From owner-svn-src-head@freebsd.org Sun Jun 28 03:37:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F68398DDA4; Sun, 28 Jun 2015 03:37:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45F311574; Sun, 28 Jun 2015 03:37:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by padev16 with SMTP id ev16so87877037pad.0; Sat, 27 Jun 2015 20:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XCC41bVdtunYEN3O8LNdRr2SCsNAP+eu7zCYe7jp0Tk=; b=qKvy2+hWj2N+REONJOeHYkgZSJB7g+ss4hdmlYExfVoqXDja7nV51dTjHnDSqZXzlY cwiPAtSZXDueqUufiOeCWzO5Ga6OSQp1S277IcILpubeHoeh0aEY4G4ZqHz5bFvKcEA7 n9JapNOZDHtpJBVG79tnQtFDwzKZASg9+mDtYAkpVwkUV4ek5VJL27Zn2fq0NB4RWEIF JJwLRUgxkE3GRA3szPg9atXLFJE9mcxzYxhfeLyD3CG/PsaYlRSmqW941nISRdLuGv/9 5aWR9pQGcF5lx+AXu3w7lMMi8wyIaMrShTavqWjeH0/dHCiQvpDyDqmQcEuo1nb1Asqd F9dQ== X-Received: by 10.70.32.164 with SMTP id k4mr18834681pdi.138.1435462645544; Sat, 27 Jun 2015 20:37:25 -0700 (PDT) Received: from [192.168.20.7] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id p9sm37886961pds.92.2015.06.27.20.37.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 27 Jun 2015 20:37:24 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r284898 - in head: . share/mk From: Garrett Cooper X-Mailer: iPhone Mail (12F70) In-Reply-To: <201506272328.t5RNSvQS063168@svn.freebsd.org> Date: Sat, 27 Jun 2015 20:37:23 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> References: <201506272328.t5RNSvQS063168@svn.freebsd.org> To: Baptiste Daroussin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 03:37:32 -0000 > On Jun 27, 2015, at 16:28, Baptiste Daroussin wrote: >=20 > Author: bapt > Date: Sat Jun 27 23:28:56 2015 > New Revision: 284898 > URL: https://svnweb.freebsd.org/changeset/base/284898 >=20 > Log: > Make all shared library a relative symlink >=20 > This makes sysroot usable for cross building, it also removes the need fo= r > _SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I have no= time > to test it) >=20 > Differential Revision: https://reviews.freebsd.org/D2920 > Submitted by: imp, adrian > Tested by: adrian Thank you!!! Now all you need to do is fix the ldscripts (lib/libc, etc) to n= ot have absolute paths.= From owner-svn-src-head@freebsd.org Sun Jun 28 05:04:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6AB298EAD3; Sun, 28 Jun 2015 05:04:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D82D11E3; Sun, 28 Jun 2015 05:04:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5S54ATb042112; Sun, 28 Jun 2015 05:04:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5S549Cv042100; Sun, 28 Jun 2015 05:04:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506280504.t5S549Cv042100@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 28 Jun 2015 05:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284901 - in head/sys: amd64/amd64 amd64/include 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 05:04:10 -0000 Author: kib Date: Sun Jun 28 05:04:08 2015 New Revision: 284901 URL: https://svnweb.freebsd.org/changeset/base/284901 Log: Remove unneeded data dependency, currently imposed by atomic_load_acq(9), on it source, for x86. Right now, atomic_load_acq() on x86 is sequentially consistent with other atomics, code ensures this by doing store/load barrier by performing locked nop on the source. Provide separate primitive __storeload_barrier(), which is implemented as the locked nop done on a cpu-private variable, and put __storeload_barrier() before load, to keep seq_cst semantic but avoid introducing false dependency on the no-modification of the source for its later use. Note that seq_cst property of x86 atomic_load_acq() is not documented and not carried by atomics implementations on other architectures, although some kernel code relies on the behaviour. This commit does not intend to change this. Reviewed by: alc Discussed with: bde Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/amd64/amd64/atomic.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/include/atomic.h head/sys/i386/i386/vm_machdep.c head/sys/i386/include/atomic.h Modified: head/sys/amd64/amd64/atomic.c ============================================================================== --- head/sys/amd64/amd64/atomic.c Sun Jun 28 03:22:26 2015 (r284900) +++ head/sys/amd64/amd64/atomic.c Sun Jun 28 05:04:08 2015 (r284901) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #undef ATOMIC_ASM /* Make atomic.h generate public functions */ +static __inline void __storeload_barrier(void); #define WANT_FUNCTIONS #define static #undef __inline Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Sun Jun 28 03:22:26 2015 (r284900) +++ head/sys/amd64/amd64/vm_machdep.c Sun Jun 28 05:04:08 2015 (r284901) @@ -93,6 +93,8 @@ _Static_assert(OFFSETOF_CURTHREAD == off "OFFSETOF_CURTHREAD does not correspond with offset of pc_curthread."); _Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb), "OFFSETOF_CURPCB does not correspond with offset of pc_curpcb."); +_Static_assert(OFFSETOF_MONITORBUF == offsetof(struct pcpu, pc_monitorbuf), + "OFFSETOF_MONINORBUF does not correspond with offset of pc_monitorbuf."); struct savefpu * get_pcb_user_save_td(struct thread *td) Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Sun Jun 28 03:22:26 2015 (r284900) +++ head/sys/amd64/include/atomic.h Sun Jun 28 05:04:08 2015 (r284901) @@ -85,7 +85,7 @@ u_long atomic_fetchadd_long(volatile u_l int atomic_testandset_int(volatile u_int *p, u_int v); int atomic_testandset_long(volatile u_long *p, u_int v); -#define ATOMIC_LOAD(TYPE, LOP) \ +#define ATOMIC_LOAD(TYPE) \ u_##TYPE atomic_load_acq_##TYPE(volatile u_##TYPE *p) #define ATOMIC_STORE(TYPE) \ void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) @@ -245,53 +245,79 @@ atomic_testandset_long(volatile u_long * * We assume that a = b will do atomic loads and stores. Due to the * IA32 memory model, a simple store guarantees release semantics. * - * However, loads may pass stores, so for atomic_load_acq we have to - * ensure a Store/Load barrier to do the load in SMP kernels. We use - * "lock cmpxchg" as recommended by the AMD Software Optimization - * Guide, and not mfence. For UP kernels, however, the cache of the - * single processor is always consistent, so we only need to take care - * of the compiler. + * However, a load may pass a store if they are performed on distinct + * addresses, so for atomic_load_acq we introduce a Store/Load barrier + * before the load in SMP kernels. We use "lock addl $0,mem", as + * recommended by the AMD Software Optimization Guide, and not mfence. + * In the kernel, we use a private per-cpu cache line as the target + * for the locked addition, to avoid introducing false data + * dependencies. In userspace, a word in the red zone on the stack + * (-8(%rsp)) is utilized. + * + * For UP kernels, however, the memory of the single processor is + * always consistent, so we only need to stop the compiler from + * reordering accesses in a way that violates the semantics of acquire + * and release. */ -#define ATOMIC_STORE(TYPE) \ -static __inline void \ -atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ -{ \ - __compiler_membar(); \ - *p = v; \ -} \ -struct __hack -#if defined(_KERNEL) && !defined(SMP) +#if defined(_KERNEL) -#define ATOMIC_LOAD(TYPE, LOP) \ -static __inline u_##TYPE \ -atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ -{ \ - u_##TYPE tmp; \ - \ - tmp = *p; \ - __compiler_membar(); \ - return (tmp); \ -} \ -struct __hack +/* + * OFFSETOF_MONITORBUF == __pcpu_offset(pc_monitorbuf). + * + * The open-coded number is used instead of the symbolic expression to + * avoid a dependency on sys/pcpu.h in machine/atomic.h consumers. + * An assertion in amd64/vm_machdep.c ensures that the value is correct. + */ +#define OFFSETOF_MONITORBUF 0x180 -#else /* !(_KERNEL && !SMP) */ +#if defined(SMP) +static __inline void +__storeload_barrier(void) +{ -#define ATOMIC_LOAD(TYPE, LOP) \ -static __inline u_##TYPE \ -atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ -{ \ - u_##TYPE res; \ - \ - __asm __volatile(MPLOCKED LOP \ - : "=a" (res), /* 0 */ \ - "+m" (*p) /* 1 */ \ - : : "memory", "cc"); \ - return (res); \ -} \ + __asm __volatile("lock; addl $0,%%gs:%0" + : "+m" (*(u_int *)OFFSETOF_MONITORBUF) : : "memory", "cc"); +} +#else /* _KERNEL && UP */ +static __inline void +__storeload_barrier(void) +{ + + __compiler_membar(); +} +#endif /* SMP */ +#else /* !_KERNEL */ +static __inline void +__storeload_barrier(void) +{ + + __asm __volatile("lock; addl $0,-8(%%rsp)" : : : "memory", "cc"); +} +#endif /* _KERNEL*/ + +#define ATOMIC_LOAD(TYPE) \ +static __inline u_##TYPE \ +atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ +{ \ + u_##TYPE res; \ + \ + __storeload_barrier(); \ + res = *p; \ + __compiler_membar(); \ + return (res); \ +} \ struct __hack -#endif /* _KERNEL && !SMP */ +#define ATOMIC_STORE(TYPE) \ +static __inline void \ +atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) \ +{ \ + \ + __compiler_membar(); \ + *p = v; \ +} \ +struct __hack #endif /* KLD_MODULE || !__GNUCLIKE_ASM */ @@ -315,20 +341,19 @@ ATOMIC_ASM(clear, long, "andq %1,%0" ATOMIC_ASM(add, long, "addq %1,%0", "ir", v); ATOMIC_ASM(subtract, long, "subq %1,%0", "ir", v); -ATOMIC_LOAD(char, "cmpxchgb %b0,%1"); -ATOMIC_LOAD(short, "cmpxchgw %w0,%1"); -ATOMIC_LOAD(int, "cmpxchgl %0,%1"); -ATOMIC_LOAD(long, "cmpxchgq %0,%1"); - -ATOMIC_STORE(char); -ATOMIC_STORE(short); -ATOMIC_STORE(int); -ATOMIC_STORE(long); +#define ATOMIC_LOADSTORE(TYPE) \ + ATOMIC_LOAD(TYPE); \ + ATOMIC_STORE(TYPE) + +ATOMIC_LOADSTORE(char); +ATOMIC_LOADSTORE(short); +ATOMIC_LOADSTORE(int); +ATOMIC_LOADSTORE(long); #undef ATOMIC_ASM #undef ATOMIC_LOAD #undef ATOMIC_STORE - +#undef ATOMIC_LOADSTORE #ifndef WANT_FUNCTIONS /* Read the current value and store a new value in the destination. */ Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Sun Jun 28 03:22:26 2015 (r284900) +++ head/sys/i386/i386/vm_machdep.c Sun Jun 28 05:04:08 2015 (r284901) @@ -111,6 +111,8 @@ _Static_assert(OFFSETOF_CURTHREAD == off "OFFSETOF_CURTHREAD does not correspond with offset of pc_curthread."); _Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb), "OFFSETOF_CURPCB does not correspond with offset of pc_curpcb."); +_Static_assert(OFFSETOF_MONITORBUF == offsetof(struct pcpu, pc_monitorbuf), + "OFFSETOF_MONINORBUF does not correspond with offset of pc_monitorbuf."); static void cpu_reset_real(void); #ifdef SMP Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Sun Jun 28 03:22:26 2015 (r284900) +++ head/sys/i386/include/atomic.h Sun Jun 28 05:04:08 2015 (r284901) @@ -87,7 +87,7 @@ int atomic_cmpset_int(volatile u_int *ds u_int atomic_fetchadd_int(volatile u_int *p, u_int v); int atomic_testandset_int(volatile u_int *p, u_int v); -#define ATOMIC_LOAD(TYPE, LOP) \ +#define ATOMIC_LOAD(TYPE) \ u_##TYPE atomic_load_acq_##TYPE(volatile u_##TYPE *p) #define ATOMIC_STORE(TYPE) \ void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) @@ -228,53 +228,78 @@ atomic_testandset_int(volatile u_int *p, * We assume that a = b will do atomic loads and stores. Due to the * IA32 memory model, a simple store guarantees release semantics. * - * However, loads may pass stores, so for atomic_load_acq we have to - * ensure a Store/Load barrier to do the load in SMP kernels. We use - * "lock cmpxchg" as recommended by the AMD Software Optimization - * Guide, and not mfence. For UP kernels, however, the cache of the - * single processor is always consistent, so we only need to take care - * of the compiler. + * However, a load may pass a store if they are performed on distinct + * addresses, so for atomic_load_acq we introduce a Store/Load barrier + * before the load in SMP kernels. We use "lock addl $0,mem", as + * recommended by the AMD Software Optimization Guide, and not mfence. + * In the kernel, we use a private per-cpu cache line as the target + * for the locked addition, to avoid introducing false data + * dependencies. In userspace, a word at the top of the stack is + * utilized. + * + * For UP kernels, however, the memory of the single processor is + * always consistent, so we only need to stop the compiler from + * reordering accesses in a way that violates the semantics of acquire + * and release. */ -#define ATOMIC_STORE(TYPE) \ -static __inline void \ -atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ -{ \ - __compiler_membar(); \ - *p = v; \ -} \ -struct __hack +#if defined(_KERNEL) -#if defined(_KERNEL) && !defined(SMP) +/* + * OFFSETOF_MONITORBUF == __pcpu_offset(pc_monitorbuf). + * + * The open-coded number is used instead of the symbolic expression to + * avoid a dependency on sys/pcpu.h in machine/atomic.h consumers. + * An assertion in i386/vm_machdep.c ensures that the value is correct. + */ +#define OFFSETOF_MONITORBUF 0x180 -#define ATOMIC_LOAD(TYPE, LOP) \ -static __inline u_##TYPE \ -atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ -{ \ - u_##TYPE tmp; \ - \ - tmp = *p; \ - __compiler_membar(); \ - return (tmp); \ -} \ -struct __hack +#if defined(SMP) +static __inline void +__storeload_barrier(void) +{ -#else /* !(_KERNEL && !SMP) */ + __asm __volatile("lock; addl $0,%%fs:%0" + : "+m" (*(u_int *)OFFSETOF_MONITORBUF) : : "memory", "cc"); +} +#else /* _KERNEL && UP */ +static __inline void +__storeload_barrier(void) +{ -#define ATOMIC_LOAD(TYPE, LOP) \ -static __inline u_##TYPE \ -atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ -{ \ - u_##TYPE res; \ - \ - __asm __volatile(MPLOCKED LOP \ - : "=a" (res), /* 0 */ \ - "+m" (*p) /* 1 */ \ - : : "memory", "cc"); \ - return (res); \ -} \ + __compiler_membar(); +} +#endif /* SMP */ +#else /* !_KERNEL */ +static __inline void +__storeload_barrier(void) +{ + + __asm __volatile("lock; addl $0,(%%esp)" : : : "memory", "cc"); +} +#endif /* _KERNEL*/ + +#define ATOMIC_LOAD(TYPE) \ +static __inline u_##TYPE \ +atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ +{ \ + u_##TYPE res; \ + \ + __storeload_barrier(); \ + res = *p; \ + __compiler_membar(); \ + return (res); \ +} \ struct __hack -#endif /* _KERNEL && !SMP */ +#define ATOMIC_STORE(TYPE) \ +static __inline void \ +atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) \ +{ \ + \ + __compiler_membar(); \ + *p = v; \ +} \ +struct __hack #ifdef _KERNEL @@ -511,19 +536,19 @@ ATOMIC_ASM(clear, long, "andl %1,%0" ATOMIC_ASM(add, long, "addl %1,%0", "ir", v); ATOMIC_ASM(subtract, long, "subl %1,%0", "ir", v); -ATOMIC_LOAD(char, "cmpxchgb %b0,%1"); -ATOMIC_LOAD(short, "cmpxchgw %w0,%1"); -ATOMIC_LOAD(int, "cmpxchgl %0,%1"); -ATOMIC_LOAD(long, "cmpxchgl %0,%1"); - -ATOMIC_STORE(char); -ATOMIC_STORE(short); -ATOMIC_STORE(int); -ATOMIC_STORE(long); +#define ATOMIC_LOADSTORE(TYPE) \ + ATOMIC_LOAD(TYPE); \ + ATOMIC_STORE(TYPE) + +ATOMIC_LOADSTORE(char); +ATOMIC_LOADSTORE(short); +ATOMIC_LOADSTORE(int); +ATOMIC_LOADSTORE(long); #undef ATOMIC_ASM #undef ATOMIC_LOAD #undef ATOMIC_STORE +#undef ATOMIC_LOADSTORE #ifndef WANT_FUNCTIONS From owner-svn-src-head@freebsd.org Sun Jun 28 05:31:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C0B798EE9C; Sun, 28 Jun 2015 05:31:48 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48A661D51; Sun, 28 Jun 2015 05:31:48 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igrv9 with SMTP id v9so23158379igr.1; Sat, 27 Jun 2015 22:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=SNF0WTsK+vpqjl+yYtl2ggf4eeA0EyZ3/TpDZl9lFXw=; b=hM4d0pHWezyZXmEC21qRU1a+XUifa+bWT47yo271WWftU6baziyNLagkHR9LbPkHWD qWnmpheNzZI16CKrDHpKhl4gAUVZAhP4eXCHjNywgYeBMfkLY14HdgbP6AoeavSgRBbz vtZVuaofp3trkVnt5w5bGJAn2YhKBKDnSFPhWJioKPs1HyOdaaZZh7WkvCVWJxvLxu+/ g6rx0h4cqamnWZWZCsLgETZLwncrUvvKWyLyaDjUtVVElpgTkGuulszItQCPueEdymZZ sW3R5AXePugWkjrJiM7jL/iaGsdlKwbktLxC/ZbyczVtl4SDcLt2JKg56WA1kH3qty0/ jEew== MIME-Version: 1.0 X-Received: by 10.107.155.74 with SMTP id d71mr12141340ioe.29.1435469507797; Sat, 27 Jun 2015 22:31:47 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Sat, 27 Jun 2015 22:31:47 -0700 (PDT) In-Reply-To: <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> Date: Sat, 27 Jun 2015 22:31:47 -0700 Message-ID: Subject: Re: svn commit: r284898 - in head: . share/mk From: Adrian Chadd To: Garrett Cooper Cc: Baptiste Daroussin , "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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 05:31:48 -0000 On 27 June 2015 at 20:37, Garrett Cooper wrote: > >> On Jun 27, 2015, at 16:28, Baptiste Daroussin wrote: >> >> Author: bapt >> Date: Sat Jun 27 23:28:56 2015 >> New Revision: 284898 >> URL: https://svnweb.freebsd.org/changeset/base/284898 >> >> Log: >> Make all shared library a relative symlink >> >> This makes sysroot usable for cross building, it also removes the need for >> _SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I have no time >> to test it) >> >> Differential Revision: https://reviews.freebsd.org/D2920 >> Submitted by: imp, adrian >> Tested by: adrian > > Thank you!!! Now all you need to do is fix the ldscripts (lib/libc, etc) to not have absolute paths. Yup! But it's baby steps. I'm looking at the netbsd gcc patches right now to see how they fixed up sysroot. It doesn't look like they fully fixed gcc sysroot behaviour. :( -a From owner-svn-src-head@freebsd.org Sun Jun 28 06:50:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC48E98F9AC; Sun, 28 Jun 2015 06:50:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pd0-x233.google.com (mail-pd0-x233.google.com [IPv6:2607:f8b0:400e:c02::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 BB9CE1D33; Sun, 28 Jun 2015 06:50:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pdcu2 with SMTP id u2so98355297pdc.3; Sat, 27 Jun 2015 23:50:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=uXYTcuE1HvML5EJVHoVTIMnoee7u8ZngtxWIiAFuFXA=; b=FMMaxugvPuG5iQVN7g3qHNYYz14QHp4zHGkQ2KGz0Qc9N9gPX5OifMkVVU+0OdYA7d 9bLxBcZ4Euz6k0y4gdBRdjdST7/lgazRPyWKydD5CuG+9ICthU5jjqTgEFmhf5fuH0mm /eHEtSLBLewmNwSTjn+mELDohITdnFkWrvWn+RVqbUgYsm3sPtkHsZcY8N09TkwkuzKi MoNo5rBWSSDmY0nHVsyKCFHwAbfTOmfszAQjEL0E7+IYnT1h1M9P2DmqzJrRGFVAumcq YrAuQ7LSKa3zQm1B5aex+VnsBHzY9fx7kWvaLGiqAcOkWxiw5dwquFWdIy3pjy+kgsq8 n4zw== X-Received: by 10.66.122.144 with SMTP id ls16mr19819831pab.47.1435474214288; Sat, 27 Jun 2015 23:50:14 -0700 (PDT) Received: from [192.168.245.140] (c-67-182-131-225.hsd1.wa.comcast.net. [67.182.131.225]) by mx.google.com with ESMTPSA id vy6sm25956280pbc.72.2015.06.27.23.50.13 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 27 Jun 2015 23:50:13 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r284898 - in head: . share/mk From: Garrett Cooper X-Mailer: iPhone Mail (12F70) In-Reply-To: Date: Sat, 27 Jun 2015 23:50:12 -0700 Cc: Baptiste Daroussin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> To: Adrian Chadd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 06:50:15 -0000 > On Jun 27, 2015, at 22:31, Adrian Chadd wrote: >=20 >> On 27 June 2015 at 20:37, Garrett Cooper wrote: >>=20 >>> On Jun 27, 2015, at 16:28, Baptiste Daroussin wrote: >>>=20 >>> Author: bapt >>> Date: Sat Jun 27 23:28:56 2015 >>> New Revision: 284898 >>> URL: https://svnweb.freebsd.org/changeset/base/284898 >>>=20 >>> Log: >>> Make all shared library a relative symlink >>>=20 >>> This makes sysroot usable for cross building, it also removes the need f= or >>> _SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I have n= o time >>> to test it) >>>=20 >>> Differential Revision: https://reviews.freebsd.org/D2920 >>> Submitted by: imp, adrian >>> Tested by: adrian >>=20 >> Thank you!!! Now all you need to do is fix the ldscripts (lib/libc, etc) t= o not have absolute paths. >=20 > Yup! But it's baby steps. >=20 > I'm looking at the netbsd gcc patches right now to see how they fixed > up sysroot. It doesn't look like they fully fixed gcc sysroot > behaviour. :( How is it broken?= From owner-svn-src-head@freebsd.org Sun Jun 28 07:13:12 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A0B998FF2B; Sun, 28 Jun 2015 07:13:12 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001: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 5503F1266; Sun, 28 Jun 2015 07:13:12 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igrv9 with SMTP id v9so23659606igr.1; Sun, 28 Jun 2015 00:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=vWiu+eXNcDGK1A0MvKFkj3EkatIoF0QrnNbgFqjXXT4=; b=g2lltKFzQjoCs0Xu2JDgVgO1XuaWDkcXdJT2p6IkZbFoVFYSPXvE52wK70wObLNdwv CtWgtyme72P//xurwZf0rz3nTNMwHktfIwGZZ66HQOh4wKEiPzA56MSud8B6kmOFp0W0 zwyAIXkun3Rf409S/sZo+uzrAVXUCJdugM57B92npIWKVFH7gm7YeqUmSNM4xn5UGkbA 1nkCRNyLodp2wRuN5VIzOuwZOT9iASPiNmL9qqm4GLOCxrr2hSGnPhVwIckiYIGqmgfG JBAKTTWNQFqm/rLEOwhGSQ0+gVSOlWRYS3JvLoD7rthF3coUdZnjj1WWwJRWzBox/tTl U8qQ== MIME-Version: 1.0 X-Received: by 10.107.11.169 with SMTP id 41mr12845019iol.8.1435475591738; Sun, 28 Jun 2015 00:13:11 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Sun, 28 Jun 2015 00:13:11 -0700 (PDT) In-Reply-To: References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> Date: Sun, 28 Jun 2015 00:13:11 -0700 Message-ID: Subject: Re: svn commit: r284898 - in head: . share/mk From: Adrian Chadd To: Garrett Cooper Cc: Baptiste Daroussin , "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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 07:13:12 -0000 On 27 June 2015 at 23:50, Garrett Cooper wrote: > >> On Jun 27, 2015, at 22:31, Adrian Chadd wrote: >> >>> On 27 June 2015 at 20:37, Garrett Cooper wrote: >>> >>>> On Jun 27, 2015, at 16:28, Baptiste Daroussin wrote: >>>> >>>> Author: bapt >>>> Date: Sat Jun 27 23:28:56 2015 >>>> New Revision: 284898 >>>> URL: https://svnweb.freebsd.org/changeset/base/284898 >>>> >>>> Log: >>>> Make all shared library a relative symlink >>>> >>>> This makes sysroot usable for cross building, it also removes the need for >>>> _SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I have no time >>>> to test it) >>>> >>>> Differential Revision: https://reviews.freebsd.org/D2920 >>>> Submitted by: imp, adrian >>>> Tested by: adrian >>> >>> Thank you!!! Now all you need to do is fix the ldscripts (lib/libc, etc) to not have absolute paths. >> >> Yup! But it's baby steps. >> >> I'm looking at the netbsd gcc patches right now to see how they fixed >> up sysroot. It doesn't look like they fully fixed gcc sysroot >> behaviour. :( > > How is it broken? ok, I figured out how to get it to work. It's not broken (this time!) The port cross gcc compiler(s) in freebsd are compiled with --without-includes, which removes /usr/include from the search path. So unless we specify it, it can't find anything in include paths. However, if you do -I/usr/include, it is an absolute path. The sysroot isn't applied to it. One must use -I=/usr/include - then the sysroot stuff gets appended correctly. So now I have dnsmasq and dropbear cross compiling successfully against a freebsd-head mips sysroot. Next up, lua and some tiny http server.. (And yes, we should also fix those linker scripts. :-) -adrian From owner-svn-src-head@freebsd.org Sun Jun 28 07:41:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BAFE98E363; Sun, 28 Jun 2015 07:41:11 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450: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 B7222115B; Sun, 28 Jun 2015 07:41:10 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wiga1 with SMTP id a1so47090423wig.0; Sun, 28 Jun 2015 00:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=uxaDodSBeEjmT1+Ba1FIvqmufOKbrJcBDYXaEx/cD4U=; b=HuWdRs9NxJV4a3+YIUhwm2je1OUXO1EVg0GvzBRlKFOlrP+ebssJVmlYNNgWpLeVHE JyeQ+2z3kQ8HaWal0xDCSLHzROEBP2c7Y25y77TuNuIZrOx27yvWWuAEKAruE8oSJsDl g0IyPpxCIiXsawTMnPupHRf/t8HzwTzE9NQad6xTMahTppDB3X05MAB3ncwkvC+NmbD2 pxr8OC+B1N2KW6k2y9ewk5kn3V/ZkGjca6nplDjfmSlAIcO4eM9Jby9jKibCqmspDptD 5tYJvP62jBbC7PLE6QJYEG9Mc0XkCCclzrW3orUxIPFHfO5MccBFdMW2YKfVJcsjqO+X UiPg== X-Received: by 10.180.91.100 with SMTP id cd4mr11645738wib.1.1435477269328; Sun, 28 Jun 2015 00:41:09 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id f8sm6228570wiy.7.2015.06.28.00.41.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2015 00:41:08 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 28 Jun 2015 09:41:06 +0200 From: Baptiste Daroussin To: Garrett Cooper Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r284898 - in head: . share/mk Message-ID: <20150628074103.GA68142@ivaldir.etoilebsd.net> References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 07:41:11 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 27, 2015 at 08:37:23PM -0700, Garrett Cooper wrote: >=20 > > On Jun 27, 2015, at 16:28, Baptiste Daroussin wrote: > >=20 > > Author: bapt > > Date: Sat Jun 27 23:28:56 2015 > > New Revision: 284898 > > URL: https://svnweb.freebsd.org/changeset/base/284898 > >=20 > > Log: > > Make all shared library a relative symlink > >=20 > > This makes sysroot usable for cross building, it also removes the need= for > > _SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I have= no time > > to test it) > >=20 > > Differential Revision: https://reviews.freebsd.org/D2920 > > Submitted by: imp, adrian > > Tested by: adrian >=20 > Thank you!!! Now all you need to do is fix the ldscripts (lib/libc, etc) = to not have absolute paths. They do not (as far as I know): cat /usr/lib/libc.so /* $FreeBSD: headlibc.ldscript 258283 2013-11-17 22:52:17Z peter $ */ GROUP ( libc.so.7 libc_nonshared.a libssp_nonshared.a ) Best regards, Bapt --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlWPpQ8ACgkQ8kTtMUmk6EyN5QCfUGqFbTY02Rojir0gt3e+uSzi 270AoMHAAzwMsqYaozwAAZMi8jgNZR0k =zFwV -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf-- From owner-svn-src-head@freebsd.org Sun Jun 28 07:46:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E72B98E4FA; Sun, 28 Jun 2015 07:46:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC2331931; Sun, 28 Jun 2015 07:46:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qkei195 with SMTP id i195so40298034qke.3; Sun, 28 Jun 2015 00:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Z7/wYe++e+1+Jr69n7GtTNOkUDRfwGuLaz15Wah6Q4Q=; b=ldZbGrBPULQxPMZ6Oq3AOxUgV++vZgH0b97nFmtNjatslZK2w0f9fIgPC5iitaoW0o Xwxip0eze+ocek2XVg4coJYGSH6PocApS/eQ+X5/j1fofKBeV/oiPF8ZGrnveSJeYfTZ VBPcFytRIvzpnn5F9Yk3NrFSbFPSdSMymp8hu/qml9VkFPRnQRUSTAXOhpoGD0WsByVR OFzeMtKHQr/tviC2ZsKVemZ0ZfQuudriaYfp6EVR8gbpeDHnKfdXsnNAejPRw0ZHL9Y2 5R56+voqp5wFVTZPVobQ7KB3SZZlxLavKcslBGj0+0RBuXGuW5yfhI2BwOrMt+j/3ubB OlAA== MIME-Version: 1.0 X-Received: by 10.55.23.17 with SMTP id i17mr20083574qkh.39.1435477594965; Sun, 28 Jun 2015 00:46:34 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Sun, 28 Jun 2015 00:46:34 -0700 (PDT) In-Reply-To: <20150628074103.GA68142@ivaldir.etoilebsd.net> References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> <20150628074103.GA68142@ivaldir.etoilebsd.net> Date: Sun, 28 Jun 2015 00:46:34 -0700 Message-ID: Subject: Re: svn commit: r284898 - in head: . share/mk From: NGie Cooper To: Baptiste Daroussin Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 07:46:36 -0000 On Sun, Jun 28, 2015 at 12:41 AM, Baptiste Daroussin wrote: > On Sat, Jun 27, 2015 at 08:37:23PM -0700, Garrett Cooper wrote: >> >> > On Jun 27, 2015, at 16:28, Baptiste Daroussin wrote: >> > >> > Author: bapt >> > Date: Sat Jun 27 23:28:56 2015 >> > New Revision: 284898 >> > URL: https://svnweb.freebsd.org/changeset/base/284898 >> > >> > Log: >> > Make all shared library a relative symlink >> > >> > This makes sysroot usable for cross building, it also removes the need for >> > _SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I have no time >> > to test it) >> > >> > Differential Revision: https://reviews.freebsd.org/D2920 >> > Submitted by: imp, adrian >> > Tested by: adrian >> >> Thank you!!! Now all you need to do is fix the ldscripts (lib/libc, etc) to not have absolute paths. > They do not (as far as I know): > cat /usr/lib/libc.so > /* $FreeBSD: headlibc.ldscript 258283 2013-11-17 22:52:17Z peter $ */ > GROUP ( libc.so.7 libc_nonshared.a libssp_nonshared.a ) Ah, I'm guessing you fixed it [by accident/on purpose?] in this commit based on comments in bsd.lib.mk related to SHLIB_LINK... Cheers! From owner-svn-src-head@freebsd.org Sun Jun 28 07:47:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74E9E98E547; Sun, 28 Jun 2015 07:47:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 325631B22; Sun, 28 Jun 2015 07:47:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qkbp125 with SMTP id p125so78755293qkb.2; Sun, 28 Jun 2015 00:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Fj3GFHrOOb4Sy0xohEKmLmLV7l4dTL32oTTycOAyIbA=; b=ohVwFO//HrXmK+Z0XN2Gjl/T6DHyS9WQG1q7IRFgUNQYlzg14WN3tKqBK/PD+28/R8 f0/AhGKT9Cu6QhAwOnvYvLfnl/NCtJQIb9+sP+YlUBxQbmG5LMXpH49bopJ0Orc+YNyX 4dokjy/yWFPHcm/U5DfkrvrX4nvh+fWjENChiZW9lb5X7JVm0FEr0hldxng6kNFYAcFv 7KUlakGnOsrTcotAmgFOR6aE50fzYEqNhPc3Eglsrp4qMGKcDmz+feDa4/gbzr5i88PN ggHWSfycc231xyGAXVsqvW3Zplpc+hP0NrdkwTv7/SAT2IuqVKvs65dyhH40jIH9J5Ly qhVg== MIME-Version: 1.0 X-Received: by 10.55.21.42 with SMTP id f42mr20173407qkh.96.1435477647485; Sun, 28 Jun 2015 00:47:27 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Sun, 28 Jun 2015 00:47:27 -0700 (PDT) In-Reply-To: References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> Date: Sun, 28 Jun 2015 00:47:27 -0700 Message-ID: Subject: Re: svn commit: r284898 - in head: . share/mk From: NGie Cooper To: Adrian Chadd Cc: Baptiste Daroussin , "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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 07:47:28 -0000 On Sun, Jun 28, 2015 at 12:13 AM, Adrian Chadd wrote: ... >> How is it broken? > > ok, I figured out how to get it to work. It's not broken (this time!) > > The port cross gcc compiler(s) in freebsd are compiled with > --without-includes, which removes /usr/include from the search path. > So unless we specify it, it can't find anything in include paths. > > However, if you do -I/usr/include, it is an absolute path. The sysroot > isn't applied to it. > > One must use -I=/usr/include - then the sysroot stuff gets appended correctly. > > So now I have dnsmasq and dropbear cross compiling successfully > against a freebsd-head mips sysroot. > > Next up, lua and some tiny http server.. > > (And yes, we should also fix those linker scripts. :-) Yes, gcc options are magic... are they being documented on the wiki somewhere? From owner-svn-src-head@freebsd.org Sun Jun 28 07:49:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F35698E5EE; Sun, 28 Jun 2015 07:49:36 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF77D1E53; Sun, 28 Jun 2015 07:49:35 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wiwl6 with SMTP id l6so74985380wiw.0; Sun, 28 Jun 2015 00:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ksUy++RpWp4DR5VHNSc8q6EFLQEnJIA7pNDQZieQk8E=; b=hNtpq98UQNxEzmQpT2mJlXctdiWyxIURxY9RBvz/Ec8UsssH65jeYqSI94eAkbcWzC 25wkWqrJgzYIFEUsg0K/DRXtcYdNjuSbUthwTz+3nb0/+RiGuXmVHpVs1Q+xueH1mKYC pb1Y/5V06YynxeT1RZHlmRJkcuIXJ8FLn8JTpj9uf+QVdHg+8QV0mJzAOxNHM+0FPdEm 0h1GMUsYFJCTN2s4iRS+hmLjvV3w7+gfjw5tJOrV8qp7MpVyCvmh0VD99cXFPuIE7Z6h oh8V/YZG1cBV75u5bRkzHMnrKZ1o9lhX+8Hz0JyUpSe2fNCL5l0hHdwfW7N+h/mo1wu0 sRgg== X-Received: by 10.180.11.225 with SMTP id t1mr11859912wib.94.1435477774507; Sun, 28 Jun 2015 00:49:34 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id y19sm6249875wia.15.2015.06.28.00.49.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2015 00:49:33 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 28 Jun 2015 09:49:31 +0200 From: Baptiste Daroussin To: NGie Cooper Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r284898 - in head: . share/mk Message-ID: <20150628074931.GB68142@ivaldir.etoilebsd.net> References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> <20150628074103.GA68142@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/WwmFnJnmDyWGHa4" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 07:49:36 -0000 --/WwmFnJnmDyWGHa4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 28, 2015 at 12:46:34AM -0700, NGie Cooper wrote: > On Sun, Jun 28, 2015 at 12:41 AM, Baptiste Daroussin w= rote: > > On Sat, Jun 27, 2015 at 08:37:23PM -0700, Garrett Cooper wrote: > >> > >> > On Jun 27, 2015, at 16:28, Baptiste Daroussin wro= te: > >> > > >> > Author: bapt > >> > Date: Sat Jun 27 23:28:56 2015 > >> > New Revision: 284898 > >> > URL: https://svnweb.freebsd.org/changeset/base/284898 > >> > > >> > Log: > >> > Make all shared library a relative symlink > >> > > >> > This makes sysroot usable for cross building, it also removes the n= eed for > >> > _SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I h= ave no time > >> > to test it) > >> > > >> > Differential Revision: https://reviews.freebsd.org/D2920 > >> > Submitted by: imp, adrian > >> > Tested by: adrian > >> > >> Thank you!!! Now all you need to do is fix the ldscripts (lib/libc, et= c) to not have absolute paths. > > They do not (as far as I know): > > cat /usr/lib/libc.so > > /* $FreeBSD: headlibc.ldscript 258283 2013-11-17 22:52:17Z peter $ */ > > GROUP ( libc.so.7 libc_nonshared.a libssp_nonshared.a ) >=20 > Ah, I'm guessing you fixed it [by accident/on purpose?] in this commit > based on comments in bsd.lib.mk related to SHLIB_LINK... >=20 > Cheers! Not at all I have this on a both where I haven't yet r284898 iirc it is like this since the beginning I do not remember seeing those ld scripts with abs= olute path. Best regards, Bapt --/WwmFnJnmDyWGHa4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlWPpwsACgkQ8kTtMUmk6ExlbwCfZy4u3ZuGm8ITqLPd8lkWEyDx ZQAAnizXqb6wUUJ0iHRU5tSAIjEu+/OG =4nRn -----END PGP SIGNATURE----- --/WwmFnJnmDyWGHa4-- From owner-svn-src-head@freebsd.org Sun Jun 28 08:44:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 347FF98F3D0; Sun, 28 Jun 2015 08:44:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E52391A93; Sun, 28 Jun 2015 08:44:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qkeo142 with SMTP id o142so79183634qke.1; Sun, 28 Jun 2015 01:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7R7yU8LMgKr+CCiQcv8A0qaIJwC5aDBbLN/L41qG9nU=; b=S91Gpin73EbKEroQBLn6e7VW7DCMiEZdFB4eZcilh6BHvuZacO0ovS90oxJu4rDdUC W/Yp+1sLQytcyR1RBR9VPYYtdT1tG2DdjDR8sCjwQy5mZMJZjfY9+kwVO6LA5nfTFZ/0 Z/bH0ebPUfLdOI+TOrJjCZJBm48OIMRS8YW7jPwj4GZBl9AaF4uutZws4ecrXacsktPO jhrH5LRSt3d5cld6Ejgk+dIdW/UHG74RanJNoVzf8SVwAwc7U2UPyjQgfm1KsyOcEvie AJuD+VkfZPEmILLRtonKKdfN8DjkPYxJ0n18CU/HlPnrx1H0jI4JKG2peF7yMinmxN6m puiw== MIME-Version: 1.0 X-Received: by 10.55.16.100 with SMTP id a97mr20994844qkh.8.1435481061910; Sun, 28 Jun 2015 01:44:21 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Sun, 28 Jun 2015 01:44:21 -0700 (PDT) In-Reply-To: <20150628074931.GB68142@ivaldir.etoilebsd.net> References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> <20150628074103.GA68142@ivaldir.etoilebsd.net> <20150628074931.GB68142@ivaldir.etoilebsd.net> Date: Sun, 28 Jun 2015 01:44:21 -0700 Message-ID: Subject: Re: svn commit: r284898 - in head: . share/mk From: NGie Cooper To: Baptiste Daroussin Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 08:44:23 -0000 On Sun, Jun 28, 2015 at 12:49 AM, Baptiste Daroussin wrote: ... > Not at all I have this on a both where I haven't yet r284898 iirc it is like > this since the beginning I do not remember seeing those ld scripts with absolute > path. $ cat /usr/lib/libc.so /* $FreeBSD$ */ GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a /usr/lib/libssp_nonshared.a ) $ what -q /boot/GENERIC.r283337+9c333ed/kernel FreeBSD 11.0-CURRENT #4 r283337+9c333ed(isilon-atf): Tue May 26 21:49:09 PDT 2015 From owner-svn-src-head@freebsd.org Sun Jun 28 08:57:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB3EB98F61B; Sun, 28 Jun 2015 08:57:19 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::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 474481624; Sun, 28 Jun 2015 08:57:19 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wgck11 with SMTP id k11so118623438wgc.0; Sun, 28 Jun 2015 01:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=CdMd60Y+LZP9+1dztXSoVuvMAAaSrJktPL2kNUDWYtI=; b=a/9OZtMo/N16KmMlgy7FGDBx4BKD1H8lRxBdbSgZv11PtiErXJ+lRjp3LQCF179Xoy wWA12Ugth9HXQxF9RZflIPqWTHuJWumW/ti3anlW9lBeEykmWo0v8fwMC3kDp4wY51tW +vO2MD9LBvU4iq0xESAbKyNF7Xp1I1a7QvqRMAOtYvQlpIGJsPNLKZNLjs7yCa/LtTnn 0+aH3M/t3rpmT1j6eka/V5c4T/QgxlJsjnBN3k72lfJBSPAR/jiVrR/75bee0r+cNv9G xNPjr6vOmRHHwYHgCLiTNVZhOZJBIEKjBVqrN+lsoT4bOZXUmLsgQHiJFEcprkT1nHvr M+cg== X-Received: by 10.180.90.112 with SMTP id bv16mr12048875wib.64.1435481837748; Sun, 28 Jun 2015 01:57:17 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id lu5sm58246754wjb.9.2015.06.28.01.57.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2015 01:57:17 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 28 Jun 2015 10:57:15 +0200 From: Baptiste Daroussin To: NGie Cooper Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r284898 - in head: . share/mk Message-ID: <20150628085714.GC68142@ivaldir.etoilebsd.net> References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> <20150628074103.GA68142@ivaldir.etoilebsd.net> <20150628074931.GB68142@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XWOWbaMNXpFDWE00" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 08:57:19 -0000 --XWOWbaMNXpFDWE00 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 28, 2015 at 01:44:21AM -0700, NGie Cooper wrote: > On Sun, Jun 28, 2015 at 12:49 AM, Baptiste Daroussin w= rote: > ... > > Not at all I have this on a both where I haven't yet r284898 iirc it is= like > > this since the beginning I do not remember seeing those ld scripts with= absolute > > path. >=20 > $ cat /usr/lib/libc.so > /* $FreeBSD$ */ > GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a /usr/lib/libssp_nonshare= d.a ) > $ what -q /boot/GENERIC.r283337+9c333ed/kernel > FreeBSD 11.0-CURRENT #4 r283337+9c333ed(isilon-atf): Tue May 26 > 21:49:09 PDT 2015 Yes you are right, I was looking at the wrong place. Best regards, Bapt --XWOWbaMNXpFDWE00 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlWPtuoACgkQ8kTtMUmk6Ezf1QCfacd7zZMtv7cqZF7mBkEa969z RKoAn2mmVUf92JObBuzDdhtPAXNrdrfS =Dy4H -----END PGP SIGNATURE----- --XWOWbaMNXpFDWE00-- From owner-svn-src-head@freebsd.org Sun Jun 28 09:03:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEE0F98D370; Sun, 28 Jun 2015 09:03:26 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC6A81C2D; Sun, 28 Jun 2015 09:03:26 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5S93QhL073204; Sun, 28 Jun 2015 09:03:26 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5S93QRq073203; Sun, 28 Jun 2015 09:03:26 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201506280903.t5S93QRq073203@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Sun, 28 Jun 2015 09:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284903 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 09:03:27 -0000 Author: matthew (ports committer) Date: Sun Jun 28 09:03:26 2015 New Revision: 284903 URL: https://svnweb.freebsd.org/changeset/base/284903 Log: Steve KArgl's commit bit taken in at his own request With hat: core-secretary Approved by: core Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Jun 28 07:44:07 2015 (r284902) +++ head/share/misc/committers-src.dot Sun Jun 28 09:03:26 2015 (r284903) @@ -61,6 +61,7 @@ jkh [label="Jordan K. Hubbard\njkh@FreeB jlemon [label="Jonathan Lemon\njlemon@FreeBSD.org\n1997/08/14\n2008/11/10"] joe [label="Josef Karthauser\njoe@FreeBSD.org\n1999/10/22\n2008/08/10"] jtc [label="J.T. Conklin\njtc@FreeBSD.org\n1993/06/12\n????/??/??"] +kargl [label="Steven G. Kargl\nkargl@FreeBSD.org\n2011/01/17\n2015/06/28"] kbyanc [label="Kelly Yancey\nkbyanc@FreeBSD.org\n2000/07/11\n2006/07/25"] keichii [label="Michael Wu\nkeichii@FreeBSD.org\n2001/03/07\n2006/04/28"] linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2006/09/30\n2008/05/04"] @@ -205,7 +206,6 @@ julian [label="Julian Elischer\njulian@F jwd [label="John De Boskey\njwd@FreeBSD.org\n2000/05/19"] kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"] kan [label="Alexander Kabaev\nkan@FreeBSD.org\n2002/07/21"] -kargl [label="Steven G. Kargl\nkargl@FreeBSD.org\n2011/01/17"] ken [label="Ken Merry\nken@FreeBSD.org\n1998/09/08"] kensmith [label="Ken Smith\nkensmith@FreeBSD.org\n2004/01/23"] kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2006/07/23"] From owner-svn-src-head@freebsd.org Sun Jun 28 09:44:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A125C98DBBC; Sun, 28 Jun 2015 09:44:59 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92AE01440; Sun, 28 Jun 2015 09:44:59 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5S9ixXq094689; Sun, 28 Jun 2015 09:44:59 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5S9ixZ1094688; Sun, 28 Jun 2015 09:44:59 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201506280944.t5S9ixZ1094688@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sun, 28 Jun 2015 09:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284909 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 09:44:59 -0000 Author: markm Date: Sun Jun 28 09:44:58 2015 New Revision: 284909 URL: https://svnweb.freebsd.org/changeset/base/284909 Log: ANSIfy the only function that uses K&R definition in this file. Modified: head/sys/kern/kern_kthread.c Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Sun Jun 28 09:41:10 2015 (r284908) +++ head/sys/kern/kern_kthread.c Sun Jun 28 09:44:58 2015 (r284909) @@ -55,8 +55,7 @@ __FBSDID("$FreeBSD$"); * to be called from SYSINIT(). */ void -kproc_start(udata) - const void *udata; +kproc_start(const void *udata) { const struct kproc_desc *kp = udata; int error; From owner-svn-src-head@freebsd.org Sun Jun 28 09:48:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7E1698DF26; Sun, 28 Jun 2015 09:48:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69F691640; Sun, 28 Jun 2015 09:48:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::e8c4:d779:5bf1:150a] (unknown [IPv6:2001:7b8:3a7:0:e8c4:d779:5bf1:150a]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 08A381DE12; Sun, 28 Jun 2015 11:48:37 +0200 (CEST) Subject: Re: svn commit: r284898 - in head: . share/mk Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/signed; boundary="Apple-Mail=_DEE26A2E-3029-4C7C-9CFF-74A01CD732C9"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5 From: Dimitry Andric In-Reply-To: <20150628085714.GC68142@ivaldir.etoilebsd.net> Date: Sun, 28 Jun 2015 11:48:48 +0200 Cc: NGie Cooper , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Message-Id: References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> <20150628074103.GA68142@ivaldir.etoilebsd.net> <20150628074931.GB68142@ivaldir.etoilebsd.net> <20150628085714.GC68142@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 09:48:47 -0000 --Apple-Mail=_DEE26A2E-3029-4C7C-9CFF-74A01CD732C9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 28 Jun 2015, at 10:57, Baptiste Daroussin wrote: >=20 > On Sun, Jun 28, 2015 at 01:44:21AM -0700, NGie Cooper wrote: >> On Sun, Jun 28, 2015 at 12:49 AM, Baptiste Daroussin = wrote: >> ... >>> Not at all I have this on a both where I haven't yet r284898 iirc it = is like >>> this since the beginning I do not remember seeing those ld scripts = with absolute >>> path. >>=20 >> $ cat /usr/lib/libc.so >> /* $FreeBSD$ */ >> GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a = /usr/lib/libssp_nonshared.a ) >> $ what -q /boot/GENERIC.r283337+9c333ed/kernel >> FreeBSD 11.0-CURRENT #4 r283337+9c333ed(isilon-atf): Tue May 26 >> 21:49:09 PDT 2015 >=20 > Yes you are right, I was looking at the wrong place. What is actually the perceived problem with having paths in those linker scripts? If you use --sysroot, the libraries are searched relative to that sysroot, right? (And yes, I know our gcc's sysroot implementation is broken. So please fix that instead. :-) -Dimitry --Apple-Mail=_DEE26A2E-3029-4C7C-9CFF-74A01CD732C9 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----- Version: GnuPG/MacGPG2 v2.0.27 iEYEARECAAYFAlWPwwMACgkQsF6jCi4glqN+7QCeIAepfZ5pdMIrcs0mAgc6yN3S ddoAoL7UrG/82PCNWt4tk5/d9rHh+UUl =YsvF -----END PGP SIGNATURE----- --Apple-Mail=_DEE26A2E-3029-4C7C-9CFF-74A01CD732C9-- From owner-svn-src-head@freebsd.org Sun Jun 28 09:55:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B40F998C07B; Sun, 28 Jun 2015 09:55:09 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::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 3F0911CA0; Sun, 28 Jun 2015 09:55:09 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wgck11 with SMTP id k11so119203591wgc.0; Sun, 28 Jun 2015 02:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=lN52cwqKJFQzZ2hq3ksfaeWuFm0VRw3YmB/E47V0Pu4=; b=t348bTL0X2pq9TT/2JCHI7otxTCgIX5SdsiLOkCPx0Un/TumRIEhxtxM5Ds26In2Ho XiyCqNDbG4RNZC5ipwnstdrSaaNYWDM0tblSaxdE/l59ycv97n7k6dK4MHzxSxNf+pup Lt35hC8w0oaKHUzxuCxnZAxoEKqfQTlJK33aV3SVehtkcxzAhqvX03JYPjjKG2nCgWdU VR3Jc/W1m0IHnsD+QLq4SfPuPSxGCWpWomDWuuulEe/OzzMGtVDPVfweFKUINU+xOWs4 zelV5DC5znZUqGP9brJqmvzA15wt+RXde9NCdHMcA7vzdTtCDWzWx+oU0FJ0I185HUU1 HoWw== X-Received: by 10.180.11.200 with SMTP id s8mr12271356wib.17.1435485307794; Sun, 28 Jun 2015 02:55:07 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id fq7sm6710297wic.5.2015.06.28.02.55.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2015 02:55:06 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 28 Jun 2015 11:55:04 +0200 From: Baptiste Daroussin To: Dimitry Andric Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , NGie Cooper Subject: Re: svn commit: r284898 - in head: . share/mk Message-ID: <20150628095504.GD68142@ivaldir.etoilebsd.net> References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> <20150628074103.GA68142@ivaldir.etoilebsd.net> <20150628074931.GB68142@ivaldir.etoilebsd.net> <20150628085714.GC68142@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W5WqUoFLvi1M7tJE" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 09:55:09 -0000 --W5WqUoFLvi1M7tJE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 28, 2015 at 11:48:48AM +0200, Dimitry Andric wrote: > On 28 Jun 2015, at 10:57, Baptiste Daroussin wrote: > >=20 > > On Sun, Jun 28, 2015 at 01:44:21AM -0700, NGie Cooper wrote: > >> On Sun, Jun 28, 2015 at 12:49 AM, Baptiste Daroussin wrote: > >> ... > >>> Not at all I have this on a both where I haven't yet r284898 iirc it = is like > >>> this since the beginning I do not remember seeing those ld scripts wi= th absolute > >>> path. > >>=20 > >> $ cat /usr/lib/libc.so > >> /* $FreeBSD$ */ > >> GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a /usr/lib/libssp_nonsh= ared.a ) > >> $ what -q /boot/GENERIC.r283337+9c333ed/kernel > >> FreeBSD 11.0-CURRENT #4 r283337+9c333ed(isilon-atf): Tue May 26 > >> 21:49:09 PDT 2015 > >=20 > > Yes you are right, I was looking at the wrong place. >=20 > What is actually the perceived problem with having paths in those linker > scripts? If you use --sysroot, the libraries are searched relative to > that sysroot, right? >=20 > (And yes, I know our gcc's sysroot implementation is broken. So please > fix that instead. :-) >=20 WHat is the point in having absolute path in the linker script? having an absolute patch (or even no path at all) will make the compiler looking in i= ts search path (and respecting sysroot). The only case where a path is needed = seems to be when the lib you want to link to is not in the search path. Am I miss= ing something? Best regards, Bapt --W5WqUoFLvi1M7tJE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlWPxHgACgkQ8kTtMUmk6EymagCfWL14CfNReVMCnVMbKzHv4vVL 2GYAniprKzNH1zhm1tQUhvsHKoOZDSZd =eEqT -----END PGP SIGNATURE----- --W5WqUoFLvi1M7tJE-- From owner-svn-src-head@freebsd.org Sun Jun 28 10:02:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CC4E98C23B; Sun, 28 Jun 2015 10:02:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com [IPv6:2607:f8b0:400d:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 573C51057; Sun, 28 Jun 2015 10:02:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qkbp125 with SMTP id p125so79699873qkb.2; Sun, 28 Jun 2015 03:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RYL13TW3B38tjHupetg/tZdK8bkIpEl3IG9OeO8ITXI=; b=bQkRx+TCbD2C5IX0s1YUwCqxuvkWnoIm8pRTZ388T9tz5ZVhwsUGNTqHhnVkaKVZ0X 0sdKjQII2VNJQ3Qw0Dlz37bduT5xKKW91jqdijSvMy/ujuvJsarEANUhDHDSJ8m0YDZC 1UViuppBZz3AvV9FkyEh/KMvd3KQZSOjgHg4awkU7jScfqghF5cfT/NLagRK7cb1fn+5 uhSpqnq6oFvaVemOp2oIlWz2BmXTQLoWHc8o83Q7zEg3pcFyWfBQhCOfmzHf1crqY9dD VR9cPvTzw94GVGhYoyPBgvsh+UU0USBcVA+xwVvKGJ5c+dzO3FbYMsaDqFRd8OIHIMG+ wf5Q== MIME-Version: 1.0 X-Received: by 10.55.16.100 with SMTP id a97mr21359402qkh.8.1435485734425; Sun, 28 Jun 2015 03:02:14 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Sun, 28 Jun 2015 03:02:14 -0700 (PDT) In-Reply-To: References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> <20150628074103.GA68142@ivaldir.etoilebsd.net> <20150628074931.GB68142@ivaldir.etoilebsd.net> <20150628085714.GC68142@ivaldir.etoilebsd.net> Date: Sun, 28 Jun 2015 03:02:14 -0700 Message-ID: Subject: Re: svn commit: r284898 - in head: . share/mk From: NGie Cooper To: Dimitry Andric Cc: Baptiste Daroussin , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 10:02:15 -0000 On Sun, Jun 28, 2015 at 2:48 AM, Dimitry Andric wrote: > On 28 Jun 2015, at 10:57, Baptiste Daroussin wrote: >> >> On Sun, Jun 28, 2015 at 01:44:21AM -0700, NGie Cooper wrote: >>> On Sun, Jun 28, 2015 at 12:49 AM, Baptiste Daroussin wrote: >>> ... >>>> Not at all I have this on a both where I haven't yet r284898 iirc it is like >>>> this since the beginning I do not remember seeing those ld scripts with absolute >>>> path. >>> >>> $ cat /usr/lib/libc.so >>> /* $FreeBSD$ */ >>> GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a /usr/lib/libssp_nonshared.a ) >>> $ what -q /boot/GENERIC.r283337+9c333ed/kernel >>> FreeBSD 11.0-CURRENT #4 r283337+9c333ed(isilon-atf): Tue May 26 >>> 21:49:09 PDT 2015 >> >> Yes you are right, I was looking at the wrong place. > > What is actually the perceived problem with having paths in those linker > scripts? If you use --sysroot, the libraries are searched relative to > that sysroot, right? > > (And yes, I know our gcc's sysroot implementation is broken. So please > fix that instead. :-) Our version of ports at $work doesn't understand --sysroot, yet. If it's fixed with --sysroot, great! This is a non-issue. If not, then this is still a problem... From owner-svn-src-head@freebsd.org Sun Jun 28 10:10:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 321B998C351; Sun, 28 Jun 2015 10:10:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B098F12F3; Sun, 28 Jun 2015 10:10:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::e8c4:d779:5bf1:150a] (unknown [IPv6:2001:7b8:3a7:0:e8c4:d779:5bf1:150a]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C6E0D1DE59; Sun, 28 Jun 2015 12:10:26 +0200 (CEST) Subject: Re: svn commit: r284898 - in head: . share/mk Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/signed; boundary="Apple-Mail=_61E8D8B5-0D61-4C54-8257-A10FE486E345"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5 From: Dimitry Andric In-Reply-To: <20150628095504.GD68142@ivaldir.etoilebsd.net> Date: Sun, 28 Jun 2015 12:10:34 +0200 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , NGie Cooper Message-Id: <73CB91C5-3A0B-466C-A169-2193B1232F0F@FreeBSD.org> References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> <20150628074103.GA68142@ivaldir.etoilebsd.net> <20150628074931.GB68142@ivaldir.etoilebsd.net> <20150628085714.GC68142@ivaldir.etoilebsd.net> <20150628095504.GD68142@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 10:10:29 -0000 --Apple-Mail=_61E8D8B5-0D61-4C54-8257-A10FE486E345 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 28 Jun 2015, at 11:55, Baptiste Daroussin wrote: >=20 > On Sun, Jun 28, 2015 at 11:48:48AM +0200, Dimitry Andric wrote: >> On 28 Jun 2015, at 10:57, Baptiste Daroussin = wrote: >>>=20 >>> On Sun, Jun 28, 2015 at 01:44:21AM -0700, NGie Cooper wrote: >>>> On Sun, Jun 28, 2015 at 12:49 AM, Baptiste Daroussin = wrote: >>>> ... >>>>> Not at all I have this on a both where I haven't yet r284898 iirc = it is like >>>>> this since the beginning I do not remember seeing those ld scripts = with absolute >>>>> path. >>>>=20 >>>> $ cat /usr/lib/libc.so >>>> /* $FreeBSD$ */ >>>> GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a = /usr/lib/libssp_nonshared.a ) >>>> $ what -q /boot/GENERIC.r283337+9c333ed/kernel >>>> FreeBSD 11.0-CURRENT #4 r283337+9c333ed(isilon-atf): Tue May 26 >>>> 21:49:09 PDT 2015 >>>=20 >>> Yes you are right, I was looking at the wrong place. >>=20 >> What is actually the perceived problem with having paths in those = linker >> scripts? If you use --sysroot, the libraries are searched relative = to >> that sysroot, right? >>=20 >> (And yes, I know our gcc's sysroot implementation is broken. So = please >> fix that instead. :-) >>=20 > WHat is the point in having absolute path in the linker script? Of course, the point is to know exactly *which* libraries you are going to link in. E.g., those with the specified paths, and not any other. > having an > absolute patch (or even no path at all) will make the compiler looking = in its > search path (and respecting sysroot). I think you meant "relative path" here? I'm not sure if relative names like ../../foo/libbar.so will work with path searches, though. > The only case where a path is needed seems > to be when the lib you want to link to is not in the search path. Am I = missing > something? You're not missing anything. Some people just seem to prefer exact paths, while others trust in search mechanisms (and the risk that the wrong library is accidentally picked up). FWIW, I don't mind removing the absolute paths in these scripts, but I was simply interested in what problems people encountered due to them. -Dimitry --Apple-Mail=_61E8D8B5-0D61-4C54-8257-A10FE486E345 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----- Version: GnuPG/MacGPG2 v2.0.27 iEYEARECAAYFAlWPyCEACgkQsF6jCi4glqMtmACgw82bQge3+sbYFGOAjmkmaM/t qRkAn1/U0rRiGmJuzI1xEVO5LaqHobMA =aVOv -----END PGP SIGNATURE----- --Apple-Mail=_61E8D8B5-0D61-4C54-8257-A10FE486E345-- From owner-svn-src-head@freebsd.org Sun Jun 28 10:51:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2269698CAD3; Sun, 28 Jun 2015 10:51:09 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1314B18F9; Sun, 28 Jun 2015 10:51:09 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5SAp8Dq030382; Sun, 28 Jun 2015 10:51:08 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5SAp8SK030381; Sun, 28 Jun 2015 10:51:08 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201506281051.t5SAp8SK030381@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sun, 28 Jun 2015 10:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284910 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 10:51:09 -0000 Author: markm Date: Sun Jun 28 10:51:08 2015 New Revision: 284910 URL: https://svnweb.freebsd.org/changeset/base/284910 Log: Ansify another function. This is the last in the file, I hope. Modified: head/sys/kern/kern_kthread.c Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Sun Jun 28 09:44:58 2015 (r284909) +++ head/sys/kern/kern_kthread.c Sun Jun 28 10:51:08 2015 (r284910) @@ -224,8 +224,7 @@ kproc_suspend_check(struct proc *p) */ void -kthread_start(udata) - const void *udata; +kthread_start(const void *udata) { const struct kthread_desc *kp = udata; int error; From owner-svn-src-head@freebsd.org Sun Jun 28 12:52:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68CD198F4AB; Sun, 28 Jun 2015 12:52:29 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59F161A01; Sun, 28 Jun 2015 12:52:29 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5SCqTPl093552; Sun, 28 Jun 2015 12:52:29 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5SCqTAd093551; Sun, 28 Jun 2015 12:52:29 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201506281252.t5SCqTAd093551@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sun, 28 Jun 2015 12:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284911 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 12:52:29 -0000 Author: markm Date: Sun Jun 28 12:52:28 2015 New Revision: 284911 URL: https://svnweb.freebsd.org/changeset/base/284911 Log: Add const to char * pointers. This breaks nothing, and means const chars can be passed with no warnings. Modified: head/sys/sys/kthread.h Modified: head/sys/sys/kthread.h ============================================================================== --- head/sys/sys/kthread.h Sun Jun 28 10:51:08 2015 (r284910) +++ head/sys/sys/kthread.h Sun Jun 28 12:52:28 2015 (r284911) @@ -37,14 +37,14 @@ * Note: global_procpp may be NULL for no global save area. */ struct kproc_desc { - char *arg0; /* arg 0 (for 'ps' listing) */ - void (*func)(void); /* "main" for kernel process */ + const char *arg0; /* arg 0 (for 'ps' listing) */ + void (*func)(void); /* "main" for kernel process */ struct proc **global_procpp; /* ptr to proc ptr save area */ }; /* A kernel thread descriptor; used to start "internal" daemons. */ struct kthread_desc { - char *arg0; /* arg 0 (for 'ps' listing) */ + const char *arg0; /* arg 0 (for 'ps' listing) */ void (*func)(void); /* "main" for kernel thread */ struct thread **global_threadpp; /* ptr to thread ptr save area */ }; From owner-svn-src-head@freebsd.org Sun Jun 28 15:10:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8CFC98F7C1; Sun, 28 Jun 2015 15:10:54 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x230.google.com (mail-ig0-x230.google.com [IPv6:2607:f8b0:4001:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 715E118FC; Sun, 28 Jun 2015 15:10:54 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igcsj18 with SMTP id sj18so62903118igc.1; Sun, 28 Jun 2015 08:10:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Og9yEUWe3i/eVdCD6RGo/y7Xfbj6K1BpQLClFu5JzlQ=; b=bJQbK/TuSyxPhPrLgNiB+5Wm+lLwRfiiId/iZR9/4c5FPsqKNF6/J8rd5ioAKwAnjF HOD7tlg91wZdCzFZ+2TUqFPo2m0pRe2O9Q63gqiss2qtA8G+qyrpk2ERe21LW6Qg+9Ej ++ErL37PVWJuXht3pcuFzaF+dIUCYcfXNEtcyo86UFuxOzGF185F3K7E82KiV4QDD9Xa 5z3qTWqsWq/RC249YlvMPD+SJ87l6gpHwF9r2UiI5jMUJZyDsOAV38Eprwoh46phpjrD S0PUlxpZ+TAp7LbiW8fKVlils4OLlfihW3MZ/s14HxZ9NDeaBcqr33XK4HTUh+aQ0SJL Nc3Q== MIME-Version: 1.0 X-Received: by 10.107.155.74 with SMTP id d71mr14486792ioe.29.1435504253926; Sun, 28 Jun 2015 08:10:53 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Sun, 28 Jun 2015 08:10:53 -0700 (PDT) In-Reply-To: References: <201506272328.t5RNSvQS063168@svn.freebsd.org> <260A448A-7195-49E6-8CCD-9F0753B61A18@gmail.com> <20150628074103.GA68142@ivaldir.etoilebsd.net> <20150628074931.GB68142@ivaldir.etoilebsd.net> <20150628085714.GC68142@ivaldir.etoilebsd.net> Date: Sun, 28 Jun 2015 08:10:53 -0700 Message-ID: Subject: Re: svn commit: r284898 - in head: . share/mk From: Adrian Chadd To: Dimitry Andric Cc: Baptiste Daroussin , NGie Cooper , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 15:10:54 -0000 I'm actively ignoring in-tree gcc and working on making sure the external toolchain and cross compiler stuff is working out okay. I'd like to eventually deorbit gcc-4.2 for MIPS and use an external toolchain (in this instance, gcc-4.9.x for now) for both building MIPS and as the compiler that will run on MIPS. Once LLVM and cross-compiling is .. better, we can use that. (But really, I'd like to see everyone doing compiler hijinx to just use the external toolchain support for testing out compilers. It'll make new CPU/board bring-up much more attractive to companies. :) -a On 28 June 2015 at 02:48, Dimitry Andric wrote: > On 28 Jun 2015, at 10:57, Baptiste Daroussin wrote: >> >> On Sun, Jun 28, 2015 at 01:44:21AM -0700, NGie Cooper wrote: >>> On Sun, Jun 28, 2015 at 12:49 AM, Baptiste Daroussin wrote: >>> ... >>>> Not at all I have this on a both where I haven't yet r284898 iirc it is like >>>> this since the beginning I do not remember seeing those ld scripts with absolute >>>> path. >>> >>> $ cat /usr/lib/libc.so >>> /* $FreeBSD$ */ >>> GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a /usr/lib/libssp_nonshared.a ) >>> $ what -q /boot/GENERIC.r283337+9c333ed/kernel >>> FreeBSD 11.0-CURRENT #4 r283337+9c333ed(isilon-atf): Tue May 26 >>> 21:49:09 PDT 2015 >> >> Yes you are right, I was looking at the wrong place. > > What is actually the perceived problem with having paths in those linker > scripts? If you use --sysroot, the libraries are searched relative to > that sysroot, right? > > (And yes, I know our gcc's sysroot implementation is broken. So please > fix that instead. :-) > > -Dimitry > From owner-svn-src-head@freebsd.org Sun Jun 28 16:43:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47B4F98F79B; Sun, 28 Jun 2015 16:43:08 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18DB51D07; Sun, 28 Jun 2015 16:43:08 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5SGh7JO009455; Sun, 28 Jun 2015 16:43:07 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5SGh7D9009454; Sun, 28 Jun 2015 16:43:07 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201506281643.t5SGh7D9009454@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Sun, 28 Jun 2015 16:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284912 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 16:43:08 -0000 Author: jmmv Date: Sun Jun 28 16:43:07 2015 New Revision: 284912 URL: https://svnweb.freebsd.org/changeset/base/284912 Log: Only initialize libedit when necessary The code path to support units conversions from the command line need not initialize neither libedit nor the history. Therefore, only do that when in interactive mode. This hides the issue reported in PR bin/201167 whereby running commands of the form 'echo "$(units ft in)"' would corrupt the terminal. The real issue causing the corruption most likely still remains somewhere. PR: bin/201167 Differential Revision: D2935 Reviewed by: eadler Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Sun Jun 28 12:52:28 2015 (r284911) +++ head/usr.bin/units/units.c Sun Jun 28 16:43:07 2015 (r284912) @@ -802,17 +802,6 @@ main(int argc, char **argv) if (!readfile) readunits(NULL); - inhistory = history_init(); - el = el_init(argv[0], stdin, stdout, stderr); - el_set(el, EL_PROMPT, &prompt); - el_set(el, EL_EDITOR, "emacs"); - el_set(el, EL_SIGNAL, 1); - el_set(el, EL_HIST, history, inhistory); - el_source(el, NULL); - history(inhistory, &ev, H_SETSIZE, 800); - if (inhistory == 0) - err(1, "Could not initialize history"); - if (cap_enter() < 0 && errno != ENOSYS) err(1, "unable to enter capability mode"); @@ -828,6 +817,17 @@ main(int argc, char **argv) showanswer(&have, &want); } else { + inhistory = history_init(); + el = el_init(argv[0], stdin, stdout, stderr); + el_set(el, EL_PROMPT, &prompt); + el_set(el, EL_EDITOR, "emacs"); + el_set(el, EL_SIGNAL, 1); + el_set(el, EL_HIST, history, inhistory); + el_source(el, NULL); + history(inhistory, &ev, H_SETSIZE, 800); + if (inhistory == 0) + err(1, "Could not initialize history"); + if (!quiet) printf("%d units, %d prefixes\n", unitcount, prefixcount); @@ -858,9 +858,10 @@ main(int argc, char **argv) completereduce(&want)); showanswer(&have, &want); } + + history_end(inhistory); + el_end(el); } - history_end(inhistory); - el_end(el); return (0); } From owner-svn-src-head@freebsd.org Sun Jun 28 19:05:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D201C98F853; Sun, 28 Jun 2015 19:05:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pd0-x234.google.com (mail-pd0-x234.google.com [IPv6:2607:f8b0:400e:c02::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99DA41ECA; Sun, 28 Jun 2015 19:05:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pdjn11 with SMTP id n11so103801951pdj.0; Sun, 28 Jun 2015 12:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=YDb5KKAycJ4U+Hhbb9YDLEMX1y+s3Ktpd7A1GinoEXg=; b=DMSDVMdjKXLwSXNBTz9pfMyOexVMtmMhDY+3gfTp9G5h4czXYf/bc2fx5kQnfXFjKy MNQ7YGXVCmNta8747Pk4COdLfmKGD+ZHsuSlH5foHVGWCsjZjYHoENW+ZBNwlHczTtHY fF+na/muNLYOg7rV8NyCDnSON/tnaVbcuvF2mxSjbmiHXQSNc3tsZx6Pnq85WCugUVac KNTnKCBK9BOPRaCahHZn4XSub4uR/lP4hOpWGCP6NYLvX7sVAKhWoEVycfsyJMkh8i23 n4FSfenS/KgmOpfPGBAWMJjn7PmAcHH6KiEVFSkKzLMD0wVTwZ0EpMcqgPgCz7ppz8Dq erHw== X-Received: by 10.66.158.65 with SMTP id ws1mr21898568pab.18.1435518336142; Sun, 28 Jun 2015 12:05:36 -0700 (PDT) Received: from ?IPv6:2601:602:8001:6c87:498a:c84e:b7b:1b16? ([2601:602:8001:6c87:498a:c84e:b7b:1b16]) by mx.google.com with ESMTPSA id b10sm39800192pdo.84.2015.06.28.12.05.35 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Jun 2015 12:05:35 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r284912 - head/usr.bin/units From: Garrett Cooper X-Mailer: iPhone Mail (12F70) In-Reply-To: <201506281643.t5SGh7D9009454@svn.freebsd.org> Date: Sun, 28 Jun 2015 12:05:34 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506281643.t5SGh7D9009454@svn.freebsd.org> To: Julio Merino X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 19:05:36 -0000 > On Jun 28, 2015, at 09:43, Julio Merino wrote: >=20 > Author: jmmv > Date: Sun Jun 28 16:43:07 2015 > New Revision: 284912 > URL: https://svnweb.freebsd.org/changeset/base/284912 >=20 > Log: > Only initialize libedit when necessary >=20 > The code path to support units conversions from the command line > need not initialize neither libedit nor the history. Therefore, only do > that when in interactive mode. >=20 > This hides the issue reported in PR bin/201167 whereby running commands > of the form 'echo "$(units ft in)"' would corrupt the terminal. The real= > issue causing the corruption most likely still remains somewhere. >=20 > PR: bin/201167 > Differential Revision: D2935 > Reviewed by: eadler Jenkins has been so messed up recently with timeouts and the like that it's h= ard to tell where things went south.. Can you please add your TERM and locale variables to the PR? I suspect that i= t might be a related issue..= From owner-svn-src-head@freebsd.org Sun Jun 28 20:32:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E9A398F566; Sun, 28 Jun 2015 20:32:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FFD51FB0; Sun, 28 Jun 2015 20:32:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5SKW49p030595; Sun, 28 Jun 2015 20:32:04 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5SKW4E7030594; Sun, 28 Jun 2015 20:32:04 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201506282032.t5SKW4E7030594@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 28 Jun 2015 20:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284913 - head/usr.sbin/dconschat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 20:32:04 -0000 Author: pfg Date: Sun Jun 28 20:32:03 2015 New Revision: 284913 URL: https://svnweb.freebsd.org/changeset/base/284913 Log: dconschat(8): Use NULL instead of 0 for the last argument in execl(3) Found while experimenting with the gcc sentinel attribute. MFC after: 3 days Modified: head/usr.sbin/dconschat/dconschat.c Modified: head/usr.sbin/dconschat/dconschat.c ============================================================================== --- head/usr.sbin/dconschat/dconschat.c Sun Jun 28 16:43:07 2015 (r284912) +++ head/usr.sbin/dconschat/dconschat.c Sun Jun 28 20:32:03 2015 (r284913) @@ -229,7 +229,7 @@ dconschat_fork_gdb(struct dcons_state *d snprintf(buf, 256, "\n[fork %s]\n", com); write(p->outfd, buf, strlen(buf)); - execl("/bin/sh", "/bin/sh", "-c", com, 0); + execl("/bin/sh", "/bin/sh", "-c", com, NULL); snprintf(buf, 256, "\n[fork failed]\n"); write(p->outfd, buf, strlen(buf)); From owner-svn-src-head@freebsd.org Sun Jun 28 20:53:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A2E298F8E3; Sun, 28 Jun 2015 20:53:37 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AE321AB1; Sun, 28 Jun 2015 20:53:37 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5SKrbZ9040512; Sun, 28 Jun 2015 20:53:37 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5SKrbjh040510; Sun, 28 Jun 2015 20:53:37 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201506282053.t5SKrbjh040510@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Sun, 28 Jun 2015 20:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284914 - head/contrib/pf/pflogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 20:53:37 -0000 Author: wblock (doc committer) Date: Sun Jun 28 20:53:36 2015 New Revision: 284914 URL: https://svnweb.freebsd.org/changeset/base/284914 Log: Fix a couple of missing lines that obscured the -p description. Submitted by: Jonathan de Boyne Pollard MFC after: 1 week Modified: head/contrib/pf/pflogd/pflogd.8 Modified: head/contrib/pf/pflogd/pflogd.8 ============================================================================== --- head/contrib/pf/pflogd/pflogd.8 Sun Jun 28 20:32:03 2015 (r284913) +++ head/contrib/pf/pflogd/pflogd.8 Sun Jun 28 20:53:36 2015 (r284914) @@ -125,9 +125,11 @@ By default, .Nm will use .Ar pflog0 . +.It Fl p Ar pidfile Writes a file containing the process ID of the program to .Pa /var/run . The file name has the form +.Ao Ar pidfile Ac Ns .pid . The default is .Ar pflogd . .It Fl s Ar snaplen From owner-svn-src-head@freebsd.org Sun Jun 28 21:06:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B505C98FCE2; Sun, 28 Jun 2015 21:06:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3E6B1580; Sun, 28 Jun 2015 21:06:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5SL6kwW046065; Sun, 28 Jun 2015 21:06:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5SL6kTN046062; Sun, 28 Jun 2015 21:06:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201506282106.t5SL6kTN046062@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 28 Jun 2015 21:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284915 - in head: share/man/man3 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 21:06:46 -0000 Author: hselasky Date: Sun Jun 28 21:06:45 2015 New Revision: 284915 URL: https://svnweb.freebsd.org/changeset/base/284915 Log: Make the system queue header file fully usable within C++ programs by adding macros to define class lists. This change is backwards compatible for all use within C and C++ programs. Only C++ programs will have added support to use the queue macros within classes. Previously the queue macros could only be used within structures. The queue.3 manual page has been updated to describe the new functionality and some alphabetic sorting has been done while at it. Differential Revision: https://reviews.freebsd.org/D2745 PR: 200827 (exp-run) MFC after: 2 weeks Modified: head/share/man/man3/Makefile head/share/man/man3/queue.3 head/sys/sys/queue.h Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Sun Jun 28 20:53:36 2015 (r284914) +++ head/share/man/man3/Makefile Sun Jun 28 21:06:45 2015 (r284915) @@ -64,13 +64,15 @@ MLINKS+= fpgetround.3 fpgetmask.3 \ MLINKS+= makedev.3 major.3 \ makedev.3 minor.3 MLINKS+= ${PTHREAD_MLINKS} -MLINKS+= queue.3 LIST_EMPTY.3 \ +MLINKS+= queue.3 LIST_CLASS_ENTRY.3 \ + queue.3 LIST_CLASS_HEAD.3 \ + queue.3 LIST_EMPTY.3 \ queue.3 LIST_ENTRY.3 \ queue.3 LIST_FIRST.3 \ queue.3 LIST_FOREACH.3 \ queue.3 LIST_FOREACH_FROM.3 \ - queue.3 LIST_FOREACH_SAFE.3 \ queue.3 LIST_FOREACH_FROM_SAFE.3 \ + queue.3 LIST_FOREACH_SAFE.3 \ queue.3 LIST_HEAD.3 \ queue.3 LIST_HEAD_INITIALIZER.3 \ queue.3 LIST_INIT.3 \ @@ -81,13 +83,15 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 LIST_PREV.3 \ queue.3 LIST_REMOVE.3 \ queue.3 LIST_SWAP.3 \ + queue.3 SLIST_CLASS_ENTRY.3 \ + queue.3 SLIST_CLASS_HEAD.3 \ queue.3 SLIST_EMPTY.3 \ queue.3 SLIST_ENTRY.3 \ queue.3 SLIST_FIRST.3 \ queue.3 SLIST_FOREACH.3 \ queue.3 SLIST_FOREACH_FROM.3 \ - queue.3 SLIST_FOREACH_SAFE.3 \ queue.3 SLIST_FOREACH_FROM_SAFE.3 \ + queue.3 SLIST_FOREACH_SAFE.3 \ queue.3 SLIST_HEAD.3 \ queue.3 SLIST_HEAD_INITIALIZER.3 \ queue.3 SLIST_INIT.3 \ @@ -98,14 +102,16 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 SLIST_REMOVE_AFTER.3 \ queue.3 SLIST_REMOVE_HEAD.3 \ queue.3 SLIST_SWAP.3 \ + queue.3 STAILQ_CLASS_ENTRY.3 \ + queue.3 STAILQ_CLASS_HEAD.3 \ queue.3 STAILQ_CONCAT.3 \ queue.3 STAILQ_EMPTY.3 \ queue.3 STAILQ_ENTRY.3 \ queue.3 STAILQ_FIRST.3 \ queue.3 STAILQ_FOREACH.3 \ queue.3 STAILQ_FOREACH_FROM.3 \ - queue.3 STAILQ_FOREACH_SAFE.3 \ queue.3 STAILQ_FOREACH_FROM_SAFE.3 \ + queue.3 STAILQ_FOREACH_SAFE.3 \ queue.3 STAILQ_HEAD.3 \ queue.3 STAILQ_HEAD_INITIALIZER.3 \ queue.3 STAILQ_INIT.3 \ @@ -118,18 +124,20 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 STAILQ_REMOVE_AFTER.3 \ queue.3 STAILQ_REMOVE_HEAD.3 \ queue.3 STAILQ_SWAP.3 \ + queue.3 TAILQ_CLASS_ENTRY.3 \ + queue.3 TAILQ_CLASS_HEAD.3 \ queue.3 TAILQ_CONCAT.3 \ queue.3 TAILQ_EMPTY.3 \ queue.3 TAILQ_ENTRY.3 \ queue.3 TAILQ_FIRST.3 \ queue.3 TAILQ_FOREACH.3 \ queue.3 TAILQ_FOREACH_FROM.3 \ + queue.3 TAILQ_FOREACH_FROM_SAFE.3 \ queue.3 TAILQ_FOREACH_REVERSE.3 \ queue.3 TAILQ_FOREACH_REVERSE_FROM.3 \ - queue.3 TAILQ_FOREACH_REVERSE_SAFE.3 \ queue.3 TAILQ_FOREACH_REVERSE_FROM_SAFE.3 \ + queue.3 TAILQ_FOREACH_REVERSE_SAFE.3 \ queue.3 TAILQ_FOREACH_SAFE.3 \ - queue.3 TAILQ_FOREACH_FROM_SAFE.3 \ queue.3 TAILQ_HEAD.3 \ queue.3 TAILQ_HEAD_INITIALIZER.3 \ queue.3 TAILQ_INIT.3 \ Modified: head/share/man/man3/queue.3 ============================================================================== --- head/share/man/man3/queue.3 Sun Jun 28 20:53:36 2015 (r284914) +++ head/share/man/man3/queue.3 Sun Jun 28 21:06:45 2015 (r284915) @@ -28,35 +28,39 @@ .\" @(#)queue.3 8.2 (Berkeley) 1/24/94 .\" $FreeBSD$ .\" -.Dd April 16, 2015 +.Dd June 24, 2015 .Dt QUEUE 3 .Os .Sh NAME +.Nm SLIST_CLASS_ENTRY , +.Nm SLIST_CLASS_HEAD , .Nm SLIST_EMPTY , .Nm SLIST_ENTRY , .Nm SLIST_FIRST , .Nm SLIST_FOREACH , .Nm SLIST_FOREACH_FROM , -.Nm SLIST_FOREACH_SAFE , .Nm SLIST_FOREACH_FROM_SAFE , +.Nm SLIST_FOREACH_SAFE , .Nm SLIST_HEAD , .Nm SLIST_HEAD_INITIALIZER , .Nm SLIST_INIT , .Nm SLIST_INSERT_AFTER , .Nm SLIST_INSERT_HEAD , .Nm SLIST_NEXT , +.Nm SLIST_REMOVE , .Nm SLIST_REMOVE_AFTER , .Nm SLIST_REMOVE_HEAD , -.Nm SLIST_REMOVE , .Nm SLIST_SWAP , +.Nm STAILQ_CLASS_ENTRY , +.Nm STAILQ_CLASS_HEAD , .Nm STAILQ_CONCAT , .Nm STAILQ_EMPTY , .Nm STAILQ_ENTRY , .Nm STAILQ_FIRST , .Nm STAILQ_FOREACH , .Nm STAILQ_FOREACH_FROM , -.Nm STAILQ_FOREACH_SAFE , .Nm STAILQ_FOREACH_FROM_SAFE , +.Nm STAILQ_FOREACH_SAFE , .Nm STAILQ_HEAD , .Nm STAILQ_HEAD_INITIALIZER , .Nm STAILQ_INIT , @@ -65,17 +69,19 @@ .Nm STAILQ_INSERT_TAIL , .Nm STAILQ_LAST , .Nm STAILQ_NEXT , +.Nm STAILQ_REMOVE , .Nm STAILQ_REMOVE_AFTER , .Nm STAILQ_REMOVE_HEAD , -.Nm STAILQ_REMOVE , .Nm STAILQ_SWAP , +.Nm LIST_CLASS_ENTRY , +.Nm LIST_CLASS_HEAD , .Nm LIST_EMPTY , .Nm LIST_ENTRY , .Nm LIST_FIRST , .Nm LIST_FOREACH , .Nm LIST_FOREACH_FROM , -.Nm LIST_FOREACH_SAFE , .Nm LIST_FOREACH_FROM_SAFE , +.Nm LIST_FOREACH_SAFE , .Nm LIST_HEAD , .Nm LIST_HEAD_INITIALIZER , .Nm LIST_INIT , @@ -86,18 +92,20 @@ .Nm LIST_PREV , .Nm LIST_REMOVE , .Nm LIST_SWAP , +.Nm TAILQ_CLASS_ENTRY , +.Nm TAILQ_CLASS_HEAD , .Nm TAILQ_CONCAT , .Nm TAILQ_EMPTY , .Nm TAILQ_ENTRY , .Nm TAILQ_FIRST , .Nm TAILQ_FOREACH , .Nm TAILQ_FOREACH_FROM , -.Nm TAILQ_FOREACH_SAFE , .Nm TAILQ_FOREACH_FROM_SAFE , .Nm TAILQ_FOREACH_REVERSE , .Nm TAILQ_FOREACH_REVERSE_FROM , -.Nm TAILQ_FOREACH_REVERSE_SAFE , .Nm TAILQ_FOREACH_REVERSE_FROM_SAFE , +.Nm TAILQ_FOREACH_REVERSE_SAFE , +.Nm TAILQ_FOREACH_SAFE , .Nm TAILQ_HEAD , .Nm TAILQ_HEAD_INITIALIZER , .Nm TAILQ_INIT , @@ -115,32 +123,36 @@ lists and tail queues .Sh SYNOPSIS .In sys/queue.h .\" +.Fn SLIST_CLASS_ENTRY "CLASSTYPE" +.Fn SLIST_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn SLIST_EMPTY "SLIST_HEAD *head" .Fn SLIST_ENTRY "TYPE" .Fn SLIST_FIRST "SLIST_HEAD *head" .Fn SLIST_FOREACH "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" .Fn SLIST_FOREACH_FROM "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" -.Fn SLIST_FOREACH_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var" .Fn SLIST_FOREACH_FROM_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var" +.Fn SLIST_FOREACH_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var" .Fn SLIST_HEAD "HEADNAME" "TYPE" .Fn SLIST_HEAD_INITIALIZER "SLIST_HEAD head" .Fn SLIST_INIT "SLIST_HEAD *head" .Fn SLIST_INSERT_AFTER "TYPE *listelm" "TYPE *elm" "SLIST_ENTRY NAME" .Fn SLIST_INSERT_HEAD "SLIST_HEAD *head" "TYPE *elm" "SLIST_ENTRY NAME" .Fn SLIST_NEXT "TYPE *elm" "SLIST_ENTRY NAME" +.Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME" .Fn SLIST_REMOVE_AFTER "TYPE *elm" "SLIST_ENTRY NAME" .Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME" -.Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME" .Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "SLIST_ENTRY NAME" .\" +.Fn STAILQ_CLASS_ENTRY "CLASSTYPE" +.Fn STAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn STAILQ_CONCAT "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" .Fn STAILQ_EMPTY "STAILQ_HEAD *head" .Fn STAILQ_ENTRY "TYPE" .Fn STAILQ_FIRST "STAILQ_HEAD *head" .Fn STAILQ_FOREACH "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" .Fn STAILQ_FOREACH_FROM "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" -.Fn STAILQ_FOREACH_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var" .Fn STAILQ_FOREACH_FROM_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var" +.Fn STAILQ_FOREACH_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var" .Fn STAILQ_HEAD "HEADNAME" "TYPE" .Fn STAILQ_HEAD_INITIALIZER "STAILQ_HEAD head" .Fn STAILQ_INIT "STAILQ_HEAD *head" @@ -149,18 +161,20 @@ lists and tail queues .Fn STAILQ_INSERT_TAIL "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_LAST "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_NEXT "TYPE *elm" "STAILQ_ENTRY NAME" +.Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME" .Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_REMOVE_HEAD "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" -.Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME" .Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "STAILQ_ENTRY NAME" .\" +.Fn LIST_CLASS_ENTRY "CLASSTYPE" +.Fn LIST_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn LIST_EMPTY "LIST_HEAD *head" .Fn LIST_ENTRY "TYPE" .Fn LIST_FIRST "LIST_HEAD *head" .Fn LIST_FOREACH "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" .Fn LIST_FOREACH_FROM "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" -.Fn LIST_FOREACH_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var" .Fn LIST_FOREACH_FROM_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var" +.Fn LIST_FOREACH_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var" .Fn LIST_HEAD "HEADNAME" "TYPE" .Fn LIST_HEAD_INITIALIZER "LIST_HEAD head" .Fn LIST_INIT "LIST_HEAD *head" @@ -172,18 +186,20 @@ lists and tail queues .Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME" .Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME" .\" +.Fn TAILQ_CLASS_ENTRY "CLASSTYPE" +.Fn TAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn TAILQ_CONCAT "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TAILQ_ENTRY NAME" .Fn TAILQ_EMPTY "TAILQ_HEAD *head" .Fn TAILQ_ENTRY "TYPE" .Fn TAILQ_FIRST "TAILQ_HEAD *head" .Fn TAILQ_FOREACH "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" .Fn TAILQ_FOREACH_FROM "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" -.Fn TAILQ_FOREACH_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var" .Fn TAILQ_FOREACH_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var" .Fn TAILQ_FOREACH_REVERSE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" .Fn TAILQ_FOREACH_REVERSE_FROM "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" -.Fn TAILQ_FOREACH_REVERSE_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var" .Fn TAILQ_FOREACH_REVERSE_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var" +.Fn TAILQ_FOREACH_REVERSE_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var" +.Fn TAILQ_FOREACH_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var" .Fn TAILQ_HEAD "HEADNAME" "TYPE" .Fn TAILQ_HEAD_INITIALIZER "TAILQ_HEAD head" .Fn TAILQ_INIT "TAILQ_HEAD *head" @@ -198,8 +214,18 @@ lists and tail queues .Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE" "TAILQ_ENTRY NAME" .\" .Sh DESCRIPTION -These macros define and operate on four types of data structures: -singly-linked lists, singly-linked tail queues, lists, and tail queues. +These macros define and operate on four types of data structures which +can be used in both C and C++ source code: +.Bl -enum -compact -offset indent +.It +Lists +.It +Singly-linked lists +.It +Singly-linked tail queues +.It +Tail queues +.El All four structures support the following functionality: .Bl -enum -compact -offset indent .It @@ -301,24 +327,39 @@ than singly-linked lists. .Pp In the macro definitions, .Fa TYPE -is the name of a user defined structure, -that must contain a field of type +is the name of a user defined structure. +The structure must contain a field called +.Fa NAME +which is of type .Li SLIST_ENTRY , .Li STAILQ_ENTRY , .Li LIST_ENTRY , or -.Li TAILQ_ENTRY , -named -.Fa NAME . +.Li TAILQ_ENTRY . +In the macro definitions, +.Fa CLASSTYPE +is the name of a user defined class. +The class must contain a field called +.Fa NAME +which is of type +.Li SLIST_CLASS_ENTRY , +.Li STAILQ_CLASS_ENTRY , +.Li LIST_CLASS_ENTRY , +or +.Li TAILQ_CLASS_ENTRY . The argument .Fa HEADNAME is the name of a user defined structure that must be declared using the macros .Li SLIST_HEAD , +.Li SLIST_CLASS_HEAD , .Li STAILQ_HEAD , +.Li STAILQ_CLASS_HEAD , .Li LIST_HEAD , +.Li LIST_CLASS_HEAD , +.Li TAILQ_HEAD , or -.Li TAILQ_HEAD . +.Li TAILQ_CLASS_HEAD . See the examples below for further explanation of how these macros are used. .Sh SINGLY-LINKED LISTS Modified: head/sys/sys/queue.h ============================================================================== --- head/sys/sys/queue.h Sun Jun 28 20:53:36 2015 (r284914) +++ head/sys/sys/queue.h Sun Jun 28 21:06:45 2015 (r284915) @@ -79,8 +79,10 @@ * * SLIST LIST STAILQ TAILQ * _HEAD + + + + + * _CLASS_HEAD + + + + * _HEAD_INITIALIZER + + + + * _ENTRY + + + + + * _CLASS_ENTRY + + + + * _INIT + + + + * _EMPTY + + + + * _FIRST + + + + @@ -143,6 +145,15 @@ struct qm_trace { #define TRASHIT(x) #endif /* QUEUE_MACRO_DEBUG */ +#ifdef __cplusplus +/* + * In C++ there can be structure lists and class lists: + */ +#define QUEUE_TYPEOF(type) type +#else +#define QUEUE_TYPEOF(type) struct type +#endif + /* * Singly-linked List declarations. */ @@ -151,6 +162,11 @@ struct name { \ struct type *slh_first; /* first element */ \ } +#define SLIST_CLASS_HEAD(name, type) \ +struct name { \ + class type *slh_first; /* first element */ \ +} + #define SLIST_HEAD_INITIALIZER(head) \ { NULL } @@ -159,6 +175,11 @@ struct { \ struct type *sle_next; /* next element */ \ } +#define SLIST_CLASS_ENTRY(type) \ +struct { \ + class type *sle_next; /* next element */ \ +} + /* * Singly-linked List functions. */ @@ -213,7 +234,7 @@ struct { \ SLIST_REMOVE_HEAD((head), field); \ } \ else { \ - struct type *curelm = SLIST_FIRST((head)); \ + QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head); \ while (SLIST_NEXT(curelm, field) != (elm)) \ curelm = SLIST_NEXT(curelm, field); \ SLIST_REMOVE_AFTER(curelm, field); \ @@ -231,7 +252,7 @@ struct { \ } while (0) #define SLIST_SWAP(head1, head2, type) do { \ - struct type *swap_first = SLIST_FIRST(head1); \ + QUEUE_TYPEOF(type) *swap_first = SLIST_FIRST(head1); \ SLIST_FIRST(head1) = SLIST_FIRST(head2); \ SLIST_FIRST(head2) = swap_first; \ } while (0) @@ -245,6 +266,12 @@ struct name { \ struct type **stqh_last;/* addr of last next element */ \ } +#define STAILQ_CLASS_HEAD(name, type) \ +struct name { \ + class type *stqh_first; /* first element */ \ + class type **stqh_last; /* addr of last next element */ \ +} + #define STAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).stqh_first } @@ -253,6 +280,11 @@ struct { \ struct type *stqe_next; /* next element */ \ } +#define STAILQ_CLASS_ENTRY(type) \ +struct { \ + class type *stqe_next; /* next element */ \ +} + /* * Singly-linked Tail queue functions. */ @@ -311,9 +343,10 @@ struct { \ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ } while (0) -#define STAILQ_LAST(head, type, field) \ - (STAILQ_EMPTY((head)) ? NULL : \ - __containerof((head)->stqh_last, struct type, field.stqe_next)) +#define STAILQ_LAST(head, type, field) \ + (STAILQ_EMPTY((head)) ? NULL : \ + __containerof((head)->stqh_last, \ + QUEUE_TYPEOF(type), field.stqe_next)) #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) @@ -323,7 +356,7 @@ struct { \ STAILQ_REMOVE_HEAD((head), field); \ } \ else { \ - struct type *curelm = STAILQ_FIRST((head)); \ + QUEUE_TYPEOF(type) *curelm = STAILQ_FIRST(head); \ while (STAILQ_NEXT(curelm, field) != (elm)) \ curelm = STAILQ_NEXT(curelm, field); \ STAILQ_REMOVE_AFTER(head, curelm, field); \ @@ -344,8 +377,8 @@ struct { \ } while (0) #define STAILQ_SWAP(head1, head2, type) do { \ - struct type *swap_first = STAILQ_FIRST(head1); \ - struct type **swap_last = (head1)->stqh_last; \ + QUEUE_TYPEOF(type) *swap_first = STAILQ_FIRST(head1); \ + QUEUE_TYPEOF(type) **swap_last = (head1)->stqh_last; \ STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \ (head1)->stqh_last = (head2)->stqh_last; \ STAILQ_FIRST(head2) = swap_first; \ @@ -365,6 +398,11 @@ struct name { \ struct type *lh_first; /* first element */ \ } +#define LIST_CLASS_HEAD(name, type) \ +struct name { \ + class type *lh_first; /* first element */ \ +} + #define LIST_HEAD_INITIALIZER(head) \ { NULL } @@ -374,6 +412,12 @@ struct { \ struct type **le_prev; /* address of previous next element */ \ } +#define LIST_CLASS_ENTRY(type) \ +struct { \ + class type *le_next; /* next element */ \ + class type **le_prev; /* address of previous next element */ \ +} + /* * List functions. */ @@ -458,9 +502,10 @@ struct { \ #define LIST_NEXT(elm, field) ((elm)->field.le_next) -#define LIST_PREV(elm, head, type, field) \ - ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \ - __containerof((elm)->field.le_prev, struct type, field.le_next)) +#define LIST_PREV(elm, head, type, field) \ + ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \ + __containerof((elm)->field.le_prev, \ + QUEUE_TYPEOF(type), field.le_next)) #define LIST_REMOVE(elm, field) do { \ QMD_SAVELINK(oldnext, (elm)->field.le_next); \ @@ -476,7 +521,7 @@ struct { \ } while (0) #define LIST_SWAP(head1, head2, type, field) do { \ - struct type *swap_tmp = LIST_FIRST((head1)); \ + QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1); \ LIST_FIRST((head1)) = LIST_FIRST((head2)); \ LIST_FIRST((head2)) = swap_tmp; \ if ((swap_tmp = LIST_FIRST((head1))) != NULL) \ @@ -495,6 +540,13 @@ struct name { \ TRACEBUF \ } +#define TAILQ_CLASS_HEAD(name, type) \ +struct name { \ + class type *tqh_first; /* first element */ \ + class type **tqh_last; /* addr of last next element */ \ + TRACEBUF \ +} + #define TAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER } @@ -505,6 +557,13 @@ struct { \ TRACEBUF \ } +#define TAILQ_CLASS_ENTRY(type) \ +struct { \ + class type *tqe_next; /* next element */ \ + class type **tqe_prev; /* address of previous next element */ \ + TRACEBUF \ +} + /* * Tail queue functions. */ @@ -675,8 +734,8 @@ struct { \ } while (0) #define TAILQ_SWAP(head1, head2, type, field) do { \ - struct type *swap_first = (head1)->tqh_first; \ - struct type **swap_last = (head1)->tqh_last; \ + QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first; \ + QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last; \ (head1)->tqh_first = (head2)->tqh_first; \ (head1)->tqh_last = (head2)->tqh_last; \ (head2)->tqh_first = swap_first; \ From owner-svn-src-head@freebsd.org Sun Jun 28 21:36:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ECCB98F25E; Sun, 28 Jun 2015 21:36:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7024D1917; Sun, 28 Jun 2015 21:36:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5SLa1E0060898; Sun, 28 Jun 2015 21:36:01 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5SLa1ZO060897; Sun, 28 Jun 2015 21:36:01 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201506282136.t5SLa1ZO060897@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 28 Jun 2015 21:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284916 - head/bin/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 21:36:01 -0000 Author: jilles Date: Sun Jun 28 21:36:00 2015 New Revision: 284916 URL: https://svnweb.freebsd.org/changeset/base/284916 Log: mv: Improve message when moving two or more files to non-directory. The message text is from cp, which has had a nicer message for this since 2007 (PR bin/50656). As with cp, the exit status changes from 64 to 1. PR: 201083 MFC after: 1 week Modified: head/bin/mv/mv.c Modified: head/bin/mv/mv.c ============================================================================== --- head/bin/mv/mv.c Sun Jun 28 21:06:45 2015 (r284915) +++ head/bin/mv/mv.c Sun Jun 28 21:36:00 2015 (r284916) @@ -122,7 +122,7 @@ main(int argc, char *argv[]) */ if (stat(argv[argc - 1], &sb) || !S_ISDIR(sb.st_mode)) { if (argc > 2) - usage(); + errx(1, "%s is not a directory", argv[argc - 1]); exit(do_move(argv[0], argv[1])); } From owner-svn-src-head@freebsd.org Mon Jun 29 00:30:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4817598FC6A; Mon, 29 Jun 2015 00:30:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39ADF1C00; Mon, 29 Jun 2015 00:30:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5T0UVXW046537; Mon, 29 Jun 2015 00:30:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5T0UVQu046518; Mon, 29 Jun 2015 00:30:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201506290030.t5T0UVQu046518@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 29 Jun 2015 00:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284917 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 00:30:31 -0000 Author: pfg Date: Mon Jun 29 00:30:30 2015 New Revision: 284917 URL: https://svnweb.freebsd.org/changeset/base/284917 Log: Add a new __sentinel attribute. The sentinel attribute was originally implemented in OpenBSD's gcc and later adopted by upstream GCC 4.0 (and clang). From the OpenBSD's gcc-local manpage: - gcc recognizes the extra attribute __sentinel__, which can be used to mark varargs function that need a NULL pointer to mark argument termination, like execl(3). This exposes latent bugs for 64-bit architectures, where a terminating 0 will expand to a 32-bit int, and not a full-fledged 64-bits pointer. While here sort the visibility attributes. Hinted-by: OpenBSD Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Jun 28 21:36:00 2015 (r284916) +++ head/sys/sys/cdefs.h Mon Jun 29 00:30:30 2015 (r284917) @@ -469,11 +469,13 @@ #endif #if __GNUC_PREREQ__(4, 0) -#define __hidden __attribute__((__visibility__("hidden"))) +#define __sentinel __attribute__((__sentinel__)) #define __exported __attribute__((__visibility__("default"))) +#define __hidden __attribute__((__visibility__("hidden"))) #else -#define __hidden +#define __sentinel #define __exported +#define __hidden #endif /* From owner-svn-src-head@freebsd.org Mon Jun 29 06:59:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B38A98E748; Mon, 29 Jun 2015 06:59:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C3CA1694; Mon, 29 Jun 2015 06:59:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5T6x9Lj034933; Mon, 29 Jun 2015 06:59:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5T6x8fP034929; Mon, 29 Jun 2015 06:59:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506290659.t5T6x8fP034929@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Jun 2015 06:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284918 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 06:59:09 -0000 Author: kib Date: Mon Jun 29 06:59:08 2015 New Revision: 284918 URL: https://svnweb.freebsd.org/changeset/base/284918 Log: Reduce code duplication. Add helper fill_based_sd(9) which creates a based user data descriptor covering whole VA. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/i386/i386/sys_machdep.c head/sys/i386/include/md_var.h Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Mon Jun 29 00:30:30 2015 (r284917) +++ head/sys/i386/i386/sys_machdep.c Mon Jun 29 06:59:08 2015 (r284918) @@ -74,6 +74,22 @@ static int i386_set_ldt_data(struct thre union descriptor *descs); static int i386_ldt_grow(struct thread *td, int len); +void +fill_based_sd(struct segment_descriptor *sdp, uint32_t base) +{ + + sdp->sd_lobase = base & 0xffffff; + sdp->sd_hibase = (base >> 24) & 0xff; + sdp->sd_lolimit = 0xffff; /* 4GB limit, wraps around */ + sdp->sd_hilimit = 0xf; + sdp->sd_type = SDT_MEMRWA; + sdp->sd_dpl = SEL_UPL; + sdp->sd_p = 1; + sdp->sd_xx = 0; + sdp->sd_def32 = 1; + sdp->sd_gran = 1; +} + #ifndef _SYS_SYSPROTO_H_ struct sysarch_args { int op; @@ -188,23 +204,14 @@ sysarch(td, uap) break; case I386_SET_FSBASE: error = copyin(uap->parms, &base, sizeof(base)); - if (!error) { + if (error == 0) { /* * Construct a descriptor and store it in the pcb for * the next context switch. Also store it in the gdt * so that the load of tf_fs into %fs will activate it * at return to userland. */ - sd.sd_lobase = base & 0xffffff; - sd.sd_hibase = (base >> 24) & 0xff; - sd.sd_lolimit = 0xffff; /* 4GB limit, wraps around */ - sd.sd_hilimit = 0xf; - sd.sd_type = SDT_MEMRWA; - sd.sd_dpl = SEL_UPL; - sd.sd_p = 1; - sd.sd_xx = 0; - sd.sd_def32 = 1; - sd.sd_gran = 1; + fill_based_sd(&sd, base); critical_enter(); td->td_pcb->pcb_fsd = sd; PCPU_GET(fsgs_gdt)[0] = sd; @@ -219,23 +226,13 @@ sysarch(td, uap) break; case I386_SET_GSBASE: error = copyin(uap->parms, &base, sizeof(base)); - if (!error) { + if (error == 0) { /* * Construct a descriptor and store it in the pcb for * the next context switch. Also store it in the gdt * because we have to do a load_gs() right now. */ - sd.sd_lobase = base & 0xffffff; - sd.sd_hibase = (base >> 24) & 0xff; - - sd.sd_lolimit = 0xffff; /* 4GB limit, wraps around */ - sd.sd_hilimit = 0xf; - sd.sd_type = SDT_MEMRWA; - sd.sd_dpl = SEL_UPL; - sd.sd_p = 1; - sd.sd_xx = 0; - sd.sd_def32 = 1; - sd.sd_gran = 1; + fill_based_sd(&sd, base); critical_enter(); td->td_pcb->pcb_gsd = sd; PCPU_GET(fsgs_gdt)[1] = sd; Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Mon Jun 29 00:30:30 2015 (r284917) +++ head/sys/i386/include/md_var.h Mon Jun 29 06:59:08 2015 (r284918) @@ -94,6 +94,7 @@ struct reg; struct fpreg; struct dbreg; struct dumperinfo; +struct segment_descriptor; void *alloc_fpusave(int flags); void bcopyb(const void *from, void *to, size_t len); @@ -114,6 +115,7 @@ void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); void finishidentcpu(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); +void fill_based_sd(struct segment_descriptor *sdp, uint32_t base); void initializecpu(void); void initializecpucache(void); void i686_pagezero(void *addr); From owner-svn-src-head@freebsd.org Mon Jun 29 07:07:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71B9098EB45; Mon, 29 Jun 2015 07:07:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55F3A1C6C; Mon, 29 Jun 2015 07:07:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5T77PZa039694; Mon, 29 Jun 2015 07:07:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5T77O3p039691; Mon, 29 Jun 2015 07:07:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506290707.t5T77O3p039691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Jun 2015 07:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284919 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 07:07:25 -0000 Author: kib Date: Mon Jun 29 07:07:24 2015 New Revision: 284919 URL: https://svnweb.freebsd.org/changeset/base/284919 Log: Add x86 PT_GETFSBASE, PT_GETGSBASE machine-depended ptrace requests to obtain the thread %fs and %gs bases. Add x86 PT_SETFSBASE and PT_SETGSBASE requests to set the bases from debuggers. The set requests, similarly to the sysarch({I386,AMD64}_SET_FSBASE), override the corresponding segment registers. The main purpose of the operations is to retrieve and modify the tcb address for debuggee. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/amd64/amd64/ptrace_machdep.c head/sys/i386/i386/ptrace_machdep.c head/sys/x86/include/ptrace.h Modified: head/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- head/sys/amd64/amd64/ptrace_machdep.c Mon Jun 29 06:59:08 2015 (r284918) +++ head/sys/amd64/amd64/ptrace_machdep.c Mon Jun 29 07:07:24 2015 (r284919) @@ -36,8 +36,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include +#include +#include static int cpu_ptrace_xstate(struct thread *td, int req, void *addr, int data) @@ -110,6 +114,20 @@ cpu_ptrace_xstate(struct thread *td, int return (error); } +static void +cpu_ptrace_setbase(struct thread *td, int req, register_t r) +{ + + if (req == PT_SETFSBASE) { + td->td_pcb->pcb_fsbase = r; + td->td_frame->tf_fs = _ufssel; + } else { + td->td_pcb->pcb_gsbase = r; + td->td_frame->tf_gs = _ugssel; + } + set_pcb_flags(td->td_pcb, PCB_FULL_IRET); +} + #ifdef COMPAT_FREEBSD32 #define PT_I386_GETXMMREGS (PT_FIRSTMACH + 0) #define PT_I386_SETXMMREGS (PT_FIRSTMACH + 1) @@ -118,6 +136,7 @@ static int cpu32_ptrace(struct thread *td, int req, void *addr, int data) { struct savefpu *fpstate; + uint32_t r; int error; switch (req) { @@ -142,6 +161,29 @@ cpu32_ptrace(struct thread *td, int req, error = cpu_ptrace_xstate(td, req, addr, data); break; + case PT_GETFSBASE: + case PT_GETGSBASE: + if (!SV_PROC_FLAG(td->td_proc, SV_ILP32)) { + error = EINVAL; + break; + } + r = req == PT_GETFSBASE ? td->td_pcb->pcb_fsbase : + td->td_pcb->pcb_gsbase; + error = copyout(&r, addr, sizeof(r)); + break; + + case PT_SETFSBASE: + case PT_SETGSBASE: + if (!SV_PROC_FLAG(td->td_proc, SV_ILP32)) { + error = EINVAL; + break; + } + error = copyin(addr, &r, sizeof(r)); + if (error != 0) + break; + cpu_ptrace_setbase(td, req, r); + break; + default: error = EINVAL; break; @@ -154,6 +196,7 @@ cpu32_ptrace(struct thread *td, int req, int cpu_ptrace(struct thread *td, int req, void *addr, int data) { + register_t *r, rv; int error; #ifdef COMPAT_FREEBSD32 @@ -176,6 +219,25 @@ cpu_ptrace(struct thread *td, int req, v error = cpu_ptrace_xstate(td, req, addr, data); break; + case PT_GETFSBASE: + case PT_GETGSBASE: + r = req == PT_GETFSBASE ? &td->td_pcb->pcb_fsbase : + &td->td_pcb->pcb_gsbase; + error = copyout(r, addr, sizeof(*r)); + break; + + case PT_SETFSBASE: + case PT_SETGSBASE: + error = copyin(addr, &rv, sizeof(rv)); + if (error != 0) + break; + if (rv >= VM_MAXUSER_ADDRESS) { + error = EINVAL; + break; + } + cpu_ptrace_setbase(td, req, rv); + break; + default: error = EINVAL; break; Modified: head/sys/i386/i386/ptrace_machdep.c ============================================================================== --- head/sys/i386/i386/ptrace_machdep.c Mon Jun 29 06:59:08 2015 (r284918) +++ head/sys/i386/i386/ptrace_machdep.c Mon Jun 29 07:07:24 2015 (r284919) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -115,8 +116,8 @@ cpu_ptrace_xstate(struct thread *td, int } #endif -int -cpu_ptrace(struct thread *td, int req, void *addr, int data) +static int +cpu_ptrace_xmm(struct thread *td, int req, void *addr, int data) { #ifdef CPU_ENABLE_SSE struct savexmm *fpstate; @@ -155,3 +156,51 @@ cpu_ptrace(struct thread *td, int req, v return (EINVAL); #endif } + +int +cpu_ptrace(struct thread *td, int req, void *addr, int data) +{ + struct segment_descriptor *sdp, sd; + register_t r; + int error; + + switch (req) { + case PT_GETXMMREGS: + case PT_SETXMMREGS: + case PT_GETXSTATE_OLD: + case PT_SETXSTATE_OLD: + case PT_GETXSTATE_INFO: + case PT_GETXSTATE: + case PT_SETXSTATE: + error = cpu_ptrace_xmm(td, req, addr, data); + break; + + case PT_GETFSBASE: + case PT_GETGSBASE: + sdp = req == PT_GETFSBASE ? &td->td_pcb->pcb_fsd : + &td->td_pcb->pcb_gsd; + r = sdp->sd_hibase << 24 | sdp->sd_lobase; + error = copyout(&r, addr, sizeof(r)); + break; + + case PT_SETFSBASE: + case PT_SETGSBASE: + error = copyin(addr, &r, sizeof(r)); + if (error != 0) + break; + fill_based_sd(&sd, r); + if (req == PT_SETFSBASE) { + td->td_pcb->pcb_fsd = sd; + td->td_frame->tf_fs = GSEL(GUFS_SEL, SEL_UPL); + } else { + td->td_pcb->pcb_gsd = sd; + td->td_pcb->pcb_gs = GSEL(GUGS_SEL, SEL_UPL); + } + break; + + default: + return (EINVAL); + } + + return (error); +} Modified: head/sys/x86/include/ptrace.h ============================================================================== --- head/sys/x86/include/ptrace.h Mon Jun 29 06:59:08 2015 (r284918) +++ head/sys/x86/include/ptrace.h Mon Jun 29 07:07:24 2015 (r284919) @@ -51,6 +51,10 @@ #define PT_GETXSTATE_INFO (PT_FIRSTMACH + 4) #define PT_GETXSTATE (PT_FIRSTMACH + 5) #define PT_SETXSTATE (PT_FIRSTMACH + 6) +#define PT_GETFSBASE (PT_FIRSTMACH + 7) +#define PT_SETFSBASE (PT_FIRSTMACH + 8) +#define PT_GETGSBASE (PT_FIRSTMACH + 9) +#define PT_SETGSBASE (PT_FIRSTMACH + 10) /* Argument structure for PT_GETXSTATE_INFO. */ struct ptrace_xstate_info { From owner-svn-src-head@freebsd.org Mon Jun 29 07:43:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0B1198F4A5; Mon, 29 Jun 2015 07:43:10 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91FCE12EC; Mon, 29 Jun 2015 07:43:10 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5T7hAq2059034; Mon, 29 Jun 2015 07:43:10 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5T7hA7S059033; Mon, 29 Jun 2015 07:43:10 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201506290743.t5T7hA7S059033@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Mon, 29 Jun 2015 07:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284920 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 07:43:10 -0000 Author: julian Date: Mon Jun 29 07:43:09 2015 New Revision: 284920 URL: https://svnweb.freebsd.org/changeset/base/284920 Log: Slight tidy up of comments before MFC MFC after: 2 days Modified: head/etc/rc.firewall Modified: head/etc/rc.firewall ============================================================================== --- head/etc/rc.firewall Mon Jun 29 07:07:24 2015 (r284919) +++ head/etc/rc.firewall Mon Jun 29 07:43:09 2015 (r284920) @@ -291,14 +291,14 @@ case ${firewall_type} in fi fi - # define stuff we should never send out or receive in + # Define stuff we should never send out or receive in. # Stop RFC1918 nets on the outside interface ${fwcmd} table ${BAD_ADDR_TBL} flush ${fwcmd} table ${BAD_ADDR_TBL} add 10.0.0.0/8 ${fwcmd} table ${BAD_ADDR_TBL} add 172.16.0.0/12 ${fwcmd} table ${BAD_ADDR_TBL} add 192.168.0.0/16 - # Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1, + # And stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1, # DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E) # on the outside interface ${fwcmd} table ${BAD_ADDR_TBL} add 0.0.0.0/8 From owner-svn-src-head@freebsd.org Mon Jun 29 07:53:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9522898F7D6; Mon, 29 Jun 2015 07:53:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C9291BBF; Mon, 29 Jun 2015 07:53:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5T7rjJO064207; Mon, 29 Jun 2015 07:53:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5T7riq6064204; Mon, 29 Jun 2015 07:53:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506290753.t5T7riq6064204@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Jun 2015 07:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284921 - in head/sys/amd64: amd64 include linux32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 07:53:45 -0000 Author: kib Date: Mon Jun 29 07:53:44 2015 New Revision: 284921 URL: https://svnweb.freebsd.org/changeset/base/284921 Log: pcb_gs32sd is unused for long time, remove it. Keep the padding in pcb. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/amd64/amd64/genassym.c head/sys/amd64/include/pcb.h head/sys/amd64/linux32/linux32_machdep.c Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Mon Jun 29 07:43:09 2015 (r284920) +++ head/sys/amd64/amd64/genassym.c Mon Jun 29 07:53:44 2015 (r284921) @@ -146,7 +146,6 @@ ASSYM(PCB_LDT, offsetof(struct pcb, pcb_ ASSYM(PCB_TR, offsetof(struct pcb, pcb_tr)); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); -ASSYM(PCB_GS32SD, offsetof(struct pcb, pcb_gs32sd)); ASSYM(PCB_TSSP, offsetof(struct pcb, pcb_tssp)); ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save)); ASSYM(PCB_EFER, offsetof(struct pcb, pcb_efer)); Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Mon Jun 29 07:43:09 2015 (r284920) +++ head/sys/amd64/include/pcb.h Mon Jun 29 07:53:44 2015 (r284921) @@ -85,8 +85,7 @@ struct pcb { /* copyin/out fault recovery */ caddr_t pcb_onfault; - /* 32-bit segment descriptor */ - struct user_segment_descriptor pcb_gs32sd; + uint64_t pcb_pad0; /* local tss, with i/o bitmap; NULL for common */ struct amd64tss *pcb_tssp; Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Mon Jun 29 07:43:09 2015 (r284920) +++ head/sys/amd64/linux32/linux32_machdep.c Mon Jun 29 07:53:44 2015 (r284921) @@ -426,7 +426,6 @@ linux_set_cloned_tls(struct thread *td, #endif pcb = td->td_pcb; pcb->pcb_gsbase = (register_t)info.base_addr; -/* XXXKIB pcb->pcb_gs32sd = sd; */ td->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL); set_pcb_flags(pcb, PCB_32BIT); } From owner-svn-src-head@freebsd.org Mon Jun 29 08:50:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 782FD98D3FD; Mon, 29 Jun 2015 08:50:26 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 092EC1866; Mon, 29 Jun 2015 08:50:26 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from [130.235.5.34] ([130.235.5.34]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0Mefy0-1ZOzM63R8K-00OHSe; Mon, 29 Jun 2015 10:50:14 +0200 Message-ID: <559105A1.5060803@FreeBSD.org> Date: Mon, 29 Jun 2015 10:45:21 +0200 From: Christian Brueffer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284893 - in head/release: . tools References: <201506272039.t5RKdEC9078999@svn.freebsd.org> In-Reply-To: <201506272039.t5RKdEC9078999@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:n0nD08R56Ud0d44CUsXlJ1RYZMgyGoRtyEqlbHj0rHDnayUxTnL zpr+UwF2Qa5D+8mB+R1vdGCyI+q+AJQBOsVmSDfXfo6zwnQPkzXv2rkfshL4Vu183ZeHjT2 ofr9ds/PNPVRtrhW/b2z5p1DOz01hyOyqd8vOqe2k3Ctfychxc74SImukVt6gleYRp0RB0O 2xF0DaOLYHq9rFhYIjzDw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Ca+Ude2WmtI=:19Jd7ovoLiL4UY6EZJ88O5 cMoWV629AA1RjCncGlwLkj3r5VmNKWOAPKIz/U5Lj9BOS1s6T/3HQnpqq3afOjRq6c7KYZNhh ZsI1TvLDD9AUE0dT7hwT17DXxa1LFJc4lH09qQVRj21HXiOUrt2B1If5JU/K7e7fnoS0k5YFw aXccqwkh3j05N6EsSteUNLHrVG8MgR7ug633s1AyPthzqGS0UaSbExyJUu2UiO+d4j3XmgRre 0aXa7/8knT4xZM3SkbTz6wqkwP5bvNj+YmvIPtS7ovtr/zz5McIVlM8JYwIAJ3q2SkBl07VYs t0RQ8ZVB9Gh4NHjmLoPCJ6U1VnK8fqKrMcD8A5pbefkn0PJAG3NehkVPCcmt5Y6vVg5odWd4v j9Oe/DKD+AH4xDbapUG0PeTQ5wviXj3L0JcFhpkI18VujoVHTKVoICEfy5Qq5rYYxxx5LPyex GK5VDG7ECpsDli+nigGHMllvEf8zkrx0UdnKv+bzCaTJ8Wj3KHDZkEqko7qBUYgnSehTKEv6w jlBn1BkWtJSv8W5fNtZvj96TcOk+267r4AffpcbTLwXC6reTNziQ34pwmgblMvITBO7LHiWLP 3SxEoHFrnM5xpSJK68xSfoWmRu/sG9voQ3wROdfztIhDzBGcewlhbsR27LH6p+ozAJh+XQ41z gozc81rdpEkPJuP+qnarDUDR1S0vyGLxSZIVg4a025bh4SQ== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 08:50:26 -0000 On 2015-06-27 22:39, Brad Davis wrote: > Author: brd (doc,ports committer) > Date: Sat Jun 27 20:39:13 2015 > New Revision: 284893 > URL: https://svnweb.freebsd.org/changeset/base/284893 > > Log: > Add initial support for building Vagrant images for VMWare. Next steps will be adding Virtualbox support and uploading to Hashicorp Atlas for others to consume. > > Approved by: re (gjb) > Yay, great work! Chris From owner-svn-src-head@freebsd.org Mon Jun 29 09:58:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 837E298F053; Mon, 29 Jun 2015 09:58:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 533AA2DF1; Mon, 29 Jun 2015 09:58:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5T9wfY8024694; Mon, 29 Jun 2015 09:58:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5T9weY9024691; Mon, 29 Jun 2015 09:58:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506290958.t5T9weY9024691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Jun 2015 09:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284922 - in head/sys: amd64/include 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 09:58:41 -0000 Author: kib Date: Mon Jun 29 09:58:40 2015 New Revision: 284922 URL: https://svnweb.freebsd.org/changeset/base/284922 Log: Add a comment about too strong semantic of atomic_load_acq() on x86. Submitted by: bde MFC after: 2 weeks Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Mon Jun 29 07:53:44 2015 (r284921) +++ head/sys/amd64/include/atomic.h Mon Jun 29 09:58:40 2015 (r284922) @@ -296,6 +296,15 @@ __storeload_barrier(void) } #endif /* _KERNEL*/ +/* + * C11-standard acq/rel semantics only apply when the variable in the + * call is the same for acq as it is for rel. However, our previous + * (x86) implementations provided much stronger ordering than required + * (essentially what is called seq_cst order in C11). This + * implementation provides the historical strong ordering since some + * callers depend on it. + */ + #define ATOMIC_LOAD(TYPE) \ static __inline u_##TYPE \ atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Mon Jun 29 07:53:44 2015 (r284921) +++ head/sys/i386/include/atomic.h Mon Jun 29 09:58:40 2015 (r284922) @@ -278,6 +278,15 @@ __storeload_barrier(void) } #endif /* _KERNEL*/ +/* + * C11-standard acq/rel semantics only apply when the variable in the + * call is the same for acq as it is for rel. However, our previous + * (x86) implementations provided much stronger ordering than required + * (essentially what is called seq_cst order in C11). This + * implementation provides the historical strong ordering since some + * callers depend on it. + */ + #define ATOMIC_LOAD(TYPE) \ static __inline u_##TYPE \ atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ From owner-svn-src-head@freebsd.org Mon Jun 29 10:31:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D84E98F03B; Mon, 29 Jun 2015 10:31:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AE68115B; Mon, 29 Jun 2015 10:31:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TAVDNl042390; Mon, 29 Jun 2015 10:31:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5TAVDt7042389; Mon, 29 Jun 2015 10:31:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506291031.t5TAVDt7042389@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Jun 2015 10:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284923 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 10:31:13 -0000 Author: kib Date: Mon Jun 29 10:31:12 2015 New Revision: 284923 URL: https://svnweb.freebsd.org/changeset/base/284923 Log: Remove sv_sigtbl handling from the arm64 sendsig(). There is no ABI emulators on arm64. Reviewed by: andrew Review: https://reviews.freebsd.org/D2889 Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Mon Jun 29 09:58:40 2015 (r284922) +++ head/sys/arm64/arm64/machdep.c Mon Jun 29 10:31:12 2015 (r284923) @@ -537,10 +537,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigexit(td, SIGILL); } - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - tf->tf_x[0]= sig; tf->tf_x[1] = (register_t)&fp->sf_si; tf->tf_x[2] = (register_t)&fp->sf_uc; From owner-svn-src-head@freebsd.org Mon Jun 29 10:33:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A51BC98F072; Mon, 29 Jun 2015 10:33:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96877150C; Mon, 29 Jun 2015 10:33:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TAX5Wn043837; Mon, 29 Jun 2015 10:33:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5TAX5AZ043836; Mon, 29 Jun 2015 10:33:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506291033.t5TAX5AZ043836@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Jun 2015 10:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284924 - head/sys/compat/svr4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 10:33:05 -0000 Author: kib Date: Mon Jun 29 10:33:04 2015 New Revision: 284924 URL: https://svnweb.freebsd.org/changeset/base/284924 Log: svr4 emulator has custom sendsig() implementation, it does not use sv_sigtbl. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/svr4/svr4_sysvec.c Modified: head/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- head/sys/compat/svr4/svr4_sysvec.c Mon Jun 29 10:31:12 2015 (r284923) +++ head/sys/compat/svr4/svr4_sysvec.c Mon Jun 29 10:33:04 2015 (r284924) @@ -167,8 +167,8 @@ struct sysentvec svr4_sysvec = { .sv_size = SVR4_SYS_MAXSYSCALL, .sv_table = svr4_sysent, .sv_mask = 0xff, - .sv_sigsize = SVR4_NSIG-1, /* NB: signal trans table indexed with signno-1 */ - .sv_sigtbl = bsd_to_svr4_sig+1, + .sv_sigsize = 0, + .sv_sigtbl = NULL, .sv_errsize = ELAST, /* ELAST */ .sv_errtbl = bsd_to_svr4_errno, .sv_transtrap = NULL, From owner-svn-src-head@freebsd.org Mon Jun 29 10:35:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 031C298F0B0; Mon, 29 Jun 2015 10:35:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E79321807; Mon, 29 Jun 2015 10:35:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TAZ1TL044162; Mon, 29 Jun 2015 10:35:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5TAZ18I044157; Mon, 29 Jun 2015 10:35:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506291035.t5TAZ18I044157@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Jun 2015 10:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284925 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 10:35:02 -0000 Author: kib Date: Mon Jun 29 10:35:00 2015 New Revision: 284925 URL: https://svnweb.freebsd.org/changeset/base/284925 Log: Move CS_SECURE() and EFL_SECURE() macros to the machine/frame.h. They are useful for most implementations of sendsig(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/machdep.c head/sys/i386/include/frame.h Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Jun 29 10:33:04 2015 (r284924) +++ head/sys/i386/i386/machdep.c Mon Jun 29 10:35:00 2015 (r284925) @@ -166,9 +166,6 @@ CTASSERT(offsetof(struct pcpu, pc_curthr extern register_t init386(int first); extern void dblfault_handler(void); -#define CS_SECURE(cs) (ISPL(cs) == SEL_UPL) -#define EFL_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) - #if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) #define CPU_ENABLE_SSE #endif Modified: head/sys/i386/include/frame.h ============================================================================== --- head/sys/i386/include/frame.h Mon Jun 29 10:33:04 2015 (r284924) +++ head/sys/i386/include/frame.h Mon Jun 29 10:35:00 2015 (r284925) @@ -4,3 +4,11 @@ /* $FreeBSD$ */ #include + +#ifndef __I386_FRAME_H__ +#define __i386_FRAME_H__ + +#define CS_SECURE(cs) (ISPL(cs) == SEL_UPL) +#define EFL_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) + +#endif From owner-svn-src-head@freebsd.org Mon Jun 29 12:06:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C5F098EAB0; Mon, 29 Jun 2015 12:06:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEE0721F0; Mon, 29 Jun 2015 12:06:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TC6bul088734; Mon, 29 Jun 2015 12:06:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5TC6b2w088731; Mon, 29 Jun 2015 12:06:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506291206.t5TC6b2w088731@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Jun 2015 12:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284926 - in head/sys/i386: i386 include isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 12:06:38 -0000 Author: kib Date: Mon Jun 29 12:06:36 2015 New Revision: 284926 URL: https://svnweb.freebsd.org/changeset/base/284926 Log: Provide npx_get_fsave(9) and npx_set_fsave(9) functions to obtain and restore the FPU state from the format of machine FSAVE area. The intended use is for ABI emulators to provide FSAVE-formatted FPU state to usermode requiring it, while kernel could use FXSAVE due to XMM/XSAVE. The core functionality to convert from/to FXSAVE format is shared with the fill_fpregs_xmm() and set_fpregs_xmm(). Move the later functions to npx.c and rename them to npx_fill_fpregs_xmm() and npx_set_fpregs_xmm(). They differ from nptx_get/set_fsave(9) since our mcontext contains padding to be zeroed or ignored. fill_fpregs() and set_fpregs() could be converted to use the new interface, but there are small differences to handle. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/machdep.c head/sys/i386/include/npx.h head/sys/i386/isa/npx.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Jun 29 10:35:00 2015 (r284925) +++ head/sys/i386/i386/machdep.c Mon Jun 29 12:06:36 2015 (r284926) @@ -176,10 +176,6 @@ static void get_fpcontext(struct thread char *xfpusave, size_t xfpusave_len); static int set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate, size_t xfpustate_len); -#ifdef CPU_ENABLE_SSE -static void set_fpregs_xmm(struct save87 *, struct savexmm *); -static void fill_fpregs_xmm(struct savexmm *, struct save87 *); -#endif /* CPU_ENABLE_SSE */ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); /* Intel ICH registers */ @@ -2952,58 +2948,6 @@ set_regs(struct thread *td, struct reg * return (0); } -#ifdef CPU_ENABLE_SSE -static void -fill_fpregs_xmm(sv_xmm, sv_87) - struct savexmm *sv_xmm; - struct save87 *sv_87; -{ - register struct env87 *penv_87 = &sv_87->sv_env; - register struct envxmm *penv_xmm = &sv_xmm->sv_env; - int i; - - bzero(sv_87, sizeof(*sv_87)); - - /* FPU control/status */ - penv_87->en_cw = penv_xmm->en_cw; - penv_87->en_sw = penv_xmm->en_sw; - penv_87->en_tw = penv_xmm->en_tw; - penv_87->en_fip = penv_xmm->en_fip; - penv_87->en_fcs = penv_xmm->en_fcs; - penv_87->en_opcode = penv_xmm->en_opcode; - penv_87->en_foo = penv_xmm->en_foo; - penv_87->en_fos = penv_xmm->en_fos; - - /* FPU registers */ - for (i = 0; i < 8; ++i) - sv_87->sv_ac[i] = sv_xmm->sv_fp[i].fp_acc; -} - -static void -set_fpregs_xmm(sv_87, sv_xmm) - struct save87 *sv_87; - struct savexmm *sv_xmm; -{ - register struct env87 *penv_87 = &sv_87->sv_env; - register struct envxmm *penv_xmm = &sv_xmm->sv_env; - int i; - - /* FPU control/status */ - penv_xmm->en_cw = penv_87->en_cw; - penv_xmm->en_sw = penv_87->en_sw; - penv_xmm->en_tw = penv_87->en_tw; - penv_xmm->en_fip = penv_87->en_fip; - penv_xmm->en_fcs = penv_87->en_fcs; - penv_xmm->en_opcode = penv_87->en_opcode; - penv_xmm->en_foo = penv_87->en_foo; - penv_xmm->en_fos = penv_87->en_fos; - - /* FPU registers */ - for (i = 0; i < 8; ++i) - sv_xmm->sv_fp[i].fp_acc = sv_87->sv_ac[i]; -} -#endif /* CPU_ENABLE_SSE */ - int fill_fpregs(struct thread *td, struct fpreg *fpregs) { @@ -3018,7 +2962,7 @@ fill_fpregs(struct thread *td, struct fp #endif #ifdef CPU_ENABLE_SSE if (cpu_fxsr) - fill_fpregs_xmm(&get_pcb_user_save_td(td)->sv_xmm, + npx_fill_fpregs_xmm(&get_pcb_user_save_td(td)->sv_xmm, (struct save87 *)fpregs); else #endif /* CPU_ENABLE_SSE */ @@ -3033,7 +2977,7 @@ set_fpregs(struct thread *td, struct fpr #ifdef CPU_ENABLE_SSE if (cpu_fxsr) - set_fpregs_xmm((struct save87 *)fpregs, + npx_set_fpregs_xmm((struct save87 *)fpregs, &get_pcb_user_save_td(td)->sv_xmm); else #endif /* CPU_ENABLE_SSE */ Modified: head/sys/i386/include/npx.h ============================================================================== --- head/sys/i386/include/npx.h Mon Jun 29 10:35:00 2015 (r284925) +++ head/sys/i386/include/npx.h Mon Jun 29 12:06:36 2015 (r284926) @@ -67,6 +67,11 @@ void npxsuspend(union savefpu *addr); int npxtrap_x87(void); int npxtrap_sse(void); void npxuserinited(struct thread *); +void npx_get_fsave(void *); +int npx_set_fsave(void *); +void npx_fill_fpregs_xmm(struct savexmm *, struct save87 *); +void npx_set_fpregs_xmm(struct save87 *, struct savexmm *); + struct fpu_kern_ctx *fpu_kern_alloc_ctx(u_int flags); void fpu_kern_free_ctx(struct fpu_kern_ctx *ctx); int fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx, Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Mon Jun 29 10:35:00 2015 (r284925) +++ head/sys/i386/isa/npx.c Mon Jun 29 12:06:36 2015 (r284926) @@ -1160,6 +1160,102 @@ fpusave(addr) } #ifdef CPU_ENABLE_SSE +static void +npx_fill_fpregs_xmm1(struct savexmm *sv_xmm, struct save87 *sv_87) +{ + struct env87 *penv_87; + struct envxmm *penv_xmm; + int i; + + penv_87 = &sv_87->sv_env; + penv_xmm = &sv_xmm->sv_env; + + /* FPU control/status */ + penv_87->en_cw = penv_xmm->en_cw; + penv_87->en_sw = penv_xmm->en_sw; + penv_87->en_tw = penv_xmm->en_tw; + penv_87->en_fip = penv_xmm->en_fip; + penv_87->en_fcs = penv_xmm->en_fcs; + penv_87->en_opcode = penv_xmm->en_opcode; + penv_87->en_foo = penv_xmm->en_foo; + penv_87->en_fos = penv_xmm->en_fos; + + /* FPU registers */ + for (i = 0; i < 8; ++i) + sv_87->sv_ac[i] = sv_xmm->sv_fp[i].fp_acc; +} + +void +npx_fill_fpregs_xmm(struct savexmm *sv_xmm, struct save87 *sv_87) +{ + + bzero(sv_87, sizeof(*sv_87)); + npx_fill_fpregs_xmm1(sv_xmm, sv_87); +} + +void +npx_set_fpregs_xmm(struct save87 *sv_87, struct savexmm *sv_xmm) +{ + struct env87 *penv_87; + struct envxmm *penv_xmm; + int i; + + penv_87 = &sv_87->sv_env; + penv_xmm = &sv_xmm->sv_env; + + /* FPU control/status */ + penv_xmm->en_cw = penv_87->en_cw; + penv_xmm->en_sw = penv_87->en_sw; + penv_xmm->en_tw = penv_87->en_tw; + penv_xmm->en_fip = penv_87->en_fip; + penv_xmm->en_fcs = penv_87->en_fcs; + penv_xmm->en_opcode = penv_87->en_opcode; + penv_xmm->en_foo = penv_87->en_foo; + penv_xmm->en_fos = penv_87->en_fos; + + /* FPU registers */ + for (i = 0; i < 8; ++i) + sv_xmm->sv_fp[i].fp_acc = sv_87->sv_ac[i]; +} +#endif /* CPU_ENABLE_SSE */ + +void +npx_get_fsave(void *addr) +{ + struct thread *td; + union savefpu *sv; + + td = curthread; + npxgetregs(td); + sv = get_pcb_user_save_td(td); +#ifdef CPU_ENABLE_SSE + if (cpu_fxsr) + npx_fill_fpregs_xmm1(&sv->sv_xmm, addr); + else +#endif + bcopy(sv, addr, sizeof(struct env87) + + sizeof(struct fpacc87[8])); +} + +int +npx_set_fsave(void *addr) +{ + union savefpu sv; + int error; + + bzero(&sv, sizeof(sv)); +#ifdef CPU_ENABLE_SSE + if (cpu_fxsr) + npx_set_fpregs_xmm(addr, &sv.sv_xmm); + else +#endif + bcopy(addr, &sv, sizeof(struct env87) + + sizeof(struct fpacc87[8])); + error = npxsetregs(curthread, &sv, NULL, 0); + return (error); +} + +#ifdef CPU_ENABLE_SSE /* * On AuthenticAMD processors, the fxrstor instruction does not restore * the x87's stored last instruction pointer, last data pointer, and last From owner-svn-src-head@freebsd.org Mon Jun 29 12:19:12 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E89298ECA1 for ; Mon, 29 Jun 2015 12:19:12 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) (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 E54A82732 for ; Mon, 29 Jun 2015 12:19:11 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by oiyy130 with SMTP id y130so116379299oiy.0 for ; Mon, 29 Jun 2015 05:19:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=lGRCTR1o1moBoTXrdPrTsD6k70bGLr4T6VvFqUvB1mI=; b=YCx8X6d+bxyif/KF2UKBAeBxSFIfjHTsLcR/eqwXluBlcTKPqKIb2YrtLpID/6FzPQ 51mSWDUc4n/WgHJOSs0dlcsI5kMZxFvpYgL2aW1/BysKI3yhj1Tlz+OGUCwKdawzACPR JkIh99fJAlt8Ai+fttyubtEgGLS4Mcc/BnWaqLXEsNJfC3/uhr7lo3pIou7XXeHZ5In1 jq5JhB67dDKHKT/BQDPFMXn09gMlH4dqf0HyjKQBPnCo5LnwJF4JCH5GOGeuZgRcdkk1 QmTwFgjCzNW5poeJXTZtxR14G/AM0rU4M4l4wE6n2jAnKFWi8QtlGXuUXiHsV06t/czH F0tQ== X-Gm-Message-State: ALoCoQmuY9BmhM4ZG/+O/LUG2PW8Mt0FlzqRFmu9YaOQf5BeTFZ3X0l8opcCu+lDdE8hsJ/7wV7t MIME-Version: 1.0 X-Received: by 10.202.208.139 with SMTP id h133mr11921111oig.74.1435580345002; Mon, 29 Jun 2015 05:19:05 -0700 (PDT) Received: by 10.76.56.51 with HTTP; Mon, 29 Jun 2015 05:19:04 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <201506270944.t5R9iEjO053344@svn.freebsd.org> References: <201506270944.t5R9iEjO053344@svn.freebsd.org> Date: Mon, 29 Jun 2015 14:19:04 +0200 Message-ID: Subject: Re: svn commit: r284887 - in head/sys: kern sys ufs/ffs From: Ed Schouten 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 12:19:12 -0000 Hi Kostik, 2015-06-27 11:44 GMT+02:00 Konstantin Belousov : > @@ -2056,6 +2072,8 @@ ffs_bufwrite(struct buf *bp) > if (bp->b_vflags & BV_BKGRDINPROG) > panic("bufwrite: still writing"); > } > + if ((bp->b_vflags & BV_BKGRDERR) != 0) > + bp->b_vflags &= ~BV_BKGRDERR; > BO_UNLOCK(bp->b_bufobj); > > /* This if-statement could be removed, right? The bit could just be cleared unconditionally. Best regards, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK/VAT number: 62051717 From owner-svn-src-head@freebsd.org Mon Jun 29 13:06:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D8A698F49F; Mon, 29 Jun 2015 13:06:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74DEF114A; Mon, 29 Jun 2015 13:06:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TD6Pi7019418; Mon, 29 Jun 2015 13:06:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5TD6P8k019417; Mon, 29 Jun 2015 13:06:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506291306.t5TD6P8k019417@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Jun 2015 13:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284927 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 13:06:25 -0000 Author: kib Date: Mon Jun 29 13:06:24 2015 New Revision: 284927 URL: https://svnweb.freebsd.org/changeset/base/284927 Log: Simplify code, no need to test the flag before clearing it. Submitted by: ed MFC after: 12 days Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Jun 29 12:06:36 2015 (r284926) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jun 29 13:06:24 2015 (r284927) @@ -2072,8 +2072,7 @@ ffs_bufwrite(struct buf *bp) if (bp->b_vflags & BV_BKGRDINPROG) panic("bufwrite: still writing"); } - if ((bp->b_vflags & BV_BKGRDERR) != 0) - bp->b_vflags &= ~BV_BKGRDERR; + bp->b_vflags &= ~BV_BKGRDERR; BO_UNLOCK(bp->b_bufobj); /* From owner-svn-src-head@freebsd.org Mon Jun 29 13:48:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A97F98FBD7; Mon, 29 Jun 2015 13:48:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BAB3169C; Mon, 29 Jun 2015 13:48:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TDmikv039323; Mon, 29 Jun 2015 13:48:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5TDmiZG039322; Mon, 29 Jun 2015 13:48:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201506291348.t5TDmiZG039322@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 29 Jun 2015 13:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284928 - head/usr.bin/ar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 13:48:45 -0000 Author: emaste Date: Mon Jun 29 13:48:44 2015 New Revision: 284928 URL: https://svnweb.freebsd.org/changeset/base/284928 Log: speed up ar(1) on UFS file systems Fault in the buffer prior to writing to workaround poor performance due to interaction with kernel fs deadlock avoidance code. See the comment prior to vn_io_fault_doio() in sys/kern/vfs_vnops.c for details of the issue. On my stable/10 desktop with a 16MB obj.o and "ar r out.a obj.o" I see the following run times (seconds): x ar.r284891 + ar.patched +----------------------------------------------------------------------+ |+ | |+ x| |+ xx| |A |A| +----------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 1.307 1.321 1.315 1.3143333 0.0070237692 + 3 0.020 0.023 0.022 0.021666667 0.0015275252 Difference at 95.0% confidence -1.29267 +/- 0.0115203 -98.3515% +/- 0.876513% (Student's t, pooled s = 0.00508265) Thanks to kib for diagnosing and explaining the issue and suggesting the workaround. Reviewed by: eadler, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2933 Modified: head/usr.bin/ar/write.c Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Mon Jun 29 13:06:24 2015 (r284927) +++ head/usr.bin/ar/write.c Mon Jun 29 13:48:44 2015 (r284928) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "ar.h" @@ -61,6 +62,7 @@ static void create_symtab_entry(struct b static void free_obj(struct bsdar *bsdar, struct ar_obj *obj); static void insert_obj(struct bsdar *bsdar, struct ar_obj *obj, struct ar_obj *pos); +static void prefault_buffer(const char *buf, size_t s); static void read_objs(struct bsdar *bsdar, const char *archive, int checkargv); static void write_archive(struct bsdar *bsdar, char mode); @@ -551,11 +553,35 @@ write_cleanup(struct bsdar *bsdar) } /* + * Fault in the buffer prior to writing as a workaround for poor performance + * due to interaction with kernel fs deadlock avoidance code. See the comment + * above vn_io_fault_doio() in sys/kern/vfs_vnops.c for details of the issue. + */ +static void +prefault_buffer(const char *buf, size_t s) +{ + volatile const char *p; + size_t page_size; + + if (s == 0) + return; + page_size = sysconf(_SC_PAGESIZE); + for (p = buf; p < buf + s; p += page_size) + *p; + /* + * Ensure we touch the last page as well, in case the buffer is not + * page-aligned. + */ + *(volatile const char *)(buf + s - 1); +} + +/* * Wrapper for archive_write_data(). */ static void write_data(struct bsdar *bsdar, struct archive *a, const void *buf, size_t s) { + prefault_buffer(buf, s); if (archive_write_data(a, buf, s) != (ssize_t)s) bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", archive_error_string(a)); From owner-svn-src-head@freebsd.org Mon Jun 29 14:23:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C817498F417 for ; Mon, 29 Jun 2015 14:23:52 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) (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 9A27214AA for ; Mon, 29 Jun 2015 14:23:52 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by oiax193 with SMTP id x193so118992158oia.2 for ; Mon, 29 Jun 2015 07:23:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=rHnxPSPVe4htPFmbrTp8yGzp+JC3YTq3FAuevKmXatI=; b=e+FhqWjxmVec16HfOXjZ9jcz6zKDtD08l7AAvWMhB4MQRV5VPcaCoQViXkYx/99+yD 7A/meGVVqOKr4wscRG44WdI7qj5NndLyx/BgUPQCz2Nllsd+vvjqf2PD5TDp7ij8nqG6 cgwdTSowfQPQb58geiA0uZgP9a5/peyS7pgaXGpmqHSjOPkHPyD60j0gnzWfeuO8Lo4I kTkjBLaryzWoaUPCwQ39XvxH7NiQlL8+BK8Sods9qDdZSTPuoo1wxaQffMAPxNxtZrLb R+3VmADCv5qqomhn0XlmueH2CAJRFRwjmywtkA/6XCwmYI1sSf4L/OaIg+GoXMhEjJj4 ohzw== X-Gm-Message-State: ALoCoQnlYOIiTtkzZHtVO/wqnab7MFma5kRe42K5N0LLTPN2oAKInqogRDurh/amc2j9o4tkdD5P MIME-Version: 1.0 X-Received: by 10.182.158.138 with SMTP id wu10mr14719132obb.12.1435587830811; Mon, 29 Jun 2015 07:23:50 -0700 (PDT) Received: by 10.76.56.51 with HTTP; Mon, 29 Jun 2015 07:23:50 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <201506291306.t5TD6P8k019417@svn.freebsd.org> References: <201506291306.t5TD6P8k019417@svn.freebsd.org> Date: Mon, 29 Jun 2015 16:23:50 +0200 Message-ID: Subject: Re: svn commit: r284927 - head/sys/ufs/ffs From: Ed Schouten 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 14:23:52 -0000 2015-06-29 15:06 GMT+02:00 Konstantin Belousov : > Simplify code, no need to test the flag before clearing it. Thanks! :-) -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK/VAT number: 62051717 From owner-svn-src-head@freebsd.org Mon Jun 29 14:41:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6CC698F7A8; Mon, 29 Jun 2015 14:41:20 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97DD61EB5; Mon, 29 Jun 2015 14:41:20 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TEfKKT068007; Mon, 29 Jun 2015 14:41:20 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5TEfKWN068005; Mon, 29 Jun 2015 14:41:20 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201506291441.t5TEfKWN068005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 29 Jun 2015 14:41:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284929 - head/share/examples/csh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 14:41:20 -0000 Author: brueffer Date: Mon Jun 29 14:41:19 2015 New Revision: 284929 URL: https://svnweb.freebsd.org/changeset/base/284929 Log: Fix issues that kept some of the examples from actually working. PR: 144534 Submitted by: Nicolas Edel MFC after: 1 week Modified: head/share/examples/csh/dot.cshrc Modified: head/share/examples/csh/dot.cshrc ============================================================================== --- head/share/examples/csh/dot.cshrc Mon Jun 29 13:48:44 2015 (r284928) +++ head/share/examples/csh/dot.cshrc Mon Jun 29 14:41:19 2015 (r284929) @@ -9,11 +9,11 @@ # has multiple ssh-agent(1) processes running, this will very likely # set SSH_AUTH_SOCK to point to the wrong file/domain socket. if (${?SSH_AUTH_SOCK} != "1") then - setenv SSH_AUTH_SOCK `sockstat -u | awk '/^${USER}.+ ssh-agent/ { print $6 }' + setenv SSH_AUTH_SOCK `sockstat -u | awk '/^${USER}.+ ssh-agent/ { print $6 }'` endif # Change only root's prompt -if (`id -g` == 0) +if (`id -g` == 0) then set prompt="root@%m# " endif @@ -70,7 +70,7 @@ complete grep 'c/-*A/x:<#_lines_after>/ 'n/-*f/f/' \ 'n/*/f/' complete ifconfig 'p@1@`ifconfig -l`@' \ - 'n/*/(range phase link netmask mtu vlandev vlan metric mediaopt down delete broadcast arp debug)/' + 'n/*/(range phase link netmask mtu vlandev vlan metric mediaopt down delete broadcast arp debug)/' \ 'c/%/j/' \ 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' From owner-svn-src-head@freebsd.org Mon Jun 29 15:01:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 293A298FB9F; Mon, 29 Jun 2015 15:01:51 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90FDF28E4; Mon, 29 Jun 2015 15:01:50 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from [130.235.5.34] ([130.235.5.34]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0LZf8m-1YmecE3RM4-00lTkf; Mon, 29 Jun 2015 16:48:46 +0200 Message-ID: <559159A9.8070205@FreeBSD.org> Date: Mon, 29 Jun 2015 16:43:53 +0200 From: Christian Brueffer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284929 - head/share/examples/csh References: <201506291441.t5TEfKWN068005@svn.freebsd.org> In-Reply-To: <201506291441.t5TEfKWN068005@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:yGwES4qBSvQRikl2WHK0l6UmxqtdfN4p5tQP4UM3wr49Sd2qciD 9NPq7SaL2uFQpyE2/P+sYR1BmLzSLie6PKutdZSlnM/4s4mfJibEF0wpuMEEWRiH9uUC02c 7s0blp3ZxUE3IIYA7v0PDZ1qjDngbaMrlw4WACv8MhQmInLIHj0MdzkeKfsPPJjtsBlE2Oi tYqW42+wCQWu0xZG/hS4w== X-UI-Out-Filterresults: notjunk:1;V01:K0:rxfqbtAKfIQ=:WTkxEAU7XHm1g6iJcfKX3X SQeeZKgliHQLgcge2PLCblnRECHpH8/oFEfK+6ePd3vIaBp85Sdqorko0AV78KsfmLLl/MQsB Whgq66Q56o6nSQ/2AcBI7pHvMHfQI7ibAqiNpSbTwo8B8ppY+dSRIgMlw2cyoer0obrN+okyS 9LAPcEpu3y2woEz7b9cLgR0sqbcdkv5kkT9cjcAhlE7+RMczniMHePH3/UIPIxkl+nraxdVyB DDgwjXyzOKtHGOMHpLkVK4zJe67Ip2cSHeOpIp1JIIzNTOWZAm5huj+1ZqCHBaKvmF/hAJ8og b94JWQ6x2qD/OzJ/ei8JgR0MvvCpZzSxBfRYJLAazm2gGbqTmxjVmC7XM1Wpi9Vrf/J6U1ERB bkYIAar/c9In3v1uTPmIE9bqgRl6vsomIoOpSbKnu8MA1vi56rRUxemS/IwTS5t3MFSF4WvbL oYUBVtJPW+HOTBYSmY5OirNZSAppyjGyZa19rpeIeAG+DJF8VSw78xDKWL5++DUCK8iB7fZOs 4xdF7QeAEwVcJhKEAn6b2HCJ39VRl0WculuR0rFg8VhBTkuv1YddTYm0wMtm4uGqCdZJQ8a3k OEN/XAkzm/0xkQ/6E+wv+DPg1Cr3nIjwnKyCFsFkS9T3Ht3irvi9s8HSirW5Q/jKMdSSrt9w5 BTT2T26SKL8NihVYwT9ACOLrUI+qYyiR6AVL87TtQQlIYmQ== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 15:01:51 -0000 This should have been PR 191759. Chris On 2015-06-29 16:41, Christian Brueffer wrote: > Author: brueffer > Date: Mon Jun 29 14:41:19 2015 > New Revision: 284929 > URL: https://svnweb.freebsd.org/changeset/base/284929 > > Log: > Fix issues that kept some of the examples from actually working. > > PR: 144534 > Submitted by: Nicolas Edel > MFC after: 1 week > > Modified: > head/share/examples/csh/dot.cshrc > > Modified: head/share/examples/csh/dot.cshrc > ============================================================================== > --- head/share/examples/csh/dot.cshrc Mon Jun 29 13:48:44 2015 (r284928) > +++ head/share/examples/csh/dot.cshrc Mon Jun 29 14:41:19 2015 (r284929) > @@ -9,11 +9,11 @@ > # has multiple ssh-agent(1) processes running, this will very likely > # set SSH_AUTH_SOCK to point to the wrong file/domain socket. > if (${?SSH_AUTH_SOCK} != "1") then > - setenv SSH_AUTH_SOCK `sockstat -u | awk '/^${USER}.+ ssh-agent/ { print $6 }' > + setenv SSH_AUTH_SOCK `sockstat -u | awk '/^${USER}.+ ssh-agent/ { print $6 }'` > endif > > # Change only root's prompt > -if (`id -g` == 0) > +if (`id -g` == 0) then > set prompt="root@%m# " > endif > > @@ -70,7 +70,7 @@ complete grep 'c/-*A/x:<#_lines_after>/ > 'n/-*f/f/' \ > 'n/*/f/' > complete ifconfig 'p@1@`ifconfig -l`@' \ > - 'n/*/(range phase link netmask mtu vlandev vlan metric mediaopt down delete broadcast arp debug)/' > + 'n/*/(range phase link netmask mtu vlandev vlan metric mediaopt down delete broadcast arp debug)/' \ > 'c/%/j/' \ > 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' > complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' > From owner-svn-src-head@freebsd.org Mon Jun 29 15:38:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3328B98F3D6; Mon, 29 Jun 2015 15:38:35 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 245DD1061; Mon, 29 Jun 2015 15:38:35 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TFcZo1095983; Mon, 29 Jun 2015 15:38:35 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5TFcYsp095982; Mon, 29 Jun 2015 15:38:35 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201506291538.t5TFcYsp095982@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 29 Jun 2015 15:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284930 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 15:38:35 -0000 Author: brueffer Date: Mon Jun 29 15:38:34 2015 New Revision: 284930 URL: https://svnweb.freebsd.org/changeset/base/284930 Log: Add CouchDB ports (5984 TCP/UDP). PR: 193268 Submitted by: yuri@rawbw.com MFC after: 1 week Modified: head/etc/services Modified: head/etc/services ============================================================================== --- head/etc/services Mon Jun 29 14:41:19 2015 (r284929) +++ head/etc/services Mon Jun 29 15:38:34 2015 (r284930) @@ -2365,6 +2365,8 @@ prosharerequest 5716/tcp #proshare con prosharerequest 5716/udp #proshare conf request prosharenotify 5717/tcp #proshare conf notify prosharenotify 5717/udp #proshare conf notify +couchdb 5984/tcp #CouchDB database server +couchdb 5984/udp #CouchDB database server cvsup 5999/tcp #CVSup file transfer/John Polstra/FreeBSD x11 6000/tcp #6000-6063 are assigned to X Window System x11 6000/udp From owner-svn-src-head@freebsd.org Mon Jun 29 17:02:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 499D2990451; Mon, 29 Jun 2015 17:02:10 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ABE01450; Mon, 29 Jun 2015 17:02:10 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TH2AYD042605; Mon, 29 Jun 2015 17:02:10 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5TH2AUh042604; Mon, 29 Jun 2015 17:02:10 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201506291702.t5TH2AUh042604@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 29 Jun 2015 17:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284931 - head/sys/x86/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 17:02:10 -0000 Author: brueffer Date: Mon Jun 29 17:02:09 2015 New Revision: 284931 URL: https://svnweb.freebsd.org/changeset/base/284931 Log: Set the initial system time to a sane (as in: not end of 21st century) value when booting on a PC with CMOS clock set to a year before 2000. This uses 1980 (instead of 1970 as in the initial patch) as pivot year as suggested by imp in the PR followup. PR: 195703 Submitted by: cs@soi.spb.ru Reviewed by: imp MFC after: 1 weeks Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Mon Jun 29 15:38:34 2015 (r284930) +++ head/sys/x86/isa/atrtc.c Mon Jun 29 17:02:09 2015 (r284931) @@ -354,7 +354,7 @@ atrtc_gettime(device_t dev, struct times #ifdef USE_RTC_CENTURY ct.year += readrtc(RTC_CENTURY) * 100; #else - ct.year += 2000; + ct.year += (ct.year < 80 ? 2000 : 1900); #endif critical_exit(); /* Set dow = -1 because some clocks don't set it correctly. */ From owner-svn-src-head@freebsd.org Mon Jun 29 17:21:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 395499907E1; Mon, 29 Jun 2015 17:21:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ie0-x233.google.com (mail-ie0-x233.google.com [IPv6:2607:f8b0:4001:c03::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 0F31912E8; Mon, 29 Jun 2015 17:21:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iebmu5 with SMTP id mu5so119498506ieb.1; Mon, 29 Jun 2015 10:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=a9+v/4t7TxYEZul2NVu9Lldfk0wUuaXfDfQh6tRz9wM=; b=vUWjVT/Z+L/MefQQDj4Bn+mRztD2b1qbpzctaduM3eHCdixKF1WJAAA7E7SzCLuHRf glk7gxY/BFOicTFCLYFSI3z6w2CSk3ergLQwT3eKTF6+WGlWnJRGz46levxepNdRGV8t Nh80iKU8mRiIz3CO8zRghA0EMYQfMoIBFIHK/E0PonszC/dr7+fHQ39rwMPK0P4G4YIn KXrRrODG7RfN+Vi8fkdAXvuGtvJuOwpPbzlp7TdbAHfekKvfkGz77cFFlULB97wgbLGL j1TSUoo6h6kj+kjSZ46EK8Iph1HvoRmXMhi/yt80X+iePvEz+8Ikn60ZStZ4ayK7m+tz 5y2w== MIME-Version: 1.0 X-Received: by 10.107.155.74 with SMTP id d71mr21968361ioe.29.1435598494468; Mon, 29 Jun 2015 10:21:34 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Mon, 29 Jun 2015 10:21:34 -0700 (PDT) In-Reply-To: <201506291348.t5TDmiZG039322@svn.freebsd.org> References: <201506291348.t5TDmiZG039322@svn.freebsd.org> Date: Mon, 29 Jun 2015 10:21:34 -0700 Message-ID: Subject: Re: svn commit: r284928 - head/usr.bin/ar From: Adrian Chadd To: Ed Maste 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 17:21:35 -0000 Is this potentially an issue for other applications? Why is it such a big issue for ar? -a On 29 June 2015 at 06:48, Ed Maste wrote: > Author: emaste > Date: Mon Jun 29 13:48:44 2015 > New Revision: 284928 > URL: https://svnweb.freebsd.org/changeset/base/284928 > > Log: > speed up ar(1) on UFS file systems > > Fault in the buffer prior to writing to workaround poor performance due > to interaction with kernel fs deadlock avoidance code. See the comment > prior to vn_io_fault_doio() in sys/kern/vfs_vnops.c for details of the > issue. > > On my stable/10 desktop with a 16MB obj.o and "ar r out.a obj.o" I see > the following run times (seconds): > > x ar.r284891 > + ar.patched > +----------------------------------------------------------------------+ > |+ | > |+ x| > |+ xx| > |A |A| > +----------------------------------------------------------------------+ > N Min Max Median Avg Stddev > x 3 1.307 1.321 1.315 1.3143333 0.0070237692 > + 3 0.020 0.023 0.022 0.021666667 0.0015275252 > Difference at 95.0% confidence > -1.29267 +/- 0.0115203 > -98.3515% +/- 0.876513% > (Student's t, pooled s = 0.00508265) > > Thanks to kib for diagnosing and explaining the issue and suggesting > the workaround. > > Reviewed by: eadler, kib > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D2933 > > Modified: > head/usr.bin/ar/write.c > > Modified: head/usr.bin/ar/write.c > ============================================================================== > --- head/usr.bin/ar/write.c Mon Jun 29 13:06:24 2015 (r284927) > +++ head/usr.bin/ar/write.c Mon Jun 29 13:48:44 2015 (r284928) > @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include "ar.h" > > @@ -61,6 +62,7 @@ static void create_symtab_entry(struct b > static void free_obj(struct bsdar *bsdar, struct ar_obj *obj); > static void insert_obj(struct bsdar *bsdar, struct ar_obj *obj, > struct ar_obj *pos); > +static void prefault_buffer(const char *buf, size_t s); > static void read_objs(struct bsdar *bsdar, const char *archive, > int checkargv); > static void write_archive(struct bsdar *bsdar, char mode); > @@ -551,11 +553,35 @@ write_cleanup(struct bsdar *bsdar) > } > > /* > + * Fault in the buffer prior to writing as a workaround for poor performance > + * due to interaction with kernel fs deadlock avoidance code. See the comment > + * above vn_io_fault_doio() in sys/kern/vfs_vnops.c for details of the issue. > + */ > +static void > +prefault_buffer(const char *buf, size_t s) > +{ > + volatile const char *p; > + size_t page_size; > + > + if (s == 0) > + return; > + page_size = sysconf(_SC_PAGESIZE); > + for (p = buf; p < buf + s; p += page_size) > + *p; > + /* > + * Ensure we touch the last page as well, in case the buffer is not > + * page-aligned. > + */ > + *(volatile const char *)(buf + s - 1); > +} > + > +/* > * Wrapper for archive_write_data(). > */ > static void > write_data(struct bsdar *bsdar, struct archive *a, const void *buf, size_t s) > { > + prefault_buffer(buf, s); > if (archive_write_data(a, buf, s) != (ssize_t)s) > bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", > archive_error_string(a)); > From owner-svn-src-head@freebsd.org Mon Jun 29 17:59:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26C8F990DB0; Mon, 29 Jun 2015 17:59:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1855A1B30; Mon, 29 Jun 2015 17:59:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5THx0u8069394; Mon, 29 Jun 2015 17:59:00 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5THx0jf069392; Mon, 29 Jun 2015 17:59:00 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201506291759.t5THx0jf069392@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 29 Jun 2015 17:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284933 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 17:59:01 -0000 Author: sbruno Date: Mon Jun 29 17:59:00 2015 New Revision: 284933 URL: https://svnweb.freebsd.org/changeset/base/284933 Log: Delete the refernce to VLAN handling being disabled by default. This is no longer the case. PR: 118693 MFC after: 3 days Modified: head/share/man/man4/em.4 Modified: head/share/man/man4/em.4 ============================================================================== --- head/share/man/man4/em.4 Mon Jun 29 17:58:45 2015 (r284932) +++ head/share/man/man4/em.4 Mon Jun 29 17:59:00 2015 (r284933) @@ -307,10 +307,5 @@ The driver was written by .An Intel Corporation Aq Mt freebsd@intel.com . .Sh BUGS -Hardware-assisted VLAN processing is disabled by default. -You can enable it on an -.Nm -interface using -.Xr ifconfig 8 . .Pp Activating EM_MULTIQUEUE support requires MSI-X features. From owner-svn-src-head@freebsd.org Mon Jun 29 19:41:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AEF09900EF; Mon, 29 Jun 2015 19:41:20 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ie0-x232.google.com (mail-ie0-x232.google.com [IPv6:2607:f8b0:4001: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 7082B1ABC; Mon, 29 Jun 2015 19:41:20 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by ieqy10 with SMTP id y10so122564415ieq.0; Mon, 29 Jun 2015 12:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=LP8t987+DMvC051tt8P6gxQMXCd9F8497n1yjkg/+V8=; b=h21Q3Assod7RJbjMovTMf79uvEJQs+uZsWSCe9JOC+XXmHxj7OJIx2rxCm7C3CsHq9 Rch1qwhxzbjIrgqF6OptbZpJDP4JMUoZ5BFGXp8C7VVfWTywExHOU5vnHUEKYzMgx67p 3lOAhIWUby/cjvG5WwFjZIz7KOhvDvba+wyw5XMKxi7ZIQ2QpkZ3K19oPYF+I/vF7lln u6PjRC+E7I6UafvOYL4A5ceBPx5u2ZdsTeSnOpGsxtSmwjp5HlVku4VFl0v5KFpescFD EjqxvyWptcZZcbE1fd7hDk1tw41y55ZUwz1UfUNxt4cBLkyn2TDXfLDEmGMTCekEoYD+ fC9A== X-Received: by 10.107.165.206 with SMTP id o197mr9457725ioe.2.1435606879749; Mon, 29 Jun 2015 12:41:19 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.48.3 with HTTP; Mon, 29 Jun 2015 12:40:57 -0700 (PDT) In-Reply-To: References: <201506291348.t5TDmiZG039322@svn.freebsd.org> From: Ed Maste Date: Mon, 29 Jun 2015 15:40:57 -0400 X-Google-Sender-Auth: kA1UC6msBk_ziVsXfFID-OzvfLw Message-ID: Subject: Re: svn commit: r284928 - head/usr.bin/ar To: Adrian Chadd 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 19:41:20 -0000 > On 29 June 2015 at 06:48, Ed Maste wrote: >> Author: emaste >> Date: Mon Jun 29 13:48:44 2015 >> New Revision: 284928 >> URL: https://svnweb.freebsd.org/changeset/base/284928 >> >> Log: >> speed up ar(1) on UFS file systems > > Is this potentially an issue for other applications? Why is it such a > big issue for ar? Yes, it could be an issue for other applications, and I'm all that happy to have this workaround in ar(1); it's a quick workaround for the issue at hand. kib pointed me at the explanation in vfs_vnops.c which explains the deadlock avoidance code well, although I'm still not sure why the slowdown is so extreme. From owner-svn-src-head@freebsd.org Mon Jun 29 21:23:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6B84990DB6; Mon, 29 Jun 2015 21:23:55 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CCB11C51; Mon, 29 Jun 2015 21:23:55 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TLNt6u074581; Mon, 29 Jun 2015 21:23:55 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5TLNter074580; Mon, 29 Jun 2015 21:23:55 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201506292123.t5TLNter074580@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Mon, 29 Jun 2015 21:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284941 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 21:23:55 -0000 Author: hiren Date: Mon Jun 29 21:23:54 2015 New Revision: 284941 URL: https://svnweb.freebsd.org/changeset/base/284941 Log: Avoid a situation where we do not set persist timer after a zero window condition. If you send a 0-length packet, but there is data is the socket buffer, and neither the rexmt or persist timer is already set, then activate the persist timer. PR: 192599 Differential Revision: D2946 Submitted by: jlott at averesystems dot com Reviewed by: jhb, jch, gnn, hiren Tested by: jlott at averesystems dot com, jch MFC after: 2 weeks Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Jun 29 19:09:16 2015 (r284940) +++ head/sys/netinet/tcp_output.c Mon Jun 29 21:23:54 2015 (r284941) @@ -1394,6 +1394,30 @@ timer: tp->t_rxtshift = 0; } tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); + } else if (len == 0 && sbavail(&so->so_snd) && + !tcp_timer_active(tp, TT_REXMT) && + !tcp_timer_active(tp, TT_PERSIST)) { + /* + * Avoid a situation where we do not set persist timer + * after a zero window condition. For example: + * 1) A -> B: packet with enough data to fill the window + * 2) B -> A: ACK for #1 + new data (0 window + * advertisement) + * 3) A -> B: ACK for #2, 0 len packet + * + * In this case, A will not activate the persist timer, + * because it chose to send a packet. Unless tcp_output + * is called for some other reason (delayed ack timer, + * another input packet from B, socket syscall), A will + * not send zero window probes. + * + * So, if you send a 0-length packet, but there is data + * in the socket buffer, and neither the rexmt or + * persist timer is already set, then activate the + * persist timer. + */ + tp->t_rxtshift = 0; + tcp_setpersist(tp); } } else { /* From owner-svn-src-head@freebsd.org Mon Jun 29 21:26:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AAE0990E0E; Mon, 29 Jun 2015 21:26:42 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1ECF71E8C; Mon, 29 Jun 2015 21:26:42 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TLQfX1075172; Mon, 29 Jun 2015 21:26:41 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5TLQfT8075170; Mon, 29 Jun 2015 21:26:41 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201506292126.t5TLQfT8075170@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Mon, 29 Jun 2015 21:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284942 - in head/release: . scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 21:26:42 -0000 Author: brd (doc,ports committer) Date: Mon Jun 29 21:26:41 2015 New Revision: 284942 URL: https://svnweb.freebsd.org/changeset/base/284942 Log: Add Support for uploading Vagrant images to Hashicorp Atlas. Approved by: re (gjb) Added: head/release/scripts/atlas-upload.sh (contents, props changed) Modified: head/release/Makefile.vagrant Modified: head/release/Makefile.vagrant ============================================================================== --- head/release/Makefile.vagrant Mon Jun 29 21:23:54 2015 (r284941) +++ head/release/Makefile.vagrant Mon Jun 29 21:26:41 2015 (r284942) @@ -7,12 +7,11 @@ VAGRANT_IMG?= ${.OBJDIR}/vagrant.vmdk VAGRANT_UPLOAD_TGTS= vagrant-check-depends \ - vagrant-do-package-vmware -# atlas-do-upload + atlas-do-upload CLEANFILES+= ${VAGRANT_UPLOAD_TGTS} .if defined(VAGRANT_UPLOAD_CONF) && !empty(VAGRANT_UPLOAD_CONF) -. for VAR in _KEY _USERNAME _NAME _VERSION +. for VAR in _KEY _USERNAME _VERSION VAGRANT${VAR}!= grep -E ^VAGRANT${VAR} ${VAGRANT_UPLOAD_CONF} | awk -F' ' '{print $$2}' ATLAS${VAR}:= ${VAGRANT${VAR}} . endfor @@ -29,7 +28,7 @@ VAGRANT_PROVIDERS?= vmware_desktop vagrant-upload: ${VAGRANT_UPLOAD_TGTS} vagrant-check-depends: -.for VAR in _KEY _USERNAME _NAME _VERSION +.for VAR in _KEY _USERNAME _VERSION . if !defined(VAGRANT${VAR}) || empty(VAGRANT${VAR}) @echo "Variable VAGRANT${VAR} cannot be empty." @false @@ -40,7 +39,7 @@ vagrant-check-depends: . if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf . endif - env ASSUME_ALWAYS_YES=yes pkg install -y ftp/curl + env ASSUME_ALWAYS_YES=yes pkg install -y curl . else make -C ${PORTSDIR}/ftp/curl BATCH=1 all install clean . endif @@ -53,17 +52,12 @@ vagrant-do-package-vmware: vagrant-creat cd ${.OBJDIR} && tar -czf ${VAGRANT_TARGET} metadata.json vagrant.vmx vagrant.vmdk touch ${.OBJDIR}/${.TARGET} -atlas-create-upload: +atlas-do-upload: vagrant-do-package-vmware .for PROVIDER in ${VAGRANT_PROVIDERS} - /usr/local/bin/curl "https://atlas.hashicorp.com/api/v1/box/${ATLAS_USERNAME}/${ATLAS_NAME}/version/${ATLAS_VERSION}/provider/${PROVIDER}/upload?access_token=${ATLAS_KEY}" + ${.CURDIR}/scripts/atlas-upload.sh -b FreeBSD-${REVISION}-${BRANCH} -f ${VAGRANT_TARGET} -p ${PROVIDER} -k ${VAGRANT_KEY} -u ${VAGRANT_USERNAME} -v 0.1 .endfor touch ${.OBJDIR}/${.TARGET} -atlas-do-upload: - /usr/local/bin/curl -X PUT --upload-file \ - ${VAGRANT_IMG} ${ATLAS_UPLOAD_PATH} - touch ${.OBJDIR}/${.TARGET} - vagrant-create-vmware-vmx: @cd ${.OBJDIR} && echo '.encoding = "UTF-8"' > vagrant.vmx @cd ${.OBJDIR} && echo 'bios.bootorder = "hdd,CDROM"' >> vagrant.vmx Added: head/release/scripts/atlas-upload.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/scripts/atlas-upload.sh Mon Jun 29 21:26:41 2015 (r284942) @@ -0,0 +1,155 @@ +#!/bin/sh +#- +# 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. +# +# Upload a Vagrant image to Hashicorp's Atlas service +# +# $FreeBSD$ +# + +ATLAS_API_URL='' +ATLAS_UPLOAD_URL='https://binstore.hashicorp.com' +VERSION_DESCRIPTION="FreeBSD Snapshot Build" + +usage() { + echo "${0} usage:" + echo "-b box-name -f box-to-upload -k api-key -p provider -u user -v version" + return 1 +} + +main () { + while getopts "b:f:k:p:u:v:" arg; do + case "${arg}" in + b) + BOX="${OPTARG}" + ;; + f) + FILE="${OPTARG}" + ;; + k) + KEY="${OPTARG}" + ;; + p) + PROVIDER="${OPTARG}" + ;; + u) + USERNAME="${OPTARG}" + ;; + v) + VERSION="${OPTARG}" + ;; + *) + ;; + esac + done + + if [ -z "${BOX}" -o \ + -z "${FILE}" -o \ + -z "${KEY}" -o \ + -z "${PROVIDER}" -o \ + -z "${USERNAME}" -o \ + -z "${VERSION}" ]; + then + usage || exit 0 + fi + + # Check to see if the box exists or create it + BOXRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}?access_token=${KEY}") + if [ $? != 0 ]; then + echo "Failed to connect to the API" + exit 2; + fi + echo $BOXRESULT | grep "\"name\":\"${BOX}\"" > /dev/null + if [ $? != 0 ]; then + echo "Creating box: ${BOX}" + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/boxes -X POST -d "box[name]=${BOX}" -d "access_token=${KEY}" > /dev/null + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX} -X PUT -d "box[is_private]=false" -d "access_token=${KEY}" > /dev/null + else + echo "Box already exists" + fi + + # Check to see if the version exists or create it + VERSIONRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}?access_token=${KEY}") + if [ $? != 0 ]; then + echo "Failed to connect to the API" + exit 2; + fi + echo $VERSIONRESULT | grep "\"version\":\"${VERSION}\"" > /dev/null + if [ $? != 0 ]; then + echo "Creating version: ${VERSION}" + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/versions -X POST -d "version[version]=${VERSION}" -d "access_token=${KEY}" > /dev/null + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION} -X PUT -d "version[description]=${VERSION_DESCRIPTION}" -d "access_token=${KEY}" > /dev/null + VERSIONRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}?access_token=${KEY}") + echo $VERSIONRESULT | grep "\"version\":\"${VERSION}\"" > /dev/null + if [ $? != 0 ]; then + echo "Failed to create version" + exit 2 + fi + else + echo "Version already exists" + fi + + # Check to see if the provider exists or create it + PROVIDERRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}?access_token=${KEY}") + if [ $? != 0 ]; then + echo "Failed to connect to the API" + exit 2; + fi + echo $PROVIDERRESULT | grep "\"name\":\"${PROVIDER}\"" > /dev/null + if [ $? != 0 ]; then + echo "Creating provider: ${PROVIDER}" + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/providers -X POST -d "provider[name]=${PROVIDER}" -d "access_token=${KEY}" > /dev/null + else + echo "Provider already exists" + fi + + # Request an upload token + TOKENRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}/upload?access_token=${KEY}") + if [ $? != 0 ]; then + echo "Failed to get the token from the API" + exit 2; + fi + echo ${TOKENRESULT} | grep "\"token\":" > /dev/null + if [ $? != 0 ]; then + echo "No token found from the API" + exit 2 + else + TOKEN=$(echo $TOKENRESULT | sed -e 's/.*token":"//' -e 's/".*//') + echo "Uploading to Atlas" + UPLOADRESULT=$(/usr/local/bin/curl -s -X PUT --upload-file ${FILE} ${ATLAS_UPLOAD_URL}/${TOKEN}) + + # Validate the Upload + echo "Validating" + VALIDRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}?access_token=${KEY}") + HOSTED_TOKEN=$(echo $VALIDRESULT | sed -e 's/.*hosted_token":"//' -e 's/".*//') + if [ ! -z ${HOSTED_TOKEN} -a ! -z ${TOKEN} -a ${HOSTED_TOKEN} != ${TOKEN} ]; then + echo "Upload failed, try again." + exit 2 + fi + + # Release the version + echo "Releasing ${VERSION} of ${BOX} in Atlas" + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/release -X PUT -d "access_token=${KEY}" > /dev/null + fi +} + +main "$@" From owner-svn-src-head@freebsd.org Tue Jun 30 01:09:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E07D898FFB9 for ; Tue, 30 Jun 2015 01:09:54 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: from mail-ig0-f178.google.com (mail-ig0-f178.google.com [209.85.213.178]) (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 B538C128D for ; Tue, 30 Jun 2015 01:09:54 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: by igrv9 with SMTP id v9so2382837igr.1 for ; Mon, 29 Jun 2015 18:09:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=NR8X8BDS+zXH0pHpysMk64qI6Isz3VBaRibec0J+WmE=; b=LoJBxbH+5FKW1EKtks4z1UwtSoxEWHGN8hD1ASdK8Ntz0UtTt8kVPrUV2Cq7KNlD3f iibZ2TE7uUyAf7a87fD3mM+q+wG0QomO9tXKOqiO2Cpsuklx+HhQVRI13NwkaYlwQGfg uRRtM5XWKb6GB2iyUId6FMoqYP5LddFgbXrmzL8lKLbyNEXJ02UCRpOeDIVBiqpmiQSW 0Cdt62gG9pllJBHjzEH4PwDLYbrEhQeXhg7zBozmfMHwcrR/lrLLD5nzrUNjtj6nz8FN nzNEpUcTWSNzyjAzwjvba4NLu7jjlhKWYyQi7R4qJq17HSnE3yDWgQwqnGBKfcB8HltE AXkw== X-Gm-Message-State: ALoCoQmO+a8qVwMElx4oH9982y1mu5yhnSJvlnJG2cHPSGibZ6s6Ke4eiVgsnLjr6iQTEPN+W7gi X-Received: by 10.50.61.241 with SMTP id t17mr20166761igr.34.1435626593640; Mon, 29 Jun 2015 18:09:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.195.199 with HTTP; Mon, 29 Jun 2015 18:09:13 -0700 (PDT) X-Originating-IP: [71.246.236.246] In-Reply-To: <201506292126.t5TLQfT8075170@svn.freebsd.org> References: <201506292126.t5TLQfT8075170@svn.freebsd.org> From: "Philip M. Gollucci" Date: Mon, 29 Jun 2015 21:09:13 -0400 Message-ID: Subject: Re: svn commit: r284942 - in head/release: . scripts To: Brad Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 01:09:55 -0000 On Mon, Jun 29, 2015 at 5:26 PM, Brad Davis wrote: > + env ASSUME_ALWAYS_YES=yes pkg install -y curl > why do we have both the env and the -y switch? -- --------------------------------------------------------------------------------- Curb: Your ride is here 4096R/D21D2752 ECDF B597 B54B 7F92 753E E0EA F699 A450 D21D 2752 Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354 Member, Apache Software Foundation Committer, FreeBSD Foundation Consultant, P6M7G8 Inc. Sr. Director IT Operations, Curb What doesn't kill us can only make us stronger; Except it almost kills you. From owner-svn-src-head@freebsd.org Tue Jun 30 01:11:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10BA3990103; Tue, 30 Jun 2015 01:11:49 +0000 (UTC) (envelope-from gjb@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 F195C1A5A; Tue, 30 Jun 2015 01:11:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 291F51A5F; Tue, 30 Jun 2015 01:11:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Tue, 30 Jun 2015 01:11:46 +0000 From: Glen Barber To: "Philip M. Gollucci" Cc: Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284942 - in head/release: . scripts Message-ID: <20150630011146.GJ5423@FreeBSD.org> References: <201506292126.t5TLQfT8075170@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VxEiC3f0k/7mWchE" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 01:11:49 -0000 --VxEiC3f0k/7mWchE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 29, 2015 at 09:09:13PM -0400, Philip M. Gollucci wrote: > On Mon, Jun 29, 2015 at 5:26 PM, Brad Davis wrote: >=20 > > + env ASSUME_ALWAYS_YES=3Dyes pkg install -y curl > > >=20 > why do we have both the env and the -y switch? >=20 Because if pkg is not bootstrapped (pkg(7) versus pkg(8)), the former (/usr/sbin/pkg) does not recognize '-y'. Glen --VxEiC3f0k/7mWchE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVkezSAAoJEAMUWKVHj+KTKLoP/ApkCw6DS7DXRAfJIW8f4Zky /Uau2jgVOfVRg1ogCLcHbEY0/CRlXpd7icE8Ycsj4ghy9ypug/TKcrc4xyf85PF2 7YrJGGZnm8zMKnTe2L/sRNMQOyztoW9NfycfB1/jwJWcDNptIoRhevoaN9KDo55P ujAcy0FgFjDvcKJo4DPHKk98+FmynPDbwiKlXV7TeKS1/LWEsWUT+fVFj0i0YLUC Q53l+AffG/I7t+sPqM+TJ83QGqsXNk7lMeay33QvNCPI4ceW99ebnlm3JxthYZzV gvHtGFcJvCaLArGncr3jy1EqdzS+1HqB/m71IkDFrYjhvN/7B/4pWQgzFRmT/bXO CYoXH2dqvZNGTHoyrdBflF5/3SX52hpwFX4oV7sxKX4G1DOfyZ1Psa2O+EkIixuq cFSIUVxP//+F+Qtu+BSmWkhV7UzGI4wi6btaWfZeWQhfO960xI342UaBLozahvvH YNMbw2I6upwJ7D1cXJ6iTnDhAe4uCoEqq1xAJcAtUI6I+vFgNSBBNwO6SW5WMXxM GX5pq7mkZuag1yeDfti41lLg7FuRghmkzgKoA8ffcouweRNbnqrkRMORv0/zlh9e iZUm/t0T/vmgm0ayKLTorPCEP4CW4MW5SOWGAauZMomNNVfFnuj//u+01LkJMNhG 3ju7bo2Vqer9WnYbx5L7 =PQ86 -----END PGP SIGNATURE----- --VxEiC3f0k/7mWchE-- From owner-svn-src-head@freebsd.org Tue Jun 30 01:13:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B9D99013D; Tue, 30 Jun 2015 01:13:17 +0000 (UTC) (envelope-from gjb@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 C0D101C2C; Tue, 30 Jun 2015 01:13:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 095451BB0; Tue, 30 Jun 2015 01:13:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Tue, 30 Jun 2015 01:13:15 +0000 From: Glen Barber To: "Philip M. Gollucci" Cc: Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284942 - in head/release: . scripts Message-ID: <20150630011315.GK5423@FreeBSD.org> References: <201506292126.t5TLQfT8075170@svn.freebsd.org> <20150630011146.GJ5423@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mtfogggI1YmpIpmy" Content-Disposition: inline In-Reply-To: <20150630011146.GJ5423@FreeBSD.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 01:13:17 -0000 --mtfogggI1YmpIpmy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 30, 2015 at 01:11:46AM +0000, Glen Barber wrote: > On Mon, Jun 29, 2015 at 09:09:13PM -0400, Philip M. Gollucci wrote: > > On Mon, Jun 29, 2015 at 5:26 PM, Brad Davis wrote: > >=20 > > > + env ASSUME_ALWAYS_YES=3Dyes pkg install -y curl > > > > >=20 > > why do we have both the env and the -y switch? > >=20 >=20 > Because if pkg is not bootstrapped (pkg(7) versus pkg(8)), the former > (/usr/sbin/pkg) does not recognize '-y'. >=20 Given the order in which the '.if exists()' events occur, theoretically this should never happen here, but I prefer to include it for consistency throughout all of the scripts/Makefiles. Glen --mtfogggI1YmpIpmy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVke0rAAoJEAMUWKVHj+KT9eAP/jKIm3GN8Z+5ftS5zFSB7w/s JPCZ3Vm93lwFTd+N4r1UbxkeukZ0lnpXjrJ9oOrFUlWiDw2DjbN7flfvKYwJ+HJu p9zzqWm0hA0vnBSnN8cgSip3UA5lofk984JPAn5adeLqYbWh4uz8aQR6JgYDjxze xCq6l/MqgcZhOTHBO8ByuLQC+ZE82ZQ6ZFWWzMjH9JGfLlRY/D93vvu/dZSsW1m3 v6YwLck3lRo0q+UvCTYbaeXztBvgnQPsq6AB8uP/u0O+KmSJeFzniT4TsE1uDpVO oErkt1pkScKbfCtOHZJjU/ZMJ+unkqFTAcJvLFXU1hYCb5YxjU0h2OvnHrl8laMU YTuwsH0t1KE2K/sV2m/idKiqTSI5mK1oD26MoFyCQcFEhlBhBBp8BIdJ0HAF/VM2 wtP9CgHk/31QE4AV64rItOTOb17o3hBcuSQHAUA7Q6K7xES5iE7i20EMSOLtboil c1VgYbDnhq2OVSydKx0FVuA4Uwjx/GDfC1WsNp8kvNhQ2MTQpxe80JgqIMnFo4CZ nZKUu1XObeBIQuoNY/D8SEBn4zsNMwOrmLkU4N8AxW3MSqVz7Eujv55QhjIcWs7W LjqN3UyurV+Zit9QIEO/EHLGUtwdWYqV/MdOAvBJ/0Dl3JHwETMgzYt7Hzu2eWqC ywk30jNNNgnHZ7Ia9RYn =ddD9 -----END PGP SIGNATURE----- --mtfogggI1YmpIpmy-- From owner-svn-src-head@freebsd.org Tue Jun 30 03:16:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35E2A99076F for ; Tue, 30 Jun 2015 03:16:27 +0000 (UTC) (envelope-from jmmv@meroh.net) Received: from mail-qg0-f51.google.com (mail-qg0-f51.google.com [209.85.192.51]) (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 EBE9D2905 for ; Tue, 30 Jun 2015 03:16:26 +0000 (UTC) (envelope-from jmmv@meroh.net) Received: by qgii30 with SMTP id i30so13392424qgi.1 for ; Mon, 29 Jun 2015 20:16:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=v3ZntdUndV1mpos31whYE0yGa2mQDKW/qggDMZO5MAc=; b=csTV7gr/8wkN8175x9fwoUpmc/+pVQRBy9eJcZY8SXd87J363HHtV/kyKmcXVSFsxq G0sqQ5Zh/yqO5o/Rd2EThqW5CMmY05OFPW2n+5RO21XBfWPniGBXnwknsQT+2NHQg8sU h9rufLqTCimg/UoMuyvGO2NQ+2I4r1siXZPm6SyG//5fK/JNOxl4jxhwjNl1J3gxtJLh COefs+2bpca34AICXx845GtckIRdVWR9pEYhlvX6FTulQ/YK2crvDfiQDRazoB5HZ6um TLxiCJR1zKJuHFUd+R4QFKchADnUJr62N/I6CGJCURBmYVzfFbBhgaVmc7mf+rX798mV MBVA== X-Gm-Message-State: ALoCoQl4rKzs1YdUiR/2EjuvML6uvaDN5Sm9EawPtKHc0xME8mYwrmrzyc7TMYeJcahFaF1H7HiG X-Received: by 10.55.18.14 with SMTP id c14mr38521683qkh.51.1435634178898; Mon, 29 Jun 2015 20:16:18 -0700 (PDT) Received: from lime.meroh.net (cpe-24-90-142-167.nyc.res.rr.com. [24.90.142.167]) by mx.google.com with ESMTPSA id c88sm12542153qge.26.2015.06.29.20.16.17 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Jun 2015 20:16:18 -0700 (PDT) Sender: Julio Merino Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r284912 - head/usr.bin/units From: Julio Merino In-Reply-To: Date: Mon, 29 Jun 2015 23:16:16 -0400 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <6A6AEA93-6E0B-4CB2-93B0-059235190A4C@FreeBSD.org> References: <201506281643.t5SGh7D9009454@svn.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 03:16:27 -0000 > On Jun 28, 2015, at 15:05 , Garrett Cooper = wrote: >=20 >=20 >> On Jun 28, 2015, at 09:43, Julio Merino wrote: >>=20 >> Author: jmmv >> Date: Sun Jun 28 16:43:07 2015 >> New Revision: 284912 >> URL: https://svnweb.freebsd.org/changeset/base/284912 >>=20 >> Log: >> Only initialize libedit when necessary >>=20 >> The code path to support units conversions from the command line >> need not initialize neither libedit nor the history. Therefore, only = do >> that when in interactive mode. >>=20 >> This hides the issue reported in PR bin/201167 whereby running = commands >> of the form 'echo "$(units ft in)"' would corrupt the terminal. The = real >> issue causing the corruption most likely still remains somewhere. >>=20 >> PR: bin/201167 >> Differential Revision: D2935 >> Reviewed by: eadler >=20 > Jenkins has been so messed up recently with timeouts and the like that = it's hard to tell where things went south.. >=20 > Can you please add your TERM and locale variables to the PR? I suspect = that it might be a related issue.. Details added, but I don=E2=80=99t think they make a difference. Could = reproduce the above under multiple combinations.= From owner-svn-src-head@freebsd.org Tue Jun 30 03:19:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE061990829; Tue, 30 Jun 2015 03:19:43 +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 942AD2CFA; Tue, 30 Jun 2015 03:19:43 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-252-104.lns20.per4.internode.on.net [121.45.252.104]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t5U3JZFn092080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 29 Jun 2015 20:19:39 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <55920AC2.3060809@freebsd.org> Date: Tue, 30 Jun 2015 11:19:30 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ed Schouten , Konstantin Belousov CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284887 - in head/sys: kern sys ufs/ffs References: <201506270944.t5R9iEjO053344@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 03:19:43 -0000 On 6/29/15 8:19 PM, Ed Schouten wrote: > Hi Kostik, > > 2015-06-27 11:44 GMT+02:00 Konstantin Belousov : >> @@ -2056,6 +2072,8 @@ ffs_bufwrite(struct buf *bp) >> if (bp->b_vflags & BV_BKGRDINPROG) >> panic("bufwrite: still writing"); >> } >> + if ((bp->b_vflags & BV_BKGRDERR) != 0) >> + bp->b_vflags &= ~BV_BKGRDERR; >> BO_UNLOCK(bp->b_bufobj); >> >> /* > This if-statement could be removed, right? The bit could just be > cleared unconditionally. true but it replaces a read and write with just a read in the case of no change. > Best regards, From owner-svn-src-head@freebsd.org Tue Jun 30 05:54:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80BC2990D71; Tue, 30 Jun 2015 05:54:51 +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 EBEDD1DB1; Tue, 30 Jun 2015 05:54:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t5U5sfsX017487 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 30 Jun 2015 08:54:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t5U5sfsX017487 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t5U5sfql017486; Tue, 30 Jun 2015 08:54:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 30 Jun 2015 08:54:41 +0300 From: Konstantin Belousov To: Julian Elischer Cc: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284887 - in head/sys: kern sys ufs/ffs Message-ID: <20150630055441.GY2080@kib.kiev.ua> References: <201506270944.t5R9iEjO053344@svn.freebsd.org> <55920AC2.3060809@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55920AC2.3060809@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 05:54:51 -0000 On Tue, Jun 30, 2015 at 11:19:30AM +0800, Julian Elischer wrote: > On 6/29/15 8:19 PM, Ed Schouten wrote: > > Hi Kostik, > > > > 2015-06-27 11:44 GMT+02:00 Konstantin Belousov : > >> @@ -2056,6 +2072,8 @@ ffs_bufwrite(struct buf *bp) > >> if (bp->b_vflags & BV_BKGRDINPROG) > >> panic("bufwrite: still writing"); > >> } > >> + if ((bp->b_vflags & BV_BKGRDERR) != 0) > >> + bp->b_vflags &= ~BV_BKGRDERR; > >> BO_UNLOCK(bp->b_bufobj); > >> > >> /* > > This if-statement could be removed, right? The bit could just be > > cleared unconditionally. > true but it replaces a read and write with just a read in the case of > no change. Th cache line is dirty already, test before the rwm operation would not give any optimizations. From owner-svn-src-head@freebsd.org Tue Jun 30 06:02:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5ABC7990EAE; Tue, 30 Jun 2015 06:02:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45E5111AA; Tue, 30 Jun 2015 06:02:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5U62h5i058690; Tue, 30 Jun 2015 06:02:43 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5U62huE058689; Tue, 30 Jun 2015 06:02:43 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201506300602.t5U62huE058689@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 30 Jun 2015 06:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284945 - head/usr.bin/mkesdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 06:02:43 -0000 Author: jhibbits Date: Tue Jun 30 06:02:42 2015 New Revision: 284945 URL: https://svnweb.freebsd.org/changeset/base/284945 Log: The LDFLAGS isn't needed, and breaks the build on powerpc64. This hack is very fragile, and was broken on powerpc64 when metamode was introduced. Removing it survives a buildworld for all architectures, and fixes the build on powerpc64. Modified: head/usr.bin/mkesdb/Makefile Modified: head/usr.bin/mkesdb/Makefile ============================================================================== --- head/usr.bin/mkesdb/Makefile Tue Jun 30 05:53:15 2015 (r284944) +++ head/usr.bin/mkesdb/Makefile Tue Jun 30 06:02:42 2015 (r284945) @@ -3,7 +3,6 @@ .PATH: ${.CURDIR}/../../lib/libc/iconv PROG= mkesdb -LDFLAGS+= -L${.OBJDIR}/../../lib/libc NO_WMISSING_VARIABLE_DECLARATIONS= From owner-svn-src-head@freebsd.org Tue Jun 30 07:46:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9573C990F12; Tue, 30 Jun 2015 07:46:07 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86D3E1FFA; Tue, 30 Jun 2015 07:46:07 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5U7k77j008218; Tue, 30 Jun 2015 07:46:07 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5U7k7oK008217; Tue, 30 Jun 2015 07:46:07 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201506300746.t5U7k7oK008217@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Tue, 30 Jun 2015 07:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284946 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 07:46:07 -0000 Author: maxim Date: Tue Jun 30 07:46:06 2015 New Revision: 284946 URL: https://svnweb.freebsd.org/changeset/base/284946 Log: o DragonFly 4.2.0 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Jun 30 06:02:42 2015 (r284945) +++ head/share/misc/bsd-family-tree Tue Jun 30 07:46:06 2015 (r284946) @@ -330,7 +330,7 @@ FreeBSD 5.2 | | | | | | DragonFly 4.0.5 | | | | | | | | OpenBSD 5.7 | - | | | | | + | | | | DragonFly 4.2.0 | | | | | FreeBSD 11 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -672,6 +672,7 @@ DragonFly 4.0.3 2015-01-21 [DFB] DragonFly 4.0.4 2015-03-09 [DFB] DragonFly 4.0.5 2015-03-23 [DFB] OpenBSD 5.7 2015-05-01 [OBD] +DragonFly 4.2.0 2015-06-29 [DFB] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Tue Jun 30 13:48:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BAB598FF0B for ; Tue, 30 Jun 2015 13:48:10 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery4.ore.mailhop.org (pmta2.delivery4.ore.mailhop.org [54.200.247.200]) by mx1.freebsd.org (Postfix) with SMTP id 3D0471C0A for ; Tue, 30 Jun 2015 13:48:10 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 30 Jun 2015 13:46:38 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t5UDl1ub018979; Tue, 30 Jun 2015 07:47:02 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1435672021.1648.61.camel@freebsd.org> Subject: Re: svn commit: r284942 - in head/release: . scripts From: Ian Lepore To: Glen Barber Cc: "Philip M. Gollucci" , Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 30 Jun 2015 07:47:01 -0600 In-Reply-To: <20150630011146.GJ5423@FreeBSD.org> References: <201506292126.t5TLQfT8075170@svn.freebsd.org> <20150630011146.GJ5423@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 13:48:10 -0000 On Tue, 2015-06-30 at 01:11 +0000, Glen Barber wrote: > On Mon, Jun 29, 2015 at 09:09:13PM -0400, Philip M. Gollucci wrote: > > On Mon, Jun 29, 2015 at 5:26 PM, Brad Davis wrote: > > > > > + env ASSUME_ALWAYS_YES=yes pkg install -y curl > > > > > > > why do we have both the env and the -y switch? > > > > Because if pkg is not bootstrapped (pkg(7) versus pkg(8)), the former > (/usr/sbin/pkg) does not recognize '-y'. > > Glen > Is there any reason we shouldn't just fix that? -- Ian From owner-svn-src-head@freebsd.org Tue Jun 30 13:57:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A7A698E1B5; Tue, 30 Jun 2015 13:57:11 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::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 940F115C9; Tue, 30 Jun 2015 13:57:10 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by widjy10 with SMTP id jy10so31210278wid.1; Tue, 30 Jun 2015 06:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=A3LvlwEu/yq976aJuklMjqZ/3O3NF11PopvgK8EGLec=; b=Sd3TmrpkvSPrlu4di/ceudn29wcWTqMavFoMw9GUJ95GWKgOyPUthveUM4FsZxuMli 78bd6oPfmCeXp9N6N/6gtc2421BQ+9546dlxfKqmhcOv1YLV2jPFlfPPbS/GVsB5DRwO hmLvN62U4S5e3d+Y58R0cc3BpvwDndsO8TUYb3ccP9w5y/f94LJtBbQ4qvnA+3vPEjtR vo8pKGdtMfuUhBwQuTTA5ytKIdRY/Veicxintq4CLTHFlbDYJxnYXHnN8vUfHsohEiui Wa8GbC1HOBOokzRi4d05vOpWgwrrliXJgZiH2lrrpVJDz22YHkRTbE1cPwqP8QG0kZhd FIbA== X-Received: by 10.194.236.199 with SMTP id uw7mr39178599wjc.92.1435672628988; Tue, 30 Jun 2015 06:57:08 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id wi1sm69158336wjb.41.2015.06.30.06.57.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jun 2015 06:57:07 -0700 (PDT) Sender: Baptiste Daroussin Date: Tue, 30 Jun 2015 15:57:05 +0200 From: Baptiste Daroussin To: "Philip M. Gollucci" Cc: Brad Davis , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r284942 - in head/release: . scripts Message-ID: <20150630135704.GA28026@ivaldir.etoilebsd.net> References: <201506292126.t5TLQfT8075170@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 13:57:11 -0000 --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 29, 2015 at 09:09:13PM -0400, Philip M. Gollucci wrote: > On Mon, Jun 29, 2015 at 5:26 PM, Brad Davis wrote: >=20 > > + env ASSUME_ALWAYS_YES=3Dyes pkg install -y curl > > >=20 > why do we have both the env and the -y switch? >=20 -y is not needed in this case Best regards, Bapt --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlWSoDAACgkQ8kTtMUmk6Ewn1gCfdjxx5DHdA6y4E6NRPUSC/onE 1RAAnRzhYieEwtHA45P3RXZ6qXKk2jyA =r+lx -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X-- From owner-svn-src-head@freebsd.org Tue Jun 30 15:22:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 935BE98FEC1; Tue, 30 Jun 2015 15:22:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84FFD1543; Tue, 30 Jun 2015 15:22:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5UFMmZw051457; Tue, 30 Jun 2015 15:22:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5UFMmuP051456; Tue, 30 Jun 2015 15:22:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506301522.t5UFMmuP051456@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 30 Jun 2015 15:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284956 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 15:22:48 -0000 Author: kib Date: Tue Jun 30 15:22:47 2015 New Revision: 284956 URL: https://svnweb.freebsd.org/changeset/base/284956 Log: Do not calculate the stack's bottom address twice. Submitted by: Olivц╘r Pintц╘r Review: https://reviews.freebsd.org/D2953 MFC after: 1 week Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Tue Jun 30 15:21:18 2015 (r284955) +++ head/sys/kern/kern_exec.c Tue Jun 30 15:22:47 2015 (r284956) @@ -1096,7 +1096,7 @@ exec_new_vmspace(imgp, sv) * are still used to enforce the stack rlimit on the process stack. */ vmspace->vm_ssize = sgrowsiz >> PAGE_SHIFT; - vmspace->vm_maxsaddr = (char *)sv->sv_usrstack - ssiz; + vmspace->vm_maxsaddr = (char *)stack_addr; return (0); } From owner-svn-src-head@freebsd.org Tue Jun 30 17:00:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C89A990530; Tue, 30 Jun 2015 17:00:48 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A4C31894; Tue, 30 Jun 2015 17:00:48 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5UH0mvl001512; Tue, 30 Jun 2015 17:00:48 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5UH0jPq001498; Tue, 30 Jun 2015 17:00:45 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201506301700.t5UH0jPq001498@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Tue, 30 Jun 2015 17:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 17:00:48 -0000 Author: markm Date: Tue Jun 30 17:00:45 2015 New Revision: 284959 URL: https://svnweb.freebsd.org/changeset/base/284959 Log: Huge cleanup of random(4) code. * GENERAL - Update copyright. - Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set neither to ON, which means we want Fortuna - If there is no 'device random' in the kernel, there will be NO random(4) device in the kernel, and the KERN_ARND sysctl will return nothing. With RANDOM_DUMMY there will be a random(4) that always blocks. - Repair kern.arandom (KERN_ARND sysctl). The old version went through arc4random(9) and was a bit weird. - Adjust arc4random stirring a bit - the existing code looks a little suspect. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Redo read_random(9) so as to duplicate random(4)'s read internals. This makes it a first-class citizen rather than a hack. - Move stuff out of locked regions when it does not need to be there. - Trim RANDOM_DEBUG printfs. Some are excess to requirement, some behind boot verbose. - Use SYSINIT to sequence the startup. - Fix init/deinit sysctl stuff. - Make relevant sysctls also tunables. - Add different harvesting "styles" to allow for different requirements (direct, queue, fast). - Add harvesting of FFS atime events. This needs to be checked for weighing down the FS code. - Add harvesting of slab allocator events. This needs to be checked for weighing down the allocator code. - Fix the random(9) manpage. - Loadable modules are not present for now. These will be re-engineered when the dust settles. - Use macros for locks. - Fix comments. * src/share/man/... - Update the man pages. * src/etc/... - The startup/shutdown work is done in D2924. * src/UPDATING - Add UPDATING announcement. * src/sys/dev/random/build.sh - Add copyright. - Add libz for unit tests. * src/sys/dev/random/dummy.c - Remove; no longer needed. Functionality incorporated into randomdev.*. * live_entropy_sources.c live_entropy_sources.h - Remove; content moved. - move content to randomdev.[ch] and optimise. * src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h - Remove; plugability is no longer used. Compile-time algorithm selection is the way to go. * src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h - Add early (re)boot-time randomness caching. * src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h - Remove; no longer needed. * src/sys/dev/random/uint128.h - Provide a fake uint128_t; if a real one ever arrived, we can use that instead. All that is needed here is N=0, N++, N==0, and some localised trickery is used to manufacture a 128-bit 0ULLL. * src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h - Improve unit tests; previously the testing human needed clairvoyance; now the test will do a basic check of compressibility. Clairvoyant talent is still a good idea. - This is still a long way off a proper unit test. * src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h - Improve messy union to just uint128_t. - Remove unneeded 'static struct fortuna_start_cache'. - Tighten up up arithmetic. - Provide a method to allow eternal junk to be introduced; harden it against blatant by compress/hashing. - Assert that locks are held correctly. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) * src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h - Improve messy union to just uint128_t. - Remove unneeded 'staic struct start_cache'. - Tighten up up arithmetic. - Provide a method to allow eternal junk to be introduced; harden it against blatant by compress/hashing. - Assert that locks are held correctly. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) - Fix some magic numbers elsewhere used as FAST and SLOW. Differential Revision: https://reviews.freebsd.org/D2025 Reviewed by: vsevolod,delphij,rwatson,trasz,jmg Approved by: so (delphij) Added: head/sys/dev/random/randomdev_none.c (contents, props changed) - copied, changed from r284956, head/sys/dev/random/randomdev_soft.h Deleted: head/sys/dev/random/dummy_rng.c head/sys/dev/random/live_entropy_sources.c head/sys/dev/random/live_entropy_sources.h head/sys/dev/random/random_adaptors.c head/sys/dev/random/random_adaptors.h head/sys/dev/random/randomdev_soft.c head/sys/dev/random/randomdev_soft.h head/sys/modules/random/Makefile Modified: head/UPDATING head/share/man/man4/random.4 head/share/man/man9/random.9 head/share/man/man9/random_harvest.9 head/sys/conf/files head/sys/conf/options head/sys/dev/glxsb/glxsb.c head/sys/dev/hifn/hifn7751.c head/sys/dev/random/build.sh head/sys/dev/random/fortuna.c head/sys/dev/random/fortuna.h head/sys/dev/random/hash.c head/sys/dev/random/hash.h head/sys/dev/random/ivy.c head/sys/dev/random/nehemiah.c head/sys/dev/random/random_harvestq.c head/sys/dev/random/random_harvestq.h head/sys/dev/random/randomdev.c head/sys/dev/random/randomdev.h head/sys/dev/random/uint128.h head/sys/dev/random/unit_test.c head/sys/dev/random/unit_test.h head/sys/dev/random/yarrow.c head/sys/dev/random/yarrow.h head/sys/dev/rndtest/rndtest.c head/sys/dev/safe/safe.c head/sys/dev/syscons/scmouse.c head/sys/dev/syscons/syscons.c head/sys/dev/ubsec/ubsec.c head/sys/dev/virtio/random/virtio_random.c head/sys/dev/vt/vt_core.c head/sys/dev/vt/vt_sysmouse.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/kern/kern_intr.c head/sys/kern/kern_mib.c head/sys/kern/subr_bus.c head/sys/libkern/arc4random.c head/sys/libkern/random.c head/sys/mips/cavium/octeon_rnd.c head/sys/mips/conf/AR71XX_BASE head/sys/mips/conf/AR724X_BASE head/sys/mips/conf/AR91XX_BASE head/sys/mips/conf/AR933X_BASE head/sys/mips/conf/AR934X_BASE head/sys/mips/conf/PB92 head/sys/mips/conf/QCA955X_BASE head/sys/mips/conf/RT305X head/sys/modules/Makefile head/sys/modules/crypto/Makefile head/sys/net/if_ethersubr.c head/sys/net/if_tun.c head/sys/netgraph/ng_iface.c head/sys/sys/kernel.h head/sys/sys/random.h head/sys/ufs/ffs/ffs_inode.c head/sys/vm/uma_core.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Jun 30 16:26:13 2015 (r284958) +++ head/UPDATING Tue Jun 30 17:00:45 2015 (r284959) @@ -31,6 +31,41 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150630: + The default kernel entropy-processing algorithm is now + Fortuna, replacing Yarrow. + + Assuming you have 'device random' in your kernel config + file, the configurations allow a kernel option to override + this default. You may choose *ONE* of: + + options RANDOM_YARROW # Legacy /dev/random algorithm. + options RANDOM_DUMMY # Blocking-only driver. + + If you have neither, you get Fortuna. For most people, + read no further, Fortuna will give a /dev/random that works + like it always used to, and the difference will be irrelevant. + + If you remove 'device random', you get *NO* kernel-processed + entopy at all. This may be acceptable to folks building + embedded systems, but has complications. Carry on reading, + and it is assumed you know what you need. + + *PLEASE* read random(4) and random(9) if you are in the + habit of tweeking kernel configs, and/or if you are a member + of the embedded community, wanting specific and not-usual + behaviour from your security subsystems. + + NOTE!! If you use RANDOM_DUMMY and/or have no 'device + random', you will NOT have a functioning /dev/random, and + many cryptographic features will not work, including SSH. + You may also find strange behaviour from the random(3) set + of library functions, in particular sranddev(3), srandomdev(3) + and arc4random(3). The reason for this is that the KERN_ARND + sysctl only returns entropy if it thinks it has some to + share, and with RANDOM_DUMMY or no 'device random' this + will never happen. + 20150623: An additional fix for the issue described in the 20150614 sendmail entry below has been been committed in revision 284717. Modified: head/share/man/man4/random.4 ============================================================================== --- head/share/man/man4/random.4 Tue Jun 30 16:26:13 2015 (r284958) +++ head/share/man/man4/random.4 Tue Jun 30 17:00:45 2015 (r284959) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2001-2013 Mark R V Murray. All rights reserved. +.\" Copyright (c) 2001-2015 Mark R V Murray. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2013 +.Dd June 30, 2015 .Dt RANDOM 4 .Os .Sh NAME @@ -37,31 +37,32 @@ The device returns an endless supply of random bytes when read. It also accepts and reads data -as any ordinary (and willing) file, -but discards data written to it. -The device will probe for -certain hardware entropy sources, -and use these in preference to the fallback, -which is a generator implemented in software. +as any ordinary file. .Pp -The software generator will start in an +The generator will start in an .Em unseeded state, and will block reads until -it is (re)seeded. +it is seeded for the first time. This may cause trouble at system boot when keys and the like are generated from -/dev/random +.Xr random 4 so steps should be taken to ensure a -reseed as soon as possible. -The -.Xr sysctl 8 -controlling the -.Em seeded -status (see below) may be used -if security is not an issue -or for convenience -during setup or development. +seeding as soon as possible. +.Pp +It is also possible +to read random bytes +by using the KERN_ARND sysctl. +On the command line +this could be done by +.Pp +.Dl "sysctl -x -B 16 kern.arandom" +.Pp +This sysctl will not return +random bytes unless +the +.Xr random 4 +is seeded. .Pp This initial seeding of random number generators @@ -90,101 +91,57 @@ To see the current settings of the softw .Nm device, use the command line: .Pp -.Dl sysctl kern.random +.Dl "sysctl kern.random" .Pp which results in something like: .Bd -literal -offset indent -kern.random.adaptors: yarrow,dummy -kern.random.active_adaptor: yarrow -kern.random.yarrow.gengateinterval: 10 -kern.random.yarrow.bins: 10 -kern.random.yarrow.fastthresh: 96 -kern.random.yarrow.slowthresh: 128 -kern.random.yarrow.slowoverthresh: 2 -kern.random.sys.seeded: 1 -kern.random.sys.harvest.ethernet: 1 -kern.random.sys.harvest.point_to_point: 1 -kern.random.sys.harvest.interrupt: 1 -kern.random.sys.harvest.swi: 1 +kern.random.fortuna.minpoolsize: 64 +kern.random.harvest.mask_symbolic: [HIGH_PERFORMANCE], ... ,CACHED +kern.random.harvest.mask_bin: 00111111111 +kern.random.harvest.mask: 511 +kern.random.random_sources: 'Intel Secure Key RNG' .Ed .Pp Other than -.Dl kern.random.adaptors -all settings are read/write. -.Pp -The -.Va kern.random.sys.seeded -variable indicates whether or not the -.Nm -device is in an acceptably secure state -as a result of reseeding. -If set to 0, -the device will block (on read) -until the next reseed -as a result of entropy harvesting. -A reseed will set the value to 1 (non-blocking). -.Pp -The -.Va kern.random.sys.harvest.ethernet -variable is used to select LAN traffic as an entropy source. -A 0 (zero) value means that LAN traffic -is not considered as an entropy source. -Set the variable to 1 (one) -if you wish to use LAN traffic for entropy harvesting. +.Dl kern.random.fortuna.minpoolsize +and +.Dl kern.random.harvest.mask +all settings are read-only. .Pp The -.Va kern.random.sys.harvest.point_to_point -variable is used to select serial line traffic as an entropy source. -(Serial line traffic includes PPP, SLIP and all tun0 traffic.) -A 0 (zero) value means such traffic -is not considered as an entropy source. -Set the variable to 1 (one) -if you wish to use it for entropy harvesting. +.Pa kern.random.fortuna.minpoolsize +sysctl is used +to set the seed threshhold. +A smaller number gives a faster seed, +but a less secure one. +In practice, +values between 64 and 256 +are acceptable. .Pp The -.Va kern.random.sys.harvest.interrupt -variable is used to select hardware interrupts +.Va kern.random.harvest.mask +bitmask is used to select +the possible entropy sources. +A 0 (zero) value means +the corresponding source +is not considered as an entropy source. -A 0 (zero) value means hardware interrupts -are not considered as an entropy source. -Set the variable to 1 (one) -if you wish to use them for entropy harvesting. -All hardware interrupt harvesting is set up by the -individual device drivers. -.Pp +Set the bit to 1 (one) +if you wish to use +that source. The -.Va kern.random.sys.harvest.swi -variable is used to select software interrupts -as an entropy source. -A 0 (zero) value means software interrupts -are not considered as an entropy source. -Set the variable to 1 (one) -if you wish to use them for entropy harvesting. -.Pp -The other variables are explained in the paper describing the -.Em Yarrow -algorithm at -.Pa http://www.schneier.com/yarrow.html . -.Pp -These variables are all limited -in terms of the values they may contain: -.Bl -tag -width "kern.random.yarrow.gengateinterval" -compact -offset indent -.It Va kern.random.yarrow.gengateinterval -.Bq 4..64 -.It Va kern.random.yarrow.bins -.Bq 2..16 -.It Va kern.random.yarrow.fastthresh -.Bq 64..256 -.It Va kern.random.yarrow.slowthresh -.Bq 64..256 -.It Va kern.random.yarrow.slowoverthresh -.Bq 1..5 -.El -.Pp -Internal -.Xr sysctl 3 -handlers force the above variables -into the stated ranges. +.Va kern.random.harvest.mask_bin +and +.Va kern.random.harvest.mask_symbolic +sysctl +can be used confirm +that your choices are correct. +Note that disabled items +in the latter item +are listed in square brackets. +See +.Xr random_harvest 9 +for more on the harvesting of entropy. .Sh RANDOMNESS The use of randomness in the field of computing is a rather subtle issue because randomness means @@ -308,23 +265,36 @@ so its use is discouraged. .Xr RAND_add 3 , .Xr RAND_bytes 3 , .Xr random 3 , -.Xr sysctl 8 +.Xr sysctl 8 , +.Xr random 9 +.Rs +.%A Ferguson +.%A Schneier +.%A Kohno +.%B Cryptography Engineering +.%I Wiley +.%O ISBN 978-0-470-47424-2 +.Re .Sh HISTORY A .Nm device appeared in .Fx 2.2 . -The early version was taken from Theodore Ts'o's entropy driver for Linux. The current software implementation, introduced in -.Fx 5.0 , -is a complete rewrite by +.Fx 10.0 , +is by .An Mark R V Murray , and is an implementation of the -.Em Yarrow -algorithm by Bruce Schneier, +.Em Fortuna +algorithm by Ferguson .Em et al . -Significant infrastructure work was done by Arthur Mesh. -.Pp -The author gratefully acknowledges -significant assistance from VIA Technologies, Inc. +It replaces the previous +.Em Yarrow +implementation, +introduced in +.Fx 5.0 . +The older +.Em Yarrow +algorithm remains available +as a compile-time fallback. Modified: head/share/man/man9/random.9 ============================================================================== --- head/share/man/man9/random.9 Tue Jun 30 16:26:13 2015 (r284958) +++ head/share/man/man9/random.9 Tue Jun 30 17:00:45 2015 (r284959) @@ -1,4 +1,6 @@ .\" +.\" Copyright (c) 2015 +.\" Mark R V Murray .\" Copyright (c) 2000 .\" The Regents of the University of California. All rights reserved. .\" @@ -26,7 +28,7 @@ .\" .\" $FreeBSD$ .\" " -.Dd September 25, 2000 +.Dd June 30, 2015 .Dt RANDOM 9 .Os .Sh NAME @@ -53,11 +55,12 @@ .Sh DESCRIPTION The .Fn random -function will by default produce a sequence of numbers that can be duplicated +function will by default produce +a sequence of numbers +that can be duplicated by calling .Fn srandom -with -.Ql 1 +with some constant as the .Fa seed . The @@ -67,19 +70,28 @@ function may be called with any arbitrar value to get slightly more unpredictable numbers. It is important to remember that the .Fn random -function is entirely predictable, and is therefore not of use where -knowledge of the sequence of numbers may be of benefit to an attacker. +function is entirely predictable, +and is therefore not of use where +knowledge of the sequence of numbers +may be of benefit to an attacker. .Pp The .Fn arc4rand -function will return very good quality random numbers, slightly better -suited for security-related purposes. +function will return very good quality random numbers, +better suited +for security-related purposes. The random numbers from .Fn arc4rand -are seeded from the entropy device if it is available. -Automatic reseeds happen after a certain timeinterval and after a -certain number of bytes have been delivered. -A forced reseed can be forced by passing a non-zero value in the +are seeded from the entropy device +if it is available. +Automatic reseeds happen +after a certain timeinterval +and after a certain number of bytes +have been delivered. +A forced reseed +can be forced +by passing a non-zero +value in the .Fa reseed argument. .Pp @@ -90,19 +102,24 @@ if it has been loaded. If the entropy device is not loaded, then the .Fa buffer -is filled with output generated by -.Fn random . +is ignored +and zero is returned. The .Fa buffer is filled with no more than .Fa count bytes. -It is advised that +It is strongly advised that .Fn read_random -is not used; instead use +is not used; +instead use .Fn arc4rand +unless it is +necessary to know +that no entropy +has been returned. .Pp -All the bits generated by +All the bits returned by .Fn random , .Fn arc4rand and @@ -120,32 +137,38 @@ to return a 32 bit pseudo-random integer .Sh RETURN VALUES The .Fn random -function -uses a non-linear additive feedback random number generator employing a -default table of size 31 long integers to return successive pseudo-random +function uses +a non-linear additive feedback random number generator +employing a default table +of size 31 +containing long integers +to return successive pseudo-random numbers in the range from 0 to .if t 2\u\s731\s10\d\(mi1. .if n (2**31)\(mi1. -The period of this random number generator is very large, approximately +The period of this random number generator +is very large, +approximately .if t 16\(mu(2\u\s731\s10\d\(mi1). .if n 16*((2**31)\(mi1). .Pp The .Fn arc4rand -function uses the RC4 algorithm to generate successive pseudo-random -bytes. +function uses the RC4 algorithm +to generate successive pseudo-random bytes. The .Fn arc4random -function -uses +function uses .Fn arc4rand -to generate pseudo-random numbers in the range from 0 to +to generate pseudo-random numbers +in the range from 0 to .if t 2\u\s732\s10\d\(mi1. .if n (2**32)\(mi1. .Pp The .Fn read_random -function returns the number of bytes placed in +function returns +the number of bytes placed in .Fa buffer . .Sh AUTHORS .An Dan Moschuk Modified: head/share/man/man9/random_harvest.9 ============================================================================== --- head/share/man/man9/random_harvest.9 Tue Jun 30 16:26:13 2015 (r284958) +++ head/share/man/man9/random_harvest.9 Tue Jun 30 17:00:45 2015 (r284959) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2002 Mark R V Murray +.\" Copyright (c) 2002-2015 Mark R V Murray .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2002 +.Dd June 30, 2015 .Dt RANDOM_HARVEST 9 .Os .Sh NAME @@ -35,59 +35,93 @@ .In sys/types.h .In sys/random.h .Ft void -.Fo random_harvest +.Fo random_harvest_direct +.Fa "void *entropy" +.Fa "u_int size" +.Fa "u_int bits" +.Fa "enum esource source" +.Fc +.Ft void +.Fo random_harvest_fast +.Fa "void *entropy" +.Fa "u_int size" +.Fa "u_int bits" +.Fa "enum esource source" +.Fc +.Ft void +.Fo random_harvest_queue .Fa "void *entropy" .Fa "u_int size" .Fa "u_int bits" -.Fa "u_int frac" .Fa "enum esource source" .Fc .Sh DESCRIPTION The -.Fn random_harvest -function is used by device drivers +.Fn random_harvest_* +functions are used by device drivers and other kernel processes to pass data that is considered (at least partially) stochastic to the entropy device. .Pp -The caller should pass a pointer (to no more than 16 bytes) of -the +The caller should pass +a pointer pointing to the .Dq random data in .Fa entropy . The argument .Fa size contains the number of bytes pointed to. -The caller should +The +.Fa source +is chosen from one of +the values enumerated in +.Pa sys/dev/random.h . +and is used to indicate the source of the entropy. +.Pp +The +.Fo random_harvest_direct +.Fc +variant is used +for early harvesting +before any multitasking +is enabled. +.Pp +The +.Fn random_harvest_fast +variant is used +by sources that +should not take +a performance hit +from harvesting, +as they are high-rate +sources. +Some entropy is sacrificed, +but the hig rate of supply +will compensate for this. +.Pp +The +.Fn random_harvest_queue +variant is used +for general harvesting +and is the default +choice for most entropy sources +such as interrupts +or console events. +.Pp +The +.Fa bits +argument is only used +by the deprecated Yarrow algorithm. +For compatibility, +the caller should .Em "very conservatively" estimate the number of random bits in the sample, and pass this in -.Fa bits -or -.Fa frac . -If the estimated number of bits per sample is an integer, then -.Fa bits -is used, and -.Fa frac -is 0. -Otherwise, -for low-entropy samples, -.Dq fractional -entropy can be supplied in -.Fa frac . -(This is considered to be -.Fa frac / -1024 bits of entropy.) -The -.Fa source -is chosen from -.Dv RANDOM_WRITE , RANDOM_KEYBOARD , RANDOM_MOUSE , RANDOM_NET -and -.Dv RANDOM_INTERRUPT , -and is used to indicate the source of the entropy. +.Fa bits . .Pp -Interrupt harvesting has been simplified +Interrupt harvesting has been +in part simplified simplified for the kernel programmer. If a device driver registers an interrupt handler with @@ -101,6 +135,7 @@ bit in the .Fa flags argument to have that interrupt source be used for entropy harvesting. +This should be done wherever practicable. .Sh SEE ALSO .Xr random 4 , .Xr BUS_SETUP_INTR 9 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jun 30 16:26:13 2015 (r284958) +++ head/sys/conf/files Tue Jun 30 17:00:45 2015 (r284959) @@ -528,14 +528,14 @@ crypto/des/des_ecb.c optional crypto | crypto/des/des_setkey.c optional crypto | ipsec | netsmb crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi crypto/rijndael/rijndael-alg-fst.c optional crypto | geom_bde | \ - ipsec | random | wlan_ccmp -crypto/rijndael/rijndael-api-fst.c optional geom_bde | random + ipsec | random random_yarrow | random !random_yarrow !random_dummy | wlan_ccmp +crypto/rijndael/rijndael-api-fst.c optional geom_bde | random random_yarrow | random !random_yarrow !random_dummy crypto/rijndael/rijndael-api.c optional crypto | ipsec | wlan_ccmp crypto/sha1.c optional carp | crypto | ipsec | \ netgraph_mppc_encryption | sctp -crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | random | \ +crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | random random_yarrow | random !random_yarrow !random_dummy | \ sctp | zfs -crypto/sha2/sha256c.c optional crypto | geom_bde | ipsec | random | \ +crypto/sha2/sha256c.c optional crypto | geom_bde | ipsec | random random_yarrow | random !random_yarrow !random_dummy | \ sctp | zfs crypto/siphash/siphash.c optional inet | inet6 crypto/siphash/siphash_test.c optional inet | inet6 @@ -2139,15 +2139,12 @@ rt2860.fw optional rt2860fw | ralfw \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2860.fw" -dev/random/randomdev.c standard -dev/random/random_adaptors.c standard -dev/random/dummy_rng.c standard -dev/random/live_entropy_sources.c standard -dev/random/random_harvestq.c standard -dev/random/randomdev_soft.c optional random -dev/random/yarrow.c optional random -dev/random/fortuna.c optional random -dev/random/hash.c optional random +dev/random/randomdev_none.c optional !random +dev/random/randomdev.c optional random +dev/random/random_harvestq.c optional random random_yarrow | random !random_dummy +dev/random/yarrow.c optional random random_yarrow +dev/random/fortuna.c optional random !random_yarrow !random_dummy +dev/random/hash.c optional random random_yarrow | random !random_dummy dev/rc/rc.c optional rc dev/re/if_re.c optional re dev/rl/if_rl.c optional rl pci Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Jun 30 16:26:13 2015 (r284958) +++ head/sys/conf/options Tue Jun 30 17:00:45 2015 (r284959) @@ -939,9 +939,16 @@ RACCT_DEFAULT_TO_DISABLED opt_global.h RCTL opt_global.h # Random number generator(s) +# The DEBUG option is in global.h as the random harvesting +# puts probes all over the place, and it makes little sense +# to pollute these headers with an extra include. +# the DUMMY option is in global.h because it is used to +# turn off harvesting all over the kernel. +RANDOM_DEBUG opt_global.h +# Which CSPRNG hashes we get. +# These are mutually exclusive. With neither, Fortuna is selected. +RANDOM_DUMMY opt_global.h RANDOM_YARROW opt_random.h -RANDOM_FORTUNA opt_random.h -RANDOM_DEBUG opt_random.h # Intel em(4) driver EM_MULTIQUEUE opt_em.h Modified: head/sys/dev/glxsb/glxsb.c ============================================================================== --- head/sys/dev/glxsb/glxsb.c Tue Jun 30 16:26:13 2015 (r284958) +++ head/sys/dev/glxsb/glxsb.c Tue Jun 30 17:00:45 2015 (r284959) @@ -476,7 +476,8 @@ glxsb_rnd(void *v) if (status & SB_RNS_TRNG_VALID) { value = bus_read_4(sc->sc_sr, SB_RANDOM_NUM); /* feed with one uint32 */ - random_harvest(&value, sizeof(value), 32/2, RANDOM_PURE_GLXSB); + /* MarkM: FIX!! Check that this does not swamp the harvester! */ + random_harvest_queue(&value, sizeof(value), 32/2, RANDOM_PURE_GLXSB); } callout_reset(&sc->sc_rngco, sc->sc_rnghz, glxsb_rnd, sc); Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Tue Jun 30 16:26:13 2015 (r284958) +++ head/sys/dev/hifn/hifn7751.c Tue Jun 30 17:00:45 2015 (r284959) @@ -258,7 +258,8 @@ hifn_partname(struct hifn_softc *sc) static void default_harvest(struct rndtest_state *rsp, void *buf, u_int count) { - random_harvest(buf, count, count*NBBY/2, RANDOM_PURE_HIFN); + /* MarkM: FIX!! Check that this does not swamp the harvester! */ + random_harvest_queue(buf, count, count*NBBY/2, RANDOM_PURE_HIFN); } static u_int Modified: head/sys/dev/random/build.sh ============================================================================== --- head/sys/dev/random/build.sh Tue Jun 30 16:26:13 2015 (r284958) +++ head/sys/dev/random/build.sh Tue Jun 30 17:00:45 2015 (r284959) @@ -1,3 +1,29 @@ +#!/bin/sh +#- +# Copyright (c) 2013-2015 Mark R V Murray +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer +# in this position and unchanged. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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$ # # Basic script to build crude unit tests. @@ -11,6 +37,7 @@ cc -g -O0 -pthread -DRANDOM_DEBUG -DRAND ../../crypto/rijndael/rijndael-alg-fst.c \ ../../crypto/sha2/sha2.c \ ../../crypto/sha2/sha256c.c \ + -lz \ -o yunit_test cc -g -O0 -pthread -DRANDOM_DEBUG -DRANDOM_FORTUNA \ -I../.. -lstdthreads -Wall \ @@ -21,4 +48,5 @@ cc -g -O0 -pthread -DRANDOM_DEBUG -DRAND ../../crypto/rijndael/rijndael-alg-fst.c \ ../../crypto/sha2/sha2.c \ ../../crypto/sha2/sha256c.c \ + -lz \ -o funit_test Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Tue Jun 30 16:26:13 2015 (r284958) +++ head/sys/dev/random/fortuna.c Tue Jun 30 17:00:45 2015 (r284959) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Mark R V Murray + * Copyright (c) 2013-2015 Mark R V Murray * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,25 +25,24 @@ * */ -/* This implementation of Fortuna is based on the descriptions found in - * ISBN 0-471-22357-3 "Practical Cryptography" by Ferguson and Schneier - * ("F&S"). - * - * The above book is superseded by ISBN 978-0-470-47424-2 "Cryptography - * Engineering" by Ferguson, Schneier and Kohno ("FS&K"). The code has - * not yet fully caught up with FS&K. +/* + * This implementation of Fortuna is based on the descriptions found in + * ISBN 978-0-470-47424-2 "Cryptography Engineering" by Ferguson, Schneier + * and Kohno ("FS&K"). */ #include __FBSDID("$FreeBSD$"); -#ifdef _KERNEL -#include "opt_random.h" +#include +#ifdef _KERNEL #include #include +#include #include #include +#include #include #include #include @@ -56,13 +55,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #else /* !_KERNEL */ -#include -#include #include #include #include @@ -79,351 +75,405 @@ __FBSDID("$FreeBSD$"); #include #endif /* _KERNEL */ -#if !defined(RANDOM_YARROW) && !defined(RANDOM_FORTUNA) -#define RANDOM_YARROW -#elif defined(RANDOM_YARROW) && defined(RANDOM_FORTUNA) -#error "Must define either RANDOM_YARROW or RANDOM_FORTUNA" -#endif - -#if defined(RANDOM_FORTUNA) - -#define NPOOLS 32 -#define MINPOOLSIZE 64 -#define DEFPOOLSIZE 256 -#define MAXPOOLSIZE 65536 - -/* This algorithm (and code) presumes that KEYSIZE is twice as large as BLOCKSIZE */ -CTASSERT(BLOCKSIZE == sizeof(uint128_t)); -CTASSERT(KEYSIZE == 2*BLOCKSIZE); - -/* This is the beastie that needs protecting. It contains all of the - * state that we are excited about. - * Exactly one is instantiated. +/* Defined in FS&K */ +#define RANDOM_FORTUNA_NPOOLS 32 /* The number of accumulation pools */ +#define RANDOM_FORTUNA_DEFPOOLSIZE 64 /* The default pool size/length for a (re)seed */ +#define RANDOM_FORTUNA_MAX_READ (1 << 20) /* Max bytes in a single read */ + +/* + * The allowable range of RANDOM_FORTUNA_DEFPOOLSIZE. The default value is above. + * Making RANDOM_FORTUNA_DEFPOOLSIZE too large will mean a long time between reseeds, + * and too small may compromise initial security but get faster reseeds. + */ +#define RANDOM_FORTUNA_MINPOOLSIZE 16 +#define RANDOM_FORTUNA_MAXPOOLSIZE UINT_MAX +CTASSERT(RANDOM_FORTUNA_MINPOOLSIZE <= RANDOM_FORTUNA_DEFPOOLSIZE); +CTASSERT(RANDOM_FORTUNA_DEFPOOLSIZE <= RANDOM_FORTUNA_MAXPOOLSIZE); + +/* This algorithm (and code) presumes that RANDOM_KEYSIZE is twice as large as RANDOM_BLOCKSIZE */ +CTASSERT(RANDOM_BLOCKSIZE == sizeof(uint128_t)); +CTASSERT(RANDOM_KEYSIZE == 2*RANDOM_BLOCKSIZE); + +/* + * This is the beastie that needs protecting. It contains all of the + * state that we are excited about. Exactly one is instantiated. */ static struct fortuna_state { - /* P_i */ - struct pool { - u_int length; - struct randomdev_hash hash; - } pool[NPOOLS]; - - /* ReseedCnt */ - u_int reseedcount; - - /* C - 128 bits */ - union { - uint8_t byte[BLOCKSIZE]; - uint128_t whole; - } counter; - - /* K */ - struct randomdev_key key; - - /* Extras */ - u_int minpoolsize; - + struct fs_pool { /* P_i */ + u_int fsp_length; /* Only the first one is used by Fortuna */ + struct randomdev_hash fsp_hash; + } fs_pool[RANDOM_FORTUNA_NPOOLS]; + u_int fs_reseedcount; /* ReseedCnt */ + uint128_t fs_counter; /* C */ + struct randomdev_key fs_key; /* K */ + u_int fs_minpoolsize; /* Extras */ /* Extras for the OS */ - #ifdef _KERNEL /* For use when 'pacing' the reseeds */ - sbintime_t lasttime; + sbintime_t fs_lasttime; #endif + /* Reseed lock */ + mtx_t fs_mtx; } fortuna_state; -/* The random_reseed_mtx mutex protects seeding and polling/blocking. */ -static mtx_t random_reseed_mtx; +#ifdef _KERNEL +static struct sysctl_ctx_list random_clist; +RANDOM_CHECK_UINT(fs_minpoolsize, RANDOM_FORTUNA_MINPOOLSIZE, RANDOM_FORTUNA_MAXPOOLSIZE); +#else +static uint8_t zero_region[RANDOM_ZERO_BLOCKSIZE]; +#endif -static struct fortuna_start_cache { - uint8_t junk[PAGE_SIZE]; - size_t length; - struct randomdev_hash hash; -} fortuna_start_cache; +static void random_fortuna_pre_read(void); +static void random_fortuna_read(uint8_t *, u_int); +static void random_fortuna_post_read(void); +static void random_fortuna_write(uint8_t *, u_int); +static void random_fortuna_reseed(void); +static int random_fortuna_seeded(void); +static void random_fortuna_process_event(struct harvest_event *); #ifdef _KERNEL -static struct sysctl_ctx_list random_clist; -RANDOM_CHECK_UINT(minpoolsize, MINPOOLSIZE, MAXPOOLSIZE); +/* Interface to Adaptors system */ +struct random_algorithm random_alg_context = { + .ra_ident = "Fortuna", + .ra_pre_read = random_fortuna_pre_read, + .ra_read = random_fortuna_read, + .ra_post_read = random_fortuna_post_read, + .ra_write = random_fortuna_write, + .ra_reseed = random_fortuna_reseed, + .ra_seeded = random_fortuna_seeded, + .ra_event_processor = random_fortuna_process_event, + .ra_poolcount = RANDOM_FORTUNA_NPOOLS, +}; #endif -void -random_fortuna_init_alg(void) +/* ARGSUSED */ +static void +random_fortuna_init_alg(void *unused __unused) { int i; #ifdef _KERNEL struct sysctl_oid *random_fortuna_o; #endif - memset(fortuna_start_cache.junk, 0, sizeof(fortuna_start_cache.junk)); - fortuna_start_cache.length = 0U; - randomdev_hash_init(&fortuna_start_cache.hash); - - /* Set up a lock for the reseed process */ -#ifdef _KERNEL - mtx_init(&random_reseed_mtx, "reseed mutex", NULL, MTX_DEF); -#else /* !_KERNEL */ - mtx_init(&random_reseed_mtx, mtx_plain); -#endif /* _KERNEL */ - -#ifdef _KERNEL - /* Fortuna parameters. Do not adjust these unless you have + RANDOM_RESEED_INIT_LOCK(); + /* + * Fortuna parameters. Do not adjust these unless you have * have a very good clue about what they do! */ + fortuna_state.fs_minpoolsize = RANDOM_FORTUNA_DEFPOOLSIZE; +#ifdef _KERNEL + fortuna_state.fs_lasttime = 0; random_fortuna_o = SYSCTL_ADD_NODE(&random_clist, SYSCTL_STATIC_CHILDREN(_kern_random), OID_AUTO, "fortuna", CTLFLAG_RW, 0, "Fortuna Parameters"); - SYSCTL_ADD_PROC(&random_clist, SYSCTL_CHILDREN(random_fortuna_o), OID_AUTO, - "minpoolsize", CTLTYPE_UINT|CTLFLAG_RW, - &fortuna_state.minpoolsize, DEFPOOLSIZE, - random_check_uint_minpoolsize, "IU", - "Minimum pool size necessary to cause a reseed automatically"); - - fortuna_state.lasttime = 0U; + "minpoolsize", CTLTYPE_UINT | CTLFLAG_RWTUN, + &fortuna_state.fs_minpoolsize, RANDOM_FORTUNA_DEFPOOLSIZE, + random_check_uint_fs_minpoolsize, "IU", + "Minimum pool size necessary to cause a reseed"); + KASSERT(fortuna_state.fs_minpoolsize > 0, ("random: Fortuna threshold must be > 0 at startup")); #endif - fortuna_state.minpoolsize = DEFPOOLSIZE; - - /* F&S - InitializePRNG() */ - - /* F&S - P_i = \epsilon */ - for (i = 0; i < NPOOLS; i++) { - randomdev_hash_init(&fortuna_state.pool[i].hash); - fortuna_state.pool[i].length = 0U; + /*- + * FS&K - InitializePRNG() + * - P_i = \epsilon + * - ReseedCNT = 0 + */ + for (i = 0; i < RANDOM_FORTUNA_NPOOLS; i++) { + randomdev_hash_init(&fortuna_state.fs_pool[i].fsp_hash); + fortuna_state.fs_pool[i].fsp_length = 0; } - - /* F&S - ReseedCNT = 0 */ - fortuna_state.reseedcount = 0U; - - /* F&S - InitializeGenerator() */ - - /* F&S - C = 0 */ - uint128_clear(&fortuna_state.counter.whole); - - /* F&S - K = 0 */ - memset(&fortuna_state.key, 0, sizeof(fortuna_state.key)); + fortuna_state.fs_reseedcount = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jun 30 17:09:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57A8E9907F8; Tue, 30 Jun 2015 17:09:43 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 477C71F86; Tue, 30 Jun 2015 17:09:43 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5UH9hF0006290; Tue, 30 Jun 2015 17:09:43 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5UH9fFA006281; Tue, 30 Jun 2015 17:09:41 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201506301709.t5UH9fFA006281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Tue, 30 Jun 2015 17:09:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284960 - in head: etc/defaults etc/rc.d share/man/man5 share/man/man9 sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 17:09:43 -0000 Author: markm Date: Tue Jun 30 17:09:41 2015 New Revision: 284960 URL: https://svnweb.freebsd.org/changeset/base/284960 Log: Updated random(4) boot/shutdown scripting. Fix the man pages as well. Differential Revision: https://reviews.freebsd.org/D2924 Approved by: so (delphij) Modified: head/etc/defaults/rc.conf head/etc/rc.d/random head/share/man/man5/rc.conf.5 head/share/man/man9/random.9 head/sys/boot/forth/loader.conf head/sys/boot/forth/loader.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Jun 30 17:00:45 2015 (r284959) +++ head/etc/defaults/rc.conf Tue Jun 30 17:09:41 2015 (r284960) @@ -630,15 +630,16 @@ kern_securelevel="-1" # range: -1..3 ; ` # in the system booting with securelevel set to 1, as # init(8) will raise the level when rc(8) completes. update_motd="YES" # update version info in /etc/motd (or NO) -entropy_file="/entropy" # Set to NO to disable caching entropy through reboots. +entropy_boot_file="/boot/entropy" # Set to NO to disable very early + # (used at early boot time) entropy caching through reboots. +entropy_file="/entropy" # Set to NO to disable late (used when going multi-user) + # entropy through reboots. # /var/db/entropy-file is preferred if / is not avail. entropy_dir="/var/db/entropy" # Set to NO to disable caching entropy via cron. entropy_save_sz="4096" # Size of the entropy cache files. entropy_save_num="8" # Number of entropy cache files to save. -harvest_interrupt="YES" # Entropy device harvests interrupt randomness -harvest_ethernet="YES" # Entropy device harvests ethernet randomness -harvest_p_to_p="YES" # Entropy device harvests point-to-point randomness -harvest_swi="YES" # Entropy device harvests internal SWI randomness +harvest_mask="511" # Entropy device harvests all but the very invasive sources. + # (See 'sysctl kern.random.harvest' and random(4)) dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot watchdogd_enable="NO" # Start the software watchdog daemon watchdogd_flags="" # Flags to watchdogd (if enabled) Modified: head/etc/rc.d/random ============================================================================== --- head/etc/rc.d/random Tue Jun 30 17:00:45 2015 (r284959) +++ head/etc/rc.d/random Tue Jun 30 17:09:41 2015 (r284960) @@ -41,6 +41,13 @@ feed_dev_random() random_start() { + + if [ ${harvest_mask} -gt 0 ]; then + echo -n 'Setting up harvesting:' + ${SYSCTL} kern.random.harvest.mask=${harvest_mask} > /dev/null + ${SYSCTL_N} kern.random.harvest.mask_symbolic + fi + echo -n 'Feeding entropy:' if [ ! -w /dev/random ] ; then @@ -68,6 +75,14 @@ random_start() ;; esac + case ${entropy_boot_file:=/boot/entropy} in + [Nn][Oo] | '') + ;; + *) + save_dev_random "${entropy_boot_file}" + ;; + esac + echo '.' } @@ -100,7 +115,33 @@ random_stop() ;; *) dd if=/dev/random of=${entropy_file_confirmed} \ - bs=4096 count=1 2> /dev/null + bs=4096 count=1 2> /dev/null || + warn 'write failed (unwriteable file or full fs?)' + echo '.' + ;; + esac + umask ${oumask} + ;; + esac + case ${entropy_boot_file:=/boot/entropy} in + [Nn][Oo] | '') + ;; + *) + echo -n 'Writing early boot entropy file:' + rm -f ${entropy_boot_file} 2> /dev/null + oumask=`umask` + umask 077 + if touch ${entropy_boot_file} 2> /dev/null; then + entropy_boot_file_confirmed="${entropy_boot_file}" + fi + case ${entropy_boot_file_confirmed} in + '') + warn 'write failed (read-only fs?)' + ;; + *) + dd if=/dev/random of=${entropy_boot_file_confirmed} \ + bs=4096 count=1 2> /dev/null || + warn 'write failed (unwriteable file or full fs?)' echo '.' ;; esac Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Tue Jun 30 17:00:45 2015 (r284959) +++ head/share/man/man5/rc.conf.5 Tue Jun 30 17:09:41 2015 (r284960) @@ -3995,27 +3995,11 @@ set from .Va jail_ Ns Ao Ar jname Ac Ns Va _sysvipc_allow .El .\" ----------------------------------------------------- -.It Va harvest_interrupt -.Pq Vt bool -Set to -.Dq Li YES -to use hardware interrupts as an entropy source. -Refer to -.Xr random 4 -for more information. -.It Va harvest_ethernet -.Pq Vt bool -Set to -.Dq Li YES -to use LAN traffic as an entropy source. -Refer to -.Xr random 4 -for more information. -.It Va harvest_p_to_p -.Pq Vt bool -Set to -.Dq Li YES -to use serial line traffic as an entropy source. +.It Va harvest_mask +.Pq Vt int +Set to a bit-mask +representing the entropy sources +you wish to harvest. Refer to .Xr random 4 for more information. @@ -4025,17 +4009,54 @@ Set to .Dq Li NO to disable caching entropy via .Xr cron 8 . -Otherwise set to the directory used to store entropy files in. +Otherwise set to the directory +in which the entropy files are stored. +To be useful, +there must be +a system cron job +that regularly writes and rotates +files here. +All files found +will be used at boot time. +The default is +.Pa /var/db/entropy . .It Va entropy_file .Pq Vt str Set to .Dq Li NO to disable caching entropy through reboots. -Otherwise set to the filename used to store cached entropy through -reboots. -This file should be located on the root file system to seed the -.Xr random 4 -device as early as possible in the boot process. +Otherwise set to the name +of a file used to store cached entropy. +This file should be located +on a file system that is readable +before all the volumes specified in +.Xr fstab 5 +are mounted. +By default, +.Pa /entropy +is used, +but if +.Pa /var/db/entropy-file +is found it will also be used. +This will be of some use to +.Xr bsdinstall 8 . +.It Va entropy_boot_file +.Pq Vt str +Set to +.Dq Li NO +to disable +very early caching entropy +through reboots. +Otherwise set to the filename +used to read +very early reboot cached entropy. +This file should be located where +.Xr loader 8 +can read it. +See also +.Xr loader.conf 5 . +The default location is +.Pa /boot/entropy . .It Va entropy_save_sz .Pq Vt int Size of the entropy cache files saved by @@ -4478,6 +4499,7 @@ The default value is an empty string. .Xr ipf 5 , .Xr ipnat 5 , .Xr jail.conf 5 , +.Xr loader.conf 5 , .Xr motd 5 , .Xr newsyslog.conf 5 , .Xr pf.conf 5 , @@ -4486,6 +4508,7 @@ The default value is an empty string. .Xr amd 8 , .Xr apm 8 , .Xr atm 8 , +.Xr bsdinstall 8 , .Xr bthidd 8 , .Xr chkprintcap 8 , .Xr chown 8 , @@ -4503,6 +4526,7 @@ The default value is an empty string. .Xr ipnat 8 , .Xr jail 8 , .Xr kldxref 8 , +.Xr loader 8 , .Xr lpd 8 , .Xr mdconfig 8 , .Xr mdmfs 8 , Modified: head/share/man/man9/random.9 ============================================================================== --- head/share/man/man9/random.9 Tue Jun 30 17:00:45 2015 (r284959) +++ head/share/man/man9/random.9 Tue Jun 30 17:09:41 2015 (r284960) @@ -4,8 +4,6 @@ .\" Copyright (c) 2000 .\" The Regents of the University of California. All rights reserved. .\" -.\" All rights reserved. -.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Tue Jun 30 17:00:45 2015 (r284959) +++ head/sys/boot/forth/loader.conf Tue Jun 30 17:09:41 2015 (r284960) @@ -42,11 +42,16 @@ bitmap_type="splash_image_data" # and pl ### Random number generator configuration ################### ############################################################## -entropy_cache_load="NO" # Set this to YES to load entropy at boot time +# See rc.conf(5). The entropy_boot_file config variable must agree with the +# settings below. + +entropy_cache_load="YES" # Set this to NO to disable loading + # entropy at boot time entropy_cache_name="/boot/entropy" # Set this to the name of the file -entropy_cache_type="/boot/entropy" -#kern.random.sys.seeded="0" # Set this to 1 to start /dev/random - # without waiting for a (re)seed. +entropy_cache_type="/boot/entropy" # Required for the kernel to find + # the boot-time entropy cache. This + # must not change value even if the + # _name above does change! ############################################################## ### RAM Blacklist configuration ############################# Modified: head/sys/boot/forth/loader.conf.5 ============================================================================== --- head/sys/boot/forth/loader.conf.5 Tue Jun 30 17:00:45 2015 (r284959) +++ head/sys/boot/forth/loader.conf.5 Tue Jun 30 17:09:41 2015 (r284960) @@ -252,6 +252,19 @@ and If set to .Dq NO , the beastie boot menu will be displayed without ANSI coloring. +.It Va entropy_cache_load +.Pq Dq YES +If set to +.Dq NO , +the very early +boot-time entropy file +will not be loaded. +See the entropy entries in +.Xr rc.conf 5 . +.It Va entropy_cache_name +.Pq Dq /boot/entropy +The name of the very early +boot-time entropy cache file. .El .Sh FILES .Bl -tag -width /boot/defaults/loader.conf -compact @@ -269,6 +282,7 @@ contains the instructions to automatical .Nm . .El .Sh SEE ALSO +.Xr rc.conf 5 , .Xr boot 8 , .Xr loader 8 , .Xr loader.4th 8 From owner-svn-src-head@freebsd.org Tue Jun 30 17:20:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B90D990AD7; Tue, 30 Jun 2015 17:20:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1304018E4; Tue, 30 Jun 2015 17:20:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5UHJxXq011527; Tue, 30 Jun 2015 17:19:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5UHJxlE011522; Tue, 30 Jun 2015 17:19:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201506301719.t5UHJxlE011522@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Jun 2015 17:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284961 - in head/sys: kern netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 17:20:00 -0000 Author: np Date: Tue Jun 30 17:19:58 2015 New Revision: 284961 URL: https://svnweb.freebsd.org/changeset/base/284961 Log: Fix leak in tcp_lro_rx. Simply clearing M_PKTHDR isn't enough, any tags hanging off the header need to be freed too. Differential Revision: https://reviews.freebsd.org/D2708 Reviewed by: ae@, hiren@ Modified: head/sys/kern/uipc_mbuf.c head/sys/netinet/tcp_lro.c head/sys/sys/mbuf.h Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Tue Jun 30 17:09:41 2015 (r284960) +++ head/sys/kern/uipc_mbuf.c Tue Jun 30 17:19:58 2015 (r284961) @@ -420,6 +420,17 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) n->m_flags |= m->m_flags & M_RDONLY; } +void +m_demote_pkthdr(struct mbuf *m) +{ + + M_ASSERTPKTHDR(m); + + m_tag_delete_chain(m, NULL); + m->m_flags &= ~M_PKTHDR; + bzero(&m->m_pkthdr, sizeof(struct pkthdr)); +} + /* * Clean up mbuf (chain) from any tags and packet headers. * If "all" is set then the first mbuf in the chain will be @@ -433,11 +444,8 @@ m_demote(struct mbuf *m0, int all, int f for (m = all ? m0 : m0->m_next; m != NULL; m = m->m_next) { KASSERT(m->m_nextpkt == NULL, ("%s: m_nextpkt in m %p, m0 %p", __func__, m, m0)); - if (m->m_flags & M_PKTHDR) { - m_tag_delete_chain(m, NULL); - m->m_flags &= ~M_PKTHDR; - bzero(&m->m_pkthdr, sizeof(struct pkthdr)); - } + if (m->m_flags & M_PKTHDR) + m_demote_pkthdr(m); m->m_flags = m->m_flags & (M_EXT | M_RDONLY | M_NOFREE | flags); } } Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Tue Jun 30 17:09:41 2015 (r284960) +++ head/sys/netinet/tcp_lro.c Tue Jun 30 17:19:58 2015 (r284961) @@ -550,7 +550,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m * append new segment to existing mbuf chain. */ m_adj(m, m->m_pkthdr.len - tcp_data_len); - m->m_flags &= ~M_PKTHDR; + m_demote_pkthdr(m); le->m_tail->m_next = m; le->m_tail = m_last(m); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Jun 30 17:09:41 2015 (r284960) +++ head/sys/sys/mbuf.h Tue Jun 30 17:19:58 2015 (r284961) @@ -959,6 +959,7 @@ struct mbuf *m_copypacket(struct mbuf *, void m_copy_pkthdr(struct mbuf *, struct mbuf *); struct mbuf *m_copyup(struct mbuf *, int, int); struct mbuf *m_defrag(struct mbuf *, int); +void m_demote_pkthdr(struct mbuf *); void m_demote(struct mbuf *, int, int); struct mbuf *m_devget(char *, int, int, struct ifnet *, void (*)(char *, caddr_t, u_int)); From owner-svn-src-head@freebsd.org Tue Jun 30 18:23:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CF40990D08; Tue, 30 Jun 2015 18:23:09 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AF9F1B94; Tue, 30 Jun 2015 18:23:09 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5UIN87e045784; Tue, 30 Jun 2015 18:23:08 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5UIN8v9045783; Tue, 30 Jun 2015 18:23:08 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201506301823.t5UIN8v9045783@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Tue, 30 Jun 2015 18:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284964 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 18:23:09 -0000 Author: hiren Date: Tue Jun 30 18:23:08 2015 New Revision: 284964 URL: https://svnweb.freebsd.org/changeset/base/284964 Log: Add missing DTrace scripts that exist in the source tree to the Makefile for install. While here, sort the list. Differential Revision: D2950 Submitted by: Jason Wolfe Reviewed by: gnn, markj, hiren Sponsored by: Limelight Networks Modified: head/share/dtrace/Makefile Modified: head/share/dtrace/Makefile ============================================================================== --- head/share/dtrace/Makefile Tue Jun 30 17:59:14 2015 (r284963) +++ head/share/dtrace/Makefile Tue Jun 30 18:23:08 2015 (r284964) @@ -15,11 +15,13 @@ _toolkit= toolkit SCRIPTS= disklatency \ disklatencycmd \ hotopen \ + nfsattrstats \ nfsclienttime \ - udptrack \ + siftr \ + tcpconn \ tcpstate \ tcptrack \ - tcpconn + udptrack SCRIPTSDIR= ${SHAREDIR}/dtrace From owner-svn-src-head@freebsd.org Tue Jun 30 18:53:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E7049904E7; Tue, 30 Jun 2015 18:53:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 124092BC0; Tue, 30 Jun 2015 18:53:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5UIrgJi060956; Tue, 30 Jun 2015 18:53:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5UIrgrC060955; Tue, 30 Jun 2015 18:53:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506301853.t5UIrgrC060955@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 30 Jun 2015 18:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284965 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 18:53:43 -0000 Author: kib Date: Tue Jun 30 18:53:42 2015 New Revision: 284965 URL: https://svnweb.freebsd.org/changeset/base/284965 Log: Document x86 machine-specific ptrace(2) requests. Provide list of the ppc requests. Reviewed by: brueffer, emaste, gjb (previous version) Sponsored by: The FreeBSD Foundation Review: https://reviews.freebsd.org/D2962 MFC after: 2 weeks Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Tue Jun 30 18:23:08 2015 (r284964) +++ head/lib/libc/sys/ptrace.2 Tue Jun 30 18:53:42 2015 (r284965) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd July 22, 2013 +.Dd June 30, 2015 .Dt PTRACE 2 .Os .Sh NAME @@ -503,8 +503,161 @@ The .Fa data argument is ignored. .El +.Sh x86 MACHINE-SPECIFIC REQUESTS +.Bl -tag -width "Dv PT_GETXSTATE_INFO" +.It Dv PT_GETXMMREGS +Copies out the XMM FPU state into the buffer pointed to by the +argument +.Fa addr . +The buffer has the same layout as the 32bit save buffer for the +machine instruction +.Dv FXSAVE . +.Pp +This request is only valid for i386 programs, both on native 32bit +systems and on amd64 kernels. +For 64bit amd64 programs, the XMM state is reported as part of +the FPU state returned by the +.Dv PT_GETFPREGS +request. +.Pp +The +.Fa data +argument is ignored. +.It Dv PT_SETXMMREGS +Loads the XMM FPU state for the thread from the buffer pointed to +by the argument +.Fa addr . +The buffer has the same layout as the 32bit load buffer for the +machine instruction +.Dv FXRSTOR . +.Pp +As with +.Dv PT_GETXMMREGS, +this request is only valid for i386 programs. +.Pp +The +.Fa data +argument is ignored. +.It Dv PT_GETXSTATE_INFO +Returns the information about the enablement state of the XSAVE FPU +extensions supported by the CPU and allowed by the OS for use by userspace +programs. +The +.Fa addr +argument must point to the variable of type +.Vt struct ptrace_xstate_info , +which contains the information on the request return. +The +.Vt struct ptrace_xstate_info +is defined as follows: +.Bd -literal +struct ptrace_xstate_info { + uint64_t xsave_mask; + uint32_t xsave_len; +}; +.Ed +The +.Dv xsave_mask +field is the bitmask of the currently enabled extensions. +The meaning of the bits is defined by the Intel and AMD +processor documentation. +The +.Dv xsave_len +field reports the length of the XSAVE area for storing the hardware +state for currently enabled extensions in the format defined by the x86 +.Dv XSAVE +machine instruction. +.Pp +The +.Fa data +argument value must be equal to the size of the +.Vt struct ptrace_xstate_info . +.It Dv PT_GETXSTATE +Returns the content of the XSAVE area for the thread. +The +.Fa addr +argument points to the buffer where the content is copied, the +.Fa data +argument specifies the size of the buffer. +The kernel copies out as much content as allowed by the buffer size. +The buffer layout is specified by the layout of the save area for the +.Dv XSAVE +machine instruction. +.It Dv PT_SETXSTATE +Load the XSAVE state for the thread from the buffer specified by the +.Fa addr +pointer. +The buffer size is passed in the +.Fa data +argument. +The buffer must be at least as large to allow the x87 FPU and XMM state, +but not large than the XSAVE state length, as reported by the +.Dv xsave_len +field from the +.Vt struct ptrace_xstate_info +of the +.Dv PT_GETXSTATE_INFO +request. +Layout of the buffer is identical to the layout of the load area for the +.Dv XRSTOR +machine instruction. +.It Dv PT_GETFSBASE +The request returns the value of base used when doing segmented +memory addressing using the %fs segment register. +The +.Fa addr +argument points to the +.Vt unsigned long +variable which gets the base value. +.Pp +The +.Fa data +argument is ignored. +.It Dv PT_GETGSBASE +Same as the +.Dv PT_GETFSBASE +request, but returns the base for the %gs segment register. +.It Dv PT_SETFSBASE +Sets the base for the %fs segment register to the value pointed +by the +.Fa addr +argument, which must point to the +.Vt unsigned long +variable containing the new base. .Pp -Additionally, machine-specific requests can exist. +The +.Fa data +argument is ignored. +.It Dv PT_SETGSBASE +Same as the +.Dv PT_SETFSBASE +request, but allows setting the base for the %gs segment register. +.El +.Sh PowerPC MACHINE-SPECIFIC REQUESTS +.Bl -tag -width "Dv PT_SETVRREGS" +.It Dv PT_GETVRREGS +Returns the +.Dv ALTIVEC +machine state for the thread into the buffer pointed to by +the argument +.Fa addr . +.Pp +The +.Fa data +argument is ignored. +.It Dv PT_SETVRREGS +Set the +.Dv ALTIVEC +machine state for the thread from the buffer pointed to by +the argument +.Fa addr . +.Pp +The +.Fa data +argument is ignored. +.El +.Pp +Additionally, other machine-specific requests can exist. .Sh RETURN VALUES Some requests can cause .Fn ptrace @@ -564,6 +717,26 @@ provided to was less than or equal to zero, or larger than the .Vt ptrace_lwpinfo structure known to the kernel. +.It +The size (in +.Fa data) +provided to the x86-specific +.Dv PT_GETXSTATE_INFO +request was not equal to the size of the +.Vt struct ptrace_xstate_info . +.It +The size (in +.Fa data) +provided to the x86-specific +.Dv PT_SETXSTATE +request was less than the size of the x87 + XMM save area, +or larger than returned in the +.Dv xsave_len +member of the +.Vt struct ptrace_xstate_info +from the +.Dv PT_GETXSTATE_INFO +request. .El .It Bq Er EBUSY .Bl -bullet -compact From owner-svn-src-head@freebsd.org Tue Jun 30 19:00:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7343199089C; Tue, 30 Jun 2015 19:00:33 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-ie0-x232.google.com (mail-ie0-x232.google.com [IPv6:2607:f8b0:4001: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 40675118F; Tue, 30 Jun 2015 19:00:33 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by ieqy10 with SMTP id y10so19270764ieq.0; Tue, 30 Jun 2015 12:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Nc5IwEQ/X/9dxoEIfBqmQJxscXilG2xQmp9NIfaUKFE=; b=bZaRjcCKje8QlDdVK4hdv2qwMmRQSW0r3vt6W08Ep64Xo0k2bCrLWMS10TiCGG9SPO MkAqt1cysWspP8Mi+84AbwA+Z/P5wHUpzK6b/llSZ2YWlKBgSFQ47I0Utz6ZlBREsDJh GWRXobYMUJvez0PJ1+lKNZX6ucmnWF8aOm/fmiBINNS0AhPbtgvO/ZcxTqtRnzqFvrK/ xt6zwa0mzcESyyEfzwwKqY/9VFea3KatsJPOUxZWMpzNr23hY7OC08K/bvrbVauRUhI4 GP9WfXSltQfuum7uyad8Yr6jMAdQK3BAdm4W1hKcYH7m+haRrUrYA2S0YGzcF/rrA5Dl bUug== MIME-Version: 1.0 X-Received: by 10.50.176.194 with SMTP id ck2mr26244959igc.2.1435690832393; Tue, 30 Jun 2015 12:00:32 -0700 (PDT) Sender: chmeeedalf@gmail.com Received: by 10.36.69.80 with HTTP; Tue, 30 Jun 2015 12:00:32 -0700 (PDT) In-Reply-To: <201506301853.t5UIrgrC060955@svn.freebsd.org> References: <201506301853.t5UIrgrC060955@svn.freebsd.org> Date: Tue, 30 Jun 2015 12:00:32 -0700 X-Google-Sender-Auth: d5GjCsqSW0wTctLf3OCDvgMGPxg Message-ID: Subject: Re: svn commit: r284965 - head/lib/libc/sys From: Justin Hibbits To: Konstantin Belousov Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 19:00:33 -0000 On Tue, Jun 30, 2015 at 11:53 AM, Konstantin Belousov wrote: > Author: kib > Date: Tue Jun 30 18:53:42 2015 > New Revision: 284965 > URL: https://svnweb.freebsd.org/changeset/base/284965 > > Log: > Document x86 machine-specific ptrace(2) requests. Provide list of the > ppc requests. > > Reviewed by: brueffer, emaste, gjb (previous version) > Sponsored by: The FreeBSD Foundation > Review: https://reviews.freebsd.org/D2962 > MFC after: 2 weeks > > Modified: > head/lib/libc/sys/ptrace.2 > ... > +.Sh PowerPC MACHINE-SPECIFIC REQUESTS > +.Bl -tag -width "Dv PT_SETVRREGS" > +.It Dv PT_GETVRREGS > +Returns the > +.Dv ALTIVEC > +machine state for the thread into the buffer pointed to by > +the argument > +.Fa addr . > +.Pp > +The > +.Fa data > +argument is ignored. > +.It Dv PT_SETVRREGS > +Set the > +.Dv ALTIVEC > +machine state for the thread from the buffer pointed to by > +the argument > +.Fa addr . > +.Pp > +The > +.Fa data > +argument is ignored. > +.El > +.Pp Thanks for documenting these. I'm way too lazy for my own good when it comes to documentation. - Justin From owner-svn-src-head@freebsd.org Tue Jun 30 19:06:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 344829909D2; Tue, 30 Jun 2015 19:06:15 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2266E19D7; Tue, 30 Jun 2015 19:06:15 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5UJ6Ft4066551; Tue, 30 Jun 2015 19:06:15 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5UJ6EDb066550; Tue, 30 Jun 2015 19:06:14 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201506301906.t5UJ6EDb066550@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Tue, 30 Jun 2015 19:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284967 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 19:06:15 -0000 Author: jmg Date: Tue Jun 30 19:06:14 2015 New Revision: 284967 URL: https://svnweb.freebsd.org/changeset/base/284967 Log: add units to the length and count so that it's clear what they are measured in... Gems like: "len is the length of the buffer." aren't useful in man pages. Modified: head/share/man/man9/hash.9 Modified: head/share/man/man9/hash.9 ============================================================================== --- head/share/man/man9/hash.9 Tue Jun 30 18:58:33 2015 (r284966) +++ head/share/man/man9/hash.9 Tue Jun 30 19:06:14 2015 (r284967) @@ -26,7 +26,7 @@ .\" $OpenBSD: hash.9,v 1.5 2003/04/17 05:08:39 jmc Exp $ .\" $FreeBSD$ .\" -.Dd October 18, 2014 +.Dd June 30, 2015 .Dt HASH 9 .Os .Sh NAME @@ -72,6 +72,13 @@ These functions can be used to hash .Dv NUL terminated strings, as well as blocks of memory. .Pp +A +.Fa len +argument is the length of the buffer in bytes. +A +.Fa count +argument is the length of the buffer in 32-bit words. +.Pp The .Fn hash32_buf function is used as a general buffer hashing function. @@ -79,7 +86,7 @@ The argument .Fa buf is used to pass in the location, and .Fa len -is the length of the buffer. +is the length of the buffer in bytes. The argument .Fa hash is used to extend an existing hash, or is passed the initial value From owner-svn-src-head@freebsd.org Tue Jun 30 19:18:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2406990C9C; Tue, 30 Jun 2015 19:18:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B94021F0E; Tue, 30 Jun 2015 19:18:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5UJI8hb071871; Tue, 30 Jun 2015 19:18:08 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5UJI8AK071870; Tue, 30 Jun 2015 19:18:08 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506301918.t5UJI8AK071870@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 30 Jun 2015 19:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284968 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 19:18:09 -0000 Author: gjb Date: Tue Jun 30 19:18:08 2015 New Revision: 284968 URL: https://svnweb.freebsd.org/changeset/base/284968 Log: Default the VAGRANT_VERSION to ${REVISION}-${BRANCH} if not set, which expands to '11.0-CURRENT', for example. If the branch is -CURRENT, -STABLE, or -PRERELEASE, suffix the VAGRANT_VERSION with the snapshot date. MFC after: 3 days X-MFC-Needs: r284893, r284895, r284896, r284897, r284942 Tested with: head@r284961 (patched) Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.vagrant Modified: head/release/Makefile.vagrant ============================================================================== --- head/release/Makefile.vagrant Tue Jun 30 19:06:14 2015 (r284967) +++ head/release/Makefile.vagrant Tue Jun 30 19:18:08 2015 (r284968) @@ -11,7 +11,7 @@ VAGRANT_UPLOAD_TGTS= vagrant-check-depen CLEANFILES+= ${VAGRANT_UPLOAD_TGTS} .if defined(VAGRANT_UPLOAD_CONF) && !empty(VAGRANT_UPLOAD_CONF) -. for VAR in _KEY _USERNAME _VERSION +. for VAR in _KEY _USERNAME VAGRANT${VAR}!= grep -E ^VAGRANT${VAR} ${VAGRANT_UPLOAD_CONF} | awk -F' ' '{print $$2}' ATLAS${VAR}:= ${VAGRANT${VAR}} . endfor @@ -21,6 +21,8 @@ ATLAS${VAR}:= ${VAGRANT${VAR}} SNAPSHOT_DATE!= date +-%Y-%m-%d-%H-%M .endif +VAGRANT_VERSION?= ${REVISION}-${BRANCH}${SNAPSHOT_DATE} + VAGRANT_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE}.box VAGRANT_PROVIDERS?= vmware_desktop #VAGRANT_PROVIDERS+= virtualbox @@ -54,7 +56,7 @@ vagrant-do-package-vmware: vagrant-creat atlas-do-upload: vagrant-do-package-vmware .for PROVIDER in ${VAGRANT_PROVIDERS} - ${.CURDIR}/scripts/atlas-upload.sh -b FreeBSD-${REVISION}-${BRANCH} -f ${VAGRANT_TARGET} -p ${PROVIDER} -k ${VAGRANT_KEY} -u ${VAGRANT_USERNAME} -v 0.1 + ${.CURDIR}/scripts/atlas-upload.sh -b FreeBSD-${REVISION}-${BRANCH} -f ${VAGRANT_TARGET} -p ${PROVIDER} -k ${VAGRANT_KEY} -u ${VAGRANT_USERNAME} -v ${VAGRANT_VERSION} .endfor touch ${.OBJDIR}/${.TARGET} From owner-svn-src-head@freebsd.org Tue Jun 30 19:35:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9262990413; Tue, 30 Jun 2015 19:35:14 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA4D21EEE; Tue, 30 Jun 2015 19:35:14 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5UJZExm081887; Tue, 30 Jun 2015 19:35:14 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5UJZEli081886; Tue, 30 Jun 2015 19:35:14 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201506301935.t5UJZEli081886@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 30 Jun 2015 19:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284969 - head/sys/modules/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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 19:35:15 -0000 Author: lwhsu (ports committer) Date: Tue Jun 30 19:35:14 2015 New Revision: 284969 URL: https://svnweb.freebsd.org/changeset/base/284969 Log: - Fix `make depend` in sys/modules Differential Revision: https://reviews.freebsd.org/D2951 Approved by: delphij Modified: head/sys/modules/hyperv/netvsc/Makefile Modified: head/sys/modules/hyperv/netvsc/Makefile ============================================================================== --- head/sys/modules/hyperv/netvsc/Makefile Tue Jun 30 19:18:08 2015 (r284968) +++ head/sys/modules/hyperv/netvsc/Makefile Tue Jun 30 19:35:14 2015 (r284969) @@ -6,7 +6,7 @@ KMOD= hv_netvsc SRCS= hv_net_vsc.c \ hv_netvsc_drv_freebsd.c \ hv_rndis_filter.c -SRCS+= bus_if.h device_if.h +SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/netvsc From owner-svn-src-head@freebsd.org Tue Jun 30 22:30:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66E10991ADE; Tue, 30 Jun 2015 22:30:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AD391AA0; Tue, 30 Jun 2015 22:30:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5UMUMX7070663; Tue, 30 Jun 2015 22:30:22 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5UMUMJJ070662; Tue, 30 Jun 2015 22:30:22 GMT (envelope-from np@FreeBSD.org) Message-Id: <201506302230.t5UMUMJJ070662@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Jun 2015 22:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284984 - head/tools/tools/cxgbetool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 22:30:22 -0000 Author: np Date: Tue Jun 30 22:30:21 2015 New Revision: 284984 URL: https://svnweb.freebsd.org/changeset/base/284984 Log: cxgbetool: fix code that decodes T5 SGE contexts. Some of the fields that changed between T4 and T5 were not displayed correctly. Obtained from: Chelsio MFC after: 3 days Differential Revision: Modified: head/tools/tools/cxgbetool/cxgbetool.c Modified: head/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- head/tools/tools/cxgbetool/cxgbetool.c Tue Jun 30 21:19:27 2015 (r284983) +++ head/tools/tools/cxgbetool/cxgbetool.c Tue Jun 30 22:30:21 2015 (r284984) @@ -1245,9 +1245,159 @@ show_struct(const uint32_t *words, int n #define FIELD1(name, start) FIELD(name, start, start) static void -show_sge_context(const struct t4_sge_context *p) +show_t5_ctxt(const struct t4_sge_context *p) { - static struct field_desc egress[] = { + static struct field_desc egress_t5[] = { + FIELD("DCA_ST:", 181, 191), + FIELD1("StatusPgNS:", 180), + FIELD1("StatusPgRO:", 179), + FIELD1("FetchNS:", 178), + FIELD1("FetchRO:", 177), + FIELD1("Valid:", 176), + FIELD("PCIeDataChannel:", 174, 175), + FIELD1("StatusPgTPHintEn:", 173), + FIELD("StatusPgTPHint:", 171, 172), + FIELD1("FetchTPHintEn:", 170), + FIELD("FetchTPHint:", 168, 169), + FIELD1("FCThreshOverride:", 167), + { "WRLength:", 162, 166, 9, 0, 1 }, + FIELD1("WRLengthKnown:", 161), + FIELD1("ReschedulePending:", 160), + FIELD1("OnChipQueue:", 159), + FIELD1("FetchSizeMode:", 158), + { "FetchBurstMin:", 156, 157, 4, 0, 1 }, + FIELD1("FLMPacking:", 155), + FIELD("FetchBurstMax:", 153, 154), + FIELD("uPToken:", 133, 152), + FIELD1("uPTokenEn:", 132), + FIELD1("UserModeIO:", 131), + FIELD("uPFLCredits:", 123, 130), + FIELD1("uPFLCreditEn:", 122), + FIELD("FID:", 111, 121), + FIELD("HostFCMode:", 109, 110), + FIELD1("HostFCOwner:", 108), + { "CIDXFlushThresh:", 105, 107, 0, 0, 1 }, + FIELD("CIDX:", 89, 104), + FIELD("PIDX:", 73, 88), + { "BaseAddress:", 18, 72, 9, 1 }, + FIELD("QueueSize:", 2, 17), + FIELD1("QueueType:", 1), + FIELD1("CachePriority:", 0), + { NULL } + }; + static struct field_desc fl_t5[] = { + FIELD("DCA_ST:", 181, 191), + FIELD1("StatusPgNS:", 180), + FIELD1("StatusPgRO:", 179), + FIELD1("FetchNS:", 178), + FIELD1("FetchRO:", 177), + FIELD1("Valid:", 176), + FIELD("PCIeDataChannel:", 174, 175), + FIELD1("StatusPgTPHintEn:", 173), + FIELD("StatusPgTPHint:", 171, 172), + FIELD1("FetchTPHintEn:", 170), + FIELD("FetchTPHint:", 168, 169), + FIELD1("FCThreshOverride:", 167), + FIELD1("ReschedulePending:", 160), + FIELD1("OnChipQueue:", 159), + FIELD1("FetchSizeMode:", 158), + { "FetchBurstMin:", 156, 157, 4, 0, 1 }, + FIELD1("FLMPacking:", 155), + FIELD("FetchBurstMax:", 153, 154), + FIELD1("FLMcongMode:", 152), + FIELD("MaxuPFLCredits:", 144, 151), + FIELD("FLMcontextID:", 133, 143), + FIELD1("uPTokenEn:", 132), + FIELD1("UserModeIO:", 131), + FIELD("uPFLCredits:", 123, 130), + FIELD1("uPFLCreditEn:", 122), + FIELD("FID:", 111, 121), + FIELD("HostFCMode:", 109, 110), + FIELD1("HostFCOwner:", 108), + { "CIDXFlushThresh:", 105, 107, 0, 0, 1 }, + FIELD("CIDX:", 89, 104), + FIELD("PIDX:", 73, 88), + { "BaseAddress:", 18, 72, 9, 1 }, + FIELD("QueueSize:", 2, 17), + FIELD1("QueueType:", 1), + FIELD1("CachePriority:", 0), + { NULL } + }; + static struct field_desc ingress_t5[] = { + FIELD("DCA_ST:", 143, 153), + FIELD1("ISCSICoalescing:", 142), + FIELD1("Queue_Valid:", 141), + FIELD1("TimerPending:", 140), + FIELD1("DropRSS:", 139), + FIELD("PCIeChannel:", 137, 138), + FIELD1("SEInterruptArmed:", 136), + FIELD1("CongestionMgtEnable:", 135), + FIELD1("NoSnoop:", 134), + FIELD1("RelaxedOrdering:", 133), + FIELD1("GTSmode:", 132), + FIELD1("TPHintEn:", 131), + FIELD("TPHint:", 129, 130), + FIELD1("UpdateScheduling:", 128), + FIELD("UpdateDelivery:", 126, 127), + FIELD1("InterruptSent:", 125), + FIELD("InterruptIDX:", 114, 124), + FIELD1("InterruptDestination:", 113), + FIELD1("InterruptArmed:", 112), + FIELD("RxIntCounter:", 106, 111), + FIELD("RxIntCounterThreshold:", 104, 105), + FIELD1("Generation:", 103), + { "BaseAddress:", 48, 102, 9, 1 }, + FIELD("PIDX:", 32, 47), + FIELD("CIDX:", 16, 31), + { "QueueSize:", 4, 15, 4, 0 }, + { "QueueEntrySize:", 2, 3, 4, 0, 1 }, + FIELD1("QueueEntryOverride:", 1), + FIELD1("CachePriority:", 0), + { NULL } + }; + static struct field_desc flm_t5[] = { + FIELD1("Valid:", 89), + FIELD("SplitLenMode:", 87, 88), + FIELD1("TPHintEn:", 86), + FIELD("TPHint:", 84, 85), + FIELD1("NoSnoop:", 83), + FIELD1("RelaxedOrdering:", 82), + FIELD("DCA_ST:", 71, 81), + FIELD("EQid:", 54, 70), + FIELD("SplitEn:", 52, 53), + FIELD1("PadEn:", 51), + FIELD1("PackEn:", 50), + FIELD1("Cache_Lock :", 49), + FIELD1("CongDrop:", 48), + FIELD("PackOffset:", 16, 47), + FIELD("CIDX:", 8, 15), + FIELD("PIDX:", 0, 7), + { NULL } + }; + static struct field_desc conm_t5[] = { + FIELD1("CngMPSEnable:", 21), + FIELD("CngTPMode:", 19, 20), + FIELD1("CngDBPHdr:", 18), + FIELD1("CngDBPData:", 17), + FIELD1("CngIMSG:", 16), + { "CngChMap:", 0, 15, 0, 1, 0 }, + { NULL } + }; + + if (p->mem_id == SGE_CONTEXT_EGRESS) + show_struct(p->data, 6, (p->data[0] & 2) ? fl_t5 : egress_t5); + else if (p->mem_id == SGE_CONTEXT_FLM) + show_struct(p->data, 3, flm_t5); + else if (p->mem_id == SGE_CONTEXT_INGRESS) + show_struct(p->data, 5, ingress_t5); + else if (p->mem_id == SGE_CONTEXT_CNM) + show_struct(p->data, 1, conm_t5); +} + +static void +show_t4_ctxt(const struct t4_sge_context *p) +{ + static struct field_desc egress_t4[] = { FIELD1("StatusPgNS:", 180), FIELD1("StatusPgRO:", 179), FIELD1("FetchNS:", 178), @@ -1281,7 +1431,7 @@ show_sge_context(const struct t4_sge_con FIELD1("CachePriority:", 0), { NULL } }; - static struct field_desc fl[] = { + static struct field_desc fl_t4[] = { FIELD1("StatusPgNS:", 180), FIELD1("StatusPgRO:", 179), FIELD1("FetchNS:", 178), @@ -1291,8 +1441,6 @@ show_sge_context(const struct t4_sge_con FIELD1("DCAEgrQEn:", 173), FIELD("DCACPUID:", 168, 172), FIELD1("FCThreshOverride:", 167), - FIELD("WRLength:", 162, 166), - FIELD1("WRLengthKnown:", 161), FIELD1("ReschedulePending:", 160), FIELD1("OnChipQueue:", 159), FIELD1("FetchSizeMode", 158), @@ -1317,7 +1465,7 @@ show_sge_context(const struct t4_sge_con FIELD1("CachePriority:", 0), { NULL } }; - static struct field_desc ingress[] = { + static struct field_desc ingress_t4[] = { FIELD1("NoSnoop:", 145), FIELD1("RelaxedOrdering:", 144), FIELD1("GTSmode:", 143), @@ -1348,7 +1496,7 @@ show_sge_context(const struct t4_sge_con FIELD1("CachePriority:", 0), { NULL } }; - static struct field_desc flm[] = { + static struct field_desc flm_t4[] = { FIELD1("NoSnoop:", 79), FIELD1("RelaxedOrdering:", 78), FIELD1("Valid:", 77), @@ -1364,31 +1512,22 @@ show_sge_context(const struct t4_sge_con FIELD("PIDX:", 0, 7), { NULL } }; - static struct field_desc conm[] = { + static struct field_desc conm_t4[] = { FIELD1("CngDBPHdr:", 6), FIELD1("CngDBPData:", 5), FIELD1("CngIMSG:", 4), { "CngChMap:", 0, 3, 0, 1, 0}, { NULL } }; - static struct field_desc t5_conm[] = { - FIELD1("CngMPSEnable:", 21), - FIELD("CngTPMode:", 19, 20), - FIELD1("CngDBPHdr:", 18), - FIELD1("CngDBPData:", 17), - FIELD1("CngIMSG:", 16), - { "CngChMap:", 0, 15, 0, 1, 0}, - { NULL } - }; if (p->mem_id == SGE_CONTEXT_EGRESS) - show_struct(p->data, 6, (p->data[0] & 2) ? fl : egress); + show_struct(p->data, 6, (p->data[0] & 2) ? fl_t4 : egress_t4); else if (p->mem_id == SGE_CONTEXT_FLM) - show_struct(p->data, 3, flm); + show_struct(p->data, 3, flm_t4); else if (p->mem_id == SGE_CONTEXT_INGRESS) - show_struct(p->data, 5, ingress); + show_struct(p->data, 5, ingress_t4); else if (p->mem_id == SGE_CONTEXT_CNM) - show_struct(p->data, 1, chip_id == 5 ? t5_conm : conm); + show_struct(p->data, 1, conm_t4); } #undef FIELD @@ -1432,7 +1571,11 @@ get_sge_context(int argc, const char *ar if (rc != 0) return (rc); - show_sge_context(&cntxt); + if (chip_id == 4) + show_t4_ctxt(&cntxt); + else + show_t5_ctxt(&cntxt); + return (0); } From owner-svn-src-head@freebsd.org Wed Jul 1 00:34:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84F04991A31; Wed, 1 Jul 2015 00:34:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C3D1194D; Wed, 1 Jul 2015 00:34:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t610YFi5035714; Wed, 1 Jul 2015 00:34:15 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t610YFK0035713; Wed, 1 Jul 2015 00:34:15 GMT (envelope-from np@FreeBSD.org) Message-Id: <201507010034.t610YFK0035713@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 1 Jul 2015 00:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284988 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 00:34:15 -0000 Author: np Date: Wed Jul 1 00:34:14 2015 New Revision: 284988 URL: https://svnweb.freebsd.org/changeset/base/284988 Log: cxgbe(4): request an automatic tx update when a netmap tx queue idles. The NIC tx queues already do this. MFC after: 1 week Differential Revision: Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Jun 30 23:21:59 2015 (r284987) +++ head/sys/dev/cxgbe/t4_netmap.c Wed Jul 1 00:34:14 2015 (r284988) @@ -405,8 +405,8 @@ alloc_nm_txq_hwq(struct port_info *pi, s V_FW_EQ_ETH_CMD_VFN(0)); c.alloc_to_len16 = htobe32(F_FW_EQ_ETH_CMD_ALLOC | F_FW_EQ_ETH_CMD_EQSTART | FW_LEN16(c)); - c.autoequiqe_to_viid = htobe32(F_FW_EQ_ETH_CMD_AUTOEQUEQE | - V_FW_EQ_ETH_CMD_VIID(pi->nm_viid)); + c.autoequiqe_to_viid = htobe32(F_FW_EQ_ETH_CMD_AUTOEQUIQE | + F_FW_EQ_ETH_CMD_AUTOEQUEQE | V_FW_EQ_ETH_CMD_VIID(pi->nm_viid)); c.fetchszm_to_iqid = htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | V_FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO | From owner-svn-src-head@freebsd.org Wed Jul 1 08:48:50 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 275E99912AF; Wed, 1 Jul 2015 08:48:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 190182E01; Wed, 1 Jul 2015 08:48:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t618mn1N083647; Wed, 1 Jul 2015 08:48:49 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t618mnYk083646; Wed, 1 Jul 2015 08:48:49 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201507010848.t618mnYk083646@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 1 Jul 2015 08:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284996 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 08:48:50 -0000 Author: gjb Date: Wed Jul 1 08:48:49 2015 New Revision: 284996 URL: https://svnweb.freebsd.org/changeset/base/284996 Log: Fix the gcloud port/package name. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.gce Modified: head/release/Makefile.gce ============================================================================== --- head/release/Makefile.gce Wed Jul 1 08:06:15 2015 (r284995) +++ head/release/Makefile.gce Wed Jul 1 08:48:49 2015 (r284996) @@ -36,13 +36,13 @@ gce-check-depends: . endif .endfor .if !exists(/usr/local/bin/gcutil) -. if !exists(${PORTSDIR}/net/google-cloud-api/Makefile) +. if !exists(${PORTSDIR}/net/google-cloud-sdk/Makefile) . if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf . endif - env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-api + env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk . else - make -C ${PORTSDIR}/net/google-cloud-api BATCH=1 all install clean + make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean . endif .endif From owner-svn-src-head@freebsd.org Wed Jul 1 09:25:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0D16992C7D; Wed, 1 Jul 2015 09:25:23 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2173292E; Wed, 1 Jul 2015 09:25:23 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t619PNEp002921; Wed, 1 Jul 2015 09:25:23 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t619PNnb002920; Wed, 1 Jul 2015 09:25:23 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201507010925.t619PNnb002920@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 1 Jul 2015 09:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284997 - head/lib/libgpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 09:25:23 -0000 Author: brueffer Date: Wed Jul 1 09:25:23 2015 New Revision: 284997 URL: https://svnweb.freebsd.org/changeset/base/284997 Log: Make the example code actually work. PR: 199440 Submitted by: waitman@waitman.net Reviewed by: loos MFC after: 1 week Modified: head/lib/libgpio/gpio.3 Modified: head/lib/libgpio/gpio.3 ============================================================================== --- head/lib/libgpio/gpio.3 Wed Jul 1 08:48:49 2015 (r284996) +++ head/lib/libgpio/gpio.3 Wed Jul 1 09:25:23 2015 (r284997) @@ -35,6 +35,7 @@ .Sh LIBRARY .Lb libgpio .Sh SYNOPSIS +.In sys/types.h .In libgpio.h .Ft "gpio_handle_t" .Fn gpio_open "unsigned int unit" @@ -161,13 +162,14 @@ are wrappers around The following example shows how to configure pin 16 as output and then drive it high: .Bd -literal +#include #include #include gpio_handle_t handle; handle = gpio_open(0); -if (handle == GPIO_HANDLE_INVALID) +if (handle == GPIO_INVALID_HANDLE) err(1, "gpio_open failed"); gpio_pin_output(handle, 16); gpio_pin_high(handle, 16); From owner-svn-src-head@freebsd.org Wed Jul 1 10:04:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C2FD990748; Wed, 1 Jul 2015 10:04:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9D7C71E10; Wed, 1 Jul 2015 10:04:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA07445; Wed, 01 Jul 2015 13:04:02 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ZAEs6-0008oh-23; Wed, 01 Jul 2015 13:04:02 +0300 Message-ID: <5593BADF.6060307@FreeBSD.org> Date: Wed, 01 Jul 2015 13:03:11 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Glen Barber , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r284829 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml References: <201506251844.t5PIiWS7047224@svn.freebsd.org> In-Reply-To: <201506251844.t5PIiWS7047224@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 10:04:23 -0000 On 25/06/2015 21:44, Glen Barber wrote: > Author: gjb > Date: Thu Jun 25 18:44:31 2015 > New Revision: 284829 > URL: https://svnweb.freebsd.org/changeset/base/284829 > > Log: > Document r284297, lockstat(1) improvements. > Add ClusterHQ to sponsors.ent. Glen, thank you very much. A couple of small suggestions / corrections below: > Sponsored by: The FreeBSD Foundation > > Modified: > head/release/doc/en_US.ISO8859-1/relnotes/article.xml > head/release/doc/share/xml/sponsor.ent > > Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml > ============================================================================== > --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 25 18:44:29 2015 (r284828) > +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 25 18:44:31 2015 (r284829) > @@ -345,6 +345,32 @@ > would cause final results to be sent to &man.stderr.4; when > receiving the SIGINFO signal has been > fixed. > + > + + sponsor="&clusterhq;">The &man.lockstat.1; utility has been > + updated with several improvements: > + > + > + > + Spin locks are now reported as the amount of time > + spinning, instead of loop iterations. > + > + > + > + Reader locks are now recognized as adaptive and can > + spin on &os;. Reader locks are now recognized as adaptive that can spin [contesting threads can both block/sleep and spin on the adaptive locks depending on a state of a current lock holder -- avg]. > + > + > + > + Lock aquisition events for successful reader try-lock > + events are now reported. > + > + > + > + Spin-and-block events that occur before lock > + acquisition are now reported. > + Spin and block events [two different kinds of events -- avg] are now reported before lock acquisition events [temporal order -- avg]. > + > > > > > Modified: head/release/doc/share/xml/sponsor.ent > ============================================================================== > --- head/release/doc/share/xml/sponsor.ent Thu Jun 25 18:44:29 2015 (r284828) > +++ head/release/doc/share/xml/sponsor.ent Thu Jun 25 18:44:31 2015 (r284829) > @@ -15,6 +15,8 @@ > > > > + > + > > > > -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed Jul 1 10:28:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 549FA991072; Wed, 1 Jul 2015 10:28:45 +0000 (UTC) (envelope-from gjb@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 427732F5C; Wed, 1 Jul 2015 10:28:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 868E416B6; Wed, 1 Jul 2015 10:28:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 1 Jul 2015 10:28:42 +0000 From: Glen Barber To: Andriy Gapon Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r284829 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml Message-ID: <20150701102842.GQ5423@FreeBSD.org> References: <201506251844.t5PIiWS7047224@svn.freebsd.org> <5593BADF.6060307@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Df9iGvjWRAzg/a8v" Content-Disposition: inline In-Reply-To: <5593BADF.6060307@FreeBSD.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 10:28:45 -0000 --Df9iGvjWRAzg/a8v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Andriy, On Wed, Jul 01, 2015 at 01:03:11PM +0300, Andriy Gapon wrote: > On 25/06/2015 21:44, Glen Barber wrote: > > Author: gjb > > Date: Thu Jun 25 18:44:31 2015 > > New Revision: 284829 > > URL: https://svnweb.freebsd.org/changeset/base/284829 > >=20 > > Log: > > Document r284297, lockstat(1) improvements. > > Add ClusterHQ to sponsors.ent. >=20 > Glen, >=20 > thank you very much. > A couple of small suggestions / corrections below: >=20 > > Sponsored by: The FreeBSD Foundation > >=20 > > Modified: > > head/release/doc/en_US.ISO8859-1/relnotes/article.xml > > head/release/doc/share/xml/sponsor.ent > >=20 > > Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 25 18= :44:29 2015 (r284828) > > +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 25 18= :44:31 2015 (r284829) > > @@ -345,6 +345,32 @@ > > would cause final results to be sent to &man.stderr.4; when > > receiving the SIGINFO signal has been > > fixed. > > + > > + > + sponsor=3D"&clusterhq;">The &man.lockstat.1; utility has been > > + updated with several improvements: > > + > > + > > + > > + Spin locks are now reported as the amount of time > > + spinning, instead of loop iterations. > > + > > + > > + > > + Reader locks are now recognized as adaptive and can > > + spin on &os;. >=20 > Reader locks are now recognized as adaptive that can spin [contesting thr= eads > can both block/sleep and spin on the adaptive locks depending on a state = of a > current lock holder -- avg]. >=20 Thank you for reviewing the text. For my own clarification, the text within brackets should be included as correction/clarification, or is it just for further clarification for the context? Thanks. Glen > > + > > + > > + > > + Lock aquisition events for successful reader try-lock > > + events are now reported. > > + > > + > > + > > + Spin-and-block events that occur before lock > > + acquisition are now reported. > > + >=20 > Spin and block events [two different kinds of events -- avg] are now repo= rted > before lock acquisition events [temporal order -- avg]. >=20 > > + > > > > =20 > > > >=20 > > Modified: head/release/doc/share/xml/sponsor.ent > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/release/doc/share/xml/sponsor.ent Thu Jun 25 18:44:29 2015 (r2= 84828) > > +++ head/release/doc/share/xml/sponsor.ent Thu Jun 25 18:44:31 2015 (r2= 84829) > > @@ -15,6 +15,8 @@ > > > > > > =20 > > + > > + > > > > > > =20 > >=20 >=20 >=20 > --=20 > Andriy Gapon >=20 --Df9iGvjWRAzg/a8v Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVk8DaAAoJEAMUWKVHj+KTTF4P/3pHqJpibo7CG5lWBFvUurCx R+fz1EF9DLxbLhI9mZYfsXsCM8X2zqJZL343V48scfRixBAFHkqXlhkeIT0TP8RU /kiEyIEBjfyygFuyPpEAtBQL6wkpKmij2B0mqxlqzBW1cGcqH4aVmpAkVP0YCwoJ iE1ScesqVHmdWs0dO7JUqhovsqn1H9MpdHgvjT8LnSLf0tOj4LShEGEWljbQMIzF 9UezMFCekM+MJo9YmBhr6rqJKL2EqQ/yTEltjN2BebKcDRTYb2l9yuYNKtpqMj8B yLjdH72pulNOMV0Imz/U0Bg+kaLYBYxBAO3+uqqamwXOtCBp+brNcAqVUEZxM94O VdNOp9NXbs2xXsmjQzWLtCjtDR26PjN8fA9CHw2cBtHDLnQKidTH62LmaKAxRXK2 8Ac9AjknUIzbfLrMyna/WQe2DiYjPHxpC/lrFMudAF6QOpR+CQmPtlzKyl0AIlKK KXHUJ9p8AQjPtGsiub0/2des4EMMx71v1twXrGpPzUcROk8NpqSqWLPk0pwTnMHF MNbqhdUuUivksbodgnLJpj5vf+1LEfE9Xy9CzHoo0F20YRTk/ymo7Bm7rHPARDES 8ONDjUOj63UOOJlhYqKVTGSngDoLe9Ne/LfYkaqoUtnYIkQA6XuJq9OvyaOTxR+r o7oSBtiAEVijxMLb+oVb =qjrf -----END PGP SIGNATURE----- --Df9iGvjWRAzg/a8v-- From owner-svn-src-head@freebsd.org Wed Jul 1 10:33:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B05629913A1; Wed, 1 Jul 2015 10:33:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F3D819C2; Wed, 1 Jul 2015 10:33:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t61AXJUp038881; Wed, 1 Jul 2015 10:33:19 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t61AXJum038880; Wed, 1 Jul 2015 10:33:19 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201507011033.t61AXJum038880@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 1 Jul 2015 10:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285000 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 10:33:19 -0000 Author: gjb Date: Wed Jul 1 10:33:19 2015 New Revision: 285000 URL: https://svnweb.freebsd.org/changeset/base/285000 Log: Refine the lockstat(1) entry based on corrections and clarifications received during review. Submitted by: avg Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Jul 1 10:17:17 2015 (r284999) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Jul 1 10:33:19 2015 (r285000) @@ -353,7 +353,7 @@ - Reader locks are now recognized as adaptive and can + Reader locks are now recognized as adaptive that can spin on &os;. @@ -363,8 +363,8 @@ - Spin-and-block events that occur before lock - acquisition are now reported. + Spin and block events are now reported before lock + acquisition events. From owner-svn-src-head@freebsd.org Wed Jul 1 13:59:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96DFB990F6B; Wed, 1 Jul 2015 13:59:27 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 717141E7A; Wed, 1 Jul 2015 13:59:27 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t61DxRrR041407; Wed, 1 Jul 2015 13:59:27 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t61DxQEB041405; Wed, 1 Jul 2015 13:59:26 GMT (envelope-from br@FreeBSD.org) Message-Id: <201507011359.t61DxQEB041405@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 1 Jul 2015 13:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285003 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 13:59:27 -0000 Author: br Date: Wed Jul 1 13:59:26 2015 New Revision: 285003 URL: https://svnweb.freebsd.org/changeset/base/285003 Log: Make libproc compilable on AArch64. Modified: head/lib/libproc/proc_bkpt.c head/lib/libproc/proc_regs.c Modified: head/lib/libproc/proc_bkpt.c ============================================================================== --- head/lib/libproc/proc_bkpt.c Wed Jul 1 11:28:42 2015 (r285002) +++ head/lib/libproc/proc_bkpt.c Wed Jul 1 13:59:26 2015 (r285003) @@ -42,18 +42,24 @@ __FBSDID("$FreeBSD$"); #include #include "_libproc.h" -#if defined(__i386__) || defined(__amd64__) -#define BREAKPOINT_INSTR 0xcc /* int 0x3 */ +#if defined(__aarch64__) +#define AARCH64_BRK 0xd4200000 +#define AARCH64_BRK_IMM16_SHIFT 5 +#define AARCH64_BRK_IMM16_VAL (0xd << AARCH64_BRK_IMM16_SHIFT) +#define BREAKPOINT_INSTR (AARCH64_BRK | AARCH64_BRK_IMM16_VAL) +#define BREAKPOINT_INSTR_SZ 4 +#elif defined(__amd64__) || defined(__i386__) +#define BREAKPOINT_INSTR 0xcc /* int 0x3 */ #define BREAKPOINT_INSTR_SZ 1 +#elif defined(__arm__) +#define BREAKPOINT_INSTR 0xe7ffffff /* bkpt */ +#define BREAKPOINT_INSTR_SZ 4 #elif defined(__mips__) -#define BREAKPOINT_INSTR 0xd /* break */ +#define BREAKPOINT_INSTR 0xd /* break */ #define BREAKPOINT_INSTR_SZ 4 #elif defined(__powerpc__) -#define BREAKPOINT_INSTR 0x7fe00008 /* trap */ -#define BREAKPOINT_INSTR_SZ 4 -#elif defined(__arm__) -#define BREAKPOINT_INSTR 0xe7ffffff /* bkpt */ -#define BREAKPOINT_INSTR_SZ 4 +#define BREAKPOINT_INSTR 0x7fe00008 /* trap */ +#define BREAKPOINT_INSTR_SZ 4 #else #error "Add support for your architecture" #endif Modified: head/lib/libproc/proc_regs.c ============================================================================== --- head/lib/libproc/proc_regs.c Wed Jul 1 11:28:42 2015 (r285002) +++ head/lib/libproc/proc_regs.c Wed Jul 1 13:59:26 2015 (r285003) @@ -54,7 +54,9 @@ proc_regget(struct proc_handle *phdl, pr return (-1); switch (reg) { case REG_PC: -#if defined(__amd64__) +#if defined(__aarch64__) + *regvalue = regs.elr; +#elif defined(__amd64__) *regvalue = regs.r_rip; #elif defined(__arm__) *regvalue = regs.r_pc; @@ -67,7 +69,9 @@ proc_regget(struct proc_handle *phdl, pr #endif break; case REG_SP: -#if defined(__amd64__) +#if defined(__aarch64__) + *regvalue = regs.sp; +#elif defined(__amd64__) *regvalue = regs.r_rsp; #elif defined(__arm__) *regvalue = regs.r_sp; @@ -101,7 +105,9 @@ proc_regset(struct proc_handle *phdl, pr return (-1); switch (reg) { case REG_PC: -#if defined(__amd64__) +#if defined(__aarch64__) + regs.elr = regvalue; +#elif defined(__amd64__) regs.r_rip = regvalue; #elif defined(__arm__) regs.r_pc = regvalue; @@ -114,7 +120,9 @@ proc_regset(struct proc_handle *phdl, pr #endif break; case REG_SP: -#if defined(__amd64__) +#if defined(__aarch64__) + regs.sp = regvalue; +#elif defined(__amd64__) regs.r_rsp = regvalue; #elif defined(__arm__) regs.r_sp = regvalue; From owner-svn-src-head@freebsd.org Wed Jul 1 14:10:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40F3799121D; Wed, 1 Jul 2015 14:10:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1864B279D; Wed, 1 Jul 2015 14:10:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t61E9x0L046924; Wed, 1 Jul 2015 14:09:59 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t61E9xfX046922; Wed, 1 Jul 2015 14:09:59 GMT (envelope-from br@FreeBSD.org) Message-Id: <201507011409.t61E9xfX046922@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 1 Jul 2015 14:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285004 - head/sys/cddl/dev/fbt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 14:10:00 -0000 Author: br Date: Wed Jul 1 14:09:59 2015 New Revision: 285004 URL: https://svnweb.freebsd.org/changeset/base/285004 Log: Add a central location for exclusion checks. We check here if function is excluded from FBT instrumentation. Reviewed by: andrew, emaste, markj Differential Revision: https://reviews.freebsd.org/D2899 Modified: head/sys/cddl/dev/fbt/fbt.c head/sys/cddl/dev/fbt/fbt.h Modified: head/sys/cddl/dev/fbt/fbt.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt.c Wed Jul 1 13:59:26 2015 (r285003) +++ head/sys/cddl/dev/fbt/fbt.c Wed Jul 1 14:09:59 2015 (r285004) @@ -111,6 +111,37 @@ static struct cdev *fbt_cdev; static int fbt_probetab_size; static int fbt_verbose = 0; +int +fbt_excluded(const char *name) +{ + + if (strncmp(name, "dtrace_", 7) == 0 && + strncmp(name, "dtrace_safe_", 12) != 0) { + /* + * Anything beginning with "dtrace_" may be called + * from probe context unless it explicitly indicates + * that it won't be called from probe context by + * using the prefix "dtrace_safe_". + */ + return (1); + } + + /* Exclude some internal functions */ + if (name[0] == '_' && name[1] == '_') + return (1); + + /* + * When DTrace is built into the kernel we need to exclude + * the FBT functions from instrumentation. + */ +#ifndef _KLD_MODULE + if (strncmp(name, "fbt_", 4) == 0) + return (1); +#endif + + return (0); +} + static void fbt_doubletrap(void) { Modified: head/sys/cddl/dev/fbt/fbt.h ============================================================================== --- head/sys/cddl/dev/fbt/fbt.h Wed Jul 1 13:59:26 2015 (r285003) +++ head/sys/cddl/dev/fbt/fbt.h Wed Jul 1 14:09:59 2015 (r285004) @@ -58,6 +58,7 @@ int fbt_invop(uintptr_t, uintptr_t *, ui void fbt_patch_tracepoint(fbt_probe_t *, fbt_patchval_t); int fbt_provide_module_function(struct linker_file *, int, struct linker_symval *, void *); +int fbt_excluded(const char *name); extern dtrace_provider_id_t fbt_id; extern fbt_probe_t **fbt_probetab; From owner-svn-src-head@freebsd.org Wed Jul 1 14:51:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3AAE991DAD; Wed, 1 Jul 2015 14:51:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B25825D6; Wed, 1 Jul 2015 14:51:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t61EpRdY068570; Wed, 1 Jul 2015 14:51:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t61EpQ9n068562; Wed, 1 Jul 2015 14:51:26 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201507011451.t61EpQ9n068562@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 1 Jul 2015 14:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285005 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 14:51:27 -0000 Author: gjb Date: Wed Jul 1 14:51:26 2015 New Revision: 285005 URL: https://svnweb.freebsd.org/changeset/base/285005 Log: Remove the HH-MM suffix from the build date suffix. It was useful when working out several kinks when testing automated image uploading when retrying was necessary, but now it is making things much too messy. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.azure head/release/Makefile.ec2 head/release/Makefile.gce head/release/Makefile.vagrant Modified: head/release/Makefile.azure ============================================================================== --- head/release/Makefile.azure Wed Jul 1 14:09:59 2015 (r285004) +++ head/release/Makefile.azure Wed Jul 1 14:51:26 2015 (r285005) @@ -17,7 +17,7 @@ AZURE${VAR}!= grep -E ^AZURE${VAR} ${AZU .endif .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" -SNAPSHOT_DATE!= date +-%Y-%m-%d-%H-%M +SNAPSHOT_DATE!= date +-%Y-%m-%d .endif AZURE_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE}.vhd Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Wed Jul 1 14:09:59 2015 (r285004) +++ head/release/Makefile.ec2 Wed Jul 1 14:51:26 2015 (r285005) @@ -6,7 +6,7 @@ # .if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE" -AMINAMESUFFIX!= date +-%Y-%m-%d-%H-%M +AMINAMESUFFIX!= date +-%Y-%m-%d .endif .if defined(EC2PUBLIC) PUBLISH= --public Modified: head/release/Makefile.gce ============================================================================== --- head/release/Makefile.gce Wed Jul 1 14:09:59 2015 (r285004) +++ head/release/Makefile.gce Wed Jul 1 14:51:26 2015 (r285005) @@ -19,7 +19,7 @@ CLEANFILES+= ${GCE_UPLOAD_TGTS} GCE_BUCKET?= .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" -SNAPSHOT_DATE!= date +-%Y-%m-%d-%H-%M +SNAPSHOT_DATE!= date +-%Y-%m-%d .endif # Really? Uppercase characters are not allowed? Sigh... Modified: head/release/Makefile.vagrant ============================================================================== --- head/release/Makefile.vagrant Wed Jul 1 14:09:59 2015 (r285004) +++ head/release/Makefile.vagrant Wed Jul 1 14:51:26 2015 (r285005) @@ -18,7 +18,7 @@ ATLAS${VAR}:= ${VAGRANT${VAR}} .endif .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" -SNAPSHOT_DATE!= date +-%Y-%m-%d-%H-%M +SNAPSHOT_DATE!= date +-%Y-%m-%d .endif VAGRANT_VERSION?= ${REVISION}-${BRANCH}${SNAPSHOT_DATE} From owner-svn-src-head@freebsd.org Wed Jul 1 14:54:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FD21991DFF; Wed, 1 Jul 2015 14:54:14 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10EDA294A; Wed, 1 Jul 2015 14:54:14 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t61EsDQZ070863; Wed, 1 Jul 2015 14:54:13 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t61EsDhL070862; Wed, 1 Jul 2015 14:54:13 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201507011454.t61EsDhL070862@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 1 Jul 2015 14:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285006 - head/sys/dev/nand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 14:54:14 -0000 Author: brueffer Date: Wed Jul 1 14:54:13 2015 New Revision: 285006 URL: https://svnweb.freebsd.org/changeset/base/285006 Log: Use the correct le*dec function to decode a 16bit type. PR: 194228 Submitted by: David Horwitt MFC after: 2 weeks Modified: head/sys/dev/nand/nand_generic.c Modified: head/sys/dev/nand/nand_generic.c ============================================================================== --- head/sys/dev/nand/nand_generic.c Wed Jul 1 14:51:26 2015 (r285005) +++ head/sys/dev/nand/nand_generic.c Wed Jul 1 14:54:13 2015 (r285006) @@ -392,7 +392,7 @@ onfi_read_parameter(struct nand_chip *ch chip_params->blocks_per_lun = le32dec(¶ms.blocks_per_lun); chip_params->pages_per_block = le32dec(¶ms.pages_per_block); chip_params->bytes_per_page = le32dec(¶ms.bytes_per_page); - chip_params->spare_bytes_per_page = le32dec(¶ms.spare_bytes_per_page); + chip_params->spare_bytes_per_page = le16dec(¶ms.spare_bytes_per_page); chip_params->t_bers = le16dec(¶ms.t_bers); chip_params->t_prog = le16dec(¶ms.t_prog); chip_params->t_r = le16dec(¶ms.t_r); From owner-svn-src-head@freebsd.org Wed Jul 1 15:51:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61190991BA0; Wed, 1 Jul 2015 15:51:16 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FCFA12A7; Wed, 1 Jul 2015 15:51:16 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t61FpG8J099962; Wed, 1 Jul 2015 15:51:16 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t61FpB0F099937; Wed, 1 Jul 2015 15:51:11 GMT (envelope-from br@FreeBSD.org) Message-Id: <201507011551.t61FpB0F099937@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 1 Jul 2015 15:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285009 - in head: . cddl/contrib/opensolaris/lib/libdtrace/aarch64 cddl/contrib/opensolaris/lib/libdtrace/common cddl/lib cddl/lib/libdtrace cddl/usr.sbin lib sys/arm64/arm64 sys/cddl/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 15:51:16 -0000 Author: br Date: Wed Jul 1 15:51:11 2015 New Revision: 285009 URL: https://svnweb.freebsd.org/changeset/base/285009 Log: First cut of DTrace for AArch64. Reviewed by: andrew, emaste Sponsored by: ARM Limited Differential Revision: https://reviews.freebsd.org/D2738 Added: head/cddl/contrib/opensolaris/lib/libdtrace/aarch64/ head/cddl/contrib/opensolaris/lib/libdtrace/aarch64/dt_isadep.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/aarch64/ head/sys/cddl/contrib/opensolaris/uts/aarch64/dtrace/ head/sys/cddl/contrib/opensolaris/uts/aarch64/dtrace/fasttrap_isa.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/aarch64/sys/ head/sys/cddl/contrib/opensolaris/uts/aarch64/sys/fasttrap_isa.h (contents, props changed) head/sys/cddl/dev/dtrace/aarch64/ head/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S (contents, props changed) head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c (contents, props changed) head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c (contents, props changed) head/sys/cddl/dev/dtrace/aarch64/regset.h (contents, props changed) head/sys/cddl/dev/fbt/aarch64/ head/sys/cddl/dev/fbt/aarch64/fbt_isa.c (contents, props changed) head/sys/cddl/dev/fbt/aarch64/fbt_isa.h (contents, props changed) Modified: head/Makefile.inc1 head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c head/cddl/lib/Makefile head/cddl/lib/libdtrace/Makefile head/cddl/usr.sbin/Makefile head/lib/Makefile head/sys/arm64/arm64/exception.S head/sys/arm64/arm64/trap.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/lockstat/lockstat.c head/sys/cddl/dev/profile/profile.c head/sys/conf/files.arm64 head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jul 1 15:04:54 2015 (r285008) +++ head/Makefile.inc1 Wed Jul 1 15:51:11 2015 (r285009) @@ -1766,9 +1766,9 @@ cddl/lib/libctf__L: lib/libz__L .endif # cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built # on select architectures though (see cddl/lib/Makefile) -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" || \ - ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "arm" || ${MACHINE_ARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" _prebuild_libs+= lib/libproc lib/librtld_db .endif Added: head/cddl/contrib/opensolaris/lib/libdtrace/aarch64/dt_isadep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/lib/libdtrace/aarch64/dt_isadep.c Wed Jul 1 15:51:11 2015 (r285009) @@ -0,0 +1,139 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + * Copyright 2014 Howard Su + * Copyright 2015 George V. Neville-Neil + * Copyright 2015 Ruslan Bukin + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include +#include + +#include +#include + +#if !defined(sun) +#include +#endif + +/*ARGSUSED*/ +int +dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp) +{ + + ftp->ftps_type = DTFTP_ENTRY; + ftp->ftps_pc = (uintptr_t)symp->st_value; + ftp->ftps_size = (size_t)symp->st_size; + ftp->ftps_noffs = 1; + ftp->ftps_offs[0] = 0; + + if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) { + dt_dprintf("fasttrap probe creation ioctl failed: %s\n", + strerror(errno)); + return (dt_set_errno(dtp, errno)); + } + + return (1); +} + +int +dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + + return (DT_PROC_ERR); +} + +/*ARGSUSED*/ +int +dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off) +{ + + if (!ALIGNED_POINTER(off, 4)) + return (DT_PROC_ALIGN); + + ftp->ftps_type = DTFTP_OFFSETS; + ftp->ftps_pc = (uintptr_t)symp->st_value; + ftp->ftps_size = (size_t)symp->st_size; + ftp->ftps_noffs = 1; + ftp->ftps_offs[0] = off; + + if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) { + dt_dprintf("fasttrap probe creation ioctl failed: %s\n", + strerror(errno)); + return (dt_set_errno(dtp, errno)); + } + + return (1); +} + +/*ARGSUSED*/ +int +dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern) +{ + ulong_t i; + + ftp->ftps_type = DTFTP_OFFSETS; + ftp->ftps_pc = (uintptr_t)symp->st_value; + ftp->ftps_size = (size_t)symp->st_size; + ftp->ftps_noffs = 0; + + /* + * If we're matching against everything, just iterate through each + * instruction in the function, otherwise look for matching offset + * names by constructing the string and comparing it against the + * pattern. + */ + if (strcmp("*", pattern) == 0) { + for (i = 0; i < symp->st_size; i += 4) { + ftp->ftps_offs[ftp->ftps_noffs++] = i; + } + } else { + char name[sizeof (i) * 2 + 1]; + + for (i = 0; i < symp->st_size; i += 4) { + (void) sprintf(name, "%lx", i); + if (gmatch(name, pattern)) + ftp->ftps_offs[ftp->ftps_noffs++] = i; + } + } + + if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) { + dt_dprintf("fasttrap probe creation ioctl failed: %s\n", + strerror(errno)); + return (dt_set_errno(dtp, errno)); + } + + return (ftp->ftps_noffs); +} Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Jul 1 15:04:54 2015 (r285008) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Jul 1 15:51:11 2015 (r285009) @@ -227,7 +227,10 @@ prepare_elf32(dtrace_hdl_t *dtp, const d s = &dofs[dofrh->dofr_tgtsec]; for (j = 0; j < nrel; j++) { -#if defined(__arm__) +#if defined(__aarch64__) +/* XXX */ +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#elif defined(__arm__) /* XXX */ printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); #elif defined(__i386) || defined(__amd64) @@ -426,7 +429,9 @@ prepare_elf64(dtrace_hdl_t *dtp, const d s = &dofs[dofrh->dofr_tgtsec]; for (j = 0; j < nrel; j++) { -#if defined(__arm__) +#if defined(__aarch64__) +/* XXX */ +#elif defined(__arm__) /* XXX */ #elif defined(__mips__) /* XXX */ @@ -822,7 +827,16 @@ dt_symtab_lookup(Elf_Data *data_sym, int return (ret); } -#if defined(__arm__) +#if defined(__aarch64__) +/* XXX */ +static int +dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, + uint32_t *off) +{ +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + return (0); +} +#elif defined(__arm__) /* XXX */ static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Wed Jul 1 15:04:54 2015 (r285008) +++ head/cddl/lib/Makefile Wed Jul 1 15:51:11 2015 (r285009) @@ -26,9 +26,9 @@ _libzpool= libzpool .endif .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" || \ - ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "arm" || ${MACHINE_ARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" _drti= drti _libdtrace= libdtrace .endif Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Wed Jul 1 15:04:54 2015 (r285008) +++ head/cddl/lib/libdtrace/Makefile Wed Jul 1 15:51:11 2015 (r285009) @@ -69,27 +69,31 @@ CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ #CFLAGS+= -DYYDEBUG -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/aarch64 +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/aarch64 +.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/aarch64 +.elif ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" CFLAGS+= -I${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/i386 .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH} .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 -.elif ${MACHINE_CPUARCH} == "sparc64" -CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc -.elif ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips .elif ${MACHINE_CPUARCH} == "arm" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/arm .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/arm .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/arm +.elif ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips +.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips .elif ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/powerpc +.elif ${MACHINE_CPUARCH} == "sparc64" +CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc .else # temporary hack CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Wed Jul 1 15:04:54 2015 (r285008) +++ head/cddl/usr.sbin/Makefile Wed Jul 1 15:51:11 2015 (r285009) @@ -30,7 +30,7 @@ _plockstat= plockstat .endif .endif -.if ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" _dtrace= dtrace _dtruss= dtruss _lockstat= lockstat Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Jul 1 15:04:54 2015 (r285008) +++ head/lib/Makefile Wed Jul 1 15:51:11 2015 (r285009) @@ -215,8 +215,9 @@ _libldns= libldns # sense to build when clang is enabled at all. Furthermore, they can only be # built for certain architectures. .if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \ - (${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \ - (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb")) + (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") || \ + (${MACHINE_CPUARCH} == "i386")) _libclang_rt= libclang_rt .endif @@ -273,7 +274,7 @@ _libsmb= libsmb _libsmb= libsmb .endif -.if ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" _libsmb= libsmb _libproc= libproc _librtld_db= librtld_db Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Wed Jul 1 15:04:54 2015 (r285008) +++ head/sys/arm64/arm64/exception.S Wed Jul 1 15:51:11 2015 (r285009) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); .macro save_registers el .if \el == 1 mov x18, sp + sub sp, sp, #128 .endif stp x28, x29, [sp, #-16]! stp x26, x27, [sp, #-16]! Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Wed Jul 1 15:04:54 2015 (r285008) +++ head/sys/arm64/arm64/trap.c Wed Jul 1 15:51:11 2015 (r285009) @@ -53,6 +53,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef KDTRACE_HOOKS +#include +#endif + #ifdef VFP #include #endif @@ -72,6 +76,8 @@ void do_el1h_sync(struct trapframe *); void do_el0_sync(struct trapframe *); void do_el0_error(struct trapframe *); +int (*dtrace_invop_jump_addr)(struct trapframe *); + static __inline void call_trapsignal(struct thread *td, int sig, u_long code) { @@ -230,6 +236,11 @@ do_el1h_sync(struct trapframe *frame) esr = READ_SPECIALREG(esr_el1); exception = ESR_ELx_EXCEPTION(esr); +#ifdef KDTRACE_HOOKS + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, exception)) + return; +#endif + /* * Sanity check we are in an exception er can handle. The IL bit * is used to indicate the instruction length, except in a few @@ -252,6 +263,13 @@ do_el1h_sync(struct trapframe *frame) data_abort(frame, esr, 0); break; case EXCP_BRK: +#ifdef KDTRACE_HOOKS + if ((esr & ESR_ELx_ISS_MASK) == 0x40d && \ + dtrace_invop_jump_addr != 0) { + dtrace_invop_jump_addr(frame); + break; + } +#endif case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: #ifdef KDB Added: head/sys/cddl/contrib/opensolaris/uts/aarch64/dtrace/fasttrap_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/aarch64/dtrace/fasttrap_isa.c Wed Jul 1 15:51:11 2015 (r285009) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * XXX: Placeholder for AArch64 fasttrap code + */ Added: head/sys/cddl/contrib/opensolaris/uts/aarch64/sys/fasttrap_isa.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/aarch64/sys/fasttrap_isa.h Wed Jul 1 15:51:11 2015 (r285009) @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FASTTRAP_ISA_H +#define _FASTTRAP_ISA_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef uint32_t fasttrap_instr_t; + +/* XXX: Place for AArch64 fasttrap headers */ + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_ISA_H */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Jul 1 15:04:54 2015 (r285008) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Jul 1 15:51:11 2015 (r285009) @@ -11884,7 +11884,8 @@ err: int i; *factor = 1; -#if defined(__amd64__) || defined(__arm__) || defined(__mips__) || defined(__powerpc__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \ + defined(__mips__) || defined(__powerpc__) /* * FreeBSD isn't good at limiting the amount of memory we * ask to malloc, so let's place a limit here before trying Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Wed Jul 1 15:04:54 2015 (r285008) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Wed Jul 1 15:51:11 2015 (r285009) @@ -2445,6 +2445,34 @@ extern void dtrace_helpers_destroy(proc_ #define DTRACE_INVOP_POPM 2 #define DTRACE_INVOP_B 3 +#elif defined(__aarch64__) + +#define INSN_SIZE 4 + +#define B_MASK 0xff000000 +#define B_DATA_MASK 0x00ffffff +#define B_INSTR 0x14000000 + +#define RET_INSTR 0xd65f03c0 + +#define LDP_STP_MASK 0xffc00000 +#define STP_32 0x29800000 +#define STP_64 0xa9800000 +#define LDP_32 0x28c00000 +#define LDP_64 0xa8c00000 +#define LDP_STP_PREIND (1 << 24) +#define LDP_STP_DIR (1 << 22) /* Load instruction */ +#define ARG1_SHIFT 0 +#define ARG1_MASK 0x1f +#define ARG2_SHIFT 10 +#define ARG2_MASK 0x1f +#define OFFSET_SHIFT 15 +#define OFFSET_SIZE 7 +#define OFFSET_MASK ((1 << OFFSET_SIZE) - 1) + +#define DTRACE_INVOP_PUSHM 1 +#define DTRACE_INVOP_RET 2 +#define DTRACE_INVOP_B 3 #endif Added: head/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S Wed Jul 1 15:51:11 2015 (r285009) @@ -0,0 +1,173 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#define _ASM +#define _LOCORE + +#include +#include + +#include +#include + +#include "assym.s" + +/* +void dtrace_membar_producer(void) +*/ +ENTRY(dtrace_membar_producer) + RET +END(dtrace_membar_producer) + +/* +void dtrace_membar_consumer(void) +*/ +ENTRY(dtrace_membar_consumer) + RET +END(dtrace_membar_consumer) + +/* +dtrace_icookie_t dtrace_interrupt_disable(void) +*/ +ENTRY(dtrace_interrupt_disable) + msr daifset, #2 + RET +END(dtrace_interrupt_disable) + +/* +void dtrace_interrupt_enable(dtrace_icookie_t cookie) +*/ +ENTRY(dtrace_interrupt_enable) + msr daifclr, #2 + RET +END(dtrace_interrupt_enable) +/* +uint8_t +dtrace_fuword8_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword8_nocheck) + ldrb w0, [x0] + RET +END(dtrace_fuword8_nocheck) + +/* +uint16_t +dtrace_fuword16_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword16_nocheck) + ldrh w0, [x0] + RET +END(dtrace_fuword16_nocheck) + +/* +uint32_t +dtrace_fuword32_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword32_nocheck) + ldr w0, [x0] + RET +END(dtrace_fuword32_nocheck) + +/* +uint64_t +dtrace_fuword64_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword64_nocheck) + ldr x0, [x0] + RET +END(dtrace_fuword64_nocheck) + +/* +void +dtrace_copy(uintptr_t uaddr, uintptr_t kaddr, size_t size) +*/ +ENTRY(dtrace_copy) + cbz x2, 2f /* If len == 0 then skip loop */ +1: + ldrb w4, [x0], #1 /* Load from uaddr */ + strb w4, [x1], #1 /* Store in kaddr */ + sub x2, x2, #1 /* len-- */ + cbnz x2, 1b +2: + RET +END(dtrace_copy) + +/* +void +dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +XXX: Check for flags? +*/ +ENTRY(dtrace_copystr) + cbz x2, 2f /* If len == 0 then skip loop */ + +1: ldrb w4, [x0], #1 /* Load from uaddr */ + strb w4, [x1], #1 /* Store in kaddr */ + cbz w4, 2f /* If == 0 then break */ + sub x2, x2, #1 /* len-- */ + cbnz x2, 1b +2: + RET +END(dtrace_copystr) + +/* +uintptr_t +dtrace_caller(int aframes) +*/ +ENTRY(dtrace_caller) + mov x0, #-1 + RET +END(dtrace_caller) + +/* +uint32_t +dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) +*/ +ENTRY(dtrace_cas32) +1: ldxr w3, [x0] /* Load target */ + cmp w3, w1 /* Check if *target == cmp */ + bne 2f /* No, return */ + stxr w12, w2, [x0] /* Store new to target */ + cbnz w12, 1b /* Try again if store not succeed */ +2: mov w0, w3 /* Return the value loaded from target */ + RET +END(dtrace_cas32) + +/* +void * +dtrace_casptr(volatile void *target, volatile void *cmp, volatile void *new) +*/ +ENTRY(dtrace_casptr) +1: ldxr x3, [x0] /* Load target */ + cmp x3, x1 /* Check if *target == cmp */ + bne 2f /* No, return */ + stxr w12, x2, [x0] /* Store new to target */ + cbnz w12, 1b /* Try again if store not succeed */ +2: mov x0, x3 /* Return the value loaded from target */ + RET +END(dtrace_casptr) Added: head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Wed Jul 1 15:51:11 2015 (r285009) @@ -0,0 +1,287 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "regset.h" + +/* + * Wee need some reasonable default to prevent backtrace code + * from wandering too far + */ +#define MAX_FUNCTION_SIZE 0x10000 +#define MAX_PROLOGUE_SIZE 0x100 + +uint8_t dtrace_fuword8_nocheck(void *); +uint16_t dtrace_fuword16_nocheck(void *); +uint32_t dtrace_fuword32_nocheck(void *); +uint64_t dtrace_fuword64_nocheck(void *); + +void +dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, + uint32_t *intrpc) +{ + struct unwind_state state; + int scp_offset; + register_t sp; + int depth; + + depth = 0; + + if (intrpc != 0) { + pcstack[depth++] = (pc_t) intrpc; + } + + aframes++; + + __asm __volatile("mov %0, sp" : "=&r" (sp)); + + state.fp = (uint64_t)__builtin_frame_address(0); + state.sp = sp; + state.pc = (uint64_t)dtrace_getpcstack; + + while (depth < pcstack_limit) { + if (unwind_frame(&state)) + break; + + if (!INKERNEL(state.pc) || !INKERNEL(state.fp)) + break; + + /* + * NB: Unlike some other architectures, we don't need to + * explicitly insert cpu_dtrace_caller as it appears in the + * normal kernel stack trace rather than a special trap frame. + */ + if (aframes > 0) { + aframes--; + } else { + pcstack[depth++] = state.pc; + } + + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} + +void +dtrace_getupcstack(uint64_t *pcstack, int pcstack_limit) +{ + + printf("IMPLEMENT ME: %s\n", __func__); +} + +int +dtrace_getustackdepth(void) +{ + + printf("IMPLEMENT ME: %s\n", __func__); + + return (0); +} + +void +dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) +{ + + printf("IMPLEMENT ME: %s\n", __func__); +} + +/*ARGSUSED*/ +uint64_t +dtrace_getarg(int arg, int aframes) +{ + + printf("IMPLEMENT ME: %s\n", __func__); + + return (0); +} + +int +dtrace_getstackdepth(int aframes) +{ + struct unwind_state state; + int scp_offset; + register_t sp; + int depth; + int done; + + depth = 1; + done = 0; + + __asm __volatile("mov %0, sp" : "=&r" (sp)); + + state.fp = (uint64_t)__builtin_frame_address(0); + state.sp = sp; + state.pc = (uint64_t)dtrace_getstackdepth; + + do { + done = unwind_frame(&state); + if (!INKERNEL(state.pc) || !INKERNEL(state.fp)) + break; + depth++; + } while (!done); + + if (depth < aframes) + return (0); + else + return (depth - aframes); +} + +ulong_t +dtrace_getreg(struct trapframe *rp, uint_t reg) +{ + + printf("IMPLEMENT ME: %s\n", __func__); + + return (0); +} + +static int +dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) +{ + + if (uaddr + size > VM_MAXUSER_ADDRESS || uaddr + size < uaddr) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = uaddr; + return (0); + } + + return (1); +} + +void +dtrace_copyin(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(uaddr, kaddr, size); +} + +void +dtrace_copyout(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(kaddr, uaddr, size); +} + +void +dtrace_copyinstr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(uaddr, kaddr, size, flags); +} + +void +dtrace_copyoutstr(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(kaddr, uaddr, size, flags); +} + +uint8_t +dtrace_fuword8(void *uaddr) +{ + + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + + return (dtrace_fuword8_nocheck(uaddr)); +} + +uint16_t +dtrace_fuword16(void *uaddr) +{ + + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + + return (dtrace_fuword16_nocheck(uaddr)); +} + +uint32_t +dtrace_fuword32(void *uaddr) +{ + + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + + return (dtrace_fuword32_nocheck(uaddr)); +} + +uint64_t +dtrace_fuword64(void *uaddr) +{ + + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + + return (dtrace_fuword64_nocheck(uaddr)); +} Added: head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Wed Jul 1 15:51:11 2015 (r285009) @@ -0,0 +1,311 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + * + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern uintptr_t dtrace_in_probe_addr; +extern int dtrace_in_probe; +extern dtrace_id_t dtrace_probeid_error; +extern int (*dtrace_invop_jump_addr)(struct trapframe *); +extern void dtrace_getnanotime(struct timespec *tsp); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jul 1 15:54:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13729991D35; Wed, 1 Jul 2015 15:54:14 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0507C191A; Wed, 1 Jul 2015 15:54:14 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t61FsD0u001559; Wed, 1 Jul 2015 15:54:13 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t61FsDPM001557; Wed, 1 Jul 2015 15:54:13 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201507011554.t61FsDPM001557@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 1 Jul 2015 15:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285010 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 15:54:14 -0000 Author: brueffer Date: Wed Jul 1 15:54:13 2015 New Revision: 285010 URL: https://svnweb.freebsd.org/changeset/base/285010 Log: Add one more file missed in the BIND-removal entries. PR: 196515 Submitted by: Trond Endrestol MFC after: 1 week Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jul 1 15:51:11 2015 (r285009) +++ head/ObsoleteFiles.inc Wed Jul 1 15:54:13 2015 (r285010) @@ -1020,6 +1020,7 @@ OLD_FILES+=usr/include/lwres/net.h OLD_FILES+=usr/include/lwres/netdb.h OLD_FILES+=usr/include/lwres/platform.h OLD_FILES+=usr/include/lwres/result.h +OLD_FILES+=usr/include/lwres/string.h OLD_FILES+=usr/include/lwres/version.h OLD_FILES+=usr/lib/liblwres.a OLD_FILES+=usr/lib/liblwres.so From owner-svn-src-head@freebsd.org Wed Jul 1 16:37:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B5E39924E0; Wed, 1 Jul 2015 16:37:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D0DD22B5; Wed, 1 Jul 2015 16:37:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t61Gb3wW022356; Wed, 1 Jul 2015 16:37:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t61Gb34r022355; Wed, 1 Jul 2015 16:37:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507011637.t61Gb34r022355@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 1 Jul 2015 16:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285011 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 16:37:04 -0000 Author: kib Date: Wed Jul 1 16:37:03 2015 New Revision: 285011 URL: https://svnweb.freebsd.org/changeset/base/285011 Log: Disallow a debugger on 64bit system to set fs/gs bases of the 32bit process beyond the end of the process address space. Such setting is not dangerous to the kernel integrity, but it causes confusing application misbehaviour. Sponsored by: The FreeBSD Foundation MFC after: 12 days Modified: head/sys/amd64/amd64/ptrace_machdep.c Modified: head/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- head/sys/amd64/amd64/ptrace_machdep.c Wed Jul 1 15:54:13 2015 (r285010) +++ head/sys/amd64/amd64/ptrace_machdep.c Wed Jul 1 16:37:03 2015 (r285011) @@ -231,7 +231,7 @@ cpu_ptrace(struct thread *td, int req, v error = copyin(addr, &rv, sizeof(rv)); if (error != 0) break; - if (rv >= VM_MAXUSER_ADDRESS) { + if (rv >= td->td_proc->p_sysent->sv_maxuser) { error = EINVAL; break; } From owner-svn-src-head@freebsd.org Wed Jul 1 16:50:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 076E69926A4; Wed, 1 Jul 2015 16:50:02 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECCB329BF; Wed, 1 Jul 2015 16:50:01 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t61Go1x0027644; Wed, 1 Jul 2015 16:50:01 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t61Go1Bq027642; Wed, 1 Jul 2015 16:50:01 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201507011650.t61Go1Bq027642@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 1 Jul 2015 16:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285012 - head/lib/libgpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 16:50:02 -0000 Author: brueffer Date: Wed Jul 1 16:50:01 2015 New Revision: 285012 URL: https://svnweb.freebsd.org/changeset/base/285012 Log: Bump .Dd for the example code update. Submitted by: loos Modified: head/lib/libgpio/gpio.3 Modified: head/lib/libgpio/gpio.3 ============================================================================== --- head/lib/libgpio/gpio.3 Wed Jul 1 16:37:03 2015 (r285011) +++ head/lib/libgpio/gpio.3 Wed Jul 1 16:50:01 2015 (r285012) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 8, 2015 +.Dd July 1, 2015 .Dt GPIO 3 .Os .Sh NAME From owner-svn-src-head@freebsd.org Wed Jul 1 17:27:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0171A992D83; Wed, 1 Jul 2015 17:27:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E703F2144; Wed, 1 Jul 2015 17:27:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t61HRikT047199; Wed, 1 Jul 2015 17:27:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t61HRiKB047198; Wed, 1 Jul 2015 17:27:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507011727.t61HRiKB047198@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 1 Jul 2015 17:27:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285014 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 17:27:45 -0000 Author: andrew Date: Wed Jul 1 17:27:44 2015 New Revision: 285014 URL: https://svnweb.freebsd.org/changeset/base/285014 Log: Fix the logic for when to restore the VFP registers. It should restore them when a different thread last used them, or when the thread was last run on a different cpu. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/vfp.c Modified: head/sys/arm64/arm64/vfp.c ============================================================================== --- head/sys/arm64/arm64/vfp.c Wed Jul 1 17:19:51 2015 (r285013) +++ head/sys/arm64/arm64/vfp.c Wed Jul 1 17:27:44 2015 (r285014) @@ -95,6 +95,9 @@ vfp_save_state(struct thread *td) */ cpacr = READ_SPECIALREG(cpacr_el1); if ((cpacr & CPACR_FPEN_MASK) == CPACR_FPEN_TRAP_NONE) { + KASSERT(PCPU_GET(fpcurthread) == td, + ("Storing an invalid VFP state")); + vfp_state = td->td_pcb->pcb_vfp; __asm __volatile( "mrs %0, fpcr \n" @@ -142,7 +145,12 @@ vfp_restore_state(void) vfp_enable(); - if (PCPU_GET(fpcurthread) != curthread && cpu != curpcb->pcb_vfpcpu) { + /* + * If the previous thread on this cpu to use the VFP was not the + * current threas, or the current thread last used it on a different + * cpu we need to restore the old state. + */ + if (PCPU_GET(fpcurthread) != curthread || cpu != curpcb->pcb_vfpcpu) { vfp_state = curthread->td_pcb->pcb_vfp; fpcr = curthread->td_pcb->pcb_fpcr; From owner-svn-src-head@freebsd.org Wed Jul 1 19:31:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7342D991B30; Wed, 1 Jul 2015 19:31:10 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: from mail-la0-x22a.google.com (mail-la0-x22a.google.com [IPv6:2a00:1450:4010:c03::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 F10C52A85; Wed, 1 Jul 2015 19:31:09 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: by laar3 with SMTP id r3so47356258laa.0; Wed, 01 Jul 2015 12:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Jp1LfEDKbStO+RwwJFYJbSlC9TLnIOSeBlReeZ/tKxo=; b=Plz4JbrsY7F7OcYtu/IFzBzz35I2bNL3ur8VtNduEL8LFQu/PaP393sGZyfQtY3GEF nxpoZY8nNdlEvi3dQxVuML/ZaBA1p/I/UiwGGbEX88rbX/iQoV+H1BE4fvJKsGPBLx3K zlmUaOCW1Li1YaXVmPuTcRygyyraqVjnu9Hhcp+140fgFqDF2HoDowHmlQ9g2JJRW0Ab u0vQfjNbPVilsHtkPH6PsnDCB9ymKtWFHr+QZ3y16zQ6nWF+OueY960kXvRKjleEx+0t C/CjU/HNXEz6jOjJniIR02cIhyiHLDirEB4MbUyY9PQiuIv2OrLbWaF6CqpYPA2n1Mov E34g== MIME-Version: 1.0 X-Received: by 10.112.212.9 with SMTP id ng9mr27003437lbc.57.1435779068032; Wed, 01 Jul 2015 12:31:08 -0700 (PDT) Received: by 10.112.52.170 with HTTP; Wed, 1 Jul 2015 12:31:07 -0700 (PDT) In-Reply-To: <201507011650.t61Go1Bq027642@svn.freebsd.org> References: <201507011650.t61Go1Bq027642@svn.freebsd.org> Date: Wed, 1 Jul 2015 16:31:07 -0300 Message-ID: Subject: Re: svn commit: r285012 - head/lib/libgpio From: Luiz Otavio O Souza To: Christian Brueffer 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 19:31:10 -0000 On Wed, Jul 1, 2015 at 1:50 PM, Christian Brueffer wrote: > Author: brueffer > Date: Wed Jul 1 16:50:01 2015 > New Revision: 285012 > URL: https://svnweb.freebsd.org/changeset/base/285012 > > Log: > Bump .Dd for the example code update. > > Submitted by: loos Thank you Chris! Luiz > > Modified: > head/lib/libgpio/gpio.3 > > Modified: head/lib/libgpio/gpio.3 > ============================================================================== > --- head/lib/libgpio/gpio.3 Wed Jul 1 16:37:03 2015 (r285011) > +++ head/lib/libgpio/gpio.3 Wed Jul 1 16:50:01 2015 (r285012) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 8, 2015 > +.Dd July 1, 2015 > .Dt GPIO 3 > .Os > .Sh NAME > From owner-svn-src-head@freebsd.org Wed Jul 1 23:07:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80534992FA8; Wed, 1 Jul 2015 23:07:13 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0145.outbound.protection.outlook.com [157.56.111.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A364511BA; Wed, 1 Jul 2015 23:07:11 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from SN1PR0501CA0019.namprd05.prod.outlook.com (10.163.126.157) by CO2PR05MB716.namprd05.prod.outlook.com (10.141.228.152) with Microsoft SMTP Server (TLS) id 15.1.195.15; Wed, 1 Jul 2015 23:07:09 +0000 Received: from BL2FFO11FD055.protection.gbl (2a01:111:f400:7c09::136) by SN1PR0501CA0019.outlook.office365.com (2a01:111:e400:52fe::29) with Microsoft SMTP Server (TLS) id 15.1.201.16 via Frontend Transport; Wed, 1 Jul 2015 23:07:09 +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; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.18 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.18) by BL2FFO11FD055.mail.protection.outlook.com (10.173.161.183) with Microsoft SMTP Server (TLS) id 15.1.190.9 via Frontend Transport; Wed, 1 Jul 2015 23:07:08 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 1 Jul 2015 16:07:06 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t61N75D15636; Wed, 1 Jul 2015 16:07:05 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id A5CA1580AA; Wed, 1 Jul 2015 16:07:05 -0700 (PDT) To: Mark Murray CC: , , Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... In-Reply-To: <201506301700.t5UH0jPq001498@svn.freebsd.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> Comments: In-reply-to: Mark Murray message dated "Tue, 30 Jun 2015 17:00:45 -0000." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Wed, 1 Jul 2015 16:07:05 -0700 Message-ID: <13981.1435792025@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD055; 1:JXtcwEqeVIun6ERJLGXmFZxC+KOUDojo6c4ZolnsPd9ELmBusFappYhfmxjTlFzT63Il1sj/Da7YwNXZBmF/w31EfdG2WKhesSwtSp122xkIIf9salYhgjiEtbfvHOa4U7odUoCz6zHR2bZ63MJ6NxGunLmjHOJutDgRJSD9tbanCzGxW50l/ZCxc8JmCZb81wHPxkuUx9GkvHRNtoFI5Pj6DWEjunf0cuuW3H1q7rDj1nXcFyowx0BIrV6k3NSwERwaGHocmy0O5w6ZUSLvsw== X-Forefront-Antispam-Report: CIP:66.129.239.18; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(199003)(189002)(24454002)(189998001)(105596002)(110136002)(5001960100002)(33716001)(87936001)(50226001)(77096005)(2950100001)(6806004)(86362001)(47776003)(19580405001)(62966003)(77156002)(106466001)(19580395003)(46102003)(450100001)(57986006)(76506005)(48376002)(76176999)(50466002)(50986999)(117636001)(92566002)(42262002)(62816006); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR05MB716; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB716; 2:jhBojk7WKXlikrrkxXBCz6lE3MDjo0NjXetcZIDgobgSf5AbiA5X00bC862lW8jE; 3:+lX05UouqR5C5L7/cN6R6XnVnoTjZB7Pyv6Xla+ROB46ktnzpGi1jcJ6T1Lc9ykPIuTJHqocMBJeH/dUDq40iZrTB64zf2PgmrLs6iF8D003W1cs2jhWtSyiKo1U69za4eDYbsI9ruQr2zNOldz7tXUXIkYL5miPJvlbnwI7yMb0wDKXeCFZonkUq4/95g0iRucknQzsyuxS5nCN/JavEkCjiYqaLHfS+NUHE8rBbes=; 20:ZPyKfFc6J6EDFM9K06cNMoiPKx3+UVzoMLHiz3YbmFAImUuaTV289vh6Aw8LPTCg3mN+Aq5Or7LvyXax0Dr2muuHuwKe6pGhGUjMSvuBKiOkNPGvxPoI0y44JN29CN93KP5/sAw66m3eW+2cUhw8ZyydNV6G0CfxeQNu2Pxtq0/0v3B0F+02B5GeGoSls/R+Z4tXOWeaIq0sR8u4unFVi3UHmHfb6xXVkV05D/csa3c7hG6MCPT4h0s+p94fmRegy4I85XEFUJ2Aah7Njk25rT7jrdWLeMRAlEotOdxs/cuMP6HheEkNRm0Otux0/KM1qeoDxSuZw+GrJCkDkKgn5jicXx5Ug/HO7f6cP5js3MOxlVGQkoARzAWnIGkP0VYI5S3X4HfAK38gp8CPvd3hMQz9IGC2n61qcK59s9+/630xGPVl09IU5yifr2PYwW5uP9uQ3KZtGeb2R1jffkJB9DTWIJspExqA+/udwx70MiS7XocFqF2sFYLL6b7v7F4q X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR05MB716; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:CO2PR05MB716; BCL:0; PCL:0; RULEID:; SRVR:CO2PR05MB716; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB716; 4:7hUXLIU6zIcVTt8auiqpB6e7Di2LwRU2BSYhrQ5d0foVIiNg94KGGLEs3wOJwun/4NwY5E+3jf3pDPDvUZ6WLlapAVkpvq/+b3wqrP+XGoNLyJSw9H7LxTpbbt+DoKPzA8UujaVChlLtM1zcAQMhn2vdy0n+ysexgmzCVoc0SSifIrkDXk26dsN0P1uVQ5JC3zQylmwTxPIfzPB1y7y/GlzKSAIJq+9MzxiEUUsPEIF0cWH62HuqCnFoHTV09yN9uYLF8vTz4kR4p9xX2Dxn/R+yLiMNF5bktwDAzWJ/kPY= X-Forefront-PRVS: 0624A2429E X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB716; 23:ltOg2SJGKO3mZLgv91X523pfXwLAbkdYO7T2sZTHDr+4FwtY1iQhiM8bTwhLh6Pw1jx/eFoN3qnWY+39Ke2LZvrbTnE4CB299oGzeTRi/V85CYy3k/FUfDF/BHjv0wtybXHsjtmzWAULKjcjmDfJfgHZ4mFI+jsu0wK7KBhBc/RVT13EWP0unw8rGwSkUasvoprV5um0ILll2gvuwkPJKeEIW0//3u90nBCWHugKxiJMfYlxRvQuVPZ4TM+XcbiAp52oq/ZCXmtzfAT94GcLPaIMIvCggU/L5jxzKL3XkXF3evSPEQNYXCqvyqticl1dMm4wBe7oIi8bMQMmPVNpzGajDXKo63Zmm90k773EzruXPb4vltib9U4PCuZPG7DBG70fsYoZfFCRwH0X1RuOp5l7r8my0uOQl33einGkFkqARV0Mkl5gk63ogzVpJxBnzoqBIKPqQT+L4zsGa/5dmnd42ap5Rl4Jnw5AbLRfNxBs4VaNNykhYEGbuSPYAzQW1UJe3aViUnf/g9xucbLB4bmVnQ3+YzKhn9EFa7sXj+xhPDjS7oZ9tAC7bXsabviwfUxgwLWGOYdYKBMQkVTnYPG5Ry9VnVjwUaQpVaXZsMCpCP7RU/qEJ6RSv3isQiaEKrJ02n3CoIKerD5INfnGYB4PYqiZ1PP2uN1soyo3KjQzkvXjUjOtlDUgWDVIvfOMVRsiJw9hT6PDuFAndN9932JNlGzzQLwgPW/Wr1z5Xlq379pPASjnNuWLoegUIwyqeGUYUPKYXLhWKkWR2gw/h/ZPhWwVqRubNtDCwBYewrCvlPPD7xYT6enZPd7Wo3dW/8FurcPpfQ5ZZ55AocxHTa9K7Nl66pjB6GlpTUcEB9z3rthsFnQBSegH5GvxtqP+v3JxXZ2w5Xvl+a10t88H5w== X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB716; 5:0E85UIb5qKDasSO+9NTcBj3mvpiHfrlGuewVklxejrhcPz7f/SSgq8bE6y0/jz4rIrqUecREUDkm29Tia1p/EoQAmq17/GwQaHKgBBegxQybeinc9rwGpwsIn1IVDm6qBx7GmJAWBduu2Xj0EeZjzg==; 24:bH2B43ULbVrU92AsIFDMSaMOp7AJAl26DLJy4nYYboAaItgWMW1SYAFyjJ4/M097jNhyuCGSQGqoirynLvcQsWB38gJMYfq7t9cmam2xZPk=; 20:I4l2FokQGie8A7gqTUGImWEGx1nClLcRi/dQOAJHNcw7/cl/F3ynspqEhi2KwzC93xU5hqugT1E/IFWPLEIY4g== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2015 23:07:08.4763 (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-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR05MB716 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 23:07:13 -0000 Mark Murray wrote: > * src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h > - Remove; plugability is no longer used. Compile-time algorithm > selection is the way to go. Errr we use that and need it. Please put it back. Whether we agree with NIST's ideas about how randomness should be handled or not, we need to to be able to comply and we do not want to burn their desired arrangement into our kernels. From owner-svn-src-head@freebsd.org Wed Jul 1 23:27:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29256992308; Wed, 1 Jul 2015 23:27:03 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6FC1DFF; Wed, 1 Jul 2015 23:27:03 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t61NR2QO029771; Wed, 1 Jul 2015 23:27:02 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t61NR2jX029769; Wed, 1 Jul 2015 23:27:02 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201507012327.t61NR2jX029769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 1 Jul 2015 23:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285017 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2015 23:27:03 -0000 Author: loos Date: Wed Jul 1 23:27:01 2015 New Revision: 285017 URL: https://svnweb.freebsd.org/changeset/base/285017 Log: Add DMA support for Allwinner MMC controller. DMA handles all data transfers up to 128K or 16 segments and fallback to pio mode when DMA requirements are not met. The read performance has improved greatly while the write performance also showed some improvement but seems limited by the card type and quality. Submitted by: Pratik Singhal Sponsored by: Google Summer of Code 2015 Tested on: A10 (cubieboard) and A20 (cubieboard 2 and banana pi) Modified: head/sys/arm/allwinner/a10_mmc.c head/sys/arm/allwinner/a10_mmc.h Modified: head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- head/sys/arm/allwinner/a10_mmc.c Wed Jul 1 21:21:14 2015 (r285016) +++ head/sys/arm/allwinner/a10_mmc.c Wed Jul 1 23:27:01 2015 (r285017) @@ -54,6 +54,13 @@ __FBSDID("$FreeBSD$"); #define A10_MMC_MEMRES 0 #define A10_MMC_IRQRES 1 #define A10_MMC_RESSZ 2 +#define A10_MMC_DMA_SEGS 16 +#define A10_MMC_DMA_MAX_SIZE 0x2000 +#define A10_MMC_DMA_FTRGLEVEL 0x20070008 + +static int a10_mmc_pio_mode = 0; + +TUNABLE_INT("hw.a10.mmc.pio_mode", &a10_mmc_pio_mode); struct a10_mmc_softc { bus_space_handle_t a10_bsh; @@ -71,6 +78,16 @@ struct a10_mmc_softc { uint32_t a10_intr; uint32_t a10_intr_wait; void * a10_intrhand; + + /* Fields required for DMA access. */ + bus_addr_t a10_dma_desc_phys; + bus_dmamap_t a10_dma_map; + bus_dma_tag_t a10_dma_tag; + void * a10_dma_desc; + bus_dmamap_t a10_dma_buf_map; + bus_dma_tag_t a10_dma_buf_tag; + int a10_dma_inuse; + int a10_dma_map_err; }; static struct resource_spec a10_mmc_res_spec[] = { @@ -82,6 +99,7 @@ static struct resource_spec a10_mmc_res_ static int a10_mmc_probe(device_t); static int a10_mmc_attach(device_t); static int a10_mmc_detach(device_t); +static int a10_mmc_setup_dma(struct a10_mmc_softc *); static int a10_mmc_reset(struct a10_mmc_softc *); static void a10_mmc_intr(void *); static int a10_mmc_update_clock(struct a10_mmc_softc *); @@ -166,6 +184,14 @@ a10_mmc_attach(device_t dev) goto fail; } + if (a10_mmc_pio_mode == 0 && a10_mmc_setup_dma(sc) != 0) { + device_printf(sc->a10_dev, "Couldn't setup DMA!\n"); + a10_mmc_pio_mode = 1; + } + if (bootverbose) + device_printf(sc->a10_dev, "DMA status: %s\n", + a10_mmc_pio_mode ? "disabled" : "enabled"); + sc->a10_host.f_min = 400000; sc->a10_host.f_max = 52000000; sc->a10_host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; @@ -201,6 +227,140 @@ a10_mmc_detach(device_t dev) return (EBUSY); } +static void +a10_dma_desc_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int err) +{ + struct a10_mmc_softc *sc; + + sc = (struct a10_mmc_softc *)arg; + if (err) { + sc->a10_dma_map_err = err; + return; + } + sc->a10_dma_desc_phys = segs[0].ds_addr; +} + +static int +a10_mmc_setup_dma(struct a10_mmc_softc *sc) +{ + int dma_desc_size, error; + + /* Allocate the DMA descriptor memory. */ + dma_desc_size = sizeof(struct a10_mmc_dma_desc) * A10_MMC_DMA_SEGS; + error = bus_dma_tag_create(bus_get_dma_tag(sc->a10_dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + dma_desc_size, 1, dma_desc_size, 0, NULL, NULL, &sc->a10_dma_tag); + if (error) + return (error); + error = bus_dmamem_alloc(sc->a10_dma_tag, &sc->a10_dma_desc, + BUS_DMA_WAITOK | BUS_DMA_ZERO, &sc->a10_dma_map); + if (error) + return (error); + + error = bus_dmamap_load(sc->a10_dma_tag, sc->a10_dma_map, + sc->a10_dma_desc, dma_desc_size, a10_dma_desc_cb, sc, 0); + if (error) + return (error); + if (sc->a10_dma_map_err) + return (sc->a10_dma_map_err); + + /* Create the DMA map for data transfers. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->a10_dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + A10_MMC_DMA_MAX_SIZE * A10_MMC_DMA_SEGS, A10_MMC_DMA_SEGS, + A10_MMC_DMA_MAX_SIZE, BUS_DMA_ALLOCNOW, NULL, NULL, + &sc->a10_dma_buf_tag); + if (error) + return (error); + error = bus_dmamap_create(sc->a10_dma_buf_tag, 0, + &sc->a10_dma_buf_map); + if (error) + return (error); + + return (0); +} + +static void +a10_dma_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int err) +{ + int i; + struct a10_mmc_dma_desc *dma_desc; + struct a10_mmc_softc *sc; + + sc = (struct a10_mmc_softc *)arg; + sc->a10_dma_map_err = err; + dma_desc = sc->a10_dma_desc; + /* Note nsegs is guaranteed to be zero if err is non-zero. */ + for (i = 0; i < nsegs; i++) { + dma_desc[i].buf_size = segs[i].ds_len; + dma_desc[i].buf_addr = segs[i].ds_addr; + dma_desc[i].config = A10_MMC_DMA_CONFIG_CH | + A10_MMC_DMA_CONFIG_OWN; + if (i == 0) + dma_desc[i].config |= A10_MMC_DMA_CONFIG_FD; + if (i < (nsegs - 1)) { + dma_desc[i].config |= A10_MMC_DMA_CONFIG_DIC; + dma_desc[i].next = sc->a10_dma_desc_phys + + ((i + 1) * sizeof(struct a10_mmc_dma_desc)); + } else { + dma_desc[i].config |= A10_MMC_DMA_CONFIG_LD | + A10_MMC_DMA_CONFIG_ER; + dma_desc[i].next = 0; + } + } +} + +static int +a10_mmc_prepare_dma(struct a10_mmc_softc *sc) +{ + bus_dmasync_op_t sync_op; + int error; + struct mmc_command *cmd; + uint32_t val; + + cmd = sc->a10_req->cmd; + if (cmd->data->len > A10_MMC_DMA_MAX_SIZE * A10_MMC_DMA_SEGS) + return (EFBIG); + error = bus_dmamap_load(sc->a10_dma_buf_tag, sc->a10_dma_buf_map, + cmd->data->data, cmd->data->len, a10_dma_cb, sc, BUS_DMA_NOWAIT); + if (error) + return (error); + if (sc->a10_dma_map_err) + return (sc->a10_dma_map_err); + + sc->a10_dma_inuse = 1; + if (cmd->data->flags & MMC_DATA_WRITE) + sync_op = BUS_DMASYNC_PREWRITE; + else + sync_op = BUS_DMASYNC_PREREAD; + bus_dmamap_sync(sc->a10_dma_buf_tag, sc->a10_dma_buf_map, sync_op); + bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_PREWRITE); + + val = A10_MMC_READ_4(sc, A10_MMC_IMASK); + val &= ~(A10_MMC_RX_DATA_REQ | A10_MMC_TX_DATA_REQ); + A10_MMC_WRITE_4(sc, A10_MMC_IMASK, val); + val = A10_MMC_READ_4(sc, A10_MMC_GCTRL); + val &= ~A10_MMC_ACCESS_BY_AHB; + val |= A10_MMC_DMA_ENABLE; + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, val); + val |= A10_MMC_DMA_RESET; + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, val); + A10_MMC_WRITE_4(sc, A10_MMC_DMAC, A10_MMC_IDMAC_SOFT_RST); + A10_MMC_WRITE_4(sc, A10_MMC_DMAC, + A10_MMC_IDMAC_IDMA_ON | A10_MMC_IDMAC_FIX_BURST); + val = A10_MMC_READ_4(sc, A10_MMC_IDIE); + val &= ~(A10_MMC_IDMAC_RECEIVE_INT | A10_MMC_IDMAC_TRANSMIT_INT); + if (cmd->data->flags & MMC_DATA_WRITE) + val |= A10_MMC_IDMAC_TRANSMIT_INT; + else + val |= A10_MMC_IDMAC_RECEIVE_INT; + A10_MMC_WRITE_4(sc, A10_MMC_IDIE, val); + A10_MMC_WRITE_4(sc, A10_MMC_DLBA, sc->a10_dma_desc_phys); + A10_MMC_WRITE_4(sc, A10_MMC_FTRGL, A10_MMC_DMA_FTRGLEVEL); + + return (0); +} + static int a10_mmc_reset(struct a10_mmc_softc *sc) { @@ -222,15 +382,14 @@ a10_mmc_reset(struct a10_mmc_softc *sc) /* Clear pending interrupts. */ A10_MMC_WRITE_4(sc, A10_MMC_RINTR, 0xffffffff); + A10_MMC_WRITE_4(sc, A10_MMC_IDST, 0xffffffff); /* Unmask interrupts. */ A10_MMC_WRITE_4(sc, A10_MMC_IMASK, A10_MMC_CMD_DONE | A10_MMC_INT_ERR_BIT | - A10_MMC_DATA_OVER | A10_MMC_AUTOCMD_DONE | - A10_MMC_RX_DATA_REQ | A10_MMC_TX_DATA_REQ); + A10_MMC_DATA_OVER | A10_MMC_AUTOCMD_DONE); /* Enable interrupts and AHB access. */ A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, - A10_MMC_READ_4(sc, A10_MMC_GCTRL) | - A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB); + A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE); return (0); } @@ -247,15 +406,19 @@ a10_mmc_req_done(struct a10_mmc_softc *s a10_mmc_reset(sc); a10_mmc_update_clock(sc); } - /* Reset the FIFO. */ - A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, - A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_FIFO_RESET); + if (sc->a10_dma_inuse == 0) { + /* Reset the FIFO. */ + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, + A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_FIFO_RESET); + } req = sc->a10_req; callout_stop(&sc->a10_timeoutc); sc->a10_req = NULL; sc->a10_intr = 0; sc->a10_resid = 0; + sc->a10_dma_inuse = 0; + sc->a10_dma_map_err = 0; sc->a10_intr_wait = 0; req->done(req); } @@ -295,7 +458,7 @@ a10_mmc_req_ok(struct a10_mmc_softc *sc) a10_mmc_req_done(sc); } -static void +static void a10_mmc_timeout(void *arg) { struct a10_mmc_softc *sc; @@ -335,28 +498,29 @@ a10_mmc_pio_transfer(struct a10_mmc_soft static void a10_mmc_intr(void *arg) { + bus_dmasync_op_t sync_op; struct a10_mmc_softc *sc; struct mmc_data *data; - uint32_t imask, rint; + uint32_t idst, imask, rint; sc = (struct a10_mmc_softc *)arg; A10_MMC_LOCK(sc); rint = A10_MMC_READ_4(sc, A10_MMC_RINTR); + idst = A10_MMC_READ_4(sc, A10_MMC_IDST); imask = A10_MMC_READ_4(sc, A10_MMC_IMASK); - if (imask == 0 && rint == 0) { + if (idst == 0 && imask == 0 && rint == 0) { A10_MMC_UNLOCK(sc); return; } #ifdef DEBUG - device_printf(sc->a10_dev, "imask: %#x, rint: %#x\n", imask, rint); + device_printf(sc->a10_dev, "idst: %#x, imask: %#x, rint: %#x\n", + idst, imask, rint); #endif if (sc->a10_req == NULL) { device_printf(sc->a10_dev, "Spurious interrupt - no active request, rint: 0x%08X\n", rint); - A10_MMC_WRITE_4(sc, A10_MMC_RINTR, rint); - A10_MMC_UNLOCK(sc); - return; + goto end; } if (rint & A10_MMC_INT_ERR_BIT) { device_printf(sc->a10_dev, "error rint: 0x%08X\n", rint); @@ -364,20 +528,39 @@ a10_mmc_intr(void *arg) sc->a10_req->cmd->error = MMC_ERR_TIMEOUT; else sc->a10_req->cmd->error = MMC_ERR_FAILED; - A10_MMC_WRITE_4(sc, A10_MMC_RINTR, rint); a10_mmc_req_done(sc); - A10_MMC_UNLOCK(sc); - return; + goto end; + } + if (idst & A10_MMC_IDMAC_ERROR) { + device_printf(sc->a10_dev, "error idst: 0x%08x\n", idst); + sc->a10_req->cmd->error = MMC_ERR_FAILED; + a10_mmc_req_done(sc); + goto end; } sc->a10_intr |= rint; data = sc->a10_req->cmd->data; - if (data != NULL && (rint & (A10_MMC_DATA_OVER | - A10_MMC_RX_DATA_REQ | A10_MMC_TX_DATA_REQ)) != 0) + if (data != NULL && sc->a10_dma_inuse == 1 && + (idst & A10_MMC_IDMAC_COMPLETE)) { + if (data->flags & MMC_DATA_WRITE) + sync_op = BUS_DMASYNC_POSTWRITE; + else + sync_op = BUS_DMASYNC_POSTREAD; + bus_dmamap_sync(sc->a10_dma_buf_tag, sc->a10_dma_buf_map, + sync_op); + bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->a10_dma_buf_tag, sc->a10_dma_buf_map); + sc->a10_resid = data->len >> 2; + } else if (data != NULL && sc->a10_dma_inuse == 0 && + (rint & (A10_MMC_DATA_OVER | A10_MMC_RX_DATA_REQ | + A10_MMC_TX_DATA_REQ)) != 0) a10_mmc_pio_transfer(sc, data); if ((sc->a10_intr & sc->a10_intr_wait) == sc->a10_intr_wait) a10_mmc_req_ok(sc); +end: + A10_MMC_WRITE_4(sc, A10_MMC_IDST, idst); A10_MMC_WRITE_4(sc, A10_MMC_RINTR, rint); A10_MMC_UNLOCK(sc); } @@ -388,7 +571,7 @@ a10_mmc_request(device_t bus, device_t c int blksz; struct a10_mmc_softc *sc; struct mmc_command *cmd; - uint32_t cmdreg; + uint32_t cmdreg, val; sc = device_get_softc(bus); A10_MMC_LOCK(sc); @@ -424,6 +607,19 @@ a10_mmc_request(device_t bus, device_t c blksz = min(cmd->data->len, MMC_SECTOR_SIZE); A10_MMC_WRITE_4(sc, A10_MMC_BLKSZ, blksz); A10_MMC_WRITE_4(sc, A10_MMC_BCNTR, cmd->data->len); + + if (a10_mmc_pio_mode == 0) + a10_mmc_prepare_dma(sc); + /* Enable PIO access if sc->a10_dma_inuse is not set. */ + if (sc->a10_dma_inuse == 0) { + val = A10_MMC_READ_4(sc, A10_MMC_GCTRL); + val &= ~A10_MMC_DMA_ENABLE; + val |= A10_MMC_ACCESS_BY_AHB; + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, val); + val = A10_MMC_READ_4(sc, A10_MMC_IMASK); + val |= A10_MMC_RX_DATA_REQ | A10_MMC_TX_DATA_REQ; + A10_MMC_WRITE_4(sc, A10_MMC_IMASK, val); + } } A10_MMC_WRITE_4(sc, A10_MMC_CARG, cmd->arg); @@ -436,7 +632,7 @@ a10_mmc_request(device_t bus, device_t c } static int -a10_mmc_read_ivar(device_t bus, device_t child, int which, +a10_mmc_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) { struct a10_mmc_softc *sc; Modified: head/sys/arm/allwinner/a10_mmc.h ============================================================================== --- head/sys/arm/allwinner/a10_mmc.h Wed Jul 1 21:21:14 2015 (r285016) +++ head/sys/arm/allwinner/a10_mmc.h Wed Jul 1 23:27:01 2015 (r285017) @@ -66,7 +66,6 @@ #define A10_MMC_DMA_ENABLE (1U << 5) #define A10_MMC_DEBOUNCE_ENABLE (1U << 8) #define A10_MMC_DDR_MODE (1U << 10) -#define A10_MMC_ACCESS_BY_DMA (1U << 30) #define A10_MMC_ACCESS_BY_AHB (1U << 31) #define A10_MMC_RESET \ (A10_MMC_SOFT_RESET | A10_MMC_FIFO_RESET | A10_MMC_DMA_RESET) @@ -175,5 +174,25 @@ #define A10_MMC_IDMAC_RD (6U << 13) #define A10_MMC_IDMAC_WR (7U << 13) #define A10_MMC_IDMAC_DESC_CLOSE (8U << 13) +#define A10_MMC_IDMAC_ERROR \ + (A10_MMC_IDMAC_FATAL_BUS_ERR | A10_MMC_IDMAC_CARD_ERR_SUM | \ + A10_MMC_IDMAC_DES_INVALID | A10_MMC_IDMAC_ABNORMAL_INT_SUM) +#define A10_MMC_IDMAC_COMPLETE \ + (A10_MMC_IDMAC_TRANSMIT_INT | A10_MMC_IDMAC_RECEIVE_INT) + +/* The DMA descriptor table. */ +struct a10_mmc_dma_desc { + uint32_t config; +#define A10_MMC_DMA_CONFIG_DIC (1U << 1) +#define A10_MMC_DMA_CONFIG_LD (1U << 2) +#define A10_MMC_DMA_CONFIG_FD (1U << 3) +#define A10_MMC_DMA_CONFIG_CH (1U << 4) +#define A10_MMC_DMA_CONFIG_ER (1U << 5) +#define A10_MMC_DMA_CONFIG_CES (1U << 30) +#define A10_MMC_DMA_CONFIG_OWN (1U << 31) + uint32_t buf_size; + uint32_t buf_addr; + uint32_t next; +}; #endif /* _A10_MMC_H_ */ From owner-svn-src-head@freebsd.org Thu Jul 2 02:13:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BDA6992CCB; Thu, 2 Jul 2015 02:13:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 511751D88; Thu, 2 Jul 2015 02:13:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t622DLgu013325; Thu, 2 Jul 2015 02:13:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t622DL3V013324; Thu, 2 Jul 2015 02:13:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201507020213.t622DL3V013324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 2 Jul 2015 02:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285018 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 02:13:21 -0000 Author: gjb Date: Thu Jul 2 02:13:20 2015 New Revision: 285018 URL: https://svnweb.freebsd.org/changeset/base/285018 Log: Implement an evil workaround that prevents UFS/MSDOS labels from being written to disk with newfs(8) and newfs_msdosfs(8). When iterating through snapshot builds in serial, it is possible for a build failure to leave stale md(4) devices behind, in some cases, they could have a UFS or MSDOS filesystem label assigned. If the md(4) is not destroyed (or not able to be destroyed, as has happened recently due to my own fault), the filesystem label that already exists can interfere with a new md(4) device that is targeted to have the same label. This behavior, although admittedly a logic error in the wrapper build scripts, has caused intermittent reports (in particular with the armv6 builds) of missing UFS/MSDOSFS labels, causing the image to fallback to the mountroot prompt. This appears to only happen when the backing md(4) device is destroyed before the calling umount(8) on the target mount, after which the UFS/MSDOSFS label persists. The workaround is this: If EVERYTHINGISFINE is set to non-empty value, check for an existing ufs/rootfs and msdosfs/MSDOSBOOT filesystem label in arm_create_disk(), and rm(1) them if they exist. The EVERYTHINGISFINE variable is chosen because it is used in exactly one other place - release/Makefile.mirrors - and there are big scary warnings at the top of that file as well that it should *not* be used under normal circumstances. This should not destroy a build machine that also uses '/dev/ufs/rootfs' as the UFS label, and I have verified in extensive local testing that the destroyed label is recreated when the md(4) is unmounted/mounted, but this really should not be enabled by anyone. Having said all that, I absolutely *do* plan MFC this to stable/10 for the 10.2-RELEASE cycle, as so far, I have only observed this behavior on stable/10, but this is a temporary solution until I can unravel all of the failure paths to properly trap them. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Wed Jul 1 23:27:01 2015 (r285017) +++ head/release/tools/arm.subr Thu Jul 2 02:13:20 2015 (r285018) @@ -63,6 +63,18 @@ umount_loop() { } arm_create_disk() { + # XXX: This is potentially dangerous, but works around an issue + # properly labeling md(4) devices when the label already + # exists. + # EVERYTHINGISFINE should *never* be set for non-RE use. + # Trust me. I'm an engineer. + if [ ! -z "${EVERYTHINGISFINE}" ]; then + for _label in ufs/rootfs msdosfs/MSDOSBOOT; do + if [ -e "${CHROOTDIR}/dev/${_label}" ]; then + rm ${CHROOTDIR}/dev/${_label} + fi + done + fi # Create the target raw file and temporary work directory. chroot ${CHROOTDIR} gpart create -s ${PART_SCHEME} ${mddev} chroot ${CHROOTDIR} gpart add -t '!12' -a 63 -s ${FAT_SIZE} ${mddev} From owner-svn-src-head@freebsd.org Thu Jul 2 02:33:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38138992F13; Thu, 2 Jul 2015 02:33:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20158156A; Thu, 2 Jul 2015 02:33:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t622XwMU023192; Thu, 2 Jul 2015 02:33:58 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t622XwEj023191; Thu, 2 Jul 2015 02:33:58 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201507020233.t622XwEj023191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 2 Jul 2015 02:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285019 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 02:33:59 -0000 Author: gjb Date: Thu Jul 2 02:33:58 2015 New Revision: 285019 URL: https://svnweb.freebsd.org/changeset/base/285019 Log: Fix the path to the UFS/MSDOSFS filesystem labels, since they cannot possibly exist within the chroot(8) before the target filesystem actually exists. MFC after: 3 days X-MFC-With: r285018 Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Thu Jul 2 02:13:20 2015 (r285018) +++ head/release/tools/arm.subr Thu Jul 2 02:33:58 2015 (r285019) @@ -70,8 +70,8 @@ arm_create_disk() { # Trust me. I'm an engineer. if [ ! -z "${EVERYTHINGISFINE}" ]; then for _label in ufs/rootfs msdosfs/MSDOSBOOT; do - if [ -e "${CHROOTDIR}/dev/${_label}" ]; then - rm ${CHROOTDIR}/dev/${_label} + if [ -e "/dev/${_label}" ]; then + rm /dev/${_label} fi done fi From owner-svn-src-head@freebsd.org Thu Jul 2 06:59:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F55599292E; Thu, 2 Jul 2015 06:59:25 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26FF4271A; Thu, 2 Jul 2015 06:59:22 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZAYSs-0002Uo-6w; Thu, 02 Jul 2015 07:59:18 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=us-ascii From: Mark R V Murray In-Reply-To: <13981.1435792025@chaos> Date: Thu, 2 Jul 2015 07:59:11 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 06:59:25 -0000 > On 2 Jul 2015, at 00:07, Simon J. Gerraty wrote: >=20 > Mark Murray wrote: >> * src/sys/dev/random/random_adaptors.c = src/sys/dev/random/random_adaptors.h >> - Remove; plugability is no longer used. Compile-time algorithm >> selection is the way to go. >=20 > Errr we use that and need it. > Please put it back. Do you really need full the plugability (including run-time selection of = algorithm), or do you just need to have KLD modules back? I intend to do the latter, but in a different way. The adaptor code and = run-time section was a locking liability. > Whether we agree with NIST's ideas about how randomness should be > handled or not, we need to to be able to comply and we do not want to > burn their desired arrangement into our kernels. Sound like you just need to be able to select a single KLD at boot time? M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Thu Jul 2 08:25:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14405993A35; Thu, 2 Jul 2015 08:25:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFF1E2A26; Thu, 2 Jul 2015 08:25:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t628PjIR098367; Thu, 2 Jul 2015 08:25:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t628PjoZ098366; Thu, 2 Jul 2015 08:25:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201507020825.t628PjoZ098366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 2 Jul 2015 08:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285020 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 08:25:46 -0000 Author: mav Date: Thu Jul 2 08:25:45 2015 New Revision: 285020 URL: https://svnweb.freebsd.org/changeset/base/285020 Log: Disable port multiplier support on Marvell 88SE61xx chips. According to report, some recent unrelated changes in the driver triggered timeouts when testing for absent port multiplier. Cause of this behavior channge is unclear, but since these chips are old, rare and buggy, it is easier to just disable port multiplier support, same as done in Linux. Reported by: bar MFC after: 3 days Modified: head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Thu Jul 2 02:33:58 2015 (r285019) +++ head/sys/dev/ahci/ahci_pci.c Thu Jul 2 08:25:45 2015 (r285020) @@ -184,14 +184,14 @@ static const struct { {0x2365197b, 0x00, "JMicron JMB365", AHCI_Q_NOFORCE}, {0x2366197b, 0x00, "JMicron JMB366", AHCI_Q_NOFORCE}, {0x2368197b, 0x00, "JMicron JMB368", AHCI_Q_NOFORCE}, - {0x611111ab, 0x00, "Marvell 88SE6111", AHCI_Q_NOFORCE | AHCI_Q_1CH | - AHCI_Q_EDGEIS}, - {0x612111ab, 0x00, "Marvell 88SE6121", AHCI_Q_NOFORCE | AHCI_Q_2CH | - AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, - {0x614111ab, 0x00, "Marvell 88SE6141", AHCI_Q_NOFORCE | AHCI_Q_4CH | - AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, - {0x614511ab, 0x00, "Marvell 88SE6145", AHCI_Q_NOFORCE | AHCI_Q_4CH | - AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, + {0x611111ab, 0x00, "Marvell 88SE6111", AHCI_Q_NOFORCE | AHCI_Q_NOPMP | + AHCI_Q_1CH | AHCI_Q_EDGEIS}, + {0x612111ab, 0x00, "Marvell 88SE6121", AHCI_Q_NOFORCE | AHCI_Q_NOPMP | + AHCI_Q_2CH | AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, + {0x614111ab, 0x00, "Marvell 88SE6141", AHCI_Q_NOFORCE | AHCI_Q_NOPMP | + AHCI_Q_4CH | AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, + {0x614511ab, 0x00, "Marvell 88SE6145", AHCI_Q_NOFORCE | AHCI_Q_NOPMP | + AHCI_Q_4CH | AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, {0x91201b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS}, {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_ALTSIG}, {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2}, From owner-svn-src-head@freebsd.org Thu Jul 2 08:32:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CAD4993BEA; Thu, 2 Jul 2015 08:32:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 032B82FEF; Thu, 2 Jul 2015 08:32:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t628W3gR002945; Thu, 2 Jul 2015 08:32:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t628W3WJ002944; Thu, 2 Jul 2015 08:32:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201507020832.t628W3WJ002944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 2 Jul 2015 08:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285021 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 08:32:04 -0000 Author: avg Date: Thu Jul 2 08:32:02 2015 New Revision: 285021 URL: https://svnweb.freebsd.org/changeset/base/285021 Log: zfs_mount(MS_REMOUNT): protect zfs_(un)register_callbacks calls We now take z_teardown_lock as a writer to ensure that there is no I/O while the filesystem state is in a flux. Also, zfs_suspend_fs() -> zfsvfs_teardown() call zfs_unregister_callbacks() and zfs_resume_fs() -> zfsvfs_setup() call zfs_unregister_callbacks(). Previously there was no synchronization between those calls and the calls in the re-mounting case. That could lead to concurrent execution and a crash. PR: 180060 Differential Revision: https://reviews.freebsd.org/D2865 Suggested by: mahrens Reviewed by: delphij, pho, mahrens, will MFC after: 13 days Sponsored by: ClusterHQ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jul 2 08:25:45 2015 (r285020) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jul 2 08:32:02 2015 (r285021) @@ -1717,9 +1717,19 @@ zfs_mount(vfs_t *vfsp) * according to those options set in the current VFS options. */ if (vfsp->vfs_flag & MS_REMOUNT) { - /* refresh mount options */ - zfs_unregister_callbacks(vfsp->vfs_data); + zfsvfs_t *zfsvfs = vfsp->vfs_data; + + /* + * Refresh mount options with z_teardown_lock blocking I/O while + * the filesystem is in an inconsistent state. + * The lock also serializes this code with filesystem + * manipulations between entry to zfs_suspend_fs() and return + * from zfs_resume_fs(). + */ + rrm_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); + zfs_unregister_callbacks(zfsvfs); error = zfs_register_callbacks(vfsp); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); goto out; } From owner-svn-src-head@freebsd.org Thu Jul 2 10:55:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADEB8992A18; Thu, 2 Jul 2015 10:55:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F20C168D; Thu, 2 Jul 2015 10:55:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62AtXVb071625; Thu, 2 Jul 2015 10:55:33 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62AtX8I071623; Thu, 2 Jul 2015 10:55:33 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201507021055.t62AtX8I071623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Thu, 2 Jul 2015 10:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285023 - in head: sbin/geom/class/eli sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 10:55:33 -0000 Author: pjd Date: Thu Jul 2 10:55:32 2015 New Revision: 285023 URL: https://svnweb.freebsd.org/changeset/base/285023 Log: Allow to omit keyfile number for the first keyfile. Modified: head/sbin/geom/class/eli/geli.8 head/sys/geom/eli/g_eli.c Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Thu Jul 2 10:31:08 2015 (r285022) +++ head/sbin/geom/class/eli/geli.8 Thu Jul 2 10:55:32 2015 (r285023) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2014 +.Dd June 2, 2015 .Dt GELI 8 .Os .Sh NAME @@ -893,6 +893,13 @@ geli_da1s3a_keyfile0_type="da1s3a:geli_k geli_da1s3a_keyfile0_name="/boot/keys/da1s3a.key" .Ed .Pp +If there is only one keyfile, the index might be omitted: +.Bd -literal -offset indent +geli_da1s3a_keyfile_load="YES" +geli_da1s3a_keyfile_type="da1s3a:geli_keyfile" +geli_da1s3a_keyfile_name="/boot/keys/da1s3a.key" +.Ed +.Pp Not only configure encryption, but also data integrity verification using .Nm HMAC/SHA256 . .Bd -literal -offset indent Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Thu Jul 2 10:31:08 2015 (r285022) +++ head/sys/geom/eli/g_eli.c Thu Jul 2 10:55:32 2015 (r285023) @@ -998,6 +998,13 @@ g_eli_keyfiles_load(struct hmac_ctx *ctx for (i = 0; ; i++) { snprintf(name, sizeof(name), "%s:geli_keyfile%d", provider, i); keyfile = preload_search_by_type(name); + if (keyfile == NULL && i == 0) { + /* + * If there is only one keyfile, allow simpler name. + */ + snprintf(name, sizeof(name), "%s:geli_keyfile", provider); + keyfile = preload_search_by_type(name); + } if (keyfile == NULL) return (i); /* Return number of loaded keyfiles. */ data = preload_fetch_addr(keyfile); From owner-svn-src-head@freebsd.org Thu Jul 2 10:57:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 188C9992A5D; Thu, 2 Jul 2015 10:57:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A0CF1982; Thu, 2 Jul 2015 10:57:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62AvYwu071924; Thu, 2 Jul 2015 10:57:34 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62AvYVR071923; Thu, 2 Jul 2015 10:57:34 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201507021057.t62AvYVR071923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Thu, 2 Jul 2015 10:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285024 - head/sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 10:57:35 -0000 Author: pjd Date: Thu Jul 2 10:57:34 2015 New Revision: 285024 URL: https://svnweb.freebsd.org/changeset/base/285024 Log: Properly propagate errors in metadata reading. PR: 198860 Submitted by: Matthew D. Fuller Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Thu Jul 2 10:55:32 2015 (r285023) +++ head/sys/geom/eli/g_eli.c Thu Jul 2 10:57:34 2015 (r285024) @@ -633,7 +633,10 @@ g_eli_read_metadata(struct g_class *mp, g_topology_lock(); if (buf == NULL) goto end; - eli_metadata_decode(buf, md); + error = eli_metadata_decode(buf, md); + if (error != 0) + goto end; + /* Metadata was read and decoded successfully. */ end: if (buf != NULL) g_free(buf); From owner-svn-src-head@freebsd.org Thu Jul 2 11:46:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 741E09924E2; Thu, 2 Jul 2015 11:46:36 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6545E208F; Thu, 2 Jul 2015 11:46:36 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62Bka9h096288; Thu, 2 Jul 2015 11:46:36 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62BkaaK096287; Thu, 2 Jul 2015 11:46:36 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201507021146.t62BkaaK096287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Thu, 2 Jul 2015 11:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285026 - head/games/fortune/datfiles X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 11:46:36 -0000 Author: brueffer Date: Thu Jul 2 11:46:35 2015 New Revision: 285026 URL: https://svnweb.freebsd.org/changeset/base/285026 Log: Fix a typo. PR: 199453 Submitted by: John Nielsen Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Thu Jul 2 11:01:27 2015 (r285025) +++ head/games/fortune/datfiles/fortunes Thu Jul 2 11:46:35 2015 (r285026) @@ -6727,7 +6727,7 @@ K is for Kate who was struck with an axe M is for Maud who was swept out to sea, N is for Neville who died of ennui. O is for Olive, run through with an awl, P is for Prue, trampled flat in a brawl Q is for Quentin who sank in a mire, R is for Rhoda, consumed by a fire. -S is for Susan who parished of fits, T is for Titus who flew into bits. +S is for Susan who perished of fits, T is for Titus who flew into bits. U is for Una who slipped down a drain, V is for Victor, squashed under a train. W is for Winnie, embedded in ice, X is for Xerxes, devoured by mice. Y is for Yorick whose head was bashed in, Z is for Zillah who drank too much gin. From owner-svn-src-head@freebsd.org Thu Jul 2 12:08:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33D52992EFC; Thu, 2 Jul 2015 12:08:06 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 240932FDC; Thu, 2 Jul 2015 12:08:06 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62C85VQ006701; Thu, 2 Jul 2015 12:08:05 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62C85Hs006700; Thu, 2 Jul 2015 12:08:05 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201507021208.t62C85Hs006700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Thu, 2 Jul 2015 12:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285028 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 12:08:06 -0000 Author: brueffer Date: Thu Jul 2 12:08:05 2015 New Revision: 285028 URL: https://svnweb.freebsd.org/changeset/base/285028 Log: Add the year to the VAX-11/780 announcement entry. PR: 200961 Submitted by: John Marshall MFC after: 1 week Modified: head/usr.bin/calendar/calendars/calendar.computer Modified: head/usr.bin/calendar/calendars/calendar.computer ============================================================================== --- head/usr.bin/calendar/calendars/calendar.computer Thu Jul 2 11:46:40 2015 (r285027) +++ head/usr.bin/calendar/calendars/calendar.computer Thu Jul 2 12:08:05 2015 (r285028) @@ -69,7 +69,7 @@ 10/14 British Computer Society founded, 1957 10/15 First FORTRAN Programmer's Reference Manual published, 1956 10/20 Zurich ALGOL report published, 1958 -10/25 DEC announces VAX-11/780 +10/25 DEC announces VAX-11/780, 1977 11/04 UNIVAC I program predicts Eisenhower victory based on 7% of votes, 1952 12/08 First Ph.D. awarded by Computer Science Dept, Univ. of Penna, 1965 From owner-svn-src-head@freebsd.org Thu Jul 2 12:14:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55EAC9910BD; Thu, 2 Jul 2015 12:14:49 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46ED21598; Thu, 2 Jul 2015 12:14:49 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62CEnfR011171; Thu, 2 Jul 2015 12:14:49 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62CEn8K011169; Thu, 2 Jul 2015 12:14:49 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201507021214.t62CEn8K011169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Thu, 2 Jul 2015 12:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285029 - head/sbin/newfs_nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 12:14:49 -0000 Author: brueffer Date: Thu Jul 2 12:14:48 2015 New Revision: 285029 URL: https://svnweb.freebsd.org/changeset/base/285029 Log: Fix an obviously wrong boolean operator. PR: 200983 Submitted by: David Bindeman MFC after: 1 week Modified: head/sbin/newfs_nandfs/newfs_nandfs.c Modified: head/sbin/newfs_nandfs/newfs_nandfs.c ============================================================================== --- head/sbin/newfs_nandfs/newfs_nandfs.c Thu Jul 2 12:08:05 2015 (r285028) +++ head/sbin/newfs_nandfs/newfs_nandfs.c Thu Jul 2 12:14:48 2015 (r285029) @@ -897,7 +897,7 @@ check_parameters(void) NANDFS_SEG_MIN_BLOCKS); /* check reserved segment percentage */ - if ((rsv_segment_percent < 1) && (rsv_segment_percent > 99)) + if ((rsv_segment_percent < 1) || (rsv_segment_percent > 99)) errx(1, "Bad reserved segment percentage. " "Must in range 1..99."); From owner-svn-src-head@freebsd.org Thu Jul 2 12:53:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06973991C19; Thu, 2 Jul 2015 12:53:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAFD81CB9; Thu, 2 Jul 2015 12:53:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62CrM0S030849; Thu, 2 Jul 2015 12:53:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62CrMVR030848; Thu, 2 Jul 2015 12:53:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201507021253.t62CrMVR030848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 2 Jul 2015 12:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285030 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 12:53:23 -0000 Author: mav Date: Thu Jul 2 12:53:22 2015 New Revision: 285030 URL: https://svnweb.freebsd.org/changeset/base/285030 Log: Fix couple panics on forced unmount of backing file. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Jul 2 12:14:48 2015 (r285029) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Jul 2 12:53:22 2015 (r285030) @@ -810,24 +810,27 @@ ctl_be_block_getattr_file(struct ctl_be_ { struct vattr vattr; struct statfs statfs; + uint64_t val; int error; + val = UINT64_MAX; if (be_lun->vn == NULL) - return (UINT64_MAX); + return (val); + vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); if (strcmp(attrname, "blocksused") == 0) { error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); - if (error != 0) - return (UINT64_MAX); - return (vattr.va_bytes >> be_lun->blocksize_shift); + if (error == 0) + val = vattr.va_bytes >> be_lun->blocksize_shift; } - if (strcmp(attrname, "blocksavail") == 0) { + if (strcmp(attrname, "blocksavail") == 0 && + (be_lun->vn->v_iflag & VI_DOOMED) == 0) { error = VFS_STATFS(be_lun->vn->v_mount, &statfs); - if (error != 0) - return (UINT64_MAX); - return ((statfs.f_bavail * statfs.f_bsize) >> - be_lun->blocksize_shift); + if (error == 0) + val = (statfs.f_bavail * statfs.f_bsize) >> + be_lun->blocksize_shift; } - return (UINT64_MAX); + VOP_UNLOCK(be_lun->vn, 0); + return (val); } static void @@ -2666,10 +2669,12 @@ ctl_be_block_modify(struct ctl_be_block_ oldsize = be_lun->size_bytes; if (be_lun->vn == NULL) error = ctl_be_block_open(softc, be_lun, req); + else if (vn_isdisk(be_lun->vn, &error)) + error = ctl_be_block_modify_dev(be_lun, req); else if (be_lun->vn->v_type == VREG) error = ctl_be_block_modify_file(be_lun, req); else - error = ctl_be_block_modify_dev(be_lun, req); + error = EINVAL; if (error == 0 && be_lun->size_bytes != oldsize) { be_lun->size_blocks = be_lun->size_bytes >> From owner-svn-src-head@freebsd.org Thu Jul 2 13:42:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E83599360F; Thu, 2 Jul 2015 13:42:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F652229D; Thu, 2 Jul 2015 13:42:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62Dgwtn056922; Thu, 2 Jul 2015 13:42:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62DgwxX056921; Thu, 2 Jul 2015 13:42:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507021342.t62DgwxX056921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 2 Jul 2015 13:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285036 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 13:42:58 -0000 Author: andrew Date: Thu Jul 2 13:42:57 2015 New Revision: 285036 URL: https://svnweb.freebsd.org/changeset/base/285036 Log: Set MACHINE_CPU to arm64 when building for arm64. This is needed by the ports tree as they check this value in a number of ports. PR: 201259 Sponsored by: ABT Systems Ltd Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Thu Jul 2 13:22:41 2015 (r285035) +++ head/share/mk/bsd.cpu.mk Thu Jul 2 13:42:57 2015 (r285036) @@ -6,7 +6,9 @@ .if !defined(CPUTYPE) || empty(CPUTYPE) _CPUCFLAGS = -. if ${MACHINE_CPUARCH} == "amd64" +. if ${MACHINE_CPUARCH} == "aarch64" +MACHINE_CPU = arm64 +. elif ${MACHINE_CPUARCH} == "amd64" MACHINE_CPU = amd64 sse2 sse mmx . elif ${MACHINE_CPUARCH} == "arm" MACHINE_CPU = arm From owner-svn-src-head@freebsd.org Thu Jul 2 13:57:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55501993811; Thu, 2 Jul 2015 13:57:27 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 460072A35; Thu, 2 Jul 2015 13:57:27 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62DvRmr062376; Thu, 2 Jul 2015 13:57:27 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62DvRdF062375; Thu, 2 Jul 2015 13:57:27 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201507021357.t62DvRdF062375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Thu, 2 Jul 2015 13:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285037 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 13:57:27 -0000 Author: brueffer Date: Thu Jul 2 13:57:26 2015 New Revision: 285037 URL: https://svnweb.freebsd.org/changeset/base/285037 Log: Add -b to the devlist usage info, forgotten in r260059. PR: 195094 Submitted by: robin.hahling@gw-computing.net MFC after: 1 week Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Jul 2 13:42:57 2015 (r285036) +++ head/sbin/camcontrol/camcontrol.c Thu Jul 2 13:57:26 2015 (r285037) @@ -8058,7 +8058,7 @@ usage(int printlong) fprintf(printlong ? stdout : stderr, "usage: camcontrol [device id][generic args][command args]\n" -" camcontrol devlist [-v]\n" +" camcontrol devlist [-b] [-v]\n" #ifndef MINIMALISTIC " camcontrol periphlist [dev_id][-n dev_name] [-u unit]\n" " camcontrol tur [dev_id][generic args]\n" From owner-svn-src-head@freebsd.org Thu Jul 2 14:00:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A7499387D; Thu, 2 Jul 2015 14:00:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 599992C35; Thu, 2 Jul 2015 14:00:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62E088D063564; Thu, 2 Jul 2015 14:00:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62E08vq063562; Thu, 2 Jul 2015 14:00:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507021400.t62E08vq063562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 2 Jul 2015 14:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285038 - head/libexec/rtld-elf/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 14:00:08 -0000 Author: andrew Date: Thu Jul 2 14:00:07 2015 New Revision: 285038 URL: https://svnweb.freebsd.org/changeset/base/285038 Log: Save & restore the floating-pont argument registers before calling _rtld_bind. The compiler may generate code using these registers and not save them. Unfortunately, as we make use of libc, we are unable to disallow rtld from using floating-point register without also doing the same for the parts of libc we use, or by limiting what _rtld_bind is able to call. Obtained from: ABT Systems Ltd Sponsored by: The FReeBSD Foundation Modified: head/libexec/rtld-elf/aarch64/rtld_start.S Modified: head/libexec/rtld-elf/aarch64/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/aarch64/rtld_start.S Thu Jul 2 13:57:26 2015 (r285037) +++ head/libexec/rtld-elf/aarch64/rtld_start.S Thu Jul 2 14:00:07 2015 (r285038) @@ -70,6 +70,12 @@ ENTRY(_rtld_bind_start) stp x6, x7, [sp, #-16]! stp x8, xzr, [sp, #-16]! + /* Save any floating-point arguments */ + stp q0, q1, [sp, #-32]! + stp q2, q3, [sp, #-32]! + stp q4, q5, [sp, #-32]! + stp q6, q7, [sp, #-32]! + /* Calculate reloff */ ldr x2, [x17, #0] /* Get the address of the entry */ sub x1, x2, x16 /* Find its offset */ @@ -85,12 +91,16 @@ ENTRY(_rtld_bind_start) bl _rtld_bind /* Restore the registers saved by the plt code */ - ldp xzr, x30, [sp, #(5 * 16)] + ldp xzr, x30, [sp, #(5 * 16 + 4 * 32)] /* Backup the address to branch to */ mov x16, x0 /* restore the arguments */ + ldp q6, q7, [sp], #32 + ldp q4, q5, [sp], #32 + ldp q2, q3, [sp], #32 + ldp q0, q1, [sp], #32 ldp x8, xzr, [sp], #16 ldp x6, x7, [sp], #16 ldp x4, x5, [sp], #16 From owner-svn-src-head@freebsd.org Thu Jul 2 14:31:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6FC3993D78; Thu, 2 Jul 2015 14:31:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A79E51F6C; Thu, 2 Jul 2015 14:31:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62EVlfs080329; Thu, 2 Jul 2015 14:31:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62EVlTL080328; Thu, 2 Jul 2015 14:31:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507021431.t62EVlTL080328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 2 Jul 2015 14:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285039 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 14:31:47 -0000 Author: kib Date: Thu Jul 2 14:31:47 2015 New Revision: 285039 URL: https://svnweb.freebsd.org/changeset/base/285039 Log: Vnode is not referenced by the vfs_domount() at the point where asserts are made. Remove them, since we might dereference freed memory. Leaked locks are asserted by the syscall return code anyway. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Jul 2 14:00:07 2015 (r285038) +++ head/sys/kern/vfs_mount.c Thu Jul 2 14:31:47 2015 (r285039) @@ -1108,9 +1108,6 @@ vfs_domount( } else error = vfs_domount_update(td, vp, fsflags, optlist); - ASSERT_VI_UNLOCKED(vp, __func__); - ASSERT_VOP_UNLOCKED(vp, __func__); - return (error); } From owner-svn-src-head@freebsd.org Thu Jul 2 14:35:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3B09993E7A; Thu, 2 Jul 2015 14:35:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4A7B22D0; Thu, 2 Jul 2015 14:35:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62EZVFV082002; Thu, 2 Jul 2015 14:35:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62EZVBk082001; Thu, 2 Jul 2015 14:35:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507021435.t62EZVBk082001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 2 Jul 2015 14:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285040 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 14:35:31 -0000 Author: andrew Date: Thu Jul 2 14:35:30 2015 New Revision: 285040 URL: https://svnweb.freebsd.org/changeset/base/285040 Log: Enable kernel debugging on arm64, other than GDB as it fails to build. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu Jul 2 14:31:47 2015 (r285039) +++ head/sys/arm64/conf/GENERIC Thu Jul 2 14:35:30 2015 (r285040) @@ -69,6 +69,19 @@ options RACCT # Resource accounting f options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default options RCTL # Resource limits +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use (turn off in stable branch): +options DDB # Support DDB. +#options GDB # Support remote GDB. +options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + device virtio device virtio_mmio device virtio_blk From owner-svn-src-head@freebsd.org Thu Jul 2 14:37:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15137993EF9; Thu, 2 Jul 2015 14:37:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED5812603; Thu, 2 Jul 2015 14:37:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62EbNgi082289; Thu, 2 Jul 2015 14:37:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62EbL35082279; Thu, 2 Jul 2015 14:37:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507021437.t62EbL35082279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 2 Jul 2015 14:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285041 - in head: gnu/usr.bin/gdb/kgdb sys/amd64/include sys/cddl/dev/dtrace/i386 sys/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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 14:37:24 -0000 Author: kib Date: Thu Jul 2 14:37:21 2015 New Revision: 285041 URL: https://svnweb.freebsd.org/changeset/base/285041 Log: Use single instance of the identical INKERNEL() and PMC_IN_KERNEL() macros on amd64 and i386. Move the definition to machine/param.h. kgdb defines INKERNEL() too, the conflict is resolved by renaming kgdb version to PINKERNEL(). On i386, correct the lowest kernel address. After the shared page was introduced, USRSTACK no longer points to the last user address + 1 [*] Submitted by: Oliver Pinter [*] Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/gnu/usr.bin/gdb/kgdb/trgt.c head/sys/amd64/include/param.h head/sys/amd64/include/pmc_mdep.h head/sys/amd64/include/stack.h head/sys/cddl/dev/dtrace/i386/dtrace_isa.c head/sys/i386/include/param.h head/sys/i386/include/pmc_mdep.h head/sys/i386/include/stack.h Modified: head/gnu/usr.bin/gdb/kgdb/trgt.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt.c Thu Jul 2 14:35:30 2015 (r285040) +++ head/gnu/usr.bin/gdb/kgdb/trgt.c Thu Jul 2 14:37:21 2015 (r285041) @@ -76,7 +76,7 @@ kvm_t *kvm; static char kvm_err[_POSIX2_LINE_MAX]; #define KERNOFF (kgdb_kernbase ()) -#define INKERNEL(x) ((x) >= KERNOFF) +#define PINKERNEL(x) ((x) >= KERNOFF) static CORE_ADDR kgdb_kernbase (void) @@ -296,7 +296,7 @@ kgdb_set_proc_cmd (char *arg, int from_t addr = (CORE_ADDR) parse_and_eval_address (arg); - if (!INKERNEL (addr)) { + if (!PINKERNEL (addr)) { thr = kgdb_thr_lookup_pid((int)addr); if (thr == NULL) error ("invalid pid"); @@ -319,7 +319,7 @@ kgdb_set_tid_cmd (char *arg, int from_tt addr = (CORE_ADDR) parse_and_eval_address (arg); - if (kvm != NULL && INKERNEL (addr)) { + if (kvm != NULL && PINKERNEL (addr)) { thr = kgdb_thr_lookup_taddr(addr); if (thr == NULL) error("invalid thread address"); Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Thu Jul 2 14:35:30 2015 (r285040) +++ head/sys/amd64/include/param.h Thu Jul 2 14:37:21 2015 (r285041) @@ -149,4 +149,7 @@ #define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) +#define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \ + || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS)) + #endif /* !_AMD64_INCLUDE_PARAM_H_ */ Modified: head/sys/amd64/include/pmc_mdep.h ============================================================================== --- head/sys/amd64/include/pmc_mdep.h Thu Jul 2 14:35:30 2015 (r285040) +++ head/sys/amd64/include/pmc_mdep.h Thu Jul 2 14:37:21 2015 (r285041) @@ -113,9 +113,7 @@ union pmc_md_pmc { #define PMC_IN_KERNEL_STACK(S,START,END) \ ((S) >= (START) && (S) < (END)) -#define PMC_IN_KERNEL(va) (((va) >= DMAP_MIN_ADDRESS && \ - (va) < DMAP_MAX_ADDRESS) || ((va) >= VM_MIN_KERNEL_ADDRESS && \ - (va) < VM_MAX_KERNEL_ADDRESS)) +#define PMC_IN_KERNEL(va) INKERNEL(va) #define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) Modified: head/sys/amd64/include/stack.h ============================================================================== --- head/sys/amd64/include/stack.h Thu Jul 2 14:35:30 2015 (r285040) +++ head/sys/amd64/include/stack.h Thu Jul 2 14:37:21 2015 (r285041) @@ -32,8 +32,6 @@ /* * Stack trace. */ -#define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \ - || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS)) struct amd64_frame { struct amd64_frame *f_frame; Modified: head/sys/cddl/dev/dtrace/i386/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_isa.c Thu Jul 2 14:35:30 2015 (r285040) +++ head/sys/cddl/dev/dtrace/i386/dtrace_isa.c Thu Jul 2 14:37:21 2015 (r285041) @@ -47,9 +47,6 @@ extern uintptr_t kernbase; uintptr_t kernelbase = (uintptr_t) &kernbase; -#define INKERNEL(va) (((vm_offset_t)(va)) >= USRSTACK && \ - ((vm_offset_t)(va)) < VM_MAX_KERNEL_ADDRESS) - uint8_t dtrace_fuword8_nocheck(void *); uint16_t dtrace_fuword16_nocheck(void *); uint32_t dtrace_fuword32_nocheck(void *); Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Thu Jul 2 14:35:30 2015 (r285040) +++ head/sys/i386/include/param.h Thu Jul 2 14:37:21 2015 (r285041) @@ -157,4 +157,7 @@ #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) +#define INKERNEL(va) (((vm_offset_t)(va)) >= VM_MAXUSER_ADDRESS && \ + ((vm_offset_t)(va)) < VM_MAX_KERNEL_ADDRESS) + #endif /* !_I386_INCLUDE_PARAM_H_ */ Modified: head/sys/i386/include/pmc_mdep.h ============================================================================== --- head/sys/i386/include/pmc_mdep.h Thu Jul 2 14:35:30 2015 (r285040) +++ head/sys/i386/include/pmc_mdep.h Thu Jul 2 14:37:21 2015 (r285041) @@ -138,8 +138,7 @@ struct pmc_mdep; #define PMC_IN_KERNEL_STACK(S,START,END) \ ((S) >= (START) && (S) < (END)) -#define PMC_IN_KERNEL(va) (((va) >= USRSTACK) && \ - ((va) < VM_MAX_KERNEL_ADDRESS)) +#define PMC_IN_KERNEL(va) INKERNEL(va) #define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) Modified: head/sys/i386/include/stack.h ============================================================================== --- head/sys/i386/include/stack.h Thu Jul 2 14:35:30 2015 (r285040) +++ head/sys/i386/include/stack.h Thu Jul 2 14:37:21 2015 (r285041) @@ -32,8 +32,6 @@ /* * Stack trace. */ -#define INKERNEL(va) (((vm_offset_t)(va)) >= USRSTACK && \ - ((vm_offset_t)(va)) < VM_MAX_KERNEL_ADDRESS) struct i386_frame { struct i386_frame *f_frame; From owner-svn-src-head@freebsd.org Thu Jul 2 14:44:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38690992291; Thu, 2 Jul 2015 14:44:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2961915FD; Thu, 2 Jul 2015 14:44:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62EiVoR088290; Thu, 2 Jul 2015 14:44:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62EiVUK088289; Thu, 2 Jul 2015 14:44:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201507021444.t62EiVUK088289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 2 Jul 2015 14:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285042 - head/contrib/bmake/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 14:44:31 -0000 Author: emaste Date: Thu Jul 2 14:44:30 2015 New Revision: 285042 URL: https://svnweb.freebsd.org/changeset/base/285042 Log: Update meta2deps example after i386-elf to i386 rename Modified: head/contrib/bmake/mk/meta2deps.sh Modified: head/contrib/bmake/mk/meta2deps.sh ============================================================================== --- head/contrib/bmake/mk/meta2deps.sh Thu Jul 2 14:37:21 2015 (r285041) +++ head/contrib/bmake/mk/meta2deps.sh Thu Jul 2 14:44:30 2015 (r285042) @@ -52,7 +52,7 @@ # $SB/obj-i386/bsd/gnu/lib/csu # $SB/obj-i386/bsd/gnu/lib/libgcc # $SB/obj-i386/bsd/include -# $SB/obj-i386/bsd/lib/csu/i386-elf +# $SB/obj-i386/bsd/lib/csu/i386 # $SB/obj-i386/bsd/lib/libc # $SB/src/bsd/include # $SB/src/bsd/sys/i386/include From owner-svn-src-head@freebsd.org Thu Jul 2 14:54:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C16E09924D6; Thu, 2 Jul 2015 14:54:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A54911E79; Thu, 2 Jul 2015 14:54:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62EsMPC093263; Thu, 2 Jul 2015 14:54:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62EsLpQ093259; Thu, 2 Jul 2015 14:54:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507021454.t62EsLpQ093259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 2 Jul 2015 14:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285043 - in head/lib/libc/aarch64: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 14:54:23 -0000 Author: andrew Date: Thu Jul 2 14:54:21 2015 New Revision: 285043 URL: https://svnweb.freebsd.org/changeset/base/285043 Log: Cleanup brk and sbrk to use the same code to find curbrk and minbrk when both compiling for PIC and non-PIC. Sponsored by: ABT Systems Ltd Modified: head/lib/libc/aarch64/Symbol.map head/lib/libc/aarch64/sys/brk.S head/lib/libc/aarch64/sys/sbrk.S Modified: head/lib/libc/aarch64/Symbol.map ============================================================================== --- head/lib/libc/aarch64/Symbol.map Thu Jul 2 14:44:30 2015 (r285042) +++ head/lib/libc/aarch64/Symbol.map Thu Jul 2 14:54:21 2015 (r285043) @@ -28,6 +28,7 @@ FBSD_1.0 { FBSDprivate_1.0 { _set_tp; + _end; curbrk; minbrk; }; Modified: head/lib/libc/aarch64/sys/brk.S ============================================================================== --- head/lib/libc/aarch64/sys/brk.S Thu Jul 2 14:44:30 2015 (r285042) +++ head/lib/libc/aarch64/sys/brk.S Thu Jul 2 14:54:21 2015 (r285043) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" + .globl _C_LABEL(_end) + .data .align 3 .globl _C_LABEL(minbrk) @@ -47,15 +49,8 @@ ENTRY(_brk) WEAK_REFERENCE(_brk, brk) /* Load the address of minbrk */ -#ifdef __PIC__ - adrp x2, :got:minbrk - ldr x3, [x2, #:got_lo12:minbrk] -#else - ldr x3, .Lminbrk -#endif - - /* Get the minimum allowable brk address */ - ldr x2, [x3] + adrp x3, minbrk + ldr x2, [x3, :lo12:minbrk] /* Validate the address */ cmp x0, x2 @@ -70,24 +65,12 @@ ENTRY(_brk) _SYSCALL(break) b.cs cerror -#ifdef __PIC__ - adrp x2, :got:curbrk - ldr x3, [x2, #:got_lo12:curbrk] -#else - ldr x3, .Lcurbrk -#endif - /* Store the new curbrk value */ - str x4, [x3] + adrp x2, curbrk + str x4, [x2, :lo12:curbrk] /* Return success */ mov x0, #0 ret -#ifndef __PIC__ -.Lcurbrk: - .quad _C_LABEL(curbrk) -.Lminbrk: - .quad _C_LABEL(minbrk) -#endif END(_brk) Modified: head/lib/libc/aarch64/sys/sbrk.S ============================================================================== --- head/lib/libc/aarch64/sys/sbrk.S Thu Jul 2 14:44:30 2015 (r285042) +++ head/lib/libc/aarch64/sys/sbrk.S Thu Jul 2 14:54:21 2015 (r285043) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" + .globl _C_LABEL(_end) + .data .align 3 .global _C_LABEL(curbrk) @@ -47,15 +49,10 @@ ENTRY(_sbrk) WEAK_REFERENCE(_sbrk, sbrk) /* Load the address of curbrk */ -#ifdef __PIC__ - adrp x2, :got:curbrk - ldr x3, [x2, #:got_lo12:curbrk] -#else - ldr x3, .Lcurbrk -#endif + adrp x3, curbrk /* Get the current brk address */ - ldr x2, [x3] + ldr x2, [x3, :lo12:curbrk] /* Calculate the new value */ add x0, x2, x0 @@ -66,14 +63,10 @@ ENTRY(_sbrk) b.cs cerror /* Load the old value to return */ - ldr x0, [x3] + ldr x0, [x3, :lo12:curbrk] /* Store the new curbrk value */ - str x4, [x3] + str x4, [x3, :lo12:curbrk] ret -#ifndef __PIC__ -.Lcurbrk: - .quad _C_LABEL(curbrk) -#endif END(_sbrk) From owner-svn-src-head@freebsd.org Thu Jul 2 15:03:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4950C992746; Thu, 2 Jul 2015 15:03:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A496260E; Thu, 2 Jul 2015 15:03:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62F308r098211; Thu, 2 Jul 2015 15:03:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62F309V098209; Thu, 2 Jul 2015 15:03:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507021503.t62F309V098209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 2 Jul 2015 15:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285044 - head/lib/csu/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 15:03:00 -0000 Author: andrew Date: Thu Jul 2 15:02:59 2015 New Revision: 285044 URL: https://svnweb.freebsd.org/changeset/base/285044 Log: Force the dynamic linker to resolve _end early so we pick up the correct copy. Sponsored by: ABT Systems Ltd Modified: head/lib/csu/aarch64/crt1.c Modified: head/lib/csu/aarch64/crt1.c ============================================================================== --- head/lib/csu/aarch64/crt1.c Thu Jul 2 14:54:21 2015 (r285043) +++ head/lib/csu/aarch64/crt1.c Thu Jul 2 15:02:59 2015 (r285044) @@ -51,6 +51,8 @@ extern int eprol; extern int etext; #endif +extern long * _end; + void __start(int, char **, char **, void (*)(void)); /* The entry function. */ @@ -79,8 +81,17 @@ __start(int argc, char *argv[], char *en if (&_DYNAMIC != NULL) atexit(cleanup); - else + else { + /* + * Hack to resolve _end so we read the correct symbol. + * Without this it will resolve to the copy in the library + * that firsts requests it. We should fix the toolchain, + * however this is is needed until this can take place. + */ + *(volatile long *)&_end; + _init_tls(); + } #ifdef GCRT atexit(_mcleanup); From owner-svn-src-head@freebsd.org Thu Jul 2 15:17:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DF7A992914; Thu, 2 Jul 2015 15:17:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6204D2B0D; Thu, 2 Jul 2015 15:17:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62FHV0Z003858; Thu, 2 Jul 2015 15:17:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62FHVMv003857; Thu, 2 Jul 2015 15:17:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507021517.t62FHVMv003857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 2 Jul 2015 15:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285045 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 15:17:31 -0000 Author: andrew Date: Thu Jul 2 15:17:30 2015 New Revision: 285045 URL: https://svnweb.freebsd.org/changeset/base/285045 Log: Use pmap_load to load table entries. This simplifies finding places where we access the tables. Obtained from: ABT Systems Ltd Sponsored by: The fReeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Jul 2 15:02:59 2015 (r285044) +++ head/sys/arm64/arm64/pmap.c Thu Jul 2 15:17:30 2015 (r285045) @@ -807,7 +807,7 @@ pmap_extract_and_hold(pmap_t pmap, vm_of PMAP_LOCK(pmap); retry: l3p = pmap_l3(pmap, va); - if (l3p != NULL && (l3 = *l3p) != 0) { + if (l3p != NULL && (l3 = pmap_load(l3p)) != 0) { if (((l3 & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) || ((prot & VM_PROT_WRITE) == 0)) { if (vm_page_pa_tryrelock(pmap, l3 & ~ATTR_MASK, &pa)) @@ -1186,7 +1186,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t l1index = ptepindex >> (L1_SHIFT - L2_SHIFT); l1 = &pmap->pm_l1[l1index]; - if (*l1 == 0) { + if (pmap_load(l1) == 0) { /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUPDE + l1index, lockp) == NULL) { @@ -1233,8 +1233,8 @@ retry: * If the page table page is mapped, we just increment the * hold count, and activate it. */ - if (l2 != NULL && *l2 != 0) { - m = PHYS_TO_VM_PAGE(*l2 & ~ATTR_MASK); + if (l2 != NULL && pmap_load(l2) != 0) { + m = PHYS_TO_VM_PAGE(pmap_load(l2) & ~ATTR_MASK); m->wire_count++; } else { /* @@ -1318,7 +1318,7 @@ pmap_growkernel(vm_offset_t addr) addr = kernel_map->max_offset; while (kernel_vm_end < addr) { l1 = pmap_l1(kernel_pmap, kernel_vm_end); - if (*l1 == 0) { + if (pmap_load(l1) == 0) { /* We need a new PDP entry */ nkpg = vm_page_alloc(NULL, kernel_vm_end >> L1_SHIFT, VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | @@ -1333,7 +1333,7 @@ pmap_growkernel(vm_offset_t addr) continue; /* try again */ } l2 = pmap_l1_to_l2(l1, kernel_vm_end); - if ((*l2 & ATTR_AF) != 0) { + if ((pmap_load(l2) & ATTR_AF) != 0) { kernel_vm_end = (kernel_vm_end + L2_SIZE) & ~L2_OFFSET; if (kernel_vm_end - 1 >= kernel_map->max_offset) { kernel_vm_end = kernel_map->max_offset; @@ -1682,7 +1682,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva break; l1 = pmap_l1(pmap, sva); - if (*l1 == 0) { + if (pmap_load(l1) == 0) { va_next = (sva + L1_SIZE) & ~L1_OFFSET; if (va_next < sva) va_next = eva; @@ -1721,7 +1721,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva sva += L3_SIZE) { if (l3 == NULL) panic("l3 == NULL"); - if (*l3 == 0) { + if (pmap_load(l3) == 0) { if (va != va_next) { pmap_invalidate_range(pmap, va, sva); va = va_next; @@ -1833,7 +1833,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv for (; sva < eva; sva = va_next) { l1 = pmap_l1(pmap, sva); - if (*l1 == 0) { + if (pmap_load(l1) == 0) { va_next = (sva + L1_SIZE) & ~L1_OFFSET; if (va_next < sva) va_next = eva; @@ -2177,8 +2177,9 @@ 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 (l2 != NULL && *l2 != 0) { - mpte = PHYS_TO_VM_PAGE(*l2 & ~ATTR_MASK); + if (l2 != NULL && pmap_load(l2) != 0) { + mpte = + PHYS_TO_VM_PAGE(pmap_load(l2) & ~ATTR_MASK); mpte->wire_count++; } else { /* @@ -2277,7 +2278,7 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { l1 = pmap_l1(pmap, sva); - if (*l1 == 0) { + if (pmap_load(l1) == 0) { va_next = (sva + L1_SIZE) & ~L1_OFFSET; if (va_next < sva) va_next = eva; @@ -2289,16 +2290,16 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva va_next = eva; l2 = pmap_l1_to_l2(l1, sva); - if (*l2 == 0) + if (pmap_load(l2) == 0) continue; if (va_next > eva) va_next = eva; for (l3 = pmap_l2_to_l3(l2, sva); sva != va_next; l3++, sva += L3_SIZE) { - if (*l3 == 0) + if (pmap_load(l3) == 0) continue; - if ((*l3 & ATTR_SW_WIRED) == 0) + if ((pmap_load(l3) & ATTR_SW_WIRED) == 0) panic("pmap_unwire: l3 %#jx is missing " "ATTR_SW_WIRED", (uintmax_t)*l3); @@ -2496,7 +2497,7 @@ restart: } } l3 = pmap_l3(pmap, pv->pv_va); - if (l3 != NULL && (*l3 & ATTR_SW_WIRED) != 0) + if (l3 != NULL && (pmap_load(l3) & ATTR_SW_WIRED) != 0) count++; PMAP_UNLOCK(pmap); } @@ -2714,7 +2715,7 @@ pmap_is_prefaultable(pmap_t pmap, vm_off rv = FALSE; PMAP_LOCK(pmap); l3 = pmap_l3(pmap, addr); - if (l3 != NULL && *l3 != 0) { + if (l3 != NULL && pmap_load(l3) != 0) { rv = TRUE; } PMAP_UNLOCK(pmap); @@ -2858,7 +2859,7 @@ retry: KASSERT((*l2 & ATTR_DESCR_MASK) == L2_TABLE, ("pmap_ts_referenced: found an invalid l2 table")); l3 = pmap_l2_to_l3(l2, pv->pv_va); - if ((*l3 & ATTR_AF) != 0) { + if ((pmap_load(l3) & ATTR_AF) != 0) { if (safe_to_clear_referenced(pmap, *l3)) { /* * TODO: We don't handle the access flag @@ -2866,7 +2867,7 @@ retry: * the exception handler. */ panic("TODO: safe_to_clear_referenced\n"); - } else if ((*l3 & ATTR_SW_WIRED) == 0) { + } else if ((pmap_load(l3) & ATTR_SW_WIRED) == 0) { /* * Wired pages cannot be paged out so * doing accessed bit emulation for From owner-svn-src-head@freebsd.org Thu Jul 2 15:22:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55C39992AE8; Thu, 2 Jul 2015 15:22:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46FB62F76; Thu, 2 Jul 2015 15:22:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62FMEIT008050; Thu, 2 Jul 2015 15:22:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62FMEQY008049; Thu, 2 Jul 2015 15:22:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507021522.t62FMEQY008049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 2 Jul 2015 15:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285046 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 15:22:14 -0000 Author: kib Date: Thu Jul 2 15:22:13 2015 New Revision: 285046 URL: https://svnweb.freebsd.org/changeset/base/285046 Log: Account for the main process stack being one page below the highest user address when ABI uses shared page. Note that the change is no-op for correctness, since shared page does not fault. The mapping for the shared page is installed at the address space creation, the page is unmanaged and its pte/pv entry cannot be reclaimed. Submitted by: Oliver Pinter Review: https://reviews.freebsd.org/D2954 MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu Jul 2 15:17:30 2015 (r285045) +++ head/sys/vm/vm_map.c Thu Jul 2 15:22:13 2015 (r285046) @@ -3640,7 +3640,8 @@ Retry: return (KERN_NO_SPACE); } - is_procstack = (addr >= (vm_offset_t)vm->vm_maxsaddr) ? 1 : 0; + is_procstack = (addr >= (vm_offset_t)vm->vm_maxsaddr && + addr < (vm_offset_t)p->p_sysent->sv_usrstack) ? 1 : 0; /* * If this is the main process stack, see if we're over the stack From owner-svn-src-head@freebsd.org Thu Jul 2 15:26:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F782992B7C; Thu, 2 Jul 2015 15:26:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70A341195; Thu, 2 Jul 2015 15:26:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62FQfgT008630; Thu, 2 Jul 2015 15:26:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62FQfuT008629; Thu, 2 Jul 2015 15:26:41 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507021526.t62FQfuT008629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 2 Jul 2015 15:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285047 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 15:26:41 -0000 Author: andrew Date: Thu Jul 2 15:26:40 2015 New Revision: 285047 URL: https://svnweb.freebsd.org/changeset/base/285047 Log: Remove an old comment, the cache is enabled. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Jul 2 15:22:13 2015 (r285046) +++ head/sys/arm64/arm64/pmap.c Thu Jul 2 15:26:40 2015 (r285047) @@ -429,10 +429,6 @@ pmap_bootstrap_dmap(vm_offset_t l1pt) pa += L1_SIZE, va += L1_SIZE, l1_slot++) { KASSERT(l1_slot < Ln_ENTRIES, ("Invalid L1 index")); - /* - * TODO: Turn the cache on here when we have cache - * flushing code. - */ pmap_load_store(&l1[l1_slot], (pa & ~L1_OFFSET) | ATTR_AF | L1_BLOCK | ATTR_IDX(CACHED_MEMORY)); From owner-svn-src-head@freebsd.org Thu Jul 2 16:13:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3F0F9934D5; Thu, 2 Jul 2015 16:13:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D50D51030; Thu, 2 Jul 2015 16:13:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62GDTlq047046; Thu, 2 Jul 2015 16:13:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62GDT09047045; Thu, 2 Jul 2015 16:13:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507021613.t62GDT09047045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 2 Jul 2015 16:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285048 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 16:13:30 -0000 Author: andrew Date: Thu Jul 2 16:13:29 2015 New Revision: 285048 URL: https://svnweb.freebsd.org/changeset/base/285048 Log: Remove an unneeded define and old comment referencing amd64. Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Jul 2 15:26:40 2015 (r285047) +++ head/sys/arm64/arm64/pmap.c Thu Jul 2 16:13:29 2015 (r285048) @@ -83,8 +83,6 @@ * SUCH DAMAGE. */ -#define AMD64_NPT_AWARE - #include __FBSDID("$FreeBSD$"); @@ -3040,14 +3038,6 @@ pmap_map_io_transient(vm_page_t page[], if (!needs_mapping) return (FALSE); - /* - * NB: The sequence of updating a page table followed by accesses - * to the corresponding pages used in the !DMAP case is subject to - * the situation described in the "AMD64 Architecture Programmer's - * Manual Volume 2: System Programming" rev. 3.23, "7.3.1 Special - * Coherency Considerations". Therefore, issuing the INVLPG right - * after modifying the PTE bits is crucial. - */ if (!can_fault) sched_pin(); for (i = 0; i < count; i++) { From owner-svn-src-head@freebsd.org Thu Jul 2 17:31:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A814B993FB5; Thu, 2 Jul 2015 17:31:01 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C5312920; Thu, 2 Jul 2015 17:31:01 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62HV1WT085199; Thu, 2 Jul 2015 17:31:01 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62HV074085188; Thu, 2 Jul 2015 17:31:00 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201507021731.t62HV074085188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Thu, 2 Jul 2015 17:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285050 - in head: lib/libutil usr.sbin/pwd_mkdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 17:31:01 -0000 Author: garga (ports committer) Date: Thu Jul 2 17:30:59 2015 New Revision: 285050 URL: https://svnweb.freebsd.org/changeset/base/285050 Log: When passwd or group information is changed (by pw, vipw, chpass, ...) temporary file is created and then a rename() call move it to official file. This operation didn't have any check to make sure data was written to disk and if a power cycle happens system could end up with a 0 length passwd or group database. There is a pfSense bug with more infor about it: https://redmine.pfsense.org/issues/4523 The following changes were made to protect passwd and group operations: * lib/libutil/gr_util.c: - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file - After rename(), fsync() call on directory for faster result * lib/libutil/pw_util.c - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file * usr.sbin/pwd_mkdb/pwd_mkdb.c - Added O_SYNC flag on dbopen() calls - After rename(), fsync() call on directory for faster result * lib/libutil/pw_util.3 - pw_lock() returns a file descriptor to master password file on success Differential Revision: https://reviews.freebsd.org/D2978 Approved by: bapt Sponsored by: Netgate Modified: head/lib/libutil/gr_util.c head/lib/libutil/pw_util.3 head/lib/libutil/pw_util.c head/usr.sbin/pwd_mkdb/pwd_mkdb.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Thu Jul 2 16:17:05 2015 (r285049) +++ head/lib/libutil/gr_util.c Thu Jul 2 17:30:59 2015 (r285050) @@ -141,7 +141,7 @@ gr_tmp(int mfd) errno = ENAMETOOLONG; return (-1); } - if ((tfd = mkstemp(tempname)) == -1) + if ((tfd = mkostemp(tempname, O_SYNC)) == -1) return (-1); if (mfd != -1) { while ((nr = read(mfd, buf, sizeof(buf))) > 0) @@ -318,10 +318,28 @@ gr_copy(int ffd, int tfd, const struct g int gr_mkdb(void) { + int fd; + if (chmod(tempname, 0644) != 0) return (-1); - return (rename(tempname, group_file)); + if (rename(tempname, group_file) != 0) + return (-1); + + /* + * Make sure new group file is safe on disk. To improve performance we + * will call fsync() to the directory where file lies + */ + if ((fd = open(group_dir, O_RDONLY|O_DIRECTORY)) == -1) + return (-1); + + if (fsync(fd) != 0) { + close(fd); + return (-1); + } + + close(fd); + return(0); } /* Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Thu Jul 2 16:17:05 2015 (r285049) +++ head/lib/libutil/pw_util.3 Thu Jul 2 17:30:59 2015 (r285050) @@ -233,7 +233,8 @@ function returns 0 in case of success an The .Fn pw_lock function locks the master password file. -It returns 0 in case of success and -1 in case of failure. +It returns a file descriptor to master password file in case of success +and -1 in case of failure. .Pp The .Fn pw_scan Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Thu Jul 2 16:17:05 2015 (r285049) +++ head/lib/libutil/pw_util.c Thu Jul 2 17:30:59 2015 (r285050) @@ -226,7 +226,7 @@ pw_tmp(int mfd) errno = ENAMETOOLONG; return (-1); } - if ((tfd = mkstemp(tempname)) == -1) + if ((tfd = mkostemp(tempname, O_SYNC)) == -1) return (-1); if (mfd != -1) { while ((nr = read(mfd, buf, sizeof(buf))) > 0) Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jul 2 16:17:05 2015 (r285049) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jul 2 17:30:59 2015 (r285050) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -227,14 +228,14 @@ main(int argc, char *argv[]) clean = FILE_INSECURE; cp(buf2, buf, PERM_INSECURE); dp = dbopen(buf, - O_RDWR|O_EXCL, PERM_INSECURE, DB_HASH, &openinfo); + O_RDWR|O_EXCL|O_SYNC, PERM_INSECURE, DB_HASH, &openinfo); if (dp == NULL) error(buf); clean = FILE_SECURE; cp(sbuf2, sbuf, PERM_SECURE); sdp = dbopen(sbuf, - O_RDWR|O_EXCL, PERM_SECURE, DB_HASH, &openinfo); + O_RDWR|O_EXCL|O_SYNC, PERM_SECURE, DB_HASH, &openinfo); if (sdp == NULL) error(sbuf); @@ -291,13 +292,13 @@ main(int argc, char *argv[]) method = 0; } else { dp = dbopen(buf, - O_RDWR|O_CREAT|O_EXCL, PERM_INSECURE, DB_HASH, &openinfo); + O_RDWR|O_CREAT|O_EXCL|O_SYNC, PERM_INSECURE, DB_HASH, &openinfo); if (dp == NULL) error(buf); clean = FILE_INSECURE; sdp = dbopen(sbuf, - O_RDWR|O_CREAT|O_EXCL, PERM_SECURE, DB_HASH, &openinfo); + O_RDWR|O_CREAT|O_EXCL|O_SYNC, PERM_SECURE, DB_HASH, &openinfo); if (sdp == NULL) error(sbuf); clean = FILE_SECURE; @@ -721,13 +722,27 @@ void mv(char *from, char *to) { char buf[MAXPATHLEN]; + char *to_dir; + int to_dir_fd = -1; - if (rename(from, to)) { + /* + * Make sure file is safe on disk. To improve performance we will call + * fsync() to the directory where file lies + */ + if (rename(from, to) != 0 || + (to_dir = dirname(to)) == NULL || + (to_dir_fd = open(to_dir, O_RDONLY|O_DIRECTORY)) == -1 || + fsync(to_dir_fd) != 0) { int sverrno = errno; (void)snprintf(buf, sizeof(buf), "%s to %s", from, to); errno = sverrno; + if (to_dir_fd != -1) + close(to_dir_fd); error(buf); } + + if (to_dir_fd != -1) + close(to_dir_fd); } void From owner-svn-src-head@freebsd.org Thu Jul 2 18:00:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D852993448; Thu, 2 Jul 2015 18:00:32 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-yk0-x231.google.com (mail-yk0-x231.google.com [IPv6:2607:f8b0:4002:c07::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 5EAD019A5; Thu, 2 Jul 2015 18:00:32 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: by ykfy125 with SMTP id y125so75479755ykf.1; Thu, 02 Jul 2015 11:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=dw6mr1hAXK9peN5PI/KJ4vEZXdz3sa2385Z1z6q3MME=; b=VLlkCjP7cnOxO3dRjs9cY3jXz7zc0/28IuOOBYkEi/W6fFqTd72dR8T34aRrJHLCQq bMk3qXPfhbCZC4GnBEx/qWPAyeDdxL84AMxGN6TPOZuJXmbXxnnvE/LJpDxqNth3EFWO ZwXnjXitseQcncn596pk/3jydSZ+aR8n7Fmj21gZZSBc9at9EL53hG4FtGTlNeTbp8rZ hVt8V+w0p1G9X5YFsg9uwYVfKxp6pKl6oMaNJPh3oxEL41flvS52JXkgBEjZvMKuqquS /Ay5yKmKDQs1cxHYatBttnkhUOoF1u/3jxVVPTMhX8SdEODup9RDCWexnwcB7i3Oq13V hoDQ== MIME-Version: 1.0 X-Received: by 10.129.82.130 with SMTP id g124mr40856286ywb.9.1435860031435; Thu, 02 Jul 2015 11:00:31 -0700 (PDT) Sender: ermal.luci@gmail.com Received: by 10.129.83.139 with HTTP; Thu, 2 Jul 2015 11:00:31 -0700 (PDT) In-Reply-To: <201507021731.t62HV074085188@repo.freebsd.org> References: <201507021731.t62HV074085188@repo.freebsd.org> Date: Thu, 2 Jul 2015 20:00:31 +0200 X-Google-Sender-Auth: STK1NdlFkIol8c6wdOgC8p00cC8 Message-ID: Subject: Re: svn commit: r285050 - in head: lib/libutil usr.sbin/pwd_mkdb From: =?UTF-8?Q?Ermal_Lu=C3=A7i?= To: Renato Botelho Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 18:00:32 -0000 On Thu, Jul 2, 2015 at 7:31 PM, Renato Botelho wrote: > Author: garga (ports committer) > Date: Thu Jul 2 17:30:59 2015 > New Revision: 285050 > URL: https://svnweb.freebsd.org/changeset/base/285050 > > Log: > When passwd or group information is changed (by pw, vipw, chpass, ...) > temporary file is created and then a rename() call move it to official > file. > This operation didn't have any check to make sure data was written to > disk > and if a power cycle happens system could end up with a 0 length passwd > or group database. > > There is a pfSense bug with more infor about it: > > https://redmine.pfsense.org/issues/4523 > > The following changes were made to protect passwd and group operations: > > * lib/libutil/gr_util.c: > - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file > - After rename(), fsync() call on directory for faster result > > * lib/libutil/pw_util.c > - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file > > * usr.sbin/pwd_mkdb/pwd_mkdb.c > - Added O_SYNC flag on dbopen() calls > - After rename(), fsync() call on directory for faster result > > * lib/libutil/pw_util.3 > - pw_lock() returns a file descriptor to master password file on success > > Differential Revision: https://reviews.freebsd.org/D2978 > Approved by: bapt > Sponsored by: Netgate > > Modified: > head/lib/libutil/gr_util.c > head/lib/libutil/pw_util.3 > head/lib/libutil/pw_util.c > head/usr.sbin/pwd_mkdb/pwd_mkdb.c > > Modified: head/lib/libutil/gr_util.c > > ============================================================================== > --- head/lib/libutil/gr_util.c Thu Jul 2 16:17:05 2015 (r285049) > +++ head/lib/libutil/gr_util.c Thu Jul 2 17:30:59 2015 (r285050) > @@ -141,7 +141,7 @@ gr_tmp(int mfd) > errno = ENAMETOOLONG; > return (-1); > } > - if ((tfd = mkstemp(tempname)) == -1) > + if ((tfd = mkostemp(tempname, O_SYNC)) == -1) > return (-1); > if (mfd != -1) { > while ((nr = read(mfd, buf, sizeof(buf))) > 0) > @@ -318,10 +318,28 @@ gr_copy(int ffd, int tfd, const struct g > int > gr_mkdb(void) > { > + int fd; > + > if (chmod(tempname, 0644) != 0) > return (-1); > > - return (rename(tempname, group_file)); > + if (rename(tempname, group_file) != 0) > + return (-1); > + > + /* > + * Make sure new group file is safe on disk. To improve > performance we > + * will call fsync() to the directory where file lies > + */ > + if ((fd = open(group_dir, O_RDONLY|O_DIRECTORY)) == -1) > + return (-1); > + > This really is not a real failure! Not sure how you would report this but it really is not a failure since the rename has completed and you are giving false information back. > + if (fsync(fd) != 0) { > + close(fd); > + return (-1); > + } > + > + close(fd); > + return(0); > } > > /* > > Modified: head/lib/libutil/pw_util.3 > > ============================================================================== > --- head/lib/libutil/pw_util.3 Thu Jul 2 16:17:05 2015 (r285049) > +++ head/lib/libutil/pw_util.3 Thu Jul 2 17:30:59 2015 (r285050) > @@ -233,7 +233,8 @@ function returns 0 in case of success an > The > .Fn pw_lock > function locks the master password file. > -It returns 0 in case of success and -1 in case of failure. > +It returns a file descriptor to master password file in case of success > +and -1 in case of failure. > .Pp > The > .Fn pw_scan > > Modified: head/lib/libutil/pw_util.c > > ============================================================================== > --- head/lib/libutil/pw_util.c Thu Jul 2 16:17:05 2015 (r285049) > +++ head/lib/libutil/pw_util.c Thu Jul 2 17:30:59 2015 (r285050) > @@ -226,7 +226,7 @@ pw_tmp(int mfd) > errno = ENAMETOOLONG; > return (-1); > } > - if ((tfd = mkstemp(tempname)) == -1) > + if ((tfd = mkostemp(tempname, O_SYNC)) == -1) > return (-1); > if (mfd != -1) { > while ((nr = read(mfd, buf, sizeof(buf))) > 0) > > Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c > > ============================================================================== > --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jul 2 16:17:05 2015 > (r285049) > +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jul 2 17:30:59 2015 > (r285050) > @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -227,14 +228,14 @@ main(int argc, char *argv[]) > clean = FILE_INSECURE; > cp(buf2, buf, PERM_INSECURE); > dp = dbopen(buf, > - O_RDWR|O_EXCL, PERM_INSECURE, DB_HASH, &openinfo); > + O_RDWR|O_EXCL|O_SYNC, PERM_INSECURE, DB_HASH, > &openinfo); > if (dp == NULL) > error(buf); > > clean = FILE_SECURE; > cp(sbuf2, sbuf, PERM_SECURE); > sdp = dbopen(sbuf, > - O_RDWR|O_EXCL, PERM_SECURE, DB_HASH, &openinfo); > + O_RDWR|O_EXCL|O_SYNC, PERM_SECURE, DB_HASH, &openinfo); > if (sdp == NULL) > error(sbuf); > > @@ -291,13 +292,13 @@ main(int argc, char *argv[]) > method = 0; > } else { > dp = dbopen(buf, > - O_RDWR|O_CREAT|O_EXCL, PERM_INSECURE, DB_HASH, > &openinfo); > + O_RDWR|O_CREAT|O_EXCL|O_SYNC, PERM_INSECURE, DB_HASH, > &openinfo); > if (dp == NULL) > error(buf); > clean = FILE_INSECURE; > > sdp = dbopen(sbuf, > - O_RDWR|O_CREAT|O_EXCL, PERM_SECURE, DB_HASH, > &openinfo); > + O_RDWR|O_CREAT|O_EXCL|O_SYNC, PERM_SECURE, DB_HASH, > &openinfo); > if (sdp == NULL) > error(sbuf); > clean = FILE_SECURE; > @@ -721,13 +722,27 @@ void > mv(char *from, char *to) > { > char buf[MAXPATHLEN]; > + char *to_dir; > + int to_dir_fd = -1; > > - if (rename(from, to)) { > + /* > + * Make sure file is safe on disk. To improve performance we will > call > + * fsync() to the directory where file lies > + */ > + if (rename(from, to) != 0 || > + (to_dir = dirname(to)) == NULL || > + (to_dir_fd = open(to_dir, O_RDONLY|O_DIRECTORY)) == -1 || > + fsync(to_dir_fd) != 0) { > int sverrno = errno; > (void)snprintf(buf, sizeof(buf), "%s to %s", from, to); > errno = sverrno; > + if (to_dir_fd != -1) > + close(to_dir_fd); > error(buf); > } > + > + if (to_dir_fd != -1) > + close(to_dir_fd); > } > > void > > -- > Ermal > From owner-svn-src-head@freebsd.org Thu Jul 2 18:10:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 764129936F8; Thu, 2 Jul 2015 18:10:42 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4B91FE9; Thu, 2 Jul 2015 18:10:42 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62IAgwO003273; Thu, 2 Jul 2015 18:10:42 GMT (envelope-from eri@FreeBSD.org) Received: (from eri@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62IAgCc003272; Thu, 2 Jul 2015 18:10:42 GMT (envelope-from eri@FreeBSD.org) Message-Id: <201507021810.t62IAgCc003272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eri set sender to eri@FreeBSD.org using -f From: Ermal Luçi Date: Thu, 2 Jul 2015 18:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285051 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 18:10:42 -0000 Author: eri Date: Thu Jul 2 18:10:41 2015 New Revision: 285051 URL: https://svnweb.freebsd.org/changeset/base/285051 Log: Avoid doing multiple route lookups for the same destination IP during forwarding ip_forward() does a route lookup for testing this packet can be sent to a known destination, it also can do another route lookup if it detects that an ICMP redirect is needed, it forgets all of this and handovers to ip_output() to do the same lookup yet again. This optimisation just does one route lookup during the forwarding path and handovers that to be considered by ip_output(). Differential Revision: https://reviews.freebsd.org/D2964 Approved by: ae, gnn(mentor) MFC after: 1 week Modified: head/sys/netinet/ip_input.c Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Thu Jul 2 17:30:59 2015 (r285050) +++ head/sys/netinet/ip_input.c Thu Jul 2 18:10:41 2015 (r285051) @@ -897,6 +897,7 @@ ip_forward(struct mbuf *m, int srcrt) struct ip *ip = mtod(m, struct ip *); struct in_ifaddr *ia; struct mbuf *mcopy; + struct sockaddr_in *sin; struct in_addr dest; struct route ro; int error, type = 0, code = 0, mtu = 0; @@ -925,7 +926,22 @@ ip_forward(struct mbuf *m, int srcrt) } #endif - ia = ip_rtaddr(ip->ip_dst, M_GETFIB(m)); + bzero(&ro, sizeof(ro)); + sin = (struct sockaddr_in *)&ro.ro_dst; + sin->sin_family = AF_INET; + sin->sin_len = sizeof(*sin); + sin->sin_addr = ip->ip_dst; +#ifdef RADIX_MPATH + rtalloc_mpath_fib(&ro, + ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr), + M_GETFIB(m)); +#else + in_rtalloc_ign(&ro, 0, M_GETFIB(m)); +#endif + if (ro.ro_rt != NULL) { + ia = ifatoia(ro.ro_rt->rt_ifa); + ifa_ref(&ia->ia_ifa); + } #ifndef IPSEC /* * 'ia' may be NULL if there is no route for this destination. @@ -934,6 +950,7 @@ ip_forward(struct mbuf *m, int srcrt) */ if (!srcrt && ia == NULL) { icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); + RO_RTFREE(&ro); return; } #endif @@ -990,16 +1007,8 @@ ip_forward(struct mbuf *m, int srcrt) dest.s_addr = 0; if (!srcrt && V_ipsendredirects && ia != NULL && ia->ia_ifp == m->m_pkthdr.rcvif) { - struct sockaddr_in *sin; struct rtentry *rt; - bzero(&ro, sizeof(ro)); - sin = (struct sockaddr_in *)&ro.ro_dst; - sin->sin_family = AF_INET; - sin->sin_len = sizeof(*sin); - sin->sin_addr = ip->ip_dst; - in_rtalloc_ign(&ro, 0, M_GETFIB(m)); - rt = ro.ro_rt; if (rt && (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0 && @@ -1018,16 +1027,8 @@ ip_forward(struct mbuf *m, int srcrt) code = ICMP_REDIRECT_HOST; } } - if (rt) - RTFREE(rt); } - /* - * Try to cache the route MTU from ip_output so we can consider it for - * the ICMP_UNREACH_NEEDFRAG "Next-Hop MTU" field described in RFC1191. - */ - bzero(&ro, sizeof(ro)); - error = ip_output(m, NULL, &ro, IP_FORWARDING, NULL, NULL); if (error == EMSGSIZE && ro.ro_rt) From owner-svn-src-head@freebsd.org Thu Jul 2 18:20:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A734299391C for ; Thu, 2 Jul 2015 18:20:35 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) by mx1.freebsd.org (Postfix) with SMTP id 79C641D42 for ; Thu, 2 Jul 2015 18:20:34 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 2 Jul 2015 18:18:30 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t62IJO93023845; Thu, 2 Jul 2015 12:19:24 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1435861164.1648.129.camel@freebsd.org> Subject: Re: svn commit: r285050 - in head: lib/libutil usr.sbin/pwd_mkdb From: Ian Lepore To: Ermal =?ISO-8859-1?Q?Lu=E7i?= Cc: Renato Botelho , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 02 Jul 2015 12:19:24 -0600 In-Reply-To: References: <201507021731.t62HV074085188@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 18:20:35 -0000 On Thu, 2015-07-02 at 20:00 +0200, Ermal Luçi wrote: > On Thu, Jul 2, 2015 at 7:31 PM, Renato Botelho wrote: > > > Author: garga (ports committer) > > Date: Thu Jul 2 17:30:59 2015 > > New Revision: 285050 > > URL: https://svnweb.freebsd.org/changeset/base/285050 > > > > Log: > > When passwd or group information is changed (by pw, vipw, chpass, ...) > > temporary file is created and then a rename() call move it to official > > file. > > This operation didn't have any check to make sure data was written to > > disk > > and if a power cycle happens system could end up with a 0 length passwd > > or group database. > > > > There is a pfSense bug with more infor about it: > > > > https://redmine.pfsense.org/issues/4523 > > > > The following changes were made to protect passwd and group operations: > > > > * lib/libutil/gr_util.c: > > - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file > > - After rename(), fsync() call on directory for faster result > > > > * lib/libutil/pw_util.c > > - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file > > > > * usr.sbin/pwd_mkdb/pwd_mkdb.c > > - Added O_SYNC flag on dbopen() calls > > - After rename(), fsync() call on directory for faster result > > > > * lib/libutil/pw_util.3 > > - pw_lock() returns a file descriptor to master password file on success > > > > Differential Revision: https://reviews.freebsd.org/D2978 > > Approved by: bapt > > Sponsored by: Netgate > > > > Modified: > > head/lib/libutil/gr_util.c > > head/lib/libutil/pw_util.3 > > head/lib/libutil/pw_util.c > > head/usr.sbin/pwd_mkdb/pwd_mkdb.c > > > > Modified: head/lib/libutil/gr_util.c > > > > ============================================================================== > > --- head/lib/libutil/gr_util.c Thu Jul 2 16:17:05 2015 (r285049) > > +++ head/lib/libutil/gr_util.c Thu Jul 2 17:30:59 2015 (r285050) > > @@ -141,7 +141,7 @@ gr_tmp(int mfd) > > errno = ENAMETOOLONG; > > return (-1); > > } > > - if ((tfd = mkstemp(tempname)) == -1) > > + if ((tfd = mkostemp(tempname, O_SYNC)) == -1) > > return (-1); > > if (mfd != -1) { > > while ((nr = read(mfd, buf, sizeof(buf))) > 0) > > @@ -318,10 +318,28 @@ gr_copy(int ffd, int tfd, const struct g > > int > > gr_mkdb(void) > > { > > + int fd; > > + > > if (chmod(tempname, 0644) != 0) > > return (-1); > > > > - return (rename(tempname, group_file)); > > + if (rename(tempname, group_file) != 0) > > + return (-1); > > + > > + /* > > + * Make sure new group file is safe on disk. To improve > > performance we > > + * will call fsync() to the directory where file lies > > + */ > > + if ((fd = open(group_dir, O_RDONLY|O_DIRECTORY)) == -1) > > + return (-1); > > + > > > > This really is not a real failure! > Not sure how you would report this but it really is not a failure since the > rename has completed and you are giving false information back. > I disagree. If you can't open the directory containing the file you just renamed into that directory, then the assertion that the rename completed strikes me as speculative at best. IMO, it's not truly completed until the fsync() returns success. -- Ian > > > > + if (fsync(fd) != 0) { > > + close(fd); > > + return (-1); > > + } > > + > > + close(fd); > > + return(0); > > } > > > > /* > > > > Modified: head/lib/libutil/pw_util.3 > > > > ============================================================================== > > --- head/lib/libutil/pw_util.3 Thu Jul 2 16:17:05 2015 (r285049) > > +++ head/lib/libutil/pw_util.3 Thu Jul 2 17:30:59 2015 (r285050) > > @@ -233,7 +233,8 @@ function returns 0 in case of success an > > The > > .Fn pw_lock > > function locks the master password file. > > -It returns 0 in case of success and -1 in case of failure. > > +It returns a file descriptor to master password file in case of success > > +and -1 in case of failure. > > .Pp > > The > > .Fn pw_scan > > > > Modified: head/lib/libutil/pw_util.c > > > > ============================================================================== > > --- head/lib/libutil/pw_util.c Thu Jul 2 16:17:05 2015 (r285049) > > +++ head/lib/libutil/pw_util.c Thu Jul 2 17:30:59 2015 (r285050) > > @@ -226,7 +226,7 @@ pw_tmp(int mfd) > > errno = ENAMETOOLONG; > > return (-1); > > } > > - if ((tfd = mkstemp(tempname)) == -1) > > + if ((tfd = mkostemp(tempname, O_SYNC)) == -1) > > return (-1); > > if (mfd != -1) { > > while ((nr = read(mfd, buf, sizeof(buf))) > 0) > > > > Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c > > > > ============================================================================== > > --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jul 2 16:17:05 2015 > > (r285049) > > +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jul 2 17:30:59 2015 > > (r285050) > > @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -227,14 +228,14 @@ main(int argc, char *argv[]) > > clean = FILE_INSECURE; > > cp(buf2, buf, PERM_INSECURE); > > dp = dbopen(buf, > > - O_RDWR|O_EXCL, PERM_INSECURE, DB_HASH, &openinfo); > > + O_RDWR|O_EXCL|O_SYNC, PERM_INSECURE, DB_HASH, > > &openinfo); > > if (dp == NULL) > > error(buf); > > > > clean = FILE_SECURE; > > cp(sbuf2, sbuf, PERM_SECURE); > > sdp = dbopen(sbuf, > > - O_RDWR|O_EXCL, PERM_SECURE, DB_HASH, &openinfo); > > + O_RDWR|O_EXCL|O_SYNC, PERM_SECURE, DB_HASH, &openinfo); > > if (sdp == NULL) > > error(sbuf); > > > > @@ -291,13 +292,13 @@ main(int argc, char *argv[]) > > method = 0; > > } else { > > dp = dbopen(buf, > > - O_RDWR|O_CREAT|O_EXCL, PERM_INSECURE, DB_HASH, > > &openinfo); > > + O_RDWR|O_CREAT|O_EXCL|O_SYNC, PERM_INSECURE, DB_HASH, > > &openinfo); > > if (dp == NULL) > > error(buf); > > clean = FILE_INSECURE; > > > > sdp = dbopen(sbuf, > > - O_RDWR|O_CREAT|O_EXCL, PERM_SECURE, DB_HASH, > > &openinfo); > > + O_RDWR|O_CREAT|O_EXCL|O_SYNC, PERM_SECURE, DB_HASH, > > &openinfo); > > if (sdp == NULL) > > error(sbuf); > > clean = FILE_SECURE; > > @@ -721,13 +722,27 @@ void > > mv(char *from, char *to) > > { > > char buf[MAXPATHLEN]; > > + char *to_dir; > > + int to_dir_fd = -1; > > > > - if (rename(from, to)) { > > + /* > > + * Make sure file is safe on disk. To improve performance we will > > call > > + * fsync() to the directory where file lies > > + */ > > + if (rename(from, to) != 0 || > > + (to_dir = dirname(to)) == NULL || > > + (to_dir_fd = open(to_dir, O_RDONLY|O_DIRECTORY)) == -1 || > > + fsync(to_dir_fd) != 0) { > > int sverrno = errno; > > (void)snprintf(buf, sizeof(buf), "%s to %s", from, to); > > errno = sverrno; > > + if (to_dir_fd != -1) > > + close(to_dir_fd); > > error(buf); > > } > > + > > + if (to_dir_fd != -1) > > + close(to_dir_fd); > > } > > > > void > > > > -- > > Ermal > > From owner-svn-src-head@freebsd.org Thu Jul 2 18:27:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85B7D993AC2; Thu, 2 Jul 2015 18:27:19 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 772011300; Thu, 2 Jul 2015 18:27:19 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62IRJke012153; Thu, 2 Jul 2015 18:27:19 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62IRJCZ012152; Thu, 2 Jul 2015 18:27:19 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201507021827.t62IRJCZ012152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Thu, 2 Jul 2015 18:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285053 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 18:27:19 -0000 Author: garga (ports committer) Date: Thu Jul 2 18:27:18 2015 New Revision: 285053 URL: https://svnweb.freebsd.org/changeset/base/285053 Log: Improve pw_lock.3 text changed in r285050 Suggested by: wblock Approved by: gnn Modified: head/lib/libutil/pw_util.3 Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Thu Jul 2 18:27:04 2015 (r285052) +++ head/lib/libutil/pw_util.3 Thu Jul 2 18:27:18 2015 (r285053) @@ -233,8 +233,8 @@ function returns 0 in case of success an The .Fn pw_lock function locks the master password file. -It returns a file descriptor to master password file in case of success -and -1 in case of failure. +It returns a file descriptor to the master password file on success +and -1 on failure. .Pp The .Fn pw_scan From owner-svn-src-head@freebsd.org Thu Jul 2 18:30:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F16C993B58; Thu, 2 Jul 2015 18:30:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71272192D; Thu, 2 Jul 2015 18:30:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62IUDuG013145; Thu, 2 Jul 2015 18:30:13 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62IUDcx013144; Thu, 2 Jul 2015 18:30:13 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201507021830.t62IUDcx013144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 2 Jul 2015 18:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285054 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 18:30:13 -0000 Author: mjg Date: Thu Jul 2 18:30:12 2015 New Revision: 285054 URL: https://svnweb.freebsd.org/changeset/base/285054 Log: vm: don't lock proc around accesses to vm_{t,d}addr and RLIMIT_DATA in sys_mmap vm_{t,d}addr are constant and we can use thread's copy of resource limits Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Thu Jul 2 18:27:18 2015 (r285053) +++ head/sys/vm/vm_mmap.c Thu Jul 2 18:30:12 2015 (r285054) @@ -312,14 +312,12 @@ sys_mmap(td, uap) * There should really be a pmap call to determine a reasonable * location. */ - PROC_LOCK(td->td_proc); if (addr == 0 || (addr >= round_page((vm_offset_t)vms->vm_taddr) && addr < round_page((vm_offset_t)vms->vm_daddr + - lim_max_proc(td->td_proc, RLIMIT_DATA)))) + lim_max(td, RLIMIT_DATA)))) addr = round_page((vm_offset_t)vms->vm_daddr + - lim_max_proc(td->td_proc, RLIMIT_DATA)); - PROC_UNLOCK(td->td_proc); + lim_max(td, RLIMIT_DATA)); } if (size == 0) { /* From owner-svn-src-head@freebsd.org Thu Jul 2 18:36:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2CE8993CCE; Thu, 2 Jul 2015 18:36:53 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bn0102.outbound.protection.outlook.com [157.56.110.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52B851E26; Thu, 2 Jul 2015 18:36:51 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from BY1PR0501CA0034.namprd05.prod.outlook.com (10.162.139.44) by BLUPR05MB707.namprd05.prod.outlook.com (10.141.207.19) with Microsoft SMTP Server (TLS) id 15.1.195.15; Thu, 2 Jul 2015 18:36:44 +0000 Received: from BN1AFFO11FD047.protection.gbl (2a01:111:f400:7c10::121) by BY1PR0501CA0034.outlook.office365.com (2a01:111:e400:4821::44) with Microsoft SMTP Server (TLS) id 15.1.207.19 via Frontend Transport; Thu, 2 Jul 2015 18:36:43 +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; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.18 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.18) by BN1AFFO11FD047.mail.protection.outlook.com (10.58.53.62) with Microsoft SMTP Server (TLS) id 15.1.190.9 via Frontend Transport; Thu, 2 Jul 2015 18:36:43 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 2 Jul 2015 11:36:30 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t62IaRD68994; Thu, 2 Jul 2015 11:36:27 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 948C4580AA; Thu, 2 Jul 2015 11:36:27 -0700 (PDT) To: Mark R V Murray CC: , , , , Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... In-Reply-To: <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> Comments: In-reply-to: Mark R V Murray message dated "Thu, 02 Jul 2015 07:59:11 +0100." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Thu, 2 Jul 2015 11:36:27 -0700 Message-ID: <22423.1435862187@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD047; 1:D3S25bxcYxQmSJ9oZmeRtsTnAXBLlswyQ8P9dfQ6VShfbL7qhpbVecf1pqrgAcggj3tqnWxjHNWXa40G5k3f/B1yXCgRyCp2NRVPtANgXWknMzYCS6xW++H/SYpLhJ0UOYEeii9kBGSIZxok9NKNUgPVsCd4RrrBk5jzFnOiiBXXpigSPFs/qsl52qWfXzV5b1guFDuxVkF42vJGpGjFViSE7PXaGvvgzoSCBJbuJukfvojn16jjyXjuDxJYZubnSSjG5rDTu0j7DO3Bv1Jw3g== X-Forefront-Antispam-Report: CIP:66.129.239.18; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(51704005)(24454002)(189002)(199003)(117636001)(105596002)(92566002)(50226001)(106466001)(110136002)(189998001)(2950100001)(5001960100002)(7520500002)(107886002)(76506005)(50986999)(57986006)(76176999)(50466002)(33716001)(48376002)(77156002)(62966003)(77096005)(450100001)(46102003)(47776003)(86362001)(87936001)(6806004)(19580395003)(19580405001)(62816006)(4001430100001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB707; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB707; 2:DrIxwjNTsHgbPzoYuMTQf0Ct6nh22HVv7GkLQEzLqydAWLh09Q1D65eSHtKeSAg2; 3:I6kIPGAbtsdJYaJ9/xVQv9rzoYtoHSR/wHe80wqmBDqrnxEmMTclwfIea8v7+EKn3GPjA96Jlzkmg/TwG7n8hC3Xs40OgGzDfCNcVG9kPCpVfpoVLQo6NY1Tpef7d3hy8pLDZAMl+vIBVKDo6t4SuA/U0s11FQ4xbOC8mAw3K6NAaVx5fpygRF3rl4+4mqz4BSYcKrE5UN4qPHJKcZzlPCFZI5wREUpq3xnoD6bOlPQ=; 20:ORB0pKco5ewKAeQXhD3MD42ja8OK7JWTCUPUfmtakZZBPfe/G8MuDHFbeIfZ/bMy+L5mFx33IVGAlBGHGTe496o4p1AdpGzfVtlwBNdHhyjEPLg7HfCgYBmFz5kSAa2ISgMAtNVuqVR15ynb67mn6X35z1zbWjI0MB1DdzQgW+uC1bZW4KY8JVsX54EjIofe9pSRdr1ecXb7a2/P3Kg1Fh11no5ZVm2/e5jKfcmGJu2aD+jI0x5vV6OETAptWbQ2wplvL2xwBg6rEXPlW20jI6WVSuCZiWjEPk5xBymTgOqp1MBwe53hEYZ7ES+vu4Al3WUSa8ZNtCdRTeEWJK38WizBiQBHPbBlnIWYfEaCUlvZ0EI87J36TflEw5V0Mf4Nm+mShikl5zUMK+3kjx5ejgB3p0p/WIAbC4b0LMMJJhfYSIM7PhMoTkFW9sd89+OzXQ/Dq83wa+G2Qmo8ERc0zWf+gr5/N3+6Sl5qj3IhxVN2f/zI6qQdwYxO23MV1RUH X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR05MB707; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BLUPR05MB707; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB707; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB707; 4:M0RZl0IzcRyhEv0+gTQ7NxDhJzkroee0oNaDrGBVdwl4d9Pn0Vx4FJUC9dgY+qWHApBMj9jkKe2wASLfU0ftNsXAhaEvtThN4ClNicRyQRVxS2TG9f7Y3Krm27gM9VvaKp/xJlvlgzoMOZnPEKAhN/rqofbpfkg9Sovq+BCAvZKt4slN4qnUoD1gQu459ZYOBpILbb5Z4YWET5TZH/MOkKC2yWKGjNaQnp7ZAEk5pyTNJ4nB5tpL/IyvTEeoi4k2BjrCZhw1C0R4LC+tvANoFAfO9O5dAynHsf2sqtGn3rs= X-Forefront-PRVS: 06259BA5A2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB707; 23:8KbnlsKHvvQ8ZHG65BwYUgZ9QIpDAQ98cnd7d/N3UU?= =?us-ascii?Q?Yp1vNbDvepIAqEZmSszXhMfAHwtrwHeH3qrhigmlb3AJQ+7LJafDWGU/LRF9?= =?us-ascii?Q?3+cC3ntnDEf5z4q4Mr8A2/tl9eoFE6dOPyo3HzOtyk6Kw1F37X0s61Sc8Blq?= =?us-ascii?Q?xAEZmit762R30SHbg9gZtgY5Z9QOHeUmMlfl1ndDqSp+PZKb1gFce99DOF7Y?= =?us-ascii?Q?+dKrdpsZpz9HWnUIYKKARyTdFkHvM3tyDKjIrUXt1NjV3VsMyte0yQGLwUOJ?= =?us-ascii?Q?AjGW0Ezw15fqAxs5uicOP8rWvdoo2xFYy9XBxcQL5ObNOjWGRhP3O7GrX4vn?= =?us-ascii?Q?ZDJmD98vwlBQKADDsjG1XrDrtjCF7gZbZ64pijqb/DdFEZGFfiuQgsR1nIjn?= =?us-ascii?Q?HIWZvoJyzbQDaIBqvLJFe/l8o0t3Nq/4qWjZgF/U3/fOH1Nzq3b7xTae5d9j?= =?us-ascii?Q?qIlgLqEHjHUMniK7mrUa6c2HElvOe1Iocny6eRtcq9HDRqM3MN2qEELduJ/M?= =?us-ascii?Q?57oFeQGJ7IHD9t/h3PxaD4462k3Tt08cl0W7qLANxQCKxk5hj1dRhI76JQGH?= =?us-ascii?Q?hBQw6T7b8oogSYNzX5fvtXwAfeCGtPjV/lwPRYcQFpKE99DS9WTCjAlF5fWL?= =?us-ascii?Q?XiQJEwL+Uw9OzMb2hSwKvs/BYouec4Ef3EAmygJK9Kc9FVPzwC2DtLmTWm+0?= =?us-ascii?Q?Bdc5S/VFVXQEWHDGlW4s6Ju9iRdTy6FZN/7sXYZDfuFwq02NIyJEm1qR9uuT?= =?us-ascii?Q?wozvUDtVSQaofQ5NSU5fMxKM2RR7RZbxW0KE8U0hNPr4kxFWM+C+tIqV5y1H?= =?us-ascii?Q?VXp/sjAUPGo3XPcbfO/3jCgGm85LA2iN4ClDkT6rGPtQrUzo+mwMAknHfKom?= =?us-ascii?Q?QERnJxhMOdnf/phzTuTvpcdYyQluWkjnsHNOJEsMPMb4zXueVPnwBvkBWLLR?= =?us-ascii?Q?/gCYOU8s5LyggKdlwZFfx+EsYebcY6DrMdsVEATRPFOCb3SDbwqZS7ds7U+V?= =?us-ascii?Q?5SY48Angs7K9ww37a3g3Te?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB707; 5:G5rSCrw6dfxbU4ifuyDCKM8hx/cZK8pE316v7hnQgX3m2B4kLBgYOumVJ53nJxnJUSYR4X6suTOeXKP90fVUR5VQVu/pqKJVMZBRgZxkQZXcprOlxypZhN3/QYwulBd936/HO+QDfDZl+jvoyr9soQ==; 24:fvfMZmsCyvtsLLOOljGMOfaQdJrjt7DkkKG+vzJk8E4qlxCXu9au8PHg9TGItOvH+Wc1Vq3uTxLqWYt53Z58Uxp3rjwgQfPRBGq9oor1Gs4=; 20:G0nCXwAm+jtKNsGts+3HvVPbrfbHhCJjR+nSPPviehONFZcEWnPEdANoEN5d21S6XL/Av5ShfTJbpLB3pnSl9A== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2015 18:36:43.3816 (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-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB707 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 18:36:54 -0000 Mark R V Murray wrote: > >> - Remove; plugability is no longer used. Compile-time algorithm > >> selection is the way to go. > > > > Errr we use that and need it. > > Please put it back. > > Do you really need full the plugability (including run-time selection > of algorithm), or do you just need to have KLD modules back? We need KLD for sure, and the ablity to leave out a mixer like yarrow/fortuna - we do not expect any of our customers (except those forced to by govt) to use that arrangement though. > I intend to do the latter, but in a different way. The adaptor code > and run-time section was a locking liability. > > > Whether we agree with NIST's ideas about how randomness should be > > handled or not, we need to to be able to comply and we do not want to > > burn their desired arrangement into our kernels. > > Sound like you just need to be able to select a single KLD at boot time? Quite possibly. Will confirm... Thanks --sjg From owner-svn-src-head@freebsd.org Thu Jul 2 18:37:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41DA7993D0A; Thu, 2 Jul 2015 18:37:48 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCB661F7B; Thu, 2 Jul 2015 18:37:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by wiar9 with SMTP id r9so109780149wia.1; Thu, 02 Jul 2015 11:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Wpa62+2fwvLVmty+7h6x+IwFH6lIOrhv6LwXCj7GhaY=; b=P2UVANcb/lVRmwidqq3ua3jahVwZJj5tccLKwjKkU8sSzz+QYtx65COXWbeu1aQK6+ so+lrki7WbP+/2OzB1ye9rCNKFfxMGAcdvVoE8kUpDAs4rB51Lq84eqf/+8ErZRP7E4d qKM7zQshJ3z9aPj33JPvebuH9R8BYU5+OuBmWSCLsCos1i/e99hKodCo9cCon15Npxv1 YYGS3Z8bfBBNS/jJ4VRiCiws2z4c1MIgqmbihgvggyU4ZiVYAygY0/6mdzBRcoVpMbSq PGHpIWX0G2r7OzhrbSpWXc6W5+tuSo6l36tjFUeriH5WU2nOSH7SlHAktH5QZctCuMwV v0qA== X-Received: by 10.180.84.202 with SMTP id b10mr19249824wiz.23.1435862266290; Thu, 02 Jul 2015 11:37:46 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id lv8sm2737386wjb.41.2015.07.02.11.37.43 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 02 Jul 2015 11:37:44 -0700 (PDT) Date: Thu, 2 Jul 2015 20:37:41 +0200 From: Mateusz Guzik To: Ian Lepore Cc: Ermal =?utf-8?B?THXDp2k=?= , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Renato Botelho Subject: Re: svn commit: r285050 - in head: lib/libutil usr.sbin/pwd_mkdb Message-ID: <20150702183741.GA7666@dft-labs.eu> References: <201507021731.t62HV074085188@repo.freebsd.org> <1435861164.1648.129.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1435861164.1648.129.camel@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 18:37:48 -0000 On Thu, Jul 02, 2015 at 12:19:24PM -0600, Ian Lepore wrote: > On Thu, 2015-07-02 at 20:00 +0200, Ermal Luçi wrote: > > On Thu, Jul 2, 2015 at 7:31 PM, Renato Botelho wrote: > > > > > Author: garga (ports committer) > > > Date: Thu Jul 2 17:30:59 2015 > > > New Revision: 285050 > > > URL: https://svnweb.freebsd.org/changeset/base/285050 > > > > > > Log: > > > When passwd or group information is changed (by pw, vipw, chpass, ...) > > > temporary file is created and then a rename() call move it to official > > > file. > > > This operation didn't have any check to make sure data was written to > > > disk > > > and if a power cycle happens system could end up with a 0 length passwd > > > or group database. > > > > > > There is a pfSense bug with more infor about it: > > > > > > https://redmine.pfsense.org/issues/4523 > > > > > > The following changes were made to protect passwd and group operations: > > > > > > * lib/libutil/gr_util.c: > > > - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file > > > - After rename(), fsync() call on directory for faster result > > > > > > * lib/libutil/pw_util.c > > > - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file > > > > > > * usr.sbin/pwd_mkdb/pwd_mkdb.c > > > - Added O_SYNC flag on dbopen() calls > > > - After rename(), fsync() call on directory for faster result > > > > > > * lib/libutil/pw_util.3 > > > - pw_lock() returns a file descriptor to master password file on success > > > > > > Differential Revision: https://reviews.freebsd.org/D2978 > > > Approved by: bapt > > > Sponsored by: Netgate > > > > > > Modified: > > > head/lib/libutil/gr_util.c > > > head/lib/libutil/pw_util.3 > > > head/lib/libutil/pw_util.c > > > head/usr.sbin/pwd_mkdb/pwd_mkdb.c > > > > > > Modified: head/lib/libutil/gr_util.c > > > > > > ============================================================================== > > > --- head/lib/libutil/gr_util.c Thu Jul 2 16:17:05 2015 (r285049) > > > +++ head/lib/libutil/gr_util.c Thu Jul 2 17:30:59 2015 (r285050) > > > @@ -141,7 +141,7 @@ gr_tmp(int mfd) > > > errno = ENAMETOOLONG; > > > return (-1); > > > } > > > - if ((tfd = mkstemp(tempname)) == -1) > > > + if ((tfd = mkostemp(tempname, O_SYNC)) == -1) > > > return (-1); > > > if (mfd != -1) { > > > while ((nr = read(mfd, buf, sizeof(buf))) > 0) > > > @@ -318,10 +318,28 @@ gr_copy(int ffd, int tfd, const struct g > > > int > > > gr_mkdb(void) > > > { > > > + int fd; > > > + > > > if (chmod(tempname, 0644) != 0) > > > return (-1); > > > > > > - return (rename(tempname, group_file)); > > > + if (rename(tempname, group_file) != 0) > > > + return (-1); > > > + > > > + /* > > > + * Make sure new group file is safe on disk. To improve > > > performance we > > > + * will call fsync() to the directory where file lies > > > + */ > > > + if ((fd = open(group_dir, O_RDONLY|O_DIRECTORY)) == -1) > > > + return (-1); > > > + > > > > > > > This really is not a real failure! > > Not sure how you would report this but it really is not a failure since the > > rename has completed and you are giving false information back. > > > > I disagree. If you can't open the directory containing the file you > just renamed into that directory, then the assertion that the rename > completed strikes me as speculative at best. IMO, it's not truly > completed until the fsync() returns success. > Well, it really depends how much you want to nitpick here. A joke problem is that By the time you open group_dir, it could have ben renamed/mounted upon/whatever and you are opening a different directory. A non-joke problem is that the caller cannot distinguish between failed rename and failed open/sync, making it impossible to perform any kind of recovery. I would say the chane should be left as it is. It reportedly fixes the problem encounterd in the wild and is not that bad One has to note this entire api and pw(8) are screaming for a rewrite for a long time now. > -- Ian > > > > > > > > + if (fsync(fd) != 0) { > > > + close(fd); > > > + return (-1); > > > + } > > > + > > > + close(fd); > > > + return(0); > > > } > > > > > > /* > > > > > > Modified: head/lib/libutil/pw_util.3 > > > > > > ============================================================================== > > > --- head/lib/libutil/pw_util.3 Thu Jul 2 16:17:05 2015 (r285049) > > > +++ head/lib/libutil/pw_util.3 Thu Jul 2 17:30:59 2015 (r285050) > > > @@ -233,7 +233,8 @@ function returns 0 in case of success an > > > The > > > .Fn pw_lock > > > function locks the master password file. > > > -It returns 0 in case of success and -1 in case of failure. > > > +It returns a file descriptor to master password file in case of success > > > +and -1 in case of failure. > > > .Pp > > > The > > > .Fn pw_scan > > > > > > Modified: head/lib/libutil/pw_util.c > > > > > > ============================================================================== > > > --- head/lib/libutil/pw_util.c Thu Jul 2 16:17:05 2015 (r285049) > > > +++ head/lib/libutil/pw_util.c Thu Jul 2 17:30:59 2015 (r285050) > > > @@ -226,7 +226,7 @@ pw_tmp(int mfd) > > > errno = ENAMETOOLONG; > > > return (-1); > > > } > > > - if ((tfd = mkstemp(tempname)) == -1) > > > + if ((tfd = mkostemp(tempname, O_SYNC)) == -1) > > > return (-1); > > > if (mfd != -1) { > > > while ((nr = read(mfd, buf, sizeof(buf))) > 0) > > > > > > Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c > > > > > > ============================================================================== > > > --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jul 2 16:17:05 2015 > > > (r285049) > > > +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jul 2 17:30:59 2015 > > > (r285050) > > > @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > #include > > > @@ -227,14 +228,14 @@ main(int argc, char *argv[]) > > > clean = FILE_INSECURE; > > > cp(buf2, buf, PERM_INSECURE); > > > dp = dbopen(buf, > > > - O_RDWR|O_EXCL, PERM_INSECURE, DB_HASH, &openinfo); > > > + O_RDWR|O_EXCL|O_SYNC, PERM_INSECURE, DB_HASH, > > > &openinfo); > > > if (dp == NULL) > > > error(buf); > > > > > > clean = FILE_SECURE; > > > cp(sbuf2, sbuf, PERM_SECURE); > > > sdp = dbopen(sbuf, > > > - O_RDWR|O_EXCL, PERM_SECURE, DB_HASH, &openinfo); > > > + O_RDWR|O_EXCL|O_SYNC, PERM_SECURE, DB_HASH, &openinfo); > > > if (sdp == NULL) > > > error(sbuf); > > > > > > @@ -291,13 +292,13 @@ main(int argc, char *argv[]) > > > method = 0; > > > } else { > > > dp = dbopen(buf, > > > - O_RDWR|O_CREAT|O_EXCL, PERM_INSECURE, DB_HASH, > > > &openinfo); > > > + O_RDWR|O_CREAT|O_EXCL|O_SYNC, PERM_INSECURE, DB_HASH, > > > &openinfo); > > > if (dp == NULL) > > > error(buf); > > > clean = FILE_INSECURE; > > > > > > sdp = dbopen(sbuf, > > > - O_RDWR|O_CREAT|O_EXCL, PERM_SECURE, DB_HASH, > > > &openinfo); > > > + O_RDWR|O_CREAT|O_EXCL|O_SYNC, PERM_SECURE, DB_HASH, > > > &openinfo); > > > if (sdp == NULL) > > > error(sbuf); > > > clean = FILE_SECURE; > > > @@ -721,13 +722,27 @@ void > > > mv(char *from, char *to) > > > { > > > char buf[MAXPATHLEN]; > > > + char *to_dir; > > > + int to_dir_fd = -1; > > > > > > - if (rename(from, to)) { > > > + /* > > > + * Make sure file is safe on disk. To improve performance we will > > > call > > > + * fsync() to the directory where file lies > > > + */ > > > + if (rename(from, to) != 0 || > > > + (to_dir = dirname(to)) == NULL || > > > + (to_dir_fd = open(to_dir, O_RDONLY|O_DIRECTORY)) == -1 || > > > + fsync(to_dir_fd) != 0) { > > > int sverrno = errno; > > > (void)snprintf(buf, sizeof(buf), "%s to %s", from, to); > > > errno = sverrno; > > > + if (to_dir_fd != -1) > > > + close(to_dir_fd); > > > error(buf); > > > } > > > + > > > + if (to_dir_fd != -1) > > > + close(to_dir_fd); > > > } > > > > > > void > > > > > > -- > > > Ermal > > > > > > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Mateusz Guzik From owner-svn-src-head@freebsd.org Thu Jul 2 18:41:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38342993E0A; Thu, 2 Jul 2015 18:41:59 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFD7D2319; Thu, 2 Jul 2015 18:41:58 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZAjQo-0003E3-Nh; Thu, 02 Jul 2015 19:41:55 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <22423.1435862187@chaos> Date: Thu, 2 Jul 2015 19:41:48 +0100 Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, amesh@juniper.net, stevek@juniper.net Content-Transfer-Encoding: quoted-printable Message-Id: <284B5FB4-F487-4FBA-ABE6-D163065AFD1B@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 18:41:59 -0000 > On 2 Jul 2015, at 19:36, Simon J. Gerraty wrote: >=20 > Mark R V Murray wrote: >>>> - Remove; plugability is no longer used. Compile-time algorithm >>>> selection is the way to go. >>>=20 >>> Errr we use that and need it. >>> Please put it back. >>=20 >> Do you really need full the plugability (including run-time selection >> of algorithm), or do you just need to have KLD modules back? >=20 > We need KLD for sure, and the ablity to leave out a mixer like > yarrow/fortuna - we do not expect any of our customers (except those > forced to by govt) to use that arrangement though. Excellent! :-) >> I intend to do the latter, but in a different way. The adaptor code >> and run-time section was a locking liability. >>=20 >>> Whether we agree with NIST's ideas about how randomness should be >>> handled or not, we need to to be able to comply and we do not want = to >>> burn their desired arrangement into our kernels. >>=20 >> Sound like you just need to be able to select a single KLD at boot = time? >=20 > Quite possibly. >=20 > Will confirm=E2=80=A6 Great, thanks! If so, can I confirm that you may be rolling your own non-Yarrow/Fortuna mixer(s)? M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Thu Jul 2 18:43:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A736993E47; Thu, 2 Jul 2015 18:43:16 +0000 (UTC) (envelope-from amesh@juniper.net) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0106.outbound.protection.outlook.com [65.55.169.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAE8E2544; Thu, 2 Jul 2015 18:43:15 +0000 (UTC) (envelope-from amesh@juniper.net) Authentication-Results: juniper.net; dkim=none (message not signed) header.d=none; Received: from juniper.net (66.129.239.11) by BN1PR05MB186.namprd05.prod.outlook.com (10.255.205.13) with Microsoft SMTP Server (TLS) id 15.1.195.15; Thu, 2 Jul 2015 18:43:00 +0000 Date: Thu, 2 Jul 2015 11:42:55 -0700 From: Arthur Mesh To: "Simon J. Gerraty" CC: Mark R V Murray , , , , Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150702184255.GH90166@juniper.net> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="faJ0ivz08JzDjTH2" Content-Disposition: inline In-Reply-To: <22423.1435862187@chaos> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [66.129.239.11] X-ClientProxiedBy: SN1PR0701CA0084.namprd07.prod.outlook.com (25.163.126.52) To BN1PR05MB186.namprd05.prod.outlook.com (10.255.205.13) X-Microsoft-Exchange-Diagnostics: 1; BN1PR05MB186; 2:jjMaga3GFiS8ZPMw5ihFPgbqAaCKjhDl8glr9gyXzu4S/3M5Oi+Qkr1/1TewFOkG; 3:33cvOeQdLXiboc+EalRIOAR5fIzBed9YSXp4hE7oNrbElHgDQGkjo1uQURuINnWXodr1niCtMc22j/yRf1GEDzzkZG8urNquv2LSpp6zHOGezC4hz5qy/2pjD1/U8rvmsjQHrJ7QZMfwizdQ0On8OQ==; 20:g/qset3wIS+Ej3J4RFHYQdJmiuXy1SJdRNzahYX0dhohzYFIWX1KqPVNgmWdiLai002VZWDcyeN80s/WTphk42JACkocM5X4bloH3vcrGPlgS0zPwBrSf8EpRTLOqYrNbyrzJK3nv9IEjB8qcKqU4FqpOtQLDLubRngeuGoBxEEDBPnoFYgC9tX1WxHZgl9zsZSu1t1EQast3v2NmzBszd7UlQA7qLNlqfMrLbHqh6wXpL1nd3EH0TyQNdKPton/VOffqov/f3/cxMIVnM+s26s13iL2mkTJgILU/+NsDtkeConQALafATdg6NtwDlWGKkCfyetzBoAnIMGOzNaNbPe6UKQpRYLEr9fCdpiLyjRj6qu0FqjnDtX/xKn6GElWsEk8v9cKMzvJNPVU3P0pWLnvTx4Cc1JlXmk6z00nhiAFPLmgPuj5lavWav+UgHpDHaGVZlK1DqgXNMpj18NByfDMs+3tvbvBy8HLwepXb8vWgsOZPf93GJ9VQQPFPV/3 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR05MB186; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BN1PR05MB186; BCL:0; PCL:0; RULEID:; SRVR:BN1PR05MB186; X-Microsoft-Exchange-Diagnostics: 1; BN1PR05MB186; 4:2WPFSrCOJculp2ikme5tkjO25jQAMUOXwQRa+85PIwy9u564Zv6MApL1a+8QzK82+WRN2jXRs+JIS6Ptp7EgOuBu0NBlteilweQPo3gvS93AHzlTtLU9H6h6y9s0NNPwkW4bV5rV81L8fwg/9KRBgMl7SRFij63HlG+STmtkyha4EZcHUN3PD+HaXCqOhrGIdaax1Z3hgQmCRl+L/5P6/Hi2hdxhC+JmBwLBTA5w0TO2R4tkMpL8WZ7cb4YQyatbXm1oBYi2IscKfQoa+N0kE9fkfGPzfgYOlVn9gNAH9jY= X-Forefront-PRVS: 06259BA5A2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(51704005)(24454002)(83506001)(19580405001)(50986999)(2950100001)(84326002)(40100003)(76176999)(66066001)(46102003)(86362001)(36756003)(19580395003)(77156002)(54356999)(62966003)(122386002)(512954002)(33656002)(87976001)(450100001)(77096005)(5000100001)(93886004)(42186005)(4001350100001)(33026002)(92566002)(189998001)(107886002)(5001960100002)(110136002)(4001430100001)(4001450100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR05MB186; H:juniper.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR05MB186; 23:hva+Ryj0ANAuz0ARzFLUdcIQqAjJp0A2bbGiiblvBe?= =?us-ascii?Q?x/gDzvk6UpYXdBbjp2/mFyooP5WeqMyXOdBj8R+RizhaX93aRUdfS5w4USBS?= =?us-ascii?Q?BAJCxTorwwD0e633EWSzcO16AsKFCZDK/KYdCP6DoKi3IF6zpBVZIyjCX+io?= =?us-ascii?Q?tQzV68Mljgbb2nsWz27kcXh3BqJ0kTdeeChENiPWTGxUkCagkVtpePP2r7jN?= =?us-ascii?Q?yrZOU6+CDUNUmtp2P7tY9+ZR/EpDUIhuu9De8HZWg4sVPExRh1ODIbsPWSp1?= =?us-ascii?Q?VndhHgQDwHwfqfiYK7bxyV7oDEJtuT52FM3wA31mmsv52P+uL1girAVENemh?= =?us-ascii?Q?k/Yut13ol8EFrRoCXYO6rPRS9QFU8yarMRgkOVK4OfKPcvnOBgvDuFvixDwV?= =?us-ascii?Q?hbW0j2drn3AGWpnPmHDcqcjd6kJz4vEpnjH+YJb7n247hM31emGNO1sQbsg/?= =?us-ascii?Q?jeyFacXOH6tu7eCdsmhZFuw06EoNXMdrrXXGTZSCCxIWXMsWb1lQtaJ3pt4I?= =?us-ascii?Q?Rbd0fJd30goe1ZrFiedPLrwaRKghVFKhYSYUgYjcbgDd7Sh0odn+uWfO7YCY?= =?us-ascii?Q?IQ2NSSFLp8qneHimm9gWS+2Suo6m4ql7ZK0yY23qhmGIP5R9+ltCpLuJWIi5?= =?us-ascii?Q?VvCdRvd3TbN4wWh8rkAYvKgs7KA2mzK8YS2QreSvO5vTNcD+V+m1H/BSrin9?= =?us-ascii?Q?0rprGqW3ZphkpkxtV20Vr88rjEkKG+j/l7aXVEilvGQjlnf/fx/rmVBnkFg/?= =?us-ascii?Q?KIeg12U2FVcY61ziImnLcCXUAD1506HUR/lGSnw9ZEagPBE6Agp+WW+AGON/?= =?us-ascii?Q?BqfIfGYMZo5oYMgEBB112ImyzvvXxkejKb1X7GwnbP5ybdJ/sDEwL2j99epW?= =?us-ascii?Q?Cv6RCenSOuTwgEaep64vSvQy9XfTpd77HL1IAVwryLFkjS81dpPrif8BnqZ/?= =?us-ascii?Q?tX/eMQTaoz06imhvkwjdnQoc+/cShLE3bkHLh7cYTorwqhzyv1mP+j1288Bx?= =?us-ascii?Q?U=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR05MB186; 5:nHacEgc/YDtow/tpTPM/wKIVvC614Rg6Rpzk/vHZNNR0jmDP5zHS9gL/vagjvUlDkXEUV02x4dfWSTlQYjDeJXSU0HSS/1T/0Wly5bVQjy1u0Gs4VyOuo3paLIAzRYRuoEZ5mR8pflFvTYHYMS09zQ==; 24:UffUDftyTj1EQ/r+lhREGG5j8T3koMljuUvPjWyFZ/qvq54fxis3swpzNe4EH/OVLc/tbUvqLHnDDL4BYOfKvyVe4bqdaf8UtUTzr7MFMdI=; 20:ikkSiaNL+e3mYLF/H3hzjEqcYgkTxBB0Z+KDfIsjvTGRop+ZzpEqYG+dzzeZpqEU/dxqXNRZiC8BuNEd5WYhzQ== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2015 18:43:00.7663 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR05MB186 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 18:43:16 -0000 --faJ0ivz08JzDjTH2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 02, 2015 at 11:36:27AM -0700, Simon J. Gerraty wrote: > > Sound like you just need to be able to select a single KLD at boot time? >=20 > Quite possibly. >=20 > Will confirm... Hello, We need to be able to select a random adaptor at load time. I.e. loader is the one selecting it based on configuration. I.e., if the box is configured to boot in FIPS mode, it should use NIST SP800-90 HMAC-DRBG adaptor. Otherwise, it uses the default FreeBSD adaptor (Fortuna I guess). We do not need ability to switch adaptors at run-time. Thanks --=20 Arthur Mesh Juniper Networks +1 408 936-4968 --faJ0ivz08JzDjTH2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQGcBAABCAAGBQJVlYYuAAoJEAi6IWerhQY4gEgL+QFfRGoOmMZ4iP+c/QtvE0AK jXGWdQLjldJ6faqe1YQ99lnzqiN3bZrmfBBLDN2FPHWDo7ZxeBup8DNbYLaAIkc8 hlubXdq/b2pVI/agaWx6eNCMURS+TF/UAef95D7bGDih3/nnV0vjmaeVDppw+05i DCAohcV0aklepz6HR/L3tHJi1ruCHMGs41u/oNU1gH2m6MAqQBGeQOjK6POd5Plk UQyoFCs23H/ygD6Fm2VHt3cB6G+mR+g/WZaW5a0lfKluIN77XRPMza/VBBZgAwat oTNydO7yKUm4lahsXmpEZ9Bkvmgr8RtWPz5ardI23pa3zHv/flIuPhgRNTA3aL6h KME86CgTOJdr9Lds/dc9+CZjoeH0+Z1w2v2PyPjYd+nPrGyfMK8LtsJldMv38hHn +TIcFKH6siVgNznN4ap7CFbf5Vr/dPa3YWpcGqzBNBmdBIafmr82sz5I6a1q4d2o uh+w+OtLhqNIyDjnauZXkgYmK7DVxlSfuYNh1+U6ZQ== =hqMD -----END PGP SIGNATURE----- --faJ0ivz08JzDjTH2-- From owner-svn-src-head@freebsd.org Thu Jul 2 19:00:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6038993FE0; Thu, 2 Jul 2015 19:00:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7C302A2A; Thu, 2 Jul 2015 19:00:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62J0MhU028292; Thu, 2 Jul 2015 19:00:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62J0Moe028290; Thu, 2 Jul 2015 19:00:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201507021900.t62J0Moe028290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 2 Jul 2015 19:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285055 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:00:22 -0000 Author: mjg Date: Thu Jul 2 19:00:22 2015 New Revision: 285055 URL: https://svnweb.freebsd.org/changeset/base/285055 Log: sysvshm: fix shmrealloc The code was supposed to initialize new segs in newsegs array, but used the old pointer. Modified: head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Thu Jul 2 18:30:12 2015 (r285054) +++ head/sys/kern/sysv_shm.c Thu Jul 2 19:00:22 2015 (r285055) @@ -801,10 +801,10 @@ shmrealloc(void) for (i = 0; i < shmalloced; i++) bcopy(&shmsegs[i], &newsegs[i], sizeof(newsegs[0])); for (; i < shminfo.shmmni; i++) { - shmsegs[i].u.shm_perm.mode = SHMSEG_FREE; - shmsegs[i].u.shm_perm.seq = 0; + newsegs[i].u.shm_perm.mode = SHMSEG_FREE; + newsegs[i].u.shm_perm.seq = 0; #ifdef MAC - mac_sysvshm_init(&shmsegs[i]); + mac_sysvshm_init(&newsegs[i]); #endif } free(shmsegs, M_SHM); From owner-svn-src-head@freebsd.org Thu Jul 2 19:03:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13B429930E2; Thu, 2 Jul 2015 19:03:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05BB72D99; Thu, 2 Jul 2015 19:03:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62J3iC1031797; Thu, 2 Jul 2015 19:03:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62J3ilo031796; Thu, 2 Jul 2015 19:03:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201507021903.t62J3ilo031796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 2 Jul 2015 19:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285056 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:03:45 -0000 Author: mjg Date: Thu Jul 2 19:03:44 2015 New Revision: 285056 URL: https://svnweb.freebsd.org/changeset/base/285056 Log: sysvshm: don't lock proc when calculating attach_va vm_daddr is constant and RLIMIT_DATA can be obtained from thread's copy of rlimits. Modified: head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Thu Jul 2 19:00:22 2015 (r285055) +++ head/sys/kern/sysv_shm.c Thu Jul 2 19:03:44 2015 (r285056) @@ -380,10 +380,8 @@ kern_shmat_locked(struct thread *td, int * This is just a hint to vm_map_find() about where to * put it. */ - PROC_LOCK(p); attach_va = round_page((vm_offset_t)p->p_vmspace->vm_daddr + - lim_max_proc(p, RLIMIT_DATA)); - PROC_UNLOCK(p); + lim_max(td, RLIMIT_DATA)); } vm_object_reference(shmseg->object); From owner-svn-src-head@freebsd.org Thu Jul 2 19:10:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 321789931F7; Thu, 2 Jul 2015 19:10:43 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0144.outbound.protection.outlook.com [207.46.100.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DFB61171; Thu, 2 Jul 2015 19:10:41 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from BY2PR05CA031.namprd05.prod.outlook.com (10.141.250.21) by BLUPR05MB772.namprd05.prod.outlook.com (10.141.209.27) with Microsoft SMTP Server (TLS) id 15.1.195.15; Thu, 2 Jul 2015 18:55:56 +0000 Received: from BL2FFO11OLC013.protection.gbl (2a01:111:f400:7c09::107) by BY2PR05CA031.outlook.office365.com (2a01:111:e400:2c5f::21) with Microsoft SMTP Server (TLS) id 15.1.201.16 via Frontend Transport; Thu, 2 Jul 2015 18:55:56 +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; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.18 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.18) by BL2FFO11OLC013.mail.protection.outlook.com (10.173.160.161) with Microsoft SMTP Server (TLS) id 15.1.201.10 via Frontend Transport; Thu, 2 Jul 2015 18:55:56 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 2 Jul 2015 11:55:49 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t62ItnD77016; Thu, 2 Jul 2015 11:55:49 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id CD958580AA; Thu, 2 Jul 2015 11:55:48 -0700 (PDT) To: Mark R V Murray CC: , , , , Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... In-Reply-To: <284B5FB4-F487-4FBA-ABE6-D163065AFD1B@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> <284B5FB4-F487-4FBA-ABE6-D163065AFD1B@FreeBSD.org> Comments: In-reply-to: Mark R V Murray message dated "Thu, 02 Jul 2015 19:41:48 +0100." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Thu, 2 Jul 2015 11:55:48 -0700 Message-ID: <322.1435863348@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC013; 1:Mdvm+JumwOllQCvqbWZT7pQuSK7iOmiHXIS3XPfBJdmu8oXPaNS1lrBzYUuzcnL9zUriyz8YasNWfaJ8GKl6Y5kw5acAVd3th+C9Ew3NxR8hJ+0Duh8EtL8Z6/c0Se5P1dVHSBQLdxR/vDHSqBXElBscjPdjVSnRnKxWNU5LUmQC5H5bmhWFO0JErjF4FUu+EHkFCyuCAFQ7rhkfITur3d+ZtnnrXQP1sOID5pM+F0JiiAyBzxAa1eCtom8n6vRSJ+RgFmbY9fh4Jj+iVGV02w== X-Forefront-Antispam-Report: CIP:66.129.239.18; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(24454002)(92566002)(6806004)(46102003)(50226001)(117636001)(450100001)(77156002)(62966003)(86362001)(50986999)(87936001)(105596002)(76176999)(48376002)(50466002)(33716001)(57986006)(19580395003)(76506005)(19580405001)(106466001)(93886004)(5001920100001)(5001960100002)(2950100001)(47776003)(189998001)(107886002)(77096005)(110136002)(42262002)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB772; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB772; 2:hTVnVMkjncMY2U0dEKktLZ5yfI6WGi6RbkDYy5cC/hCek2NefIpRxViGuCn4aIWl; 3:NkDR5EVIV9ql7L5V+fgL8t7Z4EhFjqZIvDnS6SkBaghaOKm51u93TtdqfQ7xc4leRqV9Htim42XbluRgIV4MM9QuhcmDRVwhiQEF0zQkv7lELqOBYpj0bp13zAyUnqcEFvNJYnoJmmAr7d9oKiAsaDh8CyFRC8r8IKr77fQl5tAXPqQVOlJ0ULUht9aQCcrsQ5T59qMqHKD+o2X9FGIsBYnJUm0bh7sTtBiwrQ74Fv0=; 20:+y+A+xc6xW4r3KmQCDlrZXfTUj3jCvgIBci5XzVrA/jD5sH4rtTxuiV3MmKtGWElvareVYynnohUvshvkIvxoFXjLpSIz0ySYkB1uvxgTIjfhkRGlGdaVeNNhPqLRmOd7o2I9/K0tk0xaDw/dxK+Zd4gD+98XbYzvgUu5caR5G953QOkutC26F39W8slcpIjoM2vEOBl8/fhMgp7iHWCf9GsZt28oTHm8Pxam45YpYrQ6oeQjN6ylL+/nrFikpBZuyklK9aladWwJSKGLrS0WhVawmY7D6/L0Ophjyw5TCSDete9w5jH7Manlo8q9c17kHqLvNuTXDVeHOpmKg8bfq7N0Oz+vKt5Xl/MYsXm8SE5q2D1fBEJVpH57K6IgM2yf3VJZ/MVasbSd95osstb4LbITLvVI7eeaHG7BnU8d+q3nobU93ZC3I5OUigH9goOXloGhaSha7cnvqK8uvgX73Gr8p+Du0Q2mn1dx4bAnGzH8EqJ62+VCTt3/4xbBWoq X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR05MB772; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BLUPR05MB772; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB772; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB772; 4:aDrRi0AgLdf+lCsiq3jJovWx9U4Z2JGo6cLtHasuh8zTTj3LS4+Si7CU6Kg/fIKSzy5MZ+3SCnW+tGX49QwHyxxIIRhfevw852fQ+BKz2/EAud8+5ZSxAsQOnnUNJzahraiiCeBtTpUFnlWgWllC0MV8wMgP5G50S/9rpoGocrAsdLwRV9TDxHfFSco8zrCTXZFNHeT1Sz9Gu9G8oS8ZtZNa3IRZmaLOkdF1V62hE1VkY28fumqxF9QWNmOSNrclPNMfA1cwsPSqXsHcs2H7vA+PGSGHpDPAZoz8Et6KuDI= X-Forefront-PRVS: 06259BA5A2 X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB772; 23:btXktC0s1ONnF5wijcdYzex5xzjzTiAqDy0s4twTKATPAQ3oW10dzNPGD6Vvq4JqEMg6vB/kO6V/YF270fvUXMhAariE5G0Lwue8AfYJ1BD8M7P+bM/vnUJIuZsc2zYQNOlbt74VdSXc5kf4tikI9A3PCVm76OOAdUp5TeuVNamCmIy5okrGrOyDnfD4DskG8uV4I/M1GC1zxT/N07ARohaKanHTdn+J18WdD1QP2uQHwl+dzAiUmpS3Nutu+obJdV5LR5+BE8Z377Cdt2pwuGrw8CPDi+t7rFUmLpMJ+4utP4fRPt3/AcHYPO8rCQW4MnVZ5A9Y2foiCjCVFFv4thlF5wJJM1tdZPhqU03cMAxbv9GJImaB2/tWx5lDe2TI/rC3eU+xVUuxwHxJzXIUdA4PbwTWRbtbUfJVYRMzJeqdL7LOOiD4jQd8XF0k+u9Fusb2uhIL061s9mkbwhWJ8P/+NK4wMO95C8ba+i1qBj9RI/8wt2LlMNGmHDGGT/jeWIaCeiXFsqdXrFhw1tNBJVx0xocUg1TXPDXmH9TMg8tAtDGR4jmUpwlTOGXBFwe/jywgyyG4BWXCWaYBBKOmyioydqNFi98JP42sgu1w48PitVWVEpL2zy0LI02KgmG+pBHqDK4ls/hWYPEeMd+on8JaiI2gvR973fn5JCDfXY0TBN4bNYxqqdTmrRkoo0BB7L4mWjXNILslWGDXNUgIaiU1wEhU90Be9WRhpdEIliUu2S5tkO2z8bdvRU8EELbYp3lMIa6m2sAMQ5gABzb0g2LxEHdaV4V11SIc7ezSjsF5YH5AxCmss1LJdG9zuW6Gqz/4ugMsly1H8ANkFY3sFK329pFdjpaD/sQlmqwAByHtyXE3hdXXPLpqikRYbudz/XRSYaiqle4NidBF/qTprEQhgCM1hc8V8NGHxB3xDrFABxSqO97DjHLVbH70/FWf X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB772; 5:/ygRs9Fto6u7UtUvTVxC+8roLFDKLlJfTY7oYBkWjFLQYgWjhkrsypbLP161hyHdWFkbBiImaidzpDh0zNVnl1PjBVPT9qNSS7PvXChqgioxX7TYFNRe+WVCsalJbQKIJY/1Nc3da90ZPw60wm2SCA==; 24:6L1i/AuwGhR0ILO8dsnbkygLcWBJkn/enKcyYJo7ut8OKgbIs9UI3syfy+CQR1EVNcj1vRie2j5RXEu+DoWxkTjem/Ia1v7R9M8acG7jc00=; 20:odrKtxwNQOAxbbCF7Zs42wNeKMTrrAJPjrBTzPtDLNxRPGRk4fjs2Sx18BEjl6FL+eKIoSfIS6GaIWeE1rm76Q== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2015 18:55:56.0177 (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-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB772 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:10:43 -0000 Mark R V Murray wrote: > If so, can I confirm that you may be rolling your own non-Yarrow/Fortuna > mixer(s)? AFAIK no mixer allowed; just direct SP800-90 compliant HMAC-DRBG. You can probably guess why we don't agree that's a brilliant arrangement but its not an argument we can win. Same would apply for anyone else doing FIPS 140 evaled products. From owner-svn-src-head@freebsd.org Thu Jul 2 19:13:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8641993373; Thu, 2 Jul 2015 19:13:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ie0-x22b.google.com (mail-ie0-x22b.google.com [IPv6:2607:f8b0:4001:c03::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 91C4916A1; Thu, 2 Jul 2015 19:13:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iecuq6 with SMTP id uq6so63194611iec.2; Thu, 02 Jul 2015 12:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+6JtmyVF4DpUA8yZYuG57AcyfHjQTeqcOOGv0m2EkMk=; b=RT6UBHYzkWhhJ4sfamQkNr2wB3t98MxMm9Dj8HMdDeX9PH3/Xyl/asCdlEgVg7pZ24 RafHA2o1TxaWCGoB24Bma3aYlvLbmd0oKyHeRp3Q1QVN+HCS8PADsRgv/ix1s3Gm5PoY FUtMWnYu3TAvUDRnRMIQmdr0YClyKovryA+pndqZ94U37k2Hu/34zZYyGw5bTFNRetGZ IDjhC/NwC/AMTZ20jWtpEveErIdYs0e19tf1cC8oR/nZFCWCk2VdyfIV1uOT+Xy9D0Dx Eu82E6KiP/OEH4HSbJOTy6ITNp/RaHoyfp8D/PqgvEAjtZLd1KitPBOISc2WDIimr9Wa FRkg== MIME-Version: 1.0 X-Received: by 10.107.155.74 with SMTP id d71mr49187955ioe.29.1435864434942; Thu, 02 Jul 2015 12:13:54 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Thu, 2 Jul 2015 12:13:54 -0700 (PDT) In-Reply-To: <322.1435863348@chaos> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> <284B5FB4-F487-4FBA-ABE6-D163065AFD1B@FreeBSD.org> <322.1435863348@chaos> Date: Thu, 2 Jul 2015 12:13:54 -0700 Message-ID: Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... From: Adrian Chadd To: "Simon J. Gerraty" Cc: Mark R V Murray , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , amesh@juniper.net, Steve Kiernan Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:13:55 -0000 On 2 July 2015 at 11:55, Simon J. Gerraty wrote: > Mark R V Murray wrote: >> If so, can I confirm that you may be rolling your own non-Yarrow/Fortuna >> mixer(s)? > > AFAIK no mixer allowed; just direct SP800-90 compliant HMAC-DRBG. > You can probably guess why we don't agree that's a brilliant arrangement > but its not an argument we can win. > > Same would apply for anyone else doing FIPS 140 evaled products. Could we please get something like this implemented in upstream FreeBSD? I'm sure a number of vendors would like to see a (not by default) FIPS-140 random number generator provided. It'd certainly be a good check list item for people evaluating the use of freebsd in an appliance. Thanks, -a From owner-svn-src-head@freebsd.org Thu Jul 2 19:14:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 318DA99339C; Thu, 2 Jul 2015 19:14:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1781D199A; Thu, 2 Jul 2015 19:14:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62JEU3Q037069; Thu, 2 Jul 2015 19:14:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62JEUro037068; Thu, 2 Jul 2015 19:14:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201507021914.t62JEUro037068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 2 Jul 2015 19:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285057 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:14:31 -0000 Author: mjg Date: Thu Jul 2 19:14:30 2015 New Revision: 285057 URL: https://svnweb.freebsd.org/changeset/base/285057 Log: sysvshm: fix up some whitespace issues and spurious initialisation Modified: head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Thu Jul 2 19:03:44 2015 (r285056) +++ head/sys/kern/sysv_shm.c Thu Jul 2 19:14:30 2015 (r285057) @@ -216,7 +216,7 @@ shm_find_segment(int arg, bool is_shmid) shmseg = &shmsegs[segnum]; if ((shmseg->u.shm_perm.mode & SHMSEG_ALLOCATED) == 0 || (!shm_allow_removed && - (shmseg->u.shm_perm.mode & SHMSEG_REMOVED) != 0) || + (shmseg->u.shm_perm.mode & SHMSEG_REMOVED) != 0) || (is_shmid && shmseg->u.shm_perm.seq != IPCID_TO_SEQ(arg))) return (NULL); return (shmseg); @@ -278,8 +278,9 @@ kern_shmdt_locked(struct thread *td, con struct shmmap_state *shmmap_s; #ifdef MAC struct shmid_kernel *shmsegptr; + int error; #endif - int error, i; + int i; SYSVSHM_ASSERT_LOCKED(); if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) @@ -301,8 +302,7 @@ kern_shmdt_locked(struct thread *td, con if (error != 0) return (error); #endif - error = shm_delete_mapping(p->p_vmspace, shmmap_s); - return (error); + return (shm_delete_mapping(p->p_vmspace, shmmap_s)); } #ifndef _SYS_SYSPROTO_H_ @@ -441,7 +441,6 @@ kern_shmctl_locked(struct thread *td, in if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) return (ENOSYS); - error = 0; switch (cmd) { /* * It is possible that kern_shmctl is being called from the Linux ABI @@ -550,10 +549,10 @@ struct shmctl_args { int sys_shmctl(struct thread *td, struct shmctl_args *uap) { - int error = 0; + int error; struct shmid_ds buf; size_t bufsz; - + /* * The only reason IPC_INFO, SHM_INFO, SHM_STAT exists is to support * Linux binaries. If we see the call come through the FreeBSD ABI, @@ -568,11 +567,11 @@ sys_shmctl(struct thread *td, struct shm if ((error = copyin(uap->buf, &buf, sizeof(struct shmid_ds)))) goto done; } - + error = kern_shmctl(td, uap->shmid, uap->cmd, (void *)&buf, &bufsz); if (error) goto done; - + /* Cases in which we need to copyout */ switch (uap->cmd) { case IPC_STAT: @@ -894,7 +893,7 @@ shminit(void) static int shmunload(void) { - int i; + int i; if (shm_nused > 0) return (EBUSY); @@ -995,8 +994,7 @@ oshmctl(struct thread *td, struct oshmct outbuf.shm_ctime = shmseg->u.shm_ctime; outbuf.shm_handle = shmseg->object; SYSVSHM_UNLOCK(); - error = copyout(&outbuf, uap->ubuf, sizeof(outbuf)); - return (error); + return (copyout(&outbuf, uap->ubuf, sizeof(outbuf))); #else return (EINVAL); #endif @@ -1021,14 +1019,12 @@ struct shmsys_args { int sys_shmsys(struct thread *td, struct shmsys_args *uap) { - int error; if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) return (ENOSYS); if (uap->which < 0 || uap->which >= nitems(shmcalls)) return (EINVAL); - error = (*shmcalls[uap->which])(td, &uap->a2); - return (error); + return ((*shmcalls[uap->which])(td, &uap->a2)); } #endif /* i386 && (COMPAT_FREEBSD4 || COMPAT_43) */ @@ -1087,7 +1083,7 @@ int freebsd7_freebsd32_shmctl(struct thread *td, struct freebsd7_freebsd32_shmctl_args *uap) { - int error = 0; + int error; union { struct shmid_ds shmid_ds; struct shm_info shm_info; @@ -1114,11 +1110,11 @@ freebsd7_freebsd32_shmctl(struct thread CP(u32.shmid_ds32, u.shmid_ds, shm_dtime); CP(u32.shmid_ds32, u.shmid_ds, shm_ctime); } - + error = kern_shmctl(td, uap->shmid, uap->cmd, (void *)&u, &sz); if (error) goto done; - + /* Cases in which we need to copyout */ switch (uap->cmd) { case IPC_INFO: @@ -1172,7 +1168,7 @@ done: int freebsd32_shmctl(struct thread *td, struct freebsd32_shmctl_args *uap) { - int error = 0; + int error; union { struct shmid_ds shmid_ds; struct shm_info shm_info; @@ -1184,7 +1180,7 @@ freebsd32_shmctl(struct thread *td, stru struct shminfo32 shminfo32; } u32; size_t sz; - + if (uap->cmd == IPC_SET) { if ((error = copyin(uap->buf, &u32.shmid_ds32, sizeof(u32.shmid_ds32)))) @@ -1199,11 +1195,11 @@ freebsd32_shmctl(struct thread *td, stru CP(u32.shmid_ds32, u.shmid_ds, shm_dtime); CP(u32.shmid_ds32, u.shmid_ds, shm_ctime); } - + error = kern_shmctl(td, uap->shmid, uap->cmd, (void *)&u, &sz); if (error) goto done; - + /* Cases in which we need to copyout */ switch (uap->cmd) { case IPC_INFO: @@ -1270,11 +1266,11 @@ struct freebsd7_shmctl_args { int freebsd7_shmctl(struct thread *td, struct freebsd7_shmctl_args *uap) { - int error = 0; + int error; struct shmid_ds_old old; struct shmid_ds buf; size_t bufsz; - + /* * The only reason IPC_INFO, SHM_INFO, SHM_STAT exists is to support * Linux binaries. If we see the call come through the FreeBSD ABI, @@ -1297,7 +1293,7 @@ freebsd7_shmctl(struct thread *td, struc CP(old, buf, shm_dtime); CP(old, buf, shm_ctime); } - + error = kern_shmctl(td, uap->shmid, uap->cmd, (void *)&buf, &bufsz); if (error) goto done; From owner-svn-src-head@freebsd.org Thu Jul 2 19:17:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2337F9933D0; Thu, 2 Jul 2015 19:17:54 +0000 (UTC) (envelope-from amesh@juniper.net) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0110.outbound.protection.outlook.com [157.56.110.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 631361B5E; Thu, 2 Jul 2015 19:17:53 +0000 (UTC) (envelope-from amesh@juniper.net) Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; Received: from juniper.net (66.129.239.11) by BL2PR05MB179.namprd05.prod.outlook.com (10.242.198.18) with Microsoft SMTP Server (TLS) id 15.1.201.16; Thu, 2 Jul 2015 19:17:45 +0000 Date: Thu, 2 Jul 2015 12:17:35 -0700 From: Arthur Mesh To: Adrian Chadd CC: "Simon J. Gerraty" , Mark R V Murray , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Steve Kiernan Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150702191735.GK90166@juniper.net> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> <284B5FB4-F487-4FBA-ABE6-D163065AFD1B@FreeBSD.org> <322.1435863348@chaos> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="YRGgq4HRInt36X2w" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [66.129.239.11] X-ClientProxiedBy: BLUPR0401CA0038.namprd04.prod.outlook.com (25.162.114.176) To BL2PR05MB179.namprd05.prod.outlook.com (10.242.198.18) X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB179; 2:5Mkft6hWZGNsy05g2eDI+ajqgBBJaSQDU0T/e99/ZxfeCuw8ig8ns5O0Lj21tcuR; 3:P6T1YOQ6dr2BD5YuesCCtrl8ARM/o2lhUDaVwMsRyxHq1WAmsNTIXfSWt/nC2iAKEl/HMgNYbiVkn3N60WWYF57awqwOooJC1hlymZ5NZCyGdHvbDmI7vlIL/kRPBqeZaD/dECfu8p9LvqTzwpt4yw==; 25:CAj6qmYm0MOjqr78d8cShjm3x537Dicd3XBCG6eKIn0gwMY2KSZBSaysSxunxTP0xDyKzDEJNxigYCqaaSyi/CoHcToozHsZ9bBKAvcD+uii82AdkQH/HmvCItvJ8oJJOBmKyxz46bNBhFwA6XJ0V+OHhEQuxQAYg995Fw9OrP2mi2EW4alU8IK64qfbTuskJDXF9C6amwGEGfqF2PjkCYgPRu2HTaGUo9QzbSlZxrMGhhTSImxtasJWGo1PxHzf9kocA3L2Jd4l7Ttm2UYTIw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR05MB179; X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB179; 20:s3/jmiv39xGcIan7g9M1BEwZi4AS4AFIeVsfe9YX8vliXCPGNJNSHcGkG1kDo/BCLmM2qKn4J81auVLxjPQL68yHmK5GxEXBgnmfoDz3WHgHkhZM1jKtJgj/WyxK2BAKGaU+6dnEuzJisFZNf/pA+l1tII7IWowKUMr6LdPRZUyyHr9LlkOV7rv51rXN0zG6BwgYmjh7v9j3YkusUWdV1SlYqH+bv0qpZSYR0W+E1ZLjzOZ5I9klyV4ba9cplnJ22HQ4lif4BrNU3jO5UHNyA3nHH2Tw2DF5arQ79JUAF5QaVWMDgOulMog45smtN6uAUtqGhpPpmISsV7T6/O5jg/lmFs9iKtZSwK5AF5YD4C4xnxIt1bKOqaALSzeJVAoafMaHupAOZPeMYMdcUiBOt48hxvgRYMuQuT7INQWBEWG8yzKmUK1BT/pi0uuweT/cPNogL35FCoP8ASPKXFZOrgvi4VaW9YRw45iLArqxMtY/si1zxgJoyZJp2LFzN6FC; 4:8mxXdb2t5uu6MbiNsbJUW0cX+g0uO9k3QY2ETSMMVSnp5OsQT8ijxDg9zt8eT/Iw5f6cW5gz506MR8kX7asaGNVHTMRj6kgcT4ZEPh2E6sEfDnhSLOlF6yiLIBkrW8NEt4nVK3uYwXATafDPjAF7DrEG1hWijiByrvwR/CAwOyhg/UAhdq+uAHhMpWSFN+8fgmVRCqafukP3bJSzf0ofVJ+56j+vRgpoKfS7+Eu4PT1Drwz665i9uLUxcHnOk8Vl2S3ioRqyreCd6cPZ1/gg5h9qTBHMDmaTe2NEO01zvaM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BL2PR05MB179; BCL:0; PCL:0; RULEID:; SRVR:BL2PR05MB179; X-Forefront-PRVS: 06259BA5A2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(24454002)(512954002)(66066001)(33026002)(86362001)(42186005)(93886004)(2950100001)(33656002)(19580395003)(50986999)(83506001)(77096005)(76176999)(19580405001)(54356999)(84326002)(87976001)(122386002)(40100003)(46102003)(5001920100001)(4001350100001)(77156002)(62966003)(92566002)(189998001)(107886002)(5001960100002)(36756003)(110136002)(5000100001)(2700100001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR05MB179; H:juniper.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR05MB179; 23:tXCmochpyBglZi0CrcBvWQt9VFGv20u6ixEAfcrzAb?= =?us-ascii?Q?eRWRplE0zG9Q3Rg3JfKwunlbNVVRmBbXtgfDX6yCM2w3TLCrmjzAwATyChNg?= =?us-ascii?Q?YbTrAqRAkhkWWWauwOg11skSa3ZdcW41XP1VVNmEtiiQcTaSXad9/03fzZwQ?= =?us-ascii?Q?P+hk+7zNiXt8dsFRDMXxVmqDPY/pK+8OqzQMpVC8H4R3/bpdn4/hEplFBDGz?= =?us-ascii?Q?kseLeV9LUCWo+EoAGfftYysGw4s4gHN0DNMXiA7Ka1Pj/N0m9a64evob8fxe?= =?us-ascii?Q?zkDifeE8v+uvHJ34hfSO4N1GYQbizNLR45glcMhedFaBM5VwOawDzSsbfOGW?= =?us-ascii?Q?UoHHLyk0ZceDwSxvEtYzzAUqrVlg/BPKzvwCCZ72PZoexG/fgFlsUx53BKU9?= =?us-ascii?Q?aG6EoS2LgC/8znJhx1yQPyLee6gYZSbkUFP6AxEiATkfSgvKWH1IgkBVN9tN?= =?us-ascii?Q?8sVXRSw+4BKucopn9ZdKURlICxQBQq+15iBVUVU2lZ88bWXdViRf4730CtP5?= =?us-ascii?Q?IrbWIDM/GwYNybEBSQs/mOpJtxXwCIYbEE9CJHgtxSVe73sPqVt1z5xWxHVP?= =?us-ascii?Q?6qOpcfHr5xA3TIqcz3C3JA2qifkeKpYHijf50SuEPjtG34AGodFX7s7i3KNF?= =?us-ascii?Q?GYrO/QtSvCqhbCLAguv5IaVeMZzepjtgFvIM1ocoii4YlhWtB6Uxp5pSjtt/?= =?us-ascii?Q?Vsv3y5MldcuB8OXqp4vfJUqGqUqTnAo2eSLW5TKbM/5MRJeuixQDEQBW1vxX?= =?us-ascii?Q?22xXS92opH2FCNRcN7uOBlLTY0jZLXDwpawtk7BpIOrcjbD7DaRDL1g6pjWU?= =?us-ascii?Q?n0+6Q54GMJ/ir7NTsXUy7d0m+h//5JmE1EHrwfSoDtK3x8ZJ1G+c4R42/r+Z?= =?us-ascii?Q?nBPTcAl3N+6PY33yKZvdPlWJuSbc7xGc1qtTaERqDpvz2ErSpaLJTtaatahO?= =?us-ascii?Q?2k4FV3pp4FyF47971WP5NEiNMKboR42L2mjDJGSA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB179; 5:/qxTykkYlGPoJNJ9sS1qLvvEfPn+yNGkPLbHtLnvn2fR5HTpGuf+bLBVMKDsTT8a3jGR9pAwoEdXgIwtCwWV1WTrvTuApjU89EmDHRrjqAW2sEzbDihuhJvaNMnMh1PbSnyK6BGX94ANFEZ/LbkBTA==; 24:5NdFCy8WcwR3hacNQX3xWI5wS7ycZTyNovaeUS4qFuxyl3JznTKVqUfEpT+Y5LqOGPQcAMoRCL18b0naRFWtGCe7kbupLX2oxulnAMlXcKs=; 20:OOgCxC8bIX7R/YCKfahjKObonYU7nTCdqMUIQjFBD4e2pO0ch6AgINFbcgbHDhZ9c6E/z3lP/iGS7MnQz1jCeQ== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2015 19:17:45.0488 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR05MB179 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:17:54 -0000 --YRGgq4HRInt36X2w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 02, 2015 at 12:13:54PM -0700, Adrian Chadd wrote: > Could we please get something like this implemented in upstream > FreeBSD? I'm sure a number of vendors would like to see a (not by > default) FIPS-140 random number generator provided. It'd certainly be > a good check list item for people evaluating the use of freebsd in an > appliance. Adrian, Absolutely, once our FIPS lab approves our implementation. Otherwise, it may cause more harm than good. --=20 Arthur Mesh Juniper Networks +1 408 936-4968 --YRGgq4HRInt36X2w Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQGcBAABCAAGBQJVlY5OAAoJEAi6IWerhQY4hlwL+wR5w2yCtvd72BQBZhRu7A/J RDGBq+EP+S0rR/cuwgrhYGhHC02BEJVmFffwRUH0J/EW1BLquoXdjZw4/nLtEM9f 1r7f/qFTYb0cP6FN5bKoeJFGEXcDzT1Y1yxDGUs5fNoiVjPG42NKgOA7tAayP8dK ujilqbSyTbA+iMFiBbWz7G1ukeCc9Mfy8/87U73vSduUun4UDIOeuQj5xHx3gfxB QqvXtRHKlgi/LZhbWcQpJZpISYkWm+RKQKFu8NiqplSSJUVxaTB2i80Wcb9S/N9G yospnWWQqIukMsbuLirg0EcXXNJKVhTpXedu9Pae911inmaxCyJEo2WDHxq9LTOx AmxTX/+P9miWzC60LKu4kOGjy7U/qExrsgBhPB5i8B1vRYjcKYRBbzlliK6+DQU4 RLOqlR1wHJbdJxQQwzr9d8d9Povcji7E/RTHyY3Z+eJ04koUyINR7uRj+AZnDMS4 v/FIRXI5ak+03l19P99C1eTa7oh53Cka6uR+QJsLaw== =gudi -----END PGP SIGNATURE----- --YRGgq4HRInt36X2w-- From owner-svn-src-head@freebsd.org Thu Jul 2 19:20:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40E09993445; Thu, 2 Jul 2015 19:20:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11DFD1E11; Thu, 2 Jul 2015 19:20:21 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by ieqy10 with SMTP id y10so63624001ieq.0; Thu, 02 Jul 2015 12:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gEKbvUgtX3dWpoeNJ+SFfYOdblaC+K85rQULvY4nUjM=; b=nNTVQfwOWNfPv4t7M2epOMxANcuGNLGErQd8l8tr1wLwwdXFof2KkIiZiK50UCjyfr PTYKVkMr47jMeRQVlCghNacX3HHChQ31m9TE2Za/gs1n2B8m84XJXWkY7g6GwC+Z+Gj3 eN/FuOOgNsuMSYPZHaQc+vdXmFrFpqxK1+6ovnHfi84ZY5nF8rA1inATS2+sH+v/zUPQ k9BiGeB8a4+myiV7DcVZAA28v6nsJN0497w9bKbcHwOgp4mdUjKg5tQaE67AEkp7C/F3 ZnjcqOO9DmbIQl56gpqWew8TZp1kZNW6q4TQ6E/Z4VF/17/TJaAjODpDusFOhoZw9cI+ UyQw== MIME-Version: 1.0 X-Received: by 10.50.134.196 with SMTP id pm4mr43399744igb.6.1435864821120; Thu, 02 Jul 2015 12:20:21 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Thu, 2 Jul 2015 12:20:21 -0700 (PDT) In-Reply-To: <20150702191735.GK90166@juniper.net> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> <284B5FB4-F487-4FBA-ABE6-D163065AFD1B@FreeBSD.org> <322.1435863348@chaos> <20150702191735.GK90166@juniper.net> Date: Thu, 2 Jul 2015 12:20:21 -0700 Message-ID: Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... From: Adrian Chadd To: Arthur Mesh Cc: "Simon J. Gerraty" , Mark R V Murray , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Steve Kiernan Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:20:22 -0000 On 2 July 2015 at 12:17, Arthur Mesh wrote: > On Thu, Jul 02, 2015 at 12:13:54PM -0700, Adrian Chadd wrote: >> Could we please get something like this implemented in upstream >> FreeBSD? I'm sure a number of vendors would like to see a (not by >> default) FIPS-140 random number generator provided. It'd certainly be >> a good check list item for people evaluating the use of freebsd in an >> appliance. > > Adrian, > > Absolutely, once our FIPS lab approves our implementation. Otherwise, it > may cause more harm than good. That'd be fantastic, thanks! -a From owner-svn-src-head@freebsd.org Thu Jul 2 19:21:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99E1899355B; Thu, 2 Jul 2015 19:21:30 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AD8E2029; Thu, 2 Jul 2015 19:21:30 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62JLUll040521; Thu, 2 Jul 2015 19:21:30 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62JLT6p040517; Thu, 2 Jul 2015 19:21:29 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201507021921.t62JLT6p040517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Thu, 2 Jul 2015 19:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285058 - in head/sys: dev/proto modules/proto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:21:30 -0000 Author: marcel Date: Thu Jul 2 19:21:29 2015 New Revision: 285058 URL: https://svnweb.freebsd.org/changeset/base/285058 Log: Add an ISA/ACPI bus attachment to proto(4). Added: head/sys/dev/proto/proto_bus_isa.c (contents, props changed) Modified: head/sys/dev/proto/proto_core.c head/sys/modules/proto/Makefile Added: head/sys/dev/proto/proto_bus_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/proto/proto_bus_isa.c Thu Jul 2 19:21:29 2015 (r285058) @@ -0,0 +1,121 @@ +/*- + * Copyright (c) 2015 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +static int proto_isa_probe(device_t dev); +static int proto_isa_attach(device_t dev); + +static device_method_t proto_isa_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, proto_isa_probe), + DEVMETHOD(device_attach, proto_isa_attach), + DEVMETHOD(device_detach, proto_detach), + DEVMETHOD_END +}; + +static driver_t proto_isa_driver = { + proto_driver_name, + proto_isa_methods, + sizeof(struct proto_softc), +}; + +static int +proto_isa_probe(device_t dev) +{ + struct sbuf *sb; + struct resource *res; + int rid, type; + + rid = 0; + type = SYS_RES_IOPORT; + res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); + if (res == NULL) { + type = SYS_RES_MEMORY; + res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); + } + if (res == NULL) + return (ENODEV); + + sb = sbuf_new_auto(); + sbuf_printf(sb, "isa:%#lx", rman_get_start(res)); + sbuf_finish(sb); + device_set_desc_copy(dev, sbuf_data(sb)); + sbuf_delete(sb); + bus_release_resource(dev, type, rid, res); + return (BUS_PROBE_HOOVER); +} + +static int +proto_isa_alloc(device_t dev, int type, int nrids) +{ + struct resource *res; + struct proto_softc *sc; + int count, rid; + + sc = device_get_softc(dev); + count = 0; + for (rid = 0; rid < nrids; rid++) { + res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); + if (res == NULL) + break; + proto_add_resource(sc, type, rid, res); + count++; + } + if (type == SYS_RES_DRQ && count > 0) + proto_add_resource(sc, PROTO_RES_BUSDMA, 0, NULL); + return (count); +} + +static int +proto_isa_attach(device_t dev) +{ + + proto_isa_alloc(dev, SYS_RES_IRQ, ISA_NIRQ); + proto_isa_alloc(dev, SYS_RES_DRQ, ISA_NDRQ); + proto_isa_alloc(dev, SYS_RES_IOPORT, ISA_NPORT); + proto_isa_alloc(dev, SYS_RES_MEMORY, ISA_NMEM); + return (proto_attach(dev)); +} + +DRIVER_MODULE(proto, acpi, proto_isa_driver, proto_devclass, NULL, NULL); +DRIVER_MODULE(proto, isa, proto_isa_driver, proto_devclass, NULL, NULL); Modified: head/sys/dev/proto/proto_core.c ============================================================================== --- head/sys/dev/proto/proto_core.c Thu Jul 2 19:14:30 2015 (r285057) +++ head/sys/dev/proto/proto_core.c Thu Jul 2 19:21:29 2015 (r285058) @@ -54,12 +54,15 @@ __FBSDID("$FreeBSD$"); #include CTASSERT(SYS_RES_IRQ != PROTO_RES_UNUSED && + SYS_RES_DRQ != PROTO_RES_UNUSED && SYS_RES_MEMORY != PROTO_RES_UNUSED && SYS_RES_IOPORT != PROTO_RES_UNUSED); CTASSERT(SYS_RES_IRQ != PROTO_RES_PCICFG && + SYS_RES_DRQ != PROTO_RES_PCICFG && SYS_RES_MEMORY != PROTO_RES_PCICFG && SYS_RES_IOPORT != PROTO_RES_PCICFG); CTASSERT(SYS_RES_IRQ != PROTO_RES_BUSDMA && + SYS_RES_DRQ != PROTO_RES_BUSDMA && SYS_RES_MEMORY != PROTO_RES_BUSDMA && SYS_RES_IOPORT != PROTO_RES_BUSDMA); @@ -132,6 +135,8 @@ proto_attach(device_t dev) case SYS_RES_IRQ: /* XXX TODO */ break; + case SYS_RES_DRQ: + break; case SYS_RES_MEMORY: case SYS_RES_IOPORT: r->r_size = rman_get_size(r->r_d.res); @@ -185,6 +190,10 @@ proto_detach(device_t dev) bus_release_resource(dev, r->r_type, r->r_rid, r->r_d.res); break; + case SYS_RES_DRQ: + bus_release_resource(dev, r->r_type, r->r_rid, + r->r_d.res); + break; case SYS_RES_MEMORY: case SYS_RES_IOPORT: bus_release_resource(dev, r->r_type, r->r_rid, Modified: head/sys/modules/proto/Makefile ============================================================================== --- head/sys/modules/proto/Makefile Thu Jul 2 19:14:30 2015 (r285057) +++ head/sys/modules/proto/Makefile Thu Jul 2 19:21:29 2015 (r285058) @@ -4,6 +4,7 @@ KMOD= proto SRCS= \ + proto_bus_isa.c \ proto_bus_pci.c \ proto_busdma.c \ proto_core.c @@ -11,10 +12,12 @@ SRCS= \ SRCS+= \ bus_if.h \ device_if.h \ - pci_if.h \ + isa_if.h \ + pci_if.h MFILES= \ dev/pci/pci_if.m \ + isa/isa_if.m \ kern/bus_if.m \ kern/device_if.m From owner-svn-src-head@freebsd.org Thu Jul 2 19:21:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A96E993586; Thu, 2 Jul 2015 19:21:41 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7EB6217D; Thu, 2 Jul 2015 19:21:40 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZAk3F-0003Hf-UH; Thu, 02 Jul 2015 20:21:38 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <20150702184255.GH90166@juniper.net> Date: Thu, 2 Jul 2015 20:21:31 +0100 Cc: "Simon J. Gerraty" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, stevek@juniper.net Content-Transfer-Encoding: quoted-printable Message-Id: <0B29F349-FB7C-4B71-A792-CE304FF72206@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> <20150702184255.GH90166@juniper.net> To: Arthur Mesh X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:21:41 -0000 > On 2 Jul 2015, at 19:42, Arthur Mesh wrote: >=20 > On Thu, Jul 02, 2015 at 11:36:27AM -0700, Simon J. Gerraty wrote: >>> Sound like you just need to be able to select a single KLD at boot = time? >>=20 >> Quite possibly. >>=20 >> Will confirm... >=20 > Hello, >=20 > We need to be able to select a random adaptor at load time. I.e. = loader > is the one selecting it based on configuration. >=20 > I.e., if the box is configured to boot in FIPS mode, it should use = NIST > SP800-90 HMAC-DRBG adaptor. Otherwise, it uses the default FreeBSD > adaptor (Fortuna I guess). No problem! Could you please let me know your implementation=E2=80=99s API? If I = have that, or at least an approximation, I can make a framework in which you can insert your code. > We do not need ability to switch adaptors at run-time. Excellent. This has been causing trouble for me for ages. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Thu Jul 2 19:22:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29A7D9935F7; Thu, 2 Jul 2015 19:22:39 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDA59242B; Thu, 2 Jul 2015 19:22:38 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZAk4B-0003Hf-P1; Thu, 02 Jul 2015 20:22:37 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=us-ascii From: Mark R V Murray In-Reply-To: <322.1435863348@chaos> Date: Thu, 2 Jul 2015 20:22:35 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, amesh@juniper.net, stevek@juniper.net Content-Transfer-Encoding: 7bit Message-Id: <7BE13556-EBB9-45A1-92B4-D137F4391E7E@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> <284B5FB4-F487-4FBA-ABE6-D163065AFD1B@FreeBSD.org> <322.1435863348@chaos> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:22:39 -0000 > On 2 Jul 2015, at 19:55, Simon J. Gerraty wrote: > > Mark R V Murray wrote: >> If so, can I confirm that you may be rolling your own non-Yarrow/Fortuna >> mixer(s)? > > AFAIK no mixer allowed; just direct SP800-90 compliant HMAC-DRBG. > You can probably guess why we don't agree that's a brilliant arrangement > but its not an argument we can win. IIRC, that still requires some stochastic input? > Same would apply for anyone else doing FIPS 140 evaled products. Sure. M -- Mark R V Murray From owner-svn-src-head@freebsd.org Thu Jul 2 19:28:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8835399365C; Thu, 2 Jul 2015 19:28:35 +0000 (UTC) (envelope-from amesh@juniper.net) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0117.outbound.protection.outlook.com [65.55.169.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5B0825F5; Thu, 2 Jul 2015 19:28:34 +0000 (UTC) (envelope-from amesh@juniper.net) Authentication-Results: freebsd.org; dkim=none (message not signed) header.d=none; Received: from juniper.net (66.129.239.11) by BL2PR05MB180.namprd05.prod.outlook.com (10.242.198.20) with Microsoft SMTP Server (TLS) id 15.1.201.16; Thu, 2 Jul 2015 19:28:25 +0000 Date: Thu, 2 Jul 2015 12:28:19 -0700 From: Arthur Mesh To: Mark R V Murray CC: "Simon J. Gerraty" , , , , Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150702192819.GL90166@juniper.net> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> <20150702184255.GH90166@juniper.net> <0B29F349-FB7C-4B71-A792-CE304FF72206@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Og24Z7r1sh+tVSZX" Content-Disposition: inline In-Reply-To: <0B29F349-FB7C-4B71-A792-CE304FF72206@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [66.129.239.11] X-ClientProxiedBy: CY1PR16CA0012.namprd16.prod.outlook.com (25.162.134.150) To BL2PR05MB180.namprd05.prod.outlook.com (10.242.198.20) X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB180; 2:8AEmbV3ZydNpx97R6YvCGlL9v0LMiyYywywpjMDswX8ZD7JumYs3QFMIZ/42zPNp; 3:q6w3NYv1Grs4MnLTAm0+cpWe5xSvf1MhCwhIMwYSpJQ2PJTeh+DPZSa8fsrre8vOe9r2Ne9+Qm+w+nXWShaTGNtvPZ/nbApf96DSiafIXoeS320Z9+J/I3jxuSBaGYtFOtns1so5O6zLYrFxIOPCKw==; 25:cRguAN7q4l/nQEVhNLUVoI/mMKtQQGwSwFsbLlqHqOww+fwGmdlVvMzNFKVkS8xx1d+iYLak+PMp9hu9rFftsj/0av8NxtREQHiMsJhv1A3mi990Xy61D8kwSxnvZUMxs88BNKcfQqPJxGNgIku0iSAIi4wrXwzbgNR8pQMZl9+cVRZj2TgGvJ4n6dcQ2ttYhYhVFQv0RXTDkrrbzRaxXubBwlgvmlEN2BN9wU6x2FIHRavfZaHEurnv9SzoLcEi/I354XssaOzLwvgDC1m2mQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR05MB180; X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB180; 20:Rz74pCx4xK26USmwCxo+15Nb1y0bS8uy84sCgNfAgtL4AcnmNY47x9tqRpoUnjrq2hkEmDVRO5Arf5DcbQe0s1e5NN5KbBvvsr+kDav5ZzyAbNs9W9yfFxZVkTbMfHn7lZVPttbKCBlUzCiIPMQK56DgihqChHn2NKk4DuQqlwrhqDEVQohXIHoNJ8BdQ4b3yfxW/MFO8dX7CvBz92yvQKdf/Ipep+rThe+cvgFH8/ljG4FakDhd3Nwu7Qoorp0v5uWE9RL+om3oGT4w6lY1tHSOJNsgHK8LSmaQjKCcm1zY8+0ujqSM695JMF+f7E7B6ikD+Whp45KlgI+PeYM327rkczGhfnvtTphYHan51U5qierwR1MkGcWnTrSJWVXZukfz9yo9Qrn2l2C7KpV6ILOLVKwXqnjejKBzI1UN3PuUVBeVav5nMZgGsDEsTGTORhy5S2BkI1P2131fIqIqbmfva0OlsC5UWXO6h87mVG9WnWG+8KbxHQLsJpKRoRfE; 4:q91sP9M4C1eaKeaSxgb+MBNcHt5nY+t+m5F06g/9Sokw5lWeuJICk8HDylIBoWRJQk3KZDGORW30hGKpmcE1Uh8/h0tXmXcQz0B555UVSDYoBTtsfnODE5Q9/HNJ8OIsORIEgTeTzIBs/7tuBKFiq1OvExQgocI2xS2Wd3vpxyRWXDCr27jQR9F2j4kI+ShaJMQt97D9vBeeC/XCfRKwBEnYjOkQA+cGMLmr8g7lfHW71OZOWsBJlxobAJZsbL02AwIOM1VUQTDMgW1j1YvDDSwO+0JDMlfaR0LjLTL0nwU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BL2PR05MB180; BCL:0; PCL:0; RULEID:; SRVR:BL2PR05MB180; X-Forefront-PRVS: 06259BA5A2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(24454002)(51704005)(479174004)(77156002)(62966003)(2950100001)(40100003)(77096005)(450100001)(122386002)(46102003)(93886004)(42186005)(19580405001)(19580395003)(76176999)(36756003)(33656002)(84326002)(83506001)(54356999)(87976001)(50986999)(92566002)(512954002)(5001960100002)(107886002)(33026002)(86362001)(4001350100001)(5001920100001)(110136002)(189998001)(66066001)(5890100001)(4001430100001)(2700100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR05MB180; H:juniper.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR05MB180; 23:CWNq3ZWTuEl93b/2cjoO7Zt1FgHsYKtFrhOv8gWD51?= =?us-ascii?Q?1vgOxEQ2bZqEyLmjKerX4ZnN/C2bukYz0fFjIwLvsI8bzH5eD6mPt2k9w2N+?= =?us-ascii?Q?sdfS2/SIa2g8O647HTB7bxj/dp7PD6ChzyXBeCvAhvUwJO+5Znla84Z35Lwk?= =?us-ascii?Q?Fge0hLoO4KfrcH+Xn7sKvKdMXkxx49P5MizjFs2v0VQjhYHkL7fAxYpaMA00?= =?us-ascii?Q?EsIc1IHpuH6iSm3ojKWYWpEzL+3rNIIvu4v/9wHwCbiymQb5E0HB5MFB201/?= =?us-ascii?Q?ZIz5FcM7LWHasszrIVzDmFwnvCiDvTpRru1hM413/BQsKDjtmRtCTvnkdsVv?= =?us-ascii?Q?kmsF6ynWveZMHG7MupHvrA7Hu9pN0bXGl9iKKeg83S4d+cTo3LXX7wGeyG8S?= =?us-ascii?Q?+TwMRCAdo/wxlsFYKPBT5PHS1yjqEpBMVnWvp13/AxXJHkFOOUqV02VPj0li?= =?us-ascii?Q?Z6dgik2BV2niJDfEmf9t7svJ296bzfRnEhE75g3POSbjdpGvgj+fe5I2kL4V?= =?us-ascii?Q?4Kf0IrPz41OYOhehxk/HgaL3r0HVkiXQB8MZDlayj8sCShHE2w/8diR2JKZ6?= =?us-ascii?Q?2zvIqlpUT1hB+pxV6BblQFNBEFqdCTfSWLKuEJBt7X2G/pkROndiHhufUsNC?= =?us-ascii?Q?sOBFOP/bEkPJSE9mDYcgWw/LEE1OhqZ5CGx14Oc85sV9eGshRPw8E5LOBdqs?= =?us-ascii?Q?W34shNnngtKdkM4jN16rDyu6jNprQF1Me7Sw6GLNMjT1Jw8YfHgzCR/m7zvM?= =?us-ascii?Q?NLeqp/j0exkAzBfQq4wt/SSrtLktonkV68LyPi1UfEL+iyotuVc20WLnYrd5?= =?us-ascii?Q?C1KbeDer58Z5W1OhqJ/+O2q7i9EB+Hf7FcggJs2rxn9GrJ0VDG0U2/VETecY?= =?us-ascii?Q?8S0TAJ+yjtX1kF6i9FY2COYsDuOYiIqlsGlO+lzd/LyWViKJVAU8MkdgMoUw?= =?us-ascii?Q?ps3LXo8upQtn8hAhSujaT8d8Taw3WmzbNNKQ/aIeOc15igq2NBbVTqNNy0LZ?= =?us-ascii?Q?ERfQ2PYDXfkp74gbv6Qle/Mt5W1dpM732muDQZeBmFIasGjs0WTeGYP9Q/xq?= =?us-ascii?Q?rGZ0E=3D?= X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB180; 5:AshRHaM8rrncnPTP6TjBA5Vs71quyMGUs2WZ3cUY+bT8jM7iu7mpYUTXzkDcRpN2CHtibi2Jsf1uwxbjAP771uNcv3Ptc0Uigoy9bFe0qWD2388W2ErgJ2WK44neokuTAZOWQLpX6V3CE/DLApUS6g==; 24:9DghYsQ4XPhV6A7ctfhZxpYG0E20tQuKobdJmOa366NXrJV7Byam6TpPu5ik9eisCso9iPYcso1CnwMaT1tZrjRUorxCXFOTFSiLY6pWpxg=; 20:oDatdTxWapRXYC6eo33FTlVcP+v8PvecXQecfG6oeTnxm8aWU5wifeNC4w0txVEHhNmuRkTOyhuJ5TFg5dLy6Q== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2015 19:28:25.0746 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR05MB180 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:28:35 -0000 --Og24Z7r1sh+tVSZX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 02, 2015 at 08:21:31PM +0100, Mark R V Murray wrote: > > I.e., if the box is configured to boot in FIPS mode, it should use NIST > > SP800-90 HMAC-DRBG adaptor. Otherwise, it uses the default FreeBSD > > adaptor (Fortuna I guess). >=20 > No problem! >=20 > Could you please let me know your implementation???s API? If I have that, > or at least an approximation, I can make a framework in which you can > insert your code. Sure, Here is the shim between HMAC_DRBG and struct random_adaptor (that used to plug-in before removal on 2015/6/30). /* * $Id: $ * * Copyright (c) 2014, Juniper Networks, Inc. * All rights reserved. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "hmac.h" #include "hmac_shim.h" #include "hmac_drbg.h" #include "hmac_drbg_adaptor.h" #include "health_tests.h" #include "debug.h" /* * The context mutex protects the consistency of the hmac_drbg state */ struct mtx drbg_mtx; static int hmac_drbg_security_level =3D 256; /* * hmac_drbg context */ static struct random_hmac_drbg_s drbg_ctx; static void random_hmac_drbg_init(void); static void random_hmac_drbg_deinit(void); static int random_hmac_drbg_block(int); static int random_hmac_drbg_read(void *, int); static void random_hmac_drbg_write(void *, int); static int random_hmac_drbg_poll(int, struct thread *); static void random_hmac_drbg_reseed(void); void random_hmac_drbg_unblock(void); struct random_adaptor random_hmac_drbg =3D { .ident =3D "Software, HMAC DRBG, NIST 800-90A", .init =3D random_hmac_drbg_init, .deinit =3D random_hmac_drbg_deinit, .block =3D random_hmac_drbg_block, .read =3D random_hmac_drbg_read, .poll =3D random_hmac_drbg_poll, .reseed =3D random_hmac_drbg_reseed, .seeded =3D 0, }; /* entropy bit counter */ uint64_t random_hmac_drbg_ecount; void random_hmac_drbg_unblock(void) { if (!random_hmac_drbg.seeded) { random_hmac_drbg.seeded =3D 1; selwakeuppri(&random_hmac_drbg.rsel, PUSER); wakeup(&random_hmac_drbg); } } static void hmac_drbg_process_event(struct harvest *event) { /* If entropy health test fails, discard the entropy */ if (entropy_health_test(event) !=3D 0) { return; } /* * Feed noise in to our DRBG. * Performance optimization: even though not all fields in event are * entropic, it's much faster to call random_hmac_drbg_write() on the * whole struct, vs calling random_hmac_drbg_write() separately for * event->somecounter and event->entropy. */ random_hmac_drbg_write(event, sizeof(*event)); random_hmac_drbg_ecount +=3D event->bits; if (random_hmac_drbg_ecount >=3D hmac_drbg_security_level) random_hmac_drbg_unblock(); /* Unblock random(4) */ } void random_hmac_drbg_init(void) { int error; mtx_init(&drbg_mtx, "hmac_drbg context mutex", NULL, MTX_DEF); error =3D hmac_drbg_init(&drbg_ctx, NULL); KASSERT(error =3D=3D 0, ("hmac_drbg_init() failure: %d\n", error)); random_harvestq_init(hmac_drbg_process_event); /* Register the randomness harvesting routine */ randomdev_init_harvester(random_harvestq_internal, random_hmac_drbg_read); } static void random_hmac_drbg_deinit(void) { mtx_destroy(&drbg_mtx); } static int random_hmac_drbg_block(int flag) { int error =3D 0; mtx_lock(&drbg_mtx); while (!random_hmac_drbg.seeded && !error) { if (flag & O_NONBLOCK) error =3D EWOULDBLOCK; else { printf("Entropy device is blocking.\n"); error =3D msleep(&random_hmac_drbg, &drbg_mtx, PUSER | PCATCH, "block", 0); } } mtx_unlock(&drbg_mtx); return (error); } static int random_hmac_drbg_read(void *buf, int count) { int error; mtx_lock(&drbg_mtx); error =3D hmac_drbg_get_bytes(&drbg_ctx, buf, count); KASSERT(error !=3D -1, ("hmac_drbg_get_bytes() failure: %d\n", error)); mtx_unlock(&drbg_mtx); return(error !=3D -1 ? count : 0); } static void random_hmac_drbg_write(void *buf, int count) { int error; mtx_lock(&drbg_mtx); error =3D hmac_drbg_update(&drbg_ctx, buf, count); KASSERT(error =3D=3D 0, ("hmac_drbg_update() failure: %d\n", error)); mtx_unlock(&drbg_mtx); } static int random_hmac_drbg_poll(int events, struct thread *td) { int revents =3D 0; mtx_lock(&drbg_mtx); if (random_hmac_drbg.seeded) revents =3D events & (POLLIN | POLLRDNORM); else selrecord(td, &random_hmac_drbg.rsel); mtx_unlock(&drbg_mtx); return (revents); } static void random_hmac_drbg_reseed(void) { /* Command a entropy queue flush and wait for it to finish */ random_kthread_control =3D 1; while (random_kthread_control) pause("-", hz / 10); } static int random_hmac_drbg_modevent(module_t mod, int type, void *unused) { switch(type) { case MOD_LOAD: /* Initialize health tests */ health_tests_init(); random_adaptor_register("hmac-drbg", &random_hmac_drbg); /* * For statically built kernels that contain both device * random and options PADLOCK_RNG/RDRAND_RNG/etc.., * this event handler will do nothing, since the random * driver-specific handlers are loaded after these HW * consumers, and hence hasn't yet registered for this event. * * In case where both the random driver and RNG's are built * as seperate modules, random.ko is loaded prior to *_rng.ko's * (by dependency). This event handler is there to delay * creation of /dev/{u,}random and attachment of this *_rng.ko. */ EVENTHANDLER_INVOKE(random_adaptor_attach, &random_hmac_drbg); return (0); } return (EINVAL); } RANDOM_ADAPTOR_MODULE(random_hmac_drbg, random_hmac_drbg_modevent, 1); --=20 Arthur Mesh Juniper Networks +1 408 936-4968 --Og24Z7r1sh+tVSZX Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQGcBAABCAAGBQJVlZDSAAoJEAi6IWerhQY4CtwMAJQZR9oh8NW1lfEwiG7OL8j4 ntEbj1OGN8sZlkicYd5ak8VHElMi3zISEBrg3P9ayYyvHXte4fSpAP9mWin7UIHk 7IRHeYwJVc7HwnAhfoAY7dFa3s2OLmK7vSJ45OpqDR9UFHOXoxP6xYfBE+1G5Wqj oZ+5zV0BUquH7BmS8yuItSdP3uediudFkHr4umMfxzCC9Dxkt2gC6UVKryATezr/ 4QfVNsxMFvZJMowAt0tbJzZdFvRY+EcvlNLeRQadqeK4fIJKuQjtav84AA6YibyI egJ1e03qp2O0FRrUQi8zinNV7DslTCQYpRrWO2x9nNR3tfyz2ZWJQBdYSAzklGhE 3PKJJrx7TGQFYgbyj0qzz0fAFvcHYqnp13zcTdflPjfLywgWzK/LzezJUmFWYrPA H+UMHSSptYhb9WXNGRSmcwiV9ZQhReehOiyx00t+De/1GBJF/k5glSeG+3eUqR9S jRpH8apyUNvRhQW2uc2dOjQd1mUmnTJ+TEidR43c2g== =wkT8 -----END PGP SIGNATURE----- --Og24Z7r1sh+tVSZX-- From owner-svn-src-head@freebsd.org Thu Jul 2 19:30:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83FD59936DE; Thu, 2 Jul 2015 19:30:38 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B84E2935; Thu, 2 Jul 2015 19:30:38 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZAkBv-0003Ib-H3; Thu, 02 Jul 2015 20:30:35 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=us-ascii From: Mark R V Murray In-Reply-To: <20150702192819.GL90166@juniper.net> Date: Thu, 2 Jul 2015 20:30:29 +0100 Cc: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, stevek@juniper.net Content-Transfer-Encoding: 7bit Message-Id: <56E2ED3E-990C-4602-9D72-94E85646F061@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> <20150702184255.GH90166@juniper.net> <0B29F349-FB7C-4B71-A792-CE304FF72206@FreeBSD.org> <20150702192819.GL90166@juniper.net> To: Arthur Mesh X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:30:38 -0000 > On 2 Jul 2015, at 20:28, Arthur Mesh wrote: > > On Thu, Jul 02, 2015 at 08:21:31PM +0100, Mark R V Murray wrote: >>> I.e., if the box is configured to boot in FIPS mode, it should use NIST >>> SP800-90 HMAC-DRBG adaptor. Otherwise, it uses the default FreeBSD >>> adaptor (Fortuna I guess). >> >> No problem! >> >> Could you please let me know your implementation???s API? If I have that, >> or at least an approximation, I can make a framework in which you can >> insert your code. > > Sure, Here is the shim between HMAC_DRBG and struct random_adaptor (that > used to plug-in before removal on 2015/6/30). Magic, thank you! M -- Mark R V Murray From owner-svn-src-head@freebsd.org Thu Jul 2 19:41:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A69B4993A70; Thu, 2 Jul 2015 19:41:09 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98616101D; Thu, 2 Jul 2015 19:41:09 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62Jf9pe050283; Thu, 2 Jul 2015 19:41:09 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62Jf94W050282; Thu, 2 Jul 2015 19:41:09 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201507021941.t62Jf94W050282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Thu, 2 Jul 2015 19:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285059 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 19:41:09 -0000 Author: garga (ports committer) Date: Thu Jul 2 19:41:08 2015 New Revision: 285059 URL: https://svnweb.freebsd.org/changeset/base/285059 Log: Bump .Dd due to changes made in r285050 and r285053 Spotted by: loos Approved by: loos Modified: head/lib/libutil/pw_util.3 Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Thu Jul 2 19:21:29 2015 (r285058) +++ head/lib/libutil/pw_util.3 Thu Jul 2 19:41:08 2015 (r285059) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 06, 2015 +.Dd July 02, 2015 .Dt PW_UTIL 3 .Os .Sh NAME From owner-svn-src-head@freebsd.org Thu Jul 2 21:46:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AEA2992734; Thu, 2 Jul 2015 21:46:08 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BC3F14DD; Thu, 2 Jul 2015 21:46:08 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62Lk8Qd014310; Thu, 2 Jul 2015 21:46:08 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62Lk8ud014309; Thu, 2 Jul 2015 21:46:08 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201507022146.t62Lk8ud014309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 2 Jul 2015 21:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285062 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 21:46:08 -0000 Author: oshogbo Date: Thu Jul 2 21:46:07 2015 New Revision: 285062 URL: https://svnweb.freebsd.org/changeset/base/285062 Log: Add stddef.h for size_t typedef. Approved by: pjd (mentor) Modified: head/sys/sys/dnv.h Modified: head/sys/sys/dnv.h ============================================================================== --- head/sys/sys/dnv.h Thu Jul 2 21:36:51 2015 (r285061) +++ head/sys/sys/dnv.h Thu Jul 2 21:46:07 2015 (r285062) @@ -37,6 +37,7 @@ #ifndef _KERNEL #include #include +#include #include #endif From owner-svn-src-head@freebsd.org Thu Jul 2 21:58:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A329992A26; Thu, 2 Jul 2015 21:58:20 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00BAD1E23; Thu, 2 Jul 2015 21:58:20 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62LwJdY019537; Thu, 2 Jul 2015 21:58:19 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62LwBod019468; Thu, 2 Jul 2015 21:58:11 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201507022158.t62LwBod019468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 2 Jul 2015 21:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285063 - in head: . contrib/tcpdump lib/libcapsicum lib/libcasper lib/libnv lib/libnv/tests libexec/casper/dns libexec/casper/grp libexec/casper/pwd libexec/casper/random libexec/caspe... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 21:58:20 -0000 Author: oshogbo Date: Thu Jul 2 21:58:10 2015 New Revision: 285063 URL: https://svnweb.freebsd.org/changeset/base/285063 Log: Let the nv.h and dnv.h includes be only in sys directory. Change consumers to include those files from sys. Add duplicated files to ObsoleteFiles. Approved by: pjd (mentor) Modified: head/ObsoleteFiles.inc head/contrib/tcpdump/tcpdump.c head/lib/libcapsicum/libcapsicum.c head/lib/libcapsicum/libcapsicum_dns.c head/lib/libcapsicum/libcapsicum_grp.c head/lib/libcapsicum/libcapsicum_pwd.c head/lib/libcapsicum/libcapsicum_random.c head/lib/libcapsicum/libcapsicum_service.c head/lib/libcapsicum/libcapsicum_sysctl.c head/lib/libcasper/libcasper.c head/lib/libnv/Makefile head/lib/libnv/tests/dnv_tests.cc head/lib/libnv/tests/nv_tests.cc head/lib/libnv/tests/nvlist_add_test.c head/lib/libnv/tests/nvlist_exists_test.c head/lib/libnv/tests/nvlist_free_test.c head/lib/libnv/tests/nvlist_get_test.c head/lib/libnv/tests/nvlist_move_test.c head/lib/libnv/tests/nvlist_send_recv_test.c head/libexec/casper/dns/dns.c head/libexec/casper/grp/grp.c head/libexec/casper/pwd/pwd.c head/libexec/casper/random/random.c head/libexec/casper/sysctl/sysctl.c head/sbin/casperd/casperd.c head/sbin/casperd/zygote.c head/tools/regression/capsicum/libcapsicum/sysctl.c head/usr.bin/kdump/kdump.c head/usr.sbin/iovctl/iovctl.c head/usr.sbin/iovctl/parse.c head/usr.sbin/iovctl/validate.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Jul 2 21:46:07 2015 (r285062) +++ head/ObsoleteFiles.inc Thu Jul 2 21:58:10 2015 (r285063) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20150702: Remove duplicated nvlist includes. +OLD_FILES+=usr/include/dnv.h +OLD_FILES+=usr/include/nv.h # 20150528: PCI IOV device driver methods moved to a separate kobj interface. OLD_FILES+=usr/share/man/man9/PCI_ADD_VF.9.gz OLD_FILES+=usr/share/man/man9/PCI_INIT_IOV.9.gz Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/contrib/tcpdump/tcpdump.c Thu Jul 2 21:58:10 2015 (r285063) @@ -82,7 +82,7 @@ extern int SIZE_BUF; #include #include #include -#include +#include #include #include #include Modified: head/lib/libcapsicum/libcapsicum.c ============================================================================== --- head/lib/libcapsicum/libcapsicum.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libcapsicum/libcapsicum.c Thu Jul 2 21:58:10 2015 (r285063) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -44,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include "libcapsicum.h" #include "libcapsicum_impl.h" -#include "nv.h" /* * Structure describing communication channel between two separated processes. Modified: head/lib/libcapsicum/libcapsicum_dns.c ============================================================================== --- head/lib/libcapsicum/libcapsicum_dns.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libcapsicum/libcapsicum_dns.c Thu Jul 2 21:58:10 2015 (r285063) @@ -30,14 +30,14 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include #include #include -#include - #include "libcapsicum.h" #include "libcapsicum_dns.h" Modified: head/lib/libcapsicum/libcapsicum_grp.c ============================================================================== --- head/lib/libcapsicum/libcapsicum_grp.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libcapsicum/libcapsicum_grp.c Thu Jul 2 21:58:10 2015 (r285063) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include @@ -39,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include "libcapsicum.h" #include "libcapsicum_grp.h" Modified: head/lib/libcapsicum/libcapsicum_pwd.c ============================================================================== --- head/lib/libcapsicum/libcapsicum_pwd.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libcapsicum/libcapsicum_pwd.c Thu Jul 2 21:58:10 2015 (r285063) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -39,8 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "libcapsicum.h" #include "libcapsicum_pwd.h" Modified: head/lib/libcapsicum/libcapsicum_random.c ============================================================================== --- head/lib/libcapsicum/libcapsicum_random.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libcapsicum/libcapsicum_random.c Thu Jul 2 21:58:10 2015 (r285063) @@ -30,12 +30,12 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include -#include - #include "libcapsicum.h" #include "libcapsicum_random.h" Modified: head/lib/libcapsicum/libcapsicum_service.c ============================================================================== --- head/lib/libcapsicum/libcapsicum_service.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libcapsicum/libcapsicum_service.c Thu Jul 2 21:58:10 2015 (r285063) @@ -30,12 +30,13 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include #include -#include #include "msgio.h" #include "libcapsicum.h" Modified: head/lib/libcapsicum/libcapsicum_sysctl.c ============================================================================== --- head/lib/libcapsicum/libcapsicum_sysctl.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libcapsicum/libcapsicum_sysctl.c Thu Jul 2 21:58:10 2015 (r285063) @@ -30,11 +30,11 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include -#include - #include "libcapsicum.h" #include "libcapsicum_sysctl.h" Modified: head/lib/libcasper/libcasper.c ============================================================================== --- head/lib/libcasper/libcasper.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libcasper/libcasper.c Thu Jul 2 21:58:10 2015 (r285063) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -52,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include /* Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libnv/Makefile Thu Jul 2 21:58:10 2015 (r285063) @@ -15,9 +15,6 @@ SRCS+= msgio.c SRCS+= subr_nvlist.c SRCS+= subr_nvpair.c -INCS= dnv.h -INCS+= nv.h - MAN+= nv.3 MLINKS+=nv.3 libnv.3 \ Modified: head/lib/libnv/tests/dnv_tests.cc ============================================================================== --- head/lib/libnv/tests/dnv_tests.cc Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libnv/tests/dnv_tests.cc Thu Jul 2 21:58:10 2015 (r285063) @@ -27,9 +27,10 @@ #include __FBSDID("$FreeBSD$"); +#include +#include + #include -#include -#include ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_bool__present); ATF_TEST_CASE_BODY(dnvlist_get_bool__present) Modified: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libnv/tests/nv_tests.cc Thu Jul 2 21:58:10 2015 (r285063) @@ -27,8 +27,9 @@ #include __FBSDID("$FreeBSD$"); +#include + #include -#include #include #include Modified: head/lib/libnv/tests/nvlist_add_test.c ============================================================================== --- head/lib/libnv/tests/nvlist_add_test.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libnv/tests/nvlist_add_test.c Thu Jul 2 21:58:10 2015 (r285063) @@ -29,12 +29,12 @@ * $FreeBSD$ */ +#include + #include #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ Modified: head/lib/libnv/tests/nvlist_exists_test.c ============================================================================== --- head/lib/libnv/tests/nvlist_exists_test.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libnv/tests/nvlist_exists_test.c Thu Jul 2 21:58:10 2015 (r285063) @@ -29,11 +29,11 @@ * $FreeBSD$ */ +#include + #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ Modified: head/lib/libnv/tests/nvlist_free_test.c ============================================================================== --- head/lib/libnv/tests/nvlist_free_test.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libnv/tests/nvlist_free_test.c Thu Jul 2 21:58:10 2015 (r285063) @@ -29,11 +29,11 @@ * $FreeBSD$ */ +#include + #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ Modified: head/lib/libnv/tests/nvlist_get_test.c ============================================================================== --- head/lib/libnv/tests/nvlist_get_test.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libnv/tests/nvlist_get_test.c Thu Jul 2 21:58:10 2015 (r285063) @@ -28,6 +28,7 @@ * * $FreeBSD$ */ +#include #include #include @@ -35,8 +36,6 @@ #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ Modified: head/lib/libnv/tests/nvlist_move_test.c ============================================================================== --- head/lib/libnv/tests/nvlist_move_test.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libnv/tests/nvlist_move_test.c Thu Jul 2 21:58:10 2015 (r285063) @@ -29,14 +29,14 @@ * $FreeBSD$ */ +#include + #include #include #include #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ Modified: head/lib/libnv/tests/nvlist_send_recv_test.c ============================================================================== --- head/lib/libnv/tests/nvlist_send_recv_test.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/lib/libnv/tests/nvlist_send_recv_test.c Thu Jul 2 21:58:10 2015 (r285063) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -40,8 +41,6 @@ #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ Modified: head/libexec/casper/dns/dns.c ============================================================================== --- head/libexec/casper/dns/dns.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/libexec/casper/dns/dns.c Thu Jul 2 21:58:10 2015 (r285063) @@ -30,6 +30,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include @@ -41,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include static bool Modified: head/libexec/casper/grp/grp.c ============================================================================== --- head/libexec/casper/grp/grp.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/libexec/casper/grp/grp.c Thu Jul 2 21:58:10 2015 (r285063) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -38,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include static bool Modified: head/libexec/casper/pwd/pwd.c ============================================================================== --- head/libexec/casper/pwd/pwd.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/libexec/casper/pwd/pwd.c Thu Jul 2 21:58:10 2015 (r285063) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -37,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include static bool Modified: head/libexec/casper/random/random.c ============================================================================== --- head/libexec/casper/random/random.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/libexec/casper/random/random.c Thu Jul 2 21:58:10 2015 (r285063) @@ -30,13 +30,14 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include #include #include -#include #include #define MAXSIZE (1024 * 1024) Modified: head/libexec/casper/sysctl/sysctl.c ============================================================================== --- head/libexec/casper/sysctl/sysctl.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/libexec/casper/sysctl/sysctl.c Thu Jul 2 21:58:10 2015 (r285063) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -40,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include static int Modified: head/sbin/casperd/casperd.c ============================================================================== --- head/sbin/casperd/casperd.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/sbin/casperd/casperd.c Thu Jul 2 21:58:10 2015 (r285063) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -56,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "msgio.h" Modified: head/sbin/casperd/zygote.c ============================================================================== --- head/sbin/casperd/zygote.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/sbin/casperd/zygote.c Thu Jul 2 21:58:10 2015 (r285063) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -46,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include "zygote.h" Modified: head/tools/regression/capsicum/libcapsicum/sysctl.c ============================================================================== --- head/tools/regression/capsicum/libcapsicum/sysctl.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/tools/regression/capsicum/libcapsicum/sysctl.c Thu Jul 2 21:58:10 2015 (r285063) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -46,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* * We need some sysctls to perform the tests on. Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/usr.bin/kdump/kdump.c Thu Jul 2 21:58:10 2015 (r285063) @@ -61,6 +61,9 @@ extern int errno; #include #include #include +#ifdef HAVE_LIBCAPSICUM +#include +#endif #include #include #include @@ -77,9 +80,6 @@ extern int errno; #include #include #include -#ifdef HAVE_LIBCAPSICUM -#include -#endif #include #include #include Modified: head/usr.sbin/iovctl/iovctl.c ============================================================================== --- head/usr.sbin/iovctl/iovctl.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/usr.sbin/iovctl/iovctl.c Thu Jul 2 21:58:10 2015 (r285063) @@ -29,12 +29,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include -#include #include #include #include -#include #include #include #include Modified: head/usr.sbin/iovctl/parse.c ============================================================================== --- head/usr.sbin/iovctl/parse.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/usr.sbin/iovctl/parse.c Thu Jul 2 21:58:10 2015 (r285063) @@ -29,12 +29,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -#include #include #include #include Modified: head/usr.sbin/iovctl/validate.c ============================================================================== --- head/usr.sbin/iovctl/validate.c Thu Jul 2 21:46:07 2015 (r285062) +++ head/usr.sbin/iovctl/validate.c Thu Jul 2 21:58:10 2015 (r285063) @@ -29,10 +29,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include -#include #include -#include #include #include From owner-svn-src-head@freebsd.org Thu Jul 2 22:23:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD56699302B; Thu, 2 Jul 2015 22:23:52 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE6481D60; Thu, 2 Jul 2015 22:23:52 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62MNqNE033893; Thu, 2 Jul 2015 22:23:52 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62MNqHc033892; Thu, 2 Jul 2015 22:23:52 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201507022223.t62MNqHc033892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Thu, 2 Jul 2015 22:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285064 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 22:23:52 -0000 Author: mat (doc,ports committer) Date: Thu Jul 2 22:23:52 2015 New Revision: 285064 URL: https://svnweb.freebsd.org/changeset/base/285064 Log: Add repository.callsign, to help arcanist figure out what repo it's doing things on when not using Subversion. With hat: phabric-admin@ Sponsored by: Absolight Modified: head/.arcconfig Modified: head/.arcconfig ============================================================================== --- head/.arcconfig Thu Jul 2 21:58:10 2015 (r285063) +++ head/.arcconfig Thu Jul 2 22:23:52 2015 (r285064) @@ -1,5 +1,6 @@ { "project.name": "S", + "repository.callsign" : "S", "phabricator.uri" : "https://reviews.freebsd.org/", "history.immutable" : true } From owner-svn-src-head@freebsd.org Fri Jul 3 00:37:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E1449937C4; Fri, 3 Jul 2015 00:37:17 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65DF52706; Fri, 3 Jul 2015 00:37:17 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t630bHnM000831; Fri, 3 Jul 2015 00:37:17 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t630bHZn000830; Fri, 3 Jul 2015 00:37:17 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201507030037.t630bHZn000830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Fri, 3 Jul 2015 00:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285065 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 00:37:17 -0000 Author: jmg Date: Fri Jul 3 00:37:16 2015 New Revision: 285065 URL: https://svnweb.freebsd.org/changeset/base/285065 Log: update the documentation of the _IV_ flags... _IV_PRESENT doesn't mean what you think it should... This will be fixed in the future with a flag rename, but document what the flag really does and make the _IV_ flags clear what their presents (or lack there of) means... Reviewed by: gnn, eri (both earlier version) Modified: head/share/man/man9/crypto.9 Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Thu Jul 2 22:23:52 2015 (r285064) +++ head/share/man/man9/crypto.9 Fri Jul 3 00:37:16 2015 (r285065) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 12, 2014 +.Dd July 2, 2015 .Dt CRYPTO 9 .Os .Sh NAME @@ -333,13 +333,13 @@ on the input buffer. The various fields are: .Bl -tag -width ".Va crd_inject" .It Va crd_iv -The field where IV should be provided when the +When the flag .Dv CRD_F_IV_EXPLICIT -flag is given. +is set, this field contains the IV. .It Va crd_key When the .Dv CRD_F_KEY_EXPLICIT -flag is given, the +flag is set, the .Va crd_key points to a buffer with encryption or authentication key. .It Va crd_alg @@ -370,15 +370,14 @@ The following flags are defined: For encryption algorithms, this bit is set when encryption is required (when not set, decryption is performed). .It Dv CRD_F_IV_PRESENT -For encryption, this bit is set when the IV already -precedes the data, so the -.Va crd_inject -value will be ignored and no IV will be written in the buffer. -Otherwise, the IV used to encrypt the packet will be written -at the location pointed to by +.\" This flag name has nothing to do w/ it's behavior, fix the name. +For encryption, if this bit is not set the IV used to encrypt the packet +will be written at the location pointed to by .Va crd_inject . The IV length is assumed to be equal to the blocksize of the encryption algorithm. +For encryption, if this bit is set, nothing is done. +For decryption, this flag has no meaning. Applications that do special .Dq "IV cooking" , such as the half-IV mode in @@ -388,7 +387,7 @@ This flag is typically used in conjuncti .Dv CRD_F_IV_EXPLICIT flag. .It Dv CRD_F_IV_EXPLICIT -For encryption algorithms, this bit is set when the IV is explicitly +This bit is set when the IV is explicitly provided by the consumer in the .Va crd_iv field. From owner-svn-src-head@freebsd.org Fri Jul 3 01:15:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2012993DDC; Fri, 3 Jul 2015 01:15:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6783162C; Fri, 3 Jul 2015 01:15:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t631FLkm020676; Fri, 3 Jul 2015 01:15:21 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t631FL6J020675; Fri, 3 Jul 2015 01:15:21 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201507030115.t631FL6J020675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 Jul 2015 01:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285066 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 01:15:22 -0000 Author: rmacklem Date: Fri Jul 3 01:15:21 2015 New Revision: 285066 URL: https://svnweb.freebsd.org/changeset/base/285066 Log: Alex Burlyga reported a POLA violation for the new NFS client as compared to the old NFS client via email to the freebsd-fs@ mailing list. For the new client, when multiple clients attempted to create a symbolic link concurrently, more that one client would report success instead of EEXIST. This was caused by code in the new client that mapped EEXIST to OK assuming it was caused by a retried RPC request. Since the old client did not do this, the patch defaults to the old behaviour and permits the new behaviour to be enabled via a sysctl. Reported by: alex.burlyga.ietf@gmail.com Tested by: alex.burlyga.ietf@gmail.com MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Fri Jul 3 00:37:16 2015 (r285065) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri Jul 3 01:15:21 2015 (r285066) @@ -46,6 +46,13 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include + +SYSCTL_DECL(_vfs_nfs); + +static int nfsignore_eexist = 0; +SYSCTL_INT(_vfs_nfs, OID_AUTO, ignore_eexist, CTLFLAG_RW, + &nfsignore_eexist, 0, "NFS ignore EEXIST replies for mkdir/symlink"); /* * Global variables @@ -2530,8 +2537,12 @@ nfsrpc_symlink(vnode_t dvp, char *name, mbuf_freem(nd->nd_mrep); /* * Kludge: Map EEXIST => 0 assuming that it is a reply to a retry. + * Only do this if vfs.nfs.ignore_eexist is set. + * Never do this for NFSv4.1 or later minor versions, since sessions + * should guarantee "exactly once" RPC semantics. */ - if (error == EEXIST) + if (error == EEXIST && nfsignore_eexist != 0 && (!NFSHASNFSV4(nmp) || + nmp->nm_minorvers == 0)) error = 0; return (error); } @@ -2550,10 +2561,12 @@ nfsrpc_mkdir(vnode_t dvp, char *name, in nfsattrbit_t attrbits; int error = 0; struct nfsfh *fhp; + struct nfsmount *nmp; *nfhpp = NULL; *attrflagp = 0; *dattrflagp = 0; + nmp = VFSTONFS(vnode_mount(dvp)); fhp = VTONFS(dvp)->n_fhp; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); @@ -2605,9 +2618,13 @@ nfsrpc_mkdir(vnode_t dvp, char *name, in nfsmout: mbuf_freem(nd->nd_mrep); /* - * Kludge: Map EEXIST => 0 assuming that you have a reply to a retry. + * Kludge: Map EEXIST => 0 assuming that it is a reply to a retry. + * Only do this if vfs.nfs.ignore_eexist is set. + * Never do this for NFSv4.1 or later minor versions, since sessions + * should guarantee "exactly once" RPC semantics. */ - if (error == EEXIST) + if (error == EEXIST && nfsignore_eexist != 0 && (!NFSHASNFSV4(nmp) || + nmp->nm_minorvers == 0)) error = 0; return (error); } From owner-svn-src-head@freebsd.org Fri Jul 3 01:43:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCD95993383; Fri, 3 Jul 2015 01:43:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE4A8229F; Fri, 3 Jul 2015 01:43:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t631hBtS036947; Fri, 3 Jul 2015 01:43:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t631hBmZ036946; Fri, 3 Jul 2015 01:43:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201507030143.t631hBmZ036946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 3 Jul 2015 01:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285067 - head/usr.sbin/mfiutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 01:43:12 -0000 Author: emaste Date: Fri Jul 3 01:43:11 2015 New Revision: 285067 URL: https://svnweb.freebsd.org/changeset/base/285067 Log: mfiutil: increase buffer size to accommodate sprintf string PR: 201289 MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfi_foreign.c Modified: head/usr.sbin/mfiutil/mfi_foreign.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_foreign.c Fri Jul 3 01:15:21 2015 (r285066) +++ head/usr.sbin/mfiutil/mfi_foreign.c Fri Jul 3 01:43:11 2015 (r285067) @@ -110,7 +110,7 @@ static int foreign_show_cfg(int fd, uint32_t opcode, uint8_t cfgidx, int diagnostic) { struct mfi_config_data *config; - char prefix[26]; + char prefix[64]; int error; uint8_t mbox[4]; From owner-svn-src-head@freebsd.org Fri Jul 3 01:50:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4C669934D8; Fri, 3 Jul 2015 01:50:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AAD9270B; Fri, 3 Jul 2015 01:50:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t631oabU039541; Fri, 3 Jul 2015 01:50:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t631oRd0039490; Fri, 3 Jul 2015 01:50:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201507030150.t631oRd0039490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 3 Jul 2015 01:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285068 - in head/sys: conf modules/agp modules/geom/geom_part/geom_part_apm modules/geom/geom_part/geom_part_bsd modules/geom/geom_part/geom_part_bsd64 modules/geom/geom_part/geom_part... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 01:50:36 -0000 Author: imp Date: Fri Jul 3 01:50:26 2015 New Revision: 285068 URL: https://svnweb.freebsd.org/changeset/base/285068 Log: Kill MFILES and find things automatically. It turned out to be only lightly used. Find the proper .m file when we depend on *_if.[ch] in the srcs line, with seat-belts for false positive matches. This uses make's path mechanism. A further refinement would be to calculate this once, and then pass the resulting _MPATH to modules submakes. Differential Revision: https://reviews.freebsd.org/D2327 Modified: head/sys/conf/kmod.mk head/sys/modules/agp/Makefile head/sys/modules/geom/geom_part/geom_part_apm/Makefile head/sys/modules/geom/geom_part/geom_part_bsd/Makefile head/sys/modules/geom/geom_part/geom_part_bsd64/Makefile head/sys/modules/geom/geom_part/geom_part_ebr/Makefile head/sys/modules/geom/geom_part/geom_part_gpt/Makefile head/sys/modules/geom/geom_part/geom_part_ldm/Makefile head/sys/modules/geom/geom_part/geom_part_mbr/Makefile head/sys/modules/geom/geom_part/geom_part_pc98/Makefile head/sys/modules/geom/geom_part/geom_part_vtoc8/Makefile head/sys/modules/geom/geom_raid/Makefile head/sys/modules/kgssapi/Makefile head/sys/modules/kgssapi_krb5/Makefile head/sys/modules/ksyms/Makefile head/sys/modules/libiconv/Makefile head/sys/modules/mvs/Makefile head/sys/modules/nand/Makefile head/sys/modules/nandsim/Makefile head/sys/modules/proto/Makefile head/sys/modules/puc/Makefile head/sys/modules/scc/Makefile head/sys/modules/uart/Makefile head/sys/modules/virtio/balloon/Makefile head/sys/modules/virtio/block/Makefile head/sys/modules/virtio/console/Makefile head/sys/modules/virtio/network/Makefile head/sys/modules/virtio/pci/Makefile head/sys/modules/virtio/random/Makefile head/sys/modules/virtio/scsi/Makefile head/sys/modules/virtio/virtio/Makefile Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/conf/kmod.mk Fri Jul 3 01:50:26 2015 (r285068) @@ -28,9 +28,6 @@ # # KMODUNLOAD Command to unload a kernel module [/sbin/kldunload] # -# MFILES Optionally a list of interfaces used by the module. -# This file contains a default list of interfaces. -# # PROG The name of the kernel module to build. # If not supplied, ${KMOD}.ko is used. # @@ -72,7 +69,7 @@ OBJCOPY?= objcopy .include .include "config.mk" -.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S +.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S .m # amd64 and mips use direct linking for kmod, all others use shared binaries .if ${MACHINE_CPUARCH} != amd64 && ${MACHINE_CPUARCH} != mips @@ -339,37 +336,6 @@ ${_src}: # Respect configuration-specific C flags. CFLAGS+= ${CONF_CFLAGS} -MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \ - dev/agp/agp_if.m dev/ata/ata_if.m dev/eisa/eisa_if.m \ - dev/fb/fb_if.m dev/gpio/gpio_if.m dev/gpio/gpiobus_if.m \ - dev/iicbus/iicbb_if.m dev/iicbus/iicbus_if.m \ - dev/mbox/mbox_if.m dev/mmc/mmcbr_if.m dev/mmc/mmcbus_if.m \ - dev/mii/miibus_if.m dev/mvs/mvs_if.m dev/ofw/ofw_bus_if.m \ - dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ - dev/pci/pci_iov_if.m dev/pci/pcib_if.m dev/ppbus/ppbus_if.m \ - dev/sdhci/sdhci_if.m dev/smbus/smbus_if.m dev/spibus/spibus_if.m \ - dev/sound/pci/hda/hdac_if.m \ - dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \ - dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m \ - dev/sound/midi/mpu_if.m dev/sound/midi/mpufoi_if.m \ - dev/sound/midi/synth_if.m dev/usb/usb_if.m isa/isa_if.m \ - kern/bus_if.m kern/clock_if.m \ - kern/cpufreq_if.m kern/device_if.m kern/serdev_if.m \ - libkern/iconv_converter_if.m opencrypto/cryptodev_if.m \ - pc98/pc98/canbus_if.m dev/etherswitch/mdio_if.m - -.for _srcsrc in ${MFILES} -.for _ext in c h -.for _src in ${SRCS:M${_srcsrc:T:R}.${_ext}} -CLEANFILES+= ${_src} -.if !target(${_src}) -${_src}: ${SYSDIR}/tools/makeobjops.awk ${SYSDIR}/${_srcsrc} - ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${SYSDIR}/${_srcsrc} -${_ext} -.endif -.endfor # _src -.endfor # _ext -.endfor # _srcsrc - .if !empty(SRCS:Mvnode_if.c) CLEANFILES+= vnode_if.c vnode_if.c: ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src @@ -388,6 +354,21 @@ vnode_if_typedef.h: ${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -q .endif +# Build _if.[ch] from _if.m, and clean them when we're done. +__MPATH!=find ${SYSDIR:tA}/ -name \*_if.m +_MPATH=${__MPATH:H:O:u} +.PATH.m: ${_MPATH} +.for _s in ${SRCS:M*_if.[ch]} +.if eixsts(${_s:R}.m}) +CLEANFILES+= ${_s} +.endif +.endfor # _s +.m.c: ${SYSDIR}/tools/makeobjops.awk + ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c + +.m.h: ${SYSDIR}/tools/makeobjops.awk + ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -h + .for _i in mii pccard .if !empty(SRCS:M${_i}devs.h) CLEANFILES+= ${_i}devs.h Modified: head/sys/modules/agp/Makefile ============================================================================== --- head/sys/modules/agp/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/agp/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -19,7 +19,6 @@ SRCS+= agp_apple.c .endif SRCS+= device_if.h bus_if.h agp_if.h pci_if.h SRCS+= opt_agp.h -MFILES= kern/device_if.m kern/bus_if.m dev/agp/agp_if.m dev/pci/pci_if.m EXPORT_SYMS= agp_find_device \ agp_state \ Modified: head/sys/modules/geom/geom_part/geom_part_apm/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/geom_part_apm/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/geom/geom_part/geom_part_apm/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -7,6 +7,4 @@ SRCS= g_part_apm.c SRCS+= bus_if.h device_if.h g_part_if.h -MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m - .include Modified: head/sys/modules/geom/geom_part/geom_part_bsd/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/geom_part_bsd/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/geom/geom_part/geom_part_bsd/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -7,6 +7,4 @@ SRCS= g_part_bsd.c geom_bsd_enc.c SRCS+= bus_if.h device_if.h g_part_if.h -MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m - .include Modified: head/sys/modules/geom/geom_part/geom_part_bsd64/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/geom_part_bsd64/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/geom/geom_part/geom_part_bsd64/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -7,6 +7,4 @@ SRCS= g_part_bsd64.c SRCS+= bus_if.h device_if.h g_part_if.h -MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m - .include Modified: head/sys/modules/geom/geom_part/geom_part_ebr/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/geom_part_ebr/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/geom/geom_part/geom_part_ebr/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -8,6 +8,4 @@ SRCS= g_part_ebr.c SRCS+= bus_if.h device_if.h g_part_if.h SRCS+= opt_geom.h -MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m - .include Modified: head/sys/modules/geom/geom_part/geom_part_gpt/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/geom_part_gpt/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/geom/geom_part/geom_part_gpt/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -7,6 +7,4 @@ SRCS= g_part_gpt.c SRCS+= bus_if.h device_if.h g_part_if.h -MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m - .include Modified: head/sys/modules/geom/geom_part/geom_part_ldm/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/geom_part_ldm/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/geom/geom_part/geom_part_ldm/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -7,6 +7,4 @@ SRCS= g_part_ldm.c SRCS+= bus_if.h device_if.h g_part_if.h -MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m - .include Modified: head/sys/modules/geom/geom_part/geom_part_mbr/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/geom_part_mbr/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/geom/geom_part/geom_part_mbr/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -7,6 +7,4 @@ SRCS= g_part_mbr.c SRCS+= bus_if.h device_if.h g_part_if.h -MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m - .include Modified: head/sys/modules/geom/geom_part/geom_part_pc98/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/geom_part_pc98/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/geom/geom_part/geom_part_pc98/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -7,6 +7,4 @@ SRCS= g_part_pc98.c SRCS+= bus_if.h device_if.h g_part_if.h -MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m - .include Modified: head/sys/modules/geom/geom_part/geom_part_vtoc8/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/geom_part_vtoc8/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/geom/geom_part/geom_part_vtoc8/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -7,6 +7,4 @@ SRCS= g_part_vtoc8.c SRCS+= bus_if.h device_if.h g_part_if.h -MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m - .include Modified: head/sys/modules/geom/geom_raid/Makefile ============================================================================== --- head/sys/modules/geom/geom_raid/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/geom/geom_raid/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -13,7 +13,4 @@ SRCS+= md_ddf.c md_intel.c md_jmicron.c SRCS+= tr_concat.c tr_raid0.c tr_raid1.c tr_raid1e.c tr_raid5.c -MFILES= kern/bus_if.m kern/device_if.m -MFILES+= geom/raid/g_raid_md_if.m geom/raid/g_raid_tr_if.m - .include Modified: head/sys/modules/kgssapi/Makefile ============================================================================== --- head/sys/modules/kgssapi/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/kgssapi/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -36,7 +36,6 @@ SRCS+= rpcsec_gss.c \ svc_rpcsec_gss.c SRCS+= kgss_if.h kgss_if.c -MFILES= kgssapi/kgss_if.m SRCS+= gssd.h gssd_xdr.c gssd_clnt.c CLEANFILES= gssd.h gssd_xdr.c gssd_clnt.c Modified: head/sys/modules/kgssapi_krb5/Makefile ============================================================================== --- head/sys/modules/kgssapi_krb5/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/kgssapi_krb5/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -12,7 +12,6 @@ SRCS= krb5_mech.c \ opt_inet6.h SRCS+= kgss_if.h gssd.h -MFILES= kgssapi/kgss_if.m CLEANFILES= gssd.h S= ${.CURDIR}/../.. Modified: head/sys/modules/ksyms/Makefile ============================================================================== --- head/sys/modules/ksyms/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/ksyms/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -5,6 +5,4 @@ KMOD= ksyms SRCS= ksyms.c linker_if.h -MFILES= kern/linker_if.m - .include Modified: head/sys/modules/libiconv/Makefile ============================================================================== --- head/sys/modules/libiconv/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/libiconv/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -6,7 +6,6 @@ KMOD= libiconv SRCS= iconv.c iconv_ucs.c iconv_xlat.c iconv_xlat16.c SRCS+= iconv.h SRCS+= iconv_converter_if.c iconv_converter_if.h -MFILES= libkern/iconv_converter_if.m EXPORT_SYMS= iconv_add \ iconv_open \ Modified: head/sys/modules/mvs/Makefile ============================================================================== --- head/sys/modules/mvs/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/mvs/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -5,6 +5,4 @@ KMOD= mvs SRCS= mvs.c mvs_pci.c mvs.h mvs_if.c mvs_if.h device_if.h bus_if.h pci_if.h opt_cam.h -MFILES= kern/bus_if.m kern/device_if.m dev/pci/pci_if.m dev/mvs/mvs_if.m - .include Modified: head/sys/modules/nand/Makefile ============================================================================== --- head/sys/modules/nand/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/nand/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -7,7 +7,4 @@ SRCS= nand.c nand_bbt.c nand_cdev.c nand nand_id.c nandbus.c nandbus_if.c nand_if.c nfc_if.c \ nand_if.h device_if.h bus_if.h nfc_if.h nandbus_if.h -MFILES= kern/bus_if.m kern/device_if.m dev/nand/nfc_if.m \ - dev/nand/nand_if.m dev/nand/nandbus_if.m - .include Modified: head/sys/modules/nandsim/Makefile ============================================================================== --- head/sys/modules/nandsim/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/nandsim/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -5,7 +5,5 @@ KMOD= nandsim SRCS= nandsim.c nandsim_chip.c nandsim_swap.c nandsim_ctrl.c nandsim_log.c\ bus_if.h device_if.h vnode_if.h nfc_if.h nand_if.h -MFILES= kern/bus_if.m kern/device_if.m\ - dev/nand/nfc_if.m dev/nand/nand_if.m .include Modified: head/sys/modules/proto/Makefile ============================================================================== --- head/sys/modules/proto/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/proto/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -15,10 +15,4 @@ SRCS+= \ isa_if.h \ pci_if.h -MFILES= \ - dev/pci/pci_if.m \ - isa/isa_if.m \ - kern/bus_if.m \ - kern/device_if.m - .include Modified: head/sys/modules/puc/Makefile ============================================================================== --- head/sys/modules/puc/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/puc/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -8,7 +8,4 @@ SRCS= puc.c puc_cfg.c puc_pci.c puc_pcca SRCS+= bus_if.h device_if.h serdev_if.c serdev_if.h \ card_if.h pci_if.h -MFILES= kern/bus_if.m kern/device_if.m kern/serdev_if.m \ - dev/pccard/card_if.m dev/pci/pci_if.m - .include Modified: head/sys/modules/scc/Makefile ============================================================================== --- head/sys/modules/scc/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/scc/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -14,7 +14,4 @@ SRCS= ${scc_bfe} scc_core.c scc_if.c scc scc_dev_sab82532.c scc_dev_z8530.c SRCS+= bus_if.h device_if.h ofw_bus_if.h serdev_if.c serdev_if.h -MFILES= dev/ofw/ofw_bus_if.m dev/scc/scc_if.m \ - kern/bus_if.m kern/device_if.m kern/serdev_if.m - .include Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/uart/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -36,8 +36,4 @@ SRCS+= bus_if.h card_if.h device_if.h is power_if.h pccarddevs.h serdev_if.h SRCS+= opt_platform.h -MFILES= dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ - dev/ofw/ofw_bus_if.m dev/uart/uart_if.m isa/isa_if.m kern/bus_if.m \ - kern/device_if.m kern/serdev_if.m - .include Modified: head/sys/modules/virtio/balloon/Makefile ============================================================================== --- head/sys/modules/virtio/balloon/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/virtio/balloon/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -30,7 +30,4 @@ SRCS= virtio_balloon.c SRCS+= virtio_bus_if.h virtio_if.h SRCS+= bus_if.h device_if.h -MFILES= kern/bus_if.m kern/device_if.m \ - dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m - .include Modified: head/sys/modules/virtio/block/Makefile ============================================================================== --- head/sys/modules/virtio/block/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/virtio/block/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -30,7 +30,4 @@ SRCS= virtio_blk.c SRCS+= virtio_bus_if.h virtio_if.h SRCS+= bus_if.h device_if.h -MFILES= kern/bus_if.m kern/device_if.m \ - dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m - .include Modified: head/sys/modules/virtio/console/Makefile ============================================================================== --- head/sys/modules/virtio/console/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/virtio/console/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -30,7 +30,4 @@ SRCS= virtio_console.c SRCS+= virtio_bus_if.h virtio_if.h SRCS+= bus_if.h device_if.h -MFILES= kern/bus_if.m kern/device_if.m \ - dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m - .include Modified: head/sys/modules/virtio/network/Makefile ============================================================================== --- head/sys/modules/virtio/network/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/virtio/network/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -31,7 +31,4 @@ SRCS+= virtio_bus_if.h virtio_if.h SRCS+= bus_if.h device_if.h SRCS+= opt_inet.h opt_inet6.h -MFILES= kern/bus_if.m kern/device_if.m \ - dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m - .include Modified: head/sys/modules/virtio/pci/Makefile ============================================================================== --- head/sys/modules/virtio/pci/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/virtio/pci/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -30,7 +30,4 @@ SRCS= virtio_pci.c SRCS+= virtio_bus_if.h virtio_if.h SRCS+= bus_if.h device_if.h pci_if.h -MFILES= kern/bus_if.m kern/device_if.m dev/pci/pci_if.m \ - dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m - .include Modified: head/sys/modules/virtio/random/Makefile ============================================================================== --- head/sys/modules/virtio/random/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/virtio/random/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -30,7 +30,4 @@ SRCS= virtio_random.c SRCS+= virtio_bus_if.h virtio_if.h SRCS+= bus_if.h device_if.h -MFILES= kern/bus_if.m kern/device_if.m \ - dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m - .include Modified: head/sys/modules/virtio/scsi/Makefile ============================================================================== --- head/sys/modules/virtio/scsi/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/virtio/scsi/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -30,7 +30,4 @@ SRCS= virtio_scsi.c SRCS+= virtio_bus_if.h virtio_if.h SRCS+= bus_if.h device_if.h opt_scsi.h opt_cam.h -MFILES= kern/bus_if.m kern/device_if.m \ - dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m - .include Modified: head/sys/modules/virtio/virtio/Makefile ============================================================================== --- head/sys/modules/virtio/virtio/Makefile Fri Jul 3 01:43:11 2015 (r285067) +++ head/sys/modules/virtio/virtio/Makefile Fri Jul 3 01:50:26 2015 (r285068) @@ -32,7 +32,4 @@ SRCS+= virtio_bus_if.c virtio_bus_if.h SRCS+= virtio_if.c virtio_if.h SRCS+= bus_if.h device_if.h -MFILES= kern/bus_if.m kern/device_if.m \ - dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m - .include From owner-svn-src-head@freebsd.org Fri Jul 3 01:52:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABC7899350A; Fri, 3 Jul 2015 01:52:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C42B2A13; Fri, 3 Jul 2015 01:52:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t631qOfZ042559; Fri, 3 Jul 2015 01:52:24 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t631qN6R042553; Fri, 3 Jul 2015 01:52:23 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201507030152.t631qN6R042553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 3 Jul 2015 01:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285069 - head/sys/dev/proto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 01:52:24 -0000 Author: marcel Date: Fri Jul 3 01:52:22 2015 New Revision: 285069 URL: https://svnweb.freebsd.org/changeset/base/285069 Log: Add create, destroy and load of memory descriptors. Modified: head/sys/dev/proto/proto_busdma.c head/sys/dev/proto/proto_busdma.h head/sys/dev/proto/proto_core.c head/sys/dev/proto/proto_dev.h Modified: head/sys/dev/proto/proto_busdma.c ============================================================================== --- head/sys/dev/proto/proto_busdma.c Fri Jul 3 01:50:26 2015 (r285068) +++ head/sys/dev/proto/proto_busdma.c Fri Jul 3 01:52:22 2015 (r285069) @@ -36,11 +36,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include +#include #include #include @@ -48,6 +51,12 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_PROTO_BUSDMA, "proto_busdma", "DMA management data"); +struct proto_callback_bundle { + struct proto_busdma *busdma; + struct proto_md *md; + struct proto_ioc_busdma *ioc; +}; + static int proto_busdma_tag_create(struct proto_busdma *busdma, struct proto_tag *parent, struct proto_ioc_busdma *ioc) @@ -129,26 +138,45 @@ proto_busdma_tag_lookup(struct proto_bus return (NULL); } +static int +proto_busdma_md_destroy_internal(struct proto_busdma *busdma, + struct proto_md *md) +{ + + LIST_REMOVE(md, mds); + LIST_REMOVE(md, peers); + if (md->physaddr) + bus_dmamap_unload(md->bd_tag, md->bd_map); + if (md->virtaddr != NULL) + bus_dmamem_free(md->bd_tag, md->virtaddr, md->bd_map); + else + bus_dmamap_destroy(md->bd_tag, md->bd_map); + bus_dma_tag_destroy(md->bd_tag); + free(md, M_PROTO_BUSDMA); + return (0); +} + static void proto_busdma_mem_alloc_callback(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - struct proto_ioc_busdma *ioc = arg; + struct proto_callback_bundle *pcb = arg; - ioc->u.mem.bus_nsegs = nseg; - ioc->u.mem.bus_addr = segs[0].ds_addr; + pcb->ioc->u.md.bus_nsegs = nseg; + pcb->ioc->u.md.bus_addr = segs[0].ds_addr; } static int proto_busdma_mem_alloc(struct proto_busdma *busdma, struct proto_tag *tag, struct proto_ioc_busdma *ioc) { + struct proto_callback_bundle pcb; struct proto_md *md; int error; md = malloc(sizeof(*md), M_PROTO_BUSDMA, M_WAITOK | M_ZERO); md->tag = tag; - + error = bus_dma_tag_create(busdma->bd_roottag, tag->align, tag->bndry, tag->maxaddr, BUS_SPACE_MAXADDR, NULL, NULL, tag->maxsz, tag->nsegs, tag->maxsegsz, 0, NULL, NULL, &md->bd_tag); @@ -163,8 +191,11 @@ proto_busdma_mem_alloc(struct proto_busd return (error); } md->physaddr = pmap_kextract((uintptr_t)(md->virtaddr)); + pcb.busdma = busdma; + pcb.md = md; + pcb.ioc = ioc; error = bus_dmamap_load(md->bd_tag, md->bd_map, md->virtaddr, - tag->maxsz, proto_busdma_mem_alloc_callback, ioc, BUS_DMA_NOWAIT); + tag->maxsz, proto_busdma_mem_alloc_callback, &pcb, BUS_DMA_NOWAIT); if (error) { bus_dmamem_free(md->bd_tag, md->virtaddr, md->bd_map); bus_dma_tag_destroy(md->bd_tag); @@ -173,8 +204,10 @@ proto_busdma_mem_alloc(struct proto_busd } LIST_INSERT_HEAD(&tag->mds, md, peers); LIST_INSERT_HEAD(&busdma->mds, md, mds); - ioc->u.mem.phys_nsegs = 1; - ioc->u.mem.phys_addr = md->physaddr; + ioc->u.md.virt_addr = (uintptr_t)md->virtaddr; + ioc->u.md.virt_size = tag->maxsz; + ioc->u.md.phys_nsegs = 1; + ioc->u.md.phys_addr = md->physaddr; ioc->result = (uintptr_t)(void *)md; return (0); } @@ -183,11 +216,93 @@ static int proto_busdma_mem_free(struct proto_busdma *busdma, struct proto_md *md) { - LIST_REMOVE(md, mds); - LIST_REMOVE(md, peers); - bus_dmamem_free(md->bd_tag, md->virtaddr, md->bd_map); - bus_dma_tag_destroy(md->bd_tag); - free(md, M_PROTO_BUSDMA); + if (md->virtaddr == NULL) + return (ENXIO); + return (proto_busdma_md_destroy_internal(busdma, md)); +} + +static int +proto_busdma_md_create(struct proto_busdma *busdma, struct proto_tag *tag, + struct proto_ioc_busdma *ioc) +{ + struct proto_md *md; + int error; + + md = malloc(sizeof(*md), M_PROTO_BUSDMA, M_WAITOK | M_ZERO); + md->tag = tag; + + error = bus_dma_tag_create(busdma->bd_roottag, tag->align, tag->bndry, + tag->maxaddr, BUS_SPACE_MAXADDR, NULL, NULL, tag->maxsz, + tag->nsegs, tag->maxsegsz, 0, NULL, NULL, &md->bd_tag); + if (error) { + free(md, M_PROTO_BUSDMA); + return (error); + } + error = bus_dmamap_create(md->bd_tag, 0, &md->bd_map); + if (error) { + bus_dma_tag_destroy(md->bd_tag); + free(md, M_PROTO_BUSDMA); + return (error); + } + + LIST_INSERT_HEAD(&tag->mds, md, peers); + LIST_INSERT_HEAD(&busdma->mds, md, mds); + ioc->result = (uintptr_t)(void *)md; + return (0); +} + +static int +proto_busdma_md_destroy(struct proto_busdma *busdma, struct proto_md *md) +{ + + if (md->virtaddr != NULL) + return (ENXIO); + return (proto_busdma_md_destroy_internal(busdma, md)); +} + +static void +proto_busdma_md_load_callback(void *arg, bus_dma_segment_t *segs, int nseg, + bus_size_t sz, int error) +{ + struct proto_callback_bundle *pcb = arg; + + pcb->ioc->u.md.bus_nsegs = nseg; + pcb->ioc->u.md.bus_addr = segs[0].ds_addr; +} + +static int +proto_busdma_md_load(struct proto_busdma *busdma, struct proto_md *md, + struct proto_ioc_busdma *ioc, struct thread *td) +{ + struct proto_callback_bundle pcb; + struct iovec iov; + struct uio uio; + pmap_t pmap; + int error; + + iov.iov_base = (void *)(uintptr_t)ioc->u.md.virt_addr; + iov.iov_len = ioc->u.md.virt_size; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = 0; + uio.uio_resid = iov.iov_len; + uio.uio_segflg = UIO_USERSPACE; + uio.uio_rw = UIO_READ; + uio.uio_td = td; + + pcb.busdma = busdma; + pcb.md = md; + pcb.ioc = ioc; + error = bus_dmamap_load_uio(md->bd_tag, md->bd_map, &uio, + proto_busdma_md_load_callback, &pcb, BUS_DMA_NOWAIT); + if (error) + return (error); + + /* XXX determine *all* physical memory segments */ + pmap = vmspace_pmap(td->td_proc->p_vmspace); + md->physaddr = pmap_extract(pmap, ioc->u.md.virt_addr); + ioc->u.md.phys_nsegs = 1; /* XXX */ + ioc->u.md.phys_addr = md->physaddr; return (0); } @@ -228,7 +343,7 @@ proto_busdma_cleanup(struct proto_softc struct proto_tag *tag, *tag1; LIST_FOREACH_SAFE(md, &busdma->mds, mds, md1) - proto_busdma_mem_free(busdma, md); + proto_busdma_md_destroy_internal(busdma, md); LIST_FOREACH_SAFE(tag, &busdma->tags, tags, tag1) proto_busdma_tag_destroy(busdma, tag); return (0); @@ -236,7 +351,7 @@ proto_busdma_cleanup(struct proto_softc int proto_busdma_ioctl(struct proto_softc *sc, struct proto_busdma *busdma, - struct proto_ioc_busdma *ioc) + struct proto_ioc_busdma *ioc, struct thread *td) { struct proto_tag *tag; struct proto_md *md; @@ -265,7 +380,7 @@ proto_busdma_ioctl(struct proto_softc *s error = proto_busdma_tag_destroy(busdma, tag); break; case PROTO_IOC_BUSDMA_MEM_ALLOC: - tag = proto_busdma_tag_lookup(busdma, ioc->u.mem.tag); + tag = proto_busdma_tag_lookup(busdma, ioc->u.md.tag); if (tag == NULL) { error = EINVAL; break; @@ -280,6 +395,30 @@ proto_busdma_ioctl(struct proto_softc *s } error = proto_busdma_mem_free(busdma, md); break; + case PROTO_IOC_BUSDMA_MD_CREATE: + tag = proto_busdma_tag_lookup(busdma, ioc->u.md.tag); + if (tag == NULL) { + error = EINVAL; + break; + } + error = proto_busdma_md_create(busdma, tag, ioc); + break; + case PROTO_IOC_BUSDMA_MD_DESTROY: + md = proto_busdma_md_lookup(busdma, ioc->key); + if (md == NULL) { + error = EINVAL; + break; + } + error = proto_busdma_md_destroy(busdma, md); + break; + case PROTO_IOC_BUSDMA_MD_LOAD: + md = proto_busdma_md_lookup(busdma, ioc->key); + if (md == NULL) { + error = EINVAL; + break; + } + error = proto_busdma_md_load(busdma, md, ioc, td); + break; default: error = EINVAL; break; Modified: head/sys/dev/proto/proto_busdma.h ============================================================================== --- head/sys/dev/proto/proto_busdma.h Fri Jul 3 01:50:26 2015 (r285068) +++ head/sys/dev/proto/proto_busdma.h Fri Jul 3 01:52:22 2015 (r285069) @@ -68,7 +68,7 @@ int proto_busdma_detach(struct proto_sof int proto_busdma_cleanup(struct proto_softc *, struct proto_busdma *); int proto_busdma_ioctl(struct proto_softc *, struct proto_busdma *, - struct proto_ioc_busdma *); + struct proto_ioc_busdma *, struct thread *); int proto_busdma_mmap_allowed(struct proto_busdma *, vm_paddr_t); Modified: head/sys/dev/proto/proto_core.c ============================================================================== --- head/sys/dev/proto/proto_core.c Fri Jul 3 01:50:26 2015 (r285068) +++ head/sys/dev/proto/proto_core.c Fri Jul 3 01:52:22 2015 (r285069) @@ -396,7 +396,7 @@ proto_ioctl(struct cdev *cdev, u_long cm break; } busdma = (struct proto_ioc_busdma *)data; - error = proto_busdma_ioctl(sc, r->r_d.busdma, busdma); + error = proto_busdma_ioctl(sc, r->r_d.busdma, busdma, td); break; default: error = ENOIOCTL; Modified: head/sys/dev/proto/proto_dev.h ============================================================================== --- head/sys/dev/proto/proto_dev.h Fri Jul 3 01:50:26 2015 (r285068) +++ head/sys/dev/proto/proto_dev.h Fri Jul 3 01:52:22 2015 (r285069) @@ -47,6 +47,9 @@ struct proto_ioc_busdma { #define PROTO_IOC_BUSDMA_TAG_DESTROY 3 #define PROTO_IOC_BUSDMA_MEM_ALLOC 10 #define PROTO_IOC_BUSDMA_MEM_FREE 11 +#define PROTO_IOC_BUSDMA_MD_CREATE 20 +#define PROTO_IOC_BUSDMA_MD_DESTROY 21 +#define PROTO_IOC_BUSDMA_MD_LOAD 22 unsigned long key; union { struct { @@ -62,11 +65,13 @@ struct proto_ioc_busdma { struct { unsigned long tag; unsigned int flags; + unsigned long virt_addr; + unsigned long virt_size; unsigned int phys_nsegs; unsigned long phys_addr; unsigned long bus_addr; unsigned int bus_nsegs; - } mem; + } md; } u; unsigned long result; }; From owner-svn-src-head@freebsd.org Fri Jul 3 01:55:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEA4199355E; Fri, 3 Jul 2015 01:55:07 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A01042B96; Fri, 3 Jul 2015 01:55:07 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t631t7vP043180; Fri, 3 Jul 2015 01:55:07 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t631t7B5043179; Fri, 3 Jul 2015 01:55:07 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201507030155.t631t7B5043179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Fri, 3 Jul 2015 01:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285070 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 01:55:07 -0000 Author: jmg Date: Fri Jul 3 01:55:06 2015 New Revision: 285070 URL: https://svnweb.freebsd.org/changeset/base/285070 Log: more word smithing wrt the crd_inject field... We've already defined IV earlier, so no need to expand it a second time here... Modified: head/share/man/man9/crypto.9 Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Fri Jul 3 01:52:22 2015 (r285069) +++ head/share/man/man9/crypto.9 Fri Jul 3 01:55:06 2015 (r285070) @@ -356,10 +356,12 @@ How many bytes, after .Va crd_skip , should be processed. .It Va crd_inject -Offset from the beginning of the buffer to insert any results. -For encryption algorithms, this is where the initialization vector -(IV) will be inserted when encrypting or where it can be found when -decrypting (subject to +The +.Va crd_inject +field specifies an offset in bytes from the beginning of the buffer. +For encryption algorithms, this may be where the IV will be inserted +when encrypting or where the IV may be found for +decryption (subject to .Va crd_flags ) . For MAC algorithms, this is where the result of the keyed hash will be inserted. @@ -393,7 +395,7 @@ provided by the consumer in the field. Otherwise, for encryption operations the IV is provided for by the driver used to perform the operation, whereas for decryption -operations it is pointed to by the +operations the offset of the IV is provided by the .Va crd_inject field. This flag is typically used when the IV is calculated From owner-svn-src-head@freebsd.org Fri Jul 3 02:06:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97F709937E8; Fri, 3 Jul 2015 02:06:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C1F42FB9; Fri, 3 Jul 2015 02:06:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6326npR049164; Fri, 3 Jul 2015 02:06:49 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6326mmY049153; Fri, 3 Jul 2015 02:06:48 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201507030206.t6326mmY049153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 3 Jul 2015 02:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285071 - in head/tools/bus_space: . C Python X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 02:06:49 -0000 Author: marcel Date: Fri Jul 3 02:06:47 2015 New Revision: 285071 URL: https://svnweb.freebsd.org/changeset/base/285071 Log: Add busdma_md_create, busdma_md_destroy and busdma_md_load. Modified: head/tools/bus_space/C/lang.c head/tools/bus_space/C/libbus.h head/tools/bus_space/Python/lang.c head/tools/bus_space/busdma.c head/tools/bus_space/busdma.h Modified: head/tools/bus_space/C/lang.c ============================================================================== --- head/tools/bus_space/C/lang.c Fri Jul 3 01:55:06 2015 (r285070) +++ head/tools/bus_space/C/lang.c Fri Jul 3 02:06:47 2015 (r285071) @@ -156,6 +156,32 @@ busdma_mem_free(busdma_md_t md) return (bd_mem_free(md)); } +int +busdma_md_create(busdma_tag_t tag, u_int flags, busdma_md_t *out_p) +{ + int res; + + res = bd_md_create(tag, flags); + if (res == -1) + return (errno); + *out_p = res; + return (0); +} + +int +busdma_md_destroy(busdma_md_t md) +{ + + return (bd_md_destroy(md)); +} + +int +busdma_md_load(busdma_md_t md, void *buf, size_t len, u_int flags) +{ + + return (bd_md_load(md, buf, len, flags)); +} + busdma_seg_t busdma_md_first_seg(busdma_md_t md, int space) { Modified: head/tools/bus_space/C/libbus.h ============================================================================== --- head/tools/bus_space/C/libbus.h Fri Jul 3 01:55:06 2015 (r285070) +++ head/tools/bus_space/C/libbus.h Fri Jul 3 02:06:47 2015 (r285071) @@ -58,6 +58,10 @@ int busdma_tag_destroy(busdma_tag_t tag) int busdma_mem_alloc(busdma_tag_t tag, u_int flags, busdma_md_t *out_p); int busdma_mem_free(busdma_md_t md); +int busdma_md_create(busdma_tag_t tag, u_int flags, busdma_md_t *out_p); +int busdma_md_destroy(busdma_md_t md); +int busdma_md_load(busdma_md_t md, void *buf, size_t len, u_int flags); + #define BUSDMA_MD_BUS_SPACE 0 #define BUSDMA_MD_PHYS_SPACE 1 #define BUSDMA_MD_VIRT_SPACE 2 Modified: head/tools/bus_space/Python/lang.c ============================================================================== --- head/tools/bus_space/Python/lang.c Fri Jul 3 01:55:06 2015 (r285070) +++ head/tools/bus_space/Python/lang.c Fri Jul 3 02:06:47 2015 (r285071) @@ -229,6 +229,55 @@ busdma_tag_destroy(PyObject *self, PyObj } static PyObject * +busdma_md_create(PyObject *self, PyObject *args) +{ + u_int flags; + int error, mdid, tid; + + if (!PyArg_ParseTuple(args, "iI", &tid, &flags)) + return (NULL); + mdid = bd_md_create(tid, flags); + if (mdid == -1) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + return (Py_BuildValue("i", mdid)); +} + +static PyObject * +busdma_md_destroy(PyObject *self, PyObject *args) +{ + int error, mdid; + + if (!PyArg_ParseTuple(args, "i", &mdid)) + return (NULL); + error = bd_md_destroy(mdid); + if (error) { + PyErr_SetString(PyExc_IOError, strerror(error)); + return (NULL); + } + Py_RETURN_NONE; +} + +static PyObject * +busdma_md_load(PyObject *self, PyObject *args) +{ + void *buf; + u_long len; + u_int flags; + int error, mdid; + + if (!PyArg_ParseTuple(args, "iwkI", &mdid, &buf, &len, &flags)) + return (NULL); + error = bd_md_load(mdid, buf, len, flags); + if (error) { + PyErr_SetString(PyExc_IOError, strerror(error)); + return (NULL); + } + Py_RETURN_NONE; +} + +static PyObject * busdma_mem_alloc(PyObject *self, PyObject *args) { u_int flags; @@ -347,6 +396,14 @@ static PyMethodDef busdma_methods[] = { "Derive a child tag." }, { "tag_destroy", busdma_tag_destroy, METH_VARARGS, "Destroy a tag." }, + + { "md_create", busdma_md_create, METH_VARARGS, + "Create a new and empty memory descriptor." }, + { "md_destroy", busdma_md_destroy, METH_VARARGS, + "Destroy a previously created memory descriptor." }, + { "md_load", busdma_md_load, METH_VARARGS, + "Load a buffer into a memory descriptor." }, + { "mem_alloc", busdma_mem_alloc, METH_VARARGS, "Allocate memory according to the DMA constraints." }, { "mem_free", busdma_mem_free, METH_VARARGS, Modified: head/tools/bus_space/busdma.c ============================================================================== --- head/tools/bus_space/busdma.c Fri Jul 3 01:55:06 2015 (r285070) +++ head/tools/bus_space/busdma.c Fri Jul 3 02:06:47 2015 (r285071) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -137,7 +138,7 @@ obj_lookup(int oid, u_int type) return (obj); } -struct obj * +static struct obj * bd_tag_new(struct obj *ptag, int fd, u_long align, u_long bndry, u_long maxaddr, u_long maxsz, u_int nsegs, u_long maxsegsz, u_int datarate, u_int flags) @@ -243,12 +244,29 @@ bd_tag_destroy(int tid) return (0); } +static int +bd_md_add_seg(struct obj *md, int type, u_long addr, u_long size) +{ + struct obj *seg; + + seg = obj_alloc(OBJ_TYPE_SEG); + if (seg == NULL) + return (errno); + seg->refcnt = 1; + seg->parent = md; + seg->u.seg.address = addr; + seg->u.seg.size = size; + + md->u.md.seg[type] = seg; + md->u.md.nsegs[type] = 1; + return (0); +} + int -bd_mem_alloc(int tid, u_int flags) +bd_md_create(int tid, u_int flags) { struct proto_ioc_busdma ioc; struct obj *md, *tag; - struct obj *bseg, *pseg, *vseg; tag = obj_lookup(tid, OBJ_TYPE_TAG); if (tag == NULL) @@ -259,9 +277,9 @@ bd_mem_alloc(int tid, u_int flags) return (-1); memset(&ioc, 0, sizeof(ioc)); - ioc.request = PROTO_IOC_BUSDMA_MEM_ALLOC; - ioc.u.mem.tag = tag->key; - ioc.u.mem.flags = flags; + ioc.request = PROTO_IOC_BUSDMA_MD_CREATE; + ioc.u.md.tag = tag->key; + ioc.u.md.flags = flags; if (ioctl(tag->fd, PROTO_IOC_BUSDMA, &ioc) == -1) { obj_free(md); return (-1); @@ -272,56 +290,112 @@ bd_mem_alloc(int tid, u_int flags) md->parent = tag; tag->refcnt++; md->key = ioc.result; + return (md->oid); +} - /* XXX we need to support multiple segments */ - assert(ioc.u.mem.phys_nsegs == 1); - assert(ioc.u.mem.bus_nsegs == 1); +int +bd_md_destroy(int mdid) +{ + struct proto_ioc_busdma ioc; + struct obj *md; - bseg = pseg = vseg = NULL; + md = obj_lookup(mdid, OBJ_TYPE_MD); + if (md == NULL) + return (errno); - bseg = obj_alloc(OBJ_TYPE_SEG); - if (bseg == NULL) - goto fail; - bseg->refcnt = 1; - bseg->parent = md; - bseg->u.seg.address = ioc.u.mem.bus_addr; - bseg->u.seg.size = tag->u.tag.maxsz; - md->u.md.seg[BUSDMA_MD_BUS] = bseg; - md->u.md.nsegs[BUSDMA_MD_BUS] = ioc.u.mem.bus_nsegs; + memset(&ioc, 0, sizeof(ioc)); + ioc.request = PROTO_IOC_BUSDMA_MD_DESTROY; + ioc.key = md->key; + if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) + return (errno); - pseg = obj_alloc(OBJ_TYPE_SEG); - if (pseg == NULL) - goto fail; - pseg->refcnt = 1; - pseg->parent = md; - pseg->u.seg.address = ioc.u.mem.phys_addr; - pseg->u.seg.size = tag->u.tag.maxsz; - md->u.md.seg[BUSDMA_MD_PHYS] = pseg; - md->u.md.nsegs[BUSDMA_MD_PHYS] = ioc.u.mem.phys_nsegs; + md->parent->refcnt--; + obj_free(md); + return (0); +} - vseg = obj_alloc(OBJ_TYPE_SEG); - if (vseg == NULL) - goto fail; - vseg->refcnt = 1; - vseg->parent = md; - vseg->u.seg.address = (uintptr_t)mmap(NULL, pseg->u.seg.size, - PROT_READ | PROT_WRITE, MAP_NOCORE | MAP_SHARED, md->fd, - pseg->u.seg.address); - if (vseg->u.seg.address == (uintptr_t)MAP_FAILED) +int +bd_md_load(int mdid, void *buf, u_long len, u_int flags) +{ + struct proto_ioc_busdma ioc; + struct obj *md; + int error; + + md = obj_lookup(mdid, OBJ_TYPE_MD); + if (md == NULL) + return (errno); + + memset(&ioc, 0, sizeof(ioc)); + ioc.request = PROTO_IOC_BUSDMA_MD_LOAD; + ioc.key = md->key; + ioc.u.md.flags = flags; + ioc.u.md.virt_addr = (uintptr_t)buf; + ioc.u.md.virt_size = len; + if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) + return (errno); + + printf("XXX: %s: phys(%d, %#lx), bus(%d, %#lx)\n", __func__, + ioc.u.md.phys_nsegs, ioc.u.md.phys_addr, + ioc.u.md.bus_nsegs, ioc.u.md.bus_addr); + + error = bd_md_add_seg(md, BUSDMA_MD_VIRT, ioc.u.md.virt_addr, len); + error = bd_md_add_seg(md, BUSDMA_MD_PHYS, ioc.u.md.phys_addr, len); + error = bd_md_add_seg(md, BUSDMA_MD_BUS, ioc.u.md.bus_addr, len); + return (error); +} + +int +bd_mem_alloc(int tid, u_int flags) +{ + struct proto_ioc_busdma ioc; + struct obj *md, *tag; + uintptr_t addr; + int error; + + tag = obj_lookup(tid, OBJ_TYPE_TAG); + if (tag == NULL) + return (-1); + + md = obj_alloc(OBJ_TYPE_MD); + if (md == NULL) + return (-1); + + memset(&ioc, 0, sizeof(ioc)); + ioc.request = PROTO_IOC_BUSDMA_MEM_ALLOC; + ioc.u.md.tag = tag->key; + ioc.u.md.flags = flags; + if (ioctl(tag->fd, PROTO_IOC_BUSDMA, &ioc) == -1) { + obj_free(md); + return (-1); + } + + md->refcnt = 1; + md->fd = tag->fd; + md->parent = tag; + tag->refcnt++; + md->key = ioc.result; + + printf("XXX: %s: phys(%d, %#lx), bus(%d, %#lx)\n", __func__, + ioc.u.md.phys_nsegs, ioc.u.md.phys_addr, + ioc.u.md.bus_nsegs, ioc.u.md.bus_addr); + + /* XXX we need to support multiple segments */ + assert(ioc.u.md.phys_nsegs == 1); + assert(ioc.u.md.bus_nsegs == 1); + error = bd_md_add_seg(md, BUSDMA_MD_PHYS, ioc.u.md.phys_addr, + tag->u.tag.maxsz); + error = bd_md_add_seg(md, BUSDMA_MD_BUS, ioc.u.md.bus_addr, + tag->u.tag.maxsz); + + addr = (uintptr_t)mmap(NULL, tag->u.tag.maxsz, PROT_READ | PROT_WRITE, + MAP_NOCORE | MAP_SHARED, md->fd, ioc.u.md.phys_addr); + if (addr == (uintptr_t)MAP_FAILED) goto fail; - vseg->u.seg.size = pseg->u.seg.size; - md->u.md.seg[BUSDMA_MD_VIRT] = vseg; - md->u.md.nsegs[BUSDMA_MD_VIRT] = 1; + error = bd_md_add_seg(md, BUSDMA_MD_VIRT, addr, tag->u.tag.maxsz); return (md->oid); fail: - if (vseg != NULL) - obj_free(vseg); - if (pseg != NULL) - obj_free(pseg); - if (bseg != NULL) - obj_free(bseg); memset(&ioc, 0, sizeof(ioc)); ioc.request = PROTO_IOC_BUSDMA_MEM_FREE; ioc.key = md->key; Modified: head/tools/bus_space/busdma.h ============================================================================== --- head/tools/bus_space/busdma.h Fri Jul 3 01:55:06 2015 (r285070) +++ head/tools/bus_space/busdma.h Fri Jul 3 02:06:47 2015 (r285071) @@ -37,6 +37,10 @@ int bd_tag_derive(int tid, u_long align, u_int flags); int bd_tag_destroy(int tid); +int bd_md_create(int tid, u_int flags); +int bd_md_destroy(int mdid); +int bd_md_load(int mdid, void *buf, u_long len, u_int flags); + int bd_mem_alloc(int tid, u_int flags); int bd_mem_free(int mdid); From owner-svn-src-head@freebsd.org Fri Jul 3 03:32:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE7F499470B; Fri, 3 Jul 2015 03:32:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C02E31E1A; Fri, 3 Jul 2015 03:32:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t633WsA6099679; Fri, 3 Jul 2015 03:32:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t633WsVP099678; Fri, 3 Jul 2015 03:32:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201507030332.t633WsVP099678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 Jul 2015 03:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285072 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 03:32:54 -0000 Author: adrian Date: Fri Jul 3 03:32:54 2015 New Revision: 285072 URL: https://svnweb.freebsd.org/changeset/base/285072 Log: Add register defines for the QCA955x DDR flush and GPIO control. Modified: head/sys/mips/atheros/qca955xreg.h Modified: head/sys/mips/atheros/qca955xreg.h ============================================================================== --- head/sys/mips/atheros/qca955xreg.h Fri Jul 3 02:06:47 2015 (r285071) +++ head/sys/mips/atheros/qca955xreg.h Fri Jul 3 03:32:54 2015 (r285072) @@ -179,6 +179,13 @@ #define QCA955X_RESET_I2S BIT(0) /* GPIO block */ +#define QCA955X_GPIO_REG_OUT_FUNC0 0x2c +#define QCA955X_GPIO_REG_OUT_FUNC1 0x30 +#define QCA955X_GPIO_REG_OUT_FUNC2 0x34 +#define QCA955X_GPIO_REG_OUT_FUNC3 0x38 +#define QCA955X_GPIO_REG_OUT_FUNC4 0x3c +#define QCA955X_GPIO_REG_OUT_FUNC5 0x40 +#define QCA955X_GPIO_REG_FUNC 0x6c #define QCA955X_GPIO_COUNT 24 #define QCA955X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000) @@ -204,6 +211,10 @@ #define QCA955X_DDR_REG_FLUSH_USB (AR71XX_APB_BASE + 0xa4) #define QCA955X_DDR_REG_FLUSH_PCIE (AR71XX_APB_BASE + 0xa8) #define QCA955X_DDR_REG_FLUSH_WMAC (AR71XX_APB_BASE + 0xac) +/* PCIe EP */ +#define QCA955X_DDR_REG_FLUSH_SRC1 (AR71XX_APB_BSAE + 0xb0) +/* checksum engine */ +#define QCA955X_DDR_REG_FLUSH_SRC2 (AR71XX_APB_BSAE + 0xb2) /* PCIe control block - relative to PCI_CTRL_BASE0/PCI_CTRL_BASE1 */ From owner-svn-src-head@freebsd.org Fri Jul 3 03:34:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADA5C99476A; Fri, 3 Jul 2015 03:34:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F62B2027; Fri, 3 Jul 2015 03:34:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t633YM5S000155; Fri, 3 Jul 2015 03:34:22 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t633YMCa000153; Fri, 3 Jul 2015 03:34:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201507030334.t633YMCa000153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 Jul 2015 03:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285073 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 03:34:22 -0000 Author: adrian Date: Fri Jul 3 03:34:21 2015 New Revision: 285073 URL: https://svnweb.freebsd.org/changeset/base/285073 Log: Enable setting the QCA955x GPIO output mux configuration. It's not used by any boards yet, but it's going to creep up soon as more boards show up. Modified: head/sys/mips/atheros/qca955x_chip.c Modified: head/sys/mips/atheros/qca955x_chip.c ============================================================================== --- head/sys/mips/atheros/qca955x_chip.c Fri Jul 3 03:32:54 2015 (r285072) +++ head/sys/mips/atheros/qca955x_chip.c Fri Jul 3 03:34:21 2015 (r285073) @@ -351,7 +351,7 @@ qca955x_chip_reset_nfc(int active) /* * Configure the GPIO output mux setup. * - * The AR934x introduced an output mux which allowed + * The QCA955x has an output mux which allowed * certain functions to be configured on any pin. * Specifically, the switch PHY link LEDs and * WMAC external RX LNA switches are not limited to @@ -360,14 +360,13 @@ qca955x_chip_reset_nfc(int active) static void qca955x_chip_gpio_output_configure(int gpio, uint8_t func) { -#if 0 uint32_t reg, s; uint32_t t; if (gpio > QCA955X_GPIO_COUNT) return; - reg = AR934X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4); + reg = QCA955X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4); s = 8 * (gpio % 4); /* read-modify-write */ @@ -378,7 +377,6 @@ qca955x_chip_gpio_output_configure(int g /* flush write */ ATH_READ_REG(AR71XX_GPIO_BASE + reg); -#endif } struct ar71xx_cpu_def qca955x_chip_def = { From owner-svn-src-head@freebsd.org Fri Jul 3 05:45:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0446F993D67; Fri, 3 Jul 2015 05:45:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFADB2F70; Fri, 3 Jul 2015 05:44:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t635ixE9074279; Fri, 3 Jul 2015 05:44:59 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t635ixbS074277; Fri, 3 Jul 2015 05:44:59 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201507030544.t635ixbS074277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 3 Jul 2015 05:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285074 - head/sys/dev/proto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 05:45:00 -0000 Author: marcel Date: Fri Jul 3 05:44:58 2015 New Revision: 285074 URL: https://svnweb.freebsd.org/changeset/base/285074 Log: Implement unload and sync operations. Modified: head/sys/dev/proto/proto_busdma.c head/sys/dev/proto/proto_dev.h Modified: head/sys/dev/proto/proto_busdma.c ============================================================================== --- head/sys/dev/proto/proto_busdma.c Fri Jul 3 03:34:21 2015 (r285073) +++ head/sys/dev/proto/proto_busdma.c Fri Jul 3 05:44:58 2015 (r285074) @@ -306,6 +306,28 @@ proto_busdma_md_load(struct proto_busdma return (0); } +static int +proto_busdma_md_unload(struct proto_busdma *busdma, struct proto_md *md) +{ + + if (!md->physaddr) + return (ENXIO); + bus_dmamap_unload(md->bd_tag, md->bd_map); + md->physaddr = 0; + return (0); +} + +static int +proto_busdma_sync(struct proto_busdma *busdma, struct proto_md *md, + struct proto_ioc_busdma *ioc) +{ + + if (!md->physaddr) + return (ENXIO); + bus_dmamap_sync(md->bd_tag, md->bd_map, ioc->u.sync.op); + return (0); +} + static struct proto_md * proto_busdma_md_lookup(struct proto_busdma *busdma, u_long key) { @@ -419,6 +441,22 @@ proto_busdma_ioctl(struct proto_softc *s } error = proto_busdma_md_load(busdma, md, ioc, td); break; + case PROTO_IOC_BUSDMA_MD_UNLOAD: + md = proto_busdma_md_lookup(busdma, ioc->key); + if (md == NULL) { + error = EINVAL; + break; + } + error = proto_busdma_md_unload(busdma, md); + break; + case PROTO_IOC_BUSDMA_SYNC: + md = proto_busdma_md_lookup(busdma, ioc->key); + if (md == NULL) { + error = EINVAL; + break; + } + error = proto_busdma_sync(busdma, md, ioc); + break; default: error = EINVAL; break; Modified: head/sys/dev/proto/proto_dev.h ============================================================================== --- head/sys/dev/proto/proto_dev.h Fri Jul 3 03:34:21 2015 (r285073) +++ head/sys/dev/proto/proto_dev.h Fri Jul 3 05:44:58 2015 (r285074) @@ -50,6 +50,8 @@ struct proto_ioc_busdma { #define PROTO_IOC_BUSDMA_MD_CREATE 20 #define PROTO_IOC_BUSDMA_MD_DESTROY 21 #define PROTO_IOC_BUSDMA_MD_LOAD 22 +#define PROTO_IOC_BUSDMA_MD_UNLOAD 29 +#define PROTO_IOC_BUSDMA_SYNC 30 unsigned long key; union { struct { @@ -72,6 +74,11 @@ struct proto_ioc_busdma { unsigned long bus_addr; unsigned int bus_nsegs; } md; + struct { + unsigned int op; + unsigned long base; + unsigned long size; + } sync; } u; unsigned long result; }; From owner-svn-src-head@freebsd.org Fri Jul 3 05:47:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 631E4993DA3; Fri, 3 Jul 2015 05:47:58 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AFC810CC; Fri, 3 Jul 2015 05:47:58 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t635lwDU074938; Fri, 3 Jul 2015 05:47:58 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t635luev074933; Fri, 3 Jul 2015 05:47:56 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201507030547.t635luev074933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 3 Jul 2015 05:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285075 - in head/tools/bus_space: . C Python X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 05:47:58 -0000 Author: marcel Date: Fri Jul 3 05:47:56 2015 New Revision: 285075 URL: https://svnweb.freebsd.org/changeset/base/285075 Log: Implement busdma_md_unload() and busdma_sync(). While here: 1. have the Python bindings contain constants for the space identifiers and the sync operation. 2. change the segment iterators to return None when done, not ENXIO. Modified: head/tools/bus_space/C/lang.c head/tools/bus_space/C/libbus.h head/tools/bus_space/Python/lang.c head/tools/bus_space/busdma.c head/tools/bus_space/busdma.h Modified: head/tools/bus_space/C/lang.c ============================================================================== --- head/tools/bus_space/C/lang.c Fri Jul 3 05:44:58 2015 (r285074) +++ head/tools/bus_space/C/lang.c Fri Jul 3 05:47:56 2015 (r285075) @@ -182,6 +182,13 @@ busdma_md_load(busdma_md_t md, void *buf return (bd_md_load(md, buf, len, flags)); } +int +busdma_md_unload(busdma_md_t md) +{ + + return (bd_md_unload(md)); +} + busdma_seg_t busdma_md_first_seg(busdma_md_t md, int space) { @@ -218,3 +225,10 @@ busdma_seg_get_size(busdma_seg_t seg) error = bd_seg_get_size(seg, &size); return ((error) ? ~0UL : size); } + +int +busdma_sync(busdma_md_t md, int op, bus_addr_t base, bus_size_t size) +{ + + return (bd_sync(md, op, base, size)); +} Modified: head/tools/bus_space/C/libbus.h ============================================================================== --- head/tools/bus_space/C/libbus.h Fri Jul 3 05:44:58 2015 (r285074) +++ head/tools/bus_space/C/libbus.h Fri Jul 3 05:47:56 2015 (r285075) @@ -61,6 +61,7 @@ int busdma_mem_free(busdma_md_t md); int busdma_md_create(busdma_tag_t tag, u_int flags, busdma_md_t *out_p); int busdma_md_destroy(busdma_md_t md); int busdma_md_load(busdma_md_t md, void *buf, size_t len, u_int flags); +int busdma_md_unload(busdma_md_t md); #define BUSDMA_MD_BUS_SPACE 0 #define BUSDMA_MD_PHYS_SPACE 1 @@ -72,4 +73,11 @@ int busdma_md_next_seg(busdma_md_t, busd bus_addr_t busdma_seg_get_addr(busdma_seg_t seg); bus_size_t busdma_seg_get_size(busdma_seg_t seg); +#define BUSDMA_SYNC_PREREAD 1 +#define BUSDMA_SYNC_POSTREAD 2 +#define BUSDMA_SYNC_PREWRITE 4 +#define BUSDMA_SYNC_POSTWRITE 8 + +int busdma_sync(busdma_md_t md, int op, bus_addr_t, bus_size_t); + #endif /* _LIBBUS_SPACE_H_ */ Modified: head/tools/bus_space/Python/lang.c ============================================================================== --- head/tools/bus_space/Python/lang.c Fri Jul 3 05:44:58 2015 (r285074) +++ head/tools/bus_space/Python/lang.c Fri Jul 3 05:47:56 2015 (r285075) @@ -278,6 +278,21 @@ busdma_md_load(PyObject *self, PyObject } static PyObject * +busdma_md_unload(PyObject *self, PyObject *args) +{ + int error, mdid; + + if (!PyArg_ParseTuple(args, "i", &mdid)) + return (NULL); + error = bd_md_unload(mdid); + if (error) { + PyErr_SetString(PyExc_IOError, strerror(error)); + return (NULL); + } + Py_RETURN_NONE; +} + +static PyObject * busdma_mem_alloc(PyObject *self, PyObject *args) { u_int flags; @@ -316,10 +331,8 @@ busdma_md_first_seg(PyObject *self, PyOb if (!PyArg_ParseTuple(args, "ii", &mdid, &what)) return (NULL); sid = bd_md_first_seg(mdid, what); - if (sid == -1) { - PyErr_SetString(PyExc_IOError, strerror(errno)); - return (NULL); - } + if (sid == -1) + Py_RETURN_NONE; return (Py_BuildValue("i", sid)); } @@ -331,10 +344,8 @@ busdma_md_next_seg(PyObject *self, PyObj if (!PyArg_ParseTuple(args, "ii", &mdid, &sid)) return (NULL); sid = bd_md_next_seg(mdid, sid); - if (sid == -1) { - PyErr_SetString(PyExc_IOError, strerror(errno)); - return (NULL); - } + if (sid == -1) + Py_RETURN_NONE; return (Py_BuildValue("i", sid)); } @@ -370,6 +381,22 @@ busdma_seg_get_size(PyObject *self, PyOb return (Py_BuildValue("k", size)); } +static PyObject * +busdma_sync(PyObject *self, PyObject *args) +{ + u_long base, size; + int error, mdid, op; + + if (!PyArg_ParseTuple(args, "iikk", &mdid, &op, &base, &size)) + return (NULL); + error = bd_sync(mdid, op, base, size); + if (error) { + PyErr_SetString(PyExc_IOError, strerror(error)); + return (NULL); + } + Py_RETURN_NONE; +} + static PyMethodDef bus_methods[] = { { "read_1", bus_read_1, METH_VARARGS, "Read a 1-byte data item." }, { "read_2", bus_read_2, METH_VARARGS, "Read a 2-byte data item." }, @@ -403,6 +430,8 @@ static PyMethodDef busdma_methods[] = { "Destroy a previously created memory descriptor." }, { "md_load", busdma_md_load, METH_VARARGS, "Load a buffer into a memory descriptor." }, + { "md_unload", busdma_md_unload, METH_VARARGS, + "Unload a memory descriptor." }, { "mem_alloc", busdma_mem_alloc, METH_VARARGS, "Allocate memory according to the DMA constraints." }, @@ -417,13 +446,32 @@ static PyMethodDef busdma_methods[] = { "Return the address of the segment." }, { "seg_get_size", busdma_seg_get_size, METH_VARARGS, "Return the size of the segment." }, + + { "sync", busdma_sync, METH_VARARGS, + "Keep memory/caches coherent WRT to DMA." }, + { NULL, NULL, 0, NULL } }; PyMODINIT_FUNC initbus(void) { + PyObject *bus, *busdma; - Py_InitModule("bus", bus_methods); - Py_InitModule("busdma", busdma_methods); + bus = Py_InitModule("bus", bus_methods); + if (bus == NULL) + return; + busdma = Py_InitModule("busdma", busdma_methods); + if (busdma == NULL) + return; + PyModule_AddObject(bus, "dma", busdma); + + PyModule_AddObject(busdma, "MD_BUS_SPACE", Py_BuildValue("i", 0)); + PyModule_AddObject(busdma, "MD_PHYS_SPACE", Py_BuildValue("i", 1)); + PyModule_AddObject(busdma, "MD_VIRT_SPACE", Py_BuildValue("i", 2)); + + PyModule_AddObject(busdma, "SYNC_PREREAD", Py_BuildValue("i", 1)); + PyModule_AddObject(busdma, "SYNC_POSTREAD", Py_BuildValue("i", 2)); + PyModule_AddObject(busdma, "SYNC_PREWRITE", Py_BuildValue("i", 4)); + PyModule_AddObject(busdma, "SYNC_POSTWRITE", Py_BuildValue("i", 8)); } Modified: head/tools/bus_space/busdma.c ============================================================================== --- head/tools/bus_space/busdma.c Fri Jul 3 05:44:58 2015 (r285074) +++ head/tools/bus_space/busdma.c Fri Jul 3 05:47:56 2015 (r285075) @@ -262,6 +262,20 @@ bd_md_add_seg(struct obj *md, int type, return (0); } +static int +bd_md_del_segs(struct obj *md, int type, int unmap) +{ + struct obj *seg, *seg0; + + for (seg = md->u.md.seg[type]; seg != NULL; seg = seg0) { + if (unmap) + munmap((void *)seg->u.seg.address, seg->u.seg.size); + seg0 = seg->u.seg.next; + obj_free(seg); + } + return (0); +} + int bd_md_create(int tid, u_int flags) { @@ -345,6 +359,29 @@ bd_md_load(int mdid, void *buf, u_long l } int +bd_md_unload(int mdid) +{ + struct proto_ioc_busdma ioc; + struct obj *md; + int error; + + md = obj_lookup(mdid, OBJ_TYPE_MD); + if (md == NULL) + return (errno); + + memset(&ioc, 0, sizeof(ioc)); + ioc.request = PROTO_IOC_BUSDMA_MD_UNLOAD; + ioc.key = md->key; + if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) + return (errno); + + bd_md_del_segs(md, BUSDMA_MD_VIRT, 0); + bd_md_del_segs(md, BUSDMA_MD_PHYS, 0); + bd_md_del_segs(md, BUSDMA_MD_BUS, 0); + return (0); +} + +int bd_mem_alloc(int tid, u_int flags) { struct proto_ioc_busdma ioc; @@ -409,31 +446,21 @@ int bd_mem_free(int mdid) { struct proto_ioc_busdma ioc; - struct obj *md, *seg, *seg0; + struct obj *md; md = obj_lookup(mdid, OBJ_TYPE_MD); if (md == NULL) return (errno); - for (seg = md->u.md.seg[BUSDMA_MD_VIRT]; seg != NULL; seg = seg0) { - munmap((void *)seg->u.seg.address, seg->u.seg.size); - seg0 = seg->u.seg.next; - obj_free(seg); - } - for (seg = md->u.md.seg[BUSDMA_MD_PHYS]; seg != NULL; seg = seg0) { - seg0 = seg->u.seg.next; - obj_free(seg); - } - for (seg = md->u.md.seg[BUSDMA_MD_BUS]; seg != NULL; seg = seg0) { - seg0 = seg->u.seg.next; - obj_free(seg); - } memset(&ioc, 0, sizeof(ioc)); ioc.request = PROTO_IOC_BUSDMA_MEM_FREE; ioc.key = md->key; if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) return (errno); + bd_md_del_segs(md, BUSDMA_MD_VIRT, 1); + bd_md_del_segs(md, BUSDMA_MD_PHYS, 0); + bd_md_del_segs(md, BUSDMA_MD_BUS, 0); md->parent->refcnt--; obj_free(md); return (0); @@ -509,3 +536,25 @@ bd_seg_get_size(int sid, u_long *size_p) *size_p = seg->u.seg.size; return (0); } + +int +bd_sync(int mdid, u_int op, u_long base, u_long size) +{ + struct proto_ioc_busdma ioc; + struct obj *md; + + md = obj_lookup(mdid, OBJ_TYPE_MD); + if (md == NULL) + return (errno); + + memset(&ioc, 0, sizeof(ioc)); + ioc.request = PROTO_IOC_BUSDMA_SYNC; + ioc.key = md->key; + ioc.u.sync.op = op; + ioc.u.sync.base = base; + ioc.u.sync.size = size; + if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) + return (errno); + + return (0); +} Modified: head/tools/bus_space/busdma.h ============================================================================== --- head/tools/bus_space/busdma.h Fri Jul 3 05:44:58 2015 (r285074) +++ head/tools/bus_space/busdma.h Fri Jul 3 05:47:56 2015 (r285075) @@ -40,6 +40,7 @@ int bd_tag_destroy(int tid); int bd_md_create(int tid, u_int flags); int bd_md_destroy(int mdid); int bd_md_load(int mdid, void *buf, u_long len, u_int flags); +int bd_md_unload(int mdid); int bd_mem_alloc(int tid, u_int flags); int bd_mem_free(int mdid); @@ -50,4 +51,6 @@ int bd_md_next_seg(int mdid, int sid); int bd_seg_get_addr(int sid, u_long *); int bd_seg_get_size(int sid, u_long *); +int bd_sync(int mdid, u_int op, u_long base, u_long size); + #endif /* _TOOLS_BUS_DMA_H_ */ From owner-svn-src-head@freebsd.org Fri Jul 3 06:01:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA1929921C0; Fri, 3 Jul 2015 06:01:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB6AA1C98; Fri, 3 Jul 2015 06:01:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6361bvW084319; Fri, 3 Jul 2015 06:01:37 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6361bRS084318; Fri, 3 Jul 2015 06:01:37 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201507030601.t6361bRS084318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 3 Jul 2015 06:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285076 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 06:01:38 -0000 Author: gjb Date: Fri Jul 3 06:01:37 2015 New Revision: 285076 URL: https://svnweb.freebsd.org/changeset/base/285076 Log: Fix the real problem with missing UFS/MSDOSFS labels on the FreeBSD/arm builds. The problem stems from the loader.rc file not existing, as well as geom_label not being loaded at boot. For now, add the geom_label_load entry to loader.conf, and symlink loader.rc.sample to loader.rc, both of which allowed my BeagleBone Black to boot fine with a UFS label reference in fstab(5). MFC after: 3 days X-MFC-Before: 10.2-BETA1 Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Fri Jul 3 05:47:56 2015 (r285075) +++ head/release/tools/arm.subr Fri Jul 3 06:01:37 2015 (r285076) @@ -140,6 +140,11 @@ arm_install_base() { echo 'sendmail_msp_queue_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'growfs_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + # The fstab(5) above uses UFS/MSDOSFS labels. + echo 'geom_label_load="YES"' >> ${CHROOTDIR}/boot/loader.conf + # Workaround missing loader.rc if needed. + chroot ${CHROOTDIR} ln -s /boot/loader.rc.sample /boot/loader.rc + sync umount_loop ${CHROOTDIR}/${DESTDIR} From owner-svn-src-head@freebsd.org Fri Jul 3 06:06:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFD6F99224F; Fri, 3 Jul 2015 06:06:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0DF51E3E; Fri, 3 Jul 2015 06:06:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6366jl7085867; Fri, 3 Jul 2015 06:06:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6366jcs085866; Fri, 3 Jul 2015 06:06:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201507030606.t6366jcs085866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 Jul 2015 06:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285077 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 06:06:45 -0000 Author: adrian Date: Fri Jul 3 06:06:44 2015 New Revision: 285077 URL: https://svnweb.freebsd.org/changeset/base/285077 Log: Add pcb1 to the QCA955x. The Tp-link Archer-C7v2 unit has a QCA9558 internally but hangs the QCA988x 11ac PCIe NIC off of PCI RC #1, not #0. So I actually finally /do/ have a board to verify whether PCIe is working. Grr. Tested: * TP-Link Archer-C7v2. Modified: head/sys/mips/conf/QCA955X_BASE.hints Modified: head/sys/mips/conf/QCA955X_BASE.hints ============================================================================== --- head/sys/mips/conf/QCA955X_BASE.hints Fri Jul 3 06:01:37 2015 (r285076) +++ head/sys/mips/conf/QCA955X_BASE.hints Fri Jul 3 06:06:44 2015 (r285077) @@ -36,7 +36,9 @@ hint.ehci.1.irq=1 hint.pcib.0.at="nexus0" hint.pcib.0.irq=0 -# XXX TODO: PCIe 1: qca955x_int1 (IP3) +# PCIe 1: qca955x_int1 (IP3) +hint.pcib.1.at="nexus0" +hint.pcib.1.irq=1 # IP4 hint.arge.0.at="nexus0" From owner-svn-src-head@freebsd.org Fri Jul 3 06:07:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 900E099227E; Fri, 3 Jul 2015 06:07:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 815BA1F89; Fri, 3 Jul 2015 06:07:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6367MJc086041; Fri, 3 Jul 2015 06:07:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6367MF6086040; Fri, 3 Jul 2015 06:07:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201507030607.t6367MF6086040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 3 Jul 2015 06:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285078 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 06:07:22 -0000 Author: gjb Date: Fri Jul 3 06:07:21 2015 New Revision: 285078 URL: https://svnweb.freebsd.org/changeset/base/285078 Log: Revert r285018 and r285019, which attempted to resolve UFS/MSDOSFS label issues on FreeBSD/arm builds, however the real problem was addressed in r285076, which is due to two separate issues, unrelated to md(4) stale device existence. MFC after: 3 days X-MFC-With: r285076 X-MFC-Before: 10.2-BETA1 Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Fri Jul 3 06:06:44 2015 (r285077) +++ head/release/tools/arm.subr Fri Jul 3 06:07:21 2015 (r285078) @@ -63,18 +63,6 @@ umount_loop() { } arm_create_disk() { - # XXX: This is potentially dangerous, but works around an issue - # properly labeling md(4) devices when the label already - # exists. - # EVERYTHINGISFINE should *never* be set for non-RE use. - # Trust me. I'm an engineer. - if [ ! -z "${EVERYTHINGISFINE}" ]; then - for _label in ufs/rootfs msdosfs/MSDOSBOOT; do - if [ -e "/dev/${_label}" ]; then - rm /dev/${_label} - fi - done - fi # Create the target raw file and temporary work directory. chroot ${CHROOTDIR} gpart create -s ${PART_SCHEME} ${mddev} chroot ${CHROOTDIR} gpart add -t '!12' -a 63 -s ${FAT_SIZE} ${mddev} From owner-svn-src-head@freebsd.org Fri Jul 3 06:09:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B02469922BF; Fri, 3 Jul 2015 06:09:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A013020DD; Fri, 3 Jul 2015 06:09:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6369v7I086564; Fri, 3 Jul 2015 06:09:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6369viV086562; Fri, 3 Jul 2015 06:09:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201507030609.t6369viV086562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 Jul 2015 06:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285079 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 06:09:57 -0000 Author: adrian Date: Fri Jul 3 06:09:56 2015 New Revision: 285079 URL: https://svnweb.freebsd.org/changeset/base/285079 Log: Add initial support for the TP-Link Archer C7 v2. The SoC, the flash, the ethernet ports and ethernet switch all work. The USB works. The 11ac PCIe NIC internally is at least seen by the PCIE RC, but I haven't tried using it yet. There's no driver and I haven't yet swapped it out for a non-11ac chip. The on-chip 2GHz wifi works, but there are some data errors that get thrown up in STA mode when scanning. I have a feeling I have to finish the DDR flush code out and have it run correctly on the shared interrupts; that'll take a bit of time to get right. But if you're after an updated piece of hardware, the Archer C7 v2 is certainly there, and you can replace the 11ac NIC with a 3x3 Atheros PCIe device (eg AR9380, AR9390, AR9580, etc) and it'll "just work". Tested: * TP-Link archer c7v2. Added: head/sys/mips/conf/TL-ARCHERC7V2 (contents, props changed) head/sys/mips/conf/TL-ARCHERC7V2.hints (contents, props changed) Added: head/sys/mips/conf/TL-ARCHERC7V2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/TL-ARCHERC7V2 Fri Jul 3 06:09:56 2015 (r285079) @@ -0,0 +1,68 @@ +# +# TP-Link Archer C7 - based on the AP135 reference design. +# +# This contains a QCA9558 MIPS74k SoC with on-board 3x3 2GHz wifi, +# 128MiB RAM, an AR8327 5-port gigabit ethernet switch and +# a QCA 11ac 5GHz AP NIC. +# +# The to things not currently support are the QCA 11ac NIC and +# PCIe host controllers - there's two of them, and the existing +# PCIe code here doesn't support that just yet. +# +# $FreeBSD$ +# + +# Include the default QCA955x parameters +include "QCA955X_BASE" + +ident TL-ARCHERC7V2 + +# Override hints with board values +hints "TL-ARCHERC7V2.hints" + +# Force the board memory - this has 128MiB RAM +options AR71XX_REALMEM=(128*1024*1024) + +# i2c GPIO bus +#device gpioiic +#device iicbb +#device iicbus +#device iic + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch + +# read MSDOS formatted disks - USB +options MSDOSFS + +# Enable the uboot environment stuff rather then the +# redboot stuff. +options AR71XX_ENV_UBOOT + +# uzip - to boot natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS + +# Used for the static uboot partition map +device geom_map + +# yes, this board has a PCIe connected atheros device +# add ath_pci so it can at least attach things when there's a +# ath(4) in there, rather than the 11ac chip we don't support. +device pci +device qca955x_pci + +device ath_pci +options AR71XX_ATH_EEPROM +device firmware # Used by the above +options ATH_EEPROM_FIRMWARE + +# Boot off of the rootfs, as defined in the geom_map setup. +options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" + +# Default to accept +options IPFIREWALL_DEFAULT_TO_ACCEPT Added: head/sys/mips/conf/TL-ARCHERC7V2.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/TL-ARCHERC7V2.hints Fri Jul 3 06:09:56 2015 (r285079) @@ -0,0 +1,201 @@ +# The Archer C7 v2 is based on the AP135-020 board, with +# TP-Link specific bits (eg flash layout, MAC address, etc.) + +# $FreeBSD$ + +# QCA955X_ETH_CFG_RGMII_EN (1 << 0) +hint.qca955x_gmac.0.gmac_cfg=0x1 + +# Use base mac address for wifi; +1 and +2 for arge0/arge1. +hint.ar71xx.0.eeprom_mac_addr=0x1f01fc00 +hint.ar71xx.0.eeprom_mac_isascii=0 + +hint.ar71xx_mac_map.0.devid=ath +hint.ar71xx_mac_map.0.unitid=0 +hint.ar71xx_mac_map.0.offset=0 +hint.ar71xx_mac_map.0.is_local=0 + +hint.ar71xx_mac_map.1.devid=arge +hint.ar71xx_mac_map.1.unitid=0 +hint.ar71xx_mac_map.1.offset=1 +hint.ar71xx_mac_map.1.is_local=0 + +hint.ar71xx_mac_map.2.devid=arge +hint.ar71xx_mac_map.2.unitid=1 +hint.ar71xx_mac_map.2.offset=2 +hint.ar71xx_mac_map.2.is_local=0 + +# mdiobus0 on arge0 +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x19000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + +# mdiobus1 on arge1 - required to bring up arge1? +hint.argemdio.1.at="nexus0" +hint.argemdio.1.maddr=0x1a000000 +hint.argemdio.1.msize=0x1000 +hint.argemdio.1.order=0 + +# AR8327 - connected via mdiobus0 on arge0 +hint.arswitch.0.at="mdio0" +hint.arswitch.0.is_7240=0 # definitely not the internal switch! +hint.arswitch.0.is_9340=0 # not the internal switch! +hint.arswitch.0.numphys=5 # all ports are PHYs +hint.arswitch.0.phy4cpu=0 +hint.arswitch.0.is_rgmii=0 # not needed +hint.arswitch.0.is_gmii=0 # not needed + +# This is where it gets a bit odd. port 0 and port 6 are CPU ports. +# The current code only supports one CPU port. So hm, what should +# we do to hook PAD6 up to be RGMII but a PHY, not a MAC? + +# The other trick - how do we get arge1 (hooked up to GMAC0) to work? +# That's currently supposed to be hooked up to CPU port 0. + +# Other AR8327 configuration parameters + +# AP136-020 parameters + +# GMAC0 AR8327 -> GMAC1 (arge1) SoC, SGMII + +# AR8327_PAD_MAC_SGMII +hint.arswitch.0.pad.0.mode=3 +#hint.arswitch.0.pad.0.rxclk_delay_sel=0 +hint.arswitch.0.pad.0.sgmii_delay_en=1 + +# GMAC6 AR8327 -> GMAC0 (arge0) SoC, RGMII + +# AR8327_PAD_MAC_RGMII +# XXX I think this hooks it up to the internal MAC6 +hint.arswitch.0.pad.6.mode=6 +hint.arswitch.0.pad.6.txclk_delay_en=1 +hint.arswitch.0.pad.6.rxclk_delay_en=1 +# AR8327_CLK_DELAY_SEL1 +hint.arswitch.0.pad.6.txclk_delay_sel=1 +# AR8327_CLK_DELAY_SEL2 +hint.arswitch.0.pad.6.rxclk_delay_sel=2 + +# XXX there's no LED management just yet! +hint.arswitch.0.led.ctrl0=0xc737c737 +hint.arswitch.0.led.ctrl1=0x00000000 +hint.arswitch.0.led.ctrl2=0x00000000 +hint.arswitch.0.led.ctrl3=0x00c30c00 +hint.arswitch.0.led.open_drain=0 + +# force_link=1 is required for the rest of the parameters +# to be configured. +hint.arswitch.0.port.0.force_link=1 +hint.arswitch.0.port.0.speed=1000 +hint.arswitch.0.port.0.duplex=1 +hint.arswitch.0.port.0.txpause=1 +hint.arswitch.0.port.0.rxpause=1 + +# force_link=1 is required for the rest of the parameters +# to be configured. +hint.arswitch.0.port.6.force_link=1 +hint.arswitch.0.port.6.speed=1000 +hint.arswitch.0.port.6.duplex=1 +hint.arswitch.0.port.6.txpause=1 +hint.arswitch.0.port.6.rxpause=1 + +# arge0 - hooked up to AR8327 GMAC6, RGMII +# set at 1000/full to the switch. +# so, lock both sides of this connect up to 1000/full; +# if_arge thus wont change the PLL configuration +# upon a link status change. +hint.arge.0.phymask=0x0 +hint.arge.0.miimode=3 # RGMII +hint.arge.0.media=1000 +hint.arge.0.fduplex=1 +hint.arge.0.pll_1000=0x56000000 + +# MAC for arge0 is the first 6 bytes of the ART +hint.arge.0.eeprommac=0x1fff0000 + +# arge1 - lock up to 1000/full +hint.arge.1.phymask=0x0 +hint.arge.1.media=1000 +hint.arge.1.fduplex=1 +hint.arge.1.miimode=5 # SGMII +hint.arge.1.pll_1000=0x03000101 + +# MAC for arge1 is the second 6 bytes of the ART +hint.arge.1.eeprommac=0x1fff0006 + +# ath0: Where the ART is - last 64k in the flash +hint.ath.0.eepromaddr=0x1fff0000 +hint.ath.0.eepromsize=16384 + +# ath1: it's different; it's a PCIe attached device, so +# we instead need to teach the PCIe bridge code about it +# (ie, the 'early pci fixup' stuff that programs the PCIe +# host registers on the NIC) and then we teach ath where +# to find it. + +# ath1 hint - pcie slot 0 +# hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff4000 +# hint.pcib.0.bus.0.0.0.ath_fixup_size=16384 + +# ath0 - eeprom comes from here +# hint.ath.1.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware" + +# Flash layout - the tplink layout differs to what's passed +# in via the kernel environment. What's passed in is based on +# the AP135, but.. well, TP-Link. + +# 128 KiB u-boot +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00020000 # 128k u-boot +hint.map.0.name="u-boot" +hint.map.0.readonly=1 + +# Kernel +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00020000 +hint.map.1.end="search:0x00020000:0x10000:.!/bin/sh" +hint.map.1.name="kernel" +hint.map.1.readonly=1 + +# Root +hint.map.2.at="flash/spi0" +hint.map.2.start="search:0x00020000:0x10000:.!/bin/sh" +hint.map.2.end=0x007d0000 +hint.map.2.name="rootfs" +hint.map.2.readonly=1 + +# 64KiB cfg +hint.map.4.at="flash/spi0" +hint.map.4.start=0x00fe0000 +hint.map.4.end=0x00ff0000 +hint.map.4.name="cfg" +hint.map.4.readonly=0 + +# 64KiB ART +hint.map.6.at="flash/spi0" +hint.map.6.start=0x00ff0000 +hint.map.6.end=0x01000000 # 64k ART +hint.map.6.name="ART" +hint.map.6.readonly=1 + +# TODO: GPIO config +# These are the GPIO LEDs and buttons which can be software controlled. +hint.gpio.0.pinmask=0x00600000 + +# Enable GPIO21, GPIO22 output and high - for USB power +hint.gpio.0.pinon=0x00600000 + +# TODO: GPIO pin config: +# LED_WLAN2G 12 +# BTN_RFKILL 13 +# LED_SYSTEM 14 +# LED_QSS 15 +# BTN_RESET 16 +# LED_WLAN5G 17 +# LED_USB1 18 +# LED_USB2 19 +# USB2_POWER 21 +# USB1_POWER 22 + +# TODO: PCIe isn't showing link; maybe uboot isn't initialising From owner-svn-src-head@freebsd.org Fri Jul 3 06:10:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E80C99922F8; Fri, 3 Jul 2015 06:10:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D93B3221F; Fri, 3 Jul 2015 06:10:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t636A9XY086739; Fri, 3 Jul 2015 06:10:09 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t636A94t086738; Fri, 3 Jul 2015 06:10:09 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201507030610.t636A94t086738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 3 Jul 2015 06:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285080 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 06:10:10 -0000 Author: sjg Date: Fri Jul 3 06:10:09 2015 New Revision: 285080 URL: https://svnweb.freebsd.org/changeset/base/285080 Log: Fix generation of src.conf.5 Since makeman turns all options on, we need to guard somethings from make(showconfig) Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Fri Jul 3 06:09:56 2015 (r285079) +++ head/Makefile Fri Jul 3 06:10:09 2015 (r285080) @@ -102,7 +102,7 @@ # Note: we use this awkward construct to be compatible with FreeBSD's # old make used in 10.0 and 9.2 and earlier. -.if defined(MK_META_MODE) && ${MK_META_MODE} == "yes" +.if defined(MK_META_MODE) && ${MK_META_MODE} == "yes" && !make(showconfig) # targets/Makefile plays the role of top-level .include "targets/Makefile" .else @@ -538,7 +538,9 @@ MK_META_MODE= no MK_STAGING= no # tell meta.autodep.mk to not even think about updating anything. UPDATE_DEPENDFILE= NO +.if !make(showconfig) .export MK_META_MODE MK_STAGING UPDATE_DEPENDFILE +.endif .if make(universe) # we do not want a failure of one branch abort all. From owner-svn-src-head@freebsd.org Fri Jul 3 06:11:56 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50414992408; Fri, 3 Jul 2015 06:11:56 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 227512612; Fri, 3 Jul 2015 06:11:56 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t636Bu6B090655; Fri, 3 Jul 2015 06:11:56 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t636BtsD090649; Fri, 3 Jul 2015 06:11:55 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201507030611.t636BtsD090649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 3 Jul 2015 06:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285081 - in head: lib/libvmmapi sys/modules/filemon targets/pseudo/userland 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 06:11:56 -0000 Author: sjg Date: Fri Jul 3 06:11:54 2015 New Revision: 285081 URL: https://svnweb.freebsd.org/changeset/base/285081 Log: Updated depends Added: head/sys/modules/filemon/Makefile.depend (contents, props changed) head/usr.sbin/bhyve/Makefile.depend (contents, props changed) Modified: head/lib/libvmmapi/Makefile.depend head/targets/pseudo/userland/Makefile.depend Modified: head/lib/libvmmapi/Makefile.depend ============================================================================== --- head/lib/libvmmapi/Makefile.depend Fri Jul 3 06:10:09 2015 (r285080) +++ head/lib/libvmmapi/Makefile.depend Fri Jul 3 06:11:54 2015 (r285081) @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ Added: head/sys/modules/filemon/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/filemon/Makefile.depend Fri Jul 3 06:11:54 2015 (r285081) @@ -0,0 +1,13 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +filemon.o: opt_compat.h +filemon.po: opt_compat.h +.endif Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Fri Jul 3 06:10:09 2015 (r285080) +++ head/targets/pseudo/userland/Makefile.depend Fri Jul 3 06:11:54 2015 (r285081) @@ -431,6 +431,7 @@ DIRDEPS+= \ usr.sbin/auditd \ usr.sbin/auditreduce \ usr.sbin/authpf \ + usr.sbin/bhyve \ usr.sbin/bluetooth/ath3kfw \ usr.sbin/bluetooth/bcmfw \ usr.sbin/bluetooth/bt3cfw \ Added: head/usr.sbin/bhyve/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/Makefile.depend Fri Jul 3 06:11:54 2015 (r285081) @@ -0,0 +1,22 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + lib/libmd \ + lib/libthr \ + lib/libutil \ + lib/libvmmapi \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif From owner-svn-src-head@freebsd.org Fri Jul 3 06:15:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CE5099243F; Fri, 3 Jul 2015 06:15:55 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F228E27A7; Fri, 3 Jul 2015 06:15:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t636Fshe091503; Fri, 3 Jul 2015 06:15:54 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t636Fs7t091502; Fri, 3 Jul 2015 06:15:54 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201507030615.t636Fs7t091502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 3 Jul 2015 06:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285082 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 06:15:55 -0000 Author: gjb Date: Fri Jul 3 06:15:54 2015 New Revision: 285082 URL: https://svnweb.freebsd.org/changeset/base/285082 Log: Test for loader.rc existence before attempting to create the symlink from loader.rc.sample. Fix paths relative to the CHROOTDIR. MFC after: 3 days X-MFC-With: r285076, r285078 X-MFC-Before: 10.2-BETA1 Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Fri Jul 3 06:11:54 2015 (r285081) +++ head/release/tools/arm.subr Fri Jul 3 06:15:54 2015 (r285082) @@ -129,9 +129,12 @@ arm_install_base() { echo 'growfs_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf # The fstab(5) above uses UFS/MSDOSFS labels. - echo 'geom_label_load="YES"' >> ${CHROOTDIR}/boot/loader.conf + echo 'geom_label_load="YES"' >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf # Workaround missing loader.rc if needed. - chroot ${CHROOTDIR} ln -s /boot/loader.rc.sample /boot/loader.rc + if [ ! -e "${CHROOTDIR}/${DESTDIR}/boot/loader.rc" ]; then + chroot ${CHROOTDIR} \ + ln -s /boot/loader.rc.sample ${DESTDIR}/boot/loader.rc + fi sync umount_loop ${CHROOTDIR}/${DESTDIR} From owner-svn-src-head@freebsd.org Fri Jul 3 07:00:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07390992C40; Fri, 3 Jul 2015 07:00:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC3D21810; Fri, 3 Jul 2015 07:00:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6370OAg015170; Fri, 3 Jul 2015 07:00:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6370Oer015169; Fri, 3 Jul 2015 07:00:24 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201507030700.t6370Oer015169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 Jul 2015 07:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285083 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 07:00:25 -0000 Author: adrian Date: Fri Jul 3 07:00:24 2015 New Revision: 285083 URL: https://svnweb.freebsd.org/changeset/base/285083 Log: Oops - fix typo. Modified: head/sys/mips/atheros/qca955xreg.h Modified: head/sys/mips/atheros/qca955xreg.h ============================================================================== --- head/sys/mips/atheros/qca955xreg.h Fri Jul 3 06:15:54 2015 (r285082) +++ head/sys/mips/atheros/qca955xreg.h Fri Jul 3 07:00:24 2015 (r285083) @@ -212,9 +212,9 @@ #define QCA955X_DDR_REG_FLUSH_PCIE (AR71XX_APB_BASE + 0xa8) #define QCA955X_DDR_REG_FLUSH_WMAC (AR71XX_APB_BASE + 0xac) /* PCIe EP */ -#define QCA955X_DDR_REG_FLUSH_SRC1 (AR71XX_APB_BSAE + 0xb0) +#define QCA955X_DDR_REG_FLUSH_SRC1 (AR71XX_APB_BASE + 0xb0) /* checksum engine */ -#define QCA955X_DDR_REG_FLUSH_SRC2 (AR71XX_APB_BSAE + 0xb2) +#define QCA955X_DDR_REG_FLUSH_SRC2 (AR71XX_APB_BASE + 0xb2) /* PCIe control block - relative to PCI_CTRL_BASE0/PCI_CTRL_BASE1 */ From owner-svn-src-head@freebsd.org Fri Jul 3 09:53:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A56E6990AFF; Fri, 3 Jul 2015 09:53:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90A1A2BC3; Fri, 3 Jul 2015 09:53:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t639rvH4002050; Fri, 3 Jul 2015 09:53:57 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t639rvh9002049; Fri, 3 Jul 2015 09:53:57 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201507030953.t639rvh9002049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 3 Jul 2015 09:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285084 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 09:53:57 -0000 Author: bz Date: Fri Jul 3 09:53:56 2015 New Revision: 285084 URL: https://svnweb.freebsd.org/changeset/base/285084 Log: Move comment to the right position. PR: 152791 Submitted by: vangyzen (as part of the functional change) MFC after: 3 days Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Fri Jul 3 07:00:24 2015 (r285083) +++ head/sys/netinet6/icmp6.c Fri Jul 3 09:53:56 2015 (r285084) @@ -2404,7 +2404,6 @@ icmp6_redirect_input(struct mbuf *m, int icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); goto bad; } - /* validation passed */ icmp6len -= sizeof(*nd_rd); nd6_option_init(nd_rd + 1, icmp6len, &ndopts); @@ -2429,6 +2428,8 @@ icmp6_redirect_input(struct mbuf *m, int goto bad; } + /* Validation passed. */ + /* RFC 2461 8.3 */ nd6_cache_lladdr(ifp, &redtgt6, lladdr, lladdrlen, ND_REDIRECT, is_onlink ? ND_REDIRECT_ONLINK : ND_REDIRECT_ROUTER); From owner-svn-src-head@freebsd.org Fri Jul 3 10:04:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A6B3990EDC; Fri, 3 Jul 2015 10:04:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01C201150; Fri, 3 Jul 2015 10:04:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63A4fg9007117; Fri, 3 Jul 2015 10:04:41 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63A4fNq007116; Fri, 3 Jul 2015 10:04:41 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201507031004.t63A4fNq007116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 3 Jul 2015 10:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285085 - head/usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 10:04:42 -0000 Author: trasz Date: Fri Jul 3 10:04:41 2015 New Revision: 285085 URL: https://svnweb.freebsd.org/changeset/base/285085 Log: User proper terminology - iSCSI sessions, not iSCSI connections. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctladm/ctladm.8 Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Fri Jul 3 09:53:56 2015 (r285084) +++ head/usr.sbin/ctladm/ctladm.8 Fri Jul 3 10:04:41 2015 (r285085) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd May 22, 2015 +.Dd June 3, 2015 .Dt CTLADM 8 .Os .Sh NAME @@ -951,21 +951,21 @@ If you specify the entire LUN database is displayed in XML format. .El .It Ic islist -Get a list of currently running iSCSI connections. +Get a list of currently running iSCSI sessions. This includes initiator and target names and the unique connection IDs. .Bl -tag -width 11n .It Fl v Verbose mode. .It Fl x Dump the raw XML. -The connections list information from the kernel comes in XML format, and this +The sessions list information from the kernel comes in XML format, and this option allows the display of the raw XML data. .El .It Ic islogout -Ask the initiator to log out iSCSI connections matching criteria. +Ask the initiator to log out iSCSI sessions matching criteria. .Bl -tag -width 11n .It Fl a -Log out all connections. +Log out all sessions. .It Fl c Specify connection ID. .It Fl i @@ -974,10 +974,10 @@ Specify initiator name. Specify initiator portal (hostname or IP address). .El .It Ic isterminate -Forcibly terminate iSCSI connections matching criteria. +Forcibly terminate iSCSI sessions matching criteria. .Bl -tag -width 11n .It Fl a -Terminate all connections. +Terminate all sessions. .It Fl c Specify connection ID. .It Fl i From owner-svn-src-head@freebsd.org Fri Jul 3 10:08:12 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5AD6990F57; Fri, 3 Jul 2015 10:08:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5CD712D0; Fri, 3 Jul 2015 10:08:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63A8Cw7007630; Fri, 3 Jul 2015 10:08:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63A8BPj007621; Fri, 3 Jul 2015 10:08:11 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201507031008.t63A8BPj007621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 3 Jul 2015 10:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285086 - in head/usr.sbin: ctld iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 10:08:12 -0000 Author: trasz Date: Fri Jul 3 10:08:10 2015 New Revision: 285086 URL: https://svnweb.freebsd.org/changeset/base/285086 Log: Remove OpenSSL dependency from iscsid(8) and ctld(8). Differential Revision: https://reviews.freebsd.org/D2866 Submitted by: Tony Morlan (earlier version) Reviewed by: bapt@, delphij@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/Makefile head/usr.sbin/ctld/chap.c head/usr.sbin/ctld/ctld.h head/usr.sbin/iscsid/Makefile head/usr.sbin/iscsid/chap.c head/usr.sbin/iscsid/iscsid.h Modified: head/usr.sbin/ctld/Makefile ============================================================================== --- head/usr.sbin/ctld/Makefile Fri Jul 3 10:04:41 2015 (r285085) +++ head/usr.sbin/ctld/Makefile Fri Jul 3 10:08:10 2015 (r285086) @@ -10,7 +10,7 @@ CFLAGS+= -I${.CURDIR}/../../sys/dev/iscs #CFLAGS+= -DICL_KERNEL_PROXY MAN= ctld.8 ctl.conf.5 -LIBADD= bsdxml crypto l sbuf util +LIBADD= bsdxml l md sbuf util YFLAGS+= -v CLEANFILES= y.tab.c y.tab.h y.output Modified: head/usr.sbin/ctld/chap.c ============================================================================== --- head/usr.sbin/ctld/chap.c Fri Jul 3 10:04:41 2015 (r285085) +++ head/usr.sbin/ctld/chap.c Fri Jul 3 10:08:10 2015 (r285086) @@ -32,12 +32,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include -#include -#include -#include +#include #include "ctld.h" @@ -47,17 +46,14 @@ chap_compute_md5(const char id, const ch size_t response_len) { MD5_CTX ctx; - int rv; - assert(response_len == MD5_DIGEST_LENGTH); + assert(response_len == CHAP_DIGEST_LEN); - MD5_Init(&ctx); - MD5_Update(&ctx, &id, sizeof(id)); - MD5_Update(&ctx, secret, strlen(secret)); - MD5_Update(&ctx, challenge, challenge_len); - rv = MD5_Final(response, &ctx); - if (rv != 1) - log_errx(1, "MD5_Final"); + MD5Init(&ctx); + MD5Update(&ctx, &id, sizeof(id)); + MD5Update(&ctx, secret, strlen(secret)); + MD5Update(&ctx, challenge, challenge_len); + MD5Final(response, &ctx); } static int @@ -235,7 +231,6 @@ struct chap * chap_new(void) { struct chap *chap; - int rv; chap = calloc(sizeof(*chap), 1); if (chap == NULL) @@ -244,16 +239,8 @@ chap_new(void) /* * Generate the challenge. */ - rv = RAND_bytes(chap->chap_challenge, sizeof(chap->chap_challenge)); - if (rv != 1) { - log_errx(1, "RAND_bytes failed: %s", - ERR_error_string(ERR_get_error(), NULL)); - } - rv = RAND_bytes(&chap->chap_id, sizeof(chap->chap_id)); - if (rv != 1) { - log_errx(1, "RAND_bytes failed: %s", - ERR_error_string(ERR_get_error(), NULL)); - } + arc4random_buf(chap->chap_challenge, sizeof(chap->chap_challenge)); + arc4random_buf(&chap->chap_id, sizeof(chap->chap_id)); return (chap); } @@ -320,7 +307,7 @@ chap_receive(struct chap *chap, const ch int chap_authenticate(struct chap *chap, const char *secret) { - char expected_response[MD5_DIGEST_LENGTH]; + char expected_response[CHAP_DIGEST_LEN]; chap_compute_md5(chap->chap_id, secret, chap->chap_challenge, sizeof(chap->chap_challenge), @@ -397,7 +384,7 @@ rchap_get_response_bin(struct rchap *rch void **responsep, size_t *response_lenp) { void *response_bin; - size_t response_bin_len = MD5_DIGEST_LENGTH; + size_t response_bin_len = CHAP_DIGEST_LEN; response_bin = calloc(response_bin_len, 1); if (response_bin == NULL) Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Fri Jul 3 10:04:41 2015 (r285085) +++ head/usr.sbin/ctld/ctld.h Fri Jul 3 10:08:10 2015 (r285086) @@ -39,7 +39,6 @@ #include #include #include -#include #define DEFAULT_CONFIG_PATH "/etc/ctl.conf" #define DEFAULT_PIDFILE "/var/run/ctld.pid" @@ -263,11 +262,12 @@ struct keys { }; #define CHAP_CHALLENGE_LEN 1024 +#define CHAP_DIGEST_LEN 16 /* Equal to MD5 digest size. */ struct chap { unsigned char chap_id; char chap_challenge[CHAP_CHALLENGE_LEN]; - char chap_response[MD5_DIGEST_LENGTH]; + char chap_response[CHAP_DIGEST_LEN]; }; struct rchap { Modified: head/usr.sbin/iscsid/Makefile ============================================================================== --- head/usr.sbin/iscsid/Makefile Fri Jul 3 10:04:41 2015 (r285085) +++ head/usr.sbin/iscsid/Makefile Fri Jul 3 10:08:10 2015 (r285086) @@ -8,7 +8,7 @@ CFLAGS+= -I${.CURDIR}/../../sys/dev/iscs #CFLAGS+= -DICL_KERNEL_PROXY MAN= iscsid.8 -LIBADD= crypto util +LIBADD= md util WARNS= 6 Modified: head/usr.sbin/iscsid/chap.c ============================================================================== --- head/usr.sbin/iscsid/chap.c Fri Jul 3 10:04:41 2015 (r285085) +++ head/usr.sbin/iscsid/chap.c Fri Jul 3 10:08:10 2015 (r285086) @@ -32,12 +32,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include -#include -#include -#include +#include #include "iscsid.h" @@ -47,17 +46,14 @@ chap_compute_md5(const char id, const ch size_t response_len) { MD5_CTX ctx; - int rv; - assert(response_len == MD5_DIGEST_LENGTH); + assert(response_len == CHAP_DIGEST_LEN); - MD5_Init(&ctx); - MD5_Update(&ctx, &id, sizeof(id)); - MD5_Update(&ctx, secret, strlen(secret)); - MD5_Update(&ctx, challenge, challenge_len); - rv = MD5_Final(response, &ctx); - if (rv != 1) - log_errx(1, "MD5_Final"); + MD5Init(&ctx); + MD5Update(&ctx, &id, sizeof(id)); + MD5Update(&ctx, secret, strlen(secret)); + MD5Update(&ctx, challenge, challenge_len); + MD5Final(response, &ctx); } static int @@ -235,7 +231,6 @@ struct chap * chap_new(void) { struct chap *chap; - int rv; chap = calloc(sizeof(*chap), 1); if (chap == NULL) @@ -244,16 +239,8 @@ chap_new(void) /* * Generate the challenge. */ - rv = RAND_bytes(chap->chap_challenge, sizeof(chap->chap_challenge)); - if (rv != 1) { - log_errx(1, "RAND_bytes failed: %s", - ERR_error_string(ERR_get_error(), NULL)); - } - rv = RAND_bytes(&chap->chap_id, sizeof(chap->chap_id)); - if (rv != 1) { - log_errx(1, "RAND_bytes failed: %s", - ERR_error_string(ERR_get_error(), NULL)); - } + arc4random_buf(chap->chap_challenge, sizeof(chap->chap_challenge)); + arc4random_buf(&chap->chap_id, sizeof(chap->chap_id)); return (chap); } @@ -320,7 +307,7 @@ chap_receive(struct chap *chap, const ch int chap_authenticate(struct chap *chap, const char *secret) { - char expected_response[MD5_DIGEST_LENGTH]; + char expected_response[CHAP_DIGEST_LEN]; chap_compute_md5(chap->chap_id, secret, chap->chap_challenge, sizeof(chap->chap_challenge), @@ -397,7 +384,7 @@ rchap_get_response_bin(struct rchap *rch void **responsep, size_t *response_lenp) { void *response_bin; - size_t response_bin_len = MD5_DIGEST_LENGTH; + size_t response_bin_len = CHAP_DIGEST_LEN; response_bin = calloc(response_bin_len, 1); if (response_bin == NULL) Modified: head/usr.sbin/iscsid/iscsid.h ============================================================================== --- head/usr.sbin/iscsid/iscsid.h Fri Jul 3 10:04:41 2015 (r285085) +++ head/usr.sbin/iscsid/iscsid.h Fri Jul 3 10:08:10 2015 (r285086) @@ -34,7 +34,6 @@ #include #include -#include #include @@ -83,11 +82,12 @@ struct keys { }; #define CHAP_CHALLENGE_LEN 1024 +#define CHAP_DIGEST_LEN 16 /* Equal to MD5 digest size. */ struct chap { unsigned char chap_id; char chap_challenge[CHAP_CHALLENGE_LEN]; - char chap_response[MD5_DIGEST_LENGTH]; + char chap_response[CHAP_DIGEST_LEN]; }; struct rchap { From owner-svn-src-head@freebsd.org Fri Jul 3 11:16:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED2699940BA; Fri, 3 Jul 2015 11:16:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B86C91283; Fri, 3 Jul 2015 11:16:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63BGLOr046579; Fri, 3 Jul 2015 11:16:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63BGLjO046575; Fri, 3 Jul 2015 11:16:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201507031116.t63BGLjO046575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 3 Jul 2015 11:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285088 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 11:16:22 -0000 Author: hselasky Date: Fri Jul 3 11:16:20 2015 New Revision: 285088 URL: https://svnweb.freebsd.org/changeset/base/285088 Log: Fix broken implementation of "kvasprintf()" function by adding missing kmalloc() call. Make function global instead of static inline to fix compiler warnings about passing variable argument lists to inline functions. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/device.h head/sys/ofed/include/linux/linux_compat.c Modified: head/sys/ofed/include/linux/device.h ============================================================================== --- head/sys/ofed/include/linux/device.h Fri Jul 3 11:02:20 2015 (r285087) +++ head/sys/ofed/include/linux/device.h Fri Jul 3 11:16:20 2015 (r285088) @@ -416,21 +416,7 @@ static inline int dev_to_node(struct dev return -1; } -static inline char *kvasprintf(gfp_t gfp, const char *fmt, va_list ap) -{ - unsigned int len; - char *p = NULL; - va_list aq; - - va_copy(aq, ap); - len = vsnprintf(NULL, 0, fmt, aq); - va_end(aq); - - vsnprintf(p, len+1, fmt, ap); - - return p; -} - +char *kvasprintf(gfp_t, const char *, va_list); char *kasprintf(gfp_t, const char *, ...); #endif /* _LINUX_DEVICE_H_ */ Modified: head/sys/ofed/include/linux/linux_compat.c ============================================================================== --- head/sys/ofed/include/linux/linux_compat.c Fri Jul 3 11:02:20 2015 (r285087) +++ head/sys/ofed/include/linux/linux_compat.c Fri Jul 3 11:16:20 2015 (r285088) @@ -715,6 +715,23 @@ vunmap(void *addr) kfree(vmmap); } +char * +kvasprintf(gfp_t gfp, const char *fmt, va_list ap) +{ + unsigned int len; + char *p; + va_list aq; + + va_copy(aq, ap); + len = vsnprintf(NULL, 0, fmt, aq); + va_end(aq); + + p = kmalloc(len + 1, gfp); + if (p != NULL) + vsnprintf(p, len + 1, fmt, ap); + + return (p); +} char * kasprintf(gfp_t gfp, const char *fmt, ...) @@ -726,7 +743,7 @@ kasprintf(gfp_t gfp, const char *fmt, .. p = kvasprintf(gfp, fmt, ap); va_end(ap); - return p; + return (p); } static int From owner-svn-src-head@freebsd.org Fri Jul 3 12:09:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9D73994F92; Fri, 3 Jul 2015 12:09:06 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EFF01100; Fri, 3 Jul 2015 12:09:06 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63C96lC074116; Fri, 3 Jul 2015 12:09:06 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63C96wP074115; Fri, 3 Jul 2015 12:09:06 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201507031209.t63C96wP074115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Fri, 3 Jul 2015 12:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285089 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 12:09:06 -0000 Author: royger Date: Fri Jul 3 12:09:05 2015 New Revision: 285089 URL: https://svnweb.freebsd.org/changeset/base/285089 Log: netfront: preserve configuration across migrations Try to preserve the xn configuration when migrating. This is not always possible since the backend might not have the same set of options available, in which case we will try to preserve as many as possible. MFC after: 2 weeks PR: 183139 Reported by: mcdouga9@egr.msu.edu Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Fri Jul 3 11:16:20 2015 (r285088) +++ head/sys/dev/xen/netfront/netfront.c Fri Jul 3 12:09:05 2015 (r285089) @@ -285,6 +285,8 @@ struct netfront_info { multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1]; mmu_update_t rx_mmu[NET_RX_RING_SIZE]; struct ifmedia sc_media; + + bool xn_resume; }; #define rx_mbufs xn_cdata.xn_rx_chain @@ -500,6 +502,7 @@ netfront_resume(device_t dev) { struct netfront_info *info = device_get_softc(dev); + info->xn_resume = true; netif_disconnect_backend(info); return (0); } @@ -1982,18 +1985,33 @@ xn_query_features(struct netfront_info * static int xn_configure_features(struct netfront_info *np) { - int err; + int err, cap_enabled; err = 0; + + if (np->xn_resume && + ((np->xn_ifp->if_capenable & np->xn_ifp->if_capabilities) + == np->xn_ifp->if_capenable)) { + /* Current options are available, no need to do anything. */ + return (0); + } + + /* Try to preserve as many options as possible. */ + if (np->xn_resume) + cap_enabled = np->xn_ifp->if_capenable; + else + cap_enabled = UINT_MAX; + #if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) - if ((np->xn_ifp->if_capenable & IFCAP_LRO) != 0) + if ((np->xn_ifp->if_capenable & IFCAP_LRO) == (cap_enabled & IFCAP_LRO)) tcp_lro_free(&np->xn_lro); #endif np->xn_ifp->if_capenable = - np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4); + np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4) & cap_enabled; np->xn_ifp->if_hwassist &= ~CSUM_TSO; #if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) - if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) { + if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) == + (cap_enabled & IFCAP_LRO)) { err = tcp_lro_init(&np->xn_lro); if (err) { device_printf(np->xbdev, "LRO initialization failed\n"); @@ -2002,7 +2020,8 @@ xn_configure_features(struct netfront_in np->xn_ifp->if_capenable |= IFCAP_LRO; } } - if ((np->xn_ifp->if_capabilities & IFCAP_TSO4) != 0) { + if ((np->xn_ifp->if_capabilities & IFCAP_TSO4) == + (cap_enabled & IFCAP_TSO4)) { np->xn_ifp->if_capenable |= IFCAP_TSO4; np->xn_ifp->if_hwassist |= CSUM_TSO; } From owner-svn-src-head@freebsd.org Fri Jul 3 14:11:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23D639947A1; Fri, 3 Jul 2015 14:11:05 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12B7424C9; Fri, 3 Jul 2015 14:11:05 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63EB5np035488; Fri, 3 Jul 2015 14:11:05 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63EB2xQ035466; Fri, 3 Jul 2015 14:11:02 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201507031411.t63EB2xQ035466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 3 Jul 2015 14:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285090 - in head/sys: arm/allwinner arm/conf boot/fdt/dts/arm dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 14:11:05 -0000 Author: loos Date: Fri Jul 3 14:11:01 2015 New Revision: 285090 URL: https://svnweb.freebsd.org/changeset/base/285090 Log: Add AHCI attachment code for Allwinner A10/A20 SoCs. The Allwinner SoC has an AHCI device on its internal main bus rather than the PCI bus. This SoC is somewhat underdocumented, and its SATA controller is no exception. The methods to support this chip were harvested from the Linux Allwinner SDK, and then constants invented to describe what's going on based on low-level constants contained in the SATA standard and guess work. This SoC requires a specific AHCI channel setup in order to start the operations on the channel properly. Clock setup and AHCI channel setup idea came from NetBSD. Tested on Cubieboard 2 and Banana pi (and attachment on Cubieboard by Pratik Singhal). Differential Revision: https://reviews.freebsd.org/D737 Submitted by: imp Reviewed by: imp, ganbold, mav, andrew Added: head/sys/arm/allwinner/a10_ahci.c (contents, props changed) Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_clk.h head/sys/arm/allwinner/files.allwinner head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/boot/fdt/dts/arm/cubieboard.dts head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h Added: head/sys/arm/allwinner/a10_ahci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_ahci.c Fri Jul 3 14:11:01 2015 (r285090) @@ -0,0 +1,382 @@ +/*- + * Copyright (c) 2014-2015 M. Warner Losh + * Copyright (c) 2015 Luiz Otavio O Souza + * 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. + * + * The magic-bit-bang sequence used in this code may be based on a linux + * platform driver in the Allwinner SDK from Allwinner Technology Co., Ltd. + * www.allwinnertech.com, by Daniel Wang + * though none of the original code was copied. + */ + +#include "opt_bus.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include "gpio_if.h" + +/* + * Allwinner a1x/a2x/a8x SATA attachment. This is just the AHCI register + * set with a few extra implementation-specific registers that need to + * be accounted for. There's only one PHY in the system, and it needs + * to be trained to bring the link up. In addition, there's some DMA + * specific things that need to be done as well. These things are also + * just about completely undocumented, except in ugly code in the Linux + * SDK Allwinner releases. + */ + +/* BITx -- Unknown bit that needs to be set/cleared at position x */ +/* UFx -- Uknown multi-bit field frobbed during init */ +#define AHCI_BISTAFR 0x00A0 +#define AHCI_BISTCR 0x00A4 +#define AHCI_BISTFCTR 0x00A8 +#define AHCI_BISTSR 0x00AC +#define AHCI_BISTDECR 0x00B0 +#define AHCI_DIAGNR 0x00B4 +#define AHCI_DIAGNR1 0x00B8 +#define AHCI_OOBR 0x00BC +#define AHCI_PHYCS0R 0x00C0 +/* Bits 0..17 are a mystery */ +#define PHYCS0R_BIT18 (1 << 18) +#define PHYCS0R_POWER_ENABLE (1 << 19) +#define PHYCS0R_UF1_MASK (7 << 20) /* Unknown Field 1 */ +#define PHYCS0R_UF1_INIT (3 << 20) +#define PHYCS0R_BIT23 (1 << 23) +#define PHYCS0R_UF2_MASK (7 << 24) /* Uknown Field 2 */ +#define PHYCS0R_UF2_INIT (5 << 24) +/* Bit 27 mystery */ +#define PHYCS0R_POWER_STATUS_MASK (7 << 28) +#define PHYCS0R_PS_GOOD (2 << 28) +/* Bit 31 mystery */ +#define AHCI_PHYCS1R 0x00C4 +/* Bits 0..5 are a mystery */ +#define PHYCS1R_UF1_MASK (3 << 6) +#define PHYCS1R_UF1_INIT (2 << 6) +#define PHYCS1R_UF2_MASK (0x1f << 8) +#define PHYCS1R_UF2_INIT (6 << 8) +/* Bits 13..14 are a mystery */ +#define PHYCS1R_BIT15 (1 << 15) +#define PHYCS1R_UF3_MASK (3 << 16) +#define PHYCS1R_UF3_INIT (2 << 16) +/* Bit 18 mystery */ +#define PHYCS1R_HIGHZ (1 << 19) +/* Bits 20..27 mystery */ +#define PHYCS1R_BIT28 (1 << 28) +/* Bits 29..31 mystery */ +#define AHCI_PHYCS2R 0x00C8 +/* bits 0..4 mystery */ +#define PHYCS2R_UF1_MASK (0x1f << 5) +#define PHYCS2R_UF1_INIT (0x19 << 5) +/* Bits 10..23 mystery */ +#define PHYCS2R_CALIBRATE (1 << 24) +/* Bits 25..31 mystery */ +#define AHCI_TIMER1MS 0x00E0 +#define AHCI_GPARAM1R 0x00E8 +#define AHCI_GPARAM2R 0x00EC +#define AHCI_PPARAMR 0x00F0 +#define AHCI_TESTR 0x00F4 +#define AHCI_VERSIONR 0x00F8 +#define AHCI_IDR 0x00FC +#define AHCI_RWCR 0x00FC + +#define AHCI_P0DMACR 0x0070 +#define AHCI_P0PHYCR 0x0078 +#define AHCI_P0PHYSR 0x007C + +/* Kludge for CUBIEBOARD (and Banana PI too) */ +#define GPIO_AHCI_PWR 40 + +static void inline +ahci_set(struct resource *m, bus_size_t off, uint32_t set) +{ + uint32_t val = ATA_INL(m, off); + + val |= set; + ATA_OUTL(m, off, val); +} + +static void inline +ahci_clr(struct resource *m, bus_size_t off, uint32_t clr) +{ + uint32_t val = ATA_INL(m, off); + + val &= ~clr; + ATA_OUTL(m, off, val); +} + +static void inline +ahci_mask_set(struct resource *m, bus_size_t off, uint32_t mask, uint32_t set) +{ + uint32_t val = ATA_INL(m, off); + + val &= mask; + val |= set; + ATA_OUTL(m, off, val); +} + +/* + * Should this be phy_reset or phy_init + */ +#define PHY_RESET_TIMEOUT 1000 +static void +ahci_a10_phy_reset(device_t dev) +{ + uint32_t to, val; + struct ahci_controller *ctlr = device_get_softc(dev); + + /* + * Here start the the magic -- most of the comments are based + * on guesswork, names of routines and printf error + * messages. The code works, but it will do that even if the + * comments are 100% BS. + */ + + /* + * Lock out other access while we initialize. Or at least that + * seems to be the case based on Linux SDK #defines. Maybe this + * put things into reset? + */ + ATA_OUTL(ctlr->r_mem, AHCI_RWCR, 0); + DELAY(100); + + /* + * Set bit 19 in PHYCS1R. Guessing this disables driving the PHY + * port for a bit while we reset things. + */ + ahci_set(ctlr->r_mem, AHCI_PHYCS1R, PHYCS1R_HIGHZ); + + /* + * Frob PHYCS0R... + */ + ahci_mask_set(ctlr->r_mem, AHCI_PHYCS0R, + ~PHYCS0R_UF2_MASK, + PHYCS0R_UF2_INIT | PHYCS0R_BIT23 | PHYCS0R_BIT18); + + /* + * Set three fields in PHYCS1R + */ + ahci_mask_set(ctlr->r_mem, AHCI_PHYCS1R, + ~(PHYCS1R_UF1_MASK | PHYCS1R_UF2_MASK | PHYCS1R_UF3_MASK), + PHYCS1R_UF1_INIT | PHYCS1R_UF2_INIT | PHYCS1R_UF3_INIT); + + /* + * Two more mystery bits in PHYCS1R. -- can these be combined above? + */ + ahci_set(ctlr->r_mem, AHCI_PHYCS1R, PHYCS1R_BIT15 | PHYCS1R_BIT28); + + /* + * Now clear that first mysery bit. Perhaps this starts + * driving the PHY again so we can power it up and start + * talking to the SATA drive, if any below. + */ + ahci_clr(ctlr->r_mem, AHCI_PHYCS1R, PHYCS1R_HIGHZ); + + /* + * Frob PHYCS0R again... + */ + ahci_mask_set(ctlr->r_mem, AHCI_PHYCS0R, + ~PHYCS0R_UF1_MASK, PHYCS0R_UF1_INIT); + + /* + * Frob PHYCS2R, because 25 means something? + */ + ahci_mask_set(ctlr->r_mem, AHCI_PHYCS2R, ~PHYCS2R_UF1_MASK, + PHYCS2R_UF1_INIT); + + DELAY(100); /* WAG */ + + /* + * Turn on the power to the PHY and wait for it to report back + * good? + */ + ahci_set(ctlr->r_mem, AHCI_PHYCS0R, PHYCS0R_POWER_ENABLE); + for (to = PHY_RESET_TIMEOUT; to > 0; to--) { + val = ATA_INL(ctlr->r_mem, AHCI_PHYCS0R); + if ((val & PHYCS0R_POWER_STATUS_MASK) == PHYCS0R_PS_GOOD) + break; + DELAY(10); + } + if (to == 0 && bootverbose) + device_printf(dev, "PHY Power Failed PHYCS0R = %#x\n", val); + + /* + * Calibrate the clocks between the device and the host. This appears + * to be an automated process that clears the bit when it is done. + */ + ahci_set(ctlr->r_mem, AHCI_PHYCS2R, PHYCS2R_CALIBRATE); + for (to = PHY_RESET_TIMEOUT; to > 0; to--) { + val = ATA_INL(ctlr->r_mem, AHCI_PHYCS2R); + if ((val & PHYCS2R_CALIBRATE) == 0) + break; + DELAY(10); + } + if (to == 0 && bootverbose) + device_printf(dev, "PHY Cal Failed PHYCS2R %#x\n", val); + + /* + * OK, let things settle down a bit. + */ + DELAY(1000); + + /* + * Go back into normal mode now that we've calibrated the PHY. + */ + ATA_OUTL(ctlr->r_mem, AHCI_RWCR, 7); +} + +static void +ahci_a10_ch_start(struct ahci_channel *ch) +{ + uint32_t reg; + + /* + * Magical values from Allwinner SDK, setup the DMA before start + * operations on this channel. + */ + reg = ATA_INL(ch->r_mem, AHCI_P0DMACR); + reg &= ~0xff00; + reg |= 0x4400; + ATA_OUTL(ch->r_mem, AHCI_P0DMACR, reg); +} + +static int +ahci_a10_ctlr_reset(device_t dev) +{ + + ahci_a10_phy_reset(dev); + + return (ahci_ctlr_reset(dev)); +} + +static int +ahci_a10_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-ahci")) + return (ENXIO); + device_set_desc(dev, "Allwinner Integrated AHCI controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +ahci_a10_attach(device_t dev) +{ + device_t gpio; + int error; + struct ahci_controller *ctlr; + + ctlr = device_get_softc(dev); + ctlr->quirks = AHCI_Q_NOPMP; + ctlr->vendorid = 0; + ctlr->deviceid = 0; + ctlr->subvendorid = 0; + ctlr->subdeviceid = 0; + ctlr->r_rid = 0; + if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &ctlr->r_rid, RF_ACTIVE))) + return (ENXIO); + + /* Turn on the PLL for SATA */ + a10_clk_ahci_activate(); + + /* Apply power to the drive, if any */ + gpio = devclass_get_device(devclass_find("gpio"), 0); + if (gpio == NULL) { + device_printf(dev, + "GPIO device not yet present (SATA won't work).\n"); + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, + ctlr->r_mem); + return (ENXIO); + } + GPIO_PIN_SETFLAGS(gpio, GPIO_AHCI_PWR, GPIO_PIN_OUTPUT); + GPIO_PIN_SET(gpio, GPIO_AHCI_PWR, GPIO_PIN_HIGH); + DELAY(10000); + + /* Reset controller */ + if ((error = ahci_a10_ctlr_reset(dev)) != 0) { + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, + ctlr->r_mem); + return (error); + }; + + /* + * No MSI registers on this platform. + */ + ctlr->msi = 0; + ctlr->numirqs = 1; + + /* Channel start callback(). */ + ctlr->ch_start = ahci_a10_ch_start; + + /* + * Note: ahci_attach will release ctlr->r_mem on errors automatically + */ + return (ahci_attach(dev)); +} + +static int +ahci_a10_detach(device_t dev) +{ + + return (ahci_detach(dev)); +} + +devclass_t ahci_devclass; + +static device_method_t ahci_ata_methods[] = { + DEVMETHOD(device_probe, ahci_a10_probe), + DEVMETHOD(device_attach, ahci_a10_attach), + DEVMETHOD(device_detach, ahci_a10_detach), + DEVMETHOD(bus_print_child, ahci_print_child), + DEVMETHOD(bus_alloc_resource, ahci_alloc_resource), + DEVMETHOD(bus_release_resource, ahci_release_resource), + DEVMETHOD(bus_setup_intr, ahci_setup_intr), + DEVMETHOD(bus_teardown_intr,ahci_teardown_intr), + DEVMETHOD(bus_child_location_str, ahci_child_location_str), + DEVMETHOD_END +}; + +static driver_t ahci_ata_driver = { + "ahci", + ahci_ata_methods, + sizeof(struct ahci_controller) +}; + +DRIVER_MODULE(ahci, simplebus, ahci_ata_driver, ahci_devclass, 0, 0); Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Fri Jul 3 12:09:05 2015 (r285089) +++ head/sys/arm/allwinner/a10_clk.c Fri Jul 3 14:11:01 2015 (r285090) @@ -56,6 +56,7 @@ struct a10_ccm_softc { struct resource *res; bus_space_tag_t bst; bus_space_handle_t bsh; + int pll6_enabled; }; static struct a10_ccm_softc *a10_ccm_sc = NULL; @@ -203,6 +204,8 @@ a10_clk_pll6_enable(void) * For other uses the output frequency is 24MHz * n * k / 2. */ sc = a10_ccm_sc; + if (sc->pll6_enabled) + return; reg_value = ccm_read_4(sc, CCM_PLL6_CFG); reg_value &= ~CCM_PLL_CFG_BYPASS; reg_value &= ~(CCM_PLL_CFG_FACTOR_K | CCM_PLL_CFG_FACTOR_M | @@ -211,6 +214,7 @@ a10_clk_pll6_enable(void) reg_value |= CCM_PLL6_CFG_SATA_CLKEN; reg_value |= CCM_PLL_CFG_ENABLE; ccm_write_4(sc, CCM_PLL6_CFG, reg_value); + sc->pll6_enabled = 1; } static unsigned int @@ -229,6 +233,29 @@ a10_clk_pll6_get_rate(void) } int +a10_clk_ahci_activate(void) +{ + struct a10_ccm_softc *sc; + uint32_t reg_value; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + a10_clk_pll6_enable(); + + /* Gating AHB clock for SATA */ + reg_value = ccm_read_4(sc, CCM_AHB_GATING0); + reg_value |= CCM_AHB_GATING_SATA; + ccm_write_4(sc, CCM_AHB_GATING0, reg_value); + DELAY(1000); + + ccm_write_4(sc, CCM_SATA_CLK, CCM_PLL_CFG_ENABLE); + + return (0); +} + +int a10_clk_mmc_activate(int devid) { struct a10_ccm_softc *sc; Modified: head/sys/arm/allwinner/a10_clk.h ============================================================================== --- head/sys/arm/allwinner/a10_clk.h Fri Jul 3 12:09:05 2015 (r285089) +++ head/sys/arm/allwinner/a10_clk.h Fri Jul 3 14:11:01 2015 (r285090) @@ -105,6 +105,7 @@ #define CCM_AHB_GATING_EHCI1 (1 << 3) #define CCM_AHB_GATING_SDMMC0 (1 << 8) #define CCM_AHB_GATING_EMAC (1 << 17) +#define CCM_AHB_GATING_SATA (1 << 25) #define CCM_USB_PHY (1 << 8) #define CCM_USB0_RESET (1 << 0) @@ -140,6 +141,7 @@ int a10_clk_usb_activate(void); int a10_clk_usb_deactivate(void); int a10_clk_emac_activate(void); +int a10_clk_ahci_activate(void); int a10_clk_mmc_activate(int); int a10_clk_mmc_cfg(int, int); Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Fri Jul 3 12:09:05 2015 (r285089) +++ head/sys/arm/allwinner/files.allwinner Fri Jul 3 14:11:01 2015 (r285090) @@ -5,6 +5,7 @@ arm/arm/bus_space_base.c standard arm/arm/bus_space_asm_generic.S standard arm/arm/bus_space_generic.c standard +arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_clk.c standard arm/allwinner/a10_common.c standard arm/allwinner/a10_ehci.c optional ehci Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Fri Jul 3 12:09:05 2015 (r285089) +++ head/sys/arm/conf/CUBIEBOARD Fri Jul 3 14:11:01 2015 (r285090) @@ -57,7 +57,7 @@ device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards # ATA controllers -#device ahci # AHCI-compatible SATA controllers +device ahci # AHCI-compatible SATA controllers #device ata # Legacy ATA/SATA controllers #options ATA_STATIC_ID # Static device numbering @@ -78,7 +78,7 @@ device gpio device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) -device pass +device pass # Passthrough device (direct ATA/SCSI access) # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Fri Jul 3 12:09:05 2015 (r285089) +++ head/sys/arm/conf/CUBIEBOARD2 Fri Jul 3 14:11:01 2015 (r285090) @@ -61,7 +61,7 @@ device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards # ATA controllers -#device ahci # AHCI-compatible SATA controllers +device ahci # AHCI-compatible SATA controllers #device ata # Legacy ATA/SATA controllers #options ATA_STATIC_ID # Static device numbering @@ -82,7 +82,7 @@ device gpio device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) -device pass +device pass # Passthrough device (direct ATA/SCSI access) # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. Modified: head/sys/boot/fdt/dts/arm/cubieboard.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard.dts Fri Jul 3 12:09:05 2015 (r285089) +++ head/sys/boot/fdt/dts/arm/cubieboard.dts Fri Jul 3 14:11:01 2015 (r285090) @@ -64,6 +64,10 @@ emac@01c0b000 { status = "okay"; }; + + ahci: sata@01c18000 { + status = "okay"; + }; }; chosen { Modified: head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi Fri Jul 3 12:09:05 2015 (r285089) +++ head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi Fri Jul 3 14:11:01 2015 (r285090) @@ -112,10 +112,11 @@ }; sata@01c18000 { - compatible = "allwinner,sun4i-ahci"; + compatible = "allwinner,sun4i-a10-ahci"; reg = <0x01c18000 0x1000>; interrupts = <56>; interrupt-parent = <&AINTC>; + status = "disabled"; }; UART0: serial@01c28000 { Modified: head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Fri Jul 3 12:09:05 2015 (r285089) +++ head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Fri Jul 3 14:11:01 2015 (r285090) @@ -122,6 +122,7 @@ reg = <0x01c18000 0x1000>; interrupts = <56>; interrupt-parent = <&GIC>; + status = "disabled"; }; UART0: serial@01c28000 { Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Fri Jul 3 12:09:05 2015 (r285089) +++ head/sys/dev/ahci/ahci.c Fri Jul 3 14:11:01 2015 (r285090) @@ -654,6 +654,7 @@ ahci_ch_attach(device_t dev) ch->unit = (intptr_t)device_get_ivars(dev); ch->caps = ctlr->caps; ch->caps2 = ctlr->caps2; + ch->start = ctlr->ch_start; ch->quirks = ctlr->quirks; ch->vendorid = ctlr->vendorid; ch->deviceid = ctlr->deviceid; @@ -2114,6 +2115,10 @@ ahci_start(struct ahci_channel *ch, int { u_int32_t cmd; + /* Run the channel start callback, if any. */ + if (ch->start) + ch->start(ch); + /* Clear SATA error register */ ATA_OUTL(ch->r_mem, AHCI_P_SERR, 0xFFFFFFFF); /* Clear any interrupts pending on this channel */ Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Fri Jul 3 12:09:05 2015 (r285089) +++ head/sys/dev/ahci/ahci.h Fri Jul 3 14:11:01 2015 (r285090) @@ -427,6 +427,8 @@ struct ahci_channel { int pm_present; /* PM presence reported */ int fbs_enabled; /* FIS-based switching enabled */ + void (*start)(struct ahci_channel *); + union ccb *hold[AHCI_MAX_SLOTS]; struct ahci_slot slot[AHCI_MAX_SLOTS]; uint32_t oslots; /* Occupied slots */ @@ -512,6 +514,7 @@ struct ahci_controller { void (*function)(void *); void *argument; } interrupt[AHCI_MAX_PORTS]; + void (*ch_start)(struct ahci_channel *); }; enum ahci_err_type { From owner-svn-src-head@freebsd.org Fri Jul 3 14:13:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E25929948A3; Fri, 3 Jul 2015 14:13:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9A9C2777; Fri, 3 Jul 2015 14:13:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63EDHdZ039050; Fri, 3 Jul 2015 14:13:17 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63EDH4S039047; Fri, 3 Jul 2015 14:13:17 GMT (envelope-from br@FreeBSD.org) Message-Id: <201507031413.t63EDH4S039047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 3 Jul 2015 14:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285091 - head/sys/dev/virtio/mmio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 14:13:18 -0000 Author: br Date: Fri Jul 3 14:13:16 2015 New Revision: 285091 URL: https://svnweb.freebsd.org/changeset/base/285091 Log: Add 'prewrite' method allowing us to run some platform-specific code before each write happens, e.g. write-back caches. This will help booting in Bluespec simulator of CHERI processor. Modified: head/sys/dev/virtio/mmio/virtio_mmio.c head/sys/dev/virtio/mmio/virtio_mmio_if.m Modified: head/sys/dev/virtio/mmio/virtio_mmio.c ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio.c Fri Jul 3 14:11:01 2015 (r285090) +++ head/sys/dev/virtio/mmio/virtio_mmio.c Fri Jul 3 14:13:16 2015 (r285091) @@ -138,18 +138,24 @@ static void vtmmio_vq_intr(void *); */ #define vtmmio_write_config_1(sc, o, v) \ do { \ + if (sc->platform != NULL) \ + VIRTIO_MMIO_PREWRITE(sc->platform, (o), (v)); \ bus_write_1((sc)->res[0], (o), (v)); \ if (sc->platform != NULL) \ VIRTIO_MMIO_NOTE(sc->platform, (o), (v)); \ } while (0) #define vtmmio_write_config_2(sc, o, v) \ do { \ + if (sc->platform != NULL) \ + VIRTIO_MMIO_PREWRITE(sc->platform, (o), (v)); \ bus_write_2((sc)->res[0], (o), (v)); \ if (sc->platform != NULL) \ VIRTIO_MMIO_NOTE(sc->platform, (o), (v)); \ } while (0) #define vtmmio_write_config_4(sc, o, v) \ do { \ + if (sc->platform != NULL) \ + VIRTIO_MMIO_PREWRITE(sc->platform, (o), (v)); \ bus_write_4((sc)->res[0], (o), (v)); \ if (sc->platform != NULL) \ VIRTIO_MMIO_NOTE(sc->platform, (o), (v)); \ Modified: head/sys/dev/virtio/mmio/virtio_mmio_if.m ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio_if.m Fri Jul 3 14:11:01 2015 (r285090) +++ head/sys/dev/virtio/mmio/virtio_mmio_if.m Fri Jul 3 14:13:16 2015 (r285091) @@ -42,6 +42,13 @@ INTERFACE virtio_mmio; CODE { static int + virtio_mmio_prewrite(device_t dev, size_t offset, int val) + { + + return (1); + } + + static int virtio_mmio_note(device_t dev, size_t offset, int val) { @@ -58,6 +65,15 @@ CODE { }; # +# Inform backend we are going to write data at offset. +# +METHOD int prewrite { + device_t dev; + size_t offset; + int val; +} DEFAULT virtio_mmio_prewrite; + +# # Inform backend we have data wrotten to offset. # METHOD int note { From owner-svn-src-head@freebsd.org Fri Jul 3 14:27:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45E93994BE8; Fri, 3 Jul 2015 14:27:29 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3655A2F98; Fri, 3 Jul 2015 14:27:29 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63ERTWL044755; Fri, 3 Jul 2015 14:27:29 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63ERTXu044754; Fri, 3 Jul 2015 14:27:29 GMT (envelope-from br@FreeBSD.org) Message-Id: <201507031427.t63ERTXu044754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 3 Jul 2015 14:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285093 - head/sys/dev/beri/virtio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 14:27:29 -0000 Author: br Date: Fri Jul 3 14:27:28 2015 New Revision: 285093 URL: https://svnweb.freebsd.org/changeset/base/285093 Log: Allow BERI virtio-platform code to operate with no PIO devices specified. We will use it with Bluespec simulator of CHERI processor for invalidating caches only. Modified: head/sys/dev/beri/virtio/virtio_mmio_platform.c Modified: head/sys/dev/beri/virtio/virtio_mmio_platform.c ============================================================================== --- head/sys/dev/beri/virtio/virtio_mmio_platform.c Fri Jul 3 14:22:44 2015 (r285092) +++ head/sys/dev/beri/virtio/virtio_mmio_platform.c Fri Jul 3 14:27:28 2015 (r285093) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Ruslan Bukin + * Copyright (c) 2014-2015 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -70,6 +70,7 @@ static void platform_intr(void *arg); struct virtio_mmio_platform_softc { struct resource *res[1]; + void *ih; bus_space_tag_t bst; bus_space_handle_t bsh; device_t dev; @@ -77,6 +78,7 @@ struct virtio_mmio_platform_softc { void *ih_user; device_t pio_recv; device_t pio_send; + int use_pio; }; static int @@ -131,11 +133,11 @@ virtio_mmio_platform_attach(device_t dev sc = device_get_softc(dev); sc->dev = dev; + sc->use_pio = 1; - if (setup_pio(sc, "pio-send", &sc->pio_send) != 0) - return (ENXIO); - if (setup_pio(sc, "pio-recv", &sc->pio_recv) != 0) - return (ENXIO); + if ((setup_pio(sc, "pio-send", &sc->pio_send) != 0) || + (setup_pio(sc, "pio-recv", &sc->pio_recv) != 0)) + sc->use_pio = 0; if ((node = ofw_bus_get_node(sc->dev)) == -1) return (ENXIO); @@ -149,6 +151,24 @@ virtio_mmio_platform_attach(device_t dev } static int +platform_prewrite(device_t dev, size_t offset, int val) +{ + struct virtio_mmio_platform_softc *sc; + + sc = device_get_softc(dev); + + switch (offset) { + case (VIRTIO_MMIO_QUEUE_NOTIFY): + mips_dcache_wbinv_all(); + break; + default: + break; + } + + return (0); +} + +static int platform_note(device_t dev, size_t offset, int val) { struct virtio_mmio_platform_softc *sc; @@ -158,25 +178,30 @@ platform_note(device_t dev, size_t offse sc = device_get_softc(dev); switch (offset) { - case (VIRTIO_MMIO_QUEUE_NOTIFY): - if (val == 0) - note = Q_NOTIFY; - else if (val == 1) - note = Q_NOTIFY1; - break; - case (VIRTIO_MMIO_QUEUE_PFN): - note = Q_PFN; - break; - case (VIRTIO_MMIO_QUEUE_SEL): - note = Q_SEL; - break; - default: + case (VIRTIO_MMIO_QUEUE_NOTIFY): + if (val == 0) + note = Q_NOTIFY; + else if (val == 1) + note = Q_NOTIFY1; + else note = 0; + break; + case (VIRTIO_MMIO_QUEUE_PFN): + note = Q_PFN; + break; + case (VIRTIO_MMIO_QUEUE_SEL): + note = Q_SEL; + break; + default: + note = 0; } if (note) { mips_dcache_wbinv_all(); + if (!sc->use_pio) + return (0); + PIO_SET(sc->pio_send, note, 1); /* @@ -205,11 +230,13 @@ platform_intr(void *arg) sc = arg; - /* Read pending */ - reg = PIO_READ(sc->pio_recv); + if (sc->use_pio) { + /* Read pending */ + reg = PIO_READ(sc->pio_recv); - /* Ack */ - PIO_SET(sc->pio_recv, reg, 0); + /* Ack */ + PIO_SET(sc->pio_recv, reg, 0); + } /* Writeback, invalidate cache */ mips_dcache_wbinv_all(); @@ -223,13 +250,31 @@ platform_setup_intr(device_t dev, device void *intr_handler, void *ih_user) { struct virtio_mmio_platform_softc *sc; + int rid; sc = device_get_softc(dev); sc->intr_handler = intr_handler; sc->ih_user = ih_user; - PIO_SETUP_IRQ(sc->pio_recv, platform_intr, sc); + if (sc->use_pio) { + PIO_SETUP_IRQ(sc->pio_recv, platform_intr, sc); + return (0); + } + + rid = 0; + sc->res[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->res[0]) { + device_printf(dev, "Can't allocate interrupt\n"); + return (ENXIO); + } + + if (bus_setup_intr(dev, sc->res[0], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, platform_intr, sc, &sc->ih)) { + device_printf(dev, "Can't setup the interrupt\n"); + return (ENXIO); + } return (0); } @@ -248,6 +293,7 @@ static device_method_t virtio_mmio_platf DEVMETHOD(device_attach, virtio_mmio_platform_attach), /* virtio_mmio_if.h */ + DEVMETHOD(virtio_mmio_prewrite, platform_prewrite), DEVMETHOD(virtio_mmio_note, platform_note), DEVMETHOD(virtio_mmio_poll, platform_poll), DEVMETHOD(virtio_mmio_setup_intr, platform_setup_intr), From owner-svn-src-head@freebsd.org Fri Jul 3 14:46:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C599994FDA; Fri, 3 Jul 2015 14:46:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D4671FEE; Fri, 3 Jul 2015 14:46:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63Ekwb5055087; Fri, 3 Jul 2015 14:46:58 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63Ekwla055084; Fri, 3 Jul 2015 14:46:58 GMT (envelope-from br@FreeBSD.org) Message-Id: <201507031446.t63Ekwla055084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 3 Jul 2015 14:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285095 - in head/sys: boot/fdt/dts/mips mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 14:46:58 -0000 Author: br Date: Fri Jul 3 14:46:57 2015 New Revision: 285095 URL: https://svnweb.freebsd.org/changeset/base/285095 Log: o Add a description for virtio block device implemented in PISM (Bluespec C-interface device) o Add a kernel config Sponsored by: HEIF5 Added: head/sys/mips/conf/BERI_SIM_VIRTIO (contents, props changed) Modified: head/sys/boot/fdt/dts/mips/beri-sim.dts Modified: head/sys/boot/fdt/dts/mips/beri-sim.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-sim.dts Fri Jul 3 14:29:55 2015 (r285094) +++ head/sys/boot/fdt/dts/mips/beri-sim.dts Fri Jul 3 14:46:57 2015 (r285095) @@ -128,6 +128,18 @@ reg = <0x7f002000 0x40>; }; + virtio_mmio_platform0: virtio_mmio_platform@0 { + compatible = "beri,virtio_mmio_platform"; + interrupts = <1>; + interrupt-parent = <&beripic0>; + }; + + virtio_block@7f020000 { + compatible = "virtio,mmio"; + reg = <0x7f020000 0x1000>; + platform = <&virtio_mmio_platform0>; + }; + sdcard@7f008000 { compatible = "altera,sdcard_11_2011"; reg = <0x7f008000 0x400>; Added: head/sys/mips/conf/BERI_SIM_VIRTIO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_SIM_VIRTIO Fri Jul 3 14:46:57 2015 (r285095) @@ -0,0 +1,20 @@ +# +# BERI_SIM_VIRTIO -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC Implementation) FPGA soft core, as configured for simulation. +# +# $FreeBSD$ +# + +include "BERI_SIM_BASE" + +ident BERI_SIM_VIRTIO + +device virtio +device virtio_blk +device virtio_mmio +device altera_pio + +# +# This kernel expects to find its root filesystem on the SD Card. +# +options ROOTDEVNAME=\"ufs:/dev/vtbd0\" From owner-svn-src-head@freebsd.org Fri Jul 3 15:31:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AB789939B8; Fri, 3 Jul 2015 15:31:57 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 479CE163C; Fri, 3 Jul 2015 15:31:57 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63FVvkU079114; Fri, 3 Jul 2015 15:31:57 GMT (envelope-from eri@FreeBSD.org) Received: (from eri@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63FVvek079113; Fri, 3 Jul 2015 15:31:57 GMT (envelope-from eri@FreeBSD.org) Message-Id: <201507031531.t63FVvek079113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eri set sender to eri@FreeBSD.org using -f From: Ermal Luçi Date: Fri, 3 Jul 2015 15:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285096 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 15:31:57 -0000 Author: eri Date: Fri Jul 3 15:31:56 2015 New Revision: 285096 URL: https://svnweb.freebsd.org/changeset/base/285096 Log: Reduce overhead of IPSEC for traffic generated from host When IPSEC is enabled on the kernel the forwarding path has an optimization to not enter the code paths for checking security policies but first checks if there is any security policy active at all. The patch introduces the same optimization but for traffic generated from the host itself. This reduces the overhead by 50% on my tests for generated host traffic without and SP active. Differential Revision: https://reviews.freebsd.org/D2980 Reviewed by: ae, gnn Approved by: gnn(mentor) Modified: head/sys/netipsec/ipsec.c Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Fri Jul 3 14:46:57 2015 (r285095) +++ head/sys/netipsec/ipsec.c Fri Jul 3 15:31:56 2015 (r285096) @@ -334,6 +334,12 @@ ipsec_getpolicybysock(struct mbuf *m, u_ IPSEC_ASSERT(dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND, ("invalid direction %u", dir)); + if (!key_havesp(dir)) { + /* No SP found, use system default. */ + sp = KEY_ALLOCSP_DEFAULT(); + return (sp); + } + /* Set spidx in pcb. */ *error = ipsec_setspidx_inpcb(m, inp); if (*error) From owner-svn-src-head@freebsd.org Fri Jul 3 15:56:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A48D993D35; Fri, 3 Jul 2015 15:56:01 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22F1D2043; Fri, 3 Jul 2015 15:56:01 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63Fu1nA089402; Fri, 3 Jul 2015 15:56:01 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63Fu0bK089401; Fri, 3 Jul 2015 15:56:01 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201507031556.t63Fu0bK089401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 3 Jul 2015 15:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285097 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 15:56:01 -0000 Author: marcel Date: Fri Jul 3 15:56:00 2015 New Revision: 285097 URL: https://svnweb.freebsd.org/changeset/base/285097 Log: Allow proto(4) to be compiled into the kernel. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jul 3 15:31:56 2015 (r285096) +++ head/sys/conf/files Fri Jul 3 15:56:00 2015 (r285097) @@ -2069,6 +2069,10 @@ dev/ppc/ppc_acpi.c optional ppc acpi dev/ppc/ppc_isa.c optional ppc isa dev/ppc/ppc_pci.c optional ppc pci dev/ppc/ppc_puc.c optional ppc puc +dev/proto/proto_bus_isa.c optional proto acpi | proto isa +dev/proto/proto_bus_pci.c optional proto pci +dev/proto/proto_busdma.c optional proto +dev/proto/proto_core.c optional proto dev/pst/pst-iop.c optional pst dev/pst/pst-pci.c optional pst pci dev/pst/pst-raid.c optional pst From owner-svn-src-head@freebsd.org Fri Jul 3 16:02:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A167993EF2; Fri, 3 Jul 2015 16:02:07 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B1282615; Fri, 3 Jul 2015 16:02:07 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63G26Sk093979; Fri, 3 Jul 2015 16:02:06 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63G269W093978; Fri, 3 Jul 2015 16:02:06 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201507031602.t63G269W093978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 3 Jul 2015 16:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285098 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 16:02:07 -0000 Author: marcel Date: Fri Jul 3 16:02:06 2015 New Revision: 285098 URL: https://svnweb.freebsd.org/changeset/base/285098 Log: Remove commented-out and non-existent cbus(4) attachment for uart(4). Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jul 3 15:56:00 2015 (r285097) +++ head/sys/conf/files Fri Jul 3 16:02:06 2015 (r285098) @@ -2335,7 +2335,6 @@ dev/tws/tws_user.c optional tws dev/tx/if_tx.c optional tx dev/txp/if_txp.c optional txp dev/uart/uart_bus_acpi.c optional uart acpi -#dev/uart/uart_bus_cbus.c optional uart cbus dev/uart/uart_bus_ebus.c optional uart ebus dev/uart/uart_bus_fdt.c optional uart fdt dev/uart/uart_bus_isa.c optional uart isa From owner-svn-src-head@freebsd.org Fri Jul 3 16:20:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DACDD994162; Fri, 3 Jul 2015 16:20:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEF8A2CAA; Fri, 3 Jul 2015 16:20:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63GKEiQ002852; Fri, 3 Jul 2015 16:20:14 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63GKE2B002851; Fri, 3 Jul 2015 16:20:14 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201507031620.t63GKE2B002851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 3 Jul 2015 16:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285099 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 16:20:15 -0000 Author: marcel Date: Fri Jul 3 16:20:14 2015 New Revision: 285099 URL: https://svnweb.freebsd.org/changeset/base/285099 Log: Minor update to the proto(4) man page: 1. We now support ISA devices 2. DMA support has been added Modified: head/share/man/man4/proto.4 Modified: head/share/man/man4/proto.4 ============================================================================== --- head/share/man/man4/proto.4 Fri Jul 3 16:02:06 2015 (r285098) +++ head/share/man/man4/proto.4 Fri Jul 3 16:20:14 2015 (r285099) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2014 Marcel Moolenaar +.\" Copyright (c) 2014, 2015 Marcel Moolenaar .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,13 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2014 +.Dd July 3, 2015 .Dt PROTO 4 .Os .\" .Sh NAME .Nm proto -.Nd Driver for prototyping and H/W diagnostics +.Nd Generic prototyping and diagnostics driver .\" .Sh SYNOPSIS To compile this driver into the kernel, @@ -51,9 +51,9 @@ proto_load="YES" .Sh DESCRIPTION The .Nm -device driver attaches to PCI devices when no other device drivers are -present and creates device special files for all resources associated -with the device. +device driver attaches to PCI or ISA devices when no other device drivers +are present for those devices and it creates device special files for all +resources associated with the device. The driver itself has no knowledge of the device it attaches to. Programs can open these device special files and perform register-level reads and writes. @@ -75,9 +75,9 @@ All device special files corresponding t with .Pa pci::: representing the location of the PCI device in the PCI hierarchy. -A location includes: +A PCI location includes: .Pp -.Bl -tag -width XXXXXX -compact +.Bl -tag -width XXXXXX -compact -offset indent .It The PCI domain number .It @@ -91,6 +91,10 @@ The PCI function number Every PCI device has a device special file called .Pa pcicfg . This device special file gives access to the PCI configuration space. +A device special file called +.Pa busdma +is also created. +This device special file provides the interfaces needed for doing DMA. For each valid base address register (BAR), a device special file is created that contains the BAR offset and the resource type. A resource type can be either @@ -98,15 +102,49 @@ A resource type can be either or .Pa mem representing I/O port or memory mapped I/O space (resp.) +.Pp +ISA devices do not have a location. Instead, they are identified by the +first I/O port address or first memory mapped I/O address. +Consequently, all device special files corresponding to an ISA device are +located under +.Pa /dev/proto/isa: +with +.Pa addr +the address in hexadecimal notation. +For each I/O port or memory mapped I/O address, a device special file is +created that contains the resource identification used by the kernel and +the resource type. +The resource type can be either +.Pa io +or +.Pa mem +representing I/O port or memory mapped I/O space (resp.) +When the device has a DMA channel assigned to it, a device special file +with the name +.Pa busdma +is created as well. +This device special file provides the interfaces needed for doing DMA. +.Pp +If the ISA device is not a Plug-and-Play device nor present in the ACPI +device tree, it must have the appropriate hints so that the kernel can +reserve the resources for it. .\" .Sh EXAMPLES A single function PCI device in domain 0, on bus 1, in slot 2 and having a single memory mapped I/O region will have the following device special files: .Pp -.Bl -tag -width XXXXXX -compact +.Bl -tag -width XXXXXX -compact -offset indent .It Pa /dev/proto/pci0:1:2:0/10.mem .It Pa /dev/proto/pci0:1:2:0/pcicfg .El +.Pp +A legacy floppy controller will have the following device files: +.Pp +.Bl -tag -width XXXXXX -compact -offset indent +.It Pa /dev/proto/isa:0x3f0/00.io +.It Pa /dev/proto/isa:0x3f0/01.io +.It Pa /dev/proto/isa:0x3f0/busdma +.El .\" .Sh AUTHORS The @@ -123,13 +161,12 @@ It is not advisable to use this driver o The .Nm driver does not yet support interrupts. -Since interrupts cannot be handled by the driver itself, they must be converted -into signals and delivered to the program that has registered for interrupts. -.Pp -In order to test the transmission or reception of data, some means of doing -direct memory access (DMA) by the device must be possible. -This too must be under the control of the program. -The details of how a program can set up and -initiate DMA still need to be fleshed out. -.Pp -Support for non-PCI devices has not been implemented yet. +Since interrupts cannot be handled by the driver itself, they must be +converted into signals and delivered to the program that has registered +for interrupts. +A satisfactory mechanism for keeping the interrupt masked during the +signal handling is still being worked out. +.Pp +DMA support for devices other than busmaster devices is not present yet. +The details of how a program is to interact with the DMA controller still +need to be fleshed out. From owner-svn-src-head@freebsd.org Fri Jul 3 16:55:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 689D0994791; Fri, 3 Jul 2015 16:55:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5976311AD; Fri, 3 Jul 2015 16:55:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63Gt9bu019590; Fri, 3 Jul 2015 16:55:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63Gt9hu019589; Fri, 3 Jul 2015 16:55:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201507031655.t63Gt9hu019589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 3 Jul 2015 16:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285100 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 16:55:09 -0000 Author: trasz Date: Fri Jul 3 16:55:08 2015 New Revision: 285100 URL: https://svnweb.freebsd.org/changeset/base/285100 Log: Make ctl(4) appear in "man -k iscsi" results. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/ctl.4 Modified: head/share/man/man4/ctl.4 ============================================================================== --- head/share/man/man4/ctl.4 Fri Jul 3 16:20:14 2015 (r285099) +++ head/share/man/man4/ctl.4 Fri Jul 3 16:55:08 2015 (r285100) @@ -23,12 +23,12 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd June 20, 2015 +.Dd July 3, 2015 .Dt CTL 4 .Os .Sh NAME .Nm ctl -.Nd CAM Target Layer +.Nd CAM Target Layer / iSCSI target .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your From owner-svn-src-head@freebsd.org Fri Jul 3 17:08:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0B65994AB7; Fri, 3 Jul 2015 17:08:29 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64E301DC9; Fri, 3 Jul 2015 17:08:29 +0000 (UTC) (envelope-from royger@gmail.com) Received: by wiwl6 with SMTP id l6so232303321wiw.0; Fri, 03 Jul 2015 10:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=kmgBXZdp3EWt4EGWToWGPC2E5DqimT8lGzxUAeRD8OA=; b=X0wd6mYV1UNf5FqimphFWMdAhhiShZ3qJQfI6G9YFJb/FcGWeFQKEPk85Ww2O0OeH6 s+nLcFK2Px3toEMVjU1w0O/UD7dVkR992kE/vW+rWnRAniqFb2IpKtddRpMgicZumISl m+0VKM3wdiqaqOroQXI9EOB66Y+m0rJ53UyUKTOXKvN9UeKQfjxqzPVFOSpGJv2gRvSn cc0U2w12oED5UpQj8XZdKS5snuln39rZf6LsmBkdQD776F0bpPOWMalibbzuzS6+RBJl lcVxVcE92XIiVmzr1hLxmWpVpIkqx1MyyBw8Oarz/UdRaR0EQtqJbDGyPR0g+UqtkpkG EdQg== X-Received: by 10.194.134.9 with SMTP id pg9mr74473686wjb.5.1435943307696; Fri, 03 Jul 2015 10:08:27 -0700 (PDT) Received: from [172.16.1.30] (5.Red-79-156-191.staticIP.rima-tde.net. [79.156.191.5]) by mx.google.com with ESMTPSA id um5sm14242160wjc.1.2015.07.03.10.08.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 10:08:26 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <5596C188.10404@FreeBSD.org> Date: Fri, 03 Jul 2015 19:08:24 +0200 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285068 - in head/sys: conf modules/agp modules/geom/geom_part/geom_part_apm modules/geom/geom_part/geom_part_bsd modules/geom/geom_part/geom_part_bsd64 modules/geom/geom_part/geom_part... References: <201507030150.t631oRd0039490@repo.freebsd.org> In-Reply-To: <201507030150.t631oRd0039490@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 17:08:29 -0000 El 03/07/15 a les 3.50, Warner Losh ha escrit: > Author: imp > Date: Fri Jul 3 01:50:26 2015 > New Revision: 285068 > URL: https://svnweb.freebsd.org/changeset/base/285068 > > Log: > Kill MFILES and find things automatically. It turned out to be only > lightly used. Find the proper .m file when we depend on *_if.[ch] in > the srcs line, with seat-belts for false positive matches. This uses > make's path mechanism. A further refinement would be to calculate this > once, and then pass the resulting _MPATH to modules submakes. This makes building the kernel from a NFS share extremely slow, I've been waiting for >2h for a simple buildkernel to finish, and I ended up killing it in order to bisect what was causing this (and it was still at the "make dependencies" phase only). Roger. From owner-svn-src-head@freebsd.org Fri Jul 3 17:09:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A99A3994AF2; Fri, 3 Jul 2015 17:09:28 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AB781F12; Fri, 3 Jul 2015 17:09:28 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63H9SgA025560; Fri, 3 Jul 2015 17:09:28 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63H9S6N025558; Fri, 3 Jul 2015 17:09:28 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201507031709.t63H9S6N025558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 3 Jul 2015 17:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285103 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 17:09:28 -0000 Author: loos Date: Fri Jul 3 17:09:27 2015 New Revision: 285103 URL: https://svnweb.freebsd.org/changeset/base/285103 Log: Remove duplicate and unnecessary includes. While here remove an unused and wrong define. Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_clk.h Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Fri Jul 3 16:58:17 2015 (r285102) +++ head/sys/arm/allwinner/a10_clk.c Fri Jul 3 17:09:27 2015 (r285103) @@ -36,20 +36,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include #include -#include -#include -#include #include -#include #include -#include - #include "a10_clk.h" struct a10_ccm_softc { Modified: head/sys/arm/allwinner/a10_clk.h ============================================================================== --- head/sys/arm/allwinner/a10_clk.h Fri Jul 3 16:58:17 2015 (r285102) +++ head/sys/arm/allwinner/a10_clk.h Fri Jul 3 17:09:27 2015 (r285103) @@ -29,8 +29,6 @@ #ifndef _A10_CLK_H_ #define _A10_CLK_H_ -#define CCMU_BASE 0xe1c20000 - #define CCM_PLL1_CFG 0x0000 #define CCM_PLL1_TUN 0x0004 #define CCM_PLL2_CFG 0x0008 From owner-svn-src-head@freebsd.org Fri Jul 3 17:26:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C8F4994E8D; Fri, 3 Jul 2015 17:26:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ED292A16; Fri, 3 Jul 2015 17:26:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igrv9 with SMTP id v9so80969378igr.1; Fri, 03 Jul 2015 10:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=e6bw2zV82LL/kuepGflFNiBpj/Yvq1PaVGhBkqzG0K4=; b=jNeIdJsAxQD7q3dBqhN74NY3V872NUL6iYqmAXICWRG0PPM54WXcidvhhwZibd9kWT Psx1DFZyp35xbuZsDQleKVvbuDiPoOYF5kr+Na/Cwllv2vdFGyd6nXXVJl5id2Ik//ub y8C6o8TNGRER/cj1fXCo6vkmPIncW8Kfu6o22NStZ1UC8gdgaFjp8M+Z4/ZraO18y+TS aDkdDwjSs1/0TDN8k/KsNCO6YDc6uoWqm40kQuXoudmFpw3HwPvuyG03duTj8wC7crjd XZ6F8clkPfry1qno8bxH9PO/0U/4FmlGr+LhDlpzrWR4eCmQcbd8UR22V+ypYQXLucK5 XnOg== MIME-Version: 1.0 X-Received: by 10.50.111.167 with SMTP id ij7mr50289656igb.49.1435944391367; Fri, 03 Jul 2015 10:26:31 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Fri, 3 Jul 2015 10:26:31 -0700 (PDT) In-Reply-To: <5596C188.10404@FreeBSD.org> References: <201507030150.t631oRd0039490@repo.freebsd.org> <5596C188.10404@FreeBSD.org> Date: Fri, 3 Jul 2015 10:26:31 -0700 Message-ID: Subject: Re: svn commit: r285068 - in head/sys: conf modules/agp modules/geom/geom_part/geom_part_apm modules/geom/geom_part/geom_part_bsd modules/geom/geom_part/geom_part_bsd64 modules/geom/geom_part/geom_part... From: Adrian Chadd To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: Warner Losh , "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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 17:26:32 -0000 ok, so why's it make NFS builds so slow? -a On 3 July 2015 at 10:08, Roger Pau Monn=C3=A9 wrote: > El 03/07/15 a les 3.50, Warner Losh ha escrit: >> Author: imp >> Date: Fri Jul 3 01:50:26 2015 >> New Revision: 285068 >> URL: https://svnweb.freebsd.org/changeset/base/285068 >> >> Log: >> Kill MFILES and find things automatically. It turned out to be only >> lightly used. Find the proper .m file when we depend on *_if.[ch] in >> the srcs line, with seat-belts for false positive matches. This uses >> make's path mechanism. A further refinement would be to calculate this >> once, and then pass the resulting _MPATH to modules submakes. > > This makes building the kernel from a NFS share extremely slow, I've > been waiting for >2h for a simple buildkernel to finish, and I ended up > killing it in order to bisect what was causing this (and it was still at > the "make dependencies" phase only). > > Roger. > > From owner-svn-src-head@freebsd.org Fri Jul 3 17:30:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19996994EEF; Fri, 3 Jul 2015 17:30:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0770D2CAD; Fri, 3 Jul 2015 17:30:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63HUVk4036041; Fri, 3 Jul 2015 17:30:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63HUVPe036040; Fri, 3 Jul 2015 17:30:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507031730.t63HUVPe036040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 3 Jul 2015 17:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285104 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 17:30:32 -0000 Author: kib Date: Fri Jul 3 17:30:31 2015 New Revision: 285104 URL: https://svnweb.freebsd.org/changeset/base/285104 Log: Grammar and language fixes. Submitted by: wblock Review: https://reviews.freebsd.org/D2969 MFC after: 12 days Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Fri Jul 3 17:09:27 2015 (r285103) +++ head/lib/libc/sys/ptrace.2 Fri Jul 3 17:30:31 2015 (r285104) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd June 30, 2015 +.Dd July 3, 2015 .Dt PTRACE 2 .Os .Sh NAME @@ -506,16 +506,16 @@ argument is ignored. .Sh x86 MACHINE-SPECIFIC REQUESTS .Bl -tag -width "Dv PT_GETXSTATE_INFO" .It Dv PT_GETXMMREGS -Copies out the XMM FPU state into the buffer pointed to by the +Copy the XMM FPU state into the buffer pointed to by the argument .Fa addr . -The buffer has the same layout as the 32bit save buffer for the +The buffer has the same layout as the 32-bit save buffer for the machine instruction .Dv FXSAVE . .Pp -This request is only valid for i386 programs, both on native 32bit +This request is only valid for i386 programs, both on native 32-bit systems and on amd64 kernels. -For 64bit amd64 programs, the XMM state is reported as part of +For 64-bit amd64 programs, the XMM state is reported as part of the FPU state returned by the .Dv PT_GETFPREGS request. @@ -524,10 +524,10 @@ The .Fa data argument is ignored. .It Dv PT_SETXMMREGS -Loads the XMM FPU state for the thread from the buffer pointed to +Load the XMM FPU state for the thread from the buffer pointed to by the argument .Fa addr . -The buffer has the same layout as the 32bit load buffer for the +The buffer has the same layout as the 32-bit load buffer for the machine instruction .Dv FXRSTOR . .Pp @@ -539,15 +539,13 @@ The .Fa data argument is ignored. .It Dv PT_GETXSTATE_INFO -Returns the information about the enablement state of the XSAVE FPU -extensions supported by the CPU and allowed by the OS for use by userspace -programs. +Report which XSAVE FPU extensions are supported by the CPU +and allowed in userspace programs. The .Fa addr -argument must point to the variable of type +argument must point to a variable of type .Vt struct ptrace_xstate_info , which contains the information on the request return. -The .Vt struct ptrace_xstate_info is defined as follows: .Bd -literal @@ -558,8 +556,8 @@ struct ptrace_xstate_info { .Ed The .Dv xsave_mask -field is the bitmask of the currently enabled extensions. -The meaning of the bits is defined by the Intel and AMD +field is a bitmask of the currently enabled extensions. +The meaning of the bits is defined in the Intel and AMD processor documentation. The .Dv xsave_len @@ -573,10 +571,10 @@ The argument value must be equal to the size of the .Vt struct ptrace_xstate_info . .It Dv PT_GETXSTATE -Returns the content of the XSAVE area for the thread. +Return the content of the XSAVE area for the thread. The .Fa addr -argument points to the buffer where the content is copied, the +argument points to the buffer where the content is copied, and the .Fa data argument specifies the size of the buffer. The kernel copies out as much content as allowed by the buffer size. @@ -590,8 +588,12 @@ pointer. The buffer size is passed in the .Fa data argument. -The buffer must be at least as large to allow the x87 FPU and XMM state, -but not large than the XSAVE state length, as reported by the +The buffer must be at least as large as the +.Vt struct savefpu +(defined in +.Pa x86/fpu.h ) +to allow the complete x87 FPU and XMM state load. +It must not be larger than the XSAVE state length, as reported by the .Dv xsave_len field from the .Vt struct ptrace_xstate_info @@ -602,26 +604,28 @@ Layout of the buffer is identical to the .Dv XRSTOR machine instruction. .It Dv PT_GETFSBASE -The request returns the value of base used when doing segmented +Return the value of the base used when doing segmented memory addressing using the %fs segment register. The .Fa addr -argument points to the +argument points to an .Vt unsigned long -variable which gets the base value. +variable where the base value is stored. .Pp The .Fa data argument is ignored. .It Dv PT_GETGSBASE -Same as the +Like the .Dv PT_GETFSBASE request, but returns the base for the %gs segment register. .It Dv PT_SETFSBASE -Sets the base for the %fs segment register to the value pointed +Set the base for the %fs segment register to the value pointed to by the .Fa addr -argument, which must point to the +argument. +.Fa addr +must point to the .Vt unsigned long variable containing the new base. .Pp @@ -629,27 +633,25 @@ The .Fa data argument is ignored. .It Dv PT_SETGSBASE -Same as the +Like the .Dv PT_SETFSBASE -request, but allows setting the base for the %gs segment register. +request, but sets the base for the %gs segment register. .El .Sh PowerPC MACHINE-SPECIFIC REQUESTS .Bl -tag -width "Dv PT_SETVRREGS" .It Dv PT_GETVRREGS -Returns the +Return the thread's .Dv ALTIVEC -machine state for the thread into the buffer pointed to by -the argument +machine state in the buffer pointed to by .Fa addr . .Pp The .Fa data argument is ignored. .It Dv PT_SETVRREGS -Set the +Set the thread's .Dv ALTIVEC -machine state for the thread from the buffer pointed to by -the argument +machine state from the buffer pointed to by .Fa addr . .Pp The @@ -719,24 +721,36 @@ was less than or equal to zero, or large structure known to the kernel. .It The size (in -.Fa data) +.Fa data ) provided to the x86-specific .Dv PT_GETXSTATE_INFO request was not equal to the size of the .Vt struct ptrace_xstate_info . .It The size (in -.Fa data) +.Fa data ) +provided to the x86-specific +.Dv PT_SETXSTATE +request was less than the size of the x87 plus the XMM save area. +.It +The size (in +.Fa data ) provided to the x86-specific .Dv PT_SETXSTATE -request was less than the size of the x87 + XMM save area, -or larger than returned in the +request was larger than returned in the .Dv xsave_len member of the .Vt struct ptrace_xstate_info from the .Dv PT_GETXSTATE_INFO request. +.It +The base value, provided to the amd64-specific requests +.Dv PT_SETFSBASE +or +.Dv PT_SETGSBASE , +pointed outside of the valid user address space. +This error will not occur in 32-bit programs. .El .It Bq Er EBUSY .Bl -bullet -compact From owner-svn-src-head@freebsd.org Fri Jul 3 17:35:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C881994010; Fri, 3 Jul 2015 17:35:41 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::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 AC4ED2FE0; Fri, 3 Jul 2015 17:35:40 +0000 (UTC) (envelope-from royger@gmail.com) Received: by wguu7 with SMTP id u7so93447921wgu.3; Fri, 03 Jul 2015 10:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=+HisprHhdB+HKR83EUN8q47wNaS0isxYFKcTm7cAKSc=; b=Lw3YA+tYxgwV5MtNeQeh6T9uwQLxm+7n9JgzDCpCvT+Sz3QrrQ4qw8nkiuK0+UmBHI aX0jufwcr2J8dkjSeHxdfgEzbo8PYNLiRaMNLFFFAAesPCzif4g40fMcsr2GgujWwxLs dBwH+BUEorb6/SVaDdjElTMfqvS811GCH1p6ze0HqwlZF7xx+ur14zbU3xBuCvVN8LtY JKgyq9/bFHbixzAy3e22QlDTForjwpAj6oGzgMAUrtTmjJK4Zl0Y9+CvxNgyUCgbT/Eu tNoCe4HlcwnDFXlBWPFTVVFPAL55HFxtT2xGe6lmtrTwdk/xoAB3jXA2MDtdMJaQgbUO lHiA== X-Received: by 10.194.178.201 with SMTP id da9mr26884705wjc.139.1435944939067; Fri, 03 Jul 2015 10:35:39 -0700 (PDT) Received: from [172.16.1.30] (5.Red-79-156-191.staticIP.rima-tde.net. [79.156.191.5]) by mx.google.com with ESMTPSA id q3sm14321587wjr.38.2015.07.03.10.35.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 10:35:37 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <5596C7E7.5090700@FreeBSD.org> Date: Fri, 03 Jul 2015 19:35:35 +0200 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Adrian Chadd CC: Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r285068 - in head/sys: conf modules/agp modules/geom/geom_part/geom_part_apm modules/geom/geom_part/geom_part_bsd modules/geom/geom_part/geom_part_bsd64 modules/geom/geom_part/geom_part... References: <201507030150.t631oRd0039490@repo.freebsd.org> <5596C188.10404@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 17:35:41 -0000 El 03/07/15 a les 19.26, Adrian Chadd ha escrit: > ok, so why's it make NFS builds so slow? AFAICT it makes the build process spawn a bunch of concurrent "find" processes that weren't previously there. Roger. From owner-svn-src-head@freebsd.org Fri Jul 3 17:54:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0F8F9942BB; Fri, 3 Jul 2015 17:54:42 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87B9B1AC5; Fri, 3 Jul 2015 17:54:42 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63HsgBi049983; Fri, 3 Jul 2015 17:54:42 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63HsfQZ049978; Fri, 3 Jul 2015 17:54:41 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201507031754.t63HsfQZ049978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 3 Jul 2015 17:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285105 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 17:54:42 -0000 Author: loos Date: Fri Jul 3 17:54:41 2015 New Revision: 285105 URL: https://svnweb.freebsd.org/changeset/base/285105 Log: Rename a10_emac_gpio_config() to a10_gpio_ethernet_activate() to make the change to GMAC easier on A20 SoCs. On A10 only the EMAC controller is available (fast ethernet), but on A20 there is also GMAC a high (or better) performant controller (gigabit ethernet). On A20 the both controllers uses the same pins to talk to the ethernet PHY (MII or RGMII) and they can be selected by the GPIO pin mux. There is work in progress to bring in GMAC support. Modified: head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/a10_gpio.h head/sys/arm/allwinner/if_emac.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Fri Jul 3 17:30:31 2015 (r285104) +++ head/sys/arm/allwinner/a10_gpio.c Fri Jul 3 17:54:41 2015 (r285105) @@ -524,8 +524,9 @@ static driver_t a10_gpio_driver = { DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0); int -a10_emac_gpio_config(uint32_t pin) +a10_gpio_ethernet_activate(uint32_t func) { + int i; struct a10_gpio_softc *sc = a10_gpio_sc; if (sc == NULL) @@ -533,7 +534,8 @@ a10_emac_gpio_config(uint32_t pin) /* Configure pin mux settings for MII. */ A10_GPIO_LOCK(sc); - a10_gpio_set_function(sc, pin, A10_GPIO_PULLDOWN); + for (i = 0; i <= 17; i++) + a10_gpio_set_function(sc, i, func); A10_GPIO_UNLOCK(sc); return (0); Modified: head/sys/arm/allwinner/a10_gpio.h ============================================================================== --- head/sys/arm/allwinner/a10_gpio.h Fri Jul 3 17:30:31 2015 (r285104) +++ head/sys/arm/allwinner/a10_gpio.h Fri Jul 3 17:54:41 2015 (r285105) @@ -29,6 +29,9 @@ #ifndef _A10_GPIO_H_ #define _A10_GPIO_H_ -int a10_emac_gpio_config(uint32_t pin); +#define A10_GPIO_FUNC_MII 2 +#define A10_GPIO_FUNC_RGMII 5 + +int a10_gpio_ethernet_activate(uint32_t); #endif Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Fri Jul 3 17:30:31 2015 (r285104) +++ head/sys/arm/allwinner/if_emac.c Fri Jul 3 17:54:41 2015 (r285105) @@ -142,17 +142,12 @@ static int sysctl_hw_emac_proc_limit(SYS static void emac_sys_setup(void) { - int i; + /* Activate EMAC clock. */ a10_clk_emac_activate(); - - /* - * Configure pin mux settings for MII. - * Pins PA0 from PA17. - */ - for (i = 0; i <= 17; i++) - a10_emac_gpio_config(i); - /* Map sram */ + /* Set the pin mux to EMAC (mii). */ + a10_gpio_ethernet_activate(A10_GPIO_FUNC_MII); + /* Map sram. */ a10_map_to_emac(); } From owner-svn-src-head@freebsd.org Fri Jul 3 18:39:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6049994BC8; Fri, 3 Jul 2015 18:39:26 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD8102EAF; Fri, 3 Jul 2015 18:39:26 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63IdQaC070567; Fri, 3 Jul 2015 18:39:26 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63IdQfb070565; Fri, 3 Jul 2015 18:39:26 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201507031839.t63IdQfb070565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 3 Jul 2015 18:39:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285106 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 18:39:26 -0000 Author: loos Date: Fri Jul 3 18:39:25 2015 New Revision: 285106 URL: https://svnweb.freebsd.org/changeset/base/285106 Log: Add the routines to activate the GMAC clock and setup the GMAC mode. Tested on Cubieboard 2 and Banana pi. Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_clk.h Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Fri Jul 3 17:54:41 2015 (r285105) +++ head/sys/arm/allwinner/a10_clk.c Fri Jul 3 18:39:25 2015 (r285106) @@ -182,6 +182,38 @@ a10_clk_emac_activate(void) return (0); } +int +a10_clk_gmac_activate(phandle_t node) +{ + char *phy_type; + struct a10_ccm_softc *sc; + uint32_t reg_value; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + /* Gating AHB clock for GMAC */ + reg_value = ccm_read_4(sc, CCM_AHB_GATING1); + reg_value |= CCM_AHB_GATING_GMAC; + ccm_write_4(sc, CCM_AHB_GATING1, reg_value); + + /* Set GMAC mode. */ + reg_value = CCM_GMAC_CLK_MII; + if (OF_getprop_alloc(node, "phy-type", 1, (void **)&phy_type) > 0) { + if (strcasecmp(phy_type, "rgmii") == 0) + reg_value = CCM_GMAC_CLK_RGMII | CCM_GMAC_MODE_RGMII; + else if (strcasecmp(phy_type, "rgmii-bpi") == 0) { + reg_value = CCM_GMAC_CLK_RGMII | CCM_GMAC_MODE_RGMII; + reg_value |= (3 << CCM_GMAC_CLK_DELAY_SHIFT); + } + free(phy_type, M_OFWPROP); + } + ccm_write_4(sc, CCM_GMAC_CLK, reg_value); + + return (0); +} + static void a10_clk_pll6_enable(void) { Modified: head/sys/arm/allwinner/a10_clk.h ============================================================================== --- head/sys/arm/allwinner/a10_clk.h Fri Jul 3 17:54:41 2015 (r285105) +++ head/sys/arm/allwinner/a10_clk.h Fri Jul 3 18:39:25 2015 (r285106) @@ -97,7 +97,16 @@ #define CCM_LVDS_CLK 0x014c #define CCM_HDMI_CLK 0x0150 #define CCM_MALI400_CLK 0x0154 +#define CCM_GMAC_CLK 0x0164 +#define CCM_GMAC_CLK_DELAY_SHIFT 10 +#define CCM_GMAC_CLK_MODE_MASK 0x7 +#define CCM_GMAC_MODE_RGMII (1 << 2) +#define CCM_GMAC_CLK_MII 0x0 +#define CCM_GMAC_CLK_EXT_RGMII 0x1 +#define CCM_GMAC_CLK_RGMII 0x2 + +/* AHB_GATING_REG0 */ #define CCM_AHB_GATING_USB0 (1 << 0) #define CCM_AHB_GATING_EHCI0 (1 << 1) #define CCM_AHB_GATING_EHCI1 (1 << 3) @@ -105,6 +114,9 @@ #define CCM_AHB_GATING_EMAC (1 << 17) #define CCM_AHB_GATING_SATA (1 << 25) +/* AHB_GATING_REG1 */ +#define CCM_AHB_GATING_GMAC (1 << 17) + #define CCM_USB_PHY (1 << 8) #define CCM_USB0_RESET (1 << 0) #define CCM_USB1_RESET (1 << 1) @@ -139,6 +151,7 @@ int a10_clk_usb_activate(void); int a10_clk_usb_deactivate(void); int a10_clk_emac_activate(void); +int a10_clk_gmac_activate(phandle_t); int a10_clk_ahci_activate(void); int a10_clk_mmc_activate(int); int a10_clk_mmc_cfg(int, int); From owner-svn-src-head@freebsd.org Fri Jul 3 19:01:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52C37994096; Fri, 3 Jul 2015 19:01:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4412B1BAA; Fri, 3 Jul 2015 19:01:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63J1dUe084510; Fri, 3 Jul 2015 19:01:39 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63J1dNr084509; Fri, 3 Jul 2015 19:01:39 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201507031901.t63J1dNr084509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 3 Jul 2015 19:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285107 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 19:01:39 -0000 Author: ae Date: Fri Jul 3 19:01:38 2015 New Revision: 285107 URL: https://svnweb.freebsd.org/changeset/base/285107 Log: Keep IPv6 address specified by IPV6_PKTINFO socket option in kernel internal form to be able handle link-local IPv6 addresses. Reported by: kp Tested by: kp Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri Jul 3 18:39:25 2015 (r285106) +++ head/sys/netinet6/ip6_output.c Fri Jul 3 19:01:38 2015 (r285107) @@ -2189,12 +2189,14 @@ ip6_getpcbopt(struct ip6_pktopts *pktopt switch (optname) { case IPV6_PKTINFO: - if (pktopt && pktopt->ip6po_pktinfo) - optdata = (void *)pktopt->ip6po_pktinfo; - else { + optdata = (void *)&null_pktinfo; + if (pktopt && pktopt->ip6po_pktinfo) { + bcopy(pktopt->ip6po_pktinfo, &null_pktinfo, + sizeof(null_pktinfo)); + in6_clearscope(&null_pktinfo.ipi6_addr); + } else { /* XXX: we don't have to do this every time... */ bzero(&null_pktinfo, sizeof(null_pktinfo)); - optdata = (void *)&null_pktinfo; } optdatalen = sizeof(struct in6_pktinfo); break; @@ -2566,6 +2568,7 @@ ip6_setpktopt(int optname, u_char *buf, !IN6_IS_ADDR_UNSPECIFIED(&pktinfo->ipi6_addr)) { struct in6_ifaddr *ia; + in6_setscope(&pktinfo->ipi6_addr, ifp, NULL); ia = in6ifa_ifpwithaddr(ifp, &pktinfo->ipi6_addr); if (ia == NULL) return (EADDRNOTAVAIL); From owner-svn-src-head@freebsd.org Fri Jul 3 20:09:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 964FC994D05; Fri, 3 Jul 2015 20:09:16 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 871321B0A; Fri, 3 Jul 2015 20:09:16 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63K9GlL015343; Fri, 3 Jul 2015 20:09:16 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63K9FW1015338; Fri, 3 Jul 2015 20:09:15 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201507032009.t63K9FW1015338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Fri, 3 Jul 2015 20:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285108 - in head: lib/libipsec sbin/setkey sys/net usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 20:09:16 -0000 Author: gnn Date: Fri Jul 3 20:09:14 2015 New Revision: 285108 URL: https://svnweb.freebsd.org/changeset/base/285108 Log: New AES modes for IPSec, user space components. Update setkey and libipsec to understand aes-gcm-16 as an encryption method. A partial commit of the work in review D2936. Submitted by: eri Reviewed by: jmg MFC after: 2 weeks Sponsored by: Rubicon Communications (Netgate) Modified: head/lib/libipsec/pfkey_dump.c head/sbin/setkey/setkey.8 head/sbin/setkey/token.l head/sys/net/pfkeyv2.h head/usr.bin/netstat/ipsec.c Modified: head/lib/libipsec/pfkey_dump.c ============================================================================== --- head/lib/libipsec/pfkey_dump.c Fri Jul 3 19:01:38 2015 (r285107) +++ head/lib/libipsec/pfkey_dump.c Fri Jul 3 20:09:14 2015 (r285108) @@ -187,6 +187,9 @@ static struct val2str str_alg_enc[] = { #ifdef SADB_X_EALG_AESCTR { SADB_X_EALG_AESCTR, "aes-ctr", }, #endif +#ifdef SADB_X_EALG_AESGCM16 + { SADB_X_EALG_AESGCM16, "aes-gcm-16", }, +#endif #ifdef SADB_X_EALG_CAMELLIACBC { SADB_X_EALG_CAMELLIACBC, "camellia-cbc", }, #endif Modified: head/sbin/setkey/setkey.8 ============================================================================== --- head/sbin/setkey/setkey.8 Fri Jul 3 19:01:38 2015 (r285107) +++ head/sbin/setkey/setkey.8 Fri Jul 3 20:09:14 2015 (r285108) @@ -627,11 +627,12 @@ des-deriv 64 ipsec-ciph-des-derived-01 3des-deriv 192 no document rijndael-cbc 128/192/256 rfc3602 aes-ctr 160/224/288 draft-ietf-ipsec-ciph-aes-ctr-03 +aes-gcm-16 160/224/288 rfc4106 camellia-cbc 128/192/256 rfc4312 .Ed .Pp Note that the first 128/192/256 bits of a key for -.Li aes-ctr +.Li aes-ctr or aes-gcm-16 will be used as AES key, and remaining 32 bits will be used as nonce. .Pp The following are the list of compression algorithms that can be used Modified: head/sbin/setkey/token.l ============================================================================== --- head/sbin/setkey/token.l Fri Jul 3 19:01:38 2015 (r285107) +++ head/sbin/setkey/token.l Fri Jul 3 20:09:14 2015 (r285108) @@ -168,6 +168,7 @@ tcp { yylval.num = 0; return(PR_TCP); } rijndael-cbc { yylval.num = SADB_X_EALG_RIJNDAELCBC; BEGIN INITIAL; return(ALG_ENC); } aes-ctr { yylval.num = SADB_X_EALG_AESCTR; BEGIN INITIAL; return(ALG_ENC); } camellia-cbc { yylval.num = SADB_X_EALG_CAMELLIACBC; BEGIN INITIAL; return(ALG_ENC); } +aes-gcm-16 { yylval.num = SADB_X_EALG_AESGCM16; BEGIN INITIAL; return(ALG_ENC); } /* compression algorithms */ {hyphen}C { return(F_COMP); } Modified: head/sys/net/pfkeyv2.h ============================================================================== --- head/sys/net/pfkeyv2.h Fri Jul 3 19:01:38 2015 (r285107) +++ head/sys/net/pfkeyv2.h Fri Jul 3 20:09:14 2015 (r285108) @@ -343,6 +343,9 @@ struct sadb_x_nat_t_frag { #define SADB_X_AALG_SHA2_512 7 #define SADB_X_AALG_RIPEMD160HMAC 8 #define SADB_X_AALG_AES_XCBC_MAC 9 /* draft-ietf-ipsec-ciph-aes-xcbc-mac-04 */ +#define SADB_X_AALG_AES128GMAC 11 /* RFC4543 + Errata1821 */ +#define SADB_X_AALG_AES192GMAC 12 +#define SADB_X_AALG_AES256GMAC 13 /* private allocations should use 249-255 (RFC2407) */ #define SADB_X_AALG_MD5 249 /* Keyed MD5 */ #define SADB_X_AALG_SHA 250 /* Keyed SHA */ @@ -360,8 +363,12 @@ struct sadb_x_nat_t_frag { #define SADB_X_EALG_BLOWFISHCBC 7 #define SADB_X_EALG_RIJNDAELCBC 12 #define SADB_X_EALG_AES 12 +#define SADB_X_EALG_AESGCM8 18 /* RFC4106 */ +#define SADB_X_EALG_AESGCM12 19 +#define SADB_X_EALG_AESGCM16 20 /* private allocations - based on RFC4312/IANA assignment */ #define SADB_X_EALG_CAMELLIACBC 22 +#define SADB_X_EALG_AESGMAC 23 /* RFC4543 + Errata1821 */ /* private allocations should use 249-255 (RFC2407) */ #define SADB_X_EALG_SKIPJACK 249 /*250*/ /* for IPSEC */ #define SADB_X_EALG_AESCTR 250 /*249*/ /* draft-ietf-ipsec-ciph-aes-ctr-03 */ Modified: head/usr.bin/netstat/ipsec.c ============================================================================== --- head/usr.bin/netstat/ipsec.c Fri Jul 3 19:01:38 2015 (r285107) +++ head/usr.bin/netstat/ipsec.c Fri Jul 3 20:09:14 2015 (r285108) @@ -157,6 +157,9 @@ static struct val2str ipsec_espnames[] = #ifdef SADB_X_EALG_AESCTR { SADB_X_EALG_AESCTR, "aes-ctr", }, #endif +#ifdef SADB_X_EALG_AESGCM16 + { SADB_X_EALG_AESGCM16, "aes-gcm-16", }, +#endif { -1, NULL }, }; From owner-svn-src-head@freebsd.org Fri Jul 3 20:16:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBB34994E35 for ; Fri, 3 Jul 2015 20:16:01 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ig0-f175.google.com (mail-ig0-f175.google.com [209.85.213.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23B9C1F37 for ; Fri, 3 Jul 2015 20:16:00 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by igblr2 with SMTP id lr2so82795991igb.0 for ; Fri, 03 Jul 2015 13:15:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=fkr1aXAcnLMUG3iKRQ/T4nxheLIvec8nb1k/+l9LWsg=; b=R7iSdsTYd34eE9dTHRQH1MHAeClODF/oKMSSPTv8UYHmuGzkiDeXOE9QEz+s5XRsZL UL576O8NkUHs294EpPOSh5Vk6Pjg1GI58tKuR3dneWAAzXc22cA1eB3pHlyXR2SFCdri GKqKU5t1bNHahaUwHFmKVRqqCOoT9kKhVUZZMHJ0TPS+8JJ60Goxpdzb1FuhDNZJR5v0 W5vbqGAOU/lT5kR2A5PNjgl7fVl3MfFbOHZEbhh541HOP4E4YYMHzEeOjGAm+Ar7l9Ud JY0ZUDpfXhuYqdpS7lqEnq/uZ+4Z7dPkZZTc8/4IFxu4BUL6shU4ptOiZT8/77qp0IWB QRaA== X-Gm-Message-State: ALoCoQlpbx6xBAlRAB4RntpPbwJSukN/sMWXwy9T73pRX5KQFnr6dBNOPQ56OKpqxxm7WHXVYFmN X-Received: by 10.43.10.194 with SMTP id pb2mr21252303icb.31.1435954553935; Fri, 03 Jul 2015 13:15:53 -0700 (PDT) Received: from netflix-mac-wired.bsdimp.com ([50.253.99.174]) by mx.google.com with ESMTPSA id a2sm4128592igx.3.2015.07.03.13.15.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Jul 2015 13:15:53 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r285068 - in head/sys: conf modules/agp modules/geom/geom_part/geom_part_apm modules/geom/geom_part/geom_part_bsd modules/geom/geom_part/geom_part_bsd64 modules/geom/geom_part/geom_part... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/signed; boundary="Apple-Mail=_70850091-FC69-4760-B2AA-0BBA8A0E0935"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Warner Losh In-Reply-To: <5596C7E7.5090700@FreeBSD.org> Date: Fri, 3 Jul 2015 14:15:50 -0600 Cc: Adrian Chadd , Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <68C8F69B-56DF-45C3-8DBB-40514CA48D85@bsdimp.com> References: <201507030150.t631oRd0039490@repo.freebsd.org> <5596C188.10404@FreeBSD.org> <5596C7E7.5090700@FreeBSD.org> To: =?utf-8?Q?Roger_Pau_Monn=C3=A9?= X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 20:16:02 -0000 --Apple-Mail=_70850091-FC69-4760-B2AA-0BBA8A0E0935 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 3, 2015, at 11:35 AM, Roger Pau Monn=C3=A9 = wrote: >=20 > El 03/07/15 a les 19.26, Adrian Chadd ha escrit: >> ok, so why's it make NFS builds so slow? >=20 > AFAICT it makes the build process spawn a bunch of concurrent "find" > processes that weren't previously there. OK. I=E2=80=99ll fix it. I knew it might slow things down a little, but = this is quite a bit more than =E2=80=9Ca little=E2=80=9D. Warner --Apple-Mail=_70850091-FC69-4760-B2AA-0BBA8A0E0935 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 iQIcBAEBCgAGBQJVlu13AAoJEGwc0Sh9sBEAvgoP/0aS0FRA+Mk4g4B7v8MCaKUp fxPmx/HA3nIpQpt48YxrXxo2hEeQMEiNmSskS/PqcToe8nzurUYm/VPuEA0RLfI/ NX8pShP0/IYNpbdNy45qHEbUwW0UpMFy9sbRBYD7P0uFIHH+08VY1EMeNFHid//P WqX5Sz989a7PkbT6XYhshlA/jlJAJfetUjQuQdUhDrUYcUHnZupY/u5/VFedKA5a A3Q0LFUWx4RfUI64d1+DWjbwNxIwqCoUuO6bMQKJZw/A8lOInnN1dKAZ2ZejpBIT laGbyV669VJ/9FN3GyoApXfB9Aha+ON30wgVdoTobWQpBfWZ3uU6IRsmOcFPBRFk OKFMCDKs15bQq9QwI9oWQa2qqne5bMAr62blUCbuFCexsSoQA3J4wItu2SdO0NbJ kggpwzyHgamSzWQIklDmKk7ZHNa5xPGV3XDYbw2XIP3PFjE7/1J8NvNZ33wA/v4z ksL6ycCDZRYqsgOcZz3iBzcetuU4RGmcxNiwkFj9N0LO05ISStT+A+tiwkTohM8v 0LlTbn0DO+4afI3EsxnoKPNy+qH+M7wwAvspwz1wYvnEb1PEoWUK3zEfCUMgtpBK vtq31jCiMHOobtlA/3Jz0wZogCcpx7F6z3HHXwRzsK048/uXRnEk+0Jod7Bia/qy C4gxDtnc0TfyPV3oOga8 =S8B+ -----END PGP SIGNATURE----- --Apple-Mail=_70850091-FC69-4760-B2AA-0BBA8A0E0935-- From owner-svn-src-head@freebsd.org Fri Jul 3 20:42:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DB6B993411; Fri, 3 Jul 2015 20:42:32 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F32A2D34; Fri, 3 Jul 2015 20:42:32 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63KgWYt034186; Fri, 3 Jul 2015 20:42:32 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63KgW8G034184; Fri, 3 Jul 2015 20:42:32 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201507032042.t63KgW8G034184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Fri, 3 Jul 2015 20:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285111 - head/sbin/setkey X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 20:42:32 -0000 Author: gnn Date: Fri Jul 3 20:42:31 2015 New Revision: 285111 URL: https://svnweb.freebsd.org/changeset/base/285111 Log: Update the date on the manual page. Noticed by: bz Modified: head/sbin/setkey/setkey.8 Modified: head/sbin/setkey/setkey.8 ============================================================================== --- head/sbin/setkey/setkey.8 Fri Jul 3 20:31:27 2015 (r285110) +++ head/sbin/setkey/setkey.8 Fri Jul 3 20:42:31 2015 (r285111) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2014 +.Dd July 3, 2015 .Dt SETKEY 8 .Os .\" From owner-svn-src-head@freebsd.org Fri Jul 3 22:11:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F54C994615; Fri, 3 Jul 2015 22:11:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B5781CC4; Fri, 3 Jul 2015 22:11:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63MB8sx078284; Fri, 3 Jul 2015 22:11:08 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63MB8vm078283; Fri, 3 Jul 2015 22:11:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201507032211.t63MB8vm078283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 Jul 2015 22:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285113 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 22:11:08 -0000 Author: rmacklem Date: Fri Jul 3 22:11:07 2015 New Revision: 285113 URL: https://svnweb.freebsd.org/changeset/base/285113 Log: If a "principal" argument isn't provided for a Kerberized NFS mount, the kernel would generate a bogus one with a ":/" suffix. This would only occur for the case where there was no explicit "principal" argument and the getaddrinfo() call in mount_nfs.c failed to a return a cannonical name for the server. This patch fixes this unusual case. PR: 201073 Submitted by: masato@itc.naist.jp MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Fri Jul 3 20:43:31 2015 (r285112) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Fri Jul 3 22:11:07 2015 (r285113) @@ -779,7 +779,7 @@ nfs_mount(struct mount *mp) struct thread *td; char hst[MNAMELEN]; u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100]; - char *opt, *name, *secname; + char *cp, *opt, *name, *secname; int nametimeo = NFS_DEFAULT_NAMETIMEO; int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; int minvers = 0; @@ -1158,8 +1158,12 @@ nfs_mount(struct mount *mp) if (vfs_getopt(mp->mnt_optnew, "principal", (void **)&name, NULL) == 0) strlcpy(srvkrbname, name, sizeof (srvkrbname)); - else + else { snprintf(srvkrbname, sizeof (srvkrbname), "nfs@%s", hst); + cp = strchr(srvkrbname, ':'); + if (cp != NULL) + *cp = '\0'; + } srvkrbnamelen = strlen(srvkrbname); if (vfs_getopt(mp->mnt_optnew, "gssname", (void **)&name, NULL) == 0) From owner-svn-src-head@freebsd.org Sat Jul 4 00:01:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72D0A994C0E; Sat, 4 Jul 2015 00:01:42 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6409E2B8A; Sat, 4 Jul 2015 00:01:42 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6401gkb034880; Sat, 4 Jul 2015 00:01:42 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6401gMB034879; Sat, 4 Jul 2015 00:01:42 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201507040001.t6401gMB034879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 4 Jul 2015 00:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285114 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 00:01:42 -0000 Author: gjb Date: Sat Jul 4 00:01:41 2015 New Revision: 285114 URL: https://svnweb.freebsd.org/changeset/base/285114 Log: Revert r285018, r285019, r285076, r285078, r285082. The true cause of the missing UFS/MSDOSFS labels has been identified, and only affects stable/10 at the moment. An request for commit to stable/10 will be pending RE approval after this commit. MFC after: 1 day X-MFC-Note: never X-MFC-Never: r285018, r285019, r285076, r285078, r285082 Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Fri Jul 3 22:11:07 2015 (r285113) +++ head/release/tools/arm.subr Sat Jul 4 00:01:41 2015 (r285114) @@ -128,14 +128,6 @@ arm_install_base() { echo 'sendmail_msp_queue_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'growfs_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf - # The fstab(5) above uses UFS/MSDOSFS labels. - echo 'geom_label_load="YES"' >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf - # Workaround missing loader.rc if needed. - if [ ! -e "${CHROOTDIR}/${DESTDIR}/boot/loader.rc" ]; then - chroot ${CHROOTDIR} \ - ln -s /boot/loader.rc.sample ${DESTDIR}/boot/loader.rc - fi - sync umount_loop ${CHROOTDIR}/${DESTDIR} From owner-svn-src-head@freebsd.org Sat Jul 4 02:22:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82285995277; Sat, 4 Jul 2015 02:22:27 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73C6B12E8; Sat, 4 Jul 2015 02:22:27 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t642MR3s006845; Sat, 4 Jul 2015 02:22:27 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t642MRAY006844; Sat, 4 Jul 2015 02:22:27 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201507040222.t642MRAY006844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Sat, 4 Jul 2015 02:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285117 - head/tests/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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 02:22:27 -0000 Author: jmmv Date: Sat Jul 4 02:22:26 2015 New Revision: 285117 URL: https://svnweb.freebsd.org/changeset/base/285117 Log: Make cleanup routines idempotent cleanup routines can be executed at any point during the execution of the body, including even before the body has done any real work. In those cases, cleanup routines should be careful to not raise spurious errors so as to not "override" the actual result of the test case. This is just general good coding style but is not a problem in practice for these specific tests. (The way I discovered the issue, though, was due to a regression I introduced in Kyua itself while refactoring some internals.) MFC after: 1 week Modified: head/tests/sys/netinet/fibs_test.sh Modified: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Sat Jul 4 01:02:43 2015 (r285116) +++ head/tests/sys/netinet/fibs_test.sh Sat Jul 4 02:22:26 2015 (r285117) @@ -98,9 +98,12 @@ arpresolve_checks_interface_fib_body() } arpresolve_checks_interface_fib_cleanup() { - for PID in `cat "processes_to_kill"`; do - kill $PID - done + if [ -f processes_to_kill ]; then + for pid in $(cat processes_to_kill); do + kill "${pid}" + done + rm -f processes_to_kill + fi cleanup_tap } @@ -476,8 +479,10 @@ setup_tap() cleanup_tap() { - for TAPD in `cat "tap_devices_to_cleanup"`; do - ifconfig ${TAPD} destroy - done - rm "tap_devices_to_cleanup" + if [ -f tap_devices_to_cleanup ]; then + for tap_device in $(cat tap_devices_to_cleanup); do + ifconfig "${tap_device}" destroy + done + rm -f tap_devices_to_cleanup + fi } From owner-svn-src-head@freebsd.org Sat Jul 4 02:24:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B7D39952BB; Sat, 4 Jul 2015 02:24:48 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A91215BA; Sat, 4 Jul 2015 02:24:48 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t642Olgh007179; Sat, 4 Jul 2015 02:24:47 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t642OlNX007178; Sat, 4 Jul 2015 02:24:47 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201507040224.t642OlNX007178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Sat, 4 Jul 2015 02:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285118 - head/share/examples/tests/tests/plain X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 02:24:48 -0000 Author: jmmv Date: Sat Jul 4 02:24:47 2015 New Revision: 285118 URL: https://svnweb.freebsd.org/changeset/base/285118 Log: Add missing shebang Plain test programs are not preprocessed by the build system (as opposed to ATF test cases, which automatically gain a shebang pointing at atf-sh), so we must take care of providing the shebang ourselves. I'm not sure why this was not causing problems with Kyua 0.11, but the upcoming 0.12 release chokes on this particular issue. MFC after: 1 week Modified: head/share/examples/tests/tests/plain/cp_test.sh Modified: head/share/examples/tests/tests/plain/cp_test.sh ============================================================================== --- head/share/examples/tests/tests/plain/cp_test.sh Sat Jul 4 02:22:26 2015 (r285117) +++ head/share/examples/tests/tests/plain/cp_test.sh Sat Jul 4 02:24:47 2015 (r285118) @@ -1,3 +1,4 @@ +#! /bin/sh # $FreeBSD$ # # Copyright 2013 Google Inc. From owner-svn-src-head@freebsd.org Sat Jul 4 02:37:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D88E59953CA; Sat, 4 Jul 2015 02:37:37 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B33A81B49; Sat, 4 Jul 2015 02:37:37 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t642bbeI012463; Sat, 4 Jul 2015 02:37:37 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t642bb4x012462; Sat, 4 Jul 2015 02:37:37 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201507040237.t642bb4x012462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Sat, 4 Jul 2015 02:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285119 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 02:37:38 -0000 Author: jmmv Date: Sat Jul 4 02:37:36 2015 New Revision: 285119 URL: https://svnweb.freebsd.org/changeset/base/285119 Log: Add support for TEST_METADATA Allow Makefiles to define generic metadata settings that apply to all test programs defined by a Makefile. The generic TEST_METADATA variable extends the per-test program settings already supported via TEST_METADATA.. This feature will be useful to easily apply some settings to all programs in a directory. In particular, Kyua 0.12 will support parallel execution of test programs and a bunch of them will need to be tagged as is_exclusive to indicate that they cannot be run in parallel with anything else due to their side-effects. It will be reasonable to set this setting on whole directories. MFC after: 1 week Modified: head/share/mk/suite.test.mk Modified: head/share/mk/suite.test.mk ============================================================================== --- head/share/mk/suite.test.mk Sat Jul 4 02:24:47 2015 (r285118) +++ head/share/mk/suite.test.mk Sat Jul 4 02:37:36 2015 (r285119) @@ -34,12 +34,19 @@ KYUAFILE?= auto # Kyua as this is later encoded in the Kyuafile test program definitions. #TEST_INTERFACE.= interface-name +# Metadata properties applicable to all test programs. +# +# All the variables for a test program defined in the Makefile are appended +# to the test program's definition in the Kyuafile. This feature can be +# used to avoid having to explicitly supply a Kyuafile in the source +# directory, allowing the caller Makefile to rely on the KYUAFILE=auto +# behavior defined here. +#TEST_METADATA+= key="value" + # Per-test program metadata properties as a list of key/value pairs. # -# All the variables for a particular program are appended to the program's -# definition in the Kyuafile. This feature can be used to avoid having to -# explicitly supply a Kyuafile in the source directory, allowing the caller -# Makefile to rely on the KYUAFILE=auto behavior defined here. +# These per-test program settings _extend_ the values provided in the +# unqualified TEST_METADATA variable. #TEST_METADATA.+= key="value" # Path to the prefix of the installed Kyua CLI, if any. @@ -61,6 +68,10 @@ FILESNAME_Kyuafile.auto= Kyuafile CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp +.for _T in ${_TESTS} +_TEST_METADATA.${_T}= ${TEST_METADATA} ${TEST_METADATA.${_T}} +.endfor + .NOPATH: Kyuafile.auto Kyuafile.auto: Makefile @{ \ @@ -72,7 +83,7 @@ Kyuafile.auto: Makefile echo; \ } >Kyuafile.auto.tmp .for _T in ${_TESTS} - @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \ + @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${_TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \ >>Kyuafile.auto.tmp .endfor .for _T in ${TESTS_SUBDIRS:N.WAIT} From owner-svn-src-head@freebsd.org Sat Jul 4 02:59:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 407B8995698; Sat, 4 Jul 2015 02:59:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2523915D1; Sat, 4 Jul 2015 02:59:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t642xV52022417; Sat, 4 Jul 2015 02:59:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t642xUC6022416; Sat, 4 Jul 2015 02:59:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201507040259.t642xUC6022416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 4 Jul 2015 02:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285120 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 02:59:31 -0000 Author: adrian Date: Sat Jul 4 02:59:30 2015 New Revision: 285120 URL: https://svnweb.freebsd.org/changeset/base/285120 Log: Wake up the hardware before doing anything in sysctl. This stops the panics that occur on MIPS platforms when doing say, 'sysctl dev.ath.0' whilst the MAC is asleep. The MIPS platform is rather unforgiving in getting power-save register access wrong and you will get all kinds of odd failures if you don't have things woken up at the right times. Tested: * QCA9558 (TP-Link Archer C7 v2) * AR9331 (Carambola 2) .. with no VAPs configured and ath0 down (thus the MAC is definitely asleep.) PR: kern/201117 Modified: head/sys/dev/ath/if_ath_sysctl.c Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Sat Jul 4 02:37:36 2015 (r285119) +++ head/sys/dev/ath/if_ath_sysctl.c Sat Jul 4 02:59:30 2015 (r285120) @@ -134,26 +134,52 @@ static int ath_sysctl_acktimeout(SYSCTL_HANDLER_ARGS) { struct ath_softc *sc = arg1; - u_int acktimeout = ath_hal_getacktimeout(sc->sc_ah); + u_int acktimeout; int error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + acktimeout = ath_hal_getacktimeout(sc->sc_ah); + ATH_UNLOCK(sc); + error = sysctl_handle_int(oidp, &acktimeout, 0, req); if (error || !req->newptr) - return error; - return !ath_hal_setacktimeout(sc->sc_ah, acktimeout) ? EINVAL : 0; + goto finish; + + error = !ath_hal_setacktimeout(sc->sc_ah, acktimeout) ? EINVAL : 0; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int ath_sysctl_ctstimeout(SYSCTL_HANDLER_ARGS) { struct ath_softc *sc = arg1; - u_int ctstimeout = ath_hal_getctstimeout(sc->sc_ah); + u_int ctstimeout; int error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ctstimeout = ath_hal_getctstimeout(sc->sc_ah); + ATH_UNLOCK(sc); + error = sysctl_handle_int(oidp, &ctstimeout, 0, req); if (error || !req->newptr) - return error; - return !ath_hal_setctstimeout(sc->sc_ah, ctstimeout) ? EINVAL : 0; + goto finish; + + error = !ath_hal_setctstimeout(sc->sc_ah, ctstimeout) ? EINVAL : 0; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int @@ -221,14 +247,22 @@ static int ath_sysctl_txantenna(SYSCTL_HANDLER_ARGS) { struct ath_softc *sc = arg1; - u_int txantenna = ath_hal_getantennaswitch(sc->sc_ah); + u_int txantenna; int error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + + txantenna = ath_hal_getantennaswitch(sc->sc_ah); + error = sysctl_handle_int(oidp, &txantenna, 0, req); if (!error && req->newptr) { /* XXX assumes 2 antenna ports */ - if (txantenna < HAL_ANT_VARIABLE || txantenna > HAL_ANT_FIXED_B) - return EINVAL; + if (txantenna < HAL_ANT_VARIABLE || txantenna > HAL_ANT_FIXED_B) { + error = EINVAL; + goto finish; + } ath_hal_setantennaswitch(sc->sc_ah, txantenna); /* * NB: with the switch locked this isn't meaningful, @@ -237,36 +271,67 @@ ath_sysctl_txantenna(SYSCTL_HANDLER_ARGS */ sc->sc_txantenna = txantenna; } - return error; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int ath_sysctl_rxantenna(SYSCTL_HANDLER_ARGS) { struct ath_softc *sc = arg1; - u_int defantenna = ath_hal_getdefantenna(sc->sc_ah); + u_int defantenna; int error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + defantenna = ath_hal_getdefantenna(sc->sc_ah); + ATH_UNLOCK(sc); + error = sysctl_handle_int(oidp, &defantenna, 0, req); if (!error && req->newptr) ath_hal_setdefantenna(sc->sc_ah, defantenna); - return error; + + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int ath_sysctl_diversity(SYSCTL_HANDLER_ARGS) { struct ath_softc *sc = arg1; - u_int diversity = ath_hal_getdiversity(sc->sc_ah); + u_int diversity; int error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + + diversity = ath_hal_getdiversity(sc->sc_ah); + error = sysctl_handle_int(oidp, &diversity, 0, req); if (error || !req->newptr) - return error; - if (!ath_hal_setdiversity(sc->sc_ah, diversity)) - return EINVAL; + goto finish; + if (!ath_hal_setdiversity(sc->sc_ah, diversity)) { + error = EINVAL; + goto finish; + } sc->sc_diversity = diversity; - return 0; + error = 0; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int @@ -276,12 +341,26 @@ ath_sysctl_diag(SYSCTL_HANDLER_ARGS) u_int32_t diag; int error; - if (!ath_hal_getdiag(sc->sc_ah, &diag)) - return EINVAL; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + + if (!ath_hal_getdiag(sc->sc_ah, &diag)) { + error = EINVAL; + goto finish; + } + error = sysctl_handle_int(oidp, &diag, 0, req); if (error || !req->newptr) - return error; - return !ath_hal_setdiag(sc->sc_ah, diag) ? EINVAL : 0; + goto finish; + error = !ath_hal_setdiag(sc->sc_ah, diag) ? EINVAL : 0; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int @@ -292,26 +371,51 @@ ath_sysctl_tpscale(SYSCTL_HANDLER_ARGS) u_int32_t scale; int error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + (void) ath_hal_gettpscale(sc->sc_ah, &scale); error = sysctl_handle_int(oidp, &scale, 0, req); if (error || !req->newptr) - return error; - return !ath_hal_settpscale(sc->sc_ah, scale) ? EINVAL : + goto finish; + + error = !ath_hal_settpscale(sc->sc_ah, scale) ? EINVAL : (ifp->if_drv_flags & IFF_DRV_RUNNING) ? ath_reset(ifp, ATH_RESET_NOLOSS) : 0; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int ath_sysctl_tpc(SYSCTL_HANDLER_ARGS) { struct ath_softc *sc = arg1; - u_int tpc = ath_hal_gettpc(sc->sc_ah); + u_int tpc; int error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + + tpc = ath_hal_gettpc(sc->sc_ah); + error = sysctl_handle_int(oidp, &tpc, 0, req); if (error || !req->newptr) - return error; - return !ath_hal_settpc(sc->sc_ah, tpc) ? EINVAL : 0; + goto finish; + error = !ath_hal_settpc(sc->sc_ah, tpc) ? EINVAL : 0; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int @@ -320,18 +424,35 @@ ath_sysctl_rfkill(SYSCTL_HANDLER_ARGS) struct ath_softc *sc = arg1; struct ifnet *ifp = sc->sc_ifp; struct ath_hal *ah = sc->sc_ah; - u_int rfkill = ath_hal_getrfkill(ah); + u_int rfkill; int error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + + rfkill = ath_hal_getrfkill(ah); + error = sysctl_handle_int(oidp, &rfkill, 0, req); if (error || !req->newptr) - return error; - if (rfkill == ath_hal_getrfkill(ah)) /* unchanged */ - return 0; - if (!ath_hal_setrfkill(ah, rfkill)) - return EINVAL; - return (ifp->if_drv_flags & IFF_DRV_RUNNING) ? + goto finish; + if (rfkill == ath_hal_getrfkill(ah)) { /* unchanged */ + error = 0; + goto finish; + } + if (!ath_hal_setrfkill(ah, rfkill)) { + error = EINVAL; + goto finish; + } + error = (ifp->if_drv_flags & IFF_DRV_RUNNING) ? ath_reset(ifp, ATH_RESET_FULL) : 0; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int @@ -440,12 +561,18 @@ ath_sysctl_rfsilent(SYSCTL_HANDLER_ARGS) u_int rfsilent; int error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + (void) ath_hal_getrfsilent(sc->sc_ah, &rfsilent); error = sysctl_handle_int(oidp, &rfsilent, 0, req); if (error || !req->newptr) - return error; - if (!ath_hal_setrfsilent(sc->sc_ah, rfsilent)) - return EINVAL; + goto finish; + if (!ath_hal_setrfsilent(sc->sc_ah, rfsilent)) { + error = EINVAL; + goto finish; + } /* * Earlier chips (< AR5212) have up to 8 GPIO * pins exposed. @@ -456,7 +583,14 @@ ath_sysctl_rfsilent(SYSCTL_HANDLER_ARGS) */ sc->sc_rfsilentpin = rfsilent & 0x3c; sc->sc_rfsilentpol = (rfsilent & 0x2) != 0; - return 0; + error = 0; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int @@ -466,11 +600,22 @@ ath_sysctl_tpack(SYSCTL_HANDLER_ARGS) u_int32_t tpack; int error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + (void) ath_hal_gettpack(sc->sc_ah, &tpack); error = sysctl_handle_int(oidp, &tpack, 0, req); if (error || !req->newptr) - return error; - return !ath_hal_settpack(sc->sc_ah, tpack) ? EINVAL : 0; + goto finish; + error = !ath_hal_settpack(sc->sc_ah, tpack) ? EINVAL : 0; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int @@ -480,11 +625,23 @@ ath_sysctl_tpcts(SYSCTL_HANDLER_ARGS) u_int32_t tpcts; int error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + (void) ath_hal_gettpcts(sc->sc_ah, &tpcts); error = sysctl_handle_int(oidp, &tpcts, 0, req); if (error || !req->newptr) - return error; - return !ath_hal_settpcts(sc->sc_ah, tpcts) ? EINVAL : 0; + goto finish; + + error = !ath_hal_settpcts(sc->sc_ah, tpcts) ? EINVAL : 0; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } static int @@ -493,15 +650,21 @@ ath_sysctl_intmit(SYSCTL_HANDLER_ARGS) struct ath_softc *sc = arg1; int intmit, error; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + intmit = ath_hal_getintmit(sc->sc_ah); error = sysctl_handle_int(oidp, &intmit, 0, req); if (error || !req->newptr) - return error; + goto finish; /* reusing error; 1 here means "good"; 0 means "fail" */ error = ath_hal_setintmit(sc->sc_ah, intmit); - if (! error) - return EINVAL; + if (! error) { + error = EINVAL; + goto finish; + } /* * Reset the hardware here - disabling ANI in the HAL @@ -511,7 +674,14 @@ ath_sysctl_intmit(SYSCTL_HANDLER_ARGS) if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) ath_reset(sc->sc_ifp, ATH_RESET_NOLOSS); - return 0; + error = 0; + +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } #ifdef IEEE80211_SUPPORT_TDMA @@ -565,15 +735,28 @@ ath_sysctl_hangcheck(SYSCTL_HANDLER_ARGS if (val == 0) return 0; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + /* Do a hang check */ if (!ath_hal_getdiagstate(ah, HAL_DIAG_CHECK_HANGS, &mask, sizeof(mask), - (void *) &sp, &rsize)) - return (0); + (void *) &sp, &rsize)) { + error = 0; + goto finish; + } + device_printf(sc->sc_dev, "%s: sp=0x%08x\n", __func__, *sp); val = 0; - return 0; + error = 0; +finish: + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + return (error); } #ifdef ATH_DEBUG_ALQ From owner-svn-src-head@freebsd.org Sat Jul 4 03:06:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 425E499580C; Sat, 4 Jul 2015 03:06:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E2041F76; Sat, 4 Jul 2015 03:06:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t64361dj028023; Sat, 4 Jul 2015 03:06:01 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6435vBu027989; Sat, 4 Jul 2015 03:05:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201507040305.t6435vBu027989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 4 Jul 2015 03:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285121 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 03:06:01 -0000 Author: adrian Date: Sat Jul 4 03:05:57 2015 New Revision: 285121 URL: https://svnweb.freebsd.org/changeset/base/285121 Log: Reshuffle all of the DDR flush operations into a single switch/mux, and start teaching subsystems about it. The Atheros MIPS platforms don't guarantee any kind of FIFO consistency with interrupts in hardware. So software needs to do a flush when it receives an interrupt and before it calls the interrupt handler. There are new ones for the QCA934x and QCA955x, so do a few things: * Get rid of the individual ones (for ethernet and IP2); * Create a mux and enum listing all the variations on DDR flushes; * replace the uses of IP2 with the relevant one (which will typically be "PCI" here); * call the USB DDR flush before calling the real USB interrupt handlers; * call the ethernet one upon receiving an interrupt that's for us, rather than never calling it during operation. Tested: * QCA9558 (TP-Link archer c7 v2) * AR9331 (Carambola 2) TODO: * PCI, USB, ethernet, etc need to do a double-check to see if the interrupt was truely for them before doing the DDR. For now I prefer "correct" over "fast". Modified: head/sys/mips/atheros/ar71xx_chip.c head/sys/mips/atheros/ar71xx_cpudef.h head/sys/mips/atheros/ar71xx_ehci.c head/sys/mips/atheros/ar71xx_ohci.c head/sys/mips/atheros/ar71xx_pci.c head/sys/mips/atheros/ar724x_chip.c head/sys/mips/atheros/ar724x_pci.c head/sys/mips/atheros/ar91xx_chip.c head/sys/mips/atheros/ar933x_chip.c head/sys/mips/atheros/ar934x_chip.c head/sys/mips/atheros/if_arge.c head/sys/mips/atheros/qca955x_chip.c head/sys/mips/atheros/qca955x_pci.c Modified: head/sys/mips/atheros/ar71xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar71xx_chip.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/ar71xx_chip.c Sat Jul 4 03:05:57 2015 (r285121) @@ -254,29 +254,28 @@ ar71xx_chip_set_pll_ge(int unit, int spe } static void -ar71xx_chip_ddr_flush_ge(int unit) +ar71xx_chip_ddr_flush(ar71xx_flush_ddr_id_t id) { - switch (unit) { - case 0: + switch (id) { + case AR71XX_CPU_DDR_FLUSH_GE0: ar71xx_ddr_flush(AR71XX_WB_FLUSH_GE0); break; - case 1: + case AR71XX_CPU_DDR_FLUSH_GE1: ar71xx_ddr_flush(AR71XX_WB_FLUSH_GE1); break; + case AR71XX_CPU_DDR_FLUSH_USB: + ar71xx_ddr_flush(AR71XX_WB_FLUSH_USB); + break; + case AR71XX_CPU_DDR_FLUSH_PCIE: + ar71xx_ddr_flush(AR71XX_WB_FLUSH_PCI); + break; default: - printf("%s: invalid DDR flush for arge unit: %d\n", - __func__, unit); - return; + printf("%s: invalid DDR flush id (%d)\n", __func__, id); + break; } } -static void -ar71xx_chip_ddr_flush_ip2(void) -{ - ar71xx_ddr_flush(AR71XX_WB_FLUSH_PCI); -} - static uint32_t ar71xx_chip_get_eth_pll(unsigned int mac, int speed) { @@ -334,8 +333,7 @@ struct ar71xx_cpu_def ar71xx_chip_def = &ar71xx_chip_set_pll_ge, &ar71xx_chip_set_mii_speed, &ar71xx_chip_set_mii_if, - &ar71xx_chip_ddr_flush_ge, &ar71xx_chip_get_eth_pll, - &ar71xx_chip_ddr_flush_ip2, + &ar71xx_chip_ddr_flush, &ar71xx_chip_init_usb_peripheral, }; Modified: head/sys/mips/atheros/ar71xx_cpudef.h ============================================================================== --- head/sys/mips/atheros/ar71xx_cpudef.h Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/ar71xx_cpudef.h Sat Jul 4 03:05:57 2015 (r285121) @@ -29,6 +29,16 @@ #ifndef __AR71XX_CPUDEF_H__ #define __AR71XX_CPUDEF_H__ +typedef enum { + AR71XX_CPU_DDR_FLUSH_GE0, + AR71XX_CPU_DDR_FLUSH_GE1, + AR71XX_CPU_DDR_FLUSH_USB, + AR71XX_CPU_DDR_FLUSH_PCIE, + AR71XX_CPU_DDR_FLUSH_WMAC, + AR71XX_CPU_DDR_FLUSH_PCIE_EP, + AR71XX_CPU_DDR_FLUSH_CHECKSUM, +} ar71xx_flush_ddr_id_t; + struct ar71xx_cpu_def { void (* detect_mem_size) (void); void (* detect_sys_frequency) (void); @@ -38,7 +48,6 @@ struct ar71xx_cpu_def { void (* ar71xx_chip_set_pll_ge) (int, int, uint32_t); void (* ar71xx_chip_set_mii_speed) (uint32_t, uint32_t); void (* ar71xx_chip_set_mii_if) (uint32_t, ar71xx_mii_mode); - void (* ar71xx_chip_ddr_flush_ge) (int); uint32_t (* ar71xx_chip_get_eth_pll) (unsigned int, int); /* @@ -51,7 +60,7 @@ struct ar71xx_cpu_def { * This flush is done before the IRQ is handled to make * sure the driver correctly sees any memory updates. */ - void (* ar71xx_chip_ddr_flush_ip2) (void); + void (* ar71xx_chip_ddr_flush) (ar71xx_flush_ddr_id_t id); /* * The USB peripheral init code is subtly different for * each chip. @@ -106,9 +115,9 @@ static inline void ar71xx_device_set_mii ar71xx_cpu_ops->ar71xx_chip_set_mii_if(unit, mii_cfg); } -static inline void ar71xx_device_flush_ddr_ge(int unit) +static inline void ar71xx_device_flush_ddr(ar71xx_flush_ddr_id_t id) { - ar71xx_cpu_ops->ar71xx_chip_ddr_flush_ge(unit); + ar71xx_cpu_ops->ar71xx_chip_ddr_flush(id); } static inline uint32_t ar71xx_device_get_eth_pll(unsigned int unit, int speed) @@ -139,11 +148,6 @@ static inline void ar71xx_init_gmac(void ar71xx_cpu_ops->ar71xx_chip_init_gmac(); } -static inline void ar71xx_device_ddr_flush_ip2(void) -{ - ar71xx_cpu_ops->ar71xx_chip_ddr_flush_ip2(); -} - static inline void ar71xx_reset_nfc(int active) { Modified: head/sys/mips/atheros/ar71xx_ehci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ehci.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/ar71xx_ehci.c Sat Jul 4 03:05:57 2015 (r285121) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* for stuff in ar71xx_cpudef.h */ +#include #include #define EHCI_HC_DEVSTR "AR71XX Integrated USB 2.0 controller" @@ -78,6 +80,15 @@ ar71xx_ehci_probe(device_t self) return (BUS_PROBE_NOWILDCARD); } +static void +ar71xx_ehci_intr(void *arg) +{ + + /* XXX TODO: should really see if this was our interrupt.. */ + ar71xx_device_flush_ddr(AR71XX_CPU_DDR_FLUSH_USB); + ehci_interrupt(arg); +} + static int ar71xx_ehci_attach(device_t self) { @@ -135,7 +146,7 @@ ar71xx_ehci_attach(device_t self) sprintf(sc->sc_vendor, "Atheros"); err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); + NULL, ar71xx_ehci_intr, sc, &sc->sc_intr_hdl); if (err) { device_printf(self, "Could not setup irq, %d\n", err); sc->sc_intr_hdl = NULL; Modified: head/sys/mips/atheros/ar71xx_ohci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ohci.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/ar71xx_ohci.c Sat Jul 4 03:05:57 2015 (r285121) @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* for stuff in ar71xx_cpudef.h */ +#include + static int ar71xx_ohci_attach(device_t dev); static int ar71xx_ohci_detach(device_t dev); static int ar71xx_ohci_probe(device_t dev); @@ -65,6 +68,16 @@ ar71xx_ohci_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static void +ar71xx_ohci_intr(void *arg) +{ + + /* XXX TODO: should really see if this was our interrupt.. */ + ar71xx_device_flush_ddr(AR71XX_CPU_DDR_FLUSH_USB); + ohci_interrupt(arg); +} + + static int ar71xx_ohci_attach(device_t dev) { @@ -113,7 +126,7 @@ ar71xx_ohci_attach(device_t dev) err = bus_setup_intr(dev, sc->sc_ohci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, - (driver_intr_t *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl); + ar71xx_ohci_intr, sc, &sc->sc_ohci.sc_intr_hdl); if (err) { err = ENXIO; goto error; Modified: head/sys/mips/atheros/ar71xx_pci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_pci.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/ar71xx_pci.c Sat Jul 4 03:05:57 2015 (r285121) @@ -637,8 +637,8 @@ ar71xx_pci_intr(void *arg) continue; } - /* Flush DDR FIFO for IP2 */ - ar71xx_device_ddr_flush_ip2(); + /* Flush DDR FIFO for PCI/PCIe */ + ar71xx_device_flush_ddr(AR71XX_CPU_DDR_FLUSH_PCIE); /* TODO: frame instead of NULL? */ intr_event_handle(event, NULL); Modified: head/sys/mips/atheros/ar724x_chip.c ============================================================================== --- head/sys/mips/atheros/ar724x_chip.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/ar724x_chip.c Sat Jul 4 03:05:57 2015 (r285121) @@ -161,30 +161,28 @@ ar724x_chip_set_pll_ge(int unit, int spe } static void -ar724x_chip_ddr_flush_ge(int unit) +ar724x_chip_ddr_flush(ar71xx_flush_ddr_id_t id) { - switch (unit) { - case 0: + switch (id) { + case AR71XX_CPU_DDR_FLUSH_GE0: ar71xx_ddr_flush(AR724X_DDR_REG_FLUSH_GE0); break; - case 1: + case AR71XX_CPU_DDR_FLUSH_GE1: ar71xx_ddr_flush(AR724X_DDR_REG_FLUSH_GE1); break; + case AR71XX_CPU_DDR_FLUSH_USB: + ar71xx_ddr_flush(AR724X_DDR_REG_FLUSH_USB); + break; + case AR71XX_CPU_DDR_FLUSH_PCIE: + ar71xx_ddr_flush(AR724X_DDR_REG_FLUSH_PCIE); + break; default: - printf("%s: invalid DDR flush for arge unit: %d\n", - __func__, unit); - return; + printf("%s: invalid DDR flush id (%d)\n", __func__, id); + break; } } -static void -ar724x_chip_ddr_flush_ip2(void) -{ - - ar71xx_ddr_flush(AR724X_DDR_REG_FLUSH_PCIE); -} - static uint32_t ar724x_chip_get_eth_pll(unsigned int mac, int speed) { @@ -242,8 +240,7 @@ struct ar71xx_cpu_def ar724x_chip_def = &ar724x_chip_set_pll_ge, &ar724x_chip_set_mii_speed, &ar71xx_chip_set_mii_if, - &ar724x_chip_ddr_flush_ge, &ar724x_chip_get_eth_pll, - &ar724x_chip_ddr_flush_ip2, + &ar724x_chip_ddr_flush, &ar724x_chip_init_usb_peripheral }; Modified: head/sys/mips/atheros/ar724x_pci.c ============================================================================== --- head/sys/mips/atheros/ar724x_pci.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/ar724x_pci.c Sat Jul 4 03:05:57 2015 (r285121) @@ -587,7 +587,6 @@ ar724x_pci_intr(void *arg) struct intr_event *event; uint32_t reg, irq, mask; - ar71xx_device_ddr_flush_ip2(); reg = ATH_READ_REG(AR724X_PCI_INTR_STATUS); mask = ATH_READ_REG(AR724X_PCI_INTR_MASK); @@ -604,6 +603,9 @@ ar724x_pci_intr(void *arg) return (FILTER_STRAY); } + /* Flush pending memory transactions */ + ar71xx_device_flush_ddr(AR71XX_CPU_DDR_FLUSH_PCIE); + /* TODO: frame instead of NULL? */ intr_event_handle(event, NULL); mips_intrcnt_inc(sc->sc_intr_counter[irq]); Modified: head/sys/mips/atheros/ar91xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar91xx_chip.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/ar91xx_chip.c Sat Jul 4 03:05:57 2015 (r285121) @@ -138,31 +138,28 @@ ar91xx_chip_set_pll_ge(int unit, int spe } static void -ar91xx_chip_ddr_flush_ge(int unit) +ar91xx_chip_ddr_flush(ar71xx_flush_ddr_id_t id) { - switch (unit) { - case 0: + switch (id) { + case AR71XX_CPU_DDR_FLUSH_GE0: ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_GE0); break; - case 1: + case AR71XX_CPU_DDR_FLUSH_GE1: ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_GE1); break; + case AR71XX_CPU_DDR_FLUSH_USB: + ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_USB); + break; + case AR71XX_CPU_DDR_FLUSH_WMAC: + ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_WMAC); + break; default: - printf("%s: invalid DDR flush for arge unit: %d\n", - __func__, unit); - return; + printf("%s: invalid DDR flush id (%d)\n", __func__, id); + break; } } -static void -ar91xx_chip_ddr_flush_ip2(void) -{ - - ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_WMAC); -} - - static uint32_t ar91xx_chip_get_eth_pll(unsigned int mac, int speed) { @@ -216,8 +213,7 @@ struct ar71xx_cpu_def ar91xx_chip_def = &ar91xx_chip_set_pll_ge, &ar71xx_chip_set_mii_speed, &ar71xx_chip_set_mii_if, - &ar91xx_chip_ddr_flush_ge, &ar91xx_chip_get_eth_pll, - &ar91xx_chip_ddr_flush_ip2, + &ar91xx_chip_ddr_flush, &ar91xx_chip_init_usb_peripheral, }; Modified: head/sys/mips/atheros/ar933x_chip.c ============================================================================== --- head/sys/mips/atheros/ar933x_chip.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/ar933x_chip.c Sat Jul 4 03:05:57 2015 (r285121) @@ -191,29 +191,28 @@ ar933x_chip_set_pll_ge(int unit, int spe } static void -ar933x_chip_ddr_flush_ge(int unit) +ar933x_chip_ddr_flush(ar71xx_flush_ddr_id_t id) { - switch (unit) { - case 0: + switch (id) { + case AR71XX_CPU_DDR_FLUSH_GE0: ar71xx_ddr_flush(AR933X_DDR_REG_FLUSH_GE0); break; - case 1: + case AR71XX_CPU_DDR_FLUSH_GE1: ar71xx_ddr_flush(AR933X_DDR_REG_FLUSH_GE1); break; + case AR71XX_CPU_DDR_FLUSH_USB: + ar71xx_ddr_flush(AR933X_DDR_REG_FLUSH_USB); + break; + case AR71XX_CPU_DDR_FLUSH_WMAC: + ar71xx_ddr_flush(AR933X_DDR_REG_FLUSH_WMAC); + break; default: - printf("%s: invalid DDR flush for arge unit: %d\n", - __func__, unit); - return; + printf("%s: invalid DDR flush id (%d)\n", __func__, id); + break; } } -static void -ar933x_chip_ddr_flush_ip2(void) -{ - - ar71xx_ddr_flush(AR933X_DDR_REG_FLUSH_WMAC); -} static uint32_t ar933x_chip_get_eth_pll(unsigned int mac, int speed) @@ -348,9 +347,8 @@ struct ar71xx_cpu_def ar933x_chip_def = &ar933x_chip_set_pll_ge, &ar933x_chip_set_mii_speed, &ar71xx_chip_set_mii_if, - &ar933x_chip_ddr_flush_ge, &ar933x_chip_get_eth_pll, - &ar933x_chip_ddr_flush_ip2, + &ar933x_chip_ddr_flush, &ar933x_chip_init_usb_peripheral, NULL, NULL, Modified: head/sys/mips/atheros/ar934x_chip.c ============================================================================== --- head/sys/mips/atheros/ar934x_chip.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/ar934x_chip.c Sat Jul 4 03:05:57 2015 (r285121) @@ -259,29 +259,31 @@ ar934x_chip_set_pll_ge(int unit, int spe } static void -ar934x_chip_ddr_flush_ge(int unit) +ar934x_chip_ddr_flush(ar71xx_flush_ddr_id_t id) { - switch (unit) { - case 0: + switch (id) { + case AR71XX_CPU_DDR_FLUSH_GE0: ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_GE0); break; - case 1: + case AR71XX_CPU_DDR_FLUSH_GE1: ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_GE1); break; + case AR71XX_CPU_DDR_FLUSH_USB: + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_USB); + break; + case AR71XX_CPU_DDR_FLUSH_PCIE: + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_PCIE); + break; + case AR71XX_CPU_DDR_FLUSH_WMAC: + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_WMAC); + break; default: - printf("%s: invalid DDR flush for arge unit: %d\n", - __func__, unit); - return; + printf("%s: invalid DDR flush id (%d)\n", __func__, id); + break; } } -static void -ar934x_chip_ddr_flush_ip2(void) -{ - - ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_WMAC); -} static uint32_t ar934x_chip_get_eth_pll(unsigned int mac, int speed) @@ -457,9 +459,8 @@ struct ar71xx_cpu_def ar934x_chip_def = &ar934x_chip_set_pll_ge, &ar934x_chip_set_mii_speed, &ar934x_chip_set_mii_if, - &ar934x_chip_ddr_flush_ge, &ar934x_chip_get_eth_pll, - &ar934x_chip_ddr_flush_ip2, + &ar934x_chip_ddr_flush, &ar934x_chip_init_usb_peripheral, &ar934x_chip_reset_ethernet_switch, &ar934x_chip_reset_wmac, Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/if_arge.c Sat Jul 4 03:05:57 2015 (r285121) @@ -248,12 +248,25 @@ MTX_SYSINIT(miibus_mtx, &miibus_mtx, "ar /* * Flushes all + * + * XXX this needs to be done at interrupt time! Grr! */ static void arge_flush_ddr(struct arge_softc *sc) { - - ar71xx_device_flush_ddr_ge(sc->arge_mac_unit); + switch (sc->arge_mac_unit) { + case 0: + ar71xx_device_flush_ddr(AR71XX_CPU_DDR_FLUSH_GE0); + break; + case 1: + ar71xx_device_flush_ddr(AR71XX_CPU_DDR_FLUSH_GE1); + break; + default: + device_printf(sc->arge_dev, "%s: unknown unit (%d)\n", + __func__, + sc->arge_mac_unit); + break; + } } static int @@ -2358,6 +2371,7 @@ arge_intr(void *arg) } ARGE_LOCK(sc); + arge_flush_ddr(sc); if (status & DMA_INTR_RX_PKT_RCVD) arge_rx_locked(sc); Modified: head/sys/mips/atheros/qca955x_chip.c ============================================================================== --- head/sys/mips/atheros/qca955x_chip.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/qca955x_chip.c Sat Jul 4 03:05:57 2015 (r285121) @@ -207,33 +207,36 @@ qca955x_chip_set_pll_ge(int unit, int sp } static void -qca955x_chip_ddr_flush_ge(int unit) +qca955x_chip_ddr_flush(ar71xx_flush_ddr_id_t id) { - switch (unit) { - case 0: + switch (id) { + case AR71XX_CPU_DDR_FLUSH_GE0: ar71xx_ddr_flush(QCA955X_DDR_REG_FLUSH_GE0); break; - case 1: + case AR71XX_CPU_DDR_FLUSH_GE1: ar71xx_ddr_flush(QCA955X_DDR_REG_FLUSH_GE1); break; + case AR71XX_CPU_DDR_FLUSH_USB: + ar71xx_ddr_flush(QCA955X_DDR_REG_FLUSH_USB); + break; + case AR71XX_CPU_DDR_FLUSH_PCIE: + ar71xx_ddr_flush(QCA955X_DDR_REG_FLUSH_PCIE); + break; + case AR71XX_CPU_DDR_FLUSH_WMAC: + ar71xx_ddr_flush(QCA955X_DDR_REG_FLUSH_WMAC); + break; + case AR71XX_CPU_DDR_FLUSH_PCIE_EP: + ar71xx_ddr_flush(QCA955X_DDR_REG_FLUSH_SRC1); + break; + case AR71XX_CPU_DDR_FLUSH_CHECKSUM: + ar71xx_ddr_flush(QCA955X_DDR_REG_FLUSH_SRC2); + break; default: - printf("%s: invalid DDR flush for arge unit: %d\n", - __func__, unit); - return; + printf("%s: invalid flush (%d)\n", __func__, id); } } -/* XXX TODO: USB flush, PCIe flush, wmac flush */ - -static void -qca955x_chip_ddr_flush_ip2(void) -{ -#if 0 - ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_WMAC); -#endif -} - static uint32_t qca955x_chip_get_eth_pll(unsigned int mac, int speed) { @@ -388,9 +391,8 @@ struct ar71xx_cpu_def qca955x_chip_def = &qca955x_chip_set_pll_ge, &qca955x_chip_set_mii_speed, &qca955x_chip_set_mii_if, - &qca955x_chip_ddr_flush_ge, &qca955x_chip_get_eth_pll, - &qca955x_chip_ddr_flush_ip2, + &qca955x_chip_ddr_flush, &qca955x_chip_init_usb_peripheral, &qca955x_chip_reset_ethernet_switch, &qca955x_chip_reset_wmac, Modified: head/sys/mips/atheros/qca955x_pci.c ============================================================================== --- head/sys/mips/atheros/qca955x_pci.c Sat Jul 4 02:59:30 2015 (r285120) +++ head/sys/mips/atheros/qca955x_pci.c Sat Jul 4 03:05:57 2015 (r285121) @@ -525,11 +525,12 @@ qca955x_pci_intr(void *arg) struct intr_event *event; uint32_t reg, irq, mask; - /* XXX TODO - may need to flush a different handler? */ - ar71xx_device_ddr_flush_ip2(); + /* There's only one PCIe DDR flush for both PCIe EPs */ + ar71xx_device_flush_ddr(AR71XX_CPU_DDR_FLUSH_PCIE); reg = ATH_READ_REG(sc->sc_pci_ctrl_base + QCA955X_PCI_INTR_STATUS); mask = ATH_READ_REG(sc->sc_pci_ctrl_base + QCA955X_PCI_INTR_MASK); + /* * Handle only unmasked interrupts */ From owner-svn-src-head@freebsd.org Sat Jul 4 03:07:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88320995835; Sat, 4 Jul 2015 03:07:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79C2910DF; Sat, 4 Jul 2015 03:07:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6437Tln028271; Sat, 4 Jul 2015 03:07:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6437Tq0028270; Sat, 4 Jul 2015 03:07:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201507040307.t6437Tq0028270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 4 Jul 2015 03:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285122 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 03:07:29 -0000 Author: adrian Date: Sat Jul 4 03:07:28 2015 New Revision: 285122 URL: https://svnweb.freebsd.org/changeset/base/285122 Log: Call the WMAC DDR flush before handling an interrupt for the Atheros AHB (internally) connected MAC. TODO: * verify the interrupt was for us before doing the DDR flush. Modified: head/sys/dev/ath/if_ath_ahb.c Modified: head/sys/dev/ath/if_ath_ahb.c ============================================================================== --- head/sys/dev/ath/if_ath_ahb.c Sat Jul 4 03:05:57 2015 (r285121) +++ head/sys/dev/ath/if_ath_ahb.c Sat Jul 4 03:07:28 2015 (r285122) @@ -117,6 +117,14 @@ ath_ahb_probe(device_t dev) return ENXIO; } +static void +ath_ahb_intr(void *arg) +{ + /* XXX TODO: check if its ours! */ + ar71xx_device_flush_ddr(AR71XX_CPU_DDR_FLUSH_WMAC); + ath_intr(arg); +} + static int ath_ahb_attach(device_t dev) { @@ -212,7 +220,7 @@ ath_ahb_attach(device_t dev) } if (bus_setup_intr(dev, psc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE, - NULL, ath_intr, sc, &psc->sc_ih)) { + NULL, ath_ahb_intr, sc, &psc->sc_ih)) { device_printf(dev, "could not establish interrupt\n"); goto bad2; } From owner-svn-src-head@freebsd.org Sat Jul 4 03:15:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8C4599594E; Sat, 4 Jul 2015 03:15:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA19A162D; Sat, 4 Jul 2015 03:15:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t643Fger032915; Sat, 4 Jul 2015 03:15:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t643FgTH032914; Sat, 4 Jul 2015 03:15:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201507040315.t643FgTH032914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 4 Jul 2015 03:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285123 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 03:15:43 -0000 Author: adrian Date: Sat Jul 4 03:15:42 2015 New Revision: 285123 URL: https://svnweb.freebsd.org/changeset/base/285123 Log: Quieten the scorpion SoC/WMAC reset path. Stuff the non-error stuff under HALDEBUG(). Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sat Jul 4 03:07:28 2015 (r285122) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sat Jul 4 03:15:42 2015 (r285123) @@ -1774,12 +1774,12 @@ ar9300_set_reset(struct ath_hal *ah, int } data = DDR_REG_READ(ah,DDR_CTL_CONFIG_OFFSET); - ath_hal_printf(ah, "check DDR Activity - HIGH\n"); + HALDEBUG(ah, HAL_DEBUG_RESET, "check DDR Activity - HIGH\n"); count = 0; while (DDR_CTL_CONFIG_CLIENT_ACTIVITY_GET(data)) { // AVE_DEBUG(0,"DDR Activity - HIGH\n"); - ath_hal_printf(ah, "DDR Activity - HIGH\n"); + HALDEBUG(ah, HAL_DEBUG_RESET, "DDR Activity - HIGH\n"); count++; OS_DELAY(10); data = DDR_REG_READ(ah,DDR_CTL_CONFIG_OFFSET); @@ -1801,7 +1801,7 @@ ar9300_set_reset(struct ath_hal *ah, int OS_DELAY(10); OS_REG_WRITE(ah, AR_RTC_RESET, 1); OS_DELAY(10); - ath_hal_printf(ah,"%s: Scorpion SoC RTC reset done.\n", __func__); + HALDEBUG(ah, HAL_DEBUG_RESET, "%s: Scorpion SoC RTC reset done.\n", __func__); } #undef REG_READ #undef REG_WRITE From owner-svn-src-head@freebsd.org Sat Jul 4 05:43:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 990C2995D80; Sat, 4 Jul 2015 05:43:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 843B21ED0; Sat, 4 Jul 2015 05:43:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t645hkcv010203; Sat, 4 Jul 2015 05:43:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t645hkAF010201; Sat, 4 Jul 2015 05:43:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201507040543.t645hkAF010201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 4 Jul 2015 05:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285124 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 05:43:46 -0000 Author: imp Date: Sat Jul 4 05:43:45 2015 New Revision: 285124 URL: https://svnweb.freebsd.org/changeset/base/285124 Log: Cache _MPATH and pass it down into the modules build. Some NFS setups make the find it does extremely expensive, so compute it only once. Also make sure the 'traditional' module building method works at the expense of a bit of duplicated code. Modified: head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sat Jul 4 03:15:42 2015 (r285123) +++ head/sys/conf/kern.pre.mk Sat Jul 4 05:43:45 2015 (r285124) @@ -198,6 +198,12 @@ SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symb ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET} SYSTEM_DEP+= ${LDSCRIPT} +# Calculate path for .m files early, if needed. +.if !defined(_MPATH) +__MPATH!=find ${S:tA}/ -name \*_if.m +_MPATH=${__MPATH:H:O:u} +.endif + # MKMODULESENV is set here so that port makefiles can augment # them. @@ -214,6 +220,7 @@ MKMODULESENV+= MODULES_OVERRIDE="${MODUL .if defined(DEBUG) MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" .endif +MKMODULESENV+= _MPATH="${_MPATH}" # Detect kernel config options that force stack frames to be turned on. DDB_ENABLED!= grep DDB opt_ddb.h || true ; echo Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sat Jul 4 03:15:42 2015 (r285123) +++ head/sys/conf/kmod.mk Sat Jul 4 05:43:45 2015 (r285124) @@ -355,8 +355,10 @@ vnode_if_typedef.h: .endif # Build _if.[ch] from _if.m, and clean them when we're done. +.if !defined(_MPATH) __MPATH!=find ${SYSDIR:tA}/ -name \*_if.m _MPATH=${__MPATH:H:O:u} +.endif .PATH.m: ${_MPATH} .for _s in ${SRCS:M*_if.[ch]} .if eixsts(${_s:R}.m}) From owner-svn-src-head@freebsd.org Sat Jul 4 06:54:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 453F099394B; Sat, 4 Jul 2015 06:54:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35AC6166F; Sat, 4 Jul 2015 06:54:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t646sHN1044206; Sat, 4 Jul 2015 06:54:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t646sGO7044196; Sat, 4 Jul 2015 06:54:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201507040654.t646sGO7044196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 4 Jul 2015 06:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285125 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 06:54:17 -0000 Author: mjg Date: Sat Jul 4 06:54:15 2015 New Revision: 285125 URL: https://svnweb.freebsd.org/changeset/base/285125 Log: sysctl: switch sysctllock to a sleepable rmlock The lock is almost never taken for writing. Modified: head/sys/kern/kern_linker.c head/sys/kern/kern_sysctl.c head/sys/kern/vfs_init.c head/sys/sys/sysctl.h Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sat Jul 4 05:43:45 2015 (r285124) +++ head/sys/kern/kern_linker.c Sat Jul 4 06:54:15 2015 (r285125) @@ -292,10 +292,10 @@ linker_file_register_sysctls(linker_file return; sx_xunlock(&kld_sx); - sysctl_xlock(); + sysctl_wlock(); for (oidp = start; oidp < stop; oidp++) sysctl_register_oid(*oidp); - sysctl_xunlock(); + sysctl_wunlock(); sx_xlock(&kld_sx); } @@ -313,10 +313,10 @@ linker_file_unregister_sysctls(linker_fi return; sx_xunlock(&kld_sx); - sysctl_xlock(); + sysctl_wlock(); for (oidp = start; oidp < stop; oidp++) sysctl_unregister_oid(*oidp); - sysctl_xunlock(); + sysctl_wunlock(); sx_xlock(&kld_sx); } Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sat Jul 4 05:43:45 2015 (r285124) +++ head/sys/kern/kern_sysctl.c Sat Jul 4 06:54:15 2015 (r285125) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -77,7 +78,7 @@ static MALLOC_DEFINE(M_SYSCTLTMP, "sysct * The sysctllock protects the MIB tree. It also protects sysctl * contexts used with dynamic sysctls. The sysctl_register_oid() and * sysctl_unregister_oid() routines require the sysctllock to already - * be held, so the sysctl_xlock() and sysctl_xunlock() routines are + * be held, so the sysctl_wlock() and sysctl_wunlock() routines are * provided for the few places in the kernel which need to use that * API rather than using the dynamic API. Use of the dynamic API is * strongly encouraged for most code. @@ -86,20 +87,21 @@ static MALLOC_DEFINE(M_SYSCTLTMP, "sysct * sysctl requests. This is implemented by serializing any userland * sysctl requests larger than a single page via an exclusive lock. */ -static struct sx sysctllock; +static struct rmlock sysctllock; static struct sx sysctlmemlock; -#define SYSCTL_XLOCK() sx_xlock(&sysctllock) -#define SYSCTL_XUNLOCK() sx_xunlock(&sysctllock) -#define SYSCTL_SLOCK() sx_slock(&sysctllock) -#define SYSCTL_SUNLOCK() sx_sunlock(&sysctllock) -#define SYSCTL_XLOCKED() sx_xlocked(&sysctllock) -#define SYSCTL_ASSERT_LOCKED() sx_assert(&sysctllock, SA_LOCKED) -#define SYSCTL_ASSERT_XLOCKED() sx_assert(&sysctllock, SA_XLOCKED) -#define SYSCTL_ASSERT_SLOCKED() sx_assert(&sysctllock, SA_SLOCKED) -#define SYSCTL_INIT() sx_init(&sysctllock, "sysctl lock") +#define SYSCTL_WLOCK() do { printf("wlocked!\n"); rm_wlock(&sysctllock); } while (0) +#define SYSCTL_WUNLOCK() rm_wunlock(&sysctllock) +#define SYSCTL_RLOCK(tracker) rm_rlock(&sysctllock, (tracker)) +#define SYSCTL_RUNLOCK(tracker) rm_runlock(&sysctllock, (tracker)) +#define SYSCTL_WLOCKED() rm_wowned(&sysctllock) +#define SYSCTL_ASSERT_LOCKED() rm_assert(&sysctllock, RA_LOCKED) +#define SYSCTL_ASSERT_WLOCKED() rm_assert(&sysctllock, RA_WLOCKED) +#define SYSCTL_ASSERT_RLOCKED() rm_assert(&sysctllock, RA_RLOCKED) +#define SYSCTL_INIT() rm_init_flags(&sysctllock, "sysctl lock", \ + RM_SLEEPABLE) #define SYSCTL_SLEEP(ch, wmesg, timo) \ - sx_sleep(ch, &sysctllock, 0, wmesg, timo) + rm_sleep(ch, &sysctllock, 0, wmesg, timo) static int sysctl_root(SYSCTL_HANDLER_ARGS); @@ -112,26 +114,23 @@ static int sysctl_old_kernel(struct sysc static int sysctl_new_kernel(struct sysctl_req *, void *, size_t); static void -sysctl_lock(bool xlock) +sysctl_lock(struct rm_priotracker *tracker) { - if (xlock) - SYSCTL_XLOCK(); + if (tracker != NULL) + SYSCTL_RLOCK(tracker); else - SYSCTL_SLOCK(); + SYSCTL_WLOCK(); } -static bool -sysctl_unlock(void) +static void +sysctl_unlock(struct rm_priotracker *tracker) { - bool xlocked; - xlocked = SYSCTL_XLOCKED(); - if (xlocked) - SYSCTL_XUNLOCK(); + if (tracker != NULL) + SYSCTL_RUNLOCK(tracker); else - SYSCTL_SUNLOCK(); - return (xlocked); + SYSCTL_WUNLOCK(); } static struct sysctl_oid * @@ -154,29 +153,28 @@ sysctl_find_oidname(const char *name, st * Order by number in each list. */ void -sysctl_xlock(void) +sysctl_wlock(void) { - SYSCTL_XLOCK(); + SYSCTL_WLOCK(); } void -sysctl_xunlock(void) +sysctl_wunlock(void) { - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); } static int sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, intptr_t arg2, - struct sysctl_req *req) + struct sysctl_req *req, struct rm_priotracker *tracker) { int error; - bool xlocked; if (oid->oid_kind & CTLFLAG_DYN) atomic_add_int(&oid->oid_running, 1); - xlocked = sysctl_unlock(); + sysctl_unlock(tracker); if (!(oid->oid_kind & CTLFLAG_MPSAFE)) mtx_lock(&Giant); @@ -184,7 +182,7 @@ sysctl_root_handler_locked(struct sysctl if (!(oid->oid_kind & CTLFLAG_MPSAFE)) mtx_unlock(&Giant); - sysctl_lock(xlocked); + sysctl_lock(tracker); if (oid->oid_kind & CTLFLAG_DYN) { if (atomic_fetchadd_int(&oid->oid_running, -1) == 1 && (oid->oid_kind & CTLFLAG_DYING) != 0) @@ -283,7 +281,7 @@ sysctl_load_tunable_by_oid_locked(struct return; } error = sysctl_root_handler_locked(oidp, oidp->oid_arg1, - oidp->oid_arg2, &req); + oidp->oid_arg2, &req, NULL); if (error != 0) printf("Setting sysctl %s failed: %d\n", path + rem, error); if (penv != NULL) @@ -303,7 +301,7 @@ sysctl_register_oid(struct sysctl_oid *o * First check if another oid with the same name already * exists in the parent's list. */ - SYSCTL_ASSERT_XLOCKED(); + SYSCTL_ASSERT_WLOCKED(); p = sysctl_find_oidname(oidp->oid_name, parent); if (p != NULL) { if ((p->oid_kind & CTLTYPE) == CTLTYPE_NODE) { @@ -397,7 +395,7 @@ sysctl_unregister_oid(struct sysctl_oid struct sysctl_oid *p; int error; - SYSCTL_ASSERT_XLOCKED(); + SYSCTL_ASSERT_WLOCKED(); error = ENOENT; if (oidp->oid_number == OID_AUTO) { error = EINVAL; @@ -453,7 +451,7 @@ sysctl_ctx_free(struct sysctl_ctx_list * * XXX This algorithm is a hack. But I don't know any * XXX better solution for now... */ - SYSCTL_XLOCK(); + SYSCTL_WLOCK(); TAILQ_FOREACH(e, clist, link) { error = sysctl_remove_oid_locked(e->entry, 0, 0); if (error) @@ -473,7 +471,7 @@ sysctl_ctx_free(struct sysctl_ctx_list * e1 = TAILQ_PREV(e1, sysctl_ctx_list, link); } if (error) { - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); return(EBUSY); } /* Now really delete the entries */ @@ -487,7 +485,7 @@ sysctl_ctx_free(struct sysctl_ctx_list * free(e, M_SYSCTLOID); e = e1; } - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); return (error); } @@ -497,7 +495,7 @@ sysctl_ctx_entry_add(struct sysctl_ctx_l { struct sysctl_ctx_entry *e; - SYSCTL_ASSERT_XLOCKED(); + SYSCTL_ASSERT_WLOCKED(); if (clist == NULL || oidp == NULL) return(NULL); e = malloc(sizeof(struct sysctl_ctx_entry), M_SYSCTLOID, M_WAITOK); @@ -512,7 +510,7 @@ sysctl_ctx_entry_find(struct sysctl_ctx_ { struct sysctl_ctx_entry *e; - SYSCTL_ASSERT_XLOCKED(); + SYSCTL_ASSERT_WLOCKED(); if (clist == NULL || oidp == NULL) return(NULL); TAILQ_FOREACH(e, clist, link) { @@ -534,15 +532,15 @@ sysctl_ctx_entry_del(struct sysctl_ctx_l if (clist == NULL || oidp == NULL) return (EINVAL); - SYSCTL_XLOCK(); + SYSCTL_WLOCK(); e = sysctl_ctx_entry_find(clist, oidp); if (e != NULL) { TAILQ_REMOVE(clist, e, link); - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); free(e, M_SYSCTLOID); return (0); } else { - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); return (ENOENT); } } @@ -558,9 +556,9 @@ sysctl_remove_oid(struct sysctl_oid *oid { int error; - SYSCTL_XLOCK(); + SYSCTL_WLOCK(); error = sysctl_remove_oid_locked(oidp, del, recurse); - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); return (error); } @@ -572,14 +570,14 @@ sysctl_remove_name(struct sysctl_oid *pa int error; error = ENOENT; - SYSCTL_XLOCK(); + SYSCTL_WLOCK(); SLIST_FOREACH_SAFE(p, SYSCTL_CHILDREN(parent), oid_link, tmp) { if (strcmp(p->oid_name, name) == 0) { error = sysctl_remove_oid_locked(p, del, recurse); break; } } - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); return (error); } @@ -591,7 +589,7 @@ sysctl_remove_oid_locked(struct sysctl_o struct sysctl_oid *p, *tmp; int error; - SYSCTL_ASSERT_XLOCKED(); + SYSCTL_ASSERT_WLOCKED(); if (oidp == NULL) return(EINVAL); if ((oidp->oid_kind & CTLFLAG_DYN) == 0) { @@ -666,7 +664,7 @@ sysctl_add_oid(struct sysctl_ctx_list *c if (parent == NULL) return(NULL); /* Check if the node already exists, otherwise create it */ - SYSCTL_XLOCK(); + SYSCTL_WLOCK(); oidp = sysctl_find_oidname(name, parent); if (oidp != NULL) { if ((oidp->oid_kind & CTLTYPE) == CTLTYPE_NODE) { @@ -674,10 +672,10 @@ sysctl_add_oid(struct sysctl_ctx_list *c /* Update the context */ if (clist != NULL) sysctl_ctx_entry_add(clist, oidp); - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); return (oidp); } else { - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); printf("can't re-use a leaf (%s)!\n", name); return (NULL); } @@ -700,7 +698,7 @@ sysctl_add_oid(struct sysctl_ctx_list *c sysctl_ctx_entry_add(clist, oidp); /* Register this oid */ sysctl_register_oid(oidp); - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); return (oidp); } @@ -714,10 +712,10 @@ sysctl_rename_oid(struct sysctl_oid *oid char *oldname; newname = strdup(name, M_SYSCTLOID); - SYSCTL_XLOCK(); + SYSCTL_WLOCK(); oldname = __DECONST(char *, oidp->oid_name); oidp->oid_name = newname; - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); free(oldname, M_SYSCTLOID); } @@ -729,21 +727,21 @@ sysctl_move_oid(struct sysctl_oid *oid, { struct sysctl_oid *oidp; - SYSCTL_XLOCK(); + SYSCTL_WLOCK(); if (oid->oid_parent == parent) { - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); return (0); } oidp = sysctl_find_oidname(oid->oid_name, parent); if (oidp != NULL) { - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); return (EEXIST); } sysctl_unregister_oid(oid); oid->oid_parent = parent; oid->oid_number = OID_AUTO; sysctl_register_oid(oid); - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); return (0); } @@ -759,10 +757,10 @@ sysctl_register_all(void *arg) sx_init(&sysctlmemlock, "sysctl mem"); SYSCTL_INIT(); - SYSCTL_XLOCK(); + SYSCTL_WLOCK(); SET_FOREACH(oidp, sysctl_set) sysctl_register_oid(*oidp); - SYSCTL_XUNLOCK(); + SYSCTL_WUNLOCK(); } SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0); @@ -832,14 +830,15 @@ sysctl_sysctl_debug_dump_node(struct sys static int sysctl_sysctl_debug(SYSCTL_HANDLER_ARGS) { + struct rm_priotracker tracker; int error; error = priv_check(req->td, PRIV_SYSCTL_DEBUG); if (error) return (error); - SYSCTL_SLOCK(); + SYSCTL_RLOCK(&tracker); sysctl_sysctl_debug_dump_node(&sysctl__children, 0); - SYSCTL_SUNLOCK(); + SYSCTL_RUNLOCK(&tracker); return (ENOENT); } @@ -855,9 +854,10 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) int error = 0; struct sysctl_oid *oid; struct sysctl_oid_list *lsp = &sysctl__children, *lsp2; + struct rm_priotracker tracker; char buf[10]; - SYSCTL_SLOCK(); + SYSCTL_RLOCK(&tracker); while (namelen) { if (!lsp) { snprintf(buf,sizeof(buf),"%d",*name); @@ -900,7 +900,7 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) } error = SYSCTL_OUT(req, "", 1); out: - SYSCTL_SUNLOCK(); + SYSCTL_RUNLOCK(&tracker); return (error); } @@ -979,11 +979,12 @@ sysctl_sysctl_next(SYSCTL_HANDLER_ARGS) int i, j, error; struct sysctl_oid *oid; struct sysctl_oid_list *lsp = &sysctl__children; + struct rm_priotracker tracker; int newoid[CTL_MAXNAME]; - SYSCTL_SLOCK(); + SYSCTL_RLOCK(&tracker); i = sysctl_sysctl_next_ls(lsp, name, namelen, newoid, &j, 1, &oid); - SYSCTL_SUNLOCK(); + SYSCTL_RUNLOCK(&tracker); if (i) return (ENOENT); error = SYSCTL_OUT(req, newoid, j * sizeof (int)); @@ -1042,6 +1043,7 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_AR char *p; int error, oid[CTL_MAXNAME], len = 0; struct sysctl_oid *op = 0; + struct rm_priotracker tracker; if (!req->newlen) return (ENOENT); @@ -1058,9 +1060,9 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_AR p [req->newlen] = '\0'; - SYSCTL_SLOCK(); + SYSCTL_RLOCK(&tracker); error = name2oid(p, oid, &len, &op); - SYSCTL_SUNLOCK(); + SYSCTL_RUNLOCK(&tracker); free(p, M_SYSCTL); @@ -1083,9 +1085,10 @@ static int sysctl_sysctl_oidfmt(SYSCTL_HANDLER_ARGS) { struct sysctl_oid *oid; + struct rm_priotracker tracker; int error; - SYSCTL_SLOCK(); + SYSCTL_RLOCK(&tracker); error = sysctl_find_oid(arg1, arg2, &oid, NULL, req); if (error) goto out; @@ -1099,7 +1102,7 @@ sysctl_sysctl_oidfmt(SYSCTL_HANDLER_ARGS goto out; error = SYSCTL_OUT(req, oid->oid_fmt, strlen(oid->oid_fmt) + 1); out: - SYSCTL_SUNLOCK(); + SYSCTL_RUNLOCK(&tracker); return (error); } @@ -1111,9 +1114,10 @@ static int sysctl_sysctl_oiddescr(SYSCTL_HANDLER_ARGS) { struct sysctl_oid *oid; + struct rm_priotracker tracker; int error; - SYSCTL_SLOCK(); + SYSCTL_RLOCK(&tracker); error = sysctl_find_oid(arg1, arg2, &oid, NULL, req); if (error) goto out; @@ -1124,7 +1128,7 @@ sysctl_sysctl_oiddescr(SYSCTL_HANDLER_AR } error = SYSCTL_OUT(req, oid->oid_descr, strlen(oid->oid_descr) + 1); out: - SYSCTL_SUNLOCK(); + SYSCTL_RUNLOCK(&tracker); return (error); } @@ -1429,9 +1433,7 @@ kernel_sysctl(struct thread *td, int *na req.newfunc = sysctl_new_kernel; req.lock = REQ_UNWIRED; - SYSCTL_SLOCK(); error = sysctl_root(0, name, namelen, &req); - SYSCTL_SUNLOCK(); if (req.lock == REQ_WIRED && req.validlen > 0) vsunlock(req.oldptr, req.validlen); @@ -1608,13 +1610,14 @@ static int sysctl_root(SYSCTL_HANDLER_ARGS) { struct sysctl_oid *oid; + struct rm_priotracker tracker; int error, indx, lvl; - SYSCTL_ASSERT_SLOCKED(); + SYSCTL_RLOCK(&tracker); error = sysctl_find_oid(arg1, arg2, &oid, &indx, req); if (error) - return (error); + goto out; if ((oid->oid_kind & CTLTYPE) == CTLTYPE_NODE) { /* @@ -1622,13 +1625,17 @@ sysctl_root(SYSCTL_HANDLER_ARGS) * no handler. Inform the user that it's a node. * The indx may or may not be the same as namelen. */ - if (oid->oid_handler == NULL) - return (EISDIR); + if (oid->oid_handler == NULL) { + error = EISDIR; + goto out; + } } /* Is this sysctl writable? */ - if (req->newptr && !(oid->oid_kind & CTLFLAG_WR)) - return (EPERM); + if (req->newptr && !(oid->oid_kind & CTLFLAG_WR)) { + error = EPERM; + goto out; + } KASSERT(req->td != NULL, ("sysctl_root(): req->td == NULL")); @@ -1638,10 +1645,11 @@ sysctl_root(SYSCTL_HANDLER_ARGS) * writing unless specifically granted for the node. */ if (IN_CAPABILITY_MODE(req->td)) { - if (req->oldptr && !(oid->oid_kind & CTLFLAG_CAPRD)) - return (EPERM); - if (req->newptr && !(oid->oid_kind & CTLFLAG_CAPWR)) - return (EPERM); + if ((req->oldptr && !(oid->oid_kind & CTLFLAG_CAPRD)) || + (req->newptr && !(oid->oid_kind & CTLFLAG_CAPWR))) { + error = EPERM; + goto out; + } } #endif @@ -1650,7 +1658,7 @@ sysctl_root(SYSCTL_HANDLER_ARGS) lvl = (oid->oid_kind & CTLMASK_SECURE) >> CTLSHIFT_SECURE; error = securelevel_gt(req->td->td_ucred, lvl); if (error) - return (error); + goto out; } /* Is this sysctl writable by only privileged users? */ @@ -1668,11 +1676,13 @@ sysctl_root(SYSCTL_HANDLER_ARGS) priv = PRIV_SYSCTL_WRITE; error = priv_check(req->td, priv); if (error) - return (error); + goto out; } - if (!oid->oid_handler) - return (EINVAL); + if (!oid->oid_handler) { + error = EINVAL; + goto out; + } if ((oid->oid_kind & CTLTYPE) == CTLTYPE_NODE) { arg1 = (int *)arg1 + indx; @@ -1685,16 +1695,18 @@ sysctl_root(SYSCTL_HANDLER_ARGS) error = mac_system_check_sysctl(req->td->td_ucred, oid, arg1, arg2, req); if (error != 0) - return (error); + goto out; #endif #ifdef VIMAGE if ((oid->oid_kind & CTLFLAG_VNET) && arg1 != NULL) arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); #endif - error = sysctl_root_handler_locked(oid, arg1, arg2, req); + error = sysctl_root_handler_locked(oid, arg1, arg2, req, &tracker); KFAIL_POINT_ERROR(_debug_fail_point, sysctl_running, error); +out: + SYSCTL_RUNLOCK(&tracker); return (error); } @@ -1794,9 +1806,7 @@ userland_sysctl(struct thread *td, int * for (;;) { req.oldidx = 0; req.newidx = 0; - SYSCTL_SLOCK(); error = sysctl_root(0, name, namelen, &req); - SYSCTL_SUNLOCK(); if (error != EAGAIN) break; kern_yield(PRI_USER); Modified: head/sys/kern/vfs_init.c ============================================================================== --- head/sys/kern/vfs_init.c Sat Jul 4 05:43:45 2015 (r285124) +++ head/sys/kern/vfs_init.c Sat Jul 4 06:54:15 2015 (r285125) @@ -291,7 +291,7 @@ vfs_register(struct vfsconf *vfc) * preserved by re-registering the oid after modifying its * number. */ - sysctl_xlock(); + sysctl_wlock(); SLIST_FOREACH(oidp, SYSCTL_CHILDREN(&sysctl___vfs), oid_link) { if (strcmp(oidp->oid_name, vfc->vfc_name) == 0) { sysctl_unregister_oid(oidp); @@ -300,7 +300,7 @@ vfs_register(struct vfsconf *vfc) break; } } - sysctl_xunlock(); + sysctl_wunlock(); return (0); } Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Sat Jul 4 05:43:45 2015 (r285124) +++ head/sys/sys/sysctl.h Sat Jul 4 06:54:15 2015 (r285125) @@ -807,8 +807,8 @@ int userland_sysctl(struct thread *td, i size_t *retval, int flags); int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid, int *nindx, struct sysctl_req *req); -void sysctl_xlock(void); -void sysctl_xunlock(void); +void sysctl_wlock(void); +void sysctl_wunlock(void); int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len); struct sbuf; From owner-svn-src-head@freebsd.org Sat Jul 4 07:01:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A42FE993B1B; Sat, 4 Jul 2015 07:01:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 957AF1B4A; Sat, 4 Jul 2015 07:01:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6471if3048355; Sat, 4 Jul 2015 07:01:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6471iok048354; Sat, 4 Jul 2015 07:01:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201507040701.t6471iok048354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 4 Jul 2015 07:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285126 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 07:01:44 -0000 Author: mjg Date: Sat Jul 4 07:01:43 2015 New Revision: 285126 URL: https://svnweb.freebsd.org/changeset/base/285126 Log: sysctl: remove a debugging printf which crept in with r285125 Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sat Jul 4 06:54:15 2015 (r285125) +++ head/sys/kern/kern_sysctl.c Sat Jul 4 07:01:43 2015 (r285126) @@ -90,7 +90,7 @@ static MALLOC_DEFINE(M_SYSCTLTMP, "sysct static struct rmlock sysctllock; static struct sx sysctlmemlock; -#define SYSCTL_WLOCK() do { printf("wlocked!\n"); rm_wlock(&sysctllock); } while (0) +#define SYSCTL_WLOCK() rm_wlock(&sysctllock) #define SYSCTL_WUNLOCK() rm_wunlock(&sysctllock) #define SYSCTL_RLOCK(tracker) rm_rlock(&sysctllock, (tracker)) #define SYSCTL_RUNLOCK(tracker) rm_runlock(&sysctllock, (tracker)) From owner-svn-src-head@freebsd.org Sat Jul 4 08:16:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F7EA994C5D; Sat, 4 Jul 2015 08:16:33 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FA3C2633; Sat, 4 Jul 2015 08:16:33 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t648GXl1032174; Sat, 4 Jul 2015 08:16:33 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t648GXjW032173; Sat, 4 Jul 2015 08:16:33 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201507040816.t648GXjW032173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sat, 4 Jul 2015 08:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285127 - head/sys/modules/aesni X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 08:16:33 -0000 Author: jmg Date: Sat Jul 4 08:16:32 2015 New Revision: 285127 URL: https://svnweb.freebsd.org/changeset/base/285127 Log: improve dependencies for this module a bit... not great, but at least gives some basics... I would add them to DPSRC, but due to the intrinsics headers, they can't be added... Modified: head/sys/modules/aesni/Makefile Modified: head/sys/modules/aesni/Makefile ============================================================================== --- head/sys/modules/aesni/Makefile Sat Jul 4 07:01:43 2015 (r285126) +++ head/sys/modules/aesni/Makefile Sat Jul 4 08:16:32 2015 (r285127) @@ -21,6 +21,9 @@ aesni_wrap.o: aesni_wrap.c -mmmx -msse -msse4 -maes ${.IMPSRC} ${CTFCONVERT_CMD} +aesni_ghash.o: aesni.h +aesni_wrap.o: aesni.h + .include CWARNFLAGS.aesni_ghash.c= ${NO_WCAST_QUAL} From owner-svn-src-head@freebsd.org Sat Jul 4 08:40:50 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16ECA8EE6; Sat, 4 Jul 2015 08:40:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECB716BB27; Sat, 4 Jul 2015 08:40:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t648enQT060451; Sat, 4 Jul 2015 08:40:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t648enB5060450; Sat, 4 Jul 2015 08:40:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201507040840.t648enB5060450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 4 Jul 2015 08:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285128 - head/usr.sbin/mountd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 08:40:50 -0000 Author: trasz Date: Sat Jul 4 08:40:48 2015 New Revision: 285128 URL: https://svnweb.freebsd.org/changeset/base/285128 Log: Staticize some stuff in mountd(8); no functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Sat Jul 4 08:16:32 2015 (r285127) +++ head/usr.sbin/mountd/mountd.c Sat Jul 4 08:40:48 2015 (r285128) @@ -165,97 +165,98 @@ struct fhreturn { #define GETPORT_MAXTRY 20 /* Max tries to get a port # */ /* Global defs */ -char *add_expdir(struct dirlist **, char *, int); -void add_dlist(struct dirlist **, struct dirlist *, - struct grouplist *, int, struct exportlist *); -void add_mlist(char *, char *); -int check_dirpath(char *); -int check_options(struct dirlist *); -int checkmask(struct sockaddr *sa); -int chk_host(struct dirlist *, struct sockaddr *, int *, int *, int *, - int **); +static char *add_expdir(struct dirlist **, char *, int); +static void add_dlist(struct dirlist **, struct dirlist *, + struct grouplist *, int, struct exportlist *); +static void add_mlist(char *, char *); +static int check_dirpath(char *); +static int check_options(struct dirlist *); +static int checkmask(struct sockaddr *sa); +static int chk_host(struct dirlist *, struct sockaddr *, int *, int *, + int *, int **); static int create_service(struct netconfig *nconf); static void complete_service(struct netconfig *nconf, char *port_str); static void clearout_service(void); -void del_mlist(char *hostp, char *dirp); -struct dirlist *dirp_search(struct dirlist *, char *); -int do_mount(struct exportlist *, struct grouplist *, int, - struct xucred *, char *, int, struct statfs *); -int do_opt(char **, char **, struct exportlist *, struct grouplist *, - int *, int *, struct xucred *); -struct exportlist *ex_search(fsid_t *); -struct exportlist *get_exp(void); -void free_dir(struct dirlist *); -void free_exp(struct exportlist *); -void free_grp(struct grouplist *); -void free_host(struct hostlist *); -void get_exportlist(void); -int get_host(char *, struct grouplist *, struct grouplist *); -struct hostlist *get_ht(void); -int get_line(void); -void get_mountlist(void); -int get_net(char *, struct netmsk *, int); -void getexp_err(struct exportlist *, struct grouplist *); -struct grouplist *get_grp(void); -void hang_dirp(struct dirlist *, struct grouplist *, +static void del_mlist(char *hostp, char *dirp); +static struct dirlist *dirp_search(struct dirlist *, char *); +static int do_mount(struct exportlist *, struct grouplist *, int, + struct xucred *, char *, int, struct statfs *); +static int do_opt(char **, char **, struct exportlist *, + struct grouplist *, int *, int *, struct xucred *); +static struct exportlist *ex_search(fsid_t *); +static struct exportlist *get_exp(void); +static void free_dir(struct dirlist *); +static void free_exp(struct exportlist *); +static void free_grp(struct grouplist *); +static void free_host(struct hostlist *); +static void get_exportlist(void); +static int get_host(char *, struct grouplist *, struct grouplist *); +static struct hostlist *get_ht(void); +static int get_line(void); +static void get_mountlist(void); +static int get_net(char *, struct netmsk *, int); +static void getexp_err(struct exportlist *, struct grouplist *); +static struct grouplist *get_grp(void); +static void hang_dirp(struct dirlist *, struct grouplist *, struct exportlist *, int); -void huphandler(int sig); -int makemask(struct sockaddr_storage *ssp, int bitlen); -void mntsrv(struct svc_req *, SVCXPRT *); -void nextfield(char **, char **); -void out_of_mem(void); -void parsecred(char *, struct xucred *); -int parsesec(char *, struct exportlist *); -int put_exlist(struct dirlist *, XDR *, struct dirlist *, int *, int); -void *sa_rawaddr(struct sockaddr *sa, int *nbytes); -int sacmp(struct sockaddr *sa1, struct sockaddr *sa2, - struct sockaddr *samask); -int scan_tree(struct dirlist *, struct sockaddr *); -static void usage(void); -int xdr_dir(XDR *, char *); -int xdr_explist(XDR *, caddr_t); -int xdr_explist_brief(XDR *, caddr_t); -int xdr_explist_common(XDR *, caddr_t, int); -int xdr_fhs(XDR *, caddr_t); -int xdr_mlist(XDR *, caddr_t); -void terminate(int); - -struct exportlist *exphead; -struct mountlist *mlhead; -struct grouplist *grphead; -char *exnames_default[2] = { _PATH_EXPORTS, NULL }; -char **exnames; -char **hosts = NULL; -struct xucred def_anon = { +static void huphandler(int sig); +static int makemask(struct sockaddr_storage *ssp, int bitlen); +static void mntsrv(struct svc_req *, SVCXPRT *); +static void nextfield(char **, char **); +static void out_of_mem(void); +static void parsecred(char *, struct xucred *); +static int parsesec(char *, struct exportlist *); +static int put_exlist(struct dirlist *, XDR *, struct dirlist *, + int *, int); +static void *sa_rawaddr(struct sockaddr *sa, int *nbytes); +static int sacmp(struct sockaddr *sa1, struct sockaddr *sa2, + struct sockaddr *samask); +static int scan_tree(struct dirlist *, struct sockaddr *); +static void usage(void); +static int xdr_dir(XDR *, char *); +static int xdr_explist(XDR *, caddr_t); +static int xdr_explist_brief(XDR *, caddr_t); +static int xdr_explist_common(XDR *, caddr_t, int); +static int xdr_fhs(XDR *, caddr_t); +static int xdr_mlist(XDR *, caddr_t); +static void terminate(int); + +static struct exportlist *exphead; +static struct mountlist *mlhead; +static struct grouplist *grphead; +static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; +static char **exnames; +static char **hosts = NULL; +static struct xucred def_anon = { XUCRED_VERSION, (uid_t)-2, 1, { (gid_t)-2 }, NULL }; -int force_v2 = 0; -int resvport_only = 1; -int nhosts = 0; -int dir_only = 1; -int dolog = 0; -int got_sighup = 0; -int xcreated = 0; - -char *svcport_str = NULL; -static int mallocd_svcport = 0; -static int *sock_fd; -static int sock_fdcnt; -static int sock_fdpos; -static int suspend_nfsd = 0; +static int force_v2 = 0; +static int resvport_only = 1; +static int nhosts = 0; +static int dir_only = 1; +static int dolog = 0; +static int got_sighup = 0; +static int xcreated = 0; + +static char *svcport_str = NULL; +static int mallocd_svcport = 0; +static int *sock_fd; +static int sock_fdcnt; +static int sock_fdpos; +static int suspend_nfsd = 0; -int opt_flags; +static int opt_flags; static int have_v6 = 1; -int v4root_phase = 0; -char v4root_dirpath[PATH_MAX + 1]; -int has_publicfh = 0; +static int v4root_phase = 0; +static char v4root_dirpath[PATH_MAX + 1]; +static int has_publicfh = 0; -struct pidfh *pfh = NULL; +static struct pidfh *pfh = NULL; /* Bits for opt_flags above */ #define OP_MAPROOT 0x01 #define OP_MAPALL 0x02 @@ -269,11 +270,11 @@ struct pidfh *pfh = NULL; #define OP_SEC 0x400 #ifdef DEBUG -int debug = 1; -void SYSLOG(int, const char *, ...) __printflike(2, 3); +static int debug = 1; +static void SYSLOG(int, const char *, ...) __printflike(2, 3); #define syslog SYSLOG #else -int debug = 0; +static int debug = 0; #endif /* @@ -1131,7 +1132,7 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *t /* * Xdr conversion for a dirpath string */ -int +static int xdr_dir(XDR *xdrsp, char *dirp) { return (xdr_string(xdrsp, &dirp, MNTPATHLEN)); @@ -1140,7 +1141,7 @@ xdr_dir(XDR *xdrsp, char *dirp) /* * Xdr routine to generate file handle reply */ -int +static int xdr_fhs(XDR *xdrsp, caddr_t cp) { struct fhreturn *fhrp = (struct fhreturn *)cp; @@ -1176,7 +1177,7 @@ xdr_fhs(XDR *xdrsp, caddr_t cp) return (0); } -int +static int xdr_mlist(XDR *xdrsp, caddr_t cp __unused) { struct mountlist *mlp; @@ -1204,7 +1205,7 @@ xdr_mlist(XDR *xdrsp, caddr_t cp __unuse /* * Xdr conversion for export list */ -int +static int xdr_explist_common(XDR *xdrsp, caddr_t cp __unused, int brief) { struct exportlist *ep; @@ -1240,7 +1241,7 @@ errout: * Called from xdr_explist() to traverse the tree and export the * directory paths. */ -int +static int put_exlist(struct dirlist *dp, XDR *xdrsp, struct dirlist *adp, int *putdefp, int brief) { @@ -1304,23 +1305,23 @@ put_exlist(struct dirlist *dp, XDR *xdrs return (0); } -int +static int xdr_explist(XDR *xdrsp, caddr_t cp) { return xdr_explist_common(xdrsp, cp, 0); } -int +static int xdr_explist_brief(XDR *xdrsp, caddr_t cp) { return xdr_explist_common(xdrsp, cp, 1); } -char *line; -int linesize; -FILE *exp_file; +static char *line; +static size_t linesize; +static FILE *exp_file; /* * Get the export list from one, currently open file @@ -1638,7 +1639,7 @@ nextline: /* * Get the export list from all specified files */ -void +static void get_exportlist(void) { struct exportlist *ep, *ep2; @@ -1801,7 +1802,7 @@ get_exportlist(void) /* * Allocate an export list element */ -struct exportlist * +static struct exportlist * get_exp(void) { struct exportlist *ep; @@ -1815,7 +1816,7 @@ get_exp(void) /* * Allocate a group list element */ -struct grouplist * +static struct grouplist * get_grp(void) { struct grouplist *gp; @@ -1829,7 +1830,7 @@ get_grp(void) /* * Clean up upon an error in get_exportlist(). */ -void +static void getexp_err(struct exportlist *ep, struct grouplist *grp) { struct grouplist *tgrp; @@ -1848,7 +1849,7 @@ getexp_err(struct exportlist *ep, struct /* * Search the export list for a matching fs. */ -struct exportlist * +static struct exportlist * ex_search(fsid_t *fsid) { struct exportlist *ep; @@ -1866,7 +1867,7 @@ ex_search(fsid_t *fsid) /* * Add a directory path to the list. */ -char * +static char * add_expdir(struct dirlist **dpp, char *cp, int len) { struct dirlist *dp; @@ -1887,7 +1888,7 @@ add_expdir(struct dirlist **dpp, char *c * Hang the dir list element off the dirpath binary tree as required * and update the entry for host. */ -void +static void hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep, int flags) { @@ -1935,7 +1936,7 @@ hang_dirp(struct dirlist *dp, struct gro * Traverse the binary tree either updating a node that is already there * for the new directory or adding the new node. */ -void +static void add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp, int flags, struct exportlist *ep) { @@ -1989,7 +1990,7 @@ add_dlist(struct dirlist **dpp, struct d /* * Search for a dirpath on the export point. */ -struct dirlist * +static struct dirlist * dirp_search(struct dirlist *dp, char *dirp) { int cmp; @@ -2009,7 +2010,7 @@ dirp_search(struct dirlist *dp, char *di /* * Scan for a host match in a directory tree. */ -int +static int chk_host(struct dirlist *dp, struct sockaddr *saddr, int *defsetp, int *hostsetp, int *numsecflavors, int **secflavorsp) { @@ -2065,7 +2066,7 @@ chk_host(struct dirlist *dp, struct sock /* * Scan tree for a host that matches the address. */ -int +static int scan_tree(struct dirlist *dp, struct sockaddr *saddr) { int defset, hostset; @@ -2084,7 +2085,7 @@ scan_tree(struct dirlist *dp, struct soc /* * Traverse the dirlist tree and free it up. */ -void +static void free_dir(struct dirlist *dp) { @@ -2099,7 +2100,7 @@ free_dir(struct dirlist *dp) /* * Parse a colon separated list of security flavors */ -int +static int parsesec(char *seclist, struct exportlist *ep) { char *cp, savedc; @@ -2150,7 +2151,7 @@ parsesec(char *seclist, struct exportlis * Option arguments may either be -