From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 00:22:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AE24106568E; Sun, 18 Mar 2012 00:22:30 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 171D58FC24; Sun, 18 Mar 2012 00:22:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2I0MTLm093559; Sun, 18 Mar 2012 00:22:29 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2I0MThr093557; Sun, 18 Mar 2012 00:22:29 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201203180022.q2I0MThr093557@svn.freebsd.org> From: David Xu Date: Sun, 18 Mar 2012 00:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233103 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 00:22:30 -0000 Author: davidxu Date: Sun Mar 18 00:22:29 2012 New Revision: 233103 URL: http://svn.freebsd.org/changeset/base/233103 Log: Some software think a mutex can be destroyed after it owned it, for example, it uses a serialization point like following: pthread_mutex_lock(&mutex); pthread_mutex_unlock(&mutex); pthread_mutex_destroy(&muetx); They think a previous lock holder should have already left the mutex and is no longer referencing it, so they destroy it. To be maximum compatible with such code, we use IA64 version to unlock the mutex in kernel, remove the two steps unlocking code. Modified: head/lib/libthr/thread/thr_umtx.c Modified: head/lib/libthr/thread/thr_umtx.c ============================================================================== --- head/lib/libthr/thread/thr_umtx.c Sat Mar 17 23:55:18 2012 (r233102) +++ head/lib/libthr/thread/thr_umtx.c Sun Mar 18 00:22:29 2012 (r233103) @@ -154,13 +154,6 @@ __thr_umutex_timedlock(struct umutex *mt int __thr_umutex_unlock(struct umutex *mtx, uint32_t id) { -#ifndef __ia64__ - /* XXX this logic has a race-condition on ia64. */ - if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) { - atomic_cmpset_rel_32(&mtx->m_owner, id | UMUTEX_CONTESTED, UMUTEX_CONTESTED); - return _umtx_op_err(mtx, UMTX_OP_MUTEX_WAKE, 0, 0, 0); - } -#endif /* __ia64__ */ return _umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 01:43:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42287106564A; Sun, 18 Mar 2012 01:43:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DD568FC0C; Sun, 18 Mar 2012 01:43:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2I1hgkY096010; Sun, 18 Mar 2012 01:43:42 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2I1hfEh096007; Sun, 18 Mar 2012 01:43:41 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203180143.q2I1hfEh096007@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 18 Mar 2012 01:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233104 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 01:43:42 -0000 Author: gonzo Date: Sun Mar 18 01:43:41 2012 New Revision: 233104 URL: http://svn.freebsd.org/changeset/base/233104 Log: - Fix logic for detection if further processing of PMC should be performed. pmc_intr returns one if one of the counters actually triggered the IRQ - style(9) fixed Modified: head/sys/mips/atheros/apb.c Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Sun Mar 18 00:22:29 2012 (r233103) +++ head/sys/mips/atheros/apb.c Sun Mar 18 01:43:41 2012 (r233104) @@ -347,6 +347,8 @@ apb_filter(void *arg) struct intr_event *event; uint32_t reg, irq; struct thread *td; + struct trapframe *tf; + register_t s; reg = ATH_READ_REG(AR71XX_MISC_INTR_STATUS); for (irq = 0; irq < APB_NIRQS; irq++) { @@ -368,18 +370,24 @@ apb_filter(void *arg) event = sc->sc_eventstab[irq]; if (!event || TAILQ_EMPTY(&event->ie_handlers)) { if (irq == APB_INTR_PMC) { - register_t s; - struct trapframe *tf = PCPU_GET(curthread)->td_intr_frame; + td = PCPU_GET(curthread); + tf = td->td_intr_frame; + s = intr_disable(); mips_intrcnt_inc(sc->sc_intr_counter[irq]); - if (pmc_intr && (*pmc_intr)(PCPU_GET(cpuid), tf)) { - intr_restore(s); - continue; + if (pmc_intr) { + /* + * Make sure at least one of counters + * generated this interrupt + */ + if (!(*pmc_intr)(PCPU_GET(cpuid), tf)) { + intr_restore(s); + continue; + } } intr_restore(s); - td = PCPU_GET(curthread); if (pmc_hook && (td->td_pflags & TDP_CALLCHAIN)) pmc_hook(PCPU_GET(curthread), From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 02:19:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F5BC106564A; Sun, 18 Mar 2012 02:19:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A17E8FC08; Sun, 18 Mar 2012 02:19:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2I2JUTQ097131; Sun, 18 Mar 2012 02:19:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2I2JUiZ097129; Sun, 18 Mar 2012 02:19:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203180219.q2I2JUiZ097129@svn.freebsd.org> From: Marius Strobl Date: Sun, 18 Mar 2012 02:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233105 - head/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 02:19:31 -0000 Author: marius Date: Sun Mar 18 02:19:30 2012 New Revision: 233105 URL: http://svn.freebsd.org/changeset/base/233105 Log: Declare some variables static in order to reduce the object size and redo r232822 in a less hackish way. The latter now no longer breaks compiling the x86 boot2 with clang. MFC after: 1 week Modified: head/sys/boot/common/ufsread.c Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Sun Mar 18 01:43:41 2012 (r233104) +++ head/sys/boot/common/ufsread.c Sun Mar 18 02:19:30 2012 (r233105) @@ -46,8 +46,6 @@ #include __FBSDID("$FreeBSD$"); -#include - #include #include #include @@ -96,7 +94,7 @@ static uint32_t fs_off; static __inline uint8_t fsfind(const char *name, ino_t * ino) { - char buf[DEV_BSIZE]; + static char buf[DEV_BSIZE]; struct direct *d; char *s; ssize_t n; @@ -121,7 +119,7 @@ fsfind(const char *name, ino_t * ino) static ino_t lookup(const char *path) { - char name[MAXNAMLEN + 1]; + static char name[MAXNAMLEN + 1]; const char *s; ino_t ino; ssize_t n; @@ -169,18 +167,19 @@ fsread(ino_t inode, void *buf, size_t nb { #ifndef UFS2_ONLY static struct ufs1_dinode dp1; + ufs1_daddr_t addr1; #endif #ifndef UFS1_ONLY static struct ufs2_dinode dp2; #endif + static struct fs fs; static ino_t inomap; char *blkbuf; void *indbuf; - struct fs fs; char *s; size_t n, nb, size, off, vboff; ufs_lbn_t lbn; - ufs2_daddr_t addr, vbaddr; + ufs2_daddr_t addr2, vbaddr; static ufs2_daddr_t blkmap, indmap; u_int u; @@ -251,12 +250,12 @@ fsread(ino_t inode, void *buf, size_t nb lbn = lblkno(&fs, fs_off); off = blkoff(&fs, fs_off); if (lbn < NDADDR) { - addr = DIP(di_db[lbn]); + addr2 = DIP(di_db[lbn]); } else if (lbn < NDADDR + NINDIR(&fs)) { n = INDIRPERVBLK(&fs); - addr = DIP(di_ib[0]); + addr2 = DIP(di_ib[0]); u = (u_int)(lbn - NDADDR) / n * DBPERVBLK; - vbaddr = fsbtodb(&fs, addr) + u; + vbaddr = fsbtodb(&fs, addr2) + u; if (indmap != vbaddr) { if (dskread(indbuf, vbaddr, DBPERVBLK)) return -1; @@ -264,36 +263,24 @@ fsread(ino_t inode, void *buf, size_t nb } n = (lbn - NDADDR) & (n - 1); #if defined(UFS1_ONLY) -#if BYTE_ORDER == BIG_ENDIAN - memcpy((char *)&addr + sizeof(addr) - - sizeof(ufs1_daddr_t), (ufs1_daddr_t *)indbuf + n, - sizeof(ufs1_daddr_t)); -#else - memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + memcpy(&addr1, (ufs1_daddr_t *)indbuf + n, sizeof(ufs1_daddr_t)); -#endif + addr2 = addr1; #elif defined(UFS2_ONLY) - memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + memcpy(&addr2, (ufs2_daddr_t *)indbuf + n, sizeof(ufs2_daddr_t)); #else - if (fs.fs_magic == FS_UFS1_MAGIC) -#if BYTE_ORDER == BIG_ENDIAN - memcpy((char *)&addr + sizeof(addr) - - sizeof(ufs1_daddr_t), - (ufs1_daddr_t *)indbuf + n, - sizeof(ufs1_daddr_t)); -#else - memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + if (fs.fs_magic == FS_UFS1_MAGIC) { + memcpy(&addr1, (ufs1_daddr_t *)indbuf + n, sizeof(ufs1_daddr_t)); -#endif - else - memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + addr2 = addr1; + } else + memcpy(&addr2, (ufs2_daddr_t *)indbuf + n, sizeof(ufs2_daddr_t)); #endif - } else { + } else return -1; - } - vbaddr = fsbtodb(&fs, addr) + (off >> VBLKSHIFT) * DBPERVBLK; + vbaddr = fsbtodb(&fs, addr2) + (off >> VBLKSHIFT) * DBPERVBLK; vboff = off & VBLKMASK; n = sblksize(&fs, size, lbn) - (off & ~VBLKMASK); if (n > VBLKSIZE) From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 03:42:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C15E2106566B; Sun, 18 Mar 2012 03:42:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0CBF8FC0A; Sun, 18 Mar 2012 03:42:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2I3gso4000105; Sun, 18 Mar 2012 03:42:54 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2I3gsX7000103; Sun, 18 Mar 2012 03:42:54 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203180342.q2I3gsX7000103@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 18 Mar 2012 03:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233106 - head/lib/libc/arm/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 03:42:54 -0000 Author: gonzo Date: Sun Mar 18 03:42:54 2012 New Revision: 233106 URL: http://svn.freebsd.org/changeset/base/233106 Log: Fix TLS for statically linked binaries Approved by: cognet Modified: head/lib/libc/arm/gen/_set_tp.c Modified: head/lib/libc/arm/gen/_set_tp.c ============================================================================== --- head/lib/libc/arm/gen/_set_tp.c Sun Mar 18 02:19:30 2012 (r233105) +++ head/lib/libc/arm/gen/_set_tp.c Sun Mar 18 03:42:54 2012 (r233106) @@ -29,7 +29,11 @@ #include #include +#include + void _set_tp(void *tp) { + + *((struct tcb **)ARM_TP_ADDRESS) = tp; } From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 08:08:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F917106566B; Sun, 18 Mar 2012 08:08:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65D3B8FC18; Sun, 18 Mar 2012 08:08:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2I887tx008282; Sun, 18 Mar 2012 08:08:07 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2I887ND008280; Sun, 18 Mar 2012 08:08:07 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203180808.q2I887ND008280@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 18 Mar 2012 08:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233107 - head/lib/libc/arm/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 08:08:07 -0000 Author: gonzo Date: Sun Mar 18 08:08:06 2012 New Revision: 233107 URL: http://svn.freebsd.org/changeset/base/233107 Log: Unbreak trhe build by including proper header Modified: head/lib/libc/arm/gen/_set_tp.c Modified: head/lib/libc/arm/gen/_set_tp.c ============================================================================== --- head/lib/libc/arm/gen/_set_tp.c Sun Mar 18 03:42:54 2012 (r233106) +++ head/lib/libc/arm/gen/_set_tp.c Sun Mar 18 08:08:06 2012 (r233107) @@ -27,7 +27,7 @@ */ #include -#include +#include #include From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 09:19:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A173D1065670; Sun, 18 Mar 2012 09:19:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9001E8FC08; Sun, 18 Mar 2012 09:19:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2I9Jenn010663; Sun, 18 Mar 2012 09:19:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2I9Je7I010661; Sun, 18 Mar 2012 09:19:40 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201203180919.q2I9Je7I010661@svn.freebsd.org> From: Ed Schouten Date: Sun, 18 Mar 2012 09:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233108 - stable/9/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 09:19:40 -0000 Author: ed Date: Sun Mar 18 09:19:40 2012 New Revision: 233108 URL: http://svn.freebsd.org/changeset/base/233108 Log: MFC r228322,228330,228477,228495,228562,228564,228859,228897,229574,230277: Bring in sync with FreeBSD HEAD: - Add an __alignof() for non-GCC and GCC < 2.95. - Attempt to implement the following C11 keywords: _Alignas(), _Alignof(), _Noreturn, _Static_assert() and _Thread_local. - Add __generic(), which allows us to do _Generic() in a portable fashion. - Improve __offsetof(), __DECONST(), __DEVOLATILE() and __DEQUALIFY() to use __uintptr_t and __size_t to make them work with less header prerequisites. - Add __has_feature(), __has_include() and __has_builtin() to make it easier to test against Clang features. Tested by: linimon@'s exp-run (thanks!) Modified: stable/9/sys/sys/cdefs.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/cdefs.h ============================================================================== --- stable/9/sys/sys/cdefs.h Sun Mar 18 08:08:06 2012 (r233107) +++ stable/9/sys/sys/cdefs.h Sun Mar 18 09:19:40 2012 (r233108) @@ -218,6 +218,54 @@ #endif #endif +#if !__GNUC_PREREQ__(2, 95) +#define __alignof(x) __offsetof(struct { char __a; x __b; }, __b) +#endif + +/* + * Keywords added in C11. + */ +#if defined(__cplusplus) && __cplusplus >= 201103L +#define _Alignas(e) alignas(e) +#define _Alignof(e) alignof(e) +#define _Noreturn [[noreturn]] +#define _Static_assert(e, s) static_assert(e, s) +#define _Thread_local thread_local +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +/* Do nothing. They are language keywords. */ +#else +/* Not supported. Implement them using our versions. */ +#define _Alignas(x) __aligned(x) +#define _Alignof(x) __alignof(x) +#define _Noreturn __dead2 +#define _Thread_local __thread +#ifdef __COUNTER__ +#define _Static_assert(x, y) __Static_assert(x, __COUNTER__) +#define __Static_assert(x, y) ___Static_assert(x, y) +#define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1] +#else +#define _Static_assert(x, y) struct __hack +#endif +#endif + +/* + * Emulation of C11 _Generic(). Unlike the previously defined C11 + * keywords, it is not possible to implement this using exactly the same + * syntax. Therefore implement something similar under the name + * __generic(). Unlike _Generic(), this macro can only distinguish + * between a single type, so it requires nested invocations to + * distinguish multiple cases. + */ + +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#define __generic(expr, t, yes, no) \ + _Generic(expr, t: yes, default: no) +#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) +#define __generic(expr, t, yes, no) \ + __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof(expr), t), yes, no) +#endif + #if __GNUC_PREREQ__(2, 96) #define __malloc_like __attribute__((__malloc__)) #define __pure __attribute__((__pure__)) @@ -319,10 +367,11 @@ #define __offsetof(type, field) __builtin_offsetof(type, field) #else #ifndef __cplusplus -#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) +#define __offsetof(type, field) \ + ((__size_t)(__uintptr_t)((const volatile void *)&((type *)0)->field)) #else #define __offsetof(type, field) \ - (__offsetof__ (reinterpret_cast \ + (__offsetof__ (reinterpret_cast <__size_t> \ (&reinterpret_cast \ (static_cast (0)->field)))) #endif @@ -450,15 +499,15 @@ #endif #ifndef __DECONST -#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) +#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var)) #endif #ifndef __DEVOLATILE -#define __DEVOLATILE(type, var) ((type)(uintptr_t)(volatile void *)(var)) +#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var)) #endif #ifndef __DEQUALIFY -#define __DEQUALIFY(type, var) ((type)(uintptr_t)(const volatile void *)(var)) +#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var)) #endif /*- @@ -574,4 +623,14 @@ #endif #endif +#ifndef __has_feature +#define __has_feature(x) 0 +#endif +#ifndef __has_include +#define __has_include(x) 0 +#endif +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + #endif /* !_SYS_CDEFS_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 09:45:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEF78106566C; Sun, 18 Mar 2012 09:45:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4BEF8FC15; Sun, 18 Mar 2012 09:45:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2I9jhcq011540; Sun, 18 Mar 2012 09:45:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2I9jhIE011537; Sun, 18 Mar 2012 09:45:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203180945.q2I9jhIE011537@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 18 Mar 2012 09:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233109 - head/sbin/kldload X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 09:45:43 -0000 Author: hselasky Date: Sun Mar 18 09:45:43 2012 New Revision: 233109 URL: http://svn.freebsd.org/changeset/base/233109 Log: Add option to ignore error codes if the module specified is already loaded. MFC after: 1 week Modified: head/sbin/kldload/kldload.8 head/sbin/kldload/kldload.c Modified: head/sbin/kldload/kldload.8 ============================================================================== --- head/sbin/kldload/kldload.8 Sun Mar 18 09:19:40 2012 (r233108) +++ head/sbin/kldload/kldload.8 Sun Mar 18 09:45:43 2012 (r233109) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 5, 2009 +.Dd March 18, 2012 .Dt KLDLOAD 8 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd load a file into the kernel .Sh SYNOPSIS .Nm -.Op Fl qv +.Op Fl nqv .Ar .Sh DESCRIPTION The @@ -62,6 +62,8 @@ in the current directory. .Pp The following options are available: .Bl -tag -width indent +.It Fl n +Don't try to load module if already loaded. .It Fl v Be more verbose. .It Fl q Modified: head/sbin/kldload/kldload.c ============================================================================== --- head/sbin/kldload/kldload.c Sun Mar 18 09:19:40 2012 (r233108) +++ head/sbin/kldload/kldload.c Sun Mar 18 09:45:43 2012 (r233109) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define PATHCTL "kern.module_path" @@ -129,7 +130,7 @@ path_check(const char *kldname, int quie static void usage(void) { - fprintf(stderr, "usage: kldload [-qv] file ...\n"); + fprintf(stderr, "usage: kldload [-nqv] file ...\n"); exit(1); } @@ -141,12 +142,14 @@ main(int argc, char** argv) int fileid; int verbose; int quiet; + int check_loaded; errors = 0; verbose = 0; quiet = 0; + check_loaded = 0; - while ((c = getopt(argc, argv, "qv")) != -1) { + while ((c = getopt(argc, argv, "nqv")) != -1) { switch (c) { case 'q': quiet = 1; @@ -156,6 +159,9 @@ main(int argc, char** argv) verbose = 1; quiet = 0; break; + case 'n': + check_loaded = 1; + break; default: usage(); } @@ -170,8 +176,14 @@ main(int argc, char** argv) if (path_check(argv[0], quiet) == 0) { fileid = kldload(argv[0]); if (fileid < 0) { - warn("can't load %s", argv[0]); - errors++; + if (check_loaded != 0 && errno == EEXIST) { + if (verbose) + printf("%s is already " + "loaded\n", argv[0]); + } else { + warn("can't load %s", argv[0]); + errors++; + } } else { if (verbose) printf("Loaded %s, id=%d\n", argv[0], From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 09:47:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B9AA106564A; Sun, 18 Mar 2012 09:47:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AC718FC16; Sun, 18 Mar 2012 09:47:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2I9lSaD011631; Sun, 18 Mar 2012 09:47:28 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2I9lS4x011629; Sun, 18 Mar 2012 09:47:28 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203180947.q2I9lS4x011629@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 18 Mar 2012 09:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233110 - head/tools/tools/bus_autoconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 09:47:28 -0000 Author: hselasky Date: Sun Mar 18 09:47:27 2012 New Revision: 233110 URL: http://svn.freebsd.org/changeset/base/233110 Log: Use new -n option when executing kldload, to not warn about already loaded module(s). MFC after: 1 week Modified: head/tools/tools/bus_autoconf/bus_usb.c Modified: head/tools/tools/bus_autoconf/bus_usb.c ============================================================================== --- head/tools/tools/bus_autoconf/bus_usb.c Sun Mar 18 09:45:43 2012 (r233109) +++ head/tools/tools/bus_autoconf/bus_usb.c Sun Mar 18 09:47:27 2012 (r233110) @@ -317,7 +317,7 @@ usb_dump(struct usb_device_id *id, uint3 printf(" match \"intprotocol\" \"0x%02x\";\n", id->bInterfaceProtocol); } - printf(" action \"kldload %s\";\n" + printf(" action \"kldload -n %s\";\n" "};\n\n", id->module_name); return (n); From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 09:52:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 419CA106566B; Sun, 18 Mar 2012 09:52:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3078B8FC0C; Sun, 18 Mar 2012 09:52:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2I9qtHk011836; Sun, 18 Mar 2012 09:52:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2I9qteB011834; Sun, 18 Mar 2012 09:52:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203180952.q2I9qteB011834@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 18 Mar 2012 09:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233111 - head/etc/devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 09:52:55 -0000 Author: hselasky Date: Sun Mar 18 09:52:54 2012 New Revision: 233111 URL: http://svn.freebsd.org/changeset/base/233111 Log: Regenerate usb.conf to use new -n option when doing kldload. MFC after: 1 week Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Sun Mar 18 09:47:27 2012 (r233110) +++ head/etc/devd/usb.conf Sun Mar 18 09:52:54 2012 (r233111) @@ -13,7 +13,7 @@ nomatch 32 { match "intclass" "0xff"; match "intsubclass" "0xfd"; match "intprotocol" "0x01"; - action "kldload if_ipheth"; + action "kldload -n if_ipheth"; }; nomatch 32 { @@ -24,7 +24,7 @@ nomatch 32 { match "intclass" "0xff"; match "intsubclass" "0xfd"; match "intprotocol" "0x01"; - action "kldload if_ipheth"; + action "kldload -n if_ipheth"; }; nomatch 32 { @@ -35,7 +35,7 @@ nomatch 32 { match "intclass" "0xff"; match "intsubclass" "0xfd"; match "intprotocol" "0x01"; - action "kldload if_ipheth"; + action "kldload -n if_ipheth"; }; nomatch 32 { @@ -46,7 +46,7 @@ nomatch 32 { match "intclass" "0xff"; match "intsubclass" "0xfd"; match "intprotocol" "0x01"; - action "kldload if_ipheth"; + action "kldload -n if_ipheth"; }; nomatch 32 { @@ -54,7 +54,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0104"; match "product" "0x00be"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -62,7 +62,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0123"; match "product" "0x0001"; - action "kldload uep"; + action "kldload -n uep"; }; nomatch 32 { @@ -70,7 +70,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x03e8"; match "product" "0x0008"; - action "kldload if_kue"; + action "kldload -n if_kue"; }; nomatch 32 { @@ -78,7 +78,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x03eb"; match "product" "0x2109"; - action "kldload uftdi"; + action "kldload -n uftdi"; }; nomatch 32 { @@ -86,7 +86,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x03f0"; match "product" "0x0121"; - action "kldload ugensa"; + action "kldload -n ugensa"; }; nomatch 32 { @@ -94,7 +94,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x03f0"; match "product" "(0x1016|0x1116|0x1216)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -102,7 +102,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x03f0"; match "product" "(0x1b1d|0x1e1d)"; - action "kldload u3g"; + action "kldload -n u3g"; }; nomatch 32 { @@ -110,7 +110,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x03f0"; match "product" "(0x2016|0x2116|0x2216|0x3016|0x3116|0x3216)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -118,7 +118,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x03f0"; match "product" "0x3524"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -126,7 +126,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x03f0"; match "product" "(0x4016|0x4116|0x4216|0x5016|0x5116|0x5216)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -134,7 +134,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x03f0"; match "product" "0x811c"; - action "kldload if_aue"; + action "kldload -n if_aue"; }; nomatch 32 { @@ -142,7 +142,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x03f0"; match "product" "0xca02"; - action "kldload if_urtw"; + action "kldload -n if_urtw"; }; nomatch 32 { @@ -150,7 +150,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0402"; match "product" "0x5632"; - action "kldload if_cdce"; + action "kldload -n if_cdce"; }; nomatch 32 { @@ -158,7 +158,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0403"; match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xa6d0|0xa6d0|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; - action "kldload uftdi"; + action "kldload -n uftdi"; }; nomatch 32 { @@ -166,7 +166,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0408"; match "product" "0x0304"; - action "kldload if_run"; + action "kldload -n if_run"; }; nomatch 32 { @@ -174,7 +174,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0408"; match "product" "(0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)"; - action "kldload u3g"; + action "kldload -n u3g"; }; nomatch 32 { @@ -182,7 +182,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0409"; match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -190,7 +190,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "(0x0001|0x0005|0x0009)"; - action "kldload if_aue"; + action "kldload -n if_aue"; }; nomatch 32 { @@ -198,7 +198,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "0x0012"; - action "kldload if_rue"; + action "kldload -n if_rue"; }; nomatch 32 { @@ -206,7 +206,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "0x003d"; - action "kldload if_axe"; + action "kldload -n if_axe"; }; nomatch 32 { @@ -214,7 +214,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "(0x005e|0x0066|0x0067)"; - action "kldload if_ural"; + action "kldload -n if_ural"; }; nomatch 32 { @@ -222,7 +222,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "0x006e"; - action "kldload if_axe"; + action "kldload -n if_axe"; }; nomatch 32 { @@ -230,7 +230,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "0x008b"; - action "kldload if_ural"; + action "kldload -n if_ural"; }; nomatch 32 { @@ -238,7 +238,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "0x00b3"; - action "kldload uftdi"; + action "kldload -n uftdi"; }; nomatch 32 { @@ -246,7 +246,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "(0x00d8|0x00d9)"; - action "kldload if_rum"; + action "kldload -n if_rum"; }; nomatch 32 { @@ -254,7 +254,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "0x00da"; - action "kldload if_zyd"; + action "kldload -n if_zyd"; }; nomatch 32 { @@ -262,7 +262,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "0x00e8"; - action "kldload if_run"; + action "kldload -n if_run"; }; nomatch 32 { @@ -270,7 +270,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "(0x0116|0x0119)"; - action "kldload if_rum"; + action "kldload -n if_rum"; }; nomatch 32 { @@ -278,7 +278,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "0x012e"; - action "kldload if_run"; + action "kldload -n if_run"; }; nomatch 32 { @@ -286,7 +286,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "0x0137"; - action "kldload if_rum"; + action "kldload -n if_rum"; }; nomatch 32 { @@ -294,7 +294,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0411"; match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2)"; - action "kldload if_run"; + action "kldload -n if_run"; }; nomatch 32 { @@ -302,7 +302,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0413"; match "product" "0x2101"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -310,7 +310,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0423"; match "product" "(0x000a|0x000c)"; - action "kldload if_cue"; + action "kldload -n if_cue"; }; nomatch 32 { @@ -318,7 +318,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x043e"; match "product" "0x9c01"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -326,7 +326,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x045a"; match "product" "(0x5001|0x5002)"; - action "kldload urio"; + action "kldload -n urio"; }; nomatch 32 { @@ -334,7 +334,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x045b"; match "product" "0x0053"; - action "kldload uslcom"; + action "kldload -n uslcom"; }; nomatch 32 { @@ -342,7 +342,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x045e"; match "product" "0x0079"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -350,7 +350,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x045e"; match "product" "0x007a"; - action "kldload if_aue"; + action "kldload -n if_aue"; }; nomatch 32 { @@ -358,7 +358,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x045e"; match "product" "(0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411|0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x044b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x0460|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475|0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x04cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04e9|0x04ea)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -366,7 +366,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0471"; match "product" "0x066a"; - action "kldload uslcom"; + action "kldload -n uslcom"; }; nomatch 32 { @@ -374,7 +374,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0471"; match "product" "0x1236"; - action "kldload if_zyd"; + action "kldload -n if_zyd"; }; nomatch 32 { @@ -382,7 +382,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0471"; match "product" "0x200f"; - action "kldload if_run"; + action "kldload -n if_run"; }; nomatch 32 { @@ -390,7 +390,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0482"; match "product" "0x0203"; - action "kldload umodem"; + action "kldload -n umodem"; }; nomatch 32 { @@ -398,7 +398,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0489"; match "product" "(0xe000|0xe003)"; - action "kldload uslcom"; + action "kldload -n uslcom"; }; nomatch 32 { @@ -406,7 +406,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x049f"; match "product" "(0x0003|0x0032)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -414,7 +414,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x049f"; match "product" "0x505a"; - action "kldload if_cdce"; + action "kldload -n if_cdce"; }; nomatch 32 { @@ -422,7 +422,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04a4"; match "product" "0x0014"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -430,7 +430,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04a5"; match "product" "0x4027"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -438,7 +438,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04a5"; match "product" "0x4068"; - action "kldload u3g"; + action "kldload -n u3g"; }; nomatch 32 { @@ -446,7 +446,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04ad"; match "product" "(0x0301|0x0302|0x0303|0x0306)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -454,7 +454,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04b4"; match "product" "0x1002"; - action "kldload ufm"; + action "kldload -n ufm"; }; nomatch 32 { @@ -462,7 +462,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04b7"; match "product" "0x0531"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -470,7 +470,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04b8"; match "product" "(0x0521|0x0522)"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -478,7 +478,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04bb"; match "product" "0x0901"; - action "kldload if_kue"; + action "kldload -n if_kue"; }; nomatch 32 { @@ -486,7 +486,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04bb"; match "product" "(0x0904|0x0913)"; - action "kldload if_aue"; + action "kldload -n if_aue"; }; nomatch 32 { @@ -494,7 +494,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04bb"; match "product" "0x0930"; - action "kldload if_axe"; + action "kldload -n if_axe"; }; nomatch 32 { @@ -502,7 +502,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04bb"; match "product" "(0x0944|0x0945|0x0947|0x0948)"; - action "kldload if_run"; + action "kldload -n if_run"; }; nomatch 32 { @@ -510,7 +510,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04bb"; match "product" "(0x0a03|0x0a0e)"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -518,7 +518,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04bf"; match "product" "(0x0115|0x0117)"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -526,7 +526,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04c5"; match "product" "(0x1058|0x1079)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -534,7 +534,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04da"; match "product" "0x2500"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -542,7 +542,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04da"; match "product" "0x3900"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -550,7 +550,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04dd"; match "product" "(0x8004|0x8005|0x8006|0x8007|0x9031)"; - action "kldload if_cdce"; + action "kldload -n if_cdce"; }; nomatch 32 { @@ -558,7 +558,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04dd"; match "product" "(0x9102|0x9121|0x9123|0x9151|0x91ac|0x9242)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -566,7 +566,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04e8"; match "product" "0x2018"; - action "kldload if_run"; + action "kldload -n if_run"; }; nomatch 32 { @@ -574,7 +574,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04e8"; match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -582,7 +582,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04e8"; match "product" "0x6601"; - action "kldload uvisor"; + action "kldload -n uvisor"; }; nomatch 32 { @@ -590,7 +590,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04e8"; match "product" "(0x6611|0x6613|0x6615|0x6617|0x6619|0x661b|0x662e|0x6630|0x6632)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -598,7 +598,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04e8"; match "product" "0x8001"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -606,7 +606,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04f1"; match "product" "0x3008"; - action "kldload if_axe"; + action "kldload -n if_axe"; }; nomatch 32 { @@ -614,7 +614,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04f1"; match "product" "(0x3011|0x3012)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -622,7 +622,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0502"; match "product" "(0x1631|0x1632|0x16e1|0x16e2|0x16e3)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -630,7 +630,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0506"; match "product" "(0x03e8|0x11f8)"; - action "kldload if_kue"; + action "kldload -n if_kue"; }; nomatch 32 { @@ -638,7 +638,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0506"; match "product" "0x4601"; - action "kldload if_aue"; + action "kldload -n if_aue"; }; nomatch 32 { @@ -646,7 +646,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x0103"; - action "kldload ubsa"; + action "kldload -n ubsa"; }; nomatch 32 { @@ -654,7 +654,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x0109"; - action "kldload umct"; + action "kldload -n umct"; }; nomatch 32 { @@ -662,7 +662,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x0121"; - action "kldload if_aue"; + action "kldload -n if_aue"; }; nomatch 32 { @@ -670,7 +670,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x0257"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -678,7 +678,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x0409"; - action "kldload umct"; + action "kldload -n umct"; }; nomatch 32 { @@ -686,7 +686,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x1203"; - action "kldload ubsa"; + action "kldload -n ubsa"; }; nomatch 32 { @@ -694,7 +694,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x4050"; - action "kldload if_zyd"; + action "kldload -n if_zyd"; }; nomatch 32 { @@ -702,7 +702,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x5055"; - action "kldload if_axe"; + action "kldload -n if_axe"; }; nomatch 32 { @@ -710,7 +710,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x7050"; - action "kldload if_upgt"; + action "kldload -n if_upgt"; }; nomatch 32 { @@ -718,7 +718,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "(0x7050|0x7051)"; - action "kldload if_ural"; + action "kldload -n if_ural"; }; nomatch 32 { @@ -726,7 +726,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x705a"; - action "kldload if_rum"; + action "kldload -n if_rum"; }; nomatch 32 { @@ -734,7 +734,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x705c"; - action "kldload if_zyd"; + action "kldload -n if_zyd"; }; nomatch 32 { @@ -742,7 +742,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x705e"; - action "kldload if_urtw"; + action "kldload -n if_urtw"; }; nomatch 32 { @@ -750,7 +750,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "(0x8053|0x805c|0x815c|0x825a|0x825b)"; - action "kldload if_run"; + action "kldload -n if_run"; }; nomatch 32 { @@ -758,7 +758,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x905b"; - action "kldload if_rum"; + action "kldload -n if_rum"; }; nomatch 32 { @@ -766,7 +766,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x935a"; - action "kldload if_run"; + action "kldload -n if_run"; }; nomatch 32 { @@ -774,7 +774,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0525"; match "product" "0x1080"; - action "kldload udbp"; + action "kldload -n udbp"; }; nomatch 32 { @@ -782,7 +782,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0525"; match "product" "0xa4a2"; - action "kldload if_cdce"; + action "kldload -n if_cdce"; }; nomatch 32 { @@ -790,7 +790,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0536"; match "product" "0x01a0"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -798,7 +798,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0543"; match "product" "(0x0ed9|0x1527|0x1529|0x152b|0x152e|0x1921|0x1922|0x1923)"; - action "kldload uipaq"; + action "kldload -n uipaq"; }; nomatch 32 { @@ -806,7 +806,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0547"; match "product" "0x2008"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -814,7 +814,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0547"; match "product" "0x2720"; - action "kldload udbp"; + action "kldload -n udbp"; }; nomatch 32 { @@ -822,7 +822,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x054c"; match "product" "(0x0038|0x0066|0x0095|0x009a|0x00da|0x0169)"; - action "kldload uvisor"; + action "kldload -n uvisor"; }; nomatch 32 { @@ -830,7 +830,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x054c"; match "product" "0x0437"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -838,7 +838,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0557"; match "product" "0x2002"; - action "kldload if_kue"; + action "kldload -n if_kue"; }; nomatch 32 { @@ -846,7 +846,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0557"; match "product" "0x2007"; - action "kldload if_aue"; + action "kldload -n if_aue"; }; nomatch 32 { @@ -854,7 +854,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0557"; match "product" "0x2008"; - action "kldload uplcom"; + action "kldload -n uplcom"; }; nomatch 32 { @@ -862,7 +862,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0557"; match "product" "0x2009"; - action "kldload if_axe"; + action "kldload -n if_axe"; }; nomatch 32 { @@ -870,7 +870,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0557"; match "product" "0x4000"; - action "kldload if_kue"; + action "kldload -n if_kue"; }; nomatch 32 { @@ -878,7 +878,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x055d"; match "product" "0x2018"; - action "kldload if_run"; + action "kldload -n if_run"; }; nomatch 32 { @@ -886,7 +886,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0565"; match "product" "0x0001"; - action "kldload ubsa"; + action "kldload -n ubsa"; }; nomatch 32 { @@ -894,7 +894,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0565"; match "product" "(0x0002|0x0003|0x0005)"; - action "kldload if_kue"; + action "kldload -n if_kue"; }; nomatch 32 { @@ -902,7 +902,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0567"; match "product" "(0x2000|0x2002)"; - action "kldload if_upgt"; + action "kldload -n if_upgt"; }; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 10:45:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 011101065674; Sun, 18 Mar 2012 10:45:37 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E44EE8FC14; Sun, 18 Mar 2012 10:45:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IAjaL9015715; Sun, 18 Mar 2012 10:45:36 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IAjapU015713; Sun, 18 Mar 2012 10:45:36 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201203181045.q2IAjapU015713@svn.freebsd.org> From: Hiroki Sato Date: Sun, 18 Mar 2012 10:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233112 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 10:45:37 -0000 Author: hrs Date: Sun Mar 18 10:45:36 2012 New Revision: 233112 URL: http://svn.freebsd.org/changeset/base/233112 Log: MFC r216650: Add IFT_L2VLAN to the list that is capable of supplying the ingredients of the EUI64 part of an IPv6 address. Otherwise vlans will all use the MAC address of the first ethernet interface of the system. Modified: stable/8/sys/netinet6/in6_ifattach.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/8/sys/netinet6/in6_ifattach.c Sun Mar 18 09:52:54 2012 (r233111) +++ stable/8/sys/netinet6/in6_ifattach.c Sun Mar 18 10:45:36 2012 (r233112) @@ -267,6 +267,7 @@ found: /* get EUI64 */ switch (ifp->if_type) { case IFT_ETHER: + case IFT_L2VLAN: case IFT_FDDI: case IFT_ISO88025: case IFT_ATM: From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 11:23:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B64DB106566B; Sun, 18 Mar 2012 11:23:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C8DE8FC17; Sun, 18 Mar 2012 11:23:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IBNfbk016908; Sun, 18 Mar 2012 11:23:41 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IBNfYS016905; Sun, 18 Mar 2012 11:23:41 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201203181123.q2IBNfYS016905@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 18 Mar 2012 11:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233113 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 11:23:41 -0000 Author: bz Date: Sun Mar 18 11:23:40 2012 New Revision: 233113 URL: http://svn.freebsd.org/changeset/base/233113 Log: Hide kernel option ROUTETABLES evaluations in the implementation rather than the header file. With this also move RT_MAXFIBS and RT_NUMFIBS into the implemantion to avoid further usage in other code. rt_numfibs is all that should be needed. This allows users to change the number of FIBs from 1..RT_MAXFIBS(16) dynamically using the tunable without the need to change the kernel config for the maximum anymore. This means that thet multi-FIB feature is now fully available with GENERIC kernels. The kernel option ROUTETABLES can still be used to set the default numbers of FIBs in absence of the tunable. Ok.ed by: julian, hrs, melifaro MFC after: 2 weeks Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun Mar 18 10:45:36 2012 (r233112) +++ head/sys/net/route.c Sun Mar 18 11:23:40 2012 (r233113) @@ -68,6 +68,24 @@ #include +/* We use 4 bits in the mbuf flags, thus we are limited to 16 FIBS. */ +#define RT_MAXFIBS 16 + +/* Kernel config default option. */ +#ifdef ROUTETABLES +#if ROUTETABLES <= 0 +#error "ROUTETABLES defined too low" +#endif +#if ROUTETABLES > RT_MAXFIBS +#error "ROUTETABLES defined too big" +#endif +#define RT_NUMFIBS ROUTETABLES +#endif /* ROUTETABLES */ +/* Initialize to default if not otherwise set. */ +#ifndef RT_NUMFIBS +#define RT_NUMFIBS 1 +#endif + u_int rt_numfibs = RT_NUMFIBS; SYSCTL_UINT(_net, OID_AUTO, fibs, CTLFLAG_RD, &rt_numfibs, 0, ""); /* Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Mar 18 10:45:36 2012 (r233112) +++ head/sys/net/route.h Sun Mar 18 11:23:40 2012 (r233113) @@ -90,27 +90,6 @@ struct rt_metrics { #define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ #define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) -/* MRT compile-time constants */ -#ifdef _KERNEL - #ifndef ROUTETABLES - #define RT_NUMFIBS 1 - #define RT_MAXFIBS 1 - #else - /* while we use 4 bits in the mbuf flags, we are limited to 16 */ - #define RT_MAXFIBS 16 - #if ROUTETABLES > RT_MAXFIBS - #define RT_NUMFIBS RT_MAXFIBS - #error "ROUTETABLES defined too big" - #else - #if ROUTETABLES == 0 - #define RT_NUMFIBS 1 - #else - #define RT_NUMFIBS ROUTETABLES - #endif - #endif - #endif -#endif - #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ extern u_int rt_numfibs; /* number fo usable routing tables */ /* From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 12:03:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D0541065670; Sun, 18 Mar 2012 12:03:07 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A68B8FC23; Sun, 18 Mar 2012 12:03:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IC37kA018166; Sun, 18 Mar 2012 12:03:07 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IC37c8018164; Sun, 18 Mar 2012 12:03:07 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201203181203.q2IC37c8018164@svn.freebsd.org> From: Hiroki Sato Date: Sun, 18 Mar 2012 12:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233114 - releng/8.3/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 12:03:07 -0000 Author: hrs Date: Sun Mar 18 12:03:06 2012 New Revision: 233114 URL: http://svn.freebsd.org/changeset/base/233114 Log: Add relnote items for 8.3R (revision numbers are fixed yet): SA-11:01 to SA-11:10, dtrace systrace_linux32 on amd64 support, hhook(9) and khelp(9~ added, hw.mwmtest.tests loader tunable, O_CLOEXEC for open(2) and fhopen(2) added, posix_fallocate(2) added, usbdump(8) added, cxgbe(4) 7.11.0 added, dc(4) PAE support, em(4) 7.3.2, igb(4) 2.3.1, igb(4) I350 support, ixgbe(4) 2.4.5, iwn(4) firmware image updated, msk(4) RXCSUM fixed, nge(4) MTU handling fixed, rdcphy(4) added, re(4) RTL8168E/8111E-VL and RTL8401E support added, re(4) TX interrupt moderation on RTL810xE added, re(4) RX interrupt moderation performance improvement, re(4) TSO support on RTL8168/8111 added, re(4) TXCSUM/RXCSUM offloading can be enabled independently now, re(4) RTL8105E support added, vte(4) added, ipfw(8) call and return actions added, IPsec HMAC-SHA-{256,384,512} in RFC 4868 supported, IPV6_PKTINFO bug in sendmsg(2) fixed, mod_cc(9) pluggable congestion control framework added, h_ertt(4) khelp module added, TCP_CONGESTION sockopt added, nf_ipfw(4) now supports IPv6, ng_one2many(4) XMIT_FAILOVER algorithm support added, ada(4) kern.cam.ada.write_cache, arcmsr(4) 1.20.00.22, graid(8) added, mxge(4) updated, tws(4) added, FFS TRIM support added, NFS nocto mount option added, vfs.typenumhash loader tunable added, ZFS SPA version 28, bsdtar 2.8.5, cpuset(1) -C, fetch(1) STAT FTP command bug fixed, gpart(8) show -p added, hastd(8) drops root privilege, hastd(8) checksum keyword support added, hastd(8) compression keyword support added, readline(3) API imported to libedit, makefs(8) ISO 9660 format support, libmd/libcrypt SHA-{256,512} support added, netstat(1) not expose scope addr representation derived from KAME stack, newsyslog(8) xz compression support, poweroff(8) added, ppp(8) iface name xxx and iface description xxx subcommands added, ps(1) -o usertime and -o systime, rtadvd(8) noifprefix, RFC 6106 support, rtadvctl(8) added, tftpd(8) large file bugfix, zpool labelclear subcommand added, awk 2011/8/7 snapshot, BIND 9.6-ESV-R5-P1, netcat 4.9, GCC r127959, the last GPLv2-licensed version, less v444, OpenSSH 5.4p1+HPN, sendmail 8.14.5, tzdata2011n, unifdef 2.5.6, xz 2011/7/11 snapshot, and x11/kde4 4.7.4. Approved by: re (implicit) Modified: releng/8.3/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: releng/8.3/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- releng/8.3/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Mar 18 11:23:40 2012 (r233113) +++ releng/8.3/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Mar 18 12:03:06 2012 (r233114) @@ -109,7 +109,6 @@ advisories, user-visible changes, and major architectural improvements. - Kernel Changes - + The &os; + &man.dtrace.1; framework now supports + systrace for system calls of + linux32 and freebsd32 on + &os;/&arch.amd64;. Two new + systrace_linux32 and + systrace_freebsd32 kernel modules provide + support for tracing compat system calls in addition to the native + system call tracing provided by the + systrace module. + + The &man.hhook.9; (Helper Hook) + and &man.khelp.9; (Kernel Helpers) KPIs have been implemented. + These are a kind of superset of &man.pfil.9; framework for + more general use in the kernel. The &man.hhook.9; KPI + provides a way for kernel subsystems to export hook points + that &man.khelp.9; modules can hook to provide enhanced or new + functionality to the kernel. The &man.khelp.9; KPI provides a + framework for managing &man.khelp.9; modules, which indirectly + use the &man.hhook.9; KPI to register their hook functions + with hook points of interest within the kernel. These allow a + structured way to dynamically extend the kernel at runtime in + an ABI preserving manner. + + A &man.loader.8; + tunable hw.memtest.tests has been added. + This controls whether to perform memory testing at boot time + or not. The default value is 1 (perform a + memory test). + + The &man.open.2; and &man.fhopen.2; + system calls now support the O_CLOEXEC flag, + which allows setting the FD_CLOEXEC flag for the + newly created file descriptor. This is standardized in IEEE + Std 1003.1-2008 (POSIX, Single UNIX Specification Version + 4). + + The &man.posix.fallocate.2; system call has + been implemented. This is a function in POSIX to ensure that + a part of the storage for regular file data is allocated on the + file system storage media. Boot Loader Changes @@ -170,7 +258,11 @@ Hardware Support - + The &os; &man.usb.4; subsystem now + supports USB packet filter. This allows to capture packets + which go through each USB host controller. The + implementation is almost based on &man.bpf.4; code. + The userland program &man.usbdump.8; has been added. Multimedia Support @@ -181,33 +273,360 @@ Network Interface Support - + The &man.cxgb.4; driver has been + updated to version 7.11.0. + + A &man.cxgbe.4; driver for Chelsio + T4 (Terminator 4) based 10Gb/1Gb adapters has been + added. + + The &man.dc.4; driver + now works correctly in kernels with the + option. + + The &man.em.4; driver has been + updated to version 7.3.2. + + The &man.igb.4; driver has been + updated to version 2.3.1. + + The &man.igb.4; driver now supports + Intel I350 PCIe Gigabit Ethernet controllers. + + The &man.ixgbe.4; driver has been + updated to version 2.4.5. + + Firmware images in the &man.iwn.4; + driver for 1000, 5000, 6000, and 6500 series cards have been + updated. + + A bug in the &man.msk.4; driver has been + fixed. It could prevent RX checksum offloading from + working. + + A bug in the &man.nfe.4; driver which + could prevent reinitialization after changing the MTU has + been fixed. + + A rdcphy(4) driver for RDC Semiconductor + R6040 10/100 PHY has been added. + + The &man.re.4; driver now supports + RTL8168E/8111E-VL PCIe Gigabit Ethernet controllers and + RTL8401E PCIe Fast Ethernet controllers. + + The &man.re.4; driver now supports + TX interrupt moderation on RTL810xE PCIe Fast Ethernet + controllers. + + The &man.re.4; driver now supports + another mechanism for RX interrupt moderation because of + performance problems. A &man.sysctl.8; variable + dev.re.N.int_rx_mod + has been added to control amount of time to delay RX + interrupt processing, in units of microsecond. Setting it + to 0 completely disables RX interrupt + moderation. A &man.loader.8; tunable + hw.re.intr_filter controls whether the + old mechanism utilizing MSI/MSI-X capability on + supported controllers is used or not. When set to + a non-zero value, the &man.re.4; driver uses the old + mechanism. The default value is 0 and + this tunable has no effect on controllers without MSI/MSI-X + capability. + + The &man.re.4; driver now + supports TSO (TCP Segmentation Offload) on RealTek + RTL8168/8111 C or later controllers. Note that this is + disabled by default because broken frames can be sent + under certain conditions. + + The &man.re.4; driver now + supports enabling TX and/or RX checksum offloading + independently from each other. Note that TX IP checksum + is disabled on some RTL8168C-based network interfaces + because it can generate an incorrect IP checksum when the + packet contains IP options. + + The &man.re.4; driver now supports + RTL8105E PCIe Fast Ethernet controllers. + + A &man.vte.4; driver for RDC R6040 Fast + Ethernet controllers, which are commonly found on the Vortex86 + System On a Chip, has been added. Network Protocols - + &man.ipfw.8; now supports the + call and return + actions. Upon the call + number action, the + current rule number is saved in the internal stack and + ruleset processing continues with the first rule numbered + number or higher. The + return action takes the rule number saved + to internal stack by the latest call + action and returns ruleset processing to the first rule with + number greater than that saved number. + + &os;'s &man.ipsec.4; support now uses + half of the hash size as the authenticator hash size in + Hashed Message Authentication Mode (HMAC-SHA-256, + HMAC-SHA-384, and HMAC-SHA-512) as described in RFC 4868. + This was a fixed 96-bit length in prior releases because the + implementation was based on an old Internet draft + draft-ietf-ipsec-ciph-sha-256-00. Note that this means + &release.current; and later are no longer interoperable with + the older &os; releases. + + A bug in the + IPV6_PKTINFO option used in + &man.sendmsg.2; has been fixed. The + IPV6_USE_MIN_MTU state set by + &man.setsockopt.2; was ignored. + + The + &os; TCP/IP network stack now supports the &man.mod.cc.9; pluggable + congestion control framework. This allows TCP congestion + control algorithms to be implemented as dynamically loadable + kernel modules. The following kernel modules are available + as of &release.current;: &man.cc.chd.4; for the + CAIA-Hamilton-Delay algorithm, &man.cc.cubic.4; for the CUBIC + algorithm, &man.cc.hd.4; for the Hamilton-Delay algorithm, + &man.cc.htcp.4; for the H-TCP algorithm, &man.cc.newreno.4; for + the NewReno algorithm, and &man.cc.vegas.4; for the Vegas algorithm. + The default algorithm can be set by a new &man.sysctl.8; + variable net.inet.tcp.cc.algorithm. The + value must be set to one of the names listed by + net.inet.tcp.cc.available, and + newreno is the default set at boot time. + For more + detail, see the &man.mod.cc.4; and &man.mod.cc.9; manual pages. + + An &man.h.ertt.4; (Enhanced Round Trip + Time) &man.khelp.9; module has been added. This module + allows per-connection, low noise estimates of the + instantaneous RTT in the TCP/IP network stack with a robust + implementation even in the face of delayed acknowledgments + and/or TSO (TCP Segmentation Offload) being in use for a + connection. + + A new &man.tcp.4; socket option + TCP_CONGESTION has been added. This + allows to select or query the congestion control algorithm + that the TCP/IP network stack will use for connections on + the socket. + + The &man.ng.ipfw.4; &man.netgraph.4; + node now supports IPv6. + + The &man.ng.one2many.4; + &man.netgraph.4; node now supports the + XMIT_FAILOVER transmit algorithm. This + makes packets deliver out of the first active + many hook. Disks and Storage - + The &man.ada.4; driver now supports + write cache control. A new &man.sysctl.8 variable + kern.cam.ada.write_cache determines + whether the write cache of &man.ada.4; devices is enabled or + not. Setting to 1 enables and + 0 disables the write cache, and -1 + leaves the device default behavior. &man.sysctl.8 variables + kern.cam.ada.N.write_cache + can override the configuration in a per-device basis (the + default value is -1, which means to use + the global setting). Note that the value can be changed at + runtime, but it takes effect only after a device + reset. + + The &man.arcmsr.4; driver has been + updated to version 1.20.00.22. + + The &man.graid.8; GEOM class has been + added. This is a replacement of the &man.ataraid.4; driver + supporting various BIOS-based software RAID. + + The &man.mxge.4; driver has been + updated. + + A &man.tws.4; driver for 3ware 9750 + SATA+SAS 6Gb/s RAID controllers has been added. + File Systems - + The &os; Fast File System now + supports the TRIM command when freeing data + blocks. A new flag in the &man.newfs.8; + and &man.tunefs.8; utilities sets the TRIM-enable flag for a + file system. The TRIM-enable flag makes the file system + send a delete request to the underlying device for each + freed block. The TRIM command is + specified as a Data Set Management Command in the ATA8-ACS2 + standard to carry the information related to deleted data + blocks to a device, especially for a SSD (Solid-State Drive) for + optimization. + + A new flag has + been added to the &man.newfs.8; and &man.fsck.ffs.8; utilities. + This clears unallocated blocks, notifying the underlying + device that they are not used and that their contents may be + discarded. This is useful in &man.fsck.ffs.8; for file + systems which have been mounted on systems without + TRIM support, or with + TRIM support disabled, as well as + filesystems which have been copied from one device to + another. + + The &os; NFS subsystem now supports a + mount option. This disables the + close-to-open cache coherency check at open time. This + option may improve performance for read-only mounts, but + should only be used only if the data on the server changes + rarely. The &man.mount.nfs.8; utility now also supports + this flag keyword. + + A &man.loader.8; tunable + vfs.typenumhash has been added. Setting + this to 1 enables to use a hash + calculation on the file system identification number + internally used in the kernel. This fixes the Stale + NFS file handle error on NFS clients when upgrading + or rebuilding the kernel on the NFS server due to unexpected + change of these identification number values. Note that + this is set to 0 (disable) by default for + backward compatibility. + + The &os; ZFS subsystem has been + updated to the SPA (Storage Pool Allocator, also known as + zpool) version 28. It now supports data deduplication, + triple parity RAIDZ (raidz3), snapshot holds, log device + removal, zfs diff, zpool split, zpool import + , and read-only zpool import. Userland Changes - + The &man.bsdtar.1; and + &man.cpio.1; utilities are now based on + libarchive version 2.8.5. + + The &man.cpuset.1; utility now supports + a flag to create a new cpuset and assign + an existing process into that set, and an + all keyword in the option to specify + all CPUs in the system. + + A bug in the &man.fetch.1; utility which + could prevent the STAT FTP command from working + properly has been fixed. + + The &man.gpart.8; utility now supports a + flag to the show + subcommand. This allows showing providers' names of + partitions instead of the partitions' indexes. + + The &man.hastd.8; utility now drops + root privileges of the worker processes to the + hast user. + + The &man.hastd.8; utility now supports a + checksum keyword to specify the checksum + algorithm in a resource section. As of + &release.current;, none, + sha256, and crc32 are + supported. + + The &man.hastd.8; utility now supports a + compression keyword to specify the compression + algorithm in a resource section. As of + &release.current;, none, + hole and lzf are + supported. + + The &man.hastd.8; utility now supports a + source keyword to specify the local address + to bind to before connecting the remote &man.hastd.8 + daemon. + + A &man.readline.3; API set has been + imported into libedit. This is + based on NetBSD's implementation and BSD licensed utilities + now use it instead of GNU + libreadline. + + The &man.makefs.8; utility now supports the + ISO 9660 format. + + libmd + and libcrypt now support the SHA-256 + and SHA-512 algorithms. + + The &man.netstat.1; utility now does not + expose the internal scope address representation used in the &os; + kernel, which is derived from KAME IPv6 stack, in the results + of netstat -ani and netstat + -nr. + + The &man.newsyslog.8; utility now + supports &man.xz.1; compression. An X flag + in the optional field has been added to specify the + compression. + + A &man.poweroff.8; utility has been added. + This is equivalent to: + + &prompt.root; shutdown -p now + + The &man.ppp.8; utility now supports + iface name name + and iface description + description commands. + These have the same functionalities as the name + and description subcommands of the + &man.ifconfig.8; utility. + + The &man.ps.1; utility now supports + and + options to display accumulated system and user CPU time, + respectively. + + The &man.rtadvd.8; daemon now supports a + noifprefix keyword to disable gathering + on-link prefixes from interfaces when no + addr keyword is specified. An entry in + /etc/rtadvd.conf with + noifprefix and no addr + generates an RA message with no prefix information + option. + + The &man.rtadvd.8; daemon now + supports the RDNSS and DNSSL options described in RFC 6106, + IPv6 Router Advertisement Options for DNS + Configuration. A &man.rtadvctl.8; utility to control + the &man.rtadvd.8; daemon has been added. + + A bug in the &man.tftpd.8; daemon has + been fixed. It had an interoperability issue when + transferring a large file. + + The &man.zpool.8: utility now supports a + zpool labelclear command. This allows to + wipe the label data from a drive that is not active in a + pool. <filename>/etc/periodic</filename> Scripts @@ -225,13 +644,51 @@ Contributed Software - + The awk has + been updated to the 7 August 2011 release. + + ISC BIND has + been updated to version 9.6-ESV-R5-P1. + + The netcat utility + has been updated to version 4.9. + + GNU GCC and + libstdc++ have been updated to rev + 127959 of gcc-4_2-branch (the last + GPLv2-licensed version). + + The LESS + program has been updated to version v444. + + The + OpenSSH utility has been updated to + 5.4p1, and optimization for large bandwidth-delay product + connection and none cipher support have + been merged + + sendmail + has been updated to version 8.14.5. + + The timezone + database has been updated to the + tzdata2011n release. + + The &man.unifdef.1; utility has been updated + to version 2.5.6. + + The xz + program has been updated from 5.0.0 to a snapshot as of 11 + July, 2011. Ports/Packages Collection Infrastructure - + The supported version of + the KDE desktop environment + (x11/kde4) has been + updated from 4.5.5 to 4.7.4. From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 12:07:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC727106566B; Sun, 18 Mar 2012 12:07:00 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB86D8FC08; Sun, 18 Mar 2012 12:07:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IC70Wh018319; Sun, 18 Mar 2012 12:07:00 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IC70Gb018317; Sun, 18 Mar 2012 12:07:00 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201203181207.q2IC70Gb018317@svn.freebsd.org> From: Hiroki Sato Date: Sun, 18 Mar 2012 12:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233115 - releng/8.3/release/doc/en_US.ISO8859-1/errata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 12:07:01 -0000 Author: hrs Date: Sun Mar 18 12:07:00 2012 New Revision: 233115 URL: http://svn.freebsd.org/changeset/base/233115 Log: Trim old news items. Approved by: re (implicit) Modified: releng/8.3/release/doc/en_US.ISO8859-1/errata/article.sgml Modified: releng/8.3/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- releng/8.3/release/doc/en_US.ISO8859-1/errata/article.sgml Sun Mar 18 12:03:06 2012 (r233114) +++ releng/8.3/release/doc/en_US.ISO8859-1/errata/article.sgml Sun Mar 18 12:07:00 2012 (r233115) @@ -166,13 +166,6 @@ Late-Breaking News and Corrections - A bug in OpenSSL that could cause - it to parse past the end of the message was found at the late - stage of &release.bugfix; release process. The &release.bugfix; - includes a fix for this issue by importing relevant parts from - the OpenSSL CVS. This could be triggered by an incorrectly - formatted ClientHello SSL/TLS handshake messages. The details - can be found at . + No news. From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 13:02:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 610EA1065673; Sun, 18 Mar 2012 13:02:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E35D8FC18; Sun, 18 Mar 2012 13:02:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ID2vDD020204; Sun, 18 Mar 2012 13:02:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ID2vsD020197; Sun, 18 Mar 2012 13:02:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201203181302.q2ID2vsD020197@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 18 Mar 2012 13:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233116 - in stable/9/tools/regression/bin/sh: builtins expansion parameters X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 13:02:57 -0000 Author: jilles Date: Sun Mar 18 13:02:56 2012 New Revision: 233116 URL: http://svn.freebsd.org/changeset/base/233116 Log: MFC r226892,r228007,r228873,r230121,r232839: sh: Various testcases that already work. Added: stable/9/tools/regression/bin/sh/builtins/case11.0 - copied unchanged from r228007, head/tools/regression/bin/sh/builtins/case11.0 stable/9/tools/regression/bin/sh/builtins/case12.0 - copied unchanged from r228007, head/tools/regression/bin/sh/builtins/case12.0 stable/9/tools/regression/bin/sh/builtins/for1.0 - copied unchanged from r226892, head/tools/regression/bin/sh/builtins/for1.0 stable/9/tools/regression/bin/sh/expansion/arith12.0 - copied unchanged from r232839, head/tools/regression/bin/sh/expansion/arith12.0 stable/9/tools/regression/bin/sh/expansion/cmdsubst12.0 - copied unchanged from r230121, head/tools/regression/bin/sh/expansion/cmdsubst12.0 stable/9/tools/regression/bin/sh/expansion/cmdsubst13.0 - copied unchanged from r230121, head/tools/regression/bin/sh/expansion/cmdsubst13.0 stable/9/tools/regression/bin/sh/parameters/positional2.0 - copied unchanged from r228873, head/tools/regression/bin/sh/parameters/positional2.0 Modified: Directory Properties: stable/9/tools/regression/bin/sh/ (props changed) Copied: stable/9/tools/regression/bin/sh/builtins/case11.0 (from r228007, head/tools/regression/bin/sh/builtins/case11.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/case11.0 Sun Mar 18 13:02:56 2012 (r233116, copy of r228007, head/tools/regression/bin/sh/builtins/case11.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +false +case x in +*) +esac Copied: stable/9/tools/regression/bin/sh/builtins/case12.0 (from r228007, head/tools/regression/bin/sh/builtins/case12.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/case12.0 Sun Mar 18 13:02:56 2012 (r233116, copy of r228007, head/tools/regression/bin/sh/builtins/case12.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +false +case x in +y) +esac Copied: stable/9/tools/regression/bin/sh/builtins/for1.0 (from r226892, head/tools/regression/bin/sh/builtins/for1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/for1.0 Sun Mar 18 13:02:56 2012 (r233116, copy of r226892, head/tools/regression/bin/sh/builtins/for1.0) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +false +for i in `false`; do exit 3; done Copied: stable/9/tools/regression/bin/sh/expansion/arith12.0 (from r232839, head/tools/regression/bin/sh/expansion/arith12.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/expansion/arith12.0 Sun Mar 18 13:02:56 2012 (r233116, copy of r232839, head/tools/regression/bin/sh/expansion/arith12.0) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +_x=4 y_=5 z_z=6 +[ "$((_x*100+y_*10+z_z))" = 456 ] Copied: stable/9/tools/regression/bin/sh/expansion/cmdsubst12.0 (from r230121, head/tools/regression/bin/sh/expansion/cmdsubst12.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/expansion/cmdsubst12.0 Sun Mar 18 13:02:56 2012 (r233116, copy of r230121, head/tools/regression/bin/sh/expansion/cmdsubst12.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +f() { + echo x$(printf foo >&2)y +} +[ "$(f 2>&1)" = "fooxy" ] Copied: stable/9/tools/regression/bin/sh/expansion/cmdsubst13.0 (from r230121, head/tools/regression/bin/sh/expansion/cmdsubst13.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/expansion/cmdsubst13.0 Sun Mar 18 13:02:56 2012 (r233116, copy of r230121, head/tools/regression/bin/sh/expansion/cmdsubst13.0) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +x=1 y=2 +[ "$( + case $((x+=1)) in + ($((y+=1))) echo bad1 ;; + ($((y-1))) echo $x.$y ;; + ($((y=2))) echo bad2 ;; + (*) echo bad3 ;; + esac +)" = "2.3" ] || echo "Error at $LINENO" +[ "$x.$y" = "1.2" ] || echo "Error at $LINENO" Copied: stable/9/tools/regression/bin/sh/parameters/positional2.0 (from r228873, head/tools/regression/bin/sh/parameters/positional2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/parameters/positional2.0 Sun Mar 18 13:02:56 2012 (r233116, copy of r228873, head/tools/regression/bin/sh/parameters/positional2.0) @@ -0,0 +1,65 @@ +# $FreeBSD$ + +failures='' +ok='' + +testcase() { + code="$1" + expected="$2" + oIFS="$IFS" + eval "$code" + IFS='|' + result="$#|$*" + IFS="$oIFS" + if [ "x$result" = "x$expected" ]; then + ok=x$ok + else + failures=x$failures + echo "For $code, expected $expected actual $result" + fi +} + +testcase 'set -- a b; set -- p$@q' '2|pa|bq' +testcase 'set -- a b; set -- $@q' '2|a|bq' +testcase 'set -- a b; set -- p$@' '2|pa|b' +testcase 'set -- a b; set -- p$@q' '2|pa|bq' +testcase 'set -- a b; set -- $@q' '2|a|bq' +testcase 'set -- a b; set -- p$@' '2|pa|b' +testcase 'set -- a b; set -- p$*q' '2|pa|bq' +testcase 'set -- a b; set -- $*q' '2|a|bq' +testcase 'set -- a b; set -- p$*' '2|pa|b' +testcase 'set -- a b; set -- p$*q' '2|pa|bq' +testcase 'set -- a b; set -- $*q' '2|a|bq' +testcase 'set -- a b; set -- p$*' '2|pa|b' +testcase 'set -- a b; set -- "p$@q"' '2|pa|bq' +testcase 'set -- a b; set -- "$@q"' '2|a|bq' +testcase 'set -- a b; set -- "p$@"' '2|pa|b' +testcase 'set -- a b; set -- p"$@"q' '2|pa|bq' +testcase 'set -- a b; set -- "$@"q' '2|a|bq' +testcase 'set -- a b; set -- p"$@"' '2|pa|b' +testcase 'set -- "" a b; set -- "p$@q"' '3|p|a|bq' +testcase 'set -- "" a b; set -- "$@q"' '3||a|bq' +testcase 'set -- "" a b; set -- "p$@"' '3|p|a|b' +testcase 'set -- "" a b; set -- p"$@"q' '3|p|a|bq' +testcase 'set -- "" a b; set -- "$@"q' '3||a|bq' +testcase 'set -- "" a b; set -- p"$@"' '3|p|a|b' +testcase 'set -- a; set -- p$@q' '1|paq' +testcase 'set -- a; set -- $@q' '1|aq' +testcase 'set -- a; set -- p$@' '1|pa' +testcase 'set -- a; set -- p$@q' '1|paq' +testcase 'set -- a; set -- $@q' '1|aq' +testcase 'set -- a; set -- p$@' '1|pa' +testcase 'set -- a; set -- p$*q' '1|paq' +testcase 'set -- a; set -- $*q' '1|aq' +testcase 'set -- a; set -- p$*' '1|pa' +testcase 'set -- a; set -- p$*q' '1|paq' +testcase 'set -- a; set -- $*q' '1|aq' +testcase 'set -- a; set -- p$*' '1|pa' +testcase 'set -- a; set -- "p$@q"' '1|paq' +testcase 'set -- a; set -- "$@q"' '1|aq' +testcase 'set -- a; set -- "p$@"' '1|pa' +testcase 'set -- a; set -- p"$@"q' '1|paq' +testcase 'set -- a; set -- "$@"q' '1|aq' +testcase 'set -- a; set -- p"$@"' '1|pa' + +test "x$failures" = x From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 13:22:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD761106564A; Sun, 18 Mar 2012 13:22:42 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CBA78FC08; Sun, 18 Mar 2012 13:22:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IDMgMh020837; Sun, 18 Mar 2012 13:22:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IDMg9W020835; Sun, 18 Mar 2012 13:22:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203181322.q2IDMg9W020835@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 18 Mar 2012 13:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233117 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 13:22:42 -0000 Author: nwhitehorn Date: Sun Mar 18 13:22:42 2012 New Revision: 233117 URL: http://svn.freebsd.org/changeset/base/233117 Log: Remove acquisition of VM page queues lock from pmap_protect(). Any actual manipulation of the pvo_vlink and pvo_olink entries is already protected by the table lock, so most remaining instances of the acquisition of the page queues lock can likely be replaced with the table lock, or removed if the table lock is already held. Reviewed by: alc Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sun Mar 18 13:02:56 2012 (r233116) +++ head/sys/powerpc/aim/mmu_oea64.c Sun Mar 18 13:22:42 2012 (r233117) @@ -1965,7 +1965,6 @@ moea64_protect(mmu_t mmu, pmap_t pm, vm_ return; } - vm_page_lock_queues(); PMAP_LOCK(pm); if ((eva - sva)/PAGE_SIZE < pm->pm_stats.resident_count) { for (; sva < eva; sva += PAGE_SIZE) { @@ -1980,7 +1979,6 @@ moea64_protect(mmu_t mmu, pmap_t pm, vm_ moea64_pvo_protect(mmu, pm, pvo, prot); } } - vm_page_unlock_queues(); PMAP_UNLOCK(pm); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 14:49:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 57C1E106566C; Sun, 18 Mar 2012 14:49:37 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 371768FC16; Sun, 18 Mar 2012 14:49:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IEnbDb023682; Sun, 18 Mar 2012 14:49:37 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IEnanM023678; Sun, 18 Mar 2012 14:49:36 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201203181449.q2IEnanM023678@svn.freebsd.org> From: Kevin Lo Date: Sun, 18 Mar 2012 14:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233119 - in stable/9/usr.bin: bc dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 14:49:37 -0000 Author: kevlo Date: Sun Mar 18 14:49:36 2012 New Revision: 233119 URL: http://svn.freebsd.org/changeset/base/233119 Log: MFC r232994: - Fix an erroneous invocation of the editline. - Fix wrong scaling in the bc.library. - Let length(0.000) conform to what gnu bc does. PR: bin/159227 Submitted by: AIDA Shinra Modified: stable/9/usr.bin/bc/bc.library stable/9/usr.bin/bc/bc.y stable/9/usr.bin/dc/bcode.c Directory Properties: stable/9/usr.bin/ (props changed) Modified: stable/9/usr.bin/bc/bc.library ============================================================================== --- stable/9/usr.bin/bc/bc.library Sun Mar 18 13:54:57 2012 (r233118) +++ stable/9/usr.bin/bc/bc.library Sun Mar 18 14:49:36 2012 (r233119) @@ -46,7 +46,9 @@ define e(x) { r = ibase ibase = A t = scale - scale = t + .434*x + 1 + scale = 0 + if (x > 0) scale = (0.435*x)/1 + scale = scale + t + 1 w = 0 if (x < 0) { @@ -95,26 +97,33 @@ define l(x) { t = scale f = 1 - scale = scale + scale(x) - length(x) + 1 - s = scale + if (x < 1) { + s = scale(x) + } else { + s = length(x) - scale(x) + } + scale = 0 + a = (2.31*s)/1 /* estimated integer part of the answer */ + s = t + length(a) + 2 /* estimated length of the answer */ while (x > 2) { - s = s + (length(x) - scale(x))/2 + 1 - if (s > 0) scale = s + scale=0 + scale = (length(x) + scale(x))/2 + 1 + if (scale < s) scale = s x = sqrt(x) f = f*2 } while (x < .5) { - s = s + (length(x) - scale(x))/2 + 1 - if (s > 0) scale = s + scale = 0 + scale = scale(x)/2 + 1 + if (scale < s) scale = s x = sqrt(x) f = f*2 } - scale = t + length(f) - scale(f) + 1 + scale = t + length(f) + length(t + length(f)) + 1 u = (x - 1)/(x + 1) - - scale = scale + 1.1*length(t) - 1.1*scale(t) s = u*u + scale = t + 2 b = 2*f c = b d = 1 @@ -261,3 +270,4 @@ define j(n,x) { e = g } } +/* vim: set filetype=bc shiftwidth=8 noexpandtab: */ Modified: stable/9/usr.bin/bc/bc.y ============================================================================== --- stable/9/usr.bin/bc/bc.y Sun Mar 18 13:54:57 2012 (r233118) +++ stable/9/usr.bin/bc/bc.y Sun Mar 18 14:49:36 2012 (r233119) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "extern.h" #include "pathnames.h" @@ -1093,7 +1094,7 @@ sigchld(int signo) switch (signo) { default: for (;;) { - pid = waitpid(dc, &status, WCONTINUED); + pid = waitpid(dc, &status, WUNTRACED); if (pid == -1) { if (errno == EINTR) continue; @@ -1181,16 +1182,6 @@ main(int argc, char *argv[]) dup(p[1]); close(p[0]); close(p[1]); - if (interactive) { - el = el_init("bc", stdin, stderr, stderr); - hist = history_init(); - history(hist, &he, H_SETSIZE, 100); - el_set(el, EL_HIST, history, hist); - el_set(el, EL_EDITOR, "emacs"); - el_set(el, EL_SIGNAL, 1); - el_set(el, EL_PROMPT, dummy_prompt); - el_source(el, NULL); - } } else { close(STDIN_FILENO); dup(p[0]); @@ -1200,6 +1191,16 @@ main(int argc, char *argv[]) err(1, "cannot find dc"); } } + if (interactive) { + el = el_init("bc", stdin, stderr, stderr); + hist = history_init(); + history(hist, &he, H_SETSIZE, 100); + el_set(el, EL_HIST, history, hist); + el_set(el, EL_EDITOR, "emacs"); + el_set(el, EL_SIGNAL, 1); + el_set(el, EL_PROMPT, dummy_prompt); + el_source(el, NULL); + } yywrap(); return (yyparse()); } Modified: stable/9/usr.bin/dc/bcode.c ============================================================================== --- stable/9/usr.bin/dc/bcode.c Sun Mar 18 13:54:57 2012 (r233118) +++ stable/9/usr.bin/dc/bcode.c Sun Mar 18 14:49:36 2012 (r233119) @@ -693,7 +693,7 @@ count_digits(const struct number *n) u_int i; if (BN_is_zero(n->number)) - return (1); + return (n->scale ? n->scale : 1); int_part = new_number(); fract_part = new_number(); From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 15:03:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE6EF106566C; Sun, 18 Mar 2012 15:03:02 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A36E08FC14; Sun, 18 Mar 2012 15:03:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IF328p024190; Sun, 18 Mar 2012 15:03:02 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IF32k2024186; Sun, 18 Mar 2012 15:03:02 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201203181503.q2IF32k2024186@svn.freebsd.org> From: Kevin Lo Date: Sun, 18 Mar 2012 15:03:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233120 - in stable/9/sys/fs: hpfs msdosfs ntfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 15:03:02 -0000 Author: kevlo Date: Sun Mar 18 15:03:02 2012 New Revision: 233120 URL: http://svn.freebsd.org/changeset/base/233120 Log: MFC r232483: Clean up style(9) nits Modified: stable/9/sys/fs/hpfs/hpfs_vfsops.c stable/9/sys/fs/msdosfs/msdosfs_vfsops.c stable/9/sys/fs/ntfs/ntfs_vfsops.c Directory Properties: stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) Modified: stable/9/sys/fs/hpfs/hpfs_vfsops.c ============================================================================== --- stable/9/sys/fs/hpfs/hpfs_vfsops.c Sun Mar 18 14:49:36 2012 (r233119) +++ stable/9/sys/fs/hpfs/hpfs_vfsops.c Sun Mar 18 15:03:02 2012 (r233120) @@ -283,11 +283,11 @@ hpfs_mountfs(devvp, mp, td) hpmp->hpm_devvp = devvp; hpmp->hpm_dev = devvp->v_rdev; hpmp->hpm_mp = mp; - if (1 == vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v) == 1) hpmp->hpm_uid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v) == 1) hpmp->hpm_gid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "mode", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "mode", "%d", &v) == 1) hpmp->hpm_mode = v; error = hpfs_bminit(hpmp); Modified: stable/9/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Sun Mar 18 14:49:36 2012 (r233119) +++ stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Sun Mar 18 15:03:02 2012 (r233120) @@ -149,13 +149,13 @@ update_mp(struct mount *mp, struct threa } } - if (1 == vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v) == 1) pmp->pm_gid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v) == 1) pmp->pm_uid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "mask", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "mask", "%d", &v) == 1) pmp->pm_mask = v & ALLPERMS; - if (1 == vfs_scanopt(mp->mnt_optnew, "dirmask", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "dirmask", "%d", &v) == 1) pmp->pm_dirmask = v & ALLPERMS; vfs_flagopt(mp->mnt_optnew, "shortname", &pmp->pm_flags, MSDOSFSMNT_SHORTNAME); Modified: stable/9/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- stable/9/sys/fs/ntfs/ntfs_vfsops.c Sun Mar 18 14:49:36 2012 (r233119) +++ stable/9/sys/fs/ntfs/ntfs_vfsops.c Sun Mar 18 15:03:02 2012 (r233120) @@ -345,11 +345,11 @@ ntfs_mountfs(devvp, mp, td) ntmp->ntm_mountp = mp; ntmp->ntm_devvp = devvp; - if (1 == vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v) == 1) ntmp->ntm_uid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v) == 1) ntmp->ntm_gid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "mode", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "mode", "%d", &v) == 1) ntmp->ntm_mode = v & ACCESSPERMS; vfs_flagopt(mp->mnt_optnew, "caseins", &ntmp->ntm_flag, NTFS_MFLAG_CASEINS); From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 15:34:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEECA1065675; Sun, 18 Mar 2012 15:34:39 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEBCA8FC0A; Sun, 18 Mar 2012 15:34:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IFYdYj025172; Sun, 18 Mar 2012 15:34:39 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IFYdte025170; Sun, 18 Mar 2012 15:34:39 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201203181534.q2IFYdte025170@svn.freebsd.org> From: Kevin Lo Date: Sun, 18 Mar 2012 15:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233121 - head/usr.bin/bc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 15:34:39 -0000 Author: kevlo Date: Sun Mar 18 15:34:39 2012 New Revision: 233121 URL: http://svn.freebsd.org/changeset/base/233121 Log: Repair function when used with large scales Submitted by: AIDA Shinra Modified: head/usr.bin/bc/bc.library Modified: head/usr.bin/bc/bc.library ============================================================================== --- head/usr.bin/bc/bc.library Sun Mar 18 15:03:02 2012 (r233120) +++ head/usr.bin/bc/bc.library Sun Mar 18 15:34:39 2012 (r233121) @@ -48,7 +48,7 @@ define e(x) { t = scale scale = 0 if (x > 0) scale = (0.435*x)/1 - scale = scale + t + 1 + scale = scale + t + length(scale + t) + 1 w = 0 if (x < 0) { @@ -120,7 +120,8 @@ define l(x) { f = f*2 } - scale = t + length(f) + length(t + length(f)) + 1 + scale = 0 + scale = t + length(f) + length((1.05*(t+length(f))/1)) + 1 u = (x - 1)/(x + 1) s = u*u scale = t + 2 From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 17:41:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F010106564A; Sun, 18 Mar 2012 17:41:55 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A5878FC0C; Sun, 18 Mar 2012 17:41:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IHftfP029248; Sun, 18 Mar 2012 17:41:55 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IHftK6029246; Sun, 18 Mar 2012 17:41:55 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201203181741.q2IHftK6029246@svn.freebsd.org> From: Alan Cox Date: Sun, 18 Mar 2012 17:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233122 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 17:41:55 -0000 Author: alc Date: Sun Mar 18 17:41:54 2012 New Revision: 233122 URL: http://svn.freebsd.org/changeset/base/233122 Log: Style fix to pmap_protect(). Submitted by: bde Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Mar 18 15:34:39 2012 (r233121) +++ head/sys/amd64/amd64/pmap.c Sun Mar 18 17:41:54 2012 (r233122) @@ -2939,8 +2939,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pdp_entry_t *pdpe; pd_entry_t ptpaddr, *pde; pt_entry_t *pte; - int anychanged; - boolean_t pv_lists_locked; + boolean_t anychanged, pv_lists_locked; if ((prot & VM_PROT_READ) == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); @@ -2953,7 +2952,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pv_lists_locked = FALSE; resume: - anychanged = 0; + anychanged = FALSE; PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { @@ -3001,7 +3000,7 @@ resume: * invalidated by pmap_protect_pde(). */ if (pmap_protect_pde(pmap, pde, sva, prot)) - anychanged = 1; + anychanged = TRUE; continue; } else { if (!pv_lists_locked) { @@ -3055,7 +3054,7 @@ retry: if (obits & PG_G) pmap_invalidate_page(pmap, sva); else - anychanged = 1; + anychanged = TRUE; } } } From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 18:44:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE5FD106564A; Sun, 18 Mar 2012 18:44:42 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF3808FC0A; Sun, 18 Mar 2012 18:44:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IIigcm031222; Sun, 18 Mar 2012 18:44:42 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IIigi9031219; Sun, 18 Mar 2012 18:44:42 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203181844.q2IIigi9031219@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 18 Mar 2012 18:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233123 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 18:44:42 -0000 Author: tijl Date: Sun Mar 18 18:44:42 2012 New Revision: 233123 URL: http://svn.freebsd.org/changeset/base/233123 Log: Use exact width integer types in amd64/i386 reg.h to prepare for a merge. The only real change is replacing long with int on i386. Modified: head/sys/amd64/include/reg.h head/sys/i386/include/reg.h Modified: head/sys/amd64/include/reg.h ============================================================================== --- head/sys/amd64/include/reg.h Sun Mar 18 17:41:54 2012 (r233122) +++ head/sys/amd64/include/reg.h Sun Mar 18 18:44:42 2012 (r233123) @@ -45,32 +45,32 @@ * Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS. */ struct reg { - register_t r_r15; - register_t r_r14; - register_t r_r13; - register_t r_r12; - register_t r_r11; - register_t r_r10; - register_t r_r9; - register_t r_r8; - register_t r_rdi; - register_t r_rsi; - register_t r_rbp; - register_t r_rbx; - register_t r_rdx; - register_t r_rcx; - register_t r_rax; - uint32_t r_trapno; - uint16_t r_fs; - uint16_t r_gs; - uint32_t r_err; - uint16_t r_es; - uint16_t r_ds; - register_t r_rip; - register_t r_cs; - register_t r_rflags; - register_t r_rsp; - register_t r_ss; + __int64_t r_r15; + __int64_t r_r14; + __int64_t r_r13; + __int64_t r_r12; + __int64_t r_r11; + __int64_t r_r10; + __int64_t r_r9; + __int64_t r_r8; + __int64_t r_rdi; + __int64_t r_rsi; + __int64_t r_rbp; + __int64_t r_rbx; + __int64_t r_rdx; + __int64_t r_rcx; + __int64_t r_rax; + __uint32_t r_trapno; + __uint16_t r_fs; + __uint16_t r_gs; + __uint32_t r_err; + __uint16_t r_es; + __uint16_t r_ds; + __int64_t r_rip; + __int64_t r_cs; + __int64_t r_rflags; + __int64_t r_rsp; + __int64_t r_ss; }; /* @@ -82,17 +82,17 @@ struct fpreg { * simplified struct. This may be too much detail. Perhaps * an array of unsigned longs is best. */ - unsigned long fpr_env[4]; - unsigned char fpr_acc[8][16]; - unsigned char fpr_xacc[16][16]; - unsigned long fpr_spare[12]; + __uint64_t fpr_env[4]; + __uint8_t fpr_acc[8][16]; + __uint8_t fpr_xacc[16][16]; + __uint64_t fpr_spare[12]; }; /* * Register set accessible via /proc/$pid/dbregs. */ struct dbreg { - unsigned long dr[16]; /* debug registers */ + __uint64_t dr[16]; /* debug registers */ /* Index 0-3: debug address registers */ /* Index 4-5: reserved */ /* Index 6: debug status */ Modified: head/sys/i386/include/reg.h ============================================================================== --- head/sys/i386/include/reg.h Sun Mar 18 17:41:54 2012 (r233122) +++ head/sys/i386/include/reg.h Sun Mar 18 18:44:42 2012 (r233123) @@ -36,6 +36,8 @@ #ifndef _MACHINE_REG_H_ #define _MACHINE_REG_H_ +#include + /* * Indices for registers in `struct trapframe' and `struct regs'. * @@ -78,25 +80,25 @@ * Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS. */ struct reg { - unsigned int r_fs; - unsigned int r_es; - unsigned int r_ds; - unsigned int r_edi; - unsigned int r_esi; - unsigned int r_ebp; - unsigned int r_isp; - unsigned int r_ebx; - unsigned int r_edx; - unsigned int r_ecx; - unsigned int r_eax; - unsigned int r_trapno; - unsigned int r_err; - unsigned int r_eip; - unsigned int r_cs; - unsigned int r_eflags; - unsigned int r_esp; - unsigned int r_ss; - unsigned int r_gs; + __uint32_t r_fs; + __uint32_t r_es; + __uint32_t r_ds; + __uint32_t r_edi; + __uint32_t r_esi; + __uint32_t r_ebp; + __uint32_t r_isp; + __uint32_t r_ebx; + __uint32_t r_edx; + __uint32_t r_ecx; + __uint32_t r_eax; + __uint32_t r_trapno; + __uint32_t r_err; + __uint32_t r_eip; + __uint32_t r_cs; + __uint32_t r_eflags; + __uint32_t r_esp; + __uint32_t r_ss; + __uint32_t r_gs; }; /* @@ -108,10 +110,10 @@ struct fpreg { * simplified struct. This may be too much detail. Perhaps * an array of unsigned longs is best. */ - unsigned long fpr_env[7]; - unsigned char fpr_acc[8][10]; - unsigned long fpr_ex_sw; - unsigned char fpr_pad[64]; + __uint32_t fpr_env[7]; + __uint8_t fpr_acc[8][10]; + __uint32_t fpr_ex_sw; + __uint8_t fpr_pad[64]; }; struct xmmreg { @@ -120,17 +122,17 @@ struct xmmreg { * simplified struct. This may be too much detail. Perhaps * an array of unsigned longs is best. */ - unsigned long xmm_env[8]; - unsigned char xmm_acc[8][16]; - unsigned char xmm_reg[8][16]; - unsigned char xmm_pad[224]; + __uint32_t xmm_env[8]; + __uint8_t xmm_acc[8][16]; + __uint8_t xmm_reg[8][16]; + __uint8_t xmm_pad[224]; }; /* * Register set accessible via /proc/$pid/dbregs. */ struct dbreg { - unsigned int dr[8]; /* debug registers */ + __uint32_t dr[8]; /* debug registers */ /* Index 0-3: debug address registers */ /* Index 4-5: reserved */ /* Index 6: debug status */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 18:51:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB77D106567A; Sun, 18 Mar 2012 18:51:51 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 883358FC1A; Sun, 18 Mar 2012 18:51:51 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 4A12580C; Sun, 18 Mar 2012 19:51:42 +0100 (CET) Date: Sun, 18 Mar 2012 19:50:15 +0100 From: Pawel Jakub Dawidek To: David Xu Message-ID: <20120318185014.GK1340@garage.freebsd.pl> References: <201202271338.q1RDcqEQ020033@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ms5iOKSBOB9YS8zC" Content-Disposition: inline In-Reply-To: <201202271338.q1RDcqEQ020033@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232209 - in head: lib/libthr/thread sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 18:51:52 -0000 --Ms5iOKSBOB9YS8zC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 27, 2012 at 01:38:52PM +0000, David Xu wrote: > Author: davidxu > Date: Mon Feb 27 13:38:52 2012 > New Revision: 232209 > URL: http://svn.freebsd.org/changeset/base/232209 >=20 > Log: > Follow changes made in revision 232144, pass absolute timeout to kernel, > this eliminates a clock_gettime() syscall. This or some other change has broken CLOCK_MONOTONIC usage with condition variables. You should be able to reproduce this by something like this: pthread_cond_t cv; pthread_condattr_t attr; pthread_mutex_t lock; struct timespec ts; int error; (void)pthread_mutex_init(&lock, NULL); (void)pthread_condattr_init(&attr); (void)pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); (void)pthread_cond_init(&cv, &attr); (void)pthread_condattr_destroy(&attr); (void)clock_gettime(CLOCK_MONOTONIC, &ts); ts.tv_sec +=3D 10; (void)pthread_mutex_lock(&lock); (void)pthread_cond_timedwait(&cv, &lock, &ts); (void)pthread_mutex_unlock(&lock); This should timeout after 10 seconds, but pthread_cond_timedwait(3) returns immediately with ETIMEDOUT. CLOCK_REALTIME works properly. Bascially pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) is no-op. If you change CLOCK_MONOTONIC to CLOCK_REALTIME in clock_gettime(2) call, it will timeout after 10 seconds. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --Ms5iOKSBOB9YS8zC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk9mLmYACgkQForvXbEpPzS+lQCgoKdnHns+Q/E+jvCf9O9RS42y 2bQAoIAg8CMWpS3fxaqha7beqw9bG7JN =UPcG -----END PGP SIGNATURE----- --Ms5iOKSBOB9YS8zC-- From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 19:06:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D05B7106566B; Sun, 18 Mar 2012 19:06:38 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B94A98FC0A; Sun, 18 Mar 2012 19:06:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IJ6cAx031980; Sun, 18 Mar 2012 19:06:38 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IJ6cWR031974; Sun, 18 Mar 2012 19:06:38 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203181906.q2IJ6cWR031974@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 18 Mar 2012 19:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233124 - in head/sys: amd64/include compat/ia32 i386/include pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 19:06:38 -0000 Author: tijl Date: Sun Mar 18 19:06:38 2012 New Revision: 233124 URL: http://svn.freebsd.org/changeset/base/233124 Log: Copy i386 reg.h to x86 and merge with amd64 reg.h. Replace i386/amd64/pc98 reg.h with stubs. The tREGISTER macros are only made visible on i386. These macros are deprecated and should not be available on amd64. The i386 and amd64 versions of struct reg have been renamed to struct __reg32 and struct __reg64. During compilation either __reg32 or __reg64 is defined as reg depending on the machine architecture. On amd64 the i386 struct is also available as struct reg32 which is used in COMPAT_FREEBSD32 code. Most of compat/ia32/ia32_reg.h is now IA64 only. Reviewed by: kib (previous version) Added: head/sys/x86/include/reg.h - copied, changed from r233123, head/sys/i386/include/reg.h Modified: head/sys/amd64/include/reg.h head/sys/compat/ia32/ia32_reg.h head/sys/i386/include/reg.h head/sys/pc98/include/reg.h Modified: head/sys/amd64/include/reg.h ============================================================================== --- head/sys/amd64/include/reg.h Sun Mar 18 18:44:42 2012 (r233123) +++ head/sys/amd64/include/reg.h Sun Mar 18 19:06:38 2012 (r233124) @@ -1,141 +1,6 @@ /*- - * Copyright (c) 2003 Peter Wemm. - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)reg.h 5.5 (Berkeley) 1/18/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_REG_H_ -#define _MACHINE_REG_H_ - -#if defined(_KERNEL) && !defined(_STANDALONE) -#include "opt_compat.h" -#endif - -/* - * Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS. - */ -struct reg { - __int64_t r_r15; - __int64_t r_r14; - __int64_t r_r13; - __int64_t r_r12; - __int64_t r_r11; - __int64_t r_r10; - __int64_t r_r9; - __int64_t r_r8; - __int64_t r_rdi; - __int64_t r_rsi; - __int64_t r_rbp; - __int64_t r_rbx; - __int64_t r_rdx; - __int64_t r_rcx; - __int64_t r_rax; - __uint32_t r_trapno; - __uint16_t r_fs; - __uint16_t r_gs; - __uint32_t r_err; - __uint16_t r_es; - __uint16_t r_ds; - __int64_t r_rip; - __int64_t r_cs; - __int64_t r_rflags; - __int64_t r_rsp; - __int64_t r_ss; -}; - -/* - * Register set accessible via /proc/$pid/fpregs. - */ -struct fpreg { - /* - * XXX should get struct from fpu.h. Here we give a slightly - * simplified struct. This may be too much detail. Perhaps - * an array of unsigned longs is best. - */ - __uint64_t fpr_env[4]; - __uint8_t fpr_acc[8][16]; - __uint8_t fpr_xacc[16][16]; - __uint64_t fpr_spare[12]; -}; - -/* - * Register set accessible via /proc/$pid/dbregs. - */ -struct dbreg { - __uint64_t dr[16]; /* debug registers */ - /* Index 0-3: debug address registers */ - /* Index 4-5: reserved */ - /* Index 6: debug status */ - /* Index 7: debug control */ - /* Index 8-15: reserved */ -}; - -#define DBREG_DR7_LOCAL_ENABLE 0x01 -#define DBREG_DR7_GLOBAL_ENABLE 0x02 -#define DBREG_DR7_LEN_1 0x00 /* 1 byte length */ -#define DBREG_DR7_LEN_2 0x01 -#define DBREG_DR7_LEN_4 0x03 -#define DBREG_DR7_LEN_8 0x02 -#define DBREG_DR7_EXEC 0x00 /* break on execute */ -#define DBREG_DR7_WRONLY 0x01 /* break on write */ -#define DBREG_DR7_RDWR 0x03 /* break on read or write */ -#define DBREG_DR7_MASK(i) (0xful << ((i) * 4 + 16) | 0x3 << (i) * 2) -#define DBREG_DR7_SET(i, len, access, enable) \ - ((u_long)((len) << 2 | (access)) << ((i) * 4 + 16) | (enable) << (i) * 2) -#define DBREG_DR7_GD 0x2000 -#define DBREG_DR7_ENABLED(d, i) (((d) & 0x3 << (i) * 2) != 0) -#define DBREG_DR7_ACCESS(d, i) ((d) >> ((i) * 4 + 16) & 0x3) -#define DBREG_DR7_LEN(d, i) ((d) >> ((i) * 4 + 18) & 0x3) - -#define DBREG_DRX(d,x) ((d)->dr[(x)]) /* reference dr0 - dr15 by - register number */ - -#ifdef COMPAT_FREEBSD32 -#include -#include -#endif - -#ifdef _KERNEL -/* - * XXX these interfaces are MI, so they should be declared in a MI place. - */ -int fill_regs(struct thread *, struct reg *); -int fill_frame_regs(struct trapframe *, struct reg *); -int set_regs(struct thread *, struct reg *); -int fill_fpregs(struct thread *, struct fpreg *); -int set_fpregs(struct thread *, struct fpreg *); -int fill_dbregs(struct thread *, struct dbreg *); -int set_dbregs(struct thread *, struct dbreg *); -#endif - -#endif /* !_MACHINE_REG_H_ */ +#include Modified: head/sys/compat/ia32/ia32_reg.h ============================================================================== --- head/sys/compat/ia32/ia32_reg.h Sun Mar 18 18:44:42 2012 (r233123) +++ head/sys/compat/ia32/ia32_reg.h Sun Mar 18 19:06:38 2012 (r233124) @@ -36,6 +36,7 @@ #ifndef _COMPAT_IA32_IA32_REG_H_ #define _COMPAT_IA32_IA32_REG_H_ +#ifdef __ia64__ /* * Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS. */ @@ -77,6 +78,7 @@ struct fpreg32 { struct dbreg32 { unsigned int dr[8]; /* debug registers */ }; +#endif /* * Wrappers and converters. Modified: head/sys/i386/include/reg.h ============================================================================== --- head/sys/i386/include/reg.h Sun Mar 18 18:44:42 2012 (r233123) +++ head/sys/i386/include/reg.h Sun Mar 18 19:06:38 2012 (r233124) @@ -1,174 +1,6 @@ /*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)reg.h 5.5 (Berkeley) 1/18/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_REG_H_ -#define _MACHINE_REG_H_ - -#include - -/* - * Indices for registers in `struct trapframe' and `struct regs'. - * - * This interface is deprecated. In the kernel, it is only used in FPU - * emulators to convert from register numbers encoded in instructions to - * register values. Everything else just accesses the relevant struct - * members. In userland, debuggers tend to abuse this interface since - * they don't understand that `struct regs' is a struct. I hope they have - * stopped accessing the registers in the trap frame via PT_{READ,WRITE}_U - * and we can stop supporting the user area soon. - */ -#define tFS (0) -#define tES (1) -#define tDS (2) -#define tEDI (3) -#define tESI (4) -#define tEBP (5) -#define tISP (6) -#define tEBX (7) -#define tEDX (8) -#define tECX (9) -#define tEAX (10) -#define tERR (12) -#define tEIP (13) -#define tCS (14) -#define tEFLAGS (15) -#define tESP (16) -#define tSS (17) - -/* - * Indices for registers in `struct regs' only. - * - * Some registers live in the pcb and are only in an "array" with the - * other registers in application interfaces that copy all the registers - * to or from a `struct regs'. - */ -#define tGS (18) - -/* - * Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS. - */ -struct reg { - __uint32_t r_fs; - __uint32_t r_es; - __uint32_t r_ds; - __uint32_t r_edi; - __uint32_t r_esi; - __uint32_t r_ebp; - __uint32_t r_isp; - __uint32_t r_ebx; - __uint32_t r_edx; - __uint32_t r_ecx; - __uint32_t r_eax; - __uint32_t r_trapno; - __uint32_t r_err; - __uint32_t r_eip; - __uint32_t r_cs; - __uint32_t r_eflags; - __uint32_t r_esp; - __uint32_t r_ss; - __uint32_t r_gs; -}; - -/* - * Register set accessible via /proc/$pid/fpregs. - */ -struct fpreg { - /* - * XXX should get struct from npx.h. Here we give a slightly - * simplified struct. This may be too much detail. Perhaps - * an array of unsigned longs is best. - */ - __uint32_t fpr_env[7]; - __uint8_t fpr_acc[8][10]; - __uint32_t fpr_ex_sw; - __uint8_t fpr_pad[64]; -}; - -struct xmmreg { - /* - * XXX should get struct from npx.h. Here we give a slightly - * simplified struct. This may be too much detail. Perhaps - * an array of unsigned longs is best. - */ - __uint32_t xmm_env[8]; - __uint8_t xmm_acc[8][16]; - __uint8_t xmm_reg[8][16]; - __uint8_t xmm_pad[224]; -}; - -/* - * Register set accessible via /proc/$pid/dbregs. - */ -struct dbreg { - __uint32_t dr[8]; /* debug registers */ - /* Index 0-3: debug address registers */ - /* Index 4-5: reserved */ - /* Index 6: debug status */ - /* Index 7: debug control */ -}; - -#define DBREG_DR7_LOCAL_ENABLE 0x01 -#define DBREG_DR7_GLOBAL_ENABLE 0x02 -#define DBREG_DR7_LEN_1 0x00 /* 1 byte length */ -#define DBREG_DR7_LEN_2 0x01 -#define DBREG_DR7_LEN_4 0x03 -#define DBREG_DR7_EXEC 0x00 /* break on execute */ -#define DBREG_DR7_WRONLY 0x01 /* break on write */ -#define DBREG_DR7_RDWR 0x03 /* break on read or write */ -#define DBREG_DR7_MASK(i) (0xf << ((i) * 4 + 16) | 0x3 << (i) * 2) -#define DBREG_DR7_SET(i, len, access, enable) \ - (((len) << 2 | (access)) << ((i) * 4 + 16) | (enable) << (i) * 2) -#define DBREG_DR7_GD 0x2000 -#define DBREG_DR7_ENABLED(d, i) (((d) & 0x3 << (i) * 2) != 0) -#define DBREG_DR7_ACCESS(d, i) ((d) >> ((i) * 4 + 16) & 0x3) -#define DBREG_DR7_LEN(d, i) ((d) >> ((i) * 4 + 18) & 0x3) - -#define DBREG_DRX(d,x) ((d)->dr[(x)]) /* reference dr0 - dr7 by - register number */ - -#ifdef _KERNEL -/* - * XXX these interfaces are MI, so they should be declared in a MI place. - */ -int fill_regs(struct thread *, struct reg *); -int fill_frame_regs(struct trapframe *, struct reg *); -int set_regs(struct thread *, struct reg *); -int fill_fpregs(struct thread *, struct fpreg *); -int set_fpregs(struct thread *, struct fpreg *); -int fill_dbregs(struct thread *, struct dbreg *); -int set_dbregs(struct thread *, struct dbreg *); -#endif - -#endif /* !_MACHINE_REG_H_ */ +#include Modified: head/sys/pc98/include/reg.h ============================================================================== --- head/sys/pc98/include/reg.h Sun Mar 18 18:44:42 2012 (r233123) +++ head/sys/pc98/include/reg.h Sun Mar 18 19:06:38 2012 (r233124) @@ -3,4 +3,4 @@ */ /* $FreeBSD$ */ -#include +#include Copied and modified: head/sys/x86/include/reg.h (from r233123, head/sys/i386/include/reg.h) ============================================================================== --- head/sys/i386/include/reg.h Sun Mar 18 18:44:42 2012 (r233123, copy source) +++ head/sys/x86/include/reg.h Sun Mar 18 19:06:38 2012 (r233124) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2003 Peter Wemm. * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * @@ -38,6 +39,7 @@ #include +#ifdef __i386__ /* * Indices for registers in `struct trapframe' and `struct regs'. * @@ -75,11 +77,26 @@ * to or from a `struct regs'. */ #define tGS (18) +#endif /* __i386__ */ + +/* Rename the structs below depending on the machine architecture. */ +#ifdef __i386__ +#define __reg32 reg +#define __fpreg32 fpreg +#define __dbreg32 dbreg +#else +#define __reg32 reg32 +#define __reg64 reg +#define __fpreg32 fpreg32 +#define __fpreg64 fpreg +#define __dbreg32 dbreg32 +#define __dbreg64 dbreg +#endif /* * Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS. */ -struct reg { +struct __reg32 { __uint32_t r_fs; __uint32_t r_es; __uint32_t r_ds; @@ -101,21 +118,59 @@ struct reg { __uint32_t r_gs; }; +struct __reg64 { + __int64_t r_r15; + __int64_t r_r14; + __int64_t r_r13; + __int64_t r_r12; + __int64_t r_r11; + __int64_t r_r10; + __int64_t r_r9; + __int64_t r_r8; + __int64_t r_rdi; + __int64_t r_rsi; + __int64_t r_rbp; + __int64_t r_rbx; + __int64_t r_rdx; + __int64_t r_rcx; + __int64_t r_rax; + __uint32_t r_trapno; + __uint16_t r_fs; + __uint16_t r_gs; + __uint32_t r_err; + __uint16_t r_es; + __uint16_t r_ds; + __int64_t r_rip; + __int64_t r_cs; + __int64_t r_rflags; + __int64_t r_rsp; + __int64_t r_ss; +}; + /* * Register set accessible via /proc/$pid/fpregs. + * + * XXX should get struct from fpu.h. Here we give a slightly + * simplified struct. This may be too much detail. Perhaps + * an array of unsigned longs is best. */ -struct fpreg { - /* - * XXX should get struct from npx.h. Here we give a slightly - * simplified struct. This may be too much detail. Perhaps - * an array of unsigned longs is best. - */ +struct __fpreg32 { __uint32_t fpr_env[7]; __uint8_t fpr_acc[8][10]; __uint32_t fpr_ex_sw; __uint8_t fpr_pad[64]; }; +struct __fpreg64 { + __uint64_t fpr_env[4]; + __uint8_t fpr_acc[8][16]; + __uint8_t fpr_xacc[16][16]; + __uint64_t fpr_spare[12]; +}; + +/* + * Register set accessible via PT_GETXMMREGS (i386). + */ struct xmmreg { /* * XXX should get struct from npx.h. Here we give a slightly @@ -131,7 +186,7 @@ struct xmmreg { /* * Register set accessible via /proc/$pid/dbregs. */ -struct dbreg { +struct __dbreg32 { __uint32_t dr[8]; /* debug registers */ /* Index 0-3: debug address registers */ /* Index 4-5: reserved */ @@ -139,17 +194,29 @@ struct dbreg { /* Index 7: debug control */ }; +struct __dbreg64 { + __uint64_t dr[16]; /* debug registers */ + /* Index 0-3: debug address registers */ + /* Index 4-5: reserved */ + /* Index 6: debug status */ + /* Index 7: debug control */ + /* Index 8-15: reserved */ +}; + #define DBREG_DR7_LOCAL_ENABLE 0x01 #define DBREG_DR7_GLOBAL_ENABLE 0x02 #define DBREG_DR7_LEN_1 0x00 /* 1 byte length */ #define DBREG_DR7_LEN_2 0x01 #define DBREG_DR7_LEN_4 0x03 +#define DBREG_DR7_LEN_8 0x02 #define DBREG_DR7_EXEC 0x00 /* break on execute */ #define DBREG_DR7_WRONLY 0x01 /* break on write */ #define DBREG_DR7_RDWR 0x03 /* break on read or write */ -#define DBREG_DR7_MASK(i) (0xf << ((i) * 4 + 16) | 0x3 << (i) * 2) +#define DBREG_DR7_MASK(i) \ + ((__u_register_t)(0xf) << ((i) * 4 + 16) | 0x3 << (i) * 2) #define DBREG_DR7_SET(i, len, access, enable) \ - (((len) << 2 | (access)) << ((i) * 4 + 16) | (enable) << (i) * 2) + ((__u_register_t)((len) << 2 | (access)) << ((i) * 4 + 16) | \ + (enable) << (i) * 2) #define DBREG_DR7_GD 0x2000 #define DBREG_DR7_ENABLED(d, i) (((d) & 0x3 << (i) * 2) != 0) #define DBREG_DR7_ACCESS(d, i) ((d) >> ((i) * 4 + 16) & 0x3) @@ -158,6 +225,18 @@ struct dbreg { #define DBREG_DRX(d,x) ((d)->dr[(x)]) /* reference dr0 - dr7 by register number */ +#undef __reg32 +#undef __reg64 +#undef __fpreg32 +#undef __fpreg64 +#undef __dbreg32 +#undef __dbreg64 + +#ifdef COMPAT_FREEBSD32 +#include +#include +#endif + #ifdef _KERNEL /* * XXX these interfaces are MI, so they should be declared in a MI place. From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 19:12:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5908A106566C; Sun, 18 Mar 2012 19:12:12 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4285F8FC08; Sun, 18 Mar 2012 19:12:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IJCCg6032187; Sun, 18 Mar 2012 19:12:12 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IJCCwj032182; Sun, 18 Mar 2012 19:12:12 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203181912.q2IJCCwj032182@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 18 Mar 2012 19:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233125 - in head/sys: amd64/ia32 compat/ia32 ia64/ia32 ia64/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 19:12:12 -0000 Author: tijl Date: Sun Mar 18 19:12:11 2012 New Revision: 233125 URL: http://svn.freebsd.org/changeset/base/233125 Log: Eliminate ia32_reg.h by moving its contents to x86 and ia64 reg.h. Reviewed by: kib Deleted: head/sys/compat/ia32/ia32_reg.h Modified: head/sys/amd64/ia32/ia32_reg.c head/sys/ia64/ia32/ia32_reg.c head/sys/ia64/include/reg.h head/sys/x86/include/reg.h Modified: head/sys/amd64/ia32/ia32_reg.c ============================================================================== --- head/sys/amd64/ia32/ia32_reg.c Sun Mar 18 19:06:38 2012 (r233124) +++ head/sys/amd64/ia32/ia32_reg.c Sun Mar 18 19:12:11 2012 (r233125) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/ia64/ia32/ia32_reg.c ============================================================================== --- head/sys/ia64/ia32/ia32_reg.c Sun Mar 18 19:06:38 2012 (r233124) +++ head/sys/ia64/ia32/ia32_reg.c Sun Mar 18 19:12:11 2012 (r233125) @@ -27,13 +27,13 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include #include -#include - int fill_regs32(struct thread *td, struct reg32 *regs) { Modified: head/sys/ia64/include/reg.h ============================================================================== --- head/sys/ia64/include/reg.h Sun Mar 18 19:06:38 2012 (r233124) +++ head/sys/ia64/include/reg.h Sun Mar 18 19:12:11 2012 (r233125) @@ -31,9 +31,27 @@ #include -#if defined(_KERNEL) && !defined(_STANDALONE) -#include "opt_compat.h" -#endif +struct reg32 { + unsigned int r_fs; + unsigned int r_es; + unsigned int r_ds; + unsigned int r_edi; + unsigned int r_esi; + unsigned int r_ebp; + unsigned int r_isp; + unsigned int r_ebx; + unsigned int r_edx; + unsigned int r_ecx; + unsigned int r_eax; + unsigned int r_trapno; + unsigned int r_err; + unsigned int r_eip; + unsigned int r_cs; + unsigned int r_eflags; + unsigned int r_esp; + unsigned int r_ss; + unsigned int r_gs; +}; struct reg { struct _special r_special; @@ -41,22 +59,28 @@ struct reg { struct _caller_saved r_scratch; }; +struct fpreg32 { + unsigned int fpr_env[7]; + unsigned char fpr_acc[8][10]; + unsigned int fpr_ex_sw; + unsigned char fpr_pad[64]; +}; + struct fpreg { struct _callee_saved_fp fpr_preserved; struct _caller_saved_fp fpr_scratch; struct _high_fp fpr_high; }; +struct dbreg32 { + unsigned int dr[8]; +}; + struct dbreg { unsigned long dbr_data[8]; unsigned long dbr_inst[8]; }; -#ifdef COMPAT_FREEBSD32 -#include -#include -#endif - #ifdef _KERNEL struct thread; @@ -67,6 +91,14 @@ int fill_fpregs(struct thread *, struct int set_fpregs(struct thread *, struct fpreg *); int fill_dbregs(struct thread *, struct dbreg *); int set_dbregs(struct thread *, struct dbreg *); +#ifdef COMPAT_FREEBSD32 +int fill_regs32(struct thread *, struct reg32 *); +int set_regs32(struct thread *, struct reg32 *); +int fill_fpregs32(struct thread *, struct fpreg32 *); +int set_fpregs32(struct thread *, struct fpreg32 *); +int fill_dbregs32(struct thread *, struct dbreg32 *); +int set_dbregs32(struct thread *, struct dbreg32 *); +#endif #endif #endif /* _MACHINE_REG_H_ */ Modified: head/sys/x86/include/reg.h ============================================================================== --- head/sys/x86/include/reg.h Sun Mar 18 19:06:38 2012 (r233124) +++ head/sys/x86/include/reg.h Sun Mar 18 19:12:11 2012 (r233125) @@ -232,11 +232,6 @@ struct __dbreg64 { #undef __dbreg32 #undef __dbreg64 -#ifdef COMPAT_FREEBSD32 -#include -#include -#endif - #ifdef _KERNEL /* * XXX these interfaces are MI, so they should be declared in a MI place. @@ -248,6 +243,14 @@ int fill_fpregs(struct thread *, struct int set_fpregs(struct thread *, struct fpreg *); int fill_dbregs(struct thread *, struct dbreg *); int set_dbregs(struct thread *, struct dbreg *); +#ifdef COMPAT_FREEBSD32 +int fill_regs32(struct thread *, struct reg32 *); +int set_regs32(struct thread *, struct reg32 *); +int fill_fpregs32(struct thread *, struct fpreg32 *); +int set_fpregs32(struct thread *, struct fpreg32 *); +int fill_dbregs32(struct thread *, struct dbreg32 *); +int set_dbregs32(struct thread *, struct dbreg32 *); +#endif #endif #endif /* !_MACHINE_REG_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 19:13:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFEC5106566B; Sun, 18 Mar 2012 19:13:32 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC5008FC14; Sun, 18 Mar 2012 19:13:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IJDWdW032256; Sun, 18 Mar 2012 19:13:32 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IJDWGU032254; Sun, 18 Mar 2012 19:13:32 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201203181913.q2IJDWGU032254@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 18 Mar 2012 19:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233126 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 19:13:33 -0000 Author: jh Date: Sun Mar 18 19:13:32 2012 New Revision: 233126 URL: http://svn.freebsd.org/changeset/base/233126 Log: Cast wallclock.tv_sec to uint64_t to avoid overflow in the calculation. PR: kern/161552 Reviewed by: trasz Tested by: Nikos Vassiliadis MFC after: 1 week Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Sun Mar 18 19:12:11 2012 (r233125) +++ head/sys/kern/kern_racct.c Sun Mar 18 19:13:32 2012 (r233126) @@ -745,7 +745,8 @@ racctd(void) mtx_lock(&racct_lock); racct_set_locked(p, RACCT_CPU, runtime); racct_set_locked(p, RACCT_WALLCLOCK, - wallclock.tv_sec * 1000000 + wallclock.tv_usec); + (uint64_t)wallclock.tv_sec * 1000000 + + wallclock.tv_usec); mtx_unlock(&racct_lock); PROC_UNLOCK(p); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 19:15:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 111D4106566C; Sun, 18 Mar 2012 19:15:12 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0E128FC16; Sun, 18 Mar 2012 19:15:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IJFBIG032417; Sun, 18 Mar 2012 19:15:11 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IJFBaL032415; Sun, 18 Mar 2012 19:15:11 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203181915.q2IJFBaL032415@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 18 Mar 2012 19:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233127 - head/sys/compat/ia32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 19:15:12 -0000 Author: tijl Date: Sun Mar 18 19:15:11 2012 New Revision: 233127 URL: http://svn.freebsd.org/changeset/base/233127 Log: Remove some unnecessary includes. Modified: head/sys/compat/ia32/ia32_sysvec.c Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Sun Mar 18 19:13:32 2012 (r233126) +++ head/sys/compat/ia32/ia32_sysvec.c Sun Mar 18 19:15:11 2012 (r233127) @@ -69,15 +69,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef __amd64__ -#include -#include -#include -#else -#include -#include -#include -#endif #include #include #include From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 19:24:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ACE08106564A; Sun, 18 Mar 2012 19:24:12 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id 576F38FC17; Sun, 18 Mar 2012 19:24:12 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 1017A151C3F; Sun, 18 Mar 2012 21:23:59 +0200 (EET) Date: Sun, 18 Mar 2012 21:23:58 +0200 From: Jaakko Heinonen To: Kevin Lo Message-ID: <20120318192358.GA2279@a91-153-116-96.elisa-laajakaista.fi> References: <201203181503.q2IF32k2024186@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203181503.q2IF32k2024186@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r233120 - in stable/9/sys/fs: hpfs msdosfs ntfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 19:24:12 -0000 On 2012-03-18, Kevin Lo wrote: > MFC r232483: > > Clean up style(9) nits > Directory Properties: > stable/9/sys/fs/ (props changed) > stable/9/sys/fs/ntfs/ (props changed) This should have been merged to stable/9/sys/. Also, r232995 incorrectly recorded mergeinfo to stable/9/sys/fs/ntfs/. -- Jaakko From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 19:25:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF0D6106567C; Sun, 18 Mar 2012 19:25:38 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay012.isp.belgacom.be (mailrelay012.isp.belgacom.be [195.238.6.179]) by mx1.freebsd.org (Postfix) with ESMTP id 95C638FC22; Sun, 18 Mar 2012 19:25:37 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EAIU1Zk9bsV1u/2dsb2JhbABChT6xAYEIggkBAQUjMyMQCxQEKgICOR6IJwenUpEcj2aBFgSmEIJn Received: from 110.93-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.93.110]) by relay.skynet.be with ESMTP; 18 Mar 2012 20:25:35 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q2IJPYNm006216; Sun, 18 Mar 2012 20:25:34 +0100 (CET) (envelope-from tijl@coosemans.org) From: Tijl Coosemans To: src-committers@freebsd.org Date: Sun, 18 Mar 2012 20:25:25 +0100 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.7.3; i386; ; ) References: <201203181912.q2IJCCwj032182@svn.freebsd.org> In-Reply-To: <201203181912.q2IJCCwj032182@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3461237.WHTPOhDjKD"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201203182025.32111.tijl@coosemans.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r233125 - in head/sys: amd64/ia32 compat/ia32 ia64/ia32 ia64/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 19:25:38 -0000 --nextPart3461237.WHTPOhDjKD Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sunday 18 March 2012 20:12:12 Tijl Coosemans wrote: > Author: tijl > Date: Sun Mar 18 19:12:11 2012 > New Revision: 233125 > URL: http://svn.freebsd.org/changeset/base/233125 >=20 > Log: > Eliminate ia32_reg.h by moving its contents to x86 and ia64 reg.h. > =20 > Reviewed by: kib >=20 > Deleted: > head/sys/compat/ia32/ia32_reg.h > Modified: > head/sys/amd64/ia32/ia32_reg.c > head/sys/ia64/ia32/ia32_reg.c > head/sys/ia64/include/reg.h > head/sys/x86/include/reg.h >=20 > Modified: head/sys/amd64/ia32/ia32_reg.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/amd64/ia32/ia32_reg.c Sun Mar 18 19:06:38 2012 (r233124) > +++ head/sys/amd64/ia32/ia32_reg.c Sun Mar 18 19:12:11 2012 (r233125) > @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > #include > #include >=20 > Modified: head/sys/ia64/ia32/ia32_reg.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/ia64/ia32/ia32_reg.c Sun Mar 18 19:06:38 2012 (r233124) > +++ head/sys/ia64/ia32/ia32_reg.c Sun Mar 18 19:12:11 2012 (r233125) > @@ -27,13 +27,13 @@ > #include > __FBSDID("$FreeBSD$"); > =20 > +#include "opt_compat.h" > + > #include > #include > #include > #include > =20 > -#include > - > int > fill_regs32(struct thread *td, struct reg32 *regs) > { >=20 > Modified: head/sys/ia64/include/reg.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/ia64/include/reg.h Sun Mar 18 19:06:38 2012 (r233124) > +++ head/sys/ia64/include/reg.h Sun Mar 18 19:12:11 2012 (r233125) > @@ -31,9 +31,27 @@ > =20 > #include > =20 > -#if defined(_KERNEL) && !defined(_STANDALONE) > -#include "opt_compat.h" > -#endif > +struct reg32 { > + unsigned int r_fs; > + unsigned int r_es; > + unsigned int r_ds; > + unsigned int r_edi; > + unsigned int r_esi; > + unsigned int r_ebp; > + unsigned int r_isp; > + unsigned int r_ebx; > + unsigned int r_edx; > + unsigned int r_ecx; > + unsigned int r_eax; > + unsigned int r_trapno; > + unsigned int r_err; > + unsigned int r_eip; > + unsigned int r_cs; > + unsigned int r_eflags; > + unsigned int r_esp; > + unsigned int r_ss; > + unsigned int r_gs; > +}; > =20 > struct reg { > struct _special r_special; > @@ -41,22 +59,28 @@ struct reg { > struct _caller_saved r_scratch; > }; > =20 > +struct fpreg32 { > + unsigned int fpr_env[7]; > + unsigned char fpr_acc[8][10]; > + unsigned int fpr_ex_sw; > + unsigned char fpr_pad[64]; > +}; > + > struct fpreg { > struct _callee_saved_fp fpr_preserved; > struct _caller_saved_fp fpr_scratch; > struct _high_fp fpr_high; > }; > =20 > +struct dbreg32 { > + unsigned int dr[8]; > +}; > + > struct dbreg { > unsigned long dbr_data[8]; > unsigned long dbr_inst[8]; > }; > =20 > -#ifdef COMPAT_FREEBSD32 > -#include > -#include > -#endif > - > #ifdef _KERNEL > struct thread; > =20 > @@ -67,6 +91,14 @@ int fill_fpregs(struct thread *, struct=20 > int set_fpregs(struct thread *, struct fpreg *); > int fill_dbregs(struct thread *, struct dbreg *); > int set_dbregs(struct thread *, struct dbreg *); > +#ifdef COMPAT_FREEBSD32 > +int fill_regs32(struct thread *, struct reg32 *); > +int set_regs32(struct thread *, struct reg32 *); > +int fill_fpregs32(struct thread *, struct fpreg32 *); > +int set_fpregs32(struct thread *, struct fpreg32 *); > +int fill_dbregs32(struct thread *, struct dbreg32 *); > +int set_dbregs32(struct thread *, struct dbreg32 *); > +#endif > #endif > =20 > #endif /* _MACHINE_REG_H_ */ >=20 > Modified: head/sys/x86/include/reg.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/x86/include/reg.h Sun Mar 18 19:06:38 2012 (r233124) > +++ head/sys/x86/include/reg.h Sun Mar 18 19:12:11 2012 (r233125) > @@ -232,11 +232,6 @@ struct __dbreg64 { > #undef __dbreg32 > #undef __dbreg64 > =20 > -#ifdef COMPAT_FREEBSD32 > -#include > -#include > -#endif > - > #ifdef _KERNEL > /* > * XXX these interfaces are MI, so they should be declared in a MI place. I didn't want to move them to an MI place in this patch because it involves all other architectures, but this might be a good time to discuss what that MI place should be. > @@ -248,6 +243,14 @@ int fill_fpregs(struct thread *, struct=20 > int set_fpregs(struct thread *, struct fpreg *); > int fill_dbregs(struct thread *, struct dbreg *); > int set_dbregs(struct thread *, struct dbreg *); > +#ifdef COMPAT_FREEBSD32 > +int fill_regs32(struct thread *, struct reg32 *); > +int set_regs32(struct thread *, struct reg32 *); > +int fill_fpregs32(struct thread *, struct fpreg32 *); > +int set_fpregs32(struct thread *, struct fpreg32 *); > +int fill_dbregs32(struct thread *, struct dbreg32 *); > +int set_dbregs32(struct thread *, struct dbreg32 *); > +#endif > #endif > =20 > #endif /* !_MACHINE_REG_H_ */ >=20 --nextPart3461237.WHTPOhDjKD Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk9mNqsACgkQfoCS2CCgtiuTswD+I5VocfYe22S0cuN1Z3kmZiee atn0HhdzpsY/WmZoYjoA/2xQu5qU6gu2nKc1DfPAFZZcfSJDT/qQaGhWtgA9f64t =+3AF -----END PGP SIGNATURE----- --nextPart3461237.WHTPOhDjKD-- From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 19:28:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DBD11065676; Sun, 18 Mar 2012 19:28:53 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 493998FC12; Sun, 18 Mar 2012 19:28:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IJSrD8032845; Sun, 18 Mar 2012 19:28:53 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IJSrQl032843; Sun, 18 Mar 2012 19:28:53 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <201203181928.q2IJSrQl032843@svn.freebsd.org> From: Hartmut Brandt Date: Sun, 18 Mar 2012 19:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233128 - head/contrib/bsnmp/snmpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 19:28:53 -0000 Author: harti Date: Sun Mar 18 19:28:52 2012 New Revision: 233128 URL: http://svn.freebsd.org/changeset/base/233128 Log: memset() wants the size of the structure to clear, not the size of the pointer to it. Submitted by: Pawel Worach Modified: head/contrib/bsnmp/snmpd/main.c Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Sun Mar 18 19:15:11 2012 (r233127) +++ head/contrib/bsnmp/snmpd/main.c Sun Mar 18 19:28:52 2012 (r233128) @@ -2703,7 +2703,7 @@ bsnmpd_get_usm_stats(void) void bsnmpd_reset_usm_stats(void) { - memset(&snmpd_usmstats, 0, sizeof(&snmpd_usmstats)); + memset(&snmpd_usmstats, 0, sizeof(snmpd_usmstats)); } struct usm_user * From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 19:35:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 202131065673; Sun, 18 Mar 2012 19:35:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B33B8FC14; Sun, 18 Mar 2012 19:35:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IJZUdm033082; Sun, 18 Mar 2012 19:35:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IJZUbr033080; Sun, 18 Mar 2012 19:35:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203181935.q2IJZUbr033080@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 Mar 2012 19:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233129 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 19:35:31 -0000 Author: adrian Date: Sun Mar 18 19:35:30 2012 New Revision: 233129 URL: http://svn.freebsd.org/changeset/base/233129 Log: Add a missing endian conversion. Modified: head/sys/net80211/ieee80211_alq.h Modified: head/sys/net80211/ieee80211_alq.h ============================================================================== --- head/sys/net80211/ieee80211_alq.h Sun Mar 18 19:28:52 2012 (r233128) +++ head/sys/net80211/ieee80211_alq.h Sun Mar 18 19:35:30 2012 (r233129) @@ -27,7 +27,10 @@ #ifndef __IEEE80211_ALQ_H__ #define __IEEE80211_ALQ_H__ -#define IEEE80211_ALQ_PAYLOAD_SIZE 24 +/* + * 64 byte ieee80211_alq_rec size. + */ +#define IEEE80211_ALQ_PAYLOAD_SIZE 52 /* * timestamp @@ -50,4 +53,124 @@ struct ieee80211_alq_rec { extern void ieee80211_alq_log(struct ieee80211vap *vap, uint8_t op, u_char *p, int l); +/* + * Debugging entry points + */ + +/* + * This should be called by the driver on each RX frame. + */ +#define IEEE80211_ALQ_OP_RXFRAME 0x1 +#define IEEE80211_ALQ_OP_TXFRAME 0x2 +#define IEEE80211_ALQ_OP_TXCOMPLETE 0x3 +#define IEEE80211_ALQ_OP_TX_BAW 0x4 + +/* Driver-specific - for descriptor contents, etc */ +#define IEEE80211_ALQ_OP_RX_DESC 0x81 +#define IEEE80211_ALQ_OP_TX_DESC 0x82 +#define IEEE80211_ALQ_OP_TX_DESCCOMP 0x83 + +struct ieee80211_alq_rx_frame_struct { + uint64_t tsf; /* Network order */ + uintptr_t bf; /* Driver-specific buffer ptr */ + uint8_t rxq; /* Driver-specific RX queue */ + uint8_t pad[3]; /* Pad alignment */ + struct ieee80211_qosframe wh; /* XXX 4 bytes, QoS? */ +}; + +struct ieee80211_alq_tx_frame { + uint64_t tsf; /* Network order */ + uintptr_t bf; /* Driver-specific buffer ptr */ + uint32_t tx_flags; /* Driver-specific TX flags */ + uint8_t txq; /* Driver-specific TX queue */ + uint8_t pad[3]; /* Pad alignment */ + struct ieee80211_qosframe wh; /* XXX 4 bytes, QoS? */ +}; + +struct ieee80211_alq_tx_frame_complete { + uint64_t tsf; /* Network order */ + uintptr_t bf; /* Driver-specific buffer ptr */ + uint8_t txq; /* Driver-specific TX queue */ + uint8_t txstatus; /* driver-specific TX status */ + uint8_t pad[2]; /* Pad alignment */ + struct ieee80211_qosframe wh; /* XXX 4 bytes, QoS? */ +}; + + +/* + * This is used for frame RX. + */ +static inline void +ieee80211_alq_rx_frame(struct ieee80211vap *vap, + struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t rxq) +{ + struct ieee80211_alq_rx_frame_struct rf; + + memset(&rf, 0, sizeof(rf)); + rf.tsf = htole64(tsf); + rf.bf = (uintptr_t) bf; + rf.rxq = rxq; + memcpy(&rf.wh, wh, sizeof(struct ieee80211_qosframe)); + ieee80211_alq_log(vap, IEEE80211_ALQ_OP_RXFRAME, (char *) &rf, + sizeof(rf)); +} + +/* + * Frame TX scheduling + */ +static inline void +ieee80211_alq_tx_frame(struct ieee80211vap *vap, + struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t txq, + uint32_t tx_flags) +{ + +} + +/* + * Frame TX completion + */ +static inline void +ieee80211_alq_tx_frame_comp(struct ieee80211vap *vap, + struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t txq, + uint8_t tx_status) +{ + +} + +struct ieee80211_alq_tx_baw_note_struct { + uintptr_t bf; + uint8_t tid; + uint8_t what; + uint16_t baw; + uint16_t wnd; + uint16_t new_baw; +}; + +/* + * TX BAW noting - add, remove, etc + */ + +#define IEEE80211_ALQ_TX_BAW_ADD 0x1 +#define IEEE80211_ALQ_TX_BAW_COMPLETE 0x2 + +static inline void +ieee80211_alq_tx_baw_note(struct ieee80211vap *vap, + struct ieee80211_frame *wh, void *bf, uint8_t tid, uint8_t what, + uint16_t baw, uint16_t wnd, uint16_t new_baw) +{ + struct ieee80211_alq_tx_baw_note_struct tb; + + memset(&tb, 0, sizeof(tb)); + + tb.bf = (uintptr_t) bf; + tb.tid = tid; + tb.what = what; + tb.baw = htons(baw); + tb.wnd = htons(wnd); + tb.new_baw = htons(new_baw); + + ieee80211_alq_log(vap, IEEE80211_ALQ_OP_TX_BAW, (char *) &tb, + sizeof(tb)); +} + #endif /* __IEEE80211_ALQ_H__ */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 20:34:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2503106564A; Sun, 18 Mar 2012 20:34:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD8EA8FC14; Sun, 18 Mar 2012 20:34:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IKY1e4034906; Sun, 18 Mar 2012 20:34:01 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IKY1q3034903; Sun, 18 Mar 2012 20:34:01 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201203182034.q2IKY1q3034903@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 18 Mar 2012 20:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233130 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 20:34:02 -0000 Author: jilles Date: Sun Mar 18 20:34:01 2012 New Revision: 233130 URL: http://svn.freebsd.org/changeset/base/233130 Log: fts(3): Document cases where FTS_NOCHDIR is set implicitly. PR: docs/166091 Submitted by: Matthew Story MFC after: 1 week Modified: head/lib/libc/gen/fts.3 Modified: head/lib/libc/gen/fts.3 ============================================================================== --- head/lib/libc/gen/fts.3 Sun Mar 18 19:35:30 2012 (r233129) +++ head/lib/libc/gen/fts.3 Sun Mar 18 20:34:01 2012 (r233130) @@ -28,7 +28,7 @@ .\" @(#)fts.3 8.5 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd November 25, 2009 +.Dd March 18, 2012 .Dt FTS 3 .Os .Sh NAME @@ -798,3 +798,13 @@ functions were introduced in principally to provide for alternative interfaces to the .Nm functionality using different data structures. +.Sh BUGS +The +.Fn fts_open +function will automatically set the +.Dv FTS_NOCHDIR +option if the +.Dv FTS_LOGICAL +option is provided, or if it cannot +.Xr open 2 +the current directory. From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 21:19:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12379106566B; Sun, 18 Mar 2012 21:19:22 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F08A58FC12; Sun, 18 Mar 2012 21:19:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ILJLjY036295; Sun, 18 Mar 2012 21:19:21 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ILJLn0036293; Sun, 18 Mar 2012 21:19:21 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203182119.q2ILJLn0036293@svn.freebsd.org> From: Josh Paetzel Date: Sun, 18 Mar 2012 21:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233131 - head/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 21:19:22 -0000 Author: jpaetzel Date: Sun Mar 18 21:19:21 2012 New Revision: 233131 URL: http://svn.freebsd.org/changeset/base/233131 Log: Redirect camcontrol stderr to /dev/null. Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Sun Mar 18 20:34:01 2012 (r233130) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Sun Mar 18 21:19:21 2012 (r233131) @@ -86,7 +86,7 @@ do fi # Try and find some identification information with camcontrol or atacontrol - NEWLINE=$(camcontrol identify $DEV | sed -ne 's/^device model *//p') + NEWLINE=$(camcontrol identify $DEV 2>/dev/null | sed -ne 's/^device model *//p') if [ -z "$NEWLINE" ]; then # Now try atacontrol NEWLINE=$(atacontrol list 2>/dev/null | sed -n "s|^.*$DEV <\(.*\)>.*|\1|p") From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 21:29:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E47C106566C; Sun, 18 Mar 2012 21:29:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [176.9.45.25]) by mx1.freebsd.org (Postfix) with ESMTP id 24E488FC14; Sun, 18 Mar 2012 21:29:49 +0000 (UTC) Received: from core2.vx.sk (localhost [127.0.0.2]) by mail.vx.sk (Postfix) with ESMTP id 891D518C20; Sun, 18 Mar 2012 22:29:43 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by core2.vx.sk (amavisd-new, unix socket) with LMTP id 6USe9PoiR2Ur; Sun, 18 Mar 2012 22:29:41 +0100 (CET) Received: from [10.9.8.1] (188-167-78-15.dynamic.chello.sk [188.167.78.15]) by mail.vx.sk (Postfix) with ESMTPSA id 3A35B18C19; Sun, 18 Mar 2012 22:29:41 +0100 (CET) Message-ID: <4F6653C6.6020405@FreeBSD.org> Date: Sun, 18 Mar 2012 22:29:42 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Alexander Leidinger References: <201203162130.q2GLUQaw035726@svn.freebsd.org> <20120317163539.00004d8f@unknown> In-Reply-To: <20120317163539.00004d8f@unknown> X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, pjd@FreeBSD.org, jamie@FreeBSD.org Subject: Re: svn commit: r233048 - head/etc/defaults X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 21:29:50 -0000 On 17.3.2012 16:35, Alexander Leidinger wrote: > On Fri, 16 Mar 2012 21:30:26 +0000 (UTC) Martin Matuska > wrote: > >> Author: mm >> Date: Fri Mar 16 21:30:26 2012 >> New Revision: 233048 >> URL: http://svn.freebsd.org/changeset/base/233048 >> >> Log: >> Unhide /dev/zfs in devfsrules_jail. >> >> The /dev/zfs device is required for managing jailed ZFS datasets. > This may give more info to a jail (ZFS is in use on this machine) than > what someone may want to provide. I have separate rulesets for jails > without and with ZFS (actually the one without is the default one and > the one with is a new one): > ---snip--- > ... > > [devfsrules_unhide_zfs=12] > add path zfs unhide > > ... > > [devfsrules_jail_withzfs=16] > add include $devfsrules_hide_all > add include $devfsrules_unhide_basic > add include $devfsrules_unhide_login > add include $devfsrules_unhide_zfs > ---snip--- > > Anyone with arguments why this may be overly paranoid? If not, I would > suggest that we go this way instead. > > Bye, > Alexander. > The only disclosed information I know of is whether the zfs module is loaded on your system. Other alternative I was thinking of would be using a new ruleset (e.g. devfsrules_jail_zfs=5). The disadvantage here is that users that already have defined a ruleset with this number should be informed somehow. -- Martin Matuska FreeBSD committer http://blog.vx.sk From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 21:46:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C61CE1065676; Sun, 18 Mar 2012 21:46:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B17948FC16; Sun, 18 Mar 2012 21:46:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ILkRt6037122; Sun, 18 Mar 2012 21:46:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ILkR7a037120; Sun, 18 Mar 2012 21:46:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201203182146.q2ILkR7a037120@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 18 Mar 2012 21:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233132 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 21:46:27 -0000 Author: jilles Date: Sun Mar 18 21:46:27 2012 New Revision: 233132 URL: http://svn.freebsd.org/changeset/base/233132 Log: fts(3): Mention that FTS_NOCHDIR imposes {PATH_MAX} limits on the returned pathnames. With the current API (no *at functions), FTS_NOCHDIR requires that the fts_accpath start with the original path passed to fts_open(); therefore, the depth that can be reached is limited by the {PATH_MAX} constraint on this pathname. MFC after: 1 week Modified: head/lib/libc/gen/fts.3 Modified: head/lib/libc/gen/fts.3 ============================================================================== --- head/lib/libc/gen/fts.3 Sun Mar 18 21:19:21 2012 (r233131) +++ head/lib/libc/gen/fts.3 Sun Mar 18 21:46:27 2012 (r233132) @@ -419,14 +419,17 @@ be provided to the .Fn fts_open function. .It Dv FTS_NOCHDIR -As a performance optimization, the +To allow descending to arbitrary depths +(independent of +.Brq Dv PATH_MAX ) +and improve performance, the .Nm functions change directories as they walk the file hierarchy. This has the side-effect that an application cannot rely on being in any particular directory during the traversal. The .Dv FTS_NOCHDIR -option turns off this optimization, and the +option turns off this feature, and the .Nm functions will not change the current directory. Note that applications should not themselves change their current directory From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 21:50:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9963E106566B; Sun, 18 Mar 2012 21:50:16 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:150:6101::4]) by mx1.freebsd.org (Postfix) with ESMTP id 2CEF28FC12; Sun, 18 Mar 2012 21:50:16 +0000 (UTC) Received: from core2.vx.sk (localhost [127.0.0.2]) by mail.vx.sk (Postfix) with ESMTP id 2219619827; Sun, 18 Mar 2012 22:50:15 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by core2.vx.sk (amavisd-new, unix socket) with LMTP id l7tlPgApBQw0; Sun, 18 Mar 2012 22:50:13 +0100 (CET) Received: from [10.9.8.1] (188-167-78-15.dynamic.chello.sk [188.167.78.15]) by mail.vx.sk (Postfix) with ESMTPSA id DDB351981E; Sun, 18 Mar 2012 22:50:12 +0100 (CET) Message-ID: <4F665895.1050803@FreeBSD.org> Date: Sun, 18 Mar 2012 22:50:13 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Alexander Leidinger References: <201203162130.q2GLUQaw035726@svn.freebsd.org> <20120317163539.00004d8f@unknown> <4F6653C6.6020405@FreeBSD.org> In-Reply-To: <4F6653C6.6020405@FreeBSD.org> X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, pjd@FreeBSD.org, jamie@FreeBSD.org Subject: Re: svn commit: r233048 - head/etc/defaults X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 21:50:16 -0000 On 18.3.2012 22:29, Martin Matuska wrote: > On 17.3.2012 16:35, Alexander Leidinger wrote: >> On Fri, 16 Mar 2012 21:30:26 +0000 (UTC) Martin Matuska >> wrote: >> >>> Author: mm >>> Date: Fri Mar 16 21:30:26 2012 >>> New Revision: 233048 >>> URL: http://svn.freebsd.org/changeset/base/233048 >>> >>> Log: >>> Unhide /dev/zfs in devfsrules_jail. >>> >>> The /dev/zfs device is required for managing jailed ZFS datasets. >> This may give more info to a jail (ZFS is in use on this machine) than >> what someone may want to provide. I have separate rulesets for jails >> without and with ZFS (actually the one without is the default one and >> the one with is a new one): >> ---snip--- >> ... >> >> [devfsrules_unhide_zfs=12] >> add path zfs unhide >> >> ... >> >> [devfsrules_jail_withzfs=16] >> add include $devfsrules_hide_all >> add include $devfsrules_unhide_basic >> add include $devfsrules_unhide_login >> add include $devfsrules_unhide_zfs >> ---snip--- >> >> Anyone with arguments why this may be overly paranoid? If not, I would >> suggest that we go this way instead. >> >> Bye, >> Alexander. >> > The only disclosed information I know of is whether the zfs module is > loaded on your system. > Other alternative I was thinking of would be using a new ruleset (e.g. > devfsrules_jail_zfs=5). > The disadvantage here is that users that already have defined a ruleset > with this number should be informed somehow. > Btw. jail has access to sysctl(8) and this discloses a *LOT* of information, including if ZFS is loaded or not (existence of vfs.zfs) and all its settings and statistics, hardware devices, geom devices, network card counters and many more. Compared to this is /dev/zfs really a minor issue :-) Until we limit the output of sysctl() we don't hide this information just by hiding /dev/zfs. -- Martin Matuska FreeBSD committer http://blog.vx.sk From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 21:51:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 48A9F106566C; Sun, 18 Mar 2012 21:51:57 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0E6968FC19; Sun, 18 Mar 2012 21:51:56 +0000 (UTC) Received: by dald2 with SMTP id d2so9575797dal.13 for ; Sun, 18 Mar 2012 14:51:56 -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 :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=w6BMnMoQFS5mhZhLX7Ink2+F2K4MoLvhm03kI/6PZkk=; b=p4Ool/XnlosTB+r5xSbhFfR6AR6UmlmLxgifN6oqb+arTKGUAVTTOonyA9FVRTOc0M Vw2PSDe0Qa6Ma20EpqvHis4NFxP7yTbVgevPJ0C5GqxKX7GT2Ls8syR7TlIEtq2ZT5aH pL2b6svNU4mT4Q8d3uK7RWi/F4OoxlbEaYFeUZt+IIRC6oFeJE8jjWPdEWWH/AqTTuDU eNXJyjqpSIXOJTcp5yKcbTTjZtgPI+UrQ2hstRqINKEp2aeTVSXq/9am9IsUMT92jvxa d4oN6VdzMRMb3dMQyjVGbwcqiZhRZMIMpmazlkNoqOj7LoHT8xZKCGiSaqBx8y2ePBDj lxcg== MIME-Version: 1.0 Received: by 10.68.232.2 with SMTP id tk2mr34560580pbc.68.1332107516552; Sun, 18 Mar 2012 14:51:56 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.143.33.5 with HTTP; Sun, 18 Mar 2012 14:51:56 -0700 (PDT) In-Reply-To: <201203181935.q2IJZUbr033080@svn.freebsd.org> References: <201203181935.q2IJZUbr033080@svn.freebsd.org> Date: Sun, 18 Mar 2012 14:51:56 -0700 X-Google-Sender-Auth: XSt2xATcx2j206eZaOyPfuilgqo Message-ID: From: Adrian Chadd To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r233129 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 21:51:57 -0000 pointy-hat to me, sorry! *grumbles* Adrian On 18 March 2012 12:35, Adrian Chadd wrote: > Author: adrian > Date: Sun Mar 18 19:35:30 2012 > New Revision: 233129 > URL: http://svn.freebsd.org/changeset/base/233129 > > Log: > =A0Add a missing endian conversion. > > Modified: > =A0head/sys/net80211/ieee80211_alq.h > > Modified: head/sys/net80211/ieee80211_alq.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/net80211/ieee80211_alq.h =A0 Sun Mar 18 19:28:52 2012 =A0 = =A0 =A0 =A0(r233128) > +++ head/sys/net80211/ieee80211_alq.h =A0 Sun Mar 18 19:35:30 2012 =A0 = =A0 =A0 =A0(r233129) > @@ -27,7 +27,10 @@ > =A0#ifndef =A0 =A0 =A0 =A0__IEEE80211_ALQ_H__ > =A0#define =A0 =A0 =A0 =A0__IEEE80211_ALQ_H__ > > -#define =A0 =A0 =A0 =A0IEEE80211_ALQ_PAYLOAD_SIZE =A0 =A0 =A024 > +/* > + * 64 byte ieee80211_alq_rec size. > + */ > +#define =A0 =A0 =A0 =A0IEEE80211_ALQ_PAYLOAD_SIZE =A0 =A0 =A052 > > =A0/* > =A0* timestamp > @@ -50,4 +53,124 @@ struct ieee80211_alq_rec { > =A0extern void ieee80211_alq_log(struct ieee80211vap *vap, uint8_t op, > =A0 =A0 =A0 =A0 =A0 =A0u_char *p, int l); > > +/* > + * Debugging entry points > + */ > + > +/* > + * This should be called by the driver on each RX frame. > + */ > +#define =A0 =A0 =A0 =A0IEEE80211_ALQ_OP_RXFRAME =A0 =A0 =A0 =A00x1 > +#define =A0 =A0 =A0 =A0IEEE80211_ALQ_OP_TXFRAME =A0 =A0 =A0 =A00x2 > +#define =A0 =A0 =A0 =A0IEEE80211_ALQ_OP_TXCOMPLETE =A0 =A0 0x3 > +#define =A0 =A0 =A0 =A0IEEE80211_ALQ_OP_TX_BAW =A0 =A0 =A0 =A0 0x4 > + > +/* Driver-specific - for descriptor contents, etc */ > +#define =A0 =A0 =A0 =A0IEEE80211_ALQ_OP_RX_DESC =A0 =A0 =A0 =A00x81 > +#define =A0 =A0 =A0 =A0IEEE80211_ALQ_OP_TX_DESC =A0 =A0 =A0 =A00x82 > +#define =A0 =A0 =A0 =A0IEEE80211_ALQ_OP_TX_DESCCOMP =A0 =A00x83 > + > +struct ieee80211_alq_rx_frame_struct { > + =A0 =A0 =A0 uint64_t =A0 =A0 =A0 =A0tsf; =A0 =A0/* Network order */ > + =A0 =A0 =A0 uintptr_t =A0 =A0 =A0 bf; =A0 =A0 /* Driver-specific buffer= ptr */ > + =A0 =A0 =A0 uint8_t =A0 =A0 =A0 =A0 rxq; =A0 =A0/* Driver-specific RX q= ueue */ > + =A0 =A0 =A0 uint8_t =A0 =A0 =A0 =A0 pad[3]; /* Pad alignment */ > + =A0 =A0 =A0 struct ieee80211_qosframe wh; =A0 /* XXX 4 bytes, QoS? */ > +}; > + > +struct ieee80211_alq_tx_frame { > + =A0 =A0 =A0 uint64_t =A0 =A0 =A0 =A0tsf; =A0 =A0/* Network order */ > + =A0 =A0 =A0 uintptr_t =A0 =A0 =A0 bf; =A0 =A0 /* Driver-specific buffer= ptr */ > + =A0 =A0 =A0 uint32_t =A0 =A0 =A0 =A0tx_flags; =A0 =A0 =A0 /* Driver-spe= cific TX flags */ > + =A0 =A0 =A0 uint8_t =A0 =A0 =A0 =A0 txq; =A0 =A0/* Driver-specific TX q= ueue */ > + =A0 =A0 =A0 uint8_t =A0 =A0 =A0 =A0 pad[3]; /* Pad alignment */ > + =A0 =A0 =A0 struct ieee80211_qosframe wh; =A0 /* XXX 4 bytes, QoS? */ > +}; > + > +struct ieee80211_alq_tx_frame_complete { > + =A0 =A0 =A0 uint64_t =A0 =A0 =A0 =A0tsf; =A0 =A0/* Network order */ > + =A0 =A0 =A0 uintptr_t =A0 =A0 =A0 bf; =A0 =A0 /* Driver-specific buffer= ptr */ > + =A0 =A0 =A0 uint8_t =A0 =A0 =A0 =A0 txq; =A0 =A0/* Driver-specific TX q= ueue */ > + =A0 =A0 =A0 uint8_t =A0 =A0 =A0 =A0 txstatus; =A0 =A0 =A0 /* driver-spe= cific TX status */ > + =A0 =A0 =A0 uint8_t =A0 =A0 =A0 =A0 pad[2]; /* Pad alignment */ > + =A0 =A0 =A0 struct ieee80211_qosframe wh; =A0 /* XXX 4 bytes, QoS? */ > +}; > + > + > +/* > + * This is used for frame RX. > + */ > +static inline void > +ieee80211_alq_rx_frame(struct ieee80211vap *vap, > + =A0 =A0struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t rxq) > +{ > + =A0 =A0 =A0 struct ieee80211_alq_rx_frame_struct rf; > + > + =A0 =A0 =A0 memset(&rf, 0, sizeof(rf)); > + =A0 =A0 =A0 rf.tsf =3D htole64(tsf); > + =A0 =A0 =A0 rf.bf =3D (uintptr_t) bf; > + =A0 =A0 =A0 rf.rxq =3D rxq; > + =A0 =A0 =A0 memcpy(&rf.wh, wh, sizeof(struct ieee80211_qosframe)); > + =A0 =A0 =A0 ieee80211_alq_log(vap, IEEE80211_ALQ_OP_RXFRAME, (char *) &= rf, > + =A0 =A0 =A0 =A0 =A0 sizeof(rf)); > +} > + > +/* > + * Frame TX scheduling > + */ > +static inline void > +ieee80211_alq_tx_frame(struct ieee80211vap *vap, > + =A0 =A0struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t txq, > + =A0 =A0uint32_t tx_flags) > +{ > + > +} > + > +/* > + * Frame TX completion > + */ > +static inline void > +ieee80211_alq_tx_frame_comp(struct ieee80211vap *vap, > + =A0 =A0struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t txq, > + =A0 =A0uint8_t tx_status) > +{ > + > +} > + > +struct ieee80211_alq_tx_baw_note_struct { > + =A0 =A0 =A0 uintptr_t =A0 =A0 =A0 bf; > + =A0 =A0 =A0 uint8_t =A0 =A0 =A0 =A0 tid; > + =A0 =A0 =A0 uint8_t =A0 =A0 =A0 =A0 what; > + =A0 =A0 =A0 uint16_t =A0 =A0 =A0 =A0baw; > + =A0 =A0 =A0 uint16_t =A0 =A0 =A0 =A0wnd; > + =A0 =A0 =A0 uint16_t =A0 =A0 =A0 =A0new_baw; > +}; > + > +/* > + * TX BAW noting - add, remove, etc > + */ > + > +#define =A0 =A0 =A0 =A0IEEE80211_ALQ_TX_BAW_ADD =A0 =A0 =A0 =A00x1 > +#define =A0 =A0 =A0 =A0IEEE80211_ALQ_TX_BAW_COMPLETE =A0 0x2 > + > +static inline void > +ieee80211_alq_tx_baw_note(struct ieee80211vap *vap, > + =A0 =A0struct ieee80211_frame *wh, void *bf, uint8_t tid, uint8_t what, > + =A0 =A0uint16_t baw, uint16_t wnd, uint16_t new_baw) > +{ > + =A0 =A0 =A0 struct ieee80211_alq_tx_baw_note_struct tb; > + > + =A0 =A0 =A0 memset(&tb, 0, sizeof(tb)); > + > + =A0 =A0 =A0 tb.bf =3D (uintptr_t) bf; > + =A0 =A0 =A0 tb.tid =3D tid; > + =A0 =A0 =A0 tb.what =3D what; > + =A0 =A0 =A0 tb.baw =3D htons(baw); > + =A0 =A0 =A0 tb.wnd =3D htons(wnd); > + =A0 =A0 =A0 tb.new_baw =3D htons(new_baw); > + > + =A0 =A0 =A0 ieee80211_alq_log(vap, IEEE80211_ALQ_OP_TX_BAW, (char *) &t= b, > + =A0 =A0 =A0 =A0 =A0 sizeof(tb)); > +} > + > =A0#endif /* __IEEE80211_ALQ_H__ */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 21:55:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 402C0106566C; Sun, 18 Mar 2012 21:55:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B7F38FC0C; Sun, 18 Mar 2012 21:55:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ILt0f5037414; Sun, 18 Mar 2012 21:55:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ILsxPf037412; Sun, 18 Mar 2012 21:54:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203182154.q2ILsxPf037412@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 Mar 2012 21:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233133 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 21:55:00 -0000 Author: adrian Date: Sun Mar 18 21:54:59 2012 New Revision: 233133 URL: http://svn.freebsd.org/changeset/base/233133 Log: .. revert out a local change that I hadn't yet completely finished fleshing out and testing. sorry! Modified: head/sys/net80211/ieee80211_alq.h Modified: head/sys/net80211/ieee80211_alq.h ============================================================================== --- head/sys/net80211/ieee80211_alq.h Sun Mar 18 21:46:27 2012 (r233132) +++ head/sys/net80211/ieee80211_alq.h Sun Mar 18 21:54:59 2012 (r233133) @@ -27,10 +27,7 @@ #ifndef __IEEE80211_ALQ_H__ #define __IEEE80211_ALQ_H__ -/* - * 64 byte ieee80211_alq_rec size. - */ -#define IEEE80211_ALQ_PAYLOAD_SIZE 52 +#define IEEE80211_ALQ_PAYLOAD_SIZE 24 /* * timestamp @@ -53,124 +50,4 @@ struct ieee80211_alq_rec { extern void ieee80211_alq_log(struct ieee80211vap *vap, uint8_t op, u_char *p, int l); -/* - * Debugging entry points - */ - -/* - * This should be called by the driver on each RX frame. - */ -#define IEEE80211_ALQ_OP_RXFRAME 0x1 -#define IEEE80211_ALQ_OP_TXFRAME 0x2 -#define IEEE80211_ALQ_OP_TXCOMPLETE 0x3 -#define IEEE80211_ALQ_OP_TX_BAW 0x4 - -/* Driver-specific - for descriptor contents, etc */ -#define IEEE80211_ALQ_OP_RX_DESC 0x81 -#define IEEE80211_ALQ_OP_TX_DESC 0x82 -#define IEEE80211_ALQ_OP_TX_DESCCOMP 0x83 - -struct ieee80211_alq_rx_frame_struct { - uint64_t tsf; /* Network order */ - uintptr_t bf; /* Driver-specific buffer ptr */ - uint8_t rxq; /* Driver-specific RX queue */ - uint8_t pad[3]; /* Pad alignment */ - struct ieee80211_qosframe wh; /* XXX 4 bytes, QoS? */ -}; - -struct ieee80211_alq_tx_frame { - uint64_t tsf; /* Network order */ - uintptr_t bf; /* Driver-specific buffer ptr */ - uint32_t tx_flags; /* Driver-specific TX flags */ - uint8_t txq; /* Driver-specific TX queue */ - uint8_t pad[3]; /* Pad alignment */ - struct ieee80211_qosframe wh; /* XXX 4 bytes, QoS? */ -}; - -struct ieee80211_alq_tx_frame_complete { - uint64_t tsf; /* Network order */ - uintptr_t bf; /* Driver-specific buffer ptr */ - uint8_t txq; /* Driver-specific TX queue */ - uint8_t txstatus; /* driver-specific TX status */ - uint8_t pad[2]; /* Pad alignment */ - struct ieee80211_qosframe wh; /* XXX 4 bytes, QoS? */ -}; - - -/* - * This is used for frame RX. - */ -static inline void -ieee80211_alq_rx_frame(struct ieee80211vap *vap, - struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t rxq) -{ - struct ieee80211_alq_rx_frame_struct rf; - - memset(&rf, 0, sizeof(rf)); - rf.tsf = htole64(tsf); - rf.bf = (uintptr_t) bf; - rf.rxq = rxq; - memcpy(&rf.wh, wh, sizeof(struct ieee80211_qosframe)); - ieee80211_alq_log(vap, IEEE80211_ALQ_OP_RXFRAME, (char *) &rf, - sizeof(rf)); -} - -/* - * Frame TX scheduling - */ -static inline void -ieee80211_alq_tx_frame(struct ieee80211vap *vap, - struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t txq, - uint32_t tx_flags) -{ - -} - -/* - * Frame TX completion - */ -static inline void -ieee80211_alq_tx_frame_comp(struct ieee80211vap *vap, - struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t txq, - uint8_t tx_status) -{ - -} - -struct ieee80211_alq_tx_baw_note_struct { - uintptr_t bf; - uint8_t tid; - uint8_t what; - uint16_t baw; - uint16_t wnd; - uint16_t new_baw; -}; - -/* - * TX BAW noting - add, remove, etc - */ - -#define IEEE80211_ALQ_TX_BAW_ADD 0x1 -#define IEEE80211_ALQ_TX_BAW_COMPLETE 0x2 - -static inline void -ieee80211_alq_tx_baw_note(struct ieee80211vap *vap, - struct ieee80211_frame *wh, void *bf, uint8_t tid, uint8_t what, - uint16_t baw, uint16_t wnd, uint16_t new_baw) -{ - struct ieee80211_alq_tx_baw_note_struct tb; - - memset(&tb, 0, sizeof(tb)); - - tb.bf = (uintptr_t) bf; - tb.tid = tid; - tb.what = what; - tb.baw = htons(baw); - tb.wnd = htons(wnd); - tb.new_baw = htons(new_baw); - - ieee80211_alq_log(vap, IEEE80211_ALQ_OP_TX_BAW, (char *) &tb, - sizeof(tb)); -} - #endif /* __IEEE80211_ALQ_H__ */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 23:16:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D98F1065688; Sun, 18 Mar 2012 23:16:23 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6D4248FC15; Sun, 18 Mar 2012 23:16:22 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so5443483bkc.13 for ; Sun, 18 Mar 2012 16:16: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=oC5YS86OyosJCMp6gRea85f1UzMmykW/nPvWcAsnypo=; b=RyMMgf1MWAW0BojnAISXRH0MkNPuBG9hhC8B44RMXZ5bEeLoSkZ+7PgKklQgeTI+73 N2vY8r9XP8MDax7PDQ6IfOSgVz5elXKbdja5vJcGeE4vrhYjuJ0kl+ZC6naC7Og6H4qP fP2KiUrMw2jwM6gZ3BoWTyaSL41AmqPvdRStfLbC1+h/T3ZZ/kvev8OOHCQIBWcO4MAj 4GivIvVGZiR/NJ4x/3BBwVgenGNy+/MDsTqJsIgXUarMNLImenW0SmP2lkPjRS+QB/vV bxcSqTQXcWFLlYoMGNmt3jGbjRpEyGOXhrf0wbPvoHIUAG7WVr7YPV4jCNlV+sWczdQY 0MGA== MIME-Version: 1.0 Received: by 10.204.132.80 with SMTP id a16mr3848595bkt.18.1332112581387; Sun, 18 Mar 2012 16:16:21 -0700 (PDT) Received: by 10.204.202.142 with HTTP; Sun, 18 Mar 2012 16:16:21 -0700 (PDT) Received: by 10.204.202.142 with HTTP; Sun, 18 Mar 2012 16:16:21 -0700 (PDT) In-Reply-To: <1331852174.8403.12.camel@revolution.hippie.lan> References: <201203141622.q2EGM9HR021407@svn.freebsd.org> <1331852174.8403.12.camel@revolution.hippie.lan> Date: Sun, 18 Mar 2012 23:16:21 +0000 Message-ID: From: Chris Rees To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Ed Schouten Subject: Re: svn commit: r232977 - in head: etc sbin/init X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 23:16:23 -0000 On 15 Mar 2012 22:57, "Ian Lepore" wrote: > > On Wed, 2012-03-14 at 16:22 +0000, Ed Schouten wrote: > > Author: ed > > Date: Wed Mar 14 16:22:09 2012 > > New Revision: 232977 > > URL: http://svn.freebsd.org/changeset/base/232977 > > > > Log: > > Make init(8) slightly more robust when /dev/console is missing. > > > > If the environment doesn't offer a working /dev/console, the existing > > version of init(8) will simply refuse running rc(8) scripts. This means > > you'll only have a system running init(8) and nothing else. > > > > Change the code to do the following: > > > > - Open /dev/console like we used to do, but make it more robust to use > > O_NONBLOCK to prevent blocking on a carrier. > > - If this fails, use /dev/null as stdin and /var/log/init.log as stdout > > and stderr. > > Given that the /var filesystem is mounted (and with readonly root, > actually created) by an rc script run by init, does this make sense? > Maybe it makes sense only within a jail, but not when running as pid 1? > > > - If even this fails, use /dev/null as stdin, stdout and stderr. > > > > So why us this useful? Well, if you remove the `getpid() == 1' check in > > main(), you can now use init(8) inside jails to properly execute rc(8). > > It still requires some polishing, as existing tools assume init(8) has > > PID 1. > > Not just existing tools, but 3rd party software is likely to contain > this assumption (I know some of ours does). The manpage for init > contains examples of using a hard-coded 1. Would it be practical for > any reference to pid 1 to get somehow magically redirected inside a jail > to the pid of an init process running within that jail? That's just a > pure blue-sky idea that popped into my head; I know almost nothing about > jails (their implementation or how to use them). > Not really. Processes are given a 'jailed' property, but apart from that are just regular processes. Also, faking PIDs like that will also hide the host (real) init.... though whether that is a problem or not is an exercise for the reader. Chris From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 00:07:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58CBE1065670; Mon, 19 Mar 2012 00:07:11 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 449F48FC0A; Mon, 19 Mar 2012 00:07:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J07BJp041523; Mon, 19 Mar 2012 00:07:11 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J07B5g041521; Mon, 19 Mar 2012 00:07:11 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201203190007.q2J07B5g041521@svn.freebsd.org> From: David Xu Date: Mon, 19 Mar 2012 00:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233134 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 00:07:11 -0000 Author: davidxu Date: Mon Mar 19 00:07:10 2012 New Revision: 233134 URL: http://svn.freebsd.org/changeset/base/233134 Log: Use clockid parameter instead of hard-coded CLOCK_REALTIME. Reported by: pjd Modified: head/lib/libthr/thread/thr_umtx.c Modified: head/lib/libthr/thread/thr_umtx.c ============================================================================== --- head/lib/libthr/thread/thr_umtx.c Sun Mar 18 21:54:59 2012 (r233133) +++ head/lib/libthr/thread/thr_umtx.c Mon Mar 19 00:07:10 2012 (r233134) @@ -202,7 +202,7 @@ _thr_umtx_timedwait_uint(volatile u_int tm_p = NULL; tm_size = 0; } else { - timeout._clockid = CLOCK_REALTIME; + timeout._clockid = clockid; timeout._flags = UMTX_ABSTIME; timeout._timeout = *abstime; tm_p = &timeout; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 00:36:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98F06106566B; Mon, 19 Mar 2012 00:36:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 844DB8FC0A; Mon, 19 Mar 2012 00:36:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J0aXjA042503; Mon, 19 Mar 2012 00:36:33 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J0aXUT042500; Mon, 19 Mar 2012 00:36:33 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190036.q2J0aXUT042500@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 00:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233135 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 00:36:33 -0000 Author: eadler Date: Mon Mar 19 00:36:32 2012 New Revision: 233135 URL: http://svn.freebsd.org/changeset/base/233135 Log: - Clean up timestamps in msgbuf code. The timestamps should now be inserted after the priority token thus cleaning up the output. - Remove the needless double internal do_add_char function. - Resolve a possible deadlock if interrupts are disabled and getnanotime is called Reviewed by: bde kmacy, avg, sbruno (various versions) Approved by: cperciva MFC after: 2 weeks Modified: head/sys/kern/subr_msgbuf.c head/sys/sys/msgbuf.h Modified: head/sys/kern/subr_msgbuf.c ============================================================================== --- head/sys/kern/subr_msgbuf.c Mon Mar 19 00:07:10 2012 (r233134) +++ head/sys/kern/subr_msgbuf.c Mon Mar 19 00:36:32 2012 (r233135) @@ -49,7 +49,8 @@ static u_int msgbuf_cksum(struct msgbuf *mbp); /* - * + * Timestamps in msgbuf are useful when trying to diagnose when core dumps + * or other actions occured. */ static int msgbuf_show_timestamp = 0; SYSCTL_INT(_kern, OID_AUTO, msgbuf_show_timestamp, CTLFLAG_RW | CTLFLAG_TUN, @@ -143,49 +144,20 @@ msgbuf_getcount(struct msgbuf *mbp) * * The caller should hold the message buffer spinlock. */ -static inline void -__msgbuf_do_addchar(struct msgbuf * const mbp, u_int * const seq, const int c) + +static void +msgbuf_do_addchar(struct msgbuf * const mbp, u_int * const seq, const int c) { u_int pos; /* Make sure we properly wrap the sequence number. */ pos = MSGBUF_SEQ_TO_POS(mbp, *seq); - - mbp->msg_cksum += (u_int)c - + mbp->msg_cksum += (u_int)(u_char)c - (u_int)(u_char)mbp->msg_ptr[pos]; - mbp->msg_ptr[pos] = c; - *seq = MSGBUF_SEQNORM(mbp, *seq + 1); } -static inline void -msgbuf_do_addchar(struct msgbuf * const mbp, u_int * const seq, const int c) -{ - - if (msgbuf_show_timestamp && - (mbp->msg_flags & MSGBUF_NEXT_NEW_LINE) != 0) { - char buf[32]; - char const *bufp; - struct timespec ts; - int err; - - getnanouptime(&ts); - err = snprintf(buf, sizeof (buf), "[%jd.%ld] ", - (intmax_t)ts.tv_sec, ts.tv_nsec / 1000); - - for (bufp = buf; *bufp != '\0'; bufp++) - __msgbuf_do_addchar(mbp, seq, *bufp); - - mbp->msg_flags &= ~MSGBUF_NEXT_NEW_LINE; - } - - __msgbuf_do_addchar(mbp, seq, c); - - if (c == '\n') - mbp->msg_flags |= MSGBUF_NEXT_NEW_LINE; -} - /* * Append a character to a message buffer. */ @@ -213,7 +185,8 @@ msgbuf_addstr(struct msgbuf *mbp, int pr u_int seq; size_t len, prefix_len; char prefix[MAXPRIBUF]; - int nl, i; + char buf[32]; + int nl, i, j, needtime; len = strlen(str); prefix_len = 0; @@ -250,6 +223,7 @@ msgbuf_addstr(struct msgbuf *mbp, int pr mbp->msg_flags &= ~MSGBUF_NEEDNL; } + needtime = 1; for (i = 0; i < len; i++) { /* * If we just had a newline, and the priority is not -1 @@ -263,6 +237,16 @@ msgbuf_addstr(struct msgbuf *mbp, int pr msgbuf_do_addchar(mbp, &seq, prefix[j]); } + if (msgbuf_show_timestamp && needtime == 1 && + (mbp->msg_flags & MSGBUF_NEEDNL) == 0) { + + snprintf(buf, sizeof(buf), "[%jd] ", + (intmax_t)time_uptime); + for (j = 0; buf[j] != '\0'; j++) + msgbuf_do_addchar(mbp, &seq, buf[j]); + needtime = 0; + } + /* * Don't copy carriage returns if the caller requested * filtering. Modified: head/sys/sys/msgbuf.h ============================================================================== --- head/sys/sys/msgbuf.h Mon Mar 19 00:07:10 2012 (r233134) +++ head/sys/sys/msgbuf.h Mon Mar 19 00:36:32 2012 (r233135) @@ -46,9 +46,8 @@ struct msgbuf { u_int msg_cksum; /* checksum of contents */ u_int msg_seqmod; /* range for sequence numbers */ int msg_lastpri; /* saved priority value */ - u_int msg_flags; -#define MSGBUF_NEEDNL 0x01 /* set when newline needed */ -#define MSGBUF_NEXT_NEW_LINE 0x02 + u_int msg_flags; +#define MSGBUF_NEEDNL 0x01 /* set when newline needed */ struct mtx msg_lock; /* mutex to protect the buffer */ }; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 00:41:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E63F106564A; Mon, 19 Mar 2012 00:41:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D32238FC0A; Mon, 19 Mar 2012 00:41:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J0feMu042687; Mon, 19 Mar 2012 00:41:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J0femX042684; Mon, 19 Mar 2012 00:41:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190041.q2J0femX042684@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 00:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233136 - in head/secure: usr.bin/ssh usr.sbin/sshd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 00:41:41 -0000 Author: eadler Date: Mon Mar 19 00:41:40 2012 New Revision: 233136 URL: http://svn.freebsd.org/changeset/base/233136 Log: X11BASE is not used any more and has been killed by the x11 team. Reviewed by: ??? Approved by: ??? MFC after: 3 days Modified: head/secure/usr.bin/ssh/Makefile head/secure/usr.sbin/sshd/Makefile Modified: head/secure/usr.bin/ssh/Makefile ============================================================================== --- head/secure/usr.bin/ssh/Makefile Mon Mar 19 00:36:32 2012 (r233135) +++ head/secure/usr.bin/ssh/Makefile Mon Mar 19 00:41:40 2012 (r233136) @@ -25,19 +25,6 @@ DPADD+= ${LIBGSSAPI} LDADD+= -lgssapi .endif -.if defined(X11BASE) || defined(LOCALBASE) -# Recommended /etc/make.conf setting is X11BASE=${LOCALBASE} for x.org -# 7.x upgrade on <= 6.2, but LOCALBASE has moved out of scope of src/ -# so we need to provide the default for users with old make.conf -# settings. -LOCALBASE?= /usr/local - -# Users may override either LOCALBASE or X11BASE to move the location -# of xauth -X11BASE?= ${LOCALBASE} -CFLAGS+= -DXAUTH_PATH=\"${X11BASE}/bin/xauth\" -.endif - DPADD+= ${LIBCRYPT} ${LIBCRYPTO} LDADD+= -lcrypt -lcrypto Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Mon Mar 19 00:36:32 2012 (r233135) +++ head/secure/usr.sbin/sshd/Makefile Mon Mar 19 00:41:40 2012 (r233136) @@ -40,19 +40,6 @@ DPADD+= ${LIBGSSAPI_KRB5} ${LIBGSSAPI} LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 -lasn1 .endif -.if defined(X11BASE) -# Recommended /etc/make.conf setting is X11BASE=${LOCALBASE} for x.org -# 7.x upgrade on <= 6.2, but LOCALBASE has moved out of scope of src/ -# so we need to provide the default for users with old make.conf -# settings. -LOCALBASE?= /usr/local - -# Users may override either LOCALBASE or X11BASE to move the location -# of xauth -X11BASE?= ${LOCALBASE} -CFLAGS+= -DXAUTH_PATH=\"${X11BASE}/bin/xauth\" -.endif - DPADD+= ${LIBCRYPTO} ${LIBCRYPT} LDADD+= -lcrypto -lcrypt From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 00:44:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFCD6106566C for ; Mon, 19 Mar 2012 00:44:00 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 379A08FC0A for ; Mon, 19 Mar 2012 00:43:59 +0000 (UTC) Received: by lagv3 with SMTP id v3so6092181lag.13 for ; Sun, 18 Mar 2012 17:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; bh=Pq2QX35IQTI4jE87Cazm5zNea64r7S5y450cUNuWsXI=; b=pQf9ivAs3Ss/OcPI6GDVDtSO0wjAIXmnJAdqf+7s/sGg3m7w2er9BdZ0Kdecm8fK74 H3/4wn0yYoS7Kp3vWnvjxyJq8u+bswEHUVGqJOeBeW/waU+gijRCruoyrCGTBsPT/tbG r0c4BpFOy8GZe3qaY+8WehDeUu87DkY9aeRDo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding:x-gm-message-state; bh=Pq2QX35IQTI4jE87Cazm5zNea64r7S5y450cUNuWsXI=; b=gqtZhFaH9JpJPeEZBfcJYKfFyEHRR6VH6HIkYf2GxqQOxpXBMzRqolCCRfOeBXRHLf /wzNf6P7nvQiuRROKrlJViqeu4ENWtlb0zl5+2f4DltqrR9Uy62XJMQpRWgVE8m0uddA 0j8Y7mwJT0vn+70uPRXL+qM0gXmL3pTBfHMRJPKgGxTkN9k7E5HtA7v/TGDjXCZEYXJb DXva751i1nl9OaKP8Vs8GC4zkOztJuq2Av4f4tJRjIL0GQcOMNyjGfkESxFxhpiQkX+3 S3htBKvKTnuahTzm+rsEbofmPpx3DgnMJCymXXC3kwwfYqnRxbnvccawMcVochV+5mmS Ranw== Received: by 10.112.48.200 with SMTP id o8mr4054873lbn.54.1332117833340; Sun, 18 Mar 2012 17:43:53 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.106.105 with HTTP; Sun, 18 Mar 2012 17:43:23 -0700 (PDT) In-Reply-To: <201203190041.q2J0femX042684@svn.freebsd.org> References: <201203190041.q2J0femX042684@svn.freebsd.org> From: Eitan Adler Date: Sun, 18 Mar 2012 20:43:23 -0400 X-Google-Sender-Auth: GAZtZSv8iYj2qDeWep2qyA7D9H4 Message-ID: To: 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-Gm-Message-State: ALoCoQm1YtOnbvNigaAPHvmLaWAb/rISFL8h/KebrVjNGBT3QY79vtZgknrcsjmeihJBiqrJXLTR Cc: Subject: Re: svn commit: r233136 - in head/secure: usr.bin/ssh usr.sbin/sshd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 00:44:00 -0000 On Sun, Mar 18, 2012 at 8:41 PM, Eitan Adler wrote: > Author: eadler > Date: Mon Mar 19 00:41:40 2012 > New Revision: 233136 > URL: http://svn.freebsd.org/changeset/base/233136 > > Log: > =C2=A0X11BASE is not used any more and has been killed by the x11 team. > > =C2=A0Reviewed by: =C2=A0??? > =C2=A0Approved by: =C2=A0??? Oops - forgot to edit the commit message here. Reviewed by: des Approved by: cperciva --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 00:45:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52EDB106564A; Mon, 19 Mar 2012 00:45:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 390138FC0A; Mon, 19 Mar 2012 00:45:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J0j2tX042833; Mon, 19 Mar 2012 00:45:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J0j2QY042832; Mon, 19 Mar 2012 00:45:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190045.q2J0j2QY042832@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 00:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233137 - head/bin/expr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 00:45:02 -0000 Author: eadler Date: Mon Mar 19 00:45:01 2012 New Revision: 233137 URL: http://svn.freebsd.org/changeset/base/233137 Log: rm[0].rm_so must be zero (an explicit check is made for zero in the outer if condition) Reviewed by: se Approved by: cperciva Modified: head/bin/expr/expr.y Modified: head/bin/expr/expr.y ============================================================================== --- head/bin/expr/expr.y Mon Mar 19 00:41:40 2012 (r233136) +++ head/bin/expr/expr.y Mon Mar 19 00:45:01 2012 (r233137) @@ -540,7 +540,7 @@ op_colon(struct val *a, struct val *b) v = make_str(a->u.s + rm[1].rm_so); } else - v = make_integer((intmax_t)(rm[0].rm_eo - rm[0].rm_so)); + v = make_integer((intmax_t)(rm[0].rm_eo)); else if (rp.re_nsub == 0) v = make_integer((intmax_t)0); From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 00:47:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E76D91065670; Mon, 19 Mar 2012 00:47:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D38228FC15; Mon, 19 Mar 2012 00:47:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J0l19t042925; Mon, 19 Mar 2012 00:47:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J0l1j1042923; Mon, 19 Mar 2012 00:47:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190047.q2J0l1j1042923@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 00:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233138 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 00:47:02 -0000 Author: eadler Date: Mon Mar 19 00:47:01 2012 New Revision: 233138 URL: http://svn.freebsd.org/changeset/base/233138 Log: draft-ietf-ipv6-scoping-arch-02.txt is now RFC 4007 PR: docs/163771 Submitted by: phk Reviewed by: If someone else reviewed your modification. Approved by: cperciva MFC after: 1 week Modified: head/lib/libc/net/getnameinfo.3 Modified: head/lib/libc/net/getnameinfo.3 ============================================================================== --- head/lib/libc/net/getnameinfo.3 Mon Mar 19 00:45:01 2012 (r233137) +++ head/lib/libc/net/getnameinfo.3 Mon Mar 19 00:47:01 2012 (r233138) @@ -135,7 +135,7 @@ and .El .Pp This implementation allows numeric IPv6 address notation with scope identifier, -as documented in chapter 11 of draft-ietf-ipv6-scoping-arch-02.txt. +as documented in chapter 11 of RFC 4007. IPv6 link-local address will appear as a string like .Dq Li fe80::1%ne0 . Refer to From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 00:55:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38C111065670; Mon, 19 Mar 2012 00:55:44 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 04E438FC12; Mon, 19 Mar 2012 00:55:43 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id q2J0td00009279 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 18 Mar 2012 17:55:42 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4F668422.1000308@freebsd.org> Date: Sun, 18 Mar 2012 17:56:02 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201202271338.q1RDcqEQ020033@svn.freebsd.org> <20120318185014.GK1340@garage.freebsd.pl> In-Reply-To: <20120318185014.GK1340@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu Subject: Re: svn commit: r232209 - in head: lib/libthr/thread sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 00:55:44 -0000 On 3/18/12 11:50 AM, Pawel Jakub Dawidek wrote: > On Mon, Feb 27, 2012 at 01:38:52PM +0000, David Xu wrote: >> Author: davidxu >> Date: Mon Feb 27 13:38:52 2012 >> New Revision: 232209 >> URL: http://svn.freebsd.org/changeset/base/232209 >> >> Log: >> Follow changes made in revision 232144, pass absolute timeout to kernel, >> this eliminates a clock_gettime() syscall. > This or some other change has broken CLOCK_MONOTONIC usage with > condition variables. > > You should be able to reproduce this by something like this: > > pthread_cond_t cv; > pthread_condattr_t attr; > pthread_mutex_t lock; > struct timespec ts; > int error; > > (void)pthread_mutex_init(&lock, NULL); > > (void)pthread_condattr_init(&attr); > (void)pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); > > (void)pthread_cond_init(&cv,&attr); > (void)pthread_condattr_destroy(&attr); > > (void)clock_gettime(CLOCK_MONOTONIC,&ts); > ts.tv_sec += 10; > (void)pthread_mutex_lock(&lock); > (void)pthread_cond_timedwait(&cv,&lock,&ts); > (void)pthread_mutex_unlock(&lock); > > This should timeout after 10 seconds, but pthread_cond_timedwait(3) > returns immediately with ETIMEDOUT. CLOCK_REALTIME works properly. > Bascially pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) is no-op. > If you change CLOCK_MONOTONIC to CLOCK_REALTIME in clock_gettime(2) > call, it will timeout after 10 seconds. this has been broken for a while for me in fact fixing this was, I thought, one of the reasons for this work.. glad I'm not the omnly person seeing it though. for me it broke sysutils/fio from ports From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:04:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E714E1065670; Mon, 19 Mar 2012 01:04:26 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1CFF8FC08; Mon, 19 Mar 2012 01:04:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J14Qx9043569; Mon, 19 Mar 2012 01:04:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J14Qq7043567; Mon, 19 Mar 2012 01:04:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190104.q2J14Qq7043567@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233139 - stable/9/bin/df X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:04:27 -0000 Author: eadler Date: Mon Mar 19 01:04:26 2012 New Revision: 233139 URL: http://svn.freebsd.org/changeset/base/233139 Log: MFC r232466, r232469: Direct users to swapinfo and pstat from df PR: bin/165321 Approved by: cperciva Modified: stable/9/bin/df/df.1 Directory Properties: stable/9/bin/df/ (props changed) Modified: stable/9/bin/df/df.1 ============================================================================== --- stable/9/bin/df/df.1 Mon Mar 19 00:47:01 2012 (r233138) +++ stable/9/bin/df/df.1 Mon Mar 19 01:04:26 2012 (r233139) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd October 18, 2011 +.Dd March 3, 2012 .Dt DF 1 .Os .Sh NAME @@ -158,7 +158,9 @@ is set, the block counts will be display .El .Sh SEE ALSO .Xr lsvfs 1 , +.Xr pstat 1 , .Xr quota 1 , +.Xr swapinfo 1 , .Xr fstatfs 2 , .Xr getfsstat 2 , .Xr statfs 2 , From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:04:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 769321065675; Mon, 19 Mar 2012 01:04:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6215C8FC0A; Mon, 19 Mar 2012 01:04:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J14lDJ043611; Mon, 19 Mar 2012 01:04:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J14l8h043609; Mon, 19 Mar 2012 01:04:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190104.q2J14l8h043609@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233140 - stable/8/bin/df X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:04:47 -0000 Author: eadler Date: Mon Mar 19 01:04:46 2012 New Revision: 233140 URL: http://svn.freebsd.org/changeset/base/233140 Log: MFC r232466, r232469: Direct users to swapinfo and pstat from df PR: bin/165321 Approved by: cperciva Modified: stable/8/bin/df/df.1 Directory Properties: stable/8/bin/df/ (props changed) Modified: stable/8/bin/df/df.1 ============================================================================== --- stable/8/bin/df/df.1 Mon Mar 19 01:04:26 2012 (r233139) +++ stable/8/bin/df/df.1 Mon Mar 19 01:04:46 2012 (r233140) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd October 18, 2011 +.Dd March 3, 2012 .Dt DF 1 .Os .Sh NAME @@ -158,7 +158,9 @@ is set, the block counts will be display .El .Sh SEE ALSO .Xr lsvfs 1 , +.Xr pstat 1 , .Xr quota 1 , +.Xr swapinfo 1 , .Xr fstatfs 2 , .Xr getfsstat 2 , .Xr statfs 2 , From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:15:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BD47106564A; Mon, 19 Mar 2012 01:15:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2646A8FC08; Mon, 19 Mar 2012 01:15:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1Fbnf043980; Mon, 19 Mar 2012 01:15:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1FaEZ043978; Mon, 19 Mar 2012 01:15:36 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190115.q2J1FaEZ043978@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233141 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:15:37 -0000 Author: eadler Date: Mon Mar 19 01:15:36 2012 New Revision: 233141 URL: http://svn.freebsd.org/changeset/base/233141 Log: MFC r232501: ehci tunables are only available when kernel is compiled with USB_DEBUG PR: docs/163646 Approved by: cperciva Modified: stable/9/share/man/man4/ehci.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ehci.4 ============================================================================== --- stable/9/share/man/man4/ehci.4 Mon Mar 19 01:04:46 2012 (r233140) +++ stable/9/share/man/man4/ehci.4 Mon Mar 19 01:15:36 2012 (r233141) @@ -80,7 +80,11 @@ The device driver first appeared in .Fx 5.1 . .Sh LOADER TUNABLES -Tunables can be set at the +When the kernel has been compiled with +.Cd options USB_DEBUG , +some tunables become available that affect the behavior of +.Nm . +These tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:16:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5559E106564A; Mon, 19 Mar 2012 01:16:12 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 409098FC0A; Mon, 19 Mar 2012 01:16:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1GCKI044032; Mon, 19 Mar 2012 01:16:12 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1GC2w044030; Mon, 19 Mar 2012 01:16:12 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190116.q2J1GC2w044030@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233142 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:16:12 -0000 Author: eadler Date: Mon Mar 19 01:16:11 2012 New Revision: 233142 URL: http://svn.freebsd.org/changeset/base/233142 Log: MFC r232501: ehci tunables are only available when kernel is compiled with USB_DEBUG PR: docs/163646 Approved by: cperciva Modified: stable/8/share/man/man4/ehci.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ehci.4 ============================================================================== --- stable/8/share/man/man4/ehci.4 Mon Mar 19 01:15:36 2012 (r233141) +++ stable/8/share/man/man4/ehci.4 Mon Mar 19 01:16:11 2012 (r233142) @@ -87,7 +87,11 @@ The device driver first appeared in .Fx 5.1 . .Sh LOADER TUNABLES -Tunables can be set at the +When the kernel has been compiled with +.Cd options USB_DEBUG , +some tunables become available that affect the behavior of +.Nm . +These tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:18:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 25493106566B; Mon, 19 Mar 2012 01:18:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10CDC8FC0A; Mon, 19 Mar 2012 01:18:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1IMav044134; Mon, 19 Mar 2012 01:18:22 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1IMPP044133; Mon, 19 Mar 2012 01:18:22 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190118.q2J1IMPP044133@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233143 - stable/9/sys/modules/dtrace/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:18:23 -0000 Author: eadler Date: Mon Mar 19 01:18:22 2012 New Revision: 233143 URL: http://svn.freebsd.org/changeset/base/233143 Log: MFC r232506: Explicitly list dependency PR: misc/160463 Approved by: cperciva Modified: stable/9/sys/modules/dtrace/dtrace/Makefile Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/dtrace/Makefile Mon Mar 19 01:16:11 2012 (r233142) +++ stable/9/sys/modules/dtrace/dtrace/Makefile Mon Mar 19 01:18:22 2012 (r233143) @@ -42,4 +42,6 @@ EXPORT_SYMS= dtrace_register \ dtrace_unregister \ dtrace_probe_lookup +dtrace_asm.o: assym.s + .include From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:18:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6655C1065670; Mon, 19 Mar 2012 01:18:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 513E88FC14; Mon, 19 Mar 2012 01:18:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1IlZp044181; Mon, 19 Mar 2012 01:18:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1IltA044179; Mon, 19 Mar 2012 01:18:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190118.q2J1IltA044179@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233144 - stable/8/sys/modules/dtrace/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:18:47 -0000 Author: eadler Date: Mon Mar 19 01:18:46 2012 New Revision: 233144 URL: http://svn.freebsd.org/changeset/base/233144 Log: MFC r232506: Explicitly list dependency PR: misc/160463 Approved by: cperciva Modified: stable/8/sys/modules/dtrace/dtrace/Makefile Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/dtrace/Makefile Mon Mar 19 01:18:22 2012 (r233143) +++ stable/8/sys/modules/dtrace/dtrace/Makefile Mon Mar 19 01:18:46 2012 (r233144) @@ -42,4 +42,6 @@ EXPORT_SYMS= dtrace_register \ dtrace_unregister \ dtrace_probe_lookup +dtrace_asm.o: assym.s + .include From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:19:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DED5110656D0; Mon, 19 Mar 2012 01:19:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C94AB8FC22; Mon, 19 Mar 2012 01:19:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1J4cr044221; Mon, 19 Mar 2012 01:19:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1J4U5044219; Mon, 19 Mar 2012 01:19:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190119.q2J1J4U5044219@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233145 - stable/7/sys/modules/dtrace/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:19:05 -0000 Author: eadler Date: Mon Mar 19 01:19:04 2012 New Revision: 233145 URL: http://svn.freebsd.org/changeset/base/233145 Log: MFC r232506: Explicitly list dependency PR: misc/160463 Approved by: cperciva Modified: stable/7/sys/modules/dtrace/dtrace/Makefile Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- stable/7/sys/modules/dtrace/dtrace/Makefile Mon Mar 19 01:18:46 2012 (r233144) +++ stable/7/sys/modules/dtrace/dtrace/Makefile Mon Mar 19 01:19:04 2012 (r233145) @@ -41,4 +41,6 @@ EXPORT_SYMS= dtrace_register \ dtrace_unregister \ dtrace_probe_lookup +dtrace_asm.o: assym.s + .include From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:27:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 871B6106566C; Mon, 19 Mar 2012 01:27:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 717278FC0C; Mon, 19 Mar 2012 01:27:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1RVa2044512; Mon, 19 Mar 2012 01:27:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1RVQa044509; Mon, 19 Mar 2012 01:27:31 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190127.q2J1RVQa044509@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233146 - stable/9/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:27:31 -0000 Author: eadler Date: Mon Mar 19 01:27:30 2012 New Revision: 233146 URL: http://svn.freebsd.org/changeset/base/233146 Log: MFC r232503: POSIX mandates that swab do nothing when len < 0 PR: 140690 Approved by: cperciva Modified: stable/9/lib/libc/string/swab.3 stable/9/lib/libc/string/swab.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/string/swab.3 ============================================================================== --- stable/9/lib/libc/string/swab.3 Mon Mar 19 01:19:04 2012 (r233145) +++ stable/9/lib/libc/string/swab.3 Mon Mar 19 01:27:30 2012 (r233146) @@ -28,7 +28,7 @@ .\" @(#)swab.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 10, 2004 +.Dd March 4, 2012 .Dt SWAB 3 .Os .Sh NAME @@ -54,6 +54,9 @@ swapping adjacent bytes. The argument .Fa len must be an even number. +If +.Fa len +is less than zero, nothing will be done. .Sh SEE ALSO .Xr bzero 3 , .Xr memset 3 Modified: stable/9/lib/libc/string/swab.c ============================================================================== --- stable/9/lib/libc/string/swab.c Mon Mar 19 01:19:04 2012 (r233145) +++ stable/9/lib/libc/string/swab.c Mon Mar 19 01:27:30 2012 (r233146) @@ -45,6 +45,8 @@ swab(const void * __restrict from, void int n; char *fp, *tp; + if (len <= 0) + return; n = len >> 1; fp = (char *)from; tp = (char *)to; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:27:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3760106564A; Mon, 19 Mar 2012 01:27:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9472A8FC08; Mon, 19 Mar 2012 01:27:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1RtwY044561; Mon, 19 Mar 2012 01:27:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1RtgB044557; Mon, 19 Mar 2012 01:27:55 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190127.q2J1RtgB044557@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233147 - stable/8/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:27:56 -0000 Author: eadler Date: Mon Mar 19 01:27:55 2012 New Revision: 233147 URL: http://svn.freebsd.org/changeset/base/233147 Log: MFC r232503: POSIX mandates that swab do nothing when len < 0 PR: 140690 Approved by: cperciva Modified: stable/8/lib/libc/string/swab.3 stable/8/lib/libc/string/swab.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/string/swab.3 ============================================================================== --- stable/8/lib/libc/string/swab.3 Mon Mar 19 01:27:30 2012 (r233146) +++ stable/8/lib/libc/string/swab.3 Mon Mar 19 01:27:55 2012 (r233147) @@ -28,7 +28,7 @@ .\" @(#)swab.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 10, 2004 +.Dd March 4, 2012 .Dt SWAB 3 .Os .Sh NAME @@ -54,6 +54,9 @@ swapping adjacent bytes. The argument .Fa len must be an even number. +If +.Fa len +is less than zero, nothing will be done. .Sh SEE ALSO .Xr bzero 3 , .Xr memset 3 Modified: stable/8/lib/libc/string/swab.c ============================================================================== --- stable/8/lib/libc/string/swab.c Mon Mar 19 01:27:30 2012 (r233146) +++ stable/8/lib/libc/string/swab.c Mon Mar 19 01:27:55 2012 (r233147) @@ -45,6 +45,8 @@ swab(const void * __restrict from, void int n; char *fp, *tp; + if (len <= 0) + return; n = len >> 1; fp = (char *)from; tp = (char *)to; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:28:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4F55106564A; Mon, 19 Mar 2012 01:28:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFC988FC12; Mon, 19 Mar 2012 01:28:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1SBPR044608; Mon, 19 Mar 2012 01:28:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1SBuC044605; Mon, 19 Mar 2012 01:28:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190128.q2J1SBuC044605@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233148 - stable/7/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:28:12 -0000 Author: eadler Date: Mon Mar 19 01:28:11 2012 New Revision: 233148 URL: http://svn.freebsd.org/changeset/base/233148 Log: MFC r232503: POSIX mandates that swab do nothing when len < 0 PR: 140690 Approved by: cperciva Modified: stable/7/lib/libc/string/swab.3 stable/7/lib/libc/string/swab.c Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/string/swab.3 ============================================================================== --- stable/7/lib/libc/string/swab.3 Mon Mar 19 01:27:55 2012 (r233147) +++ stable/7/lib/libc/string/swab.3 Mon Mar 19 01:28:11 2012 (r233148) @@ -28,7 +28,7 @@ .\" @(#)swab.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 10, 2004 +.Dd March 4, 2012 .Dt SWAB 3 .Os .Sh NAME @@ -54,6 +54,9 @@ swapping adjacent bytes. The argument .Fa len must be an even number. +If +.Fa len +is less than zero, nothing will be done. .Sh SEE ALSO .Xr bzero 3 , .Xr memset 3 Modified: stable/7/lib/libc/string/swab.c ============================================================================== --- stable/7/lib/libc/string/swab.c Mon Mar 19 01:27:55 2012 (r233147) +++ stable/7/lib/libc/string/swab.c Mon Mar 19 01:28:11 2012 (r233148) @@ -45,6 +45,8 @@ swab(const void * __restrict from, void int n; char *fp, *tp; + if (len <= 0) + return; n = len >> 1; fp = (char *)from; tp = (char *)to; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:32:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA903106564A; Mon, 19 Mar 2012 01:32:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D54CB8FC15; Mon, 19 Mar 2012 01:32:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1WSne044782; Mon, 19 Mar 2012 01:32:28 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1WSKY044780; Mon, 19 Mar 2012 01:32:28 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190132.q2J1WSKY044780@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233149 - stable/9/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:32:29 -0000 Author: eadler Date: Mon Mar 19 01:32:28 2012 New Revision: 233149 URL: http://svn.freebsd.org/changeset/base/233149 Log: MFC r232504: Remove reference to gcc's non-standard -fwritable-strings, which doesn't exist in recent releases (and is bad advice anyway) PR: docs/163119 Approved by: cperciva Modified: stable/9/lib/libc/stdio/mktemp.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/mktemp.3 ============================================================================== --- stable/9/lib/libc/stdio/mktemp.3 Mon Mar 19 01:28:11 2012 (r233148) +++ stable/9/lib/libc/stdio/mktemp.3 Mon Mar 19 01:32:28 2012 (r233149) @@ -28,7 +28,7 @@ .\" @(#)mktemp.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 11, 1998 +.Dd March 4, 2012 .Dt MKTEMP 3 .Os .Sh NAME @@ -180,12 +180,6 @@ with an argument of will result in a core dump due to .Fn mkstemp attempting to modify the string constant that was given. -If the program in question makes heavy use of that type -of function call, you do have the option of compiling the program -so that it will store string constants in a writable segment of memory. -See -.Xr gcc 1 -for more information. .Sh SEE ALSO .Xr chmod 2 , .Xr getpid 2 , From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:32:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 01E83106566C; Mon, 19 Mar 2012 01:32:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E03FE8FC0C; Mon, 19 Mar 2012 01:32:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1Wr7Q044826; Mon, 19 Mar 2012 01:32:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1Wrj0044824; Mon, 19 Mar 2012 01:32:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190132.q2J1Wrj0044824@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233150 - stable/8/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:32:54 -0000 Author: eadler Date: Mon Mar 19 01:32:53 2012 New Revision: 233150 URL: http://svn.freebsd.org/changeset/base/233150 Log: MFC r232504: Remove reference to gcc's non-standard -fwritable-strings, which doesn't exist in recent releases (and is bad advice anyway) PR: docs/163119 Approved by: cperciva Modified: stable/8/lib/libc/stdio/mktemp.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/stdio/mktemp.3 ============================================================================== --- stable/8/lib/libc/stdio/mktemp.3 Mon Mar 19 01:32:28 2012 (r233149) +++ stable/8/lib/libc/stdio/mktemp.3 Mon Mar 19 01:32:53 2012 (r233150) @@ -28,7 +28,7 @@ .\" @(#)mktemp.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 11, 1998 +.Dd March 4, 2012 .Dt MKTEMP 3 .Os .Sh NAME @@ -180,12 +180,6 @@ with an argument of will result in a core dump due to .Fn mkstemp attempting to modify the string constant that was given. -If the program in question makes heavy use of that type -of function call, you do have the option of compiling the program -so that it will store string constants in a writable segment of memory. -See -.Xr gcc 1 -for more information. .Sh SEE ALSO .Xr chmod 2 , .Xr getpid 2 , From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:33:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8953106566B; Mon, 19 Mar 2012 01:33:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B56F8FC15; Mon, 19 Mar 2012 01:33:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1XO0C044882; Mon, 19 Mar 2012 01:33:24 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1XOrQ044880; Mon, 19 Mar 2012 01:33:24 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190133.q2J1XOrQ044880@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233151 - stable/7/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:33:24 -0000 Author: eadler Date: Mon Mar 19 01:33:24 2012 New Revision: 233151 URL: http://svn.freebsd.org/changeset/base/233151 Log: MFC r232504: Remove reference to gcc's non-standard -fwritable-strings, which doesn't exist in recent releases (and is bad advice anyway) PR: docs/163119 Approved by: cperciva Modified: stable/7/lib/libc/stdio/mktemp.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/stdio/mktemp.3 ============================================================================== --- stable/7/lib/libc/stdio/mktemp.3 Mon Mar 19 01:32:53 2012 (r233150) +++ stable/7/lib/libc/stdio/mktemp.3 Mon Mar 19 01:33:24 2012 (r233151) @@ -28,7 +28,7 @@ .\" @(#)mktemp.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 11, 1998 +.Dd March 4, 2012 .Dt MKTEMP 3 .Os .Sh NAME @@ -180,12 +180,6 @@ with an argument of will result in a core dump due to .Fn mkstemp attempting to modify the string constant that was given. -If the program in question makes heavy use of that type -of function call, you do have the option of compiling the program -so that it will store string constants in a writable segment of memory. -See -.Xr gcc 1 -for more information. .Sh SEE ALSO .Xr chmod 2 , .Xr getpid 2 , From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:51:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 14479106566B; Mon, 19 Mar 2012 01:51:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8ED88FC12; Mon, 19 Mar 2012 01:51:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1p80f045433; Mon, 19 Mar 2012 01:51:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1p8PF045431; Mon, 19 Mar 2012 01:51:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190151.q2J1p8PF045431@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233152 - stable/9/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:51:09 -0000 Author: eadler Date: Mon Mar 19 01:51:08 2012 New Revision: 233152 URL: http://svn.freebsd.org/changeset/base/233152 Log: MFC r231306: Fix NULL ptr dereference in setusercontext if pwd is null, LOGIN_SETPRIORITY is set, and setting the priority (rtprio or setpriority) fails. PR: kern/164238 Approved by: cperciva Modified: stable/9/lib/libutil/login_class.c Directory Properties: stable/9/lib/libutil/ (props changed) Modified: stable/9/lib/libutil/login_class.c ============================================================================== --- stable/9/lib/libutil/login_class.c Mon Mar 19 01:33:24 2012 (r233151) +++ stable/9/lib/libutil/login_class.c Mon Mar 19 01:51:08 2012 (r233152) @@ -452,18 +452,21 @@ setusercontext(login_cap_t *lc, const st p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX); p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else { if (setpriority(PRIO_PROCESS, 0, (int)p) != 0) syslog(LOG_WARNING, "setpriority '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } } From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:51:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F7FF1065673; Mon, 19 Mar 2012 01:51:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AAAD8FC1B; Mon, 19 Mar 2012 01:51:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1prYh045483; Mon, 19 Mar 2012 01:51:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1pr3s045481; Mon, 19 Mar 2012 01:51:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190151.q2J1pr3s045481@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233153 - stable/8/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:51:53 -0000 Author: eadler Date: Mon Mar 19 01:51:53 2012 New Revision: 233153 URL: http://svn.freebsd.org/changeset/base/233153 Log: MFC r231306: Fix NULL ptr dereference in setusercontext if pwd is null, LOGIN_SETPRIORITY is set, and setting the priority (rtprio or setpriority) fails. PR: kern/164238 Approved by: cperciva Modified: stable/8/lib/libutil/login_class.c Directory Properties: stable/8/lib/libutil/ (props changed) Modified: stable/8/lib/libutil/login_class.c ============================================================================== --- stable/8/lib/libutil/login_class.c Mon Mar 19 01:51:08 2012 (r233152) +++ stable/8/lib/libutil/login_class.c Mon Mar 19 01:51:53 2012 (r233153) @@ -450,18 +450,21 @@ setusercontext(login_cap_t *lc, const st p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX); p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else { if (setpriority(PRIO_PROCESS, 0, (int)p) != 0) syslog(LOG_WARNING, "setpriority '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } } From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:52:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 674ED1065676 for ; Mon, 19 Mar 2012 01:52:08 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id DAFBB8FC12 for ; Mon, 19 Mar 2012 01:52:07 +0000 (UTC) Received: by iahk25 with SMTP id k25so12189833iah.13 for ; Sun, 18 Mar 2012 18:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataix.net; s=rsa; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=xG6hlcWyhxQLTPxUfA9nTmQzEO3spsOmgd4YXYWJV7o=; b=JSeJE+P93+DKttHbq+q4opIAFoa1Vc4GZ8ws297hTRC5jE1/uVRTyfCNrGaLb+Nb2w T0z2qv8PrOyB3URyXXCGJ5ocf9nbkDY+s0f4R4+yZvkyd6IHRlSR9/XM8s3i2jJLSSdg IeTU64h7enPNg/Wuwl4GkVYg4yrqXA7Vj1xrE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-gm-message-state; bh=xG6hlcWyhxQLTPxUfA9nTmQzEO3spsOmgd4YXYWJV7o=; b=Au4HPTvjM33AykmAsu44m7o6/Mss6gNnap4GFFVo48FyNbSWRL+YrQwD4ufRGgcgez cSEHZwH5sdRWda8P0o1w5PvbYpShPyiA4gxNbmxYR19N5liVtBIMzIKiFIP9hVjQSrbq upX1M9n3vHlZ61RYh3Ua9PhEZKBTcxMiroyb0DscrYfMMf6IaCC1asFciH9wwWrXlOsz prP3dxZF3C3894pwEoblqKqIZyNI/J3q146moekV1OGTDaUhYa8tIxGQYJldXsmEeQKY bYezfPiBgf66+Y1ozDAXhOuPaRvc6sOyndZrxZJEFftDlgDy6UbjhlWDxhKoQQ2ZSJ/m PrjA== Received: by 10.50.161.232 with SMTP id xv8mr4943476igb.9.1332121927191; Sun, 18 Mar 2012 18:52:07 -0700 (PDT) Received: from DataIX.net (adsl-99-112-214-41.dsl.klmzmi.sbcglobal.net. [99.112.214.41]) by mx.google.com with ESMTPS id i7sm4962031igq.11.2012.03.18.18.52.05 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Mar 2012 18:52:06 -0700 (PDT) Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q2J1q3eR059729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Mar 2012 21:52:03 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Received: (from jhellenthal@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q2J1q3wF059660; Sun, 18 Mar 2012 21:52:03 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Date: Sun, 18 Mar 2012 21:52:03 -0400 From: Jason Hellenthal To: Eitan Adler Message-ID: <20120319015203.GB13456@DataIX.net> References: <201203190127.q2J1RtgB044557@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uQr8t48UFsdbeI+V" Content-Disposition: inline In-Reply-To: <201203190127.q2J1RtgB044557@svn.freebsd.org> X-Gm-Message-State: ALoCoQmFioZMEMDkjsNn3zsrmyb5nFVFR+yPr9XW4dYLcEOTHgq+rDRrCLEMTO6IcmRJqYo54mhE Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r233147 - stable/8/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:52:08 -0000 --uQr8t48UFsdbeI+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 19, 2012 at 01:27:55AM +0000, Eitan Adler wrote: > Author: eadler > Date: Mon Mar 19 01:27:55 2012 > New Revision: 233147 > URL: http://svn.freebsd.org/changeset/base/233147 >=20 > Log: > MFC r232503: > POSIX mandates that swab do nothing when len < 0 > =20 > PR: 140690 > Approved by: cperciva >=20 > Modified: stable/8/lib/libc/string/swab.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/lib/libc/string/swab.c Mon Mar 19 01:27:30 2012 (r233146) > +++ stable/8/lib/libc/string/swab.c Mon Mar 19 01:27:55 2012 (r233147) > @@ -45,6 +45,8 @@ swab(const void * __restrict from, void=20 > int n; > char *fp, *tp; > =20 > + if (len <=3D 0) > + return; Does this not test to see if it is also equal to 0(zero) ? If I understand the above statement "POSIX mandates that swab do nothing when len < 0" then the above code should be exactly that ... and not testing whether it is equal to zero... > n =3D len >> 1; > fp =3D (char *)from; > tp =3D (char *)to; > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.or= g" --=20 ;s =3D; --uQr8t48UFsdbeI+V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJPZpFCAAoJEJBXh4mJ2FR+yNUH/j7hn/2z1yoIcP0Tbux7lQaT Y/z3W+dXCGGFuDkyIsoAQBF7zDAXqjUxjj0g/qJWakdq+SaRJA65v2AV8d1CYDbf fFlv5JY9UsDpjyHD4Z2r33Xk2hgTB8lDyJLEgFrPhbS3x9AY9euQ6oE1TS0R3J3/ 8I3Zde+MlU0c2g7ST3lZA4cKsKB8asl+fBd9NdpR7T7emryrLx2pjO+9ff9jeqpZ Sol1QnVWzgTbHkJVrM2GM3Y/1mWdpkCLa4yYNAW20u0y7/KX/Z5fNeBUZVHYFoDV wM8oioLDHhVc9d2fuWd6QaEwM5YYyh9BMC3SGALPNAAgIKwd1iOuDixKeufkmDg= =4Hc8 -----END PGP SIGNATURE----- --uQr8t48UFsdbeI+V-- From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:52:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CEB6106564A; Mon, 19 Mar 2012 01:52:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37B618FC1B; Mon, 19 Mar 2012 01:52:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1qAOq045532; Mon, 19 Mar 2012 01:52:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1qAKX045530; Mon, 19 Mar 2012 01:52:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190152.q2J1qAKX045530@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233154 - stable/7/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:52:10 -0000 Author: eadler Date: Mon Mar 19 01:52:09 2012 New Revision: 233154 URL: http://svn.freebsd.org/changeset/base/233154 Log: MFC r231306: Fix NULL ptr dereference in setusercontext if pwd is null, LOGIN_SETPRIORITY is set, and setting the priority (rtprio or setpriority) fails. PR: kern/164238 Approved by: cperciva Modified: stable/7/lib/libutil/login_class.c Directory Properties: stable/7/lib/libutil/ (props changed) Modified: stable/7/lib/libutil/login_class.c ============================================================================== --- stable/7/lib/libutil/login_class.c Mon Mar 19 01:51:53 2012 (r233153) +++ stable/7/lib/libutil/login_class.c Mon Mar 19 01:52:09 2012 (r233154) @@ -448,18 +448,21 @@ setusercontext(login_cap_t *lc, const st p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX); p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else { if (setpriority(PRIO_PROCESS, 0, (int)p) != 0) syslog(LOG_WARNING, "setpriority '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } } From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:56:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92E4E106564A; Mon, 19 Mar 2012 01:56:26 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DE448FC17; Mon, 19 Mar 2012 01:56:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1uQvW045714; Mon, 19 Mar 2012 01:56:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1uQvX045712; Mon, 19 Mar 2012 01:56:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190156.q2J1uQvX045712@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233155 - stable/9/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:56:26 -0000 Author: eadler Date: Mon Mar 19 01:56:26 2012 New Revision: 233155 URL: http://svn.freebsd.org/changeset/base/233155 Log: MFC r232505: Remove outdated comment of seven years PR: docs/116116 Approved by: cperciva Modified: stable/9/lib/libc/stdio/mktemp.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/mktemp.3 ============================================================================== --- stable/9/lib/libc/stdio/mktemp.3 Mon Mar 19 01:52:09 2012 (r233154) +++ stable/9/lib/libc/stdio/mktemp.3 Mon Mar 19 01:56:26 2012 (r233155) @@ -236,10 +236,3 @@ and the return status of the call should This will ensure that the program does not continue blindly in the event that an attacker has already created the file with the intention of manipulating or reading its contents. -.Pp -The implementation of these functions calls -.Xr arc4random 3 , -which is not reentrant. -You must provide your own locking around this and other consumers of the -.Xr arc4random 3 -API. From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:56:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 593FE106566C; Mon, 19 Mar 2012 01:56:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4158E8FC15; Mon, 19 Mar 2012 01:56:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1urGn045758; Mon, 19 Mar 2012 01:56:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1ursF045756; Mon, 19 Mar 2012 01:56:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190156.q2J1ursF045756@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233156 - stable/8/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:56:53 -0000 Author: eadler Date: Mon Mar 19 01:56:52 2012 New Revision: 233156 URL: http://svn.freebsd.org/changeset/base/233156 Log: MFC r232505: Remove outdated comment of seven years PR: docs/116116 Approved by: cperciva Modified: stable/8/lib/libc/stdio/mktemp.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/stdio/mktemp.3 ============================================================================== --- stable/8/lib/libc/stdio/mktemp.3 Mon Mar 19 01:56:26 2012 (r233155) +++ stable/8/lib/libc/stdio/mktemp.3 Mon Mar 19 01:56:52 2012 (r233156) @@ -236,10 +236,3 @@ and the return status of the call should This will ensure that the program does not continue blindly in the event that an attacker has already created the file with the intention of manipulating or reading its contents. -.Pp -The implementation of these functions calls -.Xr arc4random 3 , -which is not reentrant. -You must provide your own locking around this and other consumers of the -.Xr arc4random 3 -API. From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:57:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 261B7106566B; Mon, 19 Mar 2012 01:57:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F23B8FC1D; Mon, 19 Mar 2012 01:57:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1vE4O045802; Mon, 19 Mar 2012 01:57:14 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1vEwr045799; Mon, 19 Mar 2012 01:57:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190157.q2J1vEwr045799@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233157 - stable/7/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:57:15 -0000 Author: eadler Date: Mon Mar 19 01:57:14 2012 New Revision: 233157 URL: http://svn.freebsd.org/changeset/base/233157 Log: MFC r232505: Remove outdated comment of seven years PR: docs/116116 Approved by: cperciva Modified: stable/7/lib/libc/stdio/mktemp.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/stdio/mktemp.3 ============================================================================== --- stable/7/lib/libc/stdio/mktemp.3 Mon Mar 19 01:56:52 2012 (r233156) +++ stable/7/lib/libc/stdio/mktemp.3 Mon Mar 19 01:57:14 2012 (r233157) @@ -236,10 +236,3 @@ and the return status of the call should This will ensure that the program does not continue blindly in the event that an attacker has already created the file with the intention of manipulating or reading its contents. -.Pp -The implementation of these functions calls -.Xr arc4random 3 , -which is not reentrant. -You must provide your own locking around this and other consumers of the -.Xr arc4random 3 -API. From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 01:58:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9402F106566B for ; Mon, 19 Mar 2012 01:58:44 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0640B8FC1A for ; Mon, 19 Mar 2012 01:58:43 +0000 (UTC) Received: by lboi15 with SMTP id i15so4096242lbo.13 for ; Sun, 18 Mar 2012 18:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=HHQlaUytgYY1OLpEvtP7+RCBrkZA4UKx9QC5nkvGkb0=; b=gijIJSO+uhvbSE6azwNrYvcyYeKr+co/qL8DRkBmMYwHyK4ulSLidZq8Q9aTD0NrKu dmafGGQG/mtdrsDCDvk5kbSZCmwITE6nC4jayxmLkbecwavLoxHb8tVbHWcWM9aVSaEl MTkzWexQWZkexxEUHwLKsNXO/LldyellIRinc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=HHQlaUytgYY1OLpEvtP7+RCBrkZA4UKx9QC5nkvGkb0=; b=Uxk+wG1b4r8wzY30cIDXfnGMJkKHSsYggVTqIKfKzHQk3kyrQ0/3R92FBRSFil1CWQ nqq2LNlpWAFbmoMGbUwFtwA9ciJl0Ej1tKemLCYKhHR4yf8qtt64KUQ+TA1m4rS1FZgn Dg/R4qaZllCpifFtFUy0ZU2HwJ3W9S0URRkZHxsQgeoQcffZSxH5GQHMPnrkDh1SYAwD H4eRyDy6gge8ERajgQ0jcbC9+Xwby6JAEqTFDeTqfkn/dHqRRezNyD7qVs3c6US9KcdK 2f2I9YDeEcxFoNT6roThlOuKQvMGUmQRygESnVNWDviIp8foe/amd6Zr5V6zyfnxIAat YRdw== Received: by 10.112.24.161 with SMTP id v1mr4174285lbf.12.1332122322899; Sun, 18 Mar 2012 18:58:42 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.106.105 with HTTP; Sun, 18 Mar 2012 18:58:12 -0700 (PDT) In-Reply-To: <20120319015203.GB13456@DataIX.net> References: <201203190127.q2J1RtgB044557@svn.freebsd.org> <20120319015203.GB13456@DataIX.net> From: Eitan Adler Date: Sun, 18 Mar 2012 21:58:12 -0400 X-Google-Sender-Auth: cg-UeLuRKxLBoJasBzs0K9hRZEs Message-ID: To: Jason Hellenthal Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlVcGJ4eCW3UpAN2iMgiqkDx99tzpewNbRgRtdKMLNiHnAeW6acFK2cpGVDu/618gcu+n08 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r233147 - stable/8/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:58:44 -0000 On Sun, Mar 18, 2012 at 9:52 PM, Jason Hellenthal wrote: > > > On Mon, Mar 19, 2012 at 01:27:55AM +0000, Eitan Adler wrote: >> Author: eadler >> Date: Mon Mar 19 01:27:55 2012 >> New Revision: 233147 >> URL: http://svn.freebsd.org/changeset/base/233147 >> >> Log: >> =C2=A0 MFC r232503: >> =C2=A0 =C2=A0 =C2=A0 POSIX mandates that swab do nothing when len < 0 >> >> =C2=A0 PR: =C2=A0 =C2=A0 =C2=A0 =C2=A0 140690 >> =C2=A0 Approved by: =C2=A0 =C2=A0 =C2=A0 =C2=A0cperciva >> >> Modified: stable/8/lib/libc/string/swab.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- stable/8/lib/libc/string/swab.c =C2=A0 Mon Mar 19 01:27:30 2012 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(r233146) >> +++ stable/8/lib/libc/string/swab.c =C2=A0 Mon Mar 19 01:27:55 2012 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(r233147) >> @@ -45,6 +45,8 @@ swab(const void * __restrict from, void >> =C2=A0 =C2=A0 =C2=A0 int n; >> =C2=A0 =C2=A0 =C2=A0 char *fp, *tp; >> >> + =C2=A0 =C2=A0 if (len <=3D 0) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return; > > Does this not test to see if it is also equal to 0(zero) ? > > If I understand the above statement "POSIX mandates that swab do nothing > when len < 0" then the above code should be exactly that ... and not > testing whether it is equal to zero... If the code doesn't check for len <=3D 0 then it will do something. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 02:10:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09591106564A; Mon, 19 Mar 2012 02:10:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8FB18FC08; Mon, 19 Mar 2012 02:10:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J2AeFm046255; Mon, 19 Mar 2012 02:10:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J2Aebq046253; Mon, 19 Mar 2012 02:10:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201203190210.q2J2Aebq046253@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Mar 2012 02:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233158 - head/sys/dev/fxp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 02:10:41 -0000 Author: yongari Date: Mon Mar 19 02:10:40 2012 New Revision: 233158 URL: http://svn.freebsd.org/changeset/base/233158 Log: Do not change current media when driver is already running. If driver is running driver would have already completed flow control configuration. This change removes unnecessary media changes in controller reconfiguration cases such that it does not trigger link reestablishment for configuration change requests like promiscuous mode change. Reported by: Many Tested by: Mike Tancsa sentex dot net> MFC after: 1 week Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Mon Mar 19 01:57:14 2012 (r233157) +++ head/sys/dev/fxp/if_fxp.c Mon Mar 19 02:10:40 2012 (r233158) @@ -902,7 +902,7 @@ fxp_attach(device_t dev) FXP_LOCK(sc); /* Clear wakeup events. */ CSR_WRITE_1(sc, FXP_CSR_PMDR, CSR_READ_1(sc, FXP_CSR_PMDR)); - fxp_init_body(sc, 1); + fxp_init_body(sc, 0); fxp_stop(sc); FXP_UNLOCK(sc); } @@ -2810,7 +2810,7 @@ fxp_ioctl(struct ifnet *ifp, u_long comm if (((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) && ((ifp->if_flags ^ sc->if_flags) & (IFF_PROMISC | IFF_ALLMULTI | IFF_LINK0)) != 0) - fxp_init_body(sc, 1); + fxp_init_body(sc, 0); else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) fxp_init_body(sc, 1); } else { @@ -2916,7 +2916,7 @@ fxp_ioctl(struct ifnet *ifp, u_long comm reinit++; } if (reinit > 0 && ifp->if_flags & IFF_UP) - fxp_init_body(sc, 1); + fxp_init_body(sc, 0); FXP_UNLOCK(sc); VLAN_CAPABILITIES(ifp); break; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 02:17:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F2C21065677 for ; Mon, 19 Mar 2012 02:17:30 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 24EAA8FC12 for ; Mon, 19 Mar 2012 02:17:29 +0000 (UTC) Received: by iahk25 with SMTP id k25so12226953iah.13 for ; Sun, 18 Mar 2012 19:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataix.net; s=rsa; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to; bh=KDtC/0ktxJp3vDQXpYtToV/w65BZ79QDpxSAqPsGKDo=; b=X0OhXvNoxcbHK//VoSAWFL4w/mQnff4Rkc4fHDHLoaLF1T/GfQNuGnZhaGWDnktxi7 w5Ekwsd1WoKun2oO4ibCTI1ducZDYnRn+uqgU3r3trIfNmp3lb2mUw5RUbHv/4/1LZu3 D/fxU9jlCuC+vzgcCeqhu/c1bSaqFl6w40hQg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:x-gm-message-state; bh=KDtC/0ktxJp3vDQXpYtToV/w65BZ79QDpxSAqPsGKDo=; b=GI4Fs314JMcJDzUydQ6CMefzpighhOY4gHy6EEd6mpZiDn6qTDCYPaGf7eYYKD8vdd WMdv8lW+GSEzUGswji3yc+q8/CMhQyzw8Yhlvb7ApaLiz+lalLHzIgYGliCwUQuR1IJ9 J7kBV2CBFD0Uzl4a+y+YjhTc3XDdAIRR3Zxwdm5s7o5VsxWRCOPbURl38hNvh6Sj7JCL 9gdu4QUW7yiFIZNsHxNkEXtI3lNXgv2XzEroKOnYgYqox0JuooDtZbqQkKV02EOH29sN nsz5tSEuWi4oL9lLMUQoWUDZ31uHRNtOOY1lnsZ19M7FJF7xRl+xOCrG4wapdKzsojGD 9vSQ== Received: by 10.43.52.10 with SMTP id vk10mr5781188icb.25.1332123449452; Sun, 18 Mar 2012 19:17:29 -0700 (PDT) Received: from DataIX.net (adsl-99-112-214-41.dsl.klmzmi.sbcglobal.net. [99.112.214.41]) by mx.google.com with ESMTPS id gh8sm4997814igb.16.2012.03.18.19.17.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Mar 2012 19:17:28 -0700 (PDT) Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q2J2HPJA002608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Mar 2012 22:17:25 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Received: (from jhellenthal@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q2J2HOUS002134; Sun, 18 Mar 2012 22:17:24 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Date: Sun, 18 Mar 2012 22:17:24 -0400 From: Jason Hellenthal To: Eitan Adler Message-ID: <20120319021724.GC13456@DataIX.net> References: <201203190127.q2J1RtgB044557@svn.freebsd.org> <20120319015203.GB13456@DataIX.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Gm-Message-State: ALoCoQnsJEIq/4lx9tAkkoN+BfDN9DiLqNAti03EJ6hE8iD0PMf9G1s6jQo17jNdrxj5sgjhBSJo Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r233147 - stable/8/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 02:17:30 -0000 On Sun, Mar 18, 2012 at 09:58:12PM -0400, Eitan Adler wrote: > On Sun, Mar 18, 2012 at 9:52 PM, Jason Hellenthal > wrote: > > > > > > On Mon, Mar 19, 2012 at 01:27:55AM +0000, Eitan Adler wrote: > >> Author: eadler > >> Date: Mon Mar 19 01:27:55 2012 > >> New Revision: 233147 > >> URL: http://svn.freebsd.org/changeset/base/233147 > >> > >> Log: > >>   MFC r232503: > >>       POSIX mandates that swab do nothing when len < 0 > >> > >>   PR:         140690 > >>   Approved by:        cperciva > >> > >> Modified: stable/8/lib/libc/string/swab.c > >> ============================================================================== > >> --- stable/8/lib/libc/string/swab.c   Mon Mar 19 01:27:30 2012        (r233146) > >> +++ stable/8/lib/libc/string/swab.c   Mon Mar 19 01:27:55 2012        (r233147) > >> @@ -45,6 +45,8 @@ swab(const void * __restrict from, void > >>       int n; > >>       char *fp, *tp; > >> > >> +     if (len <= 0) > >> +             return; > > > > Does this not test to see if it is also equal to 0(zero) ? > > > > If I understand the above statement "POSIX mandates that swab do nothing > > when len < 0" then the above code should be exactly that ... and not > > testing whether it is equal to zero... > > If the code doesn't check for len <= 0 then it will do something. > To my understanding of the specification it should only return if len is negative... 0 is not a negative number. -- ;s =; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 02:32:18 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6402E106564A; Mon, 19 Mar 2012 02:32:18 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 19FF48FC14; Mon, 19 Mar 2012 02:32:14 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id q2J2W7XV089805; Mon, 19 Mar 2012 02:32:07 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.119] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id 74sitbxu8cehhdt79hbbq52guw; Mon, 19 Mar 2012 02:32:06 +0000 (UTC) (envelope-from tim@kientzle.com) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=windows-1252 From: Tim Kientzle In-Reply-To: <20120319021724.GC13456@DataIX.net> Date: Sun, 18 Mar 2012 19:32:04 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <264991E4-B083-4E61-9337-E5882DED66C3@kientzle.com> References: <201203190127.q2J1RtgB044557@svn.freebsd.org> <20120319015203.GB13456@DataIX.net> <20120319021724.GC13456@DataIX.net> To: Jason Hellenthal X-Mailer: Apple Mail (2.1257) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler , svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r233147 - stable/8/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 02:32:18 -0000 On Mar 18, 2012, at 7:17 PM, Jason Hellenthal wrote: >=20 >=20 > On Sun, Mar 18, 2012 at 09:58:12PM -0400, Eitan Adler wrote: >> On Sun, Mar 18, 2012 at 9:52 PM, Jason Hellenthal >> wrote: >>>=20 >>>=20 >>> On Mon, Mar 19, 2012 at 01:27:55AM +0000, Eitan Adler wrote: >>>> Author: eadler >>>> Date: Mon Mar 19 01:27:55 2012 >>>> New Revision: 233147 >>>> URL: http://svn.freebsd.org/changeset/base/233147 >>>>=20 >>>> Log: >>>> MFC r232503: >>>> POSIX mandates that swab do nothing when len < 0 >>>>=20 >>>> PR: 140690 >>>> Approved by: cperciva >>>>=20 >>>> Modified: stable/8/lib/libc/string/swab.c >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- stable/8/lib/libc/string/swab.c Mon Mar 19 01:27:30 2012 = (r233146) >>>> +++ stable/8/lib/libc/string/swab.c Mon Mar 19 01:27:55 2012 = (r233147) >>>> @@ -45,6 +45,8 @@ swab(const void * __restrict from, void >>>> int n; >>>> char *fp, *tp; >>>>=20 >>>> + if (len <=3D 0) >>>> + return; >>>=20 >>> Does this not test to see if it is also equal to 0(zero) ? >>>=20 >>> If I understand the above statement "POSIX mandates that swab do = nothing >>> when len < 0" then the above code should be exactly that ... and not >>> testing whether it is equal to zero... >>=20 >> If the code doesn't check for len <=3D 0 then it will do something. >>=20 >=20 > To my understanding of the specification it should only return if len = is > negative... 0 is not a negative number. =46rom POSIX: > The swab() function shall copy nbytes bytes=85 This implies that it does nothing when the argument is zero. The check for <=3D 0 is a performance optimization; otherwise the code will do nothing in a more expensive fashion. > If nbytes is negative, swab() does nothing. This states that it does nothing when the argument is less than zero. So the change is correct; it covers both cases. Tim From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 02:59:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B47C1065675 for ; Mon, 19 Mar 2012 02:59:18 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id B883D8FC17 for ; Mon, 19 Mar 2012 02:59:17 +0000 (UTC) Received: by iahk25 with SMTP id k25so12287723iah.13 for ; Sun, 18 Mar 2012 19:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataix.net; s=rsa; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to; bh=dfFFFyIlffruE/gLmNJmiSGkmnLlf456JEu319OSom8=; b=eTLdhvQvjY0G6GW/AI0AoLV+H0fKcQmGRkuFGVyGEPvy8OjNyumM1NLxl4x0ZuPpS+ qktXArG/zwdThdmiH+xmqjSx+qJ+zsQ0NHdWGxs09yRU+sRKruaJcSqf8zJulsK6ZRUK U0p1JsE0CLiFxl9Bv6VrJO/+U2UH3qW6j8Edo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:x-gm-message-state; bh=dfFFFyIlffruE/gLmNJmiSGkmnLlf456JEu319OSom8=; b=fddxiAdacBAlHJETzDZd/Oj8dQsdHlzTBQtZ2dzq2nWVCxGzYBIEbm9+TYznojFrVT /y4NaRIvuyHMCB3lYoQ7bHnDMsFIKUtIPLaKVmpFjuZFXdR628RYXmowMUSAqBfJquUA 065v8OrsMzWqzFDPgSm9ECqetaC2sj4KdUI3A51evGXB24tb1HasO+6jZMTkBZWo2eC4 GpxoC3Cztu99/enMoiLLwf6HXtlrF6Iqk2Kjwo+Nv/C3hn37dBroBoQvIi6dZHnCnGMM RS1zPyvAdz/7PV6G7iZUVdaVAAaaslrsAlVBZi5ctjeUoTzt84l9j3J2VbIAd+IeIurQ Rb7w== Received: by 10.50.106.132 with SMTP id gu4mr4904409igb.59.1332125957139; Sun, 18 Mar 2012 19:59:17 -0700 (PDT) Received: from DataIX.net (adsl-99-112-214-41.dsl.klmzmi.sbcglobal.net. [99.112.214.41]) by mx.google.com with ESMTPS id ba4sm7458438igb.14.2012.03.18.19.59.15 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Mar 2012 19:59:16 -0700 (PDT) Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q2J2xDvV079731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Mar 2012 22:59:14 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Received: (from jhellenthal@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q2J2xD13079708; Sun, 18 Mar 2012 22:59:13 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Date: Sun, 18 Mar 2012 22:59:13 -0400 From: Jason Hellenthal To: Tim Kientzle Message-ID: <20120319025913.GA29610@DataIX.net> References: <201203190127.q2J1RtgB044557@svn.freebsd.org> <20120319015203.GB13456@DataIX.net> <20120319021724.GC13456@DataIX.net> <264991E4-B083-4E61-9337-E5882DED66C3@kientzle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <264991E4-B083-4E61-9337-E5882DED66C3@kientzle.com> X-Gm-Message-State: ALoCoQnblEIdHr1YVSs9MpYsPmeIPt7kLoZ38PN4Jl4Obsk9r7+r5+7ww8iuKBpzmR234YoUh0PD Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler , svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r233147 - stable/8/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 02:59:18 -0000 On Sun, Mar 18, 2012 at 07:32:04PM -0700, Tim Kientzle wrote: > > On Mar 18, 2012, at 7:17 PM, Jason Hellenthal wrote: > > > > > > > On Sun, Mar 18, 2012 at 09:58:12PM -0400, Eitan Adler wrote: > >> On Sun, Mar 18, 2012 at 9:52 PM, Jason Hellenthal > >> wrote: > >>> > >>> > >>> On Mon, Mar 19, 2012 at 01:27:55AM +0000, Eitan Adler wrote: > >>>> Author: eadler > >>>> Date: Mon Mar 19 01:27:55 2012 > >>>> New Revision: 233147 > >>>> URL: http://svn.freebsd.org/changeset/base/233147 > >>>> > >>>> Log: > >>>> MFC r232503: > >>>> POSIX mandates that swab do nothing when len < 0 > >>>> > >>>> PR: 140690 > >>>> Approved by: cperciva > >>>> > >>>> Modified: stable/8/lib/libc/string/swab.c > >>>> ============================================================================== > >>>> --- stable/8/lib/libc/string/swab.c Mon Mar 19 01:27:30 2012 (r233146) > >>>> +++ stable/8/lib/libc/string/swab.c Mon Mar 19 01:27:55 2012 (r233147) > >>>> @@ -45,6 +45,8 @@ swab(const void * __restrict from, void > >>>> int n; > >>>> char *fp, *tp; > >>>> > >>>> + if (len <= 0) > >>>> + return; > >>> > >>> Does this not test to see if it is also equal to 0(zero) ? > >>> > >>> If I understand the above statement "POSIX mandates that swab do nothing > >>> when len < 0" then the above code should be exactly that ... and not > >>> testing whether it is equal to zero... > >> > >> If the code doesn't check for len <= 0 then it will do something. > >> > > > > To my understanding of the specification it should only return if len is > > negative... 0 is not a negative number. > > >From POSIX: > > The swab() function shall copy nbytes bytes… > > This implies that it does nothing when the argument is zero. > The check for <= 0 is a performance optimization; > otherwise the code will do nothing in a more expensive > fashion. > > > If nbytes is negative, swab() does nothing. > > This states that it does nothing when the argument is less than zero. > > So the change is correct; it covers both cases. > Yes. My point being though the description of this change does not adequately describe both cases. It just simply points to POSIX and saying it should return if negative. IMHO calling things what they are and making that very same change causes less grief. Also the man page specifies len "must be an even number" and by the posix spec it can be an odd number and copies and exchanges nbytes-1 and the disposition of the last byte is unspecified. Sorry but irregular documentation is a pet peeve of mine. -- ;s =; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 03:27:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 965701065675; Mon, 19 Mar 2012 03:27:09 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 827DD8FC14; Mon, 19 Mar 2012 03:27:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J3R9tr049099; Mon, 19 Mar 2012 03:27:09 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J3R9GG049097; Mon, 19 Mar 2012 03:27:09 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203190327.q2J3R9GG049097@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 19 Mar 2012 03:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233159 - head/contrib/gdb/gdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 03:27:09 -0000 Author: gonzo Date: Mon Mar 19 03:27:08 2012 New Revision: 233159 URL: http://svn.freebsd.org/changeset/base/233159 Log: fix ABI detection logic: for 64-bit elf objects set default ABI to n64. Modified: head/contrib/gdb/gdb/mips-tdep.c Modified: head/contrib/gdb/gdb/mips-tdep.c ============================================================================== --- head/contrib/gdb/gdb/mips-tdep.c Mon Mar 19 02:10:40 2012 (r233158) +++ head/contrib/gdb/gdb/mips-tdep.c Mon Mar 19 03:27:08 2012 (r233159) @@ -5437,6 +5437,13 @@ mips_gdbarch_init (struct gdbarch_info i } } + /* Default 64-bit objects to N64 instead of O32. */ + if (found_abi == MIPS_ABI_UNKNOWN + && info.abfd != NULL + && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour + && elf_elfheader (info.abfd)->e_ident[EI_CLASS] == ELFCLASS64) + found_abi = MIPS_ABI_N64; + if (gdbarch_debug) fprintf_unfiltered (gdb_stdlog, "mips_gdbarch_init: found_abi = %d\n", found_abi); From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 04:46:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2E6E1065670; Mon, 19 Mar 2012 04:46:11 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE7098FC0A; Mon, 19 Mar 2012 04:46:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J4kB1O051765; Mon, 19 Mar 2012 04:46:11 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J4kBoB051763; Mon, 19 Mar 2012 04:46:11 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201203190446.q2J4kBoB051763@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 19 Mar 2012 04:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233160 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 04:46:12 -0000 Author: bjk (doc committer) Date: Mon Mar 19 04:46:11 2012 New Revision: 233160 URL: http://svn.freebsd.org/changeset/base/233160 Log: Expound a bit more about the system maximum number of FIBs, how it may be set, and current limitations on the value. Approved by: hrs (mentor) PR: docs/157453 MFC after: 1 week Modified: head/lib/libc/sys/setfib.2 Modified: head/lib/libc/sys/setfib.2 ============================================================================== --- head/lib/libc/sys/setfib.2 Mon Mar 19 03:27:08 2012 (r233159) +++ head/lib/libc/sys/setfib.2 Mon Mar 19 04:46:11 2012 (r233160) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 8, 2008 +.Dd March 19, 2012 .Dt SETFIB 2 .Os .Sh NAME @@ -45,10 +45,28 @@ subsequent to the call, to be that of th The .Fa fib argument -may be between 0 and the current system maximum which +must be greater than or equal to 0 +and less than the current system maximum which may be retrieved by the .Va net.fibs sysctl. +The system maximum is set in the kernel configuration file with +.Pp +.Dl options ROUTETABLES= Ns Em N +.Pp +or in +.Pa /boot/loader.conf +with +.Pp +.Dl net.fibs= Ns Qq Em N +.Pp +where +.Em N +is an integer. +However, this maximum is capped at 16 due to the implementation storing +the fib number in a 4-bit field in +.Xr mbuf 9 +flags. The default fib of the process will be applied to all protocol families that support multiple fibs, and ignored by those that do not. The default fib for a process may be overridden for a socket with the use From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 05:08:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E8ED1065673; Mon, 19 Mar 2012 05:08:10 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A3618FC15; Mon, 19 Mar 2012 05:08:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J58APA052491; Mon, 19 Mar 2012 05:08:10 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J58ANT052489; Mon, 19 Mar 2012 05:08:10 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201203190508.q2J58ANT052489@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 19 Mar 2012 05:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233161 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 05:08:10 -0000 Author: bjk (doc committer) Date: Mon Mar 19 05:08:09 2012 New Revision: 233161 URL: http://svn.freebsd.org/changeset/base/233161 Log: Remove trailing whitespace. Approved by: hrs (mentor) Modified: head/lib/libc/sys/setfib.2 Modified: head/lib/libc/sys/setfib.2 ============================================================================== --- head/lib/libc/sys/setfib.2 Mon Mar 19 04:46:11 2012 (r233160) +++ head/lib/libc/sys/setfib.2 Mon Mar 19 05:08:09 2012 (r233161) @@ -47,7 +47,7 @@ The argument must be greater than or equal to 0 and less than the current system maximum which -may be retrieved by the +may be retrieved by the .Va net.fibs sysctl. The system maximum is set in the kernel configuration file with @@ -67,7 +67,7 @@ However, this maximum is capped at 16 du the fib number in a 4-bit field in .Xr mbuf 9 flags. -The default fib of the process will be applied to all protocol families +The default fib of the process will be applied to all protocol families that support multiple fibs, and ignored by those that do not. The default fib for a process may be overridden for a socket with the use of the From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 07:13:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A540106564A; Mon, 19 Mar 2012 07:13:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15EE68FC17; Mon, 19 Mar 2012 07:13:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J7DUMo056321; Mon, 19 Mar 2012 07:13:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J7DUwJ056319; Mon, 19 Mar 2012 07:13:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203190713.q2J7DUwJ056319@svn.freebsd.org> From: Alexander Motin Date: Mon, 19 Mar 2012 07:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233162 - stable/9/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 07:13:31 -0000 Author: mav Date: Mon Mar 19 07:13:30 2012 New Revision: 233162 URL: http://svn.freebsd.org/changeset/base/233162 Log: MFC r232797: ServerWorks HT1000 HPET reported to have problems with IRQs >= 16. Lower (ISA) IRQs are working, but allowed mask is not set correctly. Block both by default to allow HP BL465c G6 blade system to boot. Modified: stable/9/sys/dev/acpica/acpi_hpet.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_hpet.c Mon Mar 19 05:08:09 2012 (r233161) +++ stable/9/sys/dev/acpica/acpi_hpet.c Mon Mar 19 07:13:30 2012 (r233162) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define HPET_VENDID_AMD 0x4353 #define HPET_VENDID_INTEL 0x8086 #define HPET_VENDID_NVIDIA 0x10de +#define HPET_VENDID_SW 0x1166 ACPI_SERIAL_DECL(hpet, "ACPI HPET support"); @@ -513,6 +514,13 @@ hpet_attach(device_t dev) if (vendor == HPET_VENDID_NVIDIA && rev <= 0x01) sc->allowed_irqs = 0x00000000; /* + * ServerWorks HT1000 reported to have problems with IRQs >= 16. + * Lower IRQs are working, but allowed mask is not set correctly. + * Legacy_route mode works fine. + */ + if (vendor == HPET_VENDID_SW && rev <= 0x01) + sc->allowed_irqs = 0x00000000; + /* * Neither QEMU nor VirtualBox report supported IRQs correctly. * The only way to use HPET there is to specify IRQs manually * and/or use legacy_route. Legacy_route mode works on both. From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 07:15:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B057106566B; Mon, 19 Mar 2012 07:15:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B7908FC0A; Mon, 19 Mar 2012 07:15:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J7Fg77056443; Mon, 19 Mar 2012 07:15:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J7Fgun056439; Mon, 19 Mar 2012 07:15:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203190715.q2J7Fgun056439@svn.freebsd.org> From: Alexander Motin Date: Mon, 19 Mar 2012 07:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233163 - in stable/9/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 07:15:43 -0000 Author: mav Date: Mon Mar 19 07:15:42 2012 New Revision: 233163 URL: http://svn.freebsd.org/changeset/base/233163 Log: MFC r232783: Idle ticks optimization: - Pass number of events to the statclock() and profclock() functions same as to hardclock() before to not call them many times in a loop. - Rename them into statclock_cnt() and profclock_cnt(). - Turn statclock() and profclock() into compatibility wrappers, still needed for arm. - Rename hardclock_anycpu() into hardclock_cnt() for unification. Modified: stable/9/sys/kern/kern_clock.c stable/9/sys/kern/kern_clocksource.c stable/9/sys/sys/systm.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_clock.c ============================================================================== --- stable/9/sys/kern/kern_clock.c Mon Mar 19 07:13:30 2012 (r233162) +++ stable/9/sys/kern/kern_clock.c Mon Mar 19 07:15:42 2012 (r233163) @@ -482,7 +482,7 @@ hardclock(int usermode, uintfptr_t pc) } void -hardclock_anycpu(int cnt, int usermode) +hardclock_cnt(int cnt, int usermode) { struct pstats *pstats; struct thread *td = curthread; @@ -687,6 +687,13 @@ stopprofclock(p) void statclock(int usermode) { + + statclock_cnt(1, usermode); +} + +void +statclock_cnt(int cnt, int usermode) +{ struct rusage *ru; struct vmspace *vm; struct thread *td; @@ -702,11 +709,11 @@ statclock(int usermode) /* * Charge the time as appropriate. */ - td->td_uticks++; + td->td_uticks += cnt; if (p->p_nice > NZERO) - cp_time[CP_NICE]++; + cp_time[CP_NICE] += cnt; else - cp_time[CP_USER]++; + cp_time[CP_USER] += cnt; } else { /* * Came from kernel mode, so we were: @@ -722,15 +729,15 @@ statclock(int usermode) */ if ((td->td_pflags & TDP_ITHREAD) || td->td_intr_nesting_level >= 2) { - td->td_iticks++; - cp_time[CP_INTR]++; + td->td_iticks += cnt; + cp_time[CP_INTR] += cnt; } else { - td->td_pticks++; - td->td_sticks++; + td->td_pticks += cnt; + td->td_sticks += cnt; if (!TD_IS_IDLETHREAD(td)) - cp_time[CP_SYS]++; + cp_time[CP_SYS] += cnt; else - cp_time[CP_IDLE]++; + cp_time[CP_IDLE] += cnt; } } @@ -738,22 +745,30 @@ statclock(int usermode) MPASS(p->p_vmspace != NULL); vm = p->p_vmspace; ru = &td->td_ru; - ru->ru_ixrss += pgtok(vm->vm_tsize); - ru->ru_idrss += pgtok(vm->vm_dsize); - ru->ru_isrss += pgtok(vm->vm_ssize); + ru->ru_ixrss += pgtok(vm->vm_tsize) * cnt; + ru->ru_idrss += pgtok(vm->vm_dsize) * cnt; + ru->ru_isrss += pgtok(vm->vm_ssize) * cnt; rss = pgtok(vmspace_resident_count(vm)); if (ru->ru_maxrss < rss) ru->ru_maxrss = rss; KTR_POINT2(KTR_SCHED, "thread", sched_tdname(td), "statclock", "prio:%d", td->td_priority, "stathz:%d", (stathz)?stathz:hz); thread_lock_flags(td, MTX_QUIET); - sched_clock(td); + for ( ; cnt > 0; cnt--) + sched_clock(td); thread_unlock(td); } void profclock(int usermode, uintfptr_t pc) { + + profclock_cnt(1, usermode, pc); +} + +void +profclock_cnt(int cnt, int usermode, uintfptr_t pc) +{ struct thread *td; #ifdef GPROF struct gmonparam *g; @@ -769,7 +784,7 @@ profclock(int usermode, uintfptr_t pc) * bother trying to count it. */ if (td->td_proc->p_flag & P_PROFIL) - addupc_intr(td, pc, 1); + addupc_intr(td, pc, cnt); } #ifdef GPROF else { @@ -780,7 +795,7 @@ profclock(int usermode, uintfptr_t pc) if (g->state == GMON_PROF_ON && pc >= g->lowpc) { i = PC_TO_I(g, pc); if (i < g->textsize) { - KCOUNT(g, i)++; + KCOUNT(g, i) += cnt; } } } Modified: stable/9/sys/kern/kern_clocksource.c ============================================================================== --- stable/9/sys/kern/kern_clocksource.c Mon Mar 19 07:13:30 2012 (r233162) +++ stable/9/sys/kern/kern_clocksource.c Mon Mar 19 07:15:42 2012 (r233163) @@ -195,28 +195,34 @@ handleevents(struct bintime *now, int fa pc = TRAPF_PC(frame); } - runs = 0; state = DPCPU_PTR(timerstate); + runs = 0; while (bintime_cmp(now, &state->nexthard, >=)) { bintime_add(&state->nexthard, &hardperiod); runs++; } if (runs && fake < 2) { - hardclock_anycpu(runs, usermode); + hardclock_cnt(runs, usermode); done = 1; } + runs = 0; while (bintime_cmp(now, &state->nextstat, >=)) { - if (fake < 2) - statclock(usermode); bintime_add(&state->nextstat, &statperiod); + runs++; + } + if (runs && fake < 2) { + statclock_cnt(runs, usermode); done = 1; } if (profiling) { + runs = 0; while (bintime_cmp(now, &state->nextprof, >=)) { - if (!fake) - profclock(usermode, pc); bintime_add(&state->nextprof, &profperiod); + runs++; + } + if (runs && !fake) { + profclock_cnt(runs, usermode, pc); done = 1; } } else Modified: stable/9/sys/sys/systm.h ============================================================================== --- stable/9/sys/sys/systm.h Mon Mar 19 07:13:30 2012 (r233162) +++ stable/9/sys/sys/systm.h Mon Mar 19 07:15:42 2012 (r233163) @@ -238,12 +238,14 @@ void realitexpire(void *); int sysbeep(int hertz, int period); void hardclock(int usermode, uintfptr_t pc); -void hardclock_anycpu(int cnt, int usermode); +void hardclock_cnt(int cnt, int usermode); void hardclock_cpu(int usermode); void hardclock_sync(int cpu); void softclock(void *); void statclock(int usermode); +void statclock_cnt(int cnt, int usermode); void profclock(int usermode, uintfptr_t pc); +void profclock_cnt(int cnt, int usermode, uintfptr_t pc); int hardclockintr(void); From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 07:21:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 007B0106566B; Mon, 19 Mar 2012 07:21:41 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id EFE1B8FC12; Mon, 19 Mar 2012 07:21:39 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so5643541bkc.13 for ; Mon, 19 Mar 2012 00:21:38 -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=6Egw8MFzlyaSFqXg2sTA9twQfSATr7jyPZi1asxeu28=; b=zNWlU3J4hxS9zZnX1KiVwWvH/kTTr3wtuVGmqvKf2D+GvtQp9Qpmu/jTRg4suh6B9l OmyGxG3v2tl7QYpYXnSwSHQdey9m/xDcEfWIkVIdHcsB/xpx77VRoox3rR3loEbC8y2b IxZW68HmpFW+FzbdKovAIrXGQ9gvIWS5g8g6j3PvOMHRdhQjFJRWsp4mGyjNwA19nbhX bsM7XSraVWCjPjWllqhifaJ/CYniA+2ZW7Kreo7iVqmqsxF8gK7kY6w50IOsBRsClYUG 5AWJ0EaJajo0hoCbyyg41l5JxI+k+Ae+JuWtcOKUZpdL3aGP5dlMLaA7yYY8Q03ToLLH wbPg== MIME-Version: 1.0 Received: by 10.205.137.15 with SMTP id im15mr4204060bkc.54.1332141698806; Mon, 19 Mar 2012 00:21:38 -0700 (PDT) Received: by 10.204.202.142 with HTTP; Mon, 19 Mar 2012 00:21:38 -0700 (PDT) Received: by 10.204.202.142 with HTTP; Mon, 19 Mar 2012 00:21:38 -0700 (PDT) In-Reply-To: <20120317162754.I1530@besplex.bde.org> References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <20120317162754.I1530@besplex.bde.org> Date: Mon, 19 Mar 2012 07:21:38 +0000 Message-ID: From: Chris Rees To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 07:21:41 -0000 On 17 Mar 2012 05:40, "Bruce Evans" wrote: > > On Fri, 16 Mar 2012, Dimitry Andric wrote: > >> Log: >> Change the style of share/mk/bsd.sys.mk to that of the other bsd.*.mk >> files, and style.Makefile(5), where applicable. While here, update the >> link to the gcc warning documentation. > > > Thanks. I rather liked the "^.* foo" style for making ifdefs less > unreadable, but it didn't look like it was written here, and it is > a sign of other problems that so many nested ifdefs are used. It > only used a single space of each level of indentation, so the > indentation was still hard too see. > > The "other bsd.*.mk" files don't include bsd.cpu.mk. This still uses > the "^. *foo" style (and is now the only *.mk file one that does this). > For assignments, it mostly uses a different unusual style -- just the > normal C style of a single space before and after '=' (or '+='). Weird > formattings of assignments are harder to grep for than weird formattings > of ".foo", so I didn't try looking for them all. > Indented .ifs etc are used (inconsistently) in bsd.port.mk et al, and can make a huge difference to readability; make is such a messy language that multiple levels are often needed. Perhaps we should try to agree a standard on them, perhaps two spaces? It's a shame to be stripping them out. Chris From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 07:24:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63E11106566B; Mon, 19 Mar 2012 07:24:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1111A8FC12; Mon, 19 Mar 2012 07:24:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J7OQuD056799; Mon, 19 Mar 2012 07:24:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J7OQ3i056795; Mon, 19 Mar 2012 07:24:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203190724.q2J7OQ3i056795@svn.freebsd.org> From: Alexander Motin Date: Mon, 19 Mar 2012 07:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233164 - stable/9/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 07:24:28 -0000 Author: mav Date: Mon Mar 19 07:24:26 2012 New Revision: 233164 URL: http://svn.freebsd.org/changeset/base/233164 Log: MFC r230845: Make sound(4) more flexible in setting soft buffer and block sizes when hardware imposes strict limitations on hard buffer and block sizes. Previous code set soft buffer to be no smaller then hard buffer. On some cards with fixed 64K physical buffer that caused up to 800ms play latency. New code allows to set soft buffer size down to just two blocks of the hard buffer and to not write more then that size ahead to the hardware buffer. As result of that change I was able to reduce full practically measured record-playback loop delay in those conditions down to only about 115ms with theoretical playback latency of only about 50ms. New code works fine for both vchans and direct cases. In both cases sound(4) tries to follow hw.snd.latency_profile and hw.snd.latency values and application-requested buffer and block sizes as much as limitation of two hardware blocks allows. Modified: stable/9/sys/dev/sound/pcm/buffer.c stable/9/sys/dev/sound/pcm/buffer.h stable/9/sys/dev/sound/pcm/channel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/sound/pcm/buffer.c ============================================================================== --- stable/9/sys/dev/sound/pcm/buffer.c Mon Mar 19 07:15:42 2012 (r233163) +++ stable/9/sys/dev/sound/pcm/buffer.c Mon Mar 19 07:24:26 2012 (r233164) @@ -301,6 +301,15 @@ sndbuf_fillsilence(struct snd_dbuf *b) b->rl = b->bufsize; } +void +sndbuf_fillsilence_rl(struct snd_dbuf *b, u_int rl) +{ + if (b->bufsize > 0) + memset(sndbuf_getbuf(b), sndbuf_zerodata(b->fmt), b->bufsize); + b->rp = 0; + b->rl = min(b->bufsize, rl); +} + /** * @brief Reset buffer w/o flushing statistics * Modified: stable/9/sys/dev/sound/pcm/buffer.h ============================================================================== --- stable/9/sys/dev/sound/pcm/buffer.h Mon Mar 19 07:15:42 2012 (r233163) +++ stable/9/sys/dev/sound/pcm/buffer.h Mon Mar 19 07:24:26 2012 (r233164) @@ -74,6 +74,7 @@ int sndbuf_remalloc(struct snd_dbuf *b, void sndbuf_reset(struct snd_dbuf *b); void sndbuf_clear(struct snd_dbuf *b, unsigned int length); void sndbuf_fillsilence(struct snd_dbuf *b); +void sndbuf_fillsilence_rl(struct snd_dbuf *b, u_int rl); void sndbuf_softreset(struct snd_dbuf *b); void sndbuf_clearshadow(struct snd_dbuf *b); Modified: stable/9/sys/dev/sound/pcm/channel.c ============================================================================== --- stable/9/sys/dev/sound/pcm/channel.c Mon Mar 19 07:15:42 2012 (r233163) +++ stable/9/sys/dev/sound/pcm/channel.c Mon Mar 19 07:24:26 2012 (r233164) @@ -395,24 +395,28 @@ chn_wrfeed(struct pcm_channel *c) { struct snd_dbuf *b = c->bufhard; struct snd_dbuf *bs = c->bufsoft; - unsigned int amt; + unsigned int amt, want, wasfree; CHN_LOCKASSERT(c); if ((c->flags & CHN_F_MMAP) && !(c->flags & CHN_F_CLOSING)) sndbuf_acquire(bs, NULL, sndbuf_getfree(bs)); - amt = sndbuf_getfree(b); + wasfree = sndbuf_getfree(b); + want = min(sndbuf_getsize(b), + imax(0, sndbuf_xbytes(sndbuf_getsize(bs), bs, b) - + sndbuf_getready(b))); + amt = min(wasfree, want); if (amt > 0) sndbuf_feed(bs, b, c, c->feeder, amt); /* * Possible xruns. There should be no empty space left in buffer. */ - if (sndbuf_getfree(b) > 0) + if (sndbuf_getready(b) < want) c->xruns++; - if (sndbuf_getfree(b) < amt) + if (sndbuf_getfree(b) < wasfree) chn_wakeup(c); } @@ -721,7 +725,8 @@ chn_start(struct pcm_channel *c, int for } if (c->parentchannel == NULL) { if (c->direction == PCMDIR_PLAY) - sndbuf_fillsilence(b); + sndbuf_fillsilence_rl(b, + sndbuf_xbytes(sndbuf_getsize(bs), bs, b)); if (snd_verbose > 3) device_printf(c->dev, "%s(): %s starting! (%s/%s) " @@ -1728,7 +1733,7 @@ chn_resizebuf(struct pcm_channel *c, int int blkcnt, int blksz) { struct snd_dbuf *b, *bs, *pb; - int sblksz, sblkcnt, hblksz, hblkcnt, limit = 1; + int sblksz, sblkcnt, hblksz, hblkcnt, limit = 0, nsblksz, nsblkcnt; int ret; CHN_LOCKASSERT(c); @@ -1748,7 +1753,6 @@ chn_resizebuf(struct pcm_channel *c, int return EINVAL; else { c->latency = latency; - limit = 0; } bs = c->bufsoft; @@ -1783,19 +1787,22 @@ chn_resizebuf(struct pcm_channel *c, int */ sblksz = round_blksz(blksz, sndbuf_getalign(bs)); sblkcnt = round_pow2(blkcnt); - limit = 0; } if (c->parentchannel != NULL) { - pb = CHN_BUF_PARENT(c, NULL); + pb = c->parentchannel->bufsoft; CHN_UNLOCK(c); CHN_LOCK(c->parentchannel); chn_notify(c->parentchannel, CHN_N_BLOCKSIZE); CHN_UNLOCK(c->parentchannel); CHN_LOCK(c); - limit = (limit != 0 && pb != NULL) ? - sndbuf_xbytes(sndbuf_getsize(pb), pb, bs) : 0; - c->timeout = c->parentchannel->timeout; + if (c->direction == PCMDIR_PLAY) { + limit = (pb != NULL) ? + sndbuf_xbytes(sndbuf_getsize(pb), pb, bs) : 0; + } else { + limit = (pb != NULL) ? + sndbuf_xbytes(sndbuf_getblksz(pb), pb, bs) * 2 : 0; + } } else { hblkcnt = 2; if (c->flags & CHN_F_HAS_SIZE) { @@ -1836,21 +1843,22 @@ chn_resizebuf(struct pcm_channel *c, int CHN_LOCK(c); if (!CHN_EMPTY(c, children)) { - sblksz = round_blksz( - sndbuf_xbytes(sndbuf_getsize(b) >> 1, b, bs), + nsblksz = round_blksz( + sndbuf_xbytes(sndbuf_getblksz(b), b, bs), sndbuf_getalign(bs)); - sblkcnt = 2; + nsblkcnt = sndbuf_getblkcnt(b); + if (c->direction == PCMDIR_PLAY) { + do { + nsblkcnt--; + } while (nsblkcnt >= 2 && + nsblksz * nsblkcnt >= sblksz * sblkcnt); + nsblkcnt++; + } + sblksz = nsblksz; + sblkcnt = nsblkcnt; limit = 0; - } else if (limit != 0) - limit = sndbuf_xbytes(sndbuf_getsize(b), b, bs); - - /* - * Interrupt timeout - */ - c->timeout = ((u_int64_t)hz * sndbuf_getsize(b)) / - ((u_int64_t)sndbuf_getspd(b) * sndbuf_getalign(b)); - if (c->timeout < 1) - c->timeout = 1; + } else + limit = sndbuf_xbytes(sndbuf_getblksz(b), b, bs) * 2; } if (limit > CHN_2NDBUFMAXSIZE) @@ -1887,6 +1895,16 @@ chn_resizebuf(struct pcm_channel *c, int } /* + * Interrupt timeout + */ + c->timeout = ((u_int64_t)hz * sndbuf_getsize(bs)) / + ((u_int64_t)sndbuf_getspd(bs) * sndbuf_getalign(bs)); + if (c->parentchannel != NULL) + c->timeout = min(c->timeout, c->parentchannel->timeout); + if (c->timeout < 1) + c->timeout = 1; + + /* * OSSv4 docs: "By default OSS will set the low water level equal * to the fragment size which is optimal in most cases." */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 07:34:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 245CA106564A; Mon, 19 Mar 2012 07:34:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BBCC8FC0A; Mon, 19 Mar 2012 07:34:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J7Y9jk057174; Mon, 19 Mar 2012 07:34:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J7Y91n057165; Mon, 19 Mar 2012 07:34:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203190734.q2J7Y91n057165@svn.freebsd.org> From: Alexander Motin Date: Mon, 19 Mar 2012 07:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233165 - in stable/9: share/man/man4 sys/conf sys/dev/sound/pci sys/modules/sound/driver sys/modules/sound/driver/hdspe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 07:34:10 -0000 Author: mav Date: Mon Mar 19 07:34:09 2012 New Revision: 233165 URL: http://svn.freebsd.org/changeset/base/233165 Log: MFC r232337: Add driver for the RME HDSPe AIO/RayDAT sound cards -- snd_hdspe(4). Cards are expensive and so rare, so leave the driver as module. Submitted by: Ruslan Bukin Added: stable/9/share/man/man4/snd_hdspe.4 - copied unchanged from r232337, head/share/man/man4/snd_hdspe.4 stable/9/sys/dev/sound/pci/hdspe-pcm.c - copied unchanged from r232337, head/sys/dev/sound/pci/hdspe-pcm.c stable/9/sys/dev/sound/pci/hdspe.c - copied unchanged from r232337, head/sys/dev/sound/pci/hdspe.c stable/9/sys/dev/sound/pci/hdspe.h - copied unchanged from r232337, head/sys/dev/sound/pci/hdspe.h stable/9/sys/modules/sound/driver/hdspe/ - copied from r232337, head/sys/modules/sound/driver/hdspe/ Modified: stable/9/share/man/man4/Makefile stable/9/share/man/man4/pcm.4 stable/9/sys/conf/NOTES stable/9/sys/conf/files stable/9/sys/modules/sound/driver/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Mon Mar 19 07:24:26 2012 (r233164) +++ stable/9/share/man/man4/Makefile Mon Mar 19 07:34:09 2012 (r233165) @@ -414,6 +414,7 @@ MAN= aac.4 \ snd_fm801.4 \ snd_gusc.4 \ snd_hda.4 \ + snd_hdspe.4 \ snd_ich.4 \ snd_maestro3.4 \ snd_maestro.4 \ Modified: stable/9/share/man/man4/pcm.4 ============================================================================== --- stable/9/share/man/man4/pcm.4 Mon Mar 19 07:24:26 2012 (r233164) +++ stable/9/share/man/man4/pcm.4 Mon Mar 19 07:34:09 2012 (r233165) @@ -113,6 +113,8 @@ The following bridge device drivers are .It .Xr snd_hda 4 (enabled by default on amd64, i386) .It +.Xr snd_hdspe 4 +.It .Xr snd_ich 4 (enabled by default on amd64, i386) .It .Xr snd_maestro 4 @@ -714,6 +716,7 @@ A device node is not created properly. .Xr snd_fm801 4 , .Xr snd_gusc 4 , .Xr snd_hda 4 , +.Xr snd_hdspe 4 , .Xr snd_ich 4 , .Xr snd_maestro 4 , .Xr snd_maestro3 4 , Copied: stable/9/share/man/man4/snd_hdspe.4 (from r232337, head/share/man/man4/snd_hdspe.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/snd_hdspe.4 Mon Mar 19 07:34:09 2012 (r233165, copy of r232337, head/share/man/man4/snd_hdspe.4) @@ -0,0 +1,76 @@ +.\" Copyright (c) 2012 Ruslan Bukin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 13, 2012 +.Dt SND_HDSPE 4 +.Os +.Sh NAME +.Nm snd_hdspe +.Nd "RME HDSPe brigde device driver" +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device sound" +.Cd "device snd_hdspe" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the +following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +snd_hdspe_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +bridge driver allows the generic audio driver +.Xr sound 4 +to attach to RME HDSPe audio devices. +.Sh HARDWARE +The +.Nm +driver supports the following audio devices: +.Pp +.Bl -bullet -compact +.It +RME HDSPe AIO +.It +RME HDSPe RayDAT +.El +.Sh SEE ALSO +.Xr sound 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Ruslan Bukin . Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Mon Mar 19 07:24:26 2012 (r233164) +++ stable/9/sys/conf/NOTES Mon Mar 19 07:34:09 2012 (r233165) @@ -2246,6 +2246,7 @@ device sound # snd_gusc: Gravis UltraSound ISA PnP/non-PnP. # snd_hda: Intel High Definition Audio (Controller) and # compatible. +# snd_hdspe: RME HDSPe AIO and RayDAT. # snd_ich: Intel ICH AC'97 and some more audio controllers # embedded in a chipset, for example nVidia # nForce controllers. @@ -2285,6 +2286,7 @@ device snd_ess device snd_fm801 device snd_gusc device snd_hda +device snd_hdspe device snd_ich device snd_maestro device snd_maestro3 Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Mar 19 07:24:26 2012 (r233164) +++ stable/9/sys/conf/files Mon Mar 19 07:34:09 2012 (r233165) @@ -1754,6 +1754,8 @@ dev/sound/pci/hda/hdaa_patches.c optiona dev/sound/pci/hda/hdac.c optional snd_hda pci dev/sound/pci/hda/hdac_if.m optional snd_hda pci dev/sound/pci/hda/hdacc.c optional snd_hda pci +dev/sound/pci/hdspe.c optional snd_hdspe pci +dev/sound/pci/hdspe-pcm.c optional snd_hdspe pci dev/sound/pcm/ac97.c optional sound dev/sound/pcm/ac97_if.m optional sound dev/sound/pcm/ac97_patch.c optional sound Copied: stable/9/sys/dev/sound/pci/hdspe-pcm.c (from r232337, head/sys/dev/sound/pci/hdspe-pcm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/sound/pci/hdspe-pcm.c Mon Mar 19 07:34:09 2012 (r233165, copy of r232337, head/sys/dev/sound/pci/hdspe-pcm.c) @@ -0,0 +1,709 @@ +/*- + * Copyright (c) 2012 Ruslan Bukin + * 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. + */ + +/* + * RME HDSPe driver for FreeBSD (pcm-part). + * Supported cards: AIO, RayDAT. + */ + +#include +#include +#include + +#include +#include + +#include + +SND_DECLARE_FILE("$FreeBSD$"); + +struct hdspe_latency { + uint32_t n; + uint32_t period; + float ms; +}; + +static struct hdspe_latency latency_map[] = { + { 7, 32, 0.7 }, + { 0, 64, 1.5 }, + { 1, 128, 3 }, + { 2, 256, 6 }, + { 3, 512, 12 }, + { 4, 1024, 23 }, + { 5, 2048, 46 }, + { 6, 4096, 93 }, + + { 0, 0, 0 }, +}; + +struct hdspe_rate { + uint32_t speed; + uint32_t reg; +}; + +static struct hdspe_rate rate_map[] = { + { 32000, (HDSPE_FREQ_32000) }, + { 44100, (HDSPE_FREQ_44100) }, + { 48000, (HDSPE_FREQ_48000) }, + { 64000, (HDSPE_FREQ_32000 | HDSPE_FREQ_DOUBLE) }, + { 88200, (HDSPE_FREQ_44100 | HDSPE_FREQ_DOUBLE) }, + { 96000, (HDSPE_FREQ_48000 | HDSPE_FREQ_DOUBLE) }, + { 128000, (HDSPE_FREQ_32000 | HDSPE_FREQ_QUAD) }, + { 176400, (HDSPE_FREQ_44100 | HDSPE_FREQ_QUAD) }, + { 192000, (HDSPE_FREQ_48000 | HDSPE_FREQ_QUAD) }, + + { 0, 0 }, +}; + + +static int +hdspe_hw_mixer(struct sc_chinfo *ch, unsigned int dst, + unsigned int src, unsigned short data) +{ + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + int offs = 0; + + if (ch->dir == PCMDIR_PLAY) + offs = 64; + + hdspe_write_4(sc, HDSPE_MIXER_BASE + + ((offs + src + 128 * dst) * sizeof(uint32_t)), + data & 0xFFFF); + + return 0; +}; + +static int +hdspechan_setgain(struct sc_chinfo *ch) +{ + + hdspe_hw_mixer(ch, ch->lslot, ch->lslot, + ch->lvol * HDSPE_MAX_GAIN / 100); + hdspe_hw_mixer(ch, ch->rslot, ch->rslot, + ch->rvol * HDSPE_MAX_GAIN / 100); + + return 0; +} + +static int +hdspemixer_init(struct snd_mixer *m) +{ + struct sc_pcminfo *scp = mix_getdevinfo(m); + struct sc_info *sc = scp->sc; + int mask; + + if (sc == NULL) + return -1; + + mask = SOUND_MASK_PCM; + + if (scp->hc->play) + mask |= SOUND_MASK_VOLUME; + + if (scp->hc->rec) + mask |= SOUND_MASK_RECLEV; + + snd_mtxlock(sc->lock); + pcm_setflags(scp->dev, pcm_getflags(scp->dev) | SD_F_SOFTPCMVOL); + mix_setdevs(m, mask); + snd_mtxunlock(sc->lock); + + return 0; +} + +static int +hdspemixer_set(struct snd_mixer *m, unsigned dev, + unsigned left, unsigned right) +{ + struct sc_pcminfo *scp = mix_getdevinfo(m); + struct sc_chinfo *ch; + int i; + +#if 0 + device_printf(scp->dev, "hdspemixer_set() %d %d\n", + left,right); +#endif + + for (i = 0; i < scp->chnum; i++) { + ch = &scp->chan[i]; + if ((dev == SOUND_MIXER_VOLUME && ch->dir == PCMDIR_PLAY) || + (dev == SOUND_MIXER_RECLEV && ch->dir == PCMDIR_REC)) { + ch->lvol = left; + ch->rvol = right; + if (ch->run) + hdspechan_setgain(ch); + } + } + + return 0; +} + +static kobj_method_t hdspemixer_methods[] = { + KOBJMETHOD(mixer_init, hdspemixer_init), + KOBJMETHOD(mixer_set, hdspemixer_set), + KOBJMETHOD_END +}; +MIXER_DECLARE(hdspemixer); + +static void +hdspechan_enable(struct sc_chinfo *ch, int value) +{ + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + int reg; + + if (ch->dir == PCMDIR_PLAY) + reg = HDSPE_OUT_ENABLE_BASE; + else + reg = HDSPE_IN_ENABLE_BASE; + + ch->run = value; + + hdspe_write_1(sc, reg + (4 * ch->lslot), value); + hdspe_write_1(sc, reg + (4 * ch->rslot), value); +} + +static int +hdspe_running(struct sc_info *sc) +{ + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + int i, j, devcount, err; + device_t *devlist; + + if ((err = device_get_children(sc->dev, &devlist, &devcount)) != 0) + goto bad; + + for (i = 0; i < devcount; i++) { + scp = device_get_ivars(devlist[i]); + for (j = 0; j < scp->chnum; j++) { + ch = &scp->chan[j]; + if (ch->run) + goto bad; + } + } + + return 0; +bad: + +#if 0 + device_printf(sc->dev,"hdspe is running\n"); +#endif + + return 1; +} + +static void +hdspe_start_audio(struct sc_info *sc) +{ + + sc->ctrl_register |= (HDSPE_AUDIO_INT_ENABLE | HDSPE_ENABLE); + hdspe_write_4(sc, HDSPE_CONTROL_REG, sc->ctrl_register); +} + +static void +hdspe_stop_audio(struct sc_info *sc) +{ + + if (hdspe_running(sc) == 1) + return; + + sc->ctrl_register &= ~(HDSPE_AUDIO_INT_ENABLE | HDSPE_ENABLE); + hdspe_write_4(sc, HDSPE_CONTROL_REG, sc->ctrl_register); +} + +/* Multiplex / demultiplex: 2.0 <-> 2 x 1.0. */ +static void +buffer_copy(struct sc_chinfo *ch) +{ + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + int length,src,dst; + int ssize, dsize; + int i; + + length = sndbuf_getready(ch->buffer) / + (4 /* Bytes per sample. */ * 2 /* channels */); + + if (ch->dir == PCMDIR_PLAY) { + src = sndbuf_getreadyptr(ch->buffer); + } else { + src = sndbuf_getfreeptr(ch->buffer); + } + + src /= 4; /* Bytes per sample. */ + dst = src / 2; /* Destination buffer twice smaller. */ + + ssize = ch->size / 4; + dsize = ch->size / 8; + + /* + * Use two fragment buffer to avoid sound clipping. + */ + + for (i = 0; i < sc->period * 2 /* fragments */; i++) { + if (ch->dir == PCMDIR_PLAY) { + sc->pbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->lslot] = + ch->data[src]; + sc->pbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->rslot] = + ch->data[src + 1]; + + } else { + ch->data[src] = + sc->rbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->lslot]; + ch->data[src+1] = + sc->rbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->rslot]; + } + + dst+=1; + dst %= dsize; + src+=2; + src %= ssize; + } +} + +static int +clean(struct sc_chinfo *ch){ + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + uint32_t *buf = sc->rbuf; + + if (ch->dir == PCMDIR_PLAY) { + buf = sc->pbuf; + } + + bzero(buf + HDSPE_CHANBUF_SAMPLES * ch->lslot, HDSPE_CHANBUF_SIZE); + bzero(buf + HDSPE_CHANBUF_SAMPLES * ch->rslot, HDSPE_CHANBUF_SIZE); + + return 0; +} + + +/* Channel interface. */ +static void * +hdspechan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, + struct pcm_channel *c, int dir) +{ + struct sc_pcminfo *scp = devinfo; + struct sc_info *sc = scp->sc; + struct sc_chinfo *ch; + int num; + + snd_mtxlock(sc->lock); + num = scp->chnum; + + ch = &scp->chan[num]; + ch->lslot = scp->hc->left; + ch->rslot = scp->hc->right; + ch->run = 0; + ch->lvol = 0; + ch->rvol = 0; + + ch->size = HDSPE_CHANBUF_SIZE * 2 /* slots */; + ch->data = malloc(ch->size, M_HDSPE, M_NOWAIT); + + ch->buffer = b; + ch->channel = c; + ch->parent = scp; + + ch->dir = dir; + + snd_mtxunlock(sc->lock); + + if (sndbuf_setup(ch->buffer, ch->data, ch->size) != 0) { + device_printf(scp->dev, "Can't setup sndbuf.\n"); + return NULL; + } + + return ch; +} + +static int +hdspechan_trigger(kobj_t obj, void *data, int go) +{ + struct sc_chinfo *ch = data; + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + + snd_mtxlock(sc->lock); + switch (go) { + case PCMTRIG_START: +#if 0 + device_printf(scp->dev, "hdspechan_trigger(): start\n"); +#endif + hdspechan_enable(ch, 1); + hdspechan_setgain(ch); + hdspe_start_audio(sc); + break; + + case PCMTRIG_STOP: + case PCMTRIG_ABORT: +#if 0 + device_printf(scp->dev, "hdspechan_trigger(): stop or abort\n"); +#endif + clean(ch); + hdspechan_enable(ch, 0); + hdspe_stop_audio(sc); + break; + + case PCMTRIG_EMLDMAWR: + case PCMTRIG_EMLDMARD: + if(ch->run) + buffer_copy(ch); + break; + } + + snd_mtxunlock(sc->lock); + + return 0; +} + +static uint32_t +hdspechan_getptr(kobj_t obj, void *data) +{ + struct sc_chinfo *ch = data; + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + uint32_t ret, pos; + + snd_mtxlock(sc->lock); + ret = hdspe_read_2(sc, HDSPE_STATUS_REG); + snd_mtxunlock(sc->lock); + + pos = ret & HDSPE_BUF_POSITION_MASK; + pos *= 2; /* Hardbuf twice bigger. */ + + return pos; +} + +static int +hdspechan_free(kobj_t obj, void *data) +{ + struct sc_chinfo *ch = data; + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + +#if 0 + device_printf(scp->dev, "hdspechan_free()\n"); +#endif + snd_mtxlock(sc->lock); + if (ch->data != NULL) { + free(ch->data, M_HDSPE); + ch->data = NULL; + } + snd_mtxunlock(sc->lock); + + return 0; +} + +static int +hdspechan_setformat(kobj_t obj, void *data, uint32_t format) +{ + struct sc_chinfo *ch = data; + +#if 0 + struct sc_pcminfo *scp = ch->parent; + device_printf(scp->dev, "hdspechan_setformat(%d)\n", format); +#endif + + ch->format = format; + + return 0; +} + +static uint32_t +hdspechan_setspeed(kobj_t obj, void *data, uint32_t speed) +{ + struct sc_chinfo *ch = data; + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + struct hdspe_rate *hr = NULL; + long long period; + int threshold; + int i; + +#if 0 + device_printf(scp->dev, "hdspechan_setspeed(%d)\n", speed); +#endif + + if (hdspe_running(sc) == 1) + goto end; + + /* First look for equal frequency. */ + for (i = 0; rate_map[i].speed != 0; i++) { + if (rate_map[i].speed == speed) + hr = &rate_map[i]; + } + + /* If no match, just find nearest. */ + if (hr == NULL) { + for (i = 0; rate_map[i].speed != 0; i++) { + hr = &rate_map[i]; + threshold = hr->speed + ((rate_map[i + 1].speed != 0) ? + ((rate_map[i + 1].speed - hr->speed) >> 1) : 0); + if (speed < threshold) + break; + } + } + + switch (sc->type) { + case RAYDAT: + case AIO: + period = HDSPE_FREQ_AIO; + break; + default: + /* Unsupported card. */ + goto end; + } + + /* Write frequency on the device. */ + sc->ctrl_register &= ~HDSPE_FREQ_MASK; + sc->ctrl_register |= hr->reg; + hdspe_write_4(sc, HDSPE_CONTROL_REG, sc->ctrl_register); + + speed = hr->speed; + if (speed > 96000) + speed /= 4; + else if (speed > 48000) + speed /= 2; + + /* Set DDS value. */ + period /= speed; + hdspe_write_4(sc, HDSPE_FREQ_REG, period); + + sc->speed = hr->speed; +end: + return sc->speed; +} + +static uint32_t +hdspechan_setblocksize(kobj_t obj, void *data, uint32_t blocksize) +{ + struct sc_chinfo *ch = data; + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + struct hdspe_latency *hl = NULL; + int threshold; + int i; + +#if 0 + device_printf(scp->dev, "hdspechan_setblocksize(%d)\n", blocksize); +#endif + + if (hdspe_running(sc) == 1) + goto end; + + if (blocksize > HDSPE_LAT_BYTES_MAX) + blocksize = HDSPE_LAT_BYTES_MAX; + else if (blocksize < HDSPE_LAT_BYTES_MIN) + blocksize = HDSPE_LAT_BYTES_MIN; + + blocksize /= 4 /* samples */; + + /* First look for equal latency. */ + for (i = 0; latency_map[i].period != 0; i++) { + if (latency_map[i].period == blocksize) { + hl = &latency_map[i]; + } + } + + /* If no match, just find nearest. */ + if (hl == NULL) { + for (i = 0; latency_map[i].period != 0; i++) { + hl = &latency_map[i]; + threshold = hl->period + ((latency_map[i + 1].period != 0) ? + ((latency_map[i + 1].period - hl->period) >> 1) : 0); + if (blocksize < threshold) + break; + } + } + + snd_mtxlock(sc->lock); + sc->ctrl_register &= ~HDSPE_LAT_MASK; + sc->ctrl_register |= hdspe_encode_latency(hl->n); + hdspe_write_4(sc, HDSPE_CONTROL_REG, sc->ctrl_register); + sc->period = hl->period; + snd_mtxunlock(sc->lock); + +#if 0 + device_printf(scp->dev, "New period=%d\n", sc->period); +#endif + + sndbuf_resize(ch->buffer, (HDSPE_CHANBUF_SIZE * 2) / (sc->period * 4), + (sc->period * 4)); +end: + return sndbuf_getblksz(ch->buffer); +} + +static uint32_t hdspe_rfmt[] = { + SND_FORMAT(AFMT_S32_LE, 2, 0), + 0 +}; + +static struct pcmchan_caps hdspe_rcaps = {32000, 192000, hdspe_rfmt, 0}; + +static uint32_t hdspe_pfmt[] = { + SND_FORMAT(AFMT_S32_LE, 2, 0), + 0 +}; + +static struct pcmchan_caps hdspe_pcaps = {32000, 192000, hdspe_pfmt, 0}; + +static struct pcmchan_caps * +hdspechan_getcaps(kobj_t obj, void *data) +{ + struct sc_chinfo *ch = data; + +#if 0 + struct sc_pcminfo *scl = ch->parent; + device_printf(scp->dev, "hdspechan_getcaps()\n"); +#endif + + return (ch->dir == PCMDIR_PLAY) ? + &hdspe_pcaps : &hdspe_rcaps; +} + +static kobj_method_t hdspechan_methods[] = { + KOBJMETHOD(channel_init, hdspechan_init), + KOBJMETHOD(channel_free, hdspechan_free), + KOBJMETHOD(channel_setformat, hdspechan_setformat), + KOBJMETHOD(channel_setspeed, hdspechan_setspeed), + KOBJMETHOD(channel_setblocksize, hdspechan_setblocksize), + KOBJMETHOD(channel_trigger, hdspechan_trigger), + KOBJMETHOD(channel_getptr, hdspechan_getptr), + KOBJMETHOD(channel_getcaps, hdspechan_getcaps), + KOBJMETHOD_END +}; +CHANNEL_DECLARE(hdspechan); + + +static int +hdspe_pcm_probe(device_t dev) +{ + +#if 0 + device_printf(dev,"hdspe_pcm_probe()\n"); +#endif + + return 0; +} + +static uint32_t +hdspe_pcm_intr(struct sc_pcminfo *scp) { + struct sc_chinfo *ch; + struct sc_info *sc = scp->sc; + int i; + + for (i = 0; i < scp->chnum; i++) { + ch = &scp->chan[i]; + snd_mtxunlock(sc->lock); + chn_intr(ch->channel); + snd_mtxlock(sc->lock); + } + + return 0; +} + +static int +hdspe_pcm_attach(device_t dev) +{ + struct sc_pcminfo *scp; + char status[SND_STATUSLEN]; + char desc[64]; + int i, err; + + scp = device_get_ivars(dev); + scp->ih = &hdspe_pcm_intr; + + bzero(desc, sizeof(desc)); + snprintf(desc, sizeof(desc), "HDSPe AIO [%s]", scp->hc->descr); + device_set_desc_copy(dev, desc); + + /* + * We don't register interrupt handler with snd_setup_intr + * in pcm device. Mark pcm device as MPSAFE manually. + */ + pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); + + err = pcm_register(dev, scp, scp->hc->play, scp->hc->rec); + if (err) { + device_printf(dev, "Can't register pcm.\n"); + return ENXIO; + } + + scp->chnum = 0; + for (i = 0; i < scp->hc->play; i++) { + pcm_addchan(dev, PCMDIR_PLAY, &hdspechan_class, scp); + scp->chnum++; + } + + for (i = 0; i < scp->hc->rec; i++) { + pcm_addchan(dev, PCMDIR_REC, &hdspechan_class, scp); + scp->chnum++; + } + + snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld %s", + rman_get_start(scp->sc->cs), + rman_get_start(scp->sc->irq), + PCM_KLDSTRING(snd_hdspe)); + pcm_setstatus(dev, status); + + mixer_init(dev, &hdspemixer_class, scp); + + return 0; +} + +static int +hdspe_pcm_detach(device_t dev) +{ + int err; + + err = pcm_unregister(dev); + if (err) { + device_printf(dev, "Can't unregister device.\n"); + return err; + } + + return 0; +} + +static device_method_t hdspe_pcm_methods[] = { + DEVMETHOD(device_probe, hdspe_pcm_probe), + DEVMETHOD(device_attach, hdspe_pcm_attach), + DEVMETHOD(device_detach, hdspe_pcm_detach), + { 0, 0 } +}; + +static driver_t hdspe_pcm_driver = { + "pcm", + hdspe_pcm_methods, + PCM_SOFTC_SIZE, +}; + +DRIVER_MODULE(snd_hdspe_pcm, hdspe, hdspe_pcm_driver, pcm_devclass, 0, 0); +MODULE_DEPEND(snd_hdspe, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); +MODULE_VERSION(snd_hdspe, 1); Copied: stable/9/sys/dev/sound/pci/hdspe.c (from r232337, head/sys/dev/sound/pci/hdspe.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/sound/pci/hdspe.c Mon Mar 19 07:34:09 2012 (r233165, copy of r232337, head/sys/dev/sound/pci/hdspe.c) @@ -0,0 +1,410 @@ +/*- + * Copyright (c) 2012 Ruslan Bukin + * 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. + */ + +/* + * RME HDSPe driver for FreeBSD. + * Supported cards: AIO, RayDAT. + */ + +#include +#include +#include + +#include +#include + +#include + +SND_DECLARE_FILE("$FreeBSD$"); + +static struct hdspe_channel chan_map_aio[] = { + { 0, 1, "line", 1, 1 }, + { 6, 7, "phone", 1, 0 }, + { 8, 9, "aes", 1, 1 }, + { 10, 11, "s/pdif", 1, 1 }, + { 12, 16, "adat", 1, 1 }, + + /* Single or double speed. */ + { 14, 18, "adat", 1, 1 }, + + /* Single speed only. */ + { 13, 15, "adat", 1, 1 }, + { 17, 19, "adat", 1, 1 }, + + { 0, 0, NULL, 0, 0 }, +}; + +static struct hdspe_channel chan_map_rd[] = { + { 0, 1, "aes", 1, 1 }, + { 2, 3, "s/pdif", 1, 1 }, + { 4, 5, "adat", 1, 1 }, + { 6, 7, "adat", 1, 1 }, + { 8, 9, "adat", 1, 1 }, + { 10, 11, "adat", 1, 1 }, + + /* Single or double speed. */ + { 12, 13, "adat", 1, 1 }, + { 14, 15, "adat", 1, 1 }, + { 16, 17, "adat", 1, 1 }, + { 18, 19, "adat", 1, 1 }, + + /* Single speed only. */ + { 20, 21, "adat", 1, 1 }, + { 22, 23, "adat", 1, 1 }, + { 24, 25, "adat", 1, 1 }, + { 26, 27, "adat", 1, 1 }, + { 28, 29, "adat", 1, 1 }, + { 30, 31, "adat", 1, 1 }, + { 32, 33, "adat", 1, 1 }, + { 34, 35, "adat", 1, 1 }, + + { 0, 0, NULL, 0, 0 }, +}; + +static void +hdspe_intr(void *p) +{ + struct sc_info *sc = (struct sc_info *)p; + struct sc_pcminfo *scp; + device_t *devlist; + int devcount, status; + int i, err; + + snd_mtxlock(sc->lock); + + status = hdspe_read_1(sc, HDSPE_STATUS_REG); + if (status & HDSPE_AUDIO_IRQ_PENDING) { + if ((err = device_get_children(sc->dev, &devlist, &devcount)) != 0) + return; + + for (i = 0; i < devcount; i++) { + scp = device_get_ivars(devlist[i]); + if (scp->ih != NULL) + scp->ih(scp); + } + + hdspe_write_1(sc, HDSPE_INTERRUPT_ACK, 0); + } + + snd_mtxunlock(sc->lock); +} + +static void +hdspe_dmapsetmap(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ +#if 0 + struct sc_info *sc = (struct sc_info *)arg; + device_printf(sc->dev, "hdspe_dmapsetmap()\n"); +#endif +} + +static int +hdspe_alloc_resources(struct sc_info *sc) +{ + + /* Allocate resource. */ + sc->csid = PCIR_BAR(0); + sc->cs = bus_alloc_resource(sc->dev, SYS_RES_MEMORY, + &sc->csid, 0, ~0, 1, RF_ACTIVE); + + if (!sc->cs) { + device_printf(sc->dev, "Unable to map SYS_RES_MEMORY.\n"); + return (ENXIO); + } + sc->cst = rman_get_bustag(sc->cs); + sc->csh = rman_get_bushandle(sc->cs); + + + /* Allocate interrupt resource. */ + sc->irqid = 0; + sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid, + 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + + if (!sc->irq || + bus_setup_intr(sc->dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV, + NULL, hdspe_intr, sc, &sc->ih)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 07:34:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1593A1065679; Mon, 19 Mar 2012 07:34:57 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id B2C458FC1C; Mon, 19 Mar 2012 07:34:56 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 05041972; Mon, 19 Mar 2012 08:34:54 +0100 (CET) Date: Mon, 19 Mar 2012 08:33:27 +0100 From: Pawel Jakub Dawidek To: Julian Elischer Message-ID: <20120319073326.GO1340@garage.freebsd.pl> References: <201202271338.q1RDcqEQ020033@svn.freebsd.org> <20120318185014.GK1340@garage.freebsd.pl> <4F668422.1000308@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="51uid+Ur/3ko9cBW" Content-Disposition: inline In-Reply-To: <4F668422.1000308@freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu Subject: Re: svn commit: r232209 - in head: lib/libthr/thread sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 07:34:57 -0000 --51uid+Ur/3ko9cBW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 18, 2012 at 05:56:02PM -0700, Julian Elischer wrote: > On 3/18/12 11:50 AM, Pawel Jakub Dawidek wrote: > > On Mon, Feb 27, 2012 at 01:38:52PM +0000, David Xu wrote: > >> Author: davidxu > >> Date: Mon Feb 27 13:38:52 2012 > >> New Revision: 232209 > >> URL: http://svn.freebsd.org/changeset/base/232209 > >> > >> Log: > >> Follow changes made in revision 232144, pass absolute timeout to ke= rnel, > >> this eliminates a clock_gettime() syscall. > > This or some other change has broken CLOCK_MONOTONIC usage with > > condition variables. > > > > You should be able to reproduce this by something like this: > > > > pthread_cond_t cv; > > pthread_condattr_t attr; > > pthread_mutex_t lock; > > struct timespec ts; > > int error; > > > > (void)pthread_mutex_init(&lock, NULL); > > > > (void)pthread_condattr_init(&attr); > > (void)pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); > > > > (void)pthread_cond_init(&cv,&attr); > > (void)pthread_condattr_destroy(&attr); > > > > (void)clock_gettime(CLOCK_MONOTONIC,&ts); > > ts.tv_sec +=3D 10; > > (void)pthread_mutex_lock(&lock); > > (void)pthread_cond_timedwait(&cv,&lock,&ts); > > (void)pthread_mutex_unlock(&lock); > > > > This should timeout after 10 seconds, but pthread_cond_timedwait(3) > > returns immediately with ETIMEDOUT. CLOCK_REALTIME works properly. > > Bascially pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) is no-op. > > If you change CLOCK_MONOTONIC to CLOCK_REALTIME in clock_gettime(2) > > call, it will timeout after 10 seconds. >=20 > this has been broken for a while for me in fact fixing this was, I=20 > thought, > one of the reasons for this work.. glad I'm not the omnly person=20 > seeing it though. >=20 > for me it broke sysutils/fio from ports For me it breaks sbin/hastd and openbsm/auditdistd, but my feeling is that it is was broken recently. This stuff use to work not so long ago. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --51uid+Ur/3ko9cBW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk9m4UYACgkQForvXbEpPzT6VACg4ewdSsdfVGV7ElrQOBN00DJN IlUAoPpQpanzfis+qv9uuedFnB6wtyza =eyen -----END PGP SIGNATURE----- --51uid+Ur/3ko9cBW-- From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 08:10:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A808106564A; Mon, 19 Mar 2012 08:10:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73CFF8FC16; Mon, 19 Mar 2012 08:10:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J8AO2e058320; Mon, 19 Mar 2012 08:10:24 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J8AON4058317; Mon, 19 Mar 2012 08:10:24 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203190810.q2J8AON4058317@svn.freebsd.org> From: Dimitry Andric Date: Mon, 19 Mar 2012 08:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233166 - in stable/9: contrib/llvm/tools/clang/lib/Basic sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 08:10:24 -0000 Author: dim Date: Mon Mar 19 08:10:23 2012 New Revision: 233166 URL: http://svn.freebsd.org/changeset/base/233166 Log: MFC r232894: Pull in r145194 from upstream clang trunk: Make our handling of MMX x SSE closer to what gcc does: * Enabling sse enables mmx. * Disabling (-mno-mmx) mmx, doesn't disable sse (we got this right already). * The order in not important. -msse -mno-mmx is the same as -mno-mmx -msse. Some configure scripts depend on this. PR: i386/165968 MFC r232933: Update comments and CFLAGS in sys/conf/kern.mk, introduced in r221879, to match reality: clang does _not_ disable SSE automatically when -mno-mmx is used, you have to specify -mno-sse explicitly. Note this was the case even before r232894, which only makes a change in the 'positive' flag case; e.g. when you specify -msse, MMX gets enabled too. Modified: stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp stable/9/sys/conf/kern.mk Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Mon Mar 19 07:34:09 2012 (r233165) +++ stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Mon Mar 19 08:10:23 2012 (r233166) @@ -1583,23 +1583,26 @@ bool X86TargetInfo::setFeatureEnabled(ll (Name != "sse4" && Name != "sse4.2" && Name != "sse4.1")) return false; + // FIXME: this should probably use a switch with fall through. + if (Enabled) { if (Name == "mmx") Features["mmx"] = true; else if (Name == "sse") - Features["sse"] = true; + Features["mmx"] = Features["sse"] = true; else if (Name == "sse2") - Features["sse"] = Features["sse2"] = true; + Features["mmx"] = Features["sse"] = Features["sse2"] = true; else if (Name == "sse3") - Features["sse"] = Features["sse2"] = Features["sse3"] = true; + Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = + true; else if (Name == "ssse3") - Features["sse"] = Features["sse2"] = Features["sse3"] = + Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = Features["ssse3"] = true; else if (Name == "sse4" || Name == "sse4.2") - Features["sse"] = Features["sse2"] = Features["sse3"] = + Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = Features["ssse3"] = Features["sse41"] = Features["sse42"] = true; else if (Name == "sse4.1") - Features["sse"] = Features["sse2"] = Features["sse3"] = + Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = Features["ssse3"] = Features["sse41"] = true; else if (Name == "3dnow") Features["mmx"] = Features["3dnow"] = true; @@ -1608,10 +1611,11 @@ bool X86TargetInfo::setFeatureEnabled(ll else if (Name == "aes") Features["aes"] = true; else if (Name == "avx") - Features["avx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = - Features["ssse3"] = Features["sse41"] = Features["sse42"] = true; + Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = + Features["ssse3"] = Features["sse41"] = Features["sse42"] = + Features["avx"] = true; else if (Name == "sse4a") - Features["sse4a"] = true; + Features["mmx"] = Features["sse4a"] = true; } else { if (Name == "mmx") Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = false; @@ -3779,13 +3783,32 @@ TargetInfo *TargetInfo::CreateTargetInfo Target->getDefaultFeatures(Features); // Apply the user specified deltas. + // First the enables. for (std::vector::const_iterator it = Opts.Features.begin(), ie = Opts.Features.end(); it != ie; ++it) { const char *Name = it->c_str(); + if (Name[0] != '+') + continue; + + // Apply the feature via the target. + if (!Target->setFeatureEnabled(Features, Name + 1, true)) { + Diags.Report(diag::err_target_invalid_feature) << Name; + return 0; + } + } + + // Then the disables. + for (std::vector::const_iterator it = Opts.Features.begin(), + ie = Opts.Features.end(); it != ie; ++it) { + const char *Name = it->c_str(); + + if (Name[0] == '+') + continue; + // Apply the feature via the target. - if ((Name[0] != '-' && Name[0] != '+') || - !Target->setFeatureEnabled(Features, Name + 1, (Name[0] == '+'))) { + if (Name[0] != '-' || + !Target->setFeatureEnabled(Features, Name + 1, false)) { Diags.Report(diag::err_target_invalid_feature) << Name; return 0; } Modified: stable/9/sys/conf/kern.mk ============================================================================== --- stable/9/sys/conf/kern.mk Mon Mar 19 07:34:09 2012 (r233165) +++ stable/9/sys/conf/kern.mk Mon Mar 19 08:10:23 2012 (r233166) @@ -46,16 +46,16 @@ CWARNEXTRA?= -Wno-error-tautological-com # Setting -mno-sse implies -mno-sse2, -mno-sse3 and -mno-ssse3 # # clang: -# Setting -mno-mmx implies -mno-3dnow, -mno-3dnowa, -mno-sse, -mno-sse2, -# -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 +# Setting -mno-mmx implies -mno-3dnow and -mno-3dnowa +# Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 # .if ${MACHINE_CPUARCH} == "i386" .if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang" -CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-sse +CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 .else CFLAGS+= -mno-aes -mno-avx .endif -CFLAGS+= -mno-mmx -msoft-float +CFLAGS+= -mno-mmx -mno-sse -msoft-float INLINE_LIMIT?= 8000 .endif @@ -93,17 +93,15 @@ INLINE_LIMIT?= 15000 # Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3 and -mfpmath=387 # # clang: -# Setting -mno-mmx implies -mno-3dnow, -mno-3dnowa, -mno-sse, -mno-sse2, -# -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 +# Setting -mno-mmx implies -mno-3dnow and -mno-3dnowa +# Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 # (-mfpmath= is not supported) # .if ${MACHINE_CPUARCH} == "amd64" -.if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang" -CFLAGS+= -mno-sse -.else +.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" CFLAGS+= -mno-aes -mno-avx .endif -CFLAGS+= -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float \ +CFLAGS+= -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float \ -fno-asynchronous-unwind-tables INLINE_LIMIT?= 8000 .endif From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 08:17:02 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18868106564A; Mon, 19 Mar 2012 08:17:02 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D977D8FC14; Mon, 19 Mar 2012 08:17:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q2J8Gvb7071691; Mon, 19 Mar 2012 08:16:59 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F66EB7A.7030107@gmail.com> Date: Mon, 19 Mar 2012 16:16:58 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201202271338.q1RDcqEQ020033@svn.freebsd.org> <20120318185014.GK1340@garage.freebsd.pl> <4F668422.1000308@freebsd.org> <20120319073326.GO1340@garage.freebsd.pl> In-Reply-To: <20120319073326.GO1340@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Julian Elischer , David Xu Subject: Re: svn commit: r232209 - in head: lib/libthr/thread sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 08:17:02 -0000 On 2012/3/19 15:33, Pawel Jakub Dawidek wrote: > On Sun, Mar 18, 2012 at 05:56:02PM -0700, Julian Elischer wrote: >> On 3/18/12 11:50 AM, Pawel Jakub Dawidek wrote: >>> On Mon, Feb 27, 2012 at 01:38:52PM +0000, David Xu wrote: >>>> Author: davidxu >>>> Date: Mon Feb 27 13:38:52 2012 >>>> New Revision: 232209 >>>> URL: http://svn.freebsd.org/changeset/base/232209 >>>> >>>> Log: >>>> Follow changes made in revision 232144, pass absolute timeout to kernel, >>>> this eliminates a clock_gettime() syscall. >>> This or some other change has broken CLOCK_MONOTONIC usage with >>> condition variables. >>> >>> You should be able to reproduce this by something like this: >>> >>> pthread_cond_t cv; >>> pthread_condattr_t attr; >>> pthread_mutex_t lock; >>> struct timespec ts; >>> int error; >>> >>> (void)pthread_mutex_init(&lock, NULL); >>> >>> (void)pthread_condattr_init(&attr); >>> (void)pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); >>> >>> (void)pthread_cond_init(&cv,&attr); >>> (void)pthread_condattr_destroy(&attr); >>> >>> (void)clock_gettime(CLOCK_MONOTONIC,&ts); >>> ts.tv_sec += 10; >>> (void)pthread_mutex_lock(&lock); >>> (void)pthread_cond_timedwait(&cv,&lock,&ts); >>> (void)pthread_mutex_unlock(&lock); >>> >>> This should timeout after 10 seconds, but pthread_cond_timedwait(3) >>> returns immediately with ETIMEDOUT. CLOCK_REALTIME works properly. >>> Bascially pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) is no-op. >>> If you change CLOCK_MONOTONIC to CLOCK_REALTIME in clock_gettime(2) >>> call, it will timeout after 10 seconds. >> this has been broken for a while for me in fact fixing this was, I >> thought, >> one of the reasons for this work.. glad I'm not the omnly person >> seeing it though. >> >> for me it broke sysutils/fio from ports > For me it breaks sbin/hastd and openbsm/auditdistd, but my feeling is > that it is was broken recently. This stuff use to work not so long ago. Hi, Revision 233134 should have fixed the problem. http://svn.freebsd.org/changeset/base/233134 From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 08:42:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A7CD0106566B; Mon, 19 Mar 2012 08:42:47 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0D4498FC0A; Mon, 19 Mar 2012 08:42:46 +0000 (UTC) Received: from outgoing.leidinger.net (p4FC42C11.dip.t-dialin.net [79.196.44.17]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 8432F8443EA; Mon, 19 Mar 2012 09:42:25 +0100 (CET) Received: from webmail.leidinger.net (webmail.Leidinger.net [IPv6:fd73:10c7:2053:1::3:102]) by outgoing.leidinger.net (Postfix) with ESMTPS id A42F7229B; Mon, 19 Mar 2012 09:42:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1332146542; bh=ddW6okA8sja/h692ifDNM9Q1DA44YuyjL1Fttl7zV+c=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=lmiaLxSog5uUEaREBDL+OIDgMAoSoG2AuFCwihFWyVGrCd0rt7QYoo1lYpRsoHWmB YVXeb6KzBuC6iG6UOx6GK3IVYaCCeTgiNLalgUVCVfiryTensIyDCdT/TqfunC06hz wyi+c2frncrnGNcvnxfcGM1/U7GlC4dz/d01QjtEKju1RLapXZ6vGFuYOeDLoTdkZW 2bRLxGl/q6lYnPgBvNmZx9v5WbFI6hH0wVBxzGcQNVdKCZpHJRqRRnuKSPGR1YvNQs 2yetolzHNfh2deH7V7/0MwTGRUPe36iG1LYaQnzKomiR3TJV//eKxmmI9UPwXhYZO7 kHTFOCiiPrgZQ== Received: (from www@localhost) by webmail.leidinger.net (8.14.5/8.14.4/Submit) id q2J8gMBA026961; Mon, 19 Mar 2012 09:42:22 +0100 (CET) (envelope-from Alexander@Leidinger.net) X-Authentication-Warning: webmail.leidinger.net: www set sender to Alexander@Leidinger.net using -f Received: from 195.46.238.194 ([195.46.238.194]) by webmail.leidinger.net (Horde Framework) with HTTP; Mon, 19 Mar 2012 09:42:22 +0100 Date: Mon, 19 Mar 2012 09:42:22 +0100 Message-ID: <20120319094222.Horde.3rlwV5jmRSRPZvFuXTdGj_A@webmail.leidinger.net> From: Alexander Leidinger To: Martin Matuska References: <201203162130.q2GLUQaw035726@svn.freebsd.org> <20120317163539.00004d8f@unknown> <4F6653C6.6020405@FreeBSD.org> <4F665895.1050803@FreeBSD.org> In-Reply-To: <4F665895.1050803@FreeBSD.org> User-Agent: Internet Messaging Program (IMP) H4 (5.0.19) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 8432F8443EA.A0D5F X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-0.228, required 6, autolearn=disabled, AWL -0.27, DKIM_SIGNED 0.10, DKIM_VALID -0.10, DKIM_VALID_AU -0.10, TW_SV 0.08, TW_ZF 0.08, T_RP_MATCHES_RCVD -0.01) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1332751346.18171@5JKY4tctYl98spRQVRaj3A X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, pjd@FreeBSD.org, jamie@FreeBSD.org Subject: Re: svn commit: r233048 - head/etc/defaults X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 08:42:47 -0000 Quoting Martin Matuska (from Sun, 18 Mar 2012 22:50:13 +0100): > On 18.3.2012 22:29, Martin Matuska wrote: >> On 17.3.2012 16:35, Alexander Leidinger wrote: >>> On Fri, 16 Mar 2012 21:30:26 +0000 (UTC) Martin Matuska >>> wrote: >>> >>>> Author: mm >>>> Date: Fri Mar 16 21:30:26 2012 >>>> New Revision: 233048 >>>> URL: http://svn.freebsd.org/changeset/base/233048 >>>> >>>> Log: >>>> Unhide /dev/zfs in devfsrules_jail. >>>> >>>> The /dev/zfs device is required for managing jailed ZFS datasets. >>> This may give more info to a jail (ZFS is in use on this machine) than >>> what someone may want to provide. I have separate rulesets for jails >>> without and with ZFS (actually the one without is the default one and >>> the one with is a new one): >>> ---snip--- >>> ... >>> >>> [devfsrules_unhide_zfs=12] >>> add path zfs unhide >>> >>> ... >>> >>> [devfsrules_jail_withzfs=16] >>> add include $devfsrules_hide_all >>> add include $devfsrules_unhide_basic >>> add include $devfsrules_unhide_login >>> add include $devfsrules_unhide_zfs >>> ---snip--- >>> >>> Anyone with arguments why this may be overly paranoid? If not, I would >>> suggest that we go this way instead. >>> >>> Bye, >>> Alexander. >>> >> The only disclosed information I know of is whether the zfs module is >> loaded on your system. >> Other alternative I was thinking of would be using a new ruleset (e.g. >> devfsrules_jail_zfs=5). >> The disadvantage here is that users that already have defined a ruleset >> with this number should be informed somehow. Well... we always have this issue. If the rulsets in defaults changes, the user has to change his own rulesets. I have a lot of rules on my system and there was at least one occasion where I had to handle a change because of this. I don't remember if there was an entry in UPDATING or not, but I don't think we should make a decission about it based upon if an user has to renumber his rulesets or not. As the rulesets do not need to be continous, we may want to add an advise to the man-page(s) to start at a specifc value for the ruleset-numbers and reserve everything below for the system. I didn't do this myself, and I have a lot of rulesets, for me this falls within 'nice to have but easy to handle'. > Btw. jail has access to sysctl(8) and this discloses a *LOT* of > information, including if ZFS is loaded or not (existence of vfs.zfs) > and all its settings and statistics, hardware devices, geom devices, > network card counters and many more. Compared to this is /dev/zfs really > a minor issue :-) I agree. > Until we limit the output of sysctl() we don't hide this information > just by hiding /dev/zfs. What about not imported pools. Can I see them in jails or are they hidden (I don't have one around to test ATM)? Bye, Alexander. -- Don't drink when you drive -- you might hit a bump and spill it. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 08:53:00 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EACF106566C; Mon, 19 Mar 2012 08:53:00 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:150:6101::4]) by mx1.freebsd.org (Postfix) with ESMTP id CAA0F8FC0C; Mon, 19 Mar 2012 08:52:59 +0000 (UTC) Received: from core2.vx.sk (localhost [127.0.0.2]) by mail.vx.sk (Postfix) with ESMTP id F3AA42FE3F; Mon, 19 Mar 2012 09:52:58 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by core2.vx.sk (amavisd-new, unix socket) with LMTP id 3uAEHr9PaxAf; Mon, 19 Mar 2012 09:52:53 +0100 (CET) Received: from [10.0.3.3] (188-167-66-148.dynamic.chello.sk [188.167.66.148]) by mail.vx.sk (Postfix) with ESMTPSA id 83E552FE2A; Mon, 19 Mar 2012 09:52:53 +0100 (CET) Message-ID: <4F66F3E5.2020600@FreeBSD.org> Date: Mon, 19 Mar 2012 09:52:53 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Alexander Leidinger References: <201203162130.q2GLUQaw035726@svn.freebsd.org> <20120317163539.00004d8f@unknown> <4F6653C6.6020405@FreeBSD.org> <4F665895.1050803@FreeBSD.org> <20120319094222.Horde.3rlwV5jmRSRPZvFuXTdGj_A@webmail.leidinger.net> In-Reply-To: <20120319094222.Horde.3rlwV5jmRSRPZvFuXTdGj_A@webmail.leidinger.net> X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, pjd@FreeBSD.org, jamie@FreeBSD.org Subject: Re: svn commit: r233048 - head/etc/defaults X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 08:53:00 -0000 On 19. 3. 2012 9:42, Alexander Leidinger wrote: >>> The only disclosed information I know of is whether the zfs module is >>> loaded on your system. >>> Other alternative I was thinking of would be using a new ruleset (e.g. >>> devfsrules_jail_zfs=5). >>> The disadvantage here is that users that already have defined a ruleset >>> with this number should be informed somehow. > > Well... we always have this issue. If the rulsets in defaults changes, > the user has to change his own rulesets. I have a lot of rules on my > system and there was at least one occasion where I had to handle a > change because of this. I don't remember if there was an entry in > UPDATING or not, but I don't think we should make a decission about it > based upon if an user has to renumber his rulesets or not. As the > rulesets do not need to be continous, we may want to add an advise to > the man-page(s) to start at a specifc value for the ruleset-numbers > and reserve everything below for the system. I didn't do this myself, > and I have a lot of rulesets, for me this falls within 'nice to have > but easy to handle'. > >> Btw. jail has access to sysctl(8) and this discloses a *LOT* of >> information, including if ZFS is loaded or not (existence of vfs.zfs) >> and all its settings and statistics, hardware devices, geom devices, >> network card counters and many more. Compared to this is /dev/zfs really >> a minor issue :-) > > I agree. > >> Until we limit the output of sysctl() we don't hide this information >> just by hiding /dev/zfs. > > What about not imported pools. Can I see them in jails or are they > hidden (I don't have one around to test ATM)? Until you delegate a zfs dataset to a jail, the jail does not see any pools or datasets. If you delegate a dataset to a jail, the jail sees information about the delegated dataset, the dataset's pool, the parent datasets of this delegated dataset (=the path from pool up to the delegated dataset) and the descendant datasets, if any. We might want to continue this discussion outside of the svn-src mailing lists. -- Martin Matuska FreeBSD committer http://blog.vx.sk From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 09:30:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12C8C106566C; Mon, 19 Mar 2012 09:30:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F24F18FC14; Mon, 19 Mar 2012 09:30:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J9Ueq0060868; Mon, 19 Mar 2012 09:30:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J9UeO5060866; Mon, 19 Mar 2012 09:30:40 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203190930.q2J9UeO5060866@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 19 Mar 2012 09:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233167 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 09:30:41 -0000 Author: glebius Date: Mon Mar 19 09:30:40 2012 New Revision: 233167 URL: http://svn.freebsd.org/changeset/base/233167 Log: Rotate auth.log and messages at the beginning of a year. Otherwise, daily security checks 800.loginfail and 900.tcpwrap may produce false positive alerts. Modified: head/etc/newsyslog.conf Modified: head/etc/newsyslog.conf ============================================================================== --- head/etc/newsyslog.conf Mon Mar 19 08:10:23 2012 (r233166) +++ head/etc/newsyslog.conf Mon Mar 19 09:30:40 2012 (r233167) @@ -19,7 +19,7 @@ # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] /var/log/all.log 600 7 * @T00 J /var/log/amd.log 644 7 100 * J -/var/log/auth.log 600 7 100 * JC +/var/log/auth.log 600 7 100 @0101T JC /var/log/console.log 600 5 100 * J /var/log/cron 600 3 100 * JC /var/log/daily.log 640 7 * @T00 JN @@ -28,7 +28,7 @@ /var/log/kerberos.log 600 7 100 * J /var/log/lpd-errs 644 7 100 * JC /var/log/maillog 640 7 * @T00 JC -/var/log/messages 644 5 100 * JC +/var/log/messages 644 5 100 @0101T JC /var/log/monthly.log 640 12 * $M1D0 JN /var/log/pflog 600 3 100 * JB /var/run/pflogd.pid /var/log/ppp.log root:network 640 3 100 * JC From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 09:34:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A85031065674; Mon, 19 Mar 2012 09:34:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 918D98FC08; Mon, 19 Mar 2012 09:34:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J9YMUm061019; Mon, 19 Mar 2012 09:34:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J9YMEo061016; Mon, 19 Mar 2012 09:34:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203190934.q2J9YMEo061016@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 19 Mar 2012 09:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233168 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 09:34:22 -0000 Author: kib Date: Mon Mar 19 09:34:22 2012 New Revision: 233168 URL: http://svn.freebsd.org/changeset/base/233168 Log: If we ever allow for managed fictitious pages, the pages shall be excluded from superpage promotions. At least one of the reason is that pv_table is sized for non-fictitious pages only. Consistently check for the page to be non-fictitious before accesing superpage pv list. Sponsored by: The FreeBSD Foundation Reviewed by: alc MFC after: 2 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Mar 19 09:30:40 2012 (r233167) +++ head/sys/amd64/amd64/pmap.c Mon Mar 19 09:34:22 2012 (r233168) @@ -2386,7 +2386,7 @@ pmap_remove_entry(pmap_t pmap, vm_page_t mtx_assert(&vm_page_queue_mtx, MA_OWNED); pmap_pvh_free(&m->md, pmap, va); - if (TAILQ_EMPTY(&m->md.pv_list)) { + if (TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); if (TAILQ_EMPTY(&pvh->pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); @@ -2849,6 +2849,8 @@ pmap_remove_all(vm_page_t m) ("pmap_remove_all: page %p is not managed", m)); free = NULL; vm_page_lock_queues(); + if ((m->flags & PG_FICTITIOUS) != 0) + goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) { pmap = PV_PMAP(pv); @@ -2858,6 +2860,7 @@ pmap_remove_all(vm_page_t m) (void)pmap_demote_pde(pmap, pde, va); PMAP_UNLOCK(pmap); } +small_mappings: while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -2939,7 +2942,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pdp_entry_t *pdpe; pd_entry_t ptpaddr, *pde; pt_entry_t *pte; - boolean_t anychanged, pv_lists_locked; + int anychanged; + boolean_t pv_lists_locked; if ((prot & VM_PROT_READ) == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); @@ -2952,7 +2956,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pv_lists_locked = FALSE; resume: - anychanged = FALSE; + anychanged = 0; PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { @@ -3000,7 +3004,7 @@ resume: * invalidated by pmap_protect_pde(). */ if (pmap_protect_pde(pmap, pde, sva, prot)) - anychanged = TRUE; + anychanged = 1; continue; } else { if (!pv_lists_locked) { @@ -3054,7 +3058,7 @@ retry: if (obits & PG_G) pmap_invalidate_page(pmap, sva); else - anychanged = TRUE; + anychanged = 1; } } } @@ -3354,7 +3358,8 @@ validate: } if ((origpte & PG_MANAGED) != 0 && TAILQ_EMPTY(&om->md.pv_list) && - TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list)) + ((om->flags & PG_FICTITIOUS) != 0 || + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) vm_page_aflag_clear(om, PGA_WRITEABLE); if (invlva) pmap_invalidate_page(pmap, va); @@ -3367,7 +3372,8 @@ validate: * populated, then attempt promotion. */ if ((mpte == NULL || mpte->wire_count == NPTEPG) && - pg_ps_enabled && vm_reserv_level_iffullpop(m) == 0) + pg_ps_enabled && (m->flags & PG_FICTITIOUS) == 0 && + vm_reserv_level_iffullpop(m) == 0) pmap_promote_pde(pmap, pde, va); vm_page_unlock_queues(); @@ -3987,7 +3993,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p if (loops >= 16) break; } - if (!rv && loops < 16) { + if (!rv && loops < 16 && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { if (PV_PMAP(pv) == pmap) { @@ -4019,7 +4025,10 @@ pmap_page_wired_mappings(vm_page_t m) return (count); vm_page_lock_queues(); count = pmap_pvh_wired_mappings(&m->md, count); - count = pmap_pvh_wired_mappings(pa_to_pvh(VM_PAGE_TO_PHYS(m)), count); + if ((m->flags & PG_FICTITIOUS) == 0) { + count = pmap_pvh_wired_mappings(pa_to_pvh(VM_PAGE_TO_PHYS(m)), + count); + } vm_page_unlock_queues(); return (count); } @@ -4061,7 +4070,8 @@ pmap_page_is_mapped(vm_page_t m) return (FALSE); vm_page_lock_queues(); rv = !TAILQ_EMPTY(&m->md.pv_list) || - !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list); + ((m->flags & PG_FICTITIOUS) == 0 && + !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)); vm_page_unlock_queues(); return (rv); } @@ -4134,9 +4144,10 @@ pmap_remove_pages(pmap_t pmap) m, (uintmax_t)m->phys_addr, (uintmax_t)tpte)); - KASSERT(m < &vm_page_array[vm_page_array_size], - ("pmap_remove_pages: bad tpte %#jx", - (uintmax_t)tpte)); + KASSERT((m->flags & PG_FICTITIOUS) != 0 || + m < &vm_page_array[vm_page_array_size], + ("pmap_remove_pages: bad tpte %#jx", + (uintmax_t)tpte)); pte_clear(pte); @@ -4178,7 +4189,8 @@ pmap_remove_pages(pmap_t pmap) } else { pmap_resident_count_dec(pmap, 1); TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); - if (TAILQ_EMPTY(&m->md.pv_list)) { + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); if (TAILQ_EMPTY(&pvh->pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); @@ -4229,7 +4241,8 @@ pmap_is_modified(vm_page_t m) return (FALSE); vm_page_lock_queues(); rv = pmap_is_modified_pvh(&m->md) || - pmap_is_modified_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m))); + ((m->flags & PG_FICTITIOUS) == 0 && + pmap_is_modified_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); vm_page_unlock_queues(); return (rv); } @@ -4300,7 +4313,8 @@ pmap_is_referenced(vm_page_t m) ("pmap_is_referenced: page %p is not managed", m)); vm_page_lock_queues(); rv = pmap_is_referenced_pvh(&m->md) || - pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m))); + ((m->flags & PG_FICTITIOUS) == 0 && + pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); vm_page_unlock_queues(); return (rv); } @@ -4357,6 +4371,8 @@ pmap_remove_write(vm_page_t m) (m->aflags & PGA_WRITEABLE) == 0) return; vm_page_lock_queues(); + if ((m->flags & PG_FICTITIOUS) != 0) + goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { pmap = PV_PMAP(pv); @@ -4367,6 +4383,7 @@ pmap_remove_write(vm_page_t m) (void)pmap_demote_pde(pmap, pde, va); PMAP_UNLOCK(pmap); } +small_mappings: TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -4415,8 +4432,10 @@ pmap_ts_referenced(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); - pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); vm_page_lock_queues(); + if ((m->flags & PG_FICTITIOUS) != 0) + goto small_mappings; + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, pvn) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -4447,6 +4466,7 @@ pmap_ts_referenced(vm_page_t m) } PMAP_UNLOCK(pmap); } +small_mappings: if ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pvf = pv; do { @@ -4501,6 +4521,8 @@ pmap_clear_modify(vm_page_t m) if ((m->aflags & PGA_WRITEABLE) == 0) return; vm_page_lock_queues(); + if ((m->flags & PG_FICTITIOUS) != 0) + goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { pmap = PV_PMAP(pv); @@ -4533,6 +4555,7 @@ pmap_clear_modify(vm_page_t m) } PMAP_UNLOCK(pmap); } +small_mappings: TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -4567,6 +4590,8 @@ pmap_clear_reference(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_reference: page %p is not managed", m)); vm_page_lock_queues(); + if ((m->flags & PG_FICTITIOUS) != 0) + goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { pmap = PV_PMAP(pv); @@ -4590,6 +4615,7 @@ pmap_clear_reference(vm_page_t m) } PMAP_UNLOCK(pmap); } +small_mappings: TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Mar 19 09:30:40 2012 (r233167) +++ head/sys/i386/i386/pmap.c Mon Mar 19 09:34:22 2012 (r233168) @@ -2483,7 +2483,7 @@ pmap_remove_entry(pmap_t pmap, vm_page_t mtx_assert(&vm_page_queue_mtx, MA_OWNED); pmap_pvh_free(&m->md, pmap, va); - if (TAILQ_EMPTY(&m->md.pv_list)) { + if (TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); if (TAILQ_EMPTY(&pvh->pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); @@ -2957,6 +2957,8 @@ pmap_remove_all(vm_page_t m) free = NULL; vm_page_lock_queues(); sched_pin(); + if ((m->flags & PG_FICTITIOUS) != 0) + goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) { va = pv->pv_va; @@ -2966,6 +2968,7 @@ pmap_remove_all(vm_page_t m) (void)pmap_demote_pde(pmap, pde, va); PMAP_UNLOCK(pmap); } +small_mappings: while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -3481,7 +3484,8 @@ validate: } if ((origpte & PG_MANAGED) != 0 && TAILQ_EMPTY(&om->md.pv_list) && - TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list)) + ((om->flags & PG_FICTITIOUS) != 0 || + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) vm_page_aflag_clear(om, PGA_WRITEABLE); if (invlva) pmap_invalidate_page(pmap, va); @@ -3494,7 +3498,8 @@ validate: * populated, then attempt promotion. */ if ((mpte == NULL || mpte->wire_count == NPTEPG) && - pg_ps_enabled && vm_reserv_level_iffullpop(m) == 0) + pg_ps_enabled && (m->flags & PG_FICTITIOUS) == 0 && + vm_reserv_level_iffullpop(m) == 0) pmap_promote_pde(pmap, pde, va); sched_unpin(); @@ -4134,7 +4139,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p if (loops >= 16) break; } - if (!rv && loops < 16) { + if (!rv && loops < 16 && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { if (PV_PMAP(pv) == pmap) { @@ -4166,7 +4171,10 @@ pmap_page_wired_mappings(vm_page_t m) return (count); vm_page_lock_queues(); count = pmap_pvh_wired_mappings(&m->md, count); - count = pmap_pvh_wired_mappings(pa_to_pvh(VM_PAGE_TO_PHYS(m)), count); + if ((m->flags & PG_FICTITIOUS) == 0) { + count = pmap_pvh_wired_mappings(pa_to_pvh(VM_PAGE_TO_PHYS(m)), + count); + } vm_page_unlock_queues(); return (count); } @@ -4210,7 +4218,8 @@ pmap_page_is_mapped(vm_page_t m) return (FALSE); vm_page_lock_queues(); rv = !TAILQ_EMPTY(&m->md.pv_list) || - !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list); + ((m->flags & PG_FICTITIOUS) == 0 && + !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)); vm_page_unlock_queues(); return (rv); } @@ -4283,9 +4292,10 @@ pmap_remove_pages(pmap_t pmap) m, (uintmax_t)m->phys_addr, (uintmax_t)tpte)); - KASSERT(m < &vm_page_array[vm_page_array_size], - ("pmap_remove_pages: bad tpte %#jx", - (uintmax_t)tpte)); + KASSERT((m->flags & PG_FICTITIOUS) != 0 || + m < &vm_page_array[vm_page_array_size], + ("pmap_remove_pages: bad tpte %#jx", + (uintmax_t)tpte)); pte_clear(pte); @@ -4327,7 +4337,8 @@ pmap_remove_pages(pmap_t pmap) } else { pmap->pm_stats.resident_count--; TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); - if (TAILQ_EMPTY(&m->md.pv_list)) { + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); if (TAILQ_EMPTY(&pvh->pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); @@ -4380,7 +4391,8 @@ pmap_is_modified(vm_page_t m) return (FALSE); vm_page_lock_queues(); rv = pmap_is_modified_pvh(&m->md) || - pmap_is_modified_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m))); + ((m->flags & PG_FICTITIOUS) == 0 && + pmap_is_modified_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); vm_page_unlock_queues(); return (rv); } @@ -4453,7 +4465,8 @@ pmap_is_referenced(vm_page_t m) ("pmap_is_referenced: page %p is not managed", m)); vm_page_lock_queues(); rv = pmap_is_referenced_pvh(&m->md) || - pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m))); + ((m->flags & PG_FICTITIOUS) == 0 && + pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); vm_page_unlock_queues(); return (rv); } @@ -4513,6 +4526,8 @@ pmap_remove_write(vm_page_t m) return; vm_page_lock_queues(); sched_pin(); + if ((m->flags & PG_FICTITIOUS) != 0) + goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { va = pv->pv_va; @@ -4523,6 +4538,7 @@ pmap_remove_write(vm_page_t m) (void)pmap_demote_pde(pmap, pde, va); PMAP_UNLOCK(pmap); } +small_mappings: TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -4580,6 +4596,8 @@ pmap_ts_referenced(vm_page_t m) pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); vm_page_lock_queues(); sched_pin(); + if ((m->flags & PG_FICTITIOUS) != 0) + goto small_mappings; TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, pvn) { va = pv->pv_va; pmap = PV_PMAP(pv); @@ -4610,6 +4628,7 @@ pmap_ts_referenced(vm_page_t m) } PMAP_UNLOCK(pmap); } +small_mappings: if ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pvf = pv; do { @@ -4666,6 +4685,8 @@ pmap_clear_modify(vm_page_t m) return; vm_page_lock_queues(); sched_pin(); + if ((m->flags & PG_FICTITIOUS) != 0) + goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { va = pv->pv_va; @@ -4703,6 +4724,7 @@ pmap_clear_modify(vm_page_t m) } PMAP_UNLOCK(pmap); } +small_mappings: TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -4744,6 +4766,8 @@ pmap_clear_reference(vm_page_t m) ("pmap_clear_reference: page %p is not managed", m)); vm_page_lock_queues(); sched_pin(); + if ((m->flags & PG_FICTITIOUS) != 0) + goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { va = pv->pv_va; @@ -4767,6 +4791,7 @@ pmap_clear_reference(vm_page_t m) } PMAP_UNLOCK(pmap); } +small_mappings: TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 10:04:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA3721065673; Mon, 19 Mar 2012 10:04:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 974618FC1A; Mon, 19 Mar 2012 10:04:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JA4j1p062019; Mon, 19 Mar 2012 10:04:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JA4jKe062017; Mon, 19 Mar 2012 10:04:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203191004.q2JA4jKe062017@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 19 Mar 2012 10:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233169 - stable/9/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 10:04:45 -0000 Author: kib Date: Mon Mar 19 10:04:45 2012 New Revision: 233169 URL: http://svn.freebsd.org/changeset/base/233169 Log: MFC r232541: Apply inlined vn_vget_ino() algorithm for ".." lookup in pseudofs. Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/9/sys/fs/pseudofs/pseudofs_vnops.c Mon Mar 19 09:34:22 2012 (r233168) +++ stable/9/sys/fs/pseudofs/pseudofs_vnops.c Mon Mar 19 10:04:45 2012 (r233169) @@ -432,6 +432,7 @@ pfs_lookup(struct vop_cachedlookup_args struct pfs_vdata *pvd = vn->v_data; struct pfs_node *pd = pvd->pvd_pn; struct pfs_node *pn, *pdn = NULL; + struct mount *mp; pid_t pid = pvd->pvd_pid; char *pname; int error, i, namelen, visible; @@ -474,10 +475,26 @@ pfs_lookup(struct vop_cachedlookup_args PFS_RETURN (0); } + mp = vn->v_mount; + /* parent */ if (cnp->cn_flags & ISDOTDOT) { if (pd->pn_type == pfstype_root) PFS_RETURN (EIO); + error = vfs_busy(mp, MBF_NOWAIT); + if (error != 0) { + vfs_ref(mp); + VOP_UNLOCK(vn, 0); + error = vfs_busy(mp, 0); + vn_lock(vn, LK_EXCLUSIVE | LK_RETRY); + vfs_rel(mp); + if (error != 0) + PFS_RETURN(ENOENT); + if (vn->v_iflag & VI_DOOMED) { + vfs_unbusy(mp); + PFS_RETURN(ENOENT); + } + } VOP_UNLOCK(vn, 0); KASSERT(pd->pn_parent != NULL, ("%s(): non-root directory has no parent", __func__)); @@ -535,18 +552,28 @@ pfs_lookup(struct vop_cachedlookup_args goto failed; } - error = pfs_vncache_alloc(vn->v_mount, vpp, pn, pid); + error = pfs_vncache_alloc(mp, vpp, pn, pid); if (error) goto failed; - if (cnp->cn_flags & ISDOTDOT) - vn_lock(vn, LK_EXCLUSIVE|LK_RETRY); + if (cnp->cn_flags & ISDOTDOT) { + vfs_unbusy(mp); + vn_lock(vn, LK_EXCLUSIVE | LK_RETRY); + if (vn->v_iflag & VI_DOOMED) { + vput(*vpp); + *vpp = NULL; + PFS_RETURN(ENOENT); + } + } if (cnp->cn_flags & MAKEENTRY && !(vn->v_iflag & VI_DOOMED)) cache_enter(vn, *vpp, cnp); PFS_RETURN (0); failed: - if (cnp->cn_flags & ISDOTDOT) - vn_lock(vn, LK_EXCLUSIVE|LK_RETRY); + if (cnp->cn_flags & ISDOTDOT) { + vfs_unbusy(mp); + vn_lock(vn, LK_EXCLUSIVE | LK_RETRY); + *vpp = NULL; + } PFS_RETURN(error); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 10:06:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 462AD106566B; Mon, 19 Mar 2012 10:06:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 310808FC12; Mon, 19 Mar 2012 10:06:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JA6Nff062126; Mon, 19 Mar 2012 10:06:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JA6M10062124; Mon, 19 Mar 2012 10:06:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203191006.q2JA6M10062124@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 19 Mar 2012 10:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233170 - stable/9/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 10:06:23 -0000 Author: kib Date: Mon Mar 19 10:06:22 2012 New Revision: 233170 URL: http://svn.freebsd.org/changeset/base/233170 Log: MFC r233041: Remove write-only variable. Modified: stable/9/libexec/rtld-elf/map_object.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/map_object.c ============================================================================== --- stable/9/libexec/rtld-elf/map_object.c Mon Mar 19 10:04:45 2012 (r233169) +++ stable/9/libexec/rtld-elf/map_object.c Mon Mar 19 10:06:22 2012 (r233170) @@ -65,7 +65,6 @@ map_object(int fd, const char *path, con Elf_Phdr *phtls; caddr_t mapbase; size_t mapsize; - Elf_Off base_offset; Elf_Addr base_vaddr; Elf_Addr base_vlimit; caddr_t base_addr; @@ -161,7 +160,6 @@ map_object(int fd, const char *path, con * Map the entire address space of the object, to stake out our * contiguous region, and to establish the base address for relocation. */ - base_offset = trunc_page(segs[0]->p_offset); base_vaddr = trunc_page(segs[0]->p_vaddr); base_vlimit = round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz); mapsize = base_vlimit - base_vaddr; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 11:27:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43304106566C; Mon, 19 Mar 2012 11:27:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13BBF8FC16; Mon, 19 Mar 2012 11:27:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JBRsOf066349; Mon, 19 Mar 2012 11:27:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JBRsDP066347; Mon, 19 Mar 2012 11:27:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203191127.q2JBRsDP066347@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 19 Mar 2012 11:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233171 - stable/8/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 11:27:55 -0000 Author: kib Date: Mon Mar 19 11:27:54 2012 New Revision: 233171 URL: http://svn.freebsd.org/changeset/base/233171 Log: MFC r232541: Apply inlined vn_vget_ino() algorithm for ".." lookup in pseudofs. Modified: stable/8/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/8/sys/fs/pseudofs/pseudofs_vnops.c Mon Mar 19 10:06:22 2012 (r233170) +++ stable/8/sys/fs/pseudofs/pseudofs_vnops.c Mon Mar 19 11:27:54 2012 (r233171) @@ -433,6 +433,7 @@ pfs_lookup(struct vop_cachedlookup_args struct pfs_vdata *pvd = vn->v_data; struct pfs_node *pd = pvd->pvd_pn; struct pfs_node *pn, *pdn = NULL; + struct mount *mp; pid_t pid = pvd->pvd_pid; char *pname; int error, i, namelen, visible; @@ -475,10 +476,26 @@ pfs_lookup(struct vop_cachedlookup_args PFS_RETURN (0); } + mp = vn->v_mount; + /* parent */ if (cnp->cn_flags & ISDOTDOT) { if (pd->pn_type == pfstype_root) PFS_RETURN (EIO); + error = vfs_busy(mp, MBF_NOWAIT); + if (error != 0) { + vfs_ref(mp); + VOP_UNLOCK(vn, 0); + error = vfs_busy(mp, 0); + vn_lock(vn, LK_EXCLUSIVE | LK_RETRY); + vfs_rel(mp); + if (error != 0) + PFS_RETURN(ENOENT); + if (vn->v_iflag & VI_DOOMED) { + vfs_unbusy(mp); + PFS_RETURN(ENOENT); + } + } VOP_UNLOCK(vn, 0); KASSERT(pd->pn_parent != NULL, ("%s(): non-root directory has no parent", __func__)); @@ -536,18 +553,28 @@ pfs_lookup(struct vop_cachedlookup_args goto failed; } - error = pfs_vncache_alloc(vn->v_mount, vpp, pn, pid); + error = pfs_vncache_alloc(mp, vpp, pn, pid); if (error) goto failed; - if (cnp->cn_flags & ISDOTDOT) - vn_lock(vn, LK_EXCLUSIVE|LK_RETRY); + if (cnp->cn_flags & ISDOTDOT) { + vfs_unbusy(mp); + vn_lock(vn, LK_EXCLUSIVE | LK_RETRY); + if (vn->v_iflag & VI_DOOMED) { + vput(*vpp); + *vpp = NULL; + PFS_RETURN(ENOENT); + } + } if (cnp->cn_flags & MAKEENTRY && !(vn->v_iflag & VI_DOOMED)) cache_enter(vn, *vpp, cnp); PFS_RETURN (0); failed: - if (cnp->cn_flags & ISDOTDOT) - vn_lock(vn, LK_EXCLUSIVE|LK_RETRY); + if (cnp->cn_flags & ISDOTDOT) { + vfs_unbusy(mp); + vn_lock(vn, LK_EXCLUSIVE | LK_RETRY); + *vpp = NULL; + } PFS_RETURN(error); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 11:28:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F02F01065670; Mon, 19 Mar 2012 11:28:36 +0000 (UTC) (envelope-from joel@freebsd.org) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id A30AD8FC18; Mon, 19 Mar 2012 11:28:36 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id DDA40E3F07A; Mon, 19 Mar 2012 12:28:28 +0100 (CET) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ycJZyu1aK2HB; Mon, 19 Mar 2012 12:28:23 +0100 (CET) Received: from goofy01.vnodelab.local (jd.benders.se [212.247.52.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id F27B6E3F079; Mon, 19 Mar 2012 12:28:22 +0100 (CET) Date: Mon, 19 Mar 2012 12:28:21 +0100 From: Joel Dahl To: Gleb Smirnoff Message-ID: <20120319112821.GG7018@goofy01.vnodelab.local> References: <201203190930.q2J9UeO5060866@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203190930.q2J9UeO5060866@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233167 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 11:28:37 -0000 On 19-03-2012 9:30, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Mar 19 09:30:40 2012 > New Revision: 233167 > URL: http://svn.freebsd.org/changeset/base/233167 > > Log: > Rotate auth.log and messages at the beginning of a year. Otherwise, > daily security checks 800.loginfail and 900.tcpwrap may produce > false positive alerts. Thank you! -- Joel From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 11:32:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06A34106564A; Mon, 19 Mar 2012 11:32:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E53C38FC18; Mon, 19 Mar 2012 11:32:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JBWg3P066552; Mon, 19 Mar 2012 11:32:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JBWgR8066550; Mon, 19 Mar 2012 11:32:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203191132.q2JBWgR8066550@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 19 Mar 2012 11:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233172 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 11:32:43 -0000 Author: kib Date: Mon Mar 19 11:32:42 2012 New Revision: 233172 URL: http://svn.freebsd.org/changeset/base/233172 Log: MFC r233041: Remove write-only variable. Modified: stable/8/libexec/rtld-elf/map_object.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/map_object.c ============================================================================== --- stable/8/libexec/rtld-elf/map_object.c Mon Mar 19 11:27:54 2012 (r233171) +++ stable/8/libexec/rtld-elf/map_object.c Mon Mar 19 11:32:42 2012 (r233172) @@ -65,7 +65,6 @@ map_object(int fd, const char *path, con Elf_Phdr *phtls; caddr_t mapbase; size_t mapsize; - Elf_Off base_offset; Elf_Addr base_vaddr; Elf_Addr base_vlimit; caddr_t base_addr; @@ -146,7 +145,6 @@ map_object(int fd, const char *path, con * Map the entire address space of the object, to stake out our * contiguous region, and to establish the base address for relocation. */ - base_offset = trunc_page(segs[0]->p_offset); base_vaddr = trunc_page(segs[0]->p_vaddr); base_vlimit = round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz); mapsize = base_vlimit - base_vaddr; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 11:47:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8EAE11065673; Mon, 19 Mar 2012 11:47:38 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79BAE8FC08; Mon, 19 Mar 2012 11:47:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JBlcFq067044; Mon, 19 Mar 2012 11:47:38 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JBlcSo067042; Mon, 19 Mar 2012 11:47:38 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201203191147.q2JBlcSo067042@svn.freebsd.org> From: David Chisnall Date: Mon, 19 Mar 2012 11:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233173 - head/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 11:47:38 -0000 Author: theraven Date: Mon Mar 19 11:47:37 2012 New Revision: 233173 URL: http://svn.freebsd.org/changeset/base/233173 Log: Make __get_locale() static inline, not just inline, so when compiling libc in debug mode (without optimisations) it doesn't generate a linker failure. Approved by: dim (mentor) Modified: head/lib/libc/locale/xlocale_private.h Modified: head/lib/libc/locale/xlocale_private.h ============================================================================== --- head/lib/libc/locale/xlocale_private.h Mon Mar 19 11:32:42 2012 (r233172) +++ head/lib/libc/locale/xlocale_private.h Mon Mar 19 11:47:37 2012 (r233173) @@ -191,7 +191,7 @@ extern _Thread_local locale_t __thread_l * this call is not guaranteed to remain valid after the locale changes. As * such, this should only be called within libc functions. */ -inline locale_t __get_locale(void) +static inline locale_t __get_locale(void) { if (!__has_thread_locale) { From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 11:53:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 181D5106566B; Mon, 19 Mar 2012 11:53:34 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02D258FC12; Mon, 19 Mar 2012 11:53:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JBrX0h067272; Mon, 19 Mar 2012 11:53:33 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JBrX0G067269; Mon, 19 Mar 2012 11:53:33 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201203191153.q2JBrX0G067269@svn.freebsd.org> From: David Chisnall Date: Mon, 19 Mar 2012 11:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233174 - head/lib/libcxxrt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 11:53:34 -0000 Author: theraven Date: Mon Mar 19 11:53:33 2012 New Revision: 233174 URL: http://svn.freebsd.org/changeset/base/233174 Log: Add symbol versioning to libcxxrt. Approved by: dim (mentor) Added: head/lib/libcxxrt/Version.map (contents, props changed) Modified: head/lib/libcxxrt/Makefile Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Mon Mar 19 11:47:37 2012 (r233173) +++ head/lib/libcxxrt/Makefile Mon Mar 19 11:53:33 2012 (r233174) @@ -21,5 +21,6 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -I${SRCDIR} +VERSION_MAP= ${.CURDIR}/Version.map .include Added: head/lib/libcxxrt/Version.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcxxrt/Version.map Mon Mar 19 11:53:33 2012 (r233174) @@ -0,0 +1,318 @@ +# $FreeBSD$ +# Define the same version as the libsupc++ from gcc 4.2.1 so that we can use +# libcxxrt as a drop-in replacement. + +CXXABI_1.3 { + + global: + + # ABI functions with C linkage + __cxa_allocate_exception; + __cxa_bad_cast; + __cxa_bad_typeid; + __cxa_begin_catch; + __cxa_begin_cleanup; + __cxa_call_unexpected; + __cxa_current_exception_type; + __cxa_demangle; + __cxa_end_catch; + __cxa_end_cleanup; + __cxa_free_exception; + __cxa_get_globals; + __cxa_get_globals_fast; + __cxa_guard_abort; + __cxa_guard_acquire; + __cxa_guard_release; + __cxa_pure_virtual; + __cxa_rethrow; + __cxa_throw; + __cxa_type_match; + __cxa_vec_cctor; + __cxa_vec_cleanup; + __cxa_vec_ctor; + __cxa_vec_delete2; + __cxa_vec_delete3; + __cxa_vec_delete; + __cxa_vec_dtor; + __cxa_vec_new2; + __cxa_vec_new3; + __cxa_vec_new; + __dynamic_cast; + __gxx_personality_sj0; + __gxx_personality_v0; + + extern "C++" { + # Type info classes and their destructors + "__cxxabiv1::__array_type_info"; + "__cxxabiv1::__array_type_info::~__array_type_info()"; + "__cxxabiv1::__class_type_info"; + "__cxxabiv1::__class_type_info::~__class_type_info()"; + "__cxxabiv1::__enum_type_info"; + "__cxxabiv1::__enum_type_info::~__enum_type_info()"; + "__cxxabiv1::__function_type_info::"; + "__cxxabiv1::__function_type_info::~__function_type_info()"; + "__cxxabiv1::__fundamental_type_info"; + "__cxxabiv1::__fundamental_type_info::~__fundamental_type_info()"; + "__cxxabiv1::__pbase_type_info"; + "__cxxabiv1::__pbase_type_info::~__pbase_type_info()"; + "__cxxabiv1::__pointer_to_member_type_info"; + "__cxxabiv1::__pointer_to_member_type_info::~__pointer_to_member_type_info()"; + "__cxxabiv1::__pointer_type_info"; + "__cxxabiv1::__pointer_type_info::~__pointer_type_info()"; + "__cxxabiv1::__si_class_type_info"; + "__cxxabiv1::__si_class_type_info::~__si_class_type_info()"; + "__cxxabiv1::__vmi_class_type_info"; + "__cxxabiv1::__vmi_class_type_info::~__vmi_class_type_info()"; + + # vtables typeinfo classes. + "vtable for __cxxabiv1::__array_type_info"; + "vtable for __cxxabiv1::__class_type_info"; + "vtable for __cxxabiv1::__enum_type_info"; + "vtable for __cxxabiv1::__function_type_info"; + "vtable for __cxxabiv1::__fundamental_type_info"; + "vtable for __cxxabiv1::__pbase_type_info"; + "vtable for __cxxabiv1::__pointer_to_member_type_info"; + "vtable for __cxxabiv1::__pointer_type_info"; + "vtable for __cxxabiv1::__si_class_type_info"; + "vtable for __cxxabiv1::__vmi_class_type_info"; + + # Type info for built-in types + "typeinfo for bool const*"; + "typeinfo for bool"; + "typeinfo for char const*"; + "typeinfo for char"; + "typeinfo for double const*"; + "typeinfo for double"; + "typeinfo for float const*"; + "typeinfo for float"; + "typeinfo for int const*"; + "typeinfo for int"; + "typeinfo for long const*"; + "typeinfo for long double const*"; + "typeinfo for long double"; + "typeinfo for long long const*"; + "typeinfo for long long"; + "typeinfo for long"; + "typeinfo for short const*"; + "typeinfo for short"; + "typeinfo for signed char const*"; + "typeinfo for signed char"; + "typeinfo for unsigned char const*"; + "typeinfo for unsigned char"; + "typeinfo for unsigned int const*"; + "typeinfo for unsigned int"; + "typeinfo for unsigned long const*"; + "typeinfo for unsigned long long const*"; + "typeinfo for unsigned long long"; + "typeinfo for unsigned long"; + "typeinfo for unsigned short const*"; + "typeinfo for unsigned short"; + "typeinfo for void const*"; + "typeinfo for void"; + "typeinfo for wchar_t const*"; + "typeinfo for wchar_t"; + + "typeinfo for bool*"; + "typeinfo for wchar_t*"; + "typeinfo for short*"; + "typeinfo for char*"; + "typeinfo for unsigned char*"; + "typeinfo for long long*"; + "typeinfo for unsigned short*"; + "typeinfo for long*"; + "typeinfo for double*"; + "typeinfo for unsigned long*"; + "typeinfo for unsigned long long*"; + "typeinfo for int*"; + "typeinfo for long double*"; + "typeinfo for signed char*"; + "typeinfo for void*"; + "typeinfo for unsigned int*"; + "typeinfo for float*"; + + "typeinfo for __cxxabiv1::__array_type_info"; + "typeinfo for __cxxabiv1::__class_type_info"; + "typeinfo for __cxxabiv1::__enum_type_info"; + "typeinfo for __cxxabiv1::__function_type_info"; + "typeinfo for __cxxabiv1::__fundamental_type_info"; + "typeinfo for __cxxabiv1::__pbase_type_info"; + "typeinfo for __cxxabiv1::__pointer_to_member_type_info"; + "typeinfo for __cxxabiv1::__pointer_type_info"; + "typeinfo for __cxxabiv1::__si_class_type_info"; + "typeinfo for __cxxabiv1::__vmi_class_type_info"; + + # Typeinfo names. + + "typeinfo name for unsigned char const*"; + "typeinfo name for long const*"; + "typeinfo name for double const*"; + "typeinfo name for unsigned long long const*"; + "typeinfo name for unsigned short const*"; + "typeinfo name for char const*"; + "typeinfo name for long long const*"; + "typeinfo name for short const*"; + "typeinfo name for unsigned int const*"; + "typeinfo name for float const*"; + "typeinfo name for bool const*"; + "typeinfo name for wchar_t const*"; + "typeinfo name for int const*"; + "typeinfo name for unsigned long const*"; + "typeinfo name for void const*"; + "typeinfo name for long double const*"; + "typeinfo name for signed char const*"; + "typeinfo name for wchar_t"; + "typeinfo name for short"; + "typeinfo name for char"; + "typeinfo name for float"; + "typeinfo name for void"; + "typeinfo name for unsigned int"; + "typeinfo name for bool"; + "typeinfo name for signed char"; + "typeinfo name for long double"; + "typeinfo name for int"; + "typeinfo name for unsigned long long"; + "typeinfo name for unsigned long"; + "typeinfo name for unsigned char"; + "typeinfo name for long"; + "typeinfo name for long long"; + "typeinfo name for unsigned short"; + "typeinfo name for double"; + + "typeinfo name for bool*"; + "typeinfo name for wchar_t*"; + "typeinfo name for short*"; + "typeinfo name for char*"; + "typeinfo name for unsigned char*"; + "typeinfo name for long long*"; + "typeinfo name for unsigned short*"; + "typeinfo name for long*"; + "typeinfo name for double*"; + "typeinfo name for unsigned long*"; + "typeinfo name for unsigned long long*"; + "typeinfo name for int*"; + "typeinfo name for long double*"; + "typeinfo name for signed char*"; + "typeinfo name for void*"; + "typeinfo name for unsigned int*"; + "typeinfo name for float*"; + + "typeinfo name for __cxxabiv1::__array_type_info"; + "typeinfo name for __cxxabiv1::__class_type_info"; + "typeinfo name for __cxxabiv1::__enum_type_info"; + "typeinfo name for __cxxabiv1::__function_type_info"; + "typeinfo name for __cxxabiv1::__fundamental_type_info"; + "typeinfo name for __cxxabiv1::__pbase_type_info"; + "typeinfo name for __cxxabiv1::__pointer_to_member_type_info"; + "typeinfo name for __cxxabiv1::__pointer_type_info"; + "typeinfo name for __cxxabiv1::__si_class_type_info"; + "typeinfo name for __cxxabiv1::__vmi_class_type_info"; + + "std::type_info::type_info(std::type_info const&)"; + "std::type_info::type_info(std::type_info const&)"; + "std::type_info::~type_info()"; + "std::type_info::~type_info()"; + "std::type_info::~type_info()"; + "std::type_info::operator=(std::type_info const&)"; + "std::unexpected()"; + "std::get_terminate()"; + "std::set_terminate(void (*)())"; + "std::get_unexpected()"; + "std::set_unexpected(void (*)())"; + "std::set_new_handler(void (*)())"; + "std::uncaught_exception()"; + "std::terminate()"; + + + # Extensions + "pathscale::set_terminate(void (*)())"; + "pathscale::set_unexpected(void (*)())"; + "pathscale::set_use_thread_local_handlers(bool)"; + + + }; + + local: + *; +}; + +CXXABI_1.3.1 { + __cxa_get_exception_ptr; +} CXXABI_1.3; + + +CXXRT_1.0 { + + extern "C++" { + "std::bad_cast::what() const"; + "std::bad_typeid::what() const"; + "std::bad_alloc::what() const"; + "std::exception::what() const"; + "std::type_info::name() const"; + "std::type_info::before(std::type_info const&) const"; + "std::type_info::operator==(std::type_info const&) const"; + "std::type_info::operator!=(std::type_info const&) const"; + "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; + "std::bad_typeid::bad_typeid()"; + "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; + "std::bad_typeid::bad_typeid()"; + "std::bad_typeid::~bad_typeid()"; + "std::bad_typeid::~bad_typeid()"; + "std::bad_typeid::~bad_typeid()"; + "std::bad_typeid::operator=(std::bad_typeid const&)"; + "std::bad_cast::bad_cast(std::bad_cast const&)"; + "std::bad_cast::bad_cast()"; + "std::bad_cast::bad_cast(std::bad_cast const&)"; + "std::bad_cast::bad_cast()"; + "std::bad_cast::~bad_cast()"; + "std::bad_cast::~bad_cast()"; + "std::bad_cast::~bad_cast()"; + "std::bad_cast::operator=(std::bad_cast const&)"; + "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; + "std::bad_alloc::bad_alloc()"; + "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; + "std::bad_alloc::bad_alloc()"; + "std::bad_alloc::~bad_alloc()"; + "std::bad_alloc::~bad_alloc()"; + "std::bad_alloc::~bad_alloc()"; + "std::bad_alloc::operator=(std::bad_alloc const&)"; + "std::exception::exception(std::exception const&)"; + "std::exception::exception()"; + "std::exception::exception(std::exception const&)"; + "std::exception::exception()"; + "std::exception::~exception()"; + "std::exception::~exception()"; + "std::exception::~exception()"; + "std::exception::operator=(std::exception const&)"; + + + "vtable for std::bad_typeid"; + "vtable for std::bad_cast"; + "vtable for std::bad_alloc"; + "vtable for std::exception"; + "vtable for std::type_info"; + "typeinfo for std::bad_typeid"; + "typeinfo for std::bad_cast"; + "typeinfo for std::bad_alloc"; + "typeinfo for std::exception"; + "typeinfo for std::type_info"; + "typeinfo name for std::bad_typeid"; + "typeinfo name for std::bad_cast"; + "typeinfo name for std::bad_alloc"; + "typeinfo name for std::exception"; + "typeinfo name for std::type_info"; + + "operator delete[](void*)"; + "operator delete(void*)"; + "operator new[](unsigned long)"; + "operator new(unsigned long)"; + "operator new(unsigned long, std::nothrow_t const&)"; + + }; + __cxa_allocate_dependent_exception; + __cxa_current_primary_exception; + __cxa_decrement_exception_refcount; + __cxa_free_dependent_exception; + __cxa_increment_exception_refcount; + __cxa_rethrow_primary_exception; + +} CXXABI_1.3.1; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 12:57:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09706106564A; Mon, 19 Mar 2012 12:57:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E95948FC19; Mon, 19 Mar 2012 12:57:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JCvqlp069363; Mon, 19 Mar 2012 12:57:52 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JCvqpD069361; Mon, 19 Mar 2012 12:57:52 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201203191257.q2JCvqpD069361@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 19 Mar 2012 12:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233175 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 12:57:53 -0000 Author: ae Date: Mon Mar 19 12:57:52 2012 New Revision: 233175 URL: http://svn.freebsd.org/changeset/base/233175 Log: Make kern.geom.part node not static. Also add CTLFLAG_TUN to the check_integrity sysctl. MFC after: 1 month Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Mon Mar 19 11:53:33 2012 (r233174) +++ head/sys/geom/part/g_part.c Mon Mar 19 12:57:52 2012 (r233175) @@ -106,12 +106,13 @@ struct g_part_alias_list { }; SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, "GEOM_PART stuff"); static u_int check_integrity = 1; TUNABLE_INT("kern.geom.part.check_integrity", &check_integrity); -SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, CTLFLAG_RW, - &check_integrity, 1, "Enable integrity checking"); +SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, + CTLFLAG_RW | CTLFLAG_TUN, &check_integrity, 1, + "Enable integrity checking"); /* * The GEOM partitioning class. From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 13:14:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DB871065674; Mon, 19 Mar 2012 13:14:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67C278FC0C; Mon, 19 Mar 2012 13:14:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JDEjfJ069895; Mon, 19 Mar 2012 13:14:45 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JDEjeZ069894; Mon, 19 Mar 2012 13:14:45 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201203191314.q2JDEjeZ069894@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 19 Mar 2012 13:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233176 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 13:14:45 -0000 Author: ae Date: Mon Mar 19 13:14:44 2012 New Revision: 233176 URL: http://svn.freebsd.org/changeset/base/233176 Log: Add new GEOM_PART_LDM module that implements the Logical Disk Manager scheme. The LDM is a logical volume manager for MS Windows NT and it is also known as dynamic volumes. It supports about 2000 partitions and also provides the capability for software RAID implementations. This version implements only partitioning scheme capability and based on the linux-ntfs project documentation and several publications across the Web. NOTE: JBOD, RAID0 and RAID5 volumes aren't supported. An access to the LDM metadata is read-only. When LDM is on the disk partitioned with MBR we can also destroy metadata. For the GPT partitioned disks destroy action is not supported. Reviewed by: ivoras (previous version) MFC after: 1 month Added: head/sys/geom/part/g_part_ldm.c (contents, props changed) Added: head/sys/geom/part/g_part_ldm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/part/g_part_ldm.c Mon Mar 19 13:14:44 2012 (r233176) @@ -0,0 +1,1504 @@ +/*- + * Copyright (c) 2012 Andrey V. Elsukov + * 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 +#include +#include +#include +#include +#include + +#include "g_part_if.h" + +FEATURE(geom_part_ldm, "GEOM partitioning class for LDM support"); + +SYSCTL_DECL(_kern_geom_part); +static SYSCTL_NODE(_kern_geom_part, OID_AUTO, ldm, CTLFLAG_RW, 0, + "GEOM_PART_LDM Logical Disk Manager"); + +static u_int ldm_debug = 0; +TUNABLE_INT("kern.geom.part.ldm.debug", &ldm_debug); +SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, debug, CTLFLAG_RW, + &ldm_debug, 0, "Debug level"); + +/* + * This allows access to mirrored LDM volumes. Since we do not + * doing mirroring here, it is not enabled by default. + */ +static u_int show_mirrors = 0; +TUNABLE_INT("kern.geom.part.ldm.show_mirrors", &show_mirrors); +SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, show_mirrors, CTLFLAG_RW, + &show_mirrors, 0, "Show mirrored volumes"); + +#define LDM_DEBUG(lvl, fmt, ...) do { \ + if (ldm_debug >= (lvl)) { \ + printf("GEOM_PART: " fmt "\n", __VA_ARGS__); \ + } \ +} while (0) +#define LDM_DUMP(buf, size) do { \ + if (ldm_debug > 1) { \ + hexdump(buf, size, NULL, 0); \ + } \ +} while (0) + +/* + * There are internal representations of LDM structures. + * + * We do not keep all fields of on-disk structures, only most useful. + * All numbers in an on-disk structures are in big-endian format. + */ + +/* + * Private header is 512 bytes long. There are three copies on each disk. + * Offset and sizes are in sectors. Location of each copy: + * - the first offset is relative to the disk start; + * - the second and third offset are relative to the LDM database start. + * + * On a disk partitioned with GPT, the LDM has not first private header. + */ +#define LDM_PH_MBRINDEX 0 +#define LDM_PH_GPTINDEX 2 +static const uint64_t ldm_ph_off[] = {6, 1856, 2047}; +#define LDM_VERSION_2K 0x2000b +#define LDM_VERSION_VISTA 0x2000c +#define LDM_PH_VERSION_OFF 0x00c +#define LDM_PH_DISKGUID_OFF 0x030 +#define LDM_PH_DGGUID_OFF 0x0b0 +#define LDM_PH_DGNAME_OFF 0x0f0 +#define LDM_PH_START_OFF 0x11b +#define LDM_PH_SIZE_OFF 0x123 +#define LDM_PH_DB_OFF 0x12b +#define LDM_PH_DBSIZE_OFF 0x133 +#define LDM_PH_TH1_OFF 0x13b +#define LDM_PH_TH2_OFF 0x143 +#define LDM_PH_CONFSIZE_OFF 0x153 +#define LDM_PH_LOGSIZE_OFF 0x15b +#define LDM_PH_SIGN "PRIVHEAD" +struct ldm_privhdr { + struct uuid disk_guid; + struct uuid dg_guid; + u_char dg_name[32]; + uint64_t start; /* logical disk start */ + uint64_t size; /* logical disk size */ + uint64_t db_offset; /* LDM database start */ +#define LDM_DB_SIZE 2048 + uint64_t db_size; /* LDM database size */ +#define LDM_TH_COUNT 2 + uint64_t th_offset[LDM_TH_COUNT]; /* TOC header offsets */ + uint64_t conf_size; /* configuration size */ + uint64_t log_size; /* size of log */ +}; + +/* + * Table of contents header is 512 bytes long. + * There are two identical copies at offsets from the private header. + * Offsets are relative to the LDM database start. + */ +#define LDM_TH_SIGN "TOCBLOCK" +#define LDM_TH_NAME1 "config" +#define LDM_TH_NAME2 "log" +#define LDM_TH_NAME1_OFF 0x024 +#define LDM_TH_CONF_OFF 0x02e +#define LDM_TH_CONFSIZE_OFF 0x036 +#define LDM_TH_NAME2_OFF 0x046 +#define LDM_TH_LOG_OFF 0x050 +#define LDM_TH_LOGSIZE_OFF 0x058 +struct ldm_tochdr { + uint64_t conf_offset; /* configuration offset */ + uint64_t log_offset; /* log offset */ +}; + +/* + * LDM database header is 512 bytes long. + */ +#define LDM_VMDB_SIGN "VMDB" +#define LDM_DB_LASTSEQ_OFF 0x004 +#define LDM_DB_SIZE_OFF 0x008 +#define LDM_DB_STATUS_OFF 0x010 +#define LDM_DB_VERSION_OFF 0x012 +#define LDM_DB_DGNAME_OFF 0x016 +#define LDM_DB_DGGUID_OFF 0x035 +struct ldm_vmdbhdr { + uint32_t last_seq; /* sequence number of last VBLK */ + uint32_t size; /* size of VBLK */ +}; + +/* + * The LDM database configuration section contains VMDB header and + * many VBLKs. Each VBLK represents a disk group, disk partition, + * component or volume. + * + * The most interesting for us are volumes, they are represents + * partitions in the GEOM_PART meaning. But volume VBLK does not + * contain all information needed to create GEOM provider. And we + * should get this information from the related VBLK. This is how + * VBLK releated: + * Volumes <- Components <- Partitions -> Disks + * + * One volume can contain several components. In this case LDM + * does mirroring of volume data to each component. + * + * Also each component can contain several partitions (spanned or + * striped volumes). + */ + +struct ldm_component { + uint64_t id; /* object id */ + uint64_t vol_id; /* parent volume object id */ + + int count; + LIST_HEAD(, ldm_partition) partitions; + LIST_ENTRY(ldm_component) entry; +}; + +struct ldm_volume { + uint64_t id; /* object id */ + uint64_t size; /* volume size */ + uint8_t number; /* used for ordering */ + uint8_t part_type; /* partition type */ + + int count; + LIST_HEAD(, ldm_component) components; + LIST_ENTRY(ldm_volume) entry; +}; + +struct ldm_disk { + uint64_t id; /* object id */ + struct uuid guid; /* disk guid */ + + LIST_ENTRY(ldm_disk) entry; +}; + +#if 0 +struct ldm_disk_group { + uint64_t id; /* object id */ + struct uuid guid; /* disk group guid */ + u_char name[32]; /* disk group name */ + + LIST_ENTRY(ldm_disk_group) entry; +}; +#endif + +struct ldm_partition { + uint64_t id; /* object id */ + uint64_t disk_id; /* disk object id */ + uint64_t comp_id; /* parent component object id */ + uint64_t start; /* offset relative to disk start */ + uint64_t offset; /* offset for spanned volumes */ + uint64_t size; /* partition size */ + + LIST_ENTRY(ldm_partition) entry; +}; + +/* + * Each VBLK is 128 bytes long and has standard 16 bytes header. + * Some of VBLK's fields are fixed size, but others has variable size. + * Fields with variable size are prefixed with one byte length marker. + * Some fields are strings and also can have fixed size and variable. + * Strings with fixed size are NULL-terminated, others are not. + * All VBLKs have same several first fields: + * Offset Size Description + * ---------------+---------------+-------------------------- + * 0x00 16 standard VBLK header + * 0x10 2 update status + * 0x13 1 VBLK type + * 0x18 PS object id + * 0x18+ PN object name + * + * o Offset 0x18+ means '0x18 + length of all variable-width fields' + * o 'P' in size column means 'prefixed' (variable-width), + * 'S' - string, 'N' - number. + */ +#define LDM_VBLK_SIGN "VBLK" +#define LDM_VBLK_SEQ_OFF 0x04 +#define LDM_VBLK_GROUP_OFF 0x08 +#define LDM_VBLK_INDEX_OFF 0x0c +#define LDM_VBLK_COUNT_OFF 0x0e +#define LDM_VBLK_TYPE_OFF 0x13 +#define LDM_VBLK_OID_OFF 0x18 +struct ldm_vblkhdr { + uint32_t seq; /* sequence number */ + uint32_t group; /* group number */ + uint16_t index; /* index in the group */ + uint16_t count; /* number of entries in the group */ +}; + +#define LDM_VBLK_T_COMPONENT 0x32 +#define LDM_VBLK_T_PARTITION 0x33 +#define LDM_VBLK_T_DISK 0x34 +#define LDM_VBLK_T_DISKGROUP 0x35 +#define LDM_VBLK_T_DISK4 0x44 +#define LDM_VBLK_T_DISKGROUP4 0x45 +#define LDM_VBLK_T_VOLUME 0x51 +struct ldm_vblk { + uint8_t type; /* VBLK type */ + union { + uint64_t id; + struct ldm_volume vol; + struct ldm_component comp; + struct ldm_disk disk; + struct ldm_partition part; +#if 0 + struct ldm_disk_group disk_group; +#endif + } u; + LIST_ENTRY(ldm_vblk) entry; +}; + +/* + * Some VBLKs contains a bit more data than can fit into 128 bytes. These + * VBLKs are called eXtended VBLK. Before parsing, the data from these VBLK + * should be placed into continuous memory buffer. We can determine xVBLK + * by the count field in the standard VBLK header (count > 1). + */ +struct ldm_xvblk { + uint32_t group; /* xVBLK group number */ + uint32_t size; /* the total size of xVBLK */ + uint8_t map; /* bitmask of currently saved VBLKs */ + u_char *data; /* xVBLK data */ + + LIST_ENTRY(ldm_xvblk) entry; +}; + +/* The internal representation of LDM database. */ +struct ldm_db { + struct ldm_privhdr ph; /* private header */ + struct ldm_tochdr th; /* TOC header */ + struct ldm_vmdbhdr dh; /* VMDB header */ + + LIST_HEAD(, ldm_volume) volumes; + LIST_HEAD(, ldm_disk) disks; + LIST_HEAD(, ldm_vblk) vblks; + LIST_HEAD(, ldm_xvblk) xvblks; +}; + +static struct uuid gpt_uuid_ms_ldm_metadata = GPT_ENT_TYPE_MS_LDM_METADATA; + +struct g_part_ldm_table { + struct g_part_table base; + uint64_t db_offset; + int is_gpt; +}; +struct g_part_ldm_entry { + struct g_part_entry base; + uint8_t type; +}; + +static int g_part_ldm_add(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); +static int g_part_ldm_bootcode(struct g_part_table *, struct g_part_parms *); +static int g_part_ldm_create(struct g_part_table *, struct g_part_parms *); +static int g_part_ldm_destroy(struct g_part_table *, struct g_part_parms *); +static void g_part_ldm_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); +static int g_part_ldm_dumpto(struct g_part_table *, struct g_part_entry *); +static int g_part_ldm_modify(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); +static const char *g_part_ldm_name(struct g_part_table *, struct g_part_entry *, + char *, size_t); +static int g_part_ldm_probe(struct g_part_table *, struct g_consumer *); +static int g_part_ldm_read(struct g_part_table *, struct g_consumer *); +static int g_part_ldm_setunset(struct g_part_table *, struct g_part_entry *, + const char *, unsigned int); +static const char *g_part_ldm_type(struct g_part_table *, struct g_part_entry *, + char *, size_t); +static int g_part_ldm_write(struct g_part_table *, struct g_consumer *); +static int g_part_ldm_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); + +static kobj_method_t g_part_ldm_methods[] = { + KOBJMETHOD(g_part_add, g_part_ldm_add), + KOBJMETHOD(g_part_bootcode, g_part_ldm_bootcode), + KOBJMETHOD(g_part_create, g_part_ldm_create), + KOBJMETHOD(g_part_destroy, g_part_ldm_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_ldm_dumpconf), + KOBJMETHOD(g_part_dumpto, g_part_ldm_dumpto), + KOBJMETHOD(g_part_modify, g_part_ldm_modify), + KOBJMETHOD(g_part_resize, g_part_ldm_resize), + KOBJMETHOD(g_part_name, g_part_ldm_name), + KOBJMETHOD(g_part_probe, g_part_ldm_probe), + KOBJMETHOD(g_part_read, g_part_ldm_read), + KOBJMETHOD(g_part_setunset, g_part_ldm_setunset), + KOBJMETHOD(g_part_type, g_part_ldm_type), + KOBJMETHOD(g_part_write, g_part_ldm_write), + { 0, 0 } +}; + +static struct g_part_scheme g_part_ldm_scheme = { + "LDM", + g_part_ldm_methods, + sizeof(struct g_part_ldm_table), + .gps_entrysz = sizeof(struct g_part_ldm_entry) +}; +G_PART_SCHEME_DECLARE(g_part_ldm); + +static struct g_part_ldm_alias { + u_char typ; + int alias; +} ldm_alias_match[] = { + { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, + { DOSPTYP_FAT32, G_PART_ALIAS_MS_FAT32 }, + { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, + { DOSPTYP_LDM, G_PART_ALIAS_MS_LDM_DATA }, + { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, + { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, + { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, + { DOSPTYP_LINRAID, G_PART_ALIAS_LINUX_RAID }, +}; + +static u_char* +ldm_privhdr_read(struct g_consumer *cp, uint64_t off, int *error) +{ + struct g_provider *pp; + u_char *buf; + + pp = cp->provider; + buf = g_read_data(cp, off, pp->sectorsize, error); + if (buf == NULL) + return (NULL); + + if (memcmp(buf, LDM_PH_SIGN, strlen(LDM_PH_SIGN)) != 0) { + LDM_DEBUG(1, "%s: invalid LDM private header signature", + pp->name); + g_free(buf); + buf = NULL; + *error = EINVAL; + } + return (buf); +} + +static int +ldm_privhdr_parse(struct g_consumer *cp, struct ldm_privhdr *hdr, + const u_char *buf) +{ + uint32_t version; + int error; + + memset(hdr, 0, sizeof(*hdr)); + version = be32dec(buf + LDM_PH_VERSION_OFF); + if (version != LDM_VERSION_2K && + version != LDM_VERSION_VISTA) { + LDM_DEBUG(0, "%s: unsupported LDM version %u.%u", + cp->provider->name, version >> 16, + version & 0xFFFF); + return (ENXIO); + } + error = parse_uuid(buf + LDM_PH_DISKGUID_OFF, &hdr->disk_guid); + if (error != 0) + return (error); + error = parse_uuid(buf + LDM_PH_DGGUID_OFF, &hdr->dg_guid); + if (error != 0) + return (error); + strncpy(hdr->dg_name, buf + LDM_PH_DGNAME_OFF, sizeof(hdr->dg_name)); + hdr->start = be64dec(buf + LDM_PH_START_OFF); + hdr->size = be64dec(buf + LDM_PH_SIZE_OFF); + hdr->db_offset = be64dec(buf + LDM_PH_DB_OFF); + hdr->db_size = be64dec(buf + LDM_PH_DBSIZE_OFF); + hdr->th_offset[0] = be64dec(buf + LDM_PH_TH1_OFF); + hdr->th_offset[1] = be64dec(buf + LDM_PH_TH2_OFF); + hdr->conf_size = be64dec(buf + LDM_PH_CONFSIZE_OFF); + hdr->log_size = be64dec(buf + LDM_PH_LOGSIZE_OFF); + return (0); +} + +static int +ldm_privhdr_check(struct ldm_db *db, struct g_consumer *cp, int is_gpt) +{ + struct g_consumer *cp2; + struct g_provider *pp; + struct ldm_privhdr hdr; + uint64_t offset, last; + int error, found, i; + u_char *buf; + + pp = cp->provider; + if (is_gpt) { + /* + * The last LBA is used in several checks below, for the + * GPT case it should be calculated relative to the whole + * disk. + */ + cp2 = LIST_FIRST(&pp->geom->consumer); + last = + cp2->provider->mediasize / cp2->provider->sectorsize - 1; + } else + last = pp->mediasize / pp->sectorsize - 1; + for (found = 0, i = is_gpt; + i < sizeof(ldm_ph_off) / sizeof(ldm_ph_off[0]); i++) { + offset = ldm_ph_off[i]; + /* + * In the GPT case consumer is attached to the LDM metadata + * partition and we don't need add db_offset. + */ + if (!is_gpt) + offset += db->ph.db_offset; + if (i == LDM_PH_MBRINDEX) { + /* + * Prepare to errors and setup new base offset + * to read backup private headers. Assume that LDM + * database is in the last 1Mbyte area. + */ + db->ph.db_offset = last - LDM_DB_SIZE; + } + buf = ldm_privhdr_read(cp, offset * pp->sectorsize, &error); + if (buf == NULL) { + LDM_DEBUG(1, "%s: failed to read private header " + "%d at LBA %ju", pp->name, i, (uintmax_t)offset); + continue; + } + error = ldm_privhdr_parse(cp, &hdr, buf); + if (error != 0) { + LDM_DEBUG(1, "%s: failed to parse private " + "header %d", pp->name, i); + LDM_DUMP(buf, pp->sectorsize); + g_free(buf); + continue; + } + g_free(buf); + if (hdr.start > last || + hdr.start + hdr.size - 1 > last || + (hdr.start + hdr.size - 1 > hdr.db_offset && is_gpt) || + hdr.db_size != LDM_DB_SIZE || + hdr.db_offset + LDM_DB_SIZE - 1 > last || + hdr.th_offset[0] >= LDM_DB_SIZE || + hdr.th_offset[1] >= LDM_DB_SIZE || + hdr.conf_size + hdr.log_size >= LDM_DB_SIZE) { + LDM_DEBUG(1, "%s: invalid values in the " + "private header %d", pp->name, i); + LDM_DEBUG(2, "%s: start: %jd, size: %jd, " + "db_offset: %jd, db_size: %jd, th_offset0: %jd, " + "th_offset1: %jd, conf_size: %jd, log_size: %jd, " + "last: %jd", pp->name, hdr.start, hdr.size, + hdr.db_offset, hdr.db_size, hdr.th_offset[0], + hdr.th_offset[1], hdr.conf_size, hdr.log_size, + last); + continue; + } + if (found != 0 && memcmp(&db->ph, &hdr, sizeof(hdr)) != 0) { + LDM_DEBUG(0, "%s: private headers are not equal", + pp->name); + if (i > 1) { + /* + * We have different headers in the LDM. + * We can not trust this metadata. + */ + LDM_DEBUG(0, "%s: refuse LDM metadata", + pp->name); + return (EINVAL); + } + /* + * We already have read primary private header + * and it differs from this backup one. + * Prefer the backup header and save it. + */ + found = 0; + } + if (found == 0) + memcpy(&db->ph, &hdr, sizeof(hdr)); + found = 1; + } + if (found == 0) { + LDM_DEBUG(1, "%s: valid LDM private header not found", + pp->name); + return (ENXIO); + } + return (0); +} + +static int +ldm_gpt_check(struct ldm_db *db, struct g_consumer *cp) +{ + struct g_part_table *gpt; + struct g_part_entry *e; + struct g_consumer *cp2; + int error; + + cp2 = LIST_NEXT(cp, consumer); + g_topology_lock(); + gpt = cp->provider->geom->softc; + error = 0; + LIST_FOREACH(e, &gpt->gpt_entry, gpe_entry) { + if (cp->provider == e->gpe_pp) { + /* ms-ldm-metadata partition */ + if (e->gpe_start != db->ph.db_offset || + e->gpe_end != db->ph.db_offset + LDM_DB_SIZE - 1) + error++; + } else if (cp2->provider == e->gpe_pp) { + /* ms-ldm-data partition */ + if (e->gpe_start != db->ph.start || + e->gpe_end != db->ph.start + db->ph.size - 1) + error++; + } + if (error != 0) { + LDM_DEBUG(0, "%s: GPT partition %d boundaries " + "do not match with the LDM metadata", + e->gpe_pp->name, e->gpe_index); + error = ENXIO; + break; + } + } + g_topology_unlock(); + return (error); +} + +static int +ldm_tochdr_check(struct ldm_db *db, struct g_consumer *cp) +{ + struct g_provider *pp; + struct ldm_tochdr hdr; + uint64_t offset, conf_size, log_size; + int error, found, i; + u_char *buf; + + pp = cp->provider; + for (i = 0, found = 0; i < LDM_TH_COUNT; i++) { + offset = db->ph.db_offset + db->ph.th_offset[i]; + buf = g_read_data(cp, + offset * pp->sectorsize, pp->sectorsize, &error); + if (buf == NULL) { + LDM_DEBUG(1, "%s: failed to read TOC header " + "at LBA %ju", pp->name, (uintmax_t)offset); + continue; + } + if (memcmp(buf, LDM_TH_SIGN, strlen(LDM_TH_SIGN)) != 0 || + memcmp(buf + LDM_TH_NAME1_OFF, LDM_TH_NAME1, + strlen(LDM_TH_NAME1)) != 0 || + memcmp(buf + LDM_TH_NAME2_OFF, LDM_TH_NAME2, + strlen(LDM_TH_NAME2)) != 0) { + LDM_DEBUG(1, "%s: failed to parse TOC header " + "at LBA %ju", pp->name, (uintmax_t)offset); + LDM_DUMP(buf, pp->sectorsize); + g_free(buf); + continue; + } + hdr.conf_offset = be64dec(buf + LDM_TH_CONF_OFF); + hdr.log_offset = be64dec(buf + LDM_TH_LOG_OFF); + conf_size = be64dec(buf + LDM_TH_CONFSIZE_OFF); + log_size = be64dec(buf + LDM_TH_LOGSIZE_OFF); + if (conf_size != db->ph.conf_size || + hdr.conf_offset + conf_size >= LDM_DB_SIZE || + log_size != db->ph.log_size || + hdr.log_offset + log_size >= LDM_DB_SIZE) { + LDM_DEBUG(1, "%s: invalid values in the " + "TOC header at LBA %ju", pp->name, + (uintmax_t)offset); + LDM_DUMP(buf, pp->sectorsize); + g_free(buf); + continue; + } + g_free(buf); + if (found == 0) + memcpy(&db->th, &hdr, sizeof(hdr)); + found = 1; + } + if (found == 0) { + LDM_DEBUG(0, "%s: valid LDM TOC header not found.", + pp->name); + return (ENXIO); + } + return (0); +} + +static int +ldm_vmdbhdr_check(struct ldm_db *db, struct g_consumer *cp) +{ + struct g_provider *pp; + struct uuid dg_guid; + uint64_t offset; + uint32_t version; + int error; + u_char *buf; + + pp = cp->provider; + offset = db->ph.db_offset + db->th.conf_offset; + buf = g_read_data(cp, offset * pp->sectorsize, pp->sectorsize, + &error); + if (buf == NULL) { + LDM_DEBUG(0, "%s: failed to read VMDB header at " + "LBA %ju", pp->name, (uintmax_t)offset); + return (error); + } + if (memcmp(buf, LDM_VMDB_SIGN, strlen(LDM_VMDB_SIGN)) != 0) { + g_free(buf); + LDM_DEBUG(0, "%s: failed to parse VMDB header at " + "LBA %ju", pp->name, (uintmax_t)offset); + return (ENXIO); + } + /* Check version. */ + version = be32dec(buf + LDM_DB_VERSION_OFF); + if (version != 0x4000A) { + g_free(buf); + LDM_DEBUG(0, "%s: unsupported VMDB version %u.%u", + pp->name, version >> 16, version & 0xFFFF); + return (ENXIO); + } + /* + * Check VMDB update status: + * 1 - in a consistent state; + * 2 - in a creation phase; + * 3 - in a deletion phase; + */ + if (be16dec(buf + LDM_DB_STATUS_OFF) != 1) { + g_free(buf); + LDM_DEBUG(0, "%s: VMDB is not in a consistent state", + pp->name); + return (ENXIO); + } + db->dh.last_seq = be32dec(buf + LDM_DB_LASTSEQ_OFF); + db->dh.size = be32dec(buf + LDM_DB_SIZE_OFF); + error = parse_uuid(buf + LDM_DB_DGGUID_OFF, &dg_guid); + /* Compare disk group name and guid from VMDB and private headers */ + if (error != 0 || db->dh.size == 0 || + pp->sectorsize % db->dh.size != 0 || + strncmp(buf + LDM_DB_DGNAME_OFF, db->ph.dg_name, 31) != 0 || + memcmp(&dg_guid, &db->ph.dg_guid, sizeof(dg_guid)) != 0 || + db->dh.size * db->dh.last_seq > + db->ph.conf_size * pp->sectorsize) { + LDM_DEBUG(0, "%s: invalid values in the VMDB header", + pp->name); + LDM_DUMP(buf, pp->sectorsize); + g_free(buf); + return (EINVAL); + } + g_free(buf); + return (0); +} + +static int +ldm_xvblk_handle(struct ldm_db *db, struct ldm_vblkhdr *vh, const u_char *p) +{ + struct ldm_xvblk *blk; + size_t size; + + size = db->dh.size - 16; + LIST_FOREACH(blk, &db->xvblks, entry) + if (blk->group == vh->group) + break; + if (blk == NULL) { + blk = g_malloc(sizeof(*blk), M_WAITOK | M_ZERO); + blk->group = vh->group; + blk->size = size * vh->count + 16; + blk->data = g_malloc(blk->size, M_WAITOK | M_ZERO); + blk->map = 0xFF << vh->count; + LIST_INSERT_HEAD(&db->xvblks, blk, entry); + } + if ((blk->map & (1 << vh->index)) != 0) { + /* Block with given index has been already saved. */ + return (EINVAL); + } + /* Copy the data block to the place related to index. */ + memcpy(blk->data + size * vh->index + 16, p + 16, size); + blk->map |= 1 << vh->index; + return (0); +} + +/* Read the variable-width numeric field and return new offset */ +static int +ldm_vnum_get(const u_char *buf, int offset, uint64_t *result, size_t range) +{ + uint64_t num; + uint8_t len; + + len = buf[offset++]; + if (len > sizeof(uint64_t) || len + offset >= range) + return (-1); + for (num = 0; len > 0; len--) + num = (num << 8) | buf[offset++]; + *result = num; + return (offset); +} + +/* Read the variable-width string and return new offset */ +static int +ldm_vstr_get(const u_char *buf, int offset, u_char *result, + size_t maxlen, size_t range) +{ + uint8_t len; + + len = buf[offset++]; + if (len >= maxlen || len + offset >= range) + return (-1); + memcpy(result, buf + offset, len); + result[len] = '\0'; + return (offset + len); +} + +/* Just skip the variable-width variable and return new offset */ +static int +ldm_vparm_skip(const u_char *buf, int offset, size_t range) +{ + uint8_t len; + + len = buf[offset++]; + if (offset + len >= range) + return (-1); + + return (offset + len); +} + +static int +ldm_vblk_handle(struct ldm_db *db, const u_char *p, size_t size) +{ + struct ldm_vblk *blk; + struct ldm_volume *volume, *last; + const char *errstr; + u_char vstr[64]; + int error, offset; + + blk = g_malloc(sizeof(*blk), M_WAITOK | M_ZERO); + blk->type = p[LDM_VBLK_TYPE_OFF]; + offset = ldm_vnum_get(p, LDM_VBLK_OID_OFF, &blk->u.id, size); + if (offset < 0) { + errstr = "object id"; + goto fail; + } + offset = ldm_vstr_get(p, offset, vstr, sizeof(vstr), size); + if (offset < 0) { + errstr = "object name"; + goto fail; + } + switch (blk->type) { + /* + * Component VBLK fields: + * Offset Size Description + * ------------+-------+------------------------ + * 0x18+ PS volume state + * 0x18+5 PN component children count + * 0x1D+16 PN parent's volume object id + * 0x2D+1 PN stripe size + */ + case LDM_VBLK_T_COMPONENT: + offset = ldm_vparm_skip(p, offset, size); + if (offset < 0) { + errstr = "volume state"; + goto fail; + } + offset = ldm_vparm_skip(p, offset + 5, size); + if (offset < 0) { + errstr = "children count"; + goto fail; + } + offset = ldm_vnum_get(p, offset + 16, + &blk->u.comp.vol_id, size); + if (offset < 0) { + errstr = "volume id"; + goto fail; + } + break; + /* + * Partition VBLK fields: + * Offset Size Description + * ------------+-------+------------------------ + * 0x18+12 8 partition start offset + * 0x18+20 8 volume offset + * 0x18+28 PN partition size + * 0x34+ PN parent's component object id + * 0x34+ PN disk's object id + */ + case LDM_VBLK_T_PARTITION: + if (offset + 28 >= size) { + errstr = "too small buffer"; + goto fail; + } + blk->u.part.start = be64dec(p + offset + 12); + blk->u.part.offset = be64dec(p + offset + 20); + offset = ldm_vnum_get(p, offset + 28, &blk->u.part.size, size); + if (offset < 0) { + errstr = "partition size"; + goto fail; + } + offset = ldm_vnum_get(p, offset, &blk->u.part.comp_id, size); + if (offset < 0) { + errstr = "component id"; + goto fail; + } + offset = ldm_vnum_get(p, offset, &blk->u.part.disk_id, size); + if (offset < 0) { + errstr = "disk id"; + goto fail; + } + break; + /* + * Disk VBLK fields: + * Offset Size Description + * ------------+-------+------------------------ + * 0x18+ PS disk GUID + */ + case LDM_VBLK_T_DISK: + errstr = "disk guid"; + offset = ldm_vstr_get(p, offset, vstr, sizeof(vstr), size); + if (offset < 0) + goto fail; + error = parse_uuid(vstr, &blk->u.disk.guid); + if (error != 0) + goto fail; + LIST_INSERT_HEAD(&db->disks, &blk->u.disk, entry); + break; + /* + * Disk group VBLK fields: + * Offset Size Description + * ------------+-------+------------------------ + * 0x18+ PS disk group GUID + */ + case LDM_VBLK_T_DISKGROUP: +#if 0 + strncpy(blk->u.disk_group.name, vstr, + sizeof(blk->u.disk_group.name)); + offset = ldm_vstr_get(p, offset, vstr, sizeof(vstr), size); + if (offset < 0) { + errstr = "disk group guid"; + goto fail; + } + error = parse_uuid(name, &blk->u.disk_group.guid); + if (error != 0) { + errstr = "disk group guid"; + goto fail; + } + LIST_INSERT_HEAD(&db->groups, &blk->u.disk_group, entry); +#endif + break; + /* + * Disk VBLK fields: + * Offset Size Description + * ------------+-------+------------------------ + * 0x18+ 16 disk GUID + */ + case LDM_VBLK_T_DISK4: + be_uuid_dec(p + offset, &blk->u.disk.guid); + LIST_INSERT_HEAD(&db->disks, &blk->u.disk, entry); + break; + /* + * Disk group VBLK fields: + * Offset Size Description + * ------------+-------+------------------------ + * 0x18+ 16 disk GUID + */ + case LDM_VBLK_T_DISKGROUP4: +#if 0 + strncpy(blk->u.disk_group.name, vstr, + sizeof(blk->u.disk_group.name)); + be_uuid_dec(p + offset, &blk->u.disk.guid); + LIST_INSERT_HEAD(&db->groups, &blk->u.disk_group, entry); +#endif + break; + /* + * Volume VBLK fields: + * Offset Size Description + * ------------+-------+------------------------ + * 0x18+ PS volume type + * 0x18+ PS unknown + * 0x18+ 14(S) volume state + * 0x18+16 1 volume number + * 0x18+21 PN volume children count + * 0x2D+16 PN volume size + * 0x3D+4 1 partition type + */ + case LDM_VBLK_T_VOLUME: + offset = ldm_vparm_skip(p, offset, size); + if (offset < 0) { + errstr = "volume type"; + goto fail; + } + offset = ldm_vparm_skip(p, offset, size); + if (offset < 0) { + errstr = "unknown param"; + goto fail; + } + if (offset + 21 >= size) { + errstr = "too small buffer"; + goto fail; + } + blk->u.vol.number = p[offset + 16]; + offset = ldm_vparm_skip(p, offset + 21, size); + if (offset < 0) { + errstr = "children count"; + goto fail; + } + offset = ldm_vnum_get(p, offset + 16, &blk->u.vol.size, size); + if (offset < 0) { + errstr = "volume size"; + goto fail; + } + if (offset + 4 >= size) { + errstr = "too small buffer"; + goto fail; + } + blk->u.vol.part_type = p[offset + 4]; + /* keep volumes ordered by volume number */ + last = NULL; + LIST_FOREACH(volume, &db->volumes, entry) { + if (volume->number > blk->u.vol.number) + break; + last = volume; + } + if (last != NULL) + LIST_INSERT_AFTER(last, &blk->u.vol, entry); + else + LIST_INSERT_HEAD(&db->volumes, &blk->u.vol, entry); + break; + default: + LDM_DEBUG(1, "unknown VBLK type 0x%02x\n", blk->type); + LDM_DUMP(p, size); + } + LIST_INSERT_HEAD(&db->vblks, blk, entry); + return (0); +fail: + LDM_DEBUG(0, "failed to parse '%s' in VBLK of type 0x%02x\n", + errstr, blk->type); + LDM_DUMP(p, size); + g_free(blk); + return (EINVAL); +} + +static void +ldm_vmdb_free(struct ldm_db *db) +{ + struct ldm_vblk *vblk; + struct ldm_xvblk *xvblk; + + while (!LIST_EMPTY(&db->xvblks)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 13:15:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 060C3106564A; Mon, 19 Mar 2012 13:15:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E47F08FC18; Mon, 19 Mar 2012 13:15:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JDFmaF069970; Mon, 19 Mar 2012 13:15:48 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JDFmcu069967; Mon, 19 Mar 2012 13:15:48 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201203191315.q2JDFmcu069967@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 19 Mar 2012 13:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233177 - in head/sys/modules/geom/geom_part: . geom_part_ldm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 13:15:49 -0000 Author: ae Date: Mon Mar 19 13:15:48 2012 New Revision: 233177 URL: http://svn.freebsd.org/changeset/base/233177 Log: Connect geom_part_ldm module to the build. MFC after: 1 month Added: head/sys/modules/geom/geom_part/geom_part_ldm/ head/sys/modules/geom/geom_part/geom_part_ldm/Makefile (contents, props changed) Modified: head/sys/modules/geom/geom_part/Makefile Modified: head/sys/modules/geom/geom_part/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/Makefile Mon Mar 19 13:14:44 2012 (r233176) +++ head/sys/modules/geom/geom_part/Makefile Mon Mar 19 13:15:48 2012 (r233177) @@ -4,6 +4,7 @@ SUBDIR= geom_part_apm \ geom_part_bsd \ geom_part_ebr \ geom_part_gpt \ + geom_part_ldm \ geom_part_mbr \ geom_part_pc98 \ geom_part_vtoc8 Added: head/sys/modules/geom/geom_part/geom_part_ldm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/geom/geom_part/geom_part_ldm/Makefile Mon Mar 19 13:15:48 2012 (r233177) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../../geom/part + +KMOD= geom_part_ldm +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 From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 13:16:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4A16106564A; Mon, 19 Mar 2012 13:16:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F8CC8FC17; Mon, 19 Mar 2012 13:16:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JDGktH070050; Mon, 19 Mar 2012 13:16:46 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JDGksq070046; Mon, 19 Mar 2012 13:16:46 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201203191316.q2JDGksq070046@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 19 Mar 2012 13:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233178 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 13:16:46 -0000 Author: ae Date: Mon Mar 19 13:16:46 2012 New Revision: 233178 URL: http://svn.freebsd.org/changeset/base/233178 Log: Connect geom_part_ldm to the kernel build. MFC after: 1 month Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Mar 19 13:15:48 2012 (r233177) +++ head/sys/conf/NOTES Mon Mar 19 13:16:46 2012 (r233178) @@ -159,6 +159,7 @@ options GEOM_PART_BSD # BSD disklabel options GEOM_PART_EBR # Extended Boot Records options GEOM_PART_EBR_COMPAT # Backward compatible partition names options GEOM_PART_GPT # GPT partitioning +options GEOM_PART_LDM # Logical Disk Manager options GEOM_PART_MBR # MBR partitioning options GEOM_PART_PC98 # PC-9800 disk partitioning options GEOM_PART_VTOC8 # SMI VTOC8 disk label Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Mar 19 13:15:48 2012 (r233177) +++ head/sys/conf/files Mon Mar 19 13:16:46 2012 (r233178) @@ -2256,6 +2256,7 @@ geom/part/g_part_apm.c optional geom_pa geom/part/g_part_bsd.c optional geom_part_bsd geom/part/g_part_ebr.c optional geom_part_ebr geom/part/g_part_gpt.c optional geom_part_gpt +geom/part/g_part_ldm.c optional geom_part_ldm geom/part/g_part_mbr.c optional geom_part_mbr geom/part/g_part_pc98.c optional geom_part_pc98 geom/part/g_part_vtoc8.c optional geom_part_vtoc8 Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Mar 19 13:15:48 2012 (r233177) +++ head/sys/conf/options Mon Mar 19 13:16:46 2012 (r233178) @@ -103,6 +103,7 @@ GEOM_PART_BSD opt_geom.h GEOM_PART_EBR opt_geom.h GEOM_PART_EBR_COMPAT opt_geom.h GEOM_PART_GPT opt_geom.h +GEOM_PART_LDM opt_geom.h GEOM_PART_MBR opt_geom.h GEOM_PART_PC98 opt_geom.h GEOM_PART_VTOC8 opt_geom.h From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 13:17:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC77A106564A; Mon, 19 Mar 2012 13:17:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDEBF8FC0A; Mon, 19 Mar 2012 13:17:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JDHlRN070116; Mon, 19 Mar 2012 13:17:47 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JDHlrX070114; Mon, 19 Mar 2012 13:17:47 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201203191317.q2JDHlrX070114@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 19 Mar 2012 13:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233179 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 13:17:48 -0000 Author: ae Date: Mon Mar 19 13:17:47 2012 New Revision: 233179 URL: http://svn.freebsd.org/changeset/base/233179 Log: Document GEOM_PART_LDM scheme and partition types. MFC after: 1 month Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Mon Mar 19 13:16:46 2012 (r233178) +++ head/sbin/geom/class/part/gpart.8 Mon Mar 19 13:17:47 2012 (r233179) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2012 +.Dd March 19, 2012 .Dt GPART 8 .Os .Sh NAME @@ -38,6 +38,7 @@ lines in the kernel configuration file: .Cd "options GEOM_PART_APM" .Cd "options GEOM_PART_BSD" .Cd "options GEOM_PART_GPT" +.Cd "options GEOM_PART_LDM" .Cd "options GEOM_PART_MBR" .Cd "options GEOM_PART_EBR" .Cd "options GEOM_PART_EBR_COMPAT" @@ -511,6 +512,12 @@ called Requires the .Cm GEOM_PART_BSD kernel option. +.It Cm LDM +The Logical Disk Manager is an implementation of volume manager for +Microsoft Windows NT. +Requires the +.Cd GEOM_PART_LDM +kernel option. .It Cm GPT GUID Partition Table is used on Intel-based Macintosh computers and gradually replacing MBR on most PCs and other systems. @@ -559,7 +566,7 @@ The utility also allows the user to specify scheme-specific partition types for partition types that do not have symbolic names. Symbolic names currently understood are: -.Bl -tag -width ".Cm freebsd-vinum" +.Bl -tag -width ".Cm ms-ldm-metadata" .It Cm bios-boot The system partition dedicated to second stage of the boot loader program. Usually it is used by the GRUB 2 loader for GPT partitioning schemes. @@ -634,6 +641,18 @@ A partition that is sub-partitioned by a This type is known as .Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. +.It Cm ms-ldm-data +A partition that contains Logical Disk Manager (LDM) volumes. +The scheme-specific types are +.Qq Li "!66" +for MBR, +.Qq Li "!af9b60a0-1431-4f62-bc68-3311714a69ad" +for GPT. +.It Cm ms-ldm-metadata +A partition that contains Logical Disk Manager (LDM) database. +The scheme-specifig type is +.Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3" +for GPT. .El .Sh ATTRIBUTES The scheme-specific attributes for EBR: @@ -938,6 +957,23 @@ disk metadata. If some inconsistency is detected, the partition table will be rejected with a diagnostic message: .Sy "GEOM_PART: Integrity check failed (provider, scheme)" . +.It Va kern.geom.part.ldm.debug : No 0 +Debug level of the Logical Disk Manager (LDM) module. +This can be set to a number between 0 and 2 inclusive. +If set to 0 minimal debug information is printed, +and if set to 2 the maximum amount of debug information is printed. +.It Va kern.geom.part.ldm.show_mirrors : No 0 +This variable controls how the Logical Disk Manager (LDM) module handles +mirrored volumes. +By default mirrored volumes are shown as partitions with type +.Cm ms-ldm-data +(see the +.Sx "PARTITION TYPES" +section). +If this variable set to 1 each component of the mirrored volume will be +present as independet partition. +.Em NOTE : +This may break a mirrored volume and lead to data damage. .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 13:19:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F194D1065673; Mon, 19 Mar 2012 13:19:02 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC0958FC1E; Mon, 19 Mar 2012 13:19:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JDJ2av070198; Mon, 19 Mar 2012 13:19:02 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JDJ22p070195; Mon, 19 Mar 2012 13:19:02 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201203191319.q2JDJ22p070195@svn.freebsd.org> From: Ken Smith Date: Mon, 19 Mar 2012 13:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233180 - stable/8/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 13:19:03 -0000 Author: kensmith Date: Mon Mar 19 13:19:02 2012 New Revision: 233180 URL: http://svn.freebsd.org/changeset/base/233180 Log: Bump the version of perl used as part of the release build from 5.10 to 5.12. Modified: stable/8/release/Makefile stable/8/release/Makefile.inc.docports Modified: stable/8/release/Makefile ============================================================================== --- stable/8/release/Makefile Mon Mar 19 13:17:47 2012 (r233179) +++ stable/8/release/Makefile Mon Mar 19 13:19:02 2012 (r233180) @@ -171,7 +171,7 @@ NOPORTSATALL= YES # # Doing 'make index' in /usr/ports requires Perl. -MAKEINDEXPORTS= lang/perl5.10 +MAKEINDEXPORTS= lang/perl5.12 DOCPORTS= textproc/docproj # Set this to wherever the distfiles required by release procedures. .if defined(DOCDISTFILES) Modified: stable/8/release/Makefile.inc.docports ============================================================================== --- stable/8/release/Makefile.inc.docports Mon Mar 19 13:17:47 2012 (r233179) +++ stable/8/release/Makefile.inc.docports Mon Mar 19 13:19:02 2012 (r233180) @@ -81,5 +81,5 @@ MINIMALDOCPORTS+= \ ports/textproc/p5-PodParser .else MINIMALDOCPORTS+= \ - ports/lang/perl5.10 + ports/lang/perl5.12 .endif From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 13:21:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57FFB106567D; Mon, 19 Mar 2012 13:21:11 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 435698FC08; Mon, 19 Mar 2012 13:21:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JDLBFr070306; Mon, 19 Mar 2012 13:21:11 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JDLBdL070304; Mon, 19 Mar 2012 13:21:11 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201203191321.q2JDLBdL070304@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 19 Mar 2012 13:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233181 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 13:21:11 -0000 Author: ae Date: Mon Mar 19 13:21:10 2012 New Revision: 233181 URL: http://svn.freebsd.org/changeset/base/233181 Log: Add CTLFLAG_TUN to sysctls. MFC after: 1 month Modified: head/sys/geom/part/g_part_ldm.c Modified: head/sys/geom/part/g_part_ldm.c ============================================================================== --- head/sys/geom/part/g_part_ldm.c Mon Mar 19 13:19:02 2012 (r233180) +++ head/sys/geom/part/g_part_ldm.c Mon Mar 19 13:21:10 2012 (r233181) @@ -56,8 +56,8 @@ static SYSCTL_NODE(_kern_geom_part, OID_ static u_int ldm_debug = 0; TUNABLE_INT("kern.geom.part.ldm.debug", &ldm_debug); -SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, debug, CTLFLAG_RW, - &ldm_debug, 0, "Debug level"); +SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, debug, + CTLFLAG_RW | CTLFLAG_TUN, &ldm_debug, 0, "Debug level"); /* * This allows access to mirrored LDM volumes. Since we do not @@ -65,8 +65,8 @@ SYSCTL_UINT(_kern_geom_part_ldm, OID_AUT */ static u_int show_mirrors = 0; TUNABLE_INT("kern.geom.part.ldm.show_mirrors", &show_mirrors); -SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, show_mirrors, CTLFLAG_RW, - &show_mirrors, 0, "Show mirrored volumes"); +SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, show_mirrors, + CTLFLAG_RW | CTLFLAG_TUN, &show_mirrors, 0, "Show mirrored volumes"); #define LDM_DEBUG(lvl, fmt, ...) do { \ if (ldm_debug >= (lvl)) { \ From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 13:23:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF4A61065670; Mon, 19 Mar 2012 13:23:20 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 3048A8FC16; Mon, 19 Mar 2012 13:23:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id q2JDNIDC059743; Mon, 19 Mar 2012 17:23:18 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Mon, 19 Mar 2012 17:23:18 +0400 (MSK) From: Dmitry Morozovsky To: Gleb Smirnoff In-Reply-To: <201203190930.q2J9UeO5060866@svn.freebsd.org> Message-ID: References: <201203190930.q2J9UeO5060866@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (woozle.rinet.ru [0.0.0.0]); Mon, 19 Mar 2012 17:23:18 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233167 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 13:23:20 -0000 On Mon, 19 Mar 2012, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Mar 19 09:30:40 2012 > New Revision: 233167 > URL: http://svn.freebsd.org/changeset/base/233167 > > Log: > Rotate auth.log and messages at the beginning of a year. Otherwise, > daily security checks 800.loginfail and 900.tcpwrap may produce > false positive alerts. [snip] > -/var/log/auth.log 600 7 100 * JC > +/var/log/auth.log 600 7 100 @0101T JC Did I miss newsyslog behaviour change? IIRC size limit is totally ignored if timed rotation is selected, and some time ago I even proposed to change this, but it was rejected, as "one can use two lines, one with size limit, and other with timed rotation" -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 13:27:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56F9E106566B; Mon, 19 Mar 2012 13:27:43 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id C9A638FC08; Mon, 19 Mar 2012 13:27:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id q2JDRfl9059840; Mon, 19 Mar 2012 17:27:41 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Mon, 19 Mar 2012 17:27:41 +0400 (MSK) From: Dmitry Morozovsky To: Gleb Smirnoff In-Reply-To: Message-ID: References: <201203190930.q2J9UeO5060866@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (woozle.rinet.ru [0.0.0.0]); Mon, 19 Mar 2012 17:27:41 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233167 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 13:27:43 -0000 On Mon, 19 Mar 2012, Dmitry Morozovsky wrote: > > Log: > > Rotate auth.log and messages at the beginning of a year. Otherwise, > > daily security checks 800.loginfail and 900.tcpwrap may produce > > false positive alerts. > > [snip] > > > -/var/log/auth.log 600 7 100 * JC > > +/var/log/auth.log 600 7 100 @0101T JC > > Did I miss newsyslog behaviour change? > > IIRC size limit is totally ignored if timed rotation is selected, and some time > ago I even proposed to change this, but it was rejected, as "one can use two > lines, one with size limit, and other with timed rotation" http://lists.freebsd.org/pipermail/freebsd-current/2009-May/thread.html#6690 -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 13:48:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FAE6106564A; Mon, 19 Mar 2012 13:48:06 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B41F8FC0A; Mon, 19 Mar 2012 13:48:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JDm6qF071143; Mon, 19 Mar 2012 13:48:06 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JDm6sd071140; Mon, 19 Mar 2012 13:48:06 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201203191348.q2JDm6sd071140@svn.freebsd.org> From: Ken Smith Date: Mon, 19 Mar 2012 13:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233182 - releng/8.3/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 13:48:06 -0000 Author: kensmith Date: Mon Mar 19 13:48:05 2012 New Revision: 233182 URL: http://svn.freebsd.org/changeset/base/233182 Log: MFS (files not present in head) r233180: > Bump the version of perl used as part of the release build from 5.10 > to 5.12. Insta-MFS done so we can start 8.3-RC2 builds. Approved by: re (implicit) Modified: releng/8.3/release/Makefile releng/8.3/release/Makefile.inc.docports Directory Properties: releng/8.3/release/ (props changed) Modified: releng/8.3/release/Makefile ============================================================================== --- releng/8.3/release/Makefile Mon Mar 19 13:21:10 2012 (r233181) +++ releng/8.3/release/Makefile Mon Mar 19 13:48:05 2012 (r233182) @@ -171,7 +171,7 @@ NOPORTSATALL= YES # # Doing 'make index' in /usr/ports requires Perl. -MAKEINDEXPORTS= lang/perl5.10 +MAKEINDEXPORTS= lang/perl5.12 DOCPORTS= textproc/docproj # Set this to wherever the distfiles required by release procedures. .if defined(DOCDISTFILES) Modified: releng/8.3/release/Makefile.inc.docports ============================================================================== --- releng/8.3/release/Makefile.inc.docports Mon Mar 19 13:21:10 2012 (r233181) +++ releng/8.3/release/Makefile.inc.docports Mon Mar 19 13:48:05 2012 (r233182) @@ -81,5 +81,5 @@ MINIMALDOCPORTS+= \ ports/textproc/p5-PodParser .else MINIMALDOCPORTS+= \ - ports/lang/perl5.10 + ports/lang/perl5.12 .endif From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 13:51:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A3DE106564A; Mon, 19 Mar 2012 13:51:39 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 354038FC18; Mon, 19 Mar 2012 13:51:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JDpdYT071280; Mon, 19 Mar 2012 13:51:39 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JDpdW2071278; Mon, 19 Mar 2012 13:51:39 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201203191351.q2JDpdW2071278@svn.freebsd.org> From: Ken Smith Date: Mon, 19 Mar 2012 13:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233183 - releng/8.3/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 13:51:39 -0000 Author: kensmith Date: Mon Mar 19 13:51:38 2012 New Revision: 233183 URL: http://svn.freebsd.org/changeset/base/233183 Log: Ready for 8.3-RC2 builds. Approved by: re (implicit) Modified: releng/8.3/sys/conf/newvers.sh Modified: releng/8.3/sys/conf/newvers.sh ============================================================================== --- releng/8.3/sys/conf/newvers.sh Mon Mar 19 13:48:05 2012 (r233182) +++ releng/8.3/sys/conf/newvers.sh Mon Mar 19 13:51:38 2012 (r233183) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.3" -BRANCH="RC1" +BRANCH="RC2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 13:54:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4DCE6106566C; Mon, 19 Mar 2012 13:54:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39D688FC1B; Mon, 19 Mar 2012 13:54:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JDsGIY071390; Mon, 19 Mar 2012 13:54:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JDsGOM071388; Mon, 19 Mar 2012 13:54:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203191354.q2JDsGOM071388@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 Mar 2012 13:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233184 - head/sys/dev/wtap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 13:54:16 -0000 Author: adrian Date: Mon Mar 19 13:54:15 2012 New Revision: 233184 URL: http://svn.freebsd.org/changeset/base/233184 Log: Remove this - it's not needed as it's defined in ieee80211_freebsd.h. Modified: head/sys/dev/wtap/if_wtap.c Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Mon Mar 19 13:51:38 2012 (r233183) +++ head/sys/dev/wtap/if_wtap.c Mon Mar 19 13:54:15 2012 (r233184) @@ -305,9 +305,6 @@ wtap_bmiss(struct ieee80211vap *vap) avp->av_bmiss(vap); } -/* XXX */ -#define msecs_to_ticks(ms) (((ms) * hz) / 1000) - static struct ieee80211vap * wtap_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, enum ieee80211_opmode opmode, int flags, @@ -349,7 +346,6 @@ wtap_vap_create(struct ieee80211com *ic, vap->iv_bss->ni_txrate = 130; return vap; } -#undef msecs_to_ticks static void wtap_vap_delete(struct ieee80211vap *vap) From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 15:25:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D66661065679; Mon, 19 Mar 2012 15:25:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A7BEA8FC1B; Mon, 19 Mar 2012 15:25:42 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 5B7BA46B17; Mon, 19 Mar 2012 11:25:42 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C49E3B93E; Mon, 19 Mar 2012 11:25:41 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Date: Mon, 19 Mar 2012 08:28:35 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203190934.q2J9YMEo061016@svn.freebsd.org> In-Reply-To: <201203190934.q2J9YMEo061016@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203190828.35561.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 19 Mar 2012 11:25:41 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233168 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 15:25:42 -0000 On Monday, March 19, 2012 5:34:22 am Konstantin Belousov wrote: > Author: kib > Date: Mon Mar 19 09:34:22 2012 > New Revision: 233168 > URL: http://svn.freebsd.org/changeset/base/233168 > > Log: > If we ever allow for managed fictitious pages, the pages shall be > excluded from superpage promotions. At least one of the reason is > that pv_table is sized for non-fictitious pages only. > > Consistently check for the page to be non-fictitious before accesing > superpage pv list. > > Sponsored by: The FreeBSD Foundation > Reviewed by: alc > MFC after: 2 weeks Hmm, I think you accidentally reverted 223122? > Modified: head/sys/amd64/amd64/pmap.c > ============================================================================== > --- head/sys/amd64/amd64/pmap.c Mon Mar 19 09:30:40 2012 (r233167) > +++ head/sys/amd64/amd64/pmap.c Mon Mar 19 09:34:22 2012 (r233168) > @@ -2939,7 +2942,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv > pdp_entry_t *pdpe; > pd_entry_t ptpaddr, *pde; > pt_entry_t *pte; > - boolean_t anychanged, pv_lists_locked; > + int anychanged; > + boolean_t pv_lists_locked; > > if ((prot & VM_PROT_READ) == VM_PROT_NONE) { > pmap_remove(pmap, sva, eva); > @@ -2952,7 +2956,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv > > pv_lists_locked = FALSE; > resume: > - anychanged = FALSE; > + anychanged = 0; > > PMAP_LOCK(pmap); > for (; sva < eva; sva = va_next) { > @@ -3000,7 +3004,7 @@ resume: > * invalidated by pmap_protect_pde(). > */ > if (pmap_protect_pde(pmap, pde, sva, prot)) > - anychanged = TRUE; > + anychanged = 1; > continue; > } else { > if (!pv_lists_locked) { > @@ -3054,7 +3058,7 @@ retry: > if (obits & PG_G) > pmap_invalidate_page(pmap, sva); > else > - anychanged = TRUE; > + anychanged = 1; > } > } > } -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 15:25:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32ECC106564A; Mon, 19 Mar 2012 15:25:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 06E408FC14; Mon, 19 Mar 2012 15:25:44 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id B592F46B39; Mon, 19 Mar 2012 11:25:43 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 028EDB960; Mon, 19 Mar 2012 11:25:43 -0400 (EDT) From: John Baldwin To: David Xu Date: Mon, 19 Mar 2012 08:33:07 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203180022.q2I0MThr093557@svn.freebsd.org> In-Reply-To: <201203180022.q2I0MThr093557@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203190833.08153.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 19 Mar 2012 11:25:43 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233103 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 15:25:44 -0000 On Saturday, March 17, 2012 8:22:29 pm David Xu wrote: > Author: davidxu > Date: Sun Mar 18 00:22:29 2012 > New Revision: 233103 > URL: http://svn.freebsd.org/changeset/base/233103 > > Log: > Some software think a mutex can be destroyed after it owned it, for > example, it uses a serialization point like following: > pthread_mutex_lock(&mutex); > pthread_mutex_unlock(&mutex); > pthread_mutex_destroy(&muetx); > They think a previous lock holder should have already left the mutex and > is no longer referencing it, so they destroy it. To be maximum compatible > with such code, we use IA64 version to unlock the mutex in kernel, remove > the two steps unlocking code. But this means they destroy the lock while another thread holds it? That seems wrong. It's one thing if they know that no other thread has a reference to the lock (e.g. it's in a refcounted object and the current thread just dropped the reference count to zero). However, in that case no other thread can unlock it after this thread destroys it. Code that does this seems very buggy, since if the address can be unmapped it can also be remapped and assigned to another lock, etc., so you could have a thread try to unlock a lock it doesn't hold. Also, being able to safely inline the common case for pthread locks is a very useful optimization and one we should pursue IMO. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 15:25:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5ACEC1065674; Mon, 19 Mar 2012 15:25:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2DD718FC08; Mon, 19 Mar 2012 15:25:45 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id D887C46B3B; Mon, 19 Mar 2012 11:25:44 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3DFF1B924; Mon, 19 Mar 2012 11:25:44 -0400 (EDT) From: John Baldwin To: Eitan Adler Date: Mon, 19 Mar 2012 08:35:27 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203190041.q2J0femX042684@svn.freebsd.org> In-Reply-To: <201203190041.q2J0femX042684@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203190835.27561.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 19 Mar 2012 11:25:44 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233136 - in head/secure: usr.bin/ssh usr.sbin/sshd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 15:25:45 -0000 On Sunday, March 18, 2012 8:41:40 pm Eitan Adler wrote: > Author: eadler > Date: Mon Mar 19 00:41:40 2012 > New Revision: 233136 > URL: http://svn.freebsd.org/changeset/base/233136 > > Log: > X11BASE is not used any more and has been killed by the x11 team. > > Reviewed by: ??? > Approved by: ??? > MFC after: 3 days > > Modified: > head/secure/usr.bin/ssh/Makefile > head/secure/usr.sbin/sshd/Makefile This looks wrong. While X11BASE is certainly dead, LOCALBASE is not, so the existing code should have been changed, but not removed. Something like this: .if defined(LOCALBASE) CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" .endif -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 15:28:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7E32106567A for ; Mon, 19 Mar 2012 15:28:48 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta03.emeryville.ca.mail.comcast.net (qmta03.emeryville.ca.mail.comcast.net [76.96.30.32]) by mx1.freebsd.org (Postfix) with ESMTP id 89CD68FC26 for ; Mon, 19 Mar 2012 15:28:48 +0000 (UTC) Received: from omta15.emeryville.ca.mail.comcast.net ([76.96.30.71]) by qmta03.emeryville.ca.mail.comcast.net with comcast id nTBA1i0041Y3wxoA3TUi10; Mon, 19 Mar 2012 15:28:42 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta15.emeryville.ca.mail.comcast.net with comcast id nTUg1i00u4NgCEG8bTUhAj; Mon, 19 Mar 2012 15:28:42 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q2JFSdTq029470; Mon, 19 Mar 2012 09:28:39 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Gleb Smirnoff In-Reply-To: <201203190930.q2J9UeO5060866@svn.freebsd.org> References: <201203190930.q2J9UeO5060866@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 19 Mar 2012 09:28:39 -0600 Message-ID: <1332170919.8403.35.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233167 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 15:28:48 -0000 On Mon, 2012-03-19 at 09:30 +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Mar 19 09:30:40 2012 > New Revision: 233167 > URL: http://svn.freebsd.org/changeset/base/233167 > > Log: > Rotate auth.log and messages at the beginning of a year. Otherwise, > daily security checks 800.loginfail and 900.tcpwrap may produce > false positive alerts. > > Modified: > head/etc/newsyslog.conf > > Modified: head/etc/newsyslog.conf > ============================================================================== > --- head/etc/newsyslog.conf Mon Mar 19 08:10:23 2012 (r233166) > +++ head/etc/newsyslog.conf Mon Mar 19 09:30:40 2012 (r233167) > @@ -19,7 +19,7 @@ > # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] > /var/log/all.log 600 7 * @T00 J > /var/log/amd.log 644 7 100 * J > -/var/log/auth.log 600 7 100 * JC > +/var/log/auth.log 600 7 100 @0101T JC > /var/log/console.log 600 5 100 * J > /var/log/cron 600 3 100 * JC > /var/log/daily.log 640 7 * @T00 JN > @@ -28,7 +28,7 @@ > /var/log/kerberos.log 600 7 100 * J > /var/log/lpd-errs 644 7 100 * JC > /var/log/maillog 640 7 * @T00 JC > -/var/log/messages 644 5 100 * JC > +/var/log/messages 644 5 100 @0101T JC > /var/log/monthly.log 640 12 * $M1D0 JN > /var/log/pflog 600 3 100 * JB /var/run/pflogd.pid > /var/log/ppp.log root:network 640 3 100 * JC This change may not behave exactly as you expect unless the patch in PR kern/160432 or something equivelent is commited. (It should have been bin/ not kern/, my bad.) http://www.freebsd.org/cgi/query-pr.cgi?pr=160432 To summarize, if both 'size' and 'when' are specified, the size is ignored and only the time is used. The patch in that PR fixes it. We've been running our embedded products with the patch for years because rotating based on size is important when /var/log is a ramdisk. -- Ian From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 15:41:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EBA3D106566C; Mon, 19 Mar 2012 15:41:57 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B86738FC15; Mon, 19 Mar 2012 15:41:57 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q2JFfsni096911; Mon, 19 Mar 2012 15:41:55 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F6753C1.4060800@gmail.com> Date: Mon, 19 Mar 2012 23:41:53 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: John Baldwin References: <201203180022.q2I0MThr093557@svn.freebsd.org> <201203190833.08153.jhb@freebsd.org> In-Reply-To: <201203190833.08153.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu Subject: Re: svn commit: r233103 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 15:41:58 -0000 On 2012/3/19 20:33, John Baldwin wrote: > On Saturday, March 17, 2012 8:22:29 pm David Xu wrote: >> Author: davidxu >> Date: Sun Mar 18 00:22:29 2012 >> New Revision: 233103 >> URL: http://svn.freebsd.org/changeset/base/233103 >> >> Log: >> Some software think a mutex can be destroyed after it owned it, for >> example, it uses a serialization point like following: >> pthread_mutex_lock(&mutex); >> pthread_mutex_unlock(&mutex); >> pthread_mutex_destroy(&muetx); >> They think a previous lock holder should have already left the mutex and >> is no longer referencing it, so they destroy it. To be maximum compatible >> with such code, we use IA64 version to unlock the mutex in kernel, remove >> the two steps unlocking code. > But this means they destroy the lock while another thread holds it? That > seems wrong. It's one thing if they know that no other thread has a reference > to the lock (e.g. it's in a refcounted object and the current thread just > dropped the reference count to zero). However, in that case no other thread > can unlock it after this thread destroys it. Code that does this seems very > buggy, since if the address can be unmapped it can also be remapped and > assigned to another lock, etc., so you could have a thread try to unlock a > lock it doesn't hold. They have handshake code to indicate that the mutex is no longer used by previous holder. e.g: thread 1: pthread_mutex_lock(&mutex); done = 1; pthread_mutex_unlock(&mutex); thread 2: pthread_mutex_lock(&mutex); temp = done; pthread_mutex_unlock(&mutex); if (temp == 1) pthread_mutex_destroy(&mutex); I guess one crash of Python is also caused by the logic, though they use semaphore instead of mutex + condition variable to mimic lock. POSIX even explicitly requires a condition variable to be destroyable after broadcast, once you have correct teardown code. Please read its example section: http://pubs.opengroup.org/onlinepubs/007904975/functions/pthread_cond_destroy.html > Also, being able to safely inline the common case for pthread locks is a very > useful optimization and one we should pursue IMO. > Yes. From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 15:42:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C66B61065674 for ; Mon, 19 Mar 2012 15:42:11 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3DDFC8FC12 for ; Mon, 19 Mar 2012 15:42:10 +0000 (UTC) Received: by wern13 with SMTP id n13so7866881wer.13 for ; Mon, 19 Mar 2012 08:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=0vE/Phl6K0dlWa60orJhCXmigQDHsGfetH5poGv/t5I=; b=BL4wQnmPxMynfecxLmy7f4ghZFSnuaGNapykU5jF26AwnyNHbYIznLbTiw7ZDRnXLS 1Frwwmj1Vu0PmA+AQ4G8ETh3ftBLCT1ai1mpoyumOhftO/YTTFOm+yBijbG/qbb5vjOL PnxuS3nkyHaSY4GzUJCSM9p0vyAnJb4jXI46A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=0vE/Phl6K0dlWa60orJhCXmigQDHsGfetH5poGv/t5I=; b=WKKjQ2pBu9Q2T4mDhxbWTXnQwkdfMYB44T0ECuIiWVigcAK/gDXAWemYz8y6GPeJvf 1kZFWL8LQY2z5AbMj/SFGe3hrg+irLSPGRyP3F6NOmGgdK6N/1J9kcnZnmZ01SUsr1dd sVAGilgOx3FncpOEEAGbKfnvtApfyYu7+dJv6PvktzCQ0X7ZR+1riQclKMoGEKwofdZ9 ePdILFaNM4fXiFvy/YMJF6vAsuRnmMHMW4BkgdmJWdqaJIDfzGZPVE/66F07aEbpVLTe LyAmN2/UGEA/NK9ZLW5CDrLsAu88+l6+lcmTQanQ3kRnU51ZSHm5pl8002GeIM9YSQFQ glmQ== Received: by 10.180.84.164 with SMTP id a4mr20948307wiz.2.1332171724331; Mon, 19 Mar 2012 08:42:04 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.63.4 with HTTP; Mon, 19 Mar 2012 08:41:34 -0700 (PDT) In-Reply-To: <201203190835.27561.jhb@freebsd.org> References: <201203190041.q2J0femX042684@svn.freebsd.org> <201203190835.27561.jhb@freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 11:41:34 -0400 X-Google-Sender-Auth: pH5wJRfBt4nO1qhLN_8reYiq9Eg Message-ID: To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlGmMX37SL1WwvX5w7QsA+INB95P1Mttb+eS6C8QyPxQb4Q06U48IiDYlygYRmTvjFtd+56 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233136 - in head/secure: usr.bin/ssh usr.sbin/sshd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 15:42:11 -0000 On Mon, Mar 19, 2012 at 8:35 AM, John Baldwin wrote: > On Sunday, March 18, 2012 8:41:40 pm Eitan Adler wrote: >> Author: eadler >> Date: Mon Mar 19 00:41:40 2012 >> New Revision: 233136 >> URL: http://svn.freebsd.org/changeset/base/233136 >> >> Log: >> =C2=A0 X11BASE is not used any more and has been killed by the x11 team. >> >> =C2=A0 Reviewed by: =C2=A0 =C2=A0 =C2=A0 =C2=A0??? >> =C2=A0 Approved by: =C2=A0 =C2=A0 =C2=A0 =C2=A0??? >> =C2=A0 MFC after: =C2=A03 days >> >> Modified: >> =C2=A0 head/secure/usr.bin/ssh/Makefile >> =C2=A0 head/secure/usr.sbin/sshd/Makefile > > This looks wrong. =C2=A0While X11BASE is certainly dead, LOCALBASE is not= , so the > existing code should have been changed, but not removed. =C2=A0Something = like this: > > .if defined(LOCALBASE) > CFLAGS+=3D -DXAUTH_PATH=3D\"${LOCALBASE}/bin/xauth\" > .endif I think I missed "X11BASE?=3D${LOCALBASE}" in the original code making me believe this change was a no-op. I'll have a patch to fix this soon. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 15:50:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B47E41065670; Mon, 19 Mar 2012 15:50:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FD098FC12; Mon, 19 Mar 2012 15:50:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JFoFgV075229; Mon, 19 Mar 2012 15:50:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JFoFbU075227; Mon, 19 Mar 2012 15:50:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203191550.q2JFoFbU075227@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 19 Mar 2012 15:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233185 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 15:50:15 -0000 Author: kib Date: Mon Mar 19 15:50:14 2012 New Revision: 233185 URL: http://svn.freebsd.org/changeset/base/233185 Log: Re-apply r233122 erronously reverted in r233168. Submitted by: jhb Pointy hat to: kib MFC after: 2 weeks Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Mar 19 13:54:15 2012 (r233184) +++ head/sys/amd64/amd64/pmap.c Mon Mar 19 15:50:14 2012 (r233185) @@ -2942,8 +2942,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pdp_entry_t *pdpe; pd_entry_t ptpaddr, *pde; pt_entry_t *pte; - int anychanged; - boolean_t pv_lists_locked; + boolean_t anychanged, pv_lists_locked; if ((prot & VM_PROT_READ) == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); @@ -2956,7 +2955,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pv_lists_locked = FALSE; resume: - anychanged = 0; + anychanged = FALSE; PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { @@ -3004,7 +3003,7 @@ resume: * invalidated by pmap_protect_pde(). */ if (pmap_protect_pde(pmap, pde, sva, prot)) - anychanged = 1; + anychanged = TRUE; continue; } else { if (!pv_lists_locked) { @@ -3058,7 +3057,7 @@ retry: if (obits & PG_G) pmap_invalidate_page(pmap, sva); else - anychanged = 1; + anychanged = TRUE; } } } From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 15:51:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6E5D1065673; Mon, 19 Mar 2012 15:51:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 4D4B88FC12; Mon, 19 Mar 2012 15:51:04 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q2JFonfx043311; Mon, 19 Mar 2012 17:50:49 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q2JFonLp027330; Mon, 19 Mar 2012 17:50:49 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q2JFonnR027329; Mon, 19 Mar 2012 17:50:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 19 Mar 2012 17:50:49 +0200 From: Konstantin Belousov To: John Baldwin Message-ID: <20120319155049.GA2358@deviant.kiev.zoral.com.ua> References: <201203190934.q2J9YMEo061016@svn.freebsd.org> <201203190828.35561.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline In-Reply-To: <201203190828.35561.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233168 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 15:51:05 -0000 --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 19, 2012 at 08:28:35AM -0400, John Baldwin wrote: > On Monday, March 19, 2012 5:34:22 am Konstantin Belousov wrote: > > Author: kib > > Date: Mon Mar 19 09:34:22 2012 > > New Revision: 233168 > > URL: http://svn.freebsd.org/changeset/base/233168 > >=20 > > Log: > > If we ever allow for managed fictitious pages, the pages shall be > > excluded from superpage promotions. At least one of the reason is > > that pv_table is sized for non-fictitious pages only. > > =20 > > Consistently check for the page to be non-fictitious before accesing > > superpage pv list. > > =20 > > Sponsored by: The FreeBSD Foundation > > Reviewed by: alc > > MFC after: 2 weeks >=20 > Hmm, I think you accidentally reverted 223122? Oops, yes, r233122 is reverted. I committed the fix, thank you for noting. Apparently I did not pulled the master branch on the machine were I did the commit, against which the topic branch was diffed :(. >=20 > > Modified: head/sys/amd64/amd64/pmap.c > >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/sys/amd64/amd64/pmap.c Mon Mar 19 09:30:40 2012 (r233167) > > +++ head/sys/amd64/amd64/pmap.c Mon Mar 19 09:34:22 2012 (r233168) > > @@ -2939,7 +2942,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv > > pdp_entry_t *pdpe; > > pd_entry_t ptpaddr, *pde; > > pt_entry_t *pte; > > - boolean_t anychanged, pv_lists_locked; > > + int anychanged; > > + boolean_t pv_lists_locked; > > =20 > > if ((prot & VM_PROT_READ) =3D=3D VM_PROT_NONE) { > > pmap_remove(pmap, sva, eva); > > @@ -2952,7 +2956,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv > > =20 > > pv_lists_locked =3D FALSE; > > resume: > > - anychanged =3D FALSE; > > + anychanged =3D 0; > > =20 > > PMAP_LOCK(pmap); > > for (; sva < eva; sva =3D va_next) { > > @@ -3000,7 +3004,7 @@ resume: > > * invalidated by pmap_protect_pde(). > > */ > > if (pmap_protect_pde(pmap, pde, sva, prot)) > > - anychanged =3D TRUE; > > + anychanged =3D 1; > > continue; > > } else { > > if (!pv_lists_locked) { > > @@ -3054,7 +3058,7 @@ retry: > > if (obits & PG_G) > > pmap_invalidate_page(pmap, sva); > > else > > - anychanged =3D TRUE; > > + anychanged =3D 1; > > } > > } > > } >=20 > --=20 > John Baldwin --M9NhX3UHpAaciwkO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk9nVdkACgkQC3+MBN1Mb4h66ACeN6QoqjnGL+iB0ZRcmyO9jsu1 Lp8AnAptAqOafhhzfC0P5d1Fcfc5ipgb =Dj/J -----END PGP SIGNATURE----- --M9NhX3UHpAaciwkO-- From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 15:55:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D435F1065679 for ; Mon, 19 Mar 2012 15:55:45 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 54A088FC17 for ; Mon, 19 Mar 2012 15:55:44 +0000 (UTC) Received: by wern13 with SMTP id n13so7886284wer.13 for ; Mon, 19 Mar 2012 08:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=kCVkR7GKZV6TaeyPBcj+uJK9Cp3AwfhPtKL0XbJqdeA=; b=aYiSXUVNVRRNdGYilv88zDhCKNral5V3PbwzljO82qa5r8E+HqLDR6Nk5lf1WnQpHR ZNj7oY2/Yk96ZIJQdOIxBHMA5po0NO/BNrwh2xGoixKZ/ndcoxIoT6EiQv2b7oHiLuK3 cjZ0Z+5/csY9YuN0Txr9moiJvlbDq4VBDpz8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=kCVkR7GKZV6TaeyPBcj+uJK9Cp3AwfhPtKL0XbJqdeA=; b=JgmDEmBmlE4pfM8XxhLjdgbkP5FtlRvpC3OdAUMY1ATHivY0YPKtoG2Nhq2Tgu9hHs dPN1dwjsi6u8MYUgIBQxWaUx37/UZOae5oQdZej0Aum7G7BAVIJFACLxNbQBY7Cp1s3N 582dlYH77mobPVwujovMCeHVwDAoTr1eq0dlujvBl5RptXTSKpewn3Tpnpqo9a5qOJwK roKzraDpukZXtMjQN8+tgwX2xCwJUICezikAk2Xutkgq50oxCcxApk+jO8PpPWi3ysFt nWOUvmUEBTNaZ0Yz1ZNGzi/2nBi8XlIQUPj0FtDqWeoWJDfGiO0RiHn4jmdzIESUKdc/ e8LA== Received: by 10.216.136.131 with SMTP id w3mr7564200wei.15.1332172544299; Mon, 19 Mar 2012 08:55:44 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.63.4 with HTTP; Mon, 19 Mar 2012 08:55:12 -0700 (PDT) In-Reply-To: References: <201203190041.q2J0femX042684@svn.freebsd.org> <201203190835.27561.jhb@freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 11:55:12 -0400 X-Google-Sender-Auth: Nzt1ao-iEJrYMdc1x6ENQEzpxm0 Message-ID: To: John Baldwin , Colin Percival Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQklnMOmNxMY6HpnZjrlrOs7Zm+3V63IiJrEWPfjhU4iS6PpHZoy5PbilYXq1kC+vLYU92GY Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233136 - in head/secure: usr.bin/ssh usr.sbin/sshd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 15:55:45 -0000 >> This looks wrong. =C2=A0While X11BASE is certainly dead, LOCALBASE is no= t, so the >> existing code should have been changed, but not removed. Does this look good? Build tested only. commit 271b766fdbd907be040767f2387b4d5fbb6425f7 Author: Eitan Adler Date: Mon Mar 19 11:52:31 2012 -0400 Restore the ability to use a non-standard LOCALBASE Submitted by: jhb Approved by: cperciva MFC after: 0 days (with r233136) diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile index 0120771..6426ff3 100644 --- a/secure/usr.sbin/sshd/Makefile +++ b/secure/usr.sbin/sshd/Makefile @@ -40,6 +40,9 @@ DPADD+=3D ${LIBGSSAPI_KRB5} ${LIBGSSAPI} ${LIBKRB5} ${LI= BASN1} LDADD+=3D -lgssapi_krb5 -lgssapi -lkrb5 -lasn1 .endif +LOCALBASE?=3D /usr/local +CFLAGS+=3D -DXAUTH_PATH=3D\"${LOCALBASE}/bin/xauth\" + DPADD+=3D ${LIBCRYPTO} ${LIBCRYPT} LDADD+=3D -lcrypto -lcrypt --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 15:55:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9578B106566B; Mon, 19 Mar 2012 15:55:48 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 64AB28FC1E; Mon, 19 Mar 2012 15:55:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q2JFtkYZ005965; Mon, 19 Mar 2012 15:55:46 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F675701.1020807@gmail.com> Date: Mon, 19 Mar 2012 23:55:45 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: davidxu@freebsd.org References: <201203180022.q2I0MThr093557@svn.freebsd.org> <201203190833.08153.jhb@freebsd.org> <4F6753C1.4060800@gmail.com> In-Reply-To: <4F6753C1.4060800@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r233103 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 15:55:48 -0000 On 2012/3/19 23:41, David Xu wrote: > On 2012/3/19 20:33, John Baldwin wrote: >> On Saturday, March 17, 2012 8:22:29 pm David Xu wrote: >>> Author: davidxu >>> Date: Sun Mar 18 00:22:29 2012 >>> New Revision: 233103 >>> URL: http://svn.freebsd.org/changeset/base/233103 >>> >>> Log: >>> Some software think a mutex can be destroyed after it owned it, for >>> example, it uses a serialization point like following: >>> pthread_mutex_lock(&mutex); >>> pthread_mutex_unlock(&mutex); >>> pthread_mutex_destroy(&muetx); >>> They think a previous lock holder should have already left the >>> mutex and >>> is no longer referencing it, so they destroy it. To be maximum >>> compatible >>> with such code, we use IA64 version to unlock the mutex in >>> kernel, remove >>> the two steps unlocking code. >> But this means they destroy the lock while another thread holds it? >> That >> seems wrong. It's one thing if they know that no other thread has a >> reference >> to the lock (e.g. it's in a refcounted object and the current thread >> just >> dropped the reference count to zero). However, in that case no other >> thread >> can unlock it after this thread destroys it. Code that does this >> seems very >> buggy, since if the address can be unmapped it can also be remapped and >> assigned to another lock, etc., so you could have a thread try to >> unlock a >> lock it doesn't hold. > > They have handshake code to indicate that the mutex is no longer used > by previous > holder. e.g: > > thread 1: > pthread_mutex_lock(&mutex); > done = 1; > pthread_mutex_unlock(&mutex); > thread 2: > pthread_mutex_lock(&mutex); > temp = done; > pthread_mutex_unlock(&mutex); > if (temp == 1) > pthread_mutex_destroy(&mutex); > > I guess one crash of Python is also caused by the logic, though they > use semaphore > instead of mutex + condition variable to mimic lock. > POSIX even explicitly requires a condition variable to be destroyable > after broadcast, > once you have correct teardown code. Please read its example section: > http://pubs.opengroup.org/onlinepubs/007904975/functions/pthread_cond_destroy.html > > > >> Also, being able to safely inline the common case for pthread locks >> is a very >> useful optimization and one we should pursue IMO. >> > Yes. Following topics are interesting: http://sourceware.org/bugzilla/show_bug.cgi?id=12674 http://sourceware.org/bugzilla/show_bug.cgi?id=13690 http://sourceware.org/bugzilla/show_bug.cgi?id=13065 http://sourceware.org/bugzilla/show_bug.cgi?id=12683 http://sourceware.org/bugzilla/show_bug.cgi?id=13165 http://sourceware.org/bugzilla/show_bug.cgi?id=13165 From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 16:13:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17D06106564A; Mon, 19 Mar 2012 16:13:15 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0326C8FC0A; Mon, 19 Mar 2012 16:13:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JGDEaA076011; Mon, 19 Mar 2012 16:13:14 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JGDErO076009; Mon, 19 Mar 2012 16:13:14 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203191613.q2JGDErO076009@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Mar 2012 16:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233186 - head/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 16:13:15 -0000 Author: jpaetzel Date: Mon Mar 19 16:13:14 2012 New Revision: 233186 URL: http://svn.freebsd.org/changeset/base/233186 Log: An intel RAID can have any arbitrary name. Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Mon Mar 19 15:50:14 2012 (r233185) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Mon Mar 19 16:13:14 2012 (r233186) @@ -63,10 +63,7 @@ if [ -d "/dev/raid" ] ; then cd /dev/raid for i in `ls` do - case ${i} in - r0|r1|r2|r3|r4|r5) SYSDISK="${SYSDISK} ${i}" ;; - *) ;; - esac + SYSDISK="${SYSDISK} ${i}" done fi From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 17:14:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35902106564A; Mon, 19 Mar 2012 17:14:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 211A68FC0C; Mon, 19 Mar 2012 17:14:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JHECYO078096; Mon, 19 Mar 2012 17:14:12 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JHECR1078093; Mon, 19 Mar 2012 17:14:12 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203191714.q2JHECR1078093@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Mar 2012 17:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233187 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 17:14:13 -0000 Author: jkim Date: Mon Mar 19 17:14:12 2012 New Revision: 233187 URL: http://svn.freebsd.org/changeset/base/233187 Log: Do not reuse the previous address when restoring linear frame buffer. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Mon Mar 19 16:13:14 2012 (r233186) +++ head/sys/dev/fb/vesa.c Mon Mar 19 17:14:12 2012 (r233187) @@ -1478,7 +1478,8 @@ vesa_save_state(video_adapter_t *adp, vo vesa_vmem_buf = malloc(bsize, M_DEVBUF, M_NOWAIT); if (vesa_vmem_buf != NULL) bcopy((void *)buf, vesa_vmem_buf, bsize); - } + } else + vesa_vmem_buf = NULL; ((adp_state_t *)p)->sig = V_STATE_SIG; bzero(((adp_state_t *)p)->regs, vesa_state_buf_size); return (vesa_bios_save_restore(STATE_SAVE, ((adp_state_t *)p)->regs)); @@ -1496,7 +1497,6 @@ vesa_load_state(video_adapter_t *adp, vo /* Try BIOS POST to restore a sane state. */ (void)vesa_bios_post(); - buf = adp->va_buffer; bsize = adp->va_buffer_size; mode = adp->va_mode; (void)vesa_set_mode(adp, adp->va_initial_mode); @@ -1505,8 +1505,10 @@ vesa_load_state(video_adapter_t *adp, vo if (((adp_state_t *)p)->sig != V_STATE_SIG) return ((*prevvidsw->load_state)(adp, p)); - if (buf != 0 && vesa_vmem_buf != NULL) { - bcopy(vesa_vmem_buf, (void *)buf, bsize); + if (vesa_vmem_buf != NULL) { + buf = adp->va_buffer; + if (buf != 0) + bcopy(vesa_vmem_buf, (void *)buf, bsize); free(vesa_vmem_buf, M_DEVBUF); } return (vesa_bios_save_restore(STATE_LOAD, ((adp_state_t *)p)->regs)); From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 18:03:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0294B106564A; Mon, 19 Mar 2012 18:03:21 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C84AB8FC16; Mon, 19 Mar 2012 18:03:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JI3KCa079765; Mon, 19 Mar 2012 18:03:20 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JI3Kfm079763; Mon, 19 Mar 2012 18:03:20 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201203191803.q2JI3Kfm079763@svn.freebsd.org> From: Andreas Tobler Date: Mon, 19 Mar 2012 18:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233188 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 18:03:21 -0000 Author: andreast Date: Mon Mar 19 18:03:20 2012 New Revision: 233188 URL: http://svn.freebsd.org/changeset/base/233188 Log: Provide a fix for certain PowerMacs where the U3 i2c lacks the interrupt info. Tested by: Robert Hish MFC after: 1 week Modified: head/sys/powerpc/powermac/uninorth.c Modified: head/sys/powerpc/powermac/uninorth.c ============================================================================== --- head/sys/powerpc/powermac/uninorth.c Mon Mar 19 17:14:12 2012 (r233187) +++ head/sys/powerpc/powermac/uninorth.c Mon Mar 19 18:03:20 2012 (r233188) @@ -262,9 +262,11 @@ unin_chip_attach(device_t dev) struct unin_chip_devinfo *dinfo; phandle_t root; phandle_t child; + phandle_t iparent; device_t cdev; char compat[32]; - u_int reg[3]; + char name[32]; + u_int irq, reg[3]; int error, i = 0; sc = device_get_softc(dev); @@ -315,6 +317,33 @@ unin_chip_attach(device_t dev) dinfo->udi_ninterrupts = 0; unin_chip_add_intr(child, dinfo); + /* + * Some Apple machines do have a bug in OF, they miss + * the interrupt entries on the U3 I2C node. That means they + * do not have an entry with number of interrupts nor the + * entry of the interrupt parent handle. + * We define an interrupt and hardwire it to the /u3/mpic + * handle. + */ + + if (OF_getprop(child, "name", name, sizeof(name)) <= 0) + device_printf(dev, "device has no name!\n"); + if (dinfo->udi_ninterrupts == 0 && + (strcmp(name, "i2c-bus") == 0 || + strcmp(name, "i2c") == 0)) { + if (OF_getprop(child, "interrupt-parent", &iparent, + sizeof(iparent)) <= 0) { + iparent = OF_finddevice("/u3/mpic"); + device_printf(dev, "Set /u3/mpic as iparent!\n"); + } + /* Add an interrupt number 0 to the parent. */ + irq = MAP_IRQ(iparent, 0); + resource_list_add(&dinfo->udi_resources, SYS_RES_IRQ, + dinfo->udi_ninterrupts, irq, irq, 1); + dinfo->udi_interrupts[dinfo->udi_ninterrupts] = irq; + dinfo->udi_ninterrupts++; + } + unin_chip_add_reg(child, dinfo); cdev = device_add_child(dev, NULL, -1); From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 18:34:36 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E265F1065670; Mon, 19 Mar 2012 18:34:36 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 8F3BA8FC18; Mon, 19 Mar 2012 18:34:36 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id A59B1BD4; Mon, 19 Mar 2012 19:34:34 +0100 (CET) Date: Mon, 19 Mar 2012 19:33:11 +0100 From: Pawel Jakub Dawidek To: davidxu@FreeBSD.org Message-ID: <20120319183311.GB1341@garage.freebsd.pl> References: <201202271338.q1RDcqEQ020033@svn.freebsd.org> <20120318185014.GK1340@garage.freebsd.pl> <4F668422.1000308@freebsd.org> <20120319073326.GO1340@garage.freebsd.pl> <4F66EB7A.7030107@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oLBj+sq0vYjzfsbl" Content-Disposition: inline In-Reply-To: <4F66EB7A.7030107@gmail.com> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Julian Elischer Subject: Re: svn commit: r232209 - in head: lib/libthr/thread sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 18:34:37 -0000 --oLBj+sq0vYjzfsbl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 19, 2012 at 04:16:58PM +0800, David Xu wrote: > Revision 233134 should have fixed the problem. >=20 > http://svn.freebsd.org/changeset/base/233134 Works now, thanks for the quick fix. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --oLBj+sq0vYjzfsbl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk9ne+YACgkQForvXbEpPzTTXwCeITcolgvMJVEaY/6aXtCSLjQ0 5ZQAoIHtrS0l+aYCqv0IVEueyBtFj6QU =a73J -----END PGP SIGNATURE----- --oLBj+sq0vYjzfsbl-- From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 18:43:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A4821065673; Mon, 19 Mar 2012 18:43:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 165508FC15; Mon, 19 Mar 2012 18:43:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JIhiLe081098; Mon, 19 Mar 2012 18:43:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JIhiW8081096; Mon, 19 Mar 2012 18:43:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203191843.q2JIhiW8081096@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Mar 2012 18:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233190 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 18:43:45 -0000 Author: jhb Date: Mon Mar 19 18:43:44 2012 New Revision: 233190 URL: http://svn.freebsd.org/changeset/base/233190 Log: Alter the previous commit to use vm_size_t instead of vm_pindex_t. vm_pindex_t is not a count of pages per se, it is more like vm_ooffset_t, but a page index instead of a byte offset. Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Mon Mar 19 18:41:43 2012 (r233189) +++ head/sys/vm/vm_phys.c Mon Mar 19 18:43:44 2012 (r233190) @@ -223,7 +223,7 @@ _vm_phys_create_seg(vm_paddr_t start, vm { struct vm_phys_seg *seg; #ifdef VM_PHYSSEG_SPARSE - vm_pindex_t pages; + vm_size_t pages; int segind; pages = 0; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 18:47:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42A8C106564A; Mon, 19 Mar 2012 18:47:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1DF8FC0C; Mon, 19 Mar 2012 18:47:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JIlZNc081337; Mon, 19 Mar 2012 18:47:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JIlYM9081333; Mon, 19 Mar 2012 18:47:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203191847.q2JIlYM9081333@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Mar 2012 18:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233191 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 18:47:35 -0000 Author: jhb Date: Mon Mar 19 18:47:34 2012 New Revision: 233191 URL: http://svn.freebsd.org/changeset/base/233191 Log: Fix madvise(MADV_WILLNEED) to properly handle individual mappings larger than 4GB. Specifically, the inlined version of 'ptoa' of the the 'int' count of pages overflowed on 64-bit platforms. While here, change vm_object_madvise() to accept two vm_pindex_t parameters (start and end) rather than a (start, count) tuple to match other VM APIs as suggested by alc@. Modified: head/sys/vm/vm_map.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Mar 19 18:43:44 2012 (r233190) +++ head/sys/vm/vm_map.c Mon Mar 19 18:47:34 2012 (r233191) @@ -2100,8 +2100,7 @@ vm_map_madvise( } vm_map_unlock(map); } else { - vm_pindex_t pindex; - int count; + vm_pindex_t pstart, pend; /* * madvise behaviors that are implemented in the underlying @@ -2119,30 +2118,29 @@ vm_map_madvise( if (current->eflags & MAP_ENTRY_IS_SUB_MAP) continue; - pindex = OFF_TO_IDX(current->offset); - count = atop(current->end - current->start); + pstart = OFF_TO_IDX(current->offset); + pend = pstart + atop(current->end - current->start); useStart = current->start; if (current->start < start) { - pindex += atop(start - current->start); - count -= atop(start - current->start); + pstart += atop(start - current->start); useStart = start; } if (current->end > end) - count -= atop(current->end - end); + pend -= atop(current->end - end); - if (count <= 0) + if (pstart >= pend) continue; - vm_object_madvise(current->object.vm_object, - pindex, count, behav); + vm_object_madvise(current->object.vm_object, pstart, + pend, behav); if (behav == MADV_WILLNEED) { vm_map_pmap_enter(map, useStart, current->protection, current->object.vm_object, - pindex, - (count << PAGE_SHIFT), + pstart, + ptoa(pend - pstart), MAP_PREFAULT_MADVISE ); } Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Mar 19 18:43:44 2012 (r233190) +++ head/sys/vm/vm_object.c Mon Mar 19 18:47:34 2012 (r233191) @@ -1065,16 +1065,16 @@ vm_object_sync(vm_object_t object, vm_oo * without I/O. */ void -vm_object_madvise(vm_object_t object, vm_pindex_t pindex, int count, int advise) +vm_object_madvise(vm_object_t object, vm_pindex_t pindex, vm_pindex_t end, + int advise) { - vm_pindex_t end, tpindex; + vm_pindex_t tpindex; vm_object_t backing_object, tobject; vm_page_t m; if (object == NULL) return; VM_OBJECT_LOCK(object); - end = pindex + count; /* * Locate and adjust resident pages */ Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Mon Mar 19 18:43:44 2012 (r233190) +++ head/sys/vm/vm_object.h Mon Mar 19 18:47:34 2012 (r233191) @@ -225,6 +225,7 @@ void vm_object_destroy (vm_object_t); void vm_object_terminate (vm_object_t); void vm_object_set_writeable_dirty (vm_object_t); void vm_object_init (void); +void vm_object_madvise(vm_object_t, vm_pindex_t, vm_pindex_t, int); void vm_object_page_cache(vm_object_t object, vm_pindex_t start, vm_pindex_t end); boolean_t vm_object_page_clean(vm_object_t object, vm_ooffset_t start, @@ -240,7 +241,6 @@ void vm_object_shadow (vm_object_t *, vm void vm_object_split(vm_map_entry_t); boolean_t vm_object_sync(vm_object_t, vm_ooffset_t, vm_size_t, boolean_t, boolean_t); -void vm_object_madvise (vm_object_t, vm_pindex_t, int, int); #endif /* _KERNEL */ #endif /* _VM_OBJECT_ */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 19:01:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8017106564A; Mon, 19 Mar 2012 19:01:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92E698FC12; Mon, 19 Mar 2012 19:01:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JJ1YSl081876; Mon, 19 Mar 2012 19:01:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JJ1YJV081874; Mon, 19 Mar 2012 19:01:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203191901.q2JJ1YJV081874@svn.freebsd.org> From: Dimitry Andric Date: Mon, 19 Mar 2012 19:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233193 - head/contrib/libstdc++/include/bits X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 19:01:34 -0000 Author: dim Date: Mon Mar 19 19:01:34 2012 New Revision: 233193 URL: http://svn.freebsd.org/changeset/base/233193 Log: Add explicit braces to avoid dangling else in stl_tree.h. This silences the following warning produced by clang trunk: In file included from /usr/src/sbin/devd/devd.cc:91: In file included from /usr/obj/usr/src/tmp/usr/include/c++/4.2/map:64: /usr/obj/usr/src/tmp/usr/include/c++/4.2/bits/stl_tree.h:987:2: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else] else ^ MFC after: 3 days Modified: head/contrib/libstdc++/include/bits/stl_tree.h Modified: head/contrib/libstdc++/include/bits/stl_tree.h ============================================================================== --- head/contrib/libstdc++/include/bits/stl_tree.h Mon Mar 19 18:54:01 2012 (r233192) +++ head/contrib/libstdc++/include/bits/stl_tree.h Mon Mar 19 19:01:34 2012 (r233193) @@ -982,10 +982,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } iterator __j = iterator(__y); if (__comp) - if (__j == begin()) - return pair(_M_insert(__x, __y, __v), true); - else - --__j; + { + if (__j == begin()) + return pair(_M_insert(__x, __y, __v), true); + else + --__j; + } if (_M_impl._M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v))) return pair(_M_insert(__x, __y, __v), true); return pair(__j, false); From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 19:06:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB312106564A; Mon, 19 Mar 2012 19:06:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C737F8FC18; Mon, 19 Mar 2012 19:06:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JJ6e5h082127; Mon, 19 Mar 2012 19:06:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JJ6ekb082125; Mon, 19 Mar 2012 19:06:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203191906.q2JJ6ekb082125@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Mar 2012 19:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233194 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 19:06:41 -0000 Author: jhb Date: Mon Mar 19 19:06:40 2012 New Revision: 233194 URL: http://svn.freebsd.org/changeset/base/233194 Log: Bah, just revert my earlier change entirely. (Missed alc's request to do this earlier.) Requested by: alc Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Mon Mar 19 19:01:34 2012 (r233193) +++ head/sys/vm/vm_phys.c Mon Mar 19 19:06:40 2012 (r233194) @@ -223,7 +223,7 @@ _vm_phys_create_seg(vm_paddr_t start, vm { struct vm_phys_seg *seg; #ifdef VM_PHYSSEG_SPARSE - vm_size_t pages; + long pages; int segind; pages = 0; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 19:17:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9436E1065670; Mon, 19 Mar 2012 19:17:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F2AA8FC0C; Mon, 19 Mar 2012 19:17:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JJHuQV082496; Mon, 19 Mar 2012 19:17:56 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JJHuKf082494; Mon, 19 Mar 2012 19:17:56 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203191917.q2JJHuKf082494@svn.freebsd.org> From: Dimitry Andric Date: Mon, 19 Mar 2012 19:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233195 - head/usr.sbin/dconschat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 19:17:56 -0000 Author: dim Date: Mon Mar 19 19:17:55 2012 New Revision: 233195 URL: http://svn.freebsd.org/changeset/base/233195 Log: Fix the following warning from clang trunk: usr.sbin/dconschat/dconschat.c:163:65: error: format specifies type 'size_t' (aka 'unsigned int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat] snprintf(buf, PAGE_SIZE, "\r\n[dconschat reset target(addr=0x%zx)...]\r\n", dc->reset); ~~^ ~~~~~~~~~ %llx Silence this by casting dc->reset to intmax_t, and using the appropriate length modifier. While here, wrap the line to a 80 character margin. MFC after: 3 days Modified: head/usr.sbin/dconschat/dconschat.c Modified: head/usr.sbin/dconschat/dconschat.c ============================================================================== --- head/usr.sbin/dconschat/dconschat.c Mon Mar 19 19:06:40 2012 (r233194) +++ head/usr.sbin/dconschat/dconschat.c Mon Mar 19 19:17:55 2012 (r233195) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -160,7 +161,9 @@ dconschat_reset_target(struct dcons_stat if (dc->reset == 0) return; - snprintf(buf, PAGE_SIZE, "\r\n[dconschat reset target(addr=0x%zx)...]\r\n", dc->reset); + snprintf(buf, PAGE_SIZE, + "\r\n[dconschat reset target(addr=0x%jx)...]\r\n", + (intmax_t)dc->reset); write(p->outfd, buf, strlen(buf)); bzero(&buf[0], PAGE_SIZE); dwrite(dc, (void *)buf, PAGE_SIZE, dc->reset); From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 19:25:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32F56106564A; Mon, 19 Mar 2012 19:25:23 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EFD08FC08; Mon, 19 Mar 2012 19:25:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JJPMHK082769; Mon, 19 Mar 2012 19:25:22 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JJPMTm082767; Mon, 19 Mar 2012 19:25:22 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201203191925.q2JJPMTm082767@svn.freebsd.org> From: Maxim Konovalov Date: Mon, 19 Mar 2012 19:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233196 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 19:25:23 -0000 Author: maxim Date: Mon Mar 19 19:25:22 2012 New Revision: 233196 URL: http://svn.freebsd.org/changeset/base/233196 Log: o Trim EoL whitespaces. Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Mon Mar 19 19:17:55 2012 (r233195) +++ head/share/man/man4/tcp.4 Mon Mar 19 19:25:22 2012 (r233196) @@ -147,7 +147,7 @@ See .Xr mod_cc 4 for details. .It Dv TCP_KEEPINIT -This write-only +This write-only .Xr setsockopt 2 option accepts a per-socket timeout argument of .Vt "u_int" @@ -160,7 +160,7 @@ in the .Sx MIB Variables section further down. .It Dv TCP_KEEPIDLE -This write-only +This write-only .Xr setsockopt 2 option accepts an argument of .Vt "u_int" @@ -176,7 +176,7 @@ in the .Sx MIB Variables section further down. .It Dv TCP_KEEPINTVL -This write-only +This write-only .Xr setsockopt 2 option accepts an argument of .Vt "u_int" @@ -191,7 +191,7 @@ in the .Sx MIB Variables section further down. .It Dv TCP_KEEPCNT -This write-only +This write-only .Xr setsockopt 2 option accepts an argument of .Vt "u_int" From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 19:27:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC977106566B; Mon, 19 Mar 2012 19:27:44 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A83078FC19; Mon, 19 Mar 2012 19:27:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JJRivh082878; Mon, 19 Mar 2012 19:27:44 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JJRir4082876; Mon, 19 Mar 2012 19:27:44 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201203191927.q2JJRir4082876@svn.freebsd.org> From: Maxim Konovalov Date: Mon, 19 Mar 2012 19:27:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233197 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 19:27:44 -0000 Author: maxim Date: Mon Mar 19 19:27:43 2012 New Revision: 233197 URL: http://svn.freebsd.org/changeset/base/233197 Log: o Sort Xrs. Modified: head/share/man/man4/siftr.4 Modified: head/share/man/man4/siftr.4 ============================================================================== --- head/share/man/man4/siftr.4 Mon Mar 19 19:25:22 2012 (r233196) +++ head/share/man/man4/siftr.4 Mon Mar 19 19:27:43 2012 (r233197) @@ -598,11 +598,11 @@ To change the log file location to /tmp/ command as root: sysctl net.inet.siftr.logfile=/tmp/siftr.log .Sh SEE ALSO +.Xr tcpdump 1 , +.Xr tcp 4 , +.Xr sysctl 8 , .Xr alq 9 , .Xr pfil 9 -.Xr sysctl 8 , -.Xr tcp 4 , -.Xr tcpdump 1 , .Sh ACKNOWLEDGEMENTS Development of this software was made possible in part by grants from the Cisco University Research Program Fund at Community Foundation Silicon Valley, From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 19:37:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D136106564A; Mon, 19 Mar 2012 19:37:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 467BA8FC12; Mon, 19 Mar 2012 19:37:44 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:7476:a64e:dc1e:13f] (unknown [IPv6:2001:7b8:3a7:0:7476:a64e:dc1e:13f]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4577D5C37; Mon, 19 Mar 2012 20:37:43 +0100 (CET) Message-ID: <4F678B03.8050307@FreeBSD.org> Date: Mon, 19 Mar 2012 20:37:39 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120312 Thunderbird/11.0 MIME-Version: 1.0 To: Chris Rees References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <20120317162754.I1530@besplex.bde.org> In-Reply-To: X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 19:37:44 -0000 On 2012-03-19 08:21, Chris Rees wrote: > On 17 Mar 2012 05:40, "Bruce Evans" > wrote: >> >> On Fri, 16 Mar 2012, Dimitry Andric wrote: >> >>> Log: >>> Change the style of share/mk/bsd.sys.mk to that of the other bsd.*.mk >>> files, and style.Makefile(5), where applicable. While here, update the >>> link to the gcc warning documentation. >> >> >> Thanks. I rather liked the "^.* foo" style for making ifdefs less >> unreadable, but it didn't look like it was written here, and it is >> a sign of other problems that so many nested ifdefs are used. It >> only used a single space of each level of indentation, so the >> indentation was still hard too see. >> >> The "other bsd.*.mk" files don't include bsd.cpu.mk . This still uses >> the "^. *foo" style (and is now the only *.mk file one that does this). >> For assignments, it mostly uses a different unusual style -- just the >> normal C style of a single space before and after '=' (or '+='). Weird >> formattings of assignments are harder to grep for than weird formattings >> of ".foo", so I didn't try looking for them all. > > Indented .ifs etc are used (inconsistently) in bsd.port.mk et al, and can make a huge difference to readability; make is such a messy language that multiple levels are often needed. Well, the issue with Makefiles is that you cannot indent the actual statements. So even if you sort-of-indent the directives, by adding spaces between the initial dot and the directive name, you still have a very messy left margin. :) It would be much nicer to be able to write: .if defined(FOO) .if defined(BAR) CFLAGS+= -DFOO_BAR .endif .endif But I guess that would require some overhaul in make. It doesn't grok such indentations now. > Perhaps we should try to agree a standard on them, perhaps two spaces? It's a shame to be stripping them out. Two spaces sounds reasonable enough. Though indent size is probably the ultimate bikeshed... ;) From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 19:44:39 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 611D0106566C; Mon, 19 Mar 2012 19:44:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id DA7CC8FC08; Mon, 19 Mar 2012 19:44:38 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q2JJiVio019066; Mon, 19 Mar 2012 23:44:31 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q2JJiVRK019065; Mon, 19 Mar 2012 23:44:31 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 19 Mar 2012 23:44:31 +0400 From: Gleb Smirnoff To: Davide Italiano Message-ID: <20120319194431.GD30704@FreeBSD.org> References: <201203162032.q2GKWBRV033715@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201203162032.q2GKWBRV033715@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r233045 - in head/sys: conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 19:44:39 -0000 Davide, On Fri, Mar 16, 2012 at 08:32:11PM +0000, Davide Italiano wrote: D> Author: davide D> Date: Fri Mar 16 20:32:11 2012 D> New Revision: 233045 D> URL: http://svn.freebsd.org/changeset/base/233045 D> D> Log: D> Add rudimentary profiling of the hash table used in the in the umtx code to D> hold active lock queues. D> D> Reviewed by: attilio D> Approved by: davidxu, gnn (mentor) D> MFC after: 3 weeks D> D> Modified: D> head/sys/conf/NOTES D> head/sys/conf/options D> head/sys/kern/kern_umtx.c ... D> static void D> umtxq_sysinit(void *arg __unused) D> { D> @@ -232,8 +265,15 @@ umtxq_sysinit(void *arg __unused) D> TAILQ_INIT(&umtxq_chains[i][j].uc_pi_list); D> umtxq_chains[i][j].uc_busy = 0; D> umtxq_chains[i][j].uc_waiters = 0; D> + #ifdef UMTX_PROFILING D> + umtxq_chains[i][j].length = 0; D> + umtxq_chains[i][j].max_length = 0; D> + #endif D> } D> } D> + #ifdef UMTX_PROFILING D> + umtx_init_profiling(); D> + #endif D> mtx_init(&umtx_lock, "umtx lock", NULL, MTX_SPIN); D> EVENTHANDLER_REGISTER(process_exec, umtx_exec_hook, NULL, D> EVENTHANDLER_PRI_ANY); D> @@ -384,6 +424,14 @@ umtxq_insert_queue(struct umtx_q *uq, in D> D> TAILQ_INSERT_TAIL(&uh->head, uq, uq_link); D> uh->length++; D> + #ifdef UMTX_PROFILING D> + uc->length++; D> + if (uc->length > uc->max_length) { D> + uc->max_length = uc->length; D> + if (uc->max_length > max_length) D> + max_length = uc->max_length; D> + } D> + #endif D> uq->uq_flags |= UQF_UMTXQ; D> uq->uq_cur_queue = uh; D> return; D> @@ -401,6 +449,9 @@ umtxq_remove_queue(struct umtx_q *uq, in D> uh = uq->uq_cur_queue; D> TAILQ_REMOVE(&uh->head, uq, uq_link); D> uh->length--; D> + #ifdef UMTX_PROFILING D> + uc->length--; D> + #endif D> uq->uq_flags &= ~UQF_UMTXQ; D> if (TAILQ_EMPTY(&uh->head)) { D> KASSERT(uh->length == 0, These indented ifdefs look like a major violation of style used throughout the FreeBSD kernel code. Can you please keep with common style? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 19:53:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DDA3F106564A; Mon, 19 Mar 2012 19:53:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7E298FC12; Mon, 19 Mar 2012 19:53:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JJrrhB083680; Mon, 19 Mar 2012 19:53:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JJrrBt083677; Mon, 19 Mar 2012 19:53:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203191953.q2JJrrBt083677@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Mar 2012 19:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233198 - in head/sys/ofed/drivers/infiniband: core ulp/sdp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 19:53:54 -0000 Author: jhb Date: Mon Mar 19 19:53:53 2012 New Revision: 233198 URL: http://svn.freebsd.org/changeset/base/233198 Log: Fix build of OFED bits with debugging options enabled. Modified: head/sys/ofed/drivers/infiniband/core/fmr_pool.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Modified: head/sys/ofed/drivers/infiniband/core/fmr_pool.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/fmr_pool.c Mon Mar 19 19:27:43 2012 (r233197) +++ head/sys/ofed/drivers/infiniband/core/fmr_pool.c Mon Mar 19 19:53:53 2012 (r233198) @@ -150,7 +150,7 @@ static void ib_fmr_batch_release(struct #ifdef DEBUG if (fmr->ref_count !=0) { - printk(KERN_WARNING PFX "Unmapping FMR 0x%08x with ref count %d\n", + printk(KERN_WARNING PFX "Unmapping FMR %p with ref count %d\n", fmr, fmr->ref_count); } #endif Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Mon Mar 19 19:27:43 2012 (r233197) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Mon Mar 19 19:53:53 2012 (r233198) @@ -855,7 +855,7 @@ sdp_append(struct sdp_sock *ssk, struct int ncnt; SOCKBUF_LOCK_ASSERT(sb); - SBLASTRECORDCHK(sb) + SBLASTRECORDCHK(sb); KASSERT(mb->m_flags & M_PKTHDR, ("sdp_append: %p Missing packet header.\n", mb)); n = sb->sb_lastrecord; From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 19:54:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35A7B106576A; Mon, 19 Mar 2012 19:54:06 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 979CA8FC17; Mon, 19 Mar 2012 19:54:05 +0000 (UTC) Received: by vcmm1 with SMTP id m1so9359377vcm.13 for ; Mon, 19 Mar 2012 12:54:05 -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=FTpgAtjlzFUK88Vjve2qzOxM4mRzZUprr0MGw9M0l88=; b=G93RmX0IcUFzFsJkz6hTdaxF7s1XHzP4ulOHae/JO1QLzOjkW/8gox2Z+vLO5yww22 kqB6AwjsiGbDNucvFcm+avWS/3/zJMFMoWZajIhlypDRqSZ+MWQZfyyEauOt9HaMp8SL 8RVZswQJ+OrAn/X4SqJIjDNXQN9K7wQ5XZVCOWJwlg4d+TIcfUqqHOjxDHFN4rPp+pQ0 WiQF7XrN7lsoVOqe5xsJoC7VViH/SIKG440wXHqCftC9xw6YvQB5ZxrFo4HYcHlvijVI vSGx6MDDWQJd6tTNwoh9icN0/V/+UlyKGIKTnQOkIIGqPZ4VNzWxAFxCWRjTN44pn62k euhw== MIME-Version: 1.0 Received: by 10.220.58.198 with SMTP id i6mr5268657vch.57.1332186844939; Mon, 19 Mar 2012 12:54:04 -0700 (PDT) Received: by 10.52.171.167 with HTTP; Mon, 19 Mar 2012 12:54:04 -0700 (PDT) In-Reply-To: <20120319194431.GD30704@FreeBSD.org> References: <201203162032.q2GKWBRV033715@svn.freebsd.org> <20120319194431.GD30704@FreeBSD.org> Date: Mon, 19 Mar 2012 20:54:04 +0100 Message-ID: From: Davide Italiano To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233045 - in head/sys: conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 19:54:06 -0000 2012/3/19 Gleb Smirnoff : > =A0Davide, > > On Fri, Mar 16, 2012 at 08:32:11PM +0000, Davide Italiano wrote: > D> Author: davide > D> Date: Fri Mar 16 20:32:11 2012 > D> New Revision: 233045 > D> URL: http://svn.freebsd.org/changeset/base/233045 > D> > D> Log: > D> =A0 Add rudimentary profiling of the hash table used in the in the umt= x code to > D> =A0 hold active lock queues. > D> > D> =A0 Reviewed by: =A0 =A0 =A0 attilio > D> =A0 Approved by: =A0 =A0 =A0 davidxu, gnn (mentor) > D> =A0 MFC after: 3 weeks > D> > D> Modified: > D> =A0 head/sys/conf/NOTES > D> =A0 head/sys/conf/options > D> =A0 head/sys/kern/kern_umtx.c > > ... > > D> =A0static void > D> =A0umtxq_sysinit(void *arg __unused) > D> =A0{ > D> @@ -232,8 +265,15 @@ umtxq_sysinit(void *arg __unused) > D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0TAILQ_INIT(&umtxq_chains[i]= [j].uc_pi_list); > D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].uc_busy = =3D 0; > D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].uc_waite= rs =3D 0; > D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#ifdef UMTX_PROFILING > D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].length =3D= 0; > D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].max_length= =3D 0; > D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#endif > D> =A0 =A0 =A0 =A0 =A0 =A0 =A0} > D> =A0 =A0 =A0} > D> + =A0 =A0#ifdef UMTX_PROFILING > D> + =A0 =A0umtx_init_profiling(); > D> + =A0 =A0#endif > D> =A0 =A0 =A0mtx_init(&umtx_lock, "umtx lock", NULL, MTX_SPIN); > D> =A0 =A0 =A0EVENTHANDLER_REGISTER(process_exec, umtx_exec_hook, NULL, > D> =A0 =A0 =A0 =A0 =A0EVENTHANDLER_PRI_ANY); > D> @@ -384,6 +424,14 @@ umtxq_insert_queue(struct umtx_q *uq, in > D> > D> =A0 =A0 =A0TAILQ_INSERT_TAIL(&uh->head, uq, uq_link); > D> =A0 =A0 =A0uh->length++; > D> + =A0 =A0#ifdef UMTX_PROFILING > D> + =A0 =A0uc->length++; > D> + =A0 =A0if (uc->length > uc->max_length) { > D> + =A0 =A0 =A0 =A0 =A0 =A0uc->max_length =3D uc->length; > D> + =A0 =A0 =A0 =A0 =A0 =A0if (uc->max_length > max_length) > D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0max_length =3D uc->max_length= ; > D> + =A0 =A0} > D> + =A0 =A0#endif > D> =A0 =A0 =A0uq->uq_flags |=3D UQF_UMTXQ; > D> =A0 =A0 =A0uq->uq_cur_queue =3D uh; > D> =A0 =A0 =A0return; > D> @@ -401,6 +449,9 @@ umtxq_remove_queue(struct umtx_q *uq, in > D> =A0 =A0 =A0 =A0 =A0 =A0 =A0uh =3D uq->uq_cur_queue; > D> =A0 =A0 =A0 =A0 =A0 =A0 =A0TAILQ_REMOVE(&uh->head, uq, uq_link); > D> =A0 =A0 =A0 =A0 =A0 =A0 =A0uh->length--; > D> + =A0 =A0 =A0 =A0 =A0 =A0#ifdef UMTX_PROFILING > D> + =A0 =A0 =A0 =A0 =A0 =A0uc->length--; > D> + =A0 =A0 =A0 =A0 =A0 =A0#endif > D> =A0 =A0 =A0 =A0 =A0 =A0 =A0uq->uq_flags &=3D ~UQF_UMTXQ; > D> =A0 =A0 =A0 =A0 =A0 =A0 =A0if (TAILQ_EMPTY(&uh->head)) { > D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0KASSERT(uh->length =3D=3D 0= , > > These indented ifdefs look like a major violation of style used throughou= t > the FreeBSD kernel code. Can you please keep with common style? > > -- > Totus tuus, Glebius. Heh, sorry, also Juli Mallet noticed this, I'm writing a fix for this and after I'll have approval from my mentor I'll commit. Davide From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 20:06:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 322A31065670; Mon, 19 Mar 2012 20:06:39 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8BA948FC0C; Mon, 19 Mar 2012 20:06:38 +0000 (UTC) Received: by vcmm1 with SMTP id m1so9375611vcm.13 for ; Mon, 19 Mar 2012 13:06:38 -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=ZEgh6IuybMz/e4koDYKoGD6udBJia4ZQegK+KeljHqs=; b=LBcxpspPXlp0sZHHGdLr0LaO60Wxvr9ZqP46Iy/c4p1VqocalB5+mrQ0hDyZw6I6Qx 9iwrvdbFKM70NtKlHEetMtgW28CDLDYfhre3T2kKtELJPywOlMsqPmgxYZnRycZ6TTyv 3/tt3dbtWtkpfc0M/Ex68idxCoYiiMXJIALEG9oNsxLr+reczV2fWoJKvvNYGJCxCuWE QE5qsCQy0SR8YAzbnHNExuWqVzURETVatVpJxZmA+a1qOwZF49t2oy7bTNdmzlPAGhnM ax7tn+BAeJU5CtYbBPM0nMJFJDTA6hP0DJZ3quK66GD64U4savcnjoyFpsw59xw+FIoh CNQQ== MIME-Version: 1.0 Received: by 10.220.141.146 with SMTP id m18mr5284386vcu.47.1332187597983; Mon, 19 Mar 2012 13:06:37 -0700 (PDT) Received: by 10.52.171.167 with HTTP; Mon, 19 Mar 2012 13:06:36 -0700 (PDT) In-Reply-To: References: <201203162032.q2GKWBRV033715@svn.freebsd.org> <20120319194431.GD30704@FreeBSD.org> Date: Mon, 19 Mar 2012 21:06:36 +0100 Message-ID: From: Davide Italiano To: Gleb Smirnoff , George Neville-Neil Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233045 - in head/sys: conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 20:06:39 -0000 On Mon, Mar 19, 2012 at 8:54 PM, Davide Italiano wrote: > 2012/3/19 Gleb Smirnoff : >> =A0Davide, >> >> On Fri, Mar 16, 2012 at 08:32:11PM +0000, Davide Italiano wrote: >> D> Author: davide >> D> Date: Fri Mar 16 20:32:11 2012 >> D> New Revision: 233045 >> D> URL: http://svn.freebsd.org/changeset/base/233045 >> D> >> D> Log: >> D> =A0 Add rudimentary profiling of the hash table used in the in the um= tx code to >> D> =A0 hold active lock queues. >> D> >> D> =A0 Reviewed by: =A0 =A0 =A0 attilio >> D> =A0 Approved by: =A0 =A0 =A0 davidxu, gnn (mentor) >> D> =A0 MFC after: 3 weeks >> D> >> D> Modified: >> D> =A0 head/sys/conf/NOTES >> D> =A0 head/sys/conf/options >> D> =A0 head/sys/kern/kern_umtx.c >> >> ... >> >> D> =A0static void >> D> =A0umtxq_sysinit(void *arg __unused) >> D> =A0{ >> D> @@ -232,8 +265,15 @@ umtxq_sysinit(void *arg __unused) >> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0TAILQ_INIT(&umtxq_chains[i= ][j].uc_pi_list); >> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].uc_busy= =3D 0; >> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].uc_wait= ers =3D 0; >> D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#ifdef UMTX_PROFILING >> D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].length = =3D 0; >> D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].max_lengt= h =3D 0; >> D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#endif >> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> D> =A0 =A0 =A0} >> D> + =A0 =A0#ifdef UMTX_PROFILING >> D> + =A0 =A0umtx_init_profiling(); >> D> + =A0 =A0#endif >> D> =A0 =A0 =A0mtx_init(&umtx_lock, "umtx lock", NULL, MTX_SPIN); >> D> =A0 =A0 =A0EVENTHANDLER_REGISTER(process_exec, umtx_exec_hook, NULL, >> D> =A0 =A0 =A0 =A0 =A0EVENTHANDLER_PRI_ANY); >> D> @@ -384,6 +424,14 @@ umtxq_insert_queue(struct umtx_q *uq, in >> D> >> D> =A0 =A0 =A0TAILQ_INSERT_TAIL(&uh->head, uq, uq_link); >> D> =A0 =A0 =A0uh->length++; >> D> + =A0 =A0#ifdef UMTX_PROFILING >> D> + =A0 =A0uc->length++; >> D> + =A0 =A0if (uc->length > uc->max_length) { >> D> + =A0 =A0 =A0 =A0 =A0 =A0uc->max_length =3D uc->length; >> D> + =A0 =A0 =A0 =A0 =A0 =A0if (uc->max_length > max_length) >> D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0max_length =3D uc->max_lengt= h; >> D> + =A0 =A0} >> D> + =A0 =A0#endif >> D> =A0 =A0 =A0uq->uq_flags |=3D UQF_UMTXQ; >> D> =A0 =A0 =A0uq->uq_cur_queue =3D uh; >> D> =A0 =A0 =A0return; >> D> @@ -401,6 +449,9 @@ umtxq_remove_queue(struct umtx_q *uq, in >> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0uh =3D uq->uq_cur_queue; >> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0TAILQ_REMOVE(&uh->head, uq, uq_link); >> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0uh->length--; >> D> + =A0 =A0 =A0 =A0 =A0 =A0#ifdef UMTX_PROFILING >> D> + =A0 =A0 =A0 =A0 =A0 =A0uc->length--; >> D> + =A0 =A0 =A0 =A0 =A0 =A0#endif >> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0uq->uq_flags &=3D ~UQF_UMTXQ; >> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0if (TAILQ_EMPTY(&uh->head)) { >> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0KASSERT(uh->length =3D=3D = 0, >> >> These indented ifdefs look like a major violation of style used througho= ut >> the FreeBSD kernel code. Can you please keep with common style? >> >> -- >> Totus tuus, Glebius. > > Heh, > sorry, also Juli Mallet noticed this, I'm writing a fix for this and > after I'll have approval from my mentor I'll commit. > > Davide This should fix: http://people.freebsd.org/~davide/umtx_stylefix.diff Can you plase give it a closer look? George, if everythin' is ok, can I have also your approval? From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 20:15:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1699410656FE; Mon, 19 Mar 2012 20:15:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBDCA8FC0A; Mon, 19 Mar 2012 20:15:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JKFI53084482; Mon, 19 Mar 2012 20:15:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JKFItl084480; Mon, 19 Mar 2012 20:15:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203192015.q2JKFItl084480@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Mar 2012 20:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233199 - in stable/8/sys: i386/conf netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 20:15:19 -0000 Author: jhb Date: Mon Mar 19 20:15:18 2012 New Revision: 233199 URL: http://svn.freebsd.org/changeset/base/233199 Log: MFC 225096: Fix if_addr_mtx recursion in mld6. mld_set_version() is called only from mld_v1_input_query() and mld_v2_input_query() both holding the if_addr_mtx lock, and then calling into mld_v2_cancel_link_timers() acquires it the second time, which results in mtx recursion. To avoid that, delay if_addr_mtx acquisition until after mld_set_version() is called; while here, further reduce locking scope to protect only the needed pieces: if_multiaddrs, in6m_lookup_locked(). Modified: stable/8/sys/netinet6/mld6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/netinet6/mld6.c ============================================================================== --- stable/8/sys/netinet6/mld6.c Mon Mar 19 19:53:53 2012 (r233198) +++ stable/8/sys/netinet6/mld6.c Mon Mar 19 20:15:18 2012 (r233199) @@ -681,7 +681,6 @@ mld_v1_input_query(struct ifnet *ifp, co IN6_MULTI_LOCK(); MLD_LOCK(); - IF_ADDR_LOCK(ifp); /* * Switch to MLDv1 host compatibility mode. @@ -694,6 +693,7 @@ mld_v1_input_query(struct ifnet *ifp, co if (timer == 0) timer = 1; + IF_ADDR_LOCK(ifp); if (is_general_query) { /* * For each reporting group joined on this @@ -889,7 +889,6 @@ mld_v2_input_query(struct ifnet *ifp, co IN6_MULTI_LOCK(); MLD_LOCK(); - IF_ADDR_LOCK(ifp); mli = MLD_IFINFO(ifp); KASSERT(mli != NULL, ("%s: no mld_ifinfo for ifp %p", __func__, ifp)); @@ -937,14 +936,18 @@ mld_v2_input_query(struct ifnet *ifp, co * Queries for groups we are not a member of on this * link are simply ignored. */ + IF_ADDR_LOCK(ifp); inm = in6m_lookup_locked(ifp, &mld->mld_addr); - if (inm == NULL) + if (inm == NULL) { + IF_ADDR_UNLOCK(ifp); goto out_locked; + } if (nsrc > 0) { if (!ratecheck(&inm->in6m_lastgsrtv, &V_mld_gsrdelay)) { CTR1(KTR_MLD, "%s: GS query throttled.", __func__); + IF_ADDR_UNLOCK(ifp); goto out_locked; } } @@ -962,10 +965,10 @@ mld_v2_input_query(struct ifnet *ifp, co /* XXX Clear embedded scope ID as userland won't expect it. */ in6_clearscope(&mld->mld_addr); + IF_ADDR_UNLOCK(ifp); } out_locked: - IF_ADDR_UNLOCK(ifp); MLD_UNLOCK(); IN6_MULTI_UNLOCK(); From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 20:41:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0916C1065675; Mon, 19 Mar 2012 20:41:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CDBEE8FC14; Mon, 19 Mar 2012 20:41:47 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 8763046B1A; Mon, 19 Mar 2012 16:41:47 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AC7C1B963; Mon, 19 Mar 2012 16:41:46 -0400 (EDT) From: John Baldwin To: Eitan Adler Date: Mon, 19 Mar 2012 13:59:33 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203190041.q2J0femX042684@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203191359.34178.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 19 Mar 2012 16:41:46 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, des@freebsd.org, Colin Percival Subject: Re: svn commit: r233136 - in head/secure: usr.bin/ssh usr.sbin/sshd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 20:41:48 -0000 On Monday, March 19, 2012 11:55:12 am Eitan Adler wrote: > >> This looks wrong. While X11BASE is certainly dead, LOCALBASE is not, so the > >> existing code should have been changed, but not removed. > > Does this look good? > Build tested only. Hmm, I will defer to Des. Previously the make glue did not hardcode /usr/local as the default LOCALBASE, instead it only modfied CFLAGS if LOCALBASE was defined. (And presumably the openssh code has its own hardcoded copy of XAUTH_PATH as /usr/local/bin/xauth.) It's not clear if it is better in the case that LOCALBASE is not defined to rely on openssh's hardcoded default or to hardcode the default in our bmake glue. I would lean towards the former since it matches the previous behavior, or in shorter form: .ifdef LOCALBASE CFLAGS+= /* blah bblah */ .endif And not do anything if LOCALBASE is not set. Also, the original commit touched two Makefiles, this patch only fixes one of them. > commit 271b766fdbd907be040767f2387b4d5fbb6425f7 > Author: Eitan Adler > Date: Mon Mar 19 11:52:31 2012 -0400 > > Restore the ability to use a non-standard LOCALBASE > > Submitted by: jhb > Approved by: cperciva > MFC after: 0 days (with r233136) > > diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile > index 0120771..6426ff3 100644 > --- a/secure/usr.sbin/sshd/Makefile > +++ b/secure/usr.sbin/sshd/Makefile > @@ -40,6 +40,9 @@ DPADD+= ${LIBGSSAPI_KRB5} ${LIBGSSAPI} ${LIBKRB5} ${LIBASN1} > LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 -lasn1 > .endif > > +LOCALBASE?= /usr/local > +CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" > + > DPADD+= ${LIBCRYPTO} ${LIBCRYPT} > LDADD+= -lcrypto -lcrypt > > > > -- > Eitan Adler > Source & Ports committer > X11, Bugbusting teams > -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 20:41:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDC661065673; Mon, 19 Mar 2012 20:41:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C0AD18FC12; Mon, 19 Mar 2012 20:41:47 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 6354846B3B; Mon, 19 Mar 2012 16:41:46 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E790EB960; Mon, 19 Mar 2012 16:41:45 -0400 (EDT) From: John Baldwin To: davidxu@freebsd.org Date: Mon, 19 Mar 2012 13:50:51 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203180022.q2I0MThr093557@svn.freebsd.org> <201203190833.08153.jhb@freebsd.org> <4F6753C1.4060800@gmail.com> In-Reply-To: <4F6753C1.4060800@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203191350.51888.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 19 Mar 2012 16:41:46 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233103 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 20:41:48 -0000 On Monday, March 19, 2012 11:41:53 am David Xu wrote: > On 2012/3/19 20:33, John Baldwin wrote: > > On Saturday, March 17, 2012 8:22:29 pm David Xu wrote: > >> Author: davidxu > >> Date: Sun Mar 18 00:22:29 2012 > >> New Revision: 233103 > >> URL: http://svn.freebsd.org/changeset/base/233103 > >> > >> Log: > >> Some software think a mutex can be destroyed after it owned it, for > >> example, it uses a serialization point like following: > >> pthread_mutex_lock(&mutex); > >> pthread_mutex_unlock(&mutex); > >> pthread_mutex_destroy(&muetx); > >> They think a previous lock holder should have already left the mutex and > >> is no longer referencing it, so they destroy it. To be maximum compatible > >> with such code, we use IA64 version to unlock the mutex in kernel, remove > >> the two steps unlocking code. > > But this means they destroy the lock while another thread holds it? That > > seems wrong. It's one thing if they know that no other thread has a reference > > to the lock (e.g. it's in a refcounted object and the current thread just > > dropped the reference count to zero). However, in that case no other thread > > can unlock it after this thread destroys it. Code that does this seems very > > buggy, since if the address can be unmapped it can also be remapped and > > assigned to another lock, etc., so you could have a thread try to unlock a > > lock it doesn't hold. > > They have handshake code to indicate that the mutex is no longer used by > previous > holder. e.g: > > thread 1: > pthread_mutex_lock(&mutex); > done = 1; > pthread_mutex_unlock(&mutex); > thread 2: > pthread_mutex_lock(&mutex); > temp = done; > pthread_mutex_unlock(&mutex); > if (temp == 1) > pthread_mutex_destroy(&mutex); Hmm, so how does this result in the crash you fixed? That is, thread 1 has to fully finish pthread_mutex_unlock() before thread2's pthread_mutex_lock() can succeed, so I don't see how thread 1 could still be in pthread_mutex_unlock() when thread 2 calls pthread_mutex_destroy(). > I guess one crash of Python is also caused by the logic, though they use > semaphore > instead of mutex + condition variable to mimic lock. > POSIX even explicitly requires a condition variable to be destroyable > after broadcast, > once you have correct teardown code. Please read its example section: > http://pubs.opengroup.org/onlinepubs/007904975/functions/pthread_cond_destroy.html This is quite different as assuming a broadcast marks all the threads as runnable and removes them from the cv's queue, none of the threads will have references to the cv so it will be safe to destroy. It would not be safe to destroy the mutex in that case though (and the example does not destroy the mutex, only the cv). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 20:49:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8389D106566B; Mon, 19 Mar 2012 20:49:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C44C8FC0C; Mon, 19 Mar 2012 20:49:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JKnHPH085610; Mon, 19 Mar 2012 20:49:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JKnHK5085596; Mon, 19 Mar 2012 20:49:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203192049.q2JKnHK5085596@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Mar 2012 20:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233200 - in stable/9/sys: i386/conf kern net netatalk netinet netinet6 netipx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 20:49:17 -0000 Author: jhb Date: Mon Mar 19 20:49:16 2012 New Revision: 233200 URL: http://svn.freebsd.org/changeset/base/233200 Log: MFC 229621: Convert all users of IF_ADDR_LOCK to use new locking macros that specify either a read lock or write lock. Modified: stable/9/sys/kern/kern_uuid.c stable/9/sys/net/if.c stable/9/sys/net/rtsock.c stable/9/sys/netatalk/aarp.c stable/9/sys/netatalk/at_control.c stable/9/sys/netinet/if_ether.c stable/9/sys/netinet/igmp.c stable/9/sys/netinet/in.c stable/9/sys/netinet/in_mcast.c stable/9/sys/netinet/in_pcb.c stable/9/sys/netinet/in_var.h stable/9/sys/netinet/ip_carp.c stable/9/sys/netinet/ip_icmp.c stable/9/sys/netinet/ip_input.c stable/9/sys/netinet/sctp_bsd_addr.c stable/9/sys/netinet6/icmp6.c stable/9/sys/netinet6/in6.c stable/9/sys/netinet6/in6_ifattach.c stable/9/sys/netinet6/in6_mcast.c stable/9/sys/netinet6/in6_var.h stable/9/sys/netinet6/ip6_input.c stable/9/sys/netinet6/mld6.c stable/9/sys/netinet6/nd6.c stable/9/sys/netinet6/nd6_rtr.c stable/9/sys/netipx/ipx.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/kern/kern_uuid.c ============================================================================== --- stable/9/sys/kern/kern_uuid.c Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/kern/kern_uuid.c Mon Mar 19 20:49:16 2012 (r233200) @@ -98,20 +98,20 @@ uuid_node(uint16_t *node) IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { /* Walk the address list */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sdl = (struct sockaddr_dl*)ifa->ifa_addr; if (sdl != NULL && sdl->sdl_family == AF_LINK && sdl->sdl_type == IFT_ETHER) { /* Got a MAC address. */ bcopy(LLADDR(sdl), node, UUID_NODE_LEN); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); IFNET_RUNLOCK_NOSLEEP(); CURVNET_RESTORE(); return; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } IFNET_RUNLOCK_NOSLEEP(); Modified: stable/9/sys/net/if.c ============================================================================== --- stable/9/sys/net/if.c Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/net/if.c Mon Mar 19 20:49:16 2012 (r233200) @@ -802,10 +802,10 @@ if_purgemaddrs(struct ifnet *ifp) struct ifmultiaddr *ifma; struct ifmultiaddr *next; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) if_delmulti_locked(ifp, ifma, 1); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); } /* @@ -1149,10 +1149,10 @@ if_addgroup(struct ifnet *ifp, const cha ifgl->ifgl_group = ifg; ifgm->ifgm_ifp = ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_INSERT_TAIL(&ifg->ifg_members, ifgm, ifgm_next); TAILQ_INSERT_TAIL(&ifp->if_groups, ifgl, ifgl_next); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); IFNET_WUNLOCK(); @@ -1179,9 +1179,9 @@ if_delgroup(struct ifnet *ifp, const cha return (ENOENT); } - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_groups, ifgl, ifgl_next); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); TAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next) if (ifgm->ifgm_ifp == ifp) @@ -1222,9 +1222,9 @@ if_delgroups(struct ifnet *ifp) strlcpy(groupname, ifgl->ifgl_group->ifg_group, IFNAMSIZ); - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_groups, ifgl, ifgl_next); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); TAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next) if (ifgm->ifgm_ifp == ifp) @@ -1266,33 +1266,33 @@ if_getgroup(struct ifgroupreq *data, str struct ifgroupreq *ifgr = data; if (ifgr->ifgr_len == 0) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) ifgr->ifgr_len += sizeof(struct ifg_req); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (0); } len = ifgr->ifgr_len; ifgp = ifgr->ifgr_groups; /* XXX: wire */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) { if (len < sizeof(ifgrq)) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (EINVAL); } bzero(&ifgrq, sizeof ifgrq); strlcpy(ifgrq.ifgrq_group, ifgl->ifgl_group->ifg_group, sizeof(ifgrq.ifgrq_group)); if ((error = copyout(&ifgrq, ifgp, sizeof(struct ifg_req)))) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (error); } len -= sizeof(ifgrq); ifgp++; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (0); } @@ -1399,28 +1399,28 @@ void if_addr_rlock(struct ifnet *ifp) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); } void if_addr_runlock(struct ifnet *ifp) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } void if_maddr_rlock(struct ifnet *ifp) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); } void if_maddr_runlock(struct ifnet *ifp) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } /* @@ -1532,14 +1532,14 @@ ifa_ifwithaddr_internal(struct sockaddr IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) continue; if (sa_equal(addr, ifa->ifa_addr)) { if (getref) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } /* IP6 doesn't have broadcast */ @@ -1549,11 +1549,11 @@ ifa_ifwithaddr_internal(struct sockaddr sa_equal(ifa->ifa_broadaddr, addr)) { if (getref) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = NULL; done: @@ -1587,7 +1587,7 @@ ifa_ifwithbroadaddr(struct sockaddr *add IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) continue; @@ -1596,11 +1596,11 @@ ifa_ifwithbroadaddr(struct sockaddr *add ifa->ifa_broadaddr->sa_len != 0 && sa_equal(ifa->ifa_broadaddr, addr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = NULL; done: @@ -1622,18 +1622,18 @@ ifa_ifwithdstaddr(struct sockaddr *addr) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0) continue; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) continue; if (ifa->ifa_dstaddr != NULL && sa_equal(addr, ifa->ifa_dstaddr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = NULL; done: @@ -1667,12 +1667,12 @@ ifa_ifwithnet(struct sockaddr *addr, int /* * Scan though each interface, looking for ones that have addresses * in this address family. Maintain a reference on ifa_maybe once - * we find one, as we release the IF_ADDR_LOCK() that kept it stable + * we find one, as we release the IF_ADDR_RLOCK() that kept it stable * when we move onto the next interface. */ IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { char *cp, *cp2, *cp3; @@ -1691,7 +1691,7 @@ next: continue; if (ifa->ifa_dstaddr != NULL && sa_equal(addr, ifa->ifa_dstaddr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } else { @@ -1702,7 +1702,7 @@ next: continue; if (ifa->ifa_claim_addr) { if ((*ifa->ifa_claim_addr)(ifa, addr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } continue; @@ -1742,7 +1742,7 @@ next: continue; } } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = ifa_maybe; ifa_maybe = NULL; @@ -1768,7 +1768,7 @@ ifaof_ifpforaddr(struct sockaddr *addr, if (af >= AF_MAX) return (NULL); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != af) continue; @@ -1800,7 +1800,7 @@ ifaof_ifpforaddr(struct sockaddr *addr, done: if (ifa != NULL) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (ifa); } @@ -2350,9 +2350,9 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, * lose a race while we check if the membership * already exists. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); ifma = if_findmulti(ifp, &ifr->ifr_addr); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (ifma != NULL) error = EADDRINUSE; else @@ -2768,7 +2768,7 @@ again: } addrs = 0; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa = ifa->ifa_addr; @@ -2800,7 +2800,7 @@ again: if (sbuf_error(sb) == 0) valid_len = sbuf_len(sb); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (addrs == 0) { bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr)); sbuf_bcat(sb, &ifr, sizeof(ifr)); @@ -2958,13 +2958,13 @@ if_addmulti(struct ifnet *ifp, struct so * If the address is already present, return a new reference to it; * otherwise, allocate storage and set up a new address. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); ifma = if_findmulti(ifp, sa); if (ifma != NULL) { ifma->ifma_refcount++; if (retifma != NULL) *retifma = ifma; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (0); } @@ -3030,7 +3030,7 @@ if_addmulti(struct ifnet *ifp, struct so * pointer is still valid. */ rt_newmaddrmsg(RTM_NEWMADDR, ifma); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); /* * We are certain we have added something, so call down to the @@ -3050,7 +3050,7 @@ free_llsa_out: free(llsa, M_IFMADDR); unlock_out: - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (error); } @@ -3084,12 +3084,12 @@ if_delmulti(struct ifnet *ifp, struct so if (ifp == NULL) return (ENOENT); - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); lastref = 0; ifma = if_findmulti(ifp, sa); if (ifma != NULL) lastref = if_delmulti_locked(ifp, ifma, 0); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); if (ifma == NULL) return (ENOENT); @@ -3111,10 +3111,10 @@ if_delallmulti(struct ifnet *ifp) struct ifmultiaddr *ifma; struct ifmultiaddr *next; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) if_delmulti_locked(ifp, ifma, 0); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); } /* @@ -3151,7 +3151,7 @@ if_delmulti_ifma(struct ifmultiaddr *ifm * If and only if the ifnet instance exists: Acquire the address lock. */ if (ifp != NULL) - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); lastref = if_delmulti_locked(ifp, ifma, 0); @@ -3161,7 +3161,7 @@ if_delmulti_ifma(struct ifmultiaddr *ifm * Release the address lock. * If the group was left: update the hardware hash filter. */ - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); if (lastref && ifp->if_ioctl != NULL) { (void)(*ifp->if_ioctl)(ifp, SIOCDELMULTI, 0); } @@ -3183,7 +3183,7 @@ if_delmulti_locked(struct ifnet *ifp, st if (ifp != NULL && ifma->ifma_ifp != NULL) { KASSERT(ifma->ifma_ifp == ifp, ("%s: inconsistent ifp %p", __func__, ifp)); - IF_ADDR_LOCK_ASSERT(ifp); + IF_ADDR_WLOCK_ASSERT(ifp); } ifp = ifma->ifma_ifp; @@ -3256,14 +3256,14 @@ if_setlladdr(struct ifnet *ifp, const u_ struct ifaddr *ifa; struct ifreq ifr; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); ifa = ifp->if_addr; if (ifa == NULL) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (EINVAL); } ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); sdl = (struct sockaddr_dl *)ifa->ifa_addr; if (sdl == NULL) { ifa_free(ifa); Modified: stable/9/sys/net/rtsock.c ============================================================================== --- stable/9/sys/net/rtsock.c Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/net/rtsock.c Mon Mar 19 20:49:16 2012 (r233200) @@ -479,7 +479,7 @@ rtm_get_jailed(struct rt_addrinfo *info, * Try to find an address on the given outgoing interface * that belongs to the jail. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa; sa = ifa->ifa_addr; @@ -491,7 +491,7 @@ rtm_get_jailed(struct rt_addrinfo *info, break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (!found) { /* * As a last resort return the 'default' jail address. @@ -521,7 +521,7 @@ rtm_get_jailed(struct rt_addrinfo *info, * Try to find an address on the given outgoing interface * that belongs to the jail. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa; sa = ifa->ifa_addr; @@ -534,7 +534,7 @@ rtm_get_jailed(struct rt_addrinfo *info, break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (!found) { /* * As a last resort return the 'default' jail address. @@ -1710,7 +1710,7 @@ sysctl_iflist(int af, struct walkarg *w) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (w->w_arg && w->w_arg != ifp->if_index) continue; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); ifa = ifp->if_addr; info.rti_info[RTAX_IFP] = ifa->ifa_addr; len = rt_msg2(RTM_IFINFO, &info, NULL, w); @@ -1744,13 +1744,13 @@ sysctl_iflist(int af, struct walkarg *w) goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); info.rti_info[RTAX_IFA] = info.rti_info[RTAX_NETMASK] = info.rti_info[RTAX_BRD] = NULL; } done: if (ifp != NULL) - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); IFNET_RUNLOCK(); return (error); } @@ -1771,7 +1771,7 @@ sysctl_ifmalist(int af, struct walkarg * continue; ifa = ifp->if_addr; info.rti_info[RTAX_IFP] = ifa ? ifa->ifa_addr : NULL; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (af && af != ifma->ifma_addr->sa_family) continue; @@ -1792,12 +1792,12 @@ sysctl_ifmalist(int af, struct walkarg * ifmam->ifmam_addrs = info.rti_addrs; error = SYSCTL_OUT(w->w_req, w->w_tmem, len); if (error) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } done: IFNET_RUNLOCK(); Modified: stable/9/sys/netatalk/aarp.c ============================================================================== --- stable/9/sys/netatalk/aarp.c Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/netatalk/aarp.c Mon Mar 19 20:49:16 2012 (r233200) @@ -406,7 +406,7 @@ at_aarpinput(struct ifnet *ifp, struct m * Since we don't know the net, we just look for the first * phase 1 address on the interface. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); for (aa = (struct at_ifaddr *)TAILQ_FIRST(&ifp->if_addrhead); aa; aa = (struct at_ifaddr *)aa->aa_ifa.ifa_link.tqe_next) { @@ -416,12 +416,12 @@ at_aarpinput(struct ifnet *ifp, struct m } } if (aa == NULL) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); m_freem(m); return; } ifa_ref(&aa->aa_ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); tpa.s_net = spa.s_net = AA_SAT(aa)->sat_addr.s_net; } Modified: stable/9/sys/netatalk/at_control.c ============================================================================== --- stable/9/sys/netatalk/at_control.c Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/netatalk/at_control.c Mon Mar 19 20:49:16 2012 (r233200) @@ -254,9 +254,9 @@ at_control(struct socket *so, u_long cmd */ aa->aa_ifp = ifp; ifa_ref(&aa->aa_ifa); /* if_addrhead */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); } else { /* * If we DID find one then we clobber any routes @@ -357,9 +357,9 @@ at_control(struct socket *so, u_long cmd * remove the ifaddr from the interface */ ifa = (struct ifaddr *)aa; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); ifa_free(ifa); /* if_addrhead */ /* Modified: stable/9/sys/netinet/if_ether.c ============================================================================== --- stable/9/sys/netinet/if_ether.c Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/netinet/if_ether.c Mon Mar 19 20:49:16 2012 (r233200) @@ -617,15 +617,15 @@ in_arpinput(struct mbuf *m) * No match, use the first inet address on the receive interface * as a dummy address for the rest of the function. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (ifa->ifa_addr->sa_family == AF_INET) { ia = ifatoia(ifa); ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto match; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* * If bridging, fall back to using any inet address. Modified: stable/9/sys/netinet/igmp.c ============================================================================== --- stable/9/sys/netinet/igmp.c Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/netinet/igmp.c Mon Mar 19 20:49:16 2012 (r233200) @@ -617,7 +617,7 @@ igmp_ifdetach(struct ifnet *ifp) igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp; if (igi->igi_version == IGMP_VERSION_3) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -633,7 +633,7 @@ igmp_ifdetach(struct ifnet *ifp) } inm_clear_recorded(inm); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* * Free the in_multi reference(s) for this IGMP lifecycle. */ @@ -750,7 +750,7 @@ igmp_input_v1_query(struct ifnet *ifp, c * for the interface on which the query arrived, * except those which are already running. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -778,7 +778,7 @@ igmp_input_v1_query(struct ifnet *ifp, c break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); out_locked: IGMP_UNLOCK(); @@ -851,7 +851,7 @@ igmp_input_v2_query(struct ifnet *ifp, c */ CTR2(KTR_IGMPV3, "process v2 general query on ifp %p(%s)", ifp, ifp->if_xname); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -859,7 +859,7 @@ igmp_input_v2_query(struct ifnet *ifp, c inm = (struct in_multi *)ifma->ifma_protospec; igmp_v2_update_group(inm, timer); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } else { /* * Group-specific IGMPv2 query, we need only @@ -1707,7 +1707,7 @@ igmp_fasttimo_vnet(void) IFQ_SET_MAXLEN(&scq, IGMP_MAX_STATE_CHANGE_PACKETS); } - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -1725,7 +1725,7 @@ igmp_fasttimo_vnet(void) break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (igi->igi_version == IGMP_VERSION_3) { struct in_multi *tinm; @@ -2022,7 +2022,7 @@ igmp_v3_cancel_link_timers(struct igmp_i * for all memberships scoped to this link. */ ifp = igi->igi_ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -2067,7 +2067,7 @@ igmp_v3_cancel_link_timers(struct igmp_i inm->inm_timer = 0; _IF_DRAIN(&inm->inm_scq); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); SLIST_FOREACH_SAFE(inm, &igi->igi_relinmhead, inm_nrele, tinm) { SLIST_REMOVE_HEAD(&igi->igi_relinmhead, inm_nrele); inm_release_locked(inm); @@ -3330,7 +3330,7 @@ igmp_v3_dispatch_general_query(struct ig ifp = igi->igi_ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -3361,7 +3361,7 @@ igmp_v3_dispatch_general_query(struct ig break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); loop = (igi->igi_flags & IGIF_LOOPBACK) ? 1 : 0; igmp_dispatch_queue(&igi->igi_gq, IGMP_MAX_RESPONSE_BURST, loop); Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/netinet/in.c Mon Mar 19 20:49:16 2012 (r233200) @@ -326,7 +326,7 @@ in_control(struct socket *so, u_long cmd ifa_ref(&ia->ia_ifa); IN_IFADDR_RUNLOCK(); if (ia == NULL) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { iap = ifatoia(ifa); if (iap->ia_addr.sin_family == AF_INET) { @@ -340,7 +340,7 @@ in_control(struct socket *so, u_long cmd } if (ia != NULL) ifa_ref(&ia->ia_ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } if (ia == NULL) iaIsFirst = 1; @@ -404,9 +404,9 @@ in_control(struct socket *so, u_long cmd ia->ia_ifp = ifp; ifa_ref(ifa); /* if_addrhead */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); ifa_ref(ifa); /* in_ifaddrhead */ IN_IFADDR_WLOCK(); TAILQ_INSERT_TAIL(&V_in_ifaddrhead, ia, ia_link); @@ -586,7 +586,7 @@ in_control(struct socket *so, u_long cmd panic("in_control: unsupported ioctl"); } - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); /* Re-check that ia is still part of the list. */ TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa == &ia->ia_ifa) @@ -598,12 +598,12 @@ in_control(struct socket *so, u_long cmd * try it again for the next loop as there is no other exit * path between here and out. */ - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); error = EADDRNOTAVAIL; goto out; } TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); ifa_free(&ia->ia_ifa); /* if_addrhead */ IN_IFADDR_WLOCK(); @@ -753,7 +753,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } } - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET) continue; @@ -766,7 +766,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } if (ifa != NULL) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (ifa == NULL) return (EADDRNOTAVAIL); ia = (struct in_ifaddr *)ifa; @@ -1292,7 +1292,7 @@ in_purgemaddrs(struct ifnet *ifp) * We need to do this as IF_ADDR_LOCK() may be re-acquired * by code further down. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -1304,7 +1304,7 @@ in_purgemaddrs(struct ifnet *ifp) inm = (struct in_multi *)ifma->ifma_protospec; LIST_INSERT_HEAD(&purgeinms, inm, inm_link); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); LIST_FOREACH_SAFE(inm, &purgeinms, inm_link, tinm) { LIST_REMOVE(inm, inm_link); Modified: stable/9/sys/netinet/in_mcast.c ============================================================================== --- stable/9/sys/netinet/in_mcast.c Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/netinet/in_mcast.c Mon Mar 19 20:49:16 2012 (r233200) @@ -421,7 +421,7 @@ in_getmulti(struct ifnet *ifp, const str return (error); /* XXX ifma_protospec must be covered by IF_ADDR_LOCK */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); /* * If something other than netinet is occupying the link-layer @@ -445,11 +445,11 @@ in_getmulti(struct ifnet *ifp, const str #endif ++inm->inm_refcount; *pinm = inm; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (0); } - IF_ADDR_LOCK_ASSERT(ifp); + IF_ADDR_WLOCK_ASSERT(ifp); /* * A new in_multi record is needed; allocate and initialize it. @@ -461,7 +461,7 @@ in_getmulti(struct ifnet *ifp, const str inm = malloc(sizeof(*inm), M_IPMADDR, M_NOWAIT | M_ZERO); if (inm == NULL) { if_delmulti_ifma(ifma); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (ENOMEM); } inm->inm_addr = *group; @@ -484,7 +484,7 @@ in_getmulti(struct ifnet *ifp, const str *pinm = inm; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (0); } @@ -2796,7 +2796,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A IN_MULTI_LOCK(); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -2829,7 +2829,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); IN_MULTI_UNLOCK(); Modified: stable/9/sys/netinet/in_pcb.c ============================================================================== --- stable/9/sys/netinet/in_pcb.c Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/netinet/in_pcb.c Mon Mar 19 20:49:16 2012 (r233200) @@ -744,7 +744,7 @@ in_pcbladdr(struct inpcb *inp, struct in ifp = ia->ia_ifp; ifa_free(&ia->ia_ifa); ia = NULL; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sa = ifa->ifa_addr; @@ -758,10 +758,10 @@ in_pcbladdr(struct inpcb *inp, struct in } if (ia != NULL) { laddr->s_addr = ia->ia_addr.sin_addr.s_addr; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* 3. As a last resort return the 'default' jail address. */ error = prison_get_ip4(cred, laddr); @@ -803,7 +803,7 @@ in_pcbladdr(struct inpcb *inp, struct in */ ia = NULL; ifp = sro.ro_rt->rt_ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sa = ifa->ifa_addr; if (sa->sa_family != AF_INET) @@ -816,10 +816,10 @@ in_pcbladdr(struct inpcb *inp, struct in } if (ia != NULL) { laddr->s_addr = ia->ia_addr.sin_addr.s_addr; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* 3. As a last resort return the 'default' jail address. */ error = prison_get_ip4(cred, laddr); @@ -867,7 +867,7 @@ in_pcbladdr(struct inpcb *inp, struct in ifp = ia->ia_ifp; ifa_free(&ia->ia_ifa); ia = NULL; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sa = ifa->ifa_addr; @@ -882,10 +882,10 @@ in_pcbladdr(struct inpcb *inp, struct in } if (ia != NULL) { laddr->s_addr = ia->ia_addr.sin_addr.s_addr; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } /* 3. As a last resort return the 'default' jail address. */ Modified: stable/9/sys/netinet/in_var.h ============================================================================== --- stable/9/sys/netinet/in_var.h Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/netinet/in_var.h Mon Mar 19 20:49:16 2012 (r233200) @@ -393,9 +393,9 @@ inm_lookup(struct ifnet *ifp, const stru struct in_multi *inm; IN_MULTI_LOCK_ASSERT(); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); inm = inm_lookup_locked(ifp, ina); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (inm); } Modified: stable/9/sys/netinet/ip_carp.c ============================================================================== --- stable/9/sys/netinet/ip_carp.c Mon Mar 19 20:15:18 2012 (r233199) +++ stable/9/sys/netinet/ip_carp.c Mon Mar 19 20:49:16 2012 (r233200) @@ -292,7 +292,7 @@ carp_hmac_prepare(struct carp_softc *sc) found = 0; last = cur; cur.s_addr = 0xffffffff; - IF_ADDR_LOCK(SC2IFP(sc)); + IF_ADDR_RLOCK(SC2IFP(sc)); TAILQ_FOREACH(ifa, &SC2IFP(sc)->if_addrlist, ifa_list) { in.s_addr = ifatoia(ifa)->ia_addr.sin_addr.s_addr; if (ifa->ifa_addr->sa_family == AF_INET && @@ -302,7 +302,7 @@ carp_hmac_prepare(struct carp_softc *sc) found++; } } - IF_ADDR_UNLOCK(SC2IFP(sc)); + IF_ADDR_RUNLOCK(SC2IFP(sc)); if (found) SHA1Update(&sc->sc_sha1, (void *)&cur, sizeof(cur)); } while (found); @@ -313,7 +313,7 @@ carp_hmac_prepare(struct carp_softc *sc) found = 0; last6 = cur6; memset(&cur6, 0xff, sizeof(cur6)); - IF_ADDR_LOCK(SC2IFP(sc)); + IF_ADDR_RLOCK(SC2IFP(sc)); TAILQ_FOREACH(ifa, &SC2IFP(sc)->if_addrlist, ifa_list) { in6 = ifatoia6(ifa)->ia_addr.sin6_addr; if (IN6_IS_SCOPE_EMBED(&in6)) @@ -325,7 +325,7 @@ carp_hmac_prepare(struct carp_softc *sc) found++; } } - IF_ADDR_UNLOCK(SC2IFP(sc)); + IF_ADDR_RUNLOCK(SC2IFP(sc)); if (found) SHA1Update(&sc->sc_sha1, (void *)&cur6, sizeof(cur6)); } while (found); @@ -1168,7 +1168,7 @@ carp_addrcount(struct carp_if *cif, stru (SC2IFP(vh)->if_flags & IFF_UP) && (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING)) || (type == CARP_COUNT_MASTER && vh->sc_state == MASTER)) { - IF_ADDR_LOCK(SC2IFP(vh)); + IF_ADDR_RLOCK(SC2IFP(vh)); TAILQ_FOREACH(ifa, &SC2IFP(vh)->if_addrlist, ifa_list) { if (ifa->ifa_addr->sa_family == AF_INET && @@ -1176,7 +1176,7 @@ carp_addrcount(struct carp_if *cif, stru ifatoia(ifa)->ia_addr.sin_addr.s_addr) count++; } - IF_ADDR_UNLOCK(SC2IFP(vh)); + IF_ADDR_RUNLOCK(SC2IFP(vh)); } } return (count); @@ -1216,7 +1216,7 @@ carp_iamatch(struct ifnet *ifp, struct i TAILQ_FOREACH(vh, &cif->vhif_vrs, sc_list) { if ((SC2IFP(vh)->if_flags & IFF_UP) && (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING)) { - IF_ADDR_LOCK(SC2IFP(vh)); + IF_ADDR_RLOCK(SC2IFP(vh)); TAILQ_FOREACH(ifa, &SC2IFP(vh)->if_addrlist, ifa_list) { if (ifa->ifa_addr->sa_family == @@ -1227,11 +1227,11 @@ carp_iamatch(struct ifnet *ifp, struct i if (vh->sc_state == MASTER) { *enaddr = IF_LLADDR(vh->sc_ifp); - IF_ADDR_UNLOCK(SC2IFP(vh)); + IF_ADDR_RUNLOCK(SC2IFP(vh)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 20:49:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9719106566B; Mon, 19 Mar 2012 20:49:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D198C8FC0C; Mon, 19 Mar 2012 20:49:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JKngKA085668; Mon, 19 Mar 2012 20:49:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JKnghc085653; Mon, 19 Mar 2012 20:49:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203192049.q2JKnghc085653@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Mar 2012 20:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233201 - in stable/8/sys: i386/conf kern net netatalk netinet netinet6 netipx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 20:49:43 -0000 Author: jhb Date: Mon Mar 19 20:49:42 2012 New Revision: 233201 URL: http://svn.freebsd.org/changeset/base/233201 Log: MFC 229621: Convert all users of IF_ADDR_LOCK to use new locking macros that specify either a read lock or write lock. Modified: stable/8/sys/kern/kern_uuid.c stable/8/sys/net/if.c stable/8/sys/net/rtsock.c stable/8/sys/netatalk/aarp.c stable/8/sys/netatalk/at_control.c stable/8/sys/netinet/if_ether.c stable/8/sys/netinet/igmp.c stable/8/sys/netinet/in.c stable/8/sys/netinet/in_mcast.c stable/8/sys/netinet/in_pcb.c stable/8/sys/netinet/in_var.h stable/8/sys/netinet/ip_carp.c stable/8/sys/netinet/ip_icmp.c stable/8/sys/netinet/ip_input.c stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet6/icmp6.c stable/8/sys/netinet6/in6.c stable/8/sys/netinet6/in6_ifattach.c stable/8/sys/netinet6/in6_mcast.c stable/8/sys/netinet6/in6_var.h stable/8/sys/netinet6/ip6_input.c stable/8/sys/netinet6/mld6.c stable/8/sys/netinet6/nd6.c stable/8/sys/netinet6/nd6_rtr.c stable/8/sys/netipx/ipx.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/kern/kern_uuid.c ============================================================================== --- stable/8/sys/kern/kern_uuid.c Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/kern/kern_uuid.c Mon Mar 19 20:49:42 2012 (r233201) @@ -98,20 +98,20 @@ uuid_node(uint16_t *node) IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { /* Walk the address list */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sdl = (struct sockaddr_dl*)ifa->ifa_addr; if (sdl != NULL && sdl->sdl_family == AF_LINK && sdl->sdl_type == IFT_ETHER) { /* Got a MAC address. */ bcopy(LLADDR(sdl), node, UUID_NODE_LEN); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); IFNET_RUNLOCK_NOSLEEP(); CURVNET_RESTORE(); return; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } IFNET_RUNLOCK_NOSLEEP(); Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/net/if.c Mon Mar 19 20:49:42 2012 (r233201) @@ -835,10 +835,10 @@ if_purgemaddrs(struct ifnet *ifp) struct ifmultiaddr *ifma; struct ifmultiaddr *next; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) if_delmulti_locked(ifp, ifma, 1); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); } /* @@ -1182,10 +1182,10 @@ if_addgroup(struct ifnet *ifp, const cha ifgl->ifgl_group = ifg; ifgm->ifgm_ifp = ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_INSERT_TAIL(&ifg->ifg_members, ifgm, ifgm_next); TAILQ_INSERT_TAIL(&ifp->if_groups, ifgl, ifgl_next); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); IFNET_WUNLOCK(); @@ -1212,9 +1212,9 @@ if_delgroup(struct ifnet *ifp, const cha return (ENOENT); } - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_groups, ifgl, ifgl_next); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); TAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next) if (ifgm->ifgm_ifp == ifp) @@ -1255,9 +1255,9 @@ if_delgroups(struct ifnet *ifp) strlcpy(groupname, ifgl->ifgl_group->ifg_group, IFNAMSIZ); - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_groups, ifgl, ifgl_next); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); TAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next) if (ifgm->ifgm_ifp == ifp) @@ -1299,33 +1299,33 @@ if_getgroup(struct ifgroupreq *data, str struct ifgroupreq *ifgr = data; if (ifgr->ifgr_len == 0) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) ifgr->ifgr_len += sizeof(struct ifg_req); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (0); } len = ifgr->ifgr_len; ifgp = ifgr->ifgr_groups; /* XXX: wire */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) { if (len < sizeof(ifgrq)) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (EINVAL); } bzero(&ifgrq, sizeof ifgrq); strlcpy(ifgrq.ifgrq_group, ifgl->ifgl_group->ifg_group, sizeof(ifgrq.ifgrq_group)); if ((error = copyout(&ifgrq, ifgp, sizeof(struct ifg_req)))) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (error); } len -= sizeof(ifgrq); ifgp++; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (0); } @@ -1432,28 +1432,28 @@ void if_addr_rlock(struct ifnet *ifp) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); } void if_addr_runlock(struct ifnet *ifp) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } void if_maddr_rlock(struct ifnet *ifp) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); } void if_maddr_runlock(struct ifnet *ifp) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } /* @@ -1565,14 +1565,14 @@ ifa_ifwithaddr_internal(struct sockaddr IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) continue; if (sa_equal(addr, ifa->ifa_addr)) { if (getref) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } /* IP6 doesn't have broadcast */ @@ -1582,11 +1582,11 @@ ifa_ifwithaddr_internal(struct sockaddr sa_equal(ifa->ifa_broadaddr, addr)) { if (getref) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = NULL; done: @@ -1620,7 +1620,7 @@ ifa_ifwithbroadaddr(struct sockaddr *add IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) continue; @@ -1629,11 +1629,11 @@ ifa_ifwithbroadaddr(struct sockaddr *add ifa->ifa_broadaddr->sa_len != 0 && sa_equal(ifa->ifa_broadaddr, addr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = NULL; done: @@ -1655,18 +1655,18 @@ ifa_ifwithdstaddr(struct sockaddr *addr) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0) continue; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) continue; if (ifa->ifa_dstaddr != NULL && sa_equal(addr, ifa->ifa_dstaddr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = NULL; done: @@ -1700,12 +1700,12 @@ ifa_ifwithnet(struct sockaddr *addr, int /* * Scan though each interface, looking for ones that have addresses * in this address family. Maintain a reference on ifa_maybe once - * we find one, as we release the IF_ADDR_LOCK() that kept it stable + * we find one, as we release the IF_ADDR_RLOCK() that kept it stable * when we move onto the next interface. */ IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { char *cp, *cp2, *cp3; @@ -1724,7 +1724,7 @@ next: continue; if (ifa->ifa_dstaddr != NULL && sa_equal(addr, ifa->ifa_dstaddr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } else { @@ -1735,7 +1735,7 @@ next: continue; if (ifa->ifa_claim_addr) { if ((*ifa->ifa_claim_addr)(ifa, addr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } continue; @@ -1775,7 +1775,7 @@ next: continue; } } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = ifa_maybe; ifa_maybe = NULL; @@ -1801,7 +1801,7 @@ ifaof_ifpforaddr(struct sockaddr *addr, if (af >= AF_MAX) return (NULL); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != af) continue; @@ -1833,7 +1833,7 @@ ifaof_ifpforaddr(struct sockaddr *addr, done: if (ifa != NULL) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (ifa); } @@ -2410,9 +2410,9 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, * lose a race while we check if the membership * already exists. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); ifma = if_findmulti(ifp, &ifr->ifr_addr); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (ifma != NULL) error = EADDRINUSE; else @@ -2828,7 +2828,7 @@ again: } addrs = 0; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa = ifa->ifa_addr; @@ -2860,7 +2860,7 @@ again: if (!sbuf_overflowed(sb)) valid_len = sbuf_len(sb); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (addrs == 0) { bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr)); sbuf_bcat(sb, &ifr, sizeof(ifr)); @@ -3018,13 +3018,13 @@ if_addmulti(struct ifnet *ifp, struct so * If the address is already present, return a new reference to it; * otherwise, allocate storage and set up a new address. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); ifma = if_findmulti(ifp, sa); if (ifma != NULL) { ifma->ifma_refcount++; if (retifma != NULL) *retifma = ifma; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (0); } @@ -3090,7 +3090,7 @@ if_addmulti(struct ifnet *ifp, struct so * pointer is still valid. */ rt_newmaddrmsg(RTM_NEWMADDR, ifma); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); /* * We are certain we have added something, so call down to the @@ -3110,7 +3110,7 @@ free_llsa_out: free(llsa, M_IFMADDR); unlock_out: - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (error); } @@ -3144,12 +3144,12 @@ if_delmulti(struct ifnet *ifp, struct so if (ifp == NULL) return (ENOENT); - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); lastref = 0; ifma = if_findmulti(ifp, sa); if (ifma != NULL) lastref = if_delmulti_locked(ifp, ifma, 0); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); if (ifma == NULL) return (ENOENT); @@ -3171,10 +3171,10 @@ if_delallmulti(struct ifnet *ifp) struct ifmultiaddr *ifma; struct ifmultiaddr *next; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) if_delmulti_locked(ifp, ifma, 0); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); } /* @@ -3211,7 +3211,7 @@ if_delmulti_ifma(struct ifmultiaddr *ifm * If and only if the ifnet instance exists: Acquire the address lock. */ if (ifp != NULL) - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); lastref = if_delmulti_locked(ifp, ifma, 0); @@ -3221,7 +3221,7 @@ if_delmulti_ifma(struct ifmultiaddr *ifm * Release the address lock. * If the group was left: update the hardware hash filter. */ - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); if (lastref && ifp->if_ioctl != NULL) { (void)(*ifp->if_ioctl)(ifp, SIOCDELMULTI, 0); } @@ -3243,7 +3243,7 @@ if_delmulti_locked(struct ifnet *ifp, st if (ifp != NULL && ifma->ifma_ifp != NULL) { KASSERT(ifma->ifma_ifp == ifp, ("%s: inconsistent ifp %p", __func__, ifp)); - IF_ADDR_LOCK_ASSERT(ifp); + IF_ADDR_WLOCK_ASSERT(ifp); } ifp = ifma->ifma_ifp; @@ -3316,14 +3316,14 @@ if_setlladdr(struct ifnet *ifp, const u_ struct ifaddr *ifa; struct ifreq ifr; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); ifa = ifp->if_addr; if (ifa == NULL) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (EINVAL); } ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); sdl = (struct sockaddr_dl *)ifa->ifa_addr; if (sdl == NULL) { ifa_free(ifa); Modified: stable/8/sys/net/rtsock.c ============================================================================== --- stable/8/sys/net/rtsock.c Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/net/rtsock.c Mon Mar 19 20:49:42 2012 (r233201) @@ -479,7 +479,7 @@ rtm_get_jailed(struct rt_addrinfo *info, * Try to find an address on the given outgoing interface * that belongs to the jail. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa; sa = ifa->ifa_addr; @@ -491,7 +491,7 @@ rtm_get_jailed(struct rt_addrinfo *info, break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (!found) { /* * As a last resort return the 'default' jail address. @@ -521,7 +521,7 @@ rtm_get_jailed(struct rt_addrinfo *info, * Try to find an address on the given outgoing interface * that belongs to the jail. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa; sa = ifa->ifa_addr; @@ -534,7 +534,7 @@ rtm_get_jailed(struct rt_addrinfo *info, break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (!found) { /* * As a last resort return the 'default' jail address. @@ -1708,7 +1708,7 @@ sysctl_iflist(int af, struct walkarg *w) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (w->w_arg && w->w_arg != ifp->if_index) continue; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); ifa = ifp->if_addr; info.rti_info[RTAX_IFP] = ifa->ifa_addr; len = rt_msg2(RTM_IFINFO, &info, NULL, w); @@ -1742,13 +1742,13 @@ sysctl_iflist(int af, struct walkarg *w) goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); info.rti_info[RTAX_IFA] = info.rti_info[RTAX_NETMASK] = info.rti_info[RTAX_BRD] = NULL; } done: if (ifp != NULL) - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); IFNET_RUNLOCK(); return (error); } @@ -1769,7 +1769,7 @@ sysctl_ifmalist(int af, struct walkarg * continue; ifa = ifp->if_addr; info.rti_info[RTAX_IFP] = ifa ? ifa->ifa_addr : NULL; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (af && af != ifma->ifma_addr->sa_family) continue; @@ -1790,12 +1790,12 @@ sysctl_ifmalist(int af, struct walkarg * ifmam->ifmam_addrs = info.rti_addrs; error = SYSCTL_OUT(w->w_req, w->w_tmem, len); if (error) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } done: IFNET_RUNLOCK(); Modified: stable/8/sys/netatalk/aarp.c ============================================================================== --- stable/8/sys/netatalk/aarp.c Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/netatalk/aarp.c Mon Mar 19 20:49:42 2012 (r233201) @@ -406,7 +406,7 @@ at_aarpinput(struct ifnet *ifp, struct m * Since we don't know the net, we just look for the first * phase 1 address on the interface. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); for (aa = (struct at_ifaddr *)TAILQ_FIRST(&ifp->if_addrhead); aa; aa = (struct at_ifaddr *)aa->aa_ifa.ifa_link.tqe_next) { @@ -416,12 +416,12 @@ at_aarpinput(struct ifnet *ifp, struct m } } if (aa == NULL) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); m_freem(m); return; } ifa_ref(&aa->aa_ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); tpa.s_net = spa.s_net = AA_SAT(aa)->sat_addr.s_net; } Modified: stable/8/sys/netatalk/at_control.c ============================================================================== --- stable/8/sys/netatalk/at_control.c Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/netatalk/at_control.c Mon Mar 19 20:49:42 2012 (r233201) @@ -254,9 +254,9 @@ at_control(struct socket *so, u_long cmd */ aa->aa_ifp = ifp; ifa_ref(&aa->aa_ifa); /* if_addrhead */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); } else { /* * If we DID find one then we clobber any routes @@ -357,9 +357,9 @@ at_control(struct socket *so, u_long cmd * remove the ifaddr from the interface */ ifa = (struct ifaddr *)aa; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); ifa_free(ifa); /* if_addrhead */ /* Modified: stable/8/sys/netinet/if_ether.c ============================================================================== --- stable/8/sys/netinet/if_ether.c Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/netinet/if_ether.c Mon Mar 19 20:49:42 2012 (r233201) @@ -603,15 +603,15 @@ in_arpinput(struct mbuf *m) * No match, use the first inet address on the receive interface * as a dummy address for the rest of the function. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (ifa->ifa_addr->sa_family == AF_INET) { ia = ifatoia(ifa); ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto match; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* * If bridging, fall back to using any inet address. Modified: stable/8/sys/netinet/igmp.c ============================================================================== --- stable/8/sys/netinet/igmp.c Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/netinet/igmp.c Mon Mar 19 20:49:42 2012 (r233201) @@ -617,7 +617,7 @@ igmp_ifdetach(struct ifnet *ifp) igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp; if (igi->igi_version == IGMP_VERSION_3) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -633,7 +633,7 @@ igmp_ifdetach(struct ifnet *ifp) } inm_clear_recorded(inm); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* * Free the in_multi reference(s) for this IGMP lifecycle. */ @@ -750,7 +750,7 @@ igmp_input_v1_query(struct ifnet *ifp, c * for the interface on which the query arrived, * except those which are already running. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -778,7 +778,7 @@ igmp_input_v1_query(struct ifnet *ifp, c break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); out_locked: IGMP_UNLOCK(); @@ -851,7 +851,7 @@ igmp_input_v2_query(struct ifnet *ifp, c */ CTR2(KTR_IGMPV3, "process v2 general query on ifp %p(%s)", ifp, ifp->if_xname); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -859,7 +859,7 @@ igmp_input_v2_query(struct ifnet *ifp, c inm = (struct in_multi *)ifma->ifma_protospec; igmp_v2_update_group(inm, timer); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } else { /* * Group-specific IGMPv2 query, we need only @@ -1707,7 +1707,7 @@ igmp_fasttimo_vnet(void) IFQ_SET_MAXLEN(&scq, IGMP_MAX_STATE_CHANGE_PACKETS); } - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -1725,7 +1725,7 @@ igmp_fasttimo_vnet(void) break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (igi->igi_version == IGMP_VERSION_3) { struct in_multi *tinm; @@ -2022,7 +2022,7 @@ igmp_v3_cancel_link_timers(struct igmp_i * for all memberships scoped to this link. */ ifp = igi->igi_ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -2067,7 +2067,7 @@ igmp_v3_cancel_link_timers(struct igmp_i inm->inm_timer = 0; _IF_DRAIN(&inm->inm_scq); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); SLIST_FOREACH_SAFE(inm, &igi->igi_relinmhead, inm_nrele, tinm) { SLIST_REMOVE_HEAD(&igi->igi_relinmhead, inm_nrele); inm_release_locked(inm); @@ -3330,7 +3330,7 @@ igmp_v3_dispatch_general_query(struct ig ifp = igi->igi_ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -3361,7 +3361,7 @@ igmp_v3_dispatch_general_query(struct ig break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); loop = (igi->igi_flags & IGIF_LOOPBACK) ? 1 : 0; igmp_dispatch_queue(&igi->igi_gq, IGMP_MAX_RESPONSE_BURST, loop); Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/netinet/in.c Mon Mar 19 20:49:42 2012 (r233201) @@ -342,7 +342,7 @@ in_control(struct socket *so, u_long cmd ifa_ref(&ia->ia_ifa); IN_IFADDR_RUNLOCK(); if (ia == NULL) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { iap = ifatoia(ifa); if (iap->ia_addr.sin_family == AF_INET) { @@ -356,7 +356,7 @@ in_control(struct socket *so, u_long cmd } if (ia != NULL) ifa_ref(&ia->ia_ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } if (ia == NULL) iaIsFirst = 1; @@ -420,9 +420,9 @@ in_control(struct socket *so, u_long cmd ia->ia_ifp = ifp; ifa_ref(ifa); /* if_addrhead */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); ifa_ref(ifa); /* in_ifaddrhead */ IN_IFADDR_WLOCK(); TAILQ_INSERT_TAIL(&V_in_ifaddrhead, ia, ia_link); @@ -602,7 +602,7 @@ in_control(struct socket *so, u_long cmd panic("in_control: unsupported ioctl"); } - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); /* Re-check that ia is still part of the list. */ TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa == &ia->ia_ifa) @@ -614,12 +614,12 @@ in_control(struct socket *so, u_long cmd * try it again for the next loop as there is no other exit * path between here and out. */ - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); error = EADDRNOTAVAIL; goto out; } TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); ifa_free(&ia->ia_ifa); /* if_addrhead */ IN_IFADDR_WLOCK(); @@ -769,7 +769,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } } - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET) continue; @@ -782,7 +782,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } if (ifa != NULL) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (ifa == NULL) return (EADDRNOTAVAIL); ia = (struct in_ifaddr *)ifa; @@ -1310,7 +1310,7 @@ in_purgemaddrs(struct ifnet *ifp) * We need to do this as IF_ADDR_LOCK() may be re-acquired * by code further down. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -1322,7 +1322,7 @@ in_purgemaddrs(struct ifnet *ifp) inm = (struct in_multi *)ifma->ifma_protospec; LIST_INSERT_HEAD(&purgeinms, inm, inm_link); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); LIST_FOREACH_SAFE(inm, &purgeinms, inm_link, tinm) { LIST_REMOVE(inm, inm_link); Modified: stable/8/sys/netinet/in_mcast.c ============================================================================== --- stable/8/sys/netinet/in_mcast.c Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/netinet/in_mcast.c Mon Mar 19 20:49:42 2012 (r233201) @@ -421,7 +421,7 @@ in_getmulti(struct ifnet *ifp, const str return (error); /* XXX ifma_protospec must be covered by IF_ADDR_LOCK */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); /* * If something other than netinet is occupying the link-layer @@ -445,11 +445,11 @@ in_getmulti(struct ifnet *ifp, const str #endif ++inm->inm_refcount; *pinm = inm; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (0); } - IF_ADDR_LOCK_ASSERT(ifp); + IF_ADDR_WLOCK_ASSERT(ifp); /* * A new in_multi record is needed; allocate and initialize it. @@ -461,7 +461,7 @@ in_getmulti(struct ifnet *ifp, const str inm = malloc(sizeof(*inm), M_IPMADDR, M_NOWAIT | M_ZERO); if (inm == NULL) { if_delmulti_ifma(ifma); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (ENOMEM); } inm->inm_addr = *group; @@ -484,7 +484,7 @@ in_getmulti(struct ifnet *ifp, const str *pinm = inm; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (0); } @@ -2775,7 +2775,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A IN_MULTI_LOCK(); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -2808,7 +2808,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); IN_MULTI_UNLOCK(); Modified: stable/8/sys/netinet/in_pcb.c ============================================================================== --- stable/8/sys/netinet/in_pcb.c Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/netinet/in_pcb.c Mon Mar 19 20:49:42 2012 (r233201) @@ -661,7 +661,7 @@ in_pcbladdr(struct inpcb *inp, struct in ifp = ia->ia_ifp; ifa_free(&ia->ia_ifa); ia = NULL; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sa = ifa->ifa_addr; @@ -675,10 +675,10 @@ in_pcbladdr(struct inpcb *inp, struct in } if (ia != NULL) { laddr->s_addr = ia->ia_addr.sin_addr.s_addr; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* 3. As a last resort return the 'default' jail address. */ error = prison_get_ip4(cred, laddr); @@ -720,7 +720,7 @@ in_pcbladdr(struct inpcb *inp, struct in */ ia = NULL; ifp = sro.ro_rt->rt_ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sa = ifa->ifa_addr; if (sa->sa_family != AF_INET) @@ -733,10 +733,10 @@ in_pcbladdr(struct inpcb *inp, struct in } if (ia != NULL) { laddr->s_addr = ia->ia_addr.sin_addr.s_addr; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* 3. As a last resort return the 'default' jail address. */ error = prison_get_ip4(cred, laddr); @@ -784,7 +784,7 @@ in_pcbladdr(struct inpcb *inp, struct in ifp = ia->ia_ifp; ifa_free(&ia->ia_ifa); ia = NULL; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sa = ifa->ifa_addr; @@ -799,10 +799,10 @@ in_pcbladdr(struct inpcb *inp, struct in } if (ia != NULL) { laddr->s_addr = ia->ia_addr.sin_addr.s_addr; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } /* 3. As a last resort return the 'default' jail address. */ Modified: stable/8/sys/netinet/in_var.h ============================================================================== --- stable/8/sys/netinet/in_var.h Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/netinet/in_var.h Mon Mar 19 20:49:42 2012 (r233201) @@ -396,9 +396,9 @@ inm_lookup(struct ifnet *ifp, const stru struct in_multi *inm; IN_MULTI_LOCK_ASSERT(); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); inm = inm_lookup_locked(ifp, ina); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (inm); } Modified: stable/8/sys/netinet/ip_carp.c ============================================================================== --- stable/8/sys/netinet/ip_carp.c Mon Mar 19 20:49:16 2012 (r233200) +++ stable/8/sys/netinet/ip_carp.c Mon Mar 19 20:49:42 2012 (r233201) @@ -279,7 +279,7 @@ carp_hmac_prepare(struct carp_softc *sc) found = 0; last = cur; cur.s_addr = 0xffffffff; - IF_ADDR_LOCK(SC2IFP(sc)); + IF_ADDR_RLOCK(SC2IFP(sc)); TAILQ_FOREACH(ifa, &SC2IFP(sc)->if_addrlist, ifa_list) { in.s_addr = ifatoia(ifa)->ia_addr.sin_addr.s_addr; if (ifa->ifa_addr->sa_family == AF_INET && @@ -289,7 +289,7 @@ carp_hmac_prepare(struct carp_softc *sc) found++; } } - IF_ADDR_UNLOCK(SC2IFP(sc)); + IF_ADDR_RUNLOCK(SC2IFP(sc)); if (found) SHA1Update(&sc->sc_sha1, (void *)&cur, sizeof(cur)); } while (found); @@ -300,7 +300,7 @@ carp_hmac_prepare(struct carp_softc *sc) found = 0; last6 = cur6; memset(&cur6, 0xff, sizeof(cur6)); - IF_ADDR_LOCK(SC2IFP(sc)); + IF_ADDR_RLOCK(SC2IFP(sc)); TAILQ_FOREACH(ifa, &SC2IFP(sc)->if_addrlist, ifa_list) { in6 = ifatoia6(ifa)->ia_addr.sin6_addr; if (IN6_IS_SCOPE_EMBED(&in6)) @@ -312,7 +312,7 @@ carp_hmac_prepare(struct carp_softc *sc) found++; } } - IF_ADDR_UNLOCK(SC2IFP(sc)); + IF_ADDR_RUNLOCK(SC2IFP(sc)); if (found) SHA1Update(&sc->sc_sha1, (void *)&cur6, sizeof(cur6)); } while (found); @@ -1138,7 +1138,7 @@ carp_addrcount(struct carp_if *cif, stru (SC2IFP(vh)->if_flags & IFF_UP) && (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING)) || (type == CARP_COUNT_MASTER && vh->sc_state == MASTER)) { - IF_ADDR_LOCK(SC2IFP(vh)); + IF_ADDR_RLOCK(SC2IFP(vh)); TAILQ_FOREACH(ifa, &SC2IFP(vh)->if_addrlist, ifa_list) { if (ifa->ifa_addr->sa_family == AF_INET && @@ -1146,7 +1146,7 @@ carp_addrcount(struct carp_if *cif, stru ifatoia(ifa)->ia_addr.sin_addr.s_addr) count++; } - IF_ADDR_UNLOCK(SC2IFP(vh)); + IF_ADDR_RUNLOCK(SC2IFP(vh)); } } return (count); @@ -1186,7 +1186,7 @@ carp_iamatch(struct ifnet *ifp, struct i TAILQ_FOREACH(vh, &cif->vhif_vrs, sc_list) { if ((SC2IFP(vh)->if_flags & IFF_UP) && (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING)) { - IF_ADDR_LOCK(SC2IFP(vh)); + IF_ADDR_RLOCK(SC2IFP(vh)); TAILQ_FOREACH(ifa, &SC2IFP(vh)->if_addrlist, ifa_list) { if (ifa->ifa_addr->sa_family == @@ -1197,11 +1197,11 @@ carp_iamatch(struct ifnet *ifp, struct i if (vh->sc_state == MASTER) { *enaddr = IF_LLADDR(vh->sc_ifp); - IF_ADDR_UNLOCK(SC2IFP(vh)); + IF_ADDR_RUNLOCK(SC2IFP(vh)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 20:52:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C60CD106564A; Mon, 19 Mar 2012 20:52:10 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 74A398FC14; Mon, 19 Mar 2012 20:52:10 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 78DF49C36; Mon, 19 Mar 2012 20:52:09 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 5AA1186AC; Mon, 19 Mar 2012 21:52:09 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin References: <201203190041.q2J0femX042684@svn.freebsd.org> <201203191359.34178.jhb@freebsd.org> Date: Mon, 19 Mar 2012 21:52:09 +0100 In-Reply-To: <201203191359.34178.jhb@freebsd.org> (John Baldwin's message of "Mon, 19 Mar 2012 13:59:33 -0400") Message-ID: <86bons71qe.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler , Colin Percival Subject: Re: svn commit: r233136 - in head/secure: usr.bin/ssh usr.sbin/sshd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 20:52:10 -0000 John Baldwin writes: > .ifdef LOCALBASE > CFLAGS+=3D /* blah bblah */ > .endif Agreed. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 21:07:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A710106566B; Mon, 19 Mar 2012 21:07:24 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2B0158FC0A; Mon, 19 Mar 2012 21:07:22 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so6469653bkc.13 for ; Mon, 19 Mar 2012 14:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=CnwXKm9ILhDVO20KWKbcpJr6izV/YuPJH18VYQUZM1M=; b=T+5nHtdgXZl+TYDdK4ZoYGOx/FFBxr2bwSj2RfQBsvV8qrzAD0pohYhK/pIgvw1Lbh 9YOrVXf96C3NVkdyJUqNY93b3OlhApll5PdO5gKyehkXGS4mxAr9CXefYaJ9rLCItNhV GY7cbGL7tvBx+kzQVEO5Is4Ubsn+J/p5eqAgjiLBd4gkC0IG+xYgfrj9S9Pawp46TqAK mMP+/ReveqPPoadxhg9OfAPaEwSTZw7altmaOGjTqxlUVh2aQCKyN/Eemoy4x8t9vwdq aeg6i+KsNsVm0NWZR/DplUs/PMbcbyRfhC7Tk8id0b1hFsbhUAi7dmji2A6OIFDIU0Sn fIRQ== Received: by 10.204.156.217 with SMTP id y25mr5208821bkw.36.1332191235713; Mon, 19 Mar 2012 14:07:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.202.142 with HTTP; Mon, 19 Mar 2012 14:06:45 -0700 (PDT) In-Reply-To: <4F678B03.8050307@FreeBSD.org> References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <20120317162754.I1530@besplex.bde.org> <4F678B03.8050307@FreeBSD.org> From: Chris Rees Date: Mon, 19 Mar 2012 21:06:45 +0000 Message-ID: To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 21:07:24 -0000 On 19 March 2012 19:37, Dimitry Andric wrote: > On 2012-03-19 08:21, Chris Rees wrote: >> On 17 Mar 2012 05:40, "Bruce Evans" > wrote: >>> >>> On Fri, 16 Mar 2012, Dimitry Andric wrote: >>> >>>> Log: >>>> =A0Change the style of share/mk/bsd.sys.mk to that= of the other bsd.*.mk >>>> =A0files, and style.Makefile(5), where applicable. =A0While here, upda= te the >>>> =A0link to the gcc warning documentation. >>> >>> >>> Thanks. =A0I rather liked the "^.* foo" style for making ifdefs less >>> unreadable, but it didn't look like it was written here, and it is >>> a sign of other problems that so many nested ifdefs are used. =A0It >>> only used a single space of each level of indentation, so the >>> indentation was still hard too see. >>> >>> The "other bsd.*.mk" files don't include bsd.cpu.mk = . =A0This still uses >>> the "^. *foo" style (and is now the only *.mk file one that does this). >>> For assignments, it mostly uses a different unusual style -- just the >>> normal C style of a single space before and after '=3D' (or '+=3D'). = =A0Weird >>> formattings of assignments are harder to grep for than weird formatting= s >>> of ".foo", so I didn't try looking for them all. >> >> Indented .ifs etc are used (inconsistently) in bsd.port.mk et al, and can make a huge difference to readability; make is such = a messy language that multiple levels are often needed. > > Well, the issue with Makefiles is that you cannot indent the actual > statements. =A0So even if you sort-of-indent the directives, by adding > spaces between the initial dot and the directive name, you still have a > very messy left margin. :) > > It would be much nicer to be able to write: > > .if defined(FOO) > =A0.if defined(BAR) > =A0 =A0CFLAGS+=3D =A0 =A0-DFOO_BAR > =A0.endif > .endif > > But I guess that would require some overhaul in make. =A0It doesn't grok > such indentations now. That's right, lines starting with whitespace *must* be shell commands-- it'll be some overhaul that changes that... > >> Perhaps we should try to agree a standard on them, perhaps two spaces? = =A0It's a shame to be stripping them out. > > Two spaces sounds reasonable enough. =A0Though indent size is probably th= e > ultimate bikeshed... ;) True-- also whitespace-only changes are probably a bad idea for merges. I'm not suggesting changing anything existing, but I'd sure like to keep the whitespace while it's already there ;) Chris From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 21:09:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 468BD106566C; Mon, 19 Mar 2012 21:09:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31EA88FC16; Mon, 19 Mar 2012 21:09:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JL9DTi086337; Mon, 19 Mar 2012 21:09:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JL9Dkl086335; Mon, 19 Mar 2012 21:09:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203192109.q2JL9Dkl086335@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Mar 2012 21:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233202 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 21:09:13 -0000 Author: jhb Date: Mon Mar 19 21:09:12 2012 New Revision: 233202 URL: http://svn.freebsd.org/changeset/base/233202 Log: Retire the IF_ADDR_LOCK() and IF_ADDR_UNLOCK() compat macros from HEAD. The new [RW]LOCK macros are merged back to 8.x so should be suitable for new code in HEAD even if it is to be MFC'd. Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Mar 19 20:49:42 2012 (r233201) +++ head/sys/net/if_var.h Mon Mar 19 21:09:12 2012 (r233202) @@ -253,9 +253,6 @@ typedef void if_init_f_t(void *); #define IF_ADDR_RUNLOCK(if) rw_runlock(&(if)->if_addr_lock) #define IF_ADDR_LOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_LOCKED) #define IF_ADDR_WLOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_WLOCKED) -/* XXX: Compat. */ -#define IF_ADDR_LOCK(if) IF_ADDR_WLOCK(if) -#define IF_ADDR_UNLOCK(if) IF_ADDR_WUNLOCK(if) /* * Function variations on locking macros intended to be used by loadable From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 21:24:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E193C1065670; Mon, 19 Mar 2012 21:24:50 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBF408FC17; Mon, 19 Mar 2012 21:24:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JLOoEY086852; Mon, 19 Mar 2012 21:24:50 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JLOoZQ086847; Mon, 19 Mar 2012 21:24:50 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203192124.q2JLOoZQ086847@svn.freebsd.org> From: Tijl Coosemans Date: Mon, 19 Mar 2012 21:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233203 - in head/sys: amd64/include i386/include ia64/ia32 x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 21:24:51 -0000 Author: tijl Date: Mon Mar 19 21:24:50 2012 New Revision: 233203 URL: http://svn.freebsd.org/changeset/base/233203 Log: Move userland bits (and some common kernel bits) from amd64 and i386 segments.h to a new x86 segments.h. Add __packed attribute to some structs (just to be sure). Also make it clear that i386 GDT and LDT entries are used in ia64 code. Added: head/sys/x86/include/segments.h (contents, props changed) Modified: head/sys/amd64/include/segments.h head/sys/i386/include/segments.h head/sys/ia64/ia32/ia32_signal.c Modified: head/sys/amd64/include/segments.h ============================================================================== --- head/sys/amd64/include/segments.h Mon Mar 19 21:09:12 2012 (r233202) +++ head/sys/amd64/include/segments.h Mon Mar 19 21:24:50 2012 (r233203) @@ -41,45 +41,7 @@ * AMD64 Segmentation Data Structures and definitions */ -/* - * Selectors - */ - -#define SEL_RPL_MASK 3 /* requester priv level */ -#define ISPL(s) ((s)&3) /* what is the priority level of a selector */ -#define SEL_KPL 0 /* kernel priority level */ -#define SEL_UPL 3 /* user priority level */ -#define ISLDT(s) ((s)&SEL_LDT) /* is it local or global */ -#define SEL_LDT 4 /* local descriptor table */ -#define IDXSEL(s) (((s)>>3) & 0x1fff) /* index of selector */ -#define LSEL(s,r) (((s)<<3) | SEL_LDT | r) /* a local selector */ -#define GSEL(s,r) (((s)<<3) | r) /* a global selector */ - -/* - * User segment descriptors (%cs, %ds etc for compatability apps. 64 bit wide) - * For long-mode apps, %cs only has the conforming bit in sd_type, the sd_dpl, - * sd_p, sd_l and sd_def32 which must be zero). %ds only has sd_p. - */ -struct user_segment_descriptor { - u_int64_t sd_lolimit:16; /* segment extent (lsb) */ - u_int64_t sd_lobase:24; /* segment base address (lsb) */ - u_int64_t sd_type:5; /* segment type */ - u_int64_t sd_dpl:2; /* segment descriptor priority level */ - u_int64_t sd_p:1; /* segment descriptor present */ - u_int64_t sd_hilimit:4; /* segment extent (msb) */ - u_int64_t sd_xx:1; /* unused */ - u_int64_t sd_long:1; /* long mode (cs only) */ - u_int64_t sd_def32:1; /* default 32 vs 16 bit size */ - u_int64_t sd_gran:1; /* limit granularity (byte/page units)*/ - u_int64_t sd_hibase:8; /* segment base address (msb) */ -} __packed; - -#define USD_GETBASE(sd) (((sd)->sd_lobase) | (sd)->sd_hibase << 24) -#define USD_SETBASE(sd, b) (sd)->sd_lobase = (b); \ - (sd)->sd_hibase = ((b) >> 24); -#define USD_GETLIMIT(sd) (((sd)->sd_lolimit) | (sd)->sd_hilimit << 16) -#define USD_SETLIMIT(sd, l) (sd)->sd_lolimit = (l); \ - (sd)->sd_hilimit = ((l) >> 16); +#include /* * System segment descriptors (128 bit wide) @@ -100,66 +62,6 @@ struct system_segment_descriptor { } __packed; /* - * Gate descriptors (e.g. indirect descriptors, trap, interrupt etc. 128 bit) - * Only interrupt and trap gates have gd_ist. - */ -struct gate_descriptor { - u_int64_t gd_looffset:16; /* gate offset (lsb) */ - u_int64_t gd_selector:16; /* gate segment selector */ - u_int64_t gd_ist:3; /* IST table index */ - u_int64_t gd_xx:5; /* unused */ - u_int64_t gd_type:5; /* segment type */ - u_int64_t gd_dpl:2; /* segment descriptor priority level */ - u_int64_t gd_p:1; /* segment descriptor present */ - u_int64_t gd_hioffset:48 __packed; /* gate offset (msb) */ - u_int64_t sd_xx1:32; -} __packed; - -/* - * Generic descriptor - */ -union descriptor { - struct user_segment_descriptor sd; - struct gate_descriptor gd; -}; - - /* system segments and gate types */ -#define SDT_SYSNULL 0 /* system null */ -#define SDT_SYS286TSS 1 /* system 286 TSS available */ -#define SDT_SYSLDT 2 /* system 64 bit local descriptor table */ -#define SDT_SYS286BSY 3 /* system 286 TSS busy */ -#define SDT_SYS286CGT 4 /* system 286 call gate */ -#define SDT_SYSTASKGT 5 /* system task gate */ -#define SDT_SYS286IGT 6 /* system 286 interrupt gate */ -#define SDT_SYS286TGT 7 /* system 286 trap gate */ -#define SDT_SYSNULL2 8 /* system null again */ -#define SDT_SYSTSS 9 /* system available 64 bit TSS */ -#define SDT_SYSNULL3 10 /* system null again */ -#define SDT_SYSBSY 11 /* system busy 64 bit TSS */ -#define SDT_SYSCGT 12 /* system 64 bit call gate */ -#define SDT_SYSNULL4 13 /* system null again */ -#define SDT_SYSIGT 14 /* system 64 bit interrupt gate */ -#define SDT_SYSTGT 15 /* system 64 bit trap gate */ - - /* memory segment types */ -#define SDT_MEMRO 16 /* memory read only */ -#define SDT_MEMROA 17 /* memory read only accessed */ -#define SDT_MEMRW 18 /* memory read write */ -#define SDT_MEMRWA 19 /* memory read write accessed */ -#define SDT_MEMROD 20 /* memory read only expand dwn limit */ -#define SDT_MEMRODA 21 /* memory read only expand dwn limit accessed */ -#define SDT_MEMRWD 22 /* memory read write expand dwn limit */ -#define SDT_MEMRWDA 23 /* memory read write expand dwn limit accessed */ -#define SDT_MEME 24 /* memory execute only */ -#define SDT_MEMEA 25 /* memory execute only accessed */ -#define SDT_MEMER 26 /* memory execute read */ -#define SDT_MEMERA 27 /* memory execute read accessed */ -#define SDT_MEMEC 28 /* memory execute only conforming */ -#define SDT_MEMEAC 29 /* memory execute only accessed conforming */ -#define SDT_MEMERC 30 /* memory execute read conforming */ -#define SDT_MEMERAC 31 /* memory execute read accessed conforming */ - -/* * Software definitions are in this convenient format, * which are translated into inconvenient segment descriptors * when needed to be used by the 386 hardware @@ -184,56 +86,6 @@ struct region_descriptor { unsigned long rd_base:64 __packed; /* base address */ } __packed; -/* - * Size of IDT table - */ -#define NIDT 256 /* 32 reserved, 16 h/w, 0 s/w, linux's 0x80 */ -#define NRSVIDT 32 /* reserved entries for cpu exceptions */ - -/* - * Entries in the Interrupt Descriptor Table (IDT) - */ -#define IDT_DE 0 /* #DE: Divide Error */ -#define IDT_DB 1 /* #DB: Debug */ -#define IDT_NMI 2 /* Nonmaskable External Interrupt */ -#define IDT_BP 3 /* #BP: Breakpoint */ -#define IDT_OF 4 /* #OF: Overflow */ -#define IDT_BR 5 /* #BR: Bound Range Exceeded */ -#define IDT_UD 6 /* #UD: Undefined/Invalid Opcode */ -#define IDT_NM 7 /* #NM: No Math Coprocessor */ -#define IDT_DF 8 /* #DF: Double Fault */ -#define IDT_FPUGP 9 /* Coprocessor Segment Overrun */ -#define IDT_TS 10 /* #TS: Invalid TSS */ -#define IDT_NP 11 /* #NP: Segment Not Present */ -#define IDT_SS 12 /* #SS: Stack Segment Fault */ -#define IDT_GP 13 /* #GP: General Protection Fault */ -#define IDT_PF 14 /* #PF: Page Fault */ -#define IDT_MF 16 /* #MF: FPU Floating-Point Error */ -#define IDT_AC 17 /* #AC: Alignment Check */ -#define IDT_MC 18 /* #MC: Machine Check */ -#define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ -#define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ -#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ -#define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ - -/* - * Entries in the Global Descriptor Table (GDT) - */ -#define GNULL_SEL 0 /* Null Descriptor */ -#define GNULL2_SEL 1 /* Null Descriptor */ -#define GUFS32_SEL 2 /* User 32 bit %fs Descriptor */ -#define GUGS32_SEL 3 /* User 32 bit %gs Descriptor */ -#define GCODE_SEL 4 /* Kernel Code Descriptor */ -#define GDATA_SEL 5 /* Kernel Data Descriptor */ -#define GUCODE32_SEL 6 /* User 32 bit code Descriptor */ -#define GUDATA_SEL 7 /* User 32/64 bit Data Descriptor */ -#define GUCODE_SEL 8 /* User 64 bit Code Descriptor */ -#define GPROC0_SEL 9 /* TSS for entering kernel etc */ -/* slot 10 is second half of GPROC0_SEL */ -#define GUSERLDT_SEL 11 /* LDT */ -/* slot 11 is second half of GUSERLDT_SEL */ -#define NGDT 13 - #ifdef _KERNEL extern struct user_segment_descriptor gdt[]; extern struct soft_segment_descriptor gdt_segs[]; @@ -249,7 +101,6 @@ void ssdtosyssd(struct soft_segment_desc struct system_segment_descriptor *sdp); void update_gdt_gsbase(struct thread *td, uint32_t base); void update_gdt_fsbase(struct thread *td, uint32_t base); - #endif /* _KERNEL */ #endif /* !_MACHINE_SEGMENTS_H_ */ Modified: head/sys/i386/include/segments.h ============================================================================== --- head/sys/i386/include/segments.h Mon Mar 19 21:09:12 2012 (r233202) +++ head/sys/i386/include/segments.h Mon Mar 19 21:24:50 2012 (r233203) @@ -42,103 +42,7 @@ * William F. Jolitz (william@ernie.berkeley.edu) 6/20/1989 */ -/* - * Selectors - */ - -#define ISPL(s) ((s)&3) /* what is the priority level of a selector */ -#ifdef XEN -#define SEL_KPL 1 /* kernel priority level */ -#else -#define SEL_KPL 0 /* kernel priority level */ -#endif -#define SEL_UPL 3 /* user priority level */ -#define ISLDT(s) ((s)&SEL_LDT) /* is it local or global */ -#define SEL_LDT 4 /* local descriptor table */ -#define IDXSEL(s) (((s)>>3) & 0x1fff) /* index of selector */ -#define LSEL(s,r) (((s)<<3) | SEL_LDT | r) /* a local selector */ -#define GSEL(s,r) (((s)<<3) | r) /* a global selector */ - -/* - * Memory and System segment descriptors - */ -struct segment_descriptor { - unsigned sd_lolimit:16 ; /* segment extent (lsb) */ - unsigned sd_lobase:24 __packed; /* segment base address (lsb) */ - unsigned sd_type:5 ; /* segment type */ - unsigned sd_dpl:2 ; /* segment descriptor priority level */ - unsigned sd_p:1 ; /* segment descriptor present */ - unsigned sd_hilimit:4 ; /* segment extent (msb) */ - unsigned sd_xx:2 ; /* unused */ - unsigned sd_def32:1 ; /* default 32 vs 16 bit size */ - unsigned sd_gran:1 ; /* limit granularity (byte/page units)*/ - unsigned sd_hibase:8 ; /* segment base address (msb) */ -} ; - -#define USD_GETBASE(sd) (((sd)->sd_lobase) | (sd)->sd_hibase << 24) -#define USD_SETBASE(sd, b) (sd)->sd_lobase = (b); \ - (sd)->sd_hibase = ((b) >> 24); -#define USD_GETLIMIT(sd) (((sd)->sd_lolimit) | (sd)->sd_hilimit << 16) -#define USD_SETLIMIT(sd, l) (sd)->sd_lolimit = (l); \ - (sd)->sd_hilimit = ((l) >> 16); - -/* - * Gate descriptors (e.g. indirect descriptors) - */ -struct gate_descriptor { - unsigned gd_looffset:16 ; /* gate offset (lsb) */ - unsigned gd_selector:16 ; /* gate segment selector */ - unsigned gd_stkcpy:5 ; /* number of stack wds to cpy */ - unsigned gd_xx:3 ; /* unused */ - unsigned gd_type:5 ; /* segment type */ - unsigned gd_dpl:2 ; /* segment descriptor priority level */ - unsigned gd_p:1 ; /* segment descriptor present */ - unsigned gd_hioffset:16 ; /* gate offset (msb) */ -} ; - -/* - * Generic descriptor - */ -union descriptor { - struct segment_descriptor sd; - struct gate_descriptor gd; -}; - - /* system segments and gate types */ -#define SDT_SYSNULL 0 /* system null */ -#define SDT_SYS286TSS 1 /* system 286 TSS available */ -#define SDT_SYSLDT 2 /* system local descriptor table */ -#define SDT_SYS286BSY 3 /* system 286 TSS busy */ -#define SDT_SYS286CGT 4 /* system 286 call gate */ -#define SDT_SYSTASKGT 5 /* system task gate */ -#define SDT_SYS286IGT 6 /* system 286 interrupt gate */ -#define SDT_SYS286TGT 7 /* system 286 trap gate */ -#define SDT_SYSNULL2 8 /* system null again */ -#define SDT_SYS386TSS 9 /* system 386 TSS available */ -#define SDT_SYSNULL3 10 /* system null again */ -#define SDT_SYS386BSY 11 /* system 386 TSS busy */ -#define SDT_SYS386CGT 12 /* system 386 call gate */ -#define SDT_SYSNULL4 13 /* system null again */ -#define SDT_SYS386IGT 14 /* system 386 interrupt gate */ -#define SDT_SYS386TGT 15 /* system 386 trap gate */ - - /* memory segment types */ -#define SDT_MEMRO 16 /* memory read only */ -#define SDT_MEMROA 17 /* memory read only accessed */ -#define SDT_MEMRW 18 /* memory read write */ -#define SDT_MEMRWA 19 /* memory read write accessed */ -#define SDT_MEMROD 20 /* memory read only expand dwn limit */ -#define SDT_MEMRODA 21 /* memory read only expand dwn limit accessed */ -#define SDT_MEMRWD 22 /* memory read write expand dwn limit */ -#define SDT_MEMRWDA 23 /* memory read write expand dwn limit accessed */ -#define SDT_MEME 24 /* memory execute only */ -#define SDT_MEMEA 25 /* memory execute only accessed */ -#define SDT_MEMER 26 /* memory execute read */ -#define SDT_MEMERA 27 /* memory execute read accessed */ -#define SDT_MEMEC 28 /* memory execute only conforming */ -#define SDT_MEMEAC 29 /* memory execute only accessed conforming */ -#define SDT_MEMERC 30 /* memory execute read conforming */ -#define SDT_MEMERAC 31 /* memory execute read accessed conforming */ +#include /* * Software definitions are in this convenient format, @@ -176,84 +80,6 @@ struct region_descriptor { /* other bits are affected descriptor index */ #define SEGEX_IDX(s) (((s)>>3)&0x1fff) -/* - * Size of IDT table - */ - -#define NIDT 256 /* 32 reserved, 0x80 syscall, most are h/w */ -#define NRSVIDT 32 /* reserved entries for cpu exceptions */ - -/* - * Entries in the Interrupt Descriptor Table (IDT) - */ -#define IDT_DE 0 /* #DE: Divide Error */ -#define IDT_DB 1 /* #DB: Debug */ -#define IDT_NMI 2 /* Nonmaskable External Interrupt */ -#define IDT_BP 3 /* #BP: Breakpoint */ -#define IDT_OF 4 /* #OF: Overflow */ -#define IDT_BR 5 /* #BR: Bound Range Exceeded */ -#define IDT_UD 6 /* #UD: Undefined/Invalid Opcode */ -#define IDT_NM 7 /* #NM: No Math Coprocessor */ -#define IDT_DF 8 /* #DF: Double Fault */ -#define IDT_FPUGP 9 /* Coprocessor Segment Overrun */ -#define IDT_TS 10 /* #TS: Invalid TSS */ -#define IDT_NP 11 /* #NP: Segment Not Present */ -#define IDT_SS 12 /* #SS: Stack Segment Fault */ -#define IDT_GP 13 /* #GP: General Protection Fault */ -#define IDT_PF 14 /* #PF: Page Fault */ -#define IDT_MF 16 /* #MF: FPU Floating-Point Error */ -#define IDT_AC 17 /* #AC: Alignment Check */ -#define IDT_MC 18 /* #MC: Machine Check */ -#define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ -#define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ -#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ -#define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ - -/* - * Entries in the Global Descriptor Table (GDT) - * Note that each 4 entries share a single 32 byte L1 cache line. - * Some of the fast syscall instructions require a specific order here. - */ -#define GNULL_SEL 0 /* Null Descriptor */ -#define GPRIV_SEL 1 /* SMP Per-Processor Private Data */ -#define GUFS_SEL 2 /* User %fs Descriptor (order critical: 1) */ -#define GUGS_SEL 3 /* User %gs Descriptor (order critical: 2) */ -#define GCODE_SEL 4 /* Kernel Code Descriptor (order critical: 1) */ -#define GDATA_SEL 5 /* Kernel Data Descriptor (order critical: 2) */ -#define GUCODE_SEL 6 /* User Code Descriptor (order critical: 3) */ -#define GUDATA_SEL 7 /* User Data Descriptor (order critical: 4) */ -#define GBIOSLOWMEM_SEL 8 /* BIOS low memory access (must be entry 8) */ -#define GPROC0_SEL 9 /* Task state process slot zero and up */ -#define GLDT_SEL 10 /* Default User LDT */ -#define GUSERLDT_SEL 11 /* User LDT */ -#define GPANIC_SEL 12 /* Task state to consider panic from */ -#define GBIOSCODE32_SEL 13 /* BIOS interface (32bit Code) */ -#define GBIOSCODE16_SEL 14 /* BIOS interface (16bit Code) */ -#define GBIOSDATA_SEL 15 /* BIOS interface (Data) */ -#define GBIOSUTIL_SEL 16 /* BIOS interface (Utility) */ -#define GBIOSARGS_SEL 17 /* BIOS interface (Arguments) */ -#define GNDIS_SEL 18 /* For the NDIS layer */ - -#ifdef XEN -#define NGDT 9 -#else -#define NGDT 19 -#endif - -/* - * Entries in the Local Descriptor Table (LDT) - */ -#define LSYS5CALLS_SEL 0 /* forced by intel BCS */ -#define LSYS5SIGR_SEL 1 -#define L43BSDCALLS_SEL 2 /* notyet */ -#define LUCODE_SEL 3 -#define LSOL26CALLS_SEL 4 /* Solaris >= 2.6 system call gate */ -#define LUDATA_SEL 5 -/* separate stack, es,fs,gs sels ? */ -/* #define LPOSIXCALLS_SEL 5*/ /* notyet */ -#define LBSDICALLS_SEL 16 /* BSDI system call gate */ -#define NLDT (LBSDICALLS_SEL + 1) - #ifdef _KERNEL extern int _default_ldt; #ifdef XEN Modified: head/sys/ia64/ia32/ia32_signal.c ============================================================================== --- head/sys/ia64/ia32/ia32_signal.c Mon Mar 19 21:09:12 2012 (r233202) +++ head/sys/ia64/ia32/ia32_signal.c Mon Mar 19 21:24:50 2012 (r233203) @@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include char ia32_sigcode[] = { Added: head/sys/x86/include/segments.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/segments.h Mon Mar 19 21:24:50 2012 (r233203) @@ -0,0 +1,286 @@ +/*- + * Copyright (c) 1989, 1990 William F. Jolitz + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)segments.h 7.1 (Berkeley) 5/9/91 + * $FreeBSD$ + */ + +#ifndef _X86_SEGMENTS_H_ +#define _X86_SEGMENTS_H_ + +/* + * X86 Segmentation Data Structures and definitions + */ + +/* + * Selectors + */ +#define SEL_RPL_MASK 3 /* requester priv level */ +#define ISPL(s) ((s)&3) /* priority level of a selector */ +#ifdef XEN +#define SEL_KPL 1 /* kernel priority level */ +#else +#define SEL_KPL 0 /* kernel priority level */ +#endif +#define SEL_UPL 3 /* user priority level */ +#define ISLDT(s) ((s)&SEL_LDT) /* is it local or global */ +#define SEL_LDT 4 /* local descriptor table */ +#define IDXSEL(s) (((s)>>3) & 0x1fff) /* index of selector */ +#define LSEL(s,r) (((s)<<3) | SEL_LDT | r) /* a local selector */ +#define GSEL(s,r) (((s)<<3) | r) /* a global selector */ + +/* + * User segment descriptors (%cs, %ds etc for i386 apps. 64 bit wide) + * For long-mode apps, %cs only has the conforming bit in sd_type, the sd_dpl, + * sd_p, sd_l and sd_def32 which must be zero). %ds only has sd_p. + */ +struct segment_descriptor { + unsigned sd_lolimit:16; /* segment extent (lsb) */ + unsigned sd_lobase:24; /* segment base address (lsb) */ + unsigned sd_type:5; /* segment type */ + unsigned sd_dpl:2; /* segment descriptor priority level */ + unsigned sd_p:1; /* segment descriptor present */ + unsigned sd_hilimit:4; /* segment extent (msb) */ + unsigned sd_xx:2; /* unused */ + unsigned sd_def32:1; /* default 32 vs 16 bit size */ + unsigned sd_gran:1; /* limit granularity (byte/page units)*/ + unsigned sd_hibase:8; /* segment base address (msb) */ +} __packed; + +struct user_segment_descriptor { + unsigned sd_lolimit:16; /* segment extent (lsb) */ + unsigned sd_lobase:24; /* segment base address (lsb) */ + unsigned sd_type:5; /* segment type */ + unsigned sd_dpl:2; /* segment descriptor priority level */ + unsigned sd_p:1; /* segment descriptor present */ + unsigned sd_hilimit:4; /* segment extent (msb) */ + unsigned sd_xx:1; /* unused */ + unsigned sd_long:1; /* long mode (cs only) */ + unsigned sd_def32:1; /* default 32 vs 16 bit size */ + unsigned sd_gran:1; /* limit granularity (byte/page units)*/ + unsigned sd_hibase:8; /* segment base address (msb) */ +} __packed; + +#define USD_GETBASE(sd) (((sd)->sd_lobase) | (sd)->sd_hibase << 24) +#define USD_SETBASE(sd, b) (sd)->sd_lobase = (b); \ + (sd)->sd_hibase = ((b) >> 24); +#define USD_GETLIMIT(sd) (((sd)->sd_lolimit) | (sd)->sd_hilimit << 16) +#define USD_SETLIMIT(sd, l) (sd)->sd_lolimit = (l); \ + (sd)->sd_hilimit = ((l) >> 16); + +#ifdef __i386__ +/* + * Gate descriptors (e.g. indirect descriptors) + */ +struct gate_descriptor { + unsigned gd_looffset:16; /* gate offset (lsb) */ + unsigned gd_selector:16; /* gate segment selector */ + unsigned gd_stkcpy:5; /* number of stack wds to cpy */ + unsigned gd_xx:3; /* unused */ + unsigned gd_type:5; /* segment type */ + unsigned gd_dpl:2; /* segment descriptor priority level */ + unsigned gd_p:1; /* segment descriptor present */ + unsigned gd_hioffset:16; /* gate offset (msb) */ +} __packed; + +/* + * Generic descriptor + */ +union descriptor { + struct segment_descriptor sd; + struct gate_descriptor gd; +}; +#else +/* + * Gate descriptors (e.g. indirect descriptors, trap, interrupt etc. 128 bit) + * Only interrupt and trap gates have gd_ist. + */ +struct gate_descriptor { + uint64_t gd_looffset:16; /* gate offset (lsb) */ + uint64_t gd_selector:16; /* gate segment selector */ + uint64_t gd_ist:3; /* IST table index */ + uint64_t gd_xx:5; /* unused */ + uint64_t gd_type:5; /* segment type */ + uint64_t gd_dpl:2; /* segment descriptor priority level */ + uint64_t gd_p:1; /* segment descriptor present */ + uint64_t gd_hioffset:48; /* gate offset (msb) */ + uint64_t sd_xx1:32; +} __packed; + +/* + * Generic descriptor + */ +union descriptor { + struct user_segment_descriptor sd; + struct gate_descriptor gd; +}; +#endif + + /* system segments and gate types */ +#define SDT_SYSNULL 0 /* system null */ +#define SDT_SYS286TSS 1 /* system 286 TSS available */ +#define SDT_SYSLDT 2 /* system local descriptor table */ +#define SDT_SYS286BSY 3 /* system 286 TSS busy */ +#define SDT_SYS286CGT 4 /* system 286 call gate */ +#define SDT_SYSTASKGT 5 /* system task gate */ +#define SDT_SYS286IGT 6 /* system 286 interrupt gate */ +#define SDT_SYS286TGT 7 /* system 286 trap gate */ +#define SDT_SYSNULL2 8 /* system null again */ +#define SDT_SYS386TSS 9 /* system 386 TSS available */ +#define SDT_SYSTSS 9 /* system available 64 bit TSS */ +#define SDT_SYSNULL3 10 /* system null again */ +#define SDT_SYS386BSY 11 /* system 386 TSS busy */ +#define SDT_SYSBSY 11 /* system busy 64 bit TSS */ +#define SDT_SYS386CGT 12 /* system 386 call gate */ +#define SDT_SYSCGT 12 /* system 64 bit call gate */ +#define SDT_SYSNULL4 13 /* system null again */ +#define SDT_SYS386IGT 14 /* system 386 interrupt gate */ +#define SDT_SYSIGT 14 /* system 64 bit interrupt gate */ +#define SDT_SYS386TGT 15 /* system 386 trap gate */ +#define SDT_SYSTGT 15 /* system 64 bit trap gate */ + + /* memory segment types */ +#define SDT_MEMRO 16 /* memory read only */ +#define SDT_MEMROA 17 /* memory read only accessed */ +#define SDT_MEMRW 18 /* memory read write */ +#define SDT_MEMRWA 19 /* memory read write accessed */ +#define SDT_MEMROD 20 /* memory read only expand dwn limit */ +#define SDT_MEMRODA 21 /* memory read only expand dwn limit accessed */ +#define SDT_MEMRWD 22 /* memory read write expand dwn limit */ +#define SDT_MEMRWDA 23 /* memory read write expand dwn limit accessed*/ +#define SDT_MEME 24 /* memory execute only */ +#define SDT_MEMEA 25 /* memory execute only accessed */ +#define SDT_MEMER 26 /* memory execute read */ +#define SDT_MEMERA 27 /* memory execute read accessed */ +#define SDT_MEMEC 28 /* memory execute only conforming */ +#define SDT_MEMEAC 29 /* memory execute only accessed conforming */ +#define SDT_MEMERC 30 /* memory execute read conforming */ +#define SDT_MEMERAC 31 /* memory execute read accessed conforming */ + +/* + * Size of IDT table + */ +#define NIDT 256 /* 32 reserved, 0x80 syscall, most are h/w */ +#define NRSVIDT 32 /* reserved entries for cpu exceptions */ + +/* + * Entries in the Interrupt Descriptor Table (IDT) + */ +#define IDT_DE 0 /* #DE: Divide Error */ +#define IDT_DB 1 /* #DB: Debug */ +#define IDT_NMI 2 /* Nonmaskable External Interrupt */ +#define IDT_BP 3 /* #BP: Breakpoint */ +#define IDT_OF 4 /* #OF: Overflow */ +#define IDT_BR 5 /* #BR: Bound Range Exceeded */ +#define IDT_UD 6 /* #UD: Undefined/Invalid Opcode */ +#define IDT_NM 7 /* #NM: No Math Coprocessor */ +#define IDT_DF 8 /* #DF: Double Fault */ +#define IDT_FPUGP 9 /* Coprocessor Segment Overrun */ +#define IDT_TS 10 /* #TS: Invalid TSS */ +#define IDT_NP 11 /* #NP: Segment Not Present */ +#define IDT_SS 12 /* #SS: Stack Segment Fault */ +#define IDT_GP 13 /* #GP: General Protection Fault */ +#define IDT_PF 14 /* #PF: Page Fault */ +#define IDT_MF 16 /* #MF: FPU Floating-Point Error */ +#define IDT_AC 17 /* #AC: Alignment Check */ +#define IDT_MC 18 /* #MC: Machine Check */ +#define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ +#define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ +#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ +#define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ + +#if defined(__i386__) || defined(__ia64__) +/* + * Entries in the Global Descriptor Table (GDT) + * Note that each 4 entries share a single 32 byte L1 cache line. + * Some of the fast syscall instructions require a specific order here. + */ +#define GNULL_SEL 0 /* Null Descriptor */ +#define GPRIV_SEL 1 /* SMP Per-Processor Private Data */ +#define GUFS_SEL 2 /* User %fs Descriptor (order critical: 1) */ +#define GUGS_SEL 3 /* User %gs Descriptor (order critical: 2) */ +#define GCODE_SEL 4 /* Kernel Code Descriptor (order critical: 1) */ +#define GDATA_SEL 5 /* Kernel Data Descriptor (order critical: 2) */ +#define GUCODE_SEL 6 /* User Code Descriptor (order critical: 3) */ +#define GUDATA_SEL 7 /* User Data Descriptor (order critical: 4) */ +#define GBIOSLOWMEM_SEL 8 /* BIOS low memory access (must be entry 8) */ +#define GPROC0_SEL 9 /* Task state process slot zero and up */ +#define GLDT_SEL 10 /* Default User LDT */ +#define GUSERLDT_SEL 11 /* User LDT */ +#define GPANIC_SEL 12 /* Task state to consider panic from */ +#define GBIOSCODE32_SEL 13 /* BIOS interface (32bit Code) */ +#define GBIOSCODE16_SEL 14 /* BIOS interface (16bit Code) */ +#define GBIOSDATA_SEL 15 /* BIOS interface (Data) */ +#define GBIOSUTIL_SEL 16 /* BIOS interface (Utility) */ +#define GBIOSARGS_SEL 17 /* BIOS interface (Arguments) */ +#define GNDIS_SEL 18 /* For the NDIS layer */ +#ifdef XEN +#define NGDT 9 +#else +#define NGDT 19 +#endif + +/* + * Entries in the Local Descriptor Table (LDT) + */ +#define LSYS5CALLS_SEL 0 /* forced by intel BCS */ +#define LSYS5SIGR_SEL 1 +#define L43BSDCALLS_SEL 2 /* notyet */ +#define LUCODE_SEL 3 +#define LSOL26CALLS_SEL 4 /* Solaris >= 2.6 system call gate */ +#define LUDATA_SEL 5 +/* separate stack, es,fs,gs sels ? */ +/* #define LPOSIXCALLS_SEL 5*/ /* notyet */ +#define LBSDICALLS_SEL 16 /* BSDI system call gate */ +#define NLDT (LBSDICALLS_SEL + 1) + +#else /* !__i386__ && !__ia64__ */ +/* + * Entries in the Global Descriptor Table (GDT) + */ +#define GNULL_SEL 0 /* Null Descriptor */ +#define GNULL2_SEL 1 /* Null Descriptor */ +#define GUFS32_SEL 2 /* User 32 bit %fs Descriptor */ +#define GUGS32_SEL 3 /* User 32 bit %gs Descriptor */ +#define GCODE_SEL 4 /* Kernel Code Descriptor */ +#define GDATA_SEL 5 /* Kernel Data Descriptor */ +#define GUCODE32_SEL 6 /* User 32 bit code Descriptor */ +#define GUDATA_SEL 7 /* User 32/64 bit Data Descriptor */ +#define GUCODE_SEL 8 /* User 64 bit Code Descriptor */ +#define GPROC0_SEL 9 /* TSS for entering kernel etc */ +/* slot 10 is second half of GPROC0_SEL */ +#define GUSERLDT_SEL 11 /* LDT */ +/* slot 12 is second half of GUSERLDT_SEL */ +#define NGDT 13 +#endif /* __i386__ || __ia64__ */ + +#endif /* !_X86_SEGMENTS_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 21:29:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70805106566B; Mon, 19 Mar 2012 21:29:58 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 518678FC12; Mon, 19 Mar 2012 21:29:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JLTwa2087068; Mon, 19 Mar 2012 21:29:58 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JLTwNI087061; Mon, 19 Mar 2012 21:29:58 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203192129.q2JLTwNI087061@svn.freebsd.org> From: Tijl Coosemans Date: Mon, 19 Mar 2012 21:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233204 - in head/sys: amd64/include i386/include ia64/ia32 pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 21:29:58 -0000 Author: tijl Date: Mon Mar 19 21:29:57 2012 New Revision: 233204 URL: http://svn.freebsd.org/changeset/base/233204 Log: Copy i386 psl.h to x86 and replace amd64/i386/pc98 psl.h with stubs. Added: head/sys/x86/include/psl.h - copied unchanged from r233203, head/sys/i386/include/psl.h Modified: head/sys/amd64/include/psl.h head/sys/i386/include/psl.h head/sys/ia64/ia32/ia32_signal.c head/sys/ia64/ia32/ia32_trap.c head/sys/pc98/include/psl.h Modified: head/sys/amd64/include/psl.h ============================================================================== --- head/sys/amd64/include/psl.h Mon Mar 19 21:24:50 2012 (r233203) +++ head/sys/amd64/include/psl.h Mon Mar 19 21:29:57 2012 (r233204) @@ -1,84 +1,6 @@ /*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)psl.h 5.2 (Berkeley) 1/18/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_PSL_H_ -#define _MACHINE_PSL_H_ - -/* - * 386 processor status longword. - */ -#define PSL_C 0x00000001 /* carry bit */ -#define PSL_PF 0x00000004 /* parity bit */ -#define PSL_AF 0x00000010 /* bcd carry bit */ -#define PSL_Z 0x00000040 /* zero bit */ -#define PSL_N 0x00000080 /* negative bit */ -#define PSL_T 0x00000100 /* trace enable bit */ -#define PSL_I 0x00000200 /* interrupt enable bit */ -#define PSL_D 0x00000400 /* string instruction direction bit */ -#define PSL_V 0x00000800 /* overflow bit */ -#define PSL_IOPL 0x00003000 /* i/o privilege level */ -#define PSL_NT 0x00004000 /* nested task bit */ -#define PSL_RF 0x00010000 /* resume flag bit */ -/* #define PSL_VM 0x00020000 */ /* virtual 8086 mode bit */ -#define PSL_AC 0x00040000 /* alignment checking */ -/* #define PSL_VIF 0x00080000 */ /* virtual interrupt enable */ -/* #define PSL_VIP 0x00100000 */ /* virtual interrupt pending */ -#define PSL_ID 0x00200000 /* identification bit */ - -/* - * The i486 manual says that we are not supposed to change reserved flags, - * but this is too much trouble since the reserved flags depend on the cpu - * and setting them to their historical values works in practice. - */ -#define PSL_RESERVED_DEFAULT 0x00000002 - -/* - * Initial flags for kernel and user mode. The kernel later inherits - * PSL_I and some other flags from user mode. - */ -#define PSL_KERNEL PSL_RESERVED_DEFAULT -#define PSL_USER (PSL_RESERVED_DEFAULT | PSL_I) - -/* - * Bits that can be changed in user mode on 486's. We allow these bits - * to be changed using ptrace(), sigreturn() and procfs. Setting PS_NT - * is undesirable but it may as well be allowed since users can inflict - * it on the kernel directly. Changes to PSL_AC are silently ignored on - * 386's. - */ -#define PSL_USERCHANGE (PSL_C | PSL_PF | PSL_AF | PSL_Z | PSL_N | PSL_T \ - | PSL_D | PSL_V | PSL_NT | PSL_AC | PSL_ID) - -#endif /* !_MACHINE_PSL_H_ */ +#include Modified: head/sys/i386/include/psl.h ============================================================================== --- head/sys/i386/include/psl.h Mon Mar 19 21:24:50 2012 (r233203) +++ head/sys/i386/include/psl.h Mon Mar 19 21:29:57 2012 (r233204) @@ -1,84 +1,6 @@ /*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)psl.h 5.2 (Berkeley) 1/18/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_PSL_H_ -#define _MACHINE_PSL_H_ - -/* - * 386 processor status longword. - */ -#define PSL_C 0x00000001 /* carry bit */ -#define PSL_PF 0x00000004 /* parity bit */ -#define PSL_AF 0x00000010 /* bcd carry bit */ -#define PSL_Z 0x00000040 /* zero bit */ -#define PSL_N 0x00000080 /* negative bit */ -#define PSL_T 0x00000100 /* trace enable bit */ -#define PSL_I 0x00000200 /* interrupt enable bit */ -#define PSL_D 0x00000400 /* string instruction direction bit */ -#define PSL_V 0x00000800 /* overflow bit */ -#define PSL_IOPL 0x00003000 /* i/o privilege level */ -#define PSL_NT 0x00004000 /* nested task bit */ -#define PSL_RF 0x00010000 /* resume flag bit */ -#define PSL_VM 0x00020000 /* virtual 8086 mode bit */ -#define PSL_AC 0x00040000 /* alignment checking */ -#define PSL_VIF 0x00080000 /* virtual interrupt enable */ -#define PSL_VIP 0x00100000 /* virtual interrupt pending */ -#define PSL_ID 0x00200000 /* identification bit */ - -/* - * The i486 manual says that we are not supposed to change reserved flags, - * but this is too much trouble since the reserved flags depend on the cpu - * and setting them to their historical values works in practice. - */ -#define PSL_RESERVED_DEFAULT 0x00000002 - -/* - * Initial flags for kernel and user mode. The kernel later inherits - * PSL_I and some other flags from user mode. - */ -#define PSL_KERNEL PSL_RESERVED_DEFAULT -#define PSL_USER (PSL_RESERVED_DEFAULT | PSL_I) - -/* - * Bits that can be changed in user mode on 486's. We allow these bits - * to be changed using ptrace(), sigreturn() and procfs. Setting PS_NT - * is undesirable but it may as well be allowed since users can inflict - * it on the kernel directly. Changes to PSL_AC are silently ignored on - * 386's. - */ -#define PSL_USERCHANGE (PSL_C | PSL_PF | PSL_AF | PSL_Z | PSL_N | PSL_T \ - | PSL_D | PSL_V | PSL_NT | PSL_AC | PSL_ID) - -#endif /* !_MACHINE_PSL_H_ */ +#include Modified: head/sys/ia64/ia32/ia32_signal.c ============================================================================== --- head/sys/ia64/ia32/ia32_signal.c Mon Mar 19 21:24:50 2012 (r233203) +++ head/sys/ia64/ia32/ia32_signal.c Mon Mar 19 21:29:57 2012 (r233204) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/ia64/ia32/ia32_trap.c ============================================================================== --- head/sys/ia64/ia32/ia32_trap.c Mon Mar 19 21:24:50 2012 (r233203) +++ head/sys/ia64/ia32/ia32_trap.c Mon Mar 19 21:29:57 2012 (r233204) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include Modified: head/sys/pc98/include/psl.h ============================================================================== --- head/sys/pc98/include/psl.h Mon Mar 19 21:24:50 2012 (r233203) +++ head/sys/pc98/include/psl.h Mon Mar 19 21:29:57 2012 (r233204) @@ -3,4 +3,4 @@ */ /* $FreeBSD$ */ -#include +#include Copied: head/sys/x86/include/psl.h (from r233203, head/sys/i386/include/psl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/psl.h Mon Mar 19 21:29:57 2012 (r233204, copy of r233203, head/sys/i386/include/psl.h) @@ -0,0 +1,84 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)psl.h 5.2 (Berkeley) 1/18/91 + * $FreeBSD$ + */ + +#ifndef _MACHINE_PSL_H_ +#define _MACHINE_PSL_H_ + +/* + * 386 processor status longword. + */ +#define PSL_C 0x00000001 /* carry bit */ +#define PSL_PF 0x00000004 /* parity bit */ +#define PSL_AF 0x00000010 /* bcd carry bit */ +#define PSL_Z 0x00000040 /* zero bit */ +#define PSL_N 0x00000080 /* negative bit */ +#define PSL_T 0x00000100 /* trace enable bit */ +#define PSL_I 0x00000200 /* interrupt enable bit */ +#define PSL_D 0x00000400 /* string instruction direction bit */ +#define PSL_V 0x00000800 /* overflow bit */ +#define PSL_IOPL 0x00003000 /* i/o privilege level */ +#define PSL_NT 0x00004000 /* nested task bit */ +#define PSL_RF 0x00010000 /* resume flag bit */ +#define PSL_VM 0x00020000 /* virtual 8086 mode bit */ +#define PSL_AC 0x00040000 /* alignment checking */ +#define PSL_VIF 0x00080000 /* virtual interrupt enable */ +#define PSL_VIP 0x00100000 /* virtual interrupt pending */ +#define PSL_ID 0x00200000 /* identification bit */ + +/* + * The i486 manual says that we are not supposed to change reserved flags, + * but this is too much trouble since the reserved flags depend on the cpu + * and setting them to their historical values works in practice. + */ +#define PSL_RESERVED_DEFAULT 0x00000002 + +/* + * Initial flags for kernel and user mode. The kernel later inherits + * PSL_I and some other flags from user mode. + */ +#define PSL_KERNEL PSL_RESERVED_DEFAULT +#define PSL_USER (PSL_RESERVED_DEFAULT | PSL_I) + +/* + * Bits that can be changed in user mode on 486's. We allow these bits + * to be changed using ptrace(), sigreturn() and procfs. Setting PS_NT + * is undesirable but it may as well be allowed since users can inflict + * it on the kernel directly. Changes to PSL_AC are silently ignored on + * 386's. + */ +#define PSL_USERCHANGE (PSL_C | PSL_PF | PSL_AF | PSL_Z | PSL_N | PSL_T \ + | PSL_D | PSL_V | PSL_NT | PSL_AC | PSL_ID) + +#endif /* !_MACHINE_PSL_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 21:33:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E5101065674; Mon, 19 Mar 2012 21:33:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F5378FC27; Mon, 19 Mar 2012 21:33:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JLXOGK087223; Mon, 19 Mar 2012 21:33:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JLXOnl087219; Mon, 19 Mar 2012 21:33:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203192133.q2JLXOnl087219@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Mar 2012 21:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233205 - stable/9/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 21:33:24 -0000 Author: jhb Date: Mon Mar 19 21:33:23 2012 New Revision: 233205 URL: http://svn.freebsd.org/changeset/base/233205 Log: MFC 232072: Pretty-print the advice constants passed to posix_fadvise(2). Modified: stable/9/usr.bin/kdump/kdump.c stable/9/usr.bin/kdump/kdump_subr.h stable/9/usr.bin/kdump/mksubr Directory Properties: stable/9/usr.bin/kdump/ (props changed) Modified: stable/9/usr.bin/kdump/kdump.c ============================================================================== --- stable/9/usr.bin/kdump/kdump.c Mon Mar 19 21:29:57 2012 (r233204) +++ stable/9/usr.bin/kdump/kdump.c Mon Mar 19 21:33:23 2012 (r233205) @@ -935,6 +935,14 @@ ktrsyscall(struct ktr_syscall *ktr, u_in kldunloadfflagsname ((int)*ip); ip++; narg--; + } else if (ktr->ktr_code == SYS_posix_fadvise) { + print_number(ip,narg,c); + print_number(ip,narg,c); + print_number(ip,narg,c); + (void)putchar(','); + fadvisebehavname((int)*ip); + ip++; + narg--; } } while (narg > 0) { Modified: stable/9/usr.bin/kdump/kdump_subr.h ============================================================================== --- stable/9/usr.bin/kdump/kdump_subr.h Mon Mar 19 21:29:57 2012 (r233204) +++ stable/9/usr.bin/kdump/kdump_subr.h Mon Mar 19 21:33:23 2012 (r233205) @@ -32,6 +32,7 @@ void whencename (int); void rlimitname (int); void shutdownhowname (int); void prioname (int); +void fadvisebehavname (int); void madvisebehavname (int); void msyncflagsname (int); void schedpolicyname (int); Modified: stable/9/usr.bin/kdump/mksubr ============================================================================== --- stable/9/usr.bin/kdump/mksubr Mon Mar 19 21:29:57 2012 (r233204) +++ stable/9/usr.bin/kdump/mksubr Mon Mar 19 21:33:23 2012 (r233205) @@ -351,6 +351,7 @@ auto_switch_type "whencename" "SEEK_[A-Z auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h" auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" +auto_switch_type "fadvisebehavname" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h" auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" auto_switch_type "schedpolicyname" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h" From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 21:33:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94722106577F; Mon, 19 Mar 2012 21:33:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65F9B8FC1E; Mon, 19 Mar 2012 21:33:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JLXa2P087268; Mon, 19 Mar 2012 21:33:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JLXa1H087264; Mon, 19 Mar 2012 21:33:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203192133.q2JLXa1H087264@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Mar 2012 21:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233206 - stable/8/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 21:33:36 -0000 Author: jhb Date: Mon Mar 19 21:33:35 2012 New Revision: 233206 URL: http://svn.freebsd.org/changeset/base/233206 Log: MFC 232072: Pretty-print the advice constants passed to posix_fadvise(2). Modified: stable/8/usr.bin/kdump/kdump.c stable/8/usr.bin/kdump/kdump_subr.h stable/8/usr.bin/kdump/mksubr Directory Properties: stable/8/usr.bin/kdump/ (props changed) Modified: stable/8/usr.bin/kdump/kdump.c ============================================================================== --- stable/8/usr.bin/kdump/kdump.c Mon Mar 19 21:33:23 2012 (r233205) +++ stable/8/usr.bin/kdump/kdump.c Mon Mar 19 21:33:35 2012 (r233206) @@ -939,6 +939,14 @@ ktrsyscall(struct ktr_syscall *ktr, u_in kldunloadfflagsname ((int)*ip); ip++; narg--; + } else if (ktr->ktr_code == SYS_posix_fadvise) { + print_number(ip,narg,c); + print_number(ip,narg,c); + print_number(ip,narg,c); + (void)putchar(','); + fadvisebehavname((int)*ip); + ip++; + narg--; } } while (narg > 0) { Modified: stable/8/usr.bin/kdump/kdump_subr.h ============================================================================== --- stable/8/usr.bin/kdump/kdump_subr.h Mon Mar 19 21:33:23 2012 (r233205) +++ stable/8/usr.bin/kdump/kdump_subr.h Mon Mar 19 21:33:35 2012 (r233206) @@ -32,6 +32,7 @@ void whencename (int); void rlimitname (int); void shutdownhowname (int); void prioname (int); +void fadvisebehavname (int); void madvisebehavname (int); void msyncflagsname (int); void schedpolicyname (int); Modified: stable/8/usr.bin/kdump/mksubr ============================================================================== --- stable/8/usr.bin/kdump/mksubr Mon Mar 19 21:33:23 2012 (r233205) +++ stable/8/usr.bin/kdump/mksubr Mon Mar 19 21:33:35 2012 (r233206) @@ -349,6 +349,7 @@ auto_switch_type "whencename" "SEEK_[A-Z auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h" auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h" auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" +auto_switch_type "fadvisebehavname" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h" auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" auto_switch_type "schedpolicyname" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h" From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 21:34:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09755106564A; Mon, 19 Mar 2012 21:34:12 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4AEE8FC16; Mon, 19 Mar 2012 21:34:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JLYB3D087328; Mon, 19 Mar 2012 21:34:11 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JLYBPb087324; Mon, 19 Mar 2012 21:34:11 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203192134.q2JLYBPb087324@svn.freebsd.org> From: Tijl Coosemans Date: Mon, 19 Mar 2012 21:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233207 - in head/sys: amd64/include i386/include ia64/ia32 pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 21:34:12 -0000 Author: tijl Date: Mon Mar 19 21:34:11 2012 New Revision: 233207 URL: http://svn.freebsd.org/changeset/base/233207 Log: Copy i386 specialreg.h to x86 and merge with amd64 specialreg.h. Replace amd64/i386/pc98 specialreg.h with stubs. Added: head/sys/x86/include/specialreg.h - copied, changed from r233203, head/sys/i386/include/specialreg.h Modified: head/sys/amd64/include/specialreg.h head/sys/i386/include/specialreg.h head/sys/ia64/ia32/ia32_signal.c head/sys/pc98/include/specialreg.h Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Mon Mar 19 21:33:35 2012 (r233206) +++ head/sys/amd64/include/specialreg.h Mon Mar 19 21:34:11 2012 (r233207) @@ -1,597 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)specialreg.h 7.1 (Berkeley) 5/9/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_SPECIALREG_H_ -#define _MACHINE_SPECIALREG_H_ - -/* - * Bits in 386 special registers: - */ -#define CR0_PE 0x00000001 /* Protected mode Enable */ -#define CR0_MP 0x00000002 /* "Math" (fpu) Present */ -#define CR0_EM 0x00000004 /* EMulate FPU instructions. (trap ESC only) */ -#define CR0_TS 0x00000008 /* Task Switched (if MP, trap ESC and WAIT) */ -#define CR0_PG 0x80000000 /* PaGing enable */ - -/* - * Bits in 486 special registers: - */ -#define CR0_NE 0x00000020 /* Numeric Error enable (EX16 vs IRQ13) */ -#define CR0_WP 0x00010000 /* Write Protect (honor page protect in - all modes) */ -#define CR0_AM 0x00040000 /* Alignment Mask (set to enable AC flag) */ -#define CR0_NW 0x20000000 /* Not Write-through */ -#define CR0_CD 0x40000000 /* Cache Disable */ - -/* - * Bits in PPro special registers - */ -#define CR4_VME 0x00000001 /* Virtual 8086 mode extensions */ -#define CR4_PVI 0x00000002 /* Protected-mode virtual interrupts */ -#define CR4_TSD 0x00000004 /* Time stamp disable */ -#define CR4_DE 0x00000008 /* Debugging extensions */ -#define CR4_PSE 0x00000010 /* Page size extensions */ -#define CR4_PAE 0x00000020 /* Physical address extension */ -#define CR4_MCE 0x00000040 /* Machine check enable */ -#define CR4_PGE 0x00000080 /* Page global enable */ -#define CR4_PCE 0x00000100 /* Performance monitoring counter enable */ -#define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ -#define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ -#define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ - -/* - * Bits in AMD64 special registers. EFER is 64 bits wide. - */ -#define EFER_SCE 0x000000001 /* System Call Extensions (R/W) */ -#define EFER_LME 0x000000100 /* Long mode enable (R/W) */ -#define EFER_LMA 0x000000400 /* Long mode active (R) */ -#define EFER_NXE 0x000000800 /* PTE No-Execute bit enable (R/W) */ - -/* - * Intel Extended Features registers - */ -#define XCR0 0 /* XFEATURE_ENABLED_MASK register */ - -#define XFEATURE_ENABLED_X87 0x00000001 -#define XFEATURE_ENABLED_SSE 0x00000002 -#define XFEATURE_ENABLED_AVX 0x00000004 - -#define XFEATURE_AVX \ - (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE | XFEATURE_ENABLED_AVX) - -/* - * CPUID instruction features register - */ -#define CPUID_FPU 0x00000001 -#define CPUID_VME 0x00000002 -#define CPUID_DE 0x00000004 -#define CPUID_PSE 0x00000008 -#define CPUID_TSC 0x00000010 -#define CPUID_MSR 0x00000020 -#define CPUID_PAE 0x00000040 -#define CPUID_MCE 0x00000080 -#define CPUID_CX8 0x00000100 -#define CPUID_APIC 0x00000200 -#define CPUID_B10 0x00000400 -#define CPUID_SEP 0x00000800 -#define CPUID_MTRR 0x00001000 -#define CPUID_PGE 0x00002000 -#define CPUID_MCA 0x00004000 -#define CPUID_CMOV 0x00008000 -#define CPUID_PAT 0x00010000 -#define CPUID_PSE36 0x00020000 -#define CPUID_PSN 0x00040000 -#define CPUID_CLFSH 0x00080000 -#define CPUID_B20 0x00100000 -#define CPUID_DS 0x00200000 -#define CPUID_ACPI 0x00400000 -#define CPUID_MMX 0x00800000 -#define CPUID_FXSR 0x01000000 -#define CPUID_SSE 0x02000000 -#define CPUID_XMM 0x02000000 -#define CPUID_SSE2 0x04000000 -#define CPUID_SS 0x08000000 -#define CPUID_HTT 0x10000000 -#define CPUID_TM 0x20000000 -#define CPUID_IA64 0x40000000 -#define CPUID_PBE 0x80000000 - -#define CPUID2_SSE3 0x00000001 -#define CPUID2_PCLMULQDQ 0x00000002 -#define CPUID2_DTES64 0x00000004 -#define CPUID2_MON 0x00000008 -#define CPUID2_DS_CPL 0x00000010 -#define CPUID2_VMX 0x00000020 -#define CPUID2_SMX 0x00000040 -#define CPUID2_EST 0x00000080 -#define CPUID2_TM2 0x00000100 -#define CPUID2_SSSE3 0x00000200 -#define CPUID2_CNXTID 0x00000400 -#define CPUID2_FMA 0x00001000 -#define CPUID2_CX16 0x00002000 -#define CPUID2_XTPR 0x00004000 -#define CPUID2_PDCM 0x00008000 -#define CPUID2_PCID 0x00020000 -#define CPUID2_DCA 0x00040000 -#define CPUID2_SSE41 0x00080000 -#define CPUID2_SSE42 0x00100000 -#define CPUID2_X2APIC 0x00200000 -#define CPUID2_MOVBE 0x00400000 -#define CPUID2_POPCNT 0x00800000 -#define CPUID2_TSCDLT 0x01000000 -#define CPUID2_AESNI 0x02000000 -#define CPUID2_XSAVE 0x04000000 -#define CPUID2_OSXSAVE 0x08000000 -#define CPUID2_AVX 0x10000000 -#define CPUID2_F16C 0x20000000 -#define CPUID2_HV 0x80000000 - -/* - * Important bits in the Thermal and Power Management flags - * CPUID.6 EAX and ECX. - */ -#define CPUTPM1_SENSOR 0x00000001 -#define CPUTPM1_TURBO 0x00000002 -#define CPUTPM1_ARAT 0x00000004 -#define CPUTPM2_EFFREQ 0x00000001 - -/* - * Important bits in the AMD extended cpuid flags - */ -#define AMDID_SYSCALL 0x00000800 -#define AMDID_MP 0x00080000 -#define AMDID_NX 0x00100000 -#define AMDID_EXT_MMX 0x00400000 -#define AMDID_FFXSR 0x01000000 -#define AMDID_PAGE1GB 0x04000000 -#define AMDID_RDTSCP 0x08000000 -#define AMDID_LM 0x20000000 -#define AMDID_EXT_3DNOW 0x40000000 -#define AMDID_3DNOW 0x80000000 - -#define AMDID2_LAHF 0x00000001 -#define AMDID2_CMP 0x00000002 -#define AMDID2_SVM 0x00000004 -#define AMDID2_EXT_APIC 0x00000008 -#define AMDID2_CR8 0x00000010 -#define AMDID2_ABM 0x00000020 -#define AMDID2_SSE4A 0x00000040 -#define AMDID2_MAS 0x00000080 -#define AMDID2_PREFETCH 0x00000100 -#define AMDID2_OSVW 0x00000200 -#define AMDID2_IBS 0x00000400 -#define AMDID2_XOP 0x00000800 -#define AMDID2_SKINIT 0x00001000 -#define AMDID2_WDT 0x00002000 -#define AMDID2_LWP 0x00008000 -#define AMDID2_FMA4 0x00010000 -#define AMDID2_NODE_ID 0x00080000 -#define AMDID2_TBM 0x00200000 -#define AMDID2_TOPOLOGY 0x00400000 - -/* - * CPUID instruction 1 eax info - */ -#define CPUID_STEPPING 0x0000000f -#define CPUID_MODEL 0x000000f0 -#define CPUID_FAMILY 0x00000f00 -#define CPUID_EXT_MODEL 0x000f0000 -#define CPUID_EXT_FAMILY 0x0ff00000 -#define CPUID_TO_MODEL(id) \ - ((((id) & CPUID_MODEL) >> 4) | \ - (((id) & CPUID_EXT_MODEL) >> 12)) -#define CPUID_TO_FAMILY(id) \ - ((((id) & CPUID_FAMILY) >> 8) + \ - (((id) & CPUID_EXT_FAMILY) >> 20)) - -/* - * CPUID instruction 1 ebx info - */ -#define CPUID_BRAND_INDEX 0x000000ff -#define CPUID_CLFUSH_SIZE 0x0000ff00 -#define CPUID_HTT_CORES 0x00ff0000 -#define CPUID_LOCAL_APIC_ID 0xff000000 - -/* - * CPUID instruction 6 ecx info - */ -#define CPUID_PERF_STAT 0x00000001 -#define CPUID_PERF_BIAS 0x00000008 - -/* - * CPUID instruction 0xb ebx info. - */ -#define CPUID_TYPE_INVAL 0 -#define CPUID_TYPE_SMT 1 -#define CPUID_TYPE_CORE 2 - -/* - * AMD extended function 8000_0007h edx info - */ -#define AMDPM_TS 0x00000001 -#define AMDPM_FID 0x00000002 -#define AMDPM_VID 0x00000004 -#define AMDPM_TTP 0x00000008 -#define AMDPM_TM 0x00000010 -#define AMDPM_STC 0x00000020 -#define AMDPM_100MHZ_STEPS 0x00000040 -#define AMDPM_HW_PSTATE 0x00000080 -#define AMDPM_TSC_INVARIANT 0x00000100 -#define AMDPM_CPB 0x00000200 - -/* - * AMD extended function 8000_0008h ecx info - */ -#define AMDID_CMP_CORES 0x000000ff -#define AMDID_COREID_SIZE 0x0000f000 -#define AMDID_COREID_SIZE_SHIFT 12 - -/* - * CPUID manufacturers identifiers - */ -#define AMD_VENDOR_ID "AuthenticAMD" -#define CENTAUR_VENDOR_ID "CentaurHauls" -#define INTEL_VENDOR_ID "GenuineIntel" - -/* - * Model-specific registers for the i386 family - */ -#define MSR_P5_MC_ADDR 0x000 -#define MSR_P5_MC_TYPE 0x001 -#define MSR_TSC 0x010 -#define MSR_P5_CESR 0x011 -#define MSR_P5_CTR0 0x012 -#define MSR_P5_CTR1 0x013 -#define MSR_IA32_PLATFORM_ID 0x017 -#define MSR_APICBASE 0x01b -#define MSR_EBL_CR_POWERON 0x02a -#define MSR_TEST_CTL 0x033 -#define MSR_BIOS_UPDT_TRIG 0x079 -#define MSR_BBL_CR_D0 0x088 -#define MSR_BBL_CR_D1 0x089 -#define MSR_BBL_CR_D2 0x08a -#define MSR_BIOS_SIGN 0x08b -#define MSR_PERFCTR0 0x0c1 -#define MSR_PERFCTR1 0x0c2 -#define MSR_MPERF 0x0e7 -#define MSR_APERF 0x0e8 -#define MSR_IA32_EXT_CONFIG 0x0ee /* Undocumented. Core Solo/Duo only */ -#define MSR_MTRRcap 0x0fe -#define MSR_BBL_CR_ADDR 0x116 -#define MSR_BBL_CR_DECC 0x118 -#define MSR_BBL_CR_CTL 0x119 -#define MSR_BBL_CR_TRIG 0x11a -#define MSR_BBL_CR_BUSY 0x11b -#define MSR_BBL_CR_CTL3 0x11e -#define MSR_SYSENTER_CS_MSR 0x174 -#define MSR_SYSENTER_ESP_MSR 0x175 -#define MSR_SYSENTER_EIP_MSR 0x176 -#define MSR_MCG_CAP 0x179 -#define MSR_MCG_STATUS 0x17a -#define MSR_MCG_CTL 0x17b -#define MSR_EVNTSEL0 0x186 -#define MSR_EVNTSEL1 0x187 -#define MSR_THERM_CONTROL 0x19a -#define MSR_THERM_INTERRUPT 0x19b -#define MSR_THERM_STATUS 0x19c -#define MSR_IA32_MISC_ENABLE 0x1a0 -#define MSR_IA32_TEMPERATURE_TARGET 0x1a2 -#define MSR_DEBUGCTLMSR 0x1d9 -#define MSR_LASTBRANCHFROMIP 0x1db -#define MSR_LASTBRANCHTOIP 0x1dc -#define MSR_LASTINTFROMIP 0x1dd -#define MSR_LASTINTTOIP 0x1de -#define MSR_ROB_CR_BKUPTMPDR6 0x1e0 -#define MSR_MTRRVarBase 0x200 -#define MSR_MTRR64kBase 0x250 -#define MSR_MTRR16kBase 0x258 -#define MSR_MTRR4kBase 0x268 -#define MSR_PAT 0x277 -#define MSR_MC0_CTL2 0x280 -#define MSR_MTRRdefType 0x2ff -#define MSR_MC0_CTL 0x400 -#define MSR_MC0_STATUS 0x401 -#define MSR_MC0_ADDR 0x402 -#define MSR_MC0_MISC 0x403 -#define MSR_MC1_CTL 0x404 -#define MSR_MC1_STATUS 0x405 -#define MSR_MC1_ADDR 0x406 -#define MSR_MC1_MISC 0x407 -#define MSR_MC2_CTL 0x408 -#define MSR_MC2_STATUS 0x409 -#define MSR_MC2_ADDR 0x40a -#define MSR_MC2_MISC 0x40b -#define MSR_MC3_CTL 0x40c -#define MSR_MC3_STATUS 0x40d -#define MSR_MC3_ADDR 0x40e -#define MSR_MC3_MISC 0x40f -#define MSR_MC4_CTL 0x410 -#define MSR_MC4_STATUS 0x411 -#define MSR_MC4_ADDR 0x412 -#define MSR_MC4_MISC 0x413 - -/* - * Constants related to MSR's. - */ -#define APICBASE_RESERVED 0x000006ff -#define APICBASE_BSP 0x00000100 -#define APICBASE_ENABLED 0x00000800 -#define APICBASE_ADDRESS 0xfffff000 - -/* - * PAT modes. - */ -#define PAT_UNCACHEABLE 0x00 -#define PAT_WRITE_COMBINING 0x01 -#define PAT_WRITE_THROUGH 0x04 -#define PAT_WRITE_PROTECTED 0x05 -#define PAT_WRITE_BACK 0x06 -#define PAT_UNCACHED 0x07 -#define PAT_VALUE(i, m) ((long)(m) << (8 * (i))) -#define PAT_MASK(i) PAT_VALUE(i, 0xff) - -/* - * Constants related to MTRRs - */ -#define MTRR_UNCACHEABLE 0x00 -#define MTRR_WRITE_COMBINING 0x01 -#define MTRR_WRITE_THROUGH 0x04 -#define MTRR_WRITE_PROTECTED 0x05 -#define MTRR_WRITE_BACK 0x06 -#define MTRR_N64K 8 /* numbers of fixed-size entries */ -#define MTRR_N16K 16 -#define MTRR_N4K 64 -#define MTRR_CAP_WC 0x0000000000000400 -#define MTRR_CAP_FIXED 0x0000000000000100 -#define MTRR_CAP_VCNT 0x00000000000000ff -#define MTRR_DEF_ENABLE 0x0000000000000800 -#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400 -#define MTRR_DEF_TYPE 0x00000000000000ff -#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000 -#define MTRR_PHYSBASE_TYPE 0x00000000000000ff -#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000 -#define MTRR_PHYSMASK_VALID 0x0000000000000800 - -/* Performance Control Register (5x86 only). */ -#define PCR0 0x20 -#define PCR0_RSTK 0x01 /* Enables return stack */ -#define PCR0_BTB 0x02 /* Enables branch target buffer */ -#define PCR0_LOOP 0x04 /* Enables loop */ -#define PCR0_AIS 0x08 /* Enables all instrcutions stalled to - serialize pipe. */ -#define PCR0_MLR 0x10 /* Enables reordering of misaligned loads */ -#define PCR0_BTBRT 0x40 /* Enables BTB test register. */ -#define PCR0_LSSER 0x80 /* Disable reorder */ - -/* Device Identification Registers */ -#define DIR0 0xfe -#define DIR1 0xff - -/* - * Machine Check register constants. - */ -#define MCG_CAP_COUNT 0x000000ff -#define MCG_CAP_CTL_P 0x00000100 -#define MCG_CAP_EXT_P 0x00000200 -#define MCG_CAP_CMCI_P 0x00000400 -#define MCG_CAP_TES_P 0x00000800 -#define MCG_CAP_EXT_CNT 0x00ff0000 -#define MCG_CAP_SER_P 0x01000000 -#define MCG_STATUS_RIPV 0x00000001 -#define MCG_STATUS_EIPV 0x00000002 -#define MCG_STATUS_MCIP 0x00000004 -#define MCG_CTL_ENABLE 0xffffffffffffffff -#define MCG_CTL_DISABLE 0x0000000000000000 -#define MSR_MC_CTL(x) (MSR_MC0_CTL + (x) * 4) -#define MSR_MC_STATUS(x) (MSR_MC0_STATUS + (x) * 4) -#define MSR_MC_ADDR(x) (MSR_MC0_ADDR + (x) * 4) -#define MSR_MC_MISC(x) (MSR_MC0_MISC + (x) * 4) -#define MSR_MC_CTL2(x) (MSR_MC0_CTL2 + (x)) /* If MCG_CAP_CMCI_P */ -#define MC_STATUS_MCA_ERROR 0x000000000000ffff -#define MC_STATUS_MODEL_ERROR 0x00000000ffff0000 -#define MC_STATUS_OTHER_INFO 0x01ffffff00000000 -#define MC_STATUS_COR_COUNT 0x001fffc000000000 /* If MCG_CAP_CMCI_P */ -#define MC_STATUS_TES_STATUS 0x0060000000000000 /* If MCG_CAP_TES_P */ -#define MC_STATUS_AR 0x0080000000000000 /* If MCG_CAP_TES_P */ -#define MC_STATUS_S 0x0100000000000000 /* If MCG_CAP_TES_P */ -#define MC_STATUS_PCC 0x0200000000000000 -#define MC_STATUS_ADDRV 0x0400000000000000 -#define MC_STATUS_MISCV 0x0800000000000000 -#define MC_STATUS_EN 0x1000000000000000 -#define MC_STATUS_UC 0x2000000000000000 -#define MC_STATUS_OVER 0x4000000000000000 -#define MC_STATUS_VAL 0x8000000000000000 -#define MC_MISC_RA_LSB 0x000000000000003f /* If MCG_CAP_SER_P */ -#define MC_MISC_ADDRESS_MODE 0x00000000000001c0 /* If MCG_CAP_SER_P */ -#define MC_CTL2_THRESHOLD 0x0000000000007fff -#define MC_CTL2_CMCI_EN 0x0000000040000000 - -/* - * The following four 3-byte registers control the non-cacheable regions. - * These registers must be written as three separate bytes. - * - * NCRx+0: A31-A24 of starting address - * NCRx+1: A23-A16 of starting address - * NCRx+2: A15-A12 of starting address | NCR_SIZE_xx. - * - * The non-cacheable region's starting address must be aligned to the - * size indicated by the NCR_SIZE_xx field. - */ -#define NCR1 0xc4 -#define NCR2 0xc7 -#define NCR3 0xca -#define NCR4 0xcd - -#define NCR_SIZE_0K 0 -#define NCR_SIZE_4K 1 -#define NCR_SIZE_8K 2 -#define NCR_SIZE_16K 3 -#define NCR_SIZE_32K 4 -#define NCR_SIZE_64K 5 -#define NCR_SIZE_128K 6 -#define NCR_SIZE_256K 7 -#define NCR_SIZE_512K 8 -#define NCR_SIZE_1M 9 -#define NCR_SIZE_2M 10 -#define NCR_SIZE_4M 11 -#define NCR_SIZE_8M 12 -#define NCR_SIZE_16M 13 -#define NCR_SIZE_32M 14 -#define NCR_SIZE_4G 15 - -/* - * The address region registers are used to specify the location and - * size for the eight address regions. - * - * ARRx + 0: A31-A24 of start address - * ARRx + 1: A23-A16 of start address - * ARRx + 2: A15-A12 of start address | ARR_SIZE_xx - */ -#define ARR0 0xc4 -#define ARR1 0xc7 -#define ARR2 0xca -#define ARR3 0xcd -#define ARR4 0xd0 -#define ARR5 0xd3 -#define ARR6 0xd6 -#define ARR7 0xd9 - -#define ARR_SIZE_0K 0 -#define ARR_SIZE_4K 1 -#define ARR_SIZE_8K 2 -#define ARR_SIZE_16K 3 -#define ARR_SIZE_32K 4 -#define ARR_SIZE_64K 5 -#define ARR_SIZE_128K 6 -#define ARR_SIZE_256K 7 -#define ARR_SIZE_512K 8 -#define ARR_SIZE_1M 9 -#define ARR_SIZE_2M 10 -#define ARR_SIZE_4M 11 -#define ARR_SIZE_8M 12 -#define ARR_SIZE_16M 13 -#define ARR_SIZE_32M 14 -#define ARR_SIZE_4G 15 - -/* - * The region control registers specify the attributes associated with - * the ARRx addres regions. - */ -#define RCR0 0xdc -#define RCR1 0xdd -#define RCR2 0xde -#define RCR3 0xdf -#define RCR4 0xe0 -#define RCR5 0xe1 -#define RCR6 0xe2 -#define RCR7 0xe3 - -#define RCR_RCD 0x01 /* Disables caching for ARRx (x = 0-6). */ -#define RCR_RCE 0x01 /* Enables caching for ARR7. */ -#define RCR_WWO 0x02 /* Weak write ordering. */ -#define RCR_WL 0x04 /* Weak locking. */ -#define RCR_WG 0x08 /* Write gathering. */ -#define RCR_WT 0x10 /* Write-through. */ -#define RCR_NLB 0x20 /* LBA# pin is not asserted. */ - -/* AMD Write Allocate Top-Of-Memory and Control Register */ -#define AMD_WT_ALLOC_TME 0x40000 /* top-of-memory enable */ -#define AMD_WT_ALLOC_PRE 0x20000 /* programmable range enable */ -#define AMD_WT_ALLOC_FRE 0x10000 /* fixed (A0000-FFFFF) range enable */ - -/* AMD64 MSR's */ -#define MSR_EFER 0xc0000080 /* extended features */ -#define MSR_STAR 0xc0000081 /* legacy mode SYSCALL target/cs/ss */ -#define MSR_LSTAR 0xc0000082 /* long mode SYSCALL target rip */ -#define MSR_CSTAR 0xc0000083 /* compat mode SYSCALL target rip */ -#define MSR_SF_MASK 0xc0000084 /* syscall flags mask */ -#define MSR_FSBASE 0xc0000100 /* base address of the %fs "segment" */ -#define MSR_GSBASE 0xc0000101 /* base address of the %gs "segment" */ -#define MSR_KGSBASE 0xc0000102 /* base address of the kernel %gs */ -#define MSR_PERFEVSEL0 0xc0010000 -#define MSR_PERFEVSEL1 0xc0010001 -#define MSR_PERFEVSEL2 0xc0010002 -#define MSR_PERFEVSEL3 0xc0010003 -#undef MSR_PERFCTR0 -#undef MSR_PERFCTR1 -#define MSR_PERFCTR0 0xc0010004 -#define MSR_PERFCTR1 0xc0010005 -#define MSR_PERFCTR2 0xc0010006 -#define MSR_PERFCTR3 0xc0010007 -#define MSR_SYSCFG 0xc0010010 -#define MSR_HWCR 0xc0010015 -#define MSR_IORRBASE0 0xc0010016 -#define MSR_IORRMASK0 0xc0010017 -#define MSR_IORRBASE1 0xc0010018 -#define MSR_IORRMASK1 0xc0010019 -#define MSR_TOP_MEM 0xc001001a /* boundary for ram below 4G */ -#define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */ -#define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ -#define MSR_MC0_CTL_MASK 0xc0010044 - -/* VIA ACE crypto featureset: for via_feature_rng */ -#define VIA_HAS_RNG 1 /* cpu has RNG */ - -/* VIA ACE crypto featureset: for via_feature_xcrypt */ -#define VIA_HAS_AES 1 /* cpu has AES */ -#define VIA_HAS_SHA 2 /* cpu has SHA1 & SHA256 */ -#define VIA_HAS_MM 4 /* cpu has RSA instructions */ -#define VIA_HAS_AESCTR 8 /* cpu has AES-CTR instructions */ - -/* Centaur Extended Feature flags */ -#define VIA_CPUID_HAS_RNG 0x000004 -#define VIA_CPUID_DO_RNG 0x000008 -#define VIA_CPUID_HAS_ACE 0x000040 -#define VIA_CPUID_DO_ACE 0x000080 -#define VIA_CPUID_HAS_ACE2 0x000100 -#define VIA_CPUID_DO_ACE2 0x000200 -#define VIA_CPUID_HAS_PHE 0x000400 -#define VIA_CPUID_DO_PHE 0x000800 -#define VIA_CPUID_HAS_PMM 0x001000 -#define VIA_CPUID_DO_PMM 0x002000 - -/* VIA ACE xcrypt-* instruction context control options */ -#define VIA_CRYPT_CWLO_ROUND_M 0x0000000f -#define VIA_CRYPT_CWLO_ALG_M 0x00000070 -#define VIA_CRYPT_CWLO_ALG_AES 0x00000000 -#define VIA_CRYPT_CWLO_KEYGEN_M 0x00000080 -#define VIA_CRYPT_CWLO_KEYGEN_HW 0x00000000 -#define VIA_CRYPT_CWLO_KEYGEN_SW 0x00000080 -#define VIA_CRYPT_CWLO_NORMAL 0x00000000 -#define VIA_CRYPT_CWLO_INTERMEDIATE 0x00000100 -#define VIA_CRYPT_CWLO_ENCRYPT 0x00000000 -#define VIA_CRYPT_CWLO_DECRYPT 0x00000200 -#define VIA_CRYPT_CWLO_KEY128 0x0000000a /* 128bit, 10 rds */ -#define VIA_CRYPT_CWLO_KEY192 0x0000040c /* 192bit, 12 rds */ -#define VIA_CRYPT_CWLO_KEY256 0x0000080e /* 256bit, 15 rds */ - -#endif /* !_MACHINE_SPECIALREG_H_ */ +#include Modified: head/sys/i386/include/specialreg.h ============================================================================== --- head/sys/i386/include/specialreg.h Mon Mar 19 21:33:35 2012 (r233206) +++ head/sys/i386/include/specialreg.h Mon Mar 19 21:34:11 2012 (r233207) @@ -1,630 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)specialreg.h 7.1 (Berkeley) 5/9/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_SPECIALREG_H_ -#define _MACHINE_SPECIALREG_H_ - -/* - * Bits in 386 special registers: - */ -#define CR0_PE 0x00000001 /* Protected mode Enable */ -#define CR0_MP 0x00000002 /* "Math" (fpu) Present */ -#define CR0_EM 0x00000004 /* EMulate FPU instructions. (trap ESC only) */ -#define CR0_TS 0x00000008 /* Task Switched (if MP, trap ESC and WAIT) */ -#define CR0_PG 0x80000000 /* PaGing enable */ - -/* - * Bits in 486 special registers: - */ -#define CR0_NE 0x00000020 /* Numeric Error enable (EX16 vs IRQ13) */ -#define CR0_WP 0x00010000 /* Write Protect (honor page protect in - all modes) */ -#define CR0_AM 0x00040000 /* Alignment Mask (set to enable AC flag) */ -#define CR0_NW 0x20000000 /* Not Write-through */ -#define CR0_CD 0x40000000 /* Cache Disable */ - -/* - * Bits in PPro special registers - */ -#define CR4_VME 0x00000001 /* Virtual 8086 mode extensions */ -#define CR4_PVI 0x00000002 /* Protected-mode virtual interrupts */ -#define CR4_TSD 0x00000004 /* Time stamp disable */ -#define CR4_DE 0x00000008 /* Debugging extensions */ -#define CR4_PSE 0x00000010 /* Page size extensions */ -#define CR4_PAE 0x00000020 /* Physical address extension */ -#define CR4_MCE 0x00000040 /* Machine check enable */ -#define CR4_PGE 0x00000080 /* Page global enable */ -#define CR4_PCE 0x00000100 /* Performance monitoring counter enable */ -#define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ -#define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ -#define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ - -/* - * Bits in AMD64 special registers. EFER is 64 bits wide. - */ -#define EFER_NXE 0x000000800 /* PTE No-Execute bit enable (R/W) */ - -/* - * CPUID instruction features register - */ -#define CPUID_FPU 0x00000001 -#define CPUID_VME 0x00000002 -#define CPUID_DE 0x00000004 -#define CPUID_PSE 0x00000008 -#define CPUID_TSC 0x00000010 -#define CPUID_MSR 0x00000020 -#define CPUID_PAE 0x00000040 -#define CPUID_MCE 0x00000080 -#define CPUID_CX8 0x00000100 -#define CPUID_APIC 0x00000200 -#define CPUID_B10 0x00000400 -#define CPUID_SEP 0x00000800 -#define CPUID_MTRR 0x00001000 -#define CPUID_PGE 0x00002000 -#define CPUID_MCA 0x00004000 -#define CPUID_CMOV 0x00008000 -#define CPUID_PAT 0x00010000 -#define CPUID_PSE36 0x00020000 -#define CPUID_PSN 0x00040000 -#define CPUID_CLFSH 0x00080000 -#define CPUID_B20 0x00100000 -#define CPUID_DS 0x00200000 -#define CPUID_ACPI 0x00400000 -#define CPUID_MMX 0x00800000 -#define CPUID_FXSR 0x01000000 -#define CPUID_SSE 0x02000000 -#define CPUID_XMM 0x02000000 -#define CPUID_SSE2 0x04000000 -#define CPUID_SS 0x08000000 -#define CPUID_HTT 0x10000000 -#define CPUID_TM 0x20000000 -#define CPUID_IA64 0x40000000 -#define CPUID_PBE 0x80000000 - -#define CPUID2_SSE3 0x00000001 -#define CPUID2_PCLMULQDQ 0x00000002 -#define CPUID2_DTES64 0x00000004 -#define CPUID2_MON 0x00000008 -#define CPUID2_DS_CPL 0x00000010 -#define CPUID2_VMX 0x00000020 -#define CPUID2_SMX 0x00000040 -#define CPUID2_EST 0x00000080 -#define CPUID2_TM2 0x00000100 -#define CPUID2_SSSE3 0x00000200 -#define CPUID2_CNXTID 0x00000400 -#define CPUID2_FMA 0x00001000 -#define CPUID2_CX16 0x00002000 -#define CPUID2_XTPR 0x00004000 -#define CPUID2_PDCM 0x00008000 -#define CPUID2_PCID 0x00020000 -#define CPUID2_DCA 0x00040000 -#define CPUID2_SSE41 0x00080000 -#define CPUID2_SSE42 0x00100000 -#define CPUID2_X2APIC 0x00200000 -#define CPUID2_MOVBE 0x00400000 -#define CPUID2_POPCNT 0x00800000 -#define CPUID2_TSCDLT 0x01000000 -#define CPUID2_AESNI 0x02000000 -#define CPUID2_XSAVE 0x04000000 -#define CPUID2_OSXSAVE 0x08000000 -#define CPUID2_AVX 0x10000000 -#define CPUID2_F16C 0x20000000 -#define CPUID2_HV 0x80000000 - -/* - * Important bits in the Thermal and Power Management flags - * CPUID.6 EAX and ECX. - */ -#define CPUTPM1_SENSOR 0x00000001 -#define CPUTPM1_TURBO 0x00000002 -#define CPUTPM1_ARAT 0x00000004 -#define CPUTPM2_EFFREQ 0x00000001 - -/* - * Important bits in the AMD extended cpuid flags - */ -#define AMDID_SYSCALL 0x00000800 -#define AMDID_MP 0x00080000 -#define AMDID_NX 0x00100000 -#define AMDID_EXT_MMX 0x00400000 -#define AMDID_FFXSR 0x01000000 -#define AMDID_PAGE1GB 0x04000000 -#define AMDID_RDTSCP 0x08000000 -#define AMDID_LM 0x20000000 -#define AMDID_EXT_3DNOW 0x40000000 -#define AMDID_3DNOW 0x80000000 - -#define AMDID2_LAHF 0x00000001 -#define AMDID2_CMP 0x00000002 -#define AMDID2_SVM 0x00000004 -#define AMDID2_EXT_APIC 0x00000008 -#define AMDID2_CR8 0x00000010 -#define AMDID2_ABM 0x00000020 -#define AMDID2_SSE4A 0x00000040 -#define AMDID2_MAS 0x00000080 -#define AMDID2_PREFETCH 0x00000100 -#define AMDID2_OSVW 0x00000200 -#define AMDID2_IBS 0x00000400 -#define AMDID2_XOP 0x00000800 -#define AMDID2_SKINIT 0x00001000 -#define AMDID2_WDT 0x00002000 -#define AMDID2_LWP 0x00008000 -#define AMDID2_FMA4 0x00010000 -#define AMDID2_NODE_ID 0x00080000 -#define AMDID2_TBM 0x00200000 -#define AMDID2_TOPOLOGY 0x00400000 - -/* - * CPUID instruction 1 eax info - */ -#define CPUID_STEPPING 0x0000000f -#define CPUID_MODEL 0x000000f0 -#define CPUID_FAMILY 0x00000f00 -#define CPUID_EXT_MODEL 0x000f0000 -#define CPUID_EXT_FAMILY 0x0ff00000 -#define CPUID_TO_MODEL(id) \ - ((((id) & CPUID_MODEL) >> 4) | \ - ((((id) & CPUID_FAMILY) >= 0x600) ? \ - (((id) & CPUID_EXT_MODEL) >> 12) : 0)) -#define CPUID_TO_FAMILY(id) \ - ((((id) & CPUID_FAMILY) >> 8) + \ - ((((id) & CPUID_FAMILY) == 0xf00) ? \ - (((id) & CPUID_EXT_FAMILY) >> 20) : 0)) - -/* - * CPUID instruction 1 ebx info - */ -#define CPUID_BRAND_INDEX 0x000000ff -#define CPUID_CLFUSH_SIZE 0x0000ff00 -#define CPUID_HTT_CORES 0x00ff0000 -#define CPUID_LOCAL_APIC_ID 0xff000000 - -/* - * CPUID instruction 6 ecx info - */ -#define CPUID_PERF_STAT 0x00000001 -#define CPUID_PERF_BIAS 0x00000008 - -/* - * CPUID instruction 0xb ebx info. - */ -#define CPUID_TYPE_INVAL 0 -#define CPUID_TYPE_SMT 1 -#define CPUID_TYPE_CORE 2 - -/* - * AMD extended function 8000_0007h edx info - */ -#define AMDPM_TS 0x00000001 -#define AMDPM_FID 0x00000002 -#define AMDPM_VID 0x00000004 -#define AMDPM_TTP 0x00000008 -#define AMDPM_TM 0x00000010 -#define AMDPM_STC 0x00000020 -#define AMDPM_100MHZ_STEPS 0x00000040 -#define AMDPM_HW_PSTATE 0x00000080 -#define AMDPM_TSC_INVARIANT 0x00000100 -#define AMDPM_CPB 0x00000200 - -/* - * AMD extended function 8000_0008h ecx info - */ -#define AMDID_CMP_CORES 0x000000ff -#define AMDID_COREID_SIZE 0x0000f000 -#define AMDID_COREID_SIZE_SHIFT 12 - -/* - * CPUID manufacturers identifiers - */ -#define AMD_VENDOR_ID "AuthenticAMD" -#define CENTAUR_VENDOR_ID "CentaurHauls" -#define CYRIX_VENDOR_ID "CyrixInstead" -#define INTEL_VENDOR_ID "GenuineIntel" -#define NEXGEN_VENDOR_ID "NexGenDriven" -#define NSC_VENDOR_ID "Geode by NSC" -#define RISE_VENDOR_ID "RiseRiseRise" -#define SIS_VENDOR_ID "SiS SiS SiS " -#define TRANSMETA_VENDOR_ID "GenuineTMx86" -#define UMC_VENDOR_ID "UMC UMC UMC " - -/* - * Model-specific registers for the i386 family - */ -#define MSR_P5_MC_ADDR 0x000 -#define MSR_P5_MC_TYPE 0x001 -#define MSR_TSC 0x010 -#define MSR_P5_CESR 0x011 -#define MSR_P5_CTR0 0x012 -#define MSR_P5_CTR1 0x013 -#define MSR_IA32_PLATFORM_ID 0x017 -#define MSR_APICBASE 0x01b -#define MSR_EBL_CR_POWERON 0x02a -#define MSR_TEST_CTL 0x033 -#define MSR_BIOS_UPDT_TRIG 0x079 -#define MSR_BBL_CR_D0 0x088 -#define MSR_BBL_CR_D1 0x089 -#define MSR_BBL_CR_D2 0x08a -#define MSR_BIOS_SIGN 0x08b -#define MSR_PERFCTR0 0x0c1 -#define MSR_PERFCTR1 0x0c2 -#define MSR_MPERF 0x0e7 -#define MSR_APERF 0x0e8 -#define MSR_IA32_EXT_CONFIG 0x0ee /* Undocumented. Core Solo/Duo only */ -#define MSR_MTRRcap 0x0fe -#define MSR_BBL_CR_ADDR 0x116 -#define MSR_BBL_CR_DECC 0x118 -#define MSR_BBL_CR_CTL 0x119 -#define MSR_BBL_CR_TRIG 0x11a -#define MSR_BBL_CR_BUSY 0x11b -#define MSR_BBL_CR_CTL3 0x11e -#define MSR_SYSENTER_CS_MSR 0x174 -#define MSR_SYSENTER_ESP_MSR 0x175 -#define MSR_SYSENTER_EIP_MSR 0x176 -#define MSR_MCG_CAP 0x179 -#define MSR_MCG_STATUS 0x17a -#define MSR_MCG_CTL 0x17b -#define MSR_EVNTSEL0 0x186 -#define MSR_EVNTSEL1 0x187 -#define MSR_THERM_CONTROL 0x19a -#define MSR_THERM_INTERRUPT 0x19b -#define MSR_THERM_STATUS 0x19c -#define MSR_IA32_MISC_ENABLE 0x1a0 -#define MSR_IA32_TEMPERATURE_TARGET 0x1a2 -#define MSR_DEBUGCTLMSR 0x1d9 -#define MSR_LASTBRANCHFROMIP 0x1db -#define MSR_LASTBRANCHTOIP 0x1dc -#define MSR_LASTINTFROMIP 0x1dd -#define MSR_LASTINTTOIP 0x1de -#define MSR_ROB_CR_BKUPTMPDR6 0x1e0 -#define MSR_MTRRVarBase 0x200 -#define MSR_MTRR64kBase 0x250 -#define MSR_MTRR16kBase 0x258 -#define MSR_MTRR4kBase 0x268 -#define MSR_PAT 0x277 -#define MSR_MC0_CTL2 0x280 -#define MSR_MTRRdefType 0x2ff -#define MSR_MC0_CTL 0x400 -#define MSR_MC0_STATUS 0x401 -#define MSR_MC0_ADDR 0x402 -#define MSR_MC0_MISC 0x403 -#define MSR_MC1_CTL 0x404 -#define MSR_MC1_STATUS 0x405 -#define MSR_MC1_ADDR 0x406 -#define MSR_MC1_MISC 0x407 -#define MSR_MC2_CTL 0x408 -#define MSR_MC2_STATUS 0x409 -#define MSR_MC2_ADDR 0x40a -#define MSR_MC2_MISC 0x40b -#define MSR_MC3_CTL 0x40c -#define MSR_MC3_STATUS 0x40d -#define MSR_MC3_ADDR 0x40e -#define MSR_MC3_MISC 0x40f -#define MSR_MC4_CTL 0x410 -#define MSR_MC4_STATUS 0x411 -#define MSR_MC4_ADDR 0x412 -#define MSR_MC4_MISC 0x413 - -/* - * Constants related to MSR's. - */ -#define APICBASE_RESERVED 0x000006ff -#define APICBASE_BSP 0x00000100 -#define APICBASE_ENABLED 0x00000800 -#define APICBASE_ADDRESS 0xfffff000 - -/* - * PAT modes. - */ -#define PAT_UNCACHEABLE 0x00 -#define PAT_WRITE_COMBINING 0x01 -#define PAT_WRITE_THROUGH 0x04 -#define PAT_WRITE_PROTECTED 0x05 -#define PAT_WRITE_BACK 0x06 -#define PAT_UNCACHED 0x07 -#define PAT_VALUE(i, m) ((long long)(m) << (8 * (i))) -#define PAT_MASK(i) PAT_VALUE(i, 0xff) - -/* - * Constants related to MTRRs - */ -#define MTRR_UNCACHEABLE 0x00 -#define MTRR_WRITE_COMBINING 0x01 -#define MTRR_WRITE_THROUGH 0x04 -#define MTRR_WRITE_PROTECTED 0x05 -#define MTRR_WRITE_BACK 0x06 -#define MTRR_N64K 8 /* numbers of fixed-size entries */ -#define MTRR_N16K 16 -#define MTRR_N4K 64 -#define MTRR_CAP_WC 0x0000000000000400 -#define MTRR_CAP_FIXED 0x0000000000000100 -#define MTRR_CAP_VCNT 0x00000000000000ff -#define MTRR_DEF_ENABLE 0x0000000000000800 -#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400 -#define MTRR_DEF_TYPE 0x00000000000000ff -#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000 -#define MTRR_PHYSBASE_TYPE 0x00000000000000ff -#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000 -#define MTRR_PHYSMASK_VALID 0x0000000000000800 - -/* - * Cyrix configuration registers, accessible as IO ports. - */ -#define CCR0 0xc0 /* Configuration control register 0 */ -#define CCR0_NC0 0x01 /* First 64K of each 1M memory region is - non-cacheable */ -#define CCR0_NC1 0x02 /* 640K-1M region is non-cacheable */ -#define CCR0_A20M 0x04 /* Enables A20M# input pin */ -#define CCR0_KEN 0x08 /* Enables KEN# input pin */ -#define CCR0_FLUSH 0x10 /* Enables FLUSH# input pin */ -#define CCR0_BARB 0x20 /* Flushes internal cache when entering hold - state */ -#define CCR0_CO 0x40 /* Cache org: 1=direct mapped, 0=2x set - assoc */ -#define CCR0_SUSPEND 0x80 /* Enables SUSP# and SUSPA# pins */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 21:39:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id 1BD651065670; Mon, 19 Mar 2012 21:39:53 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id AE04914DA04; Mon, 19 Mar 2012 21:39:52 +0000 (UTC) Message-ID: <4F67A7A9.50003@FreeBSD.org> Date: Mon, 19 Mar 2012 14:39:53 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120312 Thunderbird/11.0 MIME-Version: 1.0 To: Dimitry Andric References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <20120317162754.I1530@besplex.bde.org> <4F678B03.8050307@FreeBSD.org> In-Reply-To: <4F678B03.8050307@FreeBSD.org> X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , Chris Rees Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 21:39:53 -0000 On 3/19/2012 12:37 PM, Dimitry Andric wrote: > It would be much nicer to be able to write: > > .if defined(FOO) > .if defined(BAR) > CFLAGS+= -DFOO_BAR > .endif > .endif Take a look at /usr/ports/Mk/bsd.port.mk for how this can be done. -- This .signature sanitized for your protection From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 21:47:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36A38106566C; Mon, 19 Mar 2012 21:47:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21A168FC0C; Mon, 19 Mar 2012 21:47:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JLloqZ087760; Mon, 19 Mar 2012 21:47:50 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JLloX8087758; Mon, 19 Mar 2012 21:47:50 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203192147.q2JLloX8087758@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Mar 2012 21:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233208 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 21:47:51 -0000 Author: jkim Date: Mon Mar 19 21:47:50 2012 New Revision: 233208 URL: http://svn.freebsd.org/changeset/base/233208 Log: Fix a witness panic introduced in r231797. Reported by: bschmidt Reviewed by: jhb Pointy hat to: jkim MFC after: 3 days Modified: head/sys/amd64/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Mon Mar 19 21:34:11 2012 (r233207) +++ head/sys/amd64/acpica/acpi_wakeup.c Mon Mar 19 21:47:50 2012 (r233208) @@ -241,8 +241,8 @@ acpi_sleep_machdep(struct acpi_softc *sc AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); - spinlock_enter(); intr_suspend(); + spinlock_enter(); if (savectx(susppcbs[0])) { ctx_fpusave(suspfpusave[0]); @@ -299,8 +299,8 @@ out: #endif mca_resume(); - intr_resume(); spinlock_exit(); + intr_resume(); AcpiSetFirmwareWakingVector(0); From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 21:57:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98507106564A; Mon, 19 Mar 2012 21:57:32 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8195F8FC0A; Mon, 19 Mar 2012 21:57:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JLvWhZ088105; Mon, 19 Mar 2012 21:57:32 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JLvWUB088100; Mon, 19 Mar 2012 21:57:32 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203192157.q2JLvWUB088100@svn.freebsd.org> From: Tijl Coosemans Date: Mon, 19 Mar 2012 21:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233209 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 21:57:32 -0000 Author: tijl Date: Mon Mar 19 21:57:31 2012 New Revision: 233209 URL: http://svn.freebsd.org/changeset/base/233209 Log: Copy amd64 sysarch.h to x86 and merge with i386 sysarch.h. Replace amd64/i386/pc98 sysarch.h with stubs. Added: head/sys/x86/include/sysarch.h - copied, changed from r233203, head/sys/amd64/include/sysarch.h Modified: head/sys/amd64/include/sysarch.h head/sys/i386/include/sysarch.h head/sys/pc98/include/sysarch.h Modified: head/sys/amd64/include/sysarch.h ============================================================================== --- head/sys/amd64/include/sysarch.h Mon Mar 19 21:47:50 2012 (r233208) +++ head/sys/amd64/include/sysarch.h Mon Mar 19 21:57:31 2012 (r233209) @@ -1,103 +1,6 @@ /*- - * Copyright (c) 1993 The Regents of the University of California. - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -/* - * Architecture specific syscalls (AMD64) - */ -#ifndef _MACHINE_SYSARCH_H_ -#define _MACHINE_SYSARCH_H_ - -#include - -#define I386_GET_LDT 0 -#define I386_SET_LDT 1 -#define LDT_AUTO_ALLOC 0xffffffff - /* I386_IOPL */ -#define I386_GET_IOPERM 3 -#define I386_SET_IOPERM 4 - -/* XXX Not implementable #define I386_VM86 6 */ - -#define I386_GET_FSBASE 7 -#define I386_SET_FSBASE 8 -#define I386_GET_GSBASE 9 -#define I386_SET_GSBASE 10 -#define I386_GET_XFPUSTATE 11 - -/* Leave space for 0-127 for to avoid translating syscalls */ -#define AMD64_GET_FSBASE 128 -#define AMD64_SET_FSBASE 129 -#define AMD64_GET_GSBASE 130 -#define AMD64_SET_GSBASE 131 -#define AMD64_GET_XFPUSTATE 132 - -struct i386_ldt_args { - unsigned int start; - struct user_segment_descriptor *descs __packed; - unsigned int num; -}; - -struct i386_ioperm_args { - unsigned int start; - unsigned int length; - int enable; -}; - -struct i386_get_xfpustate { - unsigned int addr; - int len; -}; - -struct amd64_get_xfpustate { - void *addr; - int len; -}; - -#ifndef _KERNEL -__BEGIN_DECLS -int amd64_get_fsbase(void **); -int amd64_get_gsbase(void **); -int amd64_set_fsbase(void *); -int amd64_set_gsbase(void *); -int sysarch(int, void *); -__END_DECLS -#else -struct thread; -union descriptor; - -int amd64_get_ldt(struct thread *, struct i386_ldt_args *); -int amd64_set_ldt(struct thread *, struct i386_ldt_args *, - struct user_segment_descriptor *); -int amd64_get_ioperm(struct thread *, struct i386_ioperm_args *); -int amd64_set_ioperm(struct thread *, struct i386_ioperm_args *); -#endif - -#endif /* !_MACHINE_SYSARCH_H_ */ +#include Modified: head/sys/i386/include/sysarch.h ============================================================================== --- head/sys/i386/include/sysarch.h Mon Mar 19 21:47:50 2012 (r233208) +++ head/sys/i386/include/sysarch.h Mon Mar 19 21:57:31 2012 (r233209) @@ -1,104 +1,6 @@ /*- - * Copyright (c) 1993 The Regents of the University of California. - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -/* - * Architecture specific syscalls (i386) - */ -#ifndef _MACHINE_SYSARCH_H_ -#define _MACHINE_SYSARCH_H_ - -#define I386_GET_LDT 0 -#define I386_SET_LDT 1 -#define LDT_AUTO_ALLOC 0xffffffff - /* I386_IOPL */ -#define I386_GET_IOPERM 3 -#define I386_SET_IOPERM 4 - /* xxxxx */ -#define I386_VM86 6 -#define I386_GET_FSBASE 7 -#define I386_SET_FSBASE 8 -#define I386_GET_GSBASE 9 -#define I386_SET_GSBASE 10 -#define I386_GET_XFPUSTATE 11 - -struct i386_ldt_args { - unsigned int start; - union descriptor *descs; - unsigned int num; -}; - -struct i386_ioperm_args { - unsigned int start; - unsigned int length; - int enable; -}; - -struct i386_vm86_args { - int sub_op; /* sub-operation to perform */ - char *sub_args; /* args */ -}; - -struct i386_get_xfpustate { - void *addr; - int len; -}; - -#ifndef _KERNEL -#include - -union descriptor; -struct dbreg; - -__BEGIN_DECLS -int i386_get_ldt(int, union descriptor *, int); -int i386_set_ldt(int, union descriptor *, int); -int i386_get_ioperm(unsigned int, unsigned int *, int *); -int i386_set_ioperm(unsigned int, unsigned int, int); -int i386_vm86(int, void *); -int i386_get_fsbase(void **); -int i386_get_gsbase(void **); -int i386_set_fsbase(void *); -int i386_set_gsbase(void *); -int i386_set_watch(int, unsigned int, int, int, struct dbreg *); -int i386_clr_watch(int, struct dbreg *); -int sysarch(int, void *); -__END_DECLS -#else -struct thread; -union descriptor; - -int i386_get_ldt(struct thread *, struct i386_ldt_args *); -int i386_set_ldt(struct thread *, struct i386_ldt_args *, union descriptor *); -int i386_get_ioperm(struct thread *, struct i386_ioperm_args *); -int i386_set_ioperm(struct thread *, struct i386_ioperm_args *); -#endif - -#endif /* !_MACHINE_SYSARCH_H_ */ +#include Modified: head/sys/pc98/include/sysarch.h ============================================================================== --- head/sys/pc98/include/sysarch.h Mon Mar 19 21:47:50 2012 (r233208) +++ head/sys/pc98/include/sysarch.h Mon Mar 19 21:57:31 2012 (r233209) @@ -3,4 +3,4 @@ */ /* $FreeBSD$ */ -#include +#include Copied and modified: head/sys/x86/include/sysarch.h (from r233203, head/sys/amd64/include/sysarch.h) ============================================================================== --- head/sys/amd64/include/sysarch.h Mon Mar 19 21:24:50 2012 (r233203, copy source) +++ head/sys/x86/include/sysarch.h Mon Mar 19 21:57:31 2012 (r233209) @@ -30,7 +30,7 @@ */ /* - * Architecture specific syscalls (AMD64) + * Architecture specific syscalls (X86) */ #ifndef _MACHINE_SYSARCH_H_ #define _MACHINE_SYSARCH_H_ @@ -43,9 +43,8 @@ /* I386_IOPL */ #define I386_GET_IOPERM 3 #define I386_SET_IOPERM 4 - -/* XXX Not implementable #define I386_VM86 6 */ - + /* xxxxx */ +#define I386_VM86 6 /* XXX Not implementable on amd64 */ #define I386_GET_FSBASE 7 #define I386_SET_FSBASE 8 #define I386_GET_GSBASE 9 @@ -59,16 +58,33 @@ #define AMD64_SET_GSBASE 131 #define AMD64_GET_XFPUSTATE 132 +struct i386_ioperm_args { + unsigned int start; + unsigned int length; + int enable; +}; + +#ifdef __i386__ struct i386_ldt_args { unsigned int start; - struct user_segment_descriptor *descs __packed; + union descriptor *descs; unsigned int num; }; -struct i386_ioperm_args { +struct i386_vm86_args { + int sub_op; /* sub-operation to perform */ + char *sub_args; /* args */ +}; + +struct i386_get_xfpustate { + void *addr; + int len; +}; +#else +struct i386_ldt_args { unsigned int start; - unsigned int length; - int enable; + struct user_segment_descriptor *descs __packed; + unsigned int num; }; struct i386_get_xfpustate { @@ -80,9 +96,24 @@ struct amd64_get_xfpustate { void *addr; int len; }; +#endif #ifndef _KERNEL +union descriptor; +struct dbreg; + __BEGIN_DECLS +int i386_get_ldt(int, union descriptor *, int); +int i386_set_ldt(int, union descriptor *, int); +int i386_get_ioperm(unsigned int, unsigned int *, int *); +int i386_set_ioperm(unsigned int, unsigned int, int); +int i386_vm86(int, void *); +int i386_get_fsbase(void **); +int i386_get_gsbase(void **); +int i386_set_fsbase(void *); +int i386_set_gsbase(void *); +int i386_set_watch(int, unsigned int, int, int, struct dbreg *); +int i386_clr_watch(int, struct dbreg *); int amd64_get_fsbase(void **); int amd64_get_gsbase(void **); int amd64_set_fsbase(void *); @@ -93,6 +124,10 @@ __END_DECLS struct thread; union descriptor; +int i386_get_ldt(struct thread *, struct i386_ldt_args *); +int i386_set_ldt(struct thread *, struct i386_ldt_args *, union descriptor *); +int i386_get_ioperm(struct thread *, struct i386_ioperm_args *); +int i386_set_ioperm(struct thread *, struct i386_ioperm_args *); int amd64_get_ldt(struct thread *, struct i386_ldt_args *); int amd64_set_ldt(struct thread *, struct i386_ldt_args *, struct user_segment_descriptor *); From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 22:08:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFDB4106564A; Mon, 19 Mar 2012 22:08:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FDC18FC0C; Mon, 19 Mar 2012 22:08:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JM8DUa088489; Mon, 19 Mar 2012 22:08:13 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JM8Dl0088487; Mon, 19 Mar 2012 22:08:13 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203192208.q2JM8Dl0088487@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Mar 2012 22:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233210 - stable/9/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 22:08:14 -0000 Author: jkim Date: Mon Mar 19 22:08:13 2012 New Revision: 233210 URL: http://svn.freebsd.org/changeset/base/233210 Log: MFC: r232991 Add a PCI quirk to ignore PCI map registers from configuration space. This works around a resource conflict, e. g., MSI K9AGM2 motherboard. Modified: stable/9/sys/dev/pci/pci.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Mon Mar 19 21:57:31 2012 (r233209) +++ stable/9/sys/dev/pci/pci.c Mon Mar 19 22:08:13 2012 (r233210) @@ -188,6 +188,7 @@ struct pci_quirk { #define PCI_QUIRK_MAP_REG 1 /* PCI map register in weird place */ #define PCI_QUIRK_DISABLE_MSI 2 /* MSI/MSI-X doesn't work */ #define PCI_QUIRK_ENABLE_MSI_VM 3 /* Older chipset in VM where MSI works */ +#define PCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */ int arg1; int arg2; }; @@ -236,6 +237,16 @@ static const struct pci_quirk const pci_ */ { 0x12378086, PCI_QUIRK_ENABLE_MSI_VM, 0, 0 }, + /* + * HPET MMIO base address may appear in Bar1 for AMD SB600 SMBus + * controller depending on SoftPciRst register (PM_IO 0x55 [7]). + * It prevents us from attaching hpet(4) when the bit is unset. + * Note this quirk only affects SB600 revision A13 and earlier. + * For SB600 A21 and later, firmware must set the bit to hide it. + * For SB700 and later, it is unused and hardcoded to zero. + */ + { 0x43851002, PCI_QUIRK_UNMAP_REG, 0x14, 0 }, + { 0 } }; @@ -3023,12 +3034,18 @@ xhci_early_takeover(device_t self) void pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask) { - struct pci_devinfo *dinfo = device_get_ivars(dev); - pcicfgregs *cfg = &dinfo->cfg; - struct resource_list *rl = &dinfo->resources; + struct pci_devinfo *dinfo; + pcicfgregs *cfg; + struct resource_list *rl; const struct pci_quirk *q; + uint32_t devid; int i; + dinfo = device_get_ivars(dev); + cfg = &dinfo->cfg; + rl = &dinfo->resources; + devid = (cfg->device << 16) | cfg->vendor; + /* ATA devices needs special map treatment */ if ((pci_get_class(dev) == PCIC_STORAGE) && (pci_get_subclass(dev) == PCIS_STORAGE_IDE) && @@ -3037,18 +3054,29 @@ pci_add_resources(device_t bus, device_t !pci_read_config(dev, PCIR_BAR(2), 4))) ) pci_ata_maps(bus, dev, rl, force, prefetchmask); else - for (i = 0; i < cfg->nummaps;) + for (i = 0; i < cfg->nummaps;) { + /* + * Skip quirked resources. + */ + for (q = &pci_quirks[0]; q->devid != 0; q++) + if (q->devid == devid && + q->type == PCI_QUIRK_UNMAP_REG && + q->arg1 == PCIR_BAR(i)) + break; + if (q->devid != 0) { + i++; + continue; + } i += pci_add_map(bus, dev, PCIR_BAR(i), rl, force, prefetchmask & (1 << i)); + } /* * Add additional, quirked resources. */ - for (q = &pci_quirks[0]; q->devid; q++) { - if (q->devid == ((cfg->device << 16) | cfg->vendor) - && q->type == PCI_QUIRK_MAP_REG) + for (q = &pci_quirks[0]; q->devid != 0; q++) + if (q->devid == devid && q->type == PCI_QUIRK_MAP_REG) pci_add_map(bus, dev, q->arg1, rl, force, 0); - } if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) { #ifdef __PCI_REROUTE_INTERRUPT From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 22:20:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8FBDE106564A; Mon, 19 Mar 2012 22:20:48 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A3248FC0C; Mon, 19 Mar 2012 22:20:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JMKmFO088965; Mon, 19 Mar 2012 22:20:48 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JMKmuk088963; Mon, 19 Mar 2012 22:20:48 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201203192220.q2JMKmuk088963@svn.freebsd.org> From: Ken Smith Date: Mon, 19 Mar 2012 22:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233211 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 22:20:48 -0000 Author: kensmith Date: Mon Mar 19 22:20:47 2012 New Revision: 233211 URL: http://svn.freebsd.org/changeset/base/233211 Log: We seem to be having issues with a bug in the loader that causes it to estimate the program header size for the kernel wrong. It can result in the kernel build failing with the message: ld: kernel.debug: Not enough room for program headers (allocated 5, need 6) ld: final link failed: Bad value Tinderbox builds were failing with this message a short time ago, and I encountered it while preparing the i386 build machine for the 8.3-RC2 builds. Konstantin has looked at it and believes the issue was fixed in recent versions of binutils. It is a bit too late in the release process to be messing around with the loader and/or binutils. This workaround seems to take care of the problem for now. Reviewed by: kib Modified: stable/8/sys/conf/ldscript.i386 Modified: stable/8/sys/conf/ldscript.i386 ============================================================================== --- stable/8/sys/conf/ldscript.i386 Mon Mar 19 22:08:13 2012 (r233210) +++ stable/8/sys/conf/ldscript.i386 Mon Mar 19 22:20:47 2012 (r233211) @@ -6,7 +6,7 @@ SEARCH_DIR(/usr/lib); SECTIONS { /* Read-only sections, merged into text segment: */ - . = kernbase + kernload + SIZEOF_HEADERS; + . = kernbase + kernload + 256; .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 22:26:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 527F61065675; Mon, 19 Mar 2012 22:26:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 337A28FC18; Mon, 19 Mar 2012 22:26:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JMQ3Zk089273; Mon, 19 Mar 2012 22:26:03 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JMQ2oi089271; Mon, 19 Mar 2012 22:26:02 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203192226.q2JMQ2oi089271@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Mar 2012 22:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233214 - stable/8/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 22:26:03 -0000 Author: jkim Date: Mon Mar 19 22:26:02 2012 New Revision: 233214 URL: http://svn.freebsd.org/changeset/base/233214 Log: MFC: r232991 Add a PCI quirk to ignore PCI map registers from configuration space. This works around a resource conflict, e. g., MSI K9AGM2 motherboard. Modified: stable/8/sys/dev/pci/pci.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Mon Mar 19 22:23:52 2012 (r233213) +++ stable/8/sys/dev/pci/pci.c Mon Mar 19 22:26:02 2012 (r233214) @@ -188,6 +188,7 @@ struct pci_quirk { #define PCI_QUIRK_MAP_REG 1 /* PCI map register in weird place */ #define PCI_QUIRK_DISABLE_MSI 2 /* MSI/MSI-X doesn't work */ #define PCI_QUIRK_ENABLE_MSI_VM 3 /* Older chipset in VM where MSI works */ +#define PCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */ int arg1; int arg2; }; @@ -236,6 +237,16 @@ static const struct pci_quirk const pci_ */ { 0x12378086, PCI_QUIRK_ENABLE_MSI_VM, 0, 0 }, + /* + * HPET MMIO base address may appear in Bar1 for AMD SB600 SMBus + * controller depending on SoftPciRst register (PM_IO 0x55 [7]). + * It prevents us from attaching hpet(4) when the bit is unset. + * Note this quirk only affects SB600 revision A13 and earlier. + * For SB600 A21 and later, firmware must set the bit to hide it. + * For SB700 and later, it is unused and hardcoded to zero. + */ + { 0x43851002, PCI_QUIRK_UNMAP_REG, 0x14, 0 }, + { 0 } }; @@ -2790,12 +2801,18 @@ ehci_early_takeover(device_t self) void pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask) { - struct pci_devinfo *dinfo = device_get_ivars(dev); - pcicfgregs *cfg = &dinfo->cfg; - struct resource_list *rl = &dinfo->resources; + struct pci_devinfo *dinfo; + pcicfgregs *cfg; + struct resource_list *rl; const struct pci_quirk *q; + uint32_t devid; int i; + dinfo = device_get_ivars(dev); + cfg = &dinfo->cfg; + rl = &dinfo->resources; + devid = (cfg->device << 16) | cfg->vendor; + /* ATA devices needs special map treatment */ if ((pci_get_class(dev) == PCIC_STORAGE) && (pci_get_subclass(dev) == PCIS_STORAGE_IDE) && @@ -2804,18 +2821,29 @@ pci_add_resources(device_t bus, device_t !pci_read_config(dev, PCIR_BAR(2), 4))) ) pci_ata_maps(bus, dev, rl, force, prefetchmask); else - for (i = 0; i < cfg->nummaps;) + for (i = 0; i < cfg->nummaps;) { + /* + * Skip quirked resources. + */ + for (q = &pci_quirks[0]; q->devid != 0; q++) + if (q->devid == devid && + q->type == PCI_QUIRK_UNMAP_REG && + q->arg1 == PCIR_BAR(i)) + break; + if (q->devid != 0) { + i++; + continue; + } i += pci_add_map(bus, dev, PCIR_BAR(i), rl, force, prefetchmask & (1 << i)); + } /* * Add additional, quirked resources. */ - for (q = &pci_quirks[0]; q->devid; q++) { - if (q->devid == ((cfg->device << 16) | cfg->vendor) - && q->type == PCI_QUIRK_MAP_REG) + for (q = &pci_quirks[0]; q->devid != 0; q++) + if (q->devid == devid && q->type == PCI_QUIRK_MAP_REG) pci_add_map(bus, dev, q->arg1, rl, force, 0); - } if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) { #ifdef __PCI_REROUTE_INTERRUPT From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 22:41:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A0AC1065693; Mon, 19 Mar 2012 22:41:53 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73A538FC18; Mon, 19 Mar 2012 22:41:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JMfrBu089927; Mon, 19 Mar 2012 22:41:53 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JMfrY6089925; Mon, 19 Mar 2012 22:41:53 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203192241.q2JMfrY6089925@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Mar 2012 22:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233217 - stable/9/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 22:41:53 -0000 Author: jpaetzel Date: Mon Mar 19 22:41:53 2012 New Revision: 233217 URL: http://svn.freebsd.org/changeset/base/233217 Log: MFC 227470: Report the amount of memory from smbios data if provided. This should get the correct memory size even if a 32-bit image is running on a machine with > 4GB of memory. This can be useful is using a 32-bit installer on a machine which will eventually run a 64-bit image. Reviewed by: kmoore Modified: stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Directory Properties: stable/9/usr.sbin/pc-sysinstall/ (props changed) Modified: stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Mon Mar 19 22:34:24 2012 (r233216) +++ stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Mon Mar 19 22:41:53 2012 (r233217) @@ -25,4 +25,8 @@ # # $FreeBSD$ -expr $(sysctl -n hw.realmem) / 1048576 +if smbios_mem=$(kenv -q smbios.memory.enabled); then + expr $smbios_mem / 1024 +else + expr $(sysctl -n hw.realmem) / 1048576 +fi From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 22:52:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD6AC1065670; Mon, 19 Mar 2012 22:52:19 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7EA28FC14; Mon, 19 Mar 2012 22:52:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JMqJcI090303; Mon, 19 Mar 2012 22:52:19 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JMqJ30090301; Mon, 19 Mar 2012 22:52:19 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203192252.q2JMqJ30090301@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Mar 2012 22:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233218 - stable/9/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 22:52:20 -0000 Author: jpaetzel Date: Mon Mar 19 22:52:19 2012 New Revision: 233218 URL: http://svn.freebsd.org/changeset/base/233218 Log: MFC: 232681 Work around broken BIOS memory reporting Andrzej has a machine with 32GB of RAM, but only 16GB is reported by the smbios.memory.enabled. Thus, use the greater of hw.realmem and the smbios value. Reported by: Andrzej Tobola Modified: stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Directory Properties: stable/9/usr.sbin/pc-sysinstall/ (props changed) Modified: stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Mon Mar 19 22:41:53 2012 (r233217) +++ stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Mon Mar 19 22:52:19 2012 (r233218) @@ -26,7 +26,14 @@ # $FreeBSD$ if smbios_mem=$(kenv -q smbios.memory.enabled); then - expr $smbios_mem / 1024 + smbios_mem=$(expr $smbios_mem / 1024) else - expr $(sysctl -n hw.realmem) / 1048576 + smbios_mem=0 +fi +realmem=$(expr $(sysctl -n hw.realmem) / 1048576) + +if [ $smbios_mem -gt $realmem ]; then + echo $smbios_mem +else + echo $realmem fi From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 22:59:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 861BD1065673; Mon, 19 Mar 2012 22:59:20 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D3178FC12; Mon, 19 Mar 2012 22:59:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JMxK3o090557; Mon, 19 Mar 2012 22:59:20 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JMxKoc090555; Mon, 19 Mar 2012 22:59:20 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203192259.q2JMxKoc090555@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Mar 2012 22:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233219 - stable/9/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 22:59:20 -0000 Author: jpaetzel Date: Mon Mar 19 22:59:19 2012 New Revision: 233219 URL: http://svn.freebsd.org/changeset/base/233219 Log: MFC: 232880 Fix a bug running the autoinstall functionality. Submitted by: kmoore Obtained from: PC-BSD Modified: stable/9/usr.sbin/pc-sysinstall/backend/startautoinstall.sh Directory Properties: stable/9/usr.sbin/pc-sysinstall/ (props changed) Modified: stable/9/usr.sbin/pc-sysinstall/backend/startautoinstall.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/startautoinstall.sh Mon Mar 19 22:52:19 2012 (r233218) +++ stable/9/usr.sbin/pc-sysinstall/backend/startautoinstall.sh Mon Mar 19 22:59:19 2012 (r233219) @@ -114,7 +114,7 @@ then esac fi - ${PROGDIR}/pc-sysinstall -c ${INSTALL_CFG} + pc-sysinstall -c ${INSTALL_CFG} if [ $? -eq 0 ] then if [ -n "$SHUTDOWN_CMD" ] From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 23:04:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D149E106566B; Mon, 19 Mar 2012 23:04:21 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBA858FC17; Mon, 19 Mar 2012 23:04:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JN4Lhx090789; Mon, 19 Mar 2012 23:04:21 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JN4L7C090786; Mon, 19 Mar 2012 23:04:21 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203192304.q2JN4L7C090786@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Mar 2012 23:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233220 - in stable/9/usr.sbin/pc-sysinstall: backend backend-partmanager X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 23:04:21 -0000 Author: jpaetzel Date: Mon Mar 19 23:04:21 2012 New Revision: 233220 URL: http://svn.freebsd.org/changeset/base/233220 Log: MFC: 232889 Make sure when creating new MBR partition it is set to active by default. Submitted by: kmoore Obtained from: PC-BSD Modified: stable/9/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh Directory Properties: stable/9/usr.sbin/pc-sysinstall/ (props changed) Modified: stable/9/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh Mon Mar 19 22:59:19 2012 (r233219) +++ stable/9/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh Mon Mar 19 23:04:21 2012 (r233220) @@ -86,7 +86,12 @@ fi # If this is an empty disk, see if we need to create a new scheme for it gpart show ${DISK} >/dev/null 2>/dev/null if [ $? -eq 0 -a "${SLICENUM}" = "1" ] ; then - gpart create -s ${TYPE} ${DISK} + if [ "${TYPE}" = "mbr" -o "${TYPE}" = "MBR" ] ; then + flags="-s ${TYPE} -f active" + else + flags="-s ${TYPE}" + fi + gpart create ${flags} ${DISK} fi # If we have a starting block, use it Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon Mar 19 22:59:19 2012 (r233219) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon Mar 19 23:04:21 2012 (r233220) @@ -641,7 +641,7 @@ init_mbr_full_disk() sleep 2 echo_log "Running gpart on ${_intDISK}" - rc_halt "gpart create -s mbr ${_intDISK}" + rc_halt "gpart create -s mbr -f active ${_intDISK}" # Lets figure out disk size in blocks # Get the cyl of this disk From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 23:09:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E232A1065680; Mon, 19 Mar 2012 23:09:30 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3AA58FC1A; Mon, 19 Mar 2012 23:09:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JN9Uxw090982; Mon, 19 Mar 2012 23:09:30 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JN9UVN090980; Mon, 19 Mar 2012 23:09:30 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203192309.q2JN9UVN090980@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Mar 2012 23:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233221 - stable/9/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 23:09:31 -0000 Author: jpaetzel Date: Mon Mar 19 23:09:30 2012 New Revision: 233221 URL: http://svn.freebsd.org/changeset/base/233221 Log: MFC: 232890 Fix a couple of bugs saving network config. Don't duplicate wlans_ lines. Enable ipv6 on wireless devices correctly. Submitted by: kmoore Obtained from: PC-BSD Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-networking.sh Directory Properties: stable/9/usr.sbin/pc-sysinstall/ (props changed) Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-networking.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-networking.sh Mon Mar 19 23:04:21 2012 (r233220) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-networking.sh Mon Mar 19 23:09:30 2012 (r233221) @@ -104,7 +104,10 @@ enable_dhcp_all() then # We have a wifi device, setup a wlan* entry for it WLAN="wlan${WLANCOUNT}" - echo "wlans_${NIC}=\"${WLAN}\"" >>${FSMNT}/etc/rc.conf + cat ${FSMNT}/etc/rc.conf | grep -q "wlans_${NIC}=" + if [ $? -ne 0 ] ; then + echo "wlans_${NIC}=\"${WLAN}\"" >>${FSMNT}/etc/rc.conf + fi echo "ifconfig_${WLAN}=\"DHCP\"" >>${FSMNT}/etc/rc.conf CNIC="${WLAN}" WLANCOUNT=$((WLANCOUNT+1)) @@ -138,7 +141,7 @@ enable_slaac_all() do NIC="`echo $line | cut -d ':' -f 1`" DESC="`echo $line | cut -d ':' -f 2`" - echo_log "Setting $NIC to acceptign RAs on the system." + echo_log "Setting $NIC to accepting RAs on the system." check_is_wifi ${NIC} if [ $? -eq 0 ] then @@ -146,9 +149,12 @@ enable_slaac_all() # Given we cannot have DHCP and SLAAC the same time currently # it's save to just duplicate. WLAN="wlan${WLANCOUNT}" - echo "wlans_${NIC}=\"${WLAN}\"" >>${FSMNT}/etc/rc.conf + cat ${FSMNT}/etc/rc.conf | grep -q "wlans_${NIC}=" + if [ $? -ne 0 ] ; then + echo "wlans_${NIC}=\"${WLAN}\"" >>${FSMNT}/etc/rc.conf + fi #echo "ifconfig_${NIC}=\"up\"" >>${FSMNT}/etc/rc.conf - echo "ifconfig_${WLAN}=\"inet6 accept_rtadv\"" >>${FSMNT}/etc/rc.conf + echo "ifconfig_${WLAN}_ipv6=\"inet6 accept_rtadv\"" >>${FSMNT}/etc/rc.conf CNIC="${WLAN}" WLANCOUNT=$((WLANCOUNT+1)) else From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 23:12:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B26E71065678 for ; Mon, 19 Mar 2012 23:12:57 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id EE3EF8FC1B for ; Mon, 19 Mar 2012 23:12:56 +0000 (UTC) Received: by wgbds12 with SMTP id ds12so1063274wgb.31 for ; Mon, 19 Mar 2012 16:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=saialF80KzWEqAp5ibZuWpQqLciHGtZ97aeb6yZmezE=; b=lHtPHSWAs/PXFv9qGSLx6BvrO3pIw6ZVqNnU/orp3EHHx+VnJfJcPTxZn1B2B3TDru EliJ0TjBEOEUfBJw1lC8EV+WJqkwlUM3UVTd5Hal1kG5mX9wwUJpYeK9ao2777ErSogq YXF1dnbxNIf2l0mF4Y1Kn2YKTsGKl6CiLUPyQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=saialF80KzWEqAp5ibZuWpQqLciHGtZ97aeb6yZmezE=; b=eyNgky/AsFc3nrWpRh3iBl6bJKnZKUwElAUuvym0U0UkUrYvtfHzXT7m8+BAozY4Vi cz58P6QvmO+zuORLbA5KUXMhaMSxlO0pNqcimBVhjJa4cE6BoK0S1krvn5fIjSOnYS7X U4XX8uroYihz8tPbMBx/UACncee/T+ekdYwVZWNfCsPPWNJ1jwyy6sd1tSVF4ayWUS4R 5mHsTYNbH6+q/UI/6Iw3/gywcleGpaly8qKvm+90l03GDcg2d7foVp9AnzB2tQrru5EA TY68dyqfbK/RG44Eh5L1V1+/dFQb9euZgXuUlcYhp2G/XWqDM2eS68xfqLkwdRO/kgkm 2Hfg== Received: by 10.216.136.131 with SMTP id w3mr8254736wei.15.1332198775913; Mon, 19 Mar 2012 16:12:55 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.63.4 with HTTP; Mon, 19 Mar 2012 16:12:25 -0700 (PDT) In-Reply-To: <86bons71qe.fsf@ds4.des.no> References: <201203190041.q2J0femX042684@svn.freebsd.org> <201203191359.34178.jhb@freebsd.org> <86bons71qe.fsf@ds4.des.no> From: Eitan Adler Date: Mon, 19 Mar 2012 19:12:25 -0400 X-Google-Sender-Auth: 97EQ7UpNjyljwUJU2ikYxRJJ0so Message-ID: To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQkW4cVlZDBKxflBeOu47qdX2WXZQAlztqc32ERXjlUg8AfjyDNsYQTBMiQivtMlEX6KqcWQ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival , John Baldwin Subject: Re: svn commit: r233136 - in head/secure: usr.bin/ssh usr.sbin/sshd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 23:12:57 -0000 2012/3/19 Dag-Erling Sm=C3=B8rgrav : > John Baldwin writes: Looking at the original contents of the two files sshd: -.if defined(X11BASE) || defined(LOCALBASE) ssh: -.if defined(X11BASE) which I think was the cause of my original confusion. The change *was* a no-op for ssh but resulted in behavior change when LOCALBASE was defined in sshd. What do you think of the following patch which uses the same .defined version as the original restores LOCALBASE support in sshd and and adds support to ssh? Is there a reason for the difference between the two? [ build tested only ] commit 3b4f7b77abc6a0fadb3a15ebd7e8e8d475047842 Author: Eitan Adler Date: Mon Mar 19 19:07:35 2012 -0400 Restore the ability to use a non-standard LOCALBASE to sshd Add the ability to use a non-standard LOCALBASE to ssh Submitted by: jhb Reviewed by: des Approved by: cperciva MFC after: 0 days (with r233136) diff --git a/secure/usr.bin/ssh/Makefile b/secure/usr.bin/ssh/Makefile index 619c44a..9304fd55 100644 --- a/secure/usr.bin/ssh/Makefile +++ b/secure/usr.bin/ssh/Makefile @@ -28,6 +28,10 @@ LDADD+=3D -lgssapi DPADD+=3D ${LIBCRYPT} ${LIBCRYPTO} LDADD+=3D -lcrypt -lcrypto +.if defined(LOCALBASE) +CFLAGS+=3D -DXAUTH_PATH=3D\"${LOCALBASE}/bin/xauth\" +.endif + .include .PATH: ${SSHDIR} diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile index 0120771..cc914c4 100644 --- a/secure/usr.sbin/sshd/Makefile +++ b/secure/usr.sbin/sshd/Makefile @@ -43,6 +43,10 @@ LDADD+=3D -lgssapi_krb5 -lgssapi -lkrb5 -lasn1 DPADD+=3D ${LIBCRYPTO} ${LIBCRYPT} LDADD+=3D -lcrypto -lcrypt +.if defined(LOCALBASE) +CFLAGS+=3D -DXAUTH_PATH=3D\"${LOCALBASE}/bin/xauth\" +.endif + .include .PATH: ${SSHDIR} --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 23:14:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C94B106564A; Mon, 19 Mar 2012 23:14:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 364768FC14; Mon, 19 Mar 2012 23:14:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JNEmDL091194; Mon, 19 Mar 2012 23:14:48 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JNEm5F091192; Mon, 19 Mar 2012 23:14:48 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203192314.q2JNEm5F091192@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Mar 2012 23:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233222 - stable/9/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 23:14:48 -0000 Author: jpaetzel Date: Mon Mar 19 23:14:47 2012 New Revision: 233222 URL: http://svn.freebsd.org/changeset/base/233222 Log: MFC: 232895 Check for intel RAID devices Submitted by: kmoore Obtained from: PC-BSD Modified: stable/9/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Directory Properties: stable/9/usr.sbin/pc-sysinstall/ (props changed) Modified: stable/9/usr.sbin/pc-sysinstall/backend-query/disk-list.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Mon Mar 19 23:09:30 2012 (r233221) +++ stable/9/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Mon Mar 19 23:14:47 2012 (r233222) @@ -58,6 +58,18 @@ then fi fi +# Add any RAID devices +if [ -d "/dev/raid" ] ; then + cd /dev/raid + for i in `ls` + do + case ${i} in + r0|r1|r2|r3|r4|r5) SYSDISK="${SYSDISK} ${i}" ;; + *) ;; + esac + done +fi + # Now loop through these devices, and list the disk drives for i in ${SYSDISK} do @@ -77,7 +89,7 @@ do NEWLINE=$(camcontrol identify $DEV | sed -ne 's/^device model *//p') if [ -z "$NEWLINE" ]; then # Now try atacontrol - NEWLINE=$(atacontrol list | sed -n "s|^.*$DEV <\(.*\)>.*|\1|p") + NEWLINE=$(atacontrol list 2>/dev/null | sed -n "s|^.*$DEV <\(.*\)>.*|\1|p") if [ -z "$NEWLINE" ]; then NEWLINE=" " From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 23:17:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DC21106564A; Mon, 19 Mar 2012 23:17:27 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EA518FC12; Mon, 19 Mar 2012 23:17:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JNHQOi091405; Mon, 19 Mar 2012 23:17:26 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JNHQgl091402; Mon, 19 Mar 2012 23:17:26 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203192317.q2JNHQgl091402@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Mar 2012 23:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233223 - stable/9/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 23:17:27 -0000 Author: jpaetzel Date: Mon Mar 19 23:17:26 2012 New Revision: 233223 URL: http://svn.freebsd.org/changeset/base/233223 Log: MFC: 232898 Improve ZFS exporting functionality, only export pools which are on a specific device we happen to be writing to. This fixes an issue when running pc-sysinstall on a running system which needs ZFS and the main disk gets exported. Submitted by: kmoore Obtained from: PC-BSD Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh Directory Properties: stable/9/usr.sbin/pc-sysinstall/ (props changed) Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon Mar 19 23:14:47 2012 (r233222) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon Mar 19 23:17:26 2012 (r233223) @@ -224,16 +224,6 @@ get_disk_mediasize() export VAL="${mediasize}" }; -# Function which exports all zpools, making them safe to overwrite potentially -export_all_zpools() -{ - # Export any zpools - for i in `zpool list -H -o name` - do - zpool export -f ${i} - done -}; - # Function to delete all gparts before starting an install delete_all_gpart() { @@ -268,10 +258,15 @@ delete_all_gpart() # Function to export all zpools before starting an install stop_all_zfs() { - # Export all zpools again, so that we can overwrite these partitions potentially + local DISK="`echo ${1} | sed 's|/dev/||g'`" + + # Export any zpools using this device so we can overwrite for i in `zpool list -H -o name` do - zpool export -f ${i} + ztst=`zpool status ${i} | grep "ONLINE" | awk '{print $1}' | grep -q ${DISK}` + if [ "$ztst" = "$DISK" ] ; then + zpool export -f ${i} + fi done }; @@ -324,9 +319,6 @@ setup_disk_slice() disknum="0" gmnum="0" - # Make sure all zpools are exported - export_all_zpools - # We are ready to start setting up the disks, lets read the config and do the actions while read line do @@ -354,7 +346,7 @@ setup_disk_slice() stop_all_geli ${DISK} # Make sure we don't have any zpools loaded - stop_all_zfs + stop_all_zfs ${DISK} fi @@ -375,6 +367,16 @@ setup_disk_slice() then exit_err "ERROR: The mirror disk ${MIRRORDISK} does not exist!" fi + + # Make sure we stop any gmirrors on this mirror disk + stop_all_gmirror ${MIRRORDISK} + + # Make sure we stop any geli stuff on this mirror disk + stop_all_geli ${MIRRORDISK} + + # Make sure we don't have any zpools mirror loaded + stop_all_zfs ${MIRRORDISK} + fi # Lets see if we have been given a mirror balance choice From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 23:20:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE5E1106564A; Mon, 19 Mar 2012 23:20:52 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97E538FC12; Mon, 19 Mar 2012 23:20:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JNKqEc091580; Mon, 19 Mar 2012 23:20:52 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JNKqeh091574; Mon, 19 Mar 2012 23:20:52 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203192320.q2JNKqeh091574@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Mar 2012 23:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233224 - stable/9/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 23:20:52 -0000 Author: jpaetzel Date: Mon Mar 19 23:20:52 2012 New Revision: 233224 URL: http://svn.freebsd.org/changeset/base/233224 Log: MFC: 232899 Add the ability to use a varity of ZFS dataset options. While here fix a bug causing zpools with /tmp mount-points to fail Submitted by: kmoore Obtained from: PC-BSD Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh stable/9/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh stable/9/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh stable/9/usr.sbin/pc-sysinstall/backend/functions-newfs.sh stable/9/usr.sbin/pc-sysinstall/backend/functions-unmount.sh Directory Properties: stable/9/usr.sbin/pc-sysinstall/ (props changed) Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Mon Mar 19 23:17:26 2012 (r233223) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Mon Mar 19 23:20:52 2012 (r233224) @@ -50,14 +50,14 @@ get_fs_line_xvars() ACTIVEDEV="${1}" LINE="${2}" - echo $LINE | grep -q ' (' 2>/dev/null + echo $LINE | cut -d ' ' -f 4 | grep -q ' (' 2>/dev/null if [ $? -eq 0 ] ; then # See if we are looking for ZFS specific options echo $LINE | grep -q '^ZFS' 2>/dev/null if [ $? -eq 0 ] ; then ZTYPE="NONE" - ZFSVARS="`echo $LINE | cut -d '(' -f 2- | cut -d ')' -f 1 | xargs`" + ZFSVARS="`echo $LINE | cut -d ' ' -f 4 |cut -d '(' -f 2- | cut -d ')' -f 1 | xargs`" echo $ZFSVARS | grep -qE "^(disk|file|mirror|raidz(1|2)?|spare|log|cache):" 2>/dev/null if [ $? -eq 0 ] ; then @@ -126,9 +126,9 @@ gen_glabel_name() NUM="0" MAXNUM="20" - # Check if we are doing /, and rename it - if [ "$MOUNT" = "/" ] - then + if [ "$TYPE" = "ZFS" ] ; then + NAME="zpool" + elif [ "$MOUNT" = "/" ] ; then NAME="rootfs" else # If doing a swap partition, also rename it @@ -341,7 +341,7 @@ setup_gpart_partitions() # Save this data to our partition config dir if [ "${_pType}" = "gpt" ] ; then _dFile="`echo $_pDisk | sed 's|/|-|g'`" - echo "${FS}:${MNT}:${ENC}:${PLABEL}:GPT:${XTRAOPTS}" >${PARTDIR}/${_dFile}p${CURPART} + echo "${FS}#${MNT}#${ENC}#${PLABEL}#GPT#${XTRAOPTS}" >${PARTDIR}/${_dFile}p${CURPART} # Clear out any headers sleep 2 @@ -354,7 +354,7 @@ setup_gpart_partitions() else # MBR Partition or GPT slice _dFile="`echo $_wSlice | sed 's|/|-|g'`" - echo "${FS}:${MNT}:${ENC}:${PLABEL}:MBR:${XTRAOPTS}:${IMAGE}" >${PARTDIR}/${_dFile}${PARTLETTER} + echo "${FS}#${MNT}#${ENC}#${PLABEL}#MBR#${XTRAOPTS}#${IMAGE}" >${PARTDIR}/${_dFile}${PARTLETTER} # Clear out any headers sleep 2 dd if=/dev/zero of=${_wSlice}${PARTLETTER} count=2048 2>/dev/null @@ -409,7 +409,7 @@ setup_gpart_partitions() fi # Found our flag to commit this label setup, check that we found at least 1 partition - if [ "${CURPART}" = "2" ] ; then + if [ "${CURPART}" = "1" ] ; then exit_err "ERROR: commitDiskLabel was called without any partition entries for it!" fi Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh Mon Mar 19 23:17:26 2012 (r233223) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh Mon Mar 19 23:20:52 2012 (r233224) @@ -34,8 +34,8 @@ zfs_cleanup_unmount() for PART in `ls ${PARTDIR}` do PARTDEV=`echo $PART | sed 's|-|/|g'` - PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" - PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" ZPOOLNAME=$(get_zpool_name "${PARTDEV}") if [ "$PARTFS" = "ZFS" ] @@ -84,9 +84,9 @@ zfs_cleanup_unmount() for PART in `ls ${PARTDIR}` do PARTDEV=`echo $PART | sed 's|-|/|g'` - PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" - PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" - PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`" ZPOOLNAME=$(get_zpool_name "${PARTDEV}") if [ "$PARTFS" = "ZFS" ] @@ -101,17 +101,20 @@ zfs_cleanup_unmount() # Check if we have multiple zfs mounts specified for ZMNT in `echo ${PARTMNT} | sed 's|,| |g'` do + ZMNT="`echo $ZMNT | cut -d '(' -f 1`" PARTMNTREV="${ZMNT} ${PARTMNTREV}" done for ZMNT in ${PARTMNTREV} do - if [ "${ZMNT}" != "/" ] - then - rc_halt "zfs set mountpoint=${ZMNT} ${ZPOOLNAME}${ZMNT}" + if [ "${ZMNT}" = "/" ] ; then continue ; fi + # Some ZFS like /swap aren't mounted, and dont need unmounting + mount | grep -q "${FSMNT}${ZMNT}" + if [ $? -eq 0 ] ; then rc_halt "zfs unmount ${ZPOOLNAME}${ZMNT}" - sleep 2 + rc_halt "zfs set mountpoint=${ZMNT} ${ZPOOLNAME}${ZMNT}" fi + sleep 2 done fi done @@ -154,10 +157,10 @@ setup_fstab() for PART in `ls ${PARTDIR}` do PARTDEV=`echo $PART | sed 's|-|/|g'` - PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" - PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" - PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" - PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`" + PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`" + PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d '#' -f 4`" # Unset EXT EXT="" Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh Mon Mar 19 23:17:26 2012 (r233223) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh Mon Mar 19 23:20:52 2012 (r233224) @@ -57,24 +57,52 @@ mount_partition() # Check if we have multiple zfs mounts specified for ZMNT in `echo ${MNTPOINT} | sed 's|,| |g'` do + # Check for any ZFS specific mount options + ZMNTOPTS="`echo $ZMNT | cut -d '(' -f 2 | cut -d ')' -f 1`" + if [ "$ZMNTOPTS" = "$ZMNT" ] ; then ZMNTOPTS="" ; fi + + # Reset ZMNT with options removed + ZMNT="`echo $ZMNT | cut -d '(' -f 1`" + # First make sure we create the mount point if [ ! -d "${FSMNT}${ZMNT}" ] ; then mkdir -p ${FSMNT}${ZMNT} >>${LOGOUT} 2>>${LOGOUT} fi + # Check for any volsize args + zcopt="" + for ZOPT in `echo $ZMNTOPTS | sed 's/|/ /g'` + do + echo "$ZOPT" | grep -q volsize + if [ $? -eq 0 ] ; then + volsize=`echo $ZOPT | cut -d '=' -f 2` + zcopt="-V $volsize" + fi + done + if [ "${ZMNT}" = "/" ] ; then ZNAME="" else ZNAME="${ZMNT}" - echo_log "zfs create -p ${ZPOOLNAME}${ZNAME}" - rc_halt "zfs create -p ${ZPOOLNAME}${ZNAME}" + echo_log "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" + rc_halt "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" fi sleep 2 - rc_halt "zfs set mountpoint=${FSMNT}${ZNAME} ${ZPOOLNAME}${ZNAME}" + if [ -z "$zcopt" ] ; then + rc_halt "zfs set mountpoint=${FSMNT}${ZNAME} ${ZPOOLNAME}${ZNAME}" + fi + + # If no ZFS options, we can skip + if [ -z "$ZMNTOPTS" ] ; then continue ; fi - # Disable atime for this zfs partition, speed increase - rc_nohalt "zfs set atime=off ${ZPOOLNAME}${ZNAME}" - done + # Parse any ZFS options now + for ZOPT in `echo $ZMNTOPTS | sed 's/|/ /g'` + do + echo "$ZOPT" | grep -q volsize + if [ $? -eq 0 ] ; then continue ; fi + rc_halt "zfs set $ZOPT ${ZPOOLNAME}${ZNAME}" + done + done # End of adding ZFS mounts else # If we are not on ZFS, lets do the mount now @@ -107,9 +135,9 @@ mount_all_filesystems() exit_err "ERROR: The partition ${PARTDEV} does not exist. Failure in bsdlabel?" fi - PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" - PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" - PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`" if [ "${PARTENC}" = "ON" ] then @@ -144,9 +172,9 @@ mount_all_filesystems() exit_err "ERROR: The partition ${PARTDEV} does not exist. Failure in bsdlabel?" fi - PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" - PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" - PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`" if [ "${PARTENC}" = "ON" ] then Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-newfs.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Mon Mar 19 23:17:26 2012 (r233223) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Mon Mar 19 23:20:52 2012 (r233224) @@ -95,13 +95,13 @@ setup_filesystems() exit_err "ERROR: The partition ${PARTDEV} does not exist. Failure in bsdlabel?" fi - PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" - PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" - PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" - PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`" - PARTGEOM="`cat ${PARTDIR}/${PART} | cut -d ':' -f 5`" - PARTXTRAOPTS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 6`" - PARTIMAGE="`cat ${PARTDIR}/${PART} | cut -d ':' -f 7`" + PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`" + PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d '#' -f 4`" + PARTGEOM="`cat ${PARTDIR}/${PART} | cut -d '#' -f 5`" + PARTXTRAOPTS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 6`" + PARTIMAGE="`cat ${PARTDIR}/${PART} | cut -d '#' -f 7`" # Make sure journaling isn't enabled on this device if [ -e "${PARTDEV}.journal" ] Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-unmount.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-unmount.sh Mon Mar 19 23:17:26 2012 (r233223) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-unmount.sh Mon Mar 19 23:20:52 2012 (r233224) @@ -72,10 +72,10 @@ unmount_all_filesystems() for PART in `ls ${PARTDIR}` do PARTDEV=`echo $PART | sed 's|-|/|g'` - PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" - PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" - PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" - PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`" + PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`" + PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d '#' -f 4`" if [ "${PARTENC}" = "ON" ] then @@ -168,9 +168,9 @@ unmount_all_filesystems_failure() for PART in `ls ${PARTDIR}` do PARTDEV=`echo $PART | sed 's|-|/|g'` - PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" - PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" - PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`" if [ "${PARTFS}" = "SWAP" ] then From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 23:25:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61C201065688; Mon, 19 Mar 2012 23:25:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CE528FC1A; Mon, 19 Mar 2012 23:25:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JNPBJ4091791; Mon, 19 Mar 2012 23:25:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JNPBnw091789; Mon, 19 Mar 2012 23:25:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203192325.q2JNPBnw091789@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 23:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233225 - stable/9/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 23:25:11 -0000 Author: eadler Date: Mon Mar 19 23:25:10 2012 New Revision: 233225 URL: http://svn.freebsd.org/changeset/base/233225 Log: MFC 232510: Permit the use of raidz3 in pc-sysinstall PR: conf/164709 Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Directory Properties: stable/9/usr.sbin/pc-sysinstall/ (props changed) Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Mon Mar 19 23:20:52 2012 (r233224) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Mon Mar 19 23:25:10 2012 (r233225) @@ -59,7 +59,7 @@ get_fs_line_xvars() ZTYPE="NONE" ZFSVARS="`echo $LINE | cut -d ' ' -f 4 |cut -d '(' -f 2- | cut -d ')' -f 1 | xargs`" - echo $ZFSVARS | grep -qE "^(disk|file|mirror|raidz(1|2)?|spare|log|cache):" 2>/dev/null + echo $ZFSVARS | grep -qE "^(disk|file|mirror|raidz(1|2|3)?|spare|log|cache):" 2>/dev/null if [ $? -eq 0 ] ; then ZTYPE=`echo $ZFSVARS | cut -f1 -d:` ZFSVARS=`echo $ZFSVARS | sed "s|$ZTYPE: ||g" | sed "s|$ZTYPE:||g"` From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 23:28:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A5651065673; Mon, 19 Mar 2012 23:28:14 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8E608FC19; Mon, 19 Mar 2012 23:28:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JNSDb7091926; Mon, 19 Mar 2012 23:28:13 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JNSDj7091923; Mon, 19 Mar 2012 23:28:13 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203192328.q2JNSDj7091923@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Mar 2012 23:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233226 - stable/9/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 23:28:14 -0000 Author: jpaetzel Date: Mon Mar 19 23:28:13 2012 New Revision: 233226 URL: http://svn.freebsd.org/changeset/base/233226 Log: MFC: 232901 Use gpart "-a" flag to 4k alignment. Submitted by: kmoore Obtained from: PC-BSD Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh Directory Properties: stable/9/usr.sbin/pc-sysinstall/ (props changed) Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Mon Mar 19 23:25:10 2012 (r233225) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Mon Mar 19 23:28:13 2012 (r233226) @@ -314,7 +314,7 @@ setup_gpart_partitions() if [ "$CURPART" = "2" ] ; then # If this is GPT, make sure first partition is aligned to 4k sleep 2 - rc_halt "gpart add -b 2016 ${SOUT} -t ${PARTYPE} ${_pDisk}" + rc_halt "gpart add -a 4k ${SOUT} -t ${PARTYPE} ${_pDisk}" else sleep 2 rc_halt "gpart add ${SOUT} -t ${PARTYPE} ${_pDisk}" Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon Mar 19 23:25:10 2012 (r233225) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon Mar 19 23:28:13 2012 (r233226) @@ -645,33 +645,9 @@ init_mbr_full_disk() echo_log "Running gpart on ${_intDISK}" rc_halt "gpart create -s mbr -f active ${_intDISK}" - # Lets figure out disk size in blocks - # Get the cyl of this disk - get_disk_cyl "${_intDISK}" - cyl="${VAL}" - - # Get the heads of this disk - get_disk_heads "${_intDISK}" - head="${VAL}" - - # Get the tracks/sectors of this disk - get_disk_sectors "${_intDISK}" - sec="${VAL}" - - # Multiply them all together to get our total blocks - totalblocks="`expr ${cyl} \* ${head} 2>/dev/null`" - totalblocks="`expr ${totalblocks} \* ${sec} 2>/dev/null`" - if [ -z "${totalblocks}" ] - then - totalblocks=`gpart show "${_intDISK}"|tail -2|head -1|awk '{ print $2 }'` - fi - - # Now set the ending block to the total disk block size - sizeblock="`expr ${totalblocks} - ${startblock}`" - # Install new partition setup echo_log "Running gpart add on ${_intDISK}" - rc_halt "gpart add -b ${startblock} -s ${sizeblock} -t freebsd -i 1 ${_intDISK}" + rc_halt "gpart add -a 4k -t freebsd -i 1 ${_intDISK}" sleep 2 echo_log "Cleaning up ${_intDISK}s1" @@ -847,44 +823,9 @@ run_gpart_free() rc_halt "gpart create -s mbr ${DISK}" fi - # Lets get the starting block first - if [ "${slicenum}" = "1" ] - then - startblock="63" - else - # Lets figure out where the prior slice ends - checkslice=$((slicenum-1)) - - # Get starting block of this slice - sblk=`gpart show ${DISK} | grep -v ${DISK} | tr -s '\t' ' ' | sed '/^$/d' | grep " ${checkslice} " | cut -d ' ' -f 2` - blksize=`gpart show ${DISK} | grep -v ${DISK} | tr -s '\t' ' ' | sed '/^$/d' | grep " ${checkslice} " | cut -d ' ' -f 3` - startblock=$((sblk+blksiz)) - fi - - # No slice after the new slice, lets figure out the free space remaining and use it - # Get the cyl of this disk - get_disk_cyl "${DISK}" - cyl="${VAL}" - - # Get the heads of this disk - get_disk_heads "${DISK}" - head="${VAL}" - - # Get the tracks/sectors of this disk - get_disk_sectors "${DISK}" - sec="${VAL}" - - # Multiply them all together to get our total blocks - totalblocks=$((cyl*head)) - totalblocks=$((totalblocks*sec)) - - - # Now set the ending block to the total disk block size - sizeblock=$((totalblocks-startblock)) - # Install new partition setup echo_log "Running gpart on ${DISK}" - rc_halt "gpart add -b ${startblock} -s ${sizeblock} -t freebsd -i ${slicenum} ${DISK}" + rc_halt "gpart add -a 4k -t freebsd -i ${slicenum} ${DISK}" sleep 2 echo_log "Cleaning up $slice" From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 23:53:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3A87106564A; Mon, 19 Mar 2012 23:53:46 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8A9428FC15; Mon, 19 Mar 2012 23:53:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q2JNri0D050129; Mon, 19 Mar 2012 23:53:45 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F67C707.8080006@gmail.com> Date: Tue, 20 Mar 2012 07:53:43 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: John Baldwin References: <201203180022.q2I0MThr093557@svn.freebsd.org> <201203190833.08153.jhb@freebsd.org> <4F6753C1.4060800@gmail.com> <201203191350.51888.jhb@freebsd.org> In-Reply-To: <201203191350.51888.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, davidxu@freebsd.org Subject: Re: svn commit: r233103 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 23:53:46 -0000 On 2012/3/20 1:50, John Baldwin wrote: > On Monday, March 19, 2012 11:41:53 am David Xu wrote: >> On 2012/3/19 20:33, John Baldwin wrote: >>> On Saturday, March 17, 2012 8:22:29 pm David Xu wrote: >>>> Author: davidxu >>>> Date: Sun Mar 18 00:22:29 2012 >>>> New Revision: 233103 >>>> URL: http://svn.freebsd.org/changeset/base/233103 >>>> >>>> Log: >>>> Some software think a mutex can be destroyed after it owned it, for >>>> example, it uses a serialization point like following: >>>> pthread_mutex_lock(&mutex); >>>> pthread_mutex_unlock(&mutex); >>>> pthread_mutex_destroy(&muetx); >>>> They think a previous lock holder should have already left the mutex and >>>> is no longer referencing it, so they destroy it. To be maximum compatible >>>> with such code, we use IA64 version to unlock the mutex in kernel, remove >>>> the two steps unlocking code. >>> But this means they destroy the lock while another thread holds it? That >>> seems wrong. It's one thing if they know that no other thread has a reference >>> to the lock (e.g. it's in a refcounted object and the current thread just >>> dropped the reference count to zero). However, in that case no other thread >>> can unlock it after this thread destroys it. Code that does this seems very >>> buggy, since if the address can be unmapped it can also be remapped and >>> assigned to another lock, etc., so you could have a thread try to unlock a >>> lock it doesn't hold. >> They have handshake code to indicate that the mutex is no longer used by >> previous >> holder. e.g: >> >> thread 1: >> pthread_mutex_lock(&mutex); >> done = 1; >> pthread_mutex_unlock(&mutex); >> thread 2: >> pthread_mutex_lock(&mutex); >> temp = done; >> pthread_mutex_unlock(&mutex); >> if (temp == 1) >> pthread_mutex_destroy(&mutex); > Hmm, so how does this result in the crash you fixed? That is, thread 1 has > to fully finish pthread_mutex_unlock() before thread2's pthread_mutex_lock() > can succeed, so I don't see how thread 1 could still be in > pthread_mutex_unlock() when thread 2 calls pthread_mutex_destroy(). This is implementation detail,thread1 does unlocking in two steps: first it clears lock bit, but leaves contention bit there, then thread2 enters and sets lock bit, and then destroy it. T1: clear lock bit, contention bit is still set. T2: lock the mutex by setting lock bit. do some work. unlock the mutex by clearing lock it, enters kernel, and see no waiters, clears contention bit. destroy the mutex, unmap memory T1: enter kernel to clear contention bit, because the memory is unmmaped, it returns EINVAL. > >> I guess one crash of Python is also caused by the logic, though they use >> semaphore >> instead of mutex + condition variable to mimic lock. >> POSIX even explicitly requires a condition variable to be destroyable >> after broadcast, >> once you have correct teardown code. Please read its example section: >> http://pubs.opengroup.org/onlinepubs/007904975/functions/pthread_cond_destroy.html > This is quite different as assuming a broadcast marks all the threads as runnable > and removes them from the cv's queue, none of the threads will have references to > the cv so it will be safe to destroy. It would not be safe to destroy the mutex > in that case though (and the example does not destroy the mutex, only the cv). > Please see section "Destroying mutexes": http://pubs.opengroup.org/onlinepubs/007904875/functions/pthread_mutex_init.html From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 00:07:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 620E0106564A; Tue, 20 Mar 2012 00:07:51 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 49D558FC15; Tue, 20 Mar 2012 00:07:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q2K07nW1063291; Tue, 20 Mar 2012 00:07:50 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F67CA54.4050405@gmail.com> Date: Tue, 20 Mar 2012 08:07:48 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: John Baldwin References: <201203180022.q2I0MThr093557@svn.freebsd.org> <201203190833.08153.jhb@freebsd.org> <4F6753C1.4060800@gmail.com> <201203191350.51888.jhb@freebsd.org> In-Reply-To: <201203191350.51888.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, davidxu@freebsd.org Subject: Re: svn commit: r233103 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 00:07:51 -0000 On 2012/3/20 1:50, John Baldwin wrote: > http://pubs.opengroup.org/onlinepubs/007904975/functions/pthread_cond_destroy.html > This is quite different as assuming a broadcast marks all the threads as runnable > and removes them from the cv's queue, none of the threads will have references to > the cv so it will be safe to destroy. It would not be safe to destroy the mutex > in that case though (and the example does not destroy the mutex, only the cv). > Also an implementation based on sequence number to detect broadcast will suffer from the problem because it needs to recheck the sequence number after unblocking to make sure it is not a spurious wakeup or a signal sent to the thread which makes it return to user mode. From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 04:50:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 551ED106566B; Tue, 20 Mar 2012 04:50:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E1F48FC14; Tue, 20 Mar 2012 04:50:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2K4oQKJ002379; Tue, 20 Mar 2012 04:50:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2K4oQYB002373; Tue, 20 Mar 2012 04:50:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203200450.q2K4oQYB002373@svn.freebsd.org> From: Adrian Chadd Date: Tue, 20 Mar 2012 04:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233227 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 04:50:26 -0000 Author: adrian Date: Tue Mar 20 04:50:25 2012 New Revision: 233227 URL: http://svn.freebsd.org/changeset/base/233227 Log: Delay sequence number allocation for A-MPDU until just before the frame is queued to the hardware. Because multiple concurrent paths can execute ath_start(), multiple concurrent paths can push frames into the software/hardware TX queue and since preemption/interrupting can occur, there's the possibility that a gap in time will occur between allocating the sequence number and queuing it to the hardware. Because of this, it's possible that a thread will have allocated a sequence number and then be preempted by another thread doing the same. If the second thread sneaks the frame into the BAW, the (earlier) sequence number of the first frame will be now outside the BAW and will result in the frame being constantly re-added to the tail of the queue. There it will live until the sequence numbers cycle around again. This also creates a hole in the RX BAW tracking which can also cause issues. This patch delays the sequence number allocation to occur only just before the frame is going to be added to the BAW. I've been wanting to do this anyway as part of a general code tidyup but I've not gotten around to it. This fixes the PR. However, it still makes it quite difficult to try and ensure in-order queuing and dequeuing of frames. Since multiple copies of ath_start() can be run at the same time (eg one TXing process thread, one TX completion task/one RX task) the driver may end up having frames dequeued and pushed into the hardware slightly/occasionally out of order. And, to make matters more annoying, net80211 may have the same behaviour - in the non-aggregation case, the TX code allocates sequence numbers before it's thrown to the driver. I'll open another PR to investigate this and potentially introduce some kind of final-pass TX serialisation before frames are thrown to the hardware. It's also very likely worthwhile adding some debugging code into ath(4) and net80211 to catch when/if this does occur. PR: kern/166190 Modified: head/sys/dev/ath/if_ath_debug.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx.h head/sys/dev/ath/if_ath_tx_ht.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Mon Mar 19 23:28:13 2012 (r233226) +++ head/sys/dev/ath/if_ath_debug.c Tue Mar 20 04:50:25 2012 (r233227) @@ -135,19 +135,23 @@ ath_printtxbuf(struct ath_softc *sc, con printf("Q%u[%3u]", qnum, ix); while (bf != NULL) { for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) { - printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:%04x%s\n" - " TXF: %04x Seq: %d swtry: %d ADDBAW?: %d DOBAW?: %d\n" - " %08x %08x %08x %08x %08x %08x\n", + printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:%04x%s\n", ds, (const struct ath_desc *)bf->bf_daddr + i, ds->ds_link, ds->ds_data, bf->bf_txflags, - !done ? "" : (ts->ts_status == 0) ? " *" : " !", + !done ? "" : (ts->ts_status == 0) ? " *" : " !"); + printf(" TXF: %04x Seq: %d swtry: %d ADDBAW?: %d DOBAW?: %d\n", bf->bf_state.bfs_flags, bf->bf_state.bfs_seqno, bf->bf_state.bfs_retries, bf->bf_state.bfs_addedbaw, - bf->bf_state.bfs_dobaw, + bf->bf_state.bfs_dobaw); + printf(" SEQNO_ASSIGNED: %d, NEED_SEQNO: %d\n", + bf->bf_state.bfs_seqno_assigned, + bf->bf_state.bfs_need_seqno); + printf(" %08x %08x %08x %08x %08x %08x\n", ds->ds_ctl0, ds->ds_ctl1, - ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]); + ds->ds_hw[0], ds->ds_hw[1], + ds->ds_hw[2], ds->ds_hw[3]); if (ah->ah_magic == 0x20065416) { printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", ds->ds_hw[4], ds->ds_hw[5], ds->ds_hw[6], Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Mar 19 23:28:13 2012 (r233226) +++ head/sys/dev/ath/if_ath_tx.c Tue Mar 20 04:50:25 2012 (r233227) @@ -109,10 +109,10 @@ static int ath_tx_ampdu_pending(struct a int tid); static int ath_tx_ampdu_running(struct ath_softc *sc, struct ath_node *an, int tid); -static ieee80211_seq ath_tx_tid_seqno_assign(struct ath_softc *sc, - struct ieee80211_node *ni, struct ath_buf *bf, struct mbuf *m0); static int ath_tx_action_frame_override_queue(struct ath_softc *sc, struct ieee80211_node *ni, struct mbuf *m0, int *tid); +static int ath_tx_seqno_required(struct ath_softc *sc, + struct ieee80211_node *ni, struct ath_buf *bf, struct mbuf *m0); /* * Whether to use the 11n rate scenario functions or not @@ -1376,7 +1376,7 @@ ath_tx_start(struct ath_softc *sc, struc int ismcast; const struct ieee80211_frame *wh; int is_ampdu, is_ampdu_tx, is_ampdu_pending; - ieee80211_seq seqno; + //ieee80211_seq seqno; uint8_t type, subtype; /* @@ -1428,8 +1428,9 @@ ath_tx_start(struct ath_softc *sc, struc is_ampdu_pending = ath_tx_ampdu_pending(sc, ATH_NODE(ni), tid); is_ampdu = is_ampdu_tx | is_ampdu_pending; - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, ac=%d, is_ampdu=%d\n", - __func__, tid, pri, is_ampdu); + DPRINTF(sc, ATH_DEBUG_SW_TX, + "%s: bf=%p, tid=%d, ac=%d, is_ampdu=%d\n", + __func__, bf, tid, pri, is_ampdu); /* Multicast frames go onto the software multicast queue */ if (ismcast) @@ -1447,6 +1448,9 @@ ath_tx_start(struct ath_softc *sc, struc /* Do the generic frame setup */ /* XXX should just bzero the bf_state? */ bf->bf_state.bfs_dobaw = 0; + bf->bf_state.bfs_seqno_assigned = 0; + bf->bf_state.bfs_need_seqno = 0; + bf->bf_state.bfs_seqno = -1; /* XXX debugging */ /* A-MPDU TX? Manually set sequence number */ /* Don't do it whilst pending; the net80211 layer still assigns them */ @@ -1459,19 +1463,26 @@ ath_tx_start(struct ath_softc *sc, struc * don't get a sequence number from the current * TID and thus mess with the BAW. */ - seqno = ath_tx_tid_seqno_assign(sc, ni, bf, m0); - if (IEEE80211_QOS_HAS_SEQ(wh) && - subtype != IEEE80211_FC0_SUBTYPE_QOS_NULL) { + //seqno = ath_tx_tid_seqno_assign(sc, ni, bf, m0); + if (ath_tx_seqno_required(sc, ni, bf, m0)) { bf->bf_state.bfs_dobaw = 1; + bf->bf_state.bfs_need_seqno = 1; } ATH_TXQ_UNLOCK(txq); + } else { + /* No AMPDU TX, we've been assigned a sequence number. */ + if (IEEE80211_QOS_HAS_SEQ(wh)) { + bf->bf_state.bfs_seqno_assigned = 1; + bf->bf_state.bfs_seqno = + M_SEQNO_GET(m0) << IEEE80211_SEQ_SEQ_SHIFT; + } } /* * If needed, the sequence number has been assigned. * Squirrel it away somewhere easy to get to. */ - bf->bf_state.bfs_seqno = M_SEQNO_GET(m0) << IEEE80211_SEQ_SEQ_SHIFT; + //bf->bf_state.bfs_seqno = M_SEQNO_GET(m0) << IEEE80211_SEQ_SEQ_SHIFT; /* Is ampdu pending? fetch the seqno and print it out */ if (is_ampdu_pending) @@ -1488,6 +1499,10 @@ ath_tx_start(struct ath_softc *sc, struc /* At this point m0 could have changed! */ m0 = bf->bf_m; + DPRINTF(sc, ATH_DEBUG_SW_TX, + "%s: DONE: bf=%p, tid=%d, ac=%d, is_ampdu=%d, dobaw=%d, seqno=%d\n", + __func__, bf, tid, pri, is_ampdu, bf->bf_state.bfs_dobaw, M_SEQNO_GET(m0)); + #if 1 /* * If it's a multicast frame, do a direct-dispatch to the @@ -1506,6 +1521,8 @@ ath_tx_start(struct ath_softc *sc, struc * reached.) */ if (txq == &avp->av_mcastq) { + DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + "%s: bf=%p: mcastq: TX'ing\n", __func__, bf); ATH_TXQ_LOCK(txq); ath_tx_xmit_normal(sc, txq, bf); ATH_TXQ_UNLOCK(txq); @@ -1518,6 +1535,8 @@ ath_tx_start(struct ath_softc *sc, struc ATH_TXQ_UNLOCK(txq); } else { /* add to software queue */ + DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + "%s: bf=%p: swq: TX'ing\n", __func__, bf); ath_tx_swq(sc, ni, txq, bf); } #else @@ -1966,16 +1985,41 @@ ath_tx_addto_baw(struct ath_softc *sc, s if (bf->bf_state.bfs_isretried) return; + /* + * If this occurs we're in a lot of trouble. We should try to + * recover from this without the session hanging? + */ + if (! bf->bf_state.bfs_seqno_assigned) { + device_printf(sc->sc_dev, + "%s: bf=%p, seqno_assigned is 0?!\n", __func__, bf); + return; + } + tap = ath_tx_get_tx_tid(an, tid->tid); if (bf->bf_state.bfs_addedbaw) device_printf(sc->sc_dev, - "%s: re-added? tid=%d, seqno %d; window %d:%d; " + "%s: re-added? bf=%p, tid=%d, seqno %d; window %d:%d; " + "baw head=%d tail=%d\n", + __func__, bf, tid->tid, SEQNO(bf->bf_state.bfs_seqno), + tap->txa_start, tap->txa_wnd, tid->baw_head, + tid->baw_tail); + + /* + * Verify that the given sequence number is not outside of the + * BAW. Complain loudly if that's the case. + */ + if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, + SEQNO(bf->bf_state.bfs_seqno))) { + device_printf(sc->sc_dev, + "%s: bf=%p: outside of BAW?? tid=%d, seqno %d; window %d:%d; " "baw head=%d tail=%d\n", - __func__, tid->tid, SEQNO(bf->bf_state.bfs_seqno), + __func__, bf, tid->tid, SEQNO(bf->bf_state.bfs_seqno), tap->txa_start, tap->txa_wnd, tid->baw_head, tid->baw_tail); + } + /* * ni->ni_txseqs[] is the currently allocated seqno. * the txa state contains the current baw start. @@ -1983,9 +2027,9 @@ ath_tx_addto_baw(struct ath_softc *sc, s index = ATH_BA_INDEX(tap->txa_start, SEQNO(bf->bf_state.bfs_seqno)); cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, - "%s: tid=%d, seqno %d; window %d:%d; index=%d cindex=%d " + "%s: bf=%p, tid=%d, seqno %d; window %d:%d; index=%d cindex=%d " "baw head=%d tail=%d\n", - __func__, tid->tid, SEQNO(bf->bf_state.bfs_seqno), + __func__, bf, tid->tid, SEQNO(bf->bf_state.bfs_seqno), tap->txa_start, tap->txa_wnd, index, cindex, tid->baw_head, tid->baw_tail); @@ -2088,9 +2132,9 @@ ath_tx_update_baw(struct ath_softc *sc, cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, - "%s: tid=%d, baw=%d:%d, seqno=%d, index=%d, cindex=%d, " + "%s: bf=%p: tid=%d, baw=%d:%d, seqno=%d, index=%d, cindex=%d, " "baw head=%d, tail=%d\n", - __func__, tid->tid, tap->txa_start, tap->txa_wnd, seqno, index, + __func__, bf, tid->tid, tap->txa_start, tap->txa_wnd, seqno, index, cindex, tid->baw_head, tid->baw_tail); /* @@ -2171,11 +2215,51 @@ ath_tx_tid_unsched(struct ath_softc *sc, } /* + * Return whether a sequence number is actually required. + * + * A sequence number must only be allocated at the time that a frame + * is considered for addition to the BAW/aggregate and being TXed. + * The sequence number must not be allocated before the frame + * is added to the BAW (protected by the same lock instance) + * otherwise a the multi-entrant TX path may result in a later seqno + * being added to the BAW first. The subsequent addition of the + * earlier seqno would then not go into the BAW as it's now outside + * of said BAW. + * + * This routine is used by ath_tx_start() to mark whether the frame + * should get a sequence number before adding it to the BAW. + * + * Then the actual aggregate TX routines will check whether this + * flag is set and if the frame needs to go into the BAW, it'll + * have a sequence number allocated for it. + */ +static int +ath_tx_seqno_required(struct ath_softc *sc, struct ieee80211_node *ni, + struct ath_buf *bf, struct mbuf *m0) +{ + const struct ieee80211_frame *wh; + uint8_t subtype; + + wh = mtod(m0, const struct ieee80211_frame *); + subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; + + /* XXX assert txq lock */ + /* XXX assert ampdu is set */ + + return ((IEEE80211_QOS_HAS_SEQ(wh) && + subtype != IEEE80211_FC0_SUBTYPE_QOS_NULL)); +} + +/* * Assign a sequence number manually to the given frame. * * This should only be called for A-MPDU TX frames. + * + * If this is called after the initial frame setup, make sure you've flushed + * the DMA map or you'll risk sending stale data to the NIC. This routine + * updates the actual frame contents with the relevant seqno. */ -static ieee80211_seq +int ath_tx_tid_seqno_assign(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf, struct mbuf *m0) { @@ -2188,8 +2272,22 @@ ath_tx_tid_seqno_assign(struct ath_softc wh = mtod(m0, struct ieee80211_frame *); pri = M_WME_GETAC(m0); /* honor classification */ tid = WME_AC_TO_TID(pri); - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: pri=%d, tid=%d, qos has seq=%d\n", - __func__, pri, tid, IEEE80211_QOS_HAS_SEQ(wh)); + DPRINTF(sc, ATH_DEBUG_SW_TX, + "%s: bf=%p, pri=%d, tid=%d, qos has seq=%d\n", + __func__, bf, pri, tid, IEEE80211_QOS_HAS_SEQ(wh)); + + if (! bf->bf_state.bfs_need_seqno) { + device_printf(sc->sc_dev, "%s: bf=%p: need_seqno not set?!\n", + __func__, bf); + return -1; + } + /* XXX check for bfs_need_seqno? */ + if (bf->bf_state.bfs_seqno_assigned) { + device_printf(sc->sc_dev, + "%s: bf=%p: seqno already assigned (%d)?!\n", + __func__, bf, SEQNO(bf->bf_state.bfs_seqno)); + return bf->bf_state.bfs_seqno >> IEEE80211_SEQ_SEQ_SHIFT; + } /* XXX Is it a control frame? Ignore */ @@ -2217,9 +2315,14 @@ ath_tx_tid_seqno_assign(struct ath_softc } *(uint16_t *)&wh->i_seq[0] = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); M_SEQNO_SET(m0, seqno); + bf->bf_state.bfs_seqno = seqno << IEEE80211_SEQ_SEQ_SHIFT; + bf->bf_state.bfs_seqno_assigned = 1; /* Return so caller can do something with it if needed */ - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: -> seqno=%d\n", __func__, seqno); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: -> seqno=%d\n", + __func__, + bf, + seqno); return seqno; } @@ -2231,9 +2334,11 @@ ath_tx_tid_seqno_assign(struct ath_softc static void ath_tx_xmit_aggr(struct ath_softc *sc, struct ath_node *an, struct ath_buf *bf) { + struct ieee80211_node *ni = &an->an_node; struct ath_tid *tid = &an->an_tid[bf->bf_state.bfs_tid]; struct ath_txq *txq = bf->bf_state.bfs_txq; struct ieee80211_tx_ampdu *tap; + int seqno; ATH_TXQ_LOCK_ASSERT(txq); @@ -2245,10 +2350,63 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s return; } + /* + * TODO: If it's _before_ the BAW left edge, complain very loudly. + * This means something (else) has slid the left edge along + * before we got a chance to be TXed. + */ + + /* + * Is there space in this BAW for another frame? + * If not, don't bother trying to schedule it; just + * throw it back on the queue. + * + * If we allocate the sequence number before we add + * it to the BAW, we risk racing with another TX + * thread that gets in a frame into the BAW with + * seqno greater than ours. We'd then fail the + * below check and throw the frame on the tail of + * the queue. The sender would then have a hole. + * + * XXX again, we're protecting ni->ni_txseqs[tid] + * behind this hardware TXQ lock, like the rest of + * the TIDs that map to it. Ugh. + */ + if (bf->bf_state.bfs_dobaw) { + if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, + ni->ni_txseqs[bf->bf_state.bfs_tid])) { + ATH_TXQ_INSERT_TAIL(tid, bf, bf_list); + ath_tx_tid_sched(sc, tid); + return; + } + if (! bf->bf_state.bfs_seqno_assigned) { + seqno = ath_tx_tid_seqno_assign(sc, ni, bf, bf->bf_m); + if (seqno < 0) { + device_printf(sc->sc_dev, + "%s: bf=%p, huh, seqno=-1?\n", + __func__, + bf); + /* XXX what can we even do here? */ + } + /* Flush seqno update to RAM */ + /* + * XXX This is required because the dmasetup + * XXX is done early rather than at dispatch + * XXX time. Ew, we should fix this! + */ + bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, + BUS_DMASYNC_PREWRITE); + } + } + /* outside baw? queue */ if (bf->bf_state.bfs_dobaw && (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, SEQNO(bf->bf_state.bfs_seqno)))) { + device_printf(sc->sc_dev, + "%s: bf=%p, shouldn't be outside BAW now?!\n", + __func__, + bf); ATH_TXQ_INSERT_TAIL(tid, bf, bf_list); ath_tx_tid_sched(sc, tid); return; @@ -2303,8 +2461,8 @@ ath_tx_swq(struct ath_softc *sc, struct tid = ath_tx_gettid(sc, m0); atid = &an->an_tid[tid]; - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p, pri=%d, tid=%d, qos=%d\n", - __func__, bf, pri, tid, IEEE80211_QOS_HAS_SEQ(wh)); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p, pri=%d, tid=%d, qos=%d, seqno=%d\n", + __func__, bf, pri, tid, IEEE80211_QOS_HAS_SEQ(wh), SEQNO(bf->bf_state.bfs_seqno)); /* Set local packet state, used to queue packets to hardware */ bf->bf_state.bfs_tid = tid; @@ -2320,34 +2478,34 @@ ath_tx_swq(struct ath_softc *sc, struct ATH_TXQ_LOCK(txq); if (atid->paused) { /* TID is paused, queue */ - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: paused\n", __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: paused\n", __func__, bf); ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); } else if (ath_tx_ampdu_pending(sc, an, tid)) { /* AMPDU pending; queue */ - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: pending\n", __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: pending\n", __func__, bf); ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); /* XXX sched? */ } else if (ath_tx_ampdu_running(sc, an, tid)) { /* AMPDU running, attempt direct dispatch if possible */ if (txq->axq_depth < sc->sc_hwq_limit) { - ath_tx_xmit_aggr(sc, an, bf); DPRINTF(sc, ATH_DEBUG_SW_TX, - "%s: xmit_aggr\n", - __func__); + "%s: bf=%p: xmit_aggr\n", + __func__, bf); + ath_tx_xmit_aggr(sc, an, bf); } else { DPRINTF(sc, ATH_DEBUG_SW_TX, - "%s: ampdu; swq'ing\n", - __func__); + "%s: bf=%p: ampdu; swq'ing\n", + __func__, bf); ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); ath_tx_tid_sched(sc, atid); } } else if (txq->axq_depth < sc->sc_hwq_limit) { /* AMPDU not running, attempt direct dispatch */ - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: xmit_normal\n", __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: xmit_normal\n", __func__, bf); ath_tx_xmit_normal(sc, txq, bf); } else { /* Busy; queue */ - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: swq'ing\n", __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: swq'ing\n", __func__, bf); ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); ath_tx_tid_sched(sc, atid); } @@ -2478,11 +2636,11 @@ ath_tx_tid_drain(struct ath_softc *sc, s if (t == 0) { device_printf(sc->sc_dev, - "%s: node %p: tid %d: txq_depth=%d, " + "%s: node %p: bf=%p: tid %d: txq_depth=%d, " "txq_aggr_depth=%d, sched=%d, paused=%d, " "hwq_depth=%d, incomp=%d, baw_head=%d, " "baw_tail=%d txa_start=%d, ni_txseqs=%d\n", - __func__, ni, tid->tid, txq->axq_depth, + __func__, ni, bf, tid->tid, txq->axq_depth, txq->axq_aggr_depth, tid->sched, tid->paused, tid->hwq_depth, tid->incomp, tid->baw_head, tid->baw_tail, tap == NULL ? -1 : tap->txa_start, @@ -2493,7 +2651,7 @@ ath_tx_tid_drain(struct ath_softc *sc, s mtod(bf->bf_m, const uint8_t *), bf->bf_m->m_len, 0, -1); - t = 1; + //t = 1; } Modified: head/sys/dev/ath/if_ath_tx.h ============================================================================== --- head/sys/dev/ath/if_ath_tx.h Mon Mar 19 23:28:13 2012 (r233226) +++ head/sys/dev/ath/if_ath_tx.h Tue Mar 20 04:50:25 2012 (r233227) @@ -109,6 +109,8 @@ extern void ath_tx_addto_baw(struct ath_ struct ath_tid *tid, struct ath_buf *bf); extern struct ieee80211_tx_ampdu * ath_tx_get_tx_tid(struct ath_node *an, int tid); +extern int ath_tx_tid_seqno_assign(struct ath_softc *sc, + struct ieee80211_node *ni, struct ath_buf *bf, struct mbuf *m0); /* TX addba handling */ extern int ath_addba_request(struct ieee80211_node *ni, Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Mon Mar 19 23:28:13 2012 (r233226) +++ head/sys/dev/ath/if_ath_tx_ht.c Tue Mar 20 04:50:25 2012 (r233227) @@ -644,7 +644,7 @@ ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc, struct ath_node *an, struct ath_tid *tid, ath_bufhead *bf_q) { - //struct ieee80211_node *ni = &an->an_node; + struct ieee80211_node *ni = &an->an_node; struct ath_buf *bf, *bf_first = NULL, *bf_prev = NULL; int nframes = 0; uint16_t aggr_limit = 0, al = 0, bpad = 0, al_delta, h_baw; @@ -652,6 +652,7 @@ ath_tx_form_aggr(struct ath_softc *sc, s int status = ATH_AGGR_DONE; int prev_frames = 0; /* XXX for AR5416 burst, not done here */ int prev_al = 0; /* XXX also for AR5416 burst */ + int seqno; ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); @@ -707,16 +708,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s */ /* - * If the packet has a sequence number, do not - * step outside of the block-ack window. - */ - if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, - SEQNO(bf->bf_state.bfs_seqno))) { - status = ATH_AGGR_BAW_CLOSED; - break; - } - - /* * XXX TODO: AR5416 has an 8K aggregation size limit * when RTS is enabled, and RTS is required for dual-stream * rates. @@ -744,6 +735,58 @@ ath_tx_form_aggr(struct ath_softc *sc, s } /* + * TODO: If it's _before_ the BAW left edge, complain very loudly. + * This means something (else) has slid the left edge along + * before we got a chance to be TXed. + */ + + /* + * Check if we have space in the BAW for this frame before + * we add it. + * + * see ath_tx_xmit_aggr() for more info. + */ + if (bf->bf_state.bfs_dobaw) { + if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, + ni->ni_txseqs[bf->bf_state.bfs_tid])) { + status = ATH_AGGR_BAW_CLOSED; + break; + } + /* XXX check for bfs_need_seqno? */ + if (! bf->bf_state.bfs_seqno_assigned) { + seqno = ath_tx_tid_seqno_assign(sc, ni, bf, bf->bf_m); + if (seqno < 0) { + device_printf(sc->sc_dev, + "%s: bf=%p, huh, seqno=-1?\n", + __func__, + bf); + /* XXX what can we even do here? */ + } + /* Flush seqno update to RAM */ + /* + * XXX This is required because the dmasetup + * XXX is done early rather than at dispatch + * XXX time. Ew, we should fix this! + */ + bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, + BUS_DMASYNC_PREWRITE); + } + } + + /* + * If the packet has a sequence number, do not + * step outside of the block-ack window. + */ + if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, + SEQNO(bf->bf_state.bfs_seqno))) { + device_printf(sc->sc_dev, + "%s: bf=%p, seqno=%d, outside?!\n", + __func__, bf, SEQNO(bf->bf_state.bfs_seqno)); + status = ATH_AGGR_BAW_CLOSED; + break; + } + + /* * this packet is part of an aggregate. */ ATH_TXQ_REMOVE(tid, bf, bf_list); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Mar 19 23:28:13 2012 (r233226) +++ head/sys/dev/ath/if_athvar.h Tue Mar 20 04:50:25 2012 (r233227) @@ -215,6 +215,8 @@ struct ath_buf { int bfs_ismrr:1; /* do multi-rate TX retry */ int bfs_doprot:1; /* do RTS/CTS based protection */ int bfs_doratelookup:1; /* do rate lookup before each TX */ + int bfs_need_seqno:1; /* need to assign a seqno for aggregation */ + int bfs_seqno_assigned:1; /* seqno has been assigned */ int bfs_nfl; /* next fragment length */ /* From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 09:03:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A14A1065674; Tue, 20 Mar 2012 09:03:02 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 43ECC8FC14; Tue, 20 Mar 2012 09:02:55 +0000 (UTC) Received: by lagv3 with SMTP id v3so7414600lag.13 for ; Tue, 20 Mar 2012 02:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6VEmmNeG4h04vcQZMG8P6SPbruUS78Otzq3pPvV6yD4=; b=MPqOmz9pPA3ee4esLPVXWExJcGNfN0k6K4lQeZ/Xd9CEwySaakh35YnGn5pumAOuJX k0vRk/w/XNxe3tR4S8z+EJ+RjvKmkBVV2xA9pasZ2VozhgmrMoAka7qGN8XWqiQPvI/0 cfdGr95gX6m+3qCgPPy9gWsa4tSNqt/Da6ziLFImaAkwjeLS5Y2XdtEUHSIR3m1VkQsI lIGe0Sgp+4cxxCjBbZi1sfYrbjl9EFha4jo+ODe2MbOTeSfaLU1nRkq109oucTc650tg M6owJHa8jRdpXHMSUzEq3b4NVclWDPe5UYgoPJ5eO5CN0dbH1G+a9BsEJl1KsWApjkAY Awbg== MIME-Version: 1.0 Received: by 10.112.100.232 with SMTP id fb8mr5836069lbb.86.1332234168976; Tue, 20 Mar 2012 02:02:48 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.152.21.73 with HTTP; Tue, 20 Mar 2012 02:02:48 -0700 (PDT) In-Reply-To: <201203192015.q2JKFItl084480@svn.freebsd.org> References: <201203192015.q2JKFItl084480@svn.freebsd.org> Date: Tue, 20 Mar 2012 12:02:48 +0300 X-Google-Sender-Auth: E1rrIRId25OKy2YfqfLteiTCroQ Message-ID: From: Sergey Kandaurov To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r233199 - in stable/8/sys: i386/conf netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 09:03:02 -0000 On 20 March 2012 00:15, John Baldwin wrote: > Author: jhb > Date: Mon Mar 19 20:15:18 2012 > New Revision: 233199 > URL: http://svn.freebsd.org/changeset/base/233199 > > Log: > =A0MFC 225096: > =A0Fix if_addr_mtx recursion in mld6. Ehh.. Thank you for doing this. As I mentioned earlier I could not reproduce this problem myself in RELENG_8, that's why it was not MFCed so far... > > =A0mld_set_version() is called only from mld_v1_input_query() and > =A0mld_v2_input_query() both holding the if_addr_mtx lock, and then calli= ng > =A0into mld_v2_cancel_link_timers() acquires it the second time, which re= sults > =A0in mtx recursion. To avoid that, delay if_addr_mtx acquisition until a= fter > =A0mld_set_version() is called; while here, further reduce locking scope > =A0to protect only the needed pieces: if_multiaddrs, in6m_lookup_locked()= . [...] --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 09:11:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A483106564A; Tue, 20 Mar 2012 09:11:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id CFDDA8FC0A; Tue, 20 Mar 2012 09:11:15 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q2K9B8X8065483; Tue, 20 Mar 2012 11:11:08 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q2K9B8WS034137; Tue, 20 Mar 2012 11:11:08 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q2K9B87r034136; Tue, 20 Mar 2012 11:11:08 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Mar 2012 11:11:07 +0200 From: Konstantin Belousov To: Ken Smith Message-ID: <20120320091107.GG2358@deviant.kiev.zoral.com.ua> References: <201203192220.q2JMKmuk088963@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sLx0z+5FKKtIVDwd" Content-Disposition: inline In-Reply-To: <201203192220.q2JMKmuk088963@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r233211 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 09:11:16 -0000 --sLx0z+5FKKtIVDwd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 19, 2012 at 10:20:48PM +0000, Ken Smith wrote: > Author: kensmith > Date: Mon Mar 19 22:20:47 2012 > New Revision: 233211 > URL: http://svn.freebsd.org/changeset/base/233211 >=20 > Log: > We seem to be having issues with a bug in the loader that causes it to s/loader/linker/ > estimate the program header size for the kernel wrong. It can result > in the kernel build failing with the message: > =20 > ld: kernel.debug: Not enough room for program headers (allocated 5, nee= d 6) > ld: final link failed: Bad value > =20 > Tinderbox builds were failing with this message a short time ago, and > I encountered it while preparing the i386 build machine for the 8.3-RC2 > builds. > =20 > Konstantin has looked at it and believes the issue was fixed in recent > versions of binutils. It is a bit too late in the release process to > be messing around with the loader and/or binutils. This workaround > seems to take care of the problem for now. > =20 > Reviewed by: kib >=20 > Modified: > stable/8/sys/conf/ldscript.i386 >=20 > Modified: stable/8/sys/conf/ldscript.i386 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/conf/ldscript.i386 Mon Mar 19 22:08:13 2012 (r233210) > +++ stable/8/sys/conf/ldscript.i386 Mon Mar 19 22:20:47 2012 (r233211) > @@ -6,7 +6,7 @@ SEARCH_DIR(/usr/lib); > SECTIONS > { > /* Read-only sections, merged into text segment: */ > - . =3D kernbase + kernload + SIZEOF_HEADERS; > + . =3D kernbase + kernload + 256; > .interp : { *(.interp) } > .hash : { *(.hash) } > .dynsym : { *(.dynsym) } --sLx0z+5FKKtIVDwd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEUEARECAAYFAk9oSasACgkQC3+MBN1Mb4hFMQCYh0a2QesJJcRbyheL07GIizAs YwCggeGklaNJb6IyI6XCGOLJV61hTgM= =IyqL -----END PGP SIGNATURE----- --sLx0z+5FKKtIVDwd-- From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 12:24:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDF4A106566C; Tue, 20 Mar 2012 12:24:37 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F9498FC0A; Tue, 20 Mar 2012 12:24:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KCObeT019839; Tue, 20 Mar 2012 12:24:37 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KCOb2P019837; Tue, 20 Mar 2012 12:24:37 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201203201224.q2KCOb2P019837@svn.freebsd.org> From: Maxim Konovalov Date: Tue, 20 Mar 2012 12:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233229 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 12:24:37 -0000 Author: maxim Date: Tue Mar 20 12:24:36 2012 New Revision: 233229 URL: http://svn.freebsd.org/changeset/base/233229 Log: o Xr siftr.4 in order to expose it to a wider audience. Reviewed by: lstewart Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Tue Mar 20 07:59:36 2012 (r233228) +++ head/share/man/man4/tcp.4 Tue Mar 20 12:24:36 2012 (r233229) @@ -562,6 +562,7 @@ address. .Xr intro 4 , .Xr ip 4 , .Xr mod_cc 4 , +.Xr siftr 4 , .Xr syncache 4 , .Xr setkey 8 .Rs From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 12:34:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CBC50106566C; Tue, 20 Mar 2012 12:34:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9E7258FC0A; Tue, 20 Mar 2012 12:34:14 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 3B28346B0C; Tue, 20 Mar 2012 08:34:14 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 49D20B93E; Tue, 20 Mar 2012 08:34:13 -0400 (EDT) From: John Baldwin To: Tijl Coosemans Date: Tue, 20 Mar 2012 08:34:10 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203091148.q29BmuIp005151@svn.freebsd.org> In-Reply-To: <201203091148.q29BmuIp005151@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203200834.10539.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Mar 2012 08:34:13 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232721 - head/sys/x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 12:34:14 -0000 On Friday, March 09, 2012 6:48:56 am Tijl Coosemans wrote: > Author: tijl > Date: Fri Mar 9 11:48:56 2012 > New Revision: 232721 > URL: http://svn.freebsd.org/changeset/base/232721 > > Log: > Clean up x86 endian.h: > - Remove extern "C". There are no functions with external linkage here. [1] > - Rename bswapNN_const(x) to bswapNN_gen(x) to indicate that these macros > are generic implementations that can take non-constant arguments. [1] > - Split up __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P and deal with > each separately. > - Replace _LP64 with __amd64__ because asm instructions are machine > dependent, not ABI dependent. > > Submitted by: bde [1] > Reviewed by: bde BTW, I think I found an old "bug" in this file. The _gen() variants should only use the _gen() variants of smaller types rather than using the version that re-checks __build_constant_p() I think. That is: Index: x86/include/endian.h =================================================================== --- endian.h (revision 233184) +++ endian.h (working copy) @@ -65,9 +65,9 @@ #define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8) #define __bswap32_gen(x) \ - (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) + (((__uint32_t)__bswap16_gen(x) << 16) | __bswap16_gen((x) >> 16)) #define __bswap64_gen(x) \ - (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) + (((__uint64_t)__bswap32_gen(x) << 32) | __bswap32_gen((x) >> 32)) #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P #define __bswap16(x) \ I ran into this while porting the __builtin_constant_p() functionality over to ia64. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 13:08:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C354106564A; Tue, 20 Mar 2012 13:08:58 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 163F98FC0C; Tue, 20 Mar 2012 13:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KD8vqc021318; Tue, 20 Mar 2012 13:08:57 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KD8vFb021315; Tue, 20 Mar 2012 13:08:57 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201203201308.q2KD8vFb021315@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 20 Mar 2012 13:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233230 - in head/sys/boot: fdt uboot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 13:08:58 -0000 Author: raj Date: Tue Mar 20 13:08:57 2012 New Revision: 233230 URL: http://svn.freebsd.org/changeset/base/233230 Log: Improve device tree blob (DTB) handling in loader(8). Enable using the statically embedded blob from the kernel, if present. The KLD loaded DTB takes precedence, but they are both recognized and handled in the same way. Submitted by: Lukasz Wojcik Obtained from: Semihalf MFC after: 1 week Modified: head/sys/boot/fdt/fdt_loader_cmd.c head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Tue Mar 20 12:24:36 2012 (r233229) +++ head/sys/boot/fdt/fdt_loader_cmd.c Tue Mar 20 13:08:57 2012 (r233230) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include "bootstrap.h" #include "glue.h" @@ -56,6 +59,10 @@ __FBSDID("$FreeBSD$"); #define MIN(num1, num2) (((num1) < (num2)) ? (num1):(num2)) +#define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) + +#define FDT_STATIC_DTB_SYMBOL "fdt_static_dtb" + static struct fdt_header *fdtp = NULL; static int fdt_cmd_nyi(int argc, char *argv[]); @@ -92,6 +99,86 @@ static const struct cmdtab commands[] = static char cwd[FDT_CWD_LEN] = "/"; +static vm_offset_t +fdt_find_static_dtb(void) +{ + Elf_Sym sym; + vm_offset_t dyntab, esym; + uint64_t offs; + struct preloaded_file *kfp; + struct file_metadata *md; + Elf_Sym *symtab; + Elf_Dyn *dyn; + char *strtab, *strp; + int i; + + esym = strtab = symtab = 0; + + offs = __elfN(relocation_offset); + + kfp = file_findfile(NULL, NULL); + if (kfp == NULL) + return (0); + + md = file_findmetadata(kfp, MODINFOMD_ESYM); + if (md == NULL) + return (0); + COPYOUT(md->md_data, &esym, sizeof(esym)); + + md = file_findmetadata(kfp, MODINFOMD_DYNAMIC); + if (md == NULL) + return (0); + COPYOUT(md->md_data, &dyntab, sizeof(dyntab)); + dyntab += offs; + + /* Locate STRTAB and DYNTAB */ + for (dyn = (Elf_Dyn *)dyntab; dyn->d_tag != DT_NULL; dyn++) { + if (dyn->d_tag == DT_STRTAB) { + strtab = (char *)(uintptr_t)(dyn->d_un.d_ptr + offs); + continue; + } else if (dyn->d_tag == DT_SYMTAB) { + symtab = (Elf_Sym *)(uintptr_t) + (dyn->d_un.d_ptr + offs); + continue; + } + } + + if (symtab == NULL || strtab == NULL) { + /* + * No symtab? No strtab? That should not happen here, + * and should have been verified during __elfN(loadimage). + * This must be some kind of a bug. + */ + return (0); + } + + /* + * The most efficent way to find a symbol would be to calculate a + * hash, find proper bucket and chain, and thus find a symbol. + * However, that would involve code duplication (e.g. for hash + * function). So we're using simpler and a bit slower way: we're + * iterating through symbols, searching for the one which name is + * 'equal' to 'fdt_static_dtb'. To speed up the process a little bit, + * we are eliminating symbols type of which is not STT_NOTYPE, or(and) + * those which binding attribute is not STB_GLOBAL. + */ + for (i = 0; (vm_offset_t)(symtab + i) < esym; i++) { + COPYOUT(symtab + i, &sym, sizeof(sym)); + if (ELF_ST_BIND(sym.st_info) != STB_GLOBAL || + ELF_ST_TYPE(sym.st_info) != STT_NOTYPE) + continue; + + strp = strdupout((vm_offset_t)(strtab + sym.st_name)); + if (strcmp(strp, FDT_STATIC_DTB_SYMBOL) == 0) { + /* Found a match ! */ + free(strp); + return ((vm_offset_t)(sym.st_value + offs)); + } + free(strp); + } + return (0); +} + static int fdt_setup_fdtp() { @@ -103,10 +190,14 @@ fdt_setup_fdtp() */ bfp = file_findfile(NULL, "dtb"); if (bfp == NULL) { - command_errmsg = "no device tree blob loaded"; - return (CMD_ERROR); + if ((fdtp = (struct fdt_head *)fdt_find_static_dtb()) == 0) { + command_errmsg = "no device tree blob found!"; + return (CMD_ERROR); + } + } else { + /* Dynamic blob has precedence over static. */ + fdtp = (struct fdt_header *)bfp->f_addr; } - fdtp = (struct fdt_header *)bfp->f_addr; /* * Validate the blob. @@ -448,7 +539,10 @@ fixup_stdout(const char *env) } } -int +/* + * Locate the blob, fix it up and return its location. + */ +void * fdt_fixup(void) { const char *env; @@ -461,13 +555,10 @@ fdt_fixup(void) ethstr = NULL; len = 0; - if (!fdtp) { - err = fdt_setup_fdtp(); - if (err) { - sprintf(command_errbuf, "Could not perform blob " - "fixups. Error code: %d\n", err); - return (err); - } + err = fdt_setup_fdtp(); + if (err) { + sprintf(command_errbuf, "No valid device tree blob found!"); + return (NULL); } /* Create /chosen node (if not exists) */ @@ -477,7 +568,7 @@ fdt_fixup(void) /* Value assigned to fixup-applied does not matter. */ if (fdt_getprop(fdtp, chosen, "fixup-applied", NULL)) - return (CMD_OK); + goto success; /* Acquire sys_info */ si = ub_get_sys_info(); @@ -521,7 +612,8 @@ fdt_fixup(void) fdt_setprop(fdtp, chosen, "fixup-applied", NULL, 0); - return (CMD_OK); +success: + return (fdtp); } int @@ -539,7 +631,8 @@ command_fdt_internal(int argc, char *arg /* * Check if uboot env vars were parsed already. If not, do it now. */ - fdt_fixup(); + if (fdt_fixup() == NULL) + return (CMD_ERROR); /* * Validate fdt . @@ -560,10 +653,6 @@ command_fdt_internal(int argc, char *arg return (CMD_ERROR); } - if (!fdtp) - if (fdt_setup_fdtp()) - return (CMD_ERROR); - /* * Call command handler. */ Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Tue Mar 20 12:24:36 2012 (r233229) +++ head/sys/boot/uboot/common/metadata.c Tue Mar 20 13:08:57 2012 (r233230) @@ -333,13 +333,12 @@ md_load(char *args, vm_offset_t *modulep #if defined(LOADER_FDT_SUPPORT) /* Handle device tree blob */ - fdt_fixup(); - if ((bfp = file_findfile(NULL, "dtb")) == NULL && - (howto & RB_VERBOSE)) - printf("**WARNING** Booting with no DTB loaded!\n"); - - dtbp = bfp == NULL ? 0 : bfp->f_addr; - file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); + dtbp = fdt_fixup(); + if (dtbp != (vm_offset_t)NULL) + file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); + else + pager_output("WARNING! Trying to fire up the kernel, but no " + "device tree blob found!\n"); #endif file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 13:20:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C283106566C; Tue, 20 Mar 2012 13:20:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 555BD8FC19; Tue, 20 Mar 2012 13:20:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KDKoSN021744; Tue, 20 Mar 2012 13:20:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KDKoPU021734; Tue, 20 Mar 2012 13:20:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203201320.q2KDKoPU021734@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Mar 2012 13:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233231 - in head/libexec/rtld-elf: . amd64 arm i386 ia64 mips powerpc powerpc64 sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 13:20:50 -0000 Author: kib Date: Tue Mar 20 13:20:49 2012 New Revision: 233231 URL: http://svn.freebsd.org/changeset/base/233231 Log: Fix several problems with our ELF filters implementation. Do not relocate twice an object which happens to be needed by loaded binary (or dso) and some filtee opened due to symbol resolution when relocating need objects. Record the state of the relocation processing in Obj_Entry and short-circuit relocate_objects() if current object already processed. Do not call constructors for filtees loaded during the early relocation processing before image is initialized enough to run user-provided code. Filtees are loaded using dlopen_object(), which normally performs relocation and initialization. If filtee is lazy-loaded during the relocation of dso needed by the main object, dlopen_object() runs too earlier, when most runtime services are not yet ready. Postpone the constructors call to the time when main binary and depended libraries constructors are run, passing the new flag RTLD_LO_EARLY to dlopen_object(). Symbol lookups callers inform symlook_* functions about early stage of initialization with SYMLOOK_EARLY. Pass flags through all functions participating in object relocation. Use the opportunity and fix flags argument to find_symdef() in arch-specific reloc.c to use proper name SYMLOOK_IN_PLT instead of true, which happen to have the same numeric value. Reported and tested by: theraven Reviewed by: kan MFC after: 2 weeks Modified: head/libexec/rtld-elf/amd64/reloc.c head/libexec/rtld-elf/arm/reloc.c head/libexec/rtld-elf/i386/reloc.c head/libexec/rtld-elf/ia64/reloc.c head/libexec/rtld-elf/mips/reloc.c head/libexec/rtld-elf/powerpc/reloc.c head/libexec/rtld-elf/powerpc64/reloc.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h head/libexec/rtld-elf/sparc64/reloc.c Modified: head/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- head/libexec/rtld-elf/amd64/reloc.c Tue Mar 20 13:08:57 2012 (r233230) +++ head/libexec/rtld-elf/amd64/reloc.c Tue Mar 20 13:20:49 2012 (r233231) @@ -82,6 +82,7 @@ do_copy_relocations(Obj_Entry *dstobj) size = dstsym->st_size; symlook_init(&req, name); req.ventry = fetch_ventry(dstobj, ELF_R_SYM(rela->r_info)); + req.flags = SYMLOOK_EARLY; for (srcobj = dstobj->next; srcobj != NULL; srcobj = srcobj->next) { res = symlook_obj(&req, srcobj); @@ -118,7 +119,8 @@ init_pltgot(Obj_Entry *obj) /* Process the non-PLT relocations. */ int -reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, RtldLockState *lockstate) +reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, + RtldLockState *lockstate) { const Elf_Rela *relalim; const Elf_Rela *rela; @@ -151,7 +153,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -170,7 +172,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -200,7 +202,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -214,7 +216,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -245,7 +247,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -277,7 +279,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -291,7 +293,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -305,7 +307,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -330,7 +332,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry done: if (cache != NULL) free(cache); - return(r); + return (r); } /* Process the PLT relocations. */ @@ -366,7 +368,7 @@ reloc_plt(Obj_Entry *obj) /* Relocate the jump slots in an object. */ int -reloc_jmpslots(Obj_Entry *obj, RtldLockState *lockstate) +reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) { const Elf_Rela *relalim; const Elf_Rela *rela; @@ -382,8 +384,8 @@ reloc_jmpslots(Obj_Entry *obj, RtldLockS switch (ELF_R_TYPE(rela->r_info)) { case R_X86_64_JMP_SLOT: where = (Elf_Addr *)(obj->relocbase + rela->r_offset); - def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, true, NULL, - lockstate); + def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, + SYMLOOK_IN_PLT | flags, NULL, lockstate); if (def == NULL) return (-1); if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { @@ -438,7 +440,7 @@ reloc_iresolve(Obj_Entry *obj, RtldLockS } int -reloc_gnu_ifunc(Obj_Entry *obj, RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj, int flags, RtldLockState *lockstate) { const Elf_Rela *relalim; const Elf_Rela *rela; @@ -454,8 +456,8 @@ reloc_gnu_ifunc(Obj_Entry *obj, RtldLock switch (ELF_R_TYPE(rela->r_info)) { case R_X86_64_JMP_SLOT: where = (Elf_Addr *)(obj->relocbase + rela->r_offset); - def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, true, NULL, - lockstate); + def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, + SYMLOOK_IN_PLT | flags, NULL, lockstate); if (def == NULL) return (-1); if (ELF_ST_TYPE(def->st_info) != STT_GNU_IFUNC) Modified: head/libexec/rtld-elf/arm/reloc.c ============================================================================== --- head/libexec/rtld-elf/arm/reloc.c Tue Mar 20 13:08:57 2012 (r233230) +++ head/libexec/rtld-elf/arm/reloc.c Tue Mar 20 13:20:49 2012 (r233231) @@ -54,6 +54,8 @@ do_copy_relocations(Obj_Entry *dstobj) symlook_init(&req, name); req.ventry = fetch_ventry(dstobj, ELF_R_SYM(rel->r_info)); + req.flags = SYMLOOK_EARLY; + for (srcobj = dstobj->next; srcobj != NULL; srcobj = srcobj->next) { res = symlook_obj(&req, srcobj); @@ -135,7 +137,7 @@ store_ptr(void *where, Elf_Addr val) static int reloc_nonplt_object(Obj_Entry *obj, const Elf_Rel *rel, SymCache *cache, - RtldLockState *lockstate) + int flags, RtldLockState *lockstate) { Elf_Addr *where; const Elf_Sym *def; @@ -161,7 +163,7 @@ reloc_nonplt_object(Obj_Entry *obj, cons if (addend & 0x00800000) addend |= 0xff000000; - def = find_symdef(symnum, obj, &defobj, false, cache, + def = find_symdef(symnum, obj, &defobj, flags, cache, lockstate); if (def == NULL) return -1; @@ -188,7 +190,7 @@ reloc_nonplt_object(Obj_Entry *obj, cons case R_ARM_ABS32: /* word32 B + S + A */ case R_ARM_GLOB_DAT: /* word32 B + S */ - def = find_symdef(symnum, obj, &defobj, false, cache, + def = find_symdef(symnum, obj, &defobj, flags, cache, lockstate); if (def == NULL) return -1; @@ -237,7 +239,7 @@ reloc_nonplt_object(Obj_Entry *obj, cons break; case R_ARM_TLS_DTPOFF32: - def = find_symdef(symnum, obj, &defobj, false, cache, + def = find_symdef(symnum, obj, &defobj, flags, cache, lockstate); if (def == NULL) return -1; @@ -254,7 +256,7 @@ reloc_nonplt_object(Obj_Entry *obj, cons break; case R_ARM_TLS_DTPMOD32: - def = find_symdef(symnum, obj, &defobj, false, cache, + def = find_symdef(symnum, obj, &defobj, flags, cache, lockstate); if (def == NULL) return -1; @@ -272,7 +274,7 @@ reloc_nonplt_object(Obj_Entry *obj, cons break; case R_ARM_TLS_TPOFF32: - def = find_symdef(symnum, obj, &defobj, false, cache, + def = find_symdef(symnum, obj, &defobj, flags, cache, lockstate); if (def == NULL) return -1; @@ -311,7 +313,8 @@ reloc_nonplt_object(Obj_Entry *obj, cons * * Process non-PLT relocations * */ int -reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, RtldLockState *lockstate) +reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, + RtldLockState *lockstate) { const Elf_Rel *rellim; const Elf_Rel *rel; @@ -330,7 +333,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry rellim = (const Elf_Rel *)((caddr_t)obj->rel + obj->relsize); for (rel = obj->rel; rel < rellim; rel++) { - if (reloc_nonplt_object(obj, rel, cache, lockstate) < 0) + if (reloc_nonplt_object(obj, rel, cache, flags, lockstate) < 0) goto done; } r = 0; @@ -367,7 +370,7 @@ reloc_plt(Obj_Entry *obj) * * LD_BIND_NOW was set - force relocation for all jump slots * */ int -reloc_jmpslots(Obj_Entry *obj, RtldLockState *lockstate) +reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) { const Obj_Entry *defobj; const Elf_Rel *rellim; @@ -381,7 +384,7 @@ reloc_jmpslots(Obj_Entry *obj, RtldLockS assert(ELF_R_TYPE(rel->r_info) == R_ARM_JUMP_SLOT); where = (Elf_Addr *)(obj->relocbase + rel->r_offset); def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, - true, NULL, lockstate); + SYMLOOK_IN_PLT | flags, NULL, lockstate); if (def == NULL) { dbg("reloc_jmpslots: sym not found"); return (-1); @@ -406,7 +409,8 @@ reloc_iresolve(Obj_Entry *obj, struct St } int -reloc_gnu_ifunc(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj, int flags, + struct Struct_RtldLockState *lockstate) { /* XXX not implemented */ Modified: head/libexec/rtld-elf/i386/reloc.c ============================================================================== --- head/libexec/rtld-elf/i386/reloc.c Tue Mar 20 13:08:57 2012 (r233230) +++ head/libexec/rtld-elf/i386/reloc.c Tue Mar 20 13:20:49 2012 (r233231) @@ -83,6 +83,7 @@ do_copy_relocations(Obj_Entry *dstobj) size = dstsym->st_size; symlook_init(&req, name); req.ventry = fetch_ventry(dstobj, ELF_R_SYM(rel->r_info)); + req.flags = SYMLOOK_EARLY; for (srcobj = dstobj->next; srcobj != NULL; srcobj = srcobj->next) { res = symlook_obj(&req, srcobj); @@ -119,7 +120,8 @@ init_pltgot(Obj_Entry *obj) /* Process the non-PLT relocations. */ int -reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, RtldLockState *lockstate) +reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, + RtldLockState *lockstate) { const Elf_Rel *rellim; const Elf_Rel *rel; @@ -151,7 +153,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -170,7 +172,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -200,7 +202,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -220,7 +222,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry Elf_Addr add; def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -253,7 +255,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -267,7 +269,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) goto done; @@ -286,7 +288,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry done: if (cache != NULL) free(cache); - return(r); + return (r); } /* Process the PLT relocations. */ @@ -322,7 +324,7 @@ reloc_plt(Obj_Entry *obj) /* Relocate the jump slots in an object. */ int -reloc_jmpslots(Obj_Entry *obj, RtldLockState *lockstate) +reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) { const Elf_Rel *rellim; const Elf_Rel *rel; @@ -338,8 +340,8 @@ reloc_jmpslots(Obj_Entry *obj, RtldLockS switch (ELF_R_TYPE(rel->r_info)) { case R_386_JMP_SLOT: where = (Elf_Addr *)(obj->relocbase + rel->r_offset); - def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, true, NULL, - lockstate); + def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, + SYMLOOK_IN_PLT | flags, NULL, lockstate); if (def == NULL) return (-1); if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { @@ -390,7 +392,7 @@ reloc_iresolve(Obj_Entry *obj, RtldLockS } int -reloc_gnu_ifunc(Obj_Entry *obj, RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj, int flags, RtldLockState *lockstate) { const Elf_Rel *rellim; const Elf_Rel *rel; @@ -406,8 +408,8 @@ reloc_gnu_ifunc(Obj_Entry *obj, RtldLock switch (ELF_R_TYPE(rel->r_info)) { case R_386_JMP_SLOT: where = (Elf_Addr *)(obj->relocbase + rel->r_offset); - def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, true, NULL, - lockstate); + def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, + SYMLOOK_IN_PLT | flags, NULL, lockstate); if (def == NULL) return (-1); if (ELF_ST_TYPE(def->st_info) != STT_GNU_IFUNC) Modified: head/libexec/rtld-elf/ia64/reloc.c ============================================================================== --- head/libexec/rtld-elf/ia64/reloc.c Tue Mar 20 13:08:57 2012 (r233230) +++ head/libexec/rtld-elf/ia64/reloc.c Tue Mar 20 13:20:49 2012 (r233231) @@ -151,7 +151,7 @@ free_fptrs(Obj_Entry *obj, bool mapped) /* Relocate a non-PLT object with addend. */ static int reloc_non_plt_obj(Obj_Entry *obj_rtld, Obj_Entry *obj, const Elf_Rela *rela, - SymCache *cache, RtldLockState *lockstate) + SymCache *cache, int flags, RtldLockState *lockstate) { struct fptr **fptrs; Elf_Addr *where = (Elf_Addr *) (obj->relocbase + rela->r_offset); @@ -172,7 +172,7 @@ reloc_non_plt_obj(Obj_Entry *obj_rtld, O Elf_Addr target; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) return -1; @@ -195,7 +195,7 @@ reloc_non_plt_obj(Obj_Entry *obj_rtld, O int sym_index; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - true, cache, lockstate); + SYMLOOK_IN_PLT | flags, cache, lockstate); if (def == NULL) { /* * XXX r_debug_state is problematic and find_symdef() @@ -254,7 +254,7 @@ reloc_non_plt_obj(Obj_Entry *obj_rtld, O Elf_Addr target, gp; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) return -1; @@ -277,7 +277,7 @@ reloc_non_plt_obj(Obj_Entry *obj_rtld, O const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) return -1; @@ -290,7 +290,7 @@ reloc_non_plt_obj(Obj_Entry *obj_rtld, O const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) return -1; @@ -303,7 +303,7 @@ reloc_non_plt_obj(Obj_Entry *obj_rtld, O const Obj_Entry *defobj; def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) return -1; @@ -342,7 +342,8 @@ reloc_non_plt_obj(Obj_Entry *obj_rtld, O /* Process the non-PLT relocations. */ int -reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, RtldLockState *lockstate) +reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, + RtldLockState *lockstate) { const Elf_Rel *rellim; const Elf_Rel *rel; @@ -368,7 +369,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry locrela.r_info = rel->r_info; locrela.r_offset = rel->r_offset; locrela.r_addend = 0; - if (reloc_non_plt_obj(obj_rtld, obj, &locrela, cache, + if (reloc_non_plt_obj(obj_rtld, obj, &locrela, cache, flags, lockstate)) goto done; } @@ -376,7 +377,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry /* Perform relocations with addend if there are any: */ relalim = (const Elf_Rela *) ((caddr_t) obj->rela + obj->relasize); for (rela = obj->rela; obj->rela != NULL && rela < relalim; rela++) { - if (reloc_non_plt_obj(obj_rtld, obj, rela, cache, lockstate)) + if (reloc_non_plt_obj(obj_rtld, obj, rela, cache, flags, + lockstate)) goto done; } @@ -444,7 +446,8 @@ reloc_iresolve(Obj_Entry *obj, struct St } int -reloc_gnu_ifunc(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj, int flags, + struct Struct_RtldLockState *lockstate) { /* XXX not implemented */ @@ -453,7 +456,7 @@ reloc_gnu_ifunc(Obj_Entry *obj, struct S /* Relocate the jump slots in an object. */ int -reloc_jmpslots(Obj_Entry *obj, RtldLockState *lockstate) +reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) { if (obj->jmpslots_done) return 0; @@ -472,7 +475,7 @@ reloc_jmpslots(Obj_Entry *obj, RtldLockS assert(ELF_R_TYPE(rel->r_info) == R_IA_64_IPLTLSB); where = (Elf_Addr *)(obj->relocbase + rel->r_offset); def = find_symdef(ELF_R_SYM(rel->r_info), obj, - &defobj, true, NULL, lockstate); + &defobj, SYMLOOK_IN_PLT | flags, NULL, lockstate); if (def == NULL) return -1; reloc_jmpslot(where, @@ -493,7 +496,7 @@ reloc_jmpslots(Obj_Entry *obj, RtldLockS where = (Elf_Addr *)(obj->relocbase + rela->r_offset); def = find_symdef(ELF_R_SYM(rela->r_info), obj, - &defobj, true, NULL, lockstate); + &defobj, SYMLOOK_IN_PLT | flags, NULL, lockstate); if (def == NULL) return -1; reloc_jmpslot(where, Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Tue Mar 20 13:08:57 2012 (r233230) +++ head/libexec/rtld-elf/mips/reloc.c Tue Mar 20 13:20:49 2012 (r233231) @@ -258,7 +258,8 @@ _mips_rtld_bind(Obj_Entry *obj, Elf_Size } int -reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, RtldLockState *lockstate) +reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, + RtldLockState *lockstate) { const Elf_Rel *rel; const Elf_Rel *rellim; @@ -317,7 +318,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry * to 0 if there are non-PLT references, but older * versions of GNU ld do not do this. */ - def = find_symdef(i, obj, &defobj, false, NULL, + def = find_symdef(i, obj, &defobj, flags, NULL, lockstate); if (def == NULL) return -1; @@ -359,7 +360,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry } } else { /* TODO: add cache here */ - def = find_symdef(i, obj, &defobj, false, NULL, + def = find_symdef(i, obj, &defobj, flags, NULL, lockstate); if (def == NULL) { dbg("Warning4, can't find symbole %d", i); @@ -458,7 +459,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry Elf_Addr old = load_ptr(where, rlen); Elf_Addr val = old; - def = find_symdef(r_symndx, obj, &defobj, false, NULL, + def = find_symdef(r_symndx, obj, &defobj, flags, NULL, lockstate); if (def == NULL) return -1; @@ -482,7 +483,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry Elf_Addr old = load_ptr(where, rlen); Elf_Addr val = old; - def = find_symdef(r_symndx, obj, &defobj, false, NULL, + def = find_symdef(r_symndx, obj, &defobj, flags, NULL, lockstate); if (def == NULL) return -1; @@ -509,7 +510,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry Elf_Addr old = load_ptr(where, rlen); Elf_Addr val = old; - def = find_symdef(r_symndx, obj, &defobj, false, NULL, + def = find_symdef(r_symndx, obj, &defobj, flags, NULL, lockstate); if (def == NULL) @@ -577,7 +578,7 @@ reloc_plt(Obj_Entry *obj) * LD_BIND_NOW was set - force relocation for all jump slots */ int -reloc_jmpslots(Obj_Entry *obj, RtldLockState *lockstate) +reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) { /* Do nothing */ obj->jmpslots_done = true; @@ -594,7 +595,8 @@ reloc_iresolve(Obj_Entry *obj, struct St } int -reloc_gnu_ifunc(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj, int flags, + struct Struct_RtldLockState *lockstate) { /* XXX not implemented */ Modified: head/libexec/rtld-elf/powerpc/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc/reloc.c Tue Mar 20 13:08:57 2012 (r233230) +++ head/libexec/rtld-elf/powerpc/reloc.c Tue Mar 20 13:20:49 2012 (r233231) @@ -92,6 +92,7 @@ do_copy_relocations(Obj_Entry *dstobj) size = dstsym->st_size; symlook_init(&req, name); req.ventry = fetch_ventry(dstobj, ELF_R_SYM(rela->r_info)); + req.flags = SYMLOOK_EARLY; for (srcobj = dstobj->next; srcobj != NULL; srcobj = srcobj->next) { @@ -159,7 +160,7 @@ reloc_non_plt_self(Elf_Dyn *dynp, Elf_Ad */ static int reloc_nonplt_object(Obj_Entry *obj_rtld, Obj_Entry *obj, const Elf_Rela *rela, - SymCache *cache, RtldLockState *lockstate) + SymCache *cache, int flags, RtldLockState *lockstate) { Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset); const Elf_Sym *def; @@ -174,7 +175,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, case R_PPC_ADDR32: /* word32 S + A */ case R_PPC_GLOB_DAT: /* word32 S + A */ def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) { return (-1); } @@ -221,7 +222,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, case R_PPC_DTPMOD32: def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) return (-1); @@ -232,7 +233,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, case R_PPC_TPREL32: def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) return (-1); @@ -261,7 +262,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, case R_PPC_DTPREL32: def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) return (-1); @@ -285,7 +286,8 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, * Process non-PLT relocations */ int -reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, RtldLockState *lockstate) +reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, + RtldLockState *lockstate) { const Elf_Rela *relalim; const Elf_Rela *rela; @@ -309,8 +311,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry */ relalim = (const Elf_Rela *)((caddr_t)obj->rela + obj->relasize); for (rela = obj->rela; rela < relalim; rela++) { - if (reloc_nonplt_object(obj_rtld, obj, rela, cache, lockstate) - < 0) + if (reloc_nonplt_object(obj_rtld, obj, rela, cache, flags, + lockstate) < 0) goto done; } r = 0; @@ -416,7 +418,7 @@ reloc_plt(Obj_Entry *obj) * LD_BIND_NOW was set - force relocation for all jump slots */ int -reloc_jmpslots(Obj_Entry *obj, RtldLockState *lockstate) +reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) { const Obj_Entry *defobj; const Elf_Rela *relalim; @@ -430,7 +432,7 @@ reloc_jmpslots(Obj_Entry *obj, RtldLockS assert(ELF_R_TYPE(rela->r_info) == R_PPC_JMP_SLOT); where = (Elf_Addr *)(obj->relocbase + rela->r_offset); def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - true, NULL, lockstate); + SYMLOOK_IN_PLT | flags, NULL, lockstate); if (def == NULL) { dbg("reloc_jmpslots: sym not found"); return (-1); @@ -525,7 +527,8 @@ reloc_iresolve(Obj_Entry *obj, struct St } int -reloc_gnu_ifunc(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj, int flags, + struct Struct_RtldLockState *lockstate) { /* XXX not implemented */ Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc64/reloc.c Tue Mar 20 13:08:57 2012 (r233230) +++ head/libexec/rtld-elf/powerpc64/reloc.c Tue Mar 20 13:20:49 2012 (r233231) @@ -86,6 +86,7 @@ do_copy_relocations(Obj_Entry *dstobj) size = dstsym->st_size; symlook_init(&req, name); req.ventry = fetch_ventry(dstobj, ELF_R_SYM(rela->r_info)); + req.flags = SYMLOOK_EARLY; for (srcobj = dstobj->next; srcobj != NULL; srcobj = srcobj->next) { @@ -153,7 +154,7 @@ reloc_non_plt_self(Elf_Dyn *dynp, Elf_Ad */ static int reloc_nonplt_object(Obj_Entry *obj_rtld, Obj_Entry *obj, const Elf_Rela *rela, - SymCache *cache, RtldLockState *lockstate) + SymCache *cache, int flags, RtldLockState *lockstate) { Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset); const Elf_Sym *def; @@ -169,7 +170,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, case R_PPC64_ADDR64: case R_PPC_GLOB_DAT: def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) { return (-1); } @@ -216,7 +217,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, case R_PPC64_DTPMOD64: def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) return (-1); @@ -227,7 +228,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, case R_PPC64_TPREL64: def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) return (-1); @@ -256,7 +257,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, case R_PPC64_DTPREL64: def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - false, cache, lockstate); + flags, cache, lockstate); if (def == NULL) return (-1); @@ -280,7 +281,8 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, * Process non-PLT relocations */ int -reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, RtldLockState *lockstate) +reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, + RtldLockState *lockstate) { const Elf_Rela *relalim; const Elf_Rela *rela; @@ -307,8 +309,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry */ relalim = (const Elf_Rela *)((caddr_t)obj->rela + obj->relasize); for (rela = obj->rela; rela < relalim; rela++) { - if (reloc_nonplt_object(obj_rtld, obj, rela, cache, lockstate) - < 0) + if (reloc_nonplt_object(obj_rtld, obj, rela, cache, flags, + lockstate) < 0) goto done; } r = 0; @@ -379,7 +381,7 @@ reloc_plt(Obj_Entry *obj) * LD_BIND_NOW was set - force relocation for all jump slots */ int -reloc_jmpslots(Obj_Entry *obj, RtldLockState *lockstate) +reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) { const Obj_Entry *defobj; const Elf_Rela *relalim; @@ -393,7 +395,7 @@ reloc_jmpslots(Obj_Entry *obj, RtldLockS assert(ELF_R_TYPE(rela->r_info) == R_PPC_JMP_SLOT); where = (Elf_Addr *)(obj->relocbase + rela->r_offset); def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - true, NULL, lockstate); + SYMLOOK_IN_PLT | flags, NULL, lockstate); if (def == NULL) { dbg("reloc_jmpslots: sym not found"); return (-1); @@ -468,7 +470,8 @@ reloc_iresolve(Obj_Entry *obj, struct St } int -reloc_gnu_ifunc(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj, int flags, + struct Struct_RtldLockState *lockstate) { /* XXX not implemented */ Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Mar 20 13:08:57 2012 (r233230) +++ head/libexec/rtld-elf/rtld.c Tue Mar 20 13:20:49 2012 (r233231) @@ -116,9 +116,10 @@ static void objlist_push_head(Objlist *, static void objlist_push_tail(Objlist *, Obj_Entry *); static void objlist_remove(Objlist *, Obj_Entry *); static void *path_enumerate(const char *, path_enum_proc, void *); -static int relocate_objects(Obj_Entry *, bool, Obj_Entry *, RtldLockState *); +static int relocate_objects(Obj_Entry *, bool, Obj_Entry *, int, + RtldLockState *); static int resolve_objects_ifunc(Obj_Entry *first, bool bind_now, - RtldLockState *lockstate); + int flags, RtldLockState *lockstate); static int rtld_dirname(const char *, char *); static int rtld_dirname_abs(const char *, char *); static void *rtld_dlopen(const char *name, int fd, int mode); @@ -545,7 +546,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ } if (relocate_objects(obj_main, - ld_bind_now != NULL && *ld_bind_now != '\0', &obj_rtld, NULL) == -1) + ld_bind_now != NULL && *ld_bind_now != '\0', + &obj_rtld, SYMLOOK_EARLY, NULL) == -1) die(); dbg("doing copy relocations"); @@ -580,7 +582,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ dbg("resolving ifuncs"); if (resolve_objects_ifunc(obj_main, - ld_bind_now != NULL && *ld_bind_now != '\0', NULL) == -1) + ld_bind_now != NULL && *ld_bind_now != '\0', SYMLOOK_EARLY, + NULL) == -1) die(); if (!obj_main->crt_no_init) { @@ -1552,7 +1555,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * * that symbols can be found. */ - relocate_objects(&objtmp, true, &objtmp, NULL); + relocate_objects(&objtmp, true, &objtmp, 0, NULL); } /* Initialize the object list. */ @@ -1605,6 +1608,7 @@ initlist_add_neededs(Needed_Entry *neede static void initlist_add_objects(Obj_Entry *obj, Obj_Entry **tail, Objlist *list) { + if (obj->init_scanned || obj->init_done) return; obj->init_scanned = true; @@ -1616,6 +1620,10 @@ initlist_add_objects(Obj_Entry *obj, Obj /* Recursively process the needed objects. */ if (obj->needed != NULL) initlist_add_neededs(obj->needed, list); + if (obj->needed_filtees != NULL) + initlist_add_neededs(obj->needed_filtees, list); + if (obj->needed_aux_filtees != NULL) + initlist_add_neededs(obj->needed_aux_filtees, list); /* Add the object to the init list. */ if (obj->preinit_array != (Elf_Addr)NULL || obj->init != (Elf_Addr)NULL || @@ -2144,13 +2152,17 @@ objlist_remove(Objlist *list, Obj_Entry */ static int relocate_objects(Obj_Entry *first, bool bind_now, Obj_Entry *rtldobj, - RtldLockState *lockstate) + int flags, RtldLockState *lockstate) { Obj_Entry *obj; for (obj = first; obj != NULL; obj = obj->next) { + if (obj->relocated) + continue; + obj->relocated = true; if (obj != rtldobj) dbg("relocating \"%s\"", obj->path); + if (obj->nbuckets == 0 || obj->nchains == 0 || obj->buckets == NULL || obj->symtab == NULL || obj->strtab == NULL) { _rtld_error("%s: Shared object has no run-time symbol table", @@ -2169,7 +2181,7 @@ relocate_objects(Obj_Entry *first, bool } /* Process the non-PLT relocations. */ - if (reloc_non_plt(obj, rtldobj, lockstate)) + if (reloc_non_plt(obj, rtldobj, flags, lockstate)) return -1; if (obj->textrel) { /* Re-protected the text segment. */ @@ -2190,7 +2202,7 @@ relocate_objects(Obj_Entry *first, bool return -1; /* Relocate the jump slots if we are doing immediate binding. */ if (obj->bind_now || bind_now) - if (reloc_jmpslots(obj, lockstate) == -1) + if (reloc_jmpslots(obj, flags, lockstate) == -1) return -1; if (obj->relro_size > 0) { @@ -2225,35 +2237,39 @@ relocate_objects(Obj_Entry *first, bool * consistent with how GNU does it. */ static int -resolve_object_ifunc(Obj_Entry *obj, bool bind_now, RtldLockState *lockstate) +resolve_object_ifunc(Obj_Entry *obj, bool bind_now, int flags, + RtldLockState *lockstate) { if (obj->irelative && reloc_iresolve(obj, lockstate) == -1) return (-1); if ((obj->bind_now || bind_now) && obj->gnu_ifunc && - reloc_gnu_ifunc(obj, lockstate) == -1) + reloc_gnu_ifunc(obj, flags, lockstate) == -1) return (-1); return (0); } static int -resolve_objects_ifunc(Obj_Entry *first, bool bind_now, RtldLockState *lockstate) +resolve_objects_ifunc(Obj_Entry *first, bool bind_now, int flags, + RtldLockState *lockstate) { Obj_Entry *obj; for (obj = first; obj != NULL; obj = obj->next) { - if (resolve_object_ifunc(obj, bind_now, lockstate) == -1) + if (resolve_object_ifunc(obj, bind_now, flags, lockstate) == -1) return (-1); } return (0); } static int -initlist_objects_ifunc(Objlist *list, bool bind_now, RtldLockState *lockstate) +initlist_objects_ifunc(Objlist *list, bool bind_now, int flags, + RtldLockState *lockstate) { Objlist_Entry *elm; STAILQ_FOREACH(elm, list, link) { - if (resolve_object_ifunc(elm->obj, bind_now, lockstate) == -1) + if (resolve_object_ifunc(elm->obj, bind_now, flags, + lockstate) == -1) return (-1); } return (0); @@ -2515,17 +2531,30 @@ dlopen_object(const char *name, int fd, objlist_push_tail(&list_global, obj); if (*old_obj_tail != NULL) { /* We loaded something new. */ assert(*old_obj_tail == obj); - result = load_needed_objects(obj, lo_flags & RTLD_LO_DLOPEN); + result = load_needed_objects(obj, + lo_flags & (RTLD_LO_DLOPEN | RTLD_LO_EARLY)); init_dag(obj); ref_dag(obj); if (result != -1) result = rtld_verify_versions(&obj->dagmembers); if (result != -1 && ld_tracing) goto trace; - if (result == -1 || (relocate_objects(obj, (mode & RTLD_MODEMASK) - == RTLD_NOW, &obj_rtld, &lockstate)) == -1) { + if (result == -1 || (relocate_objects(obj, + (mode & RTLD_MODEMASK) == RTLD_NOW, &obj_rtld, + (lo_flags & RTLD_LO_EARLY) ? SYMLOOK_EARLY : 0, + &lockstate)) == -1) { dlopen_cleanup(obj); obj = NULL; + } else if (lo_flags & RTLD_LO_EARLY) { + /* + * Do not call the init functions for early loaded + * filtees. The image is still not initialized enough + * for them to work. + * + * Our object is found by the global object list and + * will be ordered among all init calls done right + * before transferring control to main. + */ } else { /* Make list of init functions to call. */ initlist_add_objects(obj, &obj->next, &initlist); @@ -2559,6 +2588,7 @@ dlopen_object(const char *name, int fd, map_stacks_exec(&lockstate); if (initlist_objects_ifunc(&initlist, (mode & RTLD_MODEMASK) == RTLD_NOW, + (lo_flags & RTLD_LO_EARLY) ? SYMLOOK_EARLY : 0, &lockstate) == -1) { objlist_clear(&initlist); dlopen_cleanup(obj); @@ -2566,8 +2596,10 @@ dlopen_object(const char *name, int fd, return (NULL); } - /* Call the init functions. */ - objlist_call_init(&initlist, &lockstate); + if (!(lo_flags & RTLD_LO_EARLY)) { + /* Call the init functions. */ + objlist_call_init(&initlist, &lockstate); + } objlist_clear(&initlist); lock_release(rtld_bind_lock, &lockstate); return obj; @@ -3354,12 +3386,13 @@ symlook_obj(SymLook *req, const Obj_Entr { DoneList donelist; SymLook req1; - int res, mres; + int flags, res, mres; mres = symlook_obj1(req, obj); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 14:20:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07EFB106567A; Tue, 20 Mar 2012 14:20:27 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay005.isp.belgacom.be (mailrelay005.isp.belgacom.be [195.238.6.171]) by mx1.freebsd.org (Postfix) with ESMTP id EBBAE8FC1F; Tue, 20 Mar 2012 14:20:25 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EAMeQaE9bsV1u/2dsb2JhbABChT+xEoEIggkBAQUjMyMQCw4GBCoCAjkeBoghB6Ugkh6PaIEWBKYGgmg Received: from 110.93-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.93.110]) by relay.skynet.be with ESMTP; 20 Mar 2012 15:19:16 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q2KEJFsh003383; Tue, 20 Mar 2012 15:19:15 +0100 (CET) (envelope-from tijl@freebsd.org) From: Tijl Coosemans To: John Baldwin Date: Tue, 20 Mar 2012 15:19:07 +0100 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.7.3; i386; ; ) References: <201203091148.q29BmuIp005151@svn.freebsd.org> <201203200834.10539.jhb@freebsd.org> In-Reply-To: <201203200834.10539.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1437011.eaDneX7VNl"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201203201519.12926.tijl@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232721 - head/sys/x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 14:20:27 -0000 --nextPart1437011.eaDneX7VNl Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tuesday 20 March 2012 13:34:10 John Baldwin wrote: > On Friday, March 09, 2012 6:48:56 am Tijl Coosemans wrote: >> Author: tijl >> Date: Fri Mar 9 11:48:56 2012 >> New Revision: 232721 >> URL: http://svn.freebsd.org/changeset/base/232721 >>=20 >> Log: >> Clean up x86 endian.h: >> - Remove extern "C". There are no functions with external linkage here= =2E [1] >> - Rename bswapNN_const(x) to bswapNN_gen(x) to indicate that these mac= ros >> are generic implementations that can take non-constant arguments. [1] >> - Split up __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P and deal wi= th >> each separately. >> - Replace _LP64 with __amd64__ because asm instructions are machine >> dependent, not ABI dependent. >> =20 >> Submitted by: bde [1] >> Reviewed by: bde >=20 > BTW, I think I found an old "bug" in this file. The _gen() variants > should only use the _gen() variants of smaller types rather than using > the version that re-checks __build_constant_p() I think. That is: >=20 > Index: x86/include/endian.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- endian.h (revision 233184) > +++ endian.h (working copy) > @@ -65,9 +65,9 @@ > =20 > #define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8) > #define __bswap32_gen(x) \ > - (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) > + (((__uint32_t)__bswap16_gen(x) << 16) | __bswap16_gen((x) >> 16)) > #define __bswap64_gen(x) \ > - (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) > + (((__uint64_t)__bswap32_gen(x) << 32) | __bswap32_gen((x) >> 32)) > =20 > #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P > #define __bswap16(x) \ >=20 > I ran into this while porting the __builtin_constant_p() functionality > over to ia64. No, on i386 bswap64 with a variable argument currently expands to two bswap instructions. With your change it would be many shifts and logical operations. The _gen variants are more like fallback implementations. If bswapNN cannot be implemented directly it is split up. If those smaller problems can be implemented directly, good, if not split it up again and so on. --nextPart1437011.eaDneX7VNl Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk9okeAACgkQfoCS2CCgtivVyQD+N6E+TflHXqi3/3rNpRGKJwSI 5l7S2VYCqb/EQAzZeA0A/0gJ93lZxKzEH77Uwi1Sqi1YWJIIeUtlpUIdpJM/OBaU =ZDYk -----END PGP SIGNATURE----- --nextPart1437011.eaDneX7VNl-- From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 14:36:13 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90AF01065670; Tue, 20 Mar 2012 14:36:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 13E5F8FC0A; Tue, 20 Mar 2012 14:36:12 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q2KEaBsv026135; Tue, 20 Mar 2012 18:36:11 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q2KEaBSD026134; Tue, 20 Mar 2012 18:36:11 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 20 Mar 2012 18:36:11 +0400 From: Gleb Smirnoff To: Davide Italiano Message-ID: <20120320143611.GH30704@FreeBSD.org> References: <201203162032.q2GKWBRV033715@svn.freebsd.org> <20120319194431.GD30704@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, George Neville-Neil , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r233045 - in head/sys: conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 14:36:13 -0000 On Mon, Mar 19, 2012 at 09:06:36PM +0100, Davide Italiano wrote: D> >> These indented ifdefs look like a major violation of style used throughout D> >> the FreeBSD kernel code. Can you please keep with common style? D> >> D> > D> > Heh, D> > sorry, also Juli Mallet noticed this, I'm writing a fix for this and D> > after I'll have approval from my mentor I'll commit. Looks okay, apart from additional empty line in NOTES. Isn't single empty line enough? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 15:20:54 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 85D7C1065670; Tue, 20 Mar 2012 15:20:54 +0000 (UTC) (envelope-from theraven@theravensnest.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id 1F6028FC0C; Tue, 20 Mar 2012 15:20:53 +0000 (UTC) Received: from [192.168.0.2] (cpc1-cwma8-2-0-cust257.7-3.cable.virginmedia.com [82.20.153.2]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id q2KFKk4l022576 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 20 Mar 2012 15:20:46 GMT (envelope-from theraven@theravensnest.org) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <201201050148.q051mQl5008914@svn.freebsd.org> Date: Tue, 20 Mar 2012 15:20:41 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <0272CDA5-A574-436D-8FCA-6E9427924D6F@theravensnest.org> References: <201201050148.q051mQl5008914@svn.freebsd.org> To: "Pedro F. Giffuni" X-Mailer: Apple Mail (2.1257) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org Subject: Re: svn commit: r229551 - in stable/9/contrib/libstdc++: . config/os/aix include/bits include/ext include/tr1 libsupc++ src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 15:20:54 -0000 This part of the change gratuitously alters the vtable layout of a core = ABI class and will break things. Please revert it. David On 5 Jan 2012, at 01:48, Pedro F. Giffuni wrote: > Modified: stable/9/contrib/libstdc++/libsupc++/typeinfo > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/9/contrib/libstdc++/libsupc++/typeinfo Thu Jan 5 = 01:40:42 2012 (r229550) > +++ stable/9/contrib/libstdc++/libsupc++/typeinfo Thu Jan 5 = 01:48:25 2012 (r229551) > @@ -99,7 +99,13 @@ namespace std=20 > #endif > bool operator!=3D(const type_info& __arg) const > { return !operator=3D=3D(__arg); } > - =20 > + > + // Return true if this is a pointer type of some kind > + virtual bool __is_pointer_p() const; > + > + // Return true if this is a function type > + virtual bool __is_function_p() const; > + > // Try and catch a thrown type. Store an adjusted pointer to the > // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then > // THR_OBJ points to the thrown object. If THR_TYPE is a pointer > @@ -113,12 +119,6 @@ namespace std=20 > virtual bool __do_upcast(const __cxxabiv1::__class_type_info = *__target, > void **__obj_ptr) const; >=20 > - // Return true if this is a pointer type of some kind > - virtual bool __is_pointer_p() const; > - > - // Return true if this is a function type > - virtual bool __is_function_p() const; > - > protected: > const char *__name; >=20 >=20 From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 16:56:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D24711065673; Tue, 20 Mar 2012 16:56:35 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBF7E8FC12; Tue, 20 Mar 2012 16:56:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KGuZ2N028689; Tue, 20 Mar 2012 16:56:35 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KGuZaY028687; Tue, 20 Mar 2012 16:56:35 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203201656.q2KGuZaY028687@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 20 Mar 2012 16:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233232 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 16:56:35 -0000 Author: pluknet Date: Tue Mar 20 16:56:35 2012 New Revision: 233232 URL: http://svn.freebsd.org/changeset/base/233232 Log: Update the list of struct ifnet fields. - Document if_vnet, if_home_vnet, if_carp, if_vlantrunk, if_multiaddrs, if_amcount, if_addr, if_llsoftc stub, if_broadcastaddr, if_bridge, if_label, if_afdata, if_afdata_initialized, if_afdata_lock, if_linktask, if_addr_mtx (now if_addr_lock), if_clones, if_groups, if_pf_kif, if_lagg, if_alloctype - G/c now defunct and/or commented out in the manual page if_ipending, if_poll_slowq, if_done, if_poll_recv, if_poll_xmit, if_poll_slowinput, if_poll_intren - Update if_snd type changed with ALTQ integration. MFC after: 1 week Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Tue Mar 20 13:20:49 2012 (r233231) +++ head/share/man/man9/ifnet.9 Tue Mar 20 16:56:35 2012 (r233232) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2012 +.Dd March 20, 2012 .Dt IFNET 9 .Os .Sh NAME @@ -229,6 +229,18 @@ A pointer to the driver's private state A pointer to the common data for the interface's layer 2 protocol. (Initialized by .Fn if_alloc . ) +.It Va if_vnet +.Pq Vt "struct vnet *" +A pointer to the virtual network stack instance. +(Initialized by +.Fn if_attach . ) +.It Va if_home_vnet +.Pq Vt "struct vnet *" +A pointer to the parent virtual network stack, where this +.Vt "struct ifnet" +originates from. +(Initialized by +.Fn if_attach . ) .It Va if_link .Pq Fn TAILQ_ENTRY ifnet .Xr queue 3 @@ -276,6 +288,13 @@ A count of promiscuous listeners on this reference-count the .Dv IFF_PROMISC flag. +.It Va if_carp +.Pq Vt "struct carp_if *" +A pointer to the CARP interface structure, +.Xr carp 4 . +(Initialized by the driver-specific +.Fn if_ioctl +routine.) .It Va if_bpf .Pq Vt "struct bpf_if *" Opaque per-interface data for the packet filter, @@ -293,6 +312,13 @@ to refer to a particular interface by in .Xr link_addr 3 ) . (Initialized by .Fn if_alloc . ) +.It Va if_vlantrunk +.Pq Vt struct ifvlantrunk * +A pointer to 802.1Q trunk structure, +.Xr vlan 4 . +(Initialized by the driver-specific +.Fn if_ioctl +routine.) .It Va if_flags .Pq Vt int Flags describing operational parameters of this interface (see below). @@ -307,17 +333,6 @@ Flags describing the capabilities the in .It Va if_capenable .Pq Vt int Flags describing the enabled capabilities of the interface (see below). -.\" .It Va if_ipending -.\" Interrupt-pending bits for polled operation: -.\" .Dv IFI_XMIT -.\" (transmit complete interrupt) -.\" and -.\" .Dv IFI_RECV -.\" (received packet ready interrupt). -.\" See the -.\" .Sx Polling -.\" section, below. -.\" (Manipulated by driver.) .It Va if_linkmib .Pq Vt "void *" A pointer to an interface-specific MIB structure exported by @@ -334,18 +349,97 @@ More statistics and information; see below. (Initialized by driver, manipulated by both driver and generic code.) +.It Va if_multiaddrs +.Pq Vt struct ifmultihead +The head of the +.Xr queue 3 +.Li TAILQ +containing the list of multicast addresses assigned to this interface. +.It Va if_amcount +.Pq Vt int +A number of multicast requests on this interface, used to +reference-count the +.Dv IFF_ALLMULTI +flag. +.It Va if_addr +.Pq Vt "struct ifaddr *" +A pointer to the link-level interface address. +(Initialized by +.Fn if_alloc . ) +.\" .It Va if_llsoftc +.\" .Pq Vt "void *" +.\" The purpose of the field is unclear. .It Va if_snd -.Pq Vt "struct ifqueue" +.Pq Vt "struct ifaltq" The output queue. (Manipulated by driver.) -.\".It Va if_poll_slowq -.\".Pq Vt "struct ifqueue *" -.\"A pointer to the input queue for devices which do not support polling -.\"well. -.\"See the -.\".Sx Polling -.\"section, below. -.\"(Initialized by driver.) +.It Va if_broadcastaddr +.Pq Vt "const u_int8_t *" +A link-level broadcast bytestring for protocols with variable address +length. +.It Va if_bridge +.Pq Vt "void *" +A pointer to the bridge interface structure, +.Xr if_bridge 4 . +(Initialized by the driver-specific +.Fn if_ioctl +routine.) +.It Va if_label +.Pq Vt "struct label *" +A pointer to the MAC Framework label structure, +.Xr mac 4 . +(Initialized by +.Fn if_alloc . ) +.It Va if_afdata +.Pq Vt "void *" +An address family dependent data region. +.It Va if_afdata_initialized +.Pq Vt int +Used to track the current state of address family initialization. +.It Va if_afdata_lock +.Pq Vt "struct rwlock" +An +.Xr rwlock 9 +lock used to protect +.Va if_afdata +internals. +.It Va if_linktask +.Pq Vt "struct task" +A +.Xr taskqueue 9 +task scheduled for link state change events of the interface. +.It Va if_addr_lock +.Pq Vt "struct rwlock" +An +.Xr rwlock 9 +lock used to protect interface-related address lists. +.It Va if_clones +.Pq Fn LIST_ENTRY ifnet +.Xr queue 3 +macro glue for the list of clonable network interfaces. +.It Va if_groups +.Pq Fn TAILQ_HEAD ", ifg_list" +The head of the +.Xr queue 3 +.Li TAILQ +containing the list of groups per interface. +.It Va if_pf_kif +.Pq Vt "void *" +A pointer to the structure used for interface abstraction by +.Xr pf 4 . +.It Va if_lagg +.Pq Vt "void *" +A pointer to the +.Xr lagg 4 +interface structure. +.It Va if_alloctype +.Pq Vt u_char +The type of the interface as it was at the time of its allocation. +It is used to cache the type passed to +.Fn if_alloc , +but unlike +.Va if_type , +it would not be changed by drivers. .El .Pp References to @@ -416,10 +510,6 @@ flag is not set. does not literally mean that output is active, but rather that the device's internal output queue is full.) Please note that this function will soon be deprecated. -.It Fn if_done -Not used. -We are not even sure what it was ever for. -The prototype is faked. .It Fn if_ioctl Process interface-related .Xr ioctl 2 @@ -434,13 +524,6 @@ flags and flushing queues. See the description of .Fn ifioctl below for more information. -.\" .It Fn if_poll_recv -.\" .It Fn if_poll_xmit -.\" .It Fn if_poll_slowinput -.\" .It Fn if_poll_intren -.\" See the -.\" .Sx Polling -.\" section, below. .It Fn if_init Initialize and bring up the hardware, e.g., reset the chip and enable the receiver unit. From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 17:00:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CD14106564A; Tue, 20 Mar 2012 17:00:52 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 68A838FC19; Tue, 20 Mar 2012 17:00:51 +0000 (UTC) Received: by vcmm1 with SMTP id m1so335349vcm.13 for ; Tue, 20 Mar 2012 10:00:50 -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=yxKnFOW9GjyD5oAFXrFsgpbXt1o6nvusXoqvP0QkmMs=; b=DLJgPMgrHoum3BxlDYZVT4SX3GxMJCX3+ioqgr2TJ4s51vG3s/8JfLYPKEiYrAPex8 pplwdSyS3Z0AQjVAYELIIGukxMNL4iOr0og/txNHxOlQOdDsYwhdtTLBHh69V2dJjWK1 5iYfA+9Ideoaoh24Q9pNlF292lDdswiMXB4nI+WwoJ1Ga0KWDMNb4q1P3ZE5PKez6q7l ROAWO1UilRKBNiJss8p/VpriSAGa/8u6eMitl+jBTXZwSQnzY19o8sS/HoBsc9HxytO1 +/DR+VEsQKCEossYCjQ7Km7kkyr81vjoSqtO1snl1Fdue2+DiFW3d0TCXE5P7acXIAzC GagA== MIME-Version: 1.0 Received: by 10.52.93.77 with SMTP id cs13mr221353vdb.71.1332262850564; Tue, 20 Mar 2012 10:00:50 -0700 (PDT) Received: by 10.52.171.167 with HTTP; Tue, 20 Mar 2012 10:00:50 -0700 (PDT) In-Reply-To: <20120320143611.GH30704@FreeBSD.org> References: <201203162032.q2GKWBRV033715@svn.freebsd.org> <20120319194431.GD30704@FreeBSD.org> <20120320143611.GH30704@FreeBSD.org> Date: Tue, 20 Mar 2012 18:00:50 +0100 Message-ID: From: Davide Italiano To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, George Neville-Neil , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233045 - in head/sys: conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 17:00:52 -0000 2012/3/20 Gleb Smirnoff : > On Mon, Mar 19, 2012 at 09:06:36PM +0100, Davide Italiano wrote: > D> >> These indented ifdefs look like a major violation of style used throughout > D> >> the FreeBSD kernel code. Can you please keep with common style? > D> >> > D> > > D> > Heh, > D> > sorry, also Juli Mallet noticed this, I'm writing a fix for this and > D> > after I'll have approval from my mentor I'll commit. > > Looks okay, apart from additional empty line in NOTES. Isn't single > empty line enough? > > -- > Totus tuus, Glebius. Well, I removed that in my previous commit. It was a mistake. But if you think it's ok to remove that line, I have no objections on this. Davide From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 17:41:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9E001065677; Tue, 20 Mar 2012 17:41:02 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4C6C8FC18; Tue, 20 Mar 2012 17:41:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KHf28w030145; Tue, 20 Mar 2012 17:41:02 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KHf2XI030141; Tue, 20 Mar 2012 17:41:02 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201203201741.q2KHf2XI030141@svn.freebsd.org> From: David Chisnall Date: Tue, 20 Mar 2012 17:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233233 - vendor/libcxxrt/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 17:41:03 -0000 Author: theraven Date: Tue Mar 20 17:41:02 2012 New Revision: 233233 URL: http://svn.freebsd.org/changeset/base/233233 Log: Import new version of libcxxrt to vendor branch. Approved by: dim (mentor) Deleted: vendor/libcxxrt/dist/typeinfo Modified: vendor/libcxxrt/dist/dynamic_cast.cc vendor/libcxxrt/dist/exception.cc vendor/libcxxrt/dist/typeinfo.h Modified: vendor/libcxxrt/dist/dynamic_cast.cc ============================================================================== --- vendor/libcxxrt/dist/dynamic_cast.cc Tue Mar 20 16:56:35 2012 (r233232) +++ vendor/libcxxrt/dist/dynamic_cast.cc Tue Mar 20 17:41:02 2012 (r233233) @@ -46,9 +46,65 @@ struct vtable_header */ #define ADD_TO_PTR(x, off) (__typeof__(x))(((char*)x) + off) -bool __class_type_info::can_cast_to(const struct __class_type_info *other) const +bool std::type_info::__do_catch(std::type_info const *ex_type, + void **exception_object, + unsigned int outer) const { - return this == other; + const type_info *type = this; + + if (type == ex_type) + { + return true; + } + if (const __class_type_info *cti = dynamic_cast(type)) + { + return ex_type->__do_upcast(cti, exception_object); + } + return false; +} + +bool __pbase_type_info::__do_catch(std::type_info const *ex_type, + void **exception_object, + unsigned int outer) const +{ + if (ex_type == this) + { + return true; + } + if (!ex_type->__is_pointer_p()) + { + // Can't catch a non-pointer type in a pointer catch + return false; + } + + if (!(outer & 1)) + { + // If the low bit is cleared on this means that we've gone + // through a pointer that is not const qualified. + return false; + } + // Clear the low bit on outer if we're not const qualified. + if (!(__flags & __const_mask)) + { + outer &= ~1; + } + + const __pbase_type_info *ptr_type = + static_cast(ex_type); + + if (ptr_type->__flags & ~__flags) + { + // Handler pointer is less qualified + return false; + } + + // Special case for void* handler. + if(*__pointee == typeid(void)) + { + return true; + } + + return __pointee->__do_catch(ptr_type->__pointee, exception_object, outer); } void *__class_type_info::cast_to(void *obj, const struct __class_type_info *other) const @@ -60,12 +116,6 @@ void *__class_type_info::cast_to(void *o return 0; } - -bool __si_class_type_info::can_cast_to(const struct __class_type_info *other) const -{ - return this == other || __base_type->can_cast_to(other); -} - void *__si_class_type_info::cast_to(void *obj, const struct __class_type_info *other) const { if (this == other) @@ -74,31 +124,32 @@ void *__si_class_type_info::cast_to(void } return __base_type->cast_to(obj, other); } - - -bool __vmi_class_type_info::can_cast_to(const struct __class_type_info *other) const +bool __si_class_type_info::__do_upcast(const __class_type_info *target, + void **thrown_object) const { - if (this == other) + if (this == target) { return true; } - for (unsigned int i=0 ; i<__base_count ; i++) - { - const __base_class_type_info *info = &__base_info[i]; - if(info->isPublic() && info->__base_type->can_cast_to(other)) - { - return true; - } - } - return false; + return __base_type->__do_upcast(target, thrown_object); } void *__vmi_class_type_info::cast_to(void *obj, const struct __class_type_info *other) const { - if (this == other) + if (__do_upcast(other, &obj)) { return obj; } + return 0; +} + +bool __vmi_class_type_info::__do_upcast(const __class_type_info *target, + void **thrown_object) const +{ + if (this == target) + { + return true; + } for (unsigned int i=0 ; i<__base_count ; i++) { const __base_class_type_info *info = &__base_info[i]; @@ -111,6 +162,7 @@ void *__vmi_class_type_info::cast_to(voi // virtual table of the virtual base offset for the virtual base // referenced (negative).' + void *obj = *thrown_object; if (info->isVirtual()) { // Object's vtable @@ -121,18 +173,17 @@ void *__vmi_class_type_info::cast_to(voi } void *cast = ADD_TO_PTR(obj, offset); - if (info->__base_type == other) + if (info->__base_type == target || + (info->__base_type->__do_upcast(target, &cast))) { - return cast; - } - if ((cast = info->__base_type->cast_to(cast, other))) - { - return cast; + *thrown_object = cast; + return true; } } return 0; } + /** * ABI function used to implement the dynamic_cast<> operator. Some cases of * this operator are implemented entirely in the compiler (e.g. to void*). Modified: vendor/libcxxrt/dist/exception.cc ============================================================================== --- vendor/libcxxrt/dist/exception.cc Tue Mar 20 16:56:35 2012 (r233232) +++ vendor/libcxxrt/dist/exception.cc Tue Mar 20 17:41:02 2012 (r233233) @@ -847,14 +847,11 @@ static bool check_type_signature(__cxa_e const std::type_info *type, void *&adjustedPtr) { - // TODO: For compatibility with the GNU implementation, we should move this - // out into a __do_catch() virtual function in std::type_info void *exception_ptr = (void*)(ex+1); - const std::type_info *ex_type = ex->exceptionType; + const std::type_info *ex_type = ex->exceptionType; - const __pointer_type_info *ptr_type = - dynamic_cast(ex_type); - if (0 != ptr_type) + bool is_ptr = ex_type->__is_pointer_p(); + if (is_ptr) { exception_ptr = *(void**)exception_ptr; } @@ -862,11 +859,6 @@ static bool check_type_signature(__cxa_e // // Note: A 0 here is a catchall, not a cleanup, so we return true to // indicate that we found a catch. - // - // TODO: Provide a class for matching against foreign exceptions. This is - // already done in libobjc2, allowing C++ exceptions to be boxed as - // Objective-C objects. We should do something similar, allowing foreign - // exceptions to be wrapped in a C++ exception and delivered. if (0 == type) { if (ex) @@ -878,28 +870,6 @@ static bool check_type_signature(__cxa_e if (0 == ex) { return false; } - const __pointer_type_info *target_ptr_type = - dynamic_cast(type); - - if (0 != ptr_type && 0 != target_ptr_type) - { - if (ptr_type->__flags & ~target_ptr_type->__flags) - { - // Handler pointer is less qualified - return false; - } - - // Special case for void* handler. - if(*target_ptr_type->__pointee == typeid(void)) - { - adjustedPtr = exception_ptr; - return true; - } - - ex_type = ptr_type->__pointee; - type = target_ptr_type->__pointee; - } - // If the types are the same, no casting is needed. if (*type == *ex_type) { @@ -907,18 +877,13 @@ static bool check_type_signature(__cxa_e return true; } - const __class_type_info *cls_type = - dynamic_cast(ex_type); - const __class_type_info *target_cls_type = - dynamic_cast(type); - - if (0 != cls_type && - 0 != target_cls_type && - cls_type->can_cast_to(target_cls_type)) + + if (type->__do_catch(ex_type, &exception_ptr, 1)) { - adjustedPtr = cls_type->cast_to(exception_ptr, target_cls_type); + adjustedPtr = exception_ptr; return true; } + return false; } /** Modified: vendor/libcxxrt/dist/typeinfo.h ============================================================================== --- vendor/libcxxrt/dist/typeinfo.h Tue Mar 20 16:56:35 2012 (r233232) +++ vendor/libcxxrt/dist/typeinfo.h Tue Mar 20 17:41:02 2012 (r233233) @@ -26,7 +26,86 @@ #include #include "abi_namespace.h" -#include "typeinfo" + +namespace ABI_NAMESPACE +{ + struct __class_type_info; +} +namespace std +{ + /** + * Standard type info class. The layout of this class is specified by the + * ABI. The layout of the vtable is not, but is intended to be + * compatible with the GNU ABI. + * + * Unlike the GNU version, the vtable layout is considered semi-private. + */ + class type_info + { + public: + /** + * Virtual destructor. This class must have one virtual function to + * ensure that it has a vtable. + */ + virtual ~type_info(); + bool operator==(const type_info &) const; + bool operator!=(const type_info &) const; + bool before(const type_info &) const; + const char* name() const; + type_info(); + private: + type_info(const type_info& rhs); + type_info& operator= (const type_info& rhs); + const char *__type_name; + /* + * The following functions are in this order to match the + * vtable layout of libsupc++. This allows libcxxrt to be used + * with libraries that depend on this. + * + * These functions are in the public headers for libstdc++, so + * we have to assume that someone will probably call them and + * expect them to work. Their names must also match the names used in + * libsupc++, so that code linking against this library can subclass + * type_info and correctly fill in the values in the vtables. + */ + public: + /** + * Catch function. Allows external libraries to implement + * their own basic types. This is used, for example, in the + * GNUstep Objective-C runtime to allow Objective-C types to be + * caught in G++ catch blocks. + * + * The outer parameter indicates the number of outer pointers + * in the high bits. The low bit indicates whether the + * pointers are const qualified. + */ + virtual bool __do_catch(const type_info *thrown_type, + void **thrown_object, + unsigned outer) const; + /** + * Performs an upcast. This is used in exception handling to + * cast from subclasses to superclasses. If the upcast is + * possible, it returns true and adjusts the pointer. If the + * upcast is not possible, it returns false and does not adjust + * the pointer. + */ + virtual bool __do_upcast( + const ABI_NAMESPACE::__class_type_info *target, + void **thrown_object) const + { + return false; + } + /** + * Returns true if this is some pointer type, false otherwise. + */ + virtual bool __is_pointer_p() const { return false; } + /** + * Returns true if this is some function type, false otherwise. + */ + virtual bool __is_function_p() const { return false; } + }; +} + namespace ABI_NAMESPACE { @@ -50,6 +129,7 @@ namespace ABI_NAMESPACE struct __function_type_info : public std::type_info { virtual ~__function_type_info(); + virtual bool __is_function_p() const { return true; } }; /** * Type info for enums. @@ -68,13 +148,12 @@ namespace ABI_NAMESPACE /** * Function implementing dynamic casts. */ - virtual void *cast_to(void *obj, - const struct __class_type_info *other) const; - /** - * Function returning whether a cast from this type to another type is - * possible. - */ - virtual bool can_cast_to(const struct __class_type_info *other) const; + virtual void *cast_to(void *obj, const struct __class_type_info *other) const; + virtual bool __do_upcast(const __class_type_info *target, + void **thrown_object) const + { + return this == target; + } }; /** @@ -85,8 +164,10 @@ namespace ABI_NAMESPACE { virtual ~__si_class_type_info(); const __class_type_info *__base_type; + virtual bool __do_upcast( + const ABI_NAMESPACE::__class_type_info *target, + void **thrown_object) const; virtual void *cast_to(void *obj, const struct __class_type_info *other) const; - virtual bool can_cast_to(const struct __class_type_info *other) const; }; /** @@ -166,8 +247,10 @@ namespace ABI_NAMESPACE /** The class is diamond shaped. */ __diamond_shaped_mask = 0x2 }; + virtual bool __do_upcast( + const ABI_NAMESPACE::__class_type_info *target, + void **thrown_object) const; virtual void *cast_to(void *obj, const struct __class_type_info *other) const; - virtual bool can_cast_to(const struct __class_type_info *other) const; }; /** @@ -201,6 +284,10 @@ namespace ABI_NAMESPACE /** Pointer is a pointer to a member of an incomplete class. */ __incomplete_class_mask = 0x10 }; + virtual bool __is_pointer_p() const { return true; } + virtual bool __do_catch(const type_info *thrown_type, + void **thrown_object, + unsigned outer) const; }; /** From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 17:43:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07651106566B; Tue, 20 Mar 2012 17:43:31 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCF9F8FC19; Tue, 20 Mar 2012 17:43:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KHhUGe030259; Tue, 20 Mar 2012 17:43:30 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KHhUQO030258; Tue, 20 Mar 2012 17:43:30 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201203201743.q2KHhUQO030258@svn.freebsd.org> From: David Chisnall Date: Tue, 20 Mar 2012 17:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233234 - vendor/libcxxrt/2012-03-20-cddcf8734ed06ada9384a461bc21d58b44f6eba1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 17:43:31 -0000 Author: theraven Date: Tue Mar 20 17:43:30 2012 New Revision: 233234 URL: http://svn.freebsd.org/changeset/base/233234 Log: Tag new version of libcxxrt in vendor branch. Approved by: dim (mentor) Added: vendor/libcxxrt/2012-03-20-cddcf8734ed06ada9384a461bc21d58b44f6eba1/ - copied from r233233, vendor/libcxxrt/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 17:58:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FCDB106566B; Tue, 20 Mar 2012 17:58:16 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 105008FC12; Tue, 20 Mar 2012 17:58:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KHwGpS030831; Tue, 20 Mar 2012 17:58:16 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KHwFKC030826; Tue, 20 Mar 2012 17:58:15 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201203201758.q2KHwFKC030826@svn.freebsd.org> From: David Chisnall Date: Tue, 20 Mar 2012 17:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233235 - in head: contrib/libcxxrt lib/libcxxrt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 17:58:16 -0000 Author: theraven Date: Tue Mar 20 17:58:15 2012 New Revision: 233235 URL: http://svn.freebsd.org/changeset/base/233235 Log: Import new version of libcxxrt. Now works correctly with libobjc2 to implement the unified exception model for Objective-C++. Approved by: dim (mentor) Deleted: head/contrib/libcxxrt/typeinfo Modified: head/contrib/libcxxrt/dynamic_cast.cc head/contrib/libcxxrt/exception.cc head/contrib/libcxxrt/typeinfo.h head/lib/libcxxrt/Version.map Directory Properties: head/contrib/libcxxrt/ (props changed) Modified: head/contrib/libcxxrt/dynamic_cast.cc ============================================================================== --- head/contrib/libcxxrt/dynamic_cast.cc Tue Mar 20 17:43:30 2012 (r233234) +++ head/contrib/libcxxrt/dynamic_cast.cc Tue Mar 20 17:58:15 2012 (r233235) @@ -46,9 +46,65 @@ struct vtable_header */ #define ADD_TO_PTR(x, off) (__typeof__(x))(((char*)x) + off) -bool __class_type_info::can_cast_to(const struct __class_type_info *other) const +bool std::type_info::__do_catch(std::type_info const *ex_type, + void **exception_object, + unsigned int outer) const { - return this == other; + const type_info *type = this; + + if (type == ex_type) + { + return true; + } + if (const __class_type_info *cti = dynamic_cast(type)) + { + return ex_type->__do_upcast(cti, exception_object); + } + return false; +} + +bool __pbase_type_info::__do_catch(std::type_info const *ex_type, + void **exception_object, + unsigned int outer) const +{ + if (ex_type == this) + { + return true; + } + if (!ex_type->__is_pointer_p()) + { + // Can't catch a non-pointer type in a pointer catch + return false; + } + + if (!(outer & 1)) + { + // If the low bit is cleared on this means that we've gone + // through a pointer that is not const qualified. + return false; + } + // Clear the low bit on outer if we're not const qualified. + if (!(__flags & __const_mask)) + { + outer &= ~1; + } + + const __pbase_type_info *ptr_type = + static_cast(ex_type); + + if (ptr_type->__flags & ~__flags) + { + // Handler pointer is less qualified + return false; + } + + // Special case for void* handler. + if(*__pointee == typeid(void)) + { + return true; + } + + return __pointee->__do_catch(ptr_type->__pointee, exception_object, outer); } void *__class_type_info::cast_to(void *obj, const struct __class_type_info *other) const @@ -60,12 +116,6 @@ void *__class_type_info::cast_to(void *o return 0; } - -bool __si_class_type_info::can_cast_to(const struct __class_type_info *other) const -{ - return this == other || __base_type->can_cast_to(other); -} - void *__si_class_type_info::cast_to(void *obj, const struct __class_type_info *other) const { if (this == other) @@ -74,31 +124,32 @@ void *__si_class_type_info::cast_to(void } return __base_type->cast_to(obj, other); } - - -bool __vmi_class_type_info::can_cast_to(const struct __class_type_info *other) const +bool __si_class_type_info::__do_upcast(const __class_type_info *target, + void **thrown_object) const { - if (this == other) + if (this == target) { return true; } - for (unsigned int i=0 ; i<__base_count ; i++) - { - const __base_class_type_info *info = &__base_info[i]; - if(info->isPublic() && info->__base_type->can_cast_to(other)) - { - return true; - } - } - return false; + return __base_type->__do_upcast(target, thrown_object); } void *__vmi_class_type_info::cast_to(void *obj, const struct __class_type_info *other) const { - if (this == other) + if (__do_upcast(other, &obj)) { return obj; } + return 0; +} + +bool __vmi_class_type_info::__do_upcast(const __class_type_info *target, + void **thrown_object) const +{ + if (this == target) + { + return true; + } for (unsigned int i=0 ; i<__base_count ; i++) { const __base_class_type_info *info = &__base_info[i]; @@ -111,6 +162,7 @@ void *__vmi_class_type_info::cast_to(voi // virtual table of the virtual base offset for the virtual base // referenced (negative).' + void *obj = *thrown_object; if (info->isVirtual()) { // Object's vtable @@ -121,18 +173,17 @@ void *__vmi_class_type_info::cast_to(voi } void *cast = ADD_TO_PTR(obj, offset); - if (info->__base_type == other) + if (info->__base_type == target || + (info->__base_type->__do_upcast(target, &cast))) { - return cast; - } - if ((cast = info->__base_type->cast_to(cast, other))) - { - return cast; + *thrown_object = cast; + return true; } } return 0; } + /** * ABI function used to implement the dynamic_cast<> operator. Some cases of * this operator are implemented entirely in the compiler (e.g. to void*). Modified: head/contrib/libcxxrt/exception.cc ============================================================================== --- head/contrib/libcxxrt/exception.cc Tue Mar 20 17:43:30 2012 (r233234) +++ head/contrib/libcxxrt/exception.cc Tue Mar 20 17:58:15 2012 (r233235) @@ -847,14 +847,11 @@ static bool check_type_signature(__cxa_e const std::type_info *type, void *&adjustedPtr) { - // TODO: For compatibility with the GNU implementation, we should move this - // out into a __do_catch() virtual function in std::type_info void *exception_ptr = (void*)(ex+1); - const std::type_info *ex_type = ex->exceptionType; + const std::type_info *ex_type = ex->exceptionType; - const __pointer_type_info *ptr_type = - dynamic_cast(ex_type); - if (0 != ptr_type) + bool is_ptr = ex_type->__is_pointer_p(); + if (is_ptr) { exception_ptr = *(void**)exception_ptr; } @@ -862,11 +859,6 @@ static bool check_type_signature(__cxa_e // // Note: A 0 here is a catchall, not a cleanup, so we return true to // indicate that we found a catch. - // - // TODO: Provide a class for matching against foreign exceptions. This is - // already done in libobjc2, allowing C++ exceptions to be boxed as - // Objective-C objects. We should do something similar, allowing foreign - // exceptions to be wrapped in a C++ exception and delivered. if (0 == type) { if (ex) @@ -878,28 +870,6 @@ static bool check_type_signature(__cxa_e if (0 == ex) { return false; } - const __pointer_type_info *target_ptr_type = - dynamic_cast(type); - - if (0 != ptr_type && 0 != target_ptr_type) - { - if (ptr_type->__flags & ~target_ptr_type->__flags) - { - // Handler pointer is less qualified - return false; - } - - // Special case for void* handler. - if(*target_ptr_type->__pointee == typeid(void)) - { - adjustedPtr = exception_ptr; - return true; - } - - ex_type = ptr_type->__pointee; - type = target_ptr_type->__pointee; - } - // If the types are the same, no casting is needed. if (*type == *ex_type) { @@ -907,18 +877,13 @@ static bool check_type_signature(__cxa_e return true; } - const __class_type_info *cls_type = - dynamic_cast(ex_type); - const __class_type_info *target_cls_type = - dynamic_cast(type); - - if (0 != cls_type && - 0 != target_cls_type && - cls_type->can_cast_to(target_cls_type)) + + if (type->__do_catch(ex_type, &exception_ptr, 1)) { - adjustedPtr = cls_type->cast_to(exception_ptr, target_cls_type); + adjustedPtr = exception_ptr; return true; } + return false; } /** Modified: head/contrib/libcxxrt/typeinfo.h ============================================================================== --- head/contrib/libcxxrt/typeinfo.h Tue Mar 20 17:43:30 2012 (r233234) +++ head/contrib/libcxxrt/typeinfo.h Tue Mar 20 17:58:15 2012 (r233235) @@ -26,7 +26,86 @@ #include #include "abi_namespace.h" -#include "typeinfo" + +namespace ABI_NAMESPACE +{ + struct __class_type_info; +} +namespace std +{ + /** + * Standard type info class. The layout of this class is specified by the + * ABI. The layout of the vtable is not, but is intended to be + * compatible with the GNU ABI. + * + * Unlike the GNU version, the vtable layout is considered semi-private. + */ + class type_info + { + public: + /** + * Virtual destructor. This class must have one virtual function to + * ensure that it has a vtable. + */ + virtual ~type_info(); + bool operator==(const type_info &) const; + bool operator!=(const type_info &) const; + bool before(const type_info &) const; + const char* name() const; + type_info(); + private: + type_info(const type_info& rhs); + type_info& operator= (const type_info& rhs); + const char *__type_name; + /* + * The following functions are in this order to match the + * vtable layout of libsupc++. This allows libcxxrt to be used + * with libraries that depend on this. + * + * These functions are in the public headers for libstdc++, so + * we have to assume that someone will probably call them and + * expect them to work. Their names must also match the names used in + * libsupc++, so that code linking against this library can subclass + * type_info and correctly fill in the values in the vtables. + */ + public: + /** + * Catch function. Allows external libraries to implement + * their own basic types. This is used, for example, in the + * GNUstep Objective-C runtime to allow Objective-C types to be + * caught in G++ catch blocks. + * + * The outer parameter indicates the number of outer pointers + * in the high bits. The low bit indicates whether the + * pointers are const qualified. + */ + virtual bool __do_catch(const type_info *thrown_type, + void **thrown_object, + unsigned outer) const; + /** + * Performs an upcast. This is used in exception handling to + * cast from subclasses to superclasses. If the upcast is + * possible, it returns true and adjusts the pointer. If the + * upcast is not possible, it returns false and does not adjust + * the pointer. + */ + virtual bool __do_upcast( + const ABI_NAMESPACE::__class_type_info *target, + void **thrown_object) const + { + return false; + } + /** + * Returns true if this is some pointer type, false otherwise. + */ + virtual bool __is_pointer_p() const { return false; } + /** + * Returns true if this is some function type, false otherwise. + */ + virtual bool __is_function_p() const { return false; } + }; +} + namespace ABI_NAMESPACE { @@ -50,6 +129,7 @@ namespace ABI_NAMESPACE struct __function_type_info : public std::type_info { virtual ~__function_type_info(); + virtual bool __is_function_p() const { return true; } }; /** * Type info for enums. @@ -68,13 +148,12 @@ namespace ABI_NAMESPACE /** * Function implementing dynamic casts. */ - virtual void *cast_to(void *obj, - const struct __class_type_info *other) const; - /** - * Function returning whether a cast from this type to another type is - * possible. - */ - virtual bool can_cast_to(const struct __class_type_info *other) const; + virtual void *cast_to(void *obj, const struct __class_type_info *other) const; + virtual bool __do_upcast(const __class_type_info *target, + void **thrown_object) const + { + return this == target; + } }; /** @@ -85,8 +164,10 @@ namespace ABI_NAMESPACE { virtual ~__si_class_type_info(); const __class_type_info *__base_type; + virtual bool __do_upcast( + const ABI_NAMESPACE::__class_type_info *target, + void **thrown_object) const; virtual void *cast_to(void *obj, const struct __class_type_info *other) const; - virtual bool can_cast_to(const struct __class_type_info *other) const; }; /** @@ -166,8 +247,10 @@ namespace ABI_NAMESPACE /** The class is diamond shaped. */ __diamond_shaped_mask = 0x2 }; + virtual bool __do_upcast( + const ABI_NAMESPACE::__class_type_info *target, + void **thrown_object) const; virtual void *cast_to(void *obj, const struct __class_type_info *other) const; - virtual bool can_cast_to(const struct __class_type_info *other) const; }; /** @@ -201,6 +284,10 @@ namespace ABI_NAMESPACE /** Pointer is a pointer to a member of an incomplete class. */ __incomplete_class_mask = 0x10 }; + virtual bool __is_pointer_p() const { return true; } + virtual bool __do_catch(const type_info *thrown_type, + void **thrown_object, + unsigned outer) const; }; /** Modified: head/lib/libcxxrt/Version.map ============================================================================== --- head/lib/libcxxrt/Version.map Tue Mar 20 17:43:30 2012 (r233234) +++ head/lib/libcxxrt/Version.map Tue Mar 20 17:58:15 2012 (r233235) @@ -301,6 +301,11 @@ CXXRT_1.0 { "typeinfo name for std::exception"; "typeinfo name for std::type_info"; + "std::type_info::__is_function_p() const"; + "std::type_info::__do_upcast(__cxxabiv1::__class_type_info const*, void**) const"; + "std::type_info::__is_pointer_p() const"; + + "operator delete[](void*)"; "operator delete(void*)"; "operator new[](unsigned long)"; From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 18:05:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 093641065673; Tue, 20 Mar 2012 18:05:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8B588FC21; Tue, 20 Mar 2012 18:05:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KI5FlP031109; Tue, 20 Mar 2012 18:05:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KI5FJm031107; Tue, 20 Mar 2012 18:05:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203201805.q2KI5FJm031107@svn.freebsd.org> From: John Baldwin Date: Tue, 20 Mar 2012 18:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233236 - head/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 18:05:16 -0000 Author: jhb Date: Tue Mar 20 18:05:15 2012 New Revision: 233236 URL: http://svn.freebsd.org/changeset/base/233236 Log: Add sys/ofed to the 'make cscope' target. MFC after: 1 week Modified: head/sys/Makefile Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Tue Mar 20 17:58:15 2012 (r233235) +++ head/sys/Makefile Tue Mar 20 18:05:15 2012 (r233236) @@ -11,7 +11,7 @@ SUBDIR= boot CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ geom gnu isa kern libkern modules net net80211 netatalk \ netgraph netinet netinet6 netipsec netipx netnatm netncp \ - netsmb nfs nfsclient nfsserver nlm opencrypto \ + netsmb nfs nfsclient nfsserver nlm ofed opencrypto \ pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} .if !defined(CSCOPE_ARCHDIR) .if defined(ALL_ARCH) From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 18:17:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0485106566B; Tue, 20 Mar 2012 18:17:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96B3C8FC08; Tue, 20 Mar 2012 18:17:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KIHY0F031584; Tue, 20 Mar 2012 18:17:34 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KIHYQS031570; Tue, 20 Mar 2012 18:17:34 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203201817.q2KIHYQS031570@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Mar 2012 18:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233237 - in vendor-sys/acpica/dist: . generate/unix/iasl source/common source/compiler source/components/debugger source/components/hardware source/components/namespace source/componen... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 18:17:34 -0000 Author: jkim Date: Tue Mar 20 18:17:33 2012 New Revision: 233237 URL: http://svn.freebsd.org/changeset/base/233237 Log: Import ACPICA 20120320. Added: vendor-sys/acpica/dist/source/compiler/preprocess.h (contents, props changed) vendor-sys/acpica/dist/source/compiler/prexpress.c (contents, props changed) vendor-sys/acpica/dist/source/compiler/prmacros.c (contents, props changed) vendor-sys/acpica/dist/source/compiler/prparser.l vendor-sys/acpica/dist/source/compiler/prparser.y vendor-sys/acpica/dist/source/compiler/prscan.c (contents, props changed) vendor-sys/acpica/dist/source/compiler/prutils.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/common/getopt.c vendor-sys/acpica/dist/source/compiler/Makefile vendor-sys/acpica/dist/source/compiler/aslcodegen.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslcompiler.y vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/asltypes.h vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/dtcompile.c vendor-sys/acpica/dist/source/compiler/dtcompiler.h vendor-sys/acpica/dist/source/compiler/dtexpress.c vendor-sys/acpica/dist/source/compiler/dtio.c vendor-sys/acpica/dist/source/compiler/dtparser.y vendor-sys/acpica/dist/source/compiler/readme.txt vendor-sys/acpica/dist/source/components/debugger/dbcmds.c vendor-sys/acpica/dist/source/components/hardware/hwesleep.c vendor-sys/acpica/dist/source/components/hardware/hwsleep.c vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c vendor-sys/acpica/dist/source/components/namespace/nsdump.c vendor-sys/acpica/dist/source/components/namespace/nsdumpdv.c vendor-sys/acpica/dist/source/components/namespace/nspredef.c vendor-sys/acpica/dist/source/components/namespace/nsrepair.c vendor-sys/acpica/dist/source/components/namespace/nsutils.c vendor-sys/acpica/dist/source/components/tables/tbfadt.c vendor-sys/acpica/dist/source/components/tables/tbinstal.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/include/achware.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acnames.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acoutput.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/tools/acpisrc/astable.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/changes.txt Tue Mar 20 18:17:33 2012 (r233237) @@ -1,4 +1,96 @@ ---------------------------------------- +20 March 2012. Summary of changes for version 20120320: + +This release is available at www.acpica.org/downloads. +The ACPI 5.0 specification is available at www.acpi.info. + +1) ACPICA Core Subsystem: + +Enhanced the sleep/wake interfaces to optionally execute the _GTS method +(Going To Sleep) and the _BFS method (Back From Sleep). Windows apparently +does not execute these methods, and therefore these methods are often +untested. It has been seen on some systems where the execution of these +methods causes errors and also prevents the machine from entering S5. It is +therefore suggested that host operating systems do not execute these methods +by default. In the future, perhaps these methods can be optionally executed +based on the age of the system and/or what is the newest version of Windows +that the BIOS asks for via _OSI. Changed interfaces: AcpiEnterSleepState and +AcpileaveSleepStatePrep. See the ACPICA reference and Linux BZ 13041. Lin +Ming. + +Fixed a problem where the length of the local/common FADT was set too early. +The local FADT table length cannot be set to the common length until the +original length has been examined. There is code that checks the table length +and sets various fields appropriately. This can affect older machines with +early FADT versions. For example, this can cause inadvertent writes to the +CST_CNT register. Julian Anastasov. + +Fixed a mapping issue related to a physical table override. Use the deferred +mapping mechanism for tables loaded via the physical override OSL interface. +This allows for early mapping before the virtual memory manager is available. +Thomas Renninger, Bob Moore. + +Enhanced the automatic return-object repair code: Repair a common problem with +predefined methods that are defined to return a variable-length Package of +sub-objects. If there is only one sub-object, some BIOS ASL code mistakenly +simply returns the single object instead of a Package with one sub-object. +This new support will repair this error by wrapping a Package object around +the original object, creating the correct and expected Package with one sub- +object. Names that can be repaired in this manner include: _ALR, _CSD, _HPX, +_MLS, _PLD, _PRT, _PSS, _TRT, _TSS, _BCL, _DOD, _FIX, and _Sx. ACPICA BZ 939. + +Changed the exception code returned for invalid ACPI paths passed as +parameters to external interfaces such as AcpiEvaluateObject. Was +AE_BAD_PARAMETER, now is the more sensible AE_BAD_PATHNAME. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug +version of the code includes the debug output trace mechanism and has a much +larger code and data size. + + Previous Release: + Non-Debug Version: 93.0K Code, 25.0K Data, 118.0K Total + Debug Version: 172.5K Code, 73.2K Data, 245.7K Total + Current Release: + Non-Debug Version: 92.9K Code, 25.0K Data, 117.9K Total + Debug Version: 172.5K Code, 73.2K Data, 245.7K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Added the infrastructure and initial implementation of a integrated C- +like preprocessor. This will simplify BIOS development process by eliminating +the need for a separate preprocessing step during builds. On Windows, it also +eliminates the need to install a separate C compiler. ACPICA BZ 761. Some +features including full #define() macro support are still under development. +These preprocessor directives are supported: + #define + #elif + #else + #endif + #error + #if + #ifdef + #ifndef + #include + #pragma message + #undef + #warning +In addition, these new command line options are supported: + -D Define symbol for preprocessor use + -li Create preprocessed output file (*.i) + -P Preprocess only and create preprocessor output file (*.i) + +Table Compiler: Fixed a problem where the equals operator within an expression +did not work properly. + +Updated iASL to use the current versions of Bison/Flex. Updated the Windows +project file to invoke these tools from the standard location. ACPICA BZ 904. +Versions supported: + Flex for Windows: V2.5.4 + Bison for Windows: V2.4.1 + +---------------------------------------- 15 February 2012. Summary of changes for version 20120215: This release is available at www.acpica.org/downloads. Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Tue Mar 20 18:17:33 2012 (r233237) @@ -32,13 +32,16 @@ vpath %.c \ HEADERS = \ $(wildcard $(ASL_COMPILER)/*.h) \ $(OBJDIR)/aslcompiler.y.h \ - $(OBJDIR)/dtparser.y.h + $(OBJDIR)/dtparser.y.h \ + $(OBJDIR)/prparser.y.h OBJECTS = \ $(OBJDIR)/aslcompilerlex.o \ $(OBJDIR)/aslcompilerparse.o \ $(OBJDIR)/dtparserlex.o \ $(OBJDIR)/dtparserparse.o \ + $(OBJDIR)/prparserlex.o \ + $(OBJDIR)/prparserparse.o \ $(OBJDIR)/adfile.o \ $(OBJDIR)/adisasm.o \ $(OBJDIR)/adwalk.o \ @@ -142,6 +145,10 @@ OBJECTS = \ $(OBJDIR)/nswalk.o \ $(OBJDIR)/nsxfobj.o \ $(OBJDIR)/osunixxf.o \ + $(OBJDIR)/prexpress.o \ + $(OBJDIR)/prmacros.o \ + $(OBJDIR)/prscan.o \ + $(OBJDIR)/prutils.o \ $(OBJDIR)/psargs.o \ $(OBJDIR)/psloop.o \ $(OBJDIR)/psopcode.o \ @@ -177,7 +184,9 @@ INTERMEDIATES = \ $(OBJDIR)/aslcompilerlex.c \ $(OBJDIR)/aslcompilerparse.c \ $(OBJDIR)/dtparserlex.c \ - $(OBJDIR)/dtparserparse.c + $(OBJDIR)/dtparserparse.c \ + $(OBJDIR)/prparserlex.c \ + $(OBJDIR)/prparserparse.c MISC = \ $(OBJDIR)/aslcompilerparse.h \ @@ -185,7 +194,10 @@ MISC = \ $(OBJDIR)/aslcompilerparse.output \ $(OBJDIR)/dtparserparse.h \ $(OBJDIR)/dtparser.y.h \ - $(OBJDIR)/dtparserparse.output + $(OBJDIR)/dtparserparse.output \ + $(OBJDIR)/prparserparse.h \ + $(OBJDIR)/prparser.y.h \ + $(OBJDIR)/prparserparse.output # # Flags specific to iASL compiler @@ -217,15 +229,26 @@ $(OBJDIR)/dtparserlex.c : $(ASL_COM $(OBJDIR)/dtparserparse.c $(OBJDIR)/dtparserparse.h : $(ASL_COMPILER)/dtparser.y ${YACC} ${YFLAGS} -pDtParser -o$@ $? +$(OBJDIR)/prparserlex.c : $(ASL_COMPILER)/prparser.l + ${LEX} ${LFLAGS} -PPrParser -o$@ $? + +$(OBJDIR)/prparserparse.c $(OBJDIR)/prparserparse.h : $(ASL_COMPILER)/prparser.y + ${YACC} ${YFLAGS} -pPrParser -o$@ $? + + # Rename headers produced by bison/yacc +$(OBJDIR)/aslcompiler.y.h : $(OBJDIR)/aslcompilerparse.h + @echo Copy intermediate file: + @cp -f -v $(OBJDIR)/aslcompilerparse.h $(OBJDIR)/aslcompiler.y.h + $(OBJDIR)/dtparser.y.h: $(OBJDIR)/dtparserparse.h @echo Copy intermediate file: @cp -f -v $(OBJDIR)/dtparserparse.h $(OBJDIR)/dtparser.y.h -$(OBJDIR)/aslcompiler.y.h : $(OBJDIR)/aslcompilerparse.h +$(OBJDIR)/prparser.y.h: $(OBJDIR)/prparserparse.h @echo Copy intermediate file: - @cp -f -v $(OBJDIR)/aslcompilerparse.h $(OBJDIR)/aslcompiler.y.h + @cp -f -v $(OBJDIR)/prparserparse.h $(OBJDIR)/prparser.y.h # @@ -246,6 +269,12 @@ $(OBJDIR)/dtparserlex.o : $(OBJDIR) $(OBJDIR)/dtparserparse.o : $(OBJDIR)/dtparserparse.c $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $? +$(OBJDIR)/prparserlex.o : $(OBJDIR)/prparserlex.c + $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $? + +$(OBJDIR)/prparserparse.o : $(OBJDIR)/prparserparse.c + $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $? + $(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS) $(COMPILE) Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/source/common/adisasm.c Tue Mar 20 18:17:33 2012 (r233237) @@ -75,6 +75,10 @@ LsSetupNsList ( /* Local prototypes */ +static UINT32 +AdGetFileSize ( + FILE *File); + static void AdCreateTableHeader ( char *Filename, @@ -160,6 +164,38 @@ static ACPI_PARSE_OBJECT *AcpiGbl_Par /******************************************************************************* * + * FUNCTION: AdGetFileSize + * + * PARAMETERS: File - Open file handle + * + * RETURN: File Size + * + * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open. + * + ******************************************************************************/ + +static UINT32 +AdGetFileSize ( + FILE *File) +{ + UINT32 FileSize; + long Offset; + + + Offset = ftell (File); + + fseek (File, 0, SEEK_END); + FileSize = (UINT32) ftell (File); + + /* Restore file pointer */ + + fseek (File, Offset, SEEK_SET); + return (FileSize); +} + + +/******************************************************************************* + * * FUNCTION: AdInitialize * * PARAMETERS: None @@ -380,8 +416,10 @@ AdAmlDisassemble ( "FieldName : FieldValue\n */\n\n"); AcpiDmDumpDataTable (Table); - fprintf (stderr, "Acpi Data Table [%4.4s] decoded, written to \"%s\"\n", - Table->Signature, DisasmFilename); + fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n", + Table->Signature); + fprintf (stderr, "Formatted output: %s - %u bytes\n", + DisasmFilename, AdGetFileSize (File)); } else { @@ -490,9 +528,9 @@ AdAmlDisassemble ( if (AcpiGbl_DbOpt_disasm) { AdDisplayTables (Filename, Table); - fprintf (stderr, - "Disassembly completed, written to \"%s\"\n", - DisasmFilename); + fprintf (stderr, "Disassembly completed\n"); + fprintf (stderr, "ASL Output: %s - %u bytes\n", + DisasmFilename, AdGetFileSize (File)); } } Modified: vendor-sys/acpica/dist/source/common/getopt.c ============================================================================== --- vendor-sys/acpica/dist/source/common/getopt.c Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/source/common/getopt.c Tue Mar 20 18:17:33 2012 (r233237) @@ -49,7 +49,8 @@ #include "accommon.h" #include "acapps.h" -#define ERR(szz,czz) if(AcpiGbl_Opterr){fprintf(stderr,"%s%s%c\n",argv[0],szz,czz);} +#define ACPI_OPTION_ERROR(msg, badchar) \ + if (AcpiGbl_Opterr) {fprintf (stderr, "%s%c\n", msg, badchar);} int AcpiGbl_Opterr = 1; @@ -87,12 +88,12 @@ AcpiGetopt( argv[AcpiGbl_Optind][0] != '-' || argv[AcpiGbl_Optind][1] == '\0') { - return(EOF); + return (EOF); } else if (strcmp (argv[AcpiGbl_Optind], "--") == 0) { AcpiGbl_Optind++; - return(EOF); + return (EOF); } } @@ -105,7 +106,7 @@ AcpiGetopt( if (CurrentChar == ':' || (OptsPtr = strchr (opts, CurrentChar)) == NULL) { - ERR (": illegal option -- ", CurrentChar); + ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar); if (argv[AcpiGbl_Optind][++CurrentCharPtr] == '\0') { @@ -126,7 +127,7 @@ AcpiGetopt( } else if (++AcpiGbl_Optind >= argc) { - ERR (": option requires an argument -- ", CurrentChar); + ACPI_OPTION_ERROR ("Option requires an argument: -", CurrentChar); CurrentCharPtr = 1; return ('?'); @@ -156,6 +157,26 @@ AcpiGetopt( CurrentCharPtr = 1; } + /* Option has a required single-char argument? */ + + else if (*OptsPtr == '|') + { + if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') + { + AcpiGbl_Optarg = &argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)]; + } + else + { + ACPI_OPTION_ERROR ("Option requires a single-character suboption: -", CurrentChar); + + CurrentCharPtr = 1; + return ('?'); + } + + AcpiGbl_Optind++; + CurrentCharPtr = 1; + } + /* Option with no arguments */ else Modified: vendor-sys/acpica/dist/source/compiler/Makefile ============================================================================== --- vendor-sys/acpica/dist/source/compiler/Makefile Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/source/compiler/Makefile Tue Mar 20 18:17:33 2012 (r233237) @@ -64,13 +64,16 @@ vpath %.c \ HEADERS = \ $(wildcard $(ASL_COMPILER)/*.h) \ aslcompiler.y.h \ - dtparser.y.h + dtparser.y.h \ + prparser.y.h OBJECTS = \ aslcompilerlex.o \ aslcompilerparse.o \ dtparserlex.o \ dtparserparse.o \ + prparserlex.o \ + prparserparse.o \ adfile.o \ adisasm.o \ adwalk.o \ @@ -174,6 +177,10 @@ OBJECTS = \ nswalk.o \ nsxfobj.o \ osunixxf.o \ + prexpress.o \ + prmacros.o \ + prscan.o \ + prutils.o \ psargs.o \ psloop.o \ psopcode.o \ @@ -209,7 +216,9 @@ INTERMEDIATES = \ aslcompilerlex.c \ aslcompilerparse.c \ dtparserlex.c \ - dtparserparse.c + dtparserparse.c \ + prparserlex.c \ + prparserparse.c MISC = \ aslcompilerparse.h \ @@ -217,7 +226,10 @@ MISC = \ aslcompilerparse.output \ dtparserparse.h \ dtparser.y.h \ - dtparserparse.output + dtparserparse.output \ + prparserparse.h \ + prparser.y.h \ + prparserparse.output CFLAGS+= \ -D$(HOST) \ @@ -289,15 +301,26 @@ dtparserlex.c : $(ASL_COMPILER)/dtp dtparserparse.c dtparserparse.h : $(ASL_COMPILER)/dtparser.y ${YACC} ${YFLAGS} -pDtParser -o$@ $? +prparserlex.c : $(ASL_COMPILER)/prparser.l + ${LEX} ${LFLAGS} -PPrParser -o$@ $? + +prparserparse.c prparserparse.h : $(ASL_COMPILER)/prparser.y + ${YACC} ${YFLAGS} -pPrParser -o$@ $? + + # Rename headers produced by bison/yacc +aslcompiler.y.h : aslcompilerparse.h + @echo Copy intermediate file: + @cp -f -v aslcompilerparse.h aslcompiler.y.h + dtparser.y.h: dtparserparse.h @echo Copy intermediate file: @cp -f -v dtparserparse.h dtparser.y.h -aslcompiler.y.h : aslcompilerparse.h +prparser.y.h: prparserparse.h @echo Copy intermediate file: - @cp -f -v aslcompilerparse.h aslcompiler.y.h + @cp -f -v prparserparse.h prparser.y.h # @@ -318,6 +341,12 @@ dtparserlex.o : dtparserlex.c dtparserparse.o : dtparserparse.c $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $? +prparserlex.o : prparserlex.c + $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $? + +prparserparse.o : prparserparse.c + $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $? + %.o : %.c $(HEADERS) $(ACPICA_HEADERS) $(COMPILE) Modified: vendor-sys/acpica/dist/source/compiler/aslcodegen.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcodegen.c Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/source/compiler/aslcodegen.c Tue Mar 20 18:17:33 2012 (r233237) @@ -264,7 +264,7 @@ CgWriteAmlOpcode ( /* These opcodes should not get here */ printf ("Found a node with an unassigned AML opcode\n"); - fprintf (stderr, "Found a node with an unassigned AML opcode\n"); + FlPrintFile (ASL_FILE_STDERR, "Found a node with an unassigned AML opcode\n"); return; case AML_INT_RESERVEDFIELD_OP: Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Tue Mar 20 18:17:33 2012 (r233237) @@ -457,6 +457,17 @@ CmDoCompile ( Event = UtBeginEvent ("Open input and output files"); UtEndEvent (Event); + /* Preprocessor */ + + Event = UtBeginEvent ("Preprocess input file"); + PrDoPreprocess (); + UtEndEvent (Event); + if (Gbl_PreprocessOnly) + { + CmCleanupAndExit (); + return 0; + } + /* Build the parse tree */ Event = UtBeginEvent ("Parse source code and build parse tree"); @@ -474,8 +485,7 @@ CmDoCompile ( { AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL, "- Could not resolve parse tree root node"); - CmCleanupAndExit (); - return -1; + goto ErrorExit; } /* Optional parse tree dump, compiler debug output only */ @@ -508,12 +518,12 @@ CmDoCompile ( */ Event = UtBeginEvent ("Open AML output file"); Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix); + UtEndEvent (Event); if (ACPI_FAILURE (Status)) { AePrintErrorLog (ASL_FILE_STDERR); return -1; } - UtEndEvent (Event); /* Interpret and generate all compile-time constants */ @@ -552,6 +562,7 @@ CmDoCompile ( AePrintErrorLog (ASL_FILE_STDERR); UtDisplaySummary (ASL_FILE_STDERR); } + UtEndEvent (FullCompile); return 0; } @@ -566,7 +577,7 @@ CmDoCompile ( UtEndEvent (Event); if (ACPI_FAILURE (Status)) { - return -1; + goto ErrorExit; } /* Namespace cross-reference */ @@ -575,7 +586,7 @@ CmDoCompile ( Status = LkCrossReferenceNamespace (); if (ACPI_FAILURE (Status)) { - return -1; + goto ErrorExit; } /* Namespace - Check for non-referenced objects */ @@ -646,6 +657,11 @@ CmDoCompile ( UtEndEvent (FullCompile); CmCleanupAndExit (); return 0; + +ErrorExit: + UtEndEvent (FullCompile); + CmCleanupAndExit (); + return (-1); } @@ -799,7 +815,9 @@ CmCleanupAndExit ( /* Close all open files */ - for (i = 2; i < ASL_MAX_FILE_TYPE; i++) + Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ + + for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) { FlCloseFile (i); } @@ -817,6 +835,18 @@ CmCleanupAndExit ( } } + /* Delete the preprocessor output file (.i) unless -li flag is set */ + + if (!Gbl_PreprocessorOutputFlag && Gbl_Files[ASL_FILE_PREPROCESSOR].Filename) + { + if (remove (Gbl_Files[ASL_FILE_PREPROCESSOR].Filename)) + { + printf ("%s: ", + Gbl_Files[ASL_FILE_PREPROCESSOR].Filename); + perror ("Could not delete preprocessor .i file"); + } + } + /* * Delete intermediate ("combined") source file (if -ls flag not set) * This file is created during normal ASL/AML compiles. It is not Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Tue Mar 20 18:17:33 2012 (r233237) @@ -75,6 +75,7 @@ #include "asltypes.h" #include "aslmessages.h" #include "aslglobal.h" +#include "preprocess.h" /******************************************************************************* @@ -84,7 +85,7 @@ ******************************************************************************/ /* - * parser - generated from flex/bison, lex/yacc, etc. + * Main ASL parser - generated from flex/bison, lex/yacc, etc. */ int AslCompilerparse( @@ -303,6 +304,16 @@ AslCommonError ( char *ExtraMessage); void +AslCommonError2 ( + UINT8 Level, + UINT8 MessageId, + UINT32 LineNumber, + UINT32 Column, + char *SourceLine, + char *Filename, + char *ExtraMessage); + +void AePrintException ( UINT32 FileId, ASL_ERROR_MSG *Enode, Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.y Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.y Tue Mar 20 18:17:33 2012 (r233237) @@ -78,6 +78,11 @@ void * AslLocalAllo #define YYDEBUG 1 /* Enable debug output */ #define YYERROR_VERBOSE 1 /* Verbose error messages */ +/* Define YYMALLOC/YYFREE to prevent redefinition errors */ + +#define YYMALLOC malloc +#define YYFREE free + /* * The windows version of bison defines this incorrectly as "32768" (Not negative). * We use a custom (edited binary) version of bison that defines YYFLAG as YYFBAD Modified: vendor-sys/acpica/dist/source/compiler/aslerror.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslerror.c Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/source/compiler/aslerror.c Tue Mar 20 18:17:33 2012 (r233237) @@ -55,6 +55,18 @@ AeAddToErrorLog ( ASL_ERROR_MSG *Enode); +/******************************************************************************* + * + * FUNCTION: AeClearErrorLog + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Empty the error list + * + ******************************************************************************/ + void AeClearErrorLog ( void) @@ -168,7 +180,7 @@ AePrintException ( UINT32 SourceColumn; UINT32 ErrorColumn; FILE *OutputFile; - FILE *SourceFile; + FILE *SourceFile = NULL; long FileSize; BOOLEAN PrematureEOF = FALSE; @@ -211,24 +223,28 @@ AePrintException ( OutputFile = Gbl_Files[FileId].Handle; - /* Use the merged header/source file if present, otherwise use input file */ - SourceFile = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle; - if (!SourceFile) + if (!Enode->SourceLine) { - SourceFile = Gbl_Files[ASL_FILE_INPUT].Handle; - } + /* Use the merged header/source file if present, otherwise use input file */ - if (SourceFile) - { - /* Determine if the error occurred at source file EOF */ - - fseek (SourceFile, 0, SEEK_END); - FileSize = ftell (SourceFile); + SourceFile = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle; + if (!SourceFile) + { + SourceFile = Gbl_Files[ASL_FILE_INPUT].Handle; + } - if ((long) Enode->LogicalByteOffset >= FileSize) + if (SourceFile) { - PrematureEOF = TRUE; + /* Determine if the error occurred at source file EOF */ + + fseek (SourceFile, 0, SEEK_END); + FileSize = ftell (SourceFile); + + if ((long) Enode->LogicalByteOffset >= FileSize) + { + PrematureEOF = TRUE; + } } } @@ -247,46 +263,59 @@ AePrintException ( if (Enode->LineNumber) { - fprintf (OutputFile, " %6u: ", Enode->LineNumber); - - /* - * If not at EOF, get the corresponding source code line and - * display it. Don't attempt this if we have a premature EOF - * condition. - */ - if (!PrematureEOF) + if (Enode->SourceLine) + { + fprintf (OutputFile, " %6u: %s", + Enode->LineNumber, Enode->SourceLine); + } + else { + if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_ASL) + fprintf (OutputFile, " %6u: ", + PrGetLineNumber (Enode->LineNumber)); + else + fprintf (OutputFile, " %6u: ", + Enode->LineNumber); + /* - * Seek to the offset in the combined source file, read - * the source line, and write it to the output. + * If not at EOF, get the corresponding source code line and + * display it. Don't attempt this if we have a premature EOF + * condition. */ - Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset, - (int) SEEK_SET); - if (Actual) + if (!PrematureEOF) { - fprintf (OutputFile, - "[*** iASL: Seek error on source code temp file %s ***]", - Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); - } - else - { - RActual = fread (&SourceByte, 1, 1, SourceFile); - if (!RActual) + /* + * Seek to the offset in the combined source file, read + * the source line, and write it to the output. + */ + Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset, + (int) SEEK_SET); + if (Actual) { fprintf (OutputFile, - "[*** iASL: Read error on source code temp file %s ***]", + "[*** iASL: Seek error on source code temp file %s ***]", Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); } - - else while (RActual && SourceByte && (SourceByte != '\n')) + else { - fwrite (&SourceByte, 1, 1, OutputFile); RActual = fread (&SourceByte, 1, 1, SourceFile); + if (!RActual) + { + fprintf (OutputFile, + "[*** iASL: Read error on source code temp file %s ***]", + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); + } + + else while (RActual && SourceByte && (SourceByte != '\n')) + { + fwrite (&SourceByte, 1, 1, OutputFile); + RActual = fread (&SourceByte, 1, 1, SourceFile); + } } } - } - fprintf (OutputFile, "\n"); + fprintf (OutputFile, "\n"); + } } } else @@ -295,7 +324,16 @@ AePrintException ( if (Enode->LineNumber) { - fprintf (OutputFile, "(%u) : ", Enode->LineNumber); + if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_ASL) + { + fprintf (OutputFile, "(%u) i:%6u : ", + PrGetLineNumber (Enode->LineNumber), Enode->LineNumber); + } + else + { + fprintf (OutputFile, "(%u) i:%6u : ", + Enode->LineNumber, Enode->LineNumber); + } } } } @@ -421,6 +459,91 @@ AePrintErrorLog ( /******************************************************************************* * + * FUNCTION: AslCommonError2 + * + * PARAMETERS: Level - Seriousness (Warning/error, etc.) + * MessageId - Index into global message buffer + * LineNumber - Actual file line number + * Column - Column in current line + * SourceLine - Actual source code line + * Filename - source filename + * ExtraMessage - additional error message + * + * RETURN: None + * + * DESCRIPTION: Create a new error node and add it to the error log + * + ******************************************************************************/ + +void +AslCommonError2 ( + UINT8 Level, + UINT8 MessageId, + UINT32 LineNumber, + UINT32 Column, + char *SourceLine, + char *Filename, + char *ExtraMessage) +{ + char *MessageBuffer = NULL; + char *LineBuffer; + ASL_ERROR_MSG *Enode; + + + Enode = UtLocalCalloc (sizeof (ASL_ERROR_MSG)); + + if (ExtraMessage) + { + /* Allocate a buffer for the message and a new error node */ + + MessageBuffer = UtLocalCalloc (strlen (ExtraMessage) + 1); + + /* Keep a copy of the extra message */ + + ACPI_STRCPY (MessageBuffer, ExtraMessage); + } + + LineBuffer = UtLocalCalloc (strlen (SourceLine) + 1); + ACPI_STRCPY (LineBuffer, SourceLine); + + /* Initialize the error node */ + + if (Filename) + { + Enode->Filename = Filename; + Enode->FilenameLength = strlen (Filename); + if (Enode->FilenameLength < 6) + { + Enode->FilenameLength = 6; + } + } + + Enode->MessageId = MessageId; + Enode->Level = Level; + Enode->LineNumber = LineNumber; + Enode->LogicalLineNumber = LineNumber; + Enode->LogicalByteOffset = 0; + Enode->Column = Column; + Enode->Message = MessageBuffer; + Enode->SourceLine = LineBuffer; + + /* Add the new node to the error node list */ + + AeAddToErrorLog (Enode); + + if (Gbl_DebugFlag) + { + /* stderr is a file, send error to it immediately */ + + AePrintException (ASL_FILE_STDERR, Enode, NULL); + } + + Gbl_ExceptionCount[Level]++; +} + + +/******************************************************************************* + * * FUNCTION: AslCommonError * * PARAMETERS: Level - Seriousness (Warning/error, etc.) @@ -487,6 +610,7 @@ AslCommonError ( Enode->LogicalByteOffset = LogicalByteOffset; Enode->Column = Column; Enode->Message = MessageBuffer; + Enode->SourceLine = NULL; /* Add the new node to the error node list */ @@ -553,7 +677,6 @@ AslError ( break; } - if (Op) { AslCommonError (Level, MessageId, Op->Asl.LineNumber, @@ -643,5 +766,3 @@ AslCompilererror ( return 0; } - - Modified: vendor-sys/acpica/dist/source/compiler/aslfiles.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfiles.c Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/source/compiler/aslfiles.c Tue Mar 20 18:17:33 2012 (r233237) @@ -50,7 +50,7 @@ /* Local prototypes */ -static FILE * +FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, char *Filename); @@ -363,14 +363,13 @@ FlCloseFile ( } Error = fclose (Gbl_Files[FileId].Handle); - Gbl_Files[FileId].Handle = NULL; - if (Error) { FlFileError (FileId, ASL_MSG_CLOSE); AslAbort (); } + Gbl_Files[FileId].Handle = NULL; return; } @@ -478,7 +477,7 @@ FlAddIncludeDirectory ( * ******************************************************************************/ -static FILE * +FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, char *Filename) @@ -740,6 +739,13 @@ FlOpenMiscOutputFiles ( Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = freopen (Filename, "w+t", stderr); + if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle) + { + AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME, + 0, 0, 0, 0, NULL, NULL); + return (AE_ERROR); + } + AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT); } @@ -764,12 +770,26 @@ FlOpenMiscOutputFiles ( AslCompilerFileHeader (ASL_FILE_LISTING_OUTPUT); } + /* Create the preprocessor output file */ + + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_PREPROCESSOR); + if (!Filename) + { + AslCommonError (ASL_ERROR, ASL_MSG_PREPROCESSOR_FILENAME, + 0, 0, 0, 0, NULL, NULL); + return (AE_ERROR); + } + + FlOpenFile (ASL_FILE_PREPROCESSOR, Filename, "w+b"); + + /* All done for data table compiler */ + if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) { return (AE_OK); } - /* Create/Open a combined source output file */ + /* Create/Open a combined source output file */ Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE); if (!Filename) @@ -786,6 +806,10 @@ FlOpenMiscOutputFiles ( */ FlOpenFile (ASL_FILE_SOURCE_OUTPUT, Filename, "w+b"); +/* +// TBD: TEMP +// AslCompilerin = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle; +*/ /* Create/Open a assembly code source output file if asked */ if (Gbl_AsmOutputFlag) Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslglobal.h Tue Mar 20 18:05:15 2012 (r233236) +++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Tue Mar 20 18:17:33 2012 (r233237) @@ -70,10 +70,11 @@ extern int yyde extern FILE *AslCompilerin; extern int AslCompilerdebug; extern int DtParserdebug; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 18:18:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 681401065675; Tue, 20 Mar 2012 18:18:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A8A88FC08; Tue, 20 Mar 2012 18:18:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KIIDM4031644; Tue, 20 Mar 2012 18:18:13 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KIIDMp031643; Tue, 20 Mar 2012 18:18:13 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203201818.q2KIIDMp031643@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Mar 2012 18:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233238 - vendor-sys/acpica/20120320 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 18:18:13 -0000 Author: jkim Date: Tue Mar 20 18:18:12 2012 New Revision: 233238 URL: http://svn.freebsd.org/changeset/base/233238 Log: Tag ACPICA 20120320. Added: vendor-sys/acpica/20120320/ - copied from r233237, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 18:27:05 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EB21106566C; Tue, 20 Mar 2012 18:27:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id AF2848FC08; Tue, 20 Mar 2012 18:27:04 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q2KIR3g7027608; Tue, 20 Mar 2012 22:27:03 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q2KIR3jp027607; Tue, 20 Mar 2012 22:27:03 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 20 Mar 2012 22:27:03 +0400 From: Gleb Smirnoff To: Davide Italiano Message-ID: <20120320182703.GJ30704@FreeBSD.org> References: <201203162032.q2GKWBRV033715@svn.freebsd.org> <20120319194431.GD30704@FreeBSD.org> <20120320143611.GH30704@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, George Neville-Neil , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r233045 - in head/sys: conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 18:27:05 -0000 On Tue, Mar 20, 2012 at 06:00:50PM +0100, Davide Italiano wrote: D> 2012/3/20 Gleb Smirnoff : D> > On Mon, Mar 19, 2012 at 09:06:36PM +0100, Davide Italiano wrote: D> > D> >> These indented ifdefs look like a major violation of style used throughout D> > D> >> the FreeBSD kernel code. Can you please keep with common style? D> > D> >> D> > D> > D> > D> > Heh, D> > D> > sorry, also Juli Mallet noticed this, I'm writing a fix for this and D> > D> > after I'll have approval from my mentor I'll commit. D> > D> > Looks okay, apart from additional empty line in NOTES. Isn't single D> > empty line enough? D> > D> > -- D> > Totus tuus, Glebius. D> D> Well, I removed that in my previous commit. D> It was a mistake. D> But if you think it's ok to remove that line, I have no objections on this. Well, I'm not that style(9)-evident person :) I just personally dislike multiple empty lines, since less code fits on a terminal. So I won't insist on any choice here. I just noticed incorrect indentation of ifdefs, and that's all. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:03:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C182D1065670; Tue, 20 Mar 2012 19:03:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4AFAA8FC0A; Tue, 20 Mar 2012 19:03:57 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id D589346B2D; Tue, 20 Mar 2012 15:03:56 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 646F8B91C; Tue, 20 Mar 2012 15:03:56 -0400 (EDT) From: John Baldwin To: Doug Barton Date: Tue, 20 Mar 2012 10:19:40 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <4F678B03.8050307@FreeBSD.org> <4F67A7A9.50003@FreeBSD.org> In-Reply-To: <4F67A7A9.50003@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203201019.40486.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Mar 2012 15:03:56 -0400 (EDT) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Dimitry Andric , Bruce Evans , svn-src-head@freebsd.org, Chris Rees Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:03:57 -0000 On Monday, March 19, 2012 5:39:53 pm Doug Barton wrote: > On 3/19/2012 12:37 PM, Dimitry Andric wrote: > > It would be much nicer to be able to write: > > > > .if defined(FOO) > > .if defined(BAR) > > CFLAGS+= -DFOO_BAR > > .endif > > .endif > > Take a look at /usr/ports/Mk/bsd.port.mk for how this can be done. Hmm, do yoo have a specific example? The bits in I see in bsd.port.mk suffer from the limitation Dimitry raises, e.g.: .if defined(OPTIONS) # include OPTIONSFILE first if exists . if exists(${OPTIONSFILE}) && !make(rmconfig) . include "${OPTIONSFILE}" . endif . if exists(${OPTIONSFILE}.local) . include "${OPTIONSFILE}.local" . endif WITHOUT:= WITH:= . if defined(OPTIONS) REALOPTIONS=${OPTIONS:C/".*"//g} . for O in ${REALOPTIONS} RO:=${O} . if ${RO:L} == off WITHOUT:= ${WITHOUT} ${OPT} . endif . if ${RO:L} == on WITH:= ${WITH} ${OPT} . endif OPT:=${RO} . endfor . endif That is, all the lines that don't start with a . are not indented, and even this indentation is rather horrible (it doesn't nest, and it has the odd structure of 'if defined(OPTIONS) { if defined(OPTIONS) {} }'. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:04:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E885B1065677; Tue, 20 Mar 2012 19:03:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A24688FC12; Tue, 20 Mar 2012 19:03:59 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 584D646B17; Tue, 20 Mar 2012 15:03:59 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C06A0B96C; Tue, 20 Mar 2012 15:03:58 -0400 (EDT) From: John Baldwin To: davidxu@freebsd.org Date: Tue, 20 Mar 2012 14:13:30 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203180022.q2I0MThr093557@svn.freebsd.org> <201203191350.51888.jhb@freebsd.org> <4F67C707.8080006@gmail.com> In-Reply-To: <4F67C707.8080006@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203201413.30668.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Mar 2012 15:03:58 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233103 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:04:00 -0000 On Monday, March 19, 2012 7:53:43 pm David Xu wrote: > On 2012/3/20 1:50, John Baldwin wrote: > > On Monday, March 19, 2012 11:41:53 am David Xu wrote: > >> On 2012/3/19 20:33, John Baldwin wrote: > >>> On Saturday, March 17, 2012 8:22:29 pm David Xu wrote: > >>>> Author: davidxu > >>>> Date: Sun Mar 18 00:22:29 2012 > >>>> New Revision: 233103 > >>>> URL: http://svn.freebsd.org/changeset/base/233103 > >>>> > >>>> Log: > >>>> Some software think a mutex can be destroyed after it owned it, for > >>>> example, it uses a serialization point like following: > >>>> pthread_mutex_lock(&mutex); > >>>> pthread_mutex_unlock(&mutex); > >>>> pthread_mutex_destroy(&muetx); > >>>> They think a previous lock holder should have already left the mutex and > >>>> is no longer referencing it, so they destroy it. To be maximum compatible > >>>> with such code, we use IA64 version to unlock the mutex in kernel, remove > >>>> the two steps unlocking code. > >>> But this means they destroy the lock while another thread holds it? That > >>> seems wrong. It's one thing if they know that no other thread has a reference > >>> to the lock (e.g. it's in a refcounted object and the current thread just > >>> dropped the reference count to zero). However, in that case no other thread > >>> can unlock it after this thread destroys it. Code that does this seems very > >>> buggy, since if the address can be unmapped it can also be remapped and > >>> assigned to another lock, etc., so you could have a thread try to unlock a > >>> lock it doesn't hold. > >> They have handshake code to indicate that the mutex is no longer used by > >> previous > >> holder. e.g: > >> > >> thread 1: > >> pthread_mutex_lock(&mutex); > >> done = 1; > >> pthread_mutex_unlock(&mutex); > >> thread 2: > >> pthread_mutex_lock(&mutex); > >> temp = done; > >> pthread_mutex_unlock(&mutex); > >> if (temp == 1) > >> pthread_mutex_destroy(&mutex); > > Hmm, so how does this result in the crash you fixed? That is, thread 1 has > > to fully finish pthread_mutex_unlock() before thread2's pthread_mutex_lock() > > can succeed, so I don't see how thread 1 could still be in > > pthread_mutex_unlock() when thread 2 calls pthread_mutex_destroy(). > This is implementation detail,thread1 does unlocking in two steps: > first it clears lock bit, but leaves contention bit there, > then thread2 enters and sets lock bit, and then destroy it. > T1: > clear lock bit, contention bit is still set. > T2: > lock the mutex by setting lock bit. > do some work. > unlock the mutex by clearing lock it, > enters kernel, and see no waiters, clears contention bit. > destroy the mutex, unmap memory > T1: > enter kernel to clear contention bit, because the memory > is unmmaped, it returns EINVAL. Ah, ok. So we should still be able to do an uncontested unlock in userland directly. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:04:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74A1F1065674; Tue, 20 Mar 2012 19:04:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 42F558FC14; Tue, 20 Mar 2012 19:04:00 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id EB51246B3F; Tue, 20 Mar 2012 15:03:59 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 65D5CB91C; Tue, 20 Mar 2012 15:03:59 -0400 (EDT) From: John Baldwin To: Eitan Adler Date: Tue, 20 Mar 2012 14:52:27 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203190041.q2J0femX042684@svn.freebsd.org> <86bons71qe.fsf@ds4.des.no> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201203201452.27484.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Mar 2012 15:03:59 -0400 (EDT) Cc: svn-src-head@freebsd.org, Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= , svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival Subject: Re: svn commit: r233136 - in head/secure: usr.bin/ssh usr.sbin/sshd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:04:00 -0000 On Monday, March 19, 2012 7:12:25 pm Eitan Adler wrote: > 2012/3/19 Dag-Erling Sm=C3=B8rgrav : > > John Baldwin writes: >=20 > Looking at the original contents of the two files >=20 > sshd: > -.if defined(X11BASE) || defined(LOCALBASE) >=20 > ssh: > -.if defined(X11BASE) >=20 > which I think was the cause of my original confusion. The change *was* > a no-op for ssh but resulted in behavior change when LOCALBASE was > defined in sshd. >=20 > What do you think of the following patch which uses the same .defined > version as the original restores LOCALBASE support in sshd and and > adds support to ssh? Is there a reason for the difference between the > two? [ build tested only ] This looks good to me. I suspect it was just a bug in the ssh Makefile=20 originally. > commit 3b4f7b77abc6a0fadb3a15ebd7e8e8d475047842 > Author: Eitan Adler > Date: Mon Mar 19 19:07:35 2012 -0400 >=20 > Restore the ability to use a non-standard LOCALBASE to sshd > Add the ability to use a non-standard LOCALBASE to ssh >=20 > Submitted by: jhb > Reviewed by: des > Approved by: cperciva > MFC after: 0 days (with r233136) >=20 > diff --git a/secure/usr.bin/ssh/Makefile b/secure/usr.bin/ssh/Makefile > index 619c44a..9304fd55 100644 > --- a/secure/usr.bin/ssh/Makefile > +++ b/secure/usr.bin/ssh/Makefile > @@ -28,6 +28,10 @@ LDADD+=3D -lgssapi > DPADD+=3D ${LIBCRYPT} ${LIBCRYPTO} > LDADD+=3D -lcrypt -lcrypto >=20 > +.if defined(LOCALBASE) > +CFLAGS+=3D -DXAUTH_PATH=3D\"${LOCALBASE}/bin/xauth\" > +.endif > + > .include >=20 > .PATH: ${SSHDIR} > diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile > index 0120771..cc914c4 100644 > --- a/secure/usr.sbin/sshd/Makefile > +++ b/secure/usr.sbin/sshd/Makefile > @@ -43,6 +43,10 @@ LDADD+=3D -lgssapi_krb5 -lgssapi -lkrb5 -lasn1 > DPADD+=3D ${LIBCRYPTO} ${LIBCRYPT} > LDADD+=3D -lcrypto -lcrypt >=20 > +.if defined(LOCALBASE) > +CFLAGS+=3D -DXAUTH_PATH=3D\"${LOCALBASE}/bin/xauth\" > +.endif > + > .include >=20 > .PATH: ${SSHDIR} >=20 >=20 >=20 > --=20 > Eitan Adler > Source & Ports committer > X11, Bugbusting teams >=20 =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:04:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7B5D1065679; Tue, 20 Mar 2012 19:04:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B89998FC15; Tue, 20 Mar 2012 19:04:00 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 6B1D046B43; Tue, 20 Mar 2012 15:04:00 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DA4A0B960; Tue, 20 Mar 2012 15:03:59 -0400 (EDT) From: John Baldwin To: Sergey Kandaurov Date: Tue, 20 Mar 2012 14:53:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203192015.q2JKFItl084480@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203201453.52982.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Mar 2012 15:03:59 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r233199 - in stable/8/sys: i386/conf netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:04:01 -0000 On Tuesday, March 20, 2012 5:02:48 am Sergey Kandaurov wrote: > On 20 March 2012 00:15, John Baldwin wrote: > > Author: jhb > > Date: Mon Mar 19 20:15:18 2012 > > New Revision: 233199 > > URL: http://svn.freebsd.org/changeset/base/233199 > > > > Log: > > MFC 225096: > > Fix if_addr_mtx recursion in mld6. > > Ehh.. Thank you for doing this. > As I mentioned earlier I could not reproduce this problem myself > in RELENG_8, that's why it was not MFCed so far... To be honest, my main movitation was to remove a merge conflict in my subsequent MFC of the IF_ADDR locking changes. I could have patched the locking in the old mld6.c, but when I reviewed your diff, I figured it would be better to merge it first instead. > > > > mld_set_version() is called only from mld_v1_input_query() and > > mld_v2_input_query() both holding the if_addr_mtx lock, and then calling > > into mld_v2_cancel_link_timers() acquires it the second time, which results > > in mtx recursion. To avoid that, delay if_addr_mtx acquisition until after > > mld_set_version() is called; while here, further reduce locking scope > > to protect only the needed pieces: if_multiaddrs, in6m_lookup_locked(). > > [...] > > -- > wbr, > pluknet > -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:04:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B465106566B; Tue, 20 Mar 2012 19:04:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4E0868FC16; Tue, 20 Mar 2012 19:04:01 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 0413E46B46; Tue, 20 Mar 2012 15:04:01 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 654FCB96C; Tue, 20 Mar 2012 15:04:00 -0400 (EDT) From: John Baldwin To: Tijl Coosemans Date: Tue, 20 Mar 2012 14:56:14 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203091148.q29BmuIp005151@svn.freebsd.org> <201203200834.10539.jhb@freebsd.org> <201203201519.12926.tijl@freebsd.org> In-Reply-To: <201203201519.12926.tijl@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201203201456.14375.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Mar 2012 15:04:00 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232721 - head/sys/x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:04:01 -0000 On Tuesday, March 20, 2012 10:19:07 am Tijl Coosemans wrote: > On Tuesday 20 March 2012 13:34:10 John Baldwin wrote: > > On Friday, March 09, 2012 6:48:56 am Tijl Coosemans wrote: > >> Author: tijl > >> Date: Fri Mar 9 11:48:56 2012 > >> New Revision: 232721 > >> URL: http://svn.freebsd.org/changeset/base/232721 > >> > >> Log: > >> Clean up x86 endian.h: > >> - Remove extern "C". There are no functions with external linkage here. [1] > >> - Rename bswapNN_const(x) to bswapNN_gen(x) to indicate that these macros > >> are generic implementations that can take non-constant arguments. [1] > >> - Split up __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P and deal with > >> each separately. > >> - Replace _LP64 with __amd64__ because asm instructions are machine > >> dependent, not ABI dependent. > >> > >> Submitted by: bde [1] > >> Reviewed by: bde > > > > BTW, I think I found an old "bug" in this file. The _gen() variants > > should only use the _gen() variants of smaller types rather than using > > the version that re-checks __build_constant_p() I think. That is: > > > > Index: x86/include/endian.h > > =================================================================== > > --- endian.h (revision 233184) > > +++ endian.h (working copy) > > @@ -65,9 +65,9 @@ > > > > #define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8) > > #define __bswap32_gen(x) \ > > - (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) > > + (((__uint32_t)__bswap16_gen(x) << 16) | __bswap16_gen((x) >> 16)) > > #define __bswap64_gen(x) \ > > - (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) > > + (((__uint64_t)__bswap32_gen(x) << 32) | __bswap32_gen((x) >> 32)) > > > > #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P > > #define __bswap16(x) \ > > > > I ran into this while porting the __builtin_constant_p() functionality > > over to ia64. > > No, on i386 bswap64 with a variable argument currently expands to two > bswap instructions. With your change it would be many shifts and logical > operations. The _gen variants are more like fallback implementations. > If bswapNN cannot be implemented directly it is split up. If those > smaller problems can be implemented directly, good, if not split it up > again and so on. Oh, I now parse the comment in __bswap64_var() correctly. That's fugly. Still, it seems that if I keep the patch to port this to ia64 (so it can do constants as constants), then it will need to use this approach since it won't have the i386 problem (in its case the _gen variants are only used for constants). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:16:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15F0D106566B; Tue, 20 Mar 2012 19:16:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F41378FC08; Tue, 20 Mar 2012 19:16:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KJGs2o033731; Tue, 20 Mar 2012 19:16:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KJGsmx033728; Tue, 20 Mar 2012 19:16:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203201916.q2KJGsmx033728@svn.freebsd.org> From: Michael Tuexen Date: Tue, 20 Mar 2012 19:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233239 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:16:55 -0000 Author: tuexen Date: Tue Mar 20 19:16:54 2012 New Revision: 233239 URL: http://svn.freebsd.org/changeset/base/233239 Log: MFC r231895: Remove two clang warnings. Modified: stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Tue Mar 20 18:18:12 2012 (r233238) +++ stable/9/sys/netinet/sctp_usrreq.c Tue Mar 20 19:16:54 2012 (r233239) @@ -6357,7 +6357,7 @@ sctp_ingetaddr(struct socket *so, struct int sctp_peeraddr(struct socket *so, struct sockaddr **addr) { - struct sockaddr_in *sin = (struct sockaddr_in *)*addr; + struct sockaddr_in *sin; int fnd; struct sockaddr_in *sin_a; struct sctp_inpcb *inp; Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Tue Mar 20 18:18:12 2012 (r233238) +++ stable/9/sys/netinet6/sctp6_usrreq.c Tue Mar 20 19:16:54 2012 (r233239) @@ -1199,7 +1199,7 @@ sctp6_getaddr(struct socket *so, struct static int sctp6_peeraddr(struct socket *so, struct sockaddr **addr) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)*addr; + struct sockaddr_in6 *sin6; int fnd; struct sockaddr_in6 *sin_a6; struct sctp_inpcb *inp; From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:19:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 450BB1065673; Tue, 20 Mar 2012 19:19:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 301758FC12; Tue, 20 Mar 2012 19:19:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KJJpjZ033879; Tue, 20 Mar 2012 19:19:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KJJonb033877; Tue, 20 Mar 2012 19:19:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203201919.q2KJJonb033877@svn.freebsd.org> From: Michael Tuexen Date: Tue, 20 Mar 2012 19:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233240 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:19:51 -0000 Author: tuexen Date: Tue Mar 20 19:19:50 2012 New Revision: 233240 URL: http://svn.freebsd.org/changeset/base/233240 Log: MFC r232724: Add support for stf interfaces. Modified: stable/9/sys/netinet/sctp_bsd_addr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/9/sys/netinet/sctp_bsd_addr.c Tue Mar 20 19:16:54 2012 (r233239) +++ stable/9/sys/netinet/sctp_bsd_addr.c Tue Mar 20 19:19:50 2012 (r233240) @@ -180,6 +180,7 @@ sctp_is_desired_interface_type(struct if case IFT_SLIP: case IFT_GIF: case IFT_L2VLAN: + case IFT_STF: case IFT_IP: case IFT_IPOVERCDLC: case IFT_IPOVERCLAW: From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:22:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7BC7E1065675; Tue, 20 Mar 2012 19:22:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 666128FC0A; Tue, 20 Mar 2012 19:22:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KJMjUl034041; Tue, 20 Mar 2012 19:22:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KJMjeW034039; Tue, 20 Mar 2012 19:22:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203201922.q2KJMjeW034039@svn.freebsd.org> From: Michael Tuexen Date: Tue, 20 Mar 2012 19:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233241 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:22:45 -0000 Author: tuexen Date: Tue Mar 20 19:22:44 2012 New Revision: 233241 URL: http://svn.freebsd.org/changeset/base/233241 Log: MFC r232866: This fixes PR 165210. Basically we just add in the netgraph interface to the list of acceptable interfaces. A todo at the next IETF code blitz, though is we need to review why we screen interfaces, there was a reason ;-). From rrs@. Modified: stable/9/sys/netinet/sctp_bsd_addr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/9/sys/netinet/sctp_bsd_addr.c Tue Mar 20 19:19:50 2012 (r233240) +++ stable/9/sys/netinet/sctp_bsd_addr.c Tue Mar 20 19:22:44 2012 (r233241) @@ -184,6 +184,7 @@ sctp_is_desired_interface_type(struct if case IFT_IP: case IFT_IPOVERCDLC: case IFT_IPOVERCLAW: + case IFT_PROPVIRTUAL: /* NetGraph Virtual too */ case IFT_VIRTUALIPADDRESS: result = 1; break; From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:24:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2C72106566B; Tue, 20 Mar 2012 19:24:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B47128FC12; Tue, 20 Mar 2012 19:24:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KJOuca034162; Tue, 20 Mar 2012 19:24:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KJOuPQ034159; Tue, 20 Mar 2012 19:24:56 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203201924.q2KJOuPQ034159@svn.freebsd.org> From: Michael Tuexen Date: Tue, 20 Mar 2012 19:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233242 - in stable/9/sys: kern netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:24:57 -0000 Author: tuexen Date: Tue Mar 20 19:24:56 2012 New Revision: 233242 URL: http://svn.freebsd.org/changeset/base/233242 Log: MFC r233004: Fix bugs which can result in a panic when an non-SCTP socket it used with an sctp_ system-call which expects an SCTP socket. Modified: stable/9/sys/kern/uipc_syscalls.c stable/9/sys/netinet/sctp_peeloff.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_syscalls.c ============================================================================== --- stable/9/sys/kern/uipc_syscalls.c Tue Mar 20 19:22:44 2012 (r233241) +++ stable/9/sys/kern/uipc_syscalls.c Tue Mar 20 19:24:56 2012 (r233242) @@ -2320,6 +2320,10 @@ sys_sctp_peeloff(td, uap) error = fgetsock(td, uap->sd, CAP_PEELOFF, &head, &fflag); if (error) goto done2; + if (head->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto done2; + } error = sctp_can_peel_off(head, (sctp_assoc_t)uap->name); if (error) goto done2; @@ -2442,6 +2446,10 @@ sys_sctp_generic_sendmsg (td, uap) iov[0].iov_len = uap->mlen; so = (struct socket *)fp->f_data; + if (so->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto sctp_bad; + } #ifdef MAC error = mac_socket_check_send(td->td_ucred, so); if (error) @@ -2555,6 +2563,10 @@ sys_sctp_generic_sendmsg_iov(td, uap) #endif so = (struct socket *)fp->f_data; + if (so->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto sctp_bad; + } #ifdef MAC error = mac_socket_check_send(td->td_ucred, so); if (error) @@ -2659,6 +2671,10 @@ sys_sctp_generic_recvmsg(td, uap) goto out1; so = fp->f_data; + if (so->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto out; + } #ifdef MAC error = mac_socket_check_receive(td->td_ucred, so); if (error) { Modified: stable/9/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/9/sys/netinet/sctp_peeloff.c Tue Mar 20 19:22:44 2012 (r233241) +++ stable/9/sys/netinet/sctp_peeloff.c Tue Mar 20 19:24:56 2012 (r233242) @@ -59,16 +59,16 @@ sctp_can_peel_off(struct socket *head, s SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EBADF); return (EBADF); } - if ((head->so_proto->pr_protocol != IPPROTO_SCTP) || - (head->so_type != SOCK_SEQPACKET)) { - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); - return (EOPNOTSUPP); - } inp = (struct sctp_inpcb *)head->so_pcb; if (inp == NULL) { SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); return (EFAULT); } + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); + return (EOPNOTSUPP); + } stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); if (stcb == NULL) { SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOENT); From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:27:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 992EB106566B; Tue, 20 Mar 2012 19:27:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 762848FC08; Tue, 20 Mar 2012 19:27:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KJRRnU034293; Tue, 20 Mar 2012 19:27:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KJRRj3034290; Tue, 20 Mar 2012 19:27:27 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203201927.q2KJRRj3034290@svn.freebsd.org> From: Michael Tuexen Date: Tue, 20 Mar 2012 19:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233243 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:27:27 -0000 Author: tuexen Date: Tue Mar 20 19:27:27 2012 New Revision: 233243 URL: http://svn.freebsd.org/changeset/base/233243 Log: MFC r233005: Clean up, no functional change. Modified: stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Tue Mar 20 19:24:56 2012 (r233242) +++ stable/9/sys/netinet/sctp_usrreq.c Tue Mar 20 19:27:27 2012 (r233243) @@ -451,7 +451,7 @@ sctp_abort(struct socket *so) uint32_t flags; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { return; } sctp_must_try_again: @@ -569,7 +569,7 @@ sctp_bind(struct socket *so, struct sock return (EINVAL); } inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } @@ -585,7 +585,7 @@ sctp_close(struct socket *so) uint32_t flags; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) + if (inp == NULL) return; /* @@ -650,7 +650,7 @@ sctp_sendm(struct socket *so, int flags, int error; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { if (control) { sctp_m_freem(control); control = NULL; @@ -979,7 +979,7 @@ sctp_shutdown(struct socket *so) struct sctp_inpcb *inp; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } @@ -1639,7 +1639,7 @@ sctp_getopt(struct socket *so, int optna return (EINVAL); } inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return EINVAL; } @@ -3317,7 +3317,7 @@ sctp_setopt(struct socket *so, int optna return (EINVAL); } inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_PRINTF("inp is NULL?\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); @@ -5765,12 +5765,6 @@ sctp_ctloutput(struct socket *so, struct void *p; int error = 0; - inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { - /* I made the same as TCP since we are not setup? */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (ECONNRESET); - } if (sopt->sopt_level != IPPROTO_SCTP) { /* wrong proto level... send back up to IP */ #ifdef INET6 @@ -5785,6 +5779,7 @@ sctp_ctloutput(struct socket *so, struct #endif return (error); } + inp = (struct sctp_inpcb *)so->so_pcb; optsize = sopt->sopt_valsize; if (optsize) { SCTP_MALLOC(optval, void *, optsize, SCTP_M_SOCKOPT); @@ -5828,7 +5823,7 @@ sctp_connect(struct socket *so, struct s struct sctp_tcb *stcb = NULL; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { /* I made the same as TCP since we are not setup? */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (ECONNRESET); @@ -5988,7 +5983,7 @@ sctp_listen(struct socket *so, int backl struct sctp_inpcb *inp; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { /* I made the same as TCP since we are not setup? */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (ECONNRESET); @@ -6152,7 +6147,7 @@ sctp_accept(struct socket *so, struct so #endif inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (ECONNRESET); } Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Tue Mar 20 19:24:56 2012 (r233242) +++ stable/9/sys/netinet6/sctp6_usrreq.c Tue Mar 20 19:27:27 2012 (r233243) @@ -632,7 +632,7 @@ sctp6_abort(struct socket *so) uint32_t flags; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); return; } @@ -720,7 +720,7 @@ sctp6_bind(struct socket *so, struct soc int error; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); return (EINVAL); } @@ -960,7 +960,7 @@ sctp6_connect(struct socket *so, struct inp6 = (struct in6pcb *)so->so_pcb; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ECONNRESET); return (ECONNRESET); /* I made the same as TCP since we are * not setup? */ From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:37:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C3DE106566C; Tue, 20 Mar 2012 19:37:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 260108FC19; Tue, 20 Mar 2012 19:37:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KJb6M1034671; Tue, 20 Mar 2012 19:37:06 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KJb594034668; Tue, 20 Mar 2012 19:37:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203201937.q2KJb594034668@svn.freebsd.org> From: Michael Tuexen Date: Tue, 20 Mar 2012 19:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233244 - in stable/8/sys: i386/conf netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:37:06 -0000 Author: tuexen Date: Tue Mar 20 19:37:05 2012 New Revision: 233244 URL: http://svn.freebsd.org/changeset/base/233244 Log: MFC r231895: Remove two clang warnings. Modified: stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Tue Mar 20 19:27:27 2012 (r233243) +++ stable/8/sys/netinet/sctp_usrreq.c Tue Mar 20 19:37:05 2012 (r233244) @@ -6325,7 +6325,7 @@ sctp_ingetaddr(struct socket *so, struct int sctp_peeraddr(struct socket *so, struct sockaddr **addr) { - struct sockaddr_in *sin = (struct sockaddr_in *)*addr; + struct sockaddr_in *sin; int fnd; struct sockaddr_in *sin_a; struct sctp_inpcb *inp; Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Tue Mar 20 19:27:27 2012 (r233243) +++ stable/8/sys/netinet6/sctp6_usrreq.c Tue Mar 20 19:37:05 2012 (r233244) @@ -1199,7 +1199,7 @@ sctp6_getaddr(struct socket *so, struct static int sctp6_peeraddr(struct socket *so, struct sockaddr **addr) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)*addr; + struct sockaddr_in6 *sin6; int fnd; struct sockaddr_in6 *sin_a6; struct sctp_inpcb *inp; From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:39:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2C3D106566B; Tue, 20 Mar 2012 19:39:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC2B18FC14; Tue, 20 Mar 2012 19:39:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KJdiaO034797; Tue, 20 Mar 2012 19:39:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KJdiNH034795; Tue, 20 Mar 2012 19:39:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203201939.q2KJdiNH034795@svn.freebsd.org> From: Michael Tuexen Date: Tue, 20 Mar 2012 19:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233245 - in stable/8/sys: i386/conf netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:39:44 -0000 Author: tuexen Date: Tue Mar 20 19:39:44 2012 New Revision: 233245 URL: http://svn.freebsd.org/changeset/base/233245 Log: MFC r232724: Add support for stf interfaces. Modified: stable/8/sys/netinet/sctp_bsd_addr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Tue Mar 20 19:37:05 2012 (r233244) +++ stable/8/sys/netinet/sctp_bsd_addr.c Tue Mar 20 19:39:44 2012 (r233245) @@ -180,6 +180,7 @@ sctp_is_desired_interface_type(struct if case IFT_SLIP: case IFT_GIF: case IFT_L2VLAN: + case IFT_STF: case IFT_IP: case IFT_IPOVERCDLC: case IFT_IPOVERCLAW: From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:42:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 25102106566C; Tue, 20 Mar 2012 19:42:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F3B48FC0C; Tue, 20 Mar 2012 19:42:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KJgeDe034956; Tue, 20 Mar 2012 19:42:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KJgefN034954; Tue, 20 Mar 2012 19:42:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203201942.q2KJgefN034954@svn.freebsd.org> From: Michael Tuexen Date: Tue, 20 Mar 2012 19:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233246 - in stable/8/sys: i386/conf netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:42:41 -0000 Author: tuexen Date: Tue Mar 20 19:42:40 2012 New Revision: 233246 URL: http://svn.freebsd.org/changeset/base/233246 Log: MFC r232866: This fixes PR 165210. Basically we just add in the netgraph interface to the list of acceptable interfaces. A todo at the next IETF code blitz, though is we need to review why we screen interfaces, there was a reason ;-). From rrs@. Modified: stable/8/sys/netinet/sctp_bsd_addr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Tue Mar 20 19:39:44 2012 (r233245) +++ stable/8/sys/netinet/sctp_bsd_addr.c Tue Mar 20 19:42:40 2012 (r233246) @@ -184,6 +184,7 @@ sctp_is_desired_interface_type(struct if case IFT_IP: case IFT_IPOVERCDLC: case IFT_IPOVERCLAW: + case IFT_PROPVIRTUAL: /* NetGraph Virtual too */ case IFT_VIRTUALIPADDRESS: result = 1; break; From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:45:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4593F106566C; Tue, 20 Mar 2012 19:45:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27A198FC17; Tue, 20 Mar 2012 19:45:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KJjQBi035116; Tue, 20 Mar 2012 19:45:26 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KJjPi9035113; Tue, 20 Mar 2012 19:45:25 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203201945.q2KJjPi9035113@svn.freebsd.org> From: Michael Tuexen Date: Tue, 20 Mar 2012 19:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233247 - in stable/8/sys: i386/conf kern netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:45:26 -0000 Author: tuexen Date: Tue Mar 20 19:45:25 2012 New Revision: 233247 URL: http://svn.freebsd.org/changeset/base/233247 Log: MFC r233004: Fix bugs which can result in a panic when an non-SCTP socket it used with an sctp_ system-call which expects an SCTP socket. Modified: stable/8/sys/kern/uipc_syscalls.c stable/8/sys/netinet/sctp_peeloff.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/kern/uipc_syscalls.c ============================================================================== --- stable/8/sys/kern/uipc_syscalls.c Tue Mar 20 19:42:40 2012 (r233246) +++ stable/8/sys/kern/uipc_syscalls.c Tue Mar 20 19:45:25 2012 (r233247) @@ -2300,6 +2300,10 @@ sctp_peeloff(td, uap) error = fgetsock(td, uap->sd, &head, &fflag); if (error) goto done2; + if (head->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto done2; + } error = sctp_can_peel_off(head, (sctp_assoc_t)uap->name); if (error) goto done2; @@ -2418,6 +2422,10 @@ sctp_generic_sendmsg (td, uap) iov[0].iov_len = uap->mlen; so = (struct socket *)fp->f_data; + if (so->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto sctp_bad; + } #ifdef MAC error = mac_socket_check_send(td->td_ucred, so); if (error) @@ -2528,6 +2536,10 @@ sctp_generic_sendmsg_iov(td, uap) #endif so = (struct socket *)fp->f_data; + if (so->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto sctp_bad; + } #ifdef MAC error = mac_socket_check_send(td->td_ucred, so); if (error) @@ -2632,6 +2644,10 @@ sctp_generic_recvmsg(td, uap) goto out1; so = fp->f_data; + if (so->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto out; + } #ifdef MAC error = mac_socket_check_receive(td->td_ucred, so); if (error) { Modified: stable/8/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.c Tue Mar 20 19:42:40 2012 (r233246) +++ stable/8/sys/netinet/sctp_peeloff.c Tue Mar 20 19:45:25 2012 (r233247) @@ -59,16 +59,16 @@ sctp_can_peel_off(struct socket *head, s SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EBADF); return (EBADF); } - if ((head->so_proto->pr_protocol != IPPROTO_SCTP) || - (head->so_type != SOCK_SEQPACKET)) { - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); - return (EOPNOTSUPP); - } inp = (struct sctp_inpcb *)head->so_pcb; if (inp == NULL) { SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); return (EFAULT); } + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); + return (EOPNOTSUPP); + } stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); if (stcb == NULL) { SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOENT); From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:48:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F92A106564A; Tue, 20 Mar 2012 19:48:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FFDD8FC0A; Tue, 20 Mar 2012 19:48:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KJm0KN035240; Tue, 20 Mar 2012 19:48:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KJm0B8035237; Tue, 20 Mar 2012 19:48:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203201948.q2KJm0B8035237@svn.freebsd.org> From: Michael Tuexen Date: Tue, 20 Mar 2012 19:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233248 - in stable/8/sys: i386/conf netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:48:00 -0000 Author: tuexen Date: Tue Mar 20 19:47:59 2012 New Revision: 233248 URL: http://svn.freebsd.org/changeset/base/233248 Log: MFC r233005: Clean up, no functional change. Modified: stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Tue Mar 20 19:45:25 2012 (r233247) +++ stable/8/sys/netinet/sctp_usrreq.c Tue Mar 20 19:47:59 2012 (r233248) @@ -451,7 +451,7 @@ sctp_abort(struct socket *so) uint32_t flags; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { return; } sctp_must_try_again: @@ -569,7 +569,7 @@ sctp_bind(struct socket *so, struct sock return (EINVAL); } inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } @@ -585,7 +585,7 @@ sctp_close(struct socket *so) uint32_t flags; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) + if (inp == NULL) return; /* @@ -650,7 +650,7 @@ sctp_sendm(struct socket *so, int flags, int error; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { if (control) { sctp_m_freem(control); control = NULL; @@ -979,7 +979,7 @@ sctp_shutdown(struct socket *so) struct sctp_inpcb *inp; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } @@ -1639,7 +1639,7 @@ sctp_getopt(struct socket *so, int optna return (EINVAL); } inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return EINVAL; } @@ -3306,7 +3306,7 @@ sctp_setopt(struct socket *so, int optna return (EINVAL); } inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_PRINTF("inp is NULL?\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); @@ -5733,12 +5733,6 @@ sctp_ctloutput(struct socket *so, struct void *p; int error = 0; - inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { - /* I made the same as TCP since we are not setup? */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (ECONNRESET); - } if (sopt->sopt_level != IPPROTO_SCTP) { /* wrong proto level... send back up to IP */ #ifdef INET6 @@ -5753,6 +5747,7 @@ sctp_ctloutput(struct socket *so, struct #endif return (error); } + inp = (struct sctp_inpcb *)so->so_pcb; optsize = sopt->sopt_valsize; if (optsize) { SCTP_MALLOC(optval, void *, optsize, SCTP_M_SOCKOPT); @@ -5796,7 +5791,7 @@ sctp_connect(struct socket *so, struct s struct sctp_tcb *stcb = NULL; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { /* I made the same as TCP since we are not setup? */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (ECONNRESET); @@ -5956,7 +5951,7 @@ sctp_listen(struct socket *so, int backl struct sctp_inpcb *inp; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { /* I made the same as TCP since we are not setup? */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (ECONNRESET); @@ -6120,7 +6115,7 @@ sctp_accept(struct socket *so, struct so #endif inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (ECONNRESET); } Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Tue Mar 20 19:45:25 2012 (r233247) +++ stable/8/sys/netinet6/sctp6_usrreq.c Tue Mar 20 19:47:59 2012 (r233248) @@ -632,7 +632,7 @@ sctp6_abort(struct socket *so) uint32_t flags; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); return; } @@ -720,7 +720,7 @@ sctp6_bind(struct socket *so, struct soc int error; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); return (EINVAL); } @@ -960,7 +960,7 @@ sctp6_connect(struct socket *so, struct inp6 = (struct in6pcb *)so->so_pcb; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ECONNRESET); return (ECONNRESET); /* I made the same as TCP since we are * not setup? */ From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 20:37:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4374106564A; Tue, 20 Mar 2012 20:37:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D06DC8FC16; Tue, 20 Mar 2012 20:37:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KKbNxV037016; Tue, 20 Mar 2012 20:37:23 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KKbNfK037014; Tue, 20 Mar 2012 20:37:23 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203202037.q2KKbNfK037014@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Mar 2012 20:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233249 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 20:37:24 -0000 Author: jkim Date: Tue Mar 20 20:37:23 2012 New Revision: 233249 URL: http://svn.freebsd.org/changeset/base/233249 Log: Fix another witness panic. We cannot enter critical section at all because AcpiEnterSleepState() executes (optional) _GTS method since ACPICA 20120215 (r231844). To evaluate the method, we need malloc(9), which may sleep. Reported by: bschmidt MFC after: 3 days Modified: head/sys/amd64/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Tue Mar 20 19:47:59 2012 (r233248) +++ head/sys/amd64/acpica/acpi_wakeup.c Tue Mar 20 20:37:23 2012 (r233249) @@ -223,6 +223,7 @@ acpi_sleep_machdep(struct acpi_softc *sc #ifdef SMP cpuset_t wakeup_cpus; #endif + register_t rf; ACPI_STATUS status; int ret; @@ -241,8 +242,8 @@ acpi_sleep_machdep(struct acpi_softc *sc AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); + rf = intr_disable(); intr_suspend(); - spinlock_enter(); if (savectx(susppcbs[0])) { ctx_fpusave(suspfpusave[0]); @@ -299,8 +300,8 @@ out: #endif mca_resume(); - spinlock_exit(); intr_resume(); + intr_restore(rf); AcpiSetFirmwareWakingVector(0); From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 21:20:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7602F106564A; Tue, 20 Mar 2012 21:20:44 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2011D8FC0A; Tue, 20 Mar 2012 21:20:42 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so557883bkc.13 for ; Tue, 20 Mar 2012 14:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=hWOJpETowPFJFRGRMXGqfJXQXN4L9zLf73wgulMiVFQ=; b=zBtIpaxA6gPdWn3dwA+3PLcXyRfJB+Ta/a911suE+FKKX2YEYfoR8viKjcsB/jn/19 RL6x5b1gUM65qJN14qnz1d+01EHezmsY/8Esw0y2c4kw13ACswct1ov6Q4yIZl9Mix01 TWIp/HMMxctV7gptG9PzGhdK04ELhbwLSowi1PpCavZOmTX9+HA6UzcdXUm9yZR8qU45 hc3t4yda4pHta+VRUNi2X5w/RRfx/e3GkBgHozZAn/RWwALDfeK5oWct0iXu1dXZQnVQ KJKuCxGIS2aM45zQ/Tq19yf77CdorztASmoPFdb1751vJ0GCvE+OqJQUKJg3FYUAf+O9 W8Mw== Received: by 10.204.141.25 with SMTP id k25mr519805bku.72.1332278436109; Tue, 20 Mar 2012 14:20:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.202.142 with HTTP; Tue, 20 Mar 2012 14:20:04 -0700 (PDT) In-Reply-To: <201203201019.40486.jhb@freebsd.org> References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <4F678B03.8050307@FreeBSD.org> <4F67A7A9.50003@FreeBSD.org> <201203201019.40486.jhb@freebsd.org> From: Chris Rees Date: Tue, 20 Mar 2012 21:20:04 +0000 Message-ID: To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Doug Barton , svn-src-all@freebsd.org, Dimitry Andric , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 21:20:44 -0000 On 20 March 2012 14:19, John Baldwin wrote: > On Monday, March 19, 2012 5:39:53 pm Doug Barton wrote: >> On 3/19/2012 12:37 PM, Dimitry Andric wrote: >> > It would be much nicer to be able to write: >> > >> > .if defined(FOO) >> > =A0 .if defined(BAR) >> > =A0 =A0 CFLAGS+=3D =A0 =A0 =A0 =A0-DFOO_BAR >> > =A0 .endif >> > .endif >> >> Take a look at /usr/ports/Mk/bsd.port.mk for how this can be done. > > Hmm, do yoo have a specific example? =A0The bits in I see in bsd.port.mk = suffer > from the limitation Dimitry raises, e.g.: > > .if defined(OPTIONS) > # include OPTIONSFILE first if exists > . =A0 =A0 =A0 if exists(${OPTIONSFILE}) && !make(rmconfig) > . =A0 =A0 =A0 include "${OPTIONSFILE}" > . =A0 =A0 =A0 endif > . =A0 =A0 =A0 if exists(${OPTIONSFILE}.local) > . =A0 =A0 =A0 include "${OPTIONSFILE}.local" > . =A0 =A0 =A0 endif > WITHOUT:=3D > WITH:=3D > . =A0 =A0 =A0 if defined(OPTIONS) > REALOPTIONS=3D${OPTIONS:C/".*"//g} > . =A0 =A0 =A0 for O in ${REALOPTIONS} > RO:=3D${O} > . =A0 =A0 =A0 if ${RO:L} =3D=3D off > WITHOUT:=3D =A0 =A0 =A0 ${WITHOUT} ${OPT} > . =A0 =A0 =A0 endif > . =A0 =A0 =A0 if ${RO:L} =3D=3D on > WITH:=3D =A0 =A0 =A0 =A0 =A0${WITH} ${OPT} > . =A0 =A0 =A0 endif > OPT:=3D${RO} > . =A0 =A0 =A0 endfor > . =A0 =A0 =A0 endif > > That is, all the lines that don't start with a . are not indented, and > even this indentation is rather horrible (it doesn't nest, and it > has the odd structure of 'if defined(OPTIONS) { if defined(OPTIONS) {} }'= . I don't see how it's any more horrible than the kernel style's rules on indented #ifs (though I can see the reasoning for that) It's an unfortunate consequence of the fact that any line starting with whitespace must be a shell command-- from before Makefiles were allowed conditionals etc. It's got to be an improvement on: .if defined(ONE) .if !defined(TWO) .for one in two three four .if ${VAR} =3D=3D ${one} .if defined(VERBOSE) .warning VAR =3D one .endif .endif .endfor .elif ${VAR} =3D=3D four .if defined(VERBOSE) .warning VAR =3D four .endif .else .warning VAR is not four, and VERBOSE is ignored .endif # XXXX Which one is this for?? .endif which is what a lot of the Makefiles look like... debugging if-less endifs etc is infinitely easier if we indent, however horrible it looks. We shouldn't be *trying* to make Makefiles hard to read ;) Chris From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 21:30:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B6951065675; Tue, 20 Mar 2012 21:30:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BD87C8FC08; Tue, 20 Mar 2012 21:30:30 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 54E4946B2D; Tue, 20 Mar 2012 17:30:30 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D6C8AB93E; Tue, 20 Mar 2012 17:30:29 -0400 (EDT) From: John Baldwin To: Chris Rees Date: Tue, 20 Mar 2012 17:28:20 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <201203201019.40486.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203201728.21049.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Mar 2012 17:30:29 -0400 (EDT) Cc: Doug Barton , svn-src-all@freebsd.org, Dimitry Andric , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 21:30:31 -0000 On Tuesday, March 20, 2012 5:20:04 pm Chris Rees wrote: > On 20 March 2012 14:19, John Baldwin wrote: > > On Monday, March 19, 2012 5:39:53 pm Doug Barton wrote: > >> On 3/19/2012 12:37 PM, Dimitry Andric wrote: > >> > It would be much nicer to be able to write: > >> > > >> > .if defined(FOO) > >> > .if defined(BAR) > >> > CFLAGS+= -DFOO_BAR > >> > .endif > >> > .endif > >> > >> Take a look at /usr/ports/Mk/bsd.port.mk for how this can be done. > > > > Hmm, do yoo have a specific example? The bits in I see in bsd.port.mk suffer > > from the limitation Dimitry raises, e.g.: > > > > .if defined(OPTIONS) > > # include OPTIONSFILE first if exists > > . if exists(${OPTIONSFILE}) && !make(rmconfig) > > . include "${OPTIONSFILE}" > > . endif > > . if exists(${OPTIONSFILE}.local) > > . include "${OPTIONSFILE}.local" > > . endif > > WITHOUT:= > > WITH:= > > . if defined(OPTIONS) > > REALOPTIONS=${OPTIONS:C/".*"//g} > > . for O in ${REALOPTIONS} > > RO:=${O} > > . if ${RO:L} == off > > WITHOUT:= ${WITHOUT} ${OPT} > > . endif > > . if ${RO:L} == on > > WITH:= ${WITH} ${OPT} > > . endif > > OPT:=${RO} > > . endfor > > . endif > > > > That is, all the lines that don't start with a . are not indented, and > > even this indentation is rather horrible (it doesn't nest, and it > > has the odd structure of 'if defined(OPTIONS) { if defined(OPTIONS) {} }'. > > I don't see how it's any more horrible than the kernel style's rules > on indented #ifs (though I can see the reasoning for that) > > It's an unfortunate consequence of the fact that any line starting > with whitespace must be a shell command-- from before Makefiles were > allowed conditionals etc. > > It's got to be an improvement on: > > .if defined(ONE) > .if !defined(TWO) > .for one in two three four > .if ${VAR} == ${one} > .if defined(VERBOSE) > .warning VAR = one > .endif > .endif > .endfor > .elif ${VAR} == four > .if defined(VERBOSE) > .warning VAR = four > .endif > .else > .warning VAR is not four, and VERBOSE is ignored > .endif # XXXX Which one is this for?? > .endif > > which is what a lot of the Makefiles look like... debugging if-less > endifs etc is infinitely easier if we indent, however horrible it > looks. > > We shouldn't be *trying* to make Makefiles hard to read ;) Oh, it may be that I was reading it in less or some such and that bsd.port.mk requires 4 space tabs, so when viewed in things like less the indentation doesn't actually look like indentation. In that respect, this is no better than the above (and is what bsd.ports.mk looks like to me at least): . if defined(ONE) . if !defined(TWO) . for one in two three four etc. To be worthwhile the spacing has to actually look like indentation: .if defined(ONE) . if !defined(TWO) . for one in two three four etc. Regardless, the .if defined(OPTIONS) . if defined(OPTIONS) . endif .endif is lame. You have to admit that at least. :) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 21:37:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86BD01065670; Tue, 20 Mar 2012 21:37:53 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D7528FC12; Tue, 20 Mar 2012 21:37:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2KLbrP5039034; Tue, 20 Mar 2012 21:37:53 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2KLbrFu039018; Tue, 20 Mar 2012 21:37:53 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203202137.q2KLbrFu039018@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Mar 2012 21:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233250 - in head: share/man/man4 sys/amd64/acpica sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/co... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 21:37:53 -0000 Author: jkim Date: Tue Mar 20 21:37:52 2012 New Revision: 233250 URL: http://svn.freebsd.org/changeset/base/233250 Log: Merge ACPICA 20120320. Added: head/sys/contrib/dev/acpica/compiler/preprocess.h - copied unchanged from r233238, vendor-sys/acpica/dist/source/compiler/preprocess.h head/sys/contrib/dev/acpica/compiler/prexpress.c - copied, changed from r233238, vendor-sys/acpica/dist/source/compiler/prexpress.c head/sys/contrib/dev/acpica/compiler/prmacros.c - copied, changed from r233238, vendor-sys/acpica/dist/source/compiler/prmacros.c head/sys/contrib/dev/acpica/compiler/prparser.l - copied, changed from r233238, vendor-sys/acpica/dist/source/compiler/prparser.l head/sys/contrib/dev/acpica/compiler/prparser.y - copied, changed from r233238, vendor-sys/acpica/dist/source/compiler/prparser.y head/sys/contrib/dev/acpica/compiler/prscan.c - copied, changed from r233238, vendor-sys/acpica/dist/source/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c - copied, changed from r233238, vendor-sys/acpica/dist/source/compiler/prutils.c Modified: head/share/man/man4/acpi.4 head/sys/amd64/acpica/acpi_wakeup.c head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.y head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/hardware/hwesleep.c head/sys/contrib/dev/acpica/components/hardware/hwsleep.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/namespace/nsrepair.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/include/achware.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acnames.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpivar.h head/sys/i386/acpica/acpi_wakeup.c head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/hardware/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) Modified: head/share/man/man4/acpi.4 ============================================================================== --- head/share/man/man4/acpi.4 Tue Mar 20 20:37:23 2012 (r233249) +++ head/share/man/man4/acpi.4 Tue Mar 20 21:37:52 2012 (r233250) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2010 +.Dd March 20, 2012 .Dt ACPI 4 .Os .Sh NAME @@ -214,6 +214,14 @@ Override any automatic quirks completely Beep the PC speaker on resume. This can help diagnose suspend/resume problems. Default is 0 (disabled). +.It Va debug.acpi.sleep_flags +Execute optional ACPI methods for suspend/resume. +If the bit 0 is set (1), it will try to execute _GTS (Going To Sleep) method +when entering suspend state. +If the bit 1 is set (2), it will try to execute _BFS (Back From Sleep) method +when leaving suspend state. +If both the bits are set (3), both the methods will be tried. +Default is 0 (disabled). .It Va hint.acpi.0.disabled Set this to 1 to disable all of ACPI. If ACPI has been disabled on your system due to a blacklist entry for your Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/amd64/acpica/acpi_wakeup.c Tue Mar 20 21:37:52 2012 (r233250) @@ -270,7 +270,7 @@ acpi_sleep_machdep(struct acpi_softc *sc if (state == ACPI_STATE_S4 && sc->acpi_s4bios) status = AcpiEnterSleepStateS4bios(); else - status = AcpiEnterSleepState(state); + status = AcpiEnterSleepState(state, acpi_sleep_flags); if (status != AE_OK) { device_printf(sc->acpi_dev, Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Tue Mar 20 21:37:52 2012 (r233250) @@ -31,7 +31,7 @@ src_headers="acapps.h accommon.h acconfi actbl2.h actbl3.h actypes.h acutils.h amlcode.h amlresrc.h \ platform/acenv.h platform/acfreebsd.h platform/acgcc.h" comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \ - asltypes.h dtcompiler.h dttemplate.h" + asltypes.h dtcompiler.h dttemplate.h preprocess.h" platform_headers="acfreebsd.h acgcc.h" # pre-clean Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/changes.txt Tue Mar 20 21:37:52 2012 (r233250) @@ -1,4 +1,96 @@ ---------------------------------------- +20 March 2012. Summary of changes for version 20120320: + +This release is available at www.acpica.org/downloads. +The ACPI 5.0 specification is available at www.acpi.info. + +1) ACPICA Core Subsystem: + +Enhanced the sleep/wake interfaces to optionally execute the _GTS method +(Going To Sleep) and the _BFS method (Back From Sleep). Windows apparently +does not execute these methods, and therefore these methods are often +untested. It has been seen on some systems where the execution of these +methods causes errors and also prevents the machine from entering S5. It is +therefore suggested that host operating systems do not execute these methods +by default. In the future, perhaps these methods can be optionally executed +based on the age of the system and/or what is the newest version of Windows +that the BIOS asks for via _OSI. Changed interfaces: AcpiEnterSleepState and +AcpileaveSleepStatePrep. See the ACPICA reference and Linux BZ 13041. Lin +Ming. + +Fixed a problem where the length of the local/common FADT was set too early. +The local FADT table length cannot be set to the common length until the +original length has been examined. There is code that checks the table length +and sets various fields appropriately. This can affect older machines with +early FADT versions. For example, this can cause inadvertent writes to the +CST_CNT register. Julian Anastasov. + +Fixed a mapping issue related to a physical table override. Use the deferred +mapping mechanism for tables loaded via the physical override OSL interface. +This allows for early mapping before the virtual memory manager is available. +Thomas Renninger, Bob Moore. + +Enhanced the automatic return-object repair code: Repair a common problem with +predefined methods that are defined to return a variable-length Package of +sub-objects. If there is only one sub-object, some BIOS ASL code mistakenly +simply returns the single object instead of a Package with one sub-object. +This new support will repair this error by wrapping a Package object around +the original object, creating the correct and expected Package with one sub- +object. Names that can be repaired in this manner include: _ALR, _CSD, _HPX, +_MLS, _PLD, _PRT, _PSS, _TRT, _TSS, _BCL, _DOD, _FIX, and _Sx. ACPICA BZ 939. + +Changed the exception code returned for invalid ACPI paths passed as +parameters to external interfaces such as AcpiEvaluateObject. Was +AE_BAD_PARAMETER, now is the more sensible AE_BAD_PATHNAME. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug +version of the code includes the debug output trace mechanism and has a much +larger code and data size. + + Previous Release: + Non-Debug Version: 93.0K Code, 25.0K Data, 118.0K Total + Debug Version: 172.5K Code, 73.2K Data, 245.7K Total + Current Release: + Non-Debug Version: 92.9K Code, 25.0K Data, 117.9K Total + Debug Version: 172.5K Code, 73.2K Data, 245.7K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Added the infrastructure and initial implementation of a integrated C- +like preprocessor. This will simplify BIOS development process by eliminating +the need for a separate preprocessing step during builds. On Windows, it also +eliminates the need to install a separate C compiler. ACPICA BZ 761. Some +features including full #define() macro support are still under development. +These preprocessor directives are supported: + #define + #elif + #else + #endif + #error + #if + #ifdef + #ifndef + #include + #pragma message + #undef + #warning +In addition, these new command line options are supported: + -D Define symbol for preprocessor use + -li Create preprocessed output file (*.i) + -P Preprocess only and create preprocessor output file (*.i) + +Table Compiler: Fixed a problem where the equals operator within an expression +did not work properly. + +Updated iASL to use the current versions of Bison/Flex. Updated the Windows +project file to invoke these tools from the standard location. ACPICA BZ 904. +Versions supported: + Flex for Windows: V2.5.4 + Bison for Windows: V2.4.1 + +---------------------------------------- 15 February 2012. Summary of changes for version 20120215: This release is available at www.acpica.org/downloads. Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/common/adisasm.c Tue Mar 20 21:37:52 2012 (r233250) @@ -75,6 +75,10 @@ LsSetupNsList ( /* Local prototypes */ +static UINT32 +AdGetFileSize ( + FILE *File); + static void AdCreateTableHeader ( char *Filename, @@ -160,6 +164,38 @@ static ACPI_PARSE_OBJECT *AcpiGbl_Par /******************************************************************************* * + * FUNCTION: AdGetFileSize + * + * PARAMETERS: File - Open file handle + * + * RETURN: File Size + * + * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open. + * + ******************************************************************************/ + +static UINT32 +AdGetFileSize ( + FILE *File) +{ + UINT32 FileSize; + long Offset; + + + Offset = ftell (File); + + fseek (File, 0, SEEK_END); + FileSize = (UINT32) ftell (File); + + /* Restore file pointer */ + + fseek (File, Offset, SEEK_SET); + return (FileSize); +} + + +/******************************************************************************* + * * FUNCTION: AdInitialize * * PARAMETERS: None @@ -380,8 +416,10 @@ AdAmlDisassemble ( "FieldName : FieldValue\n */\n\n"); AcpiDmDumpDataTable (Table); - fprintf (stderr, "Acpi Data Table [%4.4s] decoded, written to \"%s\"\n", - Table->Signature, DisasmFilename); + fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n", + Table->Signature); + fprintf (stderr, "Formatted output: %s - %u bytes\n", + DisasmFilename, AdGetFileSize (File)); } else { @@ -490,9 +528,9 @@ AdAmlDisassemble ( if (AcpiGbl_DbOpt_disasm) { AdDisplayTables (Filename, Table); - fprintf (stderr, - "Disassembly completed, written to \"%s\"\n", - DisasmFilename); + fprintf (stderr, "Disassembly completed\n"); + fprintf (stderr, "ASL Output: %s - %u bytes\n", + DisasmFilename, AdGetFileSize (File)); } } Modified: head/sys/contrib/dev/acpica/common/getopt.c ============================================================================== --- head/sys/contrib/dev/acpica/common/getopt.c Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/common/getopt.c Tue Mar 20 21:37:52 2012 (r233250) @@ -49,7 +49,8 @@ #include #include -#define ERR(szz,czz) if(AcpiGbl_Opterr){fprintf(stderr,"%s%s%c\n",argv[0],szz,czz);} +#define ACPI_OPTION_ERROR(msg, badchar) \ + if (AcpiGbl_Opterr) {fprintf (stderr, "%s%c\n", msg, badchar);} int AcpiGbl_Opterr = 1; @@ -87,12 +88,12 @@ AcpiGetopt( argv[AcpiGbl_Optind][0] != '-' || argv[AcpiGbl_Optind][1] == '\0') { - return(EOF); + return (EOF); } else if (strcmp (argv[AcpiGbl_Optind], "--") == 0) { AcpiGbl_Optind++; - return(EOF); + return (EOF); } } @@ -105,7 +106,7 @@ AcpiGetopt( if (CurrentChar == ':' || (OptsPtr = strchr (opts, CurrentChar)) == NULL) { - ERR (": illegal option -- ", CurrentChar); + ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar); if (argv[AcpiGbl_Optind][++CurrentCharPtr] == '\0') { @@ -126,7 +127,7 @@ AcpiGetopt( } else if (++AcpiGbl_Optind >= argc) { - ERR (": option requires an argument -- ", CurrentChar); + ACPI_OPTION_ERROR ("Option requires an argument: -", CurrentChar); CurrentCharPtr = 1; return ('?'); @@ -156,6 +157,26 @@ AcpiGetopt( CurrentCharPtr = 1; } + /* Option has a required single-char argument? */ + + else if (*OptsPtr == '|') + { + if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') + { + AcpiGbl_Optarg = &argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)]; + } + else + { + ACPI_OPTION_ERROR ("Option requires a single-character suboption: -", CurrentChar); + + CurrentCharPtr = 1; + return ('?'); + } + + AcpiGbl_Optind++; + CurrentCharPtr = 1; + } + /* Option with no arguments */ else Modified: head/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcodegen.c Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/compiler/aslcodegen.c Tue Mar 20 21:37:52 2012 (r233250) @@ -264,7 +264,7 @@ CgWriteAmlOpcode ( /* These opcodes should not get here */ printf ("Found a node with an unassigned AML opcode\n"); - fprintf (stderr, "Found a node with an unassigned AML opcode\n"); + FlPrintFile (ASL_FILE_STDERR, "Found a node with an unassigned AML opcode\n"); return; case AML_INT_RESERVEDFIELD_OP: Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Tue Mar 20 21:37:52 2012 (r233250) @@ -457,6 +457,17 @@ CmDoCompile ( Event = UtBeginEvent ("Open input and output files"); UtEndEvent (Event); + /* Preprocessor */ + + Event = UtBeginEvent ("Preprocess input file"); + PrDoPreprocess (); + UtEndEvent (Event); + if (Gbl_PreprocessOnly) + { + CmCleanupAndExit (); + return 0; + } + /* Build the parse tree */ Event = UtBeginEvent ("Parse source code and build parse tree"); @@ -474,8 +485,7 @@ CmDoCompile ( { AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL, "- Could not resolve parse tree root node"); - CmCleanupAndExit (); - return -1; + goto ErrorExit; } /* Optional parse tree dump, compiler debug output only */ @@ -508,12 +518,12 @@ CmDoCompile ( */ Event = UtBeginEvent ("Open AML output file"); Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix); + UtEndEvent (Event); if (ACPI_FAILURE (Status)) { AePrintErrorLog (ASL_FILE_STDERR); return -1; } - UtEndEvent (Event); /* Interpret and generate all compile-time constants */ @@ -552,6 +562,7 @@ CmDoCompile ( AePrintErrorLog (ASL_FILE_STDERR); UtDisplaySummary (ASL_FILE_STDERR); } + UtEndEvent (FullCompile); return 0; } @@ -566,7 +577,7 @@ CmDoCompile ( UtEndEvent (Event); if (ACPI_FAILURE (Status)) { - return -1; + goto ErrorExit; } /* Namespace cross-reference */ @@ -575,7 +586,7 @@ CmDoCompile ( Status = LkCrossReferenceNamespace (); if (ACPI_FAILURE (Status)) { - return -1; + goto ErrorExit; } /* Namespace - Check for non-referenced objects */ @@ -646,6 +657,11 @@ CmDoCompile ( UtEndEvent (FullCompile); CmCleanupAndExit (); return 0; + +ErrorExit: + UtEndEvent (FullCompile); + CmCleanupAndExit (); + return (-1); } @@ -799,7 +815,9 @@ CmCleanupAndExit ( /* Close all open files */ - for (i = 2; i < ASL_MAX_FILE_TYPE; i++) + Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ + + for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) { FlCloseFile (i); } @@ -817,6 +835,18 @@ CmCleanupAndExit ( } } + /* Delete the preprocessor output file (.i) unless -li flag is set */ + + if (!Gbl_PreprocessorOutputFlag && Gbl_Files[ASL_FILE_PREPROCESSOR].Filename) + { + if (remove (Gbl_Files[ASL_FILE_PREPROCESSOR].Filename)) + { + printf ("%s: ", + Gbl_Files[ASL_FILE_PREPROCESSOR].Filename); + perror ("Could not delete preprocessor .i file"); + } + } + /* * Delete intermediate ("combined") source file (if -ls flag not set) * This file is created during normal ASL/AML compiles. It is not Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Tue Mar 20 21:37:52 2012 (r233250) @@ -75,6 +75,7 @@ #include #include #include +#include /******************************************************************************* @@ -84,7 +85,7 @@ ******************************************************************************/ /* - * parser - generated from flex/bison, lex/yacc, etc. + * Main ASL parser - generated from flex/bison, lex/yacc, etc. */ int AslCompilerparse( @@ -303,6 +304,16 @@ AslCommonError ( char *ExtraMessage); void +AslCommonError2 ( + UINT8 Level, + UINT8 MessageId, + UINT32 LineNumber, + UINT32 Column, + char *SourceLine, + char *Filename, + char *ExtraMessage); + +void AePrintException ( UINT32 FileId, ASL_ERROR_MSG *Enode, Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.y Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.y Tue Mar 20 21:37:52 2012 (r233250) @@ -78,6 +78,11 @@ void * AslLocalAllo #define YYDEBUG 1 /* Enable debug output */ #define YYERROR_VERBOSE 1 /* Verbose error messages */ +/* Define YYMALLOC/YYFREE to prevent redefinition errors */ + +#define YYMALLOC malloc +#define YYFREE free + /* * The windows version of bison defines this incorrectly as "32768" (Not negative). * We use a custom (edited binary) version of bison that defines YYFLAG as YYFBAD Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Tue Mar 20 21:37:52 2012 (r233250) @@ -55,6 +55,18 @@ AeAddToErrorLog ( ASL_ERROR_MSG *Enode); +/******************************************************************************* + * + * FUNCTION: AeClearErrorLog + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Empty the error list + * + ******************************************************************************/ + void AeClearErrorLog ( void) @@ -168,7 +180,7 @@ AePrintException ( UINT32 SourceColumn; UINT32 ErrorColumn; FILE *OutputFile; - FILE *SourceFile; + FILE *SourceFile = NULL; long FileSize; BOOLEAN PrematureEOF = FALSE; @@ -211,24 +223,28 @@ AePrintException ( OutputFile = Gbl_Files[FileId].Handle; - /* Use the merged header/source file if present, otherwise use input file */ - SourceFile = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle; - if (!SourceFile) + if (!Enode->SourceLine) { - SourceFile = Gbl_Files[ASL_FILE_INPUT].Handle; - } + /* Use the merged header/source file if present, otherwise use input file */ - if (SourceFile) - { - /* Determine if the error occurred at source file EOF */ - - fseek (SourceFile, 0, SEEK_END); - FileSize = ftell (SourceFile); + SourceFile = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle; + if (!SourceFile) + { + SourceFile = Gbl_Files[ASL_FILE_INPUT].Handle; + } - if ((long) Enode->LogicalByteOffset >= FileSize) + if (SourceFile) { - PrematureEOF = TRUE; + /* Determine if the error occurred at source file EOF */ + + fseek (SourceFile, 0, SEEK_END); + FileSize = ftell (SourceFile); + + if ((long) Enode->LogicalByteOffset >= FileSize) + { + PrematureEOF = TRUE; + } } } @@ -247,46 +263,59 @@ AePrintException ( if (Enode->LineNumber) { - fprintf (OutputFile, " %6u: ", Enode->LineNumber); - - /* - * If not at EOF, get the corresponding source code line and - * display it. Don't attempt this if we have a premature EOF - * condition. - */ - if (!PrematureEOF) + if (Enode->SourceLine) + { + fprintf (OutputFile, " %6u: %s", + Enode->LineNumber, Enode->SourceLine); + } + else { + if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_ASL) + fprintf (OutputFile, " %6u: ", + PrGetLineNumber (Enode->LineNumber)); + else + fprintf (OutputFile, " %6u: ", + Enode->LineNumber); + /* - * Seek to the offset in the combined source file, read - * the source line, and write it to the output. + * If not at EOF, get the corresponding source code line and + * display it. Don't attempt this if we have a premature EOF + * condition. */ - Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset, - (int) SEEK_SET); - if (Actual) + if (!PrematureEOF) { - fprintf (OutputFile, - "[*** iASL: Seek error on source code temp file %s ***]", - Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); - } - else - { - RActual = fread (&SourceByte, 1, 1, SourceFile); - if (!RActual) + /* + * Seek to the offset in the combined source file, read + * the source line, and write it to the output. + */ + Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset, + (int) SEEK_SET); + if (Actual) { fprintf (OutputFile, - "[*** iASL: Read error on source code temp file %s ***]", + "[*** iASL: Seek error on source code temp file %s ***]", Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); } - - else while (RActual && SourceByte && (SourceByte != '\n')) + else { - fwrite (&SourceByte, 1, 1, OutputFile); RActual = fread (&SourceByte, 1, 1, SourceFile); + if (!RActual) + { + fprintf (OutputFile, + "[*** iASL: Read error on source code temp file %s ***]", + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); + } + + else while (RActual && SourceByte && (SourceByte != '\n')) + { + fwrite (&SourceByte, 1, 1, OutputFile); + RActual = fread (&SourceByte, 1, 1, SourceFile); + } } } - } - fprintf (OutputFile, "\n"); + fprintf (OutputFile, "\n"); + } } } else @@ -295,7 +324,16 @@ AePrintException ( if (Enode->LineNumber) { - fprintf (OutputFile, "(%u) : ", Enode->LineNumber); + if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_ASL) + { + fprintf (OutputFile, "(%u) i:%6u : ", + PrGetLineNumber (Enode->LineNumber), Enode->LineNumber); + } + else + { + fprintf (OutputFile, "(%u) i:%6u : ", + Enode->LineNumber, Enode->LineNumber); + } } } } @@ -421,6 +459,91 @@ AePrintErrorLog ( /******************************************************************************* * + * FUNCTION: AslCommonError2 + * + * PARAMETERS: Level - Seriousness (Warning/error, etc.) + * MessageId - Index into global message buffer + * LineNumber - Actual file line number + * Column - Column in current line + * SourceLine - Actual source code line + * Filename - source filename + * ExtraMessage - additional error message + * + * RETURN: None + * + * DESCRIPTION: Create a new error node and add it to the error log + * + ******************************************************************************/ + +void +AslCommonError2 ( + UINT8 Level, + UINT8 MessageId, + UINT32 LineNumber, + UINT32 Column, + char *SourceLine, + char *Filename, + char *ExtraMessage) +{ + char *MessageBuffer = NULL; + char *LineBuffer; + ASL_ERROR_MSG *Enode; + + + Enode = UtLocalCalloc (sizeof (ASL_ERROR_MSG)); + + if (ExtraMessage) + { + /* Allocate a buffer for the message and a new error node */ + + MessageBuffer = UtLocalCalloc (strlen (ExtraMessage) + 1); + + /* Keep a copy of the extra message */ + + ACPI_STRCPY (MessageBuffer, ExtraMessage); + } + + LineBuffer = UtLocalCalloc (strlen (SourceLine) + 1); + ACPI_STRCPY (LineBuffer, SourceLine); + + /* Initialize the error node */ + + if (Filename) + { + Enode->Filename = Filename; + Enode->FilenameLength = strlen (Filename); + if (Enode->FilenameLength < 6) + { + Enode->FilenameLength = 6; + } + } + + Enode->MessageId = MessageId; + Enode->Level = Level; + Enode->LineNumber = LineNumber; + Enode->LogicalLineNumber = LineNumber; + Enode->LogicalByteOffset = 0; + Enode->Column = Column; + Enode->Message = MessageBuffer; + Enode->SourceLine = LineBuffer; + + /* Add the new node to the error node list */ + + AeAddToErrorLog (Enode); + + if (Gbl_DebugFlag) + { + /* stderr is a file, send error to it immediately */ + + AePrintException (ASL_FILE_STDERR, Enode, NULL); + } + + Gbl_ExceptionCount[Level]++; +} + + +/******************************************************************************* + * * FUNCTION: AslCommonError * * PARAMETERS: Level - Seriousness (Warning/error, etc.) @@ -487,6 +610,7 @@ AslCommonError ( Enode->LogicalByteOffset = LogicalByteOffset; Enode->Column = Column; Enode->Message = MessageBuffer; + Enode->SourceLine = NULL; /* Add the new node to the error node list */ @@ -553,7 +677,6 @@ AslError ( break; } - if (Op) { AslCommonError (Level, MessageId, Op->Asl.LineNumber, @@ -643,5 +766,3 @@ AslCompilererror ( return 0; } - - Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Tue Mar 20 21:37:52 2012 (r233250) @@ -50,7 +50,7 @@ /* Local prototypes */ -static FILE * +FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, char *Filename); @@ -363,14 +363,13 @@ FlCloseFile ( } Error = fclose (Gbl_Files[FileId].Handle); - Gbl_Files[FileId].Handle = NULL; - if (Error) { FlFileError (FileId, ASL_MSG_CLOSE); AslAbort (); } + Gbl_Files[FileId].Handle = NULL; return; } @@ -478,7 +477,7 @@ FlAddIncludeDirectory ( * ******************************************************************************/ -static FILE * +FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, char *Filename) @@ -740,6 +739,13 @@ FlOpenMiscOutputFiles ( Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = freopen (Filename, "w+t", stderr); + if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle) + { + AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME, + 0, 0, 0, 0, NULL, NULL); + return (AE_ERROR); + } + AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT); } @@ -764,12 +770,26 @@ FlOpenMiscOutputFiles ( AslCompilerFileHeader (ASL_FILE_LISTING_OUTPUT); } + /* Create the preprocessor output file */ + + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_PREPROCESSOR); + if (!Filename) + { + AslCommonError (ASL_ERROR, ASL_MSG_PREPROCESSOR_FILENAME, + 0, 0, 0, 0, NULL, NULL); + return (AE_ERROR); + } + + FlOpenFile (ASL_FILE_PREPROCESSOR, Filename, "w+b"); + + /* All done for data table compiler */ + if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) { return (AE_OK); } - /* Create/Open a combined source output file */ + /* Create/Open a combined source output file */ Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE); if (!Filename) @@ -786,6 +806,10 @@ FlOpenMiscOutputFiles ( */ FlOpenFile (ASL_FILE_SOURCE_OUTPUT, Filename, "w+b"); +/* +// TBD: TEMP +// AslCompilerin = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle; +*/ /* Create/Open a assembly code source output file if asked */ if (Gbl_AsmOutputFlag) Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslglobal.h Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/compiler/aslglobal.h Tue Mar 20 21:37:52 2012 (r233250) @@ -70,10 +70,11 @@ extern int yyde extern FILE *AslCompilerin; extern int AslCompilerdebug; extern int DtParserdebug; +extern int PrParserdebug; extern const ASL_MAPPING_ENTRY AslKeywordMapping[]; extern char *AslCompilertext; -#define ASL_LINE_BUFFER_SIZE 1024 +#define ASL_LINE_BUFFER_SIZE 4096 #define ASL_MSG_BUFFER_SIZE 4096 #define HEX_TABLE_LINE_SIZE 8 #define HEX_LISTING_LINE_SIZE 8 @@ -88,22 +89,22 @@ ASL_EXTERN UINT32 ASL_ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, Gbl_CurrentLineBuffer); - /* Exception reporting */ ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_ErrorLog,NULL); ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_NextError,NULL); - /* Option flags */ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoCompile, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoSignon, TRUE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessOnly, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_Acpi2, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE); @@ -203,7 +204,7 @@ extern char AslH /* Event timing */ -#define ASL_NUM_EVENTS 19 +#define ASL_NUM_EVENTS 20 ASL_EXTERN ASL_EVENT_INFO AslGbl_Events[ASL_NUM_EVENTS]; ASL_EXTERN UINT8 AslGbl_NextEvent; ASL_EXTERN UINT8 AslGbl_NamespaceEvent; Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Tue Mar 20 20:37:23 2012 (r233249) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Tue Mar 20 21:37:52 2012 (r233250) @@ -96,7 +96,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^mno:p:r:s:t:T:G^v:w:x:z" +#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^mno|p:Pr:s|t|T:G^v|w|x:z" /******************************************************************************* @@ -120,6 +120,11 @@ Options ( ACPI_OPTION ("-@ ", "Specify command file"); ACPI_OPTION ("-I ", "Specify additional include directory"); + printf ("\nPreprocessor:\n"); + ACPI_OPTION ("-D ", "Define symbol for preprocessor use"); + ACPI_OPTION ("-li", "Create preprocessed output file (*.i)"); + ACPI_OPTION ("-P", "Preprocess only and create preprocessor output file (*.i)"); + printf ("\nGeneral Output:\n"); ACPI_OPTION ("-p ", "Specify path/filename prefix for all output files"); ACPI_OPTION ("-va", "Disable all errors and warnings (summary only)"); @@ -127,12 +132,12 @@ Options ( ACPI_OPTION ("-vo", "Enable optimization comments"); ACPI_OPTION ("-vr", "Disable remarks"); ACPI_OPTION ("-vs", "Disable signon"); - ACPI_OPTION ("-w <1|2|3>", "Set warning reporting level"); + ACPI_OPTION ("-w1 -w2 -w3", "Set warning reporting level"); printf ("\nAML Output Files:\n"); - ACPI_OPTION ("-s ", "Create AML in assembler or C source file (*.asm or *.c)"); - ACPI_OPTION ("-i ", "Create assembler or C include file (*.inc or *.h)"); - ACPI_OPTION ("-t ", "Create AML in assembler, C, or ASL hex table (*.hex)"); + ACPI_OPTION ("-sa -sc", "Create AML in assembler or C source file (*.asm or *.c)"); + ACPI_OPTION ("-ia -ic", "Create assembler or C include file (*.inc or *.h)"); + ACPI_OPTION ("-ta -tc -ts", "Create AML in assembler, C, or ASL hex table (*.hex)"); printf ("\nAML Code Generation:\n"); ACPI_OPTION ("-oa", "Disable all optimizations (compatibility mode)"); @@ -199,12 +204,12 @@ HelpMessage ( Options (); printf ("\nCompiler/Disassembler Debug Options:\n"); - ACPI_OPTION ("-b", "Create compiler debug/trace file (*.txt)"); + ACPI_OPTION ("-bb -bp -bt", "Create compiler debug/trace file (*.txt)"); ACPI_OPTION ("", "Types: Parse/Tree/Both"); ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)"); ACPI_OPTION ("-n", "Parse only, no output generation"); ACPI_OPTION ("-ot", "Display compile times"); - ACPI_OPTION ("-x", "Set debug level for trace output"); + ACPI_OPTION ("-x ", "Set debug level for trace output"); ACPI_OPTION ("-z", "Do not insert new compiler ID for DataTables"); } @@ -405,34 +410,34 @@ AslDoOptions ( if (IsResponseFile) { printf ("Nested command files are not supported\n"); - return -1; + return (-1); } if (AslDoResponseFile (AcpiGbl_Optarg)) { - return -1; + return (-1); } break; - case '2': - + case '2': /* ACPI 2.0 compatibility mode */ Gbl_Acpi2 = TRUE; break; - case 'b': - + case 'b': /* Debug output options */ switch (AcpiGbl_Optarg[0]) { case 'b': AslCompilerdebug = 1; /* same as yydebug */ DtParserdebug = 1; + PrParserdebug = 1; break; case 'p': AslCompilerdebug = 1; /* same as yydebug */ DtParserdebug = 1; + PrParserdebug = 1; break; case 't': @@ -463,7 +468,7 @@ AslDoOptions ( break; - case 'd': *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 21:41:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64C93106566B; Tue, 20 Mar 2012 21:41:11 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 52C088FC12; Tue, 20 Mar 2012 21:41:10 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so572157bkc.13 for ; Tue, 20 Mar 2012 14:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=wZaoQiszOTZU3PsqYjYTvxeyT7zfHVtm2Ve1WjqjqtM=; b=DcDKEnlFr/sMAfTTRgeCEUyT6NwpTP8sc6g8vpvz1ERFI+VQyvZimVtbhWtnUT/ram M2qpeH68NgGQieaeqpR5keQXY3cb+BNj/dv2qlKrPGEFILhWUy3SWmJEJNLW8tu7SPvr hea29hmzKd8ExcX2W7tBwVt740PABsg0i/sJ+x5JcQGVfJnwWQXZ/Vf407d8NeZr16Sl H6QpHYEyo3oxAqpTvpNgj39B+if7KqY1OKyR+lrd9BDk48WTpHJGYxDnq7jFsbqP+kaS TC2sIUKAzsREVeAIeIaGph40cR346+rHjwQw4Xg+bmK1k1q/vNBfmme7gQ1x3A1Z7QdW +0iA== Received: by 10.204.128.201 with SMTP id l9mr535037bks.90.1332279669255; Tue, 20 Mar 2012 14:41:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.202.142 with HTTP; Tue, 20 Mar 2012 14:40:39 -0700 (PDT) In-Reply-To: <201203201728.21049.jhb@freebsd.org> References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <201203201019.40486.jhb@freebsd.org> <201203201728.21049.jhb@freebsd.org> From: Chris Rees Date: Tue, 20 Mar 2012 21:40:39 +0000 Message-ID: To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 21:41:11 -0000 On 20 March 2012 21:28, John Baldwin wrote: > On Tuesday, March 20, 2012 5:20:04 pm Chris Rees wrote: >> On 20 March 2012 14:19, John Baldwin wrote: >> > On Monday, March 19, 2012 5:39:53 pm Doug Barton wrote: >> >> On 3/19/2012 12:37 PM, Dimitry Andric wrote: >> >> > It would be much nicer to be able to write: >> >> > >> >> > .if defined(FOO) >> >> > =A0 .if defined(BAR) >> >> > =A0 =A0 CFLAGS+=3D =A0 =A0 =A0 =A0-DFOO_BAR >> >> > =A0 .endif >> >> > .endif >> >> >> >> Take a look at /usr/ports/Mk/bsd.port.mk for how this can be done. >> > >> > Hmm, do yoo have a specific example? =A0The bits in I see in bsd.port.= mk > suffer >> > from the limitation Dimitry raises, e.g.: >> > >> > .if defined(OPTIONS) >> > # include OPTIONSFILE first if exists >> > . =A0 =A0 =A0 if exists(${OPTIONSFILE}) && !make(rmconfig) >> > . =A0 =A0 =A0 include "${OPTIONSFILE}" >> > . =A0 =A0 =A0 endif >> > . =A0 =A0 =A0 if exists(${OPTIONSFILE}.local) >> > . =A0 =A0 =A0 include "${OPTIONSFILE}.local" >> > . =A0 =A0 =A0 endif >> > WITHOUT:=3D >> > WITH:=3D >> > . =A0 =A0 =A0 if defined(OPTIONS) >> > REALOPTIONS=3D${OPTIONS:C/".*"//g} >> > . =A0 =A0 =A0 for O in ${REALOPTIONS} >> > RO:=3D${O} >> > . =A0 =A0 =A0 if ${RO:L} =3D=3D off >> > WITHOUT:=3D =A0 =A0 =A0 ${WITHOUT} ${OPT} >> > . =A0 =A0 =A0 endif >> > . =A0 =A0 =A0 if ${RO:L} =3D=3D on >> > WITH:=3D =A0 =A0 =A0 =A0 =A0${WITH} ${OPT} >> > . =A0 =A0 =A0 endif >> > OPT:=3D${RO} >> > . =A0 =A0 =A0 endfor >> > . =A0 =A0 =A0 endif >> > >> > That is, all the lines that don't start with a . are not indented, and >> > even this indentation is rather horrible (it doesn't nest, and it >> > has the odd structure of 'if defined(OPTIONS) { if defined(OPTIONS) {}= }'. >> >> I don't see how it's any more horrible than the kernel style's rules >> on indented #ifs (though I can see the reasoning for that) >> >> It's an unfortunate consequence of the fact that any line starting >> with whitespace must be a shell command-- from before Makefiles were >> allowed conditionals etc. >> >> It's got to be an improvement on: >> >> .if defined(ONE) >> .if !defined(TWO) >> .for one in two three four >> .if ${VAR} =3D=3D ${one} >> .if defined(VERBOSE) >> .warning VAR =3D one >> .endif >> .endif >> .endfor >> .elif ${VAR} =3D=3D four >> .if defined(VERBOSE) >> .warning VAR =3D four >> .endif >> .else >> .warning VAR is not four, and VERBOSE is ignored >> .endif =A0 =A0# XXXX Which one is this for?? >> .endif >> >> which is what a lot of the Makefiles look like... debugging if-less >> endifs etc is infinitely easier if we indent, however horrible it >> looks. >> >> We shouldn't be *trying* to make Makefiles hard to read ;) > > Oh, it may be that I was reading it in less or some such and that bsd.por= t.mk > requires 4 space tabs, so when viewed in things like less the indentation > doesn't actually look like indentation. =A0In that respect, this is no be= tter > than the above (and is what bsd.ports.mk looks like to me at least): > > . =A0 =A0 =A0if defined(ONE) > . =A0 =A0 =A0if !defined(TWO) > . =A0 =A0 =A0for one in two three four > > etc. =A0To be worthwhile the spacing has to actually look like indentatio= n: > > .if defined(ONE) > . =A0if !defined(TWO) > . =A0 =A0for one in two three four > > etc. Yes-- it'd be nice if less could read the ex:ts=3D4 bit. That can go on my todo list. Chris From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 00:13:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D9F0106564A; Wed, 21 Mar 2012 00:13:07 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id A9BB48FC0C; Wed, 21 Mar 2012 00:13:06 +0000 (UTC) Received: from ur.dons.net.au (ppp118-210-218-84.lns20.adl6.internode.on.net [118.210.218.84]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id q2L099AG057501 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 21 Mar 2012 10:39:15 +1030 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: "Daniel O'Connor" In-Reply-To: Date: Wed, 21 Mar 2012 10:39:08 +1030 Content-Transfer-Encoding: quoted-printable Message-Id: <22E45C0B-F32A-4689-AD3A-E72826236F4A@gsoft.com.au> References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <201203201019.40486.jhb@freebsd.org> <201203201728.21049.jhb@freebsd.org> To: Chris Rees X-Mailer: Apple Mail (2.1257) X-Spam-Score: 2.162 (**) BAYES_00,KHOP_DYNAMIC,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 00:13:07 -0000 On 21/03/2012, at 8:10, Chris Rees wrote: > Yes-- it'd be nice if less could read the ex:ts=3D4 bit. >=20 > That can go on my todo list. Are you going to teach it emacs commands for the same? ;) IMO any file which wants to be viewed with tabs !=3D 8 spaces is broken. The extra cost of disk to store 4 spaces for your odd number of indent = lines is trivial.. I understand that bsd.port.mk and friends have legacy and that is fine = but I don't think it's a good precedent to use when indenting other = makefiles (which is a great idea IMO) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 00:48:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CC83106566C; Wed, 21 Mar 2012 00:48:37 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id 2511E8FC16; Wed, 21 Mar 2012 00:48:37 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id E383C56209; Tue, 20 Mar 2012 19:48:36 -0500 (CDT) Date: Tue, 20 Mar 2012 19:48:36 -0500 From: Mark Linimon To: John Baldwin Message-ID: <20120321004836.GB30795@lonesome.com> References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <201203201019.40486.jhb@freebsd.org> <201203201728.21049.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203201728.21049.jhb@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Doug Barton , svn-src-all@freebsd.org, Dimitry Andric , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Chris Rees Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 00:48:37 -0000 The style in bsd.port.mk is not consistent. (I know, this is shocking for something that's at r1.706.) Here's what I recall seeing in it, that I found readable: .if defined(USE_GL) . if ${USE_GL:L} == "yes" USE_GL= glu . endif . for _component in ${USE_GL} . if !defined(_GL_${_component}_LIB_DEPENDS) && \ !defined(_GL_${_component}_RUN_DEPENDS) IGNORE= uses unknown GL component . else LIB_DEPENDS+= ${_GL_${_component}_LIB_DEPENDS} RUN_DEPENDS+= ${_GL_${_component}_RUN_DEPENDS} . endif . endfor .endif Various other bits of ports/Mk/*.mk use this same indentation; others use two spaces, tabs, ... Unfortunately the counter-argument of "let's just go fix it to have one style" is all the patches against bsd.port.mk that would then no longer apply. Personally, I'd like to see us pick a "recommended way for new code", whether it's one or two spaces, whatever. (8 spaces seems too much.) mcl From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 01:17:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DD10106564A; Wed, 21 Mar 2012 01:17:55 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id DD4678FC0A; Wed, 21 Mar 2012 01:17:54 +0000 (UTC) Received: from ur.dons.net.au (ppp118-210-218-84.lns20.adl6.internode.on.net [118.210.218.84]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id q2L1HhEC066052 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 21 Mar 2012 11:47:49 +1030 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <20120321004836.GB30795@lonesome.com> Date: Wed, 21 Mar 2012 11:47:42 +1030 Content-Transfer-Encoding: quoted-printable Message-Id: <373E5B77-704B-4E40-BBAB-10A54BA3A6E5@gsoft.com.au> References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <201203201019.40486.jhb@freebsd.org> <201203201728.21049.jhb@freebsd.org> <20120321004836.GB30795@lonesome.com> To: Mark Linimon X-Mailer: Apple Mail (2.1257) X-Spam-Score: 2.162 (**) BAYES_00,KHOP_DYNAMIC,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: Doug Barton , John Baldwin , svn-src-all@freebsd.org, Dimitry Andric , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Chris Rees Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 01:17:55 -0000 On 21/03/2012, at 11:18, Mark Linimon wrote: > Personally, I'd like to see us pick a "recommended way for new code", > whether it's one or two spaces, whatever. (8 spaces seems too much.) 2 space indents are fine IMO, but they are spaces. A tab character should be viewed as 8 spaces wide, but that doesn't = force you to have 8 space wide indents. If you change tab width then you need to teach each editor and viewer = that could possibly read your file what that width is, which is = basically an impossible task. Yes using just spaces, or coalescing 8 spaces into a tab uses more disk = space than just tabs, but that amounts to sweet FA these days. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 03:19:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93C8F1065673; Wed, 21 Mar 2012 03:19:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EB198FC0A; Wed, 21 Mar 2012 03:19:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L3JpSP051162; Wed, 21 Mar 2012 03:19:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L3Jp2G051160; Wed, 21 Mar 2012 03:19:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203210319.q2L3Jp2G051160@svn.freebsd.org> From: Adrian Chadd Date: Wed, 21 Mar 2012 03:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233255 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 03:19:51 -0000 Author: adrian Date: Wed Mar 21 03:19:50 2012 New Revision: 233255 URL: http://svn.freebsd.org/changeset/base/233255 Log: Re-commit this - store the alq payload in network order. Modified: head/sys/net80211/ieee80211_alq.c Modified: head/sys/net80211/ieee80211_alq.c ============================================================================== --- head/sys/net80211/ieee80211_alq.c Wed Mar 21 03:13:25 2012 (r233254) +++ head/sys/net80211/ieee80211_alq.c Wed Mar 21 03:19:50 2012 (r233255) @@ -152,7 +152,7 @@ ieee80211_alq_log(struct ieee80211vap *v r->r_version = 1; r->r_wlan = htons(vap->iv_ifp->if_dunit); r->r_op = op; - r->r_threadid = (uint32_t) curthread->td_tid; + r->r_threadid = htonl((uint32_t) curthread->td_tid); memcpy(&r->r_payload, p, MIN(l, sizeof(r->r_payload))); alq_post(ieee80211_alq, ale); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 04:00:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A53CE1065673; Wed, 21 Mar 2012 04:00:59 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FC628FC14; Wed, 21 Mar 2012 04:00:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L40xsq052917; Wed, 21 Mar 2012 04:00:59 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L40xtO052913; Wed, 21 Mar 2012 04:00:59 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201203210400.q2L40xtO052913@svn.freebsd.org> From: Alan Cox Date: Wed, 21 Mar 2012 04:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233256 - in head/sys: amd64/amd64 amd64/conf conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 04:00:59 -0000 Author: alc Date: Wed Mar 21 04:00:58 2012 New Revision: 233256 URL: http://svn.freebsd.org/changeset/base/233256 Log: Eliminate vm.pmap.shpgperproc and vm.pmap.pv_entry_max because they no longer serve any purpose. Prior to r157446, they served a purpose because there was a fixed amount of kernel virtual address space reserved for pv entries at boot time. However, since that change pv entries are accessed through the direct map, and so there is no limit imposed by a fixed amount of kernel virtual address space. Fix a couple of nearby style issues. Reviewed by: jhb, kib MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/conf/NOTES head/sys/conf/options.amd64 Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Mar 21 03:19:50 2012 (r233255) +++ head/sys/amd64/amd64/pmap.c Wed Mar 21 04:00:58 2012 (r233256) @@ -148,10 +148,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifndef PMAP_SHPGPERPROC -#define PMAP_SHPGPERPROC 200 -#endif - #if !defined(DIAGNOSTIC) #ifdef __GNUC_GNU_INLINE__ #define PMAP_INLINE __attribute__((__gnu_inline__)) inline @@ -206,9 +202,8 @@ static u_int64_t DMPDPphys; /* phys addr /* * Data for the pv entry allocation mechanism */ -static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0; +static int pv_entry_count; static struct md_page *pv_table; -static int shpgperproc = PMAP_SHPGPERPROC; /* * All those kernel PT submaps that BSD is so fond of @@ -222,7 +217,7 @@ caddr_t CADDR1 = 0; static caddr_t crashdumpmap; static void free_pv_entry(pmap_t pmap, pv_entry_t pv); -static pv_entry_t get_pv_entry(pmap_t locked_pmap, int try); +static pv_entry_t get_pv_entry(pmap_t locked_pmap, boolean_t try); static void pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); static boolean_t pmap_pv_insert_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); static void pmap_pv_promote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); @@ -731,16 +726,6 @@ pmap_init(void) } /* - * Initialize the address space (zone) for the pv entries. Set a - * high water mark so that the system can recover from excessive - * numbers of pv entries. - */ - TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; - TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); - pv_entry_high_water = 9 * (pv_entry_max / 10); - - /* * If the kernel is running in a virtual machine on an AMD Family 10h * processor, then it must assume that MCA is enabled by the virtual * machine monitor. @@ -775,36 +760,6 @@ pmap_init(void) TAILQ_INIT(&pv_table[i].pv_list); } -static int -pmap_pventry_proc(SYSCTL_HANDLER_ARGS) -{ - int error; - - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0 && req->newptr) { - shpgperproc = (pv_entry_max - cnt.v_page_count) / maxproc; - pv_entry_high_water = 9 * (pv_entry_max / 10); - } - return (error); -} -SYSCTL_PROC(_vm_pmap, OID_AUTO, pv_entry_max, CTLTYPE_INT|CTLFLAG_RW, - &pv_entry_max, 0, pmap_pventry_proc, "IU", "Max number of PV entries"); - -static int -pmap_shpgperproc_proc(SYSCTL_HANDLER_ARGS) -{ - int error; - - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0 && req->newptr) { - pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; - pv_entry_high_water = 9 * (pv_entry_max / 10); - } - return (error); -} -SYSCTL_PROC(_vm_pmap, OID_AUTO, shpgperproc, CTLTYPE_INT|CTLFLAG_RW, - &shpgperproc, 0, pmap_shpgperproc_proc, "IU", "Page share factor per proc"); - static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, "2MB page mapping counters"); @@ -2184,10 +2139,8 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv * when needed. */ static pv_entry_t -get_pv_entry(pmap_t pmap, int try) +get_pv_entry(pmap_t pmap, boolean_t try) { - static const struct timeval printinterval = { 60, 0 }; - static struct timeval lastprint; struct vpgqueues *pq; int bit, field; pv_entry_t pv; @@ -2197,12 +2150,6 @@ get_pv_entry(pmap_t pmap, int try) PMAP_LOCK_ASSERT(pmap, MA_OWNED); mtx_assert(&vm_page_queue_mtx, MA_OWNED); PV_STAT(pv_entry_allocs++); - pv_entry_count++; - if (pv_entry_count > pv_entry_high_water) - if (ratecheck(&lastprint, &printinterval)) - printf("Approaching the limit on PV entries, consider " - "increasing either the vm.pmap.shpgperproc or the " - "vm.pmap.pv_entry_max sysctl.\n"); pq = NULL; retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); @@ -2220,8 +2167,10 @@ retry: if (pc->pc_map[0] == 0 && pc->pc_map[1] == 0 && pc->pc_map[2] == 0) { TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); - TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, + pc_list); } + pv_entry_count++; PV_STAT(pv_entry_spare--); return (pv); } @@ -2232,7 +2181,6 @@ retry: VM_ALLOC_WIRED); if (m == NULL) { if (try) { - pv_entry_count--; PV_STAT(pc_chunk_tryfail++); return (NULL); } @@ -2248,7 +2196,7 @@ retry: PV_STAT(pmap_collect_active++); pq = &vm_page_queues[PQ_ACTIVE]; } else - panic("get_pv_entry: increase vm.pmap.shpgperproc"); + panic("get_pv_entry: allocation failed"); pmap_collect(pmap, pq); goto retry; } @@ -2262,6 +2210,7 @@ retry: pc->pc_map[2] = PC_FREE2; pv = &pc->pc_pventry[0]; TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); + pv_entry_count++; PV_STAT(pv_entry_spare += _NPCPV - 1); return (pv); } @@ -2419,8 +2368,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm PMAP_LOCK_ASSERT(pmap, MA_OWNED); mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if (pv_entry_count < pv_entry_high_water && - (pv = get_pv_entry(pmap, TRUE)) != NULL) { + if ((pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); return (TRUE); @@ -2438,8 +2386,7 @@ pmap_pv_insert_pde(pmap_t pmap, vm_offse pv_entry_t pv; mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if (pv_entry_count < pv_entry_high_water && - (pv = get_pv_entry(pmap, TRUE)) != NULL) { + if ((pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; pvh = pa_to_pvh(pa); TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_list); Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Wed Mar 21 03:19:50 2012 (r233255) +++ head/sys/amd64/conf/NOTES Wed Mar 21 04:00:58 2012 (r233256) @@ -493,19 +493,6 @@ device cpuctl options ENABLE_ALART # Control alarm on Intel intpm driver # -# Set the number of PV entries per process. Increasing this can -# stop panics related to heavy use of shared memory. However, that can -# (combined with large amounts of physical memory) cause panics at -# boot time due the kernel running out of VM space. -# -# If you're tweaking this, you might also want to increase the sysctls -# "vm.v_free_min", "vm.v_free_reserved", and "vm.v_free_target". -# -# The value below is the one more than the default. -# -options PMAP_SHPGPERPROC=201 - -# # Number of initial kernel page table pages used for early bootstrap. # This number should include enough pages to map the kernel and any # modules or other data loaded with the kernel by the loader. Each Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Wed Mar 21 03:19:50 2012 (r233255) +++ head/sys/conf/options.amd64 Wed Mar 21 04:00:58 2012 (r233256) @@ -7,7 +7,6 @@ COUNT_XINVLTLB_HITS opt_smp.h COUNT_IPIS opt_smp.h MAXMEM PERFMON -PMAP_SHPGPERPROC opt_pmap.h MPTABLE_FORCE_HTT MP_WATCHDOG NKPT opt_pmap.h From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 04:22:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id E0C5F1065674; Wed, 21 Mar 2012 04:22:48 +0000 (UTC) Date: Wed, 21 Mar 2012 04:22:48 +0000 From: Alexey Dokuchaev To: Mark Linimon Message-ID: <20120321042248.GA9062@FreeBSD.org> References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <201203201019.40486.jhb@freebsd.org> <201203201728.21049.jhb@freebsd.org> <20120321004836.GB30795@lonesome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120321004836.GB30795@lonesome.com> User-Agent: Mutt/1.4.2.1i Cc: Doug Barton , John Baldwin , svn-src-all@freebsd.org, Dimitry Andric , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Chris Rees Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 04:22:49 -0000 On Tue, Mar 20, 2012 at 07:48:36PM -0500, Mark Linimon wrote: > Personally, I'd like to see us pick a "recommended way for new code", > whether it's one or two spaces, whatever. (8 spaces seems too much.) +1. I always hesitate between one or two spaces; but last time I recall I was using one. If people agree on two, let it be so. But please don't make it four or even eight, as the distance from the leading dot starts getting annoying at these extremities. ./danfe From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 06:51:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCF961065673; Wed, 21 Mar 2012 06:51:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C85B68FC17; Wed, 21 Mar 2012 06:51:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L6pjWM058276; Wed, 21 Mar 2012 06:51:45 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L6pjpG058274; Wed, 21 Mar 2012 06:51:45 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203210651.q2L6pjpG058274@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 21 Mar 2012 06:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233257 - head/usr.sbin/newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 06:51:46 -0000 Author: glebius Date: Wed Mar 21 06:51:45 2012 New Revision: 233257 URL: http://svn.freebsd.org/changeset/base/233257 Log: Don't run through time checks when entry is definitely oversized. This leads to newsyslog rotating on (size OR time) if both are specified. PR: 100018, 160432 Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Wed Mar 21 04:00:58 2012 (r233256) +++ head/usr.sbin/newsyslog/newsyslog.c Wed Mar 21 06:51:45 2012 (r233257) @@ -484,12 +484,14 @@ do_entry(struct conf_entry * ent) fk_entry free_or_keep; double diffsecs; char temp_reason[REASON_MAX]; + int oversized; free_or_keep = FREE_ENT; if (verbose) printf("%s <%d%s>: ", ent->log, ent->numlogs, compress_type[ent->compress].flag); ent->fsize = sizefile(ent->log); + oversized = ((ent->trsize > 0) && (ent->fsize >= ent->trsize)); modtime = age_old_log(ent->log); ent->rotate = 0; ent->firstcreate = 0; @@ -518,7 +520,8 @@ do_entry(struct conf_entry * ent) printf("does not exist, skipped%s.\n", temp_reason); } } else { - if (ent->flags & CE_TRIMAT && !force && !rotatereq) { + if (ent->flags & CE_TRIMAT && !force && !rotatereq && + !oversized) { diffsecs = ptimeget_diff(timenow, ent->trim_at); if (diffsecs < 0.0) { /* trim_at is some time in the future. */ @@ -574,7 +577,7 @@ do_entry(struct conf_entry * ent) } else if (force) { ent->rotate = 1; snprintf(temp_reason, REASON_MAX, " due to -F request"); - } else if ((ent->trsize > 0) && (ent->fsize >= ent->trsize)) { + } else if (oversized) { ent->rotate = 1; snprintf(temp_reason, REASON_MAX, " due to size>%dK", ent->trsize); From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 07:02:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C29FF106564A; Wed, 21 Mar 2012 07:02:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE7B38FC14; Wed, 21 Mar 2012 07:02:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L72H8s058664; Wed, 21 Mar 2012 07:02:17 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L72H0l058662; Wed, 21 Mar 2012 07:02:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203210702.q2L72H0l058662@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 21 Mar 2012 07:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233258 - head/usr.sbin/newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 07:02:17 -0000 Author: glebius Date: Wed Mar 21 07:02:17 2012 New Revision: 233258 URL: http://svn.freebsd.org/changeset/base/233258 Log: Fix a sentence in a paragraph that describes time and interval based trimming. This sentence vaguely can be interpreted as if it was speaking about time and size interaction, while it wasn't about it. Modified: head/usr.sbin/newsyslog/newsyslog.conf.5 Modified: head/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.conf.5 Wed Mar 21 06:51:45 2012 (r233257) +++ head/usr.sbin/newsyslog/newsyslog.conf.5 Wed Mar 21 07:02:17 2012 (r233258) @@ -21,7 +21,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd February 25, 2011 +.Dd March 21, 2012 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -130,7 +130,7 @@ Additionally, the format may also be con sign along with a rotation time specification of once a day, once a week, or once a month. .Pp -If a time is specified, the log file will only be trimmed if +Time based trimming happens only if .Xr newsyslog 8 is run within one hour of the specified time. If an interval is specified, the log file will be trimmed if that many From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 07:05:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCB5A106564A; Wed, 21 Mar 2012 07:05:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D8938FC17; Wed, 21 Mar 2012 07:05:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L75UXM058805; Wed, 21 Mar 2012 07:05:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L75UbS058802; Wed, 21 Mar 2012 07:05:30 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203210705.q2L75UbS058802@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 21 Mar 2012 07:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233259 - in stable/9/usr.sbin: ypbind ypserv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 07:05:30 -0000 Author: glebius Date: Wed Mar 21 07:05:29 2012 New Revision: 233259 URL: http://svn.freebsd.org/changeset/base/233259 Log: Merge 226690 and 226725 from head: Protect NIS client with madvise(2) since this daemon is required for succesful authentication of users. Protect NIS server with madvise(2) since this daemon is required for succesful authentication of users. Modified: stable/9/usr.sbin/ypbind/ypbind.c stable/9/usr.sbin/ypserv/yp_main.c Directory Properties: stable/9/usr.sbin/ypbind/ (props changed) stable/9/usr.sbin/ypserv/ (props changed) Modified: stable/9/usr.sbin/ypbind/ypbind.c ============================================================================== --- stable/9/usr.sbin/ypbind/ypbind.c Wed Mar 21 07:02:17 2012 (r233258) +++ stable/9/usr.sbin/ypbind/ypbind.c Wed Mar 21 07:05:29 2012 (r233259) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -465,6 +466,9 @@ main(int argc, char *argv[]) openlog(argv[0], LOG_PID, LOG_DAEMON); + if (madvise(NULL, 0, MADV_PROTECT) != 0) + syslog(LOG_WARNING, "madvise(): %m"); + /* Kick off the default domain */ broadcast(ypbindlist); Modified: stable/9/usr.sbin/ypserv/yp_main.c ============================================================================== --- stable/9/usr.sbin/ypserv/yp_main.c Wed Mar 21 07:02:17 2012 (r233258) +++ stable/9/usr.sbin/ypserv/yp_main.c Wed Mar 21 07:05:29 2012 (r233259) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include @@ -526,6 +527,9 @@ main(int argc, char *argv[]) unregister(); } + if (madvise(NULL, 0, MADV_PROTECT) != 0) + _msgout("madvise(): %s", strerror(errno)); + /* * Create RPC service for each transport. */ From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 07:07:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D582106564A; Wed, 21 Mar 2012 07:07:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DE6A8FC08; Wed, 21 Mar 2012 07:07:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L77hv9058947; Wed, 21 Mar 2012 07:07:43 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L77hZp058945; Wed, 21 Mar 2012 07:07:43 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203210707.q2L77hZp058945@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 21 Mar 2012 07:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233261 - in stable/9/sys: i386/conf netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 07:07:44 -0000 Author: glebius Date: Wed Mar 21 07:07:43 2012 New Revision: 233261 URL: http://svn.freebsd.org/changeset/base/233261 Log: Merge 227308 from head/: In icmp6_redirect_input: - Assert that we got a valid mbuf with rcvif pointer. [1] - Use __func__ in logging. Submitted by: prabhakar lakhera [1] Submitted by: Kristof Provost [1] Modified: stable/9/sys/netinet6/icmp6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/netinet6/icmp6.c ============================================================================== --- stable/9/sys/netinet6/icmp6.c Wed Mar 21 07:07:00 2012 (r233260) +++ stable/9/sys/netinet6/icmp6.c Wed Mar 21 07:07:43 2012 (r233261) @@ -2361,14 +2361,11 @@ icmp6_redirect_input(struct mbuf *m, int union nd_opts ndopts; char ip6buf[INET6_ADDRSTRLEN]; - if (!m) - return; + M_ASSERTPKTHDR(m); + KASSERT(m->m_pkthdr.rcvif != NULL, ("%s: no rcvif", __func__)); ifp = m->m_pkthdr.rcvif; - if (!ifp) - return; - /* XXX if we are router, we don't update route by icmp6 redirect */ if (V_ip6_forwarding) goto freeit; @@ -2475,9 +2472,8 @@ icmp6_redirect_input(struct mbuf *m, int icmp6len -= sizeof(*nd_rd); nd6_option_init(nd_rd + 1, icmp6len, &ndopts); if (nd6_options(&ndopts) < 0) { - nd6log((LOG_INFO, "icmp6_redirect_input: " - "invalid ND option, rejected: %s\n", - icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); + nd6log((LOG_INFO, "%s: invalid ND option, rejected: %s\n", + __func__, icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); /* nd6_options have incremented stats */ goto freeit; } @@ -2488,10 +2484,9 @@ icmp6_redirect_input(struct mbuf *m, int } if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) { - nd6log((LOG_INFO, - "icmp6_redirect_input: lladdrlen mismatch for %s " + nd6log((LOG_INFO, "%s: lladdrlen mismatch for %s " "(if %d, icmp6 packet %d): %s\n", - ip6_sprintf(ip6buf, &redtgt6), + __func__, ip6_sprintf(ip6buf, &redtgt6), ifp->if_addrlen, lladdrlen - 2, icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); goto bad; From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 07:12:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15D57106566C; Wed, 21 Mar 2012 07:12:53 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB0888FC08; Wed, 21 Mar 2012 07:12:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L7CqSC059191; Wed, 21 Mar 2012 07:12:52 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L7Cqs1059189; Wed, 21 Mar 2012 07:12:52 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201203210712.q2L7Cqs1059189@svn.freebsd.org> From: David Xu Date: Wed, 21 Mar 2012 07:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233262 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 07:12:53 -0000 Author: davidxu Date: Wed Mar 21 07:12:52 2012 New Revision: 233262 URL: http://svn.freebsd.org/changeset/base/233262 Log: Use version 2 of semaphore provided by kernel umtx code, now if there is no waiters, we still increase and decrease count in user mode without entering kernel, once there is a waiter, sem_post will enter kernel to increase count and wake thread up, this is atomicy and allow us to gracefully destroy semaphore after sem_wait returned. Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Wed Mar 21 07:07:43 2012 (r233261) +++ head/lib/libc/gen/sem_new.c Wed Mar 21 07:12:52 2012 (r233262) @@ -61,7 +61,8 @@ __weak_reference(_sem_unlink, sem_unlink __weak_reference(_sem_wait, sem_wait); #define SEM_PREFIX "/tmp/SEMD" -#define SEM_MAGIC ((u_int32_t)0x73656d31) +#define SEM_MAGIC1 ((u_int32_t)0x73656d31) +#define SEM_MAGIC ((u_int32_t)0x73656d32) struct sem_nameinfo { int open_count; @@ -109,7 +110,7 @@ static inline int sem_check_validity(sem_t *sem) { - if (sem->_magic == SEM_MAGIC) + if (sem->_magic == SEM_MAGIC || sem->_magic == SEM_MAGIC1) return (0); else { errno = EINVAL; @@ -130,7 +131,7 @@ _sem_init(sem_t *sem, int pshared, unsig sem->_magic = SEM_MAGIC; sem->_kern._count = (u_int32_t)value; sem->_kern._has_waiters = 0; - sem->_kern._flags = pshared ? USYNC_PROCESS_SHARED : 0; + sem->_kern._flags = (pshared ? USYNC_PROCESS_SHARED : 0) | SEM_VER2; return (0); } @@ -207,7 +208,7 @@ _sem_open(const char *name, int flags, . tmp._magic = SEM_MAGIC; tmp._kern._has_waiters = 0; tmp._kern._count = value; - tmp._kern._flags = USYNC_PROCESS_SHARED | SEM_NAMED; + tmp._kern._flags = USYNC_PROCESS_SHARED | SEM_NAMED | SEM_VER2; if (_write(fd, &tmp, sizeof(tmp)) != sizeof(tmp)) { flock(fd, LOCK_UN); goto error; @@ -325,20 +326,11 @@ _sem_getvalue(sem_t * __restrict sem, in if (sem_check_validity(sem) != 0) return (-1); - *sval = (int)sem->_kern._count; + *sval = (int)sem->_kern._count & ~SEM_WAITERS; return (0); } static __inline int -usem_wake(struct _usem *sem) -{ - rmb(); - if (!sem->_has_waiters) - return (0); - return _umtx_op(sem, UMTX_OP_SEM_WAKE, 0, NULL, NULL); -} - -static __inline int usem_wait(struct _usem *sem, const struct timespec *abstime) { struct _umtx_time *tm_p, timeout; @@ -358,48 +350,51 @@ usem_wait(struct _usem *sem, const struc (void *)tm_size, __DECONST(void*, tm_p)); } +static inline int +_trywait(sem_t *sem) +{ + int count; + + if ((sem->_kern._flags & SEM_VER2) != 0) { + while (((count = sem->_kern._count) & ~SEM_WAITERS) > 0) { + if (atomic_cmpset_acq_int(&sem->_kern._count, count, count - 1)) + return (0); + } + } else { + while ((count = sem->_kern._count) > 0) { + if (atomic_cmpset_acq_int(&sem->_kern._count, count, count - 1)) + return (0); + } + } + return (EAGAIN); +} + int _sem_trywait(sem_t *sem) { - int val; + int status; if (sem_check_validity(sem) != 0) return (-1); - - while ((val = sem->_kern._count) > 0) { - if (atomic_cmpset_acq_int(&sem->_kern._count, val, val - 1)) - return (0); - } - errno = EAGAIN; + if ((status = _trywait(sem)) == 0) + return (0); + errno = status; return (-1); } -#define TIMESPEC_SUB(dst, src, val) \ - do { \ - (dst)->tv_sec = (src)->tv_sec - (val)->tv_sec; \ - (dst)->tv_nsec = (src)->tv_nsec - (val)->tv_nsec; \ - if ((dst)->tv_nsec < 0) { \ - (dst)->tv_sec--; \ - (dst)->tv_nsec += 1000000000; \ - } \ - } while (0) - - int _sem_timedwait(sem_t * __restrict sem, const struct timespec * __restrict abstime) { - int val, retval; + int retval; if (sem_check_validity(sem) != 0) return (-1); retval = 0; for (;;) { - while ((val = sem->_kern._count) > 0) { - if (atomic_cmpset_acq_int(&sem->_kern._count, val, val - 1)) - return (0); - } + if (_trywait(sem) == 0) + return (0); if (retval) { _pthread_testcancel(); @@ -438,10 +433,36 @@ _sem_wait(sem_t *sem) int _sem_post(sem_t *sem) { + int count; if (sem_check_validity(sem) != 0) return (-1); - atomic_add_rel_int(&sem->_kern._count, 1); - return usem_wake(&sem->_kern); + if ((sem->_kern._flags & SEM_VER2) != 0) { + for (;;) { + count = sem->_kern._count; + if ((count & SEM_WAITERS) == 0) { + if (__predict_false(count == SEM_VALUE_MAX)) { + errno = ERANGE; + return (-1); + } + if (atomic_cmpset_rel_int(&sem->_kern._count, count, count+1)) + return (0); + } else { + return _umtx_op(&sem->_kern, UMTX_OP_SEM_WAKE, 0, NULL, NULL); + } + } + } else { + do { + count = sem->_kern._count; + if (__predict_false(count == SEM_VALUE_MAX)) { + errno = ERANGE; + return (-1); + } + } while (!atomic_cmpset_rel_int(&sem->_kern._count, count, count+1)); + rmb(); + if (!sem->_kern._has_waiters) + return (0); + return _umtx_op(&sem->_kern, UMTX_OP_SEM_WAKE, 0, NULL, NULL); + } } From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 07:16:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3F98106566B; Wed, 21 Mar 2012 07:16:59 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A60E8FC0A; Wed, 21 Mar 2012 07:16:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L7Gx3I059368; Wed, 21 Mar 2012 07:16:59 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L7Gxbi059366; Wed, 21 Mar 2012 07:16:59 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201203210716.q2L7Gxbi059366@svn.freebsd.org> From: David Xu Date: Wed, 21 Mar 2012 07:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233263 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 07:16:59 -0000 Author: davidxu Date: Wed Mar 21 07:16:58 2012 New Revision: 233263 URL: http://svn.freebsd.org/changeset/base/233263 Log: Revert previous change. It is an incomplete change from old branch. :-( Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Wed Mar 21 07:12:52 2012 (r233262) +++ head/lib/libc/gen/sem_new.c Wed Mar 21 07:16:58 2012 (r233263) @@ -61,8 +61,7 @@ __weak_reference(_sem_unlink, sem_unlink __weak_reference(_sem_wait, sem_wait); #define SEM_PREFIX "/tmp/SEMD" -#define SEM_MAGIC1 ((u_int32_t)0x73656d31) -#define SEM_MAGIC ((u_int32_t)0x73656d32) +#define SEM_MAGIC ((u_int32_t)0x73656d31) struct sem_nameinfo { int open_count; @@ -110,7 +109,7 @@ static inline int sem_check_validity(sem_t *sem) { - if (sem->_magic == SEM_MAGIC || sem->_magic == SEM_MAGIC1) + if (sem->_magic == SEM_MAGIC) return (0); else { errno = EINVAL; @@ -131,7 +130,7 @@ _sem_init(sem_t *sem, int pshared, unsig sem->_magic = SEM_MAGIC; sem->_kern._count = (u_int32_t)value; sem->_kern._has_waiters = 0; - sem->_kern._flags = (pshared ? USYNC_PROCESS_SHARED : 0) | SEM_VER2; + sem->_kern._flags = pshared ? USYNC_PROCESS_SHARED : 0; return (0); } @@ -208,7 +207,7 @@ _sem_open(const char *name, int flags, . tmp._magic = SEM_MAGIC; tmp._kern._has_waiters = 0; tmp._kern._count = value; - tmp._kern._flags = USYNC_PROCESS_SHARED | SEM_NAMED | SEM_VER2; + tmp._kern._flags = USYNC_PROCESS_SHARED | SEM_NAMED; if (_write(fd, &tmp, sizeof(tmp)) != sizeof(tmp)) { flock(fd, LOCK_UN); goto error; @@ -326,11 +325,20 @@ _sem_getvalue(sem_t * __restrict sem, in if (sem_check_validity(sem) != 0) return (-1); - *sval = (int)sem->_kern._count & ~SEM_WAITERS; + *sval = (int)sem->_kern._count; return (0); } static __inline int +usem_wake(struct _usem *sem) +{ + rmb(); + if (!sem->_has_waiters) + return (0); + return _umtx_op(sem, UMTX_OP_SEM_WAKE, 0, NULL, NULL); +} + +static __inline int usem_wait(struct _usem *sem, const struct timespec *abstime) { struct _umtx_time *tm_p, timeout; @@ -350,51 +358,48 @@ usem_wait(struct _usem *sem, const struc (void *)tm_size, __DECONST(void*, tm_p)); } -static inline int -_trywait(sem_t *sem) -{ - int count; - - if ((sem->_kern._flags & SEM_VER2) != 0) { - while (((count = sem->_kern._count) & ~SEM_WAITERS) > 0) { - if (atomic_cmpset_acq_int(&sem->_kern._count, count, count - 1)) - return (0); - } - } else { - while ((count = sem->_kern._count) > 0) { - if (atomic_cmpset_acq_int(&sem->_kern._count, count, count - 1)) - return (0); - } - } - return (EAGAIN); -} - int _sem_trywait(sem_t *sem) { - int status; + int val; if (sem_check_validity(sem) != 0) return (-1); - if ((status = _trywait(sem)) == 0) - return (0); - errno = status; + + while ((val = sem->_kern._count) > 0) { + if (atomic_cmpset_acq_int(&sem->_kern._count, val, val - 1)) + return (0); + } + errno = EAGAIN; return (-1); } +#define TIMESPEC_SUB(dst, src, val) \ + do { \ + (dst)->tv_sec = (src)->tv_sec - (val)->tv_sec; \ + (dst)->tv_nsec = (src)->tv_nsec - (val)->tv_nsec; \ + if ((dst)->tv_nsec < 0) { \ + (dst)->tv_sec--; \ + (dst)->tv_nsec += 1000000000; \ + } \ + } while (0) + + int _sem_timedwait(sem_t * __restrict sem, const struct timespec * __restrict abstime) { - int retval; + int val, retval; if (sem_check_validity(sem) != 0) return (-1); retval = 0; for (;;) { - if (_trywait(sem) == 0) - return (0); + while ((val = sem->_kern._count) > 0) { + if (atomic_cmpset_acq_int(&sem->_kern._count, val, val - 1)) + return (0); + } if (retval) { _pthread_testcancel(); @@ -433,36 +438,10 @@ _sem_wait(sem_t *sem) int _sem_post(sem_t *sem) { - int count; if (sem_check_validity(sem) != 0) return (-1); - if ((sem->_kern._flags & SEM_VER2) != 0) { - for (;;) { - count = sem->_kern._count; - if ((count & SEM_WAITERS) == 0) { - if (__predict_false(count == SEM_VALUE_MAX)) { - errno = ERANGE; - return (-1); - } - if (atomic_cmpset_rel_int(&sem->_kern._count, count, count+1)) - return (0); - } else { - return _umtx_op(&sem->_kern, UMTX_OP_SEM_WAKE, 0, NULL, NULL); - } - } - } else { - do { - count = sem->_kern._count; - if (__predict_false(count == SEM_VALUE_MAX)) { - errno = ERANGE; - return (-1); - } - } while (!atomic_cmpset_rel_int(&sem->_kern._count, count, count+1)); - rmb(); - if (!sem->_kern._has_waiters) - return (0); - return _umtx_op(&sem->_kern, UMTX_OP_SEM_WAKE, 0, NULL, NULL); - } + atomic_add_rel_int(&sem->_kern._count, 1); + return usem_wake(&sem->_kern); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 07:22:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82EBB106566B; Wed, 21 Mar 2012 07:22:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63D218FC17; Wed, 21 Mar 2012 07:22:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L7MSFc059637; Wed, 21 Mar 2012 07:22:28 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L7MS3s059635; Wed, 21 Mar 2012 07:22:28 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203210722.q2L7MS3s059635@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 21 Mar 2012 07:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233265 - in stable/9/sys: i386/conf netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 07:22:28 -0000 Author: glebius Date: Wed Mar 21 07:22:27 2012 New Revision: 233265 URL: http://svn.freebsd.org/changeset/base/233265 Log: Merge from head: r227785: - Reduce severity for all ARP events, that can be triggered from remote machine to LOG_NOTICE. Exception left to "using my IP address". - Fix multicast ARP warning: add newline and also log the bad MAC address. Tested by: Alexander Wittig r227790: Be more informative for "unknown hardware address format" message. Submitted by: Andrzej Tobola Modified: stable/9/sys/netinet/if_ether.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/netinet/if_ether.c ============================================================================== --- stable/9/sys/netinet/if_ether.c Wed Mar 21 07:21:05 2012 (r233264) +++ stable/9/sys/netinet/if_ether.c Wed Mar 21 07:22:27 2012 (r233265) @@ -433,7 +433,7 @@ arpintr(struct mbuf *m) if (m->m_len < sizeof(struct arphdr) && ((m = m_pullup(m, sizeof(struct arphdr))) == NULL)) { - log(LOG_ERR, "arp: runt packet -- m_pullup failed\n"); + log(LOG_NOTICE, "arp: runt packet -- m_pullup failed\n"); return; } ar = mtod(m, struct arphdr *); @@ -443,15 +443,17 @@ arpintr(struct mbuf *m) ntohs(ar->ar_hrd) != ARPHRD_ARCNET && ntohs(ar->ar_hrd) != ARPHRD_IEEE1394 && ntohs(ar->ar_hrd) != ARPHRD_INFINIBAND) { - log(LOG_ERR, "arp: unknown hardware address format (0x%2D)\n", - (unsigned char *)&ar->ar_hrd, ""); + log(LOG_NOTICE, "arp: unknown hardware address format (0x%2D)" + " (from %*D to %*D)\n", (unsigned char *)&ar->ar_hrd, "", + ETHER_ADDR_LEN, (u_char *)ar_sha(ar), ":", + ETHER_ADDR_LEN, (u_char *)ar_tha(ar), ":"); m_freem(m); return; } if (m->m_len < arphdr_len(ar)) { if ((m = m_pullup(m, arphdr_len(ar))) == NULL) { - log(LOG_ERR, "arp: runt packet\n"); + log(LOG_NOTICE, "arp: runt packet\n"); m_freem(m); return; } @@ -527,7 +529,7 @@ in_arpinput(struct mbuf *m) req_len = arphdr_len2(ifp->if_addrlen, sizeof(struct in_addr)); if (m->m_len < req_len && (m = m_pullup(m, req_len)) == NULL) { - log(LOG_ERR, "in_arp: runt packet -- m_pullup failed\n"); + log(LOG_NOTICE, "in_arp: runt packet -- m_pullup failed\n"); return; } @@ -537,13 +539,14 @@ in_arpinput(struct mbuf *m) * a protocol length not equal to an IPv4 address. */ if (ah->ar_pln != sizeof(struct in_addr)) { - log(LOG_ERR, "in_arp: requested protocol length != %zu\n", + log(LOG_NOTICE, "in_arp: requested protocol length != %zu\n", sizeof(struct in_addr)); return; } if (ETHER_IS_MULTICAST(ar_sha(ah))) { - log(LOG_ERR, "in_arp: source hardware address is multicast."); + log(LOG_NOTICE, "in_arp: %*D is multicast\n", + ifp->if_addrlen, (u_char *)ar_sha(ah), ":"); return; } @@ -645,7 +648,7 @@ match: if (!bcmp(ar_sha(ah), enaddr, ifp->if_addrlen)) goto drop; /* it's from me, ignore it. */ if (!bcmp(ar_sha(ah), ifp->if_broadcastaddr, ifp->if_addrlen)) { - log(LOG_ERR, + log(LOG_NOTICE, "arp: link address is broadcast for IP address %s!\n", inet_ntoa(isaddr)); goto drop; @@ -681,7 +684,7 @@ match: /* the following is not an error when doing bridging */ if (!bridged && la->lle_tbl->llt_ifp != ifp && !carp_match) { if (log_arp_wrong_iface) - log(LOG_ERR, "arp: %s is on %s " + log(LOG_WARNING, "arp: %s is on %s " "but got reply from %*D on %s\n", inet_ntoa(isaddr), la->lle_tbl->llt_ifp->if_xname, @@ -716,10 +719,10 @@ match: if (ifp->if_addrlen != ah->ar_hln) { LLE_WUNLOCK(la); - log(LOG_WARNING, - "arp from %*D: addr len: new %d, i/f %d (ignored)", - ifp->if_addrlen, (u_char *) ar_sha(ah), ":", - ah->ar_hln, ifp->if_addrlen); + log(LOG_WARNING, "arp from %*D: addr len: new %d, " + "i/f %d (ignored)\n", ifp->if_addrlen, + (u_char *) ar_sha(ah), ":", ah->ar_hln, + ifp->if_addrlen); goto drop; } (void)memcpy(&la->ll_addr, ar_sha(ah), ifp->if_addrlen); From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 07:29:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1EB791065675; Wed, 21 Mar 2012 07:29:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08F068FC0C; Wed, 21 Mar 2012 07:29:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L7TlnP059907; Wed, 21 Mar 2012 07:29:47 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L7Tlj5059905; Wed, 21 Mar 2012 07:29:47 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203210729.q2L7Tlj5059905@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 21 Mar 2012 07:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233266 - in stable/9/sys: i386/conf netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 07:29:48 -0000 Author: glebius Date: Wed Mar 21 07:29:47 2012 New Revision: 233266 URL: http://svn.freebsd.org/changeset/base/233266 Log: Merge 228321 from head: Fix double free. PR: kern/163089 Submitted by: Herbie Robinson Modified: stable/9/sys/netinet6/mld6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/netinet6/mld6.c ============================================================================== --- stable/9/sys/netinet6/mld6.c Wed Mar 21 07:22:27 2012 (r233265) +++ stable/9/sys/netinet6/mld6.c Wed Mar 21 07:29:47 2012 (r233266) @@ -3096,7 +3096,6 @@ mld_dispatch_packet(struct mbuf *m) m0 = mld_v2_encap_report(ifp, m); if (m0 == NULL) { CTR2(KTR_MLD, "%s: dropped %p", __func__, m); - m_freem(m); IP6STAT_INC(ip6s_odropped); goto out; } From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 08:03:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BCE96106566C; Wed, 21 Mar 2012 08:03:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A87088FC14; Wed, 21 Mar 2012 08:03:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L837Kr061040; Wed, 21 Mar 2012 08:03:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L8374f061037; Wed, 21 Mar 2012 08:03:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203210803.q2L8374f061037@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 21 Mar 2012 08:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233269 - head/usr.bin/wall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 08:03:07 -0000 Author: glebius Date: Wed Mar 21 08:03:07 2012 New Revision: 233269 URL: http://svn.freebsd.org/changeset/base/233269 Log: Add multibyte char support. PR: 165429 Submitted by: amdmi3 Modified: head/usr.bin/wall/wall.1 head/usr.bin/wall/wall.c Modified: head/usr.bin/wall/wall.1 ============================================================================== --- head/usr.bin/wall/wall.1 Wed Mar 21 07:49:13 2012 (r233268) +++ head/usr.bin/wall/wall.1 Wed Mar 21 08:03:07 2012 (r233269) @@ -28,7 +28,7 @@ .\" @(#)wall.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 17, 2004 +.Dd February 24, 2012 .Dt WALL 1 .Os .Sh NAME @@ -73,7 +73,3 @@ setting is used to determine which chara terminal, not the receiver's (which .Nm has no way of knowing). -.Pp -The -.Nm -utility does not recognize multibyte characters. Modified: head/usr.bin/wall/wall.c ============================================================================== --- head/usr.bin/wall/wall.c Wed Mar 21 07:49:13 2012 (r233268) +++ head/usr.bin/wall/wall.c Wed Mar 21 08:03:07 2012 (r233269) @@ -62,6 +62,8 @@ static const char sccsid[] = "@(#)wall.c #include #include #include +#include +#include #include "ttymsg.h" @@ -185,14 +187,15 @@ void makemsg(char *fname) { int cnt; - unsigned char ch; + wchar_t ch; struct tm *lt; struct passwd *pw; struct stat sbuf; time_t now; FILE *fp; int fd; - char *p, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64]; + char hostname[MAXHOSTNAMELEN], tmpname[64]; + wchar_t *p, *tmp, lbuf[256], codebuf[13]; const char *tty; const char *whom; gid_t egid; @@ -220,78 +223,61 @@ makemsg(char *fname) * Which means that we may leave a non-blank character * in column 80, but that can't be helped. */ - (void)fprintf(fp, "\r%79s\r\n", " "); - (void)snprintf(lbuf, sizeof(lbuf), - "Broadcast Message from %s@%s", + (void)fwprintf(fp, L"\r%79s\r\n", " "); + (void)swprintf(lbuf, sizeof(lbuf)/sizeof(wchar_t), + L"Broadcast Message from %s@%s", whom, hostname); - (void)fprintf(fp, "%-79.79s\007\007\r\n", lbuf); - (void)snprintf(lbuf, sizeof(lbuf), - " (%s) at %d:%02d %s...", tty, + (void)fwprintf(fp, L"%-79.79S\007\007\r\n", lbuf); + (void)swprintf(lbuf, sizeof(lbuf)/sizeof(wchar_t), + L" (%s) at %d:%02d %s...", tty, lt->tm_hour, lt->tm_min, lt->tm_zone); - (void)fprintf(fp, "%-79.79s\r\n", lbuf); + (void)fwprintf(fp, L"%-79.79S\r\n", lbuf); } - (void)fprintf(fp, "%79s\r\n", " "); + (void)fwprintf(fp, L"%79s\r\n", " "); if (fname) { egid = getegid(); setegid(getgid()); - if (freopen(fname, "r", stdin) == NULL) + if (freopen(fname, "r", stdin) == NULL) err(1, "can't read %s", fname); setegid(egid); } cnt = 0; - while (fgets(lbuf, sizeof(lbuf), stdin)) { - for (p = lbuf; (ch = *p) != '\0'; ++p, ++cnt) { - if (ch == '\r') { - putc('\r', fp); + while (fgetws(lbuf, sizeof(lbuf)/sizeof(wchar_t), stdin)) { + for (p = lbuf; (ch = *p) != L'\0'; ++p, ++cnt) { + if (ch == L'\r') { + putwc(L'\r', fp); cnt = 0; continue; - } else if (ch == '\n') { + } else if (ch == L'\n') { for (; cnt < 79; ++cnt) - putc(' ', fp); - putc('\r', fp); - putc('\n', fp); + putwc(L' ', fp); + putwc(L'\r', fp); + putwc(L'\n', fp); break; } if (cnt == 79) { - putc('\r', fp); - putc('\n', fp); + putwc(L'\r', fp); + putwc(L'\n', fp); cnt = 0; } - if (((ch & 0x80) && ch < 0xA0) || - /* disable upper controls */ - (!isprint(ch) && !isspace(ch) && - ch != '\a' && ch != '\b') - ) { - if (ch & 0x80) { - ch &= 0x7F; - putc('M', fp); + if (iswprint(ch) || iswspace(ch) || ch == L'\a' || ch == L'\b') { + putwc(ch, fp); + } else { + (void)swprintf(codebuf, sizeof(codebuf)/sizeof(wchar_t), L"<0x%X>", ch); + for (tmp = codebuf; *tmp != L'\0'; ++tmp) { + putwc(*tmp, fp); if (++cnt == 79) { - putc('\r', fp); - putc('\n', fp); - cnt = 0; - } - putc('-', fp); - if (++cnt == 79) { - putc('\r', fp); - putc('\n', fp); - cnt = 0; - } - } - if (iscntrl(ch)) { - ch ^= 040; - putc('^', fp); - if (++cnt == 79) { - putc('\r', fp); - putc('\n', fp); + putwc(L'\r', fp); + putwc(L'\n', fp); cnt = 0; } } + --cnt; } - putc(ch, fp); } } - (void)fprintf(fp, "%79s\r\n", " "); + (void)fwprintf(fp, L"%79s\r\n", " "); rewind(fp); if (fstat(fd, &sbuf)) From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 08:08:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88EBA1065673; Wed, 21 Mar 2012 08:08:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1C38FC18; Wed, 21 Mar 2012 08:08:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L88ODC061229; Wed, 21 Mar 2012 08:08:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L88ORw061226; Wed, 21 Mar 2012 08:08:24 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203210808.q2L88ORw061226@svn.freebsd.org> From: Michael Tuexen Date: Wed, 21 Mar 2012 08:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233270 - in releng/8.3/sys: i386/conf kern netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 08:08:24 -0000 Author: tuexen Date: Wed Mar 21 08:08:23 2012 New Revision: 233270 URL: http://svn.freebsd.org/changeset/base/233270 Log: MFC r233004: Fix bugs which can result in a panic when an non-SCTP socket it used with an sctp_ system-call which expects an SCTP socket. Approved by: re@ Modified: releng/8.3/sys/kern/uipc_syscalls.c releng/8.3/sys/netinet/sctp_peeloff.c Directory Properties: releng/8.3/sys/ (props changed) releng/8.3/sys/amd64/include/xen/ (props changed) releng/8.3/sys/boot/ (props changed) releng/8.3/sys/cddl/contrib/opensolaris/ (props changed) releng/8.3/sys/contrib/dev/acpica/ (props changed) releng/8.3/sys/contrib/pf/ (props changed) releng/8.3/sys/dev/e1000/ (props changed) releng/8.3/sys/i386/conf/XENHVM (props changed) Modified: releng/8.3/sys/kern/uipc_syscalls.c ============================================================================== --- releng/8.3/sys/kern/uipc_syscalls.c Wed Mar 21 08:03:07 2012 (r233269) +++ releng/8.3/sys/kern/uipc_syscalls.c Wed Mar 21 08:08:23 2012 (r233270) @@ -2300,6 +2300,10 @@ sctp_peeloff(td, uap) error = fgetsock(td, uap->sd, &head, &fflag); if (error) goto done2; + if (head->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto done2; + } error = sctp_can_peel_off(head, (sctp_assoc_t)uap->name); if (error) goto done2; @@ -2418,6 +2422,10 @@ sctp_generic_sendmsg (td, uap) iov[0].iov_len = uap->mlen; so = (struct socket *)fp->f_data; + if (so->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto sctp_bad; + } #ifdef MAC error = mac_socket_check_send(td->td_ucred, so); if (error) @@ -2528,6 +2536,10 @@ sctp_generic_sendmsg_iov(td, uap) #endif so = (struct socket *)fp->f_data; + if (so->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto sctp_bad; + } #ifdef MAC error = mac_socket_check_send(td->td_ucred, so); if (error) @@ -2632,6 +2644,10 @@ sctp_generic_recvmsg(td, uap) goto out1; so = fp->f_data; + if (so->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto out; + } #ifdef MAC error = mac_socket_check_receive(td->td_ucred, so); if (error) { Modified: releng/8.3/sys/netinet/sctp_peeloff.c ============================================================================== --- releng/8.3/sys/netinet/sctp_peeloff.c Wed Mar 21 08:03:07 2012 (r233269) +++ releng/8.3/sys/netinet/sctp_peeloff.c Wed Mar 21 08:08:23 2012 (r233270) @@ -59,16 +59,16 @@ sctp_can_peel_off(struct socket *head, s SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EBADF); return (EBADF); } - if ((head->so_proto->pr_protocol != IPPROTO_SCTP) || - (head->so_type != SOCK_SEQPACKET)) { - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); - return (EOPNOTSUPP); - } inp = (struct sctp_inpcb *)head->so_pcb; if (inp == NULL) { SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); return (EFAULT); } + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); + return (EOPNOTSUPP); + } stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); if (stcb == NULL) { SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOENT); From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 08:32:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 316591065676; Wed, 21 Mar 2012 08:32:12 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay001.isp.belgacom.be (mailrelay001.isp.belgacom.be [195.238.6.51]) by mx1.freebsd.org (Postfix) with ESMTP id 2F8C58FC25; Wed, 21 Mar 2012 08:32:10 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArAFAHaRaU9bsV1u/2dsb2JhbABEs3ODCYEIggkBAQVWIxALDgouOR4GiCG3VZEBBKYGgmg Received: from 110.93-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.93.110]) by relay.skynet.be with ESMTP; 21 Mar 2012 09:31:01 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q2L8V0bP001522; Wed, 21 Mar 2012 09:31:00 +0100 (CET) (envelope-from tijl@freebsd.org) From: Tijl Coosemans To: John Baldwin Date: Wed, 21 Mar 2012 09:30:53 +0100 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.7.3; i386; ; ) References: <201203091148.q29BmuIp005151@svn.freebsd.org> <201203201519.12926.tijl@freebsd.org> <201203201456.14375.jhb@freebsd.org> In-Reply-To: <201203201456.14375.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2167658.op2pGTnxf8"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201203210930.58389.tijl@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232721 - head/sys/x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 08:32:12 -0000 --nextPart2167658.op2pGTnxf8 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable On Tuesday 20 March 2012 19:56:14 John Baldwin wrote: > On Tuesday, March 20, 2012 10:19:07 am Tijl Coosemans wrote: >> On Tuesday 20 March 2012 13:34:10 John Baldwin wrote: >>> BTW, I think I found an old "bug" in this file. The _gen() variants >>> should only use the _gen() variants of smaller types rather than using >>> the version that re-checks __build_constant_p() I think. That is: >>>=20 >>> Index: x86/include/endian.h >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- endian.h (revision 233184) >>> +++ endian.h (working copy) >>> @@ -65,9 +65,9 @@ >>> =20 >>> #define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8) >>> #define __bswap32_gen(x) \ >>> - (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) >>> + (((__uint32_t)__bswap16_gen(x) << 16) | __bswap16_gen((x) >> 16)) >>> #define __bswap64_gen(x) \ >>> - (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) >>> + (((__uint64_t)__bswap32_gen(x) << 32) | __bswap32_gen((x) >> 32)) >>> =20 >>> #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P >>> #define __bswap16(x) \ >>>=20 >>> I ran into this while porting the __builtin_constant_p() functionality >>> over to ia64. >>=20 >> No, on i386 bswap64 with a variable argument currently expands to two >> bswap instructions. With your change it would be many shifts and logical >> operations. The _gen variants are more like fallback implementations. >> If bswapNN cannot be implemented directly it is split up. If those >> smaller problems can be implemented directly, good, if not split it up >> again and so on. >=20 > Oh, I now parse the comment in __bswap64_var() correctly. That's fugly. >=20 > Still, it seems that if I keep the patch to port this to ia64 (so it > can do constants as constants), then it will need to use this approach > since it won't have the i386 problem (in its case the _gen variants > are only used for constants). Maybe name them _const then as on other architectures. --nextPart2167658.op2pGTnxf8 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk9pkcIACgkQfoCS2CCgtivQ6AD/dv8UZ/JL9KIGvhpFlUnBAy3l BgOIVlAC0I/ol+MolkUA/0gZiQJAHpPcCl2k7/sRx2b0Fq0qVr8Ng1pWX7dHmuGS =dgsC -----END PGP SIGNATURE----- --nextPart2167658.op2pGTnxf8-- From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 08:38:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D565C106564A; Wed, 21 Mar 2012 08:38:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF6EA8FC12; Wed, 21 Mar 2012 08:38:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L8chSm062299; Wed, 21 Mar 2012 08:38:43 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L8chUM062260; Wed, 21 Mar 2012 08:38:43 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201203210838.q2L8chUM062260@svn.freebsd.org> From: Ed Schouten Date: Wed, 21 Mar 2012 08:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233271 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 08:38:43 -0000 Author: ed Date: Wed Mar 21 08:38:42 2012 New Revision: 233271 URL: http://svn.freebsd.org/changeset/base/233271 Log: Remove pty(4) from our kernel configurations. As of FreeBSD 8, this driver should not be used. Applications that use posix_openpt(2) and openpty(3) use the pts(4) that is built into the kernel unconditionally. If it turns out high profile depend on the pty(4) module anyway, I'd rather get those fixed. So please report any issues to me. The pty(4) module is still available as a kernel module of course, so a simple `kldload pty' can be used to run old-style pseudo-terminals. Modified: head/sys/amd64/conf/GENERIC head/sys/arm/conf/AVILA head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/EP80219 head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/IQ31244 head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/NSLU head/sys/arm/conf/QILA9G20 head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/TS7800 head/sys/i386/conf/GENERIC head/sys/i386/conf/XBOX head/sys/i386/conf/XEN head/sys/ia64/conf/GENERIC head/sys/ia64/conf/SKI head/sys/mips/conf/OCTEON1 head/sys/mips/conf/RT305X head/sys/mips/conf/XLR head/sys/mips/conf/XLR64 head/sys/mips/conf/XLRN32 head/sys/mips/conf/std.XLP head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/MPC85XX head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/amd64/conf/GENERIC Wed Mar 21 08:38:42 2012 (r233271) @@ -285,7 +285,6 @@ device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. -device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/AVILA Wed Mar 21 08:38:42 2012 (r233271) @@ -103,7 +103,6 @@ device mii # NB: required by npe device ether device bpf -device pty device loop device if_bridge Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/BWCT Wed Mar 21 08:38:42 2012 (r233271) @@ -72,7 +72,6 @@ device loop device random device ether device vlan -device pty device uart device ate device mii Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/CAMBRIA Wed Mar 21 08:38:42 2012 (r233271) @@ -106,7 +106,6 @@ device mii # NB: required by npe device ether device bpf -device pty device loop device if_bridge Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/CNS11XXNAS Wed Mar 21 08:38:42 2012 (r233271) @@ -98,7 +98,6 @@ device mii # Minimal mii routines device ether device bpf -device pty device loop device md Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/CRB Wed Mar 21 08:38:42 2012 (r233271) @@ -85,7 +85,6 @@ device "7seg" # SCSI Controllers -device pty #options AHC_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~128k to driver. #options AHD_REG_PRETTY_PRINT # Print register bitfields in debug Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/DB-78XXX Wed Mar 21 08:38:42 2012 (r233271) @@ -53,7 +53,6 @@ device pci # Pseudo devices device loop device md -device pty device random # Serial ports Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/DB-88F5XXX Wed Mar 21 08:38:42 2012 (r233271) @@ -53,7 +53,6 @@ device pci # Pseudo devices device md device loop -device pty device random # Serial ports Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/DB-88F6XXX Wed Mar 21 08:38:42 2012 (r233271) @@ -53,7 +53,6 @@ device pci # Pseudo devices device loop device md -device pty device random # Serial ports Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/DOCKSTAR Wed Mar 21 08:38:42 2012 (r233271) @@ -46,7 +46,6 @@ options KDB # Pseudo devices device md device random -device pty device loop # Serial ports Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/EP80219 Wed Mar 21 08:38:42 2012 (r233271) @@ -83,7 +83,6 @@ device pass # Passthrough device (dire # SCSI Controllers -device pty device iopwdog # I80321 Watchdog device dma # I80321 DMA Controller Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/GUMSTIX Wed Mar 21 08:38:42 2012 (r233271) @@ -76,8 +76,6 @@ device smcphy device uart device uart_ns8250 -device pty - # Debugging for use in -current options KDB options DDB #Enable the kernel debugger Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/HL200 Wed Mar 21 08:38:42 2012 (r233271) @@ -65,7 +65,6 @@ options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING device random -device pty device loop device ether device uart Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/HL201 Wed Mar 21 08:38:42 2012 (r233271) @@ -67,7 +67,6 @@ options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING device random -device pty device loop device ether device uart Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/IQ31244 Wed Mar 21 08:38:42 2012 (r233271) @@ -82,7 +82,6 @@ device pass # Passthrough device (dire # SCSI Controllers -device pty device iopwdog # I80321 Watchdog device dma # I80321 DMA Controller device aau # I80321 Application Accelerator Unit Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/KB920X Wed Mar 21 08:38:42 2012 (r233271) @@ -66,7 +66,6 @@ options SX_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING device random -device pty device loop device ether device uart Modified: head/sys/arm/conf/LN2410SBC ============================================================================== --- head/sys/arm/conf/LN2410SBC Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/LN2410SBC Wed Mar 21 08:38:42 2012 (r233271) @@ -63,7 +63,6 @@ options SX_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING device random -device pty device loop device ether Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/NSLU Wed Mar 21 08:38:42 2012 (r233271) @@ -101,7 +101,6 @@ device rlphy # NSLU2 uses Realtek PHY device ether device bpf -device pty device loop device md Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/QILA9G20 Wed Mar 21 08:38:42 2012 (r233271) @@ -77,7 +77,6 @@ options NO_SWAPPING #options DIAGNOSTIC device random -device pty device loop device bpf device ether Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/SAM9G20EK Wed Mar 21 08:38:42 2012 (r233271) @@ -76,7 +76,6 @@ options NO_SWAPPING #options DIAGNOSTIC device random -device pty device loop device bpf device ether Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/SHEEVAPLUG Wed Mar 21 08:38:42 2012 (r233271) @@ -44,7 +44,6 @@ options KDB # Pseudo devices device random -device pty device loop # Serial ports Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/arm/conf/TS7800 Wed Mar 21 08:38:42 2012 (r233271) @@ -47,7 +47,6 @@ device pci # Pseudo devices device md device loop -device pty device random # Serial ports Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/i386/conf/GENERIC Wed Mar 21 08:38:42 2012 (r233271) @@ -298,7 +298,6 @@ device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. -device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) Modified: head/sys/i386/conf/XBOX ============================================================================== --- head/sys/i386/conf/XBOX Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/i386/conf/XBOX Wed Mar 21 08:38:42 2012 (r233271) @@ -65,7 +65,6 @@ device loop # Network loopback device random # Entropy device device ether # Ethernet support #device tun # Packet tunnel. -device pty # BSD-style compatibility pseudo ttys #device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling #device faith # IPv6-to-IPv4 relaying (translation) Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/i386/conf/XEN Wed Mar 21 08:38:42 2012 (r233271) @@ -78,7 +78,6 @@ device loop # Network loopback device random # Entropy device device ether # Ethernet support device tun # Packet tunnel. -device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/ia64/conf/GENERIC Wed Mar 21 08:38:42 2012 (r233271) @@ -201,7 +201,6 @@ device faith # IPv6-to-IPv4 relaying ( device gif # IPv6 and IPv4 tunneling device loop # Network loopback device md # Memory "disks" -device pty # BSD-style compatibility pseudo ttys device puc # Multi I/O cards and multi-channel UARTs device random # Entropy device device tun # Packet tunnel. Modified: head/sys/ia64/conf/SKI ============================================================================== --- head/sys/ia64/conf/SKI Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/ia64/conf/SKI Wed Mar 21 08:38:42 2012 (r233271) @@ -53,7 +53,6 @@ device pci # PCI bus support device ether # Ethernet support device loop # Network loopback device md # Memory "disks" -device pty # BSD-style compatibility pseudo ttys device random # Entropy device device tun # Packet tunnel. Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/mips/conf/OCTEON1 Wed Mar 21 08:38:42 2012 (r233271) @@ -250,7 +250,6 @@ device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. -device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) Modified: head/sys/mips/conf/RT305X ============================================================================== --- head/sys/mips/conf/RT305X Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/mips/conf/RT305X Wed Mar 21 08:38:42 2012 (r233271) @@ -95,7 +95,6 @@ device loop # RT3050F, RT3052F have only pseudo PHYs, so mii not required device rt -device pty # Pseudo-ttys (telnet etc) device ether device bpf # Berkeley packet filter device vlan Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/mips/conf/XLR Wed Mar 21 08:38:42 2012 (r233271) @@ -112,7 +112,6 @@ device uart device loop device random device md -device pty device bpf # Network Modified: head/sys/mips/conf/XLR64 ============================================================================== --- head/sys/mips/conf/XLR64 Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/mips/conf/XLR64 Wed Mar 21 08:38:42 2012 (r233271) @@ -86,7 +86,6 @@ device uart device loop device random device md -device pty device bpf # Network Modified: head/sys/mips/conf/XLRN32 ============================================================================== --- head/sys/mips/conf/XLRN32 Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/mips/conf/XLRN32 Wed Mar 21 08:38:42 2012 (r233271) @@ -87,7 +87,6 @@ device uart device loop device random device md -device pty device bpf # Network Modified: head/sys/mips/conf/std.XLP ============================================================================== --- head/sys/mips/conf/std.XLP Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/mips/conf/std.XLP Wed Mar 21 08:38:42 2012 (r233271) @@ -59,7 +59,6 @@ options GEOM_UZIP device loop device random device md -device pty device bpf # Network Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/pc98/conf/GENERIC Wed Mar 21 08:38:42 2012 (r233271) @@ -222,7 +222,6 @@ device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. -device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/powerpc/conf/GENERIC Wed Mar 21 08:38:42 2012 (r233271) @@ -141,7 +141,6 @@ device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. -device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" device ofwd # Open Firmware disks device gif # IPv6 and IPv4 tunneling Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/powerpc/conf/GENERIC64 Wed Mar 21 08:38:42 2012 (r233271) @@ -138,7 +138,6 @@ device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. -device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" device ofwd # Open Firmware disks device gif # IPv6 and IPv4 tunneling Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/powerpc/conf/MPC85XX Wed Mar 21 08:38:42 2012 (r233271) @@ -74,7 +74,6 @@ device md device miibus device pass device pci -device pty device quicc device random #device rl Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Wed Mar 21 08:08:23 2012 (r233270) +++ head/sys/sparc64/conf/GENERIC Wed Mar 21 08:38:42 2012 (r233271) @@ -218,7 +218,6 @@ device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. -device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 08:43:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FBEE1065673; Wed, 21 Mar 2012 08:43:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BEFE8FC29; Wed, 21 Mar 2012 08:43:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L8hcAN062477; Wed, 21 Mar 2012 08:43:38 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L8hcm6062475; Wed, 21 Mar 2012 08:43:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203210843.q2L8hcm6062475@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 21 Mar 2012 08:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233272 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 08:43:39 -0000 Author: glebius Date: Wed Mar 21 08:43:38 2012 New Revision: 233272 URL: http://svn.freebsd.org/changeset/base/233272 Log: in6_pcblookup_local() still can return a pcb with NULL inp_socket. To avoid panic, do not dereference inp_socket, but obtain reuse port option from inp_flags2, like this is done after next call to in_pcblookup_local() a few lines down below. Submitted by: rwatson Modified: head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Wed Mar 21 08:38:42 2012 (r233271) +++ head/sys/netinet6/in6_pcb.c Wed Mar 21 08:43:38 2012 (r233272) @@ -245,8 +245,8 @@ in6_pcbbind(register struct inpcb *inp, if (tw == NULL || (reuseport & tw->tw_so_options) == 0) return (EADDRINUSE); - } else if (t && (reuseport & t->inp_socket->so_options) - == 0) { + } else if (t && (reuseport == 0 || + (t->inp_flags2 & INP_REUSEPORT) == 0)) { return (EADDRINUSE); } #ifdef INET From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 08:50:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03771106566C; Wed, 21 Mar 2012 08:50:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3A098FC14; Wed, 21 Mar 2012 08:50:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L8olZE062741; Wed, 21 Mar 2012 08:50:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L8olCj062739; Wed, 21 Mar 2012 08:50:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203210850.q2L8olCj062739@svn.freebsd.org> From: Marius Strobl Date: Wed, 21 Mar 2012 08:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233273 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 08:50:48 -0000 Author: marius Date: Wed Mar 21 08:50:47 2012 New Revision: 233273 URL: http://svn.freebsd.org/changeset/base/233273 Log: Exclude devices which are mutually exclusive with ATA_CAM. For better or worse, the former are still built as modules as part of the LINT builds Reviewed by: mav MFC after: 1 week Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Mar 21 08:43:38 2012 (r233272) +++ head/sys/conf/NOTES Wed Mar 21 08:50:47 2012 (r233273) @@ -1715,12 +1715,12 @@ device siis # For example to build a system which only supports a VIA chipset, # omit 'ata' and include the 'atacore', 'atapci' and 'atavia' drivers. device ata -device atadisk # ATA disk drives -device ataraid # ATA RAID drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives -device atapicam # emulate ATAPI devices as SCSI ditto via CAM +#device atadisk # ATA disk drives +#device ataraid # ATA RAID drives +#device atapicd # ATAPI CDROM drives +#device atapifd # ATAPI floppy drives +#device atapist # ATAPI tape drives +#device atapicam # emulate ATAPI devices as SCSI ditto via CAM # needs CAM to be present (scbus & pass) # Modular ATA From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 08:57:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 228DD1065670; Wed, 21 Mar 2012 08:57:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C5608FC14; Wed, 21 Mar 2012 08:57:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L8vF5C062991; Wed, 21 Mar 2012 08:57:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L8vFLB062984; Wed, 21 Mar 2012 08:57:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203210857.q2L8vFLB062984@svn.freebsd.org> From: Marius Strobl Date: Wed, 21 Mar 2012 08:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233274 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 08:57:16 -0000 Author: marius Date: Wed Mar 21 08:57:15 2012 New Revision: 233274 URL: http://svn.freebsd.org/changeset/base/233274 Log: Remove remnants of ATA_LOCKING uses in the ATA_CAM case and wrap it along with functions, SYSCTLs and tunables that are not used with ATA_CAM in #ifndef ATA_CAM, similar to the existing #ifdef'ed ATA_CAM code for the other way around. This makes it easier to understand which parts of ata(4) actually are used in the new world order and to later on remove the !ATA_CAM bits. It also makes it obvious that there is something fishy with the C-bus front-end as well as in the ATP850 support, as these used ATA_LOCKING which is defunct in the ATA_CAM case. When fixing the former, ATA_LOCKING probably needs to be brought back in some form or other. Reviewed by: mav MFC after: 1 week Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-cbus.c head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/ata-queue.c head/sys/dev/ata/chipsets/ata-acard.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Wed Mar 21 08:50:47 2012 (r233273) +++ head/sys/dev/ata/ata-all.c Wed Mar 21 08:57:15 2012 (r233274) @@ -79,9 +79,11 @@ static void ataaction(struct cam_sim *si static void atapoll(struct cam_sim *sim); #endif static void ata_conn_event(void *, int); +#ifndef ATA_CAM static void bswap(int8_t *, int); static void btrim(int8_t *, int); static void bpack(int8_t *, int8_t *, int); +#endif static void ata_interrupt_locked(void *data); #ifdef ATA_CAM static void ata_periodic_poll(void *data); @@ -90,27 +92,36 @@ static void ata_periodic_poll(void *data /* global vars */ MALLOC_DEFINE(M_ATA, "ata_generic", "ATA driver generic layer"); int (*ata_raid_ioctl_func)(u_long cmd, caddr_t data) = NULL; +#ifndef ATA_CAM struct intr_config_hook *ata_delayed_attach = NULL; +#endif devclass_t ata_devclass; uma_zone_t ata_request_zone; uma_zone_t ata_composite_zone; +#ifndef ATA_CAM int ata_wc = 1; int ata_setmax = 0; +#endif int ata_dma_check_80pin = 1; /* local vars */ +#ifndef ATA_CAM static int ata_dma = 1; static int atapi_dma = 1; +#endif /* sysctl vars */ static SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters"); +#ifndef ATA_CAM TUNABLE_INT("hw.ata.ata_dma", &ata_dma); SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma, CTLFLAG_RDTUN, &ata_dma, 0, "ATA disk DMA mode control"); +#endif TUNABLE_INT("hw.ata.ata_dma_check_80pin", &ata_dma_check_80pin); SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma_check_80pin, CTLFLAG_RW, &ata_dma_check_80pin, 1, "Check for 80pin cable before setting ATA DMA mode"); +#ifndef ATA_CAM TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma); SYSCTL_INT(_hw_ata, OID_AUTO, atapi_dma, CTLFLAG_RDTUN, &atapi_dma, 0, "ATAPI device DMA mode control"); @@ -120,6 +131,7 @@ SYSCTL_INT(_hw_ata, OID_AUTO, wc, CTLFLA TUNABLE_INT("hw.ata.setmax", &ata_setmax); SYSCTL_INT(_hw_ata, OID_AUTO, setmax, CTLFLAG_RDTUN, &ata_setmax, 0, "ATA disk set max native address"); +#endif #ifdef ATA_CAM FEATURE(ata_cam, "ATA devices are accessed through the cam(4) driver"); #endif @@ -186,13 +198,13 @@ ata_attach(device_t dev) callout_init(&ch->poll_callout, 1); #endif +#ifndef ATA_CAM /* reset the controller HW, the channel and device(s) */ while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit) pause("ataatch", 1); -#ifndef ATA_CAM ATA_RESET(dev); -#endif ATA_LOCKING(dev, ATA_LF_UNLOCK); +#endif /* allocate DMA resources if DMA HW present*/ if (ch->dma.alloc) @@ -606,6 +618,7 @@ ata_print_cable(device_t dev, u_int8_t * "DMA limited to UDMA33, %s found non-ATA66 cable\n", who); } +#ifndef ATA_CAM int ata_check_80pin(device_t dev, int mode) { @@ -623,7 +636,9 @@ ata_check_80pin(device_t dev, int mode) } return mode; } +#endif +#ifndef ATA_CAM void ata_setmode(device_t dev) { @@ -644,6 +659,7 @@ ata_setmode(device_t dev) (error) ? "FAILURE " : "", ata_mode2str(mode)); atadev->mode = mode; } +#endif /* * device related interfaces @@ -732,6 +748,7 @@ ata_ioctl(struct cdev *dev, u_long cmd, } #endif +#ifndef ATA_CAM int ata_device_ioctl(device_t dev, u_long cmd, caddr_t data) { @@ -830,6 +847,7 @@ ata_device_ioctl(device_t dev, u_long cm return ENOTTY; } } +#endif #ifndef ATA_CAM static void @@ -878,6 +896,7 @@ ata_add_child(device_t parent, struct at } #endif +#ifndef ATA_CAM int ata_getparam(struct ata_device *atadev, int init) { @@ -983,6 +1002,7 @@ ata_getparam(struct ata_device *atadev, } return error; } +#endif #ifndef ATA_CAM int @@ -1188,6 +1208,7 @@ ata_udelay(int interval) pause("ataslp", interval/(1000000/hz)); } +#ifndef ATA_CAM char * ata_unit2str(struct ata_device *atadev) { @@ -1200,6 +1221,7 @@ ata_unit2str(struct ata_device *atadev) sprintf(str, "%s", atadev->unit == ATA_MASTER ? "master" : "slave"); return str; } +#endif const char * ata_mode2str(int mode) @@ -1260,6 +1282,7 @@ ata_str2mode(const char *str) return (-1); } +#ifndef ATA_CAM const char * ata_satarev2str(int rev) { @@ -1272,6 +1295,7 @@ ata_satarev2str(int rev) default: return "???"; } } +#endif int ata_atapi(device_t dev, int target) @@ -1281,6 +1305,7 @@ ata_atapi(device_t dev, int target) return (ch->devices & (ATA_ATAPI_MASTER << target)); } +#ifndef ATA_CAM int ata_pmode(struct ata_params *ap) { @@ -1304,7 +1329,9 @@ ata_pmode(struct ata_params *ap) return ATA_PIO0; return ATA_PIO0; } +#endif +#ifndef ATA_CAM int ata_wmode(struct ata_params *ap) { @@ -1316,7 +1343,9 @@ ata_wmode(struct ata_params *ap) return ATA_WDMA0; return -1; } +#endif +#ifndef ATA_CAM int ata_umode(struct ata_params *ap) { @@ -1338,7 +1367,9 @@ ata_umode(struct ata_params *ap) } return -1; } +#endif +#ifndef ATA_CAM int ata_limit_mode(device_t dev, int mode, int maxmode) { @@ -1358,7 +1389,9 @@ ata_limit_mode(device_t dev, int mode, i return mode; } +#endif +#ifndef ATA_CAM static void bswap(int8_t *buf, int len) { @@ -1367,7 +1400,9 @@ bswap(int8_t *buf, int len) while (--ptr >= (u_int16_t*)buf) *ptr = ntohs(*ptr); } +#endif +#ifndef ATA_CAM static void btrim(int8_t *buf, int len) { @@ -1379,7 +1414,9 @@ btrim(int8_t *buf, int len) for (ptr = buf + len - 1; ptr >= buf && *ptr == ' '; --ptr) *ptr = 0; } +#endif +#ifndef ATA_CAM static void bpack(int8_t *src, int8_t *dst, int len) { @@ -1402,6 +1439,7 @@ bpack(int8_t *src, int8_t *dst, int len) if (j < len) dst[j] = 0x00; } +#endif #ifdef ATA_CAM void Modified: head/sys/dev/ata/ata-cbus.c ============================================================================== --- head/sys/dev/ata/ata-cbus.c Wed Mar 21 08:50:47 2012 (r233273) +++ head/sys/dev/ata/ata-cbus.c Wed Mar 21 08:57:15 2012 (r233274) @@ -339,11 +339,14 @@ static int ata_cbuschannel_banking(device_t dev, int flags) { struct ata_cbus_controller *ctlr = device_get_softc(device_get_parent(dev)); +#ifndef ATA_CAM struct ata_channel *ch = device_get_softc(dev); +#endif int res; mtx_lock(&ctlr->bank_mtx); switch (flags) { +#ifndef ATA_CAM case ATA_LF_LOCK: if (ctlr->locked_bank == -1) ctlr->locked_bank = ch->unit; @@ -368,6 +371,7 @@ ata_cbuschannel_banking(device_t dev, in } } break; +#endif case ATA_LF_WHICH: break; @@ -385,8 +389,10 @@ static device_method_t ata_cbuschannel_m DEVMETHOD(device_suspend, ata_cbuschannel_suspend), DEVMETHOD(device_resume, ata_cbuschannel_resume), +#ifndef ATA_CAM /* ATA methods */ DEVMETHOD(ata_locking, ata_cbuschannel_banking), +#endif { 0, 0 } }; Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Wed Mar 21 08:50:47 2012 (r233273) +++ head/sys/dev/ata/ata-pci.c Wed Mar 21 08:57:15 2012 (r233274) @@ -699,6 +699,7 @@ ata_pcichannel_resume(device_t dev) } +#ifndef ATA_CAM static int ata_pcichannel_locking(device_t dev, int mode) { @@ -710,6 +711,7 @@ ata_pcichannel_locking(device_t dev, int else return ch->unit; } +#endif static void ata_pcichannel_reset(device_t dev) @@ -766,7 +768,9 @@ static device_method_t ata_pcichannel_me /* ATA methods */ DEVMETHOD(ata_setmode, ata_pcichannel_setmode), DEVMETHOD(ata_getrev, ata_pcichannel_getrev), +#ifndef ATA_CAM DEVMETHOD(ata_locking, ata_pcichannel_locking), +#endif DEVMETHOD(ata_reset, ata_pcichannel_reset), { 0, 0 } Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Wed Mar 21 08:50:47 2012 (r233273) +++ head/sys/dev/ata/ata-pci.h Wed Mar 21 08:57:15 2012 (r233274) @@ -62,7 +62,9 @@ struct ata_pci_controller { int (*ch_detach)(device_t); int (*ch_suspend)(device_t); int (*ch_resume)(device_t); +#ifndef ATA_CAM int (*locking)(device_t, int); +#endif void (*reset)(device_t); int (*setmode)(device_t, int, int); int (*getrev)(device_t, int); Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Wed Mar 21 08:50:47 2012 (r233273) +++ head/sys/dev/ata/ata-queue.c Wed Mar 21 08:57:15 2012 (r233274) @@ -43,11 +43,14 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef ATA_CAM /* prototypes */ static void ata_completed(void *, int); static void ata_sort_queue(struct ata_channel *ch, struct ata_request *request); -static char *ata_skey2str(u_int8_t); +static const char *ata_skey2str(u_int8_t); +#endif +#ifndef ATA_CAM void ata_queue_request(struct ata_request *request) { @@ -123,7 +126,9 @@ ata_queue_request(struct ata_request *re sema_destroy(&request->done); } } +#endif +#ifndef ATA_CAM int ata_controlcmd(device_t dev, u_int8_t command, u_int16_t feature, u_int64_t lba, u_int16_t count) @@ -153,7 +158,9 @@ ata_controlcmd(device_t dev, u_int8_t co } return error; } +#endif +#ifndef ATA_CAM int ata_atapicmd(device_t dev, u_int8_t *ccb, caddr_t data, int count, int flags, int timeout) @@ -176,7 +183,9 @@ ata_atapicmd(device_t dev, u_int8_t *ccb } return error; } +#endif +#ifndef ATA_CAM void ata_start(device_t dev) { @@ -235,7 +244,9 @@ ata_start(device_t dev) } } } +#endif +#ifndef ATA_CAM void ata_finish(struct ata_request *request) { @@ -263,7 +274,9 @@ ata_finish(struct ata_request *request) } } } +#endif +#ifndef ATA_CAM static void ata_completed(void *context, int dummy) { @@ -495,6 +508,7 @@ ata_completed(void *context, int dummy) if (ch) ata_start(ch->dev); } +#endif void ata_timeout(struct ata_request *request) @@ -520,8 +534,8 @@ ata_timeout(struct ata_request *request) ata_cam_end_transaction(ch->dev, request); #endif mtx_unlock(&ch->state_mtx); - ATA_LOCKING(ch->dev, ATA_LF_UNLOCK); #ifndef ATA_CAM + ATA_LOCKING(ch->dev, ATA_LF_UNLOCK); ata_finish(request); #endif } @@ -530,6 +544,7 @@ ata_timeout(struct ata_request *request) } } +#ifndef ATA_CAM void ata_fail_requests(device_t dev) { @@ -568,7 +583,9 @@ ata_fail_requests(device_t dev) ata_finish(request); } } +#endif +#ifndef ATA_CAM /* * Rudely drop all requests queued to the channel of specified device. * XXX: The requests are leaked, use only in fatal case. @@ -586,7 +603,9 @@ ata_drop_requests(device_t dev) } mtx_unlock(&ch->queue_mtx); } +#endif +#ifndef ATA_CAM static u_int64_t ata_get_lba(struct ata_request *request) { @@ -608,7 +627,9 @@ ata_get_lba(struct ata_request *request) else return request->u.ata.lba; } +#endif +#ifndef ATA_CAM static void ata_sort_queue(struct ata_channel *ch, struct ata_request *request) { @@ -661,6 +682,7 @@ ata_sort_queue(struct ata_channel *ch, s ch->freezepoint = request; TAILQ_INSERT_AFTER(&ch->ata_queue, this, request, chain); } +#endif char * ata_cmd2str(struct ata_request *request) @@ -776,7 +798,8 @@ ata_cmd2str(struct ata_request *request) return buffer; } -static char * +#ifndef ATA_CAM +static const char * ata_skey2str(u_int8_t skey) { switch (skey) { @@ -799,3 +822,4 @@ ata_skey2str(u_int8_t skey) default: return("UNKNOWN"); } } +#endif Modified: head/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acard.c Wed Mar 21 08:50:47 2012 (r233273) +++ head/sys/dev/ata/chipsets/ata-acard.c Wed Mar 21 08:57:15 2012 (r233274) @@ -51,26 +51,29 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef ATA_CAM struct ata_serialize { struct mtx locked_mtx; int locked_ch; int restart_ch; }; +#endif /* local prototypes */ static int ata_acard_chipinit(device_t dev); -static int ata_acard_chipdeinit(device_t dev); static int ata_acard_ch_attach(device_t dev); static int ata_acard_status(device_t dev); static int ata_acard_850_setmode(device_t dev, int target, int mode); static int ata_acard_86X_setmode(device_t dev, int target, int mode); +#ifndef ATA_CAM +static int ata_acard_chipdeinit(device_t dev); static int ata_serialize(device_t dev, int flags); static void ata_serialize_init(struct ata_serialize *serial); +#endif /* misc defines */ #define ATP_OLD 1 - /* * Acard chipset support functions */ @@ -94,7 +97,9 @@ ata_acard_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_acard_chipinit; +#ifndef ATA_CAM ctlr->chipdeinit = ata_acard_chipdeinit; +#endif return (BUS_PROBE_DEFAULT); } @@ -102,7 +107,9 @@ static int ata_acard_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); +#ifndef ATA_CAM struct ata_serialize *serial; +#endif if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; @@ -111,17 +118,20 @@ ata_acard_chipinit(device_t dev) ctlr->ch_detach = ata_pci_ch_detach; if (ctlr->chip->cfg1 == ATP_OLD) { ctlr->setmode = ata_acard_850_setmode; +#ifndef ATA_CAM ctlr->locking = ata_serialize; serial = malloc(sizeof(struct ata_serialize), M_ATAPCI, M_WAITOK | M_ZERO); ata_serialize_init(serial); ctlr->chipset_data = serial; +#endif } else ctlr->setmode = ata_acard_86X_setmode; return 0; } +#ifndef ATA_CAM static int ata_acard_chipdeinit(device_t dev) { @@ -136,6 +146,7 @@ ata_acard_chipdeinit(device_t dev) } return (0); } +#endif static int ata_acard_ch_attach(device_t dev) @@ -228,6 +239,7 @@ ata_acard_86X_setmode(device_t dev, int return (mode); } +#ifndef ATA_CAM static void ata_serialize_init(struct ata_serialize *serial) { @@ -277,5 +289,6 @@ ata_serialize(device_t dev, int flags) mtx_unlock(&serial->locked_mtx); return res; } +#endif ATA_DECLARE_DRIVER(ata_acard); From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 08:58:45 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9ABB6106566C; Wed, 21 Mar 2012 08:58:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 28D988FC14; Wed, 21 Mar 2012 08:58:44 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q2L8wfNt008137 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Mar 2012 19:58:42 +1100 Date: Wed, 21 Mar 2012 19:58:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Tijl Coosemans In-Reply-To: <201203210930.58389.tijl@freebsd.org> Message-ID: <20120321194833.W1116@besplex.bde.org> References: <201203091148.q29BmuIp005151@svn.freebsd.org> <201203201519.12926.tijl@freebsd.org> <201203201456.14375.jhb@freebsd.org> <201203210930.58389.tijl@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r232721 - head/sys/x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 08:58:45 -0000 On Wed, 21 Mar 2012, Tijl Coosemans wrote: > On Tuesday 20 March 2012 19:56:14 John Baldwin wrote: >> On Tuesday, March 20, 2012 10:19:07 am Tijl Coosemans wrote: >... >>> No, on i386 bswap64 with a variable argument currently expands to two >>> bswap instructions. With your change it would be many shifts and logical >>> operations. The _gen variants are more like fallback implementations. >>> If bswapNN cannot be implemented directly it is split up. If those >>> smaller problems can be implemented directly, good, if not split it up >>> again and so on. >> >> Oh, I now parse the comment in __bswap64_var() correctly. That's fugly. >> >> Still, it seems that if I keep the patch to port this to ia64 (so it >> can do constants as constants), then it will need to use this approach >> since it won't have the i386 problem (in its case the _gen variants >> are only used for constants). > > Maybe name them _const then as on other architectures. But we hoped to to use the "generic" version on all arches, with only 1 definition for it, and nothing MD except possibly the "var" version. The "constant" version was renamed because it isn't limited to constants. I think it was changed to call the general version (above the "generic" version) after that, since it would have made no sense for the "constant" version to call a non-"constant" version. The "generic" version isn't really generic, since it only works for parameters without side effects. This is arranged by the "var" versions copying the parameters to non-volatile variables and then applying either the "generic" version or asm. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 09:15:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B1401065676 for ; Wed, 21 Mar 2012 09:15:38 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id BF07C8FC15 for ; Wed, 21 Mar 2012 09:15:37 +0000 (UTC) Received: (qmail 20226 invoked from network); 21 Mar 2012 07:20:02 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 21 Mar 2012 07:20:02 -0000 Message-ID: <4F699AA3.20800@freebsd.org> Date: Wed, 21 Mar 2012 10:08:51 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Marius Strobl References: <201203210850.q2L8olCj062739@svn.freebsd.org> In-Reply-To: <201203210850.q2L8olCj062739@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233273 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 09:15:38 -0000 On 21.03.2012 09:50, Marius Strobl wrote: > Author: marius > Date: Wed Mar 21 08:50:47 2012 > New Revision: 233273 > URL: http://svn.freebsd.org/changeset/base/233273 > > Log: > Exclude devices which are mutually exclusive with ATA_CAM. For better > or worse, the former are still built as modules as part of the LINT > builds > > Reviewed by: mav > MFC after: 1 week Is there any schedule on deorbiting old ATA? -- Andre From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 09:19:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 857581065674; Wed, 21 Mar 2012 09:19:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5607F8FC0C; Wed, 21 Mar 2012 09:19:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L9JOO3063683; Wed, 21 Mar 2012 09:19:24 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L9JOhx063681; Wed, 21 Mar 2012 09:19:24 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203210919.q2L9JOhx063681@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 21 Mar 2012 09:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233275 - in stable/9/sys: contrib/pf/net i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 09:19:24 -0000 Author: glebius Date: Wed Mar 21 09:19:23 2012 New Revision: 233275 URL: http://svn.freebsd.org/changeset/base/233275 Log: Merge 232685 from head: Merge from OpenBSD: revision 1.146 date: 2010/05/12 08:11:11; author: claudio; state: Exp; lines: +2 -3 bzero() the full compressed update struct before setting the values. This is needed because pf_state_peer_hton() skips some fields in certain situations which could result in garbage beeing sent to the other peer. This seems to fix the pfsync storms seen by stephan@ and so dlg owes me a whiskey. I didn't see any storms, but this definitely fixes a useless memory allocation on the receiving side, due to non zero scrub_flags field in a pfsync_state_peer structure. Modified: stable/9/sys/contrib/pf/net/if_pfsync.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- stable/9/sys/contrib/pf/net/if_pfsync.c Wed Mar 21 08:57:15 2012 (r233274) +++ stable/9/sys/contrib/pf/net/if_pfsync.c Wed Mar 21 09:19:23 2012 (r233275) @@ -48,6 +48,7 @@ * 1.120, 1.175 - use monotonic time_uptime * 1.122 - reduce number of updates for non-TCP sessions * 1.128 - cleanups + * 1.146 - bzero() mbuf before sparsely filling it with data * 1.170 - SIOCSIFMTU checks */ @@ -2020,6 +2021,7 @@ pfsync_out_upd_c(struct pf_state *st, st { struct pfsync_upd_c *up = (struct pfsync_upd_c *)(m->m_data + offset); + bzero(up, sizeof(*up)); up->id = st->id; pf_state_peer_hton(&st->src, &up->src); pf_state_peer_hton(&st->dst, &up->dst); @@ -2032,8 +2034,6 @@ pfsync_out_upd_c(struct pf_state *st, st up->expire = htonl(up->expire - time_second); up->timeout = st->timeout; - bzero(up->_pad, sizeof(up->_pad)); /* XXX */ - return (sizeof(*up)); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 09:48:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50AD31065676; Wed, 21 Mar 2012 09:48:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CAB28FC0C; Wed, 21 Mar 2012 09:48:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2L9mXWo064564; Wed, 21 Mar 2012 09:48:33 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2L9mX19064562; Wed, 21 Mar 2012 09:48:33 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201203210948.q2L9mX19064562@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 21 Mar 2012 09:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233276 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 09:48:34 -0000 Author: ae Date: Wed Mar 21 09:48:32 2012 New Revision: 233276 URL: http://svn.freebsd.org/changeset/base/233276 Log: Acquire modules lock before call module_getname() in the KLD_DEBUG case. MFC after: 1 week Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Wed Mar 21 09:19:23 2012 (r233275) +++ head/sys/kern/kern_linker.c Wed Mar 21 09:48:32 2012 (r233276) @@ -638,8 +638,12 @@ linker_file_unload(linker_file_t file, i * Give the module a chance to veto the unload. */ if ((error = module_unload(mod)) != 0) { +#ifdef KLD_DEBUG + MOD_SLOCK; KLD_DPF(FILE, ("linker_file_unload: module %s" " failed unload\n", module_getname(mod))); + MOD_SUNLOCK; +#endif return (error); } MOD_XLOCK; From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 10:03:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 624E11065674; Wed, 21 Mar 2012 10:03:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D1D78FC15; Wed, 21 Mar 2012 10:03:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2LA3rBR065930; Wed, 21 Mar 2012 10:03:53 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2LA3qsQ065928; Wed, 21 Mar 2012 10:03:52 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201203211003.q2LA3qsQ065928@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 21 Mar 2012 10:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233277 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 10:03:53 -0000 Author: ae Date: Wed Mar 21 10:03:52 2012 New Revision: 233277 URL: http://svn.freebsd.org/changeset/base/233277 Log: MFC r224546 (by glebius): Don't leak kld_sx lock in kldunloadf(). Modified: stable/8/sys/kern/kern_linker.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/kern_linker.c ============================================================================== --- stable/8/sys/kern/kern_linker.c Wed Mar 21 09:48:32 2012 (r233276) +++ stable/8/sys/kern/kern_linker.c Wed Mar 21 10:03:52 2012 (r233277) @@ -1111,8 +1111,9 @@ kern_kldunload(struct thread *td, int fi PMC_CALL_HOOK(td, PMC_FN_KLD_UNLOAD, (void *) &pkm); KLD_UNLOCK_READ(); } else -#else KLD_UNLOCK(); +#else + KLD_UNLOCK(); #endif CURVNET_RESTORE(); return (error); From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 10:07:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54D93106566C; Wed, 21 Mar 2012 10:07:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id D78388FC1B; Wed, 21 Mar 2012 10:07:28 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q2LA7NPj011126; Wed, 21 Mar 2012 12:07:23 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q2LA7MJc052114; Wed, 21 Mar 2012 12:07:22 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q2LA7MQp052113; Wed, 21 Mar 2012 12:07:22 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 21 Mar 2012 12:07:22 +0200 From: Konstantin Belousov To: Jung-uk Kim Message-ID: <20120321100722.GP2358@deviant.kiev.zoral.com.ua> References: <201203202037.q2KKbNfK037014@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="88pBQ1/6ie/nQzMF" Content-Disposition: inline In-Reply-To: <201203202037.q2KKbNfK037014@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233249 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 10:07:29 -0000 --88pBQ1/6ie/nQzMF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 20, 2012 at 08:37:23PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Tue Mar 20 20:37:23 2012 > New Revision: 233249 > URL: http://svn.freebsd.org/changeset/base/233249 >=20 > Log: > Fix another witness panic. We cannot enter critical section at all bec= ause > AcpiEnterSleepState() executes (optional) _GTS method since ACPICA 2012= 0215 > (r231844). To evaluate the method, we need malloc(9), which may sleep. You papered over the issue, and not fixed it. If sleep may happen, as it is for malloc, you cannot sleep with interrupts turned off. This would cause a deadlock at best. > =20 > Reported by: bschmidt > MFC after: 3 days >=20 > Modified: > head/sys/amd64/acpica/acpi_wakeup.c >=20 > Modified: head/sys/amd64/acpica/acpi_wakeup.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/amd64/acpica/acpi_wakeup.c Tue Mar 20 19:47:59 2012 (r233248) > +++ head/sys/amd64/acpica/acpi_wakeup.c Tue Mar 20 20:37:23 2012 (r233249) > @@ -223,6 +223,7 @@ acpi_sleep_machdep(struct acpi_softc *sc > #ifdef SMP > cpuset_t wakeup_cpus; > #endif > + register_t rf; > ACPI_STATUS status; > int ret; > =20 > @@ -241,8 +242,8 @@ acpi_sleep_machdep(struct acpi_softc *sc > =20 > AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); > =20 > + rf =3D intr_disable(); > intr_suspend(); > - spinlock_enter(); > =20 > if (savectx(susppcbs[0])) { > ctx_fpusave(suspfpusave[0]); > @@ -299,8 +300,8 @@ out: > #endif > =20 > mca_resume(); > - spinlock_exit(); > intr_resume(); > + intr_restore(rf); > =20 > AcpiSetFirmwareWakingVector(0); > =20 --88pBQ1/6ie/nQzMF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk9pqFoACgkQC3+MBN1Mb4hWMgCgt1W53qIxfa42yzVRMHRlddSF HekAoNyBEyh/auaQv2lox1qqikB2az2w =2Yja -----END PGP SIGNATURE----- --88pBQ1/6ie/nQzMF-- From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 10:18:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF9D21065675; Wed, 21 Mar 2012 10:18:44 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id C71838FC08; Wed, 21 Mar 2012 10:18:43 +0000 (UTC) Received: by lagv3 with SMTP id v3so962082lag.13 for ; Wed, 21 Mar 2012 03:18:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=5KCME/Pxk5b6K0jr/0gurNlKKTj8qrltvHGpyzzhWrc=; b=uKu9ak4h9MegLESziQPQJZlMX5MaIaPsH1AS8KTk9ZUe6oic9tNh66hjV3+NnhAvEe uGOyEYuH1AKVTFESPu1uvYSVGKN7wlqEmmRMQ1fqyF6MHaPahKa1H8GzoHOU/emLq4ai PhmcERwArxxCsL/BAZSpF1JGWncxsjI76JGAAJNUX0VQzXix+HPRW1NuMraDH1ZT9Z0c ctRhnu2TarDTmtTmWVS0HEznucHbmHsYjbHvMKd0ROKguM0m+ELmvLYYHIXLjGNb8uia 77UzALYfzTNnB6bsiVEblwXrz/EbRKs59THCZ/MDH3UahkuCMaxAxeqdlpT6l12ItK72 g7Lw== MIME-Version: 1.0 Received: by 10.152.112.100 with SMTP id ip4mr2563550lab.1.1332325116646; Wed, 21 Mar 2012 03:18:36 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.152.21.73 with HTTP; Wed, 21 Mar 2012 03:18:36 -0700 (PDT) In-Reply-To: <201203210838.q2L8chUM062260@svn.freebsd.org> References: <201203210838.q2L8chUM062260@svn.freebsd.org> Date: Wed, 21 Mar 2012 13:18:36 +0300 X-Google-Sender-Auth: KmUmM-RMOYNBT5LPZbkhI1vLFqI Message-ID: From: Sergey Kandaurov To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233271 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 10:18:45 -0000 On 21 March 2012 12:38, Ed Schouten wrote: > Author: ed > Date: Wed Mar 21 08:38:42 2012 > New Revision: 233271 > URL: http://svn.freebsd.org/changeset/base/233271 > > Log: > =A0Remove pty(4) from our kernel configurations. > > =A0As of FreeBSD 8, this driver should not be used. Applications that use > =A0posix_openpt(2) and openpty(3) use the pts(4) that is built into the > =A0kernel unconditionally. If it turns out high profile depend on the > =A0pty(4) module anyway, I'd rather get those fixed. So please report any > =A0issues to me. > > =A0The pty(4) module is still available as a kernel module of course, so = a > =A0simple `kldload pty' can be used to run old-style pseudo-terminals. Will this affect old binaries like misc/mc build for e.g. 6.x running on GE= NERIC w/o kldoaded pty(4), so that I will have to `kldload pty'? Currently executing old mc results in emitting the following kernel message= : pid 11948 (mc) is using legacy pty devices - not logging anymore --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 10:27:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 552BE1065694; Wed, 21 Mar 2012 10:27:13 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FA668FC1A; Wed, 21 Mar 2012 10:27:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2LARDhl066689; Wed, 21 Mar 2012 10:27:13 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2LARDc9066687; Wed, 21 Mar 2012 10:27:13 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203211027.q2LARDc9066687@svn.freebsd.org> From: Juli Mallett Date: Wed, 21 Mar 2012 10:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233278 - head/sys/mips/cavium X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 10:27:13 -0000 Author: jmallett Date: Wed Mar 21 10:27:12 2012 New Revision: 233278 URL: http://svn.freebsd.org/changeset/base/233278 Log: o) Don't keep drive parameters in a global, put them in the softc. o) Don't report a bogus stripesize. o) Eliminate a nearby gratuitous "proxy" indirection. Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c ============================================================================== --- head/sys/mips/cavium/octeon_ebt3000_cf.c Wed Mar 21 10:03:52 2012 (r233277) +++ head/sys/mips/cavium/octeon_ebt3000_cf.c Wed Mar 21 10:27:12 2012 (r233278) @@ -133,17 +133,6 @@ const char *const cf_type[] = { "True IDE" }; -/* Device softc */ -struct cf_priv { - device_t dev; - struct drive_param *drive_param; - - struct bio_queue_head cf_bq; - struct g_geom *cf_geom; - struct g_provider *cf_provider; - -}; - /* Device parameters */ struct drive_param{ union { @@ -157,8 +146,18 @@ struct drive_param{ uint16_t heads; uint16_t tracks; uint16_t sec_track; +}; -} drive_param; +/* Device softc */ +struct cf_priv { + device_t dev; + struct drive_param drive_param; + + struct bio_queue_head cf_bq; + struct g_geom *cf_geom; + struct g_provider *cf_provider; + +}; /* GEOM class implementation */ static g_access_t cf_access; @@ -179,15 +178,14 @@ DECLARE_GEOM_CLASS(g_cf_class, g_cf); static int cf_probe(device_t); static void cf_identify(driver_t *, device_t); static int cf_attach(device_t); -static int cf_attach_geom(void *, int); +static void cf_attach_geom(void *, int); /* ATA methods */ -static int cf_cmd_identify(void); +static int cf_cmd_identify(struct cf_priv *); static int cf_cmd_write(uint32_t, uint32_t, void *); static int cf_cmd_read(uint32_t, uint32_t, void *); static int cf_wait_busy(void); static int cf_send_cmd(uint32_t, uint8_t); -static void cf_attach_geom_proxy(void *arg, int flag); /* Miscelenous */ static void cf_swap_ascii(unsigned char[], char[]); @@ -198,11 +196,6 @@ static void cf_swap_ascii(unsigned char[ * ------------------------------------------------------------------- */ static int cf_access (struct g_provider *pp, int r, int w, int e) { - - pp->sectorsize = drive_param.sector_size; - pp->stripesize = drive_param.heads * drive_param.sec_track * drive_param.sector_size; - pp->mediasize = pp->stripesize * drive_param.tracks; - return (0); } @@ -212,17 +205,20 @@ static int cf_access (struct g_provider * ------------------------------------------------------------------- */ static void cf_start (struct bio *bp) { + struct cf_priv *cf_priv; int error; + cf_priv = bp->bio_to->geom->softc; + /* * Handle actual I/O requests. The request is passed down through * the bio struct. */ if(bp->bio_cmd & BIO_GETATTR) { - if (g_handleattr_int(bp, "GEOM::fwsectors", drive_param.sec_track)) + if (g_handleattr_int(bp, "GEOM::fwsectors", cf_priv->drive_param.sec_track)) return; - if (g_handleattr_int(bp, "GEOM::fwheads", drive_param.heads)) + if (g_handleattr_int(bp, "GEOM::fwheads", cf_priv->drive_param.heads)) return; g_io_deliver(bp, ENOIOCTL); return; @@ -231,11 +227,11 @@ static void cf_start (struct bio *bp) if ((bp->bio_cmd & (BIO_READ | BIO_WRITE))) { if (bp->bio_cmd & BIO_READ) { - error = cf_cmd_read(bp->bio_length / drive_param.sector_size, - bp->bio_offset / drive_param.sector_size, bp->bio_data); + error = cf_cmd_read(bp->bio_length / cf_priv->drive_param.sector_size, + bp->bio_offset / cf_priv->drive_param.sector_size, bp->bio_data); } else if (bp->bio_cmd & BIO_WRITE) { - error = cf_cmd_write(bp->bio_length / drive_param.sector_size, - bp->bio_offset/drive_param.sector_size, bp->bio_data); + error = cf_cmd_write(bp->bio_length / cf_priv->drive_param.sector_size, + bp->bio_offset/cf_priv->drive_param.sector_size, bp->bio_data); } else { printf("%s: unrecognized bio_cmd %x.\n", __func__, bp->bio_cmd); error = ENOTSUP; @@ -443,7 +439,7 @@ static int cf_cmd_write (uint32_t nr_sec * it in the drive_param structure * */ -static int cf_cmd_identify (void) +static int cf_cmd_identify(struct cf_priv *cf_priv) { int count; int error; @@ -457,7 +453,7 @@ static int cf_cmd_identify (void) { case CF_8: for (count = 0; count < SECTOR_SIZE; count++) - drive_param.u.buf[count] = cf_inb_8(TF_DATA); + cf_priv->drive_param.u.buf[count] = cf_inb_8(TF_DATA); break; case CF_TRUE_IDE_8: case CF_16: @@ -467,25 +463,25 @@ static int cf_cmd_identify (void) temp = cf_inw_16(TF_DATA); /* endianess will be swapped below */ - drive_param.u.buf[count] = (temp & 0xff); - drive_param.u.buf[count + 1] = (temp & 0xff00) >> 8; + cf_priv->drive_param.u.buf[count] = (temp & 0xff); + cf_priv->drive_param.u.buf[count + 1] = (temp & 0xff00) >> 8; } break; } - cf_swap_ascii(drive_param.u.driveid.model, drive_param.model); + cf_swap_ascii(cf_priv->drive_param.u.driveid.model, cf_priv->drive_param.model); - drive_param.sector_size = 512; //= SWAP_SHORT (drive_param.u.driveid.sector_bytes); - drive_param.heads = SWAP_SHORT (drive_param.u.driveid.current_heads); - drive_param.tracks = SWAP_SHORT (drive_param.u.driveid.current_cylinders); - drive_param.sec_track = SWAP_SHORT (drive_param.u.driveid.current_sectors); - drive_param.nr_sectors = (uint32_t)SWAP_SHORT (drive_param.u.driveid.lba_size_1) | - ((uint32_t)SWAP_SHORT (drive_param.u.driveid.lba_size_2)); + cf_priv->drive_param.sector_size = 512; //= SWAP_SHORT (cf_priv->drive_param.u.driveid.sector_bytes); + cf_priv->drive_param.heads = SWAP_SHORT (cf_priv->drive_param.u.driveid.current_heads); + cf_priv->drive_param.tracks = SWAP_SHORT (cf_priv->drive_param.u.driveid.current_cylinders); + cf_priv->drive_param.sec_track = SWAP_SHORT (cf_priv->drive_param.u.driveid.current_sectors); + cf_priv->drive_param.nr_sectors = (uint32_t)SWAP_SHORT (cf_priv->drive_param.u.driveid.lba_size_1) | + ((uint32_t)SWAP_SHORT (cf_priv->drive_param.u.driveid.lba_size_2)); if (bootverbose) { - printf(" model %s\n", drive_param.model); + printf(" model %s\n", cf_priv->drive_param.model); printf(" heads %d tracks %d sec_tracks %d sectors %d\n", - drive_param.heads, drive_param.tracks, - drive_param.sec_track, drive_param.nr_sectors); + cf_priv->drive_param.heads, cf_priv->drive_param.tracks, + cf_priv->drive_param.sec_track, cf_priv->drive_param.nr_sectors); } return (0); @@ -627,7 +623,7 @@ static int cf_probe (device_t dev) device_set_desc(dev, "Octeon Compact Flash Driver"); - return (cf_cmd_identify()); + return (0); } /* ------------------------------------------------------------------- * @@ -644,12 +640,12 @@ static void cf_identify (driver_t *drv, int bus_region; int count = 0; cvmx_mio_boot_reg_cfgx_t cfg; - - uint64_t phys_base = cvmx_sysinfo_get()->compact_flash_common_base_addr; - + uint64_t phys_base; + if (octeon_is_simulation()) return; + phys_base = cvmx_sysinfo_get()->compact_flash_common_base_addr; base_addr = cvmx_phys_to_ptr(phys_base); for (bus_region = 0; bus_region < 8; bus_region++) @@ -700,29 +696,19 @@ static void cf_identify (driver_t *drv, * cf_attach_geom() * * ------------------------------------------------------------------- */ -static int cf_attach_geom (void *arg, int flag) +static void cf_attach_geom (void *arg, int flag) { struct cf_priv *cf_priv; cf_priv = (struct cf_priv *) arg; cf_priv->cf_geom = g_new_geomf(&g_cf_class, "cf%d", device_get_unit(cf_priv->dev)); - cf_priv->cf_provider = g_new_providerf(cf_priv->cf_geom, cf_priv->cf_geom->name); cf_priv->cf_geom->softc = cf_priv; + cf_priv->cf_provider = g_new_providerf(cf_priv->cf_geom, cf_priv->cf_geom->name); + cf_priv->cf_provider->sectorsize = cf_priv->drive_param.sector_size; + cf_priv->cf_provider->mediasize = cf_priv->drive_param.nr_sectors * cf_priv->cf_provider->sectorsize; g_error_provider(cf_priv->cf_provider, 0); - - return (0); -} - -/* ------------------------------------------------------------------- * - * cf_attach_geom() * - * ------------------------------------------------------------------- */ -static void cf_attach_geom_proxy (void *arg, int flag) -{ - cf_attach_geom(arg, flag); } - - /* ------------------------------------------------------------------- * * cf_attach() * * ------------------------------------------------------------------- */ @@ -730,15 +716,21 @@ static void cf_attach_geom_proxy (void * static int cf_attach (device_t dev) { struct cf_priv *cf_priv; + int error; if (octeon_is_simulation()) return (ENXIO); cf_priv = device_get_softc(dev); cf_priv->dev = dev; - cf_priv->drive_param = &drive_param; - g_post_event(cf_attach_geom_proxy, cf_priv, M_WAITOK, NULL); + error = cf_cmd_identify(cf_priv); + if (error != 0) { + device_printf(dev, "cf_cmd_identify failed: %d\n", error); + return (error); + } + + g_post_event(cf_attach_geom, cf_priv, M_WAITOK, NULL); bioq_init(&cf_priv->cf_bq); return 0; From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 10:44:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D79B106566B; Wed, 21 Mar 2012 10:44:10 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 231FC8FC0A; Wed, 21 Mar 2012 10:44:09 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 2D97C2A28CD0; Wed, 21 Mar 2012 11:44:09 +0100 (CET) Date: Wed, 21 Mar 2012 11:44:09 +0100 From: Ed Schouten To: Sergey Kandaurov Message-ID: <20120321104409.GL87507@hoeg.nl> References: <201203210838.q2L8chUM062260@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nzri8VXeXB/g5ayr" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233271 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 10:44:10 -0000 --nzri8VXeXB/g5ayr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Sergey, * Sergey Kandaurov , 20120321 11:18: > Will this affect old binaries like misc/mc build for e.g. 6.x running on = GENERIC > w/o kldoaded pty(4), so that I will have to `kldload pty'? > Currently executing old mc results in emitting the following kernel messa= ge: >=20 > pid 11948 (mc) is using legacy pty devices - not logging anymore If it's dynamically linked against libc and libutil, it's not a problem. Otherwise you need to rebuild mc(1). If rebuilding mc(1) doesn't help, let me know and I'll take a look at the port. If apps print the "is using legacy pty devices" message, you probably need to load pty(4). Thanks, --=20 Ed Schouten WWW: http://80386.nl/ --nzri8VXeXB/g5ayr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iQIcBAEBAgAGBQJPabD5AAoJEG5e2P40kaK7gfAP/jq2nAvojB/Rar2jZZKwnFWr 3eL8d8LIf6vxpkc6L+OKz2wWblL1Enm/PLyk3FGeCMRo6qZbFk4HtlfTH5rHZDnK DNib1JtzU9bPJo7QVWPPn7E6Db1VShQaVn1YYM0+PQiQwiAbFWWEneJBGIE2n8rd YxpPqlBb3zjFL+EPFyVtQ4j+dYR9DlX3Fwa2v1AcRWadqtM/HzalMjPjfQHuOzT9 VjF37o/VywrGeZllUDlzVbUTiPHOipCQk/QvblOwBJXIUlpyP+su2fXmsOfwzr7f muV4h7eOJ9WF9zE09UH2Ic1nc8BI/pE43/bM+XL5+tuPY7vD/UAHhCcjpM8vCrR7 VfnOyT05B6CtmiIB/RmlFMgar24K+LssryncThWuUbtXmPPYW5ncIzny6cHJZMK6 4CgnRLwNvn2El8tPipJ+X44MNhID+usFy+wvdf39TEKogn5g8hDEHZIq+K8+mBYK f2e3YuVjQIAL5gQVhyIyVXLmbLHmwaKBigc4BaxLzfKdjVoGNnMsefkoHf1+2gEA 3kZbUtwQCha8LGgn2YsasJK7lZcNONKPGV3kN6172gY/oqWK/mO9Iy/aGxSsyDne Dq96xiKE1mtHx2c43fD9RLRBRWPwyBTnoKSJuS3RjLtsUvK3rtVMuP8RBejDj8D3 thHfFqXhnsKBJPVQKZjp =98AP -----END PGP SIGNATURE----- --nzri8VXeXB/g5ayr-- From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 11:50:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18D941065670; Wed, 21 Mar 2012 11:50:04 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 996008FC08; Wed, 21 Mar 2012 11:50:03 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q2LBo11r040964; Wed, 21 Mar 2012 12:50:02 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q2LBo1dw040963; Wed, 21 Mar 2012 12:50:01 +0100 (CET) (envelope-from marius) Date: Wed, 21 Mar 2012 12:50:01 +0100 From: Marius Strobl To: Andre Oppermann Message-ID: <20120321115001.GB37560@alchemy.franken.de> References: <201203210850.q2L8olCj062739@svn.freebsd.org> <4F699AA3.20800@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F699AA3.20800@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233273 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 11:50:04 -0000 On Wed, Mar 21, 2012 at 10:08:51AM +0100, Andre Oppermann wrote: > On 21.03.2012 09:50, Marius Strobl wrote: > >Author: marius > >Date: Wed Mar 21 08:50:47 2012 > >New Revision: 233273 > >URL: http://svn.freebsd.org/changeset/base/233273 > > > >Log: > > Exclude devices which are mutually exclusive with ATA_CAM. For better > > or worse, the former are still built as modules as part of the LINT > > builds > > > > Reviewed by: mav > > MFC after: 1 week > > Is there any schedule on deorbiting old ATA? > I'd say eventually we should as at them point in time it likely will start to collect bit rot. Currently, ATA_CAM still has some bugs and deficiencies like breaking ATAPI DMA for some controllers and generally not supporting some others (see r233274). So at present it's IMO too early to think about actually removing the !ATA_CAM bits from ata(4). Marius From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 14:31:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 200FF106566C; Wed, 21 Mar 2012 14:31:11 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id E07B68FC0A; Wed, 21 Mar 2012 14:31:10 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M1800K02OBSN100@smtpauth3.wiscmail.wisc.edu>; Wed, 21 Mar 2012 09:31:04 -0500 (CDT) Received: from wanderer.tachypleus.net (c-67-169-126-38.hsd1.ca.comcast.net [67.169.126.38]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M1800IX6OBQO600@smtpauth3.wiscmail.wisc.edu>; Wed, 21 Mar 2012 09:31:03 -0500 (CDT) Date: Wed, 21 Mar 2012 07:31:01 -0700 From: Nathan Whitehorn In-reply-to: <201203202137.q2KLbrFu039018@svn.freebsd.org> To: Jung-uk Kim Message-id: <4F69E625.9040708@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=67.169.126.38 X-Spam-PmxInfo: Server=avs-16, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.3.21.142416, SenderIP=67.169.126.38 References: <201203202137.q2KLbrFu039018@svn.freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.2) Gecko/20120220 Thunderbird/10.0.2 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233250 - in head: share/man/man4 sys/amd64/acpica sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/co... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 14:31:11 -0000 On 03/20/12 14:37, Jung-uk Kim wrote: > Author: jkim > Date: Tue Mar 20 21:37:52 2012 > New Revision: 233250 > URL: http://svn.freebsd.org/changeset/base/233250 > > Log: > Merge ACPICA 20120320. > After this, I get an endless series of "Large reference count - (increasingly large hex number) - utdelete-491" on the console when trying to boot my laptop. How should I go about trying to debug this? -Nathan From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 16:17:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DAE01065674; Wed, 21 Mar 2012 16:17:00 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08C848FC18; Wed, 21 Mar 2012 16:17:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2LGGxDm084101; Wed, 21 Mar 2012 16:16:59 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2LGGxKf084099; Wed, 21 Mar 2012 16:16:59 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201203211616.q2LGGxKf084099@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 21 Mar 2012 16:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233281 - in stable/9/sys: i386/conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 16:17:00 -0000 Author: jh Date: Wed Mar 21 16:16:59 2012 New Revision: 233281 URL: http://svn.freebsd.org/changeset/base/233281 Log: MFC r232975: Add an assert for proctree_lock to proc_to_reap(). Modified: stable/9/sys/kern/kern_exit.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/kern/kern_exit.c ============================================================================== --- stable/9/sys/kern/kern_exit.c Wed Mar 21 16:01:15 2012 (r233280) +++ stable/9/sys/kern/kern_exit.c Wed Mar 21 16:16:59 2012 (r233281) @@ -814,6 +814,8 @@ proc_to_reap(struct thread *td, struct p { struct proc *q; + sx_assert(&proctree_lock, SA_XLOCKED); + q = td->td_proc; PROC_LOCK(p); if (pid != WAIT_ANY && p->p_pid != pid && p->p_pgid != -pid) { From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 16:17:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B98A4106566B; Wed, 21 Mar 2012 16:17:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8931A8FC26; Wed, 21 Mar 2012 16:17:36 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 3569446B0A; Wed, 21 Mar 2012 12:17:36 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A4FC2B940; Wed, 21 Mar 2012 12:17:35 -0400 (EDT) From: John Baldwin To: Ed Schouten Date: Wed, 21 Mar 2012 09:42:05 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203210838.q2L8chUM062260@svn.freebsd.org> <20120321104409.GL87507@hoeg.nl> In-Reply-To: <20120321104409.GL87507@hoeg.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201203210942.05146.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 21 Mar 2012 12:17:35 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Sergey Kandaurov , src-committers@freebsd.org Subject: Re: svn commit: r233271 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 16:17:36 -0000 On Wednesday, March 21, 2012 6:44:09 am Ed Schouten wrote: > Hi Sergey, > > * Sergey Kandaurov , 20120321 11:18: > > Will this affect old binaries like misc/mc build for e.g. 6.x running on GENERIC > > w/o kldoaded pty(4), so that I will have to `kldload pty'? > > Currently executing old mc results in emitting the following kernel message: > > > > pid 11948 (mc) is using legacy pty devices - not logging anymore > > If it's dynamically linked against libc and libutil, it's not a problem. > Otherwise you need to rebuild mc(1). If rebuilding mc(1) doesn't help, > let me know and I'll take a look at the port. > > If apps print the "is using legacy pty devices" message, you probably > need to load pty(4). 6.x predates the symbol versioned libc, so even if it is dynamically linked it is still using older versions of the pty lookup routines. It will likely need pty(4) forever. Perhaps you could enable pty(4) by default if one of the relevant COMPAT_FREEBSD options is included? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 16:28:13 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 979CF1065674; Wed, 21 Mar 2012 16:28:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 2FA5D8FC1B; Wed, 21 Mar 2012 16:28:12 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q2LGS4QC032488 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Mar 2012 03:28:05 +1100 Date: Thu, 22 Mar 2012 03:28:04 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marius Strobl In-Reply-To: <201203210850.q2L8olCj062739@svn.freebsd.org> Message-ID: <20120322031550.O2453@besplex.bde.org> References: <201203210850.q2L8olCj062739@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r233273 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 16:28:13 -0000 On Wed, 21 Mar 2012, Marius Strobl wrote: > Log: > Exclude devices which are mutually exclusive with ATA_CAM. For better > or worse, the former are still built as modules as part of the LINT > builds > > Reviewed by: mav > MFC after: 1 week This breaks NOTES on these devices. The purpose of NOTES is to test as much as possible, not to provide notes. It is also supposed to test unusual cases. Thus if these unusualy devices actually conflict at compile time, then it is the usual ones that confict that should not be build by NOTES, since the usual ones get adequate testing in GENERIC. > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Wed Mar 21 08:43:38 2012 (r233272) > +++ head/sys/conf/NOTES Wed Mar 21 08:50:47 2012 (r233273) > @@ -1715,12 +1715,12 @@ device siis > # For example to build a system which only supports a VIA chipset, > # omit 'ata' and include the 'atacore', 'atapci' and 'atavia' drivers. > device ata > -device atadisk # ATA disk drives > -device ataraid # ATA RAID drives > -device atapicd # ATAPI CDROM drives > -device atapifd # ATAPI floppy drives > -device atapist # ATAPI tape drives > -device atapicam # emulate ATAPI devices as SCSI ditto via CAM > +#device atadisk # ATA disk drives > +#device ataraid # ATA RAID drives > +#device atapicd # ATAPI CDROM drives > +#device atapifd # ATAPI floppy drives > +#device atapist # ATAPI tape drives > +#device atapicam # emulate ATAPI devices as SCSI ditto via CAM > # needs CAM to be present (scbus & pass) > > # Modular ATA > This doesn't change the comment about ATA_CAM, so it is now out of date as well as misformatted. It still says that the ata peripheral devices are (only) deprecated by ATA_CAM, not mutually exclusive. For an example of normal formatting, see the "Internet family" options (except for their unsorting and shouting and misformatting of and in the non-option "WARNING". Another example of misformatting is in the SCHED* options. These have ugly ^L and ################################# delimiters, but are otherwise better formatted than the "Internet family" options. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 16:42:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B64001065677; Wed, 21 Mar 2012 16:42:01 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9815F8FC0C; Wed, 21 Mar 2012 16:42:00 +0000 (UTC) Received: by lboi15 with SMTP id i15so1284909lbo.13 for ; Wed, 21 Mar 2012 09:41:59 -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 :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JWy9Yl4mkgm1y9LbHWWV7j3KHtypw6SUETZX+vTpU7o=; b=vF8xhftpIVU6XnU8lAKpt3TsW5f2iiCa+9bLR2+MWq6Aoa161DTG5qk3zo7946GjA+ iu7tUS6cJtbeGDzALGo6+xOH9AI90qFjwfm9Q1uX6CojbnEvbv0lDn4MA+TW+3GqmpS7 y/V9iAoaJikKUo5f35ulLOhwDAaR6mF2IlyBnQDhCOqA/MNB+LN/VKWnuNmbfJveozTM MWZ9UxX1j76fkDVuts7AwgNZpg+GBqPsX+svZG519E4szbAuAI6eSFF9MlALXHwlgDQN lIWPcAbsIWN0eoWtnLhIWnTtJuGUDYNKfHw3Hu9rasMNdTAAJjOJ5tw/46eotP1OFBpq CpyA== MIME-Version: 1.0 Received: by 10.112.100.232 with SMTP id fb8mr1635689lbb.86.1332348119513; Wed, 21 Mar 2012 09:41:59 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.152.21.73 with HTTP; Wed, 21 Mar 2012 09:41:59 -0700 (PDT) In-Reply-To: <201203210942.05146.jhb@freebsd.org> References: <201203210838.q2L8chUM062260@svn.freebsd.org> <20120321104409.GL87507@hoeg.nl> <201203210942.05146.jhb@freebsd.org> Date: Wed, 21 Mar 2012 19:41:59 +0300 X-Google-Sender-Auth: 9eFtdyNTndQoAPzKsWSLDRsih9I Message-ID: From: Sergey Kandaurov To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233271 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 16:42:01 -0000 On 21 March 2012 17:42, John Baldwin wrote: > On Wednesday, March 21, 2012 6:44:09 am Ed Schouten wrote: >> Hi Sergey, >> >> * Sergey Kandaurov , 20120321 11:18: >> > Will this affect old binaries like misc/mc build for e.g. 6.x running = on > GENERIC >> > w/o kldoaded pty(4), so that I will have to `kldload pty'? >> > Currently executing old mc results in emitting the following kernel > message: >> > >> > pid 11948 (mc) is using legacy pty devices - not logging anymore >> >> If it's dynamically linked against libc and libutil, it's not a problem. >> Otherwise you need to rebuild mc(1). If rebuilding mc(1) doesn't help, >> let me know and I'll take a look at the port. >> >> If apps print the "is using legacy pty devices" message, you probably >> need to load pty(4). > > 6.x predates the symbol versioned libc, so even if it is dynamically link= ed it > is still using older versions of the pty lookup routines. =A0It will like= ly need > pty(4) forever. =A0Perhaps you could enable pty(4) by default if one of t= he > relevant COMPAT_FREEBSD options is included? > Hmm.. I just tested misc/mc on amd64 recent head (after pty removal from GENERIC) inside 6.2-RELEASE i386, and it works there without pty(4) in kernel. If I made testing right, that means nothing should be changed. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 16:56:47 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE0B01065673; Wed, 21 Mar 2012 16:56:47 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 5176A8FC17; Wed, 21 Mar 2012 16:56:47 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q2LGuj6o041946; Wed, 21 Mar 2012 17:56:45 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q2LGujDe041945; Wed, 21 Mar 2012 17:56:45 +0100 (CET) (envelope-from marius) Date: Wed, 21 Mar 2012 17:56:45 +0100 From: Marius Strobl To: Bruce Evans Message-ID: <20120321165645.GE37560@alchemy.franken.de> References: <201203210850.q2L8olCj062739@svn.freebsd.org> <20120322031550.O2453@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120322031550.O2453@besplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r233273 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 16:56:47 -0000 On Thu, Mar 22, 2012 at 03:28:04AM +1100, Bruce Evans wrote: > On Wed, 21 Mar 2012, Marius Strobl wrote: > > >Log: > > Exclude devices which are mutually exclusive with ATA_CAM. For better > > or worse, the former are still built as modules as part of the LINT > > builds > > > > Reviewed by: mav > > MFC after: 1 week > > This breaks NOTES on these devices. The purpose of NOTES is to test as > much as possible, not to provide notes. It is also supposed to test > unusual cases. Thus if these unusualy devices actually conflict at > compile time, then it is the usual ones that confict that should not > be build by NOTES, since the usual ones get adequate testing in GENERIC. As I wrote above, the unusual case (!ATA_CAM) is still built as modules as part of the LINT builds. R233271 actually was the minimal change to still build both the usual (ATA_CAM) and the unusual case as apart of the LINT builds. Marius From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 16:59:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81680106566B; Wed, 21 Mar 2012 16:59:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69EF68FC1B; Wed, 21 Mar 2012 16:59:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2LGxeaO085607; Wed, 21 Mar 2012 16:59:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2LGxdPb085573; Wed, 21 Mar 2012 16:59:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203211659.q2LGxdPb085573@svn.freebsd.org> From: Marius Strobl Date: Wed, 21 Mar 2012 16:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233282 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 16:59:40 -0000 Author: marius Date: Wed Mar 21 16:59:39 2012 New Revision: 233282 URL: http://svn.freebsd.org/changeset/base/233282 Log: - First pass at const'ifying ata(4) as appropriate. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers MFC after: 1 week Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-card.c head/sys/dev/ata/ata-cbus.c head/sys/dev/ata/ata-disk.c head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/ata-queue.c head/sys/dev/ata/ata-raid.c head/sys/dev/ata/atapi-cam.c head/sys/dev/ata/atapi-cd.c head/sys/dev/ata/atapi-fd.c head/sys/dev/ata/atapi-tape.c head/sys/dev/ata/chipsets/ata-acard.c head/sys/dev/ata/chipsets/ata-acerlabs.c head/sys/dev/ata/chipsets/ata-adaptec.c head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-amd.c head/sys/dev/ata/chipsets/ata-ati.c head/sys/dev/ata/chipsets/ata-cyrix.c head/sys/dev/ata/chipsets/ata-highpoint.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-ite.c head/sys/dev/ata/chipsets/ata-jmicron.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-national.c head/sys/dev/ata/chipsets/ata-nvidia.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-serverworks.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ata/chipsets/ata-sis.c head/sys/dev/ata/chipsets/ata-via.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/ata-all.c Wed Mar 21 16:59:39 2012 (r233282) @@ -1209,7 +1209,7 @@ ata_udelay(int interval) } #ifndef ATA_CAM -char * +const char * ata_unit2str(struct ata_device *atadev) { struct ata_channel *ch = device_get_softc(device_get_parent(atadev->dev)); Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/ata-all.h Wed Mar 21 16:59:39 2012 (r233282) @@ -622,7 +622,7 @@ int ata_identify(device_t dev); void ata_default_registers(device_t dev); void ata_modify_if_48bit(struct ata_request *request); void ata_udelay(int interval); -char *ata_unit2str(struct ata_device *atadev); +const char *ata_unit2str(struct ata_device *atadev); const char *ata_mode2str(int mode); int ata_str2mode(const char *str); const char *ata_satarev2str(int rev); @@ -649,7 +649,7 @@ void ata_timeout(struct ata_request *); void ata_catch_inflight(device_t dev); void ata_fail_requests(device_t dev); void ata_drop_requests(device_t dev); -char *ata_cmd2str(struct ata_request *request); +const char *ata_cmd2str(struct ata_request *request); /* ata-lowlevel.c: */ void ata_generic_hw(device_t dev); Modified: head/sys/dev/ata/ata-card.c ============================================================================== --- head/sys/dev/ata/ata-card.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/ata-card.c Wed Mar 21 16:59:39 2012 (r233282) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include "pccarddevs.h" -static const struct pccard_product ata_pccard_products[] = { +static const struct pccard_product const ata_pccard_products[] = { PCMCIA_CARD(FREECOM, PCCARDIDE), PCMCIA_CARD(EXP, EXPMULTIMEDIA), PCMCIA_CARD(IODATA3, CBIDE2), @@ -172,7 +172,7 @@ static device_method_t ata_pccard_method DEVMETHOD(device_attach, ata_pccard_attach), DEVMETHOD(device_detach, ata_pccard_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t ata_pccard_driver = { @@ -181,5 +181,5 @@ static driver_t ata_pccard_driver = { sizeof(struct ata_channel), }; -DRIVER_MODULE(ata, pccard, ata_pccard_driver, ata_devclass, 0, 0); +DRIVER_MODULE(ata, pccard, ata_pccard_driver, ata_devclass, NULL, NULL); MODULE_DEPEND(ata, ata, 1, 1, 1); Modified: head/sys/dev/ata/ata-cbus.c ============================================================================== --- head/sys/dev/ata/ata-cbus.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/ata-cbus.c Wed Mar 21 16:59:39 2012 (r233282) @@ -248,7 +248,7 @@ static device_method_t ata_cbus_methods[ DEVMETHOD(bus_setup_intr, ata_cbus_setup_intr), DEVMETHOD(bus_print_child, ata_cbus_print_child), - { 0, 0 } + DEVMETHOD_END }; static driver_t ata_cbus_driver = { @@ -393,7 +393,7 @@ static device_method_t ata_cbuschannel_m /* ATA methods */ DEVMETHOD(ata_locking, ata_cbuschannel_banking), #endif - { 0, 0 } + DEVMETHOD_END }; static driver_t ata_cbuschannel_driver = { @@ -402,5 +402,5 @@ static driver_t ata_cbuschannel_driver = sizeof(struct ata_channel), }; -DRIVER_MODULE(ata, atacbus, ata_cbuschannel_driver, ata_devclass, 0, 0); +DRIVER_MODULE(ata, atacbus, ata_cbuschannel_driver, ata_devclass, NULL, NULL); MODULE_DEPEND(ata, ata, 1, 1, 1); Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/ata-disk.c Wed Mar 21 16:59:39 2012 (r233282) @@ -591,7 +591,7 @@ static device_method_t ad_methods[] = { /* ATA methods */ DEVMETHOD(ata_reinit, ad_reinit), - { 0, 0 } + DEVMETHOD_END }; static driver_t ad_driver = { Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/ata-pci.c Wed Mar 21 16:59:39 2012 (r233282) @@ -595,7 +595,7 @@ static device_method_t ata_pci_methods[] DEVMETHOD(bus_print_child, ata_pci_print_child), DEVMETHOD(bus_child_location_str, ata_pci_child_location_str), - { 0, 0 } + DEVMETHOD_END }; devclass_t ata_pci_devclass; @@ -606,7 +606,7 @@ static driver_t ata_pci_driver = { sizeof(struct ata_pci_controller), }; -DRIVER_MODULE(atapci, pci, ata_pci_driver, ata_pci_devclass, 0, 0); +DRIVER_MODULE(atapci, pci, ata_pci_driver, ata_pci_devclass, NULL, NULL); MODULE_VERSION(atapci, 1); MODULE_DEPEND(atapci, ata, 1, 1, 1); @@ -773,7 +773,7 @@ static device_method_t ata_pcichannel_me #endif DEVMETHOD(ata_reset, ata_pcichannel_reset), - { 0, 0 } + DEVMETHOD_END }; driver_t ata_pcichannel_driver = { @@ -782,7 +782,7 @@ driver_t ata_pcichannel_driver = { sizeof(struct ata_channel), }; -DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, 0, 0); +DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, NULL, NULL); /* * misc support fucntions @@ -863,8 +863,8 @@ ata_set_desc(device_t dev) device_set_desc_copy(dev, buffer); } -struct ata_chip_id * -ata_match_chip(device_t dev, struct ata_chip_id *index) +const struct ata_chip_id * +ata_match_chip(device_t dev, const struct ata_chip_id *index) { uint32_t devid; uint8_t revid; @@ -879,10 +879,10 @@ ata_match_chip(device_t dev, struct ata_ return (NULL); } -struct ata_chip_id * -ata_find_chip(device_t dev, struct ata_chip_id *index, int slot) +const struct ata_chip_id * +ata_find_chip(device_t dev, const struct ata_chip_id *index, int slot) { - struct ata_chip_id *idx; + const struct ata_chip_id *idx; device_t *children; int nchildren, i; uint8_t s; @@ -904,7 +904,7 @@ ata_find_chip(device_t dev, struct ata_c return (NULL); } -char * +const char * ata_pcivendor2str(device_t dev) { switch (pci_get_vendor(dev)) { Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/ata-pci.h Wed Mar 21 16:59:39 2012 (r233282) @@ -33,7 +33,7 @@ struct ata_chip_id { int cfg1; int cfg2; u_int8_t max_dma; - char *text; + const char *text; }; #define ATA_PCI_MAX_CH 8 @@ -50,7 +50,7 @@ struct ata_pci_controller { int r_irq_rid; struct resource *r_irq; void *handle; - struct ata_chip_id *chip; + const struct ata_chip_id *chip; int legacy; int channels; int ichannels; @@ -569,15 +569,15 @@ int ata_pci_status(device_t dev); void ata_pci_hw(device_t dev); void ata_pci_dmainit(device_t dev); void ata_pci_dmafini(device_t dev); -char *ata_pcivendor2str(device_t dev); +const char *ata_pcivendor2str(device_t dev); int ata_legacy(device_t); void ata_generic_intr(void *data); int ata_generic_chipinit(device_t dev); int ata_generic_setmode(device_t dev, int target, int mode); int ata_setup_interrupt(device_t dev, void *intr_func); void ata_set_desc(device_t dev); -struct ata_chip_id *ata_match_chip(device_t dev, struct ata_chip_id *index); -struct ata_chip_id *ata_find_chip(device_t dev, struct ata_chip_id *index, int slot); +const struct ata_chip_id *ata_match_chip(device_t dev, const struct ata_chip_id *index); +const struct ata_chip_id *ata_find_chip(device_t dev, const struct ata_chip_id *index, int slot); int ata_mode2idx(int mode); /* global prototypes from chipsets/ata-*.c */ @@ -611,15 +611,14 @@ static device_method_t __CONCAT(dname,_m DEVMETHOD(pci_write_config, ata_pci_write_config), \ DEVMETHOD(bus_print_child, ata_pci_print_child), \ DEVMETHOD(bus_child_location_str, ata_pci_child_location_str), \ - { 0, 0 } \ + DEVMETHOD_END \ }; \ static driver_t __CONCAT(dname,_driver) = { \ "atapci", \ __CONCAT(dname,_methods), \ sizeof(struct ata_pci_controller) \ }; \ -DRIVER_MODULE(dname, pci, __CONCAT(dname,_driver), ata_pci_devclass, 0, 0); \ +DRIVER_MODULE(dname, pci, __CONCAT(dname,_driver), ata_pci_devclass, NULL, NULL); \ MODULE_VERSION(dname, 1); \ MODULE_DEPEND(dname, ata, 1, 1, 1); \ MODULE_DEPEND(dname, atapci, 1, 1, 1); - Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/ata-queue.c Wed Mar 21 16:59:39 2012 (r233282) @@ -684,7 +684,7 @@ ata_sort_queue(struct ata_channel *ch, s } #endif -char * +const char * ata_cmd2str(struct ata_request *request) { static char buffer[20]; Modified: head/sys/dev/ata/ata-raid.c ============================================================================== --- head/sys/dev/ata/ata-raid.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/ata-raid.c Wed Mar 21 16:59:39 2012 (r233282) @@ -4546,7 +4546,7 @@ static device_method_t ata_raid_sub_meth DEVMETHOD(device_probe, ata_raid_subdisk_probe), DEVMETHOD(device_attach, ata_raid_subdisk_attach), DEVMETHOD(device_detach, ata_raid_subdisk_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t ata_raid_sub_driver = { Modified: head/sys/dev/ata/atapi-cam.c ============================================================================== --- head/sys/dev/ata/atapi-cam.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/atapi-cam.c Wed Mar 21 16:59:39 2012 (r233282) @@ -122,7 +122,7 @@ static device_method_t atapi_cam_methods DEVMETHOD(device_attach, atapi_cam_attach), DEVMETHOD(device_detach, atapi_cam_detach), DEVMETHOD(ata_reinit, atapi_cam_reinit), - {0, 0} + DEVMETHOD_END }; static driver_t atapi_cam_driver = { Modified: head/sys/dev/ata/atapi-cd.c ============================================================================== --- head/sys/dev/ata/atapi-cd.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/atapi-cd.c Wed Mar 21 16:59:39 2012 (r233282) @@ -1899,7 +1899,7 @@ static device_method_t acd_methods[] = { /* ATA methods */ DEVMETHOD(ata_reinit, acd_reinit), - { 0, 0 } + DEVMETHOD_END }; static driver_t acd_driver = { Modified: head/sys/dev/ata/atapi-fd.c ============================================================================== --- head/sys/dev/ata/atapi-fd.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/atapi-fd.c Wed Mar 21 16:59:39 2012 (r233282) @@ -423,7 +423,7 @@ static device_method_t afd_methods[] = { /* ATA methods */ DEVMETHOD(ata_reinit, afd_reinit), - { 0, 0 } + DEVMETHOD_END }; static driver_t afd_driver = { Modified: head/sys/dev/ata/atapi-tape.c ============================================================================== --- head/sys/dev/ata/atapi-tape.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/atapi-tape.c Wed Mar 21 16:59:39 2012 (r233282) @@ -723,7 +723,7 @@ static device_method_t ast_methods[] = { /* ATA methods */ DEVMETHOD(ata_reinit, ast_reinit), - { 0, 0 } + DEVMETHOD_END }; static driver_t ast_driver = { Modified: head/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acard.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-acard.c Wed Mar 21 16:59:39 2012 (r233282) @@ -81,7 +81,7 @@ static int ata_acard_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_ATP850R, 0, ATP_OLD, 0x00, ATA_UDMA2, "ATP850" }, { ATA_ATP860A, 0, 0, 0x00, ATA_UDMA4, "ATP860A" }, { ATA_ATP860R, 0, 0, 0x00, ATA_UDMA4, "ATP860R" }, Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Wed Mar 21 16:59:39 2012 (r233282) @@ -75,7 +75,7 @@ static int ata_ali_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_ALI_5289, 0x00, 2, ALI_SATA, ATA_SA150, "M5289" }, { ATA_ALI_5288, 0x00, 4, ALI_SATA, ATA_SA300, "M5288" }, { ATA_ALI_5287, 0x00, 4, ALI_SATA, ATA_SA150, "M5287" }, @@ -304,11 +304,12 @@ ata_ali_setmode(device_t dev, int target struct ata_channel *ch = device_get_softc(dev); int devno = (ch->unit << 1) + target; int piomode; - u_int32_t piotimings[] = + static const uint32_t piotimings[] = { 0x006d0003, 0x00580002, 0x00440001, 0x00330001, 0x00310001, 0x006d0003, 0x00330001, 0x00310001 }; - u_int8_t udma[] = {0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x0f, 0x0d}; - u_int32_t word54; + static const uint8_t udma[] = {0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x0f, + 0x0d}; + uint32_t word54; mode = min(mode, ctlr->chip->max_dma); Modified: head/sys/dev/ata/chipsets/ata-adaptec.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-adaptec.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-adaptec.c Wed Mar 21 16:59:39 2012 (r233282) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #define MV_60XX 60 //must match ata_marvell.c's definition #define MV_7042 72 //must match ata_marvell.c's definition - /* * Adaptec chipset support functions */ @@ -63,7 +62,7 @@ static int ata_adaptec_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_ADAPTEC_1420, 0, 4, MV_60XX, ATA_SA300, "1420SA" }, { ATA_ADAPTEC_1430, 0, 4, MV_7042, ATA_SA300, "1430SA" }, { 0, 0, 0, 0, 0, 0}}; Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-ahci.c Wed Mar 21 16:59:39 2012 (r233282) @@ -1056,11 +1056,12 @@ static device_method_t ata_ahci_ata_meth DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, ata_pci_setup_intr), DEVMETHOD(bus_teardown_intr, ata_pci_teardown_intr), - { 0, 0 } + DEVMETHOD_END }; static driver_t ata_ahci_ata_driver = { "atapci", ata_ahci_ata_methods, sizeof(struct ata_pci_controller) }; -DRIVER_MODULE(ata_ahci_ata, atapci, ata_ahci_ata_driver, ata_pci_devclass, 0, 0); +DRIVER_MODULE(ata_ahci_ata, atapci, ata_ahci_ata_driver, ata_pci_devclass, + NULL, NULL); Modified: head/sys/dev/ata/chipsets/ata-amd.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-amd.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-amd.c Wed Mar 21 16:59:39 2012 (r233282) @@ -67,7 +67,7 @@ static int ata_amd_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_AMD756, 0x00, 0x00, 0, ATA_UDMA4, "756" }, { ATA_AMD766, 0x00, AMD_CABLE|AMD_BUG, 0, ATA_UDMA5, "766" }, { ATA_AMD768, 0x00, AMD_CABLE, 0, ATA_UDMA5, "768" }, @@ -113,8 +113,10 @@ ata_amd_setmode(device_t dev, int target struct ata_channel *ch = device_get_softc(dev); int devno = (ch->unit << 1) + target; int piomode; - u_int8_t timings[] = { 0xa8, 0x65, 0x42, 0x22, 0x20, 0xa8, 0x22, 0x20 }; - int modes[7] = { 0xc2, 0xc1, 0xc0, 0xc4, 0xc5, 0xc6, 0xc7 }; + static const uint8_t timings[] = + { 0xa8, 0x65, 0x42, 0x22, 0x20, 0xa8, 0x22, 0x20 }; + static const uint8_t modes[] = + { 0xc2, 0xc1, 0xc0, 0xc4, 0xc5, 0xc6, 0xc7 }; int reg = 0x53 - devno; mode = min(mode, ctlr->chip->max_dma); Modified: head/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ati.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-ati.c Wed Mar 21 16:59:39 2012 (r233282) @@ -58,11 +58,12 @@ static int ata_ati_ixp700_ch_attach(devi static int ata_ati_setmode(device_t dev, int target, int mode); /* misc defines */ -#define ATI_PATA 0x01 -#define ATI_SATA 0x02 +#define SII_MEMIO 1 /* must match ata_siliconimage.c's definition */ +#define SII_BUG 0x04 /* must match ata_siliconimage.c's definition */ + +#define ATI_SATA SII_MEMIO +#define ATI_PATA 0x02 #define ATI_AHCI 0x04 -#define SII_MEMIO 1 -#define SII_BUG 0x04 static int force_ahci = 1; TUNABLE_INT("hw.ahci.force", &force_ahci); @@ -74,13 +75,13 @@ static int ata_ati_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_ATI_IXP200, 0x00, ATI_PATA, 0, ATA_UDMA5, "IXP200" }, { ATA_ATI_IXP300, 0x00, ATI_PATA, 0, ATA_UDMA6, "IXP300" }, - { ATA_ATI_IXP300_S1, 0x00, ATI_SATA, 0, ATA_SA150, "IXP300" }, + { ATA_ATI_IXP300_S1, 0x00, ATI_SATA, SII_BUG, ATA_SA150, "IXP300" }, { ATA_ATI_IXP400, 0x00, ATI_PATA, 0, ATA_UDMA6, "IXP400" }, - { ATA_ATI_IXP400_S1, 0x00, ATI_SATA, 0, ATA_SA150, "IXP400" }, - { ATA_ATI_IXP400_S2, 0x00, ATI_SATA, 0, ATA_SA150, "IXP400" }, + { ATA_ATI_IXP400_S1, 0x00, ATI_SATA, SII_BUG, ATA_SA150, "IXP400" }, + { ATA_ATI_IXP400_S2, 0x00, ATI_SATA, SII_BUG, ATA_SA150, "IXP400" }, { ATA_ATI_IXP600, 0x00, ATI_PATA, 0, ATA_UDMA6, "IXP600" }, { ATA_ATI_IXP600_S1, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP600" }, { ATA_ATI_IXP700, 0x00, ATI_PATA, 0, ATA_UDMA6, "IXP700/800" }, @@ -107,10 +108,7 @@ ata_ati_probe(device_t dev) case ATI_SATA: /* * the ATI SATA controller is actually a SiI 3112 controller - * cfg values below much match those in ata-siliconimage.c */ - ctlr->chip->cfg1 = SII_MEMIO; - ctlr->chip->cfg2 = SII_BUG; ctlr->chipinit = ata_sii_chipinit; break; case ATI_AHCI: @@ -212,8 +210,8 @@ ata_ati_setmode(device_t dev, int target int devno = (ch->unit << 1) + target; int offset = (devno ^ 0x01) << 3; int piomode; - u_int8_t piotimings[] = { 0x5d, 0x47, 0x34, 0x22, 0x20 }; - u_int8_t dmatimings[] = { 0x77, 0x21, 0x20 }; + static const uint8_t piotimings[] = { 0x5d, 0x47, 0x34, 0x22, 0x20 }; + static const uint8_t dmatimings[] = { 0x77, 0x21, 0x20 }; mode = min(mode, ctlr->chip->max_dma); if (mode >= ATA_UDMA0) { Modified: head/sys/dev/ata/chipsets/ata-cyrix.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-cyrix.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-cyrix.c Wed Mar 21 16:59:39 2012 (r233282) @@ -101,10 +101,12 @@ ata_cyrix_setmode(device_t dev, int targ struct ata_channel *ch = device_get_softc(dev); int devno = (ch->unit << 1) + target; int piomode; - u_int32_t piotiming[] = + static const uint32_t piotiming[] = { 0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010 }; - u_int32_t dmatiming[] = { 0x00077771, 0x00012121, 0x00002020 }; - u_int32_t udmatiming[] = { 0x00921250, 0x00911140, 0x00911030 }; + static const uint32_t dmatiming[] = + { 0x00077771, 0x00012121, 0x00002020 }; + static const uint32_t udmatiming[] = + { 0x00921250, 0x00911140, 0x00911030 }; mode = min(mode, ATA_UDMA2); /* dont try to set the mode if we dont have the resource */ Modified: head/sys/dev/ata/chipsets/ata-highpoint.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-highpoint.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-highpoint.c Wed Mar 21 16:59:39 2012 (r233282) @@ -72,8 +72,8 @@ static int ata_highpoint_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - struct ata_chip_id *idx; - static struct ata_chip_id ids[] = + const struct ata_chip_id *idx; + static const struct ata_chip_id const ids[] = {{ ATA_HPT374, 0x07, HPT_374, 0, ATA_UDMA6, "HPT374" }, { ATA_HPT372, 0x02, HPT_372, 0, ATA_UDMA6, "HPT372N" }, { ATA_HPT372, 0x01, HPT_372, 0, ATA_UDMA6, "HPT372" }, @@ -163,8 +163,8 @@ ata_highpoint_setmode(device_t dev, int struct ata_pci_controller *ctlr = device_get_softc(parent); struct ata_channel *ch = device_get_softc(dev); int devno = (ch->unit << 1) + target; - u_int32_t timings33[][4] = { - /* HPT366 HPT370 HPT372 HPT374 mode */ + static const uint32_t timings33[][4] = { + /* HPT366 HPT370 HPT372 HPT374 mode */ { 0x40d0a7aa, 0x06914e57, 0x0d029d5e, 0x0ac1f48a }, /* PIO 0 */ { 0x40d0a7a3, 0x06914e43, 0x0d029d26, 0x0ac1f465 }, /* PIO 1 */ { 0x40d0a753, 0x06514e33, 0x0c829ca6, 0x0a81f454 }, /* PIO 2 */ Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-intel.c Wed Mar 21 16:59:39 2012 (r233282) @@ -105,7 +105,7 @@ static int ata_intel_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_I82371FB, 0, 0, 2, ATA_WDMA2, "PIIX" }, { ATA_I82371SB, 0, 0, 2, ATA_WDMA2, "PIIX3" }, { ATA_I82371AB, 0, 0, 2, ATA_UDMA2, "PIIX4" }, @@ -519,8 +519,10 @@ ata_intel_new_setmode(device_t dev, int u_int16_t reg54 = pci_read_config(parent, 0x54, 2); u_int32_t mask40 = 0, new40 = 0; u_int8_t mask44 = 0, new44 = 0; - u_int8_t timings[] = { 0x00, 0x00, 0x10, 0x21, 0x23, 0x00, 0x21, 0x23 }; - u_int8_t utimings[] = { 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02 }; + static const uint8_t timings[] = + { 0x00, 0x00, 0x10, 0x21, 0x23, 0x00, 0x21, 0x23 }; + static const uint8_t utimings[] = + { 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02 }; /* In combined mode, skip PATA stuff for SATA channel. */ if (ch->flags & ATA_SATA) Modified: head/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ite.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-ite.c Wed Mar 21 16:59:39 2012 (r233282) @@ -57,7 +57,6 @@ static int ata_ite_ch_attach(device_t de static int ata_ite_821x_setmode(device_t dev, int target, int mode); static int ata_ite_8213_setmode(device_t dev, int target, int mode); - /* * Integrated Technology Express Inc. (ITE) chipset support functions */ @@ -65,7 +64,7 @@ static int ata_ite_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_IT8213F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8213F" }, { ATA_IT8212F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8212F" }, { ATA_IT8211F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8211F" }, @@ -132,9 +131,9 @@ ata_ite_821x_setmode(device_t dev, int t int devno = (ch->unit << 1) + target; int piomode; uint8_t *timings = (uint8_t*)(&ctlr->chipset_data); - u_int8_t udmatiming[] = + static const uint8_t udmatiming[] = { 0x44, 0x42, 0x31, 0x21, 0x11, 0xa2, 0x91 }; - u_int8_t chtiming[] = + static const uint8_t chtiming[] = { 0xaa, 0xa3, 0xa1, 0x33, 0x31, 0x88, 0x32, 0x31 }; mode = min(mode, ctlr->chip->max_dma); @@ -182,8 +181,10 @@ ata_ite_8213_setmode(device_t dev, int t u_int16_t reg54 = pci_read_config(parent, 0x54, 2); u_int16_t mask40 = 0, new40 = 0; u_int8_t mask44 = 0, new44 = 0; - u_int8_t timings[] = { 0x00, 0x00, 0x10, 0x21, 0x23, 0x00, 0x21, 0x23 }; - u_int8_t utimings[] = { 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02 }; + static const uint8_t timings[] = + { 0x00, 0x00, 0x10, 0x21, 0x23, 0x00, 0x21, 0x23 }; + static const uint8_t utimings[] = + { 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02 }; mode = min(mode, ctlr->chip->max_dma); Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Wed Mar 21 16:59:39 2012 (r233282) @@ -63,8 +63,8 @@ static int ata_jmicron_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - struct ata_chip_id *idx; - static struct ata_chip_id ids[] = + const struct ata_chip_id *idx; + static const struct ata_chip_id const ids[] = {{ ATA_JMB360, 0, 1, 0, ATA_SA300, "JMB360" }, { ATA_JMB361, 0, 1, 1, ATA_UDMA6, "JMB361" }, { ATA_JMB363, 0, 2, 1, ATA_UDMA6, "JMB363" }, Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-marvell.c Wed Mar 21 16:59:39 2012 (r233282) @@ -99,7 +99,7 @@ static int ata_marvell_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_M88SX5040, 0, 4, MV_50XX, ATA_SA150, "88SX5040" }, { ATA_M88SX5041, 0, 4, MV_50XX, ATA_SA150, "88SX5041" }, { ATA_M88SX5080, 0, 8, MV_50XX, ATA_SA150, "88SX5080" }, Modified: head/sys/dev/ata/chipsets/ata-national.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-national.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-national.c Wed Mar 21 16:59:39 2012 (r233282) @@ -103,11 +103,13 @@ ata_national_setmode(device_t dev, int t struct ata_channel *ch = device_get_softc(dev); int devno = (ch->unit << 1) + target; int piomode; - u_int32_t piotiming[] = + static const uint32_t piotiming[] = { 0x9172d132, 0x21717121, 0x00803020, 0x20102010, 0x00100010, 0x9172d132, 0x20102010, 0x00100010 }; - u_int32_t dmatiming[] = { 0x80077771, 0x80012121, 0x80002020 }; - u_int32_t udmatiming[] = { 0x80921250, 0x80911140, 0x80911030 }; + static const uint32_t dmatiming[] = + { 0x80077771, 0x80012121, 0x80002020 }; + static const uint32_t udmatiming[] = + { 0x80921250, 0x80911140, 0x80911030 }; mode = min(mode, ATA_UDMA2); Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Wed Mar 21 16:59:39 2012 (r233282) @@ -75,7 +75,7 @@ static int ata_nvidia_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_NFORCE1, 0, 0, 0, ATA_UDMA5, "nForce" }, { ATA_NFORCE2, 0, 0, 0, ATA_UDMA6, "nForce2" }, { ATA_NFORCE2_PRO, 0, 0, 0, ATA_UDMA6, "nForce2 Pro" }, @@ -332,8 +332,10 @@ ata_nvidia_setmode(device_t dev, int tar struct ata_channel *ch = device_get_softc(dev); int devno = (ch->unit << 1) + target; int piomode; - u_int8_t timings[] = { 0xa8, 0x65, 0x42, 0x22, 0x20, 0xa8, 0x22, 0x20 }; - int modes[7] = { 0xc2, 0xc1, 0xc0, 0xc4, 0xc5, 0xc6, 0xc7 }; + static const uint8_t timings[] = + { 0xa8, 0x65, 0x42, 0x22, 0x20, 0xa8, 0x22, 0x20 }; + static const uint8_t modes[] = + { 0xc2, 0xc1, 0xc0, 0xc4, 0xc5, 0xc6, 0xc7 }; int reg = 0x63 - devno; mode = min(mode, ctlr->chip->max_dma); Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-promise.c Wed Mar 21 16:59:39 2012 (r233282) @@ -129,8 +129,8 @@ static int ata_promise_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - struct ata_chip_id *idx; - static struct ata_chip_id ids[] = + const struct ata_chip_id *idx; + static const struct ata_chip_id const ids[] = {{ ATA_PDC20246, 0, PR_OLD, 0x00, ATA_UDMA2, "PDC20246" }, { ATA_PDC20262, 0, PR_NEW, 0x00, ATA_UDMA4, "PDC20262" }, { ATA_PDC20263, 0, PR_NEW, 0x00, ATA_UDMA4, "PDC20263" }, @@ -454,7 +454,7 @@ ata_promise_setmode(device_t dev, int ta struct ata_pci_controller *ctlr = device_get_softc(parent); struct ata_channel *ch = device_get_softc(dev); int devno = (ch->unit << 1) + target; - u_int32_t timings[][2] = { + static const uint32_t timings[][2] = { /* PR_OLD PR_NEW mode */ { 0x004ff329, 0x004fff2f }, /* PIO 0 */ { 0x004fec25, 0x004ff82a }, /* PIO 1 */ Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Wed Mar 21 16:59:39 2012 (r233282) @@ -75,7 +75,7 @@ static int ata_serverworks_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_ROSB4, 0x00, SWKS_33, 0, ATA_WDMA2, "ROSB4" }, { ATA_CSB5, 0x92, SWKS_100, 0, ATA_UDMA5, "CSB5" }, { ATA_CSB5, 0x00, SWKS_66, 0, ATA_UDMA4, "CSB5" }, @@ -350,8 +350,8 @@ ata_serverworks_setmode(device_t dev, in int devno = (ch->unit << 1) + target; int offset = (devno ^ 0x01) << 3; int piomode; - u_int8_t piotimings[] = { 0x5d, 0x47, 0x34, 0x22, 0x20 }; - u_int8_t dmatimings[] = { 0x77, 0x21, 0x20 }; + static const uint8_t piotimings[] = { 0x5d, 0x47, 0x34, 0x22, 0x20 }; + static const uint8_t dmatimings[] = { 0x77, 0x21, 0x20 }; mode = min(mode, ctlr->chip->max_dma); if (mode >= ATA_UDMA0) { Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Wed Mar 21 16:59:39 2012 (r233282) @@ -87,7 +87,7 @@ static int ata_sii_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_SII3114, 0x00, SII_MEMIO, SII_4CH, ATA_SA150, "3114" }, { ATA_SII3512, 0x02, SII_MEMIO, 0, ATA_SA150, "3512" }, { ATA_SII3112, 0x02, SII_MEMIO, 0, ATA_SA150, "3112" }, @@ -272,10 +272,11 @@ ata_cmd_setmode(device_t dev, int target int treg = 0x54 + ((devno < 3) ? (devno << 1) : 7); int ureg = ch->unit ? 0x7b : 0x73; int piomode; - uint8_t piotimings[] = { 0xa9, 0x57, 0x44, 0x32, 0x3f, 0x87, 0x32, 0x3f }; - uint8_t udmatimings[][2] = { { 0x31, 0xc2 }, { 0x21, 0x82 }, - { 0x11, 0x42 }, { 0x25, 0x8a }, - { 0x15, 0x4a }, { 0x05, 0x0a } }; + static const uint8_t piotimings[] = + { 0xa9, 0x57, 0x44, 0x32, 0x3f, 0x87, 0x32, 0x3f }; + static const uint8_t udmatimings[][2] = + { { 0x31, 0xc2 }, { 0x21, 0x82 }, { 0x11, 0x42 }, + { 0x25, 0x8a }, { 0x15, 0x4a }, { 0x05, 0x0a } }; mode = min(mode, ctlr->chip->max_dma); if (mode >= ATA_UDMA0) { @@ -410,9 +411,11 @@ ata_sii_setmode(device_t dev, int target u_int8_t preg = 0xa4 + rego; u_int8_t dreg = 0xa8 + rego; u_int8_t ureg = 0xac + rego; - u_int16_t piotimings[] = { 0x328a, 0x2283, 0x1104, 0x10c3, 0x10c1 }; - u_int16_t dmatimings[] = { 0x2208, 0x10c2, 0x10c1 }; - u_int8_t udmatimings[] = { 0xf, 0xb, 0x7, 0x5, 0x3, 0x2, 0x1 }; + static const uint16_t piotimings[] = + { 0x328a, 0x2283, 0x1104, 0x10c3, 0x10c1 }; + static const uint16_t dmatimings[] = { 0x2208, 0x10c2, 0x10c1 }; + static const uint8_t udmatimings[] = + { 0xf, 0xb, 0x7, 0x5, 0x3, 0x2, 0x1 }; mode = min(mode, ctlr->chip->max_dma); Modified: head/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-sis.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-sis.c Wed Mar 21 16:59:39 2012 (r233282) @@ -66,7 +66,6 @@ static int ata_sis_setmode(device_t dev, #define SIS_133OLD 6 #define SIS_SATA 7 - /* * Silicon Integrated Systems Corp. (SiS) chipset support functions */ @@ -74,8 +73,8 @@ static int ata_sis_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - struct ata_chip_id *idx; - static struct ata_chip_id ids[] = + const struct ata_chip_id *idx; + static const struct ata_chip_id const ids[] = {{ ATA_SIS182, 0x00, SIS_SATA, 0, ATA_SA150, "182" }, /* south */ { ATA_SIS181, 0x00, SIS_SATA, 0, ATA_SA150, "181" }, /* south */ { ATA_SIS180, 0x00, SIS_SATA, 0, ATA_SA150, "180" }, /* south */ @@ -102,6 +101,8 @@ ata_sis_probe(device_t dev) { ATA_SIS5513, 0xc2, SIS_33, 1, ATA_UDMA2, "5513" }, { ATA_SIS5513, 0x00, SIS_33, 1, ATA_WDMA2, "5513" }, { 0, 0, 0, 0, 0, 0 }}; + static struct ata_chip_id id[] = + {{ ATA_SISSOUTH, 0x10, 0, 0, 0, "" }, { 0, 0, 0, 0, 0, 0 }}; char buffer[64]; int found = 0; @@ -114,14 +115,15 @@ ata_sis_probe(device_t dev) if (!(idx = ata_find_chip(dev, ids, -pci_get_slot(dev)))) return ENXIO; - if (idx->cfg2 && !found) { + if (idx->cfg2) { u_int8_t reg57 = pci_read_config(dev, 0x57, 1); pci_write_config(dev, 0x57, (reg57 & 0x7f), 1); if (pci_read_config(dev, PCIR_DEVVENDOR, 4) == ATA_SIS5518) { found = 1; - idx->cfg1 = SIS_133NEW; - idx->max_dma = ATA_UDMA6; + memcpy(&id[0], idx, sizeof(id[0])); + id[0].cfg1 = SIS_133NEW; + id[0].max_dma = ATA_UDMA6; sprintf(buffer, "SiS 962/963 %s controller", ata_mode2str(idx->max_dma)); } @@ -132,17 +134,13 @@ ata_sis_probe(device_t dev) pci_write_config(dev, 0x4a, (reg4a | 0x10), 1); if (pci_read_config(dev, PCIR_DEVVENDOR, 4) == ATA_SIS5517) { - struct ata_chip_id id[] = - {{ ATA_SISSOUTH, 0x10, 0, 0, 0, "" }, { 0, 0, 0, 0, 0, 0 }}; - found = 1; if (ata_find_chip(dev, id, pci_get_slot(dev))) { - idx->cfg1 = SIS_133OLD; - idx->max_dma = ATA_UDMA6; - } - else { - idx->cfg1 = SIS_100NEW; - idx->max_dma = ATA_UDMA5; + id[0].cfg1 = SIS_133OLD; + id[0].max_dma = ATA_UDMA6; + } else { + id[0].cfg1 = SIS_100NEW; + id[0].max_dma = ATA_UDMA5; } sprintf(buffer, "SiS 961 %s controller",ata_mode2str(idx->max_dma)); } @@ -151,6 +149,8 @@ ata_sis_probe(device_t dev) if (!found) sprintf(buffer,"SiS %s %s controller", idx->text, ata_mode2str(idx->max_dma)); + else + idx = &id[0]; device_set_desc_copy(dev, buffer); ctlr->chip = idx; @@ -262,7 +262,7 @@ ata_sis_setmode(device_t dev, int target switch (ctlr->chip->cfg1) { case SIS_133NEW: { - u_int32_t timings[] = + static const uint32_t timings[] = { 0x28269008, 0x0c266008, 0x04263008, 0x0c0a3008, 0x05093008, 0x22196008, 0x0c0a3008, 0x05093008, 0x050939fc, 0x050936ac, 0x0509347c, 0x0509325c, 0x0509323c, 0x0509322c, 0x0509321c}; @@ -273,7 +273,7 @@ ata_sis_setmode(device_t dev, int target break; } case SIS_133OLD: { - u_int16_t timings[] = + static const uint16_t timings[] = { 0x00cb, 0x0067, 0x0044, 0x0033, 0x0031, 0x0044, 0x0033, 0x0031, 0x8f31, 0x8a31, 0x8731, 0x8531, 0x8331, 0x8231, 0x8131 }; @@ -283,7 +283,7 @@ ata_sis_setmode(device_t dev, int target break; } case SIS_100NEW: { - u_int16_t timings[] = + static const uint16_t timings[] = { 0x00cb, 0x0067, 0x0044, 0x0033, 0x0031, 0x0044, 0x0033, 0x0031, 0x8b31, 0x8731, 0x8531, 0x8431, 0x8231, 0x8131 }; u_int16_t reg = 0x40 + (devno << 1); @@ -294,7 +294,7 @@ ata_sis_setmode(device_t dev, int target case SIS_100OLD: case SIS_66: case SIS_33: { - u_int16_t timings[] = + static const uint16_t timings[] = { 0x0c0b, 0x0607, 0x0404, 0x0303, 0x0301, 0x0404, 0x0303, 0x0301, 0xf301, 0xd301, 0xb301, 0xa301, 0x9301, 0x8301 }; u_int16_t reg = 0x40 + (devno << 1); Modified: head/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-via.c Wed Mar 21 16:16:59 2012 (r233281) +++ head/sys/dev/ata/chipsets/ata-via.c Wed Mar 21 16:59:39 2012 (r233282) @@ -82,7 +82,6 @@ static int ata_via_sata_status(device_t #define VIAAHCI 0x08 #define VIASATA 0x10 - /* * VIA Technologies Inc. chipset support functions */ @@ -90,7 +89,7 @@ static int ata_via_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_VIA82C586, 0x02, VIA33, 0x00, ATA_UDMA2, "82C586B" }, { ATA_VIA82C586, 0x00, VIA33, 0x00, ATA_WDMA2, "82C586" }, { ATA_VIA82C596, 0x12, VIA66, VIACLK, ATA_UDMA4, "82C596B" }, @@ -114,7 +113,7 @@ ata_via_probe(device_t dev) { ATA_VIAVX855, 0x00, VIA133, 0x00, ATA_UDMA6, "VX855" }, { ATA_VIAVX900, 0x00, VIA133, VIASATA, ATA_SA300, "VX900" }, { 0, 0, 0, 0, 0, 0 }}; - static struct ata_chip_id new_ids[] = + static const struct ata_chip_id const new_ids[] = {{ ATA_VIA6410, 0x00, 0, 0x00, ATA_UDMA6, "6410" }, { ATA_VIA6420, 0x00, 7, 0x00, ATA_SA150, "6420" }, { ATA_VIA6421, 0x00, 6, VIABAR, ATA_SA150, "6421" }, @@ -328,8 +327,10 @@ ata_via_new_setmode(device_t dev, int ta if ((ctlr->chip->cfg2 & VIABAR) && (ch->unit > 1)) { int piomode; - u_int8_t pio_timings[] = { 0xa8, 0x65, 0x65, 0x32, 0x20 }; - u_int8_t dma_timings[] = { 0xee, 0xe8, 0xe6, 0xe4, 0xe2, 0xe1, 0xe0 }; + static const uint8_t pio_timings[] = + { 0xa8, 0x65, 0x65, 0x32, 0x20 }; + static const uint8_t dma_timings[] = + { 0xee, 0xe8, 0xe6, 0xe4, 0xe2, 0xe1, 0xe0 }; /* This chip can't do WDMA. */ if (mode >= ATA_WDMA0 && mode < ATA_UDMA0) @@ -355,8 +356,9 @@ ata_via_old_setmode(device_t dev, int ta int devno = (ch->unit << 1) + target; int reg = 0x53 - devno; int piomode; - uint8_t timings[] = { 0xa8, 0x65, 0x42, 0x22, 0x20, 0xa8, 0x22, 0x20 }; - uint8_t modes[][7] = { + static const uint8_t timings[] = + { 0xa8, 0x65, 0x42, 0x22, 0x20, 0xa8, 0x22, 0x20 }; + static const uint8_t modes[][7] = { { 0xc2, 0xc1, 0xc0, 0x00, 0x00, 0x00, 0x00 }, /* VIA ATA33 */ { 0xee, 0xec, 0xea, 0xe9, 0xe8, 0x00, 0x00 }, /* VIA ATA66 */ { 0xf7, 0xf6, 0xf4, 0xf2, 0xf1, 0xf0, 0x00 }, /* VIA ATA100 */ From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 17:41:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 528DB1065674; Wed, 21 Mar 2012 17:41:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Konstantin Belousov Date: Wed, 21 Mar 2012 13:41:03 -0400 User-Agent: KMail/1.6.2 References: <201203202037.q2KKbNfK037014@svn.freebsd.org> <20120321100722.GP2358@deviant.kiev.zoral.com.ua> In-Reply-To: <20120321100722.GP2358@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203211341.11859.jkim@FreeBSD.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r233249 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 17:41:21 -0000 On Wednesday 21 March 2012 06:07 am, Konstantin Belousov wrote: > On Tue, Mar 20, 2012 at 08:37:23PM +0000, Jung-uk Kim wrote: > > Author: jkim > > Date: Tue Mar 20 20:37:23 2012 > > New Revision: 233249 > > URL: http://svn.freebsd.org/changeset/base/233249 > > > > Log: > > Fix another witness panic. We cannot enter critical section at > > all because AcpiEnterSleepState() executes (optional) _GTS method > > since ACPICA 20120215 (r231844). To evaluate the method, we need > > malloc(9), which may sleep. > > You papered over the issue, and not fixed it. Yes, it is a stopgap. > If sleep may happen, as it is for malloc, you cannot sleep with > interrupts turned off. This would cause a deadlock at best. I am well aware of the problem. In fact, that's why I had to merge ACPICA 20120320 rather quickly, which added a new flag to not execute _GTS method. Both _GTS and _BFS are turned off by default. You can control them with a new tunable "debug.acpi.sleep_flags" if you want. Please see the updated acpi(4). Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 17:57:18 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B52D1065670; Wed, 21 Mar 2012 17:57:18 +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 C7D328FC15; Wed, 21 Mar 2012 17:57:16 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA24497; Wed, 21 Mar 2012 19:57:08 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <4F6A1673.4050408@FreeBSD.org> Date: Wed, 21 Mar 2012 19:57:07 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.2) Gecko/20120221 Thunderbird/10.0.2 MIME-Version: 1.0 To: Jung-uk Kim References: <201203202037.q2KKbNfK037014@svn.freebsd.org> <20120321100722.GP2358@deviant.kiev.zoral.com.ua> <201203211341.11859.jkim@FreeBSD.org> In-Reply-To: <201203211341.11859.jkim@FreeBSD.org> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r233249 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 17:57:18 -0000 on 21/03/2012 19:41 Jung-uk Kim said the following: > I am well aware of the problem. In fact, that's why I had to merge > ACPICA 20120320 rather quickly, which added a new flag to not execute > _GTS method. Both _GTS and _BFS are turned off by default. You can > control them with a new tunable "debug.acpi.sleep_flags" if you want. But the bug still has to be fixed, right? Even if it takes a non-default sysctl value to give the bug a chance. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 18:06:47 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B09E106566C; Wed, 21 Mar 2012 18:06:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by mx1.freebsd.org (Postfix) with ESMTP id 1A9258FC0A; Wed, 21 Mar 2012 18:06:46 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q2LI6Xkr004171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Mar 2012 05:06:34 +1100 Date: Thu, 22 Mar 2012 05:06:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marius Strobl In-Reply-To: <20120321165645.GE37560@alchemy.franken.de> Message-ID: <20120322045351.O2789@besplex.bde.org> References: <201203210850.q2L8olCj062739@svn.freebsd.org> <20120322031550.O2453@besplex.bde.org> <20120321165645.GE37560@alchemy.franken.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r233273 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 18:06:47 -0000 On Wed, 21 Mar 2012, Marius Strobl wrote: > On Thu, Mar 22, 2012 at 03:28:04AM +1100, Bruce Evans wrote: >> On Wed, 21 Mar 2012, Marius Strobl wrote: >> >>> Log: >>> Exclude devices which are mutually exclusive with ATA_CAM. For better >>> or worse, the former are still built as modules as part of the LINT >>> builds >>> >>> Reviewed by: mav >>> MFC after: 1 week >> >> This breaks NOTES on these devices. The purpose of NOTES is to test as >> much as possible, not to provide notes. It is also supposed to test >> unusual cases. Thus if these unusualy devices actually conflict at >> compile time, then it is the usual ones that confict that should not >> be build by NOTES, since the usual ones get adequate testing in GENERIC. > > As I wrote above, the unusual case (!ATA_CAM) is still built as modules > as part of the LINT builds. R233271 actually was the minimal change to > still build both the usual (ATA_CAM) and the unusual case as apart of the > LINT builds. Not on systems which build the "correct" number of modules (that is, zero) as part of building kernels. Though LINT should arguably ignore the system's preferences for modules (as expressed by NO_MODULES in /etc/make.conf), it actually respects them, and it must not ignore the user's preferences for modules (as expressed by NO_MODULES in the environment). Bruce From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 18:52:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 874CF106566B; Wed, 21 Mar 2012 18:52:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Nathan Whitehorn Date: Wed, 21 Mar 2012 14:51:56 -0400 User-Agent: KMail/1.6.2 References: <201203202137.q2KLbrFu039018@svn.freebsd.org> <4F69E625.9040708@freebsd.org> In-Reply-To: <4F69E625.9040708@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203211451.59161.jkim@FreeBSD.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r233250 - in head: share/man/man4 sys/amd64/acpica sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/co... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 18:52:07 -0000 On Wednesday 21 March 2012 10:31 am, Nathan Whitehorn wrote: > On 03/20/12 14:37, Jung-uk Kim wrote: > > Author: jkim > > Date: Tue Mar 20 21:37:52 2012 > > New Revision: 233250 > > URL: http://svn.freebsd.org/changeset/base/233250 > > > > Log: > > Merge ACPICA 20120320. > > After this, I get an endless series of "Large reference count - > (increasingly large hex number) - utdelete-491" on the console when > trying to boot my laptop. How should I go about trying to debug > this? You need to rebuild the kernel. Add the following line to kernel configuration: options ACPI_DEBUG Then, type this from loader prompt: set debug.acpi.layer=ACPI_ALL_COMPONENTS set debug.acpi.level=ACPI_LV_ALLOCATIONS boot You will be able to trace all refcount changes. Once it boots, login and do this to turn it off: sysctl debug.acpi.layer=NONE However, I am afraid it will spit out too much information for you to interpret the data. :-( Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 19:02:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 20567106566B; Wed, 21 Mar 2012 19:02:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andriy Gapon Date: Wed, 21 Mar 2012 15:02:11 -0400 User-Agent: KMail/1.6.2 References: <201203202037.q2KKbNfK037014@svn.freebsd.org> <201203211341.11859.jkim@FreeBSD.org> <4F6A1673.4050408@FreeBSD.org> In-Reply-To: <4F6A1673.4050408@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203211502.14353.jkim@FreeBSD.org> Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r233249 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 19:02:22 -0000 On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote: > on 21/03/2012 19:41 Jung-uk Kim said the following: > > I am well aware of the problem. In fact, that's why I had to > > merge ACPICA 20120320 rather quickly, which added a new flag to > > not execute _GTS method. Both _GTS and _BFS are turned off by > > default. You can control them with a new tunable > > "debug.acpi.sleep_flags" if you want. > > But the bug still has to be fixed, right? > Even if it takes a non-default sysctl value to give the bug a > chance. Ideally, yes. However, I am not so sure if we can call it a "bug" because AcpiEnterSleepState() must be called with interrupt disabled and there is no way to change that API without breaking other OSes. We can only work around it locally or persuade upstream to find a better way to do this in ACPICA itself. Either way, it will be pretty hackish. :-( Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 19:08:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2BF7106566B; Wed, 21 Mar 2012 19:08:44 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD9E98FC17; Wed, 21 Mar 2012 19:08:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2LJ8itY089790; Wed, 21 Mar 2012 19:08:44 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2LJ8iI6089788; Wed, 21 Mar 2012 19:08:44 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201203211908.q2LJ8iI6089788@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 21 Mar 2012 19:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233283 - head/sys/dev/usb/wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 19:08:45 -0000 Author: bschmidt Date: Wed Mar 21 19:08:44 2012 New Revision: 233283 URL: http://svn.freebsd.org/changeset/base/233283 Log: Load the firmware during init not attach, as a root filesystem might not yet be available. While here, also print the firmware version. Submitted by: PseudoCylon MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Mar 21 16:59:39 2012 (r233282) +++ head/sys/dev/usb/wlan/if_run.c Wed Mar 21 19:08:44 2012 (r233283) @@ -600,12 +600,6 @@ run_attach(device_t self) sc->mac_ver, sc->mac_rev, run_get_rf(sc->rf_rev), sc->ntxchains, sc->nrxchains, ether_sprintf(sc->sc_bssid)); - if ((error = run_load_microcode(sc)) != 0) { - device_printf(sc->sc_dev, "could not load 8051 microcode\n"); - RUN_UNLOCK(sc); - goto detach; - } - RUN_UNLOCK(sc); ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); @@ -1050,8 +1044,9 @@ run_load_microcode(struct run_softc *sc) error = ETIMEDOUT; goto fail; } - device_printf(sc->sc_dev, "firmware %s loaded\n", - (base == fw->data) ? "RT2870" : "RT3071"); + device_printf(sc->sc_dev, "firmware %s ver. %u.%u loaded\n", + (base == fw->data) ? "RT2870" : "RT3071", + *(base + 4092), *(base + 4093)); fail: firmware_put(fw, FIRMWARE_UNLOAD); @@ -4677,6 +4672,11 @@ run_init_locked(struct run_softc *sc) run_stop(sc); + if (run_load_microcode(sc) != 0) { + device_printf(sc->sc_dev, "could not load 8051 microcode\n"); + goto fail; + } + for (ntries = 0; ntries < 100; ntries++) { if (run_read(sc, RT2860_ASIC_VER_ID, &tmp) != 0) goto fail; From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 19:09:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B36FD106564A; Wed, 21 Mar 2012 19:09:52 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C32A8FC08; Wed, 21 Mar 2012 19:09:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2LJ9qWM089855; Wed, 21 Mar 2012 19:09:52 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2LJ9qB2089853; Wed, 21 Mar 2012 19:09:52 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201203211909.q2LJ9qB2089853@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 21 Mar 2012 19:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233284 - head/sys/contrib/dev/run X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 19:09:52 -0000 Author: bschmidt Date: Wed Mar 21 19:09:52 2012 New Revision: 233284 URL: http://svn.freebsd.org/changeset/base/233284 Log: Update the firmware to version 0.236 Submitted by: PseudoCylon MFC after: 2 weeks Modified: head/sys/contrib/dev/run/rt2870.fw.uu Modified: head/sys/contrib/dev/run/rt2870.fw.uu ============================================================================== --- head/sys/contrib/dev/run/rt2870.fw.uu Wed Mar 21 19:08:44 2012 (r233283) +++ head/sys/contrib/dev/run/rt2870.fw.uu Wed Mar 21 19:09:52 2012 (r233284) @@ -39,70 +39,77 @@ # DAMAGE. # # This file contains two 4KB firmware, first half is RT2870 and last half -# is RT3071. On each 4KB firmware, 3rd last byte is major version number and -# 2nd last byte is minor version number. +# is RT3071. On each 4KB firmware, the last 2 bytes are CRC, 3rd last byte +# is minor version number and 4th last byte is major version number. # This file comes with -# RT2870 v. 0.17 -# RT3071 v. 0.17 +# RT2870 v. 0.236 +# RT3071 v. 0.236 begin 644 rt2870.fw.uu -M____`A`H`A`R`A!X`A,J`A,K`A-*`A-/$A-+(@(7N0(8\`(42`(3@S`%!B`- -M`Q(9R"*0`8S@,.,;Y4PPX`1_0(`"?P"0$"_O\)`!C'0(\.20`:?PD`&,X##@ -M')`!@."T`A6CX+0!$)`!A."T@0F0`8QT`?`2#<@BD`04X"#G`P(3*9!P$N#U -M5I`$!.`2"IT0V3$0O381`E`1.5$10E(10E,10E01@U41TE82,'`26W$2B7(2 -MX',3`8```!,ID'`1X/4\Y)!P$_"0!!1T@/#E5O1P`P(3*0(3(B`"`S`#'7T" -MKU82"Y&0!!1T@/#DD'`3\.56]'`#`A,I`A,BA59!T@(BD'`0X%1__[\*#9!P -M$>"T"`9U3@%U3X20`D_Y)'(I`$!.`EX"1=]5>0T#`B0#T_Y!P$.!?_Y!P$>!5)T^0#_D'`9X/[O7I`"*?`P1P2O)X`$ -MY2?T_Y`"*._PY5;T<`,"$RD"$R*0#][?CF]5?]KU82"Y&0!!1T -M@/#DD'`3\.56]'`#`A,I`A,BD'`0X/Z0WU@HZ#X/57_:]6$@N1D`04 -M=(#PY)!P$_#E5O1P`P(3*0(3(I`0`.#U5Y`0`N#U6*/@]5GE6+1P'N59M#`9 -MD`4(X$0!\/V0!07@5/OP1`3P[53^D`4(\.3U3O5/=3K_=3S_K5>O5A(+D9`$ -M%'2`\.20!$`?`B -M(N53!5 -M)_^0D`(I\#!'!*\G@`3E)_3_D`(H[_#"%"+" -M2\),Y402"IT3I0`4,P04+P@4#Q`3N2`3V6`3ZJ```!0UA4A#A4I"A4Q>Y4=D -M!F`#`A0U@!OE2,14#_5#Y4K$5`_U0N5,Q%0/]5[E1V0&<&%30P^`7(5)0X5+ -M0H5-7N5'9`9P38`;Y4G$5`_U0^5+Q%0/]4+E3<14#_5>Y4=D!G`PY4-4#T00 -M]4.`)N5'9`1@!>5'M`4&0UX$=4()Y4>T!A#E0U0/1##U0X`&TDN``M),Y/4E -MY4+$5/#_Y4-4#T_U7])@(M(5Y4\.5?5`_U -M+>4E5?5##_OS`1Y25P!74E#(`"%272;-)M@`_E7S#F -M!L)LTFV`!-)LPFWE1V0#<"$P2P;";-)M@!CE)7`#,$P1PDSE)7`%=24'@`(5 -M)=)LTFWE1[0)%.5$(.,+Y3ID`F`%Y3JT`P3";-)MY4>T"A/E.K0!!L)LTFV` -M".4Z<`32;,)M(&D'Y5X@X`*R:"!K!^5>(.$"LFH@;0?E7B#B`K)L=2Y`(&D$ -MHFB`)C!H!N5&HN*`'>5>(.($?P&``G\`Y494\/Z^\`1^`8`"?@#N;R3_DG.2 -M5>(.$$?P&``G\`Y494\/Z^\`1^`8`"?@#N;R3_ -MDG&2<)`0`."0$"SPD!`#X,.4,$`4HG&2=Z)PDG;E+A,35#_U+L)WTG:0$"_E -M+O#E1V0&<#F0`BG@5/[PY4/$5`\48`PD_F`,)`-P$\(X@`_2.(`+Y48PX@/3 -M@`'#DC@P1P6O)P(7?N4G]/\"%W[E1V0'8`_E1V0(8`GE1V0)8`,"%OV0`BG@ -M5/SPY3H48"(48"448"TD_&!))/E@%"0.<%#E1A,35#]U\`.$Y?`D_X`ZTCG" -M.(`^Y48PX@/3@!W#@!KE1C#B#50XPY0P4`9^`'\!@`1^`'\`[D\D_Y(XPCF` -M$^5&,.(#TX`!PY(YPCB`!,(XPCDP1P2O)X`$Y2?T_P(7?N5'9`Q@!N5'9`MP -M>I`"*>!4_?#E.A1@(!1@(11@*R3\8$4D^6`2)`YP2N5&$Q-4/W7P`X3E\(`I -MTCF`.N5&,.(#TX`!PY(Y@"WE1C#B#50XPY0P4`9^`'\!@`1^`'\`[D\D_Y(Y -M@`_E1C#B`].``<.2.8`"PCDP1P2O)X`$Y2?T_Y`"*._P(N5'M`L0D`(IX%3K -M\.4G5.M%1?4G(N20`BGP,$<$KT6`!.5%]/^0`BCO\"*/4-)9(H]4TE@BY/5B -MPJ_E411@2!1@9B0"8`,"&-326755`9`"HN!4?_"CX"#G(Y`$-."T`ARCX+0" -M%Z/@M`(2?R`2%Z^0$`3@5//P=5$!`AC4Y5!P!G5B`P(8U)`2`.!4`W`2?R`2 -M%Z^0`J+@5+_P=5$"`AC4Y5!P`P(8SY`"H^`PY@,"&,N0!#?@9")@`P(8RY`! -MBG1^\)`!EO"0$@1T"O#E6+1R%>59M#40Y)`%`/"C=`CPHW0!\'0#\'\!$@TJ -MD!,HX)!P&O"0$RG@D'`;\)`3*.!4\/"CX%3P\.59M#44Y3ST8`:CX%3S@!20 -M$RK@5/OP@!3E//20$RI@".!4\D4\\(`$X%3Z\)`$`>!4_?!U8@%U50+D]5&` -M">50<`5U8@/U4>5B8!7"`>3U4<)9K6*O0!(9E.5BM`,"T@/2KR+"KS`!$N20 -M`9;P]5'"6<(!?0*O0!(9E.52%&`,!&`#`AF1=5(!=54#D`0!X$0.\)!P&N"0 -M$RCPD'`;X)`3*?#E//1@".4\1`&C\(`&D!,J=`7PD!($=`/PY5BT"0$!WPD'`JX)`0'O"0$!S@]6*0$![@(.'SD!`!4#_4ZY4>T"0CE.K0#`^3U +M1N5'M`H(Y3JT`0/D]4;D_:]6$@N1T@0BD'`1X/3_D'`0X%__D'`1X%4G3Y!P +M&/"0D`(I +M\#!'!*\G@`3E)_3_D`(H[_#E5O1P`P(3N@(3LY!P$.#^D'`1X/WM^.;U5_VO +M5A(+D9`$%'2`\.20#][?6"CH/@]5?] +MKU82"Y&0!!1T@/#DD'`3\.56]'`#`A.Z`A.SD!``X/57Y/58]5F0$`/@M"@% +M=5@!@#R0$`/@M#`%=5@"@#"0$`/@M#,%=5@$@"20$`/@M#4,D!`"X+1R!758 +M"(`1D!`#X+0U"I`0`N"TDP-U6!#E6##A&9`%".!$`?#]D`4%X%3[\$0$\.U4 +M_I`%"/#D]4[U3W4Z_W4\_ZU7KU82"Y'DD'`R\,(6]5SU6O5;D'`P\*/PD`04 +M=(#PY)!P$_#E5O1P`P(3NH!WD'`0X"3_DI/D_:]6$@N1D`04=(#PY)!P$_#E +M5O1@7X!6D'`0X"3_DDK2!:U7KU82"Y&0!!1T@/#DD'`3\.56]&`\@#.0#U7*U7KU82"Y&0!!1T@/"0<##E6O"CY5OPY/5:]5N00<"7@1`'P(B+E4W`:,&`)LDTP300%1L($Y4]%3F`(Y4\53W`"%4XB(L)" +MTR(P%#"0#_D'`9X/[O7I`"*?`P1P2O)X`$Y2?T +M_Y`"*._PPA0P%F#"KY`0!.#U5Y`"*.!4!?57Y5QD`7`AY5>0$`0PX`;@5/OP +M@`3@1`3PY50$`3@1`3PTJ\BPDO"3.5$$@J=%)D`%2<$%2,(%0,0%*T@%,U@ +M%-Z@```5*85(0X5*0H5,7N5'9`9@`P(5*8`;Y4C$5`_U0^5*Q%0/]4+E3,14 +M#_5>Y4=D!G!A4T,/@%R%24.%2T*%35[E1V0&<$V`&^5)Q%0/]4/E2\14#_5" +MY4W$5`_U7N5'9`9P,.5#5`]$$/5#@";E1V0$8`7E1[0%!D->!'5"">5'M`80 +MY4-4#T0P]4.`!M)+@`+23.3U)>5"Q%3P_^5#5`]/]5_28"+2%>5')/5@"R3+ +M8`PA7"K\($TJ\BPJ^0!!3@5`Y@!-(8@`CE3D5/)/^2 +M&-*OD`04X*+DDAET'O#E7U0/]2WE)7`3,!@%Y5\@Y0LP&1GE7U0P_[\P$>4E +M<`5U)0R``A4ETFS2;8`/Y5\PY@;";-)M@`32;,)MY4=D`W`A,$L&PFS2;8`8 +MY25P`S!,$<),Y25P!74E!X`"%272;-)MY4>T"13E1"#C"^4Z9`)@!>4ZM`,$ +MPFS2;>5'M`H3Y3JT`0;";-)M@`CE.G`$TFS";2!I!^5>(.`"LF@@:P?E7B#A +M`K)J(&T'Y5X@X@*R;'4N0"!I!*)H@"8P:`;E1J+B@!WE7B#@!'\!@`)_`.5& +M5/#^OO`$?@&``GX`[F\D_Y)SDG(@:P2B:H`F,&H&Y4:BXH`=Y5X@X01_`8`" +M?P#E1E3P_K[P!'X!@`)^`.YO)/^2=9)T(&T$HFR`)N5'9`IP(C!L!N5&HN.` +M%^4ZM`$&Y4:BXX`TY48@Y`,PY0/3@`'#@"8P;`;E1J+B@!WE7B#B!'\!@`)_ +M`.5&5/#^OO`$?@&``GX`[F\D_Y)QDG"0$`#@D!`L\)`0`^##E#!`%*)QDG>B +M<))VY2X3$U0_]2["=])VD!`OY2[PY4=D!G!'D`(HX#!'`_^``O3_CR>0`BG@ +M5/[PY4/$5`\48`PD_F`,)`-P$\(X@`_2.(`+Y48PX@/3@`'#DC@P1P6O)P(8 +MG^4G]/\"&)_E1V0'8`_E1V0(8`GE1V0)8`,"&`V0`BC@,$<#_X`"]/^/)Y`" +M*>!4_/#E.A1@(A1@)11@+23\8$DD^6`4)`YP4.5&$Q-4/W7P`X3E\"3_@#K2 +M.<(X@#[E1C#B`].`'<.`&N5&,.(-5#C#E#!0!GX`?P&`!'X`?P#N3R3_DCC" +M.8`3Y48PX@/3@`'#DCG".(`$PCC".3!'!*\G@`3E)_3_`AB?Y4=D#&`)Y4=D +M"V`#`ABDD`(HX#!'`_^``O3_CR>0`BG@5/WPY3H48"`48"$48"LD_&!%)/E@ +M$B0.<$KE1A,35#]U\`.$Y?"`*=(Y@#KE1C#B`].``<.2.8`MY48PX@U4.,.4 +M,%`&?@!_`8`$?@!_`.Y/)/^2.8`/Y48PX@/3@`'#DCF``L(Y,$<$KR>`!.4G +M]/^0`BCO\"+E1[0+$)`"*>!4Z_#E)U3K147U)R+DD`(I\#!'!*]%@`3E1?3_ +MD`(H[_`BCU#262*/5-)8(N3U8L*OY5$48$@48&8D`F`#`AG^TEEU50&0`J+@ +M5'_PH^`@YR.0!#3@M`(CX+0"$G\@$AC0D!`$X%3S\'51`0(9_N50 +M<`9U8@,"&?Z0$@#@5`-P$G\@$AC0D`*BX%2_\'51`@(9_N50<`,"&?F0`J/@ +M,.8#`AGUD`0WX&0B8`,"&?60`8IT?O"0`9;PD!($=`KPY5@PXQ7DD`4`\*-T +M"/"C=`'P=`/P?P$2#2J0$RC@D'`:\)`3*>"0!4\X`1X%3[\(`4Y3STD!,J8`C@ +M5/)%//"`!.!4^O"0!`'@5/WP=6(!=54"Y/51@`GE4'`%=6(#]5'E8F`5P@'D +M]5'"6:UBKT`2&LOE8K0#`M(#TJ\BPJ\P`1+DD`&6\/51PEG"`7T"KT`2&LOE +M4A1@#`1@`P(:R'52`755`Y`$`>!$#O#E6%088!Z03^=!0N]8+D-'#U@^"T_QET%"[U@N0T +M\)`0'.#U8I`0'N`@X?.0$!S@D'`H\)`0'>"0<"GPD!`> +MX)!P*O`P2@>0<"3@1`'PP@72KR(B(@`````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` @@ -128,6 +135,72 @@ M``````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````````.SQ +M2O___P(0*`(0,@(0?0(3NP(3O`(3VP(3X!(3W"("&-H"&AH"%3P"%'"T"`9U3@%U3X20`D_Y)'(I`$!.`EX"1=]5>0T#`B0#T_Y!P$.!?_Y!P$>!5)T^0 +M#_D'`9X/[O7I`" +M*?`P1P2O)X`$Y2?T_Y`"*._PY5;T<`,"$[H"$[.0#][?CF]5?] +MKU82"ZJ0!!1T@/#DD'`3\.56]'`#`A.Z`A.SD'`0X/Z0WU@HZ#X/57 +M_:]6$@NJD`04=(#PY)!P$_#E5O1P`P(3N@(3LY`0`.#U5^3U6/59D!`#X+0H +M!758`8`\D!`#X+0P!758`H`PD!`#X+0S!758!(`DD!`#X+0U#)`0`N"T<@5U +M6`B`$9`0`^"T-0J0$`+@M),#=5@0Y5@PX1F0!0C@1`'P_9`%!>!4^_!$!/#M +M5/Z0!0CPY/5.]4]U.O]U//^M5Z]6$@NJY)!P,O#"%O5<]5KU6Y!P,/"C\)`$ +M%'2`\.200`BG@_Y!P&>#^[UZ0`BGP,$<$KR>`!.4G +M]/^0`BCO\,(4,!9@PJ^0$`3@]5>0`BC@5`7U5^5<9`%P(>57D!`$,.`&X%3[ +M\(`$X$0$\.57,.(Q!5OE6W`K!5J`)^57,.`;Y5R0$`1P!N!4^_"`!.!$!/`% +M6^5;<`L%6H`'D!`$X$0$\-*O(L)+PDSE1!(*MA29`!4G!!4C"!4#$!2M(!3- +M8!3>H```%2F%2$.%2D*%3%[E1V0&8`,"%2F`&^5(Q%0/]4/E2L14#_5"Y4S$ +M5`_U7N5'9`9P85-##X!Y4=D!G!-@!OE2<14#_5#Y4O$5`_U +M0N5-Q%0/]5[E1V0&<##E0U0/1!#U0X`FY4=D!&`%Y4>T!09#7@1U0@GE1[0& +M$.5#5`]$,/5#@`;22X`"TDSD]27E0L14\/_E0U0/3_5?TF`BTA7E1R3U8`LD +MRV`')$!P!L(5(A(8I1(57L(5PJ_"!-*O(L*OD`04X%0.8`32&(`(Y4Y%3R3_ +MDAC2KY`$%."BY)(9=![PY5]4#_4MY25P$S`8!>5?(.4+,!D9Y5]4,/^_,!'E +M)7`%=24,@`(5)=)LTFV`#^5?,.8&PFS2;8`$TFS";>5'9`-P(3!+!L)LTFV` +M&.4E<`,P3!'"3.4E<`5U)0>``A4ETFS2;>5'M`D4Y40@XPOE.F0"8`7E.K0# +M!,)LTFWE1[0*$^4ZM`$&PFS2;8`(Y3IP!-)LPFT@:0?E7B#@`K)H(&L'Y5X@ +MX0*R:B!M!^5>(.("LFQU+D`@:02B:(`F,&@&Y4:BXH`=Y5X@X`1_`8`"?P#E +M1E3P_K[P!'X!@`)^`.YO)/^25>(.$$?P&` +M`G\`Y494\/Z^\`1^`8`"?@#N;R3_DG62="!M!*)L@";E1V0*<"(P;`;E1J+C +M@!?E.K0!!N5&HN.`-.5&(.0#,.4#TX`!PX`F,&P&Y4:BXH`=Y5X@X@1_`8`" +M?P#E1E3P_K[P!'X!@`)^`.YO)/^2<9)PD!``X)`0+/"0$`/@PY0P0!2B<9)W +MHG"2=N4N$Q-4/_4NPG?2=I`0+^4N\.5'9`9P1Y`"*.`P1P/_@`+T_X\GD`(I +MX%3^\.5#Q%0/%&`,)/Y@#"0#0 +M`BG@5/SPY3H48"(48"448"TD_&!))/E@%"0.<%#E1A,35#]U\`.$Y?`D_X`Z +MTCG".(`^Y48PX@/3@!W#@!KE1C#B#50XPY0P4`9^`'\!@`1^`'\`[D\D_Y(X +MPCF`$^5&,.(#TX`!PY(YPCB`!,(XPCDP1P2O)X`$Y2?T_P(8G^5'9`Q@">5' +M9`M@`P(8I)`"*.`P1P/_@`+T_X\GD`(IX%3]\.4Z%&`@%&`A%&`K)/Q@123Y +M8!(D#G!*Y483$U0_=?`#A.7P@"G2.8`ZY48PX@/3@`'#DCF`+>5&,.(-5#C# +ME#!0!GX`?P&`!'X`?P#N3R3_DCF`#^5&,.(#TX`!PY(Y@`+".3!'!*\G@`3E +M)_3_D`(H[_`BY4>T"Q"0`BG@5.OPY2=4ZT5%]2!4^_"`%.4\])`3*F`( +MX%3R13SP@`3@5/KPD`0!X%3]\'5B`755`N3U48`)Y5!P!75B`_51Y6)@%<(! +MY/51PEFM8J]`$AK+Y6*T`P+2`]*O(L*O,`$2Y)`!EO#U4<)9P@%]`J]`$AK+ +MY5(48`P$8`,"&LAU4@%U50.0!`'@1`[PY5A4&&`>D'`:X)`3*/"0"0$!WPD'`JX)`0'O"0$!S@]6*0$![@(.'SD!`O___P(0*`(0,@(0>`(3*@(3*P(32@(33Q(32R("%[D"&/`"%$@"$X,P!08@ -M#0,2&<@BD`&,X##C&^5,,.`$?T"``G\`D!`O[_"0`8QT"/#DD`&G\)`!C.`P -MX!R0`8#@M`(5H^"T`1"0`83@M($)D`&,=`'P$@W=(I`$%.`@YP,"$RF0#U/.20!D"&`$X+0@!G5.`W5/(.3U)R*0 -M`D7?57D'`0X/]T1R57^,;OQI!P$>#_=$@E5_C&[\;D -M_:]6$@NJD`04=(#PY)!P$_#E5O1P`P(3*0(3(N5'9`=@'>5'9`A@%^5'9`E@ -M$>5'9`I@"^5'9`M@!>5'M`P(D'`1X%0/]3KE1[0)".4ZM`,#Y/5&Y4>T"@CE -M.K0!`^3U1N3]KU82"ZK2!"*0"0 -M0`BG@_Y!P&>#^[UZ0`BGP,$<$KR>` -M!.4G]/^0`BCO\.56]'`#`A,I`A,BD'`0X/Z0WXYO57_:]6$@NJD`04 -M=(#PY)!P$_#E5O1P`P(3*0(3(I!P$.#^D'`1X/WM]8*.@^#U5_VO5A(+JI`$ -M%'2`\.200$`+@]5BCX/59Y5BTO5A(+JI`$%'2`\.200<"7@1`'P -M(B+E4W`:,&`)LDTP300%1L($Y4]%3F`(Y4\53W`"%4XB(L)"TR(P%#"0#_D'`9X/[O7I`"*?`P1P2O)X`$Y2?T_Y`"*._PPA0B -MPDO"3.5$$@JV$Z4`%#,$%"\(%`\0$[D@$]E@$^J@```4-85(0X5*0H5,7N5' -M9`9@`P(4-8`;Y4C$5`_U0^5*Q%0/]4+E3,14#_5>Y4=D!G!A4T,/@%R%24.% -M2T*%35[E1V0&<$V`&^5)Q%0/]4/E2\14#_5"Y4W$5`_U7N5'9`9P,.5#5`]$ -M$/5#@";E1V0$8`7E1[0%!D->!'5"">5'M`80Y4-4#T0P]4.`!M)+@`+23.3U -M)>5"Q%3P_^5#5`]/]5_28"+2%>5')/5@"R3+8`$$A1JPA7" -MK\($TJ\BPJ^0!!3@5`Y@!-(8@`CE3D5/)/^2&-*OD`04X*+DDAET'O#E7U0/ -M]2WE)7`3,!@%Y5\@Y0LP&1GE7U0P_[\P$>4E<`5U)0R``A4ETFS2;8`/Y5\P -MY@;";-)M@`32;,)MY4=D`W`A,$L&PFS2;8`8Y25P`S!,$<),Y25P!74E!X`" -M%272;-)MY4>T"13E1"#C"^4Z9`)@!>4ZM`,$PFS2;>5'M`H3Y3JT`0;";-)M -M@`CE.G`$TFS";2!I!^5>(.`"LF@@:P?E7B#A`K)J(&T'Y5X@X@*R;'4N0"!I -M!*)H@"8P:`;E1J+B@!WE7B#B!'\!@`)_`.5&5/#^OO`$?@&``GX`[F\D_Y)S -MDG(@:P2B:H`F,&H&Y4:BXH`=Y5X@X`1_`8`"?P#E1E3P_K[P!'X!@`)^`.YO -M)/^2=9)T(&T$HFR`)N5'9`IP(C!L!N5&HN.`%^4ZM`$&Y4:BXX`TY48@Y`,P -MY0/3@`'#@"8P;`;E1J+B@!WE7B#A!'\!@`)_`.5&5/#^OO`$?@&``GX`[F\D -M_Y)QDG"0$`#@D!`L\)`0`^##E#!`%*)QDG>B<))VY2X3$U0_]2["=])VD!`O -MY2[PY4=D!G`YD`(IX%3^\.5#Q%0/%&`,)/Y@#"0#`!.4G]/\"%W[E1V0,8`;E1V0+ -M<'J0`BG@5/WPY3H48"`48"$48"LD_&!%)/E@$B0.<$KE1A,35#]U\`.$Y?"` -M*=(Y@#KE1C#B`].``<.2.8`MY48PX@U4.,.4,%`&?@!_`8`$?@!_`.Y/)/^2 -M.8`/Y48PX@/3@`'#DCF``L(Y,$<$KR>`!.4G]/^0`BCO\"+E1[0+$)`"*>!4 -MZ_#E)U3K147U)R+DD`(I\#!'!*]%@`3E1?3_D`(H[_`BCU#262*/5-)8(N3U -M8L*OY5$48$@48&8D`F`#`AC4TEEU50&0`J+@5'_PH^`@YR.0!#3@M`(CX+0"$G\@$A>OD!`$X%3S\'51`0(8U.50<`9U8@,"&-20$@#@5`-P$G\@ -M$A>OD`*BX%2_\'51`@(8U.50<`,"&,^0`J/@,.8#`AC+D`0WX&0B8`,"&,N0 -M`8IT?O"0`9;PD!($=`KPY5BT!$#O"0X"#A\Y`0'."0<"CPD!`=X)!P -M*?"0$![@D'`J\#!*!Y!P).!$`?#"!=*O(B(B```````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` @@ -212,21 +226,7 @@ M``````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````1 -"=X$` +M``````````````````````````````````````````````````````````#L +"*=(` ` end From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 20:50:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3953C106566B; Wed, 21 Mar 2012 20:50:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21CE78FC14; Wed, 21 Mar 2012 20:50:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2LKoG4o092882; Wed, 21 Mar 2012 20:50:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2LKoFYF092873; Wed, 21 Mar 2012 20:50:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203212050.q2LKoFYF092873@svn.freebsd.org> From: John Baldwin Date: Wed, 21 Mar 2012 20:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233285 - in stable/9/sys: fs/nfsclient i386/conf kern nfsclient sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 20:50:16 -0000 Author: jhb Date: Wed Mar 21 20:50:15 2012 New Revision: 233285 URL: http://svn.freebsd.org/changeset/base/233285 Log: MFC 230394,230441,230489,230552,232420: Close a race in NFS lookup processing that could result in stale name cache entries on one client when a directory was renamed on another client. The root cause for the stale entry being trusted is that each per-vnode nfsnode structure has a single 'n_ctime' timestamp used to validate positive name cache entries. However, if there are multiple entries for a single vnode, they all share a single timestamp. To fix this, extend the name cache to allow filesystems to optionally store a timestamp value in each name cache entry. The NFS clients now fetch the timestamp associated with each name cache entry and use that to validate cache hits instead of the timestamps previously stored in the nfsnode. Another part of the fix is that the NFS clients now use timestamps from the post-op attributes of RPCs when adding name cache entries rather than pulling the timestamps out of the file's attribute cache. The latter is subject to races with other lookups updating the attribute cache concurrently. Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c stable/9/sys/fs/nfsclient/nfs_clvnops.c stable/9/sys/fs/nfsclient/nfsnode.h stable/9/sys/kern/vfs_cache.c stable/9/sys/nfsclient/nfs_subs.c stable/9/sys/nfsclient/nfs_vnops.c stable/9/sys/nfsclient/nfsm_subs.h stable/9/sys/nfsclient/nfsnode.h stable/9/sys/sys/vnode.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clrpcops.c Wed Mar 21 19:09:52 2012 (r233284) +++ stable/9/sys/fs/nfsclient/nfs_clrpcops.c Wed Mar 21 20:50:15 2012 (r233285) @@ -2951,10 +2951,12 @@ nfsrpc_readdirplus(vnode_t vp, struct ui nfsattrbit_t attrbits, dattrbits; size_t tresid; u_int32_t *tl2 = NULL, fakefileno = 0xffffffff, rderr; + struct timespec dctime; KASSERT(uiop->uio_iovcnt == 1 && (uio_uio_resid(uiop) & (DIRBLKSIZ - 1)) == 0, ("nfs readdirplusrpc bad uio")); + timespecclear(&dctime); *attrflagp = 0; if (eofp != NULL) *eofp = 0; @@ -2997,6 +2999,7 @@ nfsrpc_readdirplus(vnode_t vp, struct ui #endif if (error) return (error); + dctime = nfsva.na_ctime; dotfileid = nfsva.na_fileid; NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); @@ -3134,6 +3137,8 @@ nfsrpc_readdirplus(vnode_t vp, struct ui error = nd->nd_repstat; goto nfsmout; } + if ((nd->nd_flag & ND_NFSV3) != 0 && *attrflagp != 0) + dctime = nap->na_ctime; NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED); NFSLOCKNODE(dnp); dnp->n_cookieverf.nfsuquad[0] = *tl++; @@ -3316,9 +3321,14 @@ nfsrpc_readdirplus(vnode_t vp, struct ui vtonfs_dtype(np->n_vattr.na_type); ndp->ni_vp = newvp; NFSCNHASH(cnp, HASHINIT); - if (cnp->cn_namelen <= NCHNAMLEN) { - np->n_ctime = np->n_vattr.na_ctime; - cache_enter(ndp->ni_dvp,ndp->ni_vp,cnp); + if (cnp->cn_namelen <= NCHNAMLEN && + (newvp->v_type != VDIR || + dctime.tv_sec != 0)) { + cache_enter_time(ndp->ni_dvp, + ndp->ni_vp, cnp, + &nfsva.na_ctime, + newvp->v_type != VDIR ? NULL : + &dctime); } if (unlocknewvp) vput(newvp); Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvnops.c Wed Mar 21 19:09:52 2012 (r233284) +++ stable/9/sys/fs/nfsclient/nfs_clvnops.c Wed Mar 21 20:50:15 2012 (r233285) @@ -1016,12 +1016,12 @@ nfs_lookup(struct vop_lookup_args *ap) struct vnode *newvp; struct nfsmount *nmp; struct nfsnode *np, *newnp; - int error = 0, attrflag, dattrflag, ltype; + int error = 0, attrflag, dattrflag, ltype, ncticks; struct thread *td = cnp->cn_thread; struct nfsfh *nfhp; struct nfsvattr dnfsva, nfsva; struct vattr vattr; - struct timespec dmtime; + struct timespec nctime; *vpp = NULLVP; if ((flags & ISLASTCN) && (mp->mnt_flag & MNT_RDONLY) && @@ -1042,11 +1042,24 @@ nfs_lookup(struct vop_lookup_args *ap) if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) return (error); - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup_times(dvp, vpp, cnp, &nctime, &ncticks); if (error > 0 && error != ENOENT) return (error); if (error == -1) { /* + * Lookups of "." are special and always return the + * current directory. cache_lookup() already handles + * associated locking bookkeeping, etc. + */ + if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { + /* XXX: Is this really correct? */ + if (cnp->cn_nameiop != LOOKUP && + (flags & ISLASTCN)) + cnp->cn_flags |= SAVENAME; + return (0); + } + + /* * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback @@ -1073,7 +1086,7 @@ nfs_lookup(struct vop_lookup_args *ap) } if (nfscl_nodeleg(newvp, 0) == 0 || (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_ctime, &newnp->n_ctime, ==))) { + timespeccmp(&vattr.va_ctime, &nctime, ==))) { NFSINCRGLOBAL(newnfsstats.lookupcache_hits); if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) @@ -1092,36 +1105,21 @@ nfs_lookup(struct vop_lookup_args *ap) /* * We only accept a negative hit in the cache if the * modification time of the parent directory matches - * our cached copy. Otherwise, we discard all of the - * negative cache entries for this directory. We also - * only trust -ve cache entries for less than - * nm_negative_namecache_timeout seconds. + * the cached copy in the name cache entry. + * Otherwise, we discard all of the negative cache + * entries for this directory. We also only trust + * negative cache entries for up to nm_negnametimeo + * seconds. */ - if ((u_int)(ticks - np->n_dmtime_ticks) < - (nmp->nm_negnametimeo * hz) && + if ((u_int)(ticks - ncticks) < (nmp->nm_negnametimeo * hz) && VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_mtime, &np->n_dmtime, ==)) { + timespeccmp(&vattr.va_mtime, &nctime, ==)) { NFSINCRGLOBAL(newnfsstats.lookupcache_hits); return (ENOENT); } cache_purge_negative(dvp); - mtx_lock(&np->n_mtx); - timespecclear(&np->n_dmtime); - mtx_unlock(&np->n_mtx); } - /* - * Cache the modification time of the parent directory in case - * the lookup fails and results in adding the first negative - * name cache entry for the directory. Since this is reading - * a single time_t, don't bother with locking. The - * modification time may be a bit stale, but it must be read - * before performing the lookup RPC to prevent a race where - * another lookup updates the timestamp on the directory after - * the lookup RPC has been performed on the server but before - * n_dmtime is set at the end of this function. - */ - dmtime = np->n_vattr.na_mtime; error = 0; newvp = NULLVP; NFSINCRGLOBAL(newnfsstats.lookupcache_misses); @@ -1157,30 +1155,22 @@ nfs_lookup(struct vop_lookup_args *ap) return (EJUSTRETURN); } - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE) { + if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE && + dattrflag) { /* - * Maintain n_dmtime as the modification time - * of the parent directory when the oldest -ve - * name cache entry for this directory was - * added. If a -ve cache entry has already - * been added with a newer modification time - * by a concurrent lookup, then don't bother - * adding a cache entry. The modification - * time of the directory might have changed - * due to the file this lookup failed to find - * being created. In that case a subsequent - * lookup would incorrectly use the entry - * added here instead of doing an extra - * lookup. + * Cache the modification time of the parent + * directory from the post-op attributes in + * the name cache entry. The negative cache + * entry will be ignored once the directory + * has changed. Don't bother adding the entry + * if the directory has already changed. */ mtx_lock(&np->n_mtx); - if (timespeccmp(&np->n_dmtime, &dmtime, <=)) { - if (!timespecisset(&np->n_dmtime)) { - np->n_dmtime = dmtime; - np->n_dmtime_ticks = ticks; - } + if (timespeccmp(&np->n_vattr.na_mtime, + &dnfsva.na_mtime, ==)) { mtx_unlock(&np->n_mtx); - cache_enter(dvp, NULL, cnp); + cache_enter_time(dvp, NULL, cnp, + &dnfsva.na_mtime, NULL); } else mtx_unlock(&np->n_mtx); } @@ -1279,10 +1269,10 @@ nfs_lookup(struct vop_lookup_args *ap) if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; if ((cnp->cn_flags & MAKEENTRY) && - (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN))) { - np->n_ctime = np->n_vattr.na_vattr.va_ctime; - cache_enter(dvp, newvp, cnp); - } + (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN)) && + attrflag != 0 && (newvp->v_type != VDIR || dattrflag != 0)) + cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, + newvp->v_type != VDIR ? NULL : &dnfsva.na_ctime); *vpp = newvp; return (0); } @@ -1442,8 +1432,6 @@ nfs_mknodrpc(struct vnode *dvp, struct v } } if (!error) { - if ((cnp->cn_flags & MAKEENTRY)) - cache_enter(dvp, newvp, cnp); *vpp = newvp; } else if (NFS_ISV4(dvp)) { error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, @@ -1601,8 +1589,9 @@ again: } } if (!error) { - if (cnp->cn_flags & MAKEENTRY) - cache_enter(dvp, newvp, cnp); + if ((cnp->cn_flags & MAKEENTRY) && attrflag) + cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, + NULL); *ap->a_vpp = newvp; } else if (NFS_ISV4(dvp)) { error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, @@ -1977,8 +1966,9 @@ nfs_link(struct vop_link_args *ap) * must care about lookup caching hit rate, so... */ if (VFSTONFS(vp->v_mount)->nm_negnametimeo != 0 && - (cnp->cn_flags & MAKEENTRY)) - cache_enter(tdvp, vp, cnp); + (cnp->cn_flags & MAKEENTRY) && attrflag != 0 && error == 0) { + cache_enter_time(tdvp, vp, cnp, &nfsva.na_ctime, NULL); + } if (error && NFS_ISV4(vp)) error = nfscl_maperr(cnp->cn_thread, error, (uid_t)0, (gid_t)0); @@ -2034,15 +2024,6 @@ nfs_symlink(struct vop_symlink_args *ap) error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, vap->va_gid); } else { - /* - * If negative lookup caching is enabled, I might as well - * add an entry for this node. Not necessary for correctness, - * but if negative caching is enabled, then the system - * must care about lookup caching hit rate, so... - */ - if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && - (cnp->cn_flags & MAKEENTRY)) - cache_enter(dvp, newvp, cnp); *ap->a_vpp = newvp; } @@ -2057,6 +2038,16 @@ nfs_symlink(struct vop_symlink_args *ap) mtx_unlock(&dnp->n_mtx); KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } + /* + * If negative lookup caching is enabled, I might as well + * add an entry for this node. Not necessary for correctness, + * but if negative caching is enabled, then the system + * must care about lookup caching hit rate, so... + */ + if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && + (cnp->cn_flags & MAKEENTRY) && attrflag != 0 && error == 0) { + cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, NULL); + } return (error); } @@ -2127,8 +2118,10 @@ nfs_mkdir(struct vop_mkdir_args *ap) * must care about lookup caching hit rate, so... */ if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && - (cnp->cn_flags & MAKEENTRY)) - cache_enter(dvp, newvp, cnp); + (cnp->cn_flags & MAKEENTRY) && + attrflag != 0 && dattrflag != 0) + cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, + &dnfsva.na_ctime); *ap->a_vpp = newvp; } return (error); Modified: stable/9/sys/fs/nfsclient/nfsnode.h ============================================================================== --- stable/9/sys/fs/nfsclient/nfsnode.h Wed Mar 21 19:09:52 2012 (r233284) +++ stable/9/sys/fs/nfsclient/nfsnode.h Wed Mar 21 20:50:15 2012 (r233285) @@ -99,9 +99,9 @@ struct nfsnode { time_t n_attrstamp; /* Attr. cache timestamp */ struct nfs_accesscache n_accesscache[NFS_ACCESSCACHESIZE]; struct timespec n_mtime; /* Prev modify time. */ - struct timespec n_ctime; /* Prev create time. */ - struct timespec n_dmtime; /* Prev dir modify time. */ - int n_dmtime_ticks; /* Tick of -ve cache entry */ + struct timespec n_unused0; + struct timespec n_unused1; + int n_unused2; struct nfsfh *n_fhp; /* NFS File Handle */ struct vnode *n_vnode; /* associated vnode */ struct vnode *n_dvp; /* parent vnode */ Modified: stable/9/sys/kern/vfs_cache.c ============================================================================== --- stable/9/sys/kern/vfs_cache.c Wed Mar 21 19:09:52 2012 (r233284) +++ stable/9/sys/kern/vfs_cache.c Wed Mar 21 20:50:15 2012 (r233285) @@ -103,6 +103,36 @@ struct namecache { }; /* + * struct namecache_ts repeats struct namecache layout up to the + * nc_nlen member. + * struct namecache_ts is used in place of struct namecache when time(s) need + * to be stored. The nc_dotdottime field is used when a cache entry is mapping + * both a non-dotdot directory name plus dotdot for the directory's + * parent. + */ +struct namecache_ts { + LIST_ENTRY(namecache) nc_hash; /* hash chain */ + LIST_ENTRY(namecache) nc_src; /* source vnode list */ + TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ + struct vnode *nc_dvp; /* vnode of parent of name */ + struct vnode *nc_vp; /* vnode the name refers to */ + u_char nc_flag; /* flag bits */ + u_char nc_nlen; /* length of name */ + struct timespec nc_time; /* timespec provided by fs */ + struct timespec nc_dotdottime; /* dotdot timespec provided by fs */ + int nc_ticks; /* ticks value when entry was added */ + char nc_name[0]; /* segment name + nul */ +}; + +/* + * Flags in namecache.nc_flag + */ +#define NCF_WHITE 0x01 +#define NCF_ISDOTDOT 0x02 +#define NCF_TS 0x04 +#define NCF_DTS 0x08 + +/* * Name caching works as follows: * * Names found by directory scans are retained in a cache @@ -164,20 +194,71 @@ RW_SYSINIT(vfscache, &cache_lock, "Name * fit in the small cache. */ static uma_zone_t cache_zone_small; +static uma_zone_t cache_zone_small_ts; static uma_zone_t cache_zone_large; +static uma_zone_t cache_zone_large_ts; #define CACHE_PATH_CUTOFF 35 -#define CACHE_ZONE_SMALL (sizeof(struct namecache) + CACHE_PATH_CUTOFF \ - + 1) -#define CACHE_ZONE_LARGE (sizeof(struct namecache) + NAME_MAX + 1) - -#define cache_alloc(len) uma_zalloc(((len) <= CACHE_PATH_CUTOFF) ? \ - cache_zone_small : cache_zone_large, M_WAITOK) -#define cache_free(ncp) do { \ - if (ncp != NULL) \ - uma_zfree(((ncp)->nc_nlen <= CACHE_PATH_CUTOFF) ? \ - cache_zone_small : cache_zone_large, (ncp)); \ -} while (0) + +static struct namecache * +cache_alloc(int len, int ts) +{ + + if (len > CACHE_PATH_CUTOFF) { + if (ts) + return (uma_zalloc(cache_zone_large_ts, M_WAITOK)); + else + return (uma_zalloc(cache_zone_large, M_WAITOK)); + } + if (ts) + return (uma_zalloc(cache_zone_small_ts, M_WAITOK)); + else + return (uma_zalloc(cache_zone_small, M_WAITOK)); +} + +static void +cache_free(struct namecache *ncp) +{ + int ts; + + if (ncp == NULL) + return; + ts = ncp->nc_flag & NCF_TS; + if (ncp->nc_nlen <= CACHE_PATH_CUTOFF) { + if (ts) + uma_zfree(cache_zone_small_ts, ncp); + else + uma_zfree(cache_zone_small, ncp); + } else if (ts) + uma_zfree(cache_zone_large_ts, ncp); + else + uma_zfree(cache_zone_large, ncp); +} + +static char * +nc_get_name(struct namecache *ncp) +{ + struct namecache_ts *ncp_ts; + + if ((ncp->nc_flag & NCF_TS) == 0) + return (ncp->nc_name); + ncp_ts = (struct namecache_ts *)ncp; + return (ncp_ts->nc_name); +} + +static void +cache_out_ts(struct namecache *ncp, struct timespec *tsp, int *ticksp) +{ + + KASSERT((ncp->nc_flag & NCF_TS) != 0 || + (tsp == NULL && ticksp == NULL), + ("No NCF_TS")); + + if (tsp != NULL) + *tsp = ((struct namecache_ts *)ncp)->nc_time; + if (ticksp != NULL) + *ticksp = ((struct namecache_ts *)ncp)->nc_ticks; +} static int doingcache = 1; /* 1 => enable the cache */ SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0, @@ -233,12 +314,6 @@ static int vn_fullpath1(struct thread *t static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); -/* - * Flags in namecache.nc_flag - */ -#define NCF_WHITE 0x01 -#define NCF_ISDOTDOT 0x02 - #ifdef DIAGNOSTIC /* * Grab an atomic snapshot of the name cache hash chain lengths @@ -343,10 +418,10 @@ cache_zap(ncp) #ifdef KDTRACE_HOOKS if (ncp->nc_vp != NULL) { SDT_PROBE(vfs, namecache, zap, done, ncp->nc_dvp, - ncp->nc_name, ncp->nc_vp, 0, 0); + nc_get_name(ncp), ncp->nc_vp, 0, 0); } else { SDT_PROBE(vfs, namecache, zap_negative, done, ncp->nc_dvp, - ncp->nc_name, 0, 0, 0); + nc_get_name(ncp), 0, 0, 0); } #endif vp = NULL; @@ -393,10 +468,12 @@ cache_zap(ncp) */ int -cache_lookup(dvp, vpp, cnp) +cache_lookup_times(dvp, vpp, cnp, tsp, ticksp) struct vnode *dvp; struct vnode **vpp; struct componentname *cnp; + struct timespec *tsp; + int *ticksp; { struct namecache *ncp; uint32_t hash; @@ -421,6 +498,10 @@ retry_wlocked: dothits++; SDT_PROBE(vfs, namecache, lookup, hit, dvp, ".", *vpp, 0, 0); + if (tsp != NULL) + timespecclear(tsp); + if (ticksp != NULL) + *ticksp = ticks; goto success; } if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { @@ -439,19 +520,23 @@ retry_wlocked: CACHE_WUNLOCK(); return (0); } - if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) - *vpp = dvp->v_cache_dd->nc_vp; + ncp = dvp->v_cache_dd; + if (ncp->nc_flag & NCF_ISDOTDOT) + *vpp = ncp->nc_vp; else - *vpp = dvp->v_cache_dd->nc_dvp; + *vpp = ncp->nc_dvp; /* Return failure if negative entry was found. */ - if (*vpp == NULL) { - ncp = dvp->v_cache_dd; + if (*vpp == NULL) goto negative_success; - } CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", dvp, cnp->cn_nameptr, *vpp); SDT_PROBE(vfs, namecache, lookup, hit, dvp, "..", *vpp, 0, 0); + cache_out_ts(ncp, tsp, ticksp); + if ((ncp->nc_flag & (NCF_ISDOTDOT | NCF_DTS)) == + NCF_DTS && tsp != NULL) + *tsp = ((struct namecache_ts *)ncp)-> + nc_dotdottime; goto success; } } @@ -461,7 +546,7 @@ retry_wlocked: LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { numchecks++; if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && - !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) + !bcmp(nc_get_name(ncp), cnp->cn_nameptr, ncp->nc_nlen)) break; } @@ -496,8 +581,9 @@ retry_wlocked: *vpp = ncp->nc_vp; CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", dvp, cnp->cn_nameptr, *vpp, ncp); - SDT_PROBE(vfs, namecache, lookup, hit, dvp, ncp->nc_name, + SDT_PROBE(vfs, namecache, lookup, hit, dvp, nc_get_name(ncp), *vpp, 0, 0); + cache_out_ts(ncp, tsp, ticksp); goto success; } @@ -527,8 +613,9 @@ negative_success: nchstats.ncs_neghits++; if (ncp->nc_flag & NCF_WHITE) cnp->cn_flags |= ISWHITEOUT; - SDT_PROBE(vfs, namecache, lookup, hit_negative, dvp, ncp->nc_name, + SDT_PROBE(vfs, namecache, lookup, hit_negative, dvp, nc_get_name(ncp), 0, 0, 0); + cache_out_ts(ncp, tsp, ticksp); CACHE_WUNLOCK(); return (ENOENT); @@ -615,12 +702,15 @@ unlock: * Add an entry to the cache. */ void -cache_enter(dvp, vp, cnp) +cache_enter_time(dvp, vp, cnp, tsp, dtsp) struct vnode *dvp; struct vnode *vp; struct componentname *cnp; + struct timespec *tsp; + struct timespec *dtsp; { struct namecache *ncp, *n2; + struct namecache_ts *n3; struct nchashhead *ncpp; uint32_t hash; int flag; @@ -687,13 +777,23 @@ cache_enter(dvp, vp, cnp) * Calculate the hash key and setup as much of the new * namecache entry as possible before acquiring the lock. */ - ncp = cache_alloc(cnp->cn_namelen); + ncp = cache_alloc(cnp->cn_namelen, tsp != NULL); ncp->nc_vp = vp; ncp->nc_dvp = dvp; ncp->nc_flag = flag; + if (tsp != NULL) { + n3 = (struct namecache_ts *)ncp; + n3->nc_time = *tsp; + n3->nc_ticks = ticks; + n3->nc_flag |= NCF_TS; + if (dtsp != NULL) { + n3->nc_dotdottime = *dtsp; + n3->nc_flag |= NCF_DTS; + } + } len = ncp->nc_nlen = cnp->cn_namelen; hash = fnv_32_buf(cnp->cn_nameptr, len, FNV1_32_INIT); - strlcpy(ncp->nc_name, cnp->cn_nameptr, len + 1); + strlcpy(nc_get_name(ncp), cnp->cn_nameptr, len + 1); hash = fnv_32_buf(&dvp, sizeof(dvp), hash); CACHE_WLOCK(); @@ -706,7 +806,22 @@ cache_enter(dvp, vp, cnp) LIST_FOREACH(n2, ncpp, nc_hash) { if (n2->nc_dvp == dvp && n2->nc_nlen == cnp->cn_namelen && - !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { + !bcmp(nc_get_name(n2), cnp->cn_nameptr, n2->nc_nlen)) { + if (tsp != NULL) { + KASSERT((n2->nc_flag & NCF_TS) != 0, + ("no NCF_TS")); + n3 = (struct namecache_ts *)n2; + n3->nc_time = + ((struct namecache_ts *)ncp)->nc_time; + n3->nc_ticks = + ((struct namecache_ts *)ncp)->nc_ticks; + if (dtsp != NULL) { + n3->nc_dotdottime = + ((struct namecache_ts *)ncp)-> + nc_dotdottime; + n3->nc_flag |= NCF_DTS; + } + } CACHE_WUNLOCK(); cache_free(ncp); return; @@ -735,6 +850,11 @@ cache_enter(dvp, vp, cnp) ncp->nc_flag |= NCF_WHITE; } else if (vp->v_type == VDIR) { if (flag != NCF_ISDOTDOT) { + /* + * For this case, the cache entry maps both the + * directory name in it and the name ".." for the + * directory's parent. + */ if ((n2 = vp->v_cache_dd) != NULL && (n2->nc_flag & NCF_ISDOTDOT) != 0) cache_zap(n2); @@ -764,12 +884,12 @@ cache_enter(dvp, vp, cnp) */ if (vp) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); - SDT_PROBE(vfs, namecache, enter, done, dvp, ncp->nc_name, vp, - 0, 0); + SDT_PROBE(vfs, namecache, enter, done, dvp, nc_get_name(ncp), + vp, 0, 0); } else { TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); SDT_PROBE(vfs, namecache, enter_negative, done, dvp, - ncp->nc_name, 0, 0, 0); + nc_get_name(ncp), 0, 0, 0); } if (numneg * ncnegfactor > numcache) { ncp = TAILQ_FIRST(&ncneg); @@ -791,10 +911,18 @@ nchinit(void *dummy __unused) TAILQ_INIT(&ncneg); - cache_zone_small = uma_zcreate("S VFS Cache", CACHE_ZONE_SMALL, NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); - cache_zone_large = uma_zcreate("L VFS Cache", CACHE_ZONE_LARGE, NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + cache_zone_small = uma_zcreate("S VFS Cache", + sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + cache_zone_small_ts = uma_zcreate("STS VFS Cache", + sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + cache_zone_large = uma_zcreate("L VFS Cache", + sizeof(struct namecache) + NAME_MAX + 1, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + cache_zone_large_ts = uma_zcreate("LTS VFS Cache", + sizeof(struct namecache_ts) + NAME_MAX + 1, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); } @@ -1098,9 +1226,9 @@ vn_vptocnp_locked(struct vnode **vp, str return (error); } *buflen -= ncp->nc_nlen; - memcpy(buf + *buflen, ncp->nc_name, ncp->nc_nlen); + memcpy(buf + *buflen, nc_get_name(ncp), ncp->nc_nlen); SDT_PROBE(vfs, namecache, fullpath, hit, ncp->nc_dvp, - ncp->nc_name, vp, 0, 0); + nc_get_name(ncp), vp, 0, 0); dvp = *vp; *vp = ncp->nc_dvp; vref(*vp); @@ -1273,12 +1401,35 @@ vn_commname(struct vnode *vp, char *buf, return (ENOENT); } l = min(ncp->nc_nlen, buflen - 1); - memcpy(buf, ncp->nc_name, l); + memcpy(buf, nc_get_name(ncp), l); CACHE_RUNLOCK(); buf[l] = '\0'; return (0); } +/* ABI compat shims for old kernel modules. */ +#undef cache_enter +#undef cache_lookup + +void cache_enter(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp); +int cache_lookup(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp); + +void +cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) +{ + + cache_enter_time(dvp, vp, cnp, NULL, NULL); +} + +int +cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) +{ + + return (cache_lookup_times(dvp, vpp, cnp, NULL, NULL)); +} + /* * This function updates path string to vnode's full global path * and checks the size of the new path string against the pathlen argument. Modified: stable/9/sys/nfsclient/nfs_subs.c ============================================================================== --- stable/9/sys/nfsclient/nfs_subs.c Wed Mar 21 19:09:52 2012 (r233284) +++ stable/9/sys/nfsclient/nfs_subs.c Wed Mar 21 20:50:15 2012 (r233285) @@ -978,8 +978,8 @@ nfsm_loadattr_xx(struct vnode **v, struc } int -nfsm_postop_attr_xx(struct vnode **v, int *f, struct mbuf **md, - caddr_t *dpos) +nfsm_postop_attr_xx(struct vnode **v, int *f, struct vattr *va, + struct mbuf **md, caddr_t *dpos) { u_int32_t *tl; int t1; @@ -990,7 +990,7 @@ nfsm_postop_attr_xx(struct vnode **v, in return EBADRPC; *f = fxdr_unsigned(int, *tl); if (*f != 0) { - t1 = nfs_loadattrcache(&ttvp, md, dpos, NULL, 1); + t1 = nfs_loadattrcache(&ttvp, md, dpos, va, 1); if (t1 != 0) { *f = 0; return t1; @@ -1020,7 +1020,7 @@ nfsm_wcc_data_xx(struct vnode **v, int * VTONFS(*v)->n_mtime.tv_nsec == fxdr_unsigned(u_int32_t, *(tl + 3))); mtx_unlock(&(VTONFS(*v))->n_mtx); } - t1 = nfsm_postop_attr_xx(v, &ttattrf, md, dpos); + t1 = nfsm_postop_attr_xx(v, &ttattrf, NULL, md, dpos); if (t1) return t1; if (*f) Modified: stable/9/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/9/sys/nfsclient/nfs_vnops.c Wed Mar 21 19:09:52 2012 (r233284) +++ stable/9/sys/nfsclient/nfs_vnops.c Wed Mar 21 20:50:15 2012 (r233285) @@ -912,8 +912,8 @@ nfs_lookup(struct vop_lookup_args *ap) struct vnode *dvp = ap->a_dvp; struct vnode **vpp = ap->a_vpp; struct mount *mp = dvp->v_mount; - struct vattr vattr; - struct timespec dmtime; + struct vattr dvattr, vattr; + struct timespec nctime; int flags = cnp->cn_flags; struct vnode *newvp; struct nfsmount *nmp; @@ -922,7 +922,7 @@ nfs_lookup(struct vop_lookup_args *ap) long len; nfsfh_t *fhp; struct nfsnode *np, *newnp; - int error = 0, attrflag, fhsize, ltype; + int error = 0, attrflag, dattrflag, fhsize, ltype, ncticks; int v3 = NFS_ISV3(dvp); struct thread *td = cnp->cn_thread; @@ -938,11 +938,24 @@ nfs_lookup(struct vop_lookup_args *ap) *vpp = NULLVP; return (error); } - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup_times(dvp, vpp, cnp, &nctime, &ncticks); if (error > 0 && error != ENOENT) return (error); if (error == -1) { /* + * Lookups of "." are special and always return the + * current directory. cache_lookup() already handles + * associated locking bookkeeping, etc. + */ + if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { + /* XXX: Is this really correct? */ + if (cnp->cn_nameiop != LOOKUP && + (flags & ISLASTCN)) + cnp->cn_flags |= SAVENAME; + return (0); + } + + /* * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback @@ -968,7 +981,7 @@ nfs_lookup(struct vop_lookup_args *ap) mtx_unlock(&newnp->n_mtx); } if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_ctime, &newnp->n_ctime, ==)) { + timespeccmp(&vattr.va_ctime, &nctime, ==)) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) @@ -987,36 +1000,22 @@ nfs_lookup(struct vop_lookup_args *ap) /* * We only accept a negative hit in the cache if the * modification time of the parent directory matches - * our cached copy. Otherwise, we discard all of the - * negative cache entries for this directory. We also - * only trust -ve cache entries for less than - * nm_negative_namecache_timeout seconds. + * the cached copy in the name cache entry. + * Otherwise, we discard all of the negative cache + * entries for this directory. We also only trust + * negative cache entries for up to nm_negnametimeo + * seconds. */ - if ((u_int)(ticks - np->n_dmtime_ticks) < - (nmp->nm_negnametimeo * hz) && + if ((u_int)(ticks - ncticks) < (nmp->nm_negnametimeo * hz) && VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_mtime, &np->n_dmtime, ==)) { + timespeccmp(&vattr.va_mtime, &nctime, ==)) { nfsstats.lookupcache_hits++; return (ENOENT); } cache_purge_negative(dvp); - mtx_lock(&np->n_mtx); - timespecclear(&np->n_dmtime); - mtx_unlock(&np->n_mtx); } - /* - * Cache the modification time of the parent directory in case - * the lookup fails and results in adding the first negative - * name cache entry for the directory. Since this is reading - * a single time_t, don't bother with locking. The - * modification time may be a bit stale, but it must be read - * before performing the lookup RPC to prevent a race where - * another lookup updates the timestamp on the directory after - * the lookup RPC has been performed on the server but before - * n_dmtime is set at the end of this function. - */ - dmtime = np->n_vattr.va_mtime; + attrflag = dattrflag = 0; error = 0; newvp = NULLVP; nfsstats.lookupcache_misses++; @@ -1031,7 +1030,7 @@ nfs_lookup(struct vop_lookup_args *ap) nfsm_request(dvp, NFSPROC_LOOKUP, cnp->cn_thread, cnp->cn_cred); if (error) { if (v3) { - nfsm_postop_attr(dvp, attrflag); + nfsm_postop_attr_va(dvp, dattrflag, &vattr); m_freem(mrep); } goto nfsmout; @@ -1127,17 +1126,19 @@ nfs_lookup(struct vop_lookup_args *ap) } } if (v3) { - nfsm_postop_attr(newvp, attrflag); - nfsm_postop_attr(dvp, attrflag); - } else - nfsm_loadattr(newvp, NULL); + nfsm_postop_attr_va(newvp, attrflag, &vattr); + nfsm_postop_attr_va(dvp, dattrflag, &dvattr); + } else { + nfsm_loadattr(newvp, &vattr); + attrflag = 1; + } if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; if ((cnp->cn_flags & MAKEENTRY) && - (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN))) { - np->n_ctime = np->n_vattr.va_ctime; - cache_enter(dvp, newvp, cnp); - } + (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN)) && + attrflag != 0 && (newvp->v_type != VDIR || dattrflag != 0)) + cache_enter_time(dvp, newvp, cnp, &vattr.va_ctime, + newvp->v_type != VDIR ? NULL : &dvattr.va_ctime); *vpp = newvp; m_freem(mrep); nfsmout: @@ -1164,30 +1165,22 @@ nfsmout: return (EJUSTRETURN); } - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE) { + if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE && + dattrflag) { /* - * Maintain n_dmtime as the modification time - * of the parent directory when the oldest -ve - * name cache entry for this directory was - * added. If a -ve cache entry has already - * been added with a newer modification time - * by a concurrent lookup, then don't bother - * adding a cache entry. The modification - * time of the directory might have changed - * due to the file this lookup failed to find - * being created. In that case a subsequent - * lookup would incorrectly use the entry - * added here instead of doing an extra - * lookup. + * Cache the modification time of the parent + * directory from the post-op attributes in + * the name cache entry. The negative cache + * entry will be ignored once the directory + * has changed. Don't bother adding the entry + * if the directory has already changed. */ mtx_lock(&np->n_mtx); - if (timespeccmp(&np->n_dmtime, &dmtime, <=)) { - if (!timespecisset(&np->n_dmtime)) { - np->n_dmtime = dmtime; - np->n_dmtime_ticks = ticks; - } + if (timespeccmp(&np->n_vattr.va_mtime, + &vattr.va_mtime, ==)) { mtx_unlock(&np->n_mtx); - cache_enter(dvp, NULL, cnp); + cache_enter_time(dvp, NULL, cnp, + &vattr.va_mtime, NULL); } else mtx_unlock(&np->n_mtx); } @@ -1538,8 +1531,6 @@ nfsmout: if (newvp) vput(newvp); } else { - if (cnp->cn_flags & MAKEENTRY) - cache_enter(dvp, newvp, cnp); *vpp = newvp; } mtx_lock(&(VTONFS(dvp))->n_mtx); @@ -1678,8 +1669,6 @@ nfsmout: vput(newvp); } if (!error) { - if (cnp->cn_flags & MAKEENTRY) - cache_enter(dvp, newvp, cnp); *ap->a_vpp = newvp; } mtx_lock(&(VTONFS(dvp))->n_mtx); @@ -2473,10 +2462,11 @@ nfs_readdirplusrpc(struct vnode *vp, str nfsuint64 cookie; struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsnode *dnp = VTONFS(vp), *np; + struct vattr vattr, dvattr; nfsfh_t *fhp; u_quad_t fileno; int error = 0, tlen, more_dirs = 1, blksiz = 0, doit, bigenough = 1, i; - int attrflag, fhsize; + int attrflag, dattrflag, fhsize; #ifndef nolint dp = NULL; @@ -2522,7 +2512,7 @@ nfs_readdirplusrpc(struct vnode *vp, str *tl++ = txdr_unsigned(nmp->nm_readdirsize); *tl = txdr_unsigned(nmp->nm_rsize); nfsm_request(vp, NFSPROC_READDIRPLUS, uiop->uio_td, cred); - nfsm_postop_attr(vp, attrflag); + nfsm_postop_attr_va(vp, dattrflag, &dvattr); if (error) { m_freem(mrep); goto nfsmout; @@ -2653,18 +2643,16 @@ nfs_readdirplusrpc(struct vnode *vp, str dpos = dpossav1; mdsav2 = md; md = mdsav1; - nfsm_loadattr(newvp, NULL); + nfsm_loadattr(newvp, &vattr); dpos = dpossav2; md = mdsav2; - dp->d_type = - IFTODT(VTTOIF(np->n_vattr.va_type)); + dp->d_type = IFTODT(VTTOIF(vattr.va_type)); ndp->ni_vp = newvp; - /* - * Update n_ctime so subsequent lookup - * doesn't purge entry. - */ - np->n_ctime = np->n_vattr.va_ctime; - cache_enter(ndp->ni_dvp, ndp->ni_vp, cnp); + if (newvp->v_type != VDIR || dattrflag != 0) + cache_enter_time(ndp->ni_dvp, ndp->ni_vp, + cnp, &vattr.va_ctime, + newvp->v_type != VDIR ? NULL : + &dvattr.va_ctime); } } else { /* Just skip over the file handle */ Modified: stable/9/sys/nfsclient/nfsm_subs.h ============================================================================== --- stable/9/sys/nfsclient/nfsm_subs.h Wed Mar 21 19:09:52 2012 (r233284) +++ stable/9/sys/nfsclient/nfsm_subs.h Wed Mar 21 20:50:15 2012 (r233285) @@ -152,8 +152,8 @@ int nfsm_getfh_xx(nfsfh_t **f, int *s, i caddr_t *dpos); int nfsm_loadattr_xx(struct vnode **v, struct vattr *va, struct mbuf **md, caddr_t *dpos); -int nfsm_postop_attr_xx(struct vnode **v, int *f, struct mbuf **md, - caddr_t *dpos); +int nfsm_postop_attr_xx(struct vnode **v, int *f, struct vattr *va, + struct mbuf **md, caddr_t *dpos); int nfsm_wcc_data_xx(struct vnode **v, int *f, struct mbuf **md, caddr_t *dpos); @@ -181,7 +181,14 @@ do { \ #define nfsm_postop_attr(v, f) \ do { \ int32_t t1; \ - t1 = nfsm_postop_attr_xx(&v, &f, &md, &dpos); \ + t1 = nfsm_postop_attr_xx(&v, &f, NULL, &md, &dpos); \ + nfsm_dcheck(t1, mrep); \ +} while (0) + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 20:50:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD949106568B; Wed, 21 Mar 2012 20:50:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 962E78FC0A; Wed, 21 Mar 2012 20:50:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2LKomaJ092940; Wed, 21 Mar 2012 20:50:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2LKomrA092931; Wed, 21 Mar 2012 20:50:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203212050.q2LKomrA092931@svn.freebsd.org> From: John Baldwin Date: Wed, 21 Mar 2012 20:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233286 - in stable/8/sys: fs/nfsclient i386/conf kern nfsclient sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 20:50:48 -0000 Author: jhb Date: Wed Mar 21 20:50:47 2012 New Revision: 233286 URL: http://svn.freebsd.org/changeset/base/233286 Log: MFC 230394,230441,230489,230552,232420: Close a race in NFS lookup processing that could result in stale name cache entries on one client when a directory was renamed on another client. The root cause for the stale entry being trusted is that each per-vnode nfsnode structure has a single 'n_ctime' timestamp used to validate positive name cache entries. However, if there are multiple entries for a single vnode, they all share a single timestamp. To fix this, extend the name cache to allow filesystems to optionally store a timestamp value in each name cache entry. The NFS clients now fetch the timestamp associated with each name cache entry and use that to validate cache hits instead of the timestamps previously stored in the nfsnode. Another part of the fix is that the NFS clients now use timestamps from the post-op attributes of RPCs when adding name cache entries rather than pulling the timestamps out of the file's attribute cache. The latter is subject to races with other lookups updating the attribute cache concurrently. Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c stable/8/sys/fs/nfsclient/nfs_clvnops.c stable/8/sys/fs/nfsclient/nfsnode.h stable/8/sys/kern/vfs_cache.c stable/8/sys/nfsclient/nfs_subs.c stable/8/sys/nfsclient/nfs_vnops.c stable/8/sys/nfsclient/nfsm_subs.h stable/8/sys/nfsclient/nfsnode.h stable/8/sys/sys/vnode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clrpcops.c Wed Mar 21 20:50:15 2012 (r233285) +++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c Wed Mar 21 20:50:47 2012 (r233286) @@ -2951,10 +2951,12 @@ nfsrpc_readdirplus(vnode_t vp, struct ui nfsattrbit_t attrbits, dattrbits; size_t tresid; u_int32_t *tl2 = NULL, fakefileno = 0xffffffff, rderr; + struct timespec dctime; KASSERT(uiop->uio_iovcnt == 1 && (uio_uio_resid(uiop) & (DIRBLKSIZ - 1)) == 0, ("nfs readdirplusrpc bad uio")); + timespecclear(&dctime); *attrflagp = 0; if (eofp != NULL) *eofp = 0; @@ -2997,6 +2999,7 @@ nfsrpc_readdirplus(vnode_t vp, struct ui #endif if (error) return (error); + dctime = nfsva.na_ctime; dotfileid = nfsva.na_fileid; NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); @@ -3134,6 +3137,8 @@ nfsrpc_readdirplus(vnode_t vp, struct ui error = nd->nd_repstat; goto nfsmout; } + if ((nd->nd_flag & ND_NFSV3) != 0 && *attrflagp != 0) + dctime = nap->na_ctime; NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED); NFSLOCKNODE(dnp); dnp->n_cookieverf.nfsuquad[0] = *tl++; @@ -3316,9 +3321,14 @@ nfsrpc_readdirplus(vnode_t vp, struct ui vtonfs_dtype(np->n_vattr.na_type); ndp->ni_vp = newvp; NFSCNHASH(cnp, HASHINIT); - if (cnp->cn_namelen <= NCHNAMLEN) { - np->n_ctime = np->n_vattr.na_ctime; - cache_enter(ndp->ni_dvp,ndp->ni_vp,cnp); + if (cnp->cn_namelen <= NCHNAMLEN && + (newvp->v_type != VDIR || + dctime.tv_sec != 0)) { + cache_enter_time(ndp->ni_dvp, + ndp->ni_vp, cnp, + &nfsva.na_ctime, + newvp->v_type != VDIR ? NULL : + &dctime); } if (unlocknewvp) vput(newvp); Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Wed Mar 21 20:50:15 2012 (r233285) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Wed Mar 21 20:50:47 2012 (r233286) @@ -979,12 +979,12 @@ nfs_lookup(struct vop_lookup_args *ap) struct vnode *newvp; struct nfsmount *nmp; struct nfsnode *np, *newnp; - int error = 0, attrflag, dattrflag, ltype; + int error = 0, attrflag, dattrflag, ltype, ncticks; struct thread *td = cnp->cn_thread; struct nfsfh *nfhp; struct nfsvattr dnfsva, nfsva; struct vattr vattr; - struct timespec dmtime; + struct timespec nctime; *vpp = NULLVP; if ((flags & ISLASTCN) && (mp->mnt_flag & MNT_RDONLY) && @@ -1005,11 +1005,24 @@ nfs_lookup(struct vop_lookup_args *ap) if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) return (error); - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup_times(dvp, vpp, cnp, &nctime, &ncticks); if (error > 0 && error != ENOENT) return (error); if (error == -1) { /* + * Lookups of "." are special and always return the + * current directory. cache_lookup() already handles + * associated locking bookkeeping, etc. + */ + if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { + /* XXX: Is this really correct? */ + if (cnp->cn_nameiop != LOOKUP && + (flags & ISLASTCN)) + cnp->cn_flags |= SAVENAME; + return (0); + } + + /* * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback @@ -1035,7 +1048,7 @@ nfs_lookup(struct vop_lookup_args *ap) } if (nfscl_nodeleg(newvp, 0) == 0 || (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_ctime, &newnp->n_ctime, ==))) { + timespeccmp(&vattr.va_ctime, &nctime, ==))) { NFSINCRGLOBAL(newnfsstats.lookupcache_hits); if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) @@ -1054,36 +1067,21 @@ nfs_lookup(struct vop_lookup_args *ap) /* * We only accept a negative hit in the cache if the * modification time of the parent directory matches - * our cached copy. Otherwise, we discard all of the - * negative cache entries for this directory. We also - * only trust -ve cache entries for less than - * nm_negative_namecache_timeout seconds. + * the cached copy in the name cache entry. + * Otherwise, we discard all of the negative cache + * entries for this directory. We also only trust + * negative cache entries for up to nm_negnametimeo + * seconds. */ - if ((u_int)(ticks - np->n_dmtime_ticks) < - (nmp->nm_negnametimeo * hz) && + if ((u_int)(ticks - ncticks) < (nmp->nm_negnametimeo * hz) && VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_mtime, &np->n_dmtime, ==)) { + timespeccmp(&vattr.va_mtime, &nctime, ==)) { NFSINCRGLOBAL(newnfsstats.lookupcache_hits); return (ENOENT); } cache_purge_negative(dvp); - mtx_lock(&np->n_mtx); - timespecclear(&np->n_dmtime); - mtx_unlock(&np->n_mtx); } - /* - * Cache the modification time of the parent directory in case - * the lookup fails and results in adding the first negative - * name cache entry for the directory. Since this is reading - * a single time_t, don't bother with locking. The - * modification time may be a bit stale, but it must be read - * before performing the lookup RPC to prevent a race where - * another lookup updates the timestamp on the directory after - * the lookup RPC has been performed on the server but before - * n_dmtime is set at the end of this function. - */ - dmtime = np->n_vattr.na_mtime; error = 0; newvp = NULLVP; NFSINCRGLOBAL(newnfsstats.lookupcache_misses); @@ -1119,30 +1117,22 @@ nfs_lookup(struct vop_lookup_args *ap) return (EJUSTRETURN); } - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE) { + if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE && + dattrflag) { /* - * Maintain n_dmtime as the modification time - * of the parent directory when the oldest -ve - * name cache entry for this directory was - * added. If a -ve cache entry has already - * been added with a newer modification time - * by a concurrent lookup, then don't bother - * adding a cache entry. The modification - * time of the directory might have changed - * due to the file this lookup failed to find - * being created. In that case a subsequent - * lookup would incorrectly use the entry - * added here instead of doing an extra - * lookup. + * Cache the modification time of the parent + * directory from the post-op attributes in + * the name cache entry. The negative cache + * entry will be ignored once the directory + * has changed. Don't bother adding the entry + * if the directory has already changed. */ mtx_lock(&np->n_mtx); - if (timespeccmp(&np->n_dmtime, &dmtime, <=)) { - if (!timespecisset(&np->n_dmtime)) { - np->n_dmtime = dmtime; - np->n_dmtime_ticks = ticks; - } + if (timespeccmp(&np->n_vattr.na_mtime, + &dnfsva.na_mtime, ==)) { mtx_unlock(&np->n_mtx); - cache_enter(dvp, NULL, cnp); + cache_enter_time(dvp, NULL, cnp, + &dnfsva.na_mtime, NULL); } else mtx_unlock(&np->n_mtx); } @@ -1240,10 +1230,10 @@ nfs_lookup(struct vop_lookup_args *ap) if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; if ((cnp->cn_flags & MAKEENTRY) && - (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN))) { - np->n_ctime = np->n_vattr.na_vattr.va_ctime; - cache_enter(dvp, newvp, cnp); - } + (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN)) && + attrflag != 0 && (newvp->v_type != VDIR || dattrflag != 0)) + cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, + newvp->v_type != VDIR ? NULL : &dnfsva.na_ctime); *vpp = newvp; return (0); } @@ -1403,8 +1393,6 @@ nfs_mknodrpc(struct vnode *dvp, struct v } } if (!error) { - if ((cnp->cn_flags & MAKEENTRY)) - cache_enter(dvp, newvp, cnp); *vpp = newvp; } else if (NFS_ISV4(dvp)) { error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, @@ -1549,8 +1537,9 @@ again: } } if (!error) { - if (cnp->cn_flags & MAKEENTRY) - cache_enter(dvp, newvp, cnp); + if ((cnp->cn_flags & MAKEENTRY) && attrflag) + cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, + NULL); *ap->a_vpp = newvp; } else if (NFS_ISV4(dvp)) { error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, @@ -1916,8 +1905,9 @@ nfs_link(struct vop_link_args *ap) * must care about lookup caching hit rate, so... */ if (VFSTONFS(vp->v_mount)->nm_negnametimeo != 0 && - (cnp->cn_flags & MAKEENTRY)) - cache_enter(tdvp, vp, cnp); + (cnp->cn_flags & MAKEENTRY) && attrflag != 0 && error == 0) { + cache_enter_time(tdvp, vp, cnp, &nfsva.na_ctime, NULL); + } if (error && NFS_ISV4(vp)) error = nfscl_maperr(cnp->cn_thread, error, (uid_t)0, (gid_t)0); @@ -1973,15 +1963,6 @@ nfs_symlink(struct vop_symlink_args *ap) error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, vap->va_gid); } else { - /* - * If negative lookup caching is enabled, I might as well - * add an entry for this node. Not necessary for correctness, - * but if negative caching is enabled, then the system - * must care about lookup caching hit rate, so... - */ - if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && - (cnp->cn_flags & MAKEENTRY)) - cache_enter(dvp, newvp, cnp); *ap->a_vpp = newvp; } @@ -1995,6 +1976,16 @@ nfs_symlink(struct vop_symlink_args *ap) dnp->n_attrstamp = 0; mtx_unlock(&dnp->n_mtx); } + /* + * If negative lookup caching is enabled, I might as well + * add an entry for this node. Not necessary for correctness, + * but if negative caching is enabled, then the system + * must care about lookup caching hit rate, so... + */ + if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && + (cnp->cn_flags & MAKEENTRY) && attrflag != 0 && error == 0) { + cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, NULL); + } return (error); } @@ -2064,8 +2055,10 @@ nfs_mkdir(struct vop_mkdir_args *ap) * must care about lookup caching hit rate, so... */ if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && - (cnp->cn_flags & MAKEENTRY)) - cache_enter(dvp, newvp, cnp); + (cnp->cn_flags & MAKEENTRY) && + attrflag != 0 && dattrflag != 0) + cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, + &dnfsva.na_ctime); *ap->a_vpp = newvp; } return (error); Modified: stable/8/sys/fs/nfsclient/nfsnode.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfsnode.h Wed Mar 21 20:50:15 2012 (r233285) +++ stable/8/sys/fs/nfsclient/nfsnode.h Wed Mar 21 20:50:47 2012 (r233286) @@ -107,7 +107,7 @@ struct nfsnode { struct timespec n_mtime; /* Prev modify time. */ time_t n_unused0; time_t n_unused1; - int n_dmtime_ticks; /* Tick of -ve cache entry */ + int n_unused3; time_t n_unused2; struct nfsfh *n_fhp; /* NFS File Handle */ struct vnode *n_vnode; /* associated vnode */ @@ -134,8 +134,8 @@ struct nfsnode { struct nfs_attrcache_timestamp n_unused; u_int64_t n_change; /* old Change attribute */ struct nfsv4node *n_v4; /* extra V4 stuff */ - struct timespec n_ctime; /* Prev create time. */ - struct timespec n_dmtime; /* Prev dir modify time. */ + struct timespec n_unused4; + struct timespec n_unused5; }; #define n_atim n_un1.nf_atim Modified: stable/8/sys/kern/vfs_cache.c ============================================================================== --- stable/8/sys/kern/vfs_cache.c Wed Mar 21 20:50:15 2012 (r233285) +++ stable/8/sys/kern/vfs_cache.c Wed Mar 21 20:50:47 2012 (r233286) @@ -102,6 +102,36 @@ struct namecache { }; /* + * struct namecache_ts repeats struct namecache layout up to the + * nc_nlen member. + * struct namecache_ts is used in place of struct namecache when time(s) need + * to be stored. The nc_dotdottime field is used when a cache entry is mapping + * both a non-dotdot directory name plus dotdot for the directory's + * parent. + */ +struct namecache_ts { + LIST_ENTRY(namecache) nc_hash; /* hash chain */ + LIST_ENTRY(namecache) nc_src; /* source vnode list */ + TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ + struct vnode *nc_dvp; /* vnode of parent of name */ + struct vnode *nc_vp; /* vnode the name refers to */ + u_char nc_flag; /* flag bits */ + u_char nc_nlen; /* length of name */ + struct timespec nc_time; /* timespec provided by fs */ + struct timespec nc_dotdottime; /* dotdot timespec provided by fs */ + int nc_ticks; /* ticks value when entry was added */ + char nc_name[0]; /* segment name + nul */ +}; + +/* + * Flags in namecache.nc_flag + */ +#define NCF_WHITE 0x01 +#define NCF_ISDOTDOT 0x02 +#define NCF_TS 0x04 +#define NCF_DTS 0x08 + +/* * Name caching works as follows: * * Names found by directory scans are retained in a cache @@ -165,20 +195,71 @@ RW_SYSINIT(vfscache, &cache_lock, "Name * fit in the small cache. */ static uma_zone_t cache_zone_small; +static uma_zone_t cache_zone_small_ts; static uma_zone_t cache_zone_large; +static uma_zone_t cache_zone_large_ts; #define CACHE_PATH_CUTOFF 35 -#define CACHE_ZONE_SMALL (sizeof(struct namecache) + CACHE_PATH_CUTOFF \ - + 1) -#define CACHE_ZONE_LARGE (sizeof(struct namecache) + NAME_MAX + 1) - -#define cache_alloc(len) uma_zalloc(((len) <= CACHE_PATH_CUTOFF) ? \ - cache_zone_small : cache_zone_large, M_WAITOK) -#define cache_free(ncp) do { \ - if (ncp != NULL) \ - uma_zfree(((ncp)->nc_nlen <= CACHE_PATH_CUTOFF) ? \ - cache_zone_small : cache_zone_large, (ncp)); \ -} while (0) + +static struct namecache * +cache_alloc(int len, int ts) +{ + + if (len > CACHE_PATH_CUTOFF) { + if (ts) + return (uma_zalloc(cache_zone_large_ts, M_WAITOK)); + else + return (uma_zalloc(cache_zone_large, M_WAITOK)); + } + if (ts) + return (uma_zalloc(cache_zone_small_ts, M_WAITOK)); + else + return (uma_zalloc(cache_zone_small, M_WAITOK)); +} + +static void +cache_free(struct namecache *ncp) +{ + int ts; + + if (ncp == NULL) + return; + ts = ncp->nc_flag & NCF_TS; + if (ncp->nc_nlen <= CACHE_PATH_CUTOFF) { + if (ts) + uma_zfree(cache_zone_small_ts, ncp); + else + uma_zfree(cache_zone_small, ncp); + } else if (ts) + uma_zfree(cache_zone_large_ts, ncp); + else + uma_zfree(cache_zone_large, ncp); +} + +static char * +nc_get_name(struct namecache *ncp) +{ + struct namecache_ts *ncp_ts; + + if ((ncp->nc_flag & NCF_TS) == 0) + return (ncp->nc_name); + ncp_ts = (struct namecache_ts *)ncp; + return (ncp_ts->nc_name); +} + +static void +cache_out_ts(struct namecache *ncp, struct timespec *tsp, int *ticksp) +{ + + KASSERT((ncp->nc_flag & NCF_TS) != 0 || + (tsp == NULL && ticksp == NULL), + ("No NCF_TS")); + + if (tsp != NULL) + *tsp = ((struct namecache_ts *)ncp)->nc_time; + if (ticksp != NULL) + *ticksp = ((struct namecache_ts *)ncp)->nc_ticks; +} static int doingcache = 1; /* 1 => enable the cache */ SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0, @@ -234,12 +315,6 @@ static int vn_fullpath1(struct thread *t static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); -/* - * Flags in namecache.nc_flag - */ -#define NCF_WHITE 0x01 -#define NCF_ISDOTDOT 0x02 - #ifdef DIAGNOSTIC /* * Grab an atomic snapshot of the name cache hash chain lengths @@ -344,10 +419,10 @@ cache_zap(ncp) #ifdef KDTRACE_HOOKS if (ncp->nc_vp != NULL) { SDT_PROBE(vfs, namecache, zap, done, ncp->nc_dvp, - ncp->nc_name, ncp->nc_vp, 0, 0); + nc_get_name(ncp), ncp->nc_vp, 0, 0); } else { SDT_PROBE(vfs, namecache, zap_negative, done, ncp->nc_dvp, - ncp->nc_name, 0, 0, 0); + nc_get_name(ncp), 0, 0, 0); } #endif vp = NULL; @@ -394,10 +469,12 @@ cache_zap(ncp) */ int -cache_lookup(dvp, vpp, cnp) +cache_lookup_times(dvp, vpp, cnp, tsp, ticksp) struct vnode *dvp; struct vnode **vpp; struct componentname *cnp; + struct timespec *tsp; + int *ticksp; { struct namecache *ncp; u_int32_t hash; @@ -422,6 +499,10 @@ retry_wlocked: dothits++; SDT_PROBE(vfs, namecache, lookup, hit, dvp, ".", *vpp, 0, 0); + if (tsp != NULL) + timespecclear(tsp); + if (ticksp != NULL) + *ticksp = ticks; goto success; } if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { @@ -440,19 +521,23 @@ retry_wlocked: CACHE_WUNLOCK(); return (0); } - if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) - *vpp = dvp->v_cache_dd->nc_vp; + ncp = dvp->v_cache_dd; + if (ncp->nc_flag & NCF_ISDOTDOT) + *vpp = ncp->nc_vp; else - *vpp = dvp->v_cache_dd->nc_dvp; + *vpp = ncp->nc_dvp; /* Return failure if negative entry was found. */ - if (*vpp == NULL) { - ncp = dvp->v_cache_dd; + if (*vpp == NULL) goto negative_success; - } CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", dvp, cnp->cn_nameptr, *vpp); SDT_PROBE(vfs, namecache, lookup, hit, dvp, "..", *vpp, 0, 0); + cache_out_ts(ncp, tsp, ticksp); + if ((ncp->nc_flag & (NCF_ISDOTDOT | NCF_DTS)) == + NCF_DTS && tsp != NULL) + *tsp = ((struct namecache_ts *)ncp)-> + nc_dotdottime; goto success; } } @@ -462,7 +547,7 @@ retry_wlocked: LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { numchecks++; if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && - !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) + !bcmp(nc_get_name(ncp), cnp->cn_nameptr, ncp->nc_nlen)) break; } @@ -497,8 +582,9 @@ retry_wlocked: *vpp = ncp->nc_vp; CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", dvp, cnp->cn_nameptr, *vpp, ncp); - SDT_PROBE(vfs, namecache, lookup, hit, dvp, ncp->nc_name, + SDT_PROBE(vfs, namecache, lookup, hit, dvp, nc_get_name(ncp), *vpp, 0, 0); + cache_out_ts(ncp, tsp, ticksp); goto success; } @@ -528,8 +614,9 @@ negative_success: nchstats.ncs_neghits++; if (ncp->nc_flag & NCF_WHITE) cnp->cn_flags |= ISWHITEOUT; - SDT_PROBE(vfs, namecache, lookup, hit_negative, dvp, ncp->nc_name, + SDT_PROBE(vfs, namecache, lookup, hit_negative, dvp, nc_get_name(ncp), 0, 0, 0); + cache_out_ts(ncp, tsp, ticksp); CACHE_WUNLOCK(); return (ENOENT); @@ -616,12 +703,15 @@ unlock: * Add an entry to the cache. */ void -cache_enter(dvp, vp, cnp) +cache_enter_time(dvp, vp, cnp, tsp, dtsp) struct vnode *dvp; struct vnode *vp; struct componentname *cnp; + struct timespec *tsp; + struct timespec *dtsp; { struct namecache *ncp, *n2; + struct namecache_ts *n3; struct nchashhead *ncpp; u_int32_t hash; int flag; @@ -688,13 +778,23 @@ cache_enter(dvp, vp, cnp) * Calculate the hash key and setup as much of the new * namecache entry as possible before acquiring the lock. */ - ncp = cache_alloc(cnp->cn_namelen); + ncp = cache_alloc(cnp->cn_namelen, tsp != NULL); ncp->nc_vp = vp; ncp->nc_dvp = dvp; ncp->nc_flag = flag; + if (tsp != NULL) { + n3 = (struct namecache_ts *)ncp; + n3->nc_time = *tsp; + n3->nc_ticks = ticks; + n3->nc_flag |= NCF_TS; + if (dtsp != NULL) { + n3->nc_dotdottime = *dtsp; + n3->nc_flag |= NCF_DTS; + } + } len = ncp->nc_nlen = cnp->cn_namelen; hash = fnv_32_buf(cnp->cn_nameptr, len, FNV1_32_INIT); - strlcpy(ncp->nc_name, cnp->cn_nameptr, len + 1); + strlcpy(nc_get_name(ncp), cnp->cn_nameptr, len + 1); hash = fnv_32_buf(&dvp, sizeof(dvp), hash); CACHE_WLOCK(); @@ -707,7 +807,22 @@ cache_enter(dvp, vp, cnp) LIST_FOREACH(n2, ncpp, nc_hash) { if (n2->nc_dvp == dvp && n2->nc_nlen == cnp->cn_namelen && - !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { + !bcmp(nc_get_name(n2), cnp->cn_nameptr, n2->nc_nlen)) { + if (tsp != NULL) { + KASSERT((n2->nc_flag & NCF_TS) != 0, + ("no NCF_TS")); + n3 = (struct namecache_ts *)n2; + n3->nc_time = + ((struct namecache_ts *)ncp)->nc_time; + n3->nc_ticks = + ((struct namecache_ts *)ncp)->nc_ticks; + if (dtsp != NULL) { + n3->nc_dotdottime = + ((struct namecache_ts *)ncp)-> + nc_dotdottime; + n3->nc_flag |= NCF_DTS; + } + } CACHE_WUNLOCK(); cache_free(ncp); return; @@ -736,6 +851,11 @@ cache_enter(dvp, vp, cnp) ncp->nc_flag |= NCF_WHITE; } else if (vp->v_type == VDIR) { if (flag != NCF_ISDOTDOT) { + /* + * For this case, the cache entry maps both the + * directory name in it and the name ".." for the + * directory's parent. + */ if ((n2 = vp->v_cache_dd) != NULL && (n2->nc_flag & NCF_ISDOTDOT) != 0) cache_zap(n2); @@ -765,12 +885,12 @@ cache_enter(dvp, vp, cnp) */ if (vp) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); - SDT_PROBE(vfs, namecache, enter, done, dvp, ncp->nc_name, vp, - 0, 0); + SDT_PROBE(vfs, namecache, enter, done, dvp, nc_get_name(ncp), + vp, 0, 0); } else { TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); SDT_PROBE(vfs, namecache, enter_negative, done, dvp, - ncp->nc_name, 0, 0, 0); + nc_get_name(ncp), 0, 0, 0); } if (numneg * ncnegfactor > numcache) { ncp = TAILQ_FIRST(&ncneg); @@ -792,10 +912,18 @@ nchinit(void *dummy __unused) TAILQ_INIT(&ncneg); - cache_zone_small = uma_zcreate("S VFS Cache", CACHE_ZONE_SMALL, NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); - cache_zone_large = uma_zcreate("L VFS Cache", CACHE_ZONE_LARGE, NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + cache_zone_small = uma_zcreate("S VFS Cache", + sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + cache_zone_small_ts = uma_zcreate("STS VFS Cache", + sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + cache_zone_large = uma_zcreate("L VFS Cache", + sizeof(struct namecache) + NAME_MAX + 1, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + cache_zone_large_ts = uma_zcreate("LTS VFS Cache", + sizeof(struct namecache_ts) + NAME_MAX + 1, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); } @@ -1104,9 +1232,9 @@ vn_vptocnp_locked(struct vnode **vp, str return (error); } *buflen -= ncp->nc_nlen; - memcpy(buf + *buflen, ncp->nc_name, ncp->nc_nlen); + memcpy(buf + *buflen, nc_get_name(ncp), ncp->nc_nlen); SDT_PROBE(vfs, namecache, fullpath, hit, ncp->nc_dvp, - ncp->nc_name, vp, 0, 0); + nc_get_name(ncp), vp, 0, 0); *vp = ncp->nc_dvp; return (0); } @@ -1243,8 +1371,31 @@ vn_commname(struct vnode *vp, char *buf, return (ENOENT); } l = min(ncp->nc_nlen, buflen - 1); - memcpy(buf, ncp->nc_name, l); + memcpy(buf, nc_get_name(ncp), l); CACHE_RUNLOCK(); buf[l] = '\0'; return (0); } + +/* ABI compat shims for old kernel modules. */ +#undef cache_enter +#undef cache_lookup + +void cache_enter(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp); +int cache_lookup(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp); + +void +cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) +{ + + cache_enter_time(dvp, vp, cnp, NULL, NULL); +} + +int +cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) +{ + + return (cache_lookup_times(dvp, vpp, cnp, NULL, NULL)); +} Modified: stable/8/sys/nfsclient/nfs_subs.c ============================================================================== --- stable/8/sys/nfsclient/nfs_subs.c Wed Mar 21 20:50:15 2012 (r233285) +++ stable/8/sys/nfsclient/nfs_subs.c Wed Mar 21 20:50:47 2012 (r233286) @@ -978,8 +978,8 @@ nfsm_loadattr_xx(struct vnode **v, struc } int -nfsm_postop_attr_xx(struct vnode **v, int *f, struct mbuf **md, - caddr_t *dpos) +nfsm_postop_attr_xx(struct vnode **v, int *f, struct vattr *va, + struct mbuf **md, caddr_t *dpos) { u_int32_t *tl; int t1; @@ -990,7 +990,7 @@ nfsm_postop_attr_xx(struct vnode **v, in return EBADRPC; *f = fxdr_unsigned(int, *tl); if (*f != 0) { - t1 = nfs_loadattrcache(&ttvp, md, dpos, NULL, 1); + t1 = nfs_loadattrcache(&ttvp, md, dpos, va, 1); if (t1 != 0) { *f = 0; return t1; @@ -1020,7 +1020,7 @@ nfsm_wcc_data_xx(struct vnode **v, int * VTONFS(*v)->n_mtime.tv_nsec == fxdr_unsigned(u_int32_t, *(tl + 3))); mtx_unlock(&(VTONFS(*v))->n_mtx); } - t1 = nfsm_postop_attr_xx(v, &ttattrf, md, dpos); + t1 = nfsm_postop_attr_xx(v, &ttattrf, NULL, md, dpos); if (t1) return t1; if (*f) Modified: stable/8/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vnops.c Wed Mar 21 20:50:15 2012 (r233285) +++ stable/8/sys/nfsclient/nfs_vnops.c Wed Mar 21 20:50:47 2012 (r233286) @@ -913,8 +913,8 @@ nfs_lookup(struct vop_lookup_args *ap) struct vnode *dvp = ap->a_dvp; struct vnode **vpp = ap->a_vpp; struct mount *mp = dvp->v_mount; - struct vattr vattr; - struct timespec dmtime; + struct vattr dvattr, vattr; + struct timespec nctime; int flags = cnp->cn_flags; struct vnode *newvp; struct nfsmount *nmp; @@ -923,7 +923,7 @@ nfs_lookup(struct vop_lookup_args *ap) long len; nfsfh_t *fhp; struct nfsnode *np, *newnp; - int error = 0, attrflag, fhsize, ltype; + int error = 0, attrflag, dattrflag, fhsize, ltype, ncticks; int v3 = NFS_ISV3(dvp); struct thread *td = cnp->cn_thread; @@ -939,11 +939,24 @@ nfs_lookup(struct vop_lookup_args *ap) *vpp = NULLVP; return (error); } - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup_times(dvp, vpp, cnp, &nctime, &ncticks); if (error > 0 && error != ENOENT) return (error); if (error == -1) { /* + * Lookups of "." are special and always return the + * current directory. cache_lookup() already handles + * associated locking bookkeeping, etc. + */ + if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { + /* XXX: Is this really correct? */ + if (cnp->cn_nameiop != LOOKUP && + (flags & ISLASTCN)) + cnp->cn_flags |= SAVENAME; + return (0); + } + + /* * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback @@ -969,7 +982,7 @@ nfs_lookup(struct vop_lookup_args *ap) mtx_unlock(&newnp->n_mtx); } if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_ctime, &newnp->n_ctime, ==)) { + timespeccmp(&vattr.va_ctime, &nctime, ==)) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) @@ -988,36 +1001,22 @@ nfs_lookup(struct vop_lookup_args *ap) /* * We only accept a negative hit in the cache if the * modification time of the parent directory matches - * our cached copy. Otherwise, we discard all of the - * negative cache entries for this directory. We also - * only trust -ve cache entries for less than - * nm_negative_namecache_timeout seconds. + * the cached copy in the name cache entry. + * Otherwise, we discard all of the negative cache + * entries for this directory. We also only trust + * negative cache entries for up to nm_negnametimeo + * seconds. */ - if ((u_int)(ticks - np->n_dmtime_ticks) < - (nmp->nm_negnametimeo * hz) && + if ((u_int)(ticks - ncticks) < (nmp->nm_negnametimeo * hz) && VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_mtime, &np->n_dmtime, ==)) { + timespeccmp(&vattr.va_mtime, &nctime, ==)) { nfsstats.lookupcache_hits++; return (ENOENT); } cache_purge_negative(dvp); - mtx_lock(&np->n_mtx); - timespecclear(&np->n_dmtime); - mtx_unlock(&np->n_mtx); } - /* - * Cache the modification time of the parent directory in case - * the lookup fails and results in adding the first negative - * name cache entry for the directory. Since this is reading - * a single time_t, don't bother with locking. The - * modification time may be a bit stale, but it must be read - * before performing the lookup RPC to prevent a race where - * another lookup updates the timestamp on the directory after - * the lookup RPC has been performed on the server but before - * n_dmtime is set at the end of this function. - */ - dmtime = np->n_vattr.va_mtime; + attrflag = dattrflag = 0; error = 0; newvp = NULLVP; nfsstats.lookupcache_misses++; @@ -1032,7 +1031,7 @@ nfs_lookup(struct vop_lookup_args *ap) nfsm_request(dvp, NFSPROC_LOOKUP, cnp->cn_thread, cnp->cn_cred); if (error) { if (v3) { - nfsm_postop_attr(dvp, attrflag); + nfsm_postop_attr_va(dvp, dattrflag, &vattr); m_freem(mrep); } goto nfsmout; @@ -1128,17 +1127,19 @@ nfs_lookup(struct vop_lookup_args *ap) } } if (v3) { - nfsm_postop_attr(newvp, attrflag); - nfsm_postop_attr(dvp, attrflag); - } else - nfsm_loadattr(newvp, NULL); + nfsm_postop_attr_va(newvp, attrflag, &vattr); + nfsm_postop_attr_va(dvp, dattrflag, &dvattr); + } else { + nfsm_loadattr(newvp, &vattr); + attrflag = 1; + } if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; if ((cnp->cn_flags & MAKEENTRY) && - (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN))) { - np->n_ctime = np->n_vattr.va_ctime; - cache_enter(dvp, newvp, cnp); - } + (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN)) && + attrflag != 0 && (newvp->v_type != VDIR || dattrflag != 0)) + cache_enter_time(dvp, newvp, cnp, &vattr.va_ctime, + newvp->v_type != VDIR ? NULL : &dvattr.va_ctime); *vpp = newvp; m_freem(mrep); nfsmout: @@ -1165,30 +1166,22 @@ nfsmout: return (EJUSTRETURN); } - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE) { + if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE && + dattrflag) { /* - * Maintain n_dmtime as the modification time - * of the parent directory when the oldest -ve - * name cache entry for this directory was - * added. If a -ve cache entry has already - * been added with a newer modification time - * by a concurrent lookup, then don't bother - * adding a cache entry. The modification - * time of the directory might have changed - * due to the file this lookup failed to find - * being created. In that case a subsequent - * lookup would incorrectly use the entry - * added here instead of doing an extra - * lookup. + * Cache the modification time of the parent + * directory from the post-op attributes in + * the name cache entry. The negative cache + * entry will be ignored once the directory + * has changed. Don't bother adding the entry + * if the directory has already changed. */ mtx_lock(&np->n_mtx); - if (timespeccmp(&np->n_dmtime, &dmtime, <=)) { - if (!timespecisset(&np->n_dmtime)) { - np->n_dmtime = dmtime; - np->n_dmtime_ticks = ticks; - } + if (timespeccmp(&np->n_vattr.va_mtime, + &vattr.va_mtime, ==)) { mtx_unlock(&np->n_mtx); - cache_enter(dvp, NULL, cnp); + cache_enter_time(dvp, NULL, cnp, + &vattr.va_mtime, NULL); } else mtx_unlock(&np->n_mtx); } @@ -1539,8 +1532,6 @@ nfsmout: if (newvp) vput(newvp); } else { - if (cnp->cn_flags & MAKEENTRY) - cache_enter(dvp, newvp, cnp); *vpp = newvp; } mtx_lock(&(VTONFS(dvp))->n_mtx); @@ -1679,8 +1670,6 @@ nfsmout: vput(newvp); } if (!error) { - if (cnp->cn_flags & MAKEENTRY) - cache_enter(dvp, newvp, cnp); *ap->a_vpp = newvp; } mtx_lock(&(VTONFS(dvp))->n_mtx); @@ -2474,10 +2463,11 @@ nfs_readdirplusrpc(struct vnode *vp, str nfsuint64 cookie; struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsnode *dnp = VTONFS(vp), *np; + struct vattr vattr, dvattr; nfsfh_t *fhp; u_quad_t fileno; int error = 0, tlen, more_dirs = 1, blksiz = 0, doit, bigenough = 1, i; - int attrflag, fhsize; + int attrflag, dattrflag, fhsize; #ifndef nolint dp = NULL; @@ -2523,7 +2513,7 @@ nfs_readdirplusrpc(struct vnode *vp, str *tl++ = txdr_unsigned(nmp->nm_readdirsize); *tl = txdr_unsigned(nmp->nm_rsize); nfsm_request(vp, NFSPROC_READDIRPLUS, uiop->uio_td, cred); - nfsm_postop_attr(vp, attrflag); + nfsm_postop_attr_va(vp, dattrflag, &dvattr); if (error) { m_freem(mrep); goto nfsmout; @@ -2654,18 +2644,16 @@ nfs_readdirplusrpc(struct vnode *vp, str dpos = dpossav1; mdsav2 = md; md = mdsav1; - nfsm_loadattr(newvp, NULL); + nfsm_loadattr(newvp, &vattr); dpos = dpossav2; md = mdsav2; - dp->d_type = - IFTODT(VTTOIF(np->n_vattr.va_type)); + dp->d_type = IFTODT(VTTOIF(vattr.va_type)); ndp->ni_vp = newvp; - /* - * Update n_ctime so subsequent lookup - * doesn't purge entry. - */ - np->n_ctime = np->n_vattr.va_ctime; - cache_enter(ndp->ni_dvp, ndp->ni_vp, cnp); + if (newvp->v_type != VDIR || dattrflag != 0) + cache_enter_time(ndp->ni_dvp, ndp->ni_vp, + cnp, &vattr.va_ctime, + newvp->v_type != VDIR ? NULL : + &dvattr.va_ctime); } } else { /* Just skip over the file handle */ Modified: stable/8/sys/nfsclient/nfsm_subs.h ============================================================================== --- stable/8/sys/nfsclient/nfsm_subs.h Wed Mar 21 20:50:15 2012 (r233285) +++ stable/8/sys/nfsclient/nfsm_subs.h Wed Mar 21 20:50:47 2012 (r233286) @@ -152,8 +152,8 @@ int nfsm_getfh_xx(nfsfh_t **f, int *s, i caddr_t *dpos); int nfsm_loadattr_xx(struct vnode **v, struct vattr *va, struct mbuf **md, caddr_t *dpos); -int nfsm_postop_attr_xx(struct vnode **v, int *f, struct mbuf **md, - caddr_t *dpos); +int nfsm_postop_attr_xx(struct vnode **v, int *f, struct vattr *va, + struct mbuf **md, caddr_t *dpos); int nfsm_wcc_data_xx(struct vnode **v, int *f, struct mbuf **md, caddr_t *dpos); @@ -181,7 +181,14 @@ do { \ #define nfsm_postop_attr(v, f) \ do { \ int32_t t1; \ - t1 = nfsm_postop_attr_xx(&v, &f, &md, &dpos); \ + t1 = nfsm_postop_attr_xx(&v, &f, NULL, &md, &dpos); \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 20:53:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6BE781065670; Wed, 21 Mar 2012 20:53:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D74F8FC18; Wed, 21 Mar 2012 20:53:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2LKrmoa093126; Wed, 21 Mar 2012 20:53:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2LKrmxL093123; Wed, 21 Mar 2012 20:53:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203212053.q2LKrmxL093123@svn.freebsd.org> From: Marius Strobl Date: Wed, 21 Mar 2012 20:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233287 - head/sys/boot/uboot/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 20:53:48 -0000 Author: marius Date: Wed Mar 21 20:53:47 2012 New Revision: 233287 URL: http://svn.freebsd.org/changeset/base/233287 Log: Use the common/shared CRC-32 implementation instead of duplicating it. MFC after: 1 week Modified: head/sys/boot/uboot/lib/Makefile head/sys/boot/uboot/lib/glue.c Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Wed Mar 21 20:50:47 2012 (r233286) +++ head/sys/boot/uboot/lib/Makefile Wed Mar 21 20:53:47 2012 (r233287) @@ -1,11 +1,13 @@ # $FreeBSD$ +.PATH: ${.CURDIR}/../../common + LIB= uboot INTERNALLIB= WARNS?= 2 -SRCS= devicename.c elf_freebsd.c console.c copy.c disk.c \ - module.c net.c reboot.c time.c glue.c +SRCS= crc32.c console.c copy.c devicename.c disk.c elf_freebsd.c glue.c +SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float Modified: head/sys/boot/uboot/lib/glue.c ============================================================================== --- head/sys/boot/uboot/lib/glue.c Wed Mar 21 20:50:47 2012 (r233286) +++ head/sys/boot/uboot/lib/glue.c Wed Mar 21 20:53:47 2012 (r233287) @@ -27,6 +27,9 @@ #include __FBSDID("$FreeBSD$"); +#include + +#include #include #include "api_public.h" #include "glue.h" @@ -43,69 +46,6 @@ __FBSDID("$FreeBSD$"); /* Some random address used by U-Boot. */ extern long uboot_address; -/* crc32 stuff stolen from lib/libdisk/write_ia64_disk.c */ -static uint32_t crc32_tab[] = { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, - 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, - 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, - 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, - 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, - 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, - 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, - 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, - 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, - 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, - 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, - 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, - 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, - 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, - 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, - 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, - 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, - 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, - 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, - 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, - 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, - 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, - 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, - 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, - 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, - 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, - 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d -}; - -static uint32_t -crc32(const void *buf, size_t size) -{ - const uint8_t *p; - uint32_t crc; - - p = buf; - crc = ~0U; - - while (size--) - crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); - - return (crc ^ ~0U); -} - - static int valid_sig(struct api_signature *sig) { @@ -235,7 +175,6 @@ ub_get_sys_info(void) return ((err) ? NULL : &si); } - /**************************************** * * timing @@ -260,7 +199,6 @@ ub_get_timer(unsigned long base) return (cur); } - /**************************************************************************** * * devices @@ -314,7 +252,6 @@ ub_dev_enum(void) return (n); } - /* * handle: 0-based id of the device * @@ -559,7 +496,6 @@ ub_env_set(const char *name, char *value syscall(API_ENV_SET, NULL, (uint32_t)name, (uint32_t)value); } - static char env_name[256]; const char * From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 20:55:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82B2E1065675; Wed, 21 Mar 2012 20:55:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 637B08FC1B; Wed, 21 Mar 2012 20:55:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2LKtMxa093222; Wed, 21 Mar 2012 20:55:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2LKtMYR093218; Wed, 21 Mar 2012 20:55:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203212055.q2LKtMYR093218@svn.freebsd.org> From: Marius Strobl Date: Wed, 21 Mar 2012 20:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233288 - in head/sys: boot/common libkern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 20:55:22 -0000 Author: marius Date: Wed Mar 21 20:55:21 2012 New Revision: 233288 URL: http://svn.freebsd.org/changeset/base/233288 Log: Declare the CRC lookup-tables const as they hardly should change at run-time. Modified: head/sys/boot/common/crc32.c head/sys/libkern/crc32.c head/sys/sys/libkern.h Modified: head/sys/boot/common/crc32.c ============================================================================== --- head/sys/boot/common/crc32.c Wed Mar 21 20:53:47 2012 (r233287) +++ head/sys/boot/common/crc32.c Wed Mar 21 20:55:21 2012 (r233288) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include "crc32.h" -static uint32_t crc32_tab[] = { +static const uint32_t const crc32_tab[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, Modified: head/sys/libkern/crc32.c ============================================================================== --- head/sys/libkern/crc32.c Wed Mar 21 20:53:47 2012 (r233287) +++ head/sys/libkern/crc32.c Wed Mar 21 20:55:21 2012 (r233288) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -uint32_t crc32_tab[] = { +const uint32_t const crc32_tab[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, @@ -134,7 +134,7 @@ uint32_t crc32_tab[] = { /* */ /*****************************************************************/ -static uint32_t crc32Table[256] = { +static const uint32_t const crc32Table[256] = { 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, 0x8AD958CFL, 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, @@ -240,7 +240,7 @@ singletable_crc32c(uint32_t crc, const v * File Name = ............................ 8x256_tables.c */ -static uint32_t sctp_crc_tableil8_o32[256] = +static const uint32_t const sctp_crc_tableil8_o32[256] = { 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB, 0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24, @@ -296,7 +296,7 @@ static uint32_t sctp_crc_tableil8_o32[25 * File Name = ............................ 8x256_tables.c */ -static uint32_t sctp_crc_tableil8_o40[256] = +static const uint32_t const sctp_crc_tableil8_o40[256] = { 0x00000000, 0x13A29877, 0x274530EE, 0x34E7A899, 0x4E8A61DC, 0x5D28F9AB, 0x69CF5132, 0x7A6DC945, 0x9D14C3B8, 0x8EB65BCF, 0xBA51F356, 0xA9F36B21, 0xD39EA264, 0xC03C3A13, 0xF4DB928A, 0xE7790AFD, @@ -352,7 +352,7 @@ static uint32_t sctp_crc_tableil8_o40[25 * File Name = ............................ 8x256_tables.c */ -static uint32_t sctp_crc_tableil8_o48[256] = +static const uint32_t const sctp_crc_tableil8_o48[256] = { 0x00000000, 0xA541927E, 0x4F6F520D, 0xEA2EC073, 0x9EDEA41A, 0x3B9F3664, 0xD1B1F617, 0x74F06469, 0x38513EC5, 0x9D10ACBB, 0x773E6CC8, 0xD27FFEB6, 0xA68F9ADF, 0x03CE08A1, 0xE9E0C8D2, 0x4CA15AAC, @@ -408,7 +408,7 @@ static uint32_t sctp_crc_tableil8_o48[25 * File Name = ............................ 8x256_tables.c */ -static uint32_t sctp_crc_tableil8_o56[256] = +static const uint32_t const sctp_crc_tableil8_o56[256] = { 0x00000000, 0xDD45AAB8, 0xBF672381, 0x62228939, 0x7B2231F3, 0xA6679B4B, 0xC4451272, 0x1900B8CA, 0xF64463E6, 0x2B01C95E, 0x49234067, 0x9466EADF, 0x8D665215, 0x5023F8AD, 0x32017194, 0xEF44DB2C, @@ -464,7 +464,7 @@ static uint32_t sctp_crc_tableil8_o56[25 * File Name = ............................ 8x256_tables.c */ -static uint32_t sctp_crc_tableil8_o64[256] = +static const uint32_t const sctp_crc_tableil8_o64[256] = { 0x00000000, 0x38116FAC, 0x7022DF58, 0x4833B0F4, 0xE045BEB0, 0xD854D11C, 0x906761E8, 0xA8760E44, 0xC5670B91, 0xFD76643D, 0xB545D4C9, 0x8D54BB65, 0x2522B521, 0x1D33DA8D, 0x55006A79, 0x6D1105D5, @@ -520,7 +520,7 @@ static uint32_t sctp_crc_tableil8_o64[25 * File Name = ............................ 8x256_tables.c */ -static uint32_t sctp_crc_tableil8_o72[256] = +static const uint32_t const sctp_crc_tableil8_o72[256] = { 0x00000000, 0xEF306B19, 0xDB8CA0C3, 0x34BCCBDA, 0xB2F53777, 0x5DC55C6E, 0x697997B4, 0x8649FCAD, 0x6006181F, 0x8F367306, 0xBB8AB8DC, 0x54BAD3C5, 0xD2F32F68, 0x3DC34471, 0x097F8FAB, 0xE64FE4B2, @@ -576,7 +576,7 @@ static uint32_t sctp_crc_tableil8_o72[25 * File Name = ............................ 8x256_tables.c */ -static uint32_t sctp_crc_tableil8_o80[256] = +static const uint32_t const sctp_crc_tableil8_o80[256] = { 0x00000000, 0x68032CC8, 0xD0065990, 0xB8057558, 0xA5E0C5D1, 0xCDE3E919, 0x75E69C41, 0x1DE5B089, 0x4E2DFD53, 0x262ED19B, 0x9E2BA4C3, 0xF628880B, 0xEBCD3882, 0x83CE144A, 0x3BCB6112, 0x53C84DDA, @@ -632,7 +632,7 @@ static uint32_t sctp_crc_tableil8_o80[25 * File Name = ............................ 8x256_tables.c */ -static uint32_t sctp_crc_tableil8_o88[256] = +static const uint32_t const sctp_crc_tableil8_o88[256] = { 0x00000000, 0x493C7D27, 0x9278FA4E, 0xDB448769, 0x211D826D, 0x6821FF4A, 0xB3657823, 0xFA590504, 0x423B04DA, 0x0B0779FD, 0xD043FE94, 0x997F83B3, 0x632686B7, 0x2A1AFB90, 0xF15E7CF9, 0xB86201DE, Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Wed Mar 21 20:53:47 2012 (r233287) +++ head/sys/sys/libkern.h Wed Mar 21 20:55:21 2012 (r233288) @@ -121,7 +121,7 @@ size_t strspn(const char *, const char char *strstr(const char *, const char *); int strvalid(const char *, size_t); -extern uint32_t crc32_tab[]; +extern const uint32_t const crc32_tab[]; static __inline uint32_t crc32_raw(const void *buf, size_t size, uint32_t crc) From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 21:18:06 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F10E106566B; Wed, 21 Mar 2012 21:18:06 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id B24038FC14; Wed, 21 Mar 2012 21:18:05 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q2LLI1K1047506; Wed, 21 Mar 2012 22:18:02 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <4F6A4589.4050507@FreeBSD.org> Date: Wed, 21 Mar 2012 22:18:01 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:11.0) Gecko/20120313 Thunderbird/11.0 MIME-Version: 1.0 To: Jung-uk Kim References: <201203202137.q2KLbrFu039018@svn.freebsd.org> <4F69E625.9040708@freebsd.org> In-Reply-To: <4F69E625.9040708@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Nathan Whitehorn Subject: Re: svn commit: r233250 - in head: share/man/man4 sys/amd64/acpica sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/co... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 21:18:06 -0000 On 21.03.12 15:31, Nathan Whitehorn wrote: > On 03/20/12 14:37, Jung-uk Kim wrote: >> Author: jkim >> Date: Tue Mar 20 21:37:52 2012 >> New Revision: 233250 >> URL: http://svn.freebsd.org/changeset/base/233250 >> >> Log: >> Merge ACPICA 20120320. >> > > After this, I get an endless series of "Large reference count - > (increasingly large hex number) - utdelete-491" on the console when > trying to boot my laptop. How should I go about trying to debug this? I have the same situation on my IBM T60. Only a boot with kernel.old helps.... Andreas From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 22:07:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id A5E401065670; Wed, 21 Mar 2012 22:07:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andreas Tobler Date: Wed, 21 Mar 2012 18:07:36 -0400 User-Agent: KMail/1.6.2 References: <201203202137.q2KLbrFu039018@svn.freebsd.org> <4F69E625.9040708@freebsd.org> <4F6A4589.4050507@FreeBSD.org> In-Reply-To: <4F6A4589.4050507@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203211807.38504.jkim@FreeBSD.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Nathan Whitehorn Subject: Re: svn commit: r233250 - in head: share/man/man4 sys/amd64/acpica sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/co... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 22:07:46 -0000 On Wednesday 21 March 2012 05:18 pm, Andreas Tobler wrote: > On 21.03.12 15:31, Nathan Whitehorn wrote: > > On 03/20/12 14:37, Jung-uk Kim wrote: > >> Author: jkim > >> Date: Tue Mar 20 21:37:52 2012 > >> New Revision: 233250 > >> URL: http://svn.freebsd.org/changeset/base/233250 > >> > >> Log: > >> Merge ACPICA 20120320. > > > > After this, I get an endless series of "Large reference count - > > (increasingly large hex number) - utdelete-491" on the console > > when trying to boot my laptop. How should I go about trying to > > debug this? > > I have the same situation on my IBM T60. Only a boot with > kernel.old helps.... I just reported the issue to upstream becuase I cannot reproduce it. Please stay tuned. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Mar 21 23:10:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B4E11065673; Wed, 21 Mar 2012 23:10:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 856468FC17; Wed, 21 Mar 2012 23:10:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2LNAHtX097391; Wed, 21 Mar 2012 23:10:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2LNAHLd097389; Wed, 21 Mar 2012 23:10:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201203212310.q2LNAHLd097389@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 21 Mar 2012 23:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233289 - stable/9/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 23:10:17 -0000 Author: jilles Date: Wed Mar 21 23:10:16 2012 New Revision: 233289 URL: http://svn.freebsd.org/changeset/base/233289 Log: MFC r229201: sh: Make patmatch() non-recursive. Modified: stable/9/bin/sh/expand.c Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/expand.c ============================================================================== --- stable/9/bin/sh/expand.c Wed Mar 21 20:55:21 2012 (r233288) +++ stable/9/bin/sh/expand.c Wed Mar 21 23:10:16 2012 (r233289) @@ -1440,57 +1440,63 @@ static int patmatch(const char *pattern, const char *string, int squoted) { const char *p, *q, *end; + const char *bt_p, *bt_q; char c; wchar_t wc, wc2; p = pattern; q = string; + bt_p = NULL; + bt_q = NULL; for (;;) { switch (c = *p++) { case '\0': - goto breakloop; + if (*q != '\0') + goto backtrack; + return 1; case CTLESC: if (squoted && *q == CTLESC) q++; if (*q++ != *p++) - return 0; + goto backtrack; break; case CTLQUOTEMARK: continue; case '?': if (squoted && *q == CTLESC) q++; - if (localeisutf8) + if (*q == '\0') + return 0; + if (localeisutf8) { wc = get_wc(&q); - else + /* + * A '?' does not match invalid UTF-8 but a + * '*' does, so backtrack. + */ + if (wc == 0) + goto backtrack; + } else wc = (unsigned char)*q++; - if (wc == '\0') - return 0; break; case '*': c = *p; while (c == CTLQUOTEMARK || c == '*') c = *++p; - if (c != CTLESC && c != CTLQUOTEMARK && - c != '?' && c != '*' && c != '[') { - while (*q != c) { - if (squoted && *q == CTLESC && - q[1] == c) - break; - if (*q == '\0') - return 0; - if (squoted && *q == CTLESC) - q++; - q++; - } - } - do { - if (patmatch(p, q, squoted)) - return 1; - if (squoted && *q == CTLESC) - q++; - } while (*q++ != '\0'); - return 0; + /* + * If the pattern ends here, we know the string + * matches without needing to look at the rest of it. + */ + if (c == '\0') + return 1; + /* + * First try the shortest match for the '*' that + * could work. We can forget any earlier '*' since + * there is no way having it match more characters + * can help us, given that we are already here. + */ + bt_p = p; + bt_q = q; + break; case '[': { const char *endp; int invert, found; @@ -1502,7 +1508,7 @@ patmatch(const char *pattern, const char for (;;) { while (*endp == CTLQUOTEMARK) endp++; - if (*endp == '\0') + if (*endp == 0) goto dft; /* no matching ] */ if (*endp == CTLESC) endp++; @@ -1517,12 +1523,14 @@ patmatch(const char *pattern, const char found = 0; if (squoted && *q == CTLESC) q++; - if (localeisutf8) + if (*q == '\0') + return 0; + if (localeisutf8) { chr = get_wc(&q); - else + if (chr == 0) + goto backtrack; + } else chr = (unsigned char)*q++; - if (chr == '\0') - return 0; c = *p++; do { if (c == CTLQUOTEMARK) @@ -1563,21 +1571,34 @@ patmatch(const char *pattern, const char } } while ((c = *p++) != ']'); if (found == invert) - return 0; + goto backtrack; break; } dft: default: if (squoted && *q == CTLESC) q++; - if (*q++ != c) + if (*q == '\0') + return 0; + if (*q++ == c) + break; +backtrack: + /* + * If we have a mismatch (other than hitting the end + * of the string), go back to the last '*' seen and + * have it match one additional character. + */ + if (bt_p == NULL) + return 0; + if (squoted && *bt_q == CTLESC) + bt_q++; + if (*bt_q == '\0') return 0; + bt_q++; + p = bt_p; + q = bt_q; break; } } -breakloop: - if (*q != '\0') - return 0; - return 1; } From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 04:40:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50F10106564A; Thu, 22 Mar 2012 04:40:23 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BE168FC12; Thu, 22 Mar 2012 04:40:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2M4eNNk007773; Thu, 22 Mar 2012 04:40:23 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2M4eMSl007771; Thu, 22 Mar 2012 04:40:22 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201203220440.q2M4eMSl007771@svn.freebsd.org> From: Alan Cox Date: Thu, 22 Mar 2012 04:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233290 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 04:40:23 -0000 Author: alc Date: Thu Mar 22 04:40:22 2012 New Revision: 233290 URL: http://svn.freebsd.org/changeset/base/233290 Log: Change pv_entry_count to a long. During the lifetime of FreeBSD 10.x, physical memory sizes at the high-end will likely reach a point that the number of pv entries could overflow an int. Submitted by: kib Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Mar 21 23:10:16 2012 (r233289) +++ head/sys/amd64/amd64/pmap.c Thu Mar 22 04:40:22 2012 (r233290) @@ -202,7 +202,7 @@ static u_int64_t DMPDPphys; /* phys addr /* * Data for the pv entry allocation mechanism */ -static int pv_entry_count; +static long pv_entry_count; static struct md_page *pv_table; /* @@ -2005,7 +2005,7 @@ pv_to_chunk(pv_entry_t pv) static uint64_t pc_freemask[_NPCM] = { PC_FREE0, PC_FREE1, PC_FREE2 }; -SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, &pv_entry_count, 0, +SYSCTL_LONG(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, &pv_entry_count, 0, "Current number of pv entries"); #ifdef PV_STATS From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 04:52:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9DE51065670; Thu, 22 Mar 2012 04:52:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B24938FC0A; Thu, 22 Mar 2012 04:52:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2M4qpQO008187; Thu, 22 Mar 2012 04:52:51 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2M4qp2H008178; Thu, 22 Mar 2012 04:52:51 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201203220452.q2M4qp2H008178@svn.freebsd.org> From: Alan Cox Date: Thu, 22 Mar 2012 04:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233291 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include kern sys vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 04:52:51 -0000 Author: alc Date: Thu Mar 22 04:52:51 2012 New Revision: 233291 URL: http://svn.freebsd.org/changeset/base/233291 Log: Handle spurious page faults that may occur in no-fault sections of the kernel. When access restrictions are added to a page table entry, we flush the corresponding virtual address mapping from the TLB. In contrast, when access restrictions are removed from a page table entry, we do not flush the virtual address mapping from the TLB. This is exactly as recommended in AMD's documentation. In effect, when access restrictions are removed from a page table entry, AMD's MMUs will transparently refresh a stale TLB entry. In short, this saves us from having to perform potentially costly TLB flushes. In contrast, Intel's MMUs are allowed to generate a spurious page fault based upon the stale TLB entry. Usually, such spurious page faults are handled by vm_fault() without incident. However, when we are executing no-fault sections of the kernel, we are not allowed to execute vm_fault(). This change introduces special-case handling for spurious page faults that occur in no-fault sections of the kernel. In collaboration with: kib Tested by: gibbs (an earlier version) I would also like to acknowledge Hiroki Sato's assistance in diagnosing this problem. MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c head/sys/amd64/include/proc.h head/sys/i386/i386/trap.c head/sys/i386/include/proc.h head/sys/kern/kern_sysctl.c head/sys/kern/subr_uio.c head/sys/sys/proc.h head/sys/vm/vm_fault.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu Mar 22 04:40:22 2012 (r233290) +++ head/sys/amd64/amd64/trap.c Thu Mar 22 04:52:51 2012 (r233291) @@ -301,26 +301,6 @@ trap(struct trapframe *frame) } code = frame->tf_err; - if (type == T_PAGEFLT) { - /* - * If we get a page fault while in a critical section, then - * it is most likely a fatal kernel page fault. The kernel - * is already going to panic trying to get a sleep lock to - * do the VM lookup, so just consider it a fatal trap so the - * kernel can print out a useful trap message and even get - * to the debugger. - * - * If we get a page fault while holding a non-sleepable - * lock, then it is most likely a fatal kernel page fault. - * If WITNESS is enabled, then it's going to whine about - * bogus LORs with various VM locks, so just skip to the - * fatal trap handling directly. - */ - if (td->td_critnest != 0 || - WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, - "Kernel page fault") != 0) - trap_fatal(frame, frame->tf_addr); - } if (ISPL(frame->tf_cs) == SEL_UPL) { /* user trap */ @@ -653,6 +633,50 @@ trap_pfault(frame, usermode) struct proc *p = td->td_proc; vm_offset_t eva = frame->tf_addr; + if (__predict_false((td->td_pflags & TDP_NOFAULTING) != 0)) { + /* + * Due to both processor errata and lazy TLB invalidation when + * access restrictions are removed from virtual pages, memory + * accesses that are allowed by the physical mapping layer may + * nonetheless cause one spurious page fault per virtual page. + * When the thread is executing a "no faulting" section that + * is bracketed by vm_fault_{disable,enable}_pagefaults(), + * every page fault is treated as a spurious page fault, + * unless it accesses the same virtual address as the most + * recent page fault within the same "no faulting" section. + */ + if (td->td_md.md_spurflt_addr != eva || + (td->td_pflags & TDP_RESETSPUR) != 0) { + /* + * Do nothing to the TLB. A stale TLB entry is + * flushed automatically by a page fault. + */ + td->td_md.md_spurflt_addr = eva; + td->td_pflags &= ~TDP_RESETSPUR; + return (0); + } + } else { + /* + * If we get a page fault while in a critical section, then + * it is most likely a fatal kernel page fault. The kernel + * is already going to panic trying to get a sleep lock to + * do the VM lookup, so just consider it a fatal trap so the + * kernel can print out a useful trap message and even get + * to the debugger. + * + * If we get a page fault while holding a non-sleepable + * lock, then it is most likely a fatal kernel page fault. + * If WITNESS is enabled, then it's going to whine about + * bogus LORs with various VM locks, so just skip to the + * fatal trap handling directly. + */ + if (td->td_critnest != 0 || + WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, + "Kernel page fault") != 0) { + trap_fatal(frame, eva); + return (-1); + } + } va = trunc_page(eva); if (va >= VM_MIN_KERNEL_ADDRESS) { /* Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Thu Mar 22 04:40:22 2012 (r233290) +++ head/sys/amd64/include/proc.h Thu Mar 22 04:52:51 2012 (r233291) @@ -46,6 +46,7 @@ struct proc_ldt { struct mdthread { int md_spinlock_count; /* (k) */ register_t md_saved_flags; /* (k) */ + register_t md_spurflt_addr; /* (k) Spurious page fault address. */ }; struct mdproc { Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu Mar 22 04:40:22 2012 (r233290) +++ head/sys/i386/i386/trap.c Thu Mar 22 04:52:51 2012 (r233291) @@ -330,28 +330,13 @@ trap(struct trapframe *frame) * For some Cyrix CPUs, %cr2 is clobbered by * interrupts. This problem is worked around by using * an interrupt gate for the pagefault handler. We - * are finally ready to read %cr2 and then must - * reenable interrupts. - * - * If we get a page fault while in a critical section, then - * it is most likely a fatal kernel page fault. The kernel - * is already going to panic trying to get a sleep lock to - * do the VM lookup, so just consider it a fatal trap so the - * kernel can print out a useful trap message and even get - * to the debugger. - * - * If we get a page fault while holding a non-sleepable - * lock, then it is most likely a fatal kernel page fault. - * If WITNESS is enabled, then it's going to whine about - * bogus LORs with various VM locks, so just skip to the - * fatal trap handling directly. + * are finally ready to read %cr2 and conditionally + * reenable interrupts. If we hold a spin lock, then + * we must not reenable interrupts. This might be a + * spurious page fault. */ eva = rcr2(); - if (td->td_critnest != 0 || - WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, - "Kernel page fault") != 0) - trap_fatal(frame, eva); - else + if (td->td_md.md_spinlock_count == 0) enable_intr(); } @@ -804,6 +789,50 @@ trap_pfault(frame, usermode, eva) struct thread *td = curthread; struct proc *p = td->td_proc; + if (__predict_false((td->td_pflags & TDP_NOFAULTING) != 0)) { + /* + * Due to both processor errata and lazy TLB invalidation when + * access restrictions are removed from virtual pages, memory + * accesses that are allowed by the physical mapping layer may + * nonetheless cause one spurious page fault per virtual page. + * When the thread is executing a "no faulting" section that + * is bracketed by vm_fault_{disable,enable}_pagefaults(), + * every page fault is treated as a spurious page fault, + * unless it accesses the same virtual address as the most + * recent page fault within the same "no faulting" section. + */ + if (td->td_md.md_spurflt_addr != eva || + (td->td_pflags & TDP_RESETSPUR) != 0) { + /* + * Do nothing to the TLB. A stale TLB entry is + * flushed automatically by a page fault. + */ + td->td_md.md_spurflt_addr = eva; + td->td_pflags &= ~TDP_RESETSPUR; + return (0); + } + } else { + /* + * If we get a page fault while in a critical section, then + * it is most likely a fatal kernel page fault. The kernel + * is already going to panic trying to get a sleep lock to + * do the VM lookup, so just consider it a fatal trap so the + * kernel can print out a useful trap message and even get + * to the debugger. + * + * If we get a page fault while holding a non-sleepable + * lock, then it is most likely a fatal kernel page fault. + * If WITNESS is enabled, then it's going to whine about + * bogus LORs with various VM locks, so just skip to the + * fatal trap handling directly. + */ + if (td->td_critnest != 0 || + WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, + "Kernel page fault") != 0) { + trap_fatal(frame, eva); + return (-1); + } + } va = trunc_page(eva); if (va >= KERNBASE) { /* Modified: head/sys/i386/include/proc.h ============================================================================== --- head/sys/i386/include/proc.h Thu Mar 22 04:40:22 2012 (r233290) +++ head/sys/i386/include/proc.h Thu Mar 22 04:52:51 2012 (r233291) @@ -51,6 +51,7 @@ struct proc_ldt { struct mdthread { int md_spinlock_count; /* (k) */ register_t md_saved_flags; /* (k) */ + register_t md_spurflt_addr; /* (k) Spurious page fault address. */ }; struct mdproc { Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Mar 22 04:40:22 2012 (r233290) +++ head/sys/kern/kern_sysctl.c Thu Mar 22 04:52:51 2012 (r233291) @@ -1294,8 +1294,8 @@ kernel_sysctlbyname(struct thread *td, c static int sysctl_old_user(struct sysctl_req *req, const void *p, size_t l) { - int error = 0; size_t i, len, origidx; + int error; origidx = req->oldidx; req->oldidx += l; @@ -1316,10 +1316,14 @@ sysctl_old_user(struct sysctl_req *req, else { if (i > len - origidx) i = len - origidx; - error = copyout(p, (char *)req->oldptr + origidx, i); + if (req->lock == REQ_WIRED) { + error = copyout_nofault(p, (char *)req->oldptr + + origidx, i); + } else + error = copyout(p, (char *)req->oldptr + origidx, i); + if (error != 0) + return (error); } - if (error) - return (error); if (i < l) return (ENOMEM); return (0); Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Thu Mar 22 04:40:22 2012 (r233290) +++ head/sys/kern/subr_uio.c Thu Mar 22 04:52:51 2012 (r233291) @@ -187,8 +187,12 @@ uiomove_faultflag(void *cp, int n, struc /* XXX does it make a sense to set TDP_DEADLKTREAT for UIO_SYSSPACE ? */ newflags = TDP_DEADLKTREAT; - if (uio->uio_segflg == UIO_USERSPACE && nofault) - newflags |= TDP_NOFAULTING; + if (uio->uio_segflg == UIO_USERSPACE && nofault) { + /* + * Fail if a non-spurious page fault occurs. + */ + newflags |= TDP_NOFAULTING | TDP_RESETSPUR; + } save = curthread_pflags_set(newflags); while (n > 0 && uio->uio_resid) { Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Mar 22 04:40:22 2012 (r233290) +++ head/sys/sys/proc.h Thu Mar 22 04:52:51 2012 (r233291) @@ -417,6 +417,7 @@ do { \ #define TDP_IGNSUSP 0x00800000 /* Permission to ignore the MNTK_SUSPEND* */ #define TDP_AUDITREC 0x01000000 /* Audit record pending on thread */ #define TDP_RFPPWAIT 0x02000000 /* Handle RFPPWAIT on syscall exit */ +#define TDP_RESETSPUR 0x04000000 /* Reset spurious page fault history. */ /* * Reasons that the current thread can not be run yet. Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Mar 22 04:40:22 2012 (r233290) +++ head/sys/vm/vm_fault.c Thu Mar 22 04:52:51 2012 (r233291) @@ -1468,11 +1468,17 @@ vm_fault_additional_pages(m, rbehind, ra return i; } +/* + * Block entry into the machine-independent layer's page fault handler by + * the calling thread. Subsequent calls to vm_fault() by that thread will + * return KERN_PROTECTION_FAILURE. Enable machine-dependent handling of + * spurious page faults. + */ int vm_fault_disable_pagefaults(void) { - return (curthread_pflags_set(TDP_NOFAULTING)); + return (curthread_pflags_set(TDP_NOFAULTING | TDP_RESETSPUR)); } void From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 08:12:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A77A5106564A; Thu, 22 Mar 2012 08:12:12 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 782338FC19; Thu, 22 Mar 2012 08:12:11 +0000 (UTC) Received: by lagv3 with SMTP id v3so1905493lag.13 for ; Thu, 22 Mar 2012 01:12:10 -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 :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=SzyoXrUkahv/tazfxUrvh7E6wwzbJfQ+x8vabFAXKWI=; b=IvRPaJ0ku5EqGuXx072o9HbUlZnwlxQbTSMVl1ni0nW5+/1HIfrYV5myn/89Nfq0w9 wmTK3XKkI+kvIGfG2hJ/5eRxf7+W080yrDJyImDoZlnVhFtlIiKmpPbMpKhG+AXnj/jw p9GEBYWq+36tL1m0ygPxCBA1MW4Ckh2ENmay3hyFtK6kKnuT0PV5Qylv5HEXrWgEic5T Eq+RENWkl+a2bASr5Yty2iUCWYONTU5aiAGMUggsMYYiD6PE2tU7NpkcO0D6AfQIs1xy HK55XJj4B0K2hkRgGPBhJAbslpxUdP1YtQeRchaqzqHp8OJnqACl1ffSO7D2rhbLqxxp S0+g== MIME-Version: 1.0 Received: by 10.152.104.43 with SMTP id gb11mr5070210lab.8.1332403930177; Thu, 22 Mar 2012 01:12:10 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.152.21.73 with HTTP; Thu, 22 Mar 2012 01:12:10 -0700 (PDT) In-Reply-To: <201203220440.q2M4eMSl007771@svn.freebsd.org> References: <201203220440.q2M4eMSl007771@svn.freebsd.org> Date: Thu, 22 Mar 2012 11:12:10 +0300 X-Google-Sender-Auth: CAbP7qgZYxs_Nyy6s0ryhOQg4Zs Message-ID: From: Sergey Kandaurov To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233290 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 08:12:12 -0000 On 22 March 2012 08:40, Alan Cox wrote: > Author: alc > Date: Thu Mar 22 04:40:22 2012 > New Revision: 233290 > URL: http://svn.freebsd.org/changeset/base/233290 > > Log: > =A0Change pv_entry_count to a long. =A0During the lifetime of FreeBSD 10.= x, > =A0physical memory sizes at the high-end will likely reach a point that > =A0the number of pv entries could overflow an int. > > =A0Submitted by: kib > > Modified: > =A0head/sys/amd64/amd64/pmap.c > While there, maybe also do something with these semi-debug-ish vm.pmap.pc_chunk_(allocs|frees) like change them to [u_]long too, move under debug or just drop them? While they can be useful for someone, pc_chunk_(allocs|frees) have also an "int" and quite quickly overflow. Though e.g. vm.pmap.pv_entry_(allocs|frees) have a long. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 08:38:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EABF7106564A; Thu, 22 Mar 2012 08:38:13 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D24398FC15; Thu, 22 Mar 2012 08:38:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2M8cDPG015207; Thu, 22 Mar 2012 08:38:13 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2M8cDN7015205; Thu, 22 Mar 2012 08:38:13 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203220838.q2M8cDN7015205@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 22 Mar 2012 08:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233293 - stable/9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 08:38:14 -0000 Author: pluknet Date: Thu Mar 22 08:38:13 2012 New Revision: 233293 URL: http://svn.freebsd.org/changeset/base/233293 Log: MFC r233010: Remove TARGET_ARCH conditionals for COMPAT_FREEBSD32. Modified: stable/9/ObsoleteFiles.inc (contents, props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Thu Mar 22 07:34:15 2012 (r233292) +++ stable/9/ObsoleteFiles.inc Thu Mar 22 08:38:13 2012 (r233293) @@ -54,7 +54,6 @@ OLD_LIBS+=usr/lib/libdwarf.so.2 OLD_LIBS+=usr/lib/libopie.so.6 OLD_LIBS+=usr/lib/librtld_db.so.1 OLD_LIBS+=usr/lib/libtacplus.so.4 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libcam.so.5 OLD_LIBS+=usr/lib32/libpcap.so.7 OLD_LIBS+=usr/lib32/libufs.so.5 @@ -63,7 +62,6 @@ OLD_LIBS+=usr/lib32/libdwarf.so.2 OLD_LIBS+=usr/lib32/libopie.so.6 OLD_LIBS+=usr/lib32/librtld_db.so.1 OLD_LIBS+=usr/lib32/libtacplus.so.4 -.endif # 20110718: no longer useful in the age of rc.d OLD_FILES+=usr/sbin/named.reconfig OLD_FILES+=usr/sbin/named.reload @@ -92,17 +90,13 @@ OLD_FILES+=usr/lib/libpkg.a OLD_FILES+=usr/lib/libpkg.so OLD_LIBS+=usr/lib/libpkg.so.0 OLD_FILES+=usr/lib/libpkg_p.a -.if ${TARGET_ARCH} == "amd64" OLD_FILES+=usr/lib32/libpkg.a OLD_FILES+=usr/lib32/libpkg.so OLD_LIBS+=usr/lib32/libpkg.so.0 OLD_FILES+=usr/lib32/libpkg_p.a -.endif # 20110517: libsbuf version bump OLD_LIBS+=lib/libsbuf.so.5 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libsbuf.so.5 -.endif # 20110502: new clang import which bumps version from 2.9 to 3.0 OLD_FILES+=usr/include/clang/2.9/emmintrin.h OLD_FILES+=usr/include/clang/2.9/mm_malloc.h @@ -131,12 +125,10 @@ OLD_FILES+=usr/lib/libobjc_p.a OLD_FILES+=usr/libexec/cc1obj OLD_LIBS+=usr/lib/libobjc.so.4 OLD_DIRS+=usr/include/objc -.if ${TARGET_ARCH} == "amd64" OLD_FILES+=usr/lib32/libobjc.a OLD_FILES+=usr/lib32/libobjc.so OLD_FILES+=usr/lib32/libobjc_p.a OLD_LIBS+=usr/lib32/libobjc.so.4 -.endif # 20110331: firmware.img created at build time OLD_FILES+=usr/share/examples/kld/firmware/fwimage/firmware.img # 20110224: sticky.8 -> sticky.7 @@ -258,9 +250,7 @@ OLD_FILES+=usr/include/machine/intr.h .endif # 20100514: library version bump for versioned symbols for liblzma OLD_LIBS+=usr/lib/liblzma.so.0 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/liblzma.so.0 -.endif # 20100511: move GCC-specific headers to /usr/include/gcc .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/emmintrin.h @@ -301,9 +291,7 @@ OLD_FILES+=usr/share/info/cpio.info.gz OLD_FILES+=usr/share/man/man1/gcpio.1.gz # 20100322: libz update OLD_LIBS+=lib/libz.so.5 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libz.so.5 -.endif # 20100314: removal of regexp.h OLD_FILES+=usr/include/regexp.h OLD_FILES+=usr/share/man/man3/regexp.3.gz @@ -352,9 +340,7 @@ OLD_FILES+=usr/share/man/man5/lastlog.5. OLD_FILES+=usr/share/man/man5/utmp.5.gz OLD_FILES+=usr/share/man/man5/wtmp.5.gz OLD_LIBS+=lib/libutil.so.8 -.if ${TARGET_ARCH} == "amd64" OLB_LIBS+=usr/lib32/libutil.so.8 -.endif # 20100105: new userland semaphore implementation OLD_FILES+=usr/include/sys/semaphore.h # 20100103: ntptrace(8) removed @@ -562,7 +548,6 @@ OLD_LIBS+=usr/lib/snmp_hostres.so.5 OLD_LIBS+=usr/lib/snmp_mibII.so.5 OLD_LIBS+=usr/lib/snmp_netgraph.so.5 OLD_LIBS+=usr/lib/snmp_pf.so.5 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libalias.so.6 OLD_LIBS+=usr/lib32/libarchive.so.4 OLD_LIBS+=usr/lib32/libauditd.so.4 @@ -663,7 +648,6 @@ OLD_LIBS+=usr/lib32/pam_self.so.4 OLD_LIBS+=usr/lib32/pam_ssh.so.4 OLD_LIBS+=usr/lib32/pam_tacplus.so.4 OLD_LIBS+=usr/lib32/pam_unix.so.4 -.endif # 20090718: the gdm pam.d file is no longer required. OLD_FILES+=etc/pam.d/gdm # 20090713: vimage container structs removed. @@ -848,9 +832,7 @@ OLD_FILES+=usr/share/man/man8/sliplogin. OLD_FILES+=usr/share/man/man8/slstat.8.gz # 20090321: libpcap upgraded to 1.0.0 OLD_LIBS+=lib/libpcap.so.5 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libpcap.so.5 -.endif # 20090319: uscanner(4) has been removed OLD_FILES+=usr/share/man/man4/uscanner.4.gz # 20090313: k8temp(4) renamed to amdtemp(4) @@ -862,17 +844,13 @@ OLD_FILES+=usr/lib/libusb20.so OLD_FILES+=usr/lib/libusb20_p.a OLD_FILES+=usr/include/libusb20_compat01.h OLD_FILES+=usr/include/libusb20_compat10.h -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libusb20.so.1 OLD_FILES+=usr/lib32/libusb20.a OLD_FILES+=usr/lib32/libusb20.so OLD_FILES+=usr/lib32/libusb20_p.a -.endif # 20090226: libmp(3) functions renamed OLD_LIBS+=usr/lib/libmp.so.6 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libmp.so.6 -.endif # 20090223: changeover of USB stacks OLD_FILES+=usr/include/dev/usb2/include/ufm2_ioctl.h OLD_FILES+=usr/include/dev/usb2/include/urio2_ioctl.h @@ -1175,9 +1153,7 @@ OLD_LIBS+=usr/lib/libkadm5srv.so.9 OLD_LIBS+=usr/lib/libkafs5.so.9 OLD_LIBS+=usr/lib/libkrb5.so.9 OLD_LIBS+=usr/lib/libroken.so.9 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libgssapi.so.9 -.endif # 20080420: Symbol card support dropped OLD_FILES+=usr/include/dev/wi/spectrum24t_cf.h # 20080420: awi removal @@ -1204,10 +1180,8 @@ OLD_FILES+=usr/share/man/man2/kse_releas OLD_FILES+=usr/share/man/man2/kse_switchin.2.gz OLD_FILES+=usr/share/man/man2/kse_thr_interrupt.2.gz OLD_FILES+=usr/share/man/man2/kse_wakeup.2.gz -.if ${TARGET_ARCH} == "amd64" OLD_FILES+=usr/lib32/libkse.so OLD_LIBS+=usr/lib32/libkse.so.3 -.endif # 20080220: geom_lvm rename to geom_linux_lvm OLD_FILES+=usr/share/man/man4/geom_lvm.4.gz # 20080126: oldcard.4 removal @@ -1227,11 +1201,9 @@ OLD_FILES+=usr/include/sys/xrpuio.h OLD_FILES+=usr/lib/libkse.a OLD_FILES+=usr/lib/libkse_p.a OLD_FILES+=usr/lib/libkse_pic.a -.if ${TARGET_ARCH} == "amd64" OLD_FILES+=usr/lib32/libkse.a OLD_FILES+=usr/lib32/libkse_p.a OLD_FILES+=usr/lib32/libkse_pic.a -.endif # 20071129: Removed a Solaris compatibility header OLD_FILES+=usr/include/sys/_elf_solaris.h # 20071125: Renamed to pmc_get_msr() @@ -1331,12 +1303,10 @@ OLD_DIRS+=usr/include/netatm/ipatm OLD_DIRS+=usr/include/netatm/uni OLD_DIRS+=usr/include/netatm OLD_DIRS+=usr/share/examples/atm -.if ${TARGET_ARCH} == "amd64" OLD_FILES+=usr/lib32/libatm.a OLD_FILES+=usr/lib32/libatm.so OLD_LIBS+=usr/lib32/libatm.so.5 OLD_FILES+=usr/lib32/libatm_p.a -.endif # 20070705: I4B headers repo-copied to include/i4b/ .if ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/i4b_cause.h @@ -1421,7 +1391,6 @@ OLD_LIBS+=usr/lib/snmp_hostres.so.4 OLD_LIBS+=usr/lib/snmp_mibII.so.4 OLD_LIBS+=usr/lib/snmp_netgraph.so.4 OLD_LIBS+=usr/lib/snmp_pf.so.4 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libalias.so.5 OLD_LIBS+=usr/lib32/libbsnmp.so.3 OLD_LIBS+=usr/lib32/libdialog.so.5 @@ -1456,7 +1425,6 @@ OLD_LIBS+=usr/lib32/pam_self.so.3 OLD_LIBS+=usr/lib32/pam_ssh.so.3 OLD_LIBS+=usr/lib32/pam_tacplus.so.3 OLD_LIBS+=usr/lib32/pam_unix.so.3 -.endif # 20070613: IPX over IP tunnel removal OLD_FILES+=usr/include/netipx/ipx_ip.h # 20070605: sched_core removal @@ -1526,7 +1494,6 @@ OLD_LIBS+=usr/lib/libwrap.so.4 OLD_LIBS+=usr/lib/libypclnt.so.2 OLD_LIBS+=usr/lib/snmp_bridge.so.3 OLD_LIBS+=usr/lib/snmp_hostres.so.3 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libatm.so.4 OLD_LIBS+=usr/lib32/libbegemot.so.2 OLD_LIBS+=usr/lib32/libbluetooth.so.2 @@ -1585,7 +1552,6 @@ OLD_LIBS+=usr/lib32/libvgl.so.4 OLD_LIBS+=usr/lib32/libwrap.so.4 OLD_LIBS+=usr/lib32/libypclnt.so.2 OLD_LIBS+=usr/lib32/libz.so.3 -.endif # 20070519: GCC 4.2 OLD_FILES+=usr/bin/f77 OLD_FILES+=usr/bin/protoize @@ -1832,9 +1798,7 @@ OLD_FILES+=usr/bin/uuidgen OLD_FILES+=usr/share/info/bzip2.info.gz # 20070303: libarchive 2.0 OLD_LIBS+=usr/lib/libarchive.so.3 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libarchive.so.3 -.endif # 20070301: remove addr2ascii and ascii2addr OLD_FILES+=usr/share/man/man3/addr2ascii.3.gz OLD_FILES+=usr/share/man/man3/ascii2addr.3.gz @@ -1851,14 +1815,12 @@ OLD_FILES+=usr/lib/libmytinfo_p.a OLD_FILES+=usr/lib/libmytinfow.a OLD_FILES+=usr/lib/libmytinfow.so OLD_FILES+=usr/lib/libmytinfow_p.a -.if ${TARGET_ARCH} == "amd64" OLD_FILES+=usr/lib32/libmytinfo.a OLD_FILES+=usr/lib32/libmytinfo.so OLD_FILES+=usr/lib32/libmytinfo_p.a OLD_FILES+=usr/lib32/libmytinfow.a OLD_FILES+=usr/lib32/libmytinfow.so OLD_FILES+=usr/lib32/libmytinfow_p.a -.endif # 20070128: remove vnconfig OLD_FILES+=usr/sbin/vnconfig # 20070127: remove bpf_compat.h @@ -5202,40 +5164,32 @@ OLD_LIBS+=usr/lib/libkadm5srv.so.8 OLD_LIBS+=usr/lib/libkafs5.so.8 OLD_LIBS+=usr/lib/libkrb5.so.8 OLD_LIBS+=usr/lib/libobjc.so.2 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libgssapi.so.8 OLD_LIBS+=usr/lib32/libobjc.so.2 -.endif # 20070519: GCC 4.2 OLD_LIBS+=usr/lib/libg2c.a OLD_LIBS+=usr/lib/libg2c.so OLD_LIBS+=usr/lib/libg2c.so.2 OLD_LIBS+=usr/lib/libg2c_p.a OLD_LIBS+=usr/lib/libgcc_pic.a -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libg2c.a OLD_LIBS+=usr/lib32/libg2c.so OLD_LIBS+=usr/lib32/libg2c.so.2 OLD_LIBS+=usr/lib32/libg2c_p.a OLD_LIBS+=usr/lib32/libgcc_pic.a -.endif # 20060729: OpenSSL 0.9.7e -> 0.9.8b upgrade OLD_LIBS+=lib/libcrypto.so.4 OLD_LIBS+=usr/lib/libssl.so.4 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libcrypto.so.4 OLD_LIBS+=usr/lib32/libssl.so.4 -.endif # 20060521: gethostbyaddr(3) ABI change OLD_LIBS+=usr/lib/libroken.so.8 OLD_LIBS+=lib/libatm.so.3 OLD_LIBS+=lib/libc.so.6 OLD_LIBS+=lib/libutil.so.5 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libatm.so.3 OLD_LIBS+=usr/lib32/libc.so.6 OLD_LIBS+=usr/lib32/libutil.so.5 -.endif # 20060413: shared library moved to /usr/lib OLD_LIBS+=lib/libgpib.so.1 # 20060413: libpcap.so.4 moved to /lib/ @@ -5249,12 +5203,10 @@ OLD_LIBS+=usr/lib/libc_r.a OLD_LIBS+=usr/lib/libc_r.so OLD_LIBS+=usr/lib/libc_r.so.7 OLD_LIBS+=usr/lib/libc_r_p.a -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libc_r.a OLD_LIBS+=usr/lib32/libc_r.so OLD_LIBS+=usr/lib32/libc_r.so.7 OLD_LIBS+=usr/lib32/libc_r_p.a -.endif # 20050722: bump for 6.0-RELEASE OLD_LIBS+=lib/libalias.so.4 OLD_LIBS+=lib/libatm.so.2 @@ -5466,10 +5418,8 @@ OLD_LIBS+=usr/lib/libc_r.so.3 OLD_LIBS+=usr/lib/libarchive.so.2 OLD_LIBS+=usr/lib/libbsnmp.so.1 OLD_LIBS+=usr/lib/libc_r.so.6 -.if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libarchive.so.2 OLD_LIBS+=usr/lib32/libc_r.so.6 -.endif OLD_LIBS+=usr/lib/libcipher.so.2 OLD_LIBS+=usr/lib/libgssapi.so.6 OLD_LIBS+=usr/lib/libkse.so.1 From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 08:48:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9717A106564A; Thu, 22 Mar 2012 08:48:44 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B5F08FC0A; Thu, 22 Mar 2012 08:48:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2M8mi1f015603; Thu, 22 Mar 2012 08:48:44 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2M8mia8015593; Thu, 22 Mar 2012 08:48:44 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201203220848.q2M8mia8015593@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 22 Mar 2012 08:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233294 - in head: . contrib/com_err crypto/heimdal crypto/heimdal/admin crypto/heimdal/appl crypto/heimdal/appl/afsutil crypto/heimdal/appl/ftp crypto/heimdal/appl/ftp/common crypto/he... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 08:48:44 -0000 Author: stas Date: Thu Mar 22 08:48:42 2012 New Revision: 233294 URL: http://svn.freebsd.org/changeset/base/233294 Log: - Update FreeBSD Heimdal distribution to version 1.5.1. This also brings several new kerberos related libraries and applications to FreeBSD: o kgetcred(1) allows one to manually get a ticket for a particular service. o kf(1) securily forwards ticket to another host through an authenticated and encrypted stream. o kcc(1) is an umbrella program around klist(1), kswitch(1), kgetcred(1) and other user kerberos operations. klist and kswitch are just symlinks to kcc(1) now. o kswitch(1) allows you to easily switch between kerberos credentials if you're running KCM. o hxtool(1) is a certificate management tool to use with PKINIT. o string2key(1) maps a password into key. o kdigest(8) is a userland tool to access the KDC's digest interface. o kimpersonate(8) creates a "fake" ticket for a service. We also now install manpages for some lirbaries that were not installed before, libheimntlm and libhx509. - The new HEIMDAL version no longer supports Kerberos 4. All users are recommended to switch to Kerberos 5. - Weak ciphers are now disabled by default. To enable DES support (used by telnet(8)), use "allow_weak_crypto" option in krb5.conf. - libtelnet, pam_ksu and pam_krb5 are now compiled with error on warnings disabled due to the function they use (krb5_get_err_text(3)) being deprecated. I plan to work on this next. - Heimdal's KDC now require sqlite to operate. We use the bundled version and install it as libheimsqlite. If some other FreeBSD components will require it in the future we can rename it to libbsdsqlite and use for these components as well. - This is not a latest Heimdal version, the new one was released while I was working on the update. I will update it to 1.5.2 soon, as it fixes some important bugs and security issues. Added: head/crypto/heimdal/admin/destroy.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/admin/destroy.c head/crypto/heimdal/appl/login/login-protos.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/appl/login/login-protos.h head/crypto/heimdal/base/ - copied from r226129, vendor-crypto/heimdal/dist/base/ head/crypto/heimdal/doc/copyright.texi head/crypto/heimdal/doc/doxyout/ - copied from r226129, vendor-crypto/heimdal/dist/doc/doxyout/ head/crypto/heimdal/doc/gssapi.din - copied unchanged from r226129, vendor-crypto/heimdal/dist/doc/gssapi.din head/crypto/heimdal/doc/header.html - copied unchanged from r226129, vendor-crypto/heimdal/dist/doc/header.html head/crypto/heimdal/doc/wind.din - copied unchanged from r226129, vendor-crypto/heimdal/dist/doc/wind.din head/crypto/heimdal/include/crypto-headers.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/include/crypto-headers.h head/crypto/heimdal/include/heim_threads.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/include/heim_threads.h head/crypto/heimdal/include/krb5-types.cross - copied unchanged from r226129, vendor-crypto/heimdal/dist/include/krb5-types.cross head/crypto/heimdal/kadmin/rpc.c - copied, changed from r226129, vendor-crypto/heimdal/dist/kadmin/rpc.c head/crypto/heimdal/kcm/kcm-protos.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/kcm/kcm-protos.h head/crypto/heimdal/kcm/sessions.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/kcm/sessions.c head/crypto/heimdal/kdc/announce.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/kdc/announce.c head/crypto/heimdal/kdc/digest-service.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/kdc/digest-service.c head/crypto/heimdal/kuser/kcc-commands.in - copied unchanged from r226129, vendor-crypto/heimdal/dist/kuser/kcc-commands.in head/crypto/heimdal/kuser/kcc.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/kuser/kcc.c head/crypto/heimdal/kuser/kdigest.8 - copied unchanged from r226129, vendor-crypto/heimdal/dist/kuser/kdigest.8 head/crypto/heimdal/kuser/kimpersonate.8 - copied unchanged from r226129, vendor-crypto/heimdal/dist/kuser/kimpersonate.8 head/crypto/heimdal/kuser/kswitch.1 - copied unchanged from r226129, vendor-crypto/heimdal/dist/kuser/kswitch.1 head/crypto/heimdal/kuser/kswitch.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/kuser/kswitch.c head/crypto/heimdal/lib/asn1/asn1-template.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/asn1-template.h head/crypto/heimdal/lib/asn1/asn1parse.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/asn1parse.c head/crypto/heimdal/lib/asn1/asn1parse.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/asn1parse.h head/crypto/heimdal/lib/asn1/asn1parse.y - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/asn1parse.y head/crypto/heimdal/lib/asn1/cms.asn1 - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/cms.asn1 head/crypto/heimdal/lib/asn1/cms.opt - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/cms.opt head/crypto/heimdal/lib/asn1/der-private.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/der-private.h head/crypto/heimdal/lib/asn1/gen_template.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/gen_template.c head/crypto/heimdal/lib/asn1/krb5.asn1 - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/krb5.asn1 head/crypto/heimdal/lib/asn1/krb5.opt - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/krb5.opt head/crypto/heimdal/lib/asn1/template.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/template.c head/crypto/heimdal/lib/asn1/version-script.map - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/asn1/version-script.map head/crypto/heimdal/lib/gssapi/gssapi/gssapi_ntlm.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/gssapi/gssapi_ntlm.h head/crypto/heimdal/lib/gssapi/gssapi/gssapi_oid.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/gssapi/gssapi_oid.h head/crypto/heimdal/lib/gssapi/gsstool.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/gsstool.c head/crypto/heimdal/lib/gssapi/krb5/aeap.c - copied, changed from r226129, vendor-crypto/heimdal/dist/lib/gssapi/krb5/aeap.c head/crypto/heimdal/lib/gssapi/krb5/authorize_localname.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/krb5/authorize_localname.c head/crypto/heimdal/lib/gssapi/krb5/creds.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/krb5/creds.c head/crypto/heimdal/lib/gssapi/krb5/pname_to_uid.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/krb5/pname_to_uid.c head/crypto/heimdal/lib/gssapi/krb5/store_cred.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/krb5/store_cred.c head/crypto/heimdal/lib/gssapi/mech/ - copied from r226129, vendor-crypto/heimdal/dist/lib/gssapi/mech/ head/crypto/heimdal/lib/gssapi/ntlm/creds.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/ntlm/creds.c head/crypto/heimdal/lib/gssapi/ntlm/inquire_sec_context_by_oid.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/ntlm/inquire_sec_context_by_oid.c head/crypto/heimdal/lib/gssapi/ntlm/iter_cred.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/ntlm/iter_cred.c head/crypto/heimdal/lib/gssapi/ntlm/kdc.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/ntlm/kdc.c head/crypto/heimdal/lib/gssapi/spnego/spnego.opt - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/gssapi/spnego/spnego.opt head/crypto/heimdal/lib/hdb/hdb-keytab.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hdb/hdb-keytab.c head/crypto/heimdal/lib/hdb/hdb-mitdb.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hdb/hdb-mitdb.c head/crypto/heimdal/lib/hdb/hdb-sqlite.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hdb/hdb-sqlite.c head/crypto/heimdal/lib/hdb/version-script.map - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hdb/version-script.map head/crypto/heimdal/lib/heimdal/ - copied from r226129, vendor-crypto/heimdal/dist/lib/heimdal/ head/crypto/heimdal/lib/hx509/char_map.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hx509/char_map.h head/crypto/heimdal/lib/hx509/ocsp.opt - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hx509/ocsp.opt head/crypto/heimdal/lib/hx509/pkcs10.opt - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hx509/pkcs10.opt head/crypto/heimdal/lib/hx509/quote.py - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hx509/quote.py head/crypto/heimdal/lib/hx509/sel-gram.y - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hx509/sel-gram.y head/crypto/heimdal/lib/hx509/sel-lex.l - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hx509/sel-lex.l head/crypto/heimdal/lib/hx509/sel.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hx509/sel.c head/crypto/heimdal/lib/hx509/sel.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/hx509/sel.h head/crypto/heimdal/lib/ipc/ - copied from r226129, vendor-crypto/heimdal/dist/lib/ipc/ head/crypto/heimdal/lib/krb5/ccache_plugin.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/ccache_plugin.h head/crypto/heimdal/lib/krb5/crypto-aes.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto-aes.c head/crypto/heimdal/lib/krb5/crypto-algs.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto-algs.c head/crypto/heimdal/lib/krb5/crypto-arcfour.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto-arcfour.c head/crypto/heimdal/lib/krb5/crypto-des-common.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto-des-common.c head/crypto/heimdal/lib/krb5/crypto-des.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto-des.c head/crypto/heimdal/lib/krb5/crypto-des3.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto-des3.c head/crypto/heimdal/lib/krb5/crypto-evp.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto-evp.c head/crypto/heimdal/lib/krb5/crypto-null.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto-null.c head/crypto/heimdal/lib/krb5/crypto-pk.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto-pk.c head/crypto/heimdal/lib/krb5/crypto-rand.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto-rand.c head/crypto/heimdal/lib/krb5/crypto-stubs.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto-stubs.c head/crypto/heimdal/lib/krb5/crypto.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/crypto.h head/crypto/heimdal/lib/krb5/deprecated.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/deprecated.c head/crypto/heimdal/lib/krb5/expand_path.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/expand_path.c head/crypto/heimdal/lib/krb5/pcache.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/pcache.c head/crypto/heimdal/lib/krb5/salt-aes.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/salt-aes.c head/crypto/heimdal/lib/krb5/salt-arcfour.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/salt-arcfour.c head/crypto/heimdal/lib/krb5/salt-des.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/salt-des.c head/crypto/heimdal/lib/krb5/salt-des3.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/salt-des3.c head/crypto/heimdal/lib/krb5/salt.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/salt.c head/crypto/heimdal/lib/krb5/scache.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/scache.c head/crypto/heimdal/lib/krb5/send_to_kdc_plugin.h - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/send_to_kdc_plugin.h head/crypto/heimdal/lib/krb5/store-int.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/krb5/store-int.c head/crypto/heimdal/lib/ntlm/ntlm_err.et - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/ntlm/ntlm_err.et head/crypto/heimdal/lib/roken/cloexec.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/roken/cloexec.c head/crypto/heimdal/lib/roken/ct.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/roken/ct.c head/crypto/heimdal/lib/roken/doxygen.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/roken/doxygen.c head/crypto/heimdal/lib/roken/qsort.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/roken/qsort.c head/crypto/heimdal/lib/roken/rand.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/roken/rand.c head/crypto/heimdal/lib/roken/rkpty.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/roken/rkpty.c head/crypto/heimdal/lib/roken/search.hin - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/roken/search.hin head/crypto/heimdal/lib/roken/strerror_r.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/roken/strerror_r.c head/crypto/heimdal/lib/roken/tsearch.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/roken/tsearch.c head/crypto/heimdal/lib/roken/version-script.map - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/roken/version-script.map head/crypto/heimdal/lib/roken/xfree.c - copied unchanged from r226129, vendor-crypto/heimdal/dist/lib/roken/xfree.c head/crypto/heimdal/lib/sqlite/ - copied from r226129, vendor-crypto/heimdal/dist/lib/sqlite/ head/crypto/heimdal/lib/wind/ - copied from r226129, vendor-crypto/heimdal/dist/lib/wind/ head/kerberos5/lib/libgssapi_krb5/gss_oid.c (contents, props changed) head/kerberos5/lib/libgssapi_spnego/freebsd_compat.c - copied, changed from r232906, head/kerberos5/lib/libgssapi_spnego/prefix.c head/kerberos5/lib/libheimbase/ head/kerberos5/lib/libheimbase/Makefile (contents, props changed) head/kerberos5/lib/libheimipcc/ head/kerberos5/lib/libheimipcc/Makefile (contents, props changed) head/kerberos5/lib/libheimipcs/ head/kerberos5/lib/libheimipcs/Makefile (contents, props changed) head/kerberos5/lib/libheimsqlite/ head/kerberos5/lib/libheimsqlite/Makefile (contents, props changed) head/kerberos5/lib/libkdc/ head/kerberos5/lib/libkdc/Makefile (contents, props changed) head/kerberos5/lib/libwind/ head/kerberos5/lib/libwind/Makefile (contents, props changed) head/kerberos5/libexec/digest-service/ head/kerberos5/libexec/digest-service/Makefile (contents, props changed) head/kerberos5/libexec/kdigest/ head/kerberos5/libexec/kdigest/Makefile (contents, props changed) head/kerberos5/libexec/kfd/ head/kerberos5/libexec/kfd/Makefile (contents, props changed) head/kerberos5/libexec/kimpersonate/ head/kerberos5/libexec/kimpersonate/Makefile (contents, props changed) head/kerberos5/usr.bin/hxtool/ head/kerberos5/usr.bin/hxtool/Makefile (contents, props changed) head/kerberos5/usr.bin/kcc/ head/kerberos5/usr.bin/kcc/Makefile (contents, props changed) head/kerberos5/usr.bin/kf/ head/kerberos5/usr.bin/kf/Makefile (contents, props changed) head/kerberos5/usr.bin/kgetcred/ head/kerberos5/usr.bin/kgetcred/Makefile (contents, props changed) head/kerberos5/usr.bin/string2key/ head/kerberos5/usr.bin/string2key/Makefile (contents, props changed) head/kerberos5/usr.sbin/iprop-log/ head/kerberos5/usr.sbin/iprop-log/Makefile (contents, props changed) Replaced: head/contrib/com_err/ChangeLog (contents, props changed) Deleted: head/contrib/com_err/Makefile.am head/contrib/com_err/Makefile.in head/contrib/com_err/getarg.c head/contrib/com_err/getarg.h head/contrib/com_err/lex.c head/contrib/com_err/parse.c head/contrib/com_err/parse.h head/crypto/heimdal/appl/ftp/ftp/krb4.c head/crypto/heimdal/appl/ftp/ftpd/krb4.c head/crypto/heimdal/appl/login/login_protos.h head/crypto/heimdal/appl/telnet/libtelnet/kerberos.c head/crypto/heimdal/appl/telnet/libtelnet/krb4encpwd.c head/crypto/heimdal/cf/ head/crypto/heimdal/configure.in head/crypto/heimdal/include/make_crypto.c head/crypto/heimdal/kcm/cursor.c head/crypto/heimdal/kcm/kcm_protos.h head/crypto/heimdal/kdc/524.c head/crypto/heimdal/kdc/kadb.h head/crypto/heimdal/kdc/kaserver.c head/crypto/heimdal/kdc/kerberos4.c head/crypto/heimdal/kdc/v4_dump.c head/crypto/heimdal/kuser/kimpersonate.1 head/crypto/heimdal/lib/45/ head/crypto/heimdal/lib/asn1/CMS.asn1 head/crypto/heimdal/lib/asn1/k5.asn1 head/crypto/heimdal/lib/asn1/parse.c head/crypto/heimdal/lib/asn1/parse.h head/crypto/heimdal/lib/asn1/parse.y head/crypto/heimdal/lib/auth/ head/crypto/heimdal/lib/gssapi/gss.c head/crypto/heimdal/lib/gssapi/krb5/v1.c head/crypto/heimdal/lib/gssapi/ntlm/digest.c head/crypto/heimdal/lib/gssapi/ntlm/inquire_cred.c head/crypto/heimdal/lib/hx509/data/ head/crypto/heimdal/lib/kafs/README.dlfcn head/crypto/heimdal/lib/kafs/afskrb.c head/crypto/heimdal/lib/kafs/dlfcn.c head/crypto/heimdal/lib/kafs/dlfcn.h head/crypto/heimdal/lib/krb5/config_file_netinfo.c head/crypto/heimdal/lib/krb5/get_in_tkt_pw.c head/crypto/heimdal/lib/krb5/get_in_tkt_with_keytab.c head/crypto/heimdal/lib/krb5/get_in_tkt_with_skey.c head/crypto/heimdal/lib/krb5/heim_threads.h head/crypto/heimdal/lib/krb5/keytab_krb4.c head/crypto/heimdal/lib/krb5/krb5.3 head/crypto/heimdal/lib/krb5/krb5_address.3 head/crypto/heimdal/lib/krb5/krb5_ccache.3 head/crypto/heimdal/lib/krb5/krb5_compare_creds.3 head/crypto/heimdal/lib/krb5/krb5_config.3 head/crypto/heimdal/lib/krb5/krb5_context.3 head/crypto/heimdal/lib/krb5/krb5_crypto_init.3 head/crypto/heimdal/lib/krb5/krb5_data.3 head/crypto/heimdal/lib/krb5/krb5_expand_hostname.3 head/crypto/heimdal/lib/krb5/krb5_keyblock.3 head/crypto/heimdal/lib/krb5/krb5_keytab.3 head/crypto/heimdal/lib/krb5/krb5_kuserok.3 head/crypto/heimdal/lib/krb5/krb5_storage.3 head/crypto/heimdal/lib/krb5/krb5_ticket.3 head/crypto/heimdal/lib/krb5/krb5_unparse_name.3 head/crypto/heimdal/lib/krb5/krb5_warn.3 head/crypto/heimdal/lib/krb5/name-45-test.c head/crypto/heimdal/lib/krb5/v4_glue.c head/crypto/heimdal/lib/roken/snprintf-test.h head/crypto/heimdal/lib/roken/vis.h head/crypto/heimdal/lib/sl/lex.c head/crypto/heimdal/lib/sl/lex.l head/crypto/heimdal/lib/sl/make_cmds.c head/crypto/heimdal/lib/sl/make_cmds.h head/crypto/heimdal/lib/sl/parse.c head/crypto/heimdal/lib/sl/parse.h head/crypto/heimdal/lib/sl/parse.y head/crypto/heimdal/lib/sl/ss.c head/crypto/heimdal/lib/sl/ss.h head/crypto/heimdal/lib/vers/make-print-version.c head/crypto/heimdal/packages/ head/crypto/heimdal/tests/ head/crypto/heimdal/tools/heimdal-build.sh head/kerberos5/lib/libgssapi_spnego/prefix.c head/kerberos5/tools/make-print-version/ head/kerberos5/usr.bin/klist/ Modified: head/Makefile.inc1 head/ObsoleteFiles.inc head/contrib/com_err/com_err.3 head/contrib/com_err/com_err.c (contents, props changed) head/contrib/com_err/com_err.h (contents, props changed) head/contrib/com_err/com_right.h (contents, props changed) head/contrib/com_err/compile_et.c (contents, props changed) head/contrib/com_err/compile_et.h (contents, props changed) head/contrib/com_err/error.c (contents, props changed) head/contrib/com_err/lex.h (contents, props changed) head/contrib/com_err/lex.l head/contrib/com_err/parse.y head/contrib/com_err/roken_rename.h (contents, props changed) head/contrib/com_err/version-script.map head/crypto/heimdal/ChangeLog (contents, props changed) head/crypto/heimdal/ChangeLog.2002 (contents, props changed) head/crypto/heimdal/ChangeLog.2003 (contents, props changed) head/crypto/heimdal/ChangeLog.2004 (contents, props changed) head/crypto/heimdal/ChangeLog.2005 (contents, props changed) head/crypto/heimdal/ChangeLog.2006 (contents, props changed) head/crypto/heimdal/LICENSE (contents, props changed) head/crypto/heimdal/Makefile.am head/crypto/heimdal/Makefile.am.common head/crypto/heimdal/Makefile.in head/crypto/heimdal/NEWS (contents, props changed) head/crypto/heimdal/README (contents, props changed) head/crypto/heimdal/acinclude.m4 head/crypto/heimdal/aclocal.m4 head/crypto/heimdal/admin/ChangeLog (contents, props changed) head/crypto/heimdal/admin/Makefile.am head/crypto/heimdal/admin/Makefile.in head/crypto/heimdal/admin/add.c (contents, props changed) head/crypto/heimdal/admin/change.c (contents, props changed) head/crypto/heimdal/admin/copy.c (contents, props changed) head/crypto/heimdal/admin/get.c (contents, props changed) head/crypto/heimdal/admin/ktutil-commands.in head/crypto/heimdal/admin/ktutil.8 head/crypto/heimdal/admin/ktutil.c (contents, props changed) head/crypto/heimdal/admin/ktutil_locl.h (contents, props changed) head/crypto/heimdal/admin/list.c (contents, props changed) head/crypto/heimdal/admin/purge.c (contents, props changed) head/crypto/heimdal/admin/remove.c (contents, props changed) head/crypto/heimdal/admin/rename.c (contents, props changed) head/crypto/heimdal/appl/Makefile.am head/crypto/heimdal/appl/Makefile.in head/crypto/heimdal/appl/afsutil/ChangeLog (contents, props changed) head/crypto/heimdal/appl/afsutil/Makefile.am head/crypto/heimdal/appl/afsutil/Makefile.in head/crypto/heimdal/appl/afsutil/afslog.1 head/crypto/heimdal/appl/afsutil/afslog.c (contents, props changed) head/crypto/heimdal/appl/afsutil/pagsh.1 head/crypto/heimdal/appl/afsutil/pagsh.c (contents, props changed) head/crypto/heimdal/appl/ftp/ChangeLog (contents, props changed) head/crypto/heimdal/appl/ftp/Makefile.am head/crypto/heimdal/appl/ftp/Makefile.in head/crypto/heimdal/appl/ftp/common/Makefile.am head/crypto/heimdal/appl/ftp/common/Makefile.in head/crypto/heimdal/appl/ftp/common/buffer.c (contents, props changed) head/crypto/heimdal/appl/ftp/common/common.h (contents, props changed) head/crypto/heimdal/appl/ftp/common/sockbuf.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/Makefile.am head/crypto/heimdal/appl/ftp/ftp/Makefile.in head/crypto/heimdal/appl/ftp/ftp/cmds.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/cmdtab.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/domacro.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/extern.h (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/ftp.1 head/crypto/heimdal/appl/ftp/ftp/ftp.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/ftp_locl.h (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/globals.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/gssapi.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/kauth.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/main.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/ruserpass.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/security.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftp/security.h (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/Makefile.am head/crypto/heimdal/appl/ftp/ftpd/Makefile.in head/crypto/heimdal/appl/ftp/ftpd/extern.h (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/ftpcmd.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/ftpcmd.y (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/ftpd.8 head/crypto/heimdal/appl/ftp/ftpd/ftpd.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/ftpd_locl.h (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/ftpusers.5 head/crypto/heimdal/appl/ftp/ftpd/gss_userok.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/gssapi.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/kauth.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/klist.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/logwtmp.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/ls.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/popen.c (contents, props changed) head/crypto/heimdal/appl/ftp/ftpd/security.c (contents, props changed) head/crypto/heimdal/appl/gssmask/Makefile.am head/crypto/heimdal/appl/gssmask/Makefile.in head/crypto/heimdal/appl/gssmask/common.c (contents, props changed) head/crypto/heimdal/appl/gssmask/common.h (contents, props changed) head/crypto/heimdal/appl/gssmask/gssmaestro.c (contents, props changed) head/crypto/heimdal/appl/gssmask/gssmask.c (contents, props changed) head/crypto/heimdal/appl/gssmask/protocol.h (contents, props changed) head/crypto/heimdal/appl/kf/Makefile.am head/crypto/heimdal/appl/kf/Makefile.in head/crypto/heimdal/appl/kf/kf.1 head/crypto/heimdal/appl/kf/kf.c (contents, props changed) head/crypto/heimdal/appl/kf/kf_locl.h (contents, props changed) head/crypto/heimdal/appl/kf/kfd.8 head/crypto/heimdal/appl/kf/kfd.c (contents, props changed) head/crypto/heimdal/appl/login/ChangeLog (contents, props changed) head/crypto/heimdal/appl/login/Makefile.am head/crypto/heimdal/appl/login/Makefile.in head/crypto/heimdal/appl/login/conf.c (contents, props changed) head/crypto/heimdal/appl/login/env.c (contents, props changed) head/crypto/heimdal/appl/login/limits_conf.c (contents, props changed) head/crypto/heimdal/appl/login/login.1 head/crypto/heimdal/appl/login/login.access.5 head/crypto/heimdal/appl/login/login.c (contents, props changed) head/crypto/heimdal/appl/login/login_access.c (contents, props changed) head/crypto/heimdal/appl/login/login_locl.h (contents, props changed) head/crypto/heimdal/appl/login/loginpaths.h (contents, props changed) head/crypto/heimdal/appl/login/osfc2.c (contents, props changed) head/crypto/heimdal/appl/login/read_string.c (contents, props changed) head/crypto/heimdal/appl/login/shadow.c (contents, props changed) head/crypto/heimdal/appl/login/stty_default.c (contents, props changed) head/crypto/heimdal/appl/login/tty.c (contents, props changed) head/crypto/heimdal/appl/login/utmp_login.c (contents, props changed) head/crypto/heimdal/appl/login/utmpx_login.c (contents, props changed) head/crypto/heimdal/appl/push/ChangeLog (contents, props changed) head/crypto/heimdal/appl/push/Makefile.am head/crypto/heimdal/appl/push/Makefile.in head/crypto/heimdal/appl/push/pfrom.1 head/crypto/heimdal/appl/push/pfrom.in head/crypto/heimdal/appl/push/push.8 head/crypto/heimdal/appl/push/push.c (contents, props changed) head/crypto/heimdal/appl/push/push_locl.h (contents, props changed) head/crypto/heimdal/appl/rcp/ChangeLog (contents, props changed) head/crypto/heimdal/appl/rcp/Makefile.am head/crypto/heimdal/appl/rcp/Makefile.in head/crypto/heimdal/appl/rcp/extern.h (contents, props changed) head/crypto/heimdal/appl/rcp/rcp.1 head/crypto/heimdal/appl/rcp/rcp.c (contents, props changed) head/crypto/heimdal/appl/rcp/rcp_locl.h (contents, props changed) head/crypto/heimdal/appl/rcp/util.c (contents, props changed) head/crypto/heimdal/appl/rsh/ChangeLog (contents, props changed) head/crypto/heimdal/appl/rsh/Makefile.am head/crypto/heimdal/appl/rsh/Makefile.in head/crypto/heimdal/appl/rsh/common.c (contents, props changed) head/crypto/heimdal/appl/rsh/limits_conf.c (contents, props changed) head/crypto/heimdal/appl/rsh/login_access.c (contents, props changed) head/crypto/heimdal/appl/rsh/rsh.1 head/crypto/heimdal/appl/rsh/rsh.c (contents, props changed) head/crypto/heimdal/appl/rsh/rsh_locl.h (contents, props changed) head/crypto/heimdal/appl/rsh/rshd.8 head/crypto/heimdal/appl/rsh/rshd.c (contents, props changed) head/crypto/heimdal/appl/su/ChangeLog (contents, props changed) head/crypto/heimdal/appl/su/Makefile.am head/crypto/heimdal/appl/su/Makefile.in head/crypto/heimdal/appl/su/su.1 head/crypto/heimdal/appl/su/su.c (contents, props changed) head/crypto/heimdal/appl/su/supaths.h (contents, props changed) head/crypto/heimdal/appl/telnet/ChangeLog (contents, props changed) head/crypto/heimdal/appl/telnet/Makefile.am head/crypto/heimdal/appl/telnet/Makefile.in head/crypto/heimdal/appl/telnet/libtelnet/Makefile.am head/crypto/heimdal/appl/telnet/libtelnet/Makefile.in head/crypto/heimdal/appl/telnet/libtelnet/auth-proto.h (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/auth.c (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/auth.h (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/enc-proto.h (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/enc_des.c (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/encrypt.c (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/encrypt.h (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/genget.c (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/kerberos5.c (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/misc-proto.h (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/misc.c (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/rsaencpwd.c (contents, props changed) head/crypto/heimdal/appl/telnet/libtelnet/spx.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/Makefile.am head/crypto/heimdal/appl/telnet/telnet/Makefile.in head/crypto/heimdal/appl/telnet/telnet/authenc.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/commands.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/externs.h (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/main.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/network.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/ring.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/ring.h (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/sys_bsd.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/telnet.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/telnet_locl.h (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/terminal.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnet/utilities.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnetd/Makefile.am head/crypto/heimdal/appl/telnet/telnetd/Makefile.in head/crypto/heimdal/appl/telnet/telnetd/authenc.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnetd/defs.h (contents, props changed) head/crypto/heimdal/appl/telnet/telnetd/ext.h (contents, props changed) head/crypto/heimdal/appl/telnet/telnetd/global.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnetd/slc.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnetd/state.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnetd/sys_term.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnetd/telnetd.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnetd/telnetd.h (contents, props changed) head/crypto/heimdal/appl/telnet/telnetd/termstat.c (contents, props changed) head/crypto/heimdal/appl/telnet/telnetd/utility.c (contents, props changed) head/crypto/heimdal/appl/test/Makefile.am head/crypto/heimdal/appl/test/Makefile.in head/crypto/heimdal/appl/test/common.c (contents, props changed) head/crypto/heimdal/appl/test/gss_common.c (contents, props changed) head/crypto/heimdal/appl/test/gss_common.h (contents, props changed) head/crypto/heimdal/appl/test/gssapi_client.c (contents, props changed) head/crypto/heimdal/appl/test/gssapi_server.c (contents, props changed) head/crypto/heimdal/appl/test/http_client.c (contents, props changed) head/crypto/heimdal/appl/test/nt_gss_client.c (contents, props changed) head/crypto/heimdal/appl/test/nt_gss_common.c (contents, props changed) head/crypto/heimdal/appl/test/nt_gss_common.h (contents, props changed) head/crypto/heimdal/appl/test/nt_gss_server.c (contents, props changed) head/crypto/heimdal/appl/test/tcp_client.c (contents, props changed) head/crypto/heimdal/appl/test/tcp_server.c (contents, props changed) head/crypto/heimdal/appl/test/test_locl.h (contents, props changed) head/crypto/heimdal/appl/test/uu_client.c (contents, props changed) head/crypto/heimdal/appl/test/uu_server.c (contents, props changed) head/crypto/heimdal/autogen.sh head/crypto/heimdal/compile head/crypto/heimdal/config.guess head/crypto/heimdal/config.sub head/crypto/heimdal/configure head/crypto/heimdal/doc/Makefile.am head/crypto/heimdal/doc/Makefile.in head/crypto/heimdal/doc/ack.texi head/crypto/heimdal/doc/apps.texi head/crypto/heimdal/doc/doxytmpl.dxy head/crypto/heimdal/doc/hcrypto.din head/crypto/heimdal/doc/heimdal.texi head/crypto/heimdal/doc/hx509.din head/crypto/heimdal/doc/hx509.texi head/crypto/heimdal/doc/install.texi head/crypto/heimdal/doc/intro.texi head/crypto/heimdal/doc/kerberos4.texi head/crypto/heimdal/doc/krb5.din head/crypto/heimdal/doc/migration.texi head/crypto/heimdal/doc/misc.texi head/crypto/heimdal/doc/ntlm.din head/crypto/heimdal/doc/programming.texi head/crypto/heimdal/doc/setup.texi head/crypto/heimdal/doc/vars.texi head/crypto/heimdal/doc/whatis.texi head/crypto/heimdal/doc/win2k.texi head/crypto/heimdal/etc/Makefile.am head/crypto/heimdal/etc/Makefile.in head/crypto/heimdal/etc/services.append head/crypto/heimdal/include/Makefile.am head/crypto/heimdal/include/Makefile.in head/crypto/heimdal/include/bits.c (contents, props changed) head/crypto/heimdal/include/config.h.in head/crypto/heimdal/include/gssapi/Makefile.am head/crypto/heimdal/include/gssapi/Makefile.in head/crypto/heimdal/include/hcrypto/Makefile.am head/crypto/heimdal/include/hcrypto/Makefile.in head/crypto/heimdal/include/kadm5/Makefile.am head/crypto/heimdal/include/kadm5/Makefile.in head/crypto/heimdal/install-sh head/crypto/heimdal/kadmin/ChangeLog (contents, props changed) head/crypto/heimdal/kadmin/Makefile.am head/crypto/heimdal/kadmin/Makefile.in head/crypto/heimdal/kadmin/add-random-users.c (contents, props changed) head/crypto/heimdal/kadmin/add_enctype.c (contents, props changed) head/crypto/heimdal/kadmin/ank.c (contents, props changed) head/crypto/heimdal/kadmin/check.c (contents, props changed) head/crypto/heimdal/kadmin/cpw.c (contents, props changed) head/crypto/heimdal/kadmin/del.c (contents, props changed) head/crypto/heimdal/kadmin/del_enctype.c (contents, props changed) head/crypto/heimdal/kadmin/dump.c (contents, props changed) head/crypto/heimdal/kadmin/ext.c (contents, props changed) head/crypto/heimdal/kadmin/get.c (contents, props changed) head/crypto/heimdal/kadmin/init.c (contents, props changed) head/crypto/heimdal/kadmin/kadm_conn.c (contents, props changed) head/crypto/heimdal/kadmin/kadmin-commands.in head/crypto/heimdal/kadmin/kadmin.8 head/crypto/heimdal/kadmin/kadmin.c (contents, props changed) head/crypto/heimdal/kadmin/kadmin_locl.h (contents, props changed) head/crypto/heimdal/kadmin/kadmind.8 head/crypto/heimdal/kadmin/kadmind.c (contents, props changed) head/crypto/heimdal/kadmin/load.c (contents, props changed) head/crypto/heimdal/kadmin/mod.c (contents, props changed) head/crypto/heimdal/kadmin/pw_quality.c (contents, props changed) head/crypto/heimdal/kadmin/random_password.c (contents, props changed) head/crypto/heimdal/kadmin/rename.c (contents, props changed) head/crypto/heimdal/kadmin/server.c (contents, props changed) head/crypto/heimdal/kadmin/stash.c (contents, props changed) head/crypto/heimdal/kadmin/test_util.c (contents, props changed) head/crypto/heimdal/kadmin/util.c (contents, props changed) head/crypto/heimdal/kcm/Makefile.am head/crypto/heimdal/kcm/Makefile.in head/crypto/heimdal/kcm/acl.c (contents, props changed) head/crypto/heimdal/kcm/acquire.c (contents, props changed) head/crypto/heimdal/kcm/cache.c (contents, props changed) head/crypto/heimdal/kcm/client.c (contents, props changed) head/crypto/heimdal/kcm/config.c (contents, props changed) head/crypto/heimdal/kcm/connect.c (contents, props changed) head/crypto/heimdal/kcm/events.c (contents, props changed) head/crypto/heimdal/kcm/glue.c (contents, props changed) head/crypto/heimdal/kcm/headers.h (contents, props changed) head/crypto/heimdal/kcm/kcm.8 head/crypto/heimdal/kcm/kcm_locl.h (contents, props changed) head/crypto/heimdal/kcm/log.c (contents, props changed) head/crypto/heimdal/kcm/main.c (contents, props changed) head/crypto/heimdal/kcm/protocol.c (contents, props changed) head/crypto/heimdal/kcm/renew.c (contents, props changed) head/crypto/heimdal/kdc/Makefile.am head/crypto/heimdal/kdc/Makefile.in head/crypto/heimdal/kdc/config.c (contents, props changed) head/crypto/heimdal/kdc/connect.c (contents, props changed) head/crypto/heimdal/kdc/default_config.c (contents, props changed) head/crypto/heimdal/kdc/digest.c (contents, props changed) head/crypto/heimdal/kdc/headers.h (contents, props changed) head/crypto/heimdal/kdc/hprop.8 head/crypto/heimdal/kdc/hprop.c (contents, props changed) head/crypto/heimdal/kdc/hprop.h (contents, props changed) head/crypto/heimdal/kdc/hpropd.8 head/crypto/heimdal/kdc/hpropd.c (contents, props changed) head/crypto/heimdal/kdc/kdc-private.h (contents, props changed) head/crypto/heimdal/kdc/kdc-protos.h (contents, props changed) head/crypto/heimdal/kdc/kdc-replay.c (contents, props changed) head/crypto/heimdal/kdc/kdc.8 head/crypto/heimdal/kdc/kdc.h (contents, props changed) head/crypto/heimdal/kdc/kdc_locl.h (contents, props changed) head/crypto/heimdal/kdc/kerberos5.c (contents, props changed) head/crypto/heimdal/kdc/krb5tgs.c (contents, props changed) head/crypto/heimdal/kdc/kstash.8 head/crypto/heimdal/kdc/kstash.c (contents, props changed) head/crypto/heimdal/kdc/kx509.c (contents, props changed) head/crypto/heimdal/kdc/log.c (contents, props changed) head/crypto/heimdal/kdc/main.c (contents, props changed) head/crypto/heimdal/kdc/misc.c (contents, props changed) head/crypto/heimdal/kdc/mit_dump.c (contents, props changed) head/crypto/heimdal/kdc/pkinit.c (contents, props changed) head/crypto/heimdal/kdc/process.c (contents, props changed) head/crypto/heimdal/kdc/rx.h (contents, props changed) head/crypto/heimdal/kdc/set_dbinfo.c (contents, props changed) head/crypto/heimdal/kdc/string2key.8 head/crypto/heimdal/kdc/string2key.c (contents, props changed) head/crypto/heimdal/kdc/version-script.map head/crypto/heimdal/kdc/windc.c (contents, props changed) head/crypto/heimdal/kdc/windc_plugin.h (contents, props changed) head/crypto/heimdal/kpasswd/Makefile.am head/crypto/heimdal/kpasswd/Makefile.in head/crypto/heimdal/kpasswd/kpasswd-generator.c (contents, props changed) head/crypto/heimdal/kpasswd/kpasswd.1 head/crypto/heimdal/kpasswd/kpasswd.c (contents, props changed) head/crypto/heimdal/kpasswd/kpasswd_locl.h (contents, props changed) head/crypto/heimdal/kpasswd/kpasswdd.8 head/crypto/heimdal/kpasswd/kpasswdd.c (contents, props changed) head/crypto/heimdal/kuser/Makefile.am head/crypto/heimdal/kuser/Makefile.in head/crypto/heimdal/kuser/copy_cred_cache.1 head/crypto/heimdal/kuser/copy_cred_cache.c (contents, props changed) head/crypto/heimdal/kuser/generate-requests.c (contents, props changed) head/crypto/heimdal/kuser/kdecode_ticket.c (contents, props changed) head/crypto/heimdal/kuser/kdestroy.1 head/crypto/heimdal/kuser/kdestroy.c (contents, props changed) head/crypto/heimdal/kuser/kdigest-commands.in head/crypto/heimdal/kuser/kdigest.c (contents, props changed) head/crypto/heimdal/kuser/kgetcred.1 head/crypto/heimdal/kuser/kgetcred.c (contents, props changed) head/crypto/heimdal/kuser/kimpersonate.c (contents, props changed) head/crypto/heimdal/kuser/kinit.1 head/crypto/heimdal/kuser/kinit.c (contents, props changed) head/crypto/heimdal/kuser/klist.1 head/crypto/heimdal/kuser/klist.c (contents, props changed) head/crypto/heimdal/kuser/kuser_locl.h (contents, props changed) head/crypto/heimdal/kuser/kverify.c (contents, props changed) head/crypto/heimdal/lib/Makefile.am head/crypto/heimdal/lib/Makefile.in head/crypto/heimdal/lib/asn1/ChangeLog (contents, props changed) head/crypto/heimdal/lib/asn1/Makefile.am head/crypto/heimdal/lib/asn1/Makefile.in head/crypto/heimdal/lib/asn1/asn1-common.h (contents, props changed) head/crypto/heimdal/lib/asn1/asn1_err.et head/crypto/heimdal/lib/asn1/asn1_gen.c (contents, props changed) head/crypto/heimdal/lib/asn1/asn1_print.c (contents, props changed) head/crypto/heimdal/lib/asn1/asn1_queue.h (contents, props changed) head/crypto/heimdal/lib/asn1/canthandle.asn1 head/crypto/heimdal/lib/asn1/check-common.c (contents, props changed) head/crypto/heimdal/lib/asn1/check-common.h (contents, props changed) head/crypto/heimdal/lib/asn1/check-der.c (contents, props changed) head/crypto/heimdal/lib/asn1/check-gen.c (contents, props changed) head/crypto/heimdal/lib/asn1/check-timegm.c (contents, props changed) head/crypto/heimdal/lib/asn1/der-protos.h (contents, props changed) head/crypto/heimdal/lib/asn1/der.c (contents, props changed) head/crypto/heimdal/lib/asn1/der.h (contents, props changed) head/crypto/heimdal/lib/asn1/der_cmp.c (contents, props changed) head/crypto/heimdal/lib/asn1/der_copy.c (contents, props changed) head/crypto/heimdal/lib/asn1/der_format.c (contents, props changed) head/crypto/heimdal/lib/asn1/der_free.c (contents, props changed) head/crypto/heimdal/lib/asn1/der_get.c (contents, props changed) head/crypto/heimdal/lib/asn1/der_length.c (contents, props changed) head/crypto/heimdal/lib/asn1/der_locl.h (contents, props changed) head/crypto/heimdal/lib/asn1/der_put.c (contents, props changed) head/crypto/heimdal/lib/asn1/digest.asn1 head/crypto/heimdal/lib/asn1/extra.c (contents, props changed) head/crypto/heimdal/lib/asn1/gen.c (contents, props changed) head/crypto/heimdal/lib/asn1/gen_copy.c (contents, props changed) head/crypto/heimdal/lib/asn1/gen_decode.c (contents, props changed) head/crypto/heimdal/lib/asn1/gen_encode.c (contents, props changed) head/crypto/heimdal/lib/asn1/gen_free.c (contents, props changed) head/crypto/heimdal/lib/asn1/gen_glue.c (contents, props changed) head/crypto/heimdal/lib/asn1/gen_length.c (contents, props changed) head/crypto/heimdal/lib/asn1/gen_locl.h (contents, props changed) head/crypto/heimdal/lib/asn1/gen_seq.c (contents, props changed) head/crypto/heimdal/lib/asn1/hash.c (contents, props changed) head/crypto/heimdal/lib/asn1/hash.h (contents, props changed) head/crypto/heimdal/lib/asn1/heim_asn1.h (contents, props changed) head/crypto/heimdal/lib/asn1/kx509.asn1 head/crypto/heimdal/lib/asn1/lex.c (contents, props changed) head/crypto/heimdal/lib/asn1/lex.h (contents, props changed) head/crypto/heimdal/lib/asn1/lex.l head/crypto/heimdal/lib/asn1/main.c (contents, props changed) head/crypto/heimdal/lib/asn1/pkcs12.asn1 head/crypto/heimdal/lib/asn1/pkcs8.asn1 head/crypto/heimdal/lib/asn1/pkcs9.asn1 head/crypto/heimdal/lib/asn1/pkinit.asn1 head/crypto/heimdal/lib/asn1/rfc2459.asn1 head/crypto/heimdal/lib/asn1/setchgpw2.asn1 head/crypto/heimdal/lib/asn1/symbol.c (contents, props changed) head/crypto/heimdal/lib/asn1/symbol.h (contents, props changed) head/crypto/heimdal/lib/asn1/test.asn1 head/crypto/heimdal/lib/asn1/test.gen head/crypto/heimdal/lib/asn1/timegm.c (contents, props changed) head/crypto/heimdal/lib/com_err/ChangeLog (contents, props changed) head/crypto/heimdal/lib/com_err/Makefile.am head/crypto/heimdal/lib/com_err/Makefile.in head/crypto/heimdal/lib/com_err/com_err.c (contents, props changed) head/crypto/heimdal/lib/com_err/com_err.h (contents, props changed) head/crypto/heimdal/lib/com_err/com_right.h (contents, props changed) head/crypto/heimdal/lib/com_err/compile_et.c (contents, props changed) head/crypto/heimdal/lib/com_err/compile_et.h (contents, props changed) head/crypto/heimdal/lib/com_err/error.c (contents, props changed) head/crypto/heimdal/lib/com_err/lex.c (contents, props changed) head/crypto/heimdal/lib/com_err/lex.h (contents, props changed) head/crypto/heimdal/lib/com_err/lex.l head/crypto/heimdal/lib/com_err/parse.c (contents, props changed) head/crypto/heimdal/lib/com_err/parse.h (contents, props changed) head/crypto/heimdal/lib/com_err/parse.y head/crypto/heimdal/lib/com_err/roken_rename.h (contents, props changed) head/crypto/heimdal/lib/com_err/version-script.map head/crypto/heimdal/lib/gssapi/ChangeLog (contents, props changed) head/crypto/heimdal/lib/gssapi/Makefile.am head/crypto/heimdal/lib/gssapi/Makefile.in head/crypto/heimdal/lib/gssapi/gss-commands.in head/crypto/heimdal/lib/gssapi/gss_acquire_cred.3 head/crypto/heimdal/lib/gssapi/gssapi.3 head/crypto/heimdal/lib/gssapi/gssapi.h (contents, props changed) head/crypto/heimdal/lib/gssapi/gssapi/gssapi.h (contents, props changed) head/crypto/heimdal/lib/gssapi/gssapi/gssapi_krb5.h (contents, props changed) head/crypto/heimdal/lib/gssapi/gssapi/gssapi_spnego.h (contents, props changed) head/crypto/heimdal/lib/gssapi/gssapi_mech.h (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/8003.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/accept_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/acquire_cred.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/add_cred.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/address_to_krb5addr.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/arcfour.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/canonicalize_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/ccache_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/cfx.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/cfx.h (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/compare_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/compat.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/context_time.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/copy_ccache.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/decapsulate.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/delete_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/display_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/display_status.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/duplicate_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/encapsulate.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/export_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/export_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/external.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/get_mic.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/gkrb5_err.et head/crypto/heimdal/lib/gssapi/krb5/gsskrb5-private.h (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/gsskrb5_locl.h (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/import_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/import_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/indicate_mechs.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/init.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/init_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/inquire_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/inquire_cred.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/inquire_cred_by_mech.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/inquire_cred_by_oid.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/inquire_mechs_for_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/inquire_names_for_mech.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/inquire_sec_context_by_oid.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/prf.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/process_context_token.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/release_buffer.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/release_cred.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/release_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/sequence.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/set_cred_option.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/set_sec_context_option.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/test_cfx.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/ticket_flags.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/unwrap.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/verify_mic.c (contents, props changed) head/crypto/heimdal/lib/gssapi/krb5/wrap.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/accept_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/acquire_cred.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/add_cred.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/canonicalize_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/compare_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/context_time.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/crypto.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/delete_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/display_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/display_status.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/duplicate_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/export_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/export_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/external.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/import_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/import_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/indicate_mechs.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/init_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/inquire_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/inquire_cred_by_mech.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/inquire_mechs_for_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/inquire_names_for_mech.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/ntlm-private.h (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/ntlm.h (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/process_context_token.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/release_cred.c (contents, props changed) head/crypto/heimdal/lib/gssapi/ntlm/release_name.c (contents, props changed) head/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/spnego/compat.c (contents, props changed) head/crypto/heimdal/lib/gssapi/spnego/context_stubs.c (contents, props changed) head/crypto/heimdal/lib/gssapi/spnego/cred_stubs.c (contents, props changed) head/crypto/heimdal/lib/gssapi/spnego/external.c (contents, props changed) head/crypto/heimdal/lib/gssapi/spnego/init_sec_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/spnego/spnego-private.h (contents, props changed) head/crypto/heimdal/lib/gssapi/spnego/spnego.asn1 head/crypto/heimdal/lib/gssapi/spnego/spnego_locl.h (contents, props changed) head/crypto/heimdal/lib/gssapi/test_acquire_cred.c (contents, props changed) head/crypto/heimdal/lib/gssapi/test_common.c (contents, props changed) head/crypto/heimdal/lib/gssapi/test_common.h (contents, props changed) head/crypto/heimdal/lib/gssapi/test_context.c (contents, props changed) head/crypto/heimdal/lib/gssapi/test_cred.c (contents, props changed) head/crypto/heimdal/lib/gssapi/test_kcred.c (contents, props changed) head/crypto/heimdal/lib/gssapi/test_names.c (contents, props changed) head/crypto/heimdal/lib/gssapi/test_ntlm.c (contents, props changed) head/crypto/heimdal/lib/gssapi/test_oid.c (contents, props changed) head/crypto/heimdal/lib/gssapi/version-script.map head/crypto/heimdal/lib/hdb/Makefile.am head/crypto/heimdal/lib/hdb/Makefile.in head/crypto/heimdal/lib/hdb/common.c (contents, props changed) head/crypto/heimdal/lib/hdb/db.c (contents, props changed) head/crypto/heimdal/lib/hdb/db3.c (contents, props changed) head/crypto/heimdal/lib/hdb/dbinfo.c (contents, props changed) head/crypto/heimdal/lib/hdb/ext.c (contents, props changed) head/crypto/heimdal/lib/hdb/hdb-ldap.c (contents, props changed) head/crypto/heimdal/lib/hdb/hdb-private.h (contents, props changed) head/crypto/heimdal/lib/hdb/hdb-protos.h (contents, props changed) head/crypto/heimdal/lib/hdb/hdb.asn1 head/crypto/heimdal/lib/hdb/hdb.c (contents, props changed) head/crypto/heimdal/lib/hdb/hdb.h (contents, props changed) head/crypto/heimdal/lib/hdb/hdb.schema head/crypto/heimdal/lib/hdb/hdb_err.et head/crypto/heimdal/lib/hdb/hdb_locl.h (contents, props changed) head/crypto/heimdal/lib/hdb/keys.c (contents, props changed) head/crypto/heimdal/lib/hdb/keytab.c (contents, props changed) head/crypto/heimdal/lib/hdb/mkey.c (contents, props changed) head/crypto/heimdal/lib/hdb/ndbm.c (contents, props changed) head/crypto/heimdal/lib/hdb/print.c (contents, props changed) head/crypto/heimdal/lib/hdb/test_dbinfo.c (contents, props changed) head/crypto/heimdal/lib/hx509/ChangeLog (contents, props changed) head/crypto/heimdal/lib/hx509/Makefile.am head/crypto/heimdal/lib/hx509/Makefile.in head/crypto/heimdal/lib/hx509/ca.c (contents, props changed) head/crypto/heimdal/lib/hx509/cert.c (contents, props changed) head/crypto/heimdal/lib/hx509/cms.c (contents, props changed) head/crypto/heimdal/lib/hx509/collector.c (contents, props changed) head/crypto/heimdal/lib/hx509/crmf.asn1 head/crypto/heimdal/lib/hx509/crypto.c (contents, props changed) head/crypto/heimdal/lib/hx509/doxygen.c (contents, props changed) head/crypto/heimdal/lib/hx509/env.c (contents, props changed) head/crypto/heimdal/lib/hx509/error.c (contents, props changed) head/crypto/heimdal/lib/hx509/file.c (contents, props changed) head/crypto/heimdal/lib/hx509/hx509-private.h (contents, props changed) head/crypto/heimdal/lib/hx509/hx509-protos.h (contents, props changed) head/crypto/heimdal/lib/hx509/hx509.h (contents, props changed) head/crypto/heimdal/lib/hx509/hx509_err.et head/crypto/heimdal/lib/hx509/hx_locl.h (contents, props changed) head/crypto/heimdal/lib/hx509/hxtool-commands.in head/crypto/heimdal/lib/hx509/hxtool.c (contents, props changed) head/crypto/heimdal/lib/hx509/keyset.c (contents, props changed) head/crypto/heimdal/lib/hx509/ks_dir.c (contents, props changed) head/crypto/heimdal/lib/hx509/ks_file.c (contents, props changed) head/crypto/heimdal/lib/hx509/ks_keychain.c (contents, props changed) head/crypto/heimdal/lib/hx509/ks_mem.c (contents, props changed) head/crypto/heimdal/lib/hx509/ks_null.c (contents, props changed) head/crypto/heimdal/lib/hx509/ks_p11.c (contents, props changed) head/crypto/heimdal/lib/hx509/ks_p12.c (contents, props changed) head/crypto/heimdal/lib/hx509/lock.c (contents, props changed) head/crypto/heimdal/lib/hx509/name.c (contents, props changed) head/crypto/heimdal/lib/hx509/ocsp.asn1 head/crypto/heimdal/lib/hx509/peer.c (contents, props changed) head/crypto/heimdal/lib/hx509/pkcs10.asn1 head/crypto/heimdal/lib/hx509/print.c (contents, props changed) head/crypto/heimdal/lib/hx509/req.c (contents, props changed) head/crypto/heimdal/lib/hx509/revoke.c (contents, props changed) head/crypto/heimdal/lib/hx509/softp11.c (contents, props changed) head/crypto/heimdal/lib/hx509/test_ca.in head/crypto/heimdal/lib/hx509/test_cert.in head/crypto/heimdal/lib/hx509/test_chain.in head/crypto/heimdal/lib/hx509/test_cms.in head/crypto/heimdal/lib/hx509/test_crypto.in head/crypto/heimdal/lib/hx509/test_java_pkcs11.in head/crypto/heimdal/lib/hx509/test_name.c (contents, props changed) head/crypto/heimdal/lib/hx509/test_nist.in head/crypto/heimdal/lib/hx509/test_nist2.in head/crypto/heimdal/lib/hx509/test_nist_cert.in head/crypto/heimdal/lib/hx509/test_nist_pkcs12.in head/crypto/heimdal/lib/hx509/test_pkcs11.in head/crypto/heimdal/lib/hx509/test_query.in head/crypto/heimdal/lib/hx509/test_req.in head/crypto/heimdal/lib/hx509/test_soft_pkcs11.c (contents, props changed) head/crypto/heimdal/lib/hx509/test_windows.in head/crypto/heimdal/lib/hx509/tst-crypto-available2 head/crypto/heimdal/lib/hx509/tst-crypto-select1 head/crypto/heimdal/lib/hx509/tst-crypto-select2 head/crypto/heimdal/lib/hx509/version-script.map head/crypto/heimdal/lib/ipc/server.c head/crypto/heimdal/lib/kadm5/ChangeLog (contents, props changed) head/crypto/heimdal/lib/kadm5/Makefile.am head/crypto/heimdal/lib/kadm5/Makefile.in head/crypto/heimdal/lib/kadm5/acl.c (contents, props changed) head/crypto/heimdal/lib/kadm5/ad.c (contents, props changed) head/crypto/heimdal/lib/kadm5/admin.h (contents, props changed) head/crypto/heimdal/lib/kadm5/bump_pw_expire.c (contents, props changed) head/crypto/heimdal/lib/kadm5/check-cracklib.pl head/crypto/heimdal/lib/kadm5/chpass_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/chpass_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/client_glue.c (contents, props changed) head/crypto/heimdal/lib/kadm5/common_glue.c (contents, props changed) head/crypto/heimdal/lib/kadm5/context_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/create_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/create_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/default_keys.c (contents, props changed) head/crypto/heimdal/lib/kadm5/delete_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/delete_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/destroy_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/destroy_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/ent_setup.c (contents, props changed) head/crypto/heimdal/lib/kadm5/error.c (contents, props changed) head/crypto/heimdal/lib/kadm5/flush.c (contents, props changed) head/crypto/heimdal/lib/kadm5/flush_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/flush_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/free.c (contents, props changed) head/crypto/heimdal/lib/kadm5/get_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/get_princs_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/get_princs_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/get_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/init_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/init_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/iprop-commands.in head/crypto/heimdal/lib/kadm5/iprop-log.8 head/crypto/heimdal/lib/kadm5/iprop-log.c (contents, props changed) head/crypto/heimdal/lib/kadm5/iprop.8 head/crypto/heimdal/lib/kadm5/iprop.h (contents, props changed) head/crypto/heimdal/lib/kadm5/ipropd_common.c (contents, props changed) head/crypto/heimdal/lib/kadm5/ipropd_master.c (contents, props changed) head/crypto/heimdal/lib/kadm5/ipropd_slave.c (contents, props changed) head/crypto/heimdal/lib/kadm5/kadm5-private.h (contents, props changed) head/crypto/heimdal/lib/kadm5/kadm5-pwcheck.h (contents, props changed) head/crypto/heimdal/lib/kadm5/kadm5_err.et head/crypto/heimdal/lib/kadm5/kadm5_locl.h (contents, props changed) head/crypto/heimdal/lib/kadm5/kadm5_pwcheck.3 head/crypto/heimdal/lib/kadm5/keys.c (contents, props changed) head/crypto/heimdal/lib/kadm5/log.c (contents, props changed) head/crypto/heimdal/lib/kadm5/marshall.c (contents, props changed) head/crypto/heimdal/lib/kadm5/modify_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/modify_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/password_quality.c (contents, props changed) head/crypto/heimdal/lib/kadm5/private.h (contents, props changed) head/crypto/heimdal/lib/kadm5/privs_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/privs_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/randkey_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/randkey_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/rename_c.c (contents, props changed) head/crypto/heimdal/lib/kadm5/rename_s.c (contents, props changed) head/crypto/heimdal/lib/kadm5/sample_passwd_check.c (contents, props changed) head/crypto/heimdal/lib/kadm5/send_recv.c (contents, props changed) head/crypto/heimdal/lib/kadm5/server_glue.c (contents, props changed) head/crypto/heimdal/lib/kadm5/set_keys.c (contents, props changed) head/crypto/heimdal/lib/kadm5/set_modifier.c (contents, props changed) head/crypto/heimdal/lib/kadm5/test_pw_quality.c (contents, props changed) head/crypto/heimdal/lib/kafs/ChangeLog (contents, props changed) head/crypto/heimdal/lib/kafs/Makefile.am head/crypto/heimdal/lib/kafs/Makefile.in head/crypto/heimdal/lib/kafs/afskrb5.c (contents, props changed) head/crypto/heimdal/lib/kafs/afslib.c (contents, props changed) head/crypto/heimdal/lib/kafs/afssys.c (contents, props changed) head/crypto/heimdal/lib/kafs/afssysdefs.h (contents, props changed) head/crypto/heimdal/lib/kafs/common.c (contents, props changed) head/crypto/heimdal/lib/kafs/kafs.3 head/crypto/heimdal/lib/kafs/kafs.h (contents, props changed) head/crypto/heimdal/lib/kafs/kafs_locl.h (contents, props changed) head/crypto/heimdal/lib/kafs/roken_rename.h (contents, props changed) head/crypto/heimdal/lib/krb5/Makefile.am head/crypto/heimdal/lib/krb5/Makefile.in head/crypto/heimdal/lib/krb5/acache.c (contents, props changed) head/crypto/heimdal/lib/krb5/acl.c (contents, props changed) head/crypto/heimdal/lib/krb5/add_et_list.c (contents, props changed) head/crypto/heimdal/lib/krb5/addr_families.c (contents, props changed) head/crypto/heimdal/lib/krb5/aes-test.c (contents, props changed) head/crypto/heimdal/lib/krb5/aname_to_localname.c (contents, props changed) head/crypto/heimdal/lib/krb5/appdefault.c (contents, props changed) head/crypto/heimdal/lib/krb5/asn1_glue.c (contents, props changed) head/crypto/heimdal/lib/krb5/auth_context.c (contents, props changed) head/crypto/heimdal/lib/krb5/build_ap_req.c (contents, props changed) head/crypto/heimdal/lib/krb5/build_auth.c (contents, props changed) head/crypto/heimdal/lib/krb5/cache.c (contents, props changed) head/crypto/heimdal/lib/krb5/changepw.c (contents, props changed) head/crypto/heimdal/lib/krb5/codec.c (contents, props changed) head/crypto/heimdal/lib/krb5/config_file.c (contents, props changed) head/crypto/heimdal/lib/krb5/constants.c (contents, props changed) head/crypto/heimdal/lib/krb5/context.c (contents, props changed) head/crypto/heimdal/lib/krb5/convert_creds.c (contents, props changed) head/crypto/heimdal/lib/krb5/copy_host_realm.c (contents, props changed) head/crypto/heimdal/lib/krb5/crc.c (contents, props changed) head/crypto/heimdal/lib/krb5/creds.c (contents, props changed) head/crypto/heimdal/lib/krb5/crypto.c (contents, props changed) head/crypto/heimdal/lib/krb5/data.c (contents, props changed) head/crypto/heimdal/lib/krb5/derived-key-test.c (contents, props changed) head/crypto/heimdal/lib/krb5/digest.c (contents, props changed) head/crypto/heimdal/lib/krb5/doxygen.c (contents, props changed) head/crypto/heimdal/lib/krb5/eai_to_heim_errno.c (contents, props changed) head/crypto/heimdal/lib/krb5/error_string.c (contents, props changed) head/crypto/heimdal/lib/krb5/expand_hostname.c (contents, props changed) head/crypto/heimdal/lib/krb5/fcache.c (contents, props changed) head/crypto/heimdal/lib/krb5/free.c (contents, props changed) head/crypto/heimdal/lib/krb5/free_host_realm.c (contents, props changed) head/crypto/heimdal/lib/krb5/generate_seq_number.c (contents, props changed) head/crypto/heimdal/lib/krb5/generate_subkey.c (contents, props changed) head/crypto/heimdal/lib/krb5/get_addrs.c (contents, props changed) head/crypto/heimdal/lib/krb5/get_cred.c (contents, props changed) head/crypto/heimdal/lib/krb5/get_default_principal.c (contents, props changed) head/crypto/heimdal/lib/krb5/get_default_realm.c (contents, props changed) head/crypto/heimdal/lib/krb5/get_for_creds.c (contents, props changed) head/crypto/heimdal/lib/krb5/get_host_realm.c (contents, props changed) head/crypto/heimdal/lib/krb5/get_in_tkt.c (contents, props changed) head/crypto/heimdal/lib/krb5/get_port.c (contents, props changed) head/crypto/heimdal/lib/krb5/heim_err.et head/crypto/heimdal/lib/krb5/init_creds.c (contents, props changed) head/crypto/heimdal/lib/krb5/init_creds_pw.c (contents, props changed) head/crypto/heimdal/lib/krb5/k524_err.et head/crypto/heimdal/lib/krb5/kcm.c (contents, props changed) head/crypto/heimdal/lib/krb5/kcm.h (contents, props changed) head/crypto/heimdal/lib/krb5/kerberos.8 head/crypto/heimdal/lib/krb5/keyblock.c (contents, props changed) head/crypto/heimdal/lib/krb5/keytab.c (contents, props changed) head/crypto/heimdal/lib/krb5/keytab_any.c (contents, props changed) head/crypto/heimdal/lib/krb5/keytab_file.c (contents, props changed) head/crypto/heimdal/lib/krb5/keytab_keyfile.c (contents, props changed) head/crypto/heimdal/lib/krb5/keytab_memory.c (contents, props changed) head/crypto/heimdal/lib/krb5/krb5-private.h (contents, props changed) head/crypto/heimdal/lib/krb5/krb5-protos.h (contents, props changed) head/crypto/heimdal/lib/krb5/krb5-v4compat.h (contents, props changed) head/crypto/heimdal/lib/krb5/krb5.conf.5 head/crypto/heimdal/lib/krb5/krb5.h (contents, props changed) head/crypto/heimdal/lib/krb5/krb5.moduli head/crypto/heimdal/lib/krb5/krb524_convert_creds_kdc.3 head/crypto/heimdal/lib/krb5/krb5_425_conv_principal.3 head/crypto/heimdal/lib/krb5/krb5_acl_match_file.3 head/crypto/heimdal/lib/krb5/krb5_aname_to_localname.3 head/crypto/heimdal/lib/krb5/krb5_appdefault.3 head/crypto/heimdal/lib/krb5/krb5_auth_context.3 head/crypto/heimdal/lib/krb5/krb5_c_make_checksum.3 head/crypto/heimdal/lib/krb5/krb5_ccapi.h (contents, props changed) head/crypto/heimdal/lib/krb5/krb5_check_transited.3 head/crypto/heimdal/lib/krb5/krb5_create_checksum.3 head/crypto/heimdal/lib/krb5/krb5_creds.3 head/crypto/heimdal/lib/krb5/krb5_digest.3 head/crypto/heimdal/lib/krb5/krb5_eai_to_heim_errno.3 head/crypto/heimdal/lib/krb5/krb5_encrypt.3 head/crypto/heimdal/lib/krb5/krb5_err.et head/crypto/heimdal/lib/krb5/krb5_find_padata.3 head/crypto/heimdal/lib/krb5/krb5_generate_random_block.3 head/crypto/heimdal/lib/krb5/krb5_get_all_client_addrs.3 head/crypto/heimdal/lib/krb5/krb5_get_credentials.3 head/crypto/heimdal/lib/krb5/krb5_get_creds.3 head/crypto/heimdal/lib/krb5/krb5_get_forwarded_creds.3 head/crypto/heimdal/lib/krb5/krb5_get_in_cred.3 head/crypto/heimdal/lib/krb5/krb5_get_init_creds.3 head/crypto/heimdal/lib/krb5/krb5_get_krbhst.3 head/crypto/heimdal/lib/krb5/krb5_getportbyname.3 head/crypto/heimdal/lib/krb5/krb5_init_context.3 head/crypto/heimdal/lib/krb5/krb5_is_thread_safe.3 head/crypto/heimdal/lib/krb5/krb5_krbhst_init.3 head/crypto/heimdal/lib/krb5/krb5_locl.h (contents, props changed) head/crypto/heimdal/lib/krb5/krb5_mk_req.3 head/crypto/heimdal/lib/krb5/krb5_mk_safe.3 head/crypto/heimdal/lib/krb5/krb5_openlog.3 head/crypto/heimdal/lib/krb5/krb5_parse_name.3 head/crypto/heimdal/lib/krb5/krb5_principal.3 head/crypto/heimdal/lib/krb5/krb5_rcache.3 head/crypto/heimdal/lib/krb5/krb5_rd_error.3 head/crypto/heimdal/lib/krb5/krb5_rd_safe.3 head/crypto/heimdal/lib/krb5/krb5_set_default_realm.3 head/crypto/heimdal/lib/krb5/krb5_set_password.3 head/crypto/heimdal/lib/krb5/krb5_string_to_key.3 head/crypto/heimdal/lib/krb5/krb5_timeofday.3 head/crypto/heimdal/lib/krb5/krb5_verify_init_creds.3 head/crypto/heimdal/lib/krb5/krb5_verify_user.3 head/crypto/heimdal/lib/krb5/krbhst-test.c (contents, props changed) head/crypto/heimdal/lib/krb5/krbhst.c (contents, props changed) head/crypto/heimdal/lib/krb5/kuserok.c (contents, props changed) head/crypto/heimdal/lib/krb5/locate_plugin.h (contents, props changed) head/crypto/heimdal/lib/krb5/log.c (contents, props changed) head/crypto/heimdal/lib/krb5/mcache.c (contents, props changed) head/crypto/heimdal/lib/krb5/misc.c (contents, props changed) head/crypto/heimdal/lib/krb5/mit_glue.c (contents, props changed) head/crypto/heimdal/lib/krb5/mk_error.c (contents, props changed) head/crypto/heimdal/lib/krb5/mk_priv.c (contents, props changed) head/crypto/heimdal/lib/krb5/mk_rep.c (contents, props changed) head/crypto/heimdal/lib/krb5/mk_req.c (contents, props changed) head/crypto/heimdal/lib/krb5/mk_req_ext.c (contents, props changed) head/crypto/heimdal/lib/krb5/mk_safe.c (contents, props changed) head/crypto/heimdal/lib/krb5/n-fold-test.c (contents, props changed) head/crypto/heimdal/lib/krb5/n-fold.c (contents, props changed) head/crypto/heimdal/lib/krb5/net_read.c (contents, props changed) head/crypto/heimdal/lib/krb5/net_write.c (contents, props changed) head/crypto/heimdal/lib/krb5/pac.c (contents, props changed) head/crypto/heimdal/lib/krb5/padata.c (contents, props changed) head/crypto/heimdal/lib/krb5/parse-name-test.c (contents, props changed) head/crypto/heimdal/lib/krb5/pkinit.c (contents, props changed) head/crypto/heimdal/lib/krb5/plugin.c (contents, props changed) head/crypto/heimdal/lib/krb5/principal.c (contents, props changed) head/crypto/heimdal/lib/krb5/prog_setup.c (contents, props changed) head/crypto/heimdal/lib/krb5/prompter_posix.c (contents, props changed) head/crypto/heimdal/lib/krb5/rd_cred.c (contents, props changed) head/crypto/heimdal/lib/krb5/rd_error.c (contents, props changed) head/crypto/heimdal/lib/krb5/rd_priv.c (contents, props changed) head/crypto/heimdal/lib/krb5/rd_rep.c (contents, props changed) head/crypto/heimdal/lib/krb5/rd_req.c (contents, props changed) head/crypto/heimdal/lib/krb5/rd_safe.c (contents, props changed) head/crypto/heimdal/lib/krb5/read_message.c (contents, props changed) head/crypto/heimdal/lib/krb5/recvauth.c (contents, props changed) head/crypto/heimdal/lib/krb5/replay.c (contents, props changed) head/crypto/heimdal/lib/krb5/send_to_kdc.c (contents, props changed) head/crypto/heimdal/lib/krb5/sendauth.c (contents, props changed) head/crypto/heimdal/lib/krb5/set_default_realm.c (contents, props changed) head/crypto/heimdal/lib/krb5/sock_principal.c (contents, props changed) head/crypto/heimdal/lib/krb5/store-int.h (contents, props changed) head/crypto/heimdal/lib/krb5/store-test.c (contents, props changed) head/crypto/heimdal/lib/krb5/store.c (contents, props changed) head/crypto/heimdal/lib/krb5/store_emem.c (contents, props changed) head/crypto/heimdal/lib/krb5/store_fd.c (contents, props changed) head/crypto/heimdal/lib/krb5/store_mem.c (contents, props changed) head/crypto/heimdal/lib/krb5/string-to-key-test.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_acl.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_addr.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_alname.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_cc.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_config.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_crypto.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_crypto_wrapping.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_forward.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_get_addrs.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_hostname.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_keytab.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_kuserok.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_mem.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_pac.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_pkinit_dh2key.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_plugin.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_prf.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_princ.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_renew.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_store.c (contents, props changed) head/crypto/heimdal/lib/krb5/test_time.c (contents, props changed) head/crypto/heimdal/lib/krb5/ticket.c (contents, props changed) head/crypto/heimdal/lib/krb5/time.c (contents, props changed) head/crypto/heimdal/lib/krb5/transited.c (contents, props changed) head/crypto/heimdal/lib/krb5/verify_init.c (contents, props changed) head/crypto/heimdal/lib/krb5/verify_krb5_conf.8 head/crypto/heimdal/lib/krb5/verify_krb5_conf.c (contents, props changed) head/crypto/heimdal/lib/krb5/verify_user.c (contents, props changed) head/crypto/heimdal/lib/krb5/version-script.map head/crypto/heimdal/lib/krb5/version.c (contents, props changed) head/crypto/heimdal/lib/krb5/warn.c (contents, props changed) head/crypto/heimdal/lib/krb5/write_message.c (contents, props changed) head/crypto/heimdal/lib/ntlm/ChangeLog (contents, props changed) head/crypto/heimdal/lib/ntlm/Makefile.am head/crypto/heimdal/lib/ntlm/Makefile.in head/crypto/heimdal/lib/ntlm/heimntlm-protos.h (contents, props changed) head/crypto/heimdal/lib/ntlm/heimntlm.h (contents, props changed) head/crypto/heimdal/lib/ntlm/ntlm.c (contents, props changed) head/crypto/heimdal/lib/ntlm/test_ntlm.c (contents, props changed) head/crypto/heimdal/lib/ntlm/version-script.map head/crypto/heimdal/lib/roken/ChangeLog (contents, props changed) head/crypto/heimdal/lib/roken/Makefile.am head/crypto/heimdal/lib/roken/Makefile.in head/crypto/heimdal/lib/roken/base64-test.c (contents, props changed) head/crypto/heimdal/lib/roken/base64.c (contents, props changed) head/crypto/heimdal/lib/roken/base64.h (contents, props changed) head/crypto/heimdal/lib/roken/bswap.c (contents, props changed) head/crypto/heimdal/lib/roken/chown.c (contents, props changed) head/crypto/heimdal/lib/roken/closefrom.c (contents, props changed) head/crypto/heimdal/lib/roken/concat.c (contents, props changed) head/crypto/heimdal/lib/roken/copyhostent.c (contents, props changed) head/crypto/heimdal/lib/roken/daemon.c (contents, props changed) head/crypto/heimdal/lib/roken/dumpdata.c (contents, props changed) head/crypto/heimdal/lib/roken/ecalloc.3 head/crypto/heimdal/lib/roken/ecalloc.c (contents, props changed) head/crypto/heimdal/lib/roken/emalloc.c (contents, props changed) head/crypto/heimdal/lib/roken/environment.c (contents, props changed) head/crypto/heimdal/lib/roken/eread.c (contents, props changed) head/crypto/heimdal/lib/roken/erealloc.c (contents, props changed) head/crypto/heimdal/lib/roken/err.c (contents, props changed) head/crypto/heimdal/lib/roken/err.hin head/crypto/heimdal/lib/roken/errx.c (contents, props changed) head/crypto/heimdal/lib/roken/esetenv.c (contents, props changed) head/crypto/heimdal/lib/roken/estrdup.c (contents, props changed) head/crypto/heimdal/lib/roken/ewrite.c (contents, props changed) head/crypto/heimdal/lib/roken/fchown.c (contents, props changed) head/crypto/heimdal/lib/roken/flock.c (contents, props changed) head/crypto/heimdal/lib/roken/fnmatch.c (contents, props changed) head/crypto/heimdal/lib/roken/fnmatch.hin head/crypto/heimdal/lib/roken/freeaddrinfo.c (contents, props changed) head/crypto/heimdal/lib/roken/freehostent.c (contents, props changed) head/crypto/heimdal/lib/roken/gai_strerror.c (contents, props changed) head/crypto/heimdal/lib/roken/get_default_username.c (contents, props changed) head/crypto/heimdal/lib/roken/get_window_size.c (contents, props changed) head/crypto/heimdal/lib/roken/getaddrinfo-test.c (contents, props changed) head/crypto/heimdal/lib/roken/getaddrinfo.c (contents, props changed) head/crypto/heimdal/lib/roken/getaddrinfo_hostspec.c (contents, props changed) head/crypto/heimdal/lib/roken/getarg.3 head/crypto/heimdal/lib/roken/getarg.c (contents, props changed) head/crypto/heimdal/lib/roken/getarg.h (contents, props changed) head/crypto/heimdal/lib/roken/getcap.c (contents, props changed) head/crypto/heimdal/lib/roken/getcwd.c (contents, props changed) head/crypto/heimdal/lib/roken/getdtablesize.c (contents, props changed) head/crypto/heimdal/lib/roken/getegid.c (contents, props changed) head/crypto/heimdal/lib/roken/geteuid.c (contents, props changed) head/crypto/heimdal/lib/roken/getgid.c (contents, props changed) head/crypto/heimdal/lib/roken/gethostname.c (contents, props changed) head/crypto/heimdal/lib/roken/getifaddrs.c (contents, props changed) head/crypto/heimdal/lib/roken/getipnodebyaddr.c (contents, props changed) head/crypto/heimdal/lib/roken/getipnodebyname.c (contents, props changed) head/crypto/heimdal/lib/roken/getnameinfo.c (contents, props changed) head/crypto/heimdal/lib/roken/getnameinfo_verified.c (contents, props changed) head/crypto/heimdal/lib/roken/getopt.c (contents, props changed) head/crypto/heimdal/lib/roken/getprogname.c (contents, props changed) head/crypto/heimdal/lib/roken/gettimeofday.c (contents, props changed) head/crypto/heimdal/lib/roken/getuid.c (contents, props changed) head/crypto/heimdal/lib/roken/getusershell.c (contents, props changed) head/crypto/heimdal/lib/roken/glob.c (contents, props changed) head/crypto/heimdal/lib/roken/glob.hin head/crypto/heimdal/lib/roken/h_errno.c (contents, props changed) head/crypto/heimdal/lib/roken/hex-test.c (contents, props changed) head/crypto/heimdal/lib/roken/hex.c (contents, props changed) head/crypto/heimdal/lib/roken/hex.h (contents, props changed) head/crypto/heimdal/lib/roken/hostent_find_fqdn.c (contents, props changed) head/crypto/heimdal/lib/roken/hstrerror.c (contents, props changed) head/crypto/heimdal/lib/roken/ifaddrs.hin head/crypto/heimdal/lib/roken/inet_aton.c (contents, props changed) head/crypto/heimdal/lib/roken/inet_ntop.c (contents, props changed) head/crypto/heimdal/lib/roken/inet_pton.c (contents, props changed) head/crypto/heimdal/lib/roken/initgroups.c (contents, props changed) head/crypto/heimdal/lib/roken/innetgr.c (contents, props changed) head/crypto/heimdal/lib/roken/iruserok.c (contents, props changed) head/crypto/heimdal/lib/roken/issuid.c (contents, props changed) head/crypto/heimdal/lib/roken/k_getpwnam.c (contents, props changed) head/crypto/heimdal/lib/roken/k_getpwuid.c (contents, props changed) head/crypto/heimdal/lib/roken/localtime_r.c (contents, props changed) head/crypto/heimdal/lib/roken/lstat.c (contents, props changed) head/crypto/heimdal/lib/roken/memmove.c (contents, props changed) head/crypto/heimdal/lib/roken/mini_inetd.c (contents, props changed) head/crypto/heimdal/lib/roken/mkstemp.c (contents, props changed) head/crypto/heimdal/lib/roken/ndbm_wrap.c (contents, props changed) head/crypto/heimdal/lib/roken/ndbm_wrap.h (contents, props changed) head/crypto/heimdal/lib/roken/net_read.c (contents, props changed) head/crypto/heimdal/lib/roken/net_write.c (contents, props changed) head/crypto/heimdal/lib/roken/parse_bytes-test.c (contents, props changed) head/crypto/heimdal/lib/roken/parse_bytes.c (contents, props changed) head/crypto/heimdal/lib/roken/parse_bytes.h (contents, props changed) head/crypto/heimdal/lib/roken/parse_reply-test.c (contents, props changed) head/crypto/heimdal/lib/roken/parse_time-test.c (contents, props changed) head/crypto/heimdal/lib/roken/parse_time.3 head/crypto/heimdal/lib/roken/parse_time.c (contents, props changed) head/crypto/heimdal/lib/roken/parse_time.h (contents, props changed) head/crypto/heimdal/lib/roken/parse_units.c (contents, props changed) head/crypto/heimdal/lib/roken/parse_units.h (contents, props changed) head/crypto/heimdal/lib/roken/putenv.c (contents, props changed) head/crypto/heimdal/lib/roken/rcmd.c (contents, props changed) head/crypto/heimdal/lib/roken/readv.c (contents, props changed) head/crypto/heimdal/lib/roken/realloc.c (contents, props changed) head/crypto/heimdal/lib/roken/recvmsg.c (contents, props changed) head/crypto/heimdal/lib/roken/resolve-test.c (contents, props changed) head/crypto/heimdal/lib/roken/resolve.c (contents, props changed) head/crypto/heimdal/lib/roken/resolve.h (contents, props changed) head/crypto/heimdal/lib/roken/roken-common.h (contents, props changed) head/crypto/heimdal/lib/roken/roken.awk head/crypto/heimdal/lib/roken/roken.h.in head/crypto/heimdal/lib/roken/roken_gethostby.c (contents, props changed) head/crypto/heimdal/lib/roken/rtbl.3 head/crypto/heimdal/lib/roken/rtbl.c (contents, props changed) head/crypto/heimdal/lib/roken/rtbl.h (contents, props changed) head/crypto/heimdal/lib/roken/sendmsg.c (contents, props changed) head/crypto/heimdal/lib/roken/setegid.c (contents, props changed) head/crypto/heimdal/lib/roken/setenv.c (contents, props changed) head/crypto/heimdal/lib/roken/seteuid.c (contents, props changed) head/crypto/heimdal/lib/roken/setprogname.c (contents, props changed) head/crypto/heimdal/lib/roken/signal.c (contents, props changed) head/crypto/heimdal/lib/roken/simple_exec.c (contents, props changed) head/crypto/heimdal/lib/roken/snprintf-test.c (contents, props changed) head/crypto/heimdal/lib/roken/snprintf.c (contents, props changed) head/crypto/heimdal/lib/roken/socket.c (contents, props changed) head/crypto/heimdal/lib/roken/socket_wrapper.c (contents, props changed) head/crypto/heimdal/lib/roken/socket_wrapper.h (contents, props changed) head/crypto/heimdal/lib/roken/strcasecmp.c (contents, props changed) head/crypto/heimdal/lib/roken/strcollect.c (contents, props changed) head/crypto/heimdal/lib/roken/strdup.c (contents, props changed) head/crypto/heimdal/lib/roken/strerror.c (contents, props changed) head/crypto/heimdal/lib/roken/strftime.c (contents, props changed) head/crypto/heimdal/lib/roken/strlcat.c (contents, props changed) head/crypto/heimdal/lib/roken/strlcpy.c (contents, props changed) head/crypto/heimdal/lib/roken/strlwr.c (contents, props changed) head/crypto/heimdal/lib/roken/strncasecmp.c (contents, props changed) head/crypto/heimdal/lib/roken/strndup.c (contents, props changed) head/crypto/heimdal/lib/roken/strnlen.c (contents, props changed) head/crypto/heimdal/lib/roken/strpftime-test.c (contents, props changed) head/crypto/heimdal/lib/roken/strpftime-test.h (contents, props changed) head/crypto/heimdal/lib/roken/strpool.c (contents, props changed) head/crypto/heimdal/lib/roken/strptime.c (contents, props changed) head/crypto/heimdal/lib/roken/strsep.c (contents, props changed) head/crypto/heimdal/lib/roken/strsep_copy.c (contents, props changed) head/crypto/heimdal/lib/roken/strtok_r.c (contents, props changed) head/crypto/heimdal/lib/roken/strupr.c (contents, props changed) head/crypto/heimdal/lib/roken/swab.c (contents, props changed) head/crypto/heimdal/lib/roken/test-mem.c (contents, props changed) head/crypto/heimdal/lib/roken/test-mem.h (contents, props changed) head/crypto/heimdal/lib/roken/test-readenv.c (contents, props changed) head/crypto/heimdal/lib/roken/timegm.c (contents, props changed) head/crypto/heimdal/lib/roken/timeval.c (contents, props changed) head/crypto/heimdal/lib/roken/tm2time.c (contents, props changed) head/crypto/heimdal/lib/roken/unsetenv.c (contents, props changed) head/crypto/heimdal/lib/roken/unvis.c (contents, props changed) head/crypto/heimdal/lib/roken/verify.c (contents, props changed) head/crypto/heimdal/lib/roken/verr.c (contents, props changed) head/crypto/heimdal/lib/roken/verrx.c (contents, props changed) head/crypto/heimdal/lib/roken/vis.c (contents, props changed) head/crypto/heimdal/lib/roken/vis.hin head/crypto/heimdal/lib/roken/vsyslog.c (contents, props changed) head/crypto/heimdal/lib/roken/vwarn.c (contents, props changed) head/crypto/heimdal/lib/roken/vwarnx.c (contents, props changed) head/crypto/heimdal/lib/roken/warn.c (contents, props changed) head/crypto/heimdal/lib/roken/warnerr.c (contents, props changed) head/crypto/heimdal/lib/roken/warnx.c (contents, props changed) head/crypto/heimdal/lib/roken/write_pid.c (contents, props changed) head/crypto/heimdal/lib/roken/writev.c (contents, props changed) head/crypto/heimdal/lib/roken/xdbm.h (contents, props changed) head/crypto/heimdal/lib/sl/ChangeLog (contents, props changed) head/crypto/heimdal/lib/sl/Makefile.am head/crypto/heimdal/lib/sl/Makefile.in head/crypto/heimdal/lib/sl/roken_rename.h (contents, props changed) head/crypto/heimdal/lib/sl/sl.c (contents, props changed) head/crypto/heimdal/lib/sl/sl.h (contents, props changed) head/crypto/heimdal/lib/sl/sl_locl.h (contents, props changed) head/crypto/heimdal/lib/sl/slc-gram.c (contents, props changed) head/crypto/heimdal/lib/sl/slc-gram.h (contents, props changed) head/crypto/heimdal/lib/sl/slc-gram.y head/crypto/heimdal/lib/sl/slc-lex.c (contents, props changed) head/crypto/heimdal/lib/sl/slc-lex.l head/crypto/heimdal/lib/sl/slc.h (contents, props changed) head/crypto/heimdal/lib/sl/test_sl.c (contents, props changed) head/crypto/heimdal/lib/vers/ChangeLog (contents, props changed) head/crypto/heimdal/lib/vers/Makefile.am head/crypto/heimdal/lib/vers/Makefile.in head/crypto/heimdal/lib/vers/print_version.c (contents, props changed) head/crypto/heimdal/lib/vers/vers.h (contents, props changed) head/crypto/heimdal/ltmain.sh head/crypto/heimdal/missing head/crypto/heimdal/tools/Makefile.am head/crypto/heimdal/tools/Makefile.in head/crypto/heimdal/tools/heimdal-gssapi.pc.in head/crypto/heimdal/tools/kdc-log-analyze.pl head/crypto/heimdal/tools/krb5-config.1 head/crypto/heimdal/tools/krb5-config.in head/etc/mtree/BSD.include.dist head/kerberos5/Makefile.inc head/kerberos5/include/config.h head/kerberos5/include/crypto-headers.h head/kerberos5/include/krb5-types.h head/kerberos5/include/version.h head/kerberos5/lib/Makefile head/kerberos5/lib/Makefile.inc head/kerberos5/lib/libasn1/Makefile head/kerberos5/lib/libgssapi_krb5/Makefile head/kerberos5/lib/libgssapi_krb5/gss_krb5.c head/kerberos5/lib/libgssapi_ntlm/Makefile head/kerberos5/lib/libgssapi_ntlm/prefix.c head/kerberos5/lib/libgssapi_spnego/Makefile head/kerberos5/lib/libhdb/Makefile head/kerberos5/lib/libheimntlm/Makefile head/kerberos5/lib/libhx509/Makefile head/kerberos5/lib/libkadm5clnt/Makefile head/kerberos5/lib/libkadm5srv/Makefile head/kerberos5/lib/libkafs5/Makefile head/kerberos5/lib/libkrb5/Makefile head/kerberos5/lib/libroken/Makefile head/kerberos5/lib/libvers/Makefile head/kerberos5/libexec/Makefile head/kerberos5/libexec/hprop/Makefile head/kerberos5/libexec/ipropd-master/Makefile head/kerberos5/libexec/kadmind/Makefile head/kerberos5/libexec/kcm/Makefile head/kerberos5/libexec/kdc/Makefile head/kerberos5/tools/Makefile head/kerberos5/tools/Makefile.inc head/kerberos5/tools/asn1_compile/Makefile head/kerberos5/tools/make-roken/Makefile head/kerberos5/tools/slc/Makefile head/kerberos5/usr.bin/Makefile head/kerberos5/usr.bin/kadmin/Makefile head/kerberos5/usr.bin/kdestroy/Makefile head/kerberos5/usr.bin/kinit/Makefile head/kerberos5/usr.bin/krb5-config/Makefile head/kerberos5/usr.sbin/Makefile head/kerberos5/usr.sbin/kstash/Makefile head/kerberos5/usr.sbin/ktutil/Makefile head/lib/libcom_err/Makefile head/lib/libgssapi/Symbol.map head/lib/libgssapi/gss_display_status.c head/lib/libgssapi/mech_switch.h head/lib/libpam/modules/pam_krb5/Makefile head/lib/libpam/modules/pam_ksu/Makefile head/lib/libtelnet/Makefile head/share/mk/bsd.libnames.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/make_libdeps.sh head/usr.bin/compile_et/Makefile Directory Properties: head/contrib/com_err/ (props changed) head/crypto/heimdal/ (props changed) head/crypto/heimdal/ChangeLog.1998 (props changed) head/crypto/heimdal/ChangeLog.1999 (props changed) head/crypto/heimdal/ChangeLog.2000 (props changed) head/crypto/heimdal/ChangeLog.2001 (props changed) head/crypto/heimdal/appl/ftp/ftp/ftp_var.h (props changed) head/crypto/heimdal/appl/ftp/ftp/pathnames.h (props changed) head/crypto/heimdal/appl/ftp/ftpd/pathnames.h (props changed) head/crypto/heimdal/appl/telnet/README.ORIG (props changed) head/crypto/heimdal/appl/telnet/arpa/telnet.h (props changed) head/crypto/heimdal/appl/telnet/libtelnet/misc.h (props changed) head/crypto/heimdal/appl/telnet/telnet.state (props changed) head/crypto/heimdal/appl/telnet/telnet/defines.h (props changed) head/crypto/heimdal/appl/telnet/telnet/types.h (props changed) head/crypto/heimdal/lib/hx509/ref/pkcs11.h (props changed) head/crypto/heimdal/lib/kadm5/kadm5-protos.h (props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Mar 22 08:38:13 2012 (r233293) +++ head/Makefile.inc1 Thu Mar 22 08:48:42 2012 (r233294) @@ -468,13 +468,6 @@ build32: -p ${LIB32TMP}/usr/include >/dev/null mkdir -p ${WORLDTMP} ln -sf ${.CURDIR}/sys ${WORLDTMP} -.if ${MK_KERBEROS} != "no" -.for _t in obj depend all - cd ${.CURDIR}/kerberos5/tools; \ - MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ - DIRPRFX=kerberos5/tools/ ${_t} -.endfor -.endif .for _t in obj includes cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t} cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t} @@ -1065,12 +1058,22 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/ _dtc= gnu/usr.bin/dtc .endif +.if ${MK_KERBEROS} != "no" +_kerberos5_bootstrap_tools= \ + kerberos5/tools/make-roken \ + kerberos5/lib/libroken \ + kerberos5/lib/libvers \ + kerberos5/tools/asn1_compile \ + kerberos5/tools/slc +.endif + # Please document (add comment) why something is in 'bootstrap-tools'. # Try to bound the building of the bootstrap-tool to just the # FreeBSD versions that need the tool built at this stage of the build. bootstrap-tools: .for _tool in \ ${_clang_tblgen} \ + ${_kerberos5_bootstrap_tools} \ ${_dtrace_tools} \ ${_strfile} \ ${_gperf} \ @@ -1112,10 +1115,6 @@ _share= share/syscons/scrnmaps _gcc_tools= gnu/usr.bin/cc/cc_tools .endif -.if ${MK_KERBEROS} != "no" -_kerberos5_tools= kerberos5/tools -.endif - .if ${MK_RESCUE} != "no" _rescue= rescue/rescue .endif @@ -1140,8 +1139,7 @@ build-tools: ${MAKE} DIRPRFX=${_tool}/ build-tools .endfor .for _tool in \ - ${_gcc_tools} \ - ${_kerberos5_tools} + ${_gcc_tools} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ @@ -1247,10 +1245,15 @@ gnu/lib/libgcc__L: lib/libc__L lib/libcxxrt__L: gnu/lib/libgcc__L .endif -_prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libhdb} \ +_prebuild_libs= ${_kerberos5_lib_libasn1} \ + ${_kerberos5_lib_libhdb} \ + ${_kerberos5_lib_libheimbase} \ ${_kerberos5_lib_libheimntlm} \ + ${_kerberos5_lib_libheimsqlite} \ + ${_kerberos5_lib_libheimipcc} \ ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ ${_kerberos5_lib_libroken} \ + ${_kerberos5_lib_libwind} \ lib/libbz2 lib/libcom_err lib/libcrypt \ lib/libexpat \ ${_lib_libgssapi} ${_lib_libipx} \ @@ -1301,14 +1304,21 @@ _secure_lib= secure/lib .if ${MK_KERBEROS} != "no" kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ - kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L -kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L + kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \ + kerberos5/lib/libwind__L kerberos5/lib/libheimsqlite__L +kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L \ + kerberos5/lib/libroken__L lib/libcom_err__L kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ - secure/lib/libcrypto__L kerberos5/lib/libroken__L + secure/lib/libcrypto__L kerberos5/lib/libroken__L kerberos5/lib/libwind__L kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \ - kerberos5/lib/libroken__L + kerberos5/lib/libroken__L kerberos5/lib/libwind__L \ + kerberos5/lib/libheimbase__L kerberos5/lib/libheimipcc__L kerberos5/lib/libroken__L: lib/libcrypt__L +kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L +kerberos5/lib/libheimbase__L: lib/libthr__L +kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L +kerberos5/lib/libheimsqlite__L: lib/libthr__L .endif .if ${MK_GSSAPI} != "no" @@ -1323,10 +1333,14 @@ _lib_libipx= lib/libipx _kerberos5_lib= kerberos5/lib _kerberos5_lib_libasn1= kerberos5/lib/libasn1 _kerberos5_lib_libhdb= kerberos5/lib/libhdb +_kerberos5_lib_libheimbase= kerberos5/lib/libheimbase _kerberos5_lib_libkrb5= kerberos5/lib/libkrb5 _kerberos5_lib_libhx509= kerberos5/lib/libhx509 _kerberos5_lib_libroken= kerberos5/lib/libroken _kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm +_kerberos5_lib_libheimsqlite= kerberos5/lib/libheimsqlite +_kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc +_kerberos5_lib_libwind= kerberos5/lib/libwind .endif .if ${MK_NIS} != "no" Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Mar 22 08:38:13 2012 (r233293) +++ head/ObsoleteFiles.inc Thu Mar 22 08:48:42 2012 (r233294) @@ -38,6 +38,39 @@ # xargs -n1 | sort | uniq -d; # done +# 201203XX: Update heimdal to 1.5.1. +OLD_FILES+=usr/include/krb5-v4compat.h \ + usr/include/krb_err.h \ + usr/include/hdb-private.h \ + usr/share/man/man3/krb5_addresses.3.gz \ + usr/share/man/man3/krb5_cc_cursor.3.gz \ + usr/share/man/man3/krb5_cc_ops.3.gz \ + usr/share/man/man3/krb5_config.3.gz \ + usr/share/man/man3/krb5_config_get_int_default.3.gz \ + usr/share/man/man3/krb5_context.3.gz \ + usr/share/man/man3/krb5_data.3.gz \ + usr/share/man/man3/krb5_err.3.gz \ + usr/share/man/man3/krb5_errx.3.gz \ + usr/share/man/man3/krb5_keyblock.3.gz \ + usr/share/man/man3/krb5_keytab_entry.3.gz \ + usr/share/man/man3/krb5_kt_cursor.3.gz \ + usr/share/man/man3/krb5_kt_ops.3.gz \ + usr/share/man/man3/krb5_set_warn_dest.3.gz \ + usr/share/man/man3/krb5_verify_user.3.gz \ + usr/share/man/man3/krb5_verr.3.gz \ + usr/share/man/man3/krb5_verrx.3.gz \ + usr/share/man/man3/krb5_vwarnx.3.gz \ + usr/share/man/man3/krb5_warn.3.gz \ + usr/share/man/man3/krb5_warnx.3.gz +OLD_LIBS+=usr/lib/libasn1.so.10 \ + usr/lib/libhdb.so.10 \ + usr/lib/libheimntlm.so.10 \ + usr/lib/libhx509.so.10 \ + usr/lib/libkadm5clnt.so.10 \ + usr/lib/libkadm5srv.so.10 \ + usr/lib/libkafs5.so.10 \ + usr/lib/libkrb5.so.10 \ + usr/lib/libroken.so.10 # 20120309: Remove fifofs header files. OLD_FILES+=usr/include/fs/fifofs/fifo.h OLD_DIRS+=usr/include/fs/fifofs Added: head/contrib/com_err/ChangeLog ============================================================================== Modified: head/contrib/com_err/com_err.3 ============================================================================== --- head/contrib/com_err/com_err.3 Thu Mar 22 08:38:13 2012 (r233293) +++ head/contrib/com_err/com_err.3 Thu Mar 22 08:48:42 2012 (r233294) @@ -1,96 +1,245 @@ -.\" Copyright (c) 1988 Massachusetts Institute of Technology, -.\" Student Information Processing Board. All rights reserved. +.\" Copyright (c) 2005 Kungliga Tekniska Högskolan +.\" (Royal Institute of Technology, Stockholm, Sweden). +.\" All rights reserved. .\" -.\" $FreeBSD$ +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: .\" -.TH COM_ERR 3 "22 Nov 1988" SIPB -.SH NAME -com_err \- common error display routine -.SH SYNOPSIS -.nf - #include -.PP -void com_err (whoami, code, format, ...); - const char *whoami; - long code; - const char *format; -.PP -proc = set_com_err_hook (proc); -.fi -void (* -.I proc -) (const char *, long, const char *, va_list); -.nf -.PP -proc = reset_com_err_hook (); -.PP -void initialize_XXXX_error_table (); -.fi -.SH DESCRIPTION -.I Com_err -displays an error message on the standard error stream -.I stderr -(see -.IR stdio (3S)) -composed of the -.I whoami -string, which should specify the program name or some subportion of -a program, followed by an error message generated from the -.I code -value (derived from -.IR compile_et (1)), -and a string produced using the -.I format -string and any following arguments, in the same style as -.IR fprintf (3). - -The behavior of -.I com_err -can be modified using -.I set_com_err_hook; -this defines a procedure which is called with the arguments passed to -.I com_err, -instead of the default internal procedure which sends the formatted -text to error output. Thus the error messages from a program can all -easily be diverted to another form of diagnostic logging, such as -.IR syslog (3). -.I Reset_com_err_hook -may be used to restore the behavior of -.I com_err -to its default form. Both procedures return the previous ``hook'' -value. These ``hook'' procedures must have the declaration given for -.I proc -above in the synopsis. - -The -.I initialize_XXXX_error_table -routine is generated mechanically by -.IR compile_et (1) -from a source file containing names and associated strings. Each -table has a name of up to four characters, which is used in place of -the -.B XXXX -in the name of the routine. These routines should be called before -any of the corresponding error codes are used, so that the -.I com_err -library will recognize error codes from these tables when they are -used. - +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" 3. Neither the name of the Institute nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Id$ +.\" +.\" This manpage was contributed by Gregory McGarry. +.\" +.Dd July 7, 2005 +.Dt COM_ERR 3 +.Os +.Sh NAME +.Nm com_err , +.Nm com_err_va , +.Nm error_message , +.Nm error_table_name , +.Nm init_error_table , +.Nm set_com_err_hook , +.Nm reset_com_err_hook , +.Nm add_to_error_table , +.Nm initialize_error_table_r +.Nm free_error_table , +.Nm com_right +.Nd common error display library +.Sh LIBRARY +Common Error Library (libcom_err, -lcom_err) +.Sh SYNOPSIS +.Fd #include +.Fd #include +.Fd #include +.Fd #include \&"XXX_err.h\&" +.Pp +typedef void (*errf)(const char *, long, const char *, ...); +.Ft void +.Fn com_err "const char *whoami" "long code" "const char *format" "..." +.Ft void +.Fn com_err_va "const char *whoami" "long code" "const char *format" "..." +.Ft const char * +.Fn error_message "long code" +.Ft const char * +.Fn error_table_name "int num" +.Ft int +.Fn init_error_table "const char **msgs" "long base" "int count" +.Ft errf +.Fn set_com_err_hook "errf func" +.Ft errf +.Fn reset_com_err_hook "" +.Ft void +.Fn add_to_error_table "struct et_list *new_table" +.Ft void +.Fn initialize_error_table_r "struct et_list **et_list" "const char **msgs" "int base" "long count" +.Ft void +.Fn free_error_table "struct et_list *" +.Ft const char * +.Fn com_right "struct et_list *list" long code" +.Sh DESCRIPTION The -.B com_err.h -header file should be included in any source file that uses routines -from the -.I com_err -library; executable files must be linked using -.I ``-lcom_err'' -in order to cause the -.I com_err -library to be included. - -.\" .IR for manual entries -.\" .PP for paragraph breaks - -.SH "SEE ALSO" -compile_et (1), syslog (3). - -Ken Raeburn, "A Common Error Description Library for UNIX". +.Nm +library provides a common error-reporting mechanism for defining and +accessing error codes and descriptions for application software +packages. Error descriptions are defined in a table and error codes +are used to index the table. The error table, the descriptions and +the error codes are generated using +.Xr compile_et 1 . +.Pp +The error table is registered with the +.Nm +library by calling its initialisation function defined in its header +file. The initialisation function is generally defined as +.Fn initialize__error_table , +where +.Em name +is the name of the error table. +.Pp +If a thread-safe version of the library is needed +.Fn initialize__error_table_r +that internally calls +.Fn initialize_error_table_r +instead be used. +.Pp +Any variable which is to contain an error code should be declared +.Em _error_number +where +.Em name +is the name of the error table. +.Sh FUNCTIONS +The following functions are available to the application developer: +.Bl -tag -width compact +.It Fn com_err "whoami" "code" "format" "..." +Displays an error message on standard error composed of the +.Fa whoami +string, which should specify the program name, followed by an error +message generated from +.Fa code , +and a string produced using the +.Xr printf 3 +.Fa format +string and any following arguments. If +.Fa format +is NULL, the formatted message will not be +printed. The argument +.Fa format +may not be omitted. +.It Fn com_err_va "whoami" "code" "format" "va_list args" +This routine provides an interface, equivalent to +.Fn com_err , +which may be used by higher-level variadic functions (functions which +accept variable numbers of arguments). +.It Fn error_message "code" +Returns the character string error message associate with +.Fa code . +If +.Fa code is associated with an unknown error table, or if +.Fa code +is associated with a known error table but is not in the table, a +string of the form `Unknown code XXXX NN' is returned, where XXXX is +the error table name produced by reversing the compaction performed on +the error table number implied by that error code, and NN is the +offset from that base value. +.Pp +Although this routine is available for use when needed, its use should +be left to circumstances which render +.Fn com_err +unusable. +.Pp +.Fn com_right +returns the error string just like +.Fa com_err +but in a thread-safe way. +.Pp +.It Fn error_table_name "num" +Convert a machine-independent error table number +.Fa num +into an error table name. +.It Fn init_error_table "msgs" "base" "count" +Initialise the internal error table with the array of character string +error messages in +.Fa msgs +of length +.Fa count . +The error codes are assigned incrementally from +.Fa base . +This function is useful for using the error-reporting mechanism with +custom error tables that have not been generated with +.Xr compile_et 1 . +Although this routine is available for use when needed, its use should +be restricted. +.Pp +.Fn initialize_error_table_r +initialize the +.Fa et_list +in the same way as +.Fn init_error_table , +but in a thread-safe way. +.Pp +.It Fn set_com_err_hook "func" +Provides a hook into the +.Nm +library to allow the routine +.Fa func +to be dynamically substituted for +.Fn com_err . +After +.Fn set_com_err_hook + has been called, calls to +.Fn com_err +will turn into calls to the new hook routine. This function is +intended to be used in daemons to use a routine which calls +.Xr syslog 3 , +or in a window system application to pop up a dialogue box. +.It Fn reset_com_err_hook "" +Turns off the hook set in +.Fn set_com_err_hook . +.It Fn add_to_error_table "new_table" +Add the error table, its messages strings and error codes in +.Fa new_table +to the internal error table. +.El +.Sh EXAMPLES +The following is an example using the table defined in +.Xr compile_et 1 : +.Pp +.Bd -literal + #include + #include + #include + + #include "test_err.h" + + void + hook(const char *whoami, long code, + const char *format, va_list args) + { + char buffer[BUFSIZ]; + static int initialized = 0; + + if (!initialized) { + openlog(whoami, LOG_NOWAIT, LOG_DAEMON); + initialized = 1; + } + vsprintf(buffer, format, args); + syslog(LOG_ERR, "%s %s", error_message(code), buffer); + } + + int + main(int argc, char *argv[]) + { + char *whoami = argv[0]; + + initialize_test_error_table(); + com_err(whoami, TEST_INVAL, "before hook"); + set_com_err_hook(hook); + com_err(whoami, TEST_IO, "after hook"); + return (0); + } +.Ed +.Sh SEE ALSO +.Xr compile_et 1 Modified: head/contrib/com_err/com_err.c ============================================================================== --- head/contrib/com_err/com_err.c Thu Mar 22 08:38:13 2012 (r233293) +++ head/contrib/com_err/com_err.c Thu Mar 22 08:48:42 2012 (r233294) @@ -1,41 +1,37 @@ /* - * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * 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. + * 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. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ -/* $FreeBSD$ */ -#ifdef HAVE_CONFIG_H -#include -RCSID("$Id: com_err.c 14930 2005-04-24 19:43:06Z lha $"); -#endif + #include #include #include @@ -44,7 +40,7 @@ RCSID("$Id: com_err.c 14930 2005-04-24 1 struct et_list *_et_list = NULL; -const char * +KRB5_LIB_FUNCTION const char * KRB5_LIB_CALL error_message (long code) { static char msg[128]; @@ -57,23 +53,23 @@ error_message (long code) } if (p != NULL && *p != '\0') { strlcpy(msg, p, sizeof(msg)); - } else + } else snprintf(msg, sizeof(msg), "Unknown error %ld", code); return msg; } -int +KRB5_LIB_FUNCTION int KRB5_LIB_CALL init_error_table(const char **msgs, long base, int count) { initialize_error_table_r(&_et_list, msgs, count, base); return 0; } -static void +static void KRB5_CALLCONV default_proc (const char *whoami, long code, const char *fmt, va_list args) __attribute__((__format__(__printf__, 3, 0))); - -static void + +static void KRB5_CALLCONV default_proc (const char *whoami, long code, const char *fmt, va_list args) { if (whoami) @@ -87,19 +83,19 @@ default_proc (const char *whoami, long c static errf com_err_hook = default_proc; -void -com_err_va (const char *whoami, - long code, - const char *fmt, +KRB5_LIB_FUNCTION void KRB5_LIB_CALL +com_err_va (const char *whoami, + long code, + const char *fmt, va_list args) { (*com_err_hook) (whoami, code, fmt, args); } -void +KRB5_LIB_FUNCTION void KRB5_LIB_CALL com_err (const char *whoami, long code, - const char *fmt, + const char *fmt, ...) { va_list ap; @@ -108,7 +104,7 @@ com_err (const char *whoami, va_end(ap); } -errf +KRB5_LIB_FUNCTION errf KRB5_LIB_CALL set_com_err_hook (errf new) { errf old = com_err_hook; @@ -117,12 +113,12 @@ set_com_err_hook (errf new) com_err_hook = new; else com_err_hook = default_proc; - + return old; } -errf -reset_com_err_hook (void) +KRB5_LIB_FUNCTION errf KRB5_LIB_CALL +reset_com_err_hook (void) { return set_com_err_hook(NULL); } @@ -135,7 +131,7 @@ static const char char_set[] = static char buf[6]; -const char * +KRB5_LIB_FUNCTION const char * KRB5_LIB_CALL error_table_name(int num) { int ch; @@ -157,7 +153,7 @@ error_table_name(int num) return(buf); } -void +KRB5_LIB_FUNCTION void KRB5_LIB_CALL add_to_error_table(struct et_list *new_table) { struct et_list *et; Modified: head/contrib/com_err/com_err.h ============================================================================== --- head/contrib/com_err/com_err.h Thu Mar 22 08:38:13 2012 (r233293) +++ head/contrib/com_err/com_err.h Thu Mar 22 08:48:42 2012 (r233294) @@ -1,66 +1,76 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * 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. + * 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. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ -/* $FreeBSD$ */ -/* $Id: com_err.h 15566 2005-07-07 14:58:07Z lha $ */ +/* $Id$ */ /* MIT compatible com_err library */ #ifndef __COM_ERR_H__ #define __COM_ERR_H__ -#include -#include - #include #include -typedef void (*errf) __P((const char *, long, const char *, va_list)); +#if !defined(__GNUC__) && !defined(__attribute__) +#define __attribute__(X) +#endif + +typedef void (KRB5_CALLCONV *errf) (const char *, long, const char *, va_list); + +KRB5_LIB_FUNCTION const char * KRB5_LIB_CALL +error_message (long); + +KRB5_LIB_FUNCTION int KRB5_LIB_CALL +init_error_table (const char**, long, int); -const char * error_message (long); -int init_error_table (const char**, long, int); +KRB5_LIB_FUNCTION void KRB5_LIB_CALL +com_err_va (const char *, long, const char *, va_list) + __attribute__((format(printf, 3, 0))); -void com_err_va __P((const char *, long, const char *, va_list)) - __printflike(3, 0); +KRB5_LIB_FUNCTION void KRB5_LIB_CALL +com_err (const char *, long, const char *, ...) + __attribute__((format(printf, 3, 4))); -void com_err __P((const char *, long, const char *, ...)) - __printflike(3, 4); +KRB5_LIB_FUNCTION errf KRB5_LIB_CALL +set_com_err_hook (errf); -errf set_com_err_hook (errf); -errf reset_com_err_hook (void); +KRB5_LIB_FUNCTION errf KRB5_LIB_CALL +reset_com_err_hook (void); -const char *error_table_name (int num); +KRB5_LIB_FUNCTION const char * KRB5_LIB_CALL +error_table_name (int num); -void add_to_error_table (struct et_list *new_table); +KRB5_LIB_FUNCTION void KRB5_LIB_CALL +add_to_error_table (struct et_list *new_table); #endif /* __COM_ERR_H__ */ Modified: head/contrib/com_err/com_right.h ============================================================================== --- head/contrib/com_err/com_right.h Thu Mar 22 08:38:13 2012 (r233293) +++ head/contrib/com_err/com_right.h Thu Mar 22 08:48:42 2012 (r233294) @@ -1,44 +1,76 @@ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. + * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * 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. + * 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. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ -/* $Id: com_right.h 14551 2005-02-03 08:45:13Z lha $ */ -/* $FreeBSD$ */ +/* $Id$ */ #ifndef __COM_RIGHT_H__ #define __COM_RIGHT_H__ +#ifndef KRB5_LIB_FUNCTION +#if defined(_WIN32) +#define KRB5_LIB_FUNCTION __declspec(dllimport) +#else +#define KRB5_LIB_FUNCTION +#endif +#endif + +#ifndef KRB5_LIB_CALL +#if defined(_WIN32) +#define KRB5_LIB_CALL __stdcall +#else +#define KRB5_LIB_CALL +#endif +#endif + +#ifndef KRB5_LIB_VARIABLE +#if defined(_WIN32) +#define KRB5_LIB_VARIABLE __declspec(dllimport) +#else +#define KRB5_LIB_VARIABLE +#endif +#endif + +#ifdef _WIN32 +#define KRB5_CALLCONV __stdcall +#else +#define KRB5_CALLCONV +#endif + #include + +#ifdef __STDC__ #include +#endif struct error_table { char const * const * msgs; @@ -51,8 +83,16 @@ struct et_list { }; extern struct et_list *_et_list; -const char *com_right (struct et_list *list, long code); -void initialize_error_table_r (struct et_list **, const char **, int, long); -void free_error_table (struct et_list *); +KRB5_LIB_FUNCTION const char * KRB5_LIB_CALL +com_right (struct et_list *list, long code); + +KRB5_LIB_FUNCTION const char * KRB5_LIB_CALL +com_right_r (struct et_list *list, long code, char *, size_t); + +KRB5_LIB_FUNCTION void KRB5_LIB_CALL +initialize_error_table_r (struct et_list **, const char **, int, long); + +KRB5_LIB_FUNCTION void KRB5_LIB_CALL +free_error_table (struct et_list *); #endif /* __COM_RIGHT_H__ */ Modified: head/contrib/com_err/compile_et.c ============================================================================== --- head/contrib/com_err/compile_et.c Thu Mar 22 08:38:13 2012 (r233293) +++ head/contrib/com_err/compile_et.c Thu Mar 22 08:48:42 2012 (r233294) @@ -1,45 +1,44 @@ /* - * Copyright (c) 1998-2002 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. + * Copyright (c) 1998-2002 Kungliga Tekniska Högskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * 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. + * 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. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ -/* $FreeBSD$ */ #undef ROKEN_RENAME + +#define rk_PATH_DELIM '/' + #include "compile_et.h" #include -#if 0 -RCSID("$Id: compile_et.c 15426 2005-06-16 19:21:42Z lha $"); -#endif - +#include #include #include "parse.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 09:29:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5072C106564A; Thu, 22 Mar 2012 09:29:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB60C8FC0C; Thu, 22 Mar 2012 09:29:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2M9T7Rn016899; Thu, 22 Mar 2012 09:29:07 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2M9T7ft016897; Thu, 22 Mar 2012 09:29:07 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201203220929.q2M9T7ft016897@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 22 Mar 2012 09:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233295 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 09:29:08 -0000 Author: ae Date: Thu Mar 22 09:29:07 2012 New Revision: 233295 URL: http://svn.freebsd.org/changeset/base/233295 Log: Correct debug message. Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Mar 22 08:48:42 2012 (r233294) +++ head/sys/kern/kern_linker.c Thu Mar 22 09:29:07 2012 (r233295) @@ -312,7 +312,7 @@ linker_file_unregister_sysctls(linker_fi { struct sysctl_oid **start, **stop, **oidp; - KLD_DPF(FILE, ("linker_file_unregister_sysctls: registering SYSCTLs" + KLD_DPF(FILE, ("linker_file_unregister_sysctls: unregistering SYSCTLs" " for %s\n", lf->filename)); if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0) From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 09:33:08 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59E00106564A; Thu, 22 Mar 2012 09:33:08 +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 A308D8FC0C; Thu, 22 Mar 2012 09:33:04 +0000 (UTC) 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 LAA06332; Thu, 22 Mar 2012 11:33:03 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1SAeOE-0005XE-O6; Thu, 22 Mar 2012 11:33:02 +0200 Message-ID: <4F6AF1CB.80902@FreeBSD.org> Date: Thu, 22 Mar 2012 11:32:59 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.2) Gecko/20120218 Thunderbird/10.0.2 MIME-Version: 1.0 To: Jung-uk Kim References: <201203202037.q2KKbNfK037014@svn.freebsd.org> <201203211341.11859.jkim@FreeBSD.org> <4F6A1673.4050408@FreeBSD.org> <201203211502.14353.jkim@FreeBSD.org> In-Reply-To: <201203211502.14353.jkim@FreeBSD.org> X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r233249 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 09:33:08 -0000 on 21/03/2012 21:02 Jung-uk Kim said the following: > On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote: >> on 21/03/2012 19:41 Jung-uk Kim said the following: >>> I am well aware of the problem. In fact, that's why I had to >>> merge ACPICA 20120320 rather quickly, which added a new flag to >>> not execute _GTS method. Both _GTS and _BFS are turned off by >>> default. You can control them with a new tunable >>> "debug.acpi.sleep_flags" if you want. >> >> But the bug still has to be fixed, right? >> Even if it takes a non-default sysctl value to give the bug a >> chance. > > Ideally, yes. However, I am not so sure if we can call it a "bug" > because AcpiEnterSleepState() must be called with interrupt disabled > and there is no way to change that API without breaking other OSes. > We can only work around it locally or persuade upstream to find a > better way to do this in ACPICA itself. Either way, it will be > pretty hackish. :-( I see. Thank you. Maybe the code could be somehow tricked into using M_NOWAIT in this context... -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 09:42:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70F12106564A; Thu, 22 Mar 2012 09:42:28 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8E78FC08; Thu, 22 Mar 2012 09:42:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2M9gSFS017341; Thu, 22 Mar 2012 09:42:28 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2M9gSvv017339; Thu, 22 Mar 2012 09:42:28 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203220942.q2M9gSvv017339@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 22 Mar 2012 09:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233296 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 09:42:28 -0000 Author: pluknet Date: Thu Mar 22 09:42:27 2012 New Revision: 233296 URL: http://svn.freebsd.org/changeset/base/233296 Log: Prevent fs_file NULL pointer dereference in fixfsfile() uncovered after r1.5 when passing damaged user-supplied fstab file data. MFC after: 1 week Modified: head/lib/libc/gen/fstab.c Modified: head/lib/libc/gen/fstab.c ============================================================================== --- head/lib/libc/gen/fstab.c Thu Mar 22 09:29:07 2012 (r233295) +++ head/lib/libc/gen/fstab.c Thu Mar 22 09:42:27 2012 (r233296) @@ -91,7 +91,7 @@ fixfsfile() struct stat sb; struct statfs sf; - if (strcmp(_fs_fstab.fs_file, "/") != 0) + if (_fs_fstab.fs_file != NULL &&strcmp(_fs_fstab.fs_file, "/") != 0) return; if (statfs("/", &sf) != 0) return; From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 09:47:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B15BB1065675; Thu, 22 Mar 2012 09:47:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C12B8FC14; Thu, 22 Mar 2012 09:47:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2M9lAMY017541; Thu, 22 Mar 2012 09:47:10 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2M9lARK017539; Thu, 22 Mar 2012 09:47:10 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203220947.q2M9lARK017539@svn.freebsd.org> From: Dimitry Andric Date: Thu, 22 Mar 2012 09:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233297 - stable/9/contrib/libstdc++/include/bits X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 09:47:10 -0000 Author: dim Date: Thu Mar 22 09:47:10 2012 New Revision: 233297 URL: http://svn.freebsd.org/changeset/base/233297 Log: MFC r233193: Add explicit braces to avoid dangling else in stl_tree.h. This silences the following warning produced by clang trunk: In file included from /usr/src/sbin/devd/devd.cc:91: In file included from /usr/obj/usr/src/tmp/usr/include/c++/4.2/map:64: /usr/obj/usr/src/tmp/usr/include/c++/4.2/bits/stl_tree.h:987:2: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else] else ^ Modified: stable/9/contrib/libstdc++/include/bits/stl_tree.h Directory Properties: stable/9/contrib/libstdc++/ (props changed) Modified: stable/9/contrib/libstdc++/include/bits/stl_tree.h ============================================================================== --- stable/9/contrib/libstdc++/include/bits/stl_tree.h Thu Mar 22 09:42:27 2012 (r233296) +++ stable/9/contrib/libstdc++/include/bits/stl_tree.h Thu Mar 22 09:47:10 2012 (r233297) @@ -982,10 +982,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } iterator __j = iterator(__y); if (__comp) - if (__j == begin()) - return pair(_M_insert(__x, __y, __v), true); - else - --__j; + { + if (__j == begin()) + return pair(_M_insert(__x, __y, __v), true); + else + --__j; + } if (_M_impl._M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v))) return pair(_M_insert(__x, __y, __v), true); return pair(__j, false); From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 09:47:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 604B8106564A; Thu, 22 Mar 2012 09:47:15 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AAB38FC19; Thu, 22 Mar 2012 09:47:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2M9lFf1017578; Thu, 22 Mar 2012 09:47:15 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2M9lF3j017576; Thu, 22 Mar 2012 09:47:15 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203220947.q2M9lF3j017576@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 22 Mar 2012 09:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233298 - head/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 09:47:15 -0000 Author: pluknet Date: Thu Mar 22 09:47:14 2012 New Revision: 233298 URL: http://svn.freebsd.org/changeset/base/233298 Log: Garbage collect defunct nlist(3) symbols. MFC after: 1 week Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Thu Mar 22 09:47:10 2012 (r233297) +++ head/usr.bin/vmstat/vmstat.c Thu Mar 22 09:47:14 2012 (r233298) @@ -81,26 +81,20 @@ static char da[] = "da"; static struct nlist namelist[] = { #define X_SUM 0 { "_cnt" }, -#define X_BOOTTIME 1 - { "_boottime" }, -#define X_HZ 2 +#define X_HZ 1 { "_hz" }, -#define X_STATHZ 3 +#define X_STATHZ 2 { "_stathz" }, -#define X_NCHSTATS 4 +#define X_NCHSTATS 3 { "_nchstats" }, -#define X_INTRNAMES 5 +#define X_INTRNAMES 4 { "_intrnames" }, -#define X_SINTRNAMES 6 +#define X_SINTRNAMES 5 { "_sintrnames" }, -#define X_INTRCNT 7 +#define X_INTRCNT 6 { "_intrcnt" }, -#define X_SINTRCNT 8 +#define X_SINTRCNT 7 { "_sintrcnt" }, -#define X_KMEMSTATS 9 - { "_kmemstatistics" }, -#define X_KMEMZONES 10 - { "_kmemzones" }, #ifdef notyet #define X_DEFICIT XXX { "_deficit" }, @@ -112,7 +106,7 @@ static struct nlist namelist[] = { { "_xstats" }, #define X_END XXX #else -#define X_END 11 +#define X_END 8 #endif { "" }, }; From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 09:50:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7DB0106564A; Thu, 22 Mar 2012 09:50:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1C8C8FC17; Thu, 22 Mar 2012 09:50:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2M9oGiG017717; Thu, 22 Mar 2012 09:50:16 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2M9oGRL017715; Thu, 22 Mar 2012 09:50:16 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203220950.q2M9oGRL017715@svn.freebsd.org> From: Dimitry Andric Date: Thu, 22 Mar 2012 09:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233299 - stable/9/usr.sbin/dconschat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 09:50:17 -0000 Author: dim Date: Thu Mar 22 09:50:16 2012 New Revision: 233299 URL: http://svn.freebsd.org/changeset/base/233299 Log: MFC r233195: Fix the following warning from clang trunk: usr.sbin/dconschat/dconschat.c:163:65: error: format specifies type 'size_t' (aka 'unsigned int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat] snprintf(buf, PAGE_SIZE, "\r\n[dconschat reset target(addr=0x%zx)...]\r\n", dc->reset); ~~^ ~~~~~~~~~ %llx Silence this by casting dc->reset to intmax_t, and using the appropriate length modifier. While here, wrap the line to a 80 character margin. Modified: stable/9/usr.sbin/dconschat/dconschat.c Modified: stable/9/usr.sbin/dconschat/dconschat.c ============================================================================== --- stable/9/usr.sbin/dconschat/dconschat.c Thu Mar 22 09:47:14 2012 (r233298) +++ stable/9/usr.sbin/dconschat/dconschat.c Thu Mar 22 09:50:16 2012 (r233299) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -160,7 +161,9 @@ dconschat_reset_target(struct dcons_stat if (dc->reset == 0) return; - snprintf(buf, PAGE_SIZE, "\r\n[dconschat reset target(addr=0x%zx)...]\r\n", dc->reset); + snprintf(buf, PAGE_SIZE, + "\r\n[dconschat reset target(addr=0x%jx)...]\r\n", + (intmax_t)dc->reset); write(p->outfd, buf, strlen(buf)); bzero(&buf[0], PAGE_SIZE); dwrite(dc, (void *)buf, PAGE_SIZE, dc->reset); From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 09:51:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5833106566B; Thu, 22 Mar 2012 09:51:31 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A17038FC0C; Thu, 22 Mar 2012 09:51:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2M9pVIn017794; Thu, 22 Mar 2012 09:51:31 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2M9pVtL017792; Thu, 22 Mar 2012 09:51:31 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203220951.q2M9pVtL017792@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 22 Mar 2012 09:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233300 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 09:51:31 -0000 Author: pluknet Date: Thu Mar 22 09:51:31 2012 New Revision: 233300 URL: http://svn.freebsd.org/changeset/base/233300 Log: Fix style. Somehow I managed to lost a space when copy&paste. Pointed out by: stefanf Modified: head/lib/libc/gen/fstab.c Modified: head/lib/libc/gen/fstab.c ============================================================================== --- head/lib/libc/gen/fstab.c Thu Mar 22 09:50:16 2012 (r233299) +++ head/lib/libc/gen/fstab.c Thu Mar 22 09:51:31 2012 (r233300) @@ -91,7 +91,7 @@ fixfsfile() struct stat sb; struct statfs sf; - if (_fs_fstab.fs_file != NULL &&strcmp(_fs_fstab.fs_file, "/") != 0) + if (_fs_fstab.fs_file != NULL && strcmp(_fs_fstab.fs_file, "/") != 0) return; if (statfs("/", &sf) != 0) return; From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 11:18:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 879E81065674; Thu, 22 Mar 2012 11:18:15 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 726298FC0A; Thu, 22 Mar 2012 11:18:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MBIFgr021957; Thu, 22 Mar 2012 11:18:15 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MBIFeQ021954; Thu, 22 Mar 2012 11:18:15 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201203221118.q2MBIFeQ021954@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 22 Mar 2012 11:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233302 - head/lib/libpam/modules/pam_ksu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 11:18:15 -0000 Author: stas Date: Thu Mar 22 11:18:14 2012 New Revision: 233302 URL: http://svn.freebsd.org/changeset/base/233302 Log: - Avoid use of deprecated KRB5 functions. Modified: head/lib/libpam/modules/pam_ksu/Makefile head/lib/libpam/modules/pam_ksu/pam_ksu.c Modified: head/lib/libpam/modules/pam_ksu/Makefile ============================================================================== --- head/lib/libpam/modules/pam_ksu/Makefile Thu Mar 22 10:26:53 2012 (r233301) +++ head/lib/libpam/modules/pam_ksu/Makefile Thu Mar 22 11:18:14 2012 (r233302) @@ -31,6 +31,4 @@ MAN= pam_ksu.8 DPADD= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO} LDADD= -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto -NO_WERROR= yes - .include Modified: head/lib/libpam/modules/pam_ksu/pam_ksu.c ============================================================================== --- head/lib/libpam/modules/pam_ksu/pam_ksu.c Thu Mar 22 10:26:53 2012 (r233301) +++ head/lib/libpam/modules/pam_ksu/pam_ksu.c Thu Mar 22 11:18:14 2012 (r233302) @@ -70,8 +70,9 @@ pam_sm_authenticate(pam_handle_t *pamh, PAM_LOG("Got ruser: %s", (const char *)ruser); rv = krb5_init_context(&context); if (rv != 0) { - PAM_LOG("krb5_init_context failed: %s", - krb5_get_err_text(context, rv)); + const char *msg = krb5_get_error_message(context, rv); + PAM_LOG("krb5_init_context failed: %s", msg); + krb5_free_error_message(context, msg); return (PAM_SERVICE_ERR); } rv = get_su_principal(context, user, ruser, &su_principal_name, &su_principal); @@ -112,7 +113,7 @@ auth_krb5(pam_handle_t *pamh, krb5_conte krb5_principal su_principal) { krb5_creds creds; - krb5_get_init_creds_opt gic_opt; + krb5_get_init_creds_opt *gic_opt; krb5_verify_init_creds_opt vic_opt; const char *pass; char *prompt; @@ -120,7 +121,6 @@ auth_krb5(pam_handle_t *pamh, krb5_conte int pamret; prompt = NULL; - krb5_get_init_creds_opt_init(&gic_opt); krb5_verify_init_creds_opt_init(&vic_opt); if (su_principal_name != NULL) (void)asprintf(&prompt, "Password for %s:", su_principal_name); @@ -133,11 +133,20 @@ auth_krb5(pam_handle_t *pamh, krb5_conte free(prompt); if (pamret != PAM_SUCCESS) return (pamret); + rv = krb5_get_init_creds_opt_alloc(context, &gic_opt); + if (rv != 0) { + const char *msg = krb5_get_error_message(context, rv); + PAM_LOG("krb5_get_init_creds_opt_alloc: %s", msg); + krb5_free_error_message(context, msg); + return (PAM_AUTH_ERR); + } rv = krb5_get_init_creds_password(context, &creds, su_principal, - pass, NULL, NULL, 0, NULL, &gic_opt); + pass, NULL, NULL, 0, NULL, gic_opt); + krb5_get_init_creds_opt_free(context, gic_opt); if (rv != 0) { - PAM_LOG("krb5_get_init_creds_password: %s", - krb5_get_err_text(context, rv)); + const char *msg = krb5_get_error_message(context, rv); + PAM_LOG("krb5_get_init_creds_password: %s", msg); + krb5_free_error_message(context, msg); return (PAM_AUTH_ERR); } krb5_verify_init_creds_opt_set_ap_req_nofail(&vic_opt, 1); @@ -145,8 +154,9 @@ auth_krb5(pam_handle_t *pamh, krb5_conte &vic_opt); krb5_free_cred_contents(context, &creds); if (rv != 0) { - PAM_LOG("krb5_verify_init_creds: %s", - krb5_get_err_text(context, rv)); + const char *msg = krb5_get_error_message(context, rv); + PAM_LOG("krb5_verify_init_creds: %s", msg); + krb5_free_error_message(context, msg); return (PAM_AUTH_ERR); } return (PAM_SUCCESS); @@ -220,8 +230,9 @@ get_su_principal(krb5_context context, c rv = krb5_unparse_name(context, default_principal, &principal_name); krb5_free_principal(context, default_principal); if (rv != 0) { - PAM_LOG("krb5_unparse_name: %s", - krb5_get_err_text(context, rv)); + const char *msg = krb5_get_error_message(context, rv); + PAM_LOG("krb5_unparse_name: %s", msg); + krb5_free_error_message(context, msg); return (rv); } PAM_LOG("Default principal name: %s", principal_name); @@ -243,8 +254,9 @@ get_su_principal(krb5_context context, c return (errno); rv = krb5_parse_name(context, *su_principal_name, &default_principal); if (rv != 0) { - PAM_LOG("krb5_parse_name `%s': %s", *su_principal_name, - krb5_get_err_text(context, rv)); + const char *msg = krb5_get_error_message(context, rv); + PAM_LOG("krb5_parse_name `%s': %s", *su_principal_name, msg); + krb5_free_error_message(context, msg); free(*su_principal_name); return (rv); } From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 11:43:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BCFCC1065673; Thu, 22 Mar 2012 11:43:54 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A81138FC08; Thu, 22 Mar 2012 11:43:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MBhsKn022805; Thu, 22 Mar 2012 11:43:54 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MBhswa022803; Thu, 22 Mar 2012 11:43:54 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203221143.q2MBhswa022803@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 22 Mar 2012 11:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233303 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 11:43:57 -0000 Author: pluknet Date: Thu Mar 22 11:43:54 2012 New Revision: 233303 URL: http://svn.freebsd.org/changeset/base/233303 Log: MFC r210525: Missing IFCAP_* macro descriptions in ifnet(9). PR: docs/148952 Submitted by: Lars Hartmann Modified: stable/8/share/man/man9/ifnet.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/ifnet.9 ============================================================================== --- stable/8/share/man/man9/ifnet.9 Thu Mar 22 11:18:14 2012 (r233302) +++ stable/8/share/man/man9/ifnet.9 Thu Mar 22 11:43:54 2012 (r233303) @@ -600,6 +600,31 @@ longer than permitted by the Ethernet sp .It Dv IFCAP_JUMBO_MTU This Ethernet interface can transmit and receive frames up to 9000 bytes long. +.It Dv IFCAP_TSO4 +This Ethernet interface supports TCP Segmentation offloading. +.It Dv IFCAP_TSO6 +This Ethernet interface supports TCP6 Segmentation offloading. +.It Dv IFCAP_TSO +A shorthand for +.Pq Dv IFCAP_TSO4 | IFCAP_TSO6 . +.It Dv IFCAP_TOE4 +This Ethernet interface supports TCP offloading. +.It Dv IFCAP_TOE6 +This Ethernet interface supports TCP6 offloading. +.It Dv ICAP_TOE +A Shorthand for +.Pq Dv IFCAP_TOE4 | IFCAP_TOE6 . +.It Dv IFCAP_WOL_UCAST +This Ethernet interface supports waking up on any Unicast packet. +.It Dv IFCAP_WOL_MCAST +This Ethernet interface supports waking up on any Multicast packet. +.It Dv IFCAP_WOL_MAGIC +This Ethernet interface supports waking up on any Magic packet such +as those sent by +.Xr wake 8 . +.It Dv IFCAP_WOL +A shorthand for +.Pq Dv IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC . .El .Pp The ability of advanced network interfaces to offload certain From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 11:47:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E5EB1065673; Thu, 22 Mar 2012 11:47:07 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 583998FC15; Thu, 22 Mar 2012 11:47:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MBl7Wd022970; Thu, 22 Mar 2012 11:47:07 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MBl7Ne022968; Thu, 22 Mar 2012 11:47:07 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203221147.q2MBl7Ne022968@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 22 Mar 2012 11:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233304 - stable/7/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 11:47:07 -0000 Author: pluknet Date: Thu Mar 22 11:47:06 2012 New Revision: 233304 URL: http://svn.freebsd.org/changeset/base/233304 Log: MFC r210525: Missing IFCAP_* macro descriptions in ifnet(9). PR: docs/148952 Submitted by: Lars Hartmann Modified: stable/7/share/man/man9/ifnet.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/ifnet.9 ============================================================================== --- stable/7/share/man/man9/ifnet.9 Thu Mar 22 11:43:54 2012 (r233303) +++ stable/7/share/man/man9/ifnet.9 Thu Mar 22 11:47:06 2012 (r233304) @@ -572,6 +572,31 @@ longer than permitted by the Ethernet sp .It Dv IFCAP_JUMBO_MTU This Ethernet interface can transmit and receive frames up to 9000 bytes long. +.It Dv IFCAP_TSO4 +This Ethernet interface supports TCP Segmentation offloading. +.It Dv IFCAP_TSO6 +This Ethernet interface supports TCP6 Segmentation offloading. +.It Dv IFCAP_TSO +A shorthand for +.Pq Dv IFCAP_TSO4 | IFCAP_TSO6 . +.It Dv IFCAP_TOE4 +This Ethernet interface supports TCP offloading. +.It Dv IFCAP_TOE6 +This Ethernet interface supports TCP6 offloading. +.It Dv ICAP_TOE +A Shorthand for +.Pq Dv IFCAP_TOE4 | IFCAP_TOE6 . +.It Dv IFCAP_WOL_UCAST +This Ethernet interface supports waking up on any Unicast packet. +.It Dv IFCAP_WOL_MCAST +This Ethernet interface supports waking up on any Multicast packet. +.It Dv IFCAP_WOL_MAGIC +This Ethernet interface supports waking up on any Magic packet such +as those sent by +.Xr wake 8 . +.It Dv IFCAP_WOL +A shorthand for +.Pq Dv IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC . .El .Pp The ability of advanced network interfaces to offload certain From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 12:23:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 014BC1065670; Thu, 22 Mar 2012 12:23:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0A7F8FC15; Thu, 22 Mar 2012 12:23:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MCNWqJ024125; Thu, 22 Mar 2012 12:23:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MCNW6j024123; Thu, 22 Mar 2012 12:23:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203221223.q2MCNW6j024123@svn.freebsd.org> From: John Baldwin Date: Thu, 22 Mar 2012 12:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233305 - head/sys/x86/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 12:23:33 -0000 Author: jhb Date: Thu Mar 22 12:23:32 2012 New Revision: 233305 URL: http://svn.freebsd.org/changeset/base/233305 Log: Mark the 'lapics' and 'ioapics' arrays here static since they are private to this file. The 'lapics' array was actually shadowing a completely different 'lapics' array that is private to local_apic.c. Reported by: bde MFC after: 2 weeks Modified: head/sys/x86/acpica/madt.c Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Thu Mar 22 11:47:06 2012 (r233304) +++ head/sys/x86/acpica/madt.c Thu Mar 22 12:23:32 2012 (r233305) @@ -53,12 +53,12 @@ __FBSDID("$FreeBSD$"); struct ioapic_info { void *io_apic; UINT32 io_vector; -} ioapics[MAX_APIC_ID + 1]; +} static ioapics[MAX_APIC_ID + 1]; struct lapic_info { u_int la_enabled:1; u_int la_acpi_id:8; -} lapics[MAX_APIC_ID + 1]; +} static lapics[MAX_APIC_ID + 1]; static int madt_found_sci_override; static ACPI_TABLE_MADT *madt; From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 13:28:08 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B50A81065670; Thu, 22 Mar 2012 13:28:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 4DC938FC1F; Thu, 22 Mar 2012 13:28:07 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q2MDS0Uu009960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Mar 2012 00:28:00 +1100 Date: Fri, 23 Mar 2012 00:28:00 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin In-Reply-To: <201203221223.q2MCNW6j024123@svn.freebsd.org> Message-ID: <20120323001046.H2349@besplex.bde.org> References: <201203221223.q2MCNW6j024123@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r233305 - head/sys/x86/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 13:28:08 -0000 On Thu, 22 Mar 2012, John Baldwin wrote: > Log: > Mark the 'lapics' and 'ioapics' arrays here static since they are > private to this file. The 'lapics' array was actually shadowing a > completely different 'lapics' array that is private to local_apic.c. > > Reported by: bde > MFC after: 2 weeks > > Modified: > head/sys/x86/acpica/madt.c > > Modified: head/sys/x86/acpica/madt.c > ============================================================================== > --- head/sys/x86/acpica/madt.c Thu Mar 22 11:47:06 2012 (r233304) > +++ head/sys/x86/acpica/madt.c Thu Mar 22 12:23:32 2012 (r233305) > @@ -53,12 +53,12 @@ __FBSDID("$FreeBSD$"); > struct ioapic_info { > void *io_apic; > UINT32 io_vector; > -} ioapics[MAX_APIC_ID + 1]; > +} static ioapics[MAX_APIC_ID + 1]; > > struct lapic_info { > u_int la_enabled:1; > u_int la_acpi_id:8; > -} lapics[MAX_APIC_ID + 1]; > +} static lapics[MAX_APIC_ID + 1]; > > static int madt_found_sci_override; > static ACPI_TABLE_MADT *madt; Thanks, but that's any even weirder style. It's in between "int static foo;" and "int static unsigned foo;" for weirdness. Normal style gives: %%% struct lapic_info { u_int la_enabled:1; u_int la_acpi_id:8; }; static struct lapic_info lapics[MAX_APIC_ID + 1]; %%% etc. This also fixes some indentation. The struct tag for struct ioapic_info is not used outside of its declaration, so a non-separate type declaration would be more reasonable for it (since this gives the only way to omit the tag: static struct { void *io_apic; u_int io_vector; } ioapics[MAX_APIC_ID + 1]; This also translates UINT32 from windosspeak. There is no need for uint32_t since this is x86, and other places use u_int. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 14:09:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1EB6A106564A; Thu, 22 Mar 2012 14:09:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E209C8FC0A; Thu, 22 Mar 2012 14:09:20 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 7E8EC46B0C; Thu, 22 Mar 2012 10:09:20 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DB419B943; Thu, 22 Mar 2012 10:09:19 -0400 (EDT) From: John Baldwin To: Andriy Gapon Date: Thu, 22 Mar 2012 07:48:49 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203202037.q2KKbNfK037014@svn.freebsd.org> <201203211502.14353.jkim@FreeBSD.org> <4F6AF1CB.80902@FreeBSD.org> In-Reply-To: <4F6AF1CB.80902@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203220748.49635.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 22 Mar 2012 10:09:20 -0400 (EDT) Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Jung-uk Kim Subject: Re: svn commit: r233249 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 14:09:21 -0000 On Thursday, March 22, 2012 5:32:59 am Andriy Gapon wrote: > on 21/03/2012 21:02 Jung-uk Kim said the following: > > On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote: > >> on 21/03/2012 19:41 Jung-uk Kim said the following: > >>> I am well aware of the problem. In fact, that's why I had to > >>> merge ACPICA 20120320 rather quickly, which added a new flag to > >>> not execute _GTS method. Both _GTS and _BFS are turned off by > >>> default. You can control them with a new tunable > >>> "debug.acpi.sleep_flags" if you want. > >> > >> But the bug still has to be fixed, right? > >> Even if it takes a non-default sysctl value to give the bug a > >> chance. > > > > Ideally, yes. However, I am not so sure if we can call it a "bug" > > because AcpiEnterSleepState() must be called with interrupt disabled > > and there is no way to change that API without breaking other OSes. > > We can only work around it locally or persuade upstream to find a > > better way to do this in ACPICA itself. Either way, it will be > > pretty hackish. :-( > > I see. Thank you. > Maybe the code could be somehow tricked into using M_NOWAIT in this context... That still wouldn't be good enough. We don't want to try to acquire any regular mutexes either (we can't safely block to let the lock owner run, or the lock owner might be a suspended thread on another CPU, etc.). The only proper way to fix this would be to use pre-allocated storage in this particular case, but given that Windows doesn't invoke these methods on suspend/resume, it's doubtful that we will ever need to do so. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 14:11:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E685106564A; Thu, 22 Mar 2012 14:11:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3995E8FC1D; Thu, 22 Mar 2012 14:11:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MEBB4a027430; Thu, 22 Mar 2012 14:11:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MEBBIU027428; Thu, 22 Mar 2012 14:11:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203221411.q2MEBBIU027428@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Mar 2012 14:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233306 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 14:11:11 -0000 Author: kib Date: Thu Mar 22 14:11:10 2012 New Revision: 233306 URL: http://svn.freebsd.org/changeset/base/233306 Log: Remove the fragments which are not needed on FreeBSD. The caltech malloc hardly would ever be updated. Reviewed by: bde, kan MFC after: 2 weeks Modified: head/libexec/rtld-elf/malloc.c Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Thu Mar 22 12:23:32 2012 (r233305) +++ head/libexec/rtld-elf/malloc.c Thu Mar 22 14:11:10 2012 (r233306) @@ -59,15 +59,6 @@ static char *rcsid = "$FreeBSD$"; #include #include #include "rtld_printf.h" -#ifndef BSD -#define MAP_COPY MAP_PRIVATE -#define MAP_FILE 0 -#define MAP_ANON 0 -#endif - -#ifndef BSD /* Need do better than this */ -#define NEED_DEV_ZERO 1 -#endif static void morecore(); static int findbucket(); @@ -492,12 +483,6 @@ int n; int fd = -1; int offset; -#ifdef NEED_DEV_ZERO - fd = open(_PATH_DEVZERO, O_RDWR, 0); - if (fd == -1) - perror(_PATH_DEVZERO); -#endif - if (pagepool_end - pagepool_start > pagesz) { caddr_t addr = (caddr_t) (((long)pagepool_start + pagesz - 1) & ~(pagesz - 1)); @@ -517,8 +502,5 @@ int n; pagepool_end = pagepool_start + n * pagesz; pagepool_start += offset; -#ifdef NEED_DEV_ZERO - close(fd); -#endif return n; } From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 14:14:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C2ED1065670; Thu, 22 Mar 2012 14:14:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 702798FC17; Thu, 22 Mar 2012 14:14:45 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q2MEEbYR015702; Thu, 22 Mar 2012 16:14:37 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q2MEEa4i063855; Thu, 22 Mar 2012 16:14:36 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q2MEEaTk063854; Thu, 22 Mar 2012 16:14:36 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 22 Mar 2012 16:14:36 +0200 From: Konstantin Belousov To: John Baldwin Message-ID: <20120322141436.GC2358@deviant.kiev.zoral.com.ua> References: <201203202037.q2KKbNfK037014@svn.freebsd.org> <201203211502.14353.jkim@FreeBSD.org> <4F6AF1CB.80902@FreeBSD.org> <201203220748.49635.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gLcqQrOcczDba7nC" Content-Disposition: inline In-Reply-To: <201203220748.49635.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Jung-uk Kim , Andriy Gapon Subject: Re: svn commit: r233249 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 14:14:46 -0000 --gLcqQrOcczDba7nC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 22, 2012 at 07:48:49AM -0400, John Baldwin wrote: > On Thursday, March 22, 2012 5:32:59 am Andriy Gapon wrote: > > on 21/03/2012 21:02 Jung-uk Kim said the following: > > > On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote: > > >> on 21/03/2012 19:41 Jung-uk Kim said the following: > > >>> I am well aware of the problem. In fact, that's why I had to > > >>> merge ACPICA 20120320 rather quickly, which added a new flag to > > >>> not execute _GTS method. Both _GTS and _BFS are turned off by > > >>> default. You can control them with a new tunable > > >>> "debug.acpi.sleep_flags" if you want. > > >> > > >> But the bug still has to be fixed, right? > > >> Even if it takes a non-default sysctl value to give the bug a > > >> chance. > > >=20 > > > Ideally, yes. However, I am not so sure if we can call it a "bug"=20 > > > because AcpiEnterSleepState() must be called with interrupt disabled= =20 > > > and there is no way to change that API without breaking other OSes. = =20 > > > We can only work around it locally or persuade upstream to find a=20 > > > better way to do this in ACPICA itself. Either way, it will be=20 > > > pretty hackish. :-( > >=20 > > I see. Thank you. > > Maybe the code could be somehow tricked into using M_NOWAIT in this=20 > context... >=20 > That still wouldn't be good enough. We don't want to try to acquire any= =20 > regular mutexes either (we can't safely block to let the lock owner run, = or=20 > the lock owner might be a suspended thread on another CPU, etc.). The on= ly=20 > proper way to fix this would be to use pre-allocated storage in this=20 > particular case, but given that Windows doesn't invoke these methods on= =20 > suspend/resume, it's doubtful that we will ever need to do so. I already noted this to Jung-uk, I think that current suspend handling is (somewhat) wrong. We shall not stop other CPUs for suspension when they are executing some random kernel code. Rather, CPUs should be safely stopped at the kernel->user boundary, or at sleep point, or at designated suspend point like idle loop. We already are engaged into somewhat doubtful actions like restoring of %cr= 2, since we might, for instance, preemt page fault handler with suspend IPI. --gLcqQrOcczDba7nC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk9rM8wACgkQC3+MBN1Mb4gnpQCeK/+dLY/ihNsbDZoK/vEN5j6D udkAoKxKG4zXP2TmK7igqhqlZARm1rfH =6gO6 -----END PGP SIGNATURE----- --gLcqQrOcczDba7nC-- From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 14:20:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 194441065677; Thu, 22 Mar 2012 14:20:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED47B8FC16; Thu, 22 Mar 2012 14:20:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MEKp0v027777; Thu, 22 Mar 2012 14:20:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MEKptP027771; Thu, 22 Mar 2012 14:20:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203221420.q2MEKptP027771@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Mar 2012 14:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233307 - in head/libexec/rtld-elf: . ia64 powerpc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 14:20:52 -0000 Author: kib Date: Thu Mar 22 14:20:51 2012 New Revision: 233307 URL: http://svn.freebsd.org/changeset/base/233307 Log: Use xmalloc() instead of malloc() in the places where malloc() calls are assumed to not fail. Make the xcalloc() calling conventions follow the calloc(3) calling conventions and replace unchecked calls to calloc() with calls to xcalloc(). Remove redundand declarations from xmalloc.c, which are already present in rtld.h. Reviewed by: kan Discussed with: bde MFC after: 2 weeks Modified: head/libexec/rtld-elf/ia64/reloc.c head/libexec/rtld-elf/powerpc64/reloc.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h head/libexec/rtld-elf/xmalloc.c Modified: head/libexec/rtld-elf/ia64/reloc.c ============================================================================== --- head/libexec/rtld-elf/ia64/reloc.c Thu Mar 22 14:11:10 2012 (r233306) +++ head/libexec/rtld-elf/ia64/reloc.c Thu Mar 22 14:20:51 2012 (r233307) @@ -87,7 +87,7 @@ alloc_fptr(Elf_Addr target, Elf_Addr gp) struct fptr* fptr; if (next_fptr == last_fptr) { - current_chunk = malloc(sizeof(struct fptr_chunk)); + current_chunk = xmalloc(sizeof(struct fptr_chunk)); next_fptr = ¤t_chunk->fptrs[0]; last_fptr = ¤t_chunk->fptrs[FPTR_CHUNK_SIZE]; } @@ -116,9 +116,7 @@ alloc_fptrs(Obj_Entry *obj, bool mapped) if (fptrs == MAP_FAILED) fptrs = NULL; } else { - fptrs = malloc(fbytes); - if (fptrs != NULL) - memset(fptrs, 0, fbytes); + fptrs = xcalloc(1, fbytes); } /* Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc64/reloc.c Thu Mar 22 14:11:10 2012 (r233306) +++ head/libexec/rtld-elf/powerpc64/reloc.c Thu Mar 22 14:20:51 2012 (r233307) @@ -338,7 +338,7 @@ reloc_plt_object(Obj_Entry *obj, const E reloff = rela - obj->pltrela; if (obj->priv == NULL) - obj->priv = malloc(obj->pltrelasize); + obj->priv = xmalloc(obj->pltrelasize); glink = obj->priv + reloff*sizeof(Elf_Addr)*2; dbg(" reloc_plt_object: where=%p,reloff=%lx,glink=%p", (void *)where, reloff, glink); Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Mar 22 14:11:10 2012 (r233306) +++ head/libexec/rtld-elf/rtld.c Thu Mar 22 14:20:51 2012 (r233307) @@ -3733,7 +3733,7 @@ tls_get_addr_slow(Elf_Addr **dtvp, int i /* Check dtv generation in case new modules have arrived */ if (dtv[0] != tls_dtv_generation) { wlock_acquire(rtld_bind_lock, &lockstate); - newdtv = calloc(1, (tls_max_index + 2) * sizeof(Elf_Addr)); + newdtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); to_copy = dtv[1]; if (to_copy > tls_max_index) to_copy = tls_max_index; @@ -3788,7 +3788,7 @@ allocate_tls(Obj_Entry *objs, void *oldt return (oldtcb); assert(tcbsize >= TLS_TCB_SIZE); - tcb = calloc(1, tls_static_space - TLS_TCB_SIZE + tcbsize); + tcb = xcalloc(1, tls_static_space - TLS_TCB_SIZE + tcbsize); tls = (Elf_Addr **)(tcb + tcbsize - TLS_TCB_SIZE); if (oldtcb != NULL) { @@ -3804,7 +3804,7 @@ allocate_tls(Obj_Entry *objs, void *oldt } } } else { - dtv = calloc(tls_max_index + 2, sizeof(Elf_Addr)); + dtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); tls[0] = dtv; dtv[0] = tls_dtv_generation; dtv[1] = tls_max_index; @@ -3868,8 +3868,8 @@ allocate_tls(Obj_Entry *objs, void *oldt size = round(tls_static_space, tcbalign); assert(tcbsize >= 2*sizeof(Elf_Addr)); - tls = calloc(1, size + tcbsize); - dtv = calloc(1, (tls_max_index + 2) * sizeof(Elf_Addr)); + tls = xcalloc(1, size + tcbsize); + dtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); segbase = (Elf_Addr)(tls + size); ((Elf_Addr*)segbase)[0] = segbase; @@ -4209,7 +4209,7 @@ rtld_verify_object_versions(Obj_Entry *o * way. */ obj->vernum = maxvernum + 1; - obj->vertab = calloc(obj->vernum, sizeof(Ver_Entry)); + obj->vertab = xcalloc(obj->vernum, sizeof(Ver_Entry)); vd = obj->verdef; while (vd != NULL) { Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Thu Mar 22 14:11:10 2012 (r233306) +++ head/libexec/rtld-elf/rtld.h Thu Mar 22 14:20:51 2012 (r233307) @@ -58,7 +58,7 @@ #endif #define NEW(type) ((type *) xmalloc(sizeof(type))) -#define CNEW(type) ((type *) xcalloc(sizeof(type))) +#define CNEW(type) ((type *) xcalloc(1, sizeof(type))) /* We might as well do booleans like C++. */ typedef unsigned char bool; @@ -319,7 +319,7 @@ typedef struct Struct_SymLook { extern void _rtld_error(const char *, ...) __printflike(1, 2); extern const char *rtld_strerror(int); extern Obj_Entry *map_object(int, const char *, const struct stat *); -extern void *xcalloc(size_t); +extern void *xcalloc(size_t, size_t); extern void *xmalloc(size_t); extern char *xstrdup(const char *); extern Elf_Addr _GLOBAL_OFFSET_TABLE_[]; Modified: head/libexec/rtld-elf/xmalloc.c ============================================================================== --- head/libexec/rtld-elf/xmalloc.c Thu Mar 22 14:11:10 2012 (r233306) +++ head/libexec/rtld-elf/xmalloc.c Thu Mar 22 14:20:51 2012 (r233307) @@ -32,14 +32,17 @@ #include "rtld.h" #include "rtld_printf.h" -void *xcalloc(size_t); -void *xmalloc(size_t); -char *xstrdup(const char *); - void * -xcalloc(size_t size) +xcalloc(size_t number, size_t size) { - return memset(xmalloc(size), 0, size); + void *p; + + p = calloc(number, size); + if (p == NULL) { + rtld_fdputstr(STDERR_FILENO, "Out of memory\n"); + _exit(1); + } + return (p); } void * From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 15:14:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE327106566B; Thu, 22 Mar 2012 15:14:10 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D97F78FC1F; Thu, 22 Mar 2012 15:14:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MFEAFt029552; Thu, 22 Mar 2012 15:14:10 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MFEAG3029550; Thu, 22 Mar 2012 15:14:10 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201203221514.q2MFEAG3029550@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 22 Mar 2012 15:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233308 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 15:14:11 -0000 Author: jchandra Date: Thu Mar 22 15:14:10 2012 New Revision: 233308 URL: http://svn.freebsd.org/changeset/base/233308 Log: Fix return type of mips pmap_kextract() The return type should be vm_paddr_t, not vm_offset_t. Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Mar 22 14:20:51 2012 (r233307) +++ head/sys/mips/mips/pmap.c Thu Mar 22 15:14:10 2012 (r233308) @@ -3209,7 +3209,7 @@ pmap_emulate_modified(pmap_t pmap, vm_of * Extract the physical page address associated * virtual address. */ - /* PMAP_INLINE */ vm_offset_t +vm_paddr_t pmap_kextract(vm_offset_t va) { int mapped; From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 16:19:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB511106566C; Thu, 22 Mar 2012 16:19:04 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A59F28FC12; Thu, 22 Mar 2012 16:19:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MGJ4bL031645; Thu, 22 Mar 2012 16:19:04 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MGJ477031642; Thu, 22 Mar 2012 16:19:04 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201203221619.q2MGJ477031642@svn.freebsd.org> From: Joel Dahl Date: Thu, 22 Mar 2012 16:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233310 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 16:19:04 -0000 Author: joel (doc committer) Date: Thu Mar 22 16:19:04 2012 New Revision: 233310 URL: http://svn.freebsd.org/changeset/base/233310 Log: Add snd_cmi, snd_csa and snd_emu10kx to GENERIC on i386 and amd64. The GPL infected parts which were blocking the inclusion of snd_csa and snd_emu10kx in GENERIC have recently been removed from the tree. I'm also adding snd_cmi to GENERIC, which I originally intended to add when we enabled sound support by default. Discussed with: jhb, pfg, Yuriy Tsibizov Approved by: jhb Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu Mar 22 15:21:09 2012 (r233309) +++ head/sys/amd64/conf/GENERIC Thu Mar 22 16:19:04 2012 (r233310) @@ -316,6 +316,9 @@ device dcons_crom # Configuration ROM f # Sound support device sound # Generic sound driver (required) +device snd_cmi # CMedia CMI8338/CMI8738 +device snd_csa # Crystal Semiconductor CS461x/428x +device snd_emu10kx # Creative SoundBlaster Live! and Audigy device snd_es137x # Ensoniq AudioPCI ES137x device snd_hda # Intel High Definition Audio device snd_ich # Intel, NVidia and other ICH AC'97 Audio Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Mar 22 15:21:09 2012 (r233309) +++ head/sys/i386/conf/GENERIC Thu Mar 22 16:19:04 2012 (r233310) @@ -329,6 +329,9 @@ device dcons_crom # Configuration ROM f # Sound support device sound # Generic sound driver (required) +device snd_cmi # CMedia CMI8338/CMI8738 +device snd_csa # Crystal Semiconductor CS461x/428x +device snd_emu10kx # Creative SoundBlaster Live! and Audigy device snd_es137x # Ensoniq AudioPCI ES137x device snd_hda # Intel High Definition Audio device snd_ich # Intel, NVidia and other ICH AC'97 Audio From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 16:22:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 872FD106564A; Thu, 22 Mar 2012 16:22:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 591F88FC14; Thu, 22 Mar 2012 16:22:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MGMHvL031797; Thu, 22 Mar 2012 16:22:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MGMH32031795; Thu, 22 Mar 2012 16:22:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203221622.q2MGMH32031795@svn.freebsd.org> From: Michael Tuexen Date: Thu, 22 Mar 2012 16:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233311 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 16:22:17 -0000 Author: tuexen Date: Thu Mar 22 16:22:16 2012 New Revision: 233311 URL: http://svn.freebsd.org/changeset/base/233311 Log: Small cleanup of the code. No functional change (in FreeBSD kernel). MFC after: 1 week. Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Thu Mar 22 16:19:04 2012 (r233310) +++ head/sys/netinet/sctputil.c Thu Mar 22 16:22:16 2012 (r233311) @@ -5443,28 +5443,31 @@ found_one: } #endif if (fromlen && from) { - struct sockaddr *to; - + cp_len = min((size_t)fromlen, (size_t)control->whoFrom->ro._l_addr.sa.sa_len); + switch (control->whoFrom->ro._l_addr.sa.sa_family) { +#ifdef INET6 + case AF_INET6: + ((struct sockaddr_in6 *)from)->sin6_port = control->port_from; + break; +#endif #ifdef INET - cp_len = min((size_t)fromlen, (size_t)control->whoFrom->ro._l_addr.sin.sin_len); - memcpy(from, &control->whoFrom->ro._l_addr, cp_len); - ((struct sockaddr_in *)from)->sin_port = control->port_from; -#else - /* No AF_INET use AF_INET6 */ - cp_len = min((size_t)fromlen, (size_t)control->whoFrom->ro._l_addr.sin6.sin6_len); - memcpy(from, &control->whoFrom->ro._l_addr, cp_len); - ((struct sockaddr_in6 *)from)->sin6_port = control->port_from; + case AF_INET: + ((struct sockaddr_in *)from)->sin_port = control->port_from; + break; #endif + default: + break; + } + memcpy(from, &control->whoFrom->ro._l_addr, cp_len); - to = from; #if defined(INET) && defined(INET6) if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) && - (to->sa_family == AF_INET) && + (from->sa_family == AF_INET) && ((size_t)fromlen >= sizeof(struct sockaddr_in6))) { struct sockaddr_in *sin; struct sockaddr_in6 sin6; - sin = (struct sockaddr_in *)to; + sin = (struct sockaddr_in *)from; bzero(&sin6, sizeof(sin6)); sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(struct sockaddr_in6); @@ -5473,15 +5476,15 @@ found_one: &sin6.sin6_addr.s6_addr32[3], sizeof(sin6.sin6_addr.s6_addr32[3])); sin6.sin6_port = sin->sin_port; - memcpy(from, (caddr_t)&sin6, sizeof(sin6)); + memcpy(from, &sin6, sizeof(struct sockaddr_in6)); } #endif #if defined(INET6) { - struct sockaddr_in6 lsa6, *to6; + struct sockaddr_in6 lsa6, *from6; - to6 = (struct sockaddr_in6 *)to; - sctp_recover_scope_mac(to6, (&lsa6)); + from6 = (struct sockaddr_in6 *)from; + sctp_recover_scope_mac(from6, (&lsa6)); } #endif } From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 16:24:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8BBE2106566C; Thu, 22 Mar 2012 16:24:51 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7760B8FC12; Thu, 22 Mar 2012 16:24:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MGOpMV031903; Thu, 22 Mar 2012 16:24:51 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MGOpZv031901; Thu, 22 Mar 2012 16:24:51 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201203221624.q2MGOpZv031901@svn.freebsd.org> From: Joel Dahl Date: Thu, 22 Mar 2012 16:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233312 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 16:24:51 -0000 Author: joel (doc committer) Date: Thu Mar 22 16:24:50 2012 New Revision: 233312 URL: http://svn.freebsd.org/changeset/base/233312 Log: Update snd_cmi, snd_csa and snd_emu10kx status. Modified: head/share/man/man4/pcm.4 Modified: head/share/man/man4/pcm.4 ============================================================================== --- head/share/man/man4/pcm.4 Thu Mar 22 16:22:16 2012 (r233311) +++ head/share/man/man4/pcm.4 Thu Mar 22 16:24:50 2012 (r233312) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2012 +.Dd March 22, 2012 .Dt SOUND 4 .Os .Sh NAME @@ -85,11 +85,11 @@ The following bridge device drivers are .It .Xr snd_audiocs 4 (enabled by default on sparc64) .It -.Xr snd_cmi 4 +.Xr snd_cmi 4 (enabled by default on amd64, i386) .It .Xr snd_cs4281 4 .It -.Xr snd_csa 4 +.Xr snd_csa 4 (enabled by default on amd64, i386) .It .Xr snd_davbus 4 (enabled by default on powerpc) .It @@ -97,7 +97,7 @@ The following bridge device drivers are .It .Xr snd_emu10k1 4 .It -.Xr snd_emu10kx 4 +.Xr snd_emu10kx 4 (enabled by default on amd64, i386) .It .Xr snd_envy24 4 .It From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 16:44:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F4DC106564A; Thu, 22 Mar 2012 16:44:45 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh8.mail.rice.edu (mh8.mail.rice.edu [128.42.201.24]) by mx1.freebsd.org (Postfix) with ESMTP id 1C9018FC14; Thu, 22 Mar 2012 16:44:44 +0000 (UTC) Received: from mh8.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh8.mail.rice.edu (Postfix) with ESMTP id 5A1F2291D52; Thu, 22 Mar 2012 11:44:38 -0500 (CDT) Received: from mh8.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh8.mail.rice.edu (Postfix) with ESMTP id 4C26729761F; Thu, 22 Mar 2012 11:44:38 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh8.mail.rice.edu, auth channel Received: from mh8.mail.rice.edu ([127.0.0.1]) by mh8.mail.rice.edu (mh8.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id kxPgSQcOZiHW; Thu, 22 Mar 2012 11:44:38 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh8.mail.rice.edu (Postfix) with ESMTPSA id 70846291C30; Thu, 22 Mar 2012 11:44:37 -0500 (CDT) Message-ID: <4F6B56F3.6030209@rice.edu> Date: Thu, 22 Mar 2012 11:44:35 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Sergey Kandaurov References: <201203220440.q2M4eMSl007771@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233290 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 16:44:45 -0000 On 03/22/2012 03:12, Sergey Kandaurov wrote: > On 22 March 2012 08:40, Alan Cox wrote: >> Author: alc >> Date: Thu Mar 22 04:40:22 2012 >> New Revision: 233290 >> URL: http://svn.freebsd.org/changeset/base/233290 >> >> Log: >> Change pv_entry_count to a long. During the lifetime of FreeBSD 10.x, >> physical memory sizes at the high-end will likely reach a point that >> the number of pv entries could overflow an int. >> >> Submitted by: kib >> >> Modified: >> head/sys/amd64/amd64/pmap.c >> > While there, maybe also do something with these semi-debug-ish > vm.pmap.pc_chunk_(allocs|frees) like change them to [u_]long too, move > under debug or just drop them? While they can be useful for someone, > pc_chunk_(allocs|frees) have also an "int" and quite quickly overflow. > Though e.g. vm.pmap.pv_entry_(allocs|frees) have a long. > Yes, in the next month or two I'm going to be making some changes to the way that pmap_collect() works. I will be eliminating a couple of the counters as part of those changes. I will deal with the rest of the counters at the same time. Alan From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 17:01:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 601F3106566C; Thu, 22 Mar 2012 17:01:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A9178FC0C; Thu, 22 Mar 2012 17:01:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MH1QS3033160; Thu, 22 Mar 2012 17:01:26 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MH1QhL033157; Thu, 22 Mar 2012 17:01:26 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203221701.q2MH1QhL033157@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 22 Mar 2012 17:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233313 - in head: share/man/man4 sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 17:01:26 -0000 Author: jkim Date: Thu Mar 22 17:01:25 2012 New Revision: 233313 URL: http://svn.freebsd.org/changeset/base/233313 Log: Add ACPI_LV_REPAIR debug level, available since ACPICA 20091214 (r200553). MFC after: 3 days Modified: head/share/man/man4/acpi.4 head/sys/dev/acpica/acpi.c Modified: head/share/man/man4/acpi.4 ============================================================================== --- head/share/man/man4/acpi.4 Thu Mar 22 16:24:50 2012 (r233312) +++ head/share/man/man4/acpi.4 Thu Mar 22 17:01:25 2012 (r233313) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2012 +.Dd March 22, 2012 .Dt ACPI 4 .Os .Sh NAME @@ -491,6 +491,8 @@ Initialization progress Stores to objects .It Li ACPI_LV_INFO General information and progress +.It Li ACPI_LV_REPAIR +Repair a common problem with predefined methods .It Li ACPI_LV_ALL_EXCEPTIONS All the previous levels .It Li ACPI_LV_PARSE Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Thu Mar 22 16:24:50 2012 (r233312) +++ head/sys/dev/acpica/acpi.c Thu Mar 22 17:01:25 2012 (r233313) @@ -3540,6 +3540,7 @@ static struct debugtag dbg_level[] = { {"ACPI_LV_INIT", ACPI_LV_INIT}, {"ACPI_LV_DEBUG_OBJECT", ACPI_LV_DEBUG_OBJECT}, {"ACPI_LV_INFO", ACPI_LV_INFO}, + {"ACPI_LV_REPAIR", ACPI_LV_REPAIR}, {"ACPI_LV_ALL_EXCEPTIONS", ACPI_LV_ALL_EXCEPTIONS}, /* Trace verbosity level 1 [Standard Trace Level] */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 17:02:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A22F11065673; Thu, 22 Mar 2012 17:02:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82FDC8FC18; Thu, 22 Mar 2012 17:02:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MH26JW033222; Thu, 22 Mar 2012 17:02:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MH260m033220; Thu, 22 Mar 2012 17:02:06 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203221702.q2MH260m033220@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 22 Mar 2012 17:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233314 - stable/8/usr.sbin/usbdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 17:02:06 -0000 Author: hselasky Date: Thu Mar 22 17:02:05 2012 New Revision: 233314 URL: http://svn.freebsd.org/changeset/base/233314 Log: MFC r233037 and r233039: Fix cross-platform issue about the file-format in which usbdump stores data. Modified: stable/8/usr.sbin/usbdump/usbdump.c (contents, props changed) Directory Properties: stable/8/usr.sbin/usbdump/ (props changed) Modified: stable/8/usr.sbin/usbdump/usbdump.c ============================================================================== --- stable/8/usr.sbin/usbdump/usbdump.c Thu Mar 22 17:01:25 2012 (r233313) +++ stable/8/usr.sbin/usbdump/usbdump.c Thu Mar 22 17:02:05 2012 (r233314) @@ -70,9 +70,23 @@ struct usbcap_filehdr { uint8_t reserved[26]; } __packed; +#define HEADER_ALIGN(x,a) (((x) + (a) - 1) & ~((a) - 1)) + +struct header_32 { + /* capture timestamp */ + uint32_t ts_sec; + uint32_t ts_usec; + /* data length and alignment information */ + uint32_t caplen; + uint32_t datalen; + uint8_t hdrlen; + uint8_t align; +} __packed; + static int doexit = 0; static int pkt_captured = 0; static int verbose = 0; +static int uf_minor; static const char *i_arg = "usbus0"; static const char *r_arg = NULL; static const char *w_arg = NULL; @@ -283,7 +297,7 @@ hexdump(const uint8_t *region, uint32_t } static void -print_apacket(const struct bpf_hdr *hdr, const uint8_t *ptr, int ptr_len) +print_apacket(const struct header_32 *hdr, const uint8_t *ptr, int ptr_len) { struct tm *tm; struct usbpf_pkthdr up_temp; @@ -318,8 +332,8 @@ print_apacket(const struct bpf_hdr *hdr, up->up_packet_count = le32toh(up->up_packet_count); up->up_endpoint = le32toh(up->up_endpoint); - tv.tv_sec = hdr->bh_tstamp.tv_sec; - tv.tv_usec = hdr->bh_tstamp.tv_usec; + tv.tv_sec = hdr->ts_sec; + tv.tv_usec = hdr->ts_usec; tm = localtime(&tv.tv_sec); len = strftime(buf, sizeof(buf), "%H:%M:%S", tm); @@ -384,19 +398,73 @@ print_apacket(const struct bpf_hdr *hdr, } static void -print_packets(uint8_t *data, const int datalen) +fix_packets(uint8_t *data, const int datalen) { - const struct bpf_hdr *hdr; + struct header_32 temp; uint8_t *ptr; uint8_t *next; + uint32_t hdrlen; + uint32_t caplen; for (ptr = data; ptr < (data + datalen); ptr = next) { + + const struct bpf_hdr *hdr; + hdr = (const struct bpf_hdr *)ptr; - next = ptr + BPF_WORDALIGN(hdr->bh_hdrlen + hdr->bh_caplen); - if (w_arg == NULL) { - print_apacket(hdr, ptr + - hdr->bh_hdrlen, hdr->bh_caplen); + temp.ts_sec = htole32(hdr->bh_tstamp.tv_sec); + temp.ts_usec = htole32(hdr->bh_tstamp.tv_usec); + temp.caplen = htole32(hdr->bh_caplen); + temp.datalen = htole32(hdr->bh_datalen); + temp.hdrlen = hdr->bh_hdrlen; + temp.align = BPF_WORDALIGN(1); + + hdrlen = hdr->bh_hdrlen; + caplen = hdr->bh_caplen; + + if ((hdrlen >= sizeof(temp)) && (hdrlen <= 255) && + ((ptr + hdrlen) <= (data + datalen))) { + memcpy(ptr, &temp, sizeof(temp)); + memset(ptr + sizeof(temp), 0, hdrlen - sizeof(temp)); + } else { + err(EXIT_FAILURE, "Invalid header length %d", hdrlen); + } + + next = ptr + BPF_WORDALIGN(hdrlen + caplen); + + if (next <= ptr) + err(EXIT_FAILURE, "Invalid length"); + } +} + +static void +print_packets(uint8_t *data, const int datalen) +{ + struct header_32 temp; + uint8_t *ptr; + uint8_t *next; + + for (ptr = data; ptr < (data + datalen); ptr = next) { + + const struct header_32 *hdr32; + + hdr32 = (const struct header_32 *)ptr; + + temp.ts_sec = le32toh(hdr32->ts_sec); + temp.ts_usec = le32toh(hdr32->ts_usec); + temp.caplen = le32toh(hdr32->caplen); + temp.datalen = le32toh(hdr32->datalen); + temp.hdrlen = hdr32->hdrlen; + temp.align = hdr32->align; + + next = ptr + HEADER_ALIGN(temp.hdrlen + temp.caplen, temp.align); + + if (next <= ptr) + err(EXIT_FAILURE, "Invalid length"); + + if (w_arg == NULL || r_arg != NULL) { + print_apacket(&temp, ptr + + temp.hdrlen, temp.caplen); } pkt_captured++; } @@ -437,6 +505,9 @@ read_file(struct usbcap *p) err(EXIT_FAILURE, "Could not read complete " "USB data payload"); } + if (uf_minor == 2) + fix_packets(data, datalen); + print_packets(data, datalen); free(data); } @@ -461,6 +532,9 @@ do_loop(struct usbcap *p) } if (cc == 0) continue; + + fix_packets(p->buffer, cc); + if (w_arg != NULL) write_packets(p, p->buffer, cc); print_packets(p->buffer, cc); @@ -492,7 +566,10 @@ init_rfile(struct usbcap *p) errx(EX_SOFTWARE, "Invalid major version(%d) " "field in USB capture file header.", (int)uf.major); } - if (uf.minor != 2) { + + uf_minor = uf.minor; + + if (uf.minor != 3 && uf.minor != 2) { errx(EX_SOFTWARE, "Invalid minor version(%d) " "field in USB capture file header.", (int)uf.minor); } @@ -507,12 +584,12 @@ init_wfile(struct usbcap *p) p->wfd = open(w_arg, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); if (p->wfd < 0) { err(EXIT_FAILURE, "Could not open " - "'%s' for write", r_arg); + "'%s' for write", w_arg); } memset(&uf, 0, sizeof(uf)); uf.magic = htole32(USBCAP_FILEHDR_MAGIC); uf.major = 0; - uf.minor = 2; + uf.minor = 3; ret = write(p->wfd, (const void *)&uf, sizeof(uf)); if (ret != sizeof(uf)) { err(EXIT_FAILURE, "Could not write " From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 17:04:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7A6F106566C; Thu, 22 Mar 2012 17:04:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C88ED8FC14; Thu, 22 Mar 2012 17:04:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MH4nD7033343; Thu, 22 Mar 2012 17:04:49 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MH4n11033341; Thu, 22 Mar 2012 17:04:49 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203221704.q2MH4n11033341@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 22 Mar 2012 17:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233315 - stable/9/usr.sbin/usbdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 17:04:50 -0000 Author: hselasky Date: Thu Mar 22 17:04:49 2012 New Revision: 233315 URL: http://svn.freebsd.org/changeset/base/233315 Log: MFC r233037 and r233039: Fix cross-platform issue about the file-format in which usbdump stores data. Modified: stable/9/usr.sbin/usbdump/usbdump.c Directory Properties: stable/9/usr.sbin/usbdump/ (props changed) Modified: stable/9/usr.sbin/usbdump/usbdump.c ============================================================================== --- stable/9/usr.sbin/usbdump/usbdump.c Thu Mar 22 17:02:05 2012 (r233314) +++ stable/9/usr.sbin/usbdump/usbdump.c Thu Mar 22 17:04:49 2012 (r233315) @@ -92,9 +92,23 @@ struct usbcap_filehdr { uint8_t reserved[26]; } __packed; +#define HEADER_ALIGN(x,a) (((x) + (a) - 1) & ~((a) - 1)) + +struct header_32 { + /* capture timestamp */ + uint32_t ts_sec; + uint32_t ts_usec; + /* data length and alignment information */ + uint32_t caplen; + uint32_t datalen; + uint8_t hdrlen; + uint8_t align; +} __packed; + static int doexit = 0; static int pkt_captured = 0; static int verbose = 0; +static int uf_minor; static const char *i_arg = "usbus0"; static const char *r_arg = NULL; static const char *w_arg = NULL; @@ -413,7 +427,7 @@ hexdump(const uint8_t *region, uint32_t } static void -print_apacket(const struct bpf_hdr *hdr, const uint8_t *ptr, int ptr_len) +print_apacket(const struct header_32 *hdr, const uint8_t *ptr, int ptr_len) { struct tm *tm; struct usbpf_pkthdr up_temp; @@ -448,8 +462,8 @@ print_apacket(const struct bpf_hdr *hdr, up->up_packet_count = le32toh(up->up_packet_count); up->up_endpoint = le32toh(up->up_endpoint); - tv.tv_sec = hdr->bh_tstamp.tv_sec; - tv.tv_usec = hdr->bh_tstamp.tv_usec; + tv.tv_sec = hdr->ts_sec; + tv.tv_usec = hdr->ts_usec; tm = localtime(&tv.tv_sec); len = strftime(buf, sizeof(buf), "%H:%M:%S", tm); @@ -514,19 +528,73 @@ print_apacket(const struct bpf_hdr *hdr, } static void -print_packets(uint8_t *data, const int datalen) +fix_packets(uint8_t *data, const int datalen) { - const struct bpf_hdr *hdr; + struct header_32 temp; uint8_t *ptr; uint8_t *next; + uint32_t hdrlen; + uint32_t caplen; for (ptr = data; ptr < (data + datalen); ptr = next) { + + const struct bpf_hdr *hdr; + hdr = (const struct bpf_hdr *)ptr; - next = ptr + BPF_WORDALIGN(hdr->bh_hdrlen + hdr->bh_caplen); - if (w_arg == NULL) { - print_apacket(hdr, ptr + - hdr->bh_hdrlen, hdr->bh_caplen); + temp.ts_sec = htole32(hdr->bh_tstamp.tv_sec); + temp.ts_usec = htole32(hdr->bh_tstamp.tv_usec); + temp.caplen = htole32(hdr->bh_caplen); + temp.datalen = htole32(hdr->bh_datalen); + temp.hdrlen = hdr->bh_hdrlen; + temp.align = BPF_WORDALIGN(1); + + hdrlen = hdr->bh_hdrlen; + caplen = hdr->bh_caplen; + + if ((hdrlen >= sizeof(temp)) && (hdrlen <= 255) && + ((ptr + hdrlen) <= (data + datalen))) { + memcpy(ptr, &temp, sizeof(temp)); + memset(ptr + sizeof(temp), 0, hdrlen - sizeof(temp)); + } else { + err(EXIT_FAILURE, "Invalid header length %d", hdrlen); + } + + next = ptr + BPF_WORDALIGN(hdrlen + caplen); + + if (next <= ptr) + err(EXIT_FAILURE, "Invalid length"); + } +} + +static void +print_packets(uint8_t *data, const int datalen) +{ + struct header_32 temp; + uint8_t *ptr; + uint8_t *next; + + for (ptr = data; ptr < (data + datalen); ptr = next) { + + const struct header_32 *hdr32; + + hdr32 = (const struct header_32 *)ptr; + + temp.ts_sec = le32toh(hdr32->ts_sec); + temp.ts_usec = le32toh(hdr32->ts_usec); + temp.caplen = le32toh(hdr32->caplen); + temp.datalen = le32toh(hdr32->datalen); + temp.hdrlen = hdr32->hdrlen; + temp.align = hdr32->align; + + next = ptr + HEADER_ALIGN(temp.hdrlen + temp.caplen, temp.align); + + if (next <= ptr) + err(EXIT_FAILURE, "Invalid length"); + + if (w_arg == NULL || r_arg != NULL) { + print_apacket(&temp, ptr + + temp.hdrlen, temp.caplen); } pkt_captured++; } @@ -567,6 +635,9 @@ read_file(struct usbcap *p) err(EXIT_FAILURE, "Could not read complete " "USB data payload"); } + if (uf_minor == 2) + fix_packets(data, datalen); + print_packets(data, datalen); free(data); } @@ -591,6 +662,9 @@ do_loop(struct usbcap *p) } if (cc == 0) continue; + + fix_packets(p->buffer, cc); + if (w_arg != NULL) write_packets(p, p->buffer, cc); print_packets(p->buffer, cc); @@ -622,7 +696,10 @@ init_rfile(struct usbcap *p) errx(EX_SOFTWARE, "Invalid major version(%d) " "field in USB capture file header.", (int)uf.major); } - if (uf.minor != 2) { + + uf_minor = uf.minor; + + if (uf.minor != 3 && uf.minor != 2) { errx(EX_SOFTWARE, "Invalid minor version(%d) " "field in USB capture file header.", (int)uf.minor); } @@ -637,12 +714,12 @@ init_wfile(struct usbcap *p) p->wfd = open(w_arg, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); if (p->wfd < 0) { err(EXIT_FAILURE, "Could not open " - "'%s' for write", r_arg); + "'%s' for write", w_arg); } memset(&uf, 0, sizeof(uf)); uf.magic = htole32(USBCAP_FILEHDR_MAGIC); uf.major = 0; - uf.minor = 2; + uf.minor = 3; ret = write(p->wfd, (const void *)&uf, sizeof(uf)); if (ret != sizeof(uf)) { err(EXIT_FAILURE, "Could not write " From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 17:36:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC0C210656ED; Thu, 22 Mar 2012 17:36:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C73CF8FC1A; Thu, 22 Mar 2012 17:36:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MHarRe034365; Thu, 22 Mar 2012 17:36:53 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MHart2034363; Thu, 22 Mar 2012 17:36:53 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203221736.q2MHart2034363@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 22 Mar 2012 17:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233316 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 17:36:54 -0000 Author: gonzo Date: Thu Mar 22 17:36:53 2012 New Revision: 233316 URL: http://svn.freebsd.org/changeset/base/233316 Log: Fix PMC syscall on 64-bit big endian systems. Sycall argument is pointer to array of register_t values. Casting it to pointer to structure with fields of size smaller then register_t we rely on compiler-dependent memory layout of structure. Tested on: mips64 and amd64 systems Modified: head/sys/sys/pmc.h Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Thu Mar 22 17:04:49 2012 (r233315) +++ head/sys/sys/pmc.h Thu Mar 22 17:36:53 2012 (r233316) @@ -589,7 +589,7 @@ struct pmc_op_getmsr { */ struct pmc_syscall_args { - uint32_t pmop_code; /* one of PMC_OP_* */ + register_t pmop_code; /* one of PMC_OP_* */ void *pmop_data; /* syscall parameter */ }; From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 17:44:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3B4ED106566B; Thu, 22 Mar 2012 17:44:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2672E8FC15; Thu, 22 Mar 2012 17:44:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MHibF6034666; Thu, 22 Mar 2012 17:44:37 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MHia1i034664; Thu, 22 Mar 2012 17:44:36 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203221744.q2MHia1i034664@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 22 Mar 2012 17:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233317 - head/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 17:44:37 -0000 Author: gonzo Date: Thu Mar 22 17:44:36 2012 New Revision: 233317 URL: http://svn.freebsd.org/changeset/base/233317 Log: Fix base vaddr detection for ELF binaries. PT_LOAD with offset 0 is not mandatory for ELF binaries so we'll use the segment with offset less then alignment and align it appropriately (which covers pt_offset == 0 case) Modified: head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Thu Mar 22 17:36:53 2012 (r233316) +++ head/usr.sbin/pmcstat/pmcstat_log.c Thu Mar 22 17:44:36 2012 (r233317) @@ -697,8 +697,8 @@ pmcstat_image_get_elf_params(struct pmcs ph.p_offset); break; case PT_LOAD: - if (ph.p_offset == 0) - image->pi_vaddr = ph.p_vaddr; + if ((ph.p_offset & (-ph.p_align)) == 0) + image->pi_vaddr = ph.p_vaddr & (-ph.p_align); break; } } From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 17:47:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8710D106564A; Thu, 22 Mar 2012 17:47:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58C238FC24; Thu, 22 Mar 2012 17:47:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MHlraD034822; Thu, 22 Mar 2012 17:47:53 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MHlrKn034819; Thu, 22 Mar 2012 17:47:53 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203221747.q2MHlrKn034819@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 22 Mar 2012 17:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233318 - in head/sys/mips: atheros mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 17:47:53 -0000 Author: gonzo Date: Thu Mar 22 17:47:52 2012 New Revision: 233318 URL: http://svn.freebsd.org/changeset/base/233318 Log: Move PMC hook invocation to cpu_intr. The idea is the same as with ast() call but there is no reason to implement it in assembler. Modified: head/sys/mips/atheros/apb.c head/sys/mips/mips/intr_machdep.c Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Thu Mar 22 17:44:36 2012 (r233317) +++ head/sys/mips/atheros/apb.c Thu Mar 22 17:47:52 2012 (r233318) @@ -348,7 +348,6 @@ apb_filter(void *arg) uint32_t reg, irq; struct thread *td; struct trapframe *tf; - register_t s; reg = ATH_READ_REG(AR71XX_MISC_INTR_STATUS); for (irq = 0; irq < APB_NIRQS; irq++) { @@ -373,28 +372,12 @@ apb_filter(void *arg) td = PCPU_GET(curthread); tf = td->td_intr_frame; - s = intr_disable(); + if (pmc_intr) + (*pmc_intr)(PCPU_GET(cpuid), tf); + mips_intrcnt_inc(sc->sc_intr_counter[irq]); - if (pmc_intr) { - /* - * Make sure at least one of counters - * generated this interrupt - */ - if (!(*pmc_intr)(PCPU_GET(cpuid), tf)) { - intr_restore(s); - continue; - } - } - - intr_restore(s); - - if (pmc_hook && (td->td_pflags & TDP_CALLCHAIN)) - pmc_hook(PCPU_GET(curthread), - PMC_FN_USER_CALLCHAIN, tf); - continue; - } /* Ignore timer interrupts */ if (irq != 0) Modified: head/sys/mips/mips/intr_machdep.c ============================================================================== --- head/sys/mips/mips/intr_machdep.c Thu Mar 22 17:44:36 2012 (r233317) +++ head/sys/mips/mips/intr_machdep.c Thu Mar 22 17:47:52 2012 (r233318) @@ -29,10 +29,14 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_hwpmc_hooks.h" + #include #include #include #include +#include +#include #include #include @@ -266,4 +270,9 @@ cpu_intr(struct trapframe *tf) KASSERT(i == 0, ("all interrupts handled")); critical_exit(); + +#ifdef HWPMC_HOOKS + if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) + pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, tf); +#endif } From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 18:01:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0C03106564A; Thu, 22 Mar 2012 18:01:23 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 880F78FC17; Thu, 22 Mar 2012 18:01:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MI1NAI035334; Thu, 22 Mar 2012 18:01:23 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MI1Nlk035329; Thu, 22 Mar 2012 18:01:23 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203221801.q2MI1Nlk035329@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 22 Mar 2012 18:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233319 - in head/sys: conf dev/hwpmc mips/atheros mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 18:01:23 -0000 Author: gonzo Date: Thu Mar 22 18:01:23 2012 New Revision: 233319 URL: http://svn.freebsd.org/changeset/base/233319 Log: Rework MIPS PMC code: - Replace MIPS24K-specific code with more generic framework that will make adding new CPU support easier - Add MIPS24K support for new framework - Limit backtrace depth to 1 for stability reasons and add option HWPMC_MIPS_BACKTRACE to override this limitation Deleted: head/sys/dev/hwpmc/hwpmc_mips24k.h Modified: head/sys/conf/files.mips head/sys/conf/options head/sys/dev/hwpmc/hwpmc_mips.c head/sys/dev/hwpmc/hwpmc_mips24k.c head/sys/mips/atheros/files.ar71xx head/sys/mips/include/pmc_mdep.h Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Thu Mar 22 17:47:52 2012 (r233318) +++ head/sys/conf/files.mips Thu Mar 22 18:01:23 2012 (r233319) @@ -107,7 +107,6 @@ dev/siba/siba_pcib.c optional siba pci #mips/sentry5/siba_mips.c optional siba # not yet dev/hwpmc/hwpmc_mips.c optional hwpmc -dev/hwpmc/hwpmc_mips24k.c optional hwpmc dev/rt/if_rt.c optional rt dev/nvram2env/nvram2env.c optional nvram2env Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Mar 22 17:47:52 2012 (r233318) +++ head/sys/conf/options Thu Mar 22 18:01:23 2012 (r233319) @@ -829,6 +829,7 @@ DCONS_FORCE_GDB opt_dcons.h # HWPMC options HWPMC_HOOKS +HWPMC_MIPS_BACKTRACE opt_hwpmc_hooks.h # XBOX options for FreeBSD/i386, but some files are MI XBOX opt_xbox.h Modified: head/sys/dev/hwpmc/hwpmc_mips.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mips.c Thu Mar 22 17:47:52 2012 (r233318) +++ head/sys/dev/hwpmc/hwpmc_mips.c Thu Mar 22 18:01:23 2012 (r233319) @@ -28,8 +28,11 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_hwpmc_hooks.h" + #include #include +#include #include #include @@ -37,6 +40,17 @@ __FBSDID("$FreeBSD$"); #include #include +int mips_npmcs; + +/* + * Per-processor information. + */ +struct mips_cpu { + struct pmc_hw *pc_mipspmcs; +}; + +static struct mips_cpu **mips_pcpu; + #if defined(__mips_n64) # define MIPS_IS_VALID_KERNELADDR(reg) ((((reg) & 3) == 0) && \ ((vm_offset_t)(reg) >= MIPS_XKPHYS_START)) @@ -53,6 +67,413 @@ __FBSDID("$FreeBSD$"); #define MAX_PROLOGUE_SIZE 0x100 static int +mips_allocate_pmc(int cpu, int ri, struct pmc *pm, + const struct pmc_op_pmcallocate *a) +{ + enum pmc_event pe; + uint32_t caps, config, counter; + uint32_t event; + int i; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < mips_npmcs, + ("[mips,%d] illegal row index %d", __LINE__, ri)); + + caps = a->pm_caps; + if (a->pm_class != mips_pmc_spec.ps_cpuclass) + return (EINVAL); + pe = a->pm_ev; + counter = MIPS_CTR_ALL; + event = 0; + for (i = 0; i < mips_event_codes_size; i++) { + if (mips_event_codes[i].pe_ev == pe) { + event = mips_event_codes[i].pe_code; + counter = mips_event_codes[i].pe_counter; + break; + } + } + + if (i == mips_event_codes_size) + return (EINVAL); + + if ((counter != MIPS_CTR_ALL) && (counter != ri)) + return (EINVAL); + + config = mips_get_perfctl(cpu, ri, event, caps); + + pm->pm_md.pm_mips_evsel = config; + + PMCDBG(MDP,ALL,2,"mips-allocate ri=%d -> config=0x%x", ri, config); + + return 0; +} + + +static int +mips_read_pmc(int cpu, int ri, pmc_value_t *v) +{ + struct pmc *pm; + pmc_value_t tmp; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < mips_npmcs, + ("[mips,%d] illegal row index %d", __LINE__, ri)); + + pm = mips_pcpu[cpu]->pc_mipspmcs[ri].phw_pmc; + tmp = mips_pmcn_read(ri); + PMCDBG(MDP,REA,2,"mips-read id=%d -> %jd", ri, tmp); + + if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) + *v = tmp - (1UL << (mips_pmc_spec.ps_counter_width - 1)); + else + *v = tmp; + + return 0; +} + +static int +mips_write_pmc(int cpu, int ri, pmc_value_t v) +{ + struct pmc *pm; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < mips_npmcs, + ("[mips,%d] illegal row-index %d", __LINE__, ri)); + + pm = mips_pcpu[cpu]->pc_mipspmcs[ri].phw_pmc; + + if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) + v = (1UL << (mips_pmc_spec.ps_counter_width - 1)) - v; + + PMCDBG(MDP,WRI,1,"mips-write cpu=%d ri=%d v=%jx", cpu, ri, v); + + mips_pmcn_write(ri, v); + + return 0; +} + +static int +mips_config_pmc(int cpu, int ri, struct pmc *pm) +{ + struct pmc_hw *phw; + + PMCDBG(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < mips_npmcs, + ("[mips,%d] illegal row-index %d", __LINE__, ri)); + + phw = &mips_pcpu[cpu]->pc_mipspmcs[ri]; + + KASSERT(pm == NULL || phw->phw_pmc == NULL, + ("[mips,%d] pm=%p phw->pm=%p hwpmc not unconfigured", + __LINE__, pm, phw->phw_pmc)); + + phw->phw_pmc = pm; + + return 0; +} + +static int +mips_start_pmc(int cpu, int ri) +{ + uint32_t config; + struct pmc *pm; + struct pmc_hw *phw; + + phw = &mips_pcpu[cpu]->pc_mipspmcs[ri]; + pm = phw->phw_pmc; + config = pm->pm_md.pm_mips_evsel; + + /* Enable the PMC. */ + switch (ri) { + case 0: + mips_wr_perfcnt0(config); + break; + case 1: + mips_wr_perfcnt2(config); + break; + default: + break; + } + + return 0; +} + +static int +mips_stop_pmc(int cpu, int ri) +{ + struct pmc *pm; + struct pmc_hw *phw; + + phw = &mips_pcpu[cpu]->pc_mipspmcs[ri]; + pm = phw->phw_pmc; + + /* + * Disable the PMCs. + * + * Clearing the entire register turns the counter off as well + * as removes the previously sampled event. + */ + switch (ri) { + case 0: + mips_wr_perfcnt0(0); + break; + case 1: + mips_wr_perfcnt2(0); + break; + default: + break; + } + return 0; +} + +static int +mips_release_pmc(int cpu, int ri, struct pmc *pmc) +{ + struct pmc_hw *phw; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < mips_npmcs, + ("[mips,%d] illegal row-index %d", __LINE__, ri)); + + phw = &mips_pcpu[cpu]->pc_mipspmcs[ri]; + KASSERT(phw->phw_pmc == NULL, + ("[mips,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc)); + + return 0; +} + +static int +mips_pmc_intr(int cpu, struct trapframe *tf) +{ + int error; + int retval, ri; + struct pmc *pm; + struct mips_cpu *pc; + uint32_t r0, r2; + pmc_value_t r; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[mips,%d] CPU %d out of range", __LINE__, cpu)); + + retval = 0; + pc = mips_pcpu[cpu]; + + /* Stop PMCs without clearing the counter */ + r0 = mips_rd_perfcnt0(); + mips_wr_perfcnt0(r0 & ~(0x1f)); + r2 = mips_rd_perfcnt2(); + mips_wr_perfcnt2(r2 & ~(0x1f)); + + for (ri = 0; ri < mips_npmcs; ri++) { + pm = mips_pcpu[cpu]->pc_mipspmcs[ri].phw_pmc; + if (pm == NULL) + continue; + if (! PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) + continue; + + r = mips_pmcn_read(ri); + + /* If bit 31 is set, the counter has overflowed */ + if ((r & (1UL << (mips_pmc_spec.ps_counter_width - 1))) == 0) + continue; + + retval = 1; + if (pm->pm_state != PMC_STATE_RUNNING) + continue; + error = pmc_process_interrupt(cpu, pm, tf, + TRAPF_USERMODE(tf)); + if (error) { + /* Clear/disable the relevant counter */ + if (ri == 0) + r0 = 0; + else if (ri == 1) + r2 = 0; + mips_stop_pmc(cpu, ri); + } + + /* Reload sampling count */ + mips_write_pmc(cpu, ri, pm->pm_sc.pm_reloadcount); + } + + /* + * Re-enable the PMC counters where they left off. + * + * Any counter which overflowed will have its sample count + * reloaded in the loop above. + */ + mips_wr_perfcnt0(r0); + mips_wr_perfcnt2(r2); + + return retval; +} + +static int +mips_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) +{ + int error; + struct pmc_hw *phw; + char mips_name[PMC_NAME_MAX]; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[mips,%d], illegal CPU %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < mips_npmcs, + ("[mips,%d] row-index %d out of range", __LINE__, ri)); + + phw = &mips_pcpu[cpu]->pc_mipspmcs[ri]; + snprintf(mips_name, sizeof(mips_name), "MIPS-%d", ri); + if ((error = copystr(mips_name, pi->pm_name, PMC_NAME_MAX, + NULL)) != 0) + return error; + pi->pm_class = mips_pmc_spec.ps_cpuclass; + if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { + pi->pm_enabled = TRUE; + *ppmc = phw->phw_pmc; + } else { + pi->pm_enabled = FALSE; + *ppmc = NULL; + } + + return (0); +} + +static int +mips_get_config(int cpu, int ri, struct pmc **ppm) +{ + *ppm = mips_pcpu[cpu]->pc_mipspmcs[ri].phw_pmc; + + return 0; +} + +/* + * XXX don't know what we should do here. + */ +static int +mips_pmc_switch_in(struct pmc_cpu *pc, struct pmc_process *pp) +{ + return 0; +} + +static int +mips_pmc_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) +{ + return 0; +} + +static int +mips_pcpu_init(struct pmc_mdep *md, int cpu) +{ + int first_ri, i; + struct pmc_cpu *pc; + struct mips_cpu *pac; + struct pmc_hw *phw; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[mips,%d] wrong cpu number %d", __LINE__, cpu)); + PMCDBG(MDP,INI,1,"mips-init cpu=%d", cpu); + + mips_pcpu[cpu] = pac = malloc(sizeof(struct mips_cpu), M_PMC, + M_WAITOK|M_ZERO); + pac->pc_mipspmcs = malloc(sizeof(struct pmc_hw) * mips_npmcs, + M_PMC, M_WAITOK|M_ZERO); + pc = pmc_pcpu[cpu]; + first_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_MIPS].pcd_ri; + KASSERT(pc != NULL, ("[mips,%d] NULL per-cpu pointer", __LINE__)); + + for (i = 0, phw = pac->pc_mipspmcs; i < mips_npmcs; i++, phw++) { + phw->phw_state = PMC_PHW_FLAG_IS_ENABLED | + PMC_PHW_CPU_TO_STATE(cpu) | PMC_PHW_INDEX_TO_STATE(i); + phw->phw_pmc = NULL; + pc->pc_hwpmcs[i + first_ri] = phw; + } + + /* + * Clear the counter control register which has the effect + * of disabling counting. + */ + for (i = 0; i < mips_npmcs; i++) + mips_pmcn_write(i, 0); + + return 0; +} + +static int +mips_pcpu_fini(struct pmc_mdep *md, int cpu) +{ + return 0; +} + +struct pmc_mdep * +pmc_mips_initialize() +{ + struct pmc_mdep *pmc_mdep; + struct pmc_classdep *pcd; + + /* + * TODO: Use More bit of PerfCntlX register to detect actual + * number of counters + */ + mips_npmcs = 2; + + PMCDBG(MDP,INI,1,"mips-init npmcs=%d", mips_npmcs); + + /* + * Allocate space for pointers to PMC HW descriptors and for + * the MDEP structure used by MI code. + */ + mips_pcpu = malloc(sizeof(struct mips_cpu *) * pmc_cpu_max(), M_PMC, + M_WAITOK|M_ZERO); + + /* Just one class */ + pmc_mdep = malloc(sizeof(struct pmc_mdep) + sizeof(struct pmc_classdep), + M_PMC, M_WAITOK|M_ZERO); + + pmc_mdep->pmd_cputype = mips_pmc_spec.ps_cputype; + pmc_mdep->pmd_nclass = 1; + + pcd = &pmc_mdep->pmd_classdep[PMC_MDEP_CLASS_INDEX_MIPS]; + pcd->pcd_caps = mips_pmc_spec.ps_capabilities; + pcd->pcd_class = mips_pmc_spec.ps_cpuclass; + pcd->pcd_num = mips_npmcs; + pcd->pcd_ri = pmc_mdep->pmd_npmc; + pcd->pcd_width = mips_pmc_spec.ps_counter_width; + + pcd->pcd_allocate_pmc = mips_allocate_pmc; + pcd->pcd_config_pmc = mips_config_pmc; + pcd->pcd_pcpu_fini = mips_pcpu_fini; + pcd->pcd_pcpu_init = mips_pcpu_init; + pcd->pcd_describe = mips_describe; + pcd->pcd_get_config = mips_get_config; + pcd->pcd_read_pmc = mips_read_pmc; + pcd->pcd_release_pmc = mips_release_pmc; + pcd->pcd_start_pmc = mips_start_pmc; + pcd->pcd_stop_pmc = mips_stop_pmc; + pcd->pcd_write_pmc = mips_write_pmc; + + pmc_mdep->pmd_intr = mips_pmc_intr; + pmc_mdep->pmd_switch_in = mips_pmc_switch_in; + pmc_mdep->pmd_switch_out = mips_pmc_switch_out; + + pmc_mdep->pmd_npmc += mips_npmcs; + + return (pmc_mdep); +} + +void +pmc_mips_finalize(struct pmc_mdep *md) +{ + (void) md; +} + +#ifdef HWPMC_MIPS_BACKTRACE + +static int pmc_next_frame(register_t *pc, register_t *sp) { InstFmt i; @@ -310,23 +731,18 @@ pmc_next_uframe(register_t *pc, register return (0); } +#endif /* HWPMC_MIPS_BACKTRACE */ + struct pmc_mdep * pmc_md_initialize() { - /* if (cpu_class == CPU_CLASS_MIPS24K)*/ - return pmc_mips24k_initialize(); - /* else - return NULL;*/ + return pmc_mips_initialize(); } void pmc_md_finalize(struct pmc_mdep *md) { - /* if (cpu_class == CPU_CLASS_MIPS24K) */ - pmc_mips24k_finalize(md); - /* else - KASSERT(0, ("[mips,%d] Unknown CPU Class 0x%x", __LINE__, - cpu_class));*/ + return pmc_mips_finalize(md); } int @@ -340,17 +756,22 @@ pmc_save_kernel_callchain(uintptr_t *cc, sp = tf->sp; ra = tf->ra; + cc[frames++] = pc; + +#ifdef HWPMC_MIPS_BACKTRACE /* * Unwind, and unwind, and unwind */ while (1) { - cc[frames++] = pc; if (frames >= nframes) break; if (pmc_next_frame(&pc, &sp) < 0) break; + + cc[frames++] = pc; } +#endif return (frames); } @@ -366,17 +787,23 @@ pmc_save_user_callchain(uintptr_t *cc, i sp = tf->sp; ra = tf->ra; + cc[frames++] = pc; + +#ifdef HWPMC_MIPS_BACKTRACE + /* * Unwind, and unwind, and unwind */ while (1) { - cc[frames++] = pc; if (frames >= nframes) break; if (pmc_next_uframe(&pc, &sp, &ra) < 0) break; + + cc[frames++] = pc; } +#endif return (frames); } Modified: head/sys/dev/hwpmc/hwpmc_mips24k.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mips24k.c Thu Mar 22 17:47:52 2012 (r233318) +++ head/sys/dev/hwpmc/hwpmc_mips24k.c Thu Mar 22 18:01:23 2012 (r233319) @@ -37,147 +37,137 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * Support for MIPS CPUs - * - */ -static int mips24k_npmcs; - -struct mips24k_event_code_map { - enum pmc_event pe_ev; /* enum value */ - uint8_t pe_counter; /* Which counter this can be counted in. */ - uint8_t pe_code; /* numeric code */ -}; - -/* - * MIPS event codes are encoded with a select bit. The - * select bit is used when writing to CP0 so that we - * can select either counter 0/2 or 1/3. The cycle - * and instruction counters are special in that they - * can be counted on either 0/2 or 1/3. - */ - -#define MIPS24K_ALL 255 /* Count events in any counter. */ -#define MIPS24K_CTR_0 0 /* Counter 0 Event */ -#define MIPS24K_CTR_1 1 /* Counter 1 Event */ - -const struct mips24k_event_code_map mips24k_event_codes[] = { - { PMC_EV_MIPS24K_CYCLE, MIPS24K_ALL, 0}, - { PMC_EV_MIPS24K_INSTR_EXECUTED, MIPS24K_ALL, 1}, - { PMC_EV_MIPS24K_BRANCH_COMPLETED, MIPS24K_CTR_0, 2}, - { PMC_EV_MIPS24K_BRANCH_MISPRED, MIPS24K_CTR_1, 2}, - { PMC_EV_MIPS24K_RETURN, MIPS24K_CTR_0, 3}, - { PMC_EV_MIPS24K_RETURN_MISPRED, MIPS24K_CTR_1, 3}, - { PMC_EV_MIPS24K_RETURN_NOT_31, MIPS24K_CTR_0, 4}, - { PMC_EV_MIPS24K_RETURN_NOTPRED, MIPS24K_CTR_1, 4}, - { PMC_EV_MIPS24K_ITLB_ACCESS, MIPS24K_CTR_0, 5}, - { PMC_EV_MIPS24K_ITLB_MISS, MIPS24K_CTR_1, 5}, - { PMC_EV_MIPS24K_DTLB_ACCESS, MIPS24K_CTR_0, 6}, - { PMC_EV_MIPS24K_DTLB_MISS, MIPS24K_CTR_1, 6}, - { PMC_EV_MIPS24K_JTLB_IACCESS, MIPS24K_CTR_0, 7}, - { PMC_EV_MIPS24K_JTLB_IMISS, MIPS24K_CTR_1, 7}, - { PMC_EV_MIPS24K_JTLB_DACCESS, MIPS24K_CTR_0, 8}, - { PMC_EV_MIPS24K_JTLB_DMISS, MIPS24K_CTR_1, 8}, - { PMC_EV_MIPS24K_IC_FETCH, MIPS24K_CTR_0, 9}, - { PMC_EV_MIPS24K_IC_MISS, MIPS24K_CTR_1, 9}, - { PMC_EV_MIPS24K_DC_LOADSTORE, MIPS24K_CTR_0, 10}, - { PMC_EV_MIPS24K_DC_WRITEBACK, MIPS24K_CTR_1, 10}, - { PMC_EV_MIPS24K_DC_MISS, MIPS24K_ALL, 11}, +#define MIPS24K_PMC_CAPS (PMC_CAP_INTERRUPT | PMC_CAP_USER | \ + PMC_CAP_SYSTEM | PMC_CAP_EDGE | \ + PMC_CAP_THRESHOLD | PMC_CAP_READ | \ + PMC_CAP_WRITE | PMC_CAP_INVERT | \ + PMC_CAP_QUALIFIER) + +#define MIPS24K_PMC_INTERRUPT_ENABLE 0x10 /* Enable interrupts */ +#define MIPS24K_PMC_USER_ENABLE 0x08 /* Count in USER mode */ +#define MIPS24K_PMC_SUPER_ENABLE 0x04 /* Count in SUPERVISOR mode */ +#define MIPS24K_PMC_KERNEL_ENABLE 0x02 /* Count in KERNEL mode */ +#define MIPS24K_PMC_ENABLE (MIPS24K_PMC_USER_ENABLE | \ + MIPS24K_PMC_SUPER_ENABLE | \ + MIPS24K_PMC_KERNEL_ENABLE) + +#define MIPS24K_PMC_SELECT 5 /* Which bit position the event starts at. */ + +const struct mips_event_code_map mips_event_codes[] = { + { PMC_EV_MIPS24K_CYCLE, MIPS_CTR_ALL, 0}, + { PMC_EV_MIPS24K_INSTR_EXECUTED, MIPS_CTR_ALL, 1}, + { PMC_EV_MIPS24K_BRANCH_COMPLETED, MIPS_CTR_0, 2}, + { PMC_EV_MIPS24K_BRANCH_MISPRED, MIPS_CTR_1, 2}, + { PMC_EV_MIPS24K_RETURN, MIPS_CTR_0, 3}, + { PMC_EV_MIPS24K_RETURN_MISPRED, MIPS_CTR_1, 3}, + { PMC_EV_MIPS24K_RETURN_NOT_31, MIPS_CTR_0, 4}, + { PMC_EV_MIPS24K_RETURN_NOTPRED, MIPS_CTR_1, 4}, + { PMC_EV_MIPS24K_ITLB_ACCESS, MIPS_CTR_0, 5}, + { PMC_EV_MIPS24K_ITLB_MISS, MIPS_CTR_1, 5}, + { PMC_EV_MIPS24K_DTLB_ACCESS, MIPS_CTR_0, 6}, + { PMC_EV_MIPS24K_DTLB_MISS, MIPS_CTR_1, 6}, + { PMC_EV_MIPS24K_JTLB_IACCESS, MIPS_CTR_0, 7}, + { PMC_EV_MIPS24K_JTLB_IMISS, MIPS_CTR_1, 7}, + { PMC_EV_MIPS24K_JTLB_DACCESS, MIPS_CTR_0, 8}, + { PMC_EV_MIPS24K_JTLB_DMISS, MIPS_CTR_1, 8}, + { PMC_EV_MIPS24K_IC_FETCH, MIPS_CTR_0, 9}, + { PMC_EV_MIPS24K_IC_MISS, MIPS_CTR_1, 9}, + { PMC_EV_MIPS24K_DC_LOADSTORE, MIPS_CTR_0, 10}, + { PMC_EV_MIPS24K_DC_WRITEBACK, MIPS_CTR_1, 10}, + { PMC_EV_MIPS24K_DC_MISS, MIPS_CTR_ALL, 11}, /* 12 reserved */ - { PMC_EV_MIPS24K_STORE_MISS, MIPS24K_CTR_0, 13}, - { PMC_EV_MIPS24K_LOAD_MISS, MIPS24K_CTR_1, 13}, - { PMC_EV_MIPS24K_INTEGER_COMPLETED, MIPS24K_CTR_0, 14}, - { PMC_EV_MIPS24K_FP_COMPLETED, MIPS24K_CTR_1, 14}, - { PMC_EV_MIPS24K_LOAD_COMPLETED, MIPS24K_CTR_0, 15}, - { PMC_EV_MIPS24K_STORE_COMPLETED, MIPS24K_CTR_1, 15}, - { PMC_EV_MIPS24K_BARRIER_COMPLETED, MIPS24K_CTR_0, 16}, - { PMC_EV_MIPS24K_MIPS16_COMPLETED, MIPS24K_CTR_1, 16}, - { PMC_EV_MIPS24K_NOP_COMPLETED, MIPS24K_CTR_0, 17}, - { PMC_EV_MIPS24K_INTEGER_MULDIV_COMPLETED, MIPS24K_CTR_1, 17}, - { PMC_EV_MIPS24K_RF_STALL, MIPS24K_CTR_0, 18}, - { PMC_EV_MIPS24K_INSTR_REFETCH, MIPS24K_CTR_1, 18}, - { PMC_EV_MIPS24K_STORE_COND_COMPLETED, MIPS24K_CTR_0, 19}, - { PMC_EV_MIPS24K_STORE_COND_FAILED, MIPS24K_CTR_1, 19}, - { PMC_EV_MIPS24K_ICACHE_REQUESTS, MIPS24K_CTR_0, 20}, - { PMC_EV_MIPS24K_ICACHE_HIT, MIPS24K_CTR_1, 20}, - { PMC_EV_MIPS24K_L2_WRITEBACK, MIPS24K_CTR_0, 21}, - { PMC_EV_MIPS24K_L2_ACCESS, MIPS24K_CTR_1, 21}, - { PMC_EV_MIPS24K_L2_MISS, MIPS24K_CTR_0, 22}, - { PMC_EV_MIPS24K_L2_ERR_CORRECTED, MIPS24K_CTR_1, 22}, - { PMC_EV_MIPS24K_EXCEPTIONS, MIPS24K_CTR_0, 23}, + { PMC_EV_MIPS24K_STORE_MISS, MIPS_CTR_0, 13}, + { PMC_EV_MIPS24K_LOAD_MISS, MIPS_CTR_1, 13}, + { PMC_EV_MIPS24K_INTEGER_COMPLETED, MIPS_CTR_0, 14}, + { PMC_EV_MIPS24K_FP_COMPLETED, MIPS_CTR_1, 14}, + { PMC_EV_MIPS24K_LOAD_COMPLETED, MIPS_CTR_0, 15}, + { PMC_EV_MIPS24K_STORE_COMPLETED, MIPS_CTR_1, 15}, + { PMC_EV_MIPS24K_BARRIER_COMPLETED, MIPS_CTR_0, 16}, + { PMC_EV_MIPS24K_MIPS16_COMPLETED, MIPS_CTR_1, 16}, + { PMC_EV_MIPS24K_NOP_COMPLETED, MIPS_CTR_0, 17}, + { PMC_EV_MIPS24K_INTEGER_MULDIV_COMPLETED, MIPS_CTR_1, 17}, + { PMC_EV_MIPS24K_RF_STALL, MIPS_CTR_0, 18}, + { PMC_EV_MIPS24K_INSTR_REFETCH, MIPS_CTR_1, 18}, + { PMC_EV_MIPS24K_STORE_COND_COMPLETED, MIPS_CTR_0, 19}, + { PMC_EV_MIPS24K_STORE_COND_FAILED, MIPS_CTR_1, 19}, + { PMC_EV_MIPS24K_ICACHE_REQUESTS, MIPS_CTR_0, 20}, + { PMC_EV_MIPS24K_ICACHE_HIT, MIPS_CTR_1, 20}, + { PMC_EV_MIPS24K_L2_WRITEBACK, MIPS_CTR_0, 21}, + { PMC_EV_MIPS24K_L2_ACCESS, MIPS_CTR_1, 21}, + { PMC_EV_MIPS24K_L2_MISS, MIPS_CTR_0, 22}, + { PMC_EV_MIPS24K_L2_ERR_CORRECTED, MIPS_CTR_1, 22}, + { PMC_EV_MIPS24K_EXCEPTIONS, MIPS_CTR_0, 23}, /* Event 23 on COP0 1/3 is undefined */ - { PMC_EV_MIPS24K_RF_CYCLES_STALLED, MIPS24K_CTR_0, 24}, - { PMC_EV_MIPS24K_IFU_CYCLES_STALLED, MIPS24K_CTR_0, 25}, - { PMC_EV_MIPS24K_ALU_CYCLES_STALLED, MIPS24K_CTR_1, 25}, + { PMC_EV_MIPS24K_RF_CYCLES_STALLED, MIPS_CTR_0, 24}, + { PMC_EV_MIPS24K_IFU_CYCLES_STALLED, MIPS_CTR_0, 25}, + { PMC_EV_MIPS24K_ALU_CYCLES_STALLED, MIPS_CTR_1, 25}, /* Events 26 through 32 undefined or reserved to customers */ - { PMC_EV_MIPS24K_UNCACHED_LOAD, MIPS24K_CTR_0, 33}, - { PMC_EV_MIPS24K_UNCACHED_STORE, MIPS24K_CTR_1, 33}, - { PMC_EV_MIPS24K_CP2_REG_TO_REG_COMPLETED, MIPS24K_CTR_0, 35}, - { PMC_EV_MIPS24K_MFTC_COMPLETED, MIPS24K_CTR_1, 35}, + { PMC_EV_MIPS24K_UNCACHED_LOAD, MIPS_CTR_0, 33}, + { PMC_EV_MIPS24K_UNCACHED_STORE, MIPS_CTR_1, 33}, + { PMC_EV_MIPS24K_CP2_REG_TO_REG_COMPLETED, MIPS_CTR_0, 35}, + { PMC_EV_MIPS24K_MFTC_COMPLETED, MIPS_CTR_1, 35}, /* Event 36 reserved */ - { PMC_EV_MIPS24K_IC_BLOCKED_CYCLES, MIPS24K_CTR_0, 37}, - { PMC_EV_MIPS24K_DC_BLOCKED_CYCLES, MIPS24K_CTR_1, 37}, - { PMC_EV_MIPS24K_L2_IMISS_STALL_CYCLES, MIPS24K_CTR_0, 38}, - { PMC_EV_MIPS24K_L2_DMISS_STALL_CYCLES, MIPS24K_CTR_1, 38}, - { PMC_EV_MIPS24K_DMISS_CYCLES, MIPS24K_CTR_0, 39}, - { PMC_EV_MIPS24K_L2_MISS_CYCLES, MIPS24K_CTR_1, 39}, - { PMC_EV_MIPS24K_UNCACHED_BLOCK_CYCLES, MIPS24K_CTR_0, 40}, - { PMC_EV_MIPS24K_MDU_STALL_CYCLES, MIPS24K_CTR_0, 41}, - { PMC_EV_MIPS24K_FPU_STALL_CYCLES, MIPS24K_CTR_1, 41}, - { PMC_EV_MIPS24K_CP2_STALL_CYCLES, MIPS24K_CTR_0, 42}, - { PMC_EV_MIPS24K_COREXTEND_STALL_CYCLES, MIPS24K_CTR_1, 42}, - { PMC_EV_MIPS24K_ISPRAM_STALL_CYCLES, MIPS24K_CTR_0, 43}, - { PMC_EV_MIPS24K_DSPRAM_STALL_CYCLES, MIPS24K_CTR_1, 43}, - { PMC_EV_MIPS24K_CACHE_STALL_CYCLES, MIPS24K_CTR_0, 44}, + { PMC_EV_MIPS24K_IC_BLOCKED_CYCLES, MIPS_CTR_0, 37}, + { PMC_EV_MIPS24K_DC_BLOCKED_CYCLES, MIPS_CTR_1, 37}, + { PMC_EV_MIPS24K_L2_IMISS_STALL_CYCLES, MIPS_CTR_0, 38}, + { PMC_EV_MIPS24K_L2_DMISS_STALL_CYCLES, MIPS_CTR_1, 38}, + { PMC_EV_MIPS24K_DMISS_CYCLES, MIPS_CTR_0, 39}, + { PMC_EV_MIPS24K_L2_MISS_CYCLES, MIPS_CTR_1, 39}, + { PMC_EV_MIPS24K_UNCACHED_BLOCK_CYCLES, MIPS_CTR_0, 40}, + { PMC_EV_MIPS24K_MDU_STALL_CYCLES, MIPS_CTR_0, 41}, + { PMC_EV_MIPS24K_FPU_STALL_CYCLES, MIPS_CTR_1, 41}, + { PMC_EV_MIPS24K_CP2_STALL_CYCLES, MIPS_CTR_0, 42}, + { PMC_EV_MIPS24K_COREXTEND_STALL_CYCLES, MIPS_CTR_1, 42}, + { PMC_EV_MIPS24K_ISPRAM_STALL_CYCLES, MIPS_CTR_0, 43}, + { PMC_EV_MIPS24K_DSPRAM_STALL_CYCLES, MIPS_CTR_1, 43}, + { PMC_EV_MIPS24K_CACHE_STALL_CYCLES, MIPS_CTR_0, 44}, /* Event 44 undefined on 1/3 */ - { PMC_EV_MIPS24K_LOAD_TO_USE_STALLS, MIPS24K_CTR_0, 45}, - { PMC_EV_MIPS24K_BASE_MISPRED_STALLS, MIPS24K_CTR_1, 45}, - { PMC_EV_MIPS24K_CPO_READ_STALLS, MIPS24K_CTR_0, 46}, - { PMC_EV_MIPS24K_BRANCH_MISPRED_CYCLES, MIPS24K_CTR_1, 46}, + { PMC_EV_MIPS24K_LOAD_TO_USE_STALLS, MIPS_CTR_0, 45}, + { PMC_EV_MIPS24K_BASE_MISPRED_STALLS, MIPS_CTR_1, 45}, + { PMC_EV_MIPS24K_CPO_READ_STALLS, MIPS_CTR_0, 46}, + { PMC_EV_MIPS24K_BRANCH_MISPRED_CYCLES, MIPS_CTR_1, 46}, /* Event 47 reserved */ - { PMC_EV_MIPS24K_IFETCH_BUFFER_FULL, MIPS24K_CTR_0, 48}, - { PMC_EV_MIPS24K_FETCH_BUFFER_ALLOCATED, MIPS24K_CTR_1, 48}, - { PMC_EV_MIPS24K_EJTAG_ITRIGGER, MIPS24K_CTR_0, 49}, - { PMC_EV_MIPS24K_EJTAG_DTRIGGER, MIPS24K_CTR_1, 49}, - { PMC_EV_MIPS24K_FSB_LT_QUARTER, MIPS24K_CTR_0, 50}, - { PMC_EV_MIPS24K_FSB_QUARTER_TO_HALF, MIPS24K_CTR_1, 50}, - { PMC_EV_MIPS24K_FSB_GT_HALF, MIPS24K_CTR_0, 51}, - { PMC_EV_MIPS24K_FSB_FULL_PIPELINE_STALLS, MIPS24K_CTR_1, 51}, - { PMC_EV_MIPS24K_LDQ_LT_QUARTER, MIPS24K_CTR_0, 52}, - { PMC_EV_MIPS24K_LDQ_QUARTER_TO_HALF, MIPS24K_CTR_1, 52}, - { PMC_EV_MIPS24K_LDQ_GT_HALF, MIPS24K_CTR_0, 53}, - { PMC_EV_MIPS24K_LDQ_FULL_PIPELINE_STALLS, MIPS24K_CTR_1, 53}, - { PMC_EV_MIPS24K_WBB_LT_QUARTER, MIPS24K_CTR_0, 54}, - { PMC_EV_MIPS24K_WBB_QUARTER_TO_HALF, MIPS24K_CTR_1, 54}, - { PMC_EV_MIPS24K_WBB_GT_HALF, MIPS24K_CTR_0, 55}, - { PMC_EV_MIPS24K_WBB_FULL_PIPELINE_STALLS, MIPS24K_CTR_1, 55}, + { PMC_EV_MIPS24K_IFETCH_BUFFER_FULL, MIPS_CTR_0, 48}, + { PMC_EV_MIPS24K_FETCH_BUFFER_ALLOCATED, MIPS_CTR_1, 48}, + { PMC_EV_MIPS24K_EJTAG_ITRIGGER, MIPS_CTR_0, 49}, + { PMC_EV_MIPS24K_EJTAG_DTRIGGER, MIPS_CTR_1, 49}, + { PMC_EV_MIPS24K_FSB_LT_QUARTER, MIPS_CTR_0, 50}, + { PMC_EV_MIPS24K_FSB_QUARTER_TO_HALF, MIPS_CTR_1, 50}, + { PMC_EV_MIPS24K_FSB_GT_HALF, MIPS_CTR_0, 51}, + { PMC_EV_MIPS24K_FSB_FULL_PIPELINE_STALLS, MIPS_CTR_1, 51}, + { PMC_EV_MIPS24K_LDQ_LT_QUARTER, MIPS_CTR_0, 52}, + { PMC_EV_MIPS24K_LDQ_QUARTER_TO_HALF, MIPS_CTR_1, 52}, + { PMC_EV_MIPS24K_LDQ_GT_HALF, MIPS_CTR_0, 53}, + { PMC_EV_MIPS24K_LDQ_FULL_PIPELINE_STALLS, MIPS_CTR_1, 53}, + { PMC_EV_MIPS24K_WBB_LT_QUARTER, MIPS_CTR_0, 54}, + { PMC_EV_MIPS24K_WBB_QUARTER_TO_HALF, MIPS_CTR_1, 54}, + { PMC_EV_MIPS24K_WBB_GT_HALF, MIPS_CTR_0, 55}, + { PMC_EV_MIPS24K_WBB_FULL_PIPELINE_STALLS, MIPS_CTR_1, 55}, /* Events 56-63 reserved */ - { PMC_EV_MIPS24K_REQUEST_LATENCY, MIPS24K_CTR_0, 61}, - { PMC_EV_MIPS24K_REQUEST_COUNT, MIPS24K_CTR_1, 61} + { PMC_EV_MIPS24K_REQUEST_LATENCY, MIPS_CTR_0, 61}, + { PMC_EV_MIPS24K_REQUEST_COUNT, MIPS_CTR_1, 61} }; -const int mips24k_event_codes_size = - sizeof(mips24k_event_codes) / sizeof(mips24k_event_codes[0]); +const int mips_event_codes_size = + sizeof(mips_event_codes) / sizeof(mips_event_codes[0]); -/* - * Per-processor information. - */ -struct mips24k_cpu { - struct pmc_hw *pc_mipspmcs; +struct mips_pmc_spec mips_pmc_spec = { + .ps_cpuclass = PMC_CLASS_MIPS24K, + .ps_cputype = PMC_CPU_MIPS_24K, + .ps_capabilities = MIPS24K_PMC_CAPS, + .ps_counter_width = 32 }; -static struct mips24k_cpu **mips24k_pcpu; - /* * Performance Count Register N */ -static uint32_t -mips24k_pmcn_read(unsigned int pmc) +uint64_t +mips_pmcn_read(unsigned int pmc) { uint32_t reg = 0; - KASSERT(pmc < mips24k_npmcs, ("[mips,%d] illegal PMC number %d", + KASSERT(pmc < mips_npmcs, ("[mips24k,%d] illegal PMC number %d", __LINE__, pmc)); /* The counter value is the next value after the control register. */ @@ -194,13 +184,13 @@ mips24k_pmcn_read(unsigned int pmc) return (reg); } -static uint32_t -mips24k_pmcn_write(unsigned int pmc, uint32_t reg) +uint64_t +mips_pmcn_write(unsigned int pmc, uint64_t reg) { - KASSERT(pmc < mips24k_npmcs, ("[mips,%d] illegal PMC number %d", + KASSERT(pmc < mips_npmcs, ("[mips24k,%d] illegal PMC number %d", __LINE__, pmc)); - + switch (pmc) { case 0: mips_wr_perfcnt1(reg); @@ -214,40 +204,17 @@ mips24k_pmcn_write(unsigned int pmc, uin return (reg); } -static int -mips24k_allocate_pmc(int cpu, int ri, struct pmc *pm, - const struct pmc_op_pmcallocate *a) +uint32_t +mips_get_perfctl(int cpu, int ri, uint32_t event, uint32_t caps) { - enum pmc_event pe; - uint32_t caps, config, counter; - int i; - - KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), - ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); - KASSERT(ri >= 0 && ri < mips24k_npmcs, - ("[mips,%d] illegal row index %d", __LINE__, ri)); - - caps = a->pm_caps; - if (a->pm_class != PMC_CLASS_MIPS24K) - return (EINVAL); - pe = a->pm_ev; - for (i = 0; i < mips24k_event_codes_size; i++) { - if (mips24k_event_codes[i].pe_ev == pe) { - config = mips24k_event_codes[i].pe_code; - counter = mips24k_event_codes[i].pe_counter; - break; - } - } - if (i == mips24k_event_codes_size) - return (EINVAL); + uint32_t config; - if ((counter != MIPS24K_ALL) && (counter != ri)) - return (EINVAL); + config = event; config <<= MIPS24K_PMC_SELECT; if (caps & PMC_CAP_SYSTEM) - config |= (MIPS24K_PMC_SUPER_ENABLE | + config |= (MIPS24K_PMC_SUPER_ENABLE | MIPS24K_PMC_KERNEL_ENABLE); if (caps & PMC_CAP_USER) config |= MIPS24K_PMC_USER_ENABLE; @@ -256,374 +223,7 @@ mips24k_allocate_pmc(int cpu, int ri, st if (caps & PMC_CAP_INTERRUPT) config |= MIPS24K_PMC_INTERRUPT_ENABLE; - pm->pm_md.pm_mips24k.pm_mips24k_evsel = config; - - PMCDBG(MDP,ALL,2,"mips-allocate ri=%d -> config=0x%x", ri, config); - - return 0; -} - - -static int -mips24k_read_pmc(int cpu, int ri, pmc_value_t *v) -{ - struct pmc *pm; - pmc_value_t tmp; - - KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), - ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); - KASSERT(ri >= 0 && ri < mips24k_npmcs, - ("[mips,%d] illegal row index %d", __LINE__, ri)); - - pm = mips24k_pcpu[cpu]->pc_mipspmcs[ri].phw_pmc; - tmp = mips24k_pmcn_read(ri); - PMCDBG(MDP,REA,2,"mips-read id=%d -> %jd", ri, tmp); - if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) - *v = MIPS24K_PERFCTR_VALUE_TO_RELOAD_COUNT(tmp); - else - *v = tmp; - - return 0; -} - -static int -mips24k_write_pmc(int cpu, int ri, pmc_value_t v) -{ - struct pmc *pm; - - KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), - ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); - KASSERT(ri >= 0 && ri < mips24k_npmcs, - ("[mips,%d] illegal row-index %d", __LINE__, ri)); - - pm = mips24k_pcpu[cpu]->pc_mipspmcs[ri].phw_pmc; - - if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) - v = MIPS24K_RELOAD_COUNT_TO_PERFCTR_VALUE(v); - - PMCDBG(MDP,WRI,1,"mips-write cpu=%d ri=%d v=%jx", cpu, ri, v); - - mips24k_pmcn_write(ri, v); - - return 0; -} - -static int -mips24k_config_pmc(int cpu, int ri, struct pmc *pm) -{ - struct pmc_hw *phw; - - PMCDBG(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); - - KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), - ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); - KASSERT(ri >= 0 && ri < mips24k_npmcs, - ("[mips,%d] illegal row-index %d", __LINE__, ri)); - - phw = &mips24k_pcpu[cpu]->pc_mipspmcs[ri]; - - KASSERT(pm == NULL || phw->phw_pmc == NULL, - ("[mips,%d] pm=%p phw->pm=%p hwpmc not unconfigured", - __LINE__, pm, phw->phw_pmc)); - - phw->phw_pmc = pm; - - return 0; -} - -static int -mips24k_start_pmc(int cpu, int ri) -{ - uint32_t config; - struct pmc *pm; - struct pmc_hw *phw; - - phw = &mips24k_pcpu[cpu]->pc_mipspmcs[ri]; - pm = phw->phw_pmc; - config = pm->pm_md.pm_mips24k.pm_mips24k_evsel; - - /* Enable the PMC. */ - switch (ri) { - case 0: - mips_wr_perfcnt0(config); - break; - case 1: - mips_wr_perfcnt2(config); - break; - default: - break; - } - - return 0; -} - -static int -mips24k_stop_pmc(int cpu, int ri) -{ - struct pmc *pm; - struct pmc_hw *phw; - - phw = &mips24k_pcpu[cpu]->pc_mipspmcs[ri]; - pm = phw->phw_pmc; - - /* - * Disable the PMCs. - * - * Clearing the entire register turns the counter off as well - * as removes the previously sampled event. - */ - switch (ri) { - case 0: - mips_wr_perfcnt0(0); - break; - case 1: - mips_wr_perfcnt2(0); - break; - default: - break; - } - return 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 18:07:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7613106566B; Thu, 22 Mar 2012 18:07:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A1C08FC26; Thu, 22 Mar 2012 18:07:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MI7iOi035566; Thu, 22 Mar 2012 18:07:44 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MI7iVU035564; Thu, 22 Mar 2012 18:07:44 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203221807.q2MI7iVU035564@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 22 Mar 2012 18:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233320 - head/lib/libpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 18:07:44 -0000 Author: gonzo Date: Thu Mar 22 18:07:44 2012 New Revision: 233320 URL: http://svn.freebsd.org/changeset/base/233320 Log: Make reusable part of code have mips prefix, not mips24 Modified: head/lib/libpmc/libpmc.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Thu Mar 22 18:01:23 2012 (r233319) +++ head/lib/libpmc/libpmc.c Thu Mar 22 18:07:44 2012 (r233320) @@ -79,7 +79,7 @@ static int xscale_allocate_pmc(enum pmc_ #endif #if defined(__mips__) -static int mips24k_allocate_pmc(enum pmc_event _pe, char* ctrspec, +static int mips_allocate_pmc(enum pmc_event _pe, char* ctrspec, struct pmc_op_pmcallocate *_pmc_config); #endif /* __mips__ */ @@ -279,7 +279,7 @@ PMC_CLASS_TABLE_DESC(xscale, XSCALE, xsc #endif #if defined(__mips__) -PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, mips24k, mips24k); +PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, mips24k, mips); #endif /* __mips__ */ #if defined(__powerpc__) @@ -2208,12 +2208,12 @@ static struct pmc_event_alias mips24k_al EV_ALIAS(NULL, NULL) }; -#define MIPS24K_KW_OS "os" -#define MIPS24K_KW_USR "usr" -#define MIPS24K_KW_ANYTHREAD "anythread" +#define MIPS_KW_OS "os" +#define MIPS_KW_USR "usr" +#define MIPS_KW_ANYTHREAD "anythread" static int -mips24k_allocate_pmc(enum pmc_event pe, char *ctrspec __unused, +mips_allocate_pmc(enum pmc_event pe, char *ctrspec __unused, struct pmc_op_pmcallocate *pmc_config __unused) { char *p; @@ -2223,11 +2223,11 @@ mips24k_allocate_pmc(enum pmc_event pe, pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); while ((p = strsep(&ctrspec, ",")) != NULL) { - if (KWMATCH(p, MIPS24K_KW_OS)) + if (KWMATCH(p, MIPS_KW_OS)) pmc_config->pm_caps |= PMC_CAP_SYSTEM; - else if (KWMATCH(p, MIPS24K_KW_USR)) + else if (KWMATCH(p, MIPS_KW_USR)) pmc_config->pm_caps |= PMC_CAP_USER; - else if (KWMATCH(p, MIPS24K_KW_ANYTHREAD)) + else if (KWMATCH(p, MIPS_KW_ANYTHREAD)) pmc_config->pm_caps |= (PMC_CAP_USER | PMC_CAP_SYSTEM); else return (-1); @@ -2235,6 +2235,7 @@ mips24k_allocate_pmc(enum pmc_event pe, return (0); } + #endif /* __mips__ */ #if defined(__powerpc__) From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 19:04:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 963B7106566C; Thu, 22 Mar 2012 19:04:23 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81B078FC0A; Thu, 22 Mar 2012 19:04:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MJ4NmT037478; Thu, 22 Mar 2012 19:04:23 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MJ4NnD037476; Thu, 22 Mar 2012 19:04:23 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <201203221904.q2MJ4NnD037476@svn.freebsd.org> From: Joseph Koshy Date: Thu, 22 Mar 2012 19:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233321 - head/lib/libpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 19:04:23 -0000 Author: jkoshy Date: Thu Mar 22 19:04:22 2012 New Revision: 233321 URL: http://svn.freebsd.org/changeset/base/233321 Log: Correct a function prototype. Submitted by: "Anders Magnusson" , via joel Modified: head/lib/libpmc/pmc.h Modified: head/lib/libpmc/pmc.h ============================================================================== --- head/lib/libpmc/pmc.h Thu Mar 22 18:07:44 2012 (r233320) +++ head/lib/libpmc/pmc.h Thu Mar 22 19:04:22 2012 (r233321) @@ -98,7 +98,7 @@ int pmc_npmc(int _cpu); int pmc_cpuinfo(const struct pmc_cpuinfo **_cpu_info); int pmc_pmcinfo(int _cpu, struct pmc_pmcinfo **_pmc_info); -const char *pmc_name_of_capability(uint32_t _c); +const char *pmc_name_of_capability(enum pmc_caps _c); const char *pmc_name_of_class(enum pmc_class _pc); const char *pmc_name_of_cputype(enum pmc_cputype _cp); const char *pmc_name_of_disposition(enum pmc_disp _pd); From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 19:13:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 22E031065674; Thu, 22 Mar 2012 19:13:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Thu, 22 Mar 2012 15:13:28 -0400 User-Agent: KMail/1.6.2 References: <201203202037.q2KKbNfK037014@svn.freebsd.org> <4F6AF1CB.80902@FreeBSD.org> <201203220748.49635.jhb@freebsd.org> In-Reply-To: <201203220748.49635.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203221513.32171.jkim@FreeBSD.org> Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andriy Gapon Subject: Re: svn commit: r233249 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 19:13:40 -0000 On Thursday 22 March 2012 07:48 am, John Baldwin wrote: > On Thursday, March 22, 2012 5:32:59 am Andriy Gapon wrote: > > on 21/03/2012 21:02 Jung-uk Kim said the following: > > > On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote: > > >> on 21/03/2012 19:41 Jung-uk Kim said the following: > > >>> I am well aware of the problem. In fact, that's why I had to > > >>> merge ACPICA 20120320 rather quickly, which added a new flag > > >>> to not execute _GTS method. Both _GTS and _BFS are turned > > >>> off by default. You can control them with a new tunable > > >>> "debug.acpi.sleep_flags" if you want. > > >> > > >> But the bug still has to be fixed, right? > > >> Even if it takes a non-default sysctl value to give the bug a > > >> chance. > > > > > > Ideally, yes. However, I am not so sure if we can call it a > > > "bug" because AcpiEnterSleepState() must be called with > > > interrupt disabled and there is no way to change that API > > > without breaking other OSes. We can only work around it locally > > > or persuade upstream to find a better way to do this in ACPICA > > > itself. Either way, it will be pretty hackish. :-( > > > > I see. Thank you. > > Maybe the code could be somehow tricked into using M_NOWAIT in > > this > > context... > > That still wouldn't be good enough. We don't want to try to > acquire any regular mutexes either (we can't safely block to let > the lock owner run, or the lock owner might be a suspended thread > on another CPU, etc.). The only proper way to fix this would be to > use pre-allocated storage in this particular case, but given that > Windows doesn't invoke these methods on suspend/resume, it's > doubtful that we will ever need to do so. FYI, I filed an upstream PR to track this issue: http://acpica.org/bugzilla/show_bug.cgi?id=950 Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 19:30:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 8F7E2106566B; Thu, 22 Mar 2012 19:30:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Konstantin Belousov Date: Thu, 22 Mar 2012 15:29:51 -0400 User-Agent: KMail/1.6.2 References: <201203202037.q2KKbNfK037014@svn.freebsd.org> <201203220748.49635.jhb@freebsd.org> <20120322141436.GC2358@deviant.kiev.zoral.com.ua> In-Reply-To: <20120322141436.GC2358@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203221529.56045.jkim@FreeBSD.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andriy Gapon , John Baldwin Subject: Re: svn commit: r233249 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 19:30:04 -0000 On Thursday 22 March 2012 10:14 am, Konstantin Belousov wrote: > On Thu, Mar 22, 2012 at 07:48:49AM -0400, John Baldwin wrote: > > On Thursday, March 22, 2012 5:32:59 am Andriy Gapon wrote: > > > on 21/03/2012 21:02 Jung-uk Kim said the following: > > > > On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote: > > > >> on 21/03/2012 19:41 Jung-uk Kim said the following: > > > >>> I am well aware of the problem. In fact, that's why I had > > > >>> to merge ACPICA 20120320 rather quickly, which added a new > > > >>> flag to not execute _GTS method. Both _GTS and _BFS are > > > >>> turned off by default. You can control them with a new > > > >>> tunable > > > >>> "debug.acpi.sleep_flags" if you want. > > > >> > > > >> But the bug still has to be fixed, right? > > > >> Even if it takes a non-default sysctl value to give the bug > > > >> a chance. > > > > > > > > Ideally, yes. However, I am not so sure if we can call it a > > > > "bug" because AcpiEnterSleepState() must be called with > > > > interrupt disabled and there is no way to change that API > > > > without breaking other OSes. We can only work around it > > > > locally or persuade upstream to find a better way to do this > > > > in ACPICA itself. Either way, it will be pretty hackish. :-( > > > > > > I see. Thank you. > > > Maybe the code could be somehow tricked into using M_NOWAIT in > > > this > > > > context... > > > > That still wouldn't be good enough. We don't want to try to > > acquire any regular mutexes either (we can't safely block to let > > the lock owner run, or the lock owner might be a suspended thread > > on another CPU, etc.). The only proper way to fix this would be > > to use pre-allocated storage in this particular case, but given > > that Windows doesn't invoke these methods on suspend/resume, it's > > doubtful that we will ever need to do so. > > I already noted this to Jung-uk, I think that current suspend > handling is (somewhat) wrong. We shall not stop other CPUs for > suspension when they are executing some random kernel code. Rather, > CPUs should be safely stopped at the kernel->user boundary, or at > sleep point, or at designated suspend point like idle loop. > > We already are engaged into somewhat doubtful actions like > restoring of %cr2, since we might, for instance, preemt page fault > handler with suspend IPI. And as I noted to you, a proper fix isn't trivial and I need help in this area. :-( Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 20:31:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74825106566B; Thu, 22 Mar 2012 20:31:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2C18FC16; Thu, 22 Mar 2012 20:31:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MKVrRP040156; Thu, 22 Mar 2012 20:31:53 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MKVrn7040148; Thu, 22 Mar 2012 20:31:53 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201203222031.q2MKVrn7040148@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 22 Mar 2012 20:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233322 - stable/9/sys/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 20:31:53 -0000 Author: pfg Date: Thu Mar 22 20:31:52 2012 New Revision: 233322 URL: http://svn.freebsd.org/changeset/base/233322 Log: MFC: 232703 Add support for ns timestamps and birthtime to the ext2/3 driver. When using big inodes there is sufficient space in ext3 to keep extra resolution and birthtime (creation) timestamps. We now support the extra timestamps silently when the inode is big enough. Reviewed by: bde Approved by: jhb (mentor) Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c stable/9/sys/fs/ext2fs/ext2_dinode.h stable/9/sys/fs/ext2fs/ext2_inode_cnv.c stable/9/sys/fs/ext2fs/ext2_vfsops.c stable/9/sys/fs/ext2fs/ext2_vnops.c stable/9/sys/fs/ext2fs/ext2fs.h stable/9/sys/fs/ext2fs/inode.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_alloc.c Thu Mar 22 19:04:22 2012 (r233321) +++ stable/9/sys/fs/ext2fs/ext2_alloc.c Thu Mar 22 20:31:52 2012 (r233322) @@ -344,6 +344,7 @@ ext2_valloc(pvp, mode, cred, vpp) struct ucred *cred; struct vnode **vpp; { + struct timespec ts; struct inode *pip; struct m_ext2fs *fs; struct inode *ip; @@ -385,14 +386,14 @@ ext2_valloc(pvp, mode, cred, vpp) } ip = VTOI(*vpp); - /* - the question is whether using VGET was such good idea at all - - Linux doesn't read the old inode in when it's allocating a - new one. I will set at least i_size & i_blocks the zero. - */ - ip->i_mode = 0; + /* + * The question is whether using VGET was such good idea at all: + * Linux doesn't read the old inode in when it is allocating a + * new one. I will set at least i_size and i_blocks to zero. + */ ip->i_size = 0; ip->i_blocks = 0; + ip->i_mode = 0; ip->i_flags = 0; /* now we want to make sure that the block pointers are zeroed out */ for (i = 0; i < NDADDR; i++) @@ -406,6 +407,11 @@ ext2_valloc(pvp, mode, cred, vpp) */ if (ip->i_gen == 0 || ++ip->i_gen == 0) ip->i_gen = random() / 2 + 1; + + vfs_timestamp(&ts); + ip->i_birthtime = ts.tv_sec; + ip->i_birthnsec = ts.tv_nsec; + /* printf("ext2_valloc: allocated inode %d\n", ino); */ Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_dinode.h Thu Mar 22 19:04:22 2012 (r233321) +++ stable/9/sys/fs/ext2fs/ext2_dinode.h Thu Mar 22 20:31:52 2012 (r233322) @@ -61,6 +61,16 @@ #define EXT2_NODUMP 0x00000040 /* do not dump file */ #define EXT2_NOATIME 0x00000080 /* do not update atime */ +/* + * Definitions for nanosecond timestamps. + * Ext3 inode versioning, 2006-12-13. + */ +#define EXT3_EPOCH_BITS 2 +#define EXT3_EPOCH_MASK ((1 << EXT3_EPOCH_BITS) - 1) +#define EXT3_NSEC_MASK (~0UL << EXT3_EPOCH_BITS) + +#define E2DI_HAS_XTIME(ip) (EXT2_INODE_SIZE((ip)->i_e2fs) > \ + E2FS_REV0_INODE_SIZE) /* * Structure of an inode on the disk @@ -77,7 +87,7 @@ struct ext2fs_dinode { uint16_t e2di_nlink; /* 26: File link count */ uint32_t e2di_nblock; /* 28: Blocks count */ uint32_t e2di_flags; /* 32: Status flags (chflags) */ - uint32_t e2di_linux_reserved1; /* 36 */ + uint32_t e2di_version; /* 36: Low 32 bits inode version */ uint32_t e2di_blocks[EXT2_N_BLOCKS]; /* 40: disk blocks */ uint32_t e2di_gen; /* 100: generation number */ uint32_t e2di_facl; /* 104: file ACL (not implemented) */ @@ -91,6 +101,12 @@ struct ext2fs_dinode { uint32_t e2di_linux_reserved3; /* 124 */ uint16_t e2di_extra_isize; uint16_t e2di_pad1; + uint32_t e2di_ctime_extra; /* Extra change time */ + uint32_t e2di_mtime_extra; /* Extra modification time */ + uint32_t e2di_atime_extra; /* Extra access time */ + uint32_t e2di_crtime; /* Creation (birth)time */ + uint32_t e2di_crtime_extra; /* Extra creation (birth)time */ + uint32_t e2di_version_hi; /* High 30 bits of inode version */ }; #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */ Modified: stable/9/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_inode_cnv.c Thu Mar 22 19:04:22 2012 (r233321) +++ stable/9/sys/fs/ext2fs/ext2_inode_cnv.c Thu Mar 22 20:31:52 2012 (r233322) @@ -36,6 +36,9 @@ #include #include +#define XTIME_TO_NSEC(x) ((x & EXT3_NSEC_MASK) >> 2) +#define NSEC_TO_XTIME(t) ((t << 2) & EXT3_NSEC_MASK) + void ext2_print_inode( in ) struct inode *in; @@ -83,6 +86,13 @@ ext2_ei2i(ei, ip) ip->i_atime = ei->e2di_atime; ip->i_mtime = ei->e2di_mtime; ip->i_ctime = ei->e2di_ctime; + if (E2DI_HAS_XTIME(ip)) { + ip->i_atimensec = XTIME_TO_NSEC(ei->e2di_atime_extra); + ip->i_mtimensec = XTIME_TO_NSEC(ei->e2di_mtime_extra); + ip->i_ctimensec = XTIME_TO_NSEC(ei->e2di_ctime_extra); + ip->i_birthtime = ei->e2di_crtime; + ip->i_birthnsec = XTIME_TO_NSEC(ei->e2di_crtime_extra); + } ip->i_flags = 0; ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0; ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0; @@ -121,6 +131,13 @@ ext2_i2ei(ip, ei) ei->e2di_atime = ip->i_atime; ei->e2di_mtime = ip->i_mtime; ei->e2di_ctime = ip->i_ctime; + if (E2DI_HAS_XTIME(ip)) { + ei->e2di_ctime_extra = NSEC_TO_XTIME(ip->i_ctimensec); + ei->e2di_mtime_extra = NSEC_TO_XTIME(ip->i_mtimensec); + ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec); + ei->e2di_crtime = ip->i_birthtime; + ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec); + } ei->e2di_flags = ip->i_flags; ei->e2di_flags = 0; ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0; Modified: stable/9/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vfsops.c Thu Mar 22 19:04:22 2012 (r233321) +++ stable/9/sys/fs/ext2fs/ext2_vfsops.c Thu Mar 22 20:31:52 2012 (r233322) @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -339,14 +340,21 @@ compute_sb_data(struct vnode *devvp, str /* * Simple sanity check for superblock inode size value. */ - if (fs->e2fs_isize < E2FS_REV0_INODE_SIZE || - fs->e2fs_isize > fs->e2fs_bsize || + if (EXT2_INODE_SIZE(fs) < E2FS_REV0_INODE_SIZE || + EXT2_INODE_SIZE(fs) > fs->e2fs_bsize || (fs->e2fs_isize & (fs->e2fs_isize - 1)) != 0) { - printf("EXT2-fs: invalid inode size %d\n", + printf("ext2fs: invalid inode size %d\n", fs->e2fs_isize); return (EIO); } } + /* Check for extra isize in big inodes. */ + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT4F_ROCOMPAT_EXTRA_ISIZE) && + EXT2_INODE_SIZE(fs) < sizeof(struct ext2fs_dinode)) { + printf("ext2fs: no space for extra inode timestamps\n"); + return (EINVAL); + } + fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); fs->e2fs_itpg = fs->e2fs_ipg /fs->e2fs_ipb; fs->e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd); @@ -358,8 +366,8 @@ compute_sb_data(struct vnode *devvp, str fs->e2fs_gdbcount = db_count; fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize, M_EXT2MNT, M_WAITOK); - fs->e2fs_contigdirs = malloc(fs->e2fs_gcount * sizeof(*fs->e2fs_contigdirs), - M_EXT2MNT, M_WAITOK); + fs->e2fs_contigdirs = malloc(fs->e2fs_gcount * + sizeof(*fs->e2fs_contigdirs), M_EXT2MNT, M_WAITOK); /* * Adjust logic_sb_block. @@ -390,7 +398,7 @@ compute_sb_data(struct vnode *devvp, str fs->e2fs_contigdirs[i] = 0; } if (es->e2fs_rev == E2FS_REV0 || - (es->e2fs_features_rocompat & EXT2F_ROCOMPAT_LARGEFILE) == 0) + !EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_LARGEFILE)) fs->e2fs_maxfilesize = 0x7fffffff; else fs->e2fs_maxfilesize = 0x7fffffffffffffff; @@ -967,8 +975,6 @@ ext2_vget(struct mount *mp, ino_t ino, i ip->i_block_group = ino_to_cg(fs, ino); ip->i_next_alloc_block = 0; ip->i_next_alloc_goal = 0; - ip->i_prealloc_count = 0; - ip->i_prealloc_block = 0; /* * Now we want to make sure that block pointers for unused Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vnops.c Thu Mar 22 19:04:22 2012 (r233321) +++ stable/9/sys/fs/ext2fs/ext2_vnops.c Thu Mar 22 20:31:52 2012 (r233322) @@ -360,11 +360,15 @@ ext2_getattr(ap) vap->va_rdev = ip->i_rdev; vap->va_size = ip->i_size; vap->va_atime.tv_sec = ip->i_atime; - vap->va_atime.tv_nsec = ip->i_atimensec; + vap->va_atime.tv_nsec = E2DI_HAS_XTIME(ip) ? ip->i_atimensec : 0; vap->va_mtime.tv_sec = ip->i_mtime; - vap->va_mtime.tv_nsec = ip->i_mtimensec; + vap->va_mtime.tv_nsec = E2DI_HAS_XTIME(ip) ? ip->i_mtimensec : 0; vap->va_ctime.tv_sec = ip->i_ctime; - vap->va_ctime.tv_nsec = ip->i_ctimensec; + vap->va_ctime.tv_nsec = E2DI_HAS_XTIME(ip) ? ip->i_ctimensec : 0; + if E2DI_HAS_XTIME(ip) { + vap->va_birthtime.tv_sec = ip->i_birthtime; + vap->va_birthtime.tv_nsec = ip->i_birthnsec; + } vap->va_flags = ip->i_flags; vap->va_gen = ip->i_gen; vap->va_blocksize = vp->v_mount->mnt_stat.f_iosize; @@ -501,6 +505,8 @@ ext2_setattr(ap) ip->i_mtime = vap->va_mtime.tv_sec; ip->i_mtimensec = vap->va_mtime.tv_nsec; } + ip->i_birthtime = vap->va_birthtime.tv_sec; + ip->i_birthnsec = vap->va_birthtime.tv_nsec; error = ext2_update(vp, 0); if (error) return (error); Modified: stable/9/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2fs.h Thu Mar 22 19:04:22 2012 (r233321) +++ stable/9/sys/fs/ext2fs/ext2fs.h Thu Mar 22 20:31:52 2012 (r233322) @@ -129,7 +129,7 @@ struct ext2fs { uint32_t e4fs_rbcount_hi; /* reserved blocks count */ uint32_t e4fs_fbcount_hi; /* free blocks count */ uint16_t e4fs_min_extra_isize;/* all inodes have at least some bytes */ - uint16_t e4fs_want_extra_isize; /* new inodes should reserve some bytes */ + uint16_t e4fs_want_extra_isize; /* inodes must reserve some bytes */ uint32_t e4fs_flags; /* miscellaneous flags */ uint16_t e4fs_raid_stride; /* RAID stride */ uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */ @@ -214,6 +214,7 @@ struct m_ext2fs { #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 #define EXT2F_ROCOMPAT_LARGEFILE 0x0002 #define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 +#define EXT4F_ROCOMPAT_EXTRA_ISIZE 0x0040 #define EXT2F_INCOMPAT_COMP 0x0001 #define EXT2F_INCOMPAT_FTYPE 0x0002 @@ -227,8 +228,9 @@ struct m_ext2fs { * - EXT2F_INCOMPAT_FTYPE */ #define EXT2F_COMPAT_SUPP 0x0000 -#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER \ - | EXT2F_ROCOMPAT_LARGEFILE) +#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ + EXT2F_ROCOMPAT_LARGEFILE | \ + EXT4F_ROCOMPAT_EXTRA_ISIZE) #define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE /* Assume that user mode programs are passing in an ext2fs superblock, not Modified: stable/9/sys/fs/ext2fs/inode.h ============================================================================== --- stable/9/sys/fs/ext2fs/inode.h Thu Mar 22 19:04:22 2012 (r233321) +++ stable/9/sys/fs/ext2fs/inode.h Thu Mar 22 20:31:52 2012 (r233322) @@ -77,8 +77,6 @@ struct inode { uint32_t i_block_group; uint32_t i_next_alloc_block; uint32_t i_next_alloc_goal; - uint32_t i_prealloc_block; - uint32_t i_prealloc_count; /* Fields from struct dinode in UFS. */ uint16_t i_mode; /* IFMT, permissions; see below. */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 20:34:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF2C2106564A; Thu, 22 Mar 2012 20:34:26 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0C608FC14; Thu, 22 Mar 2012 20:34:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MKYQZq040281; Thu, 22 Mar 2012 20:34:26 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MKYQm7040279; Thu, 22 Mar 2012 20:34:26 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201203222034.q2MKYQm7040279@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 22 Mar 2012 20:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233323 - head/sys/boot/fdt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 20:34:27 -0000 Author: raj Date: Thu Mar 22 20:34:26 2012 New Revision: 233323 URL: http://svn.freebsd.org/changeset/base/233323 Log: Improve FDT handling in loader(8) and make it more robust. o Fix buffer overflows when using a long property body in node paths. o Fix loop end condition when iterating through the symbol table. o Better error handling during node modification, better problem reporting. o Eliminate build time warnings. Submitted by: Lukasz Wojcik Obtained from: Semihalf MFC after: 1 week Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Thu Mar 22 20:31:52 2012 (r233322) +++ head/sys/boot/fdt/fdt_loader_cmd.c Thu Mar 22 20:34:26 2012 (r233323) @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$"); #define STR(number) #number #define STRINGIFY(number) STR(number) -#define MIN(num1, num2) (((num1) < (num2)) ? (num1):(num2)) - #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) #define FDT_STATIC_DTB_SYMBOL "fdt_static_dtb" @@ -110,9 +108,11 @@ fdt_find_static_dtb(void) Elf_Sym *symtab; Elf_Dyn *dyn; char *strtab, *strp; - int i; + int i, sym_count; - esym = strtab = symtab = 0; + symtab = NULL; + dyntab = esym = 0; + strtab = strp = NULL; offs = __elfN(relocation_offset); @@ -129,6 +129,7 @@ fdt_find_static_dtb(void) if (md == NULL) return (0); COPYOUT(md->md_data, &dyntab, sizeof(dyntab)); + dyntab += offs; /* Locate STRTAB and DYNTAB */ @@ -152,6 +153,8 @@ fdt_find_static_dtb(void) return (0); } + sym_count = (int)((Elf_Sym *)esym - symtab) / sizeof(Elf_Sym); + /* * The most efficent way to find a symbol would be to calculate a * hash, find proper bucket and chain, and thus find a symbol. @@ -162,7 +165,7 @@ fdt_find_static_dtb(void) * we are eliminating symbols type of which is not STT_NOTYPE, or(and) * those which binding attribute is not STB_GLOBAL. */ - for (i = 0; (vm_offset_t)(symtab + i) < esym; i++) { + for (i = 0; i < sym_count; i++) { COPYOUT(symtab + i, &sym, sizeof(sym)); if (ELF_ST_BIND(sym.st_info) != STB_GLOBAL || ELF_ST_TYPE(sym.st_info) != STT_NOTYPE) @@ -190,7 +193,7 @@ fdt_setup_fdtp() */ bfp = file_findfile(NULL, "dtb"); if (bfp == NULL) { - if ((fdtp = (struct fdt_head *)fdt_find_static_dtb()) == 0) { + if ((fdtp = (struct fdt_header *)fdt_find_static_dtb()) == 0) { command_errmsg = "no device tree blob found!"; return (CMD_ERROR); } @@ -842,32 +845,41 @@ fdt_isprint(const void *data, int len, i static int fdt_data_str(const void *data, int len, int count, char **buf) { - char tmp[80], *b; + char *b, *tmp; const char *d; - int i, l; + int buf_len, i, l; /* * Calculate the length for the string and allocate memory. * - * Note len already includes at least one terminator. + * Note that 'len' already includes at least one terminator. */ - l = len; + buf_len = len; if (count > 1) { /* * Each token had already a terminator buried in 'len', but we * only need one eventually, don't count space for these. */ - l -= count - 1; + buf_len -= count - 1; /* Each consecutive token requires a ", " separator. */ - l += count * 2; + buf_len += count * 2; } - /* Space for surrounding double quotes. */ - l += count * 2; - b = (char *)malloc(l); + /* Add some space for surrounding double quotes. */ + buf_len += count * 2; + + /* Note that string being put in 'tmp' may be as big as 'buf_len'. */ + b = (char *)malloc(buf_len); + tmp = (char *)malloc(buf_len); if (b == NULL) - return (1); + goto error; + + if (tmp == NULL) { + free(b); + goto error; + } + b[0] = '\0'; /* @@ -887,13 +899,17 @@ fdt_data_str(const void *data, int len, } while (i < len); *buf = b; + free(tmp); + return (0); +error: + return (1); } static int fdt_data_cell(const void *data, int len, char **buf) { - char tmp[80], *b; + char *b, *tmp; const uint32_t *c; int count, i, l; @@ -916,8 +932,14 @@ fdt_data_cell(const void *data, int len, l += 3; b = (char *)malloc(l); + tmp = (char *)malloc(l); if (b == NULL) - return (1); + goto error; + + if (tmp == NULL) { + free(b); + goto error; + } b[0] = '\0'; strcat(b, "<"); @@ -931,13 +953,17 @@ fdt_data_cell(const void *data, int len, strcat(b, ">"); *buf = b; + free(tmp); + return (0); +error: + return (1); } static int fdt_data_bytes(const void *data, int len, char **buf) { - char tmp[80], *b; + char *b, *tmp; const char *d; int i, l; @@ -956,8 +982,14 @@ fdt_data_bytes(const void *data, int len l += 3; b = (char *)malloc(l); + tmp = (char *)malloc(l); if (b == NULL) - return (1); + goto error; + + if (tmp == NULL) { + free(b); + goto error; + } b[0] = '\0'; strcat(b, "["); @@ -969,7 +1001,11 @@ fdt_data_bytes(const void *data, int len strcat(b, "]"); *buf = b; + free(tmp); + return (0); +error: + return (1); } static int @@ -1108,6 +1144,14 @@ fdt_modprop(int nodeoff, char *propname, break; } + if (rv != 0) { + if (rv == -FDT_ERR_NOSPACE) + sprintf(command_errbuf, + "Device tree blob is too small!\n"); + else + sprintf(command_errbuf, + "Could not add/modify property!\n"); + } return (rv); } @@ -1350,9 +1394,12 @@ fdt_cmd_mknode(int argc, char *argv[]) rv = fdt_add_subnode(fdtp, o, nodename); if (rv < 0) { - sprintf(command_errbuf, "could not delete node %s\n", - (rv == -FDT_ERR_NOTFOUND) ? - "(node does not exist)" : ""); + if (rv == -FDT_ERR_NOSPACE) + sprintf(command_errbuf, + "Device tree blob is too small!\n"); + else + sprintf(command_errbuf, + "Could not add node!\n"); return (CMD_ERROR); } return (CMD_OK); @@ -1361,7 +1408,7 @@ fdt_cmd_mknode(int argc, char *argv[]) static int fdt_cmd_pwd(int argc, char *argv[]) { - char line[80]; + char line[FDT_CWD_LEN]; pager_open(); sprintf(line, "%s\n", cwd); From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 20:51:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 530C01065676; Thu, 22 Mar 2012 20:51:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23CD38FC1C; Thu, 22 Mar 2012 20:51:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MKpZa3040840; Thu, 22 Mar 2012 20:51:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MKpZPO040838; Thu, 22 Mar 2012 20:51:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203222051.q2MKpZPO040838@svn.freebsd.org> From: John Baldwin Date: Thu, 22 Mar 2012 20:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233324 - in stable/9/sys: i386/conf nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 20:51:36 -0000 Author: jhb Date: Thu Mar 22 20:51:35 2012 New Revision: 233324 URL: http://svn.freebsd.org/changeset/base/233324 Log: MFC 232116: Adjust the nfs_skip_wcc_data_onerr setting so that it does not block post-op attributes for ENOENT errors now that the name caching logic depends on working post-op attributes. Modified: stable/9/sys/nfsclient/nfs_krpc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/9/sys/nfsclient/nfs_krpc.c Thu Mar 22 20:34:26 2012 (r233323) +++ stable/9/sys/nfsclient/nfs_krpc.c Thu Mar 22 20:51:35 2012 (r233324) @@ -603,13 +603,15 @@ tryagain: if (error == ESTALE) nfs_purgecache(vp); /* - * Skip wcc data on NFS errors for now. NetApp filers - * return corrupt postop attrs in the wcc data for NFS - * err EROFS. Not sure if they could return corrupt - * postop attrs for others errors. + * Skip wcc data on non-ENOENT NFS errors for now. + * NetApp filers return corrupt postop attrs in the + * wcc data for NFS err EROFS. Not sure if they could + * return corrupt postop attrs for others errors. + * Blocking ENOENT post-op attributes breaks negative + * name caching, so always allow it through. */ if ((nmp->nm_flag & NFSMNT_NFSV3) && - !nfs_skip_wcc_data_onerr) { + (!nfs_skip_wcc_data_onerr || error == ENOENT)) { *mrp = mrep; *mdp = md; *dposp = dpos; From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 20:52:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFE73106564A; Thu, 22 Mar 2012 20:52:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA0D58FC08; Thu, 22 Mar 2012 20:52:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MKq0tE040892; Thu, 22 Mar 2012 20:52:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MKq0iM040889; Thu, 22 Mar 2012 20:52:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203222052.q2MKq0iM040889@svn.freebsd.org> From: John Baldwin Date: Thu, 22 Mar 2012 20:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233325 - in stable/8/sys: i386/conf nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 20:52:01 -0000 Author: jhb Date: Thu Mar 22 20:52:00 2012 New Revision: 233325 URL: http://svn.freebsd.org/changeset/base/233325 Log: MFC 232116: Adjust the nfs_skip_wcc_data_onerr setting so that it does not block post-op attributes for ENOENT errors now that the name caching logic depends on working post-op attributes. Modified: stable/8/sys/nfsclient/nfs_krpc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/8/sys/nfsclient/nfs_krpc.c Thu Mar 22 20:51:35 2012 (r233324) +++ stable/8/sys/nfsclient/nfs_krpc.c Thu Mar 22 20:52:00 2012 (r233325) @@ -603,13 +603,15 @@ tryagain: if (error == ESTALE) nfs_purgecache(vp); /* - * Skip wcc data on NFS errors for now. NetApp filers - * return corrupt postop attrs in the wcc data for NFS - * err EROFS. Not sure if they could return corrupt - * postop attrs for others errors. + * Skip wcc data on non-ENOENT NFS errors for now. + * NetApp filers return corrupt postop attrs in the + * wcc data for NFS err EROFS. Not sure if they could + * return corrupt postop attrs for others errors. + * Blocking ENOENT post-op attributes breaks negative + * name caching, so always allow it through. */ if ((nmp->nm_flag & NFSMNT_NFSV3) && - !nfs_skip_wcc_data_onerr) { + (!nfs_skip_wcc_data_onerr || error == ENOENT)) { *mrp = mrep; *mdp = md; *dposp = dpos; From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 21:07:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2EFE106566C; Thu, 22 Mar 2012 21:07:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8412C8FC15; Thu, 22 Mar 2012 21:07:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ML7tpK041473; Thu, 22 Mar 2012 21:07:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ML7tET041465; Thu, 22 Mar 2012 21:07:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203222107.q2ML7tET041465@svn.freebsd.org> From: John Baldwin Date: Thu, 22 Mar 2012 21:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233326 - in stable/9: sbin/mount_nfs sys/fs/nfsclient sys/i386/conf sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 21:07:55 -0000 Author: jhb Date: Thu Mar 22 21:07:54 2012 New Revision: 233326 URL: http://svn.freebsd.org/changeset/base/233326 Log: MFC 230547: Add a timeout on positive name cache entries in the NFS client. That is, we will only trust a positive name cache entry for a specified amount of time before falling back to a LOOKUP RPC, even if the ctime for the file handle matches the cached copy in the name cache entry. The timeout is configured via a new 'nametimeo' mount option and defaults to 60 seconds. It may be set to zero to disable positive name caching entirely. Modified: stable/9/sbin/mount_nfs/mount_nfs.8 stable/9/sys/fs/nfsclient/nfs_clvfsops.c stable/9/sys/fs/nfsclient/nfs_clvnops.c stable/9/sys/fs/nfsclient/nfsmount.h stable/9/sys/nfsclient/nfs_vfsops.c stable/9/sys/nfsclient/nfs_vnops.c stable/9/sys/nfsclient/nfsmount.h Directory Properties: stable/9/sbin/mount_nfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- stable/9/sbin/mount_nfs/mount_nfs.8 Thu Mar 22 20:52:00 2012 (r233325) +++ stable/9/sbin/mount_nfs/mount_nfs.8 Thu Mar 22 21:07:54 2012 (r233326) @@ -157,6 +157,10 @@ Force the mount protocol to use UDP tran (Necessary for some old .Bx servers.) +.It Cm nametimeo Ns = Ns Aq Ar value +Override the default of NFS_DEFAULT_NAMETIMEO for the timeout (in seconds) +for positive name cache entries. +If this is set to 0 it disables positive name caching for the mount point. .It Cm negnametimeo Ns = Ns Aq Ar value Override the default of NFS_DEFAULT_NEGNAMETIMEO for the timeout (in seconds) for negative name cache entries. If this is set to 0 it disables negative Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Thu Mar 22 20:52:00 2012 (r233325) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Thu Mar 22 21:07:54 2012 (r233326) @@ -104,7 +104,7 @@ static void nfs_decode_args(struct mount static int mountnfs(struct nfs_args *, struct mount *, struct sockaddr *, char *, u_char *, int, u_char *, int, u_char *, int, struct vnode **, struct ucred *, - struct thread *, int); + struct thread *, int, int); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, struct sockaddr_storage *, int *, off_t *, struct timeval *); @@ -520,7 +520,8 @@ nfs_mountdiskless(char *path, dirlen = 0; nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK); if ((error = mountnfs(args, mp, nam, path, NULL, 0, dirpath, dirlen, - NULL, 0, vpp, td->td_ucred, td, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { + NULL, 0, vpp, td->td_ucred, td, NFS_DEFAULT_NAMETIMEO, + NFS_DEFAULT_NEGNAMETIMEO)) != 0) { printf("nfs_mountroot: mount %s on /: %d\n", path, error); return (error); } @@ -715,7 +716,7 @@ static const char *nfs_opts[] = { "from" "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "resvport", "readahead", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", - "negnametimeo", "nocto", "wcommitsize", + "nametimeo", "negnametimeo", "nocto", "wcommitsize", NULL }; /* @@ -760,6 +761,7 @@ nfs_mount(struct mount *mp) char hst[MNAMELEN]; u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100]; char *opt, *name, *secname; + int nametimeo = NFS_DEFAULT_NAMETIMEO; int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; int dirlen, has_nfs_args_opt, krbnamelen, srvkrbnamelen; size_t hstlen; @@ -968,6 +970,14 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_TIMEO; } + if (vfs_getopt(mp->mnt_optnew, "nametimeo", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &nametimeo); + if (ret != 1 || nametimeo < 0) { + vfs_mount_error(mp, "illegal nametimeo: %s", opt); + error = EINVAL; + goto out; + } + } if (vfs_getopt(mp->mnt_optnew, "negnametimeo", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &negnametimeo); @@ -1122,7 +1132,7 @@ nfs_mount(struct mount *mp) args.fh = nfh; error = mountnfs(&args, mp, nam, hst, krbname, krbnamelen, dirpath, dirlen, srvkrbname, srvkrbnamelen, &vp, td->td_ucred, td, - negnametimeo); + nametimeo, negnametimeo); out: if (!error) { MNT_ILOCK(mp); @@ -1166,7 +1176,7 @@ static int mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, char *hst, u_char *krbname, int krbnamelen, u_char *dirpath, int dirlen, u_char *srvkrbname, int srvkrbnamelen, struct vnode **vpp, - struct ucred *cred, struct thread *td, int negnametimeo) + struct ucred *cred, struct thread *td, int nametimeo, int negnametimeo) { struct nfsmount *nmp; struct nfsnode *np; @@ -1233,13 +1243,14 @@ mountnfs(struct nfs_args *argp, struct m } vfs_getnewfsid(mp); nmp->nm_mountp = mp; - mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF | MTX_DUPOK); + mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF | MTX_DUPOK); /* - * Since nfs_decode_args() might optionally set them, these need to - * set to defaults before the call, so that the optional settings - * aren't overwritten. + * Since nfs_decode_args() might optionally set them, these + * need to be set to defaults before the call, so that the + * optional settings aren't overwritten. */ + nmp->nm_nametimeo = nametimeo; nmp->nm_negnametimeo = negnametimeo; nmp->nm_timeo = NFS_TIMEO; nmp->nm_retry = NFS_RETRANS; Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvnops.c Thu Mar 22 20:52:00 2012 (r233325) +++ stable/9/sys/fs/nfsclient/nfs_clvnops.c Thu Mar 22 21:07:54 2012 (r233326) @@ -1063,7 +1063,8 @@ nfs_lookup(struct vop_lookup_args *ap) * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback - * to doing a lookup RPC. + * to doing a lookup RPC. We also only trust cache + * entries for less than nm_nametimeo seconds. * * To better handle stale file handles and attributes, * clear the attribute cache of this node if it is a @@ -1085,7 +1086,8 @@ nfs_lookup(struct vop_lookup_args *ap) mtx_unlock(&newnp->n_mtx); } if (nfscl_nodeleg(newvp, 0) == 0 || - (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && + ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) && + VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && timespeccmp(&vattr.va_ctime, &nctime, ==))) { NFSINCRGLOBAL(newnfsstats.lookupcache_hits); if (cnp->cn_nameiop != LOOKUP && Modified: stable/9/sys/fs/nfsclient/nfsmount.h ============================================================================== --- stable/9/sys/fs/nfsclient/nfsmount.h Thu Mar 22 20:52:00 2012 (r233325) +++ stable/9/sys/fs/nfsclient/nfsmount.h Thu Mar 22 21:07:54 2012 (r233326) @@ -66,6 +66,7 @@ struct nfsmount { u_int64_t nm_maxfilesize; /* maximum file size */ int nm_tprintf_initial_delay; /* initial delay */ int nm_tprintf_delay; /* interval for messages */ + int nm_nametimeo; /* timeout for +ve entries (sec) */ int nm_negnametimeo; /* timeout for -ve entries (sec) */ /* Newnfs additions */ @@ -106,6 +107,10 @@ struct nfsmount { */ #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data)) +#ifndef NFS_DEFAULT_NAMETIMEO +#define NFS_DEFAULT_NAMETIMEO 60 +#endif + #ifndef NFS_DEFAULT_NEGNAMETIMEO #define NFS_DEFAULT_NEGNAMETIMEO 60 #endif Modified: stable/9/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/9/sys/nfsclient/nfs_vfsops.c Thu Mar 22 20:52:00 2012 (r233325) +++ stable/9/sys/nfsclient/nfs_vfsops.c Thu Mar 22 21:07:54 2012 (r233326) @@ -118,7 +118,7 @@ static void nfs_decode_args(struct mount struct nfs_args *argp, const char *hostname); static int mountnfs(struct nfs_args *, struct mount *, struct sockaddr *, char *, struct vnode **, - struct ucred *cred, int); + struct ucred *cred, int, int); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, struct sockaddr_storage *, int *, off_t *, struct timeval *); @@ -560,8 +560,8 @@ nfs_mountdiskless(char *path, int error; nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK); - if ((error = mountnfs(args, mp, nam, path, vpp, - td->td_ucred, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { + if ((error = mountnfs(args, mp, nam, path, vpp, td->td_ucred, + NFS_DEFAULT_NAMETIMEO, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { printf("nfs_mountroot: mount %s on /: %d\n", path, error); return (error); } @@ -789,6 +789,7 @@ static const char *nfs_opts[] = { "from" "wsize", "rsize", "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "deadthresh", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", "maxgroups", "principal", "negnametimeo", "nocto", "wcommitsize", + "nametimeo", NULL }; /* @@ -837,6 +838,7 @@ nfs_mount(struct mount *mp) size_t len; u_char nfh[NFSX_V3FHMAX]; char *opt; + int nametimeo = NFS_DEFAULT_NAMETIMEO; int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; has_nfs_args_opt = 0; @@ -1059,6 +1061,14 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_MAXGRPS; } + if (vfs_getopt(mp->mnt_optnew, "nametimeo", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &nametimeo); + if (ret != 1 || nametimeo < 0) { + vfs_mount_error(mp, "illegal nametimeo: %s", opt); + error = EINVAL; + goto out; + } + } if (vfs_getopt(mp->mnt_optnew, "negnametimeo", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &negnametimeo); @@ -1179,7 +1189,7 @@ nfs_mount(struct mount *mp) goto out; } error = mountnfs(&args, mp, nam, args.hostname, &vp, - curthread->td_ucred, negnametimeo); + curthread->td_ucred, nametimeo, negnametimeo); out: if (!error) { MNT_ILOCK(mp); @@ -1221,7 +1231,8 @@ nfs_cmount(struct mntarg *ma, void *data */ static int mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, - char *hst, struct vnode **vpp, struct ucred *cred, int negnametimeo) + char *hst, struct vnode **vpp, struct ucred *cred, int nametimeo, + int negnametimeo) { struct nfsmount *nmp; struct nfsnode *np; @@ -1271,6 +1282,7 @@ mountnfs(struct nfs_args *argp, struct m nmp->nm_numgrps = NFS_MAXGRPS; nmp->nm_readahead = NFS_DEFRAHEAD; nmp->nm_deadthresh = NFS_MAXDEADTHRESH; + nmp->nm_nametimeo = nametimeo; nmp->nm_negnametimeo = negnametimeo; nmp->nm_tprintf_delay = nfs_tprintf_delay; if (nmp->nm_tprintf_delay < 0) Modified: stable/9/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/9/sys/nfsclient/nfs_vnops.c Thu Mar 22 20:52:00 2012 (r233325) +++ stable/9/sys/nfsclient/nfs_vnops.c Thu Mar 22 21:07:54 2012 (r233326) @@ -959,7 +959,8 @@ nfs_lookup(struct vop_lookup_args *ap) * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback - * to doing a lookup RPC. + * to doing a lookup RPC. We also only trust cache + * entries for less than nm_nametimeo seconds. * * To better handle stale file handles and attributes, * clear the attribute cache of this node if it is a @@ -980,7 +981,8 @@ nfs_lookup(struct vop_lookup_args *ap) KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); mtx_unlock(&newnp->n_mtx); } - if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && + if ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) && + VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && timespeccmp(&vattr.va_ctime, &nctime, ==)) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && Modified: stable/9/sys/nfsclient/nfsmount.h ============================================================================== --- stable/9/sys/nfsclient/nfsmount.h Thu Mar 22 20:52:00 2012 (r233325) +++ stable/9/sys/nfsclient/nfsmount.h Thu Mar 22 21:07:54 2012 (r233326) @@ -83,6 +83,7 @@ struct nfsmount { struct rpc_timers nm_timers[NFS_MAX_TIMER]; /* RTT Timers for rpcs */ char nm_principal[MNAMELEN]; /* GSS-API principal of server */ gss_OID nm_mech_oid; /* OID of selected GSS-API mechanism */ + int nm_nametimeo; /* timeout for +ve entries (sec) */ int nm_negnametimeo; /* timeout for -ve entries (sec) */ /* NFSv4 */ @@ -116,6 +117,10 @@ struct nfsmount { #define NFS_TPRINTF_DELAY 30 #endif +#ifndef NFS_DEFAULT_NAMETIMEO +#define NFS_DEFAULT_NAMETIMEO 60 +#endif + #ifndef NFS_DEFAULT_NEGNAMETIMEO #define NFS_DEFAULT_NEGNAMETIMEO 60 #endif From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 21:08:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 211BA1065675; Thu, 22 Mar 2012 21:08:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 018E88FC15; Thu, 22 Mar 2012 21:08:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ML8Ewb041528; Thu, 22 Mar 2012 21:08:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ML8EDG041520; Thu, 22 Mar 2012 21:08:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203222108.q2ML8EDG041520@svn.freebsd.org> From: John Baldwin Date: Thu, 22 Mar 2012 21:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233327 - in stable/8: sbin/mount_nfs sys/fs/nfsclient sys/i386/conf sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 21:08:15 -0000 Author: jhb Date: Thu Mar 22 21:08:14 2012 New Revision: 233327 URL: http://svn.freebsd.org/changeset/base/233327 Log: MFC 230547: Add a timeout on positive name cache entries in the NFS client. That is, we will only trust a positive name cache entry for a specified amount of time before falling back to a LOOKUP RPC, even if the ctime for the file handle matches the cached copy in the name cache entry. The timeout is configured via a new 'nametimeo' mount option and defaults to 60 seconds. It may be set to zero to disable positive name caching entirely. Modified: stable/8/sbin/mount_nfs/mount_nfs.8 stable/8/sys/fs/nfsclient/nfs_clvfsops.c stable/8/sys/fs/nfsclient/nfs_clvnops.c stable/8/sys/fs/nfsclient/nfsmount.h stable/8/sys/nfsclient/nfs_vfsops.c stable/8/sys/nfsclient/nfs_vnops.c stable/8/sys/nfsclient/nfsmount.h Directory Properties: stable/8/sbin/mount_nfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- stable/8/sbin/mount_nfs/mount_nfs.8 Thu Mar 22 21:07:54 2012 (r233326) +++ stable/8/sbin/mount_nfs/mount_nfs.8 Thu Mar 22 21:08:14 2012 (r233327) @@ -151,6 +151,10 @@ Force the mount protocol to use UDP tran (Necessary for some old .Bx servers.) +.It Cm nametimeo Ns = Ns Aq Ar value +Override the default of NFS_DEFAULT_NAMETIMEO for the timeout (in seconds) +for positive name cache entries. +If this is set to 0 it disables positive name caching for the mount point. .It Cm negnametimeo Ns = Ns Aq Ar value Override the default of NFS_DEFAULT_NEGNAMETIMEO for the timeout (in seconds) for negative name cache entries. If this is set to 0 it disables negative Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Thu Mar 22 21:07:54 2012 (r233326) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Thu Mar 22 21:08:14 2012 (r233327) @@ -104,7 +104,7 @@ static void nfs_decode_args(struct mount static int mountnfs(struct nfs_args *, struct mount *, struct sockaddr *, char *, u_char *, int, u_char *, int, u_char *, int, struct vnode **, struct ucred *, - struct thread *, int); + struct thread *, int, int); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, struct sockaddr_storage *, int *, off_t *, struct timeval *); @@ -516,7 +516,8 @@ nfs_mountdiskless(char *path, dirlen = 0; nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK); if ((error = mountnfs(args, mp, nam, path, NULL, 0, dirpath, dirlen, - NULL, 0, vpp, td->td_ucred, td, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { + NULL, 0, vpp, td->td_ucred, td, NFS_DEFAULT_NAMETIMEO, + NFS_DEFAULT_NEGNAMETIMEO)) != 0) { printf("nfs_mountroot: mount %s on /: %d\n", path, error); return (error); } @@ -711,7 +712,7 @@ static const char *nfs_opts[] = { "from" "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "resvport", "readahead", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", - "negnametimeo", "nocto", "wcommitsize", + "nametimeo", "negnametimeo", "nocto", "wcommitsize", NULL }; /* @@ -756,6 +757,7 @@ nfs_mount(struct mount *mp) char hst[MNAMELEN]; u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100]; char *opt, *name, *secname; + int nametimeo = NFS_DEFAULT_NAMETIMEO; int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; int dirlen, has_nfs_args_opt, krbnamelen, srvkrbnamelen; size_t hstlen; @@ -964,6 +966,14 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_TIMEO; } + if (vfs_getopt(mp->mnt_optnew, "nametimeo", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &nametimeo); + if (ret != 1 || nametimeo < 0) { + vfs_mount_error(mp, "illegal nametimeo: %s", opt); + error = EINVAL; + goto out; + } + } if (vfs_getopt(mp->mnt_optnew, "negnametimeo", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &negnametimeo); @@ -1118,7 +1128,7 @@ nfs_mount(struct mount *mp) args.fh = nfh; error = mountnfs(&args, mp, nam, hst, krbname, krbnamelen, dirpath, dirlen, srvkrbname, srvkrbnamelen, &vp, td->td_ucred, td, - negnametimeo); + nametimeo, negnametimeo); out: if (!error) { MNT_ILOCK(mp); @@ -1162,7 +1172,7 @@ static int mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, char *hst, u_char *krbname, int krbnamelen, u_char *dirpath, int dirlen, u_char *srvkrbname, int srvkrbnamelen, struct vnode **vpp, - struct ucred *cred, struct thread *td, int negnametimeo) + struct ucred *cred, struct thread *td, int nametimeo, int negnametimeo) { struct nfsmount *nmp; struct nfsnode *np; @@ -1229,13 +1239,14 @@ mountnfs(struct nfs_args *argp, struct m } vfs_getnewfsid(mp); nmp->nm_mountp = mp; - mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF | MTX_DUPOK); + mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF | MTX_DUPOK); /* - * Since nfs_decode_args() might optionally set them, these need to - * set to defaults before the call, so that the optional settings - * aren't overwritten. + * Since nfs_decode_args() might optionally set them, these + * need to be set to defaults before the call, so that the + * optional settings aren't overwritten. */ + nmp->nm_nametimeo = nametimeo; nmp->nm_negnametimeo = negnametimeo; nmp->nm_timeo = NFS_TIMEO; nmp->nm_retry = NFS_RETRANS; Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Thu Mar 22 21:07:54 2012 (r233326) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Thu Mar 22 21:08:14 2012 (r233327) @@ -1026,7 +1026,8 @@ nfs_lookup(struct vop_lookup_args *ap) * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback - * to doing a lookup RPC. + * to doing a lookup RPC. We also only trust cache + * entries for less than nm_nametimeo seconds. * * To better handle stale file handles and attributes, * clear the attribute cache of this node if it is a @@ -1047,7 +1048,8 @@ nfs_lookup(struct vop_lookup_args *ap) mtx_unlock(&newnp->n_mtx); } if (nfscl_nodeleg(newvp, 0) == 0 || - (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && + ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) && + VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && timespeccmp(&vattr.va_ctime, &nctime, ==))) { NFSINCRGLOBAL(newnfsstats.lookupcache_hits); if (cnp->cn_nameiop != LOOKUP && Modified: stable/8/sys/fs/nfsclient/nfsmount.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfsmount.h Thu Mar 22 21:07:54 2012 (r233326) +++ stable/8/sys/fs/nfsclient/nfsmount.h Thu Mar 22 21:08:14 2012 (r233327) @@ -66,6 +66,7 @@ struct nfsmount { u_int64_t nm_maxfilesize; /* maximum file size */ int nm_tprintf_initial_delay; /* initial delay */ int nm_tprintf_delay; /* interval for messages */ + int nm_nametimeo; /* timeout for +ve entries (sec) */ int nm_negnametimeo; /* timeout for -ve entries (sec) */ /* Newnfs additions */ @@ -106,6 +107,10 @@ struct nfsmount { */ #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data)) +#ifndef NFS_DEFAULT_NAMETIMEO +#define NFS_DEFAULT_NAMETIMEO 60 +#endif + #ifndef NFS_DEFAULT_NEGNAMETIMEO #define NFS_DEFAULT_NEGNAMETIMEO 60 #endif Modified: stable/8/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vfsops.c Thu Mar 22 21:07:54 2012 (r233326) +++ stable/8/sys/nfsclient/nfs_vfsops.c Thu Mar 22 21:08:14 2012 (r233327) @@ -116,7 +116,7 @@ static void nfs_decode_args(struct mount struct nfs_args *argp, const char *hostname); static int mountnfs(struct nfs_args *, struct mount *, struct sockaddr *, char *, struct vnode **, - struct ucred *cred, int); + struct ucred *cred, int, int); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, struct sockaddr_storage *, int *, off_t *, struct timeval *); @@ -558,8 +558,8 @@ nfs_mountdiskless(char *path, int error; nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK); - if ((error = mountnfs(args, mp, nam, path, vpp, - td->td_ucred, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { + if ((error = mountnfs(args, mp, nam, path, vpp, td->td_ucred, + NFS_DEFAULT_NAMETIMEO, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { printf("nfs_mountroot: mount %s on /: %d\n", path, error); return (error); } @@ -787,6 +787,7 @@ static const char *nfs_opts[] = { "from" "wsize", "rsize", "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "deadthresh", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", "maxgroups", "principal", "negnametimeo", "nocto", "wcommitsize", + "nametimeo", NULL }; /* @@ -835,6 +836,7 @@ nfs_mount(struct mount *mp) size_t len; u_char nfh[NFSX_V3FHMAX]; char *opt; + int nametimeo = NFS_DEFAULT_NAMETIMEO; int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; has_nfs_args_opt = 0; @@ -1057,6 +1059,14 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_MAXGRPS; } + if (vfs_getopt(mp->mnt_optnew, "nametimeo", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &nametimeo); + if (ret != 1 || nametimeo < 0) { + vfs_mount_error(mp, "illegal nametimeo: %s", opt); + error = EINVAL; + goto out; + } + } if (vfs_getopt(mp->mnt_optnew, "negnametimeo", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &negnametimeo); @@ -1177,7 +1187,7 @@ nfs_mount(struct mount *mp) goto out; } error = mountnfs(&args, mp, nam, args.hostname, &vp, - curthread->td_ucred, negnametimeo); + curthread->td_ucred, nametimeo, negnametimeo); out: if (!error) { MNT_ILOCK(mp); @@ -1219,7 +1229,8 @@ nfs_cmount(struct mntarg *ma, void *data */ static int mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, - char *hst, struct vnode **vpp, struct ucred *cred, int negnametimeo) + char *hst, struct vnode **vpp, struct ucred *cred, int nametimeo, + int negnametimeo) { struct nfsmount *nmp; struct nfsnode *np; @@ -1269,6 +1280,7 @@ mountnfs(struct nfs_args *argp, struct m nmp->nm_numgrps = NFS_MAXGRPS; nmp->nm_readahead = NFS_DEFRAHEAD; nmp->nm_deadthresh = NFS_MAXDEADTHRESH; + nmp->nm_nametimeo = nametimeo; nmp->nm_negnametimeo = negnametimeo; nmp->nm_tprintf_delay = nfs_tprintf_delay; if (nmp->nm_tprintf_delay < 0) Modified: stable/8/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vnops.c Thu Mar 22 21:07:54 2012 (r233326) +++ stable/8/sys/nfsclient/nfs_vnops.c Thu Mar 22 21:08:14 2012 (r233327) @@ -960,7 +960,8 @@ nfs_lookup(struct vop_lookup_args *ap) * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback - * to doing a lookup RPC. + * to doing a lookup RPC. We also only trust cache + * entries for less than nm_nametimeo seconds. * * To better handle stale file handles and attributes, * clear the attribute cache of this node if it is a @@ -981,7 +982,8 @@ nfs_lookup(struct vop_lookup_args *ap) KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); mtx_unlock(&newnp->n_mtx); } - if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && + if ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) && + VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && timespeccmp(&vattr.va_ctime, &nctime, ==)) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && Modified: stable/8/sys/nfsclient/nfsmount.h ============================================================================== --- stable/8/sys/nfsclient/nfsmount.h Thu Mar 22 21:07:54 2012 (r233326) +++ stable/8/sys/nfsclient/nfsmount.h Thu Mar 22 21:08:14 2012 (r233327) @@ -83,6 +83,7 @@ struct nfsmount { struct rpc_timers nm_timers[NFS_MAX_TIMER]; /* RTT Timers for rpcs */ char nm_principal[MNAMELEN]; /* GSS-API principal of server */ gss_OID nm_mech_oid; /* OID of selected GSS-API mechanism */ + int nm_nametimeo; /* timeout for +ve entries (sec) */ int nm_negnametimeo; /* timeout for -ve entries (sec) */ /* NFSv4 */ @@ -116,6 +117,10 @@ struct nfsmount { #define NFS_TPRINTF_DELAY 30 #endif +#ifndef NFS_DEFAULT_NAMETIMEO +#define NFS_DEFAULT_NAMETIMEO 60 +#endif + #ifndef NFS_DEFAULT_NEGNAMETIMEO #define NFS_DEFAULT_NEGNAMETIMEO 60 #endif From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 21:22:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C1D81065670; Thu, 22 Mar 2012 21:22:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37F908FC17; Thu, 22 Mar 2012 21:22:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MLMxM8042027; Thu, 22 Mar 2012 21:22:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MLMxdC042025; Thu, 22 Mar 2012 21:22:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203222122.q2MLMxdC042025@svn.freebsd.org> From: Adrian Chadd Date: Thu, 22 Mar 2012 21:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233328 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 21:22:59 -0000 Author: adrian Date: Thu Mar 22 21:22:58 2012 New Revision: 233328 URL: http://svn.freebsd.org/changeset/base/233328 Log: Fix an incorrect parameter usage here. Submitted by: monthadar@gmail.com Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Thu Mar 22 21:08:14 2012 (r233327) +++ head/sbin/ifconfig/ifieee80211.c Thu Mar 22 21:22:58 2012 (r233328) @@ -1879,7 +1879,7 @@ DECL_CMD_FUNC(set80211meshttl, val, d) static DECL_CMD_FUNC(set80211meshforward, val, d) { - set80211(s, IEEE80211_IOC_MESH_FWRD, atoi(val), 0, NULL); + set80211(s, IEEE80211_IOC_MESH_FWRD, d, 0, NULL); } static From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 21:47:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A99A01065678; Thu, 22 Mar 2012 21:47:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B3A98FC14; Thu, 22 Mar 2012 21:47:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MLlFLS042802; Thu, 22 Mar 2012 21:47:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MLlFWP042800; Thu, 22 Mar 2012 21:47:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203222147.q2MLlFWP042800@svn.freebsd.org> From: Adrian Chadd Date: Thu, 22 Mar 2012 21:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233329 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 21:47:15 -0000 Author: adrian Date: Thu Mar 22 21:47:14 2012 New Revision: 233329 URL: http://svn.freebsd.org/changeset/base/233329 Log: Sprinkle some style(9) things around. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Mar 22 21:22:58 2012 (r233328) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Mar 22 21:47:14 2012 (r233329) @@ -689,7 +689,8 @@ ar5416InitUserSettings(struct ath_hal *a /* Restore user-specified settings */ if (ahp->ah_miscMode != 0) - OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode); + OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) + | ahp->ah_miscMode); if (ahp->ah_sifstime != (u_int) -1) ar5212SetSifsTime(ah, ahp->ah_sifstime); if (ahp->ah_slottime != (u_int) -1) @@ -1188,7 +1189,8 @@ ar5416SetTransmitPower(struct ath_hal *a HAL_RFGAIN ar5416GetRfgain(struct ath_hal *ah) { - return HAL_RFGAIN_INACTIVE; + + return (HAL_RFGAIN_INACTIVE); } /* @@ -1197,13 +1199,14 @@ ar5416GetRfgain(struct ath_hal *ah) HAL_BOOL ar5416Disable(struct ath_hal *ah) { + if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) return AH_FALSE; if (! ar5416SetResetReg(ah, HAL_RESET_COLD)) return AH_FALSE; AH5416(ah)->ah_initPLL(ah, AH_NULL); - return AH_TRUE; + return (AH_TRUE); } /* @@ -1215,11 +1218,12 @@ ar5416Disable(struct ath_hal *ah) HAL_BOOL ar5416PhyDisable(struct ath_hal *ah) { + if (! ar5416SetResetReg(ah, HAL_RESET_WARM)) return AH_FALSE; AH5416(ah)->ah_initPLL(ah, AH_NULL); - return AH_TRUE; + return (AH_TRUE); } /* @@ -1509,6 +1513,7 @@ ar5416SetDefGainValues(struct ath_hal *a const struct ar5416eeprom *eep, uint8_t txRxAttenLocal, int regChainOffset, int i) { + if (IS_EEP_MINOR_V3(ah)) { txRxAttenLocal = pModal->txRxAttenCh[i]; @@ -1705,7 +1710,7 @@ ar5416SetBoardValues(struct ath_hal *ah, eep->baseEepHeader.desiredScaleCCK); } - return AH_TRUE; + return (AH_TRUE); } /* @@ -1739,7 +1744,8 @@ ar5416SetRatesArrayFromTargetPower(struc /* Set rates Array from collected data */ ratesArray[rate6mb] = ratesArray[rate9mb] = ratesArray[rate12mb] = - ratesArray[rate18mb] = ratesArray[rate24mb] = targetPowerOfdm->tPow2x[0]; + ratesArray[rate18mb] = ratesArray[rate24mb] = + targetPowerOfdm->tPow2x[0]; ratesArray[rate36mb] = targetPowerOfdm->tPow2x[1]; ratesArray[rate48mb] = targetPowerOfdm->tPow2x[2]; ratesArray[rate54mb] = targetPowerOfdm->tPow2x[3]; From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 21:48:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 882611065675; Thu, 22 Mar 2012 21:48:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70E3F8FC18; Thu, 22 Mar 2012 21:48:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MLmbHR042878; Thu, 22 Mar 2012 21:48:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MLmba0042876; Thu, 22 Mar 2012 21:48:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203222148.q2MLmba0042876@svn.freebsd.org> From: Adrian Chadd Date: Thu, 22 Mar 2012 21:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233330 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 21:48:37 -0000 Author: adrian Date: Thu Mar 22 21:48:36 2012 New Revision: 233330 URL: http://svn.freebsd.org/changeset/base/233330 Log: Add some further debugging to try and aid tracking down what the state of things were just before a full software queue is drained. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Mar 22 21:47:14 2012 (r233329) +++ head/sys/dev/ath/if_ath_tx.c Thu Mar 22 21:48:36 2012 (r233330) @@ -663,6 +663,15 @@ ath_tx_tag_crypto(struct ath_softc *sc, struct mbuf *m0, int iswep, int isfrag, int *hdrlen, int *pktlen, int *keyix) { + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: hdrlen=%d, pktlen=%d, isfrag=%d, iswep=%d, m0=%p\n", + __func__, + *hdrlen, + *pktlen, + isfrag, + iswep, + m0); + if (iswep) { const struct ieee80211_cipher *cip; struct ieee80211_key *k; @@ -1473,6 +1482,7 @@ ath_tx_start(struct ath_softc *sc, struc /* No AMPDU TX, we've been assigned a sequence number. */ if (IEEE80211_QOS_HAS_SEQ(wh)) { bf->bf_state.bfs_seqno_assigned = 1; + /* XXX we should store the frag+seqno in bfs_seqno */ bf->bf_state.bfs_seqno = M_SEQNO_GET(m0) << IEEE80211_SEQ_SEQ_SHIFT; } @@ -2636,6 +2646,15 @@ ath_tx_tid_drain(struct ath_softc *sc, s if (t == 0) { device_printf(sc->sc_dev, + "%s: node %p: bf=%p: addbaw=%d, dobaw=%d, " + "seqno_assign=%d, seqno_required=%d, seqno=%d\n", + __func__, ni, bf, + bf->bf_state.bfs_addedbaw, + bf->bf_state.bfs_dobaw, + bf->bf_state.bfs_need_seqno, + bf->bf_state.bfs_seqno_assigned, + SEQNO(bf->bf_state.bfs_seqno)); + device_printf(sc->sc_dev, "%s: node %p: bf=%p: tid %d: txq_depth=%d, " "txq_aggr_depth=%d, sched=%d, paused=%d, " "hwq_depth=%d, incomp=%d, baw_head=%d, " From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 00:01:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67EB9106564A; Fri, 23 Mar 2012 00:01:10 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52E2F8FC16; Fri, 23 Mar 2012 00:01:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N01AA7048000; Fri, 23 Mar 2012 00:01:10 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N01A2S047998; Fri, 23 Mar 2012 00:01:10 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203230001.q2N01A2S047998@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 00:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233331 - head/sys/mips/cavium X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 00:01:10 -0000 Author: gonzo Date: Fri Mar 23 00:01:09 2012 New Revision: 233331 URL: http://svn.freebsd.org/changeset/base/233331 Log: Setup fake MODINFO variables for octeon kernel Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Thu Mar 22 21:48:36 2012 (r233330) +++ head/sys/mips/cavium/octeon_machdep.c Fri Mar 23 00:01:09 2012 (r233331) @@ -363,6 +363,8 @@ platform_start(__register_t a0, __regist * entirely. */ + mips_postboot_fixup(); + /* Initialize pcpu stuff */ mips_pcpu0_init(); mips_timer_early_init(OCTEON_CLOCK_DEFAULT); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 00:03:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6BF7E106566B; Fri, 23 Mar 2012 00:03:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57C0C8FC12; Fri, 23 Mar 2012 00:03:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N03Rge048107; Fri, 23 Mar 2012 00:03:27 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N03RR2048105; Fri, 23 Mar 2012 00:03:27 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203230003.q2N03RR2048105@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 00:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233332 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 00:03:27 -0000 Author: gonzo Date: Fri Mar 23 00:03:26 2012 New Revision: 233332 URL: http://svn.freebsd.org/changeset/base/233332 Log: Add Octeon class and CPU type Modified: head/sys/sys/pmc.h Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Fri Mar 23 00:01:09 2012 (r233331) +++ head/sys/sys/pmc.h Fri Mar 23 00:03:26 2012 (r233332) @@ -89,6 +89,7 @@ __PMC_CPU(INTEL_SANDYBRIDGE, 0x8D, "Intel Sandy Bridge") \ __PMC_CPU(INTEL_XSCALE, 0x100, "Intel XScale") \ __PMC_CPU(MIPS_24K, 0x200, "MIPS 24K") \ + __PMC_CPU(MIPS_OCTEON, 0x201, "Cavium Octeon") \ __PMC_CPU(PPC_7450, 0x300, "PowerPC MPC7450") enum pmc_cputype { @@ -116,7 +117,8 @@ enum pmc_cputype { __PMC_CLASS(UCF) /* Intel Uncore fixed function */ \ __PMC_CLASS(UCP) /* Intel Uncore programmable */ \ __PMC_CLASS(XSCALE) /* Intel XScale counters */ \ - __PMC_CLASS(MIPS24K) /* MIPS 24K */ \ + __PMC_CLASS(MIPS24K) /* MIPS 24K */ \ + __PMC_CLASS(OCTEON) /* Cavium Octeon */ \ __PMC_CLASS(PPC7450) /* Motorola MPC7450 class */ enum pmc_class { From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 00:04:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28C2B1065680; Fri, 23 Mar 2012 00:04:10 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13B168FC0C; Fri, 23 Mar 2012 00:04:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N049kC048163; Fri, 23 Mar 2012 00:04:09 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N049RK048161; Fri, 23 Mar 2012 00:04:09 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203230004.q2N049RK048161@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 00:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233333 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 00:04:10 -0000 Author: gonzo Date: Fri Mar 23 00:04:09 2012 New Revision: 233333 URL: http://svn.freebsd.org/changeset/base/233333 Log: Add list of Octeon's PMC counters obtained from cvmx-core.h Modified: head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Fri Mar 23 00:03:26 2012 (r233332) +++ head/sys/dev/hwpmc/pmc_events.h Fri Mar 23 00:04:09 2012 (r233333) @@ -3411,6 +3411,67 @@ __PMC_EV_ALIAS("IMPC_C0H_TRK_REQUEST.ALL #define PMC_EV_MIPS24K_FIRST PMC_EV_MIPS24K_CYCLE #define PMC_EV_MIPS24K_LAST PMC_EV_MIPS24K_WBB_FULL_PIPELINE_STALLS +/* + * Cavium Octeon counters. Obtained from cvmx-core.h + */ +#define __PMC_EV_OCTEON() \ + __PMC_EV(OCTEON, CLK) \ + __PMC_EV(OCTEON, ISSUE) \ + __PMC_EV(OCTEON, RET) \ + __PMC_EV(OCTEON, NISSUE) \ + __PMC_EV(OCTEON, SISSUE) \ + __PMC_EV(OCTEON, DISSUE) \ + __PMC_EV(OCTEON, IFI) \ + __PMC_EV(OCTEON, BR) \ + __PMC_EV(OCTEON, BRMIS) \ + __PMC_EV(OCTEON, J) \ + __PMC_EV(OCTEON, JMIS) \ + __PMC_EV(OCTEON, REPLAY) \ + __PMC_EV(OCTEON, IUNA) \ + __PMC_EV(OCTEON, TRAP) \ + __PMC_EV(OCTEON, UULOAD) \ + __PMC_EV(OCTEON, UUSTORE) \ + __PMC_EV(OCTEON, ULOAD) \ + __PMC_EV(OCTEON, USTORE) \ + __PMC_EV(OCTEON, EC) \ + __PMC_EV(OCTEON, MC) \ + __PMC_EV(OCTEON, CC) \ + __PMC_EV(OCTEON, CSRC) \ + __PMC_EV(OCTEON, CFETCH) \ + __PMC_EV(OCTEON, CPREF) \ + __PMC_EV(OCTEON, ICA) \ + __PMC_EV(OCTEON, II) \ + __PMC_EV(OCTEON, IP) \ + __PMC_EV(OCTEON, CIMISS) \ + __PMC_EV(OCTEON, WBUF) \ + __PMC_EV(OCTEON, WDAT) \ + __PMC_EV(OCTEON, WBUFLD) \ + __PMC_EV(OCTEON, WBUFFL) \ + __PMC_EV(OCTEON, WBUFTR) \ + __PMC_EV(OCTEON, BADD) \ + __PMC_EV(OCTEON, BADDL2) \ + __PMC_EV(OCTEON, BFILL) \ + __PMC_EV(OCTEON, DDIDS) \ + __PMC_EV(OCTEON, IDIDS) \ + __PMC_EV(OCTEON, DIDNA) \ + __PMC_EV(OCTEON, LDS) \ + __PMC_EV(OCTEON, LMLDS) \ + __PMC_EV(OCTEON, IOLDS) \ + __PMC_EV(OCTEON, DMLDS) \ + __PMC_EV(OCTEON, STS) \ + __PMC_EV(OCTEON, LMSTS) \ + __PMC_EV(OCTEON, IOSTS) \ + __PMC_EV(OCTEON, IOBDMA) \ + __PMC_EV(OCTEON, DTLB) \ + __PMC_EV(OCTEON, DTLBAD) \ + __PMC_EV(OCTEON, ITLB) \ + __PMC_EV(OCTEON, SYNC) \ + __PMC_EV(OCTEON, SYNCIOB) \ + __PMC_EV(OCTEON, SYNCW) + +#define PMC_EV_OCTEON_FIRST PMC_EV_OCTEON_CLK +#define PMC_EV_OCTEON_LAST PMC_EV_OCTEON_SYNCW + #define __PMC_EV_PPC7450() \ __PMC_EV(PPC7450, CYCLE) \ __PMC_EV(PPC7450, INSTR_COMPLETED) \ @@ -3677,6 +3738,8 @@ __PMC_EV_ALIAS("IMPC_C0H_TRK_REQUEST.ALL __PMC_EV_XSCALE() \ __PMC_EV_BLOCK(MIPS24K, 0x11300) \ __PMC_EV_MIPS24K() \ + __PMC_EV_BLOCK(OCTEON, 0x11400) \ + __PMC_EV_OCTEON() \ __PMC_EV_BLOCK(UCF, 0x12000) \ __PMC_EV_UCF() \ __PMC_EV_BLOCK(UCP, 0x12080) \ From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 00:09:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A89EA106566B; Fri, 23 Mar 2012 00:09:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 919BC8FC19; Fri, 23 Mar 2012 00:09:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N09RUv048362; Fri, 23 Mar 2012 00:09:27 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N09Rt0048361; Fri, 23 Mar 2012 00:09:27 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203230009.q2N09Rt0048361@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 00:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233334 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 00:09:27 -0000 Author: gonzo Date: Fri Mar 23 00:09:27 2012 New Revision: 233334 URL: http://svn.freebsd.org/changeset/base/233334 Log: Add Octeon PMC hardware backend Added: head/sys/dev/hwpmc/hwpmc_octeon.c (contents, props changed) Added: head/sys/dev/hwpmc/hwpmc_octeon.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hwpmc/hwpmc_octeon.c Fri Mar 23 00:09:27 2012 (r233334) @@ -0,0 +1,195 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#define OCTEON_PMC_CAPS (PMC_CAP_INTERRUPT | PMC_CAP_USER | \ + PMC_CAP_SYSTEM | PMC_CAP_EDGE | \ + PMC_CAP_THRESHOLD | PMC_CAP_READ | \ + PMC_CAP_WRITE | PMC_CAP_INVERT | \ + PMC_CAP_QUALIFIER) + +const struct mips_event_code_map mips_event_codes[] = +{ + { PMC_EV_OCTEON_CLK, MIPS_CTR_ALL, CVMX_CORE_PERF_CLK }, + { PMC_EV_OCTEON_ISSUE, MIPS_CTR_ALL, CVMX_CORE_PERF_ISSUE }, + { PMC_EV_OCTEON_RET, MIPS_CTR_ALL, CVMX_CORE_PERF_RET }, + { PMC_EV_OCTEON_NISSUE, MIPS_CTR_ALL, CVMX_CORE_PERF_NISSUE }, + { PMC_EV_OCTEON_SISSUE, MIPS_CTR_ALL, CVMX_CORE_PERF_SISSUE }, + { PMC_EV_OCTEON_DISSUE, MIPS_CTR_ALL, CVMX_CORE_PERF_DISSUE }, + { PMC_EV_OCTEON_IFI, MIPS_CTR_ALL, CVMX_CORE_PERF_IFI }, + { PMC_EV_OCTEON_BR, MIPS_CTR_ALL, CVMX_CORE_PERF_BR }, + { PMC_EV_OCTEON_BRMIS, MIPS_CTR_ALL, CVMX_CORE_PERF_BRMIS }, + { PMC_EV_OCTEON_J, MIPS_CTR_ALL, CVMX_CORE_PERF_J }, + { PMC_EV_OCTEON_JMIS, MIPS_CTR_ALL, CVMX_CORE_PERF_JMIS }, + { PMC_EV_OCTEON_REPLAY, MIPS_CTR_ALL, CVMX_CORE_PERF_REPLAY }, + { PMC_EV_OCTEON_IUNA, MIPS_CTR_ALL, CVMX_CORE_PERF_IUNA }, + { PMC_EV_OCTEON_TRAP, MIPS_CTR_ALL, CVMX_CORE_PERF_TRAP }, + { PMC_EV_OCTEON_UULOAD, MIPS_CTR_ALL, CVMX_CORE_PERF_UULOAD }, + { PMC_EV_OCTEON_UUSTORE, MIPS_CTR_ALL, CVMX_CORE_PERF_UUSTORE }, + { PMC_EV_OCTEON_ULOAD, MIPS_CTR_ALL, CVMX_CORE_PERF_ULOAD }, + { PMC_EV_OCTEON_USTORE, MIPS_CTR_ALL, CVMX_CORE_PERF_USTORE }, + { PMC_EV_OCTEON_EC, MIPS_CTR_ALL, CVMX_CORE_PERF_EC }, + { PMC_EV_OCTEON_MC, MIPS_CTR_ALL, CVMX_CORE_PERF_MC }, + { PMC_EV_OCTEON_CC, MIPS_CTR_ALL, CVMX_CORE_PERF_CC }, + { PMC_EV_OCTEON_CSRC, MIPS_CTR_ALL, CVMX_CORE_PERF_CSRC }, + { PMC_EV_OCTEON_CFETCH, MIPS_CTR_ALL, CVMX_CORE_PERF_CFETCH }, + { PMC_EV_OCTEON_CPREF, MIPS_CTR_ALL, CVMX_CORE_PERF_CPREF }, + { PMC_EV_OCTEON_ICA, MIPS_CTR_ALL, CVMX_CORE_PERF_ICA }, + { PMC_EV_OCTEON_II, MIPS_CTR_ALL, CVMX_CORE_PERF_II }, + { PMC_EV_OCTEON_IP, MIPS_CTR_ALL, CVMX_CORE_PERF_IP }, + { PMC_EV_OCTEON_CIMISS, MIPS_CTR_ALL, CVMX_CORE_PERF_CIMISS }, + { PMC_EV_OCTEON_WBUF, MIPS_CTR_ALL, CVMX_CORE_PERF_WBUF }, + { PMC_EV_OCTEON_WDAT, MIPS_CTR_ALL, CVMX_CORE_PERF_WDAT }, + { PMC_EV_OCTEON_WBUFLD, MIPS_CTR_ALL, CVMX_CORE_PERF_WBUFLD }, + { PMC_EV_OCTEON_WBUFFL, MIPS_CTR_ALL, CVMX_CORE_PERF_WBUFFL }, + { PMC_EV_OCTEON_WBUFTR, MIPS_CTR_ALL, CVMX_CORE_PERF_WBUFTR }, + { PMC_EV_OCTEON_BADD, MIPS_CTR_ALL, CVMX_CORE_PERF_BADD }, + { PMC_EV_OCTEON_BADDL2, MIPS_CTR_ALL, CVMX_CORE_PERF_BADDL2 }, + { PMC_EV_OCTEON_BFILL, MIPS_CTR_ALL, CVMX_CORE_PERF_BFILL }, + { PMC_EV_OCTEON_DDIDS, MIPS_CTR_ALL, CVMX_CORE_PERF_DDIDS }, + { PMC_EV_OCTEON_IDIDS, MIPS_CTR_ALL, CVMX_CORE_PERF_IDIDS }, + { PMC_EV_OCTEON_DIDNA, MIPS_CTR_ALL, CVMX_CORE_PERF_DIDNA }, + { PMC_EV_OCTEON_LDS, MIPS_CTR_ALL, CVMX_CORE_PERF_LDS }, + { PMC_EV_OCTEON_LMLDS, MIPS_CTR_ALL, CVMX_CORE_PERF_LMLDS }, + { PMC_EV_OCTEON_IOLDS, MIPS_CTR_ALL, CVMX_CORE_PERF_IOLDS }, + { PMC_EV_OCTEON_DMLDS, MIPS_CTR_ALL, CVMX_CORE_PERF_DMLDS }, + { PMC_EV_OCTEON_STS, MIPS_CTR_ALL, CVMX_CORE_PERF_STS }, + { PMC_EV_OCTEON_LMSTS, MIPS_CTR_ALL, CVMX_CORE_PERF_LMSTS }, + { PMC_EV_OCTEON_IOSTS, MIPS_CTR_ALL, CVMX_CORE_PERF_IOSTS }, + { PMC_EV_OCTEON_IOBDMA, MIPS_CTR_ALL, CVMX_CORE_PERF_IOBDMA }, + { PMC_EV_OCTEON_DTLB, MIPS_CTR_ALL, CVMX_CORE_PERF_DTLB }, + { PMC_EV_OCTEON_DTLBAD, MIPS_CTR_ALL, CVMX_CORE_PERF_DTLBAD }, + { PMC_EV_OCTEON_ITLB, MIPS_CTR_ALL, CVMX_CORE_PERF_ITLB }, + { PMC_EV_OCTEON_SYNC, MIPS_CTR_ALL, CVMX_CORE_PERF_SYNC }, + { PMC_EV_OCTEON_SYNCIOB, MIPS_CTR_ALL, CVMX_CORE_PERF_SYNCIOB }, + { PMC_EV_OCTEON_SYNCW, MIPS_CTR_ALL, CVMX_CORE_PERF_SYNCW }, +}; + +const int mips_event_codes_size = + sizeof(mips_event_codes) / sizeof(mips_event_codes[0]); + +struct mips_pmc_spec mips_pmc_spec = { + .ps_cpuclass = PMC_CLASS_OCTEON, + .ps_cputype = PMC_CPU_MIPS_OCTEON, + .ps_capabilities = OCTEON_PMC_CAPS, + .ps_counter_width = 64 +}; + +/* + * Performance Count Register N + */ +uint64_t +mips_pmcn_read(unsigned int pmc) +{ + uint64_t reg = 0; + + KASSERT(pmc < mips_npmcs, ("[mips,%d] illegal PMC number %d", + __LINE__, pmc)); + + /* The counter value is the next value after the control register. */ + switch (pmc) { + case 0: + CVMX_MF_COP0(reg, COP0_PERFVALUE0); + break; + case 1: + CVMX_MF_COP0(reg, COP0_PERFVALUE1); + break; + default: + return 0; + } + return (reg); +} + +uint64_t +mips_pmcn_write(unsigned int pmc, uint64_t reg) +{ + + KASSERT(pmc < mips_npmcs, ("[mips,%d] illegal PMC number %d", + __LINE__, pmc)); + + switch (pmc) { + case 0: + CVMX_MT_COP0(reg, COP0_PERFVALUE0); + break; + case 1: + CVMX_MT_COP0(reg, COP0_PERFVALUE1); + break; + default: + return 0; + } + return (reg); +} + +uint32_t +mips_get_perfctl(int cpu, int ri, uint32_t event, uint32_t caps) +{ + cvmx_core_perf_control_t control; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < mips_npmcs, + ("[mips,%d] illegal row index %d", __LINE__, ri)); + + control.s.event = event; + + if (caps & PMC_CAP_SYSTEM) { + control.s.k = 1; + control.s.s = 1; + control.s.ex = 1; + } + + if (caps & PMC_CAP_USER) + control.s.u = 1; + + if ((caps & (PMC_CAP_USER | PMC_CAP_SYSTEM)) == 0) { + control.s.k = 1; + control.s.s = 1; + control.s.u = 1; + control.s.ex = 1; + } + + if (caps & PMC_CAP_INTERRUPT) + control.s.ie = 1; + + PMCDBG(MDP,ALL,2,"mips-allocate ri=%d -> config=0x%x", ri, control.u32); + + return (control.u32); +} From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 00:10:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EF2B1065673; Fri, 23 Mar 2012 00:10:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70D668FC17; Fri, 23 Mar 2012 00:10:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N0AMFJ048428; Fri, 23 Mar 2012 00:10:22 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N0AMLj048426; Fri, 23 Mar 2012 00:10:22 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203230010.q2N0AMLj048426@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 00:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233335 - head/lib/libpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 00:10:22 -0000 Author: gonzo Date: Fri Mar 23 00:10:21 2012 New Revision: 233335 URL: http://svn.freebsd.org/changeset/base/233335 Log: Add Octeon-related parts to libpmc Modified: head/lib/libpmc/libpmc.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Fri Mar 23 00:09:27 2012 (r233334) +++ head/lib/libpmc/libpmc.c Fri Mar 23 00:10:21 2012 (r233335) @@ -152,6 +152,7 @@ PMC_CLASSDEP_TABLE(p5, P5); PMC_CLASSDEP_TABLE(p6, P6); PMC_CLASSDEP_TABLE(xscale, XSCALE); PMC_CLASSDEP_TABLE(mips24k, MIPS24K); +PMC_CLASSDEP_TABLE(octeon, OCTEON); PMC_CLASSDEP_TABLE(ucf, UCF); PMC_CLASSDEP_TABLE(ppc7450, PPC7450); @@ -227,6 +228,7 @@ PMC_MDEP_TABLE(p5, P5, PMC_CLASS_TSC); PMC_MDEP_TABLE(p6, P6, PMC_CLASS_TSC); PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_XSCALE); PMC_MDEP_TABLE(mips24k, MIPS24K, PMC_CLASS_MIPS24K); +PMC_MDEP_TABLE(octeon, OCTEON, PMC_CLASS_OCTEON); PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_PPC7450); static const struct pmc_event_descr tsc_event_table[] = @@ -280,6 +282,7 @@ PMC_CLASS_TABLE_DESC(xscale, XSCALE, xsc #if defined(__mips__) PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, mips24k, mips); +PMC_CLASS_TABLE_DESC(octeon, OCTEON, octeon, mips); #endif /* __mips__ */ #if defined(__powerpc__) @@ -2208,6 +2211,13 @@ static struct pmc_event_alias mips24k_al EV_ALIAS(NULL, NULL) }; +static struct pmc_event_alias octeon_aliases[] = { + EV_ALIAS("instructions", "RET"), + EV_ALIAS("branches", "BR"), + EV_ALIAS("branch-mispredicts", "BRMIS"), + EV_ALIAS(NULL, NULL) +}; + #define MIPS_KW_OS "os" #define MIPS_KW_USR "usr" #define MIPS_KW_ANYTHREAD "anythread" @@ -2645,6 +2655,10 @@ pmc_event_names_of_class(enum pmc_class ev = mips24k_event_table; count = PMC_EVENT_TABLE_SIZE(mips24k); break; + case PMC_CLASS_OCTEON: + ev = octeon_event_table; + count = PMC_EVENT_TABLE_SIZE(octeon); + break; case PMC_CLASS_PPC7450: ev = ppc7450_event_table; count = PMC_EVENT_TABLE_SIZE(ppc7450); @@ -2864,6 +2878,10 @@ pmc_init(void) PMC_MDEP_INIT(mips24k); pmc_class_table[n] = &mips24k_class_table_descr; break; + case PMC_CPU_MIPS_OCTEON: + PMC_MDEP_INIT(octeon); + pmc_class_table[n] = &octeon_class_table_descr; + break; #endif /* __mips__ */ #if defined(__powerpc__) case PMC_CPU_PPC_7450: @@ -3019,6 +3037,9 @@ _pmc_name_of_event(enum pmc_event pe, en ev = mips24k_event_table; evfence = mips24k_event_table + PMC_EVENT_TABLE_SIZE(mips24k ); + } else if (pe >= PMC_EV_OCTEON_FIRST && pe <= PMC_EV_OCTEON_LAST) { + ev = octeon_event_table; + evfence = octeon_event_table + PMC_EVENT_TABLE_SIZE(octeon); } else if (pe >= PMC_EV_PPC7450_FIRST && pe <= PMC_EV_PPC7450_LAST) { ev = ppc7450_event_table; evfence = ppc7450_event_table + PMC_EVENT_TABLE_SIZE(ppc7450 From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 00:11:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 463701065676; Fri, 23 Mar 2012 00:11:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 266348FC17; Fri, 23 Mar 2012 00:11:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N0BtcV048517; Fri, 23 Mar 2012 00:11:55 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N0BsG1048514; Fri, 23 Mar 2012 00:11:54 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203230011.q2N0BsG1048514@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 00:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233336 - head/sys/mips/cavium X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 00:11:55 -0000 Author: gonzo Date: Fri Mar 23 00:11:54 2012 New Revision: 233336 URL: http://svn.freebsd.org/changeset/base/233336 Log: Add pseudo-device for handling PMC interrupts and link everything PMC-related to build Added: head/sys/mips/cavium/octeon_pmc.c (contents, props changed) Modified: head/sys/mips/cavium/files.octeon1 Modified: head/sys/mips/cavium/files.octeon1 ============================================================================== --- head/sys/mips/cavium/files.octeon1 Fri Mar 23 00:10:21 2012 (r233335) +++ head/sys/mips/cavium/files.octeon1 Fri Mar 23 00:11:54 2012 (r233336) @@ -8,6 +8,7 @@ mips/cavium/octeon_ds1337.c standard mips/cavium/octeon_ebt3000_cf.c optional cf mips/cavium/octeon_machdep.c standard mips/cavium/octeon_mp.c optional smp +mips/cavium/octeon_pmc.c optional hwpmc mips/cavium/octeon_rtc.c standard mips/cavium/uart_bus_octeonusart.c optional uart mips/cavium/uart_cpu_octeonusart.c optional uart @@ -88,3 +89,6 @@ contrib/octeon-sdk/cvmx-thunder.c stand contrib/octeon-sdk/cvmx-twsi.c standard contrib/octeon-sdk/cvmx-warn.c standard contrib/octeon-sdk/octeon-model.c standard + +# HWPMC +dev/hwpmc/hwpmc_octeon.c optional hwpmc Added: head/sys/mips/cavium/octeon_pmc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octeon_pmc.c Fri Mar 23 00:11:54 2012 (r233336) @@ -0,0 +1,141 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +struct octeon_pmc_softc { + struct rman irq_rman; + struct resource *octeon_pmc_irq; +}; + +static void octeon_pmc_identify(driver_t *, device_t); +static int octeon_pmc_probe(device_t); +static int octeon_pmc_attach(device_t); +static int octeon_pmc_intr(void *); + +#define OCTEON_PMC_IRQ 4 + +static void +octeon_pmc_identify(driver_t *drv, device_t parent) +{ + if (octeon_has_feature(OCTEON_FEATURE_USB)) + BUS_ADD_CHILD(parent, 0, "pmc", 0); +} + +static int +octeon_pmc_probe(device_t dev) +{ + if (device_get_unit(dev) != 0) + return (ENXIO); + + device_set_desc(dev, "Cavium Octeon Performance Counters"); + return (0); +} + +static int +octeon_pmc_attach(device_t dev) +{ + struct octeon_pmc_softc *sc; + int error; + int rid; + uint64_t cvmctl; + + sc = device_get_softc(dev); + + rid = 0; + sc->octeon_pmc_irq = bus_alloc_resource(dev, + SYS_RES_IRQ, &rid, OCTEON_PMC_IRQ, + OCTEON_PMC_IRQ, 1, RF_ACTIVE); + + if (sc->octeon_pmc_irq == NULL) { + device_printf(dev, "could not allocate irq%d\n", OCTEON_PMC_IRQ); + return (ENXIO); + } + + error = bus_setup_intr(dev, sc->octeon_pmc_irq, + INTR_TYPE_MISC, octeon_pmc_intr, NULL, sc, NULL); + if (error != 0) { + device_printf(dev, "bus_setup_intr failed: %d\n", error); + return (error); + } + + /* + * Move the Performance Counter interrupt to OCTEON_PMC_IRQ + */ + cvmctl = mips_rd_cvmctl(); + cvmctl &= ~(7 << 7); + cvmctl |= (OCTEON_PMC_IRQ + 2) << 7; + mips_wr_cvmctl(cvmctl); + + return (0); +} + +static int +octeon_pmc_intr(void *arg) +{ + struct trapframe *tf = PCPU_GET(curthread)->td_intr_frame; + + if (pmc_intr) + (*pmc_intr)(PCPU_GET(cpuid), tf); + + return (FILTER_HANDLED); +} + +static device_method_t octeon_pmc_methods[] = { + DEVMETHOD(device_identify, octeon_pmc_identify), + DEVMETHOD(device_probe, octeon_pmc_probe), + DEVMETHOD(device_attach, octeon_pmc_attach), + { 0, 0 } +}; + +static driver_t octeon_pmc_driver = { + "pmc", + octeon_pmc_methods, + sizeof(struct octeon_pmc_softc), +}; +static devclass_t octeon_pmc_devclass; +DRIVER_MODULE(octeon_pmc, nexus, octeon_pmc_driver, octeon_pmc_devclass, 0, 0); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 03:16:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2914A1065670; Fri, 23 Mar 2012 03:16:36 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AE8B8FC15; Fri, 23 Mar 2012 03:16:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N3GZeI054608; Fri, 23 Mar 2012 03:16:35 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N3GZW8054603; Fri, 23 Mar 2012 03:16:35 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201203230316.q2N3GZW8054603@svn.freebsd.org> From: Stanislav Sedov Date: Fri, 23 Mar 2012 03:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233337 - in head: . lib tools/build/mk usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 03:16:36 -0000 Author: stas Date: Fri Mar 23 03:16:35 2012 New Revision: 233337 URL: http://svn.freebsd.org/changeset/base/233337 Log: - Do not build libcom_err and compile_et when kerberos is disabled. They depends on several heimdal libraries and not used by anything but kerberos tools. Modified: head/Makefile.inc1 head/lib/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Mar 23 00:11:54 2012 (r233336) +++ head/Makefile.inc1 Fri Mar 23 03:16:35 2012 (r233337) @@ -1254,7 +1254,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ ${_kerberos5_lib_libroken} \ ${_kerberos5_lib_libwind} \ - lib/libbz2 lib/libcom_err lib/libcrypt \ + lib/libbz2 ${_libcom_err} lib/libcrypt \ lib/libexpat \ ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ @@ -1341,6 +1341,7 @@ _kerberos5_lib_libheimntlm= kerberos5/li _kerberos5_lib_libheimsqlite= kerberos5/lib/libheimsqlite _kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc _kerberos5_lib_libwind= kerberos5/lib/libwind +_libcom_err= lib/libcom_err .endif .if ${MK_NIS} != "no" Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Fri Mar 23 00:11:54 2012 (r233336) +++ head/lib/Makefile Fri Mar 23 03:16:35 2012 (r233337) @@ -33,7 +33,6 @@ SUBDIR_ORDERED= ${_csu} \ libc \ libbsm \ libauditd \ - libcom_err \ libcompiler_rt \ libcrypt \ libelf \ @@ -52,6 +51,10 @@ SUBDIR_ORDERED= ${_csu} \ ${_libcxxrt} \ ${_libcplusplus} +.if ${MK_KERBEROS_SUPPORT} != "no" +SUBDIR_ORDERED+= libcom_err +.endif + SUBDIR= ${SUBDIR_ORDERED} \ libalias \ libarchive \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Mar 23 00:11:54 2012 (r233336) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Mar 23 03:16:35 2012 (r233337) @@ -2184,6 +2184,7 @@ OLD_FILES+=usr/share/man/man8/jls.8.gz .endif .if ${MK_KERBEROS} == no +OLD_FILES+=usr/bin/compile_et OLD_FILES+=usr/bin/hxtool OLD_FILES+=usr/bin/kadmin OLD_FILES+=usr/bin/kdestroy @@ -2266,6 +2267,11 @@ OLD_FILES+=usr/lib/libasn1.a OLD_FILES+=usr/lib/libasn1.so OLD_LIBS+=usr/lib/libasn1.so.10 OLD_FILES+=usr/lib/libasn1_p.a +OLD_FILES+=usr/lib/libcom_err.a +OLD_FILES+=usr/lib/libcom_err.so +OLD_LIBS+=usr/lib/libcom_err.so.5 +OLD_FILES+=usr/lib/libcom_err_p.a +OLD_FILES+=usr/lib/libcom_err_p.a OLD_FILES+=usr/lib/libgssapi_krb5.a OLD_FILES+=usr/lib/libgssapi_krb5.so OLD_LIBS+=usr/lib/libgssapi_krb5.so.10 Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Fri Mar 23 00:11:54 2012 (r233336) +++ head/usr.bin/Makefile Fri Mar 23 03:16:35 2012 (r233337) @@ -261,6 +261,10 @@ SUBDIR+= csup SUBDIR+= locate .endif +.if ${MK_KERBEROS_SUPPORT} != "no" +SUBDIR+= compile_et +.endif + # XXX msgs? .if ${MK_MAIL} != "no" SUBDIR+= biff @@ -317,7 +321,6 @@ SUBDIR+= ul SUBDIR+= ar SUBDIR+= c89 SUBDIR+= c99 -SUBDIR+= compile_et SUBDIR+= ctags SUBDIR+= file2c SUBDIR+= gprof From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 03:43:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B117A1065670; Fri, 23 Mar 2012 03:43:04 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B31F8FC0A; Fri, 23 Mar 2012 03:43:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N3h4Pg055400; Fri, 23 Mar 2012 03:43:04 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N3h4M7055398; Fri, 23 Mar 2012 03:43:04 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201203230343.q2N3h4M7055398@svn.freebsd.org> From: Stanislav Sedov Date: Fri, 23 Mar 2012 03:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233338 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 03:43:04 -0000 Author: stas Date: Fri Mar 23 03:43:04 2012 New Revision: 233338 URL: http://svn.freebsd.org/changeset/base/233338 Log: - Add new kerberos libraries to the list of optional obsolete files. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Mar 23 03:16:35 2012 (r233337) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Mar 23 03:43:04 2012 (r233338) @@ -2265,7 +2265,7 @@ OLD_FILES+=usr/include/wind_err.h OLD_FILES+=usr/include/xdbm.h OLD_FILES+=usr/lib/libasn1.a OLD_FILES+=usr/lib/libasn1.so -OLD_LIBS+=usr/lib/libasn1.so.10 +OLD_LIBS+=usr/lib/libasn1.so.11 OLD_FILES+=usr/lib/libasn1_p.a OLD_FILES+=usr/lib/libcom_err.a OLD_FILES+=usr/lib/libcom_err.so @@ -2288,10 +2288,18 @@ OLD_FILES+=usr/lib/libhdb.a OLD_FILES+=usr/lib/libhdb.so OLD_LIBS+=usr/lib/libhdb.so.11 OLD_FILES+=usr/lib/libhdb_p.a +OLD_FILES+=usr/lib/libheimbase.a +OLD_FILES+=usr/lib/libheimbase.so +OLD_LIBS+=usr/lib/libheimbase.so.11 +OLD_FILES+=usr/lib/libheimbase_p.a OLD_FILES+=usr/lib/libheimntlm.a OLD_FILES+=usr/lib/libheimntlm.so OLD_LIBS+=usr/lib/libheimntlm.so.11 OLD_FILES+=usr/lib/libheimntlm_p.a +OLD_FILES+=usr/lib/libheimsqlite.a +OLD_FILES+=usr/lib/libheimsqlite.so +OLD_LIBS+=usr/lib/libheimsqlite.so.11 +OLD_FILES+=usr/lib/libheimsqlite_p.a OLD_FILES+=usr/lib/libhx509.a OLD_FILES+=usr/lib/libhx509.so OLD_LIBS+=usr/lib/libhx509.so.11 @@ -2308,6 +2316,10 @@ OLD_FILES+=usr/lib/libkafs5.a OLD_FILES+=usr/lib/libkafs5.so OLD_LIBS+=usr/lib/libkafs5.so.11 OLD_FILES+=usr/lib/libkafs5_p.a +OLD_FILES+=usr/lib/libkdc.a +OLD_FILES+=usr/lib/libkdc.so +OLD_LIBS+=usr/lib/libkdc.so.11 +OLD_FILES+=usr/lib/libkdc_p.a OLD_FILES+=usr/lib/libkrb5.a OLD_FILES+=usr/lib/libkrb5.so OLD_LIBS+=usr/lib/libkrb5.so.11 @@ -2316,6 +2328,10 @@ OLD_FILES+=usr/lib/libroken.a OLD_FILES+=usr/lib/libroken.so OLD_LIBS+=usr/lib/libroken.so.11 OLD_FILES+=usr/lib/libroken_p.a +OLD_FILES+=usr/lib/libwind.a +OLD_FILES+=usr/lib/libwind.so +OLD_LIBS+=usr/lib/libwind.so.11 +OLD_FILES+=usr/lib/libwind_p.a OLD_FILES+=usr/lib/pam_krb5.so OLD_LIBS+=usr/lib/pam_krb5.so.5 OLD_FILES+=usr/lib/pam_ksu.so @@ -2341,10 +2357,18 @@ OLD_FILES+=usr/lib32/libhdb.a OLD_FILES+=usr/lib32/libhdb.so OLD_LIBS+=usr/lib32/libhdb.so.11 OLD_FILES+=usr/lib32/libhdb_p.a +OLD_FILES+=usr/lib32/libheimbase.a +OLD_FILES+=usr/lib32/libheimbase.so +OLD_LIBS+=usr/lib32/libheimbase.so.11 +OLD_FILES+=usr/lib32/libheimbase_p.a OLD_FILES+=usr/lib32/libheimntlm.a OLD_FILES+=usr/lib32/libheimntlm.so OLD_LIBS+=usr/lib32/libheimntlm.so.11 OLD_FILES+=usr/lib32/libheimntlm_p.a +OLD_FILES+=usr/lib32/libheimsqlite.a +OLD_FILES+=usr/lib32/libheimsqlite.so +OLD_LIBS+=usr/lib32/libheimsqlite.so.11 +OLD_FILES+=usr/lib32/libheimsqlite_p.a OLD_FILES+=usr/lib32/libhx509.a OLD_FILES+=usr/lib32/libhx509.so OLD_LIBS+=usr/lib32/libhx509.so.11 @@ -2361,6 +2385,10 @@ OLD_FILES+=usr/lib32/libkafs5.a OLD_FILES+=usr/lib32/libkafs5.so OLD_LIBS+=usr/lib32/libkafs5.so.11 OLD_FILES+=usr/lib32/libkafs5_p.a +OLD_FILES+=usr/lib32/libkdc.a +OLD_FILES+=usr/lib32/libkdc.so +OLD_LIBS+=usr/lib32/libkdc.so.11 +OLD_FILES+=usr/lib32/libkdc_p.a OLD_FILES+=usr/lib32/libkrb5.a OLD_FILES+=usr/lib32/libkrb5.so OLD_LIBS+=usr/lib32/libkrb5.so.11 @@ -2369,6 +2397,10 @@ OLD_FILES+=usr/lib32/libroken.a OLD_FILES+=usr/lib32/libroken.so OLD_LIBS+=usr/lib32/libroken.so.11 OLD_FILES+=usr/lib32/libroken_p.a +OLD_FILES+=usr/lib32/libwind.a +OLD_FILES+=usr/lib32/libwind.so +OLD_LIBS+=usr/lib32/libwind.so.11 +OLD_FILES+=usr/lib32/libwind_p.a OLD_FILES+=usr/lib32/pam_krb5.so OLD_LIBS+=usr/lib32/pam_krb5.so.5 OLD_FILES+=usr/lib32/pam_ksu.so @@ -3495,6 +3527,8 @@ OLD_FILES+=usr/lib/libgpib_p.a OLD_FILES+=usr/lib/libgssapi_krb5_p.a OLD_FILES+=usr/lib/libgssapi_p.a OLD_FILES+=usr/lib/libhdb_p.a +OLD_FILES+=usr/lib/libheimbase_p.a +OLD_FILES+=usr/lib/libheimsqlite_p.a OLD_FILES+=usr/lib/libhistory_p.a OLD_FILES+=usr/lib/libipsec_p.a OLD_FILES+=usr/lib/libipx_p.a @@ -3502,6 +3536,7 @@ OLD_FILES+=usr/lib/libjail_p.a OLD_FILES+=usr/lib/libkadm5clnt_p.a OLD_FILES+=usr/lib/libkadm5srv_p.a OLD_FILES+=usr/lib/libkafs5_p.a +OLD_FILES+=usr/lib/libkdc_p.a OLD_FILES+=usr/lib/libkiconv_p.a OLD_FILES+=usr/lib/libkrb5_p.a OLD_FILES+=usr/lib/libkvm_p.a @@ -3554,6 +3589,7 @@ OLD_FILES+=usr/lib/libugidfw_p.a OLD_FILES+=usr/lib/libusbhid_p.a OLD_FILES+=usr/lib/libutil_p.a OLD_FILES+=usr/lib/libvgl_p.a +OLD_FILES+=usr/lib/libwind_p.a OLD_FILES+=usr/lib/libwrap_p.a OLD_FILES+=usr/lib/liby_p.a OLD_FILES+=usr/lib/libypclnt_p.a From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 06:01:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C580106566C; Fri, 23 Mar 2012 06:01:17 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DA638FC12; Fri, 23 Mar 2012 06:01:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N61Hrb059744; Fri, 23 Mar 2012 06:01:17 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N61H7q059742; Fri, 23 Mar 2012 06:01:17 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203230601.q2N61H7q059742@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 23 Mar 2012 06:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233339 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 06:01:17 -0000 Author: pluknet Date: Fri Mar 23 06:01:16 2012 New Revision: 233339 URL: http://svn.freebsd.org/changeset/base/233339 Log: Update IFF_* macro descriptions. MFC after: 1 week Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Fri Mar 23 03:43:04 2012 (r233338) +++ head/share/man/man9/ifnet.9 Fri Mar 23 06:01:16 2012 (r233339) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2012 +.Dd March 23, 2012 .Dt IFNET 9 .Os .Sh NAME @@ -583,6 +583,14 @@ The interface is a loopback device. The interface is point-to-point; .Dq broadcast address is actually the address of the other end. +.It Dv IFF_SMART +.Aq S* +The interface manages its own routes, rather than using the generic +code in +.Fn if_up +and +.Fn if_down . +This is probably useful for serial lines. .It Dv IFF_DRV_RUNNING .Aq D* The interface has been configured and dynamic resources were @@ -619,14 +627,31 @@ multiple physical layers on some devices .It Dv IFF_MULTICAST .Aq S* This interface supports multicast. -.It Dv IFF_POLLING +.It Dv IFF_CANTCONFIG +.Aq S* +The interface isn't configurable in a meaningful way. +Primarily useful for +.Dv IFT_USB +interfaces registered at the interface list. +.It Dv IFF_MONITOR +.Aq D +This interface blocks transmission of packets and discards incoming +packets after BPF processing. +Used to monitor network trafic but not interact +with the network in question. +.It Dv IFF_STATICARP +.Aq D +Used to enable/disable ARP requests on this interface. +.It Dv IFF_DYING .Aq D* -The interface is in -.Xr polling 4 -mode. -See -.Sx Interface Capabilities Flags -for details. +Set when the +.Vt ifnet +structure of this interface is being released and still has +.Va if_refcount +references. +.It Dv IFF_RENAMING +.Aq D* +Set when this interface is being renamed. .El .Ss "Interface Capabilities Flags" Interface capabilities are specialized features an interface may From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 06:06:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6AA781065676; Fri, 23 Mar 2012 06:06:38 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 551ED8FC0C; Fri, 23 Mar 2012 06:06:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N66cNW059936; Fri, 23 Mar 2012 06:06:38 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N66cFM059934; Fri, 23 Mar 2012 06:06:38 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203230606.q2N66cFM059934@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 23 Mar 2012 06:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233340 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 06:06:38 -0000 Author: pluknet Date: Fri Mar 23 06:06:37 2012 New Revision: 233340 URL: http://svn.freebsd.org/changeset/base/233340 Log: Document IFT_USB referenced by IFF_CANTCONFIG since the previous change, so that ifnet(9) is self contained. MFC after: 1 week Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Fri Mar 23 06:01:16 2012 (r233339) +++ head/share/man/man9/ifnet.9 Fri Mar 23 06:06:37 2012 (r233340) @@ -1026,6 +1026,8 @@ Parallel-port IP .Pq Dq Tn PLIP .It Dv IFT_ATM Asynchronous Transfer Mode +.It Dv IFT_USB +USB Interface .El .Ss Interface Link States The following link states are currently defined: From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 06:57:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79598106566C; Fri, 23 Mar 2012 06:57:05 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64CD98FC0C; Fri, 23 Mar 2012 06:57:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N6v5mD061635; Fri, 23 Mar 2012 06:57:05 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N6v5lT061633; Fri, 23 Mar 2012 06:57:05 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203230657.q2N6v5lT061633@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 23 Mar 2012 06:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233341 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 06:57:05 -0000 Author: pluknet Date: Fri Mar 23 06:57:04 2012 New Revision: 233341 URL: http://svn.freebsd.org/changeset/base/233341 Log: Remove archive_entry_*_w(3) entries from ObsoleteFiles.inc. Since the recent libarchive import they are MLINK'ed again. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Mar 23 06:06:37 2012 (r233340) +++ head/ObsoleteFiles.inc Fri Mar 23 06:57:04 2012 (r233341) @@ -4600,9 +4600,7 @@ OLD_FILES+=usr/share/man/man1/x509.1.gz OLD_FILES+=usr/share/man/man3/SSL_COMP_add_compression_method.3.gz OLD_FILES+=usr/share/man/man3/SSL_CTX_get_ex_new_index.3.gz OLD_FILES+=usr/share/man/man3/archive_entry_dup.3.gz -OLD_FILES+=usr/share/man/man3/archive_entry_hardlink_w.3.gz OLD_FILES+=usr/share/man/man3/archive_entry_set_tartype.3.gz -OLD_FILES+=usr/share/man/man3/archive_entry_symlink_w.3.gz OLD_FILES+=usr/share/man/man3/archive_entry_tartype.3.gz OLD_FILES+=usr/share/man/man3/archive_read_data_into_file.3.gz OLD_FILES+=usr/share/man/man3/archive_read_open_tar.3.gz From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 07:26:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1654B1065670; Fri, 23 Mar 2012 07:26:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 017E58FC1B; Fri, 23 Mar 2012 07:26:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N7QHLf062583; Fri, 23 Mar 2012 07:26:17 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N7QH06062581; Fri, 23 Mar 2012 07:26:17 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201203230726.q2N7QH06062581@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 23 Mar 2012 07:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233342 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 07:26:18 -0000 Author: ae Date: Fri Mar 23 07:26:17 2012 New Revision: 233342 URL: http://svn.freebsd.org/changeset/base/233342 Log: Check that scheme is not already registered. This may happens when a KLD is preloaded with loader(8) and leads to infinity loops. Also do not return EEXIST error code from MOD_LOAD handler, because we have undocumented(?) ability replace kernel's module with preloaded one. And if we have so, then preloaded module will be initialized first. Thus error in MOD_LOAD handler will be triggered for the kernel. PR: kern/165573 MFC after: 3 weeks Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri Mar 23 06:57:04 2012 (r233341) +++ head/sys/geom/part/g_part.c Fri Mar 23 07:26:17 2012 (r233342) @@ -2211,23 +2211,32 @@ g_part_unload_event(void *arg, int flag) int g_part_modevent(module_t mod, int type, struct g_part_scheme *scheme) { + struct g_part_scheme *iter; uintptr_t arg; int error; + error = 0; switch (type) { case MOD_LOAD: - TAILQ_INSERT_TAIL(&g_part_schemes, scheme, scheme_list); - - error = g_retaste(&g_part_class); - if (error) - TAILQ_REMOVE(&g_part_schemes, scheme, scheme_list); + TAILQ_FOREACH(iter, &g_part_schemes, scheme_list) { + if (scheme == iter) { + printf("GEOM_PART: scheme %s is already " + "registered!\n", scheme->name); + break; + } + } + if (iter == NULL) { + TAILQ_INSERT_TAIL(&g_part_schemes, scheme, + scheme_list); + g_retaste(&g_part_class); + } break; case MOD_UNLOAD: arg = (uintptr_t)scheme; error = g_waitfor_event(g_part_unload_event, &arg, M_WAITOK, NULL); - if (!error) - error = (arg == (uintptr_t)scheme) ? EDOOFUS : arg; + if (error == 0) + error = arg; break; default: error = EOPNOTSUPP; From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 07:45:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C7A11065670; Fri, 23 Mar 2012 07:45:12 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC9068FC14; Fri, 23 Mar 2012 07:45:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N7jBh4063222; Fri, 23 Mar 2012 07:45:11 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N7jBhI063220; Fri, 23 Mar 2012 07:45:11 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201203230745.q2N7jBhI063220@svn.freebsd.org> From: Stanislav Sedov Date: Fri, 23 Mar 2012 07:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233343 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 07:45:12 -0000 Author: stas Date: Fri Mar 23 07:45:11 2012 New Revision: 233343 URL: http://svn.freebsd.org/changeset/base/233343 Log: - Take krb5_verify_user.3.gz out of ObsoleteFiles as it's still being installed. - Add 32-bit compat old kerberos libraries to ObsoleteFiles as well. Reported by: pluknet@ Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Mar 23 07:26:17 2012 (r233342) +++ head/ObsoleteFiles.inc Fri Mar 23 07:45:11 2012 (r233343) @@ -56,7 +56,6 @@ OLD_FILES+=usr/include/krb5-v4compat.h \ usr/share/man/man3/krb5_kt_cursor.3.gz \ usr/share/man/man3/krb5_kt_ops.3.gz \ usr/share/man/man3/krb5_set_warn_dest.3.gz \ - usr/share/man/man3/krb5_verify_user.3.gz \ usr/share/man/man3/krb5_verr.3.gz \ usr/share/man/man3/krb5_verrx.3.gz \ usr/share/man/man3/krb5_vwarnx.3.gz \ @@ -70,7 +69,16 @@ OLD_LIBS+=usr/lib/libasn1.so.10 \ usr/lib/libkadm5srv.so.10 \ usr/lib/libkafs5.so.10 \ usr/lib/libkrb5.so.10 \ - usr/lib/libroken.so.10 + usr/lib/libroken.so.10 \ + usr/lib32/libasn1.so.10 \ + usr/lib32/libhdb.so.10 \ + usr/lib32/libheimntlm.so.10 \ + usr/lib32/libhx509.so.10 \ + usr/lib32/libkadm5clnt.so.10 \ + usr/lib32/libkadm5srv.so.10 \ + usr/lib32/libkafs5.so.10 \ + usr/lib32/libkrb5.so.10 \ + usr/lib32/libroken.so.10 # 20120309: Remove fifofs header files. OLD_FILES+=usr/include/fs/fifofs/fifo.h OLD_DIRS+=usr/include/fs/fifofs From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 07:52:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 310A1106566B; Fri, 23 Mar 2012 07:52:38 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C7968FC14; Fri, 23 Mar 2012 07:52:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N7qblD063492; Fri, 23 Mar 2012 07:52:37 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N7qbQP063490; Fri, 23 Mar 2012 07:52:37 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201203230752.q2N7qbQP063490@svn.freebsd.org> From: Stanislav Sedov Date: Fri, 23 Mar 2012 07:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233344 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 07:52:38 -0000 Author: stas Date: Fri Mar 23 07:52:37 2012 New Revision: 233344 URL: http://svn.freebsd.org/changeset/base/233344 Log: - Actually fill the date of the Heimdal update. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Mar 23 07:45:11 2012 (r233343) +++ head/ObsoleteFiles.inc Fri Mar 23 07:52:37 2012 (r233344) @@ -38,7 +38,7 @@ # xargs -n1 | sort | uniq -d; # done -# 201203XX: Update heimdal to 1.5.1. +# 20120322: Update heimdal to 1.5.1. OLD_FILES+=usr/include/krb5-v4compat.h \ usr/include/krb_err.h \ usr/include/hdb-private.h \ From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 08:26:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 96E55106566B; Fri, 23 Mar 2012 08:26:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81C968FC14; Fri, 23 Mar 2012 08:26:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2N8QWZD064621; Fri, 23 Mar 2012 08:26:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2N8QW0m064618; Fri, 23 Mar 2012 08:26:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201203230826.q2N8QW0m064618@svn.freebsd.org> From: Ed Schouten Date: Fri, 23 Mar 2012 08:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233345 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 08:26:32 -0000 Author: ed Date: Fri Mar 23 08:26:31 2012 New Revision: 233345 URL: http://svn.freebsd.org/changeset/base/233345 Log: Make utmpx(3) thread safe if we support TLS. Because the utmpx interface is generally not required to be thread-safe, but it is nice to have, if easy to do so. Therefore don't make a mess out of the code and only use it if __NO_TLS is not defined. Modified: head/lib/libc/gen/getutxent.c head/lib/libc/gen/utxdb.c Modified: head/lib/libc/gen/getutxent.c ============================================================================== --- head/lib/libc/gen/getutxent.c Fri Mar 23 07:52:37 2012 (r233344) +++ head/lib/libc/gen/getutxent.c Fri Mar 23 08:26:31 2012 (r233345) @@ -38,8 +38,13 @@ __FBSDID("$FreeBSD$"); #include "utxdb.h" #include "un-namespace.h" +#ifdef __NO_TLS static FILE *uf = NULL; static int udb; +#else +static _Thread_local FILE *uf = NULL; +static _Thread_local int udb; +#endif int setutxdb(int db, const char *file) Modified: head/lib/libc/gen/utxdb.c ============================================================================== --- head/lib/libc/gen/utxdb.c Fri Mar 23 07:52:37 2012 (r233344) +++ head/lib/libc/gen/utxdb.c Fri Mar 23 08:26:31 2012 (r233345) @@ -126,7 +126,11 @@ utx_to_futx(const struct utmpx *ut, stru struct utmpx * futx_to_utx(const struct futx *fu) { +#ifdef __NO_TLS static struct utmpx *ut; +#else + static _Thread_local struct utmpx *ut; +#endif if (ut == NULL) { ut = calloc(1, sizeof *ut); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 08:47:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CF5D1065673; Fri, 23 Mar 2012 08:47:13 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0EFD28FC0C; Fri, 23 Mar 2012 08:47:11 +0000 (UTC) Received: by lboi15 with SMTP id i15so3025245lbo.13 for ; Fri, 23 Mar 2012 01:47:05 -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 :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=AXh5tqJE3LyLXwu22ZDW+8UaFMDiC5u4kwxs+iMR5dM=; b=gVx3dwzo94Mst7aoxw8fEdbMqhslctorDawMaOgpv/MfIYCZEk67GAAczJXiGBo175 hNOkIs5f9OzSCOfVvAdOJwJ/pO7lZ/B/1C3wnhT0a3ySdgPGcno+7LKm18wBw5uaH2b3 ydrIZuyquE9sIFT3Ir8/8OQ9Q9MTPMKRJhvdd3jEUPICt/l1POusQXXvf5mrvFapm4Us KBby7a8V5QuD1SlmRW70TETYCFbG+jAWyVbNs1hO2C9kMIxOP/yIBxIdi+Lw2rTmvLJ2 IMwpwZu42LrrVUCwhX9ALQlrNDmRkT3uYcRiIc3FnO45ArdNRTKqLimbxCHcTjojPkn5 6RYQ== MIME-Version: 1.0 Received: by 10.112.43.163 with SMTP id x3mr1428195lbl.58.1332492425182; Fri, 23 Mar 2012 01:47:05 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.152.21.73 with HTTP; Fri, 23 Mar 2012 01:47:05 -0700 (PDT) In-Reply-To: <201203111219.q2BCJwGN009328@svn.freebsd.org> References: <201203111219.q2BCJwGN009328@svn.freebsd.org> Date: Fri, 23 Mar 2012 11:47:05 +0300 X-Google-Sender-Auth: pT5osOaTN1FVmi-ecNp2bHNxBYY Message-ID: From: Sergey Kandaurov To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232821 - in head: . include sys/fs/cd9660 sys/fs/ext2fs sys/fs/fifofs sys/fs/nfs sys/fs/tmpfs sys/fs/udf sys/gnu/fs/xfs/FreeBSD sys/kern sys/nfsclient sys/sys sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 08:47:13 -0000 On 11 March 2012 16:19, Konstantin Belousov wrote: > Author: kib > Date: Sun Mar 11 12:19:58 2012 > New Revision: 232821 > URL: http://svn.freebsd.org/changeset/base/232821 > > Log: > =A0Remove fifo.h. The only used function declaration from the header is > =A0migrated to sys/vnode.h. > > =A0Submitted by: gianni Looks like it is still installed with src/etc/mtree/BSD.include.dist. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 10:12:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 679C6106566B; Fri, 23 Mar 2012 10:12:36 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 524B18FC0A; Fri, 23 Mar 2012 10:12:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NACaNQ069452; Fri, 23 Mar 2012 10:12:36 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NACauG069450; Fri, 23 Mar 2012 10:12:36 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203231012.q2NACauG069450@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 23 Mar 2012 10:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233346 - head/etc/mtree X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 10:12:36 -0000 Author: pluknet Date: Fri Mar 23 10:12:35 2012 New Revision: 233346 URL: http://svn.freebsd.org/changeset/base/233346 Log: Clean up of fs/fifofs include directory after fifo.h removal. Glanced by: kib Modified: head/etc/mtree/BSD.include.dist Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Fri Mar 23 08:26:31 2012 (r233345) +++ head/etc/mtree/BSD.include.dist Fri Mar 23 10:12:35 2012 (r233346) @@ -152,8 +152,6 @@ .. fdescfs .. - fifofs - .. msdosfs .. nfs From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 10:33:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6EDAB1065670; Fri, 23 Mar 2012 10:33:25 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 508218FC08; Fri, 23 Mar 2012 10:33:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NAXPVN070138; Fri, 23 Mar 2012 10:33:25 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NAXPUr070136; Fri, 23 Mar 2012 10:33:25 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203231033.q2NAXPUr070136@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 23 Mar 2012 10:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233347 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 10:33:25 -0000 Author: pluknet Date: Fri Mar 23 10:33:24 2012 New Revision: 233347 URL: http://svn.freebsd.org/changeset/base/233347 Log: Clean up from the old kern.polling. Reviewed by: attilio MFC after: 1 week Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Fri Mar 23 10:12:35 2012 (r233346) +++ head/share/man/man9/ifnet.9 Fri Mar 23 10:33:24 2012 (r233347) @@ -798,20 +798,7 @@ The capability of a network interface to .Xr polling 4 mode involves several flags in different global variables and per-interface fields. -First, there is a system-wide -.Xr sysctl 8 -master switch named -.Va kern.polling.enable , -which can toggle -.Xr polling 4 -globally. -If that variable is set to non-zero, -.Xr polling 4 -will be used on those devices where it is enabled individually. -Otherwise, -.Xr polling 4 -will not be used in the system. -Second, the capability flag +The capability flag .Dv IFCAP_POLLING set in interface's .Va if_capabilities @@ -821,20 +808,19 @@ on the particular interface. If set in .Va if_capabilities , the same flag can be marked or cleared in the interface's -.Va if_capenable , +.Va if_capenable +within +.Fn ifioctl , thus initiating switch of the interface to .Xr polling 4 mode or interrupt mode, respectively. -The actual mode change will occur at an implementation-specific moment -in the future, e.g., during the next interrupt or -.Xr polling 4 -cycle. -And finally, if the mode transition has been successful, the flag -.Dv IFF_POLLING -is marked or cleared in the interface's -.Va if_flags -to indicate the current mode of the interface. +The actual mode change is managed by the driver-specific +.Fn if_ioctl +routine. +The +.Xr polling +handler returns the number of packets processed. .Ss The Vt if_data Ss Structure The .Vt if_data @@ -880,18 +866,6 @@ to attempt to ensure that there is alway sufficient space to prepend a link-layer header without allocating an additional .Vt mbuf . -.\" (See -.\" .Xr mbuf 9 . ) -.\" .It Va ifi_recvquota -.\" .Pq Vt u_char -.\" Number of packets the interface is permitted to receive at one time -.\" when in polled mode. -.\" .It Va ifi_xmitquota -.\" .Pq Vt u_char -.\" Number of packets the interface is permitted to queue for transmission -.\" at one time when in polled mode. -.\" There is some controversy over -.\" whether such a restriction makes any sense at all. .It Va ifi_datalen .Pq Vt u_char Length of the @@ -972,18 +946,6 @@ Number of packets dropped on input. Rarely implemented. .It Va ifi_noproto Number of packets received for unknown network-layer protocol. -.\" .It Va ifi_recvtiming -.\" Amount of time, in microseconds, spent to receive an average packet on -.\" this interface. -.\" See the -.\" .Sx Polling -.\" section, below. -.\" .It Va ifi_xmittiming -.\" Amount of time, in microseconds, spent to service a transmit-complete -.\" interrupt on this interface. -.\" See the -.\" .Sx Polling -.\" section, below. .It Va ifi_lastchange .Pq Vt "struct timeval" The time of the last administrative change to the interface (as required From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 10:39:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9187106566B; Fri, 23 Mar 2012 10:39:50 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D42E58FC0C; Fri, 23 Mar 2012 10:39:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NAdosc070361; Fri, 23 Mar 2012 10:39:50 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NAdoHn070359; Fri, 23 Mar 2012 10:39:50 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203231039.q2NAdoHn070359@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 23 Mar 2012 10:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233348 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 10:39:51 -0000 Author: pluknet Date: Fri Mar 23 10:39:50 2012 New Revision: 233348 URL: http://svn.freebsd.org/changeset/base/233348 Log: Update IFCAP_* macro descriptions. Reviewed by: attilio (polling part, a previous version) MFC after: 1 week Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Fri Mar 23 10:33:24 2012 (r233347) +++ head/share/man/man9/ifnet.9 Fri Mar 23 10:39:50 2012 (r233348) @@ -685,13 +685,7 @@ Userland code shall use .Xr ioctl 2 . .Pp The following capabilities are currently supported by the system: -.Bl -tag -width ".Dv IFCAP_VLAN_HWTAGGING" -offset indent -.It Dv IFCAP_NETCONS -This interface can be a network console. -.It Dv IFCAP_POLLING -This interface supports -.Xr polling 4 . -See below for details. +.Bl -tag -width ".Dv IFCAP_POLLING_NOCOUNT" -offset indent .It Dv IFCAP_RXCSUM This interface can do checksum validation on receiving data. Some interfaces do not have sufficient buffer storage to store frames @@ -703,9 +697,8 @@ This interface can do checksum calculati .It Dv IFCAP_HWCSUM A shorthand for .Pq Dv IFCAP_RXCSUM | IFCAP_TXCSUM . -.It Dv IFCAP_VLAN_HWTAGGING -This interface can do VLAN tagging on output and -demultiplex frames by their VLAN tag on input. +.It Dv IFCAP_NETCONS +This interface can be a network console. .It Dv IFCAP_VLAN_MTU The .Xr vlan 4 @@ -715,11 +708,24 @@ without having to decrease MTU on interfaces below 1500 bytes. This implies the ability of this interface to cope with frames somewhat longer than permitted by the Ethernet specification. +.It Dv IFCAP_VLAN_HWTAGGING +This interface can do VLAN tagging on output and +demultiplex frames by their VLAN tag on input. .It Dv IFCAP_JUMBO_MTU This Ethernet interface can transmit and receive frames up to 9000 bytes long. +.It Dv IFCAP_POLLING +This interface supports +.Xr polling 4 . +See below for details. +.It Dv IFCAP_VLAN_HWCSUM +This interface can do checksum calculation on both transmitting +and receiving data on +.Xr vlan 4 +interfaces (implies +.Dv IFCAP_HWCSUM ) . .It Dv IFCAP_TSO4 -This Ethernet interface supports TCP Segmentation offloading. +This Ethernet interface supports TCP4 Segmentation offloading. .It Dv IFCAP_TSO6 This Ethernet interface supports TCP6 Segmentation offloading. .It Dv IFCAP_TSO @@ -729,7 +735,7 @@ A shorthand for This Ethernet interface supports TCP offloading. .It Dv IFCAP_TOE6 This Ethernet interface supports TCP6 offloading. -.It Dv ICAP_TOE +.It Dv IFCAP_TOE A shorthand for .Pq Dv IFCAP_TOE4 | IFCAP_TOE6 . .It Dv IFCAP_WOL_UCAST @@ -743,6 +749,27 @@ as those sent by .It Dv IFCAP_WOL A shorthand for .Pq Dv IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC . +.It Dv IFCAP_TOE4 +This Ethernet interface supports TCP4 Offload Engine. +.It Dv IFCAP_TOE6 +This Ethernet interface supports TCP6 Offload Engine. +.It Dv IFCAP_TOE +A shorthand for +.Pq Dv IFCAP_TOE4 | IFCAP_TOE6 . +.It Dv IFCAP_VLAN_HWFILTER +This interface supports frame filtering in hardware on +.Xr vlan 4 +interfaces. +.It Dv IFCAP_POLLING_NOCOUNT +The return value for the number of processed packets should be +skipped for this interface. +.It Dv IFCAP_VLAN_HWTSO +This interface supports TCP Segmentation offloading on +.Xr vlan 4 +interfaces (implies +.Dv IFCAP_TSO ) . +.It Dv IFCAP_LINKSTATE +This Ethernet interface supports dynamic link state changes. .El .Pp The ability of advanced network interfaces to offload certain From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 10:43:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D806106566B; Fri, 23 Mar 2012 10:43:20 +0000 (UTC) (envelope-from giovanni.trematerra@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id E66A68FC17; Fri, 23 Mar 2012 10:43:19 +0000 (UTC) Received: by qcsg15 with SMTP id g15so2238520qcs.13 for ; Fri, 23 Mar 2012 03:43:13 -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 :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=WdQX2pTFBel6Fu8Y8/bxpOoMWDujuF4mMQmmL3SZmLA=; b=AjN8UTo66+GpHXLeJJTssEMBCuqyATZToMsmqpRp2X96cVc37cizRmlWJ6SgyXc6QF fAXMzvdkMIH8wxSDBcXz/tjMCyl1bNkHPmm8/1gd2+UWRnGP/eNeUEXmkJ6oFivJ6a/N Cxy/xcR+yUWpgbxXUTpr1kKnHzF5UNuMTh5f3KHiLEVkbO+qgzZ8Zo1itcraOGke1s0k WaSs6x7H5sA2B55bOGT10BzN+497yech2wOncfgtvYtTGoBlkXJaRt5gU8Hib5bKxFj/ WLIsDrNQYxhKMOutpe8OcJXPAM0uu/01HuTI+Bio+J/811snrMuSF1mBU5Rw/97Tqdzh pXpA== MIME-Version: 1.0 Received: by 10.224.187.197 with SMTP id cx5mr2478327qab.43.1332499393482; Fri, 23 Mar 2012 03:43:13 -0700 (PDT) Sender: giovanni.trematerra@gmail.com Received: by 10.229.36.14 with HTTP; Fri, 23 Mar 2012 03:43:13 -0700 (PDT) In-Reply-To: <201203231012.q2NACauG069450@svn.freebsd.org> References: <201203231012.q2NACauG069450@svn.freebsd.org> Date: Fri, 23 Mar 2012 11:43:13 +0100 X-Google-Sender-Auth: rztztvjcwQhWyja__nu85gmooF8 Message-ID: From: Giovanni Trematerra To: Sergey Kandaurov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233346 - head/etc/mtree X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 10:43:20 -0000 On Fri, Mar 23, 2012 at 11:12 AM, Sergey Kandaurov wr= ote: > Author: pluknet > Date: Fri Mar 23 10:12:35 2012 > New Revision: 233346 > URL: http://svn.freebsd.org/changeset/base/233346 > > Log: > =A0Clean up of fs/fifofs include directory after fifo.h removal. > > =A0Glanced by: =A0 kib > > Modified: > =A0head/etc/mtree/BSD.include.dist > Thank you. It was my fault. Point-hat to: me From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 10:55:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D8BC11065673; Fri, 23 Mar 2012 10:55:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B271B8FC12; Fri, 23 Mar 2012 10:55:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NAtJvm070984; Fri, 23 Mar 2012 10:55:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NAtJ9p070979; Fri, 23 Mar 2012 10:55:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203231055.q2NAtJ9p070979@svn.freebsd.org> From: Dimitry Andric Date: Fri, 23 Mar 2012 10:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233349 - in stable/9/sys: amd64/include i386/include powerpc/include sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 10:55:20 -0000 Author: dim Date: Fri Mar 23 10:55:19 2012 New Revision: 233349 URL: http://svn.freebsd.org/changeset/base/233349 Log: MFC r232745: Add casts to __uint16_t to the __bswap16() macros on all arches which didn't already have them. This is because the ternary expression will return int, due to the Usual Arithmetic Conversions. Such casts are not needed for the 32 and 64 bit variants. While here, add additional parentheses around the x86 variant, to protect against unintended consequences. Modified: stable/9/sys/amd64/include/endian.h stable/9/sys/i386/include/endian.h stable/9/sys/powerpc/include/endian.h stable/9/sys/sparc64/include/endian.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/include/endian.h ============================================================================== --- stable/9/sys/amd64/include/endian.h Fri Mar 23 10:39:50 2012 (r233348) +++ stable/9/sys/amd64/include/endian.h Fri Mar 23 10:55:19 2012 (r233349) @@ -119,8 +119,8 @@ __bswap16_var(__uint16_t _x) __bswap32_const((__uint32_t)(_x)) : __bswap32_var(_x)) #define __bswap16(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap16_const((__uint16_t)(_x)) : __bswap16_var(_x)) + ((__uint16_t)(__builtin_constant_p(_x) ? \ + __bswap16_const((__uint16_t)(_x)) : __bswap16_var(_x))) #define __htonl(x) __bswap32(x) #define __htons(x) __bswap16(x) Modified: stable/9/sys/i386/include/endian.h ============================================================================== --- stable/9/sys/i386/include/endian.h Fri Mar 23 10:39:50 2012 (r233348) +++ stable/9/sys/i386/include/endian.h Fri Mar 23 10:55:19 2012 (r233349) @@ -119,8 +119,8 @@ __bswap16_var(__uint16_t _x) __bswap32_const((__uint32_t)(_x)) : __bswap32_var(_x)) #define __bswap16(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap16_const((__uint16_t)(_x)) : __bswap16_var(_x)) + ((__uint16_t)(__builtin_constant_p(_x) ? \ + __bswap16_const((__uint16_t)(_x)) : __bswap16_var(_x))) #define __htonl(x) __bswap32(x) #define __htons(x) __bswap16(x) Modified: stable/9/sys/powerpc/include/endian.h ============================================================================== --- stable/9/sys/powerpc/include/endian.h Fri Mar 23 10:39:50 2012 (r233348) +++ stable/9/sys/powerpc/include/endian.h Fri Mar 23 10:55:19 2012 (r233349) @@ -124,8 +124,8 @@ __bswap64_var(__uint64_t _x) ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); } -#define __bswap16(x) (__is_constant(x) ? __bswap16_const(x) : \ - __bswap16_var(x)) +#define __bswap16(x) ((__uint16_t)(__is_constant(x) ? __bswap16_const(x) : \ + __bswap16_var(x))) #define __bswap32(x) (__is_constant(x) ? __bswap32_const(x) : \ __bswap32_var(x)) #define __bswap64(x) (__is_constant(x) ? __bswap64_const(x) : \ Modified: stable/9/sys/sparc64/include/endian.h ============================================================================== --- stable/9/sys/sparc64/include/endian.h Fri Mar 23 10:39:50 2012 (r233348) +++ stable/9/sys/sparc64/include/endian.h Fri Mar 23 10:55:19 2012 (r233349) @@ -109,8 +109,8 @@ __bswap64_var(__uint64_t _x) ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); } -#define __bswap16(x) (__is_constant(x) ? __bswap16_const(x) : \ - __bswap16_var(x)) +#define __bswap16(x) ((__uint16_t)(__is_constant(x) ? __bswap16_const(x) : \ + __bswap16_var(x))) #define __bswap32(x) (__is_constant(x) ? __bswap32_const(x) : \ __bswap32_var(x)) #define __bswap64(x) (__is_constant(x) ? __bswap64_const(x) : \ From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 10:58:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17D131065674; Fri, 23 Mar 2012 10:58:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 028C88FC14; Fri, 23 Mar 2012 10:58:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NAwZwm071135; Fri, 23 Mar 2012 10:58:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NAwZwt071133; Fri, 23 Mar 2012 10:58:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203231058.q2NAwZwt071133@svn.freebsd.org> From: Dimitry Andric Date: Fri, 23 Mar 2012 10:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233350 - stable/9/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 10:58:36 -0000 Author: dim Date: Fri Mar 23 10:58:35 2012 New Revision: 233350 URL: http://svn.freebsd.org/changeset/base/233350 Log: MFC r232748: After r232745, which makes sure __bswap16(), ntohs() and htons() return __uint16_t, we can partially undo r228668. Note the remark "Work around a clang false positive with format string warnings and ntohs macros (see LLVM PR 11313)" was actually incorrect. Before r232745, on some arches, the ntohs() macros did in fact return int, not uint16_t, so clang was right in warning about the %hu format string. Modified: stable/9/usr.bin/netstat/Makefile Directory Properties: stable/9/usr.bin/netstat/ (props changed) Modified: stable/9/usr.bin/netstat/Makefile ============================================================================== --- stable/9/usr.bin/netstat/Makefile Fri Mar 23 10:55:19 2012 (r233349) +++ stable/9/usr.bin/netstat/Makefile Fri Mar 23 10:58:35 2012 (r233350) @@ -8,9 +8,6 @@ SRCS= if.c inet.c main.c mbuf.c mroute.c unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c WARNS?= 3 -# XXX: Work around a clang false positive with format string warnings -# and ntohs macros (see LLVM PR 11313). -NO_WFORMAT.clang= CFLAGS+=-fno-strict-aliasing CFLAGS+=-DIPSEC From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 11:01:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EE11106564A; Fri, 23 Mar 2012 11:01:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89BC68FC20; Fri, 23 Mar 2012 11:01:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NB15UU071283; Fri, 23 Mar 2012 11:01:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NB15m4071280; Fri, 23 Mar 2012 11:01:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203231101.q2NB15m4071280@svn.freebsd.org> From: Dimitry Andric Date: Fri, 23 Mar 2012 11:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233351 - stable/9/sbin/fsdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 11:01:05 -0000 Author: dim Date: Fri Mar 23 11:01:04 2012 New Revision: 233351 URL: http://svn.freebsd.org/changeset/base/233351 Log: MFC r232749: Partially undo r228693, by removing NO_WFORMAT.clang in fsdb's Makefile, and fixing the format string in sbin/fsdb/fsdbutil.c instead. Note the remark "Work around a problem with format string warnings and ntohs macros" was actually incorrect. The DIP(dp, di_nlink) macro invocation actually returned an int, due to its ternary expression, even though the di_nlink members of struct ufs1_dinode and struct ufs2_dinode are both defined as int16_t. Modified: stable/9/sbin/fsdb/Makefile stable/9/sbin/fsdb/fsdbutil.c Directory Properties: stable/9/sbin/fsdb/ (props changed) Modified: stable/9/sbin/fsdb/Makefile ============================================================================== --- stable/9/sbin/fsdb/Makefile Fri Mar 23 10:58:35 2012 (r233350) +++ stable/9/sbin/fsdb/Makefile Fri Mar 23 11:01:04 2012 (r233351) @@ -9,8 +9,6 @@ SRCS= fsdb.c fsdbutil.c \ pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c CFLAGS+= -I${.CURDIR}/../fsck_ffs WARNS?= 2 -# Work around a problem with format string warnings and ntohs macros. -NO_WFORMAT.clang= LDADD= -ledit -ltermcap DPADD= ${LIBEDIT} ${LIBTERMCAP} .PATH: ${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs Modified: stable/9/sbin/fsdb/fsdbutil.c ============================================================================== --- stable/9/sbin/fsdb/fsdbutil.c Fri Mar 23 10:58:35 2012 (r233350) +++ stable/9/sbin/fsdb/fsdbutil.c Fri Mar 23 11:01:04 2012 (r233351) @@ -195,7 +195,7 @@ printstat(const char *cp, ino_t inum, un blocks = DIP(dp, di_blocks); gen = DIP(dp, di_gen); - printf("LINKCNT=%hd FLAGS=%#x BLKCNT=%jx GEN=%jx\n", DIP(dp, di_nlink), + printf("LINKCNT=%d FLAGS=%#x BLKCNT=%jx GEN=%jx\n", DIP(dp, di_nlink), DIP(dp, di_flags), (intmax_t)blocks, (intmax_t)gen); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 11:18:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83A34106564A; Fri, 23 Mar 2012 11:18:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F35A8FC0A; Fri, 23 Mar 2012 11:18:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NBI8Xp071830; Fri, 23 Mar 2012 11:18:08 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NBI8jJ071828; Fri, 23 Mar 2012 11:18:08 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203231118.q2NBI8jJ071828@svn.freebsd.org> From: Dimitry Andric Date: Fri, 23 Mar 2012 11:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233352 - head/lib/libarchive X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 11:18:08 -0000 Author: dim Date: Fri Mar 23 11:18:07 2012 New Revision: 233352 URL: http://svn.freebsd.org/changeset/base/233352 Log: Silence alignment warnings from clang in libarchive's ppmd code (which is actually third-party code). Clang even warns about alignment issues on x86, and the warnings are not needed there. Modified: head/lib/libarchive/Makefile Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Fri Mar 23 11:01:04 2012 (r233351) +++ head/lib/libarchive/Makefile Fri Mar 23 11:18:07 2012 (r233352) @@ -45,6 +45,7 @@ NO_WCAST_ALIGN= yes CFLAGS+= -DPPMD_32BIT .endif .endif +NO_WCAST_ALIGN.clang= .PATH: ${LIBARCHIVEDIR}/libarchive From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 11:26:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B844106566C; Fri, 23 Mar 2012 11:26:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2175B8FC0C; Fri, 23 Mar 2012 11:26:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NBQtdt072750; Fri, 23 Mar 2012 11:26:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NBQsKT072716; Fri, 23 Mar 2012 11:26:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203231126.q2NBQsKT072716@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 23 Mar 2012 11:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233353 - in stable/9/sys: cddl/compat/opensolaris/sys compat/ndis fs/cd9660 fs/devfs fs/ext2fs fs/msdosfs fs/nfsclient fs/nfsserver fs/pseudofs fs/udf i386/conf kern nfsclient sys ufs/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 11:26:55 -0000 Author: kib Date: Fri Mar 23 11:26:54 2012 New Revision: 233353 URL: http://svn.freebsd.org/changeset/base/233353 Log: MFC r231949: Fix found places where uio_resid is truncated to int. Add the sysctl debug.iosize_max_clamp, enabled by default. Setting the sysctl to zero allows to perform the SSIZE_MAX-sized i/o requests from the usermode. MFC r232493: Remove unneeded cast to u_int. The values as small enough to fit into int, beside the use of MIN macro which performs type promotions. MFC r232494: Instead of incomplete handling of read(2)/write(2) return values that does not fit into registers, declare that we do not support this case using CTASSERT(), and remove endianess-unsafe code to split return value into td_retval. While there, change the style of the sysctl debug.iosize_max_clamp definition. MFC r232495: pipe_read(): change the type of size to int, and remove signed clamp. pipe_write(): change the type of desiredsize back to int, its value fits. Modified: stable/9/sys/cddl/compat/opensolaris/sys/vnode.h stable/9/sys/compat/ndis/subr_ndis.c stable/9/sys/fs/cd9660/cd9660_vnops.c stable/9/sys/fs/devfs/devfs_vnops.c stable/9/sys/fs/ext2fs/ext2_lookup.c stable/9/sys/fs/msdosfs/msdosfs_vnops.c stable/9/sys/fs/nfsclient/nfs_clbio.c stable/9/sys/fs/nfsclient/nfs_clvnops.c stable/9/sys/fs/nfsserver/nfs_nfsdstate.c stable/9/sys/fs/pseudofs/pseudofs_vnops.c stable/9/sys/fs/udf/udf_vnops.c stable/9/sys/kern/kern_ctf.c stable/9/sys/kern/kern_gzio.c stable/9/sys/kern/kern_ktrace.c stable/9/sys/kern/kern_linker.c stable/9/sys/kern/link_elf.c stable/9/sys/kern/link_elf_obj.c stable/9/sys/kern/subr_uio.c stable/9/sys/kern/sys_generic.c stable/9/sys/kern/sys_pipe.c stable/9/sys/kern/tty_ttydisc.c stable/9/sys/kern/uipc_mbuf.c stable/9/sys/kern/uipc_socket.c stable/9/sys/kern/uipc_syscalls.c stable/9/sys/kern/vfs_extattr.c stable/9/sys/kern/vfs_mountroot.c stable/9/sys/kern/vfs_syscalls.c stable/9/sys/kern/vfs_vnops.c stable/9/sys/nfsclient/nfs_bio.c stable/9/sys/sys/systm.h stable/9/sys/sys/vnode.h stable/9/sys/ufs/ffs/ffs_vnops.c stable/9/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/sys/vnode.h Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/cddl/compat/opensolaris/sys/vnode.h Fri Mar 23 11:26:54 2012 (r233353) @@ -223,7 +223,8 @@ zfs_vn_rdwr(enum uio_rw rw, vnode_t *vp, ssize_t *residp) { struct thread *td = curthread; - int error, vfslocked, resid; + int error, vfslocked; + ssize_t resid; ASSERT(ioflag == 0); ASSERT(ulimit == RLIM64_INFINITY); Modified: stable/9/sys/compat/ndis/subr_ndis.c ============================================================================== --- stable/9/sys/compat/ndis/subr_ndis.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/compat/ndis/subr_ndis.c Fri Mar 23 11:26:54 2012 (r233353) @@ -2862,7 +2862,8 @@ NdisMapFile(status, mappedbuffer, fileha struct thread *td = curthread; linker_file_t lf; caddr_t kldstart; - int error, resid, vfslocked; + int error, vfslocked; + ssize_t resid; struct vnode *vp; if (filehandle == NULL) { Modified: stable/9/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- stable/9/sys/fs/cd9660/cd9660_vnops.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/fs/cd9660/cd9660_vnops.c Fri Mar 23 11:26:54 2012 (r233353) @@ -318,8 +318,7 @@ cd9660_read(ap) do { lbn = lblkno(imp, uio->uio_offset); on = blkoff(imp, uio->uio_offset); - n = min((u_int)(imp->logical_block_size - on), - uio->uio_resid); + n = MIN(imp->logical_block_size - on, uio->uio_resid); diff = (off_t)ip->i_size - uio->uio_offset; if (diff <= 0) return (0); @@ -343,7 +342,7 @@ cd9660_read(ap) } else error = bread(vp, lbn, size, NOCRED, &bp); } - n = min(n, size - bp->b_resid); + n = MIN(n, size - bp->b_resid); if (error) { brelse(bp); return (error); Modified: stable/9/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/9/sys/fs/devfs/devfs_vnops.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/fs/devfs/devfs_vnops.c Fri Mar 23 11:26:54 2012 (r233353) @@ -1156,7 +1156,8 @@ static int devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct thread *td) { struct cdev *dev; - int ioflag, error, ref, resid; + int ioflag, error, ref; + ssize_t resid; struct cdevsw *dsw; struct file *fpop; @@ -1634,7 +1635,8 @@ static int devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct thread *td) { struct cdev *dev; - int error, ioflag, ref, resid; + int error, ioflag, ref; + ssize_t resid; struct cdevsw *dsw; struct file *fpop; Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_lookup.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/fs/ext2fs/ext2_lookup.c Fri Mar 23 11:26:54 2012 (r233353) @@ -1001,7 +1001,8 @@ ext2_dirempty(ip, parentino, cred) off_t off; struct dirtemplate dbuf; struct ext2fs_direct_2 *dp = (struct ext2fs_direct_2 *)&dbuf; - int error, count, namlen; + int error, namlen; + ssize_t count; #define MINDIRSIZ (sizeof(struct dirtemplate) / 2) for (off = 0; off < ip->i_size; off += dp->e2d_reclen) { Modified: stable/9/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_vnops.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/fs/msdosfs/msdosfs_vnops.c Fri Mar 23 11:26:54 2012 (r233353) @@ -543,7 +543,7 @@ msdosfs_read(ap) int error = 0; int blsize; int isadir; - int orig_resid; + ssize_t orig_resid; u_int n; u_long diff; u_long on; @@ -643,7 +643,7 @@ msdosfs_write(ap) { int n; int croffset; - int resid; + ssize_t resid; u_long osize; int error = 0; u_long count; Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Fri Mar 23 11:26:54 2012 (r233353) @@ -570,7 +570,7 @@ ncl_bioread(struct vnode *vp, struct uio n = 0; if (on < bcount) - n = min((unsigned)(bcount - on), uio->uio_resid); + n = MIN((unsigned)(bcount - on), uio->uio_resid); break; case VLNK: NFSINCRGLOBAL(newnfsstats.biocache_readlinks); @@ -589,7 +589,7 @@ ncl_bioread(struct vnode *vp, struct uio return (error); } } - n = min(uio->uio_resid, NFS_MAXPATHLEN - bp->b_resid); + n = MIN(uio->uio_resid, NFS_MAXPATHLEN - bp->b_resid); on = 0; break; case VDIR: @@ -757,8 +757,8 @@ nfs_directio_write(vp, uiop, cred, iofla struct iovec iov; do_sync: while (uiop->uio_resid > 0) { - size = min(uiop->uio_resid, wsize); - size = min(uiop->uio_iov->iov_len, size); + size = MIN(uiop->uio_resid, wsize); + size = MIN(uiop->uio_iov->iov_len, size); iov.iov_base = uiop->uio_iov->iov_base; iov.iov_len = size; uio.uio_iov = &iov; @@ -806,8 +806,8 @@ do_sync: * in NFS directio access. */ while (uiop->uio_resid > 0) { - size = min(uiop->uio_resid, wsize); - size = min(uiop->uio_iov->iov_len, size); + size = MIN(uiop->uio_resid, wsize); + size = MIN(uiop->uio_iov->iov_len, size); bp = getpbuf(&ncl_pbuf_freecnt); t_uio = malloc(sizeof(struct uio), M_NFSDIRECTIO, M_WAITOK); t_iov = malloc(sizeof(struct iovec), M_NFSDIRECTIO, M_WAITOK); @@ -1038,7 +1038,7 @@ flush_and_restart: NFSINCRGLOBAL(newnfsstats.biocache_writes); lbn = uio->uio_offset / biosize; on = uio->uio_offset & (biosize-1); - n = min((unsigned)(biosize - on), uio->uio_resid); + n = MIN((unsigned)(biosize - on), uio->uio_resid); again: /* * Handle direct append and file extension cases, calculate @@ -1587,7 +1587,7 @@ ncl_doio(struct vnode *vp, struct buf *b * writes, but that is not possible any longer. */ int nread = bp->b_bcount - uiop->uio_resid; - int left = uiop->uio_resid; + ssize_t left = uiop->uio_resid; if (left > 0) bzero((char *)bp->b_data + nread, left); Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvnops.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/fs/nfsclient/nfs_clvnops.c Fri Mar 23 11:26:54 2012 (r233353) @@ -2180,7 +2180,8 @@ nfs_readdir(struct vop_readdir_args *ap) struct vnode *vp = ap->a_vp; struct nfsnode *np = VTONFS(vp); struct uio *uio = ap->a_uio; - int tresid, error = 0; + ssize_t tresid; + int error = 0; struct vattr vattr; if (vp->v_type != VDIR) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdstate.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/fs/nfsserver/nfs_nfsdstate.c Fri Mar 23 11:26:54 2012 (r233353) @@ -3962,7 +3962,7 @@ nfsrv_setupstable(NFSPROC_T *p) struct nfst_rec *tsp; int error, i, tryagain; off_t off = 0; - int aresid, len; + ssize_t aresid, len; struct timeval curtime; /* Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/9/sys/fs/pseudofs/pseudofs_vnops.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/fs/pseudofs/pseudofs_vnops.c Fri Mar 23 11:26:54 2012 (r233353) @@ -616,7 +616,8 @@ pfs_read(struct vop_read_args *va) struct proc *proc; struct sbuf *sb = NULL; int error, locked; - unsigned int buflen, offset, resid; + off_t offset; + ssize_t buflen, resid; PFS_TRACE(("%s", pn->pn_name)); pfs_assert_not_owned(pn); Modified: stable/9/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/9/sys/fs/udf/udf_vnops.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/fs/udf/udf_vnops.c Fri Mar 23 11:26:54 2012 (r233353) @@ -439,8 +439,9 @@ udf_read(struct vop_read_args *ap) uint8_t *data; daddr_t lbn, rablock; off_t diff, fsize; + ssize_t n; int error = 0; - long size, n, on; + long size, on; if (uio->uio_resid == 0) return (0); Modified: stable/9/sys/kern/kern_ctf.c ============================================================================== --- stable/9/sys/kern/kern_ctf.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/kern_ctf.c Fri Mar 23 11:26:54 2012 (r233353) @@ -68,7 +68,7 @@ link_elf_ctf_get(linker_file_t lf, linke int flags; int i; int nbytes; - int resid; + ssize_t resid; int vfslocked; size_t sz; struct nameidata nd; Modified: stable/9/sys/kern/kern_gzio.c ============================================================================== --- stable/9/sys/kern/kern_gzio.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/kern_gzio.c Fri Mar 23 11:26:54 2012 (r233353) @@ -97,7 +97,7 @@ gzFile gz_open (path, mode, vp) gz_stream *s; char fmode[80]; /* copy of mode, without the compression level */ char *m = fmode; - int resid; + ssize_t resid; int error; char buf[GZ_HEADER_LEN + 1]; @@ -342,7 +342,7 @@ local void putU32 (s, x) { uint32_t xx; off_t curoff = s->outoff; - int resid; + ssize_t resid; #if BYTE_ORDER == BIG_ENDIAN xx = bswap32(x); Modified: stable/9/sys/kern/kern_ktrace.c ============================================================================== --- stable/9/sys/kern/kern_ktrace.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/kern_ktrace.c Fri Mar 23 11:26:54 2012 (r233353) @@ -682,7 +682,7 @@ ktrgenio(fd, rw, uio, error) } uio->uio_offset = 0; uio->uio_rw = UIO_WRITE; - datalen = imin(uio->uio_resid, ktr_geniosize); + datalen = MIN(uio->uio_resid, ktr_geniosize); buf = malloc(datalen, M_KTRACE, M_WAITOK); error = uiomove(buf, datalen, uio); free(uio, M_IOV); Modified: stable/9/sys/kern/kern_linker.c ============================================================================== --- stable/9/sys/kern/kern_linker.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/kern_linker.c Fri Mar 23 11:26:54 2012 (r233353) @@ -1747,7 +1747,8 @@ linker_hints_lookup(const char *path, in struct vattr vattr, mattr; u_char *hints = NULL; u_char *cp, *recptr, *bufend, *result, *best, *pathbuf, *sep; - int error, ival, bestver, *intp, reclen, found, flags, clen, blen; + int error, ival, bestver, *intp, found, flags, clen, blen; + ssize_t reclen; int vfslocked = 0; result = NULL; @@ -1792,7 +1793,7 @@ linker_hints_lookup(const char *path, in VFS_UNLOCK_GIANT(vfslocked); nd.ni_vp = NULL; if (reclen != 0) { - printf("can't read %d\n", reclen); + printf("can't read %zd\n", reclen); goto bad; } intp = (int *)hints; Modified: stable/9/sys/kern/link_elf.c ============================================================================== --- stable/9/sys/kern/link_elf.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/link_elf.c Fri Mar 23 11:26:54 2012 (r233353) @@ -655,7 +655,8 @@ link_elf_load_file(linker_class_t cls, c Elf_Addr base_vaddr; Elf_Addr base_vlimit; int error = 0; - int resid, flags; + ssize_t resid; + int flags; elf_file_t ef; linker_file_t lf; Elf_Shdr *shdr; Modified: stable/9/sys/kern/link_elf_obj.c ============================================================================== --- stable/9/sys/kern/link_elf_obj.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/link_elf_obj.c Fri Mar 23 11:26:54 2012 (r233353) @@ -440,7 +440,8 @@ link_elf_load_file(linker_class_t cls, c vm_offset_t mapbase; size_t mapsize; int error = 0; - int resid, flags; + ssize_t resid; + int flags; elf_file_t ef; linker_file_t lf; int symtabindex; Modified: stable/9/sys/kern/subr_uio.c ============================================================================== --- stable/9/sys/kern/subr_uio.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/subr_uio.c Fri Mar 23 11:26:54 2012 (r233353) @@ -171,7 +171,7 @@ uiomove_faultflag(void *cp, int n, struc { struct thread *td; struct iovec *iov; - u_int cnt; + size_t cnt; int error, newflags, save; td = curthread; @@ -245,14 +245,14 @@ out: int uiomove_frombuf(void *buf, int buflen, struct uio *uio) { - unsigned int offset, n; + size_t offset, n; if (uio->uio_offset < 0 || uio->uio_resid < 0 || (offset = uio->uio_offset) != uio->uio_offset) return (EINVAL); if (buflen <= 0 || offset >= buflen) return (0); - if ((n = buflen - offset) > INT_MAX) + if ((n = buflen - offset) > IOSIZE_MAX) return (EINVAL); return (uiomove((char *)buf + offset, n, uio)); } @@ -479,7 +479,7 @@ copyinuio(struct iovec *iovp, u_int iovc uio->uio_offset = -1; uio->uio_resid = 0; for (i = 0; i < iovcnt; i++) { - if (iov->iov_len > INT_MAX - uio->uio_resid) { + if (iov->iov_len > IOSIZE_MAX - uio->uio_resid) { free(uio, M_IOV); return (EINVAL); } Modified: stable/9/sys/kern/sys_generic.c ============================================================================== --- stable/9/sys/kern/sys_generic.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/sys_generic.c Fri Mar 23 11:26:54 2012 (r233353) @@ -74,6 +74,16 @@ __FBSDID("$FreeBSD$"); #include +int iosize_max_clamp = 1; +SYSCTL_INT(_debug, OID_AUTO, iosize_max_clamp, CTLFLAG_RW, + &iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX"); +/* + * Assert that the return value of read(2) and write(2) syscalls fits + * into a register. If not, an architecture will need to provide the + * usermode wrappers to reconstruct the result. + */ +CTASSERT(sizeof(register_t) >= sizeof(size_t)); + static MALLOC_DEFINE(M_IOCTLOPS, "ioctlops", "ioctl data buffer"); static MALLOC_DEFINE(M_SELECT, "select", "select() buffer"); MALLOC_DEFINE(M_IOV, "iov", "large iov's"); @@ -145,7 +155,7 @@ sys_read(td, uap) struct iovec aiov; int error; - if (uap->nbyte > INT_MAX) + if (uap->nbyte > IOSIZE_MAX) return (EINVAL); aiov.iov_base = uap->buf; aiov.iov_len = uap->nbyte; @@ -178,7 +188,7 @@ sys_pread(td, uap) struct iovec aiov; int error; - if (uap->nbyte > INT_MAX) + if (uap->nbyte > IOSIZE_MAX) return (EINVAL); aiov.iov_base = uap->buf; aiov.iov_len = uap->nbyte; @@ -354,7 +364,7 @@ sys_write(td, uap) struct iovec aiov; int error; - if (uap->nbyte > INT_MAX) + if (uap->nbyte > IOSIZE_MAX) return (EINVAL); aiov.iov_base = (void *)(uintptr_t)uap->buf; aiov.iov_len = uap->nbyte; @@ -387,7 +397,7 @@ sys_pwrite(td, uap) struct iovec aiov; int error; - if (uap->nbyte > INT_MAX) + if (uap->nbyte > IOSIZE_MAX) return (EINVAL); aiov.iov_base = (void *)(uintptr_t)uap->buf; aiov.iov_len = uap->nbyte; Modified: stable/9/sys/kern/sys_pipe.c ============================================================================== --- stable/9/sys/kern/sys_pipe.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/sys_pipe.c Fri Mar 23 11:26:54 2012 (r233353) @@ -585,7 +585,7 @@ pipe_read(fp, uio, active_cred, flags, t struct pipe *rpipe = fp->f_data; int error; int nread = 0; - u_int size; + int size; PIPE_LOCK(rpipe); ++rpipe->pipe_busy; @@ -617,8 +617,8 @@ pipe_read(fp, uio, active_cred, flags, t size = rpipe->pipe_buffer.size - rpipe->pipe_buffer.out; if (size > rpipe->pipe_buffer.cnt) size = rpipe->pipe_buffer.cnt; - if (size > (u_int) uio->uio_resid) - size = (u_int) uio->uio_resid; + if (size > uio->uio_resid) + size = uio->uio_resid; PIPE_UNLOCK(rpipe); error = uiomove( @@ -650,7 +650,7 @@ pipe_read(fp, uio, active_cred, flags, t */ } else if ((size = rpipe->pipe_map.cnt) && (rpipe->pipe_state & PIPE_DIRECTW)) { - if (size > (u_int) uio->uio_resid) + if (size > uio->uio_resid) size = (u_int) uio->uio_resid; PIPE_UNLOCK(rpipe); @@ -764,9 +764,10 @@ pipe_build_write_buffer(wpipe, uio) KASSERT(wpipe->pipe_state & PIPE_DIRECTW, ("Clone attempt on non-direct write pipe!")); - size = (u_int) uio->uio_iov->iov_len; - if (size > wpipe->pipe_buffer.size) - size = wpipe->pipe_buffer.size; + if (uio->uio_iov->iov_len > wpipe->pipe_buffer.size) + size = wpipe->pipe_buffer.size; + else + size = uio->uio_iov->iov_len; if ((i = vm_fault_quick_hold_pages(&curproc->p_vmspace->vm_map, (vm_offset_t)uio->uio_iov->iov_base, size, VM_PROT_READ, @@ -960,7 +961,8 @@ pipe_write(fp, uio, active_cred, flags, int flags; { int error = 0; - int desiredsize, orig_resid; + int desiredsize; + ssize_t orig_resid; struct pipe *wpipe, *rpipe; rpipe = fp->f_data; Modified: stable/9/sys/kern/tty_ttydisc.c ============================================================================== --- stable/9/sys/kern/tty_ttydisc.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/tty_ttydisc.c Fri Mar 23 11:26:54 2012 (r233353) @@ -180,7 +180,7 @@ static int ttydisc_read_raw_no_timer(struct tty *tp, struct uio *uio, int ioflag) { size_t vmin = tp->t_termios.c_cc[VMIN]; - int oresid = uio->uio_resid; + ssize_t oresid = uio->uio_resid; int error; MPASS(tp->t_termios.c_cc[VTIME] == 0); @@ -265,7 +265,7 @@ static int ttydisc_read_raw_interbyte_timer(struct tty *tp, struct uio *uio, int ioflag) { size_t vmin = tp->t_termios.c_cc[VMIN]; - int oresid = uio->uio_resid; + ssize_t oresid = uio->uio_resid; int error; MPASS(tp->t_termios.c_cc[VMIN] != 0); @@ -1174,7 +1174,7 @@ int ttydisc_getc_uio(struct tty *tp, struct uio *uio) { int error = 0; - int obytes = uio->uio_resid; + ssize_t obytes = uio->uio_resid; size_t len; char buf[TTY_STACKBUF]; Modified: stable/9/sys/kern/uipc_mbuf.c ============================================================================== --- stable/9/sys/kern/uipc_mbuf.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/uipc_mbuf.c Fri Mar 23 11:26:54 2012 (r233353) @@ -1726,7 +1726,8 @@ struct mbuf * m_uiotombuf(struct uio *uio, int how, int len, int align, int flags) { struct mbuf *m, *mb; - int error, length, total; + int error, length; + ssize_t total; int progress = 0; /* Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/uipc_socket.c Fri Mar 23 11:26:54 2012 (r233353) @@ -887,7 +887,8 @@ sosend_copyin(struct uio *uio, struct mb int flags) { struct mbuf *m, **mp, *top; - long len, resid; + long len; + ssize_t resid; int error; #ifdef ZERO_COPY_SOCKETS int cow_send; @@ -987,7 +988,8 @@ int sosend_dgram(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *td) { - long space, resid; + long space; + ssize_t resid; int clen = 0, error, dontroute; #ifdef ZERO_COPY_SOCKETS int atomic = sosendallatonce(so) || top; @@ -1159,7 +1161,8 @@ int sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *td) { - long space, resid; + long space; + ssize_t resid; int clen = 0, error, dontroute; int atomic = sosendallatonce(so) || top; @@ -1456,11 +1459,12 @@ soreceive_generic(struct socket *so, str struct mbuf **mp0, struct mbuf **controlp, int *flagsp) { struct mbuf *m, **mp; - int flags, len, error, offset; + int flags, error, offset; + ssize_t len; struct protosw *pr = so->so_proto; struct mbuf *nextrecord; int moff, type = 0; - int orig_resid = uio->uio_resid; + ssize_t orig_resid = uio->uio_resid; mp = mp0; if (psa != NULL) @@ -2119,7 +2123,8 @@ soreceive_dgram(struct socket *so, struc struct mbuf **mp0, struct mbuf **controlp, int *flagsp) { struct mbuf *m, *m2; - int flags, len, error; + int flags, error; + ssize_t len; struct protosw *pr = so->so_proto; struct mbuf *nextrecord; Modified: stable/9/sys/kern/uipc_syscalls.c ============================================================================== --- stable/9/sys/kern/uipc_syscalls.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/uipc_syscalls.c Fri Mar 23 11:26:54 2012 (r233353) @@ -756,8 +756,8 @@ kern_sendit(td, s, mp, flags, control, s struct uio auio; struct iovec *iov; struct socket *so; - int i; - int len, error; + int i, error; + ssize_t len; cap_rights_t rights; #ifdef KTRACE struct uio *ktruio = NULL; @@ -956,7 +956,7 @@ kern_recvit(td, s, mp, fromseg, controlp struct uio auio; struct iovec *iov; int i; - socklen_t len; + ssize_t len; int error; struct mbuf *m, *control = 0; caddr_t ctlbuf; @@ -1007,19 +1007,19 @@ kern_recvit(td, s, mp, fromseg, controlp (mp->msg_control || controlp) ? &control : (struct mbuf **)0, &mp->msg_flags); if (error) { - if (auio.uio_resid != (int)len && (error == ERESTART || + if (auio.uio_resid != len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) error = 0; } #ifdef KTRACE if (ktruio != NULL) { - ktruio->uio_resid = (int)len - auio.uio_resid; + ktruio->uio_resid = len - auio.uio_resid; ktrgenio(s, UIO_READ, ktruio, error); } #endif if (error) goto out; - td->td_retval[0] = (int)len - auio.uio_resid; + td->td_retval[0] = len - auio.uio_resid; if (mp->msg_name) { len = mp->msg_namelen; if (len <= 0 || fromsa == 0) @@ -2086,7 +2086,8 @@ retry_space: else if (uap->flags & SF_NODISKIO) error = EBUSY; else { - int bsize, resid; + int bsize; + ssize_t resid; /* * Ensure that our page is still around @@ -2518,7 +2519,8 @@ sys_sctp_generic_sendmsg_iov(td, uap) struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL; struct socket *so; struct file *fp = NULL; - int error=0, len, i; + int error=0, i; + ssize_t len; struct sockaddr *to = NULL; #ifdef KTRACE struct uio *ktruio = NULL; @@ -2649,7 +2651,8 @@ sys_sctp_generic_recvmsg(td, uap) struct file *fp = NULL; struct sockaddr *fromsa; int fromlen; - int len, i, msg_flags; + ssize_t len; + int i, msg_flags; int error = 0; #ifdef KTRACE struct uio *ktruio = NULL; @@ -2727,7 +2730,7 @@ sys_sctp_generic_recvmsg(td, uap) (struct sctp_sndrcvinfo *)&sinfo, 1); CURVNET_RESTORE(); if (error) { - if (auio.uio_resid != (int)len && (error == ERESTART || + if (auio.uio_resid != len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) error = 0; } else { @@ -2736,13 +2739,13 @@ sys_sctp_generic_recvmsg(td, uap) } #ifdef KTRACE if (ktruio != NULL) { - ktruio->uio_resid = (int)len - auio.uio_resid; + ktruio->uio_resid = len - auio.uio_resid; ktrgenio(uap->sd, UIO_READ, ktruio, error); } #endif /* KTRACE */ if (error) goto out; - td->td_retval[0] = (int)len - auio.uio_resid; + td->td_retval[0] = len - auio.uio_resid; if (fromlen && uap->from) { len = fromlen; @@ -2750,7 +2753,7 @@ sys_sctp_generic_recvmsg(td, uap) len = 0; else { len = MIN(len, fromsa->sa_len); - error = copyout(fromsa, uap->from, (unsigned)len); + error = copyout(fromsa, uap->from, (size_t)len); if (error) goto out; } Modified: stable/9/sys/kern/vfs_extattr.c ============================================================================== --- stable/9/sys/kern/vfs_extattr.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/vfs_extattr.c Fri Mar 23 11:26:54 2012 (r233353) @@ -181,7 +181,7 @@ extattr_set_vp(struct vnode *vp, int att auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_offset = 0; - if (nbytes > INT_MAX) { + if (nbytes > IOSIZE_MAX) { error = EINVAL; goto done; } @@ -355,7 +355,7 @@ extattr_get_vp(struct vnode *vp, int att auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_offset = 0; - if (nbytes > INT_MAX) { + if (nbytes > IOSIZE_MAX) { error = EINVAL; goto done; } @@ -672,7 +672,7 @@ extattr_list_vp(struct vnode *vp, int at auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_offset = 0; - if (nbytes > INT_MAX) { + if (nbytes > IOSIZE_MAX) { error = EINVAL; goto done; } Modified: stable/9/sys/kern/vfs_mountroot.c ============================================================================== --- stable/9/sys/kern/vfs_mountroot.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/vfs_mountroot.c Fri Mar 23 11:26:54 2012 (r233353) @@ -871,9 +871,8 @@ vfs_mountroot_readconf(struct thread *td static char buf[128]; struct nameidata nd; off_t ofs; - int error, flags; - int len, resid; - int vfslocked; + ssize_t resid; + int error, flags, len, vfslocked; NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, "/.mount.conf", td); Modified: stable/9/sys/kern/vfs_syscalls.c ============================================================================== --- stable/9/sys/kern/vfs_syscalls.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/vfs_syscalls.c Fri Mar 23 11:26:54 2012 (r233353) @@ -2691,7 +2691,7 @@ kern_readlinkat(struct thread *td, int f struct nameidata nd; int vfslocked; - if (count > INT_MAX) + if (count > IOSIZE_MAX) return (EINVAL); NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | @@ -4152,7 +4152,8 @@ kern_getdirentries(struct thread *td, in int error, eofflag; AUDIT_ARG_FD(fd); - if (count > INT_MAX) + auio.uio_resid = count; + if (auio.uio_resid > IOSIZE_MAX) return (EINVAL); if ((error = getvnode(td->td_proc->p_fd, fd, CAP_READ | CAP_SEEK, &fp)) != 0) @@ -4176,7 +4177,6 @@ unionread: auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; - auio.uio_resid = count; vn_lock(vp, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(vp); loff = auio.uio_offset = fp->f_offset; Modified: stable/9/sys/kern/vfs_vnops.c ============================================================================== --- stable/9/sys/kern/vfs_vnops.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/kern/vfs_vnops.c Fri Mar 23 11:26:54 2012 (r233353) @@ -373,7 +373,7 @@ vn_rdwr(rw, vp, base, len, offset, segfl int ioflg; struct ucred *active_cred; struct ucred *file_cred; - int *aresid; + ssize_t *aresid; struct thread *td; { struct uio auio; @@ -470,7 +470,7 @@ vn_rdwr_inchunks(rw, vp, base, len, offs struct thread *td; { int error = 0; - int iaresid; + ssize_t iaresid; VFS_ASSERT_GIANT(vp->v_mount); Modified: stable/9/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/9/sys/nfsclient/nfs_bio.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/nfsclient/nfs_bio.c Fri Mar 23 11:26:54 2012 (r233353) @@ -564,7 +564,7 @@ nfs_bioread(struct vnode *vp, struct uio n = 0; if (on < bcount) - n = min((unsigned)(bcount - on), uio->uio_resid); + n = MIN((unsigned)(bcount - on), uio->uio_resid); break; case VLNK: nfsstats.biocache_readlinks++; @@ -583,7 +583,7 @@ nfs_bioread(struct vnode *vp, struct uio return (error); } } - n = min(uio->uio_resid, NFS_MAXPATHLEN - bp->b_resid); + n = MIN(uio->uio_resid, NFS_MAXPATHLEN - bp->b_resid); on = 0; break; case VDIR: @@ -751,8 +751,8 @@ nfs_directio_write(vp, uiop, cred, iofla struct iovec iov; do_sync: while (uiop->uio_resid > 0) { - size = min(uiop->uio_resid, wsize); - size = min(uiop->uio_iov->iov_len, size); + size = MIN(uiop->uio_resid, wsize); + size = MIN(uiop->uio_iov->iov_len, size); iov.iov_base = uiop->uio_iov->iov_base; iov.iov_len = size; uio.uio_iov = &iov; @@ -800,8 +800,8 @@ do_sync: * in NFS directio access. */ while (uiop->uio_resid > 0) { - size = min(uiop->uio_resid, wsize); - size = min(uiop->uio_iov->iov_len, size); + size = MIN(uiop->uio_resid, wsize); + size = MIN(uiop->uio_iov->iov_len, size); bp = getpbuf(&nfs_pbuf_freecnt); t_uio = malloc(sizeof(struct uio), M_NFSDIRECTIO, M_WAITOK); t_iov = malloc(sizeof(struct iovec), M_NFSDIRECTIO, M_WAITOK); @@ -1029,7 +1029,7 @@ flush_and_restart: nfsstats.biocache_writes++; lbn = uio->uio_offset / biosize; on = uio->uio_offset & (biosize-1); - n = min((unsigned)(biosize - on), uio->uio_resid); + n = MIN((unsigned)(biosize - on), uio->uio_resid); again: /* * Handle direct append and file extension cases, calculate Modified: stable/9/sys/sys/systm.h ============================================================================== --- stable/9/sys/sys/systm.h Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/sys/systm.h Fri Mar 23 11:26:54 2012 (r233353) @@ -127,6 +127,9 @@ extern char **kenvp; extern const void *zero_region; /* address space maps to a zeroed page */ +extern int iosize_max_clamp; +#define IOSIZE_MAX (iosize_max_clamp ? INT_MAX : SSIZE_MAX) + /* * General function declarations. */ Modified: stable/9/sys/sys/vnode.h ============================================================================== --- stable/9/sys/sys/vnode.h Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/sys/vnode.h Fri Mar 23 11:26:54 2012 (r233353) @@ -656,7 +656,7 @@ void vn_pages_remove(struct vnode *vp, v int vn_pollrecord(struct vnode *vp, struct thread *p, int events); int vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset, enum uio_seg segflg, int ioflg, - struct ucred *active_cred, struct ucred *file_cred, int *aresid, + struct ucred *active_cred, struct ucred *file_cred, ssize_t *aresid, struct thread *td); int vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, void *base, size_t len, off_t offset, enum uio_seg segflg, int ioflg, Modified: stable/9/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vnops.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/ufs/ffs/ffs_vnops.c Fri Mar 23 11:26:54 2012 (r233353) @@ -419,7 +419,8 @@ ffs_read(ap) ufs_lbn_t lbn, nextlbn; off_t bytesinfile; long size, xfersize, blkoffset; - int error, orig_resid; + ssize_t orig_resid; + int error; int seqcount; int ioflag; @@ -632,8 +633,9 @@ ffs_write(ap) struct buf *bp; ufs_lbn_t lbn; off_t osize; + ssize_t resid; int seqcount; - int blkoffset, error, flags, ioflag, resid, size, xfersize; + int blkoffset, error, flags, ioflag, size, xfersize; vp = ap->a_vp; uio = ap->a_uio; @@ -870,7 +872,8 @@ ffs_extread(struct vnode *vp, struct uio ufs_lbn_t lbn, nextlbn; off_t bytesinfile; long size, xfersize, blkoffset; - int error, orig_resid; + ssize_t orig_resid; + int error; ip = VTOI(vp); fs = ip->i_fs; @@ -1023,7 +1026,8 @@ ffs_extwrite(struct vnode *vp, struct ui struct buf *bp; ufs_lbn_t lbn; off_t osize; - int blkoffset, error, flags, resid, size, xfersize; + ssize_t resid; + int blkoffset, error, flags, size, xfersize; ip = VTOI(vp); fs = ip->i_fs; Modified: stable/9/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/9/sys/ufs/ufs/ufs_lookup.c Fri Mar 23 11:18:07 2012 (r233352) +++ stable/9/sys/ufs/ufs/ufs_lookup.c Fri Mar 23 11:26:54 2012 (r233353) @@ -1337,7 +1337,8 @@ ufs_dirempty(ip, parentino, cred) doff_t off; struct dirtemplate dbuf; struct direct *dp = (struct direct *)&dbuf; - int error, count, namlen; + int error, namlen; + ssize_t count; #define MINDIRSIZ (sizeof (struct dirtemplate) / 2) for (off = 0; off < ip->i_size; off += dp->d_reclen) { From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 11:35:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C54991065670; Fri, 23 Mar 2012 11:35:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96BD98FC1D; Fri, 23 Mar 2012 11:35:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NBZ27g073580; Fri, 23 Mar 2012 11:35:02 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NBZ2EF073576; Fri, 23 Mar 2012 11:35:02 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203231135.q2NBZ2EF073576@svn.freebsd.org> From: Dimitry Andric Date: Fri, 23 Mar 2012 11:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233354 - in head/sys: conf modules/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 11:35:02 -0000 Author: dim Date: Fri Mar 23 11:35:01 2012 New Revision: 233354 URL: http://svn.freebsd.org/changeset/base/233354 Log: Work around the following clang warning in mps(4): sys/dev/mps/mps_sas.c:861:1: error: function 'mpssas_discovery_timeout' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] mpssas_discovery_timeout(void *data) ^ Because the driver is obtained from upstream, we don't want to modify it; just silence the warning instead, it is harmless. MFC after: 3 days Modified: head/sys/conf/files head/sys/conf/kern.mk head/sys/modules/mps/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Mar 23 11:26:54 2012 (r233353) +++ head/sys/conf/files Fri Mar 23 11:35:01 2012 (r233354) @@ -1480,7 +1480,8 @@ dev/mps/mps.c optional mps dev/mps/mps_config.c optional mps dev/mps/mps_mapping.c optional mps dev/mps/mps_pci.c optional mps pci -dev/mps/mps_sas.c optional mps +dev/mps/mps_sas.c optional mps \ + compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}" dev/mps/mps_sas_lsi.c optional mps dev/mps/mps_table.c optional mps dev/mps/mps_user.c optional mps Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Fri Mar 23 11:26:54 2012 (r233353) +++ head/sys/conf/kern.mk Fri Mar 23 11:35:01 2012 (r233354) @@ -23,6 +23,7 @@ NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-cou NO_WUNUSED_VALUE= -Wno-unused-value NO_WSELF_ASSIGN= -Wno-self-assign NO_WFORMAT_SECURITY= -Wno-format-security +NO_WUNNEEDED_INTERNAL_DECL= -Wno-unneeded-internal-declaration # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. Modified: head/sys/modules/mps/Makefile ============================================================================== --- head/sys/modules/mps/Makefile Fri Mar 23 11:26:54 2012 (r233353) +++ head/sys/modules/mps/Makefile Fri Mar 23 11:35:01 2012 (r233354) @@ -11,3 +11,6 @@ SRCS+= device_if.h bus_if.h pci_if.h #CFLAGS += -DMPS_DEBUG .include + +CWARNFLAGS.mps_sas.c= ${NO_WUNNEEDED_INTERNAL_DECL} +CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 12:01:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1F371065678; Fri, 23 Mar 2012 12:01:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCCD88FC23; Fri, 23 Mar 2012 12:01:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NC1XWS075191; Fri, 23 Mar 2012 12:01:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NC1Xt3075189; Fri, 23 Mar 2012 12:01:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231201.q2NC1Xt3075189@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 12:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233355 - in stable/9/sys: i386/conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 12:01:34 -0000 Author: jhb Date: Fri Mar 23 12:01:33 2012 New Revision: 233355 URL: http://svn.freebsd.org/changeset/base/233355 Log: MFC 232265: Properly clear a device's devclass if DEVICE_ATTACH() fails if the device does not have a fixed devclass. Modified: stable/9/sys/kern/subr_bus.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/kern/subr_bus.c ============================================================================== --- stable/9/sys/kern/subr_bus.c Fri Mar 23 11:35:01 2012 (r233354) +++ stable/9/sys/kern/subr_bus.c Fri Mar 23 12:01:33 2012 (r233355) @@ -2726,9 +2726,8 @@ device_attach(device_t dev) if ((error = DEVICE_ATTACH(dev)) != 0) { printf("device_attach: %s%d attach returned %d\n", dev->driver->name, dev->unit, error); - /* Unset the class; set in device_probe_child */ - if (dev->devclass == NULL) - (void)device_set_devclass(dev, NULL); + if (!(dev->flags & DF_FIXEDCLASS)) + devclass_delete_device(dev->devclass, dev); (void)device_set_driver(dev, NULL); device_sysctl_fini(dev); dev->state = DS_NOTPRESENT; From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 12:02:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 284E61065676; Fri, 23 Mar 2012 12:02:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1BD08FC1B; Fri, 23 Mar 2012 12:02:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NC2023075241; Fri, 23 Mar 2012 12:02:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NC20SV075239; Fri, 23 Mar 2012 12:02:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231202.q2NC20SV075239@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 12:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233356 - in stable/8/sys: i386/conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 12:02:01 -0000 Author: jhb Date: Fri Mar 23 12:02:00 2012 New Revision: 233356 URL: http://svn.freebsd.org/changeset/base/233356 Log: MFC 232265: Properly clear a device's devclass if DEVICE_ATTACH() fails if the device does not have a fixed devclass. Modified: stable/8/sys/kern/subr_bus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Fri Mar 23 12:01:33 2012 (r233355) +++ stable/8/sys/kern/subr_bus.c Fri Mar 23 12:02:00 2012 (r233356) @@ -2729,9 +2729,8 @@ device_attach(device_t dev) if ((error = DEVICE_ATTACH(dev)) != 0) { printf("device_attach: %s%d attach returned %d\n", dev->driver->name, dev->unit, error); - /* Unset the class; set in device_probe_child */ - if (dev->devclass == NULL) - (void)device_set_devclass(dev, NULL); + if (!(dev->flags & DF_FIXEDCLASS)) + devclass_delete_device(dev->devclass, dev); (void)device_set_driver(dev, NULL); device_sysctl_fini(dev); dev->state = DS_NOTPRESENT; From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 12:04:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9EBD1065673; Fri, 23 Mar 2012 12:04:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C57F88FC15; Fri, 23 Mar 2012 12:04:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NC4iTA075378; Fri, 23 Mar 2012 12:04:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NC4iTW075376; Fri, 23 Mar 2012 12:04:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203231204.q2NC4iTW075376@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 23 Mar 2012 12:04:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233357 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 12:04:45 -0000 Author: kib Date: Fri Mar 23 12:04:44 2012 New Revision: 233357 URL: http://svn.freebsd.org/changeset/base/233357 Log: Implement xstrdup() using strlen()/xmalloc()/memcpy() already presented in rtld, instead of pulling in libc strdup(). Submitted by: bde MFC after: 2 weeks Modified: head/libexec/rtld-elf/xmalloc.c Modified: head/libexec/rtld-elf/xmalloc.c ============================================================================== --- head/libexec/rtld-elf/xmalloc.c Fri Mar 23 12:02:00 2012 (r233356) +++ head/libexec/rtld-elf/xmalloc.c Fri Mar 23 12:04:44 2012 (r233357) @@ -57,12 +57,13 @@ xmalloc(size_t size) } char * -xstrdup(const char *s) +xstrdup(const char *str) { - char *p = strdup(s); - if (p == NULL) { - rtld_fdputstr(STDERR_FILENO, "Out of memory\n"); - _exit(1); - } - return p; + char *copy; + size_t len; + + len = strlen(str) + 1; + copy = xmalloc(len); + memcpy(copy, str, len); + return (copy); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 12:05:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8195D1065670; Fri, 23 Mar 2012 12:05:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 428538FC27; Fri, 23 Mar 2012 12:05:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NC5qZl075451; Fri, 23 Mar 2012 12:05:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NC5qpw075449; Fri, 23 Mar 2012 12:05:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231205.q2NC5qpw075449@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 12:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233358 - in stable/9/sys: i386/conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 12:05:52 -0000 Author: jhb Date: Fri Mar 23 12:05:51 2012 New Revision: 233358 URL: http://svn.freebsd.org/changeset/base/233358 Log: MFC 232218: Clear the a device's description string anytime it's driver changes. Descriptions are specific to drivers and we don't change drivers on attached devices. This fixes a few places where we were not clearing the description when detaching a driver (e.g. if device_attach() failed). While here, fix a few other nits: - Remove spurious call to remove a device's driver from devclass_driver_deleted(). device_detach() removes it already. - Fix a typo. Modified: stable/9/sys/kern/subr_bus.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/kern/subr_bus.c ============================================================================== --- stable/9/sys/kern/subr_bus.c Fri Mar 23 12:04:44 2012 (r233357) +++ stable/9/sys/kern/subr_bus.c Fri Mar 23 12:05:51 2012 (r233358) @@ -1129,7 +1129,6 @@ devclass_driver_deleted(devclass_t buscl dev->parent->devclass == busclass) { if ((error = device_detach(dev)) != 0) return (error); - (void)device_set_driver(dev, NULL); BUS_PROBE_NOMATCH(dev->parent, dev); devnomatch(dev); dev->flags |= DF_DONENOMATCH; @@ -2091,7 +2090,7 @@ device_probe_child(device_t dev, device_ /* XXX What happens if we rebid and got no best? */ if (best) { /* - * If this device was atached, and we were asked to + * If this device was attached, and we were asked to * rescan, and it is a different driver, then we have * to detach the old driver and reattach this new one. * Note, we don't have to check for DF_REBID here @@ -2598,6 +2597,7 @@ device_set_driver(device_t dev, driver_t free(dev->softc, M_BUS_SC); dev->softc = NULL; } + device_set_desc(dev, NULL); kobj_delete((kobj_t) dev, NULL); dev->driver = driver; if (driver) { @@ -2782,7 +2782,6 @@ device_detach(device_t dev) dev->state = DS_NOTPRESENT; (void)device_set_driver(dev, NULL); - device_set_desc(dev, NULL); device_sysctl_fini(dev); return (0); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 12:06:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 552C11065690; Fri, 23 Mar 2012 12:06:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 260CB8FC15; Fri, 23 Mar 2012 12:06:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NC6Ww2075513; Fri, 23 Mar 2012 12:06:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NC6WRc075511; Fri, 23 Mar 2012 12:06:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231206.q2NC6WRc075511@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 12:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233359 - in stable/8/sys: i386/conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 12:06:33 -0000 Author: jhb Date: Fri Mar 23 12:06:32 2012 New Revision: 233359 URL: http://svn.freebsd.org/changeset/base/233359 Log: MFC 232218: Clear the a device's description string anytime it's driver changes. Descriptions are specific to drivers and we don't change drivers on attached devices. This fixes a few places where we were not clearing the description when detaching a driver (e.g. if device_attach() failed). While here, fix a few other nits: - Remove spurious call to remove a device's driver from devclass_driver_deleted(). device_detach() removes it already. - Fix a typo. Modified: stable/8/sys/kern/subr_bus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Fri Mar 23 12:05:51 2012 (r233358) +++ stable/8/sys/kern/subr_bus.c Fri Mar 23 12:06:32 2012 (r233359) @@ -1165,7 +1165,6 @@ devclass_driver_deleted(devclass_t buscl dev->parent->devclass == busclass) { if ((error = device_detach(dev)) != 0) return (error); - (void)device_set_driver(dev, NULL); BUS_PROBE_NOMATCH(dev->parent, dev); devnomatch(dev); dev->flags |= DF_DONENOMATCH; @@ -2094,7 +2093,7 @@ device_probe_child(device_t dev, device_ /* XXX What happens if we rebid and got no best? */ if (best) { /* - * If this device was atached, and we were asked to + * If this device was attached, and we were asked to * rescan, and it is a different driver, then we have * to detach the old driver and reattach this new one. * Note, we don't have to check for DF_REBID here @@ -2601,6 +2600,7 @@ device_set_driver(device_t dev, driver_t free(dev->softc, M_BUS_SC); dev->softc = NULL; } + device_set_desc(dev, NULL); kobj_delete((kobj_t) dev, NULL); dev->driver = driver; if (driver) { @@ -2785,7 +2785,6 @@ device_detach(device_t dev) dev->state = DS_NOTPRESENT; (void)device_set_driver(dev, NULL); - device_set_desc(dev, NULL); device_sysctl_fini(dev); return (0); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 12:10:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8A69106564A; Fri, 23 Mar 2012 12:10:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B36318FC0A; Fri, 23 Mar 2012 12:10:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NCACvg075660; Fri, 23 Mar 2012 12:10:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NCACjn075658; Fri, 23 Mar 2012 12:10:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203231210.q2NCACjn075658@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 23 Mar 2012 12:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233360 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 12:10:12 -0000 Author: kib Date: Fri Mar 23 12:10:12 2012 New Revision: 233360 URL: http://svn.freebsd.org/changeset/base/233360 Log: Centralize the calculation of the top source directory. This simplifies the build of rtld with partial checkout, allowing to override only one place to reference other tree. Submitted by: bde MFC after: 2 weeks Modified: head/libexec/rtld-elf/Makefile Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Fri Mar 23 12:06:32 2012 (r233359) +++ head/libexec/rtld-elf/Makefile Fri Mar 23 12:10:12 2012 (r233360) @@ -9,8 +9,9 @@ SRCS= rtld_start.S \ malloc.c xmalloc.c debug.c libmap.c MAN= rtld.1 CSTD?= gnu99 +TOPSRCDIR= ${.CURDIR}/../.. CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -CFLAGS+= -I${.CURDIR}/../../lib/csu/common +CFLAGS+= -I${TOPSRCDIR}/lib/csu/common .if exists(${.CURDIR}/${MACHINE_ARCH}) RTLD_ARCH= ${MACHINE_ARCH} .else @@ -42,7 +43,7 @@ DPADD= ${LIBC_PIC} LDADD= -lc_pic -lssp_nonshared .if ${MK_SYMVER} == "yes" -LIBCDIR= ${.CURDIR}/../../lib/libc +LIBCDIR= ${TOPSRCDIR}/lib/libc VERSION_DEF= ${LIBCDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map VERSION_MAP= Version.map From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 12:13:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD85E106564A; Fri, 23 Mar 2012 12:13:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9848F8FC16; Fri, 23 Mar 2012 12:13:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NCDVLx075826; Fri, 23 Mar 2012 12:13:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NCDVB6075824; Fri, 23 Mar 2012 12:13:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203231213.q2NCDVB6075824@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 23 Mar 2012 12:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233361 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 12:13:31 -0000 Author: kib Date: Fri Mar 23 12:13:31 2012 New Revision: 233361 URL: http://svn.freebsd.org/changeset/base/233361 Log: Remove superfluous extern keywords. MFC after: 2 weeks Modified: head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Fri Mar 23 12:10:12 2012 (r233360) +++ head/libexec/rtld-elf/rtld.h Fri Mar 23 12:13:31 2012 (r233361) @@ -316,19 +316,19 @@ typedef struct Struct_SymLook { struct Struct_RtldLockState *lockstate; } SymLook; -extern void _rtld_error(const char *, ...) __printflike(1, 2); -extern const char *rtld_strerror(int); -extern Obj_Entry *map_object(int, const char *, const struct stat *); -extern void *xcalloc(size_t, size_t); -extern void *xmalloc(size_t); -extern char *xstrdup(const char *); +void _rtld_error(const char *, ...) __printflike(1, 2); +const char *rtld_strerror(int); +Obj_Entry *map_object(int, const char *, const struct stat *); +void *xcalloc(size_t, size_t); +void *xmalloc(size_t); +char *xstrdup(const char *); extern Elf_Addr _GLOBAL_OFFSET_TABLE_[]; extern Elf_Sym sym_zero; /* For resolving undefined weak refs. */ -extern void dump_relocations (Obj_Entry *); -extern void dump_obj_relocations (Obj_Entry *); -extern void dump_Elf_Rel (Obj_Entry *, const Elf_Rel *, u_long); -extern void dump_Elf_Rela (Obj_Entry *, const Elf_Rela *, u_long); +void dump_relocations(Obj_Entry *); +void dump_obj_relocations(Obj_Entry *); +void dump_Elf_Rel(Obj_Entry *, const Elf_Rel *, u_long); +void dump_Elf_Rela(Obj_Entry *, const Elf_Rela *, u_long); /* * Function declarations. From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 12:34:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04F3C106564A; Fri, 23 Mar 2012 12:34:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3EC18FC0A; Fri, 23 Mar 2012 12:34:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NCYdSx076518; Fri, 23 Mar 2012 12:34:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NCYd26076516; Fri, 23 Mar 2012 12:34:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231234.q2NCYd26076516@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 12:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233362 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 12:34:40 -0000 Author: jhb Date: Fri Mar 23 12:34:39 2012 New Revision: 233362 URL: http://svn.freebsd.org/changeset/base/233362 Log: Don't cast a bus address to a uint8_t pointer just to add an offset to it. Instead, add the offset directly to the bus address. Modified: head/sys/dev/sound/pci/emu10kx.c Modified: head/sys/dev/sound/pci/emu10kx.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx.c Fri Mar 23 12:13:31 2012 (r233361) +++ head/sys/dev/sound/pci/emu10kx.c Fri Mar 23 12:34:39 2012 (r233362) @@ -1137,7 +1137,7 @@ emu_memalloc(struct emu_mem *mem, uint32 ofs = 0; for (idx = start; idx < start + blksz; idx++) { mem->bmap[idx >> 3] |= 1 << (idx & 7); - tmp = (uint32_t) (u_long) ((uint8_t *) blk->buf_addr + ofs); + tmp = (uint32_t) (blk->buf_addr + ofs); mem->ptb_pages[idx] = (tmp << 1) | idx; ofs += EMUPAGESIZE; } From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 13:44:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95195106566C; Fri, 23 Mar 2012 13:44:44 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6770C8FC15; Fri, 23 Mar 2012 13:44:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NDiiD1078732; Fri, 23 Mar 2012 13:44:44 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NDiiMq078730; Fri, 23 Mar 2012 13:44:44 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201203231344.q2NDiiMq078730@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 23 Mar 2012 13:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233363 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 13:44:44 -0000 Author: gibbs Date: Fri Mar 23 13:44:43 2012 New Revision: 233363 URL: http://svn.freebsd.org/changeset/base/233363 Log: Please welcome Cherry Matthew (cherry) as a src committer. Cherry will be working on amd64 SMP Xen PV and Dom0 support. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Fri Mar 23 12:34:39 2012 (r233362) +++ svnadmin/conf/access Fri Mar 23 13:44:43 2012 (r233363) @@ -48,6 +48,7 @@ bruno bschmidt bz charnier +cherry cognet cokane cperciva From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 15:37:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 215D41065678; Fri, 23 Mar 2012 15:37:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B4D18FC17; Fri, 23 Mar 2012 15:37:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NFbfoP082290; Fri, 23 Mar 2012 15:37:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NFbf9k082283; Fri, 23 Mar 2012 15:37:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203231537.q2NFbf9k082283@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 23 Mar 2012 15:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233365 - in stable/8/sys: kern sys vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 15:37:42 -0000 Author: kib Date: Fri Mar 23 15:37:41 2012 New Revision: 233365 URL: http://svn.freebsd.org/changeset/base/233365 Log: MFC r223889: Add a facility to disable processing page faults. When activated, uiomove generates EFAULT if any accessed address is not mapped, as opposed to handling the fault. Modified: stable/8/sys/kern/kern_subr.c stable/8/sys/sys/proc.h stable/8/sys/sys/systm.h stable/8/sys/sys/uio.h stable/8/sys/vm/vm_extern.h stable/8/sys/vm/vm_fault.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/kern_subr.c ============================================================================== --- stable/8/sys/kern/kern_subr.c Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/kern/kern_subr.c Fri Mar 23 15:37:41 2012 (r233365) @@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$"); SYSCTL_INT(_kern, KERN_IOV_MAX, iov_max, CTLFLAG_RD, NULL, UIO_MAXIOV, "Maximum number of elements in an I/O vector; sysconf(_SC_IOV_MAX)"); +static int uiomove_faultflag(void *cp, int n, struct uio *uio, int nofault); + #ifdef ZERO_COPY_SOCKETS /* Declared in uipc_socket.c */ extern int so_zero_copy_receive; @@ -132,23 +134,65 @@ retry: #endif /* ZERO_COPY_SOCKETS */ int +copyin_nofault(const void *udaddr, void *kaddr, size_t len) +{ + int error, save; + + save = vm_fault_disable_pagefaults(); + error = copyin(udaddr, kaddr, len); + vm_fault_enable_pagefaults(save); + return (error); +} + +int +copyout_nofault(const void *kaddr, void *udaddr, size_t len) +{ + int error, save; + + save = vm_fault_disable_pagefaults(); + error = copyout(kaddr, udaddr, len); + vm_fault_enable_pagefaults(save); + return (error); +} + +int uiomove(void *cp, int n, struct uio *uio) { - struct thread *td = curthread; + + return (uiomove_faultflag(cp, n, uio, 0)); +} + +int +uiomove_nofault(void *cp, int n, struct uio *uio) +{ + + return (uiomove_faultflag(cp, n, uio, 1)); +} + +static int +uiomove_faultflag(void *cp, int n, struct uio *uio, int nofault) +{ + struct thread *td; struct iovec *iov; u_int cnt; - int error = 0; - int save = 0; + int error, newflags, save; + + td = curthread; + error = 0; KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE, ("uiomove: mode")); - KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, + KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == td, ("uiomove proc")); - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, - "Calling uiomove()"); - - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; + if (!nofault) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "Calling uiomove()"); + + /* XXX does it make a sense to set TDP_DEADLKTREAT for UIO_SYSSPACE ? */ + newflags = TDP_DEADLKTREAT; + if (uio->uio_segflg == UIO_USERSPACE && nofault) + newflags |= TDP_NOFAULTING; + save = curthread_pflags_set(newflags); while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; @@ -191,8 +235,7 @@ uiomove(void *cp, int n, struct uio *uio n -= cnt; } out: - if (save == 0) - td->td_pflags &= ~TDP_DEADLKTREAT; + curthread_pflags_restore(save); return (error); } Modified: stable/8/sys/sys/proc.h ============================================================================== --- stable/8/sys/sys/proc.h Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/sys/proc.h Fri Mar 23 15:37:41 2012 (r233365) @@ -391,7 +391,7 @@ do { \ #define TDP_COWINPROGRESS 0x00000010 /* Snapshot copy-on-write in progress. */ #define TDP_ALTSTACK 0x00000020 /* Have alternate signal stack. */ #define TDP_DEADLKTREAT 0x00000040 /* Lock aquisition - deadlock treatment. */ -#define TDP_UNUSED80 0x00000080 /* available. */ +#define TDP_NOFAULTING 0x00000080 /* Do not handle page faults. */ #define TDP_NOSLEEPING 0x00000100 /* Thread is not allowed to sleep on a sq. */ #define TDP_OWEUPC 0x00000200 /* Call addupc() at next AST. */ #define TDP_ITHREAD 0x00000400 /* Thread is an interrupt thread. */ Modified: stable/8/sys/sys/systm.h ============================================================================== --- stable/8/sys/sys/systm.h Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/sys/systm.h Fri Mar 23 15:37:41 2012 (r233365) @@ -216,8 +216,12 @@ int copyinstr(const void * __restrict ud __nonnull(1) __nonnull(2); int copyin(const void * __restrict udaddr, void * __restrict kaddr, size_t len) __nonnull(1) __nonnull(2); +int copyin_nofault(const void * __restrict udaddr, void * __restrict kaddr, + size_t len) __nonnull(1) __nonnull(2); int copyout(const void * __restrict kaddr, void * __restrict udaddr, size_t len) __nonnull(1) __nonnull(2); +int copyout_nofault(const void * __restrict kaddr, void * __restrict udaddr, + size_t len) __nonnull(1) __nonnull(2); int fubyte(const void *base); long fuword(const void *base); Modified: stable/8/sys/sys/uio.h ============================================================================== --- stable/8/sys/sys/uio.h Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/sys/uio.h Fri Mar 23 15:37:41 2012 (r233365) @@ -101,6 +101,7 @@ int uiomove(void *cp, int n, struct uio int uiomove_frombuf(void *buf, int buflen, struct uio *uio); int uiomove_fromphys(struct vm_page *ma[], vm_offset_t offset, int n, struct uio *uio); +int uiomove_nofault(void *cp, int n, struct uio *uio); int uiomoveco(void *cp, int n, struct uio *uio, int disposable); #else /* !_KERNEL */ Modified: stable/8/sys/vm/vm_extern.h ============================================================================== --- stable/8/sys/vm/vm_extern.h Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/vm/vm_extern.h Fri Mar 23 15:37:41 2012 (r233365) @@ -61,6 +61,8 @@ int useracc(void *, int, int); int vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int); void vm_fault_copy_entry(vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t, vm_ooffset_t *); +int vm_fault_disable_pagefaults(void); +void vm_fault_enable_pagefaults(int save); void vm_fault_unwire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t); int vm_fault_wire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t); int vm_forkproc(struct thread *, struct proc *, struct thread *, struct vmspace *, int); Modified: stable/8/sys/vm/vm_fault.c ============================================================================== --- stable/8/sys/vm/vm_fault.c Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/vm/vm_fault.c Fri Mar 23 15:37:41 2012 (r233365) @@ -222,6 +222,9 @@ vm_fault(vm_map_t map, vm_offset_t vaddr struct vnode *vp; int locked, error; + if ((curthread->td_pflags & TDP_NOFAULTING) != 0) + return (KERN_PROTECTION_FAILURE); + hardfault = 0; growstack = TRUE; PCPU_INC(cnt.v_vm_faults); @@ -1405,3 +1408,17 @@ vm_fault_additional_pages(m, rbehind, ra /* return number of pages */ return i; } + +int +vm_fault_disable_pagefaults(void) +{ + + return (curthread_pflags_set(TDP_NOFAULTING)); +} + +void +vm_fault_enable_pagefaults(int save) +{ + + curthread_pflags_restore(save); +} From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 15:49:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3056106564A; Fri, 23 Mar 2012 15:49:46 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E1EF8FC1A; Fri, 23 Mar 2012 15:49:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NFnkTH082694; Fri, 23 Mar 2012 15:49:46 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NFnkPb082692; Fri, 23 Mar 2012 15:49:46 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201203231549.q2NFnkPb082692@svn.freebsd.org> From: Ken Smith Date: Fri, 23 Mar 2012 15:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233366 - releng/8.3/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 15:49:46 -0000 Author: kensmith Date: Fri Mar 23 15:49:46 2012 New Revision: 233366 URL: http://svn.freebsd.org/changeset/base/233366 Log: MFS r233211 (problem not believed to effect head or stable/9): Implement a workaround for a bug in the linker's estimate for the program header size that can cause it to fail linking the kernel. Reviewed by: kib Approved by: re (bz) Modified: releng/8.3/sys/conf/ldscript.i386 Directory Properties: releng/8.3/sys/ (props changed) Modified: releng/8.3/sys/conf/ldscript.i386 ============================================================================== --- releng/8.3/sys/conf/ldscript.i386 Fri Mar 23 15:37:41 2012 (r233365) +++ releng/8.3/sys/conf/ldscript.i386 Fri Mar 23 15:49:46 2012 (r233366) @@ -6,7 +6,7 @@ SEARCH_DIR(/usr/lib); SECTIONS { /* Read-only sections, merged into text segment: */ - . = kernbase + kernload + SIZEOF_HEADERS; + . = kernbase + kernload + 256; .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 16:12:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A152106564A; Fri, 23 Mar 2012 16:12:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24FF58FC12; Fri, 23 Mar 2012 16:12:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NGCqCX083518; Fri, 23 Mar 2012 16:12:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NGCqat083516; Fri, 23 Mar 2012 16:12:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203231612.q2NGCqat083516@svn.freebsd.org> From: Alexander Motin Date: Fri, 23 Mar 2012 16:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233367 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 16:12:53 -0000 Author: mav Date: Fri Mar 23 16:12:52 2012 New Revision: 233367 URL: http://svn.freebsd.org/changeset/base/233367 Log: MFC r232717: Be more polite when setting state->nextevent inside cpu_new_callout(). Hardclock is not the only who wakes idle CPU since kdtrace cyclic addition. Modified: stable/9/sys/kern/kern_clocksource.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_clocksource.c ============================================================================== --- stable/9/sys/kern/kern_clocksource.c Fri Mar 23 15:49:46 2012 (r233366) +++ stable/9/sys/kern/kern_clocksource.c Fri Mar 23 16:12:52 2012 (r233367) @@ -860,10 +860,11 @@ cpu_new_callout(int cpu, int ticks) * If timer is global - there is chance it is already programmed. */ if (periodic || (timer->et_flags & ET_FLAGS_PERCPU) == 0) { - state->nextevent = state->nexthard; tmp = hardperiod; bintime_mul(&tmp, ticks - 1); - bintime_add(&state->nextevent, &tmp); + bintime_add(&tmp, &state->nexthard); + if (bintime_cmp(&tmp, &state->nextevent, <)) + state->nextevent = tmp; if (periodic || bintime_cmp(&state->nextevent, &nexttick, >=)) { ET_HW_UNLOCK(state); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 16:17:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D2791065676; Fri, 23 Mar 2012 16:17:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E7AD8FC08; Fri, 23 Mar 2012 16:17:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NGHl1x083740; Fri, 23 Mar 2012 16:17:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NGHlKG083738; Fri, 23 Mar 2012 16:17:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203231617.q2NGHlKG083738@svn.freebsd.org> From: Alexander Motin Date: Fri, 23 Mar 2012 16:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233368 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 16:17:47 -0000 Author: mav Date: Fri Mar 23 16:17:46 2012 New Revision: 233368 URL: http://svn.freebsd.org/changeset/base/233368 Log: MFC r232793: Revert r175376 and tune cpufreq(4) frequency comparison logic instead. Instead of using 25MHz equality threshold, look for the nearest value when handling dev.cpu.0.freq sysctl and for exact match when it is expected. ACPI may report extra level with frequency 1MHz above the nominal to control Intel Turbo Boost operation. It is not a bug, but feature: dev.cpu.0.freq_levels: 2934/106000 2933/95000 2800/82000 ... In this case value 2933 means 2.93GHz, but 2934 means 3.2-3.6GHz. I've found that my Core i7 based systems have Intel Turbo Boost not used by default and without this change it was absolutely invisible and hard to control. Modified: stable/9/sys/kern/kern_cpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_cpu.c ============================================================================== --- stable/9/sys/kern/kern_cpu.c Fri Mar 23 16:12:52 2012 (r233367) +++ stable/9/sys/kern/kern_cpu.c Fri Mar 23 16:17:46 2012 (r233368) @@ -311,7 +311,7 @@ cf_set_method(device_t dev, const struct } /* If already at this level, just return. */ - if (CPUFREQ_CMP(sc->curr_level.total_set.freq, level->total_set.freq)) { + if (sc->curr_level.total_set.freq == level->total_set.freq) { CF_DEBUG("skipping freq %d, same as current level %d\n", level->total_set.freq, sc->curr_level.total_set.freq); goto skip; @@ -470,7 +470,7 @@ cf_get_method(device_t dev, struct cf_le if (CPUFREQ_DRV_GET(devs[n], &set) != 0) continue; for (i = 0; i < count; i++) { - if (CPUFREQ_CMP(set.freq, levels[i].total_set.freq)) { + if (set.freq == levels[i].total_set.freq) { sc->curr_level = levels[i]; break; } @@ -626,16 +626,6 @@ cf_levels_method(device_t dev, struct cf /* Finally, output the list of levels. */ i = 0; TAILQ_FOREACH(lev, &sc->all_levels, link) { - /* - * Skip levels that are too close in frequency to the - * previous levels. Some systems report bogus duplicate - * settings (i.e., for acpi_perf). - */ - if (i > 0 && CPUFREQ_CMP(lev->total_set.freq, - levels[i - 1].total_set.freq)) { - sc->all_count--; - continue; - } /* Skip levels that have a frequency that is too low. */ if (lev->total_set.freq < cf_lowest_freq) { @@ -869,7 +859,7 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS) { struct cpufreq_softc *sc; struct cf_level *levels; - int count, devcount, error, freq, i, n; + int best, count, diff, bdiff, devcount, error, freq, i, n; device_t *devs; devs = NULL; @@ -901,17 +891,16 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS) "cpufreq: need to increase CF_MAX_LEVELS\n"); break; } + best = 0; + bdiff = 1 << 30; for (i = 0; i < count; i++) { - if (CPUFREQ_CMP(levels[i].total_set.freq, freq)) { - error = CPUFREQ_SET(devs[n], &levels[i], - CPUFREQ_PRIO_USER); - break; + diff = abs(levels[i].total_set.freq - freq); + if (diff < bdiff) { + bdiff = diff; + best = i; } } - if (i == count) { - error = EINVAL; - break; - } + error = CPUFREQ_SET(devs[n], &levels[best], CPUFREQ_PRIO_USER); } out: From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 16:19:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DD9B106567F; Fri, 23 Mar 2012 16:19:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E37328FC21; Fri, 23 Mar 2012 16:19:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NGJE8l083849; Fri, 23 Mar 2012 16:19:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NGJEkQ083847; Fri, 23 Mar 2012 16:19:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203231619.q2NGJEkQ083847@svn.freebsd.org> From: Alexander Motin Date: Fri, 23 Mar 2012 16:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233369 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 16:19:15 -0000 Author: mav Date: Fri Mar 23 16:19:14 2012 New Revision: 233369 URL: http://svn.freebsd.org/changeset/base/233369 Log: MFC r232793: Revert r175376 and tune cpufreq(4) frequency comparison logic instead. Instead of using 25MHz equality threshold, look for the nearest value when handling dev.cpu.0.freq sysctl and for exact match when it is expected. ACPI may report extra level with frequency 1MHz above the nominal to control Intel Turbo Boost operation. It is not a bug, but feature: dev.cpu.0.freq_levels: 2934/106000 2933/95000 2800/82000 ... In this case value 2933 means 2.93GHz, but 2934 means 3.2-3.6GHz. I've found that my Core i7 based systems have Intel Turbo Boost not used by default and without this change it was absolutely invisible and hard to control. Modified: stable/8/sys/kern/kern_cpu.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/kern_cpu.c ============================================================================== --- stable/8/sys/kern/kern_cpu.c Fri Mar 23 16:17:46 2012 (r233368) +++ stable/8/sys/kern/kern_cpu.c Fri Mar 23 16:19:14 2012 (r233369) @@ -311,7 +311,7 @@ cf_set_method(device_t dev, const struct } /* If already at this level, just return. */ - if (CPUFREQ_CMP(sc->curr_level.total_set.freq, level->total_set.freq)) { + if (sc->curr_level.total_set.freq == level->total_set.freq) { CF_DEBUG("skipping freq %d, same as current level %d\n", level->total_set.freq, sc->curr_level.total_set.freq); goto skip; @@ -470,7 +470,7 @@ cf_get_method(device_t dev, struct cf_le if (CPUFREQ_DRV_GET(devs[n], &set) != 0) continue; for (i = 0; i < count; i++) { - if (CPUFREQ_CMP(set.freq, levels[i].total_set.freq)) { + if (set.freq == levels[i].total_set.freq) { sc->curr_level = levels[i]; break; } @@ -626,16 +626,6 @@ cf_levels_method(device_t dev, struct cf /* Finally, output the list of levels. */ i = 0; TAILQ_FOREACH(lev, &sc->all_levels, link) { - /* - * Skip levels that are too close in frequency to the - * previous levels. Some systems report bogus duplicate - * settings (i.e., for acpi_perf). - */ - if (i > 0 && CPUFREQ_CMP(lev->total_set.freq, - levels[i - 1].total_set.freq)) { - sc->all_count--; - continue; - } /* Skip levels that have a frequency that is too low. */ if (lev->total_set.freq < cf_lowest_freq) { @@ -869,7 +859,7 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS) { struct cpufreq_softc *sc; struct cf_level *levels; - int count, devcount, error, freq, i, n; + int best, count, diff, bdiff, devcount, error, freq, i, n; device_t *devs; devs = NULL; @@ -901,17 +891,16 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS) "cpufreq: need to increase CF_MAX_LEVELS\n"); break; } + best = 0; + bdiff = 1 << 30; for (i = 0; i < count; i++) { - if (CPUFREQ_CMP(levels[i].total_set.freq, freq)) { - error = CPUFREQ_SET(devs[n], &levels[i], - CPUFREQ_PRIO_USER); - break; + diff = abs(levels[i].total_set.freq - freq); + if (diff < bdiff) { + bdiff = diff; + best = i; } } - if (i == count) { - error = EINVAL; - break; - } + error = CPUFREQ_SET(devs[n], &levels[best], CPUFREQ_PRIO_USER); } out: From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 16:24:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A14321065670; Fri, 23 Mar 2012 16:24:08 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CBAC8FC0C; Fri, 23 Mar 2012 16:24:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NGO8a5084063; Fri, 23 Mar 2012 16:24:08 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NGO8Fi084061; Fri, 23 Mar 2012 16:24:08 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203231624.q2NGO8Fi084061@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 23 Mar 2012 16:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233370 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 16:24:08 -0000 Author: pluknet Date: Fri Mar 23 16:24:07 2012 New Revision: 233370 URL: http://svn.freebsd.org/changeset/base/233370 Log: Expand contraction. Spotted by: bjk Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Fri Mar 23 16:19:14 2012 (r233369) +++ head/share/man/man9/ifnet.9 Fri Mar 23 16:24:07 2012 (r233370) @@ -629,7 +629,7 @@ multiple physical layers on some devices This interface supports multicast. .It Dv IFF_CANTCONFIG .Aq S* -The interface isn't configurable in a meaningful way. +The interface is not configurable in a meaningful way. Primarily useful for .Dv IFT_USB interfaces registered at the interface list. From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 16:28:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1CD2C1065674; Fri, 23 Mar 2012 16:28:12 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1BB58FC1F; Fri, 23 Mar 2012 16:28:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NGSBoD084227; Fri, 23 Mar 2012 16:28:11 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NGSBmj084223; Fri, 23 Mar 2012 16:28:11 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201203231628.q2NGSBmj084223@svn.freebsd.org> From: Jim Harris Date: Fri, 23 Mar 2012 16:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233371 - head/sys/dev/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 16:28:12 -0000 Author: jimharris Date: Fri Mar 23 16:28:11 2012 New Revision: 233371 URL: http://svn.freebsd.org/changeset/base/233371 Log: Call xpt_bus_register during attach context, then freeze and do not release until domain discovery is complete. This fixes an isci(4) bug on FreeBSD 7.x where devices weren't always appearing after boot without an explicit rescan. Sponsored by: Intel Reported and tested by: Reviewed by: scottl Approved by: scottl Modified: head/sys/dev/isci/isci.h head/sys/dev/isci/isci_controller.c head/sys/dev/isci/isci_remote_device.c Modified: head/sys/dev/isci/isci.h ============================================================================== --- head/sys/dev/isci/isci.h Fri Mar 23 16:24:07 2012 (r233370) +++ head/sys/dev/isci/isci.h Fri Mar 23 16:28:11 2012 (r233371) @@ -122,6 +122,7 @@ struct ISCI_CONTROLLER SCI_CONTROLLER_HANDLE_T scif_controller_handle; struct ISCI_DOMAIN domain[SCI_MAX_DOMAINS]; BOOL is_started; + BOOL has_been_scanned; uint32_t initial_discovery_mask; BOOL is_frozen; uint8_t *remote_device_memory; Modified: head/sys/dev/isci/isci_controller.c ============================================================================== --- head/sys/dev/isci/isci_controller.c Fri Mar 23 16:24:07 2012 (r233370) +++ head/sys/dev/isci/isci_controller.c Fri Mar 23 16:28:11 2012 (r233371) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -300,6 +303,16 @@ SCI_STATUS isci_controller_initialize(st TUNABLE_INT_FETCH("hw.isci.io_shortage", &io_shortage); controller->sim_queue_depth += io_shortage; + /* Attach to CAM using xpt_bus_register now, then immediately freeze + * the simq. It will get released later when initial domain discovery + * is complete. + */ + controller->has_been_scanned = FALSE; + mtx_lock(&controller->lock); + isci_controller_attach_to_cam(controller); + xpt_freeze_simq(controller->sim, 1); + mtx_unlock(&controller->lock); + return (scif_controller_initialize(controller->scif_controller_handle)); } @@ -441,13 +454,13 @@ void isci_controller_start(void *control void isci_controller_domain_discovery_complete( struct ISCI_CONTROLLER *isci_controller, struct ISCI_DOMAIN *isci_domain) { - if (isci_controller->sim == NULL) + if (!isci_controller->has_been_scanned) { - /* Controller has not been attached to CAM yet. We'll clear + /* Controller has not been scanned yet. We'll clear * the discovery bit for this domain, then check if all bits * are now clear. That would indicate that all domains are - * done with discovery and we can then attach the controller - * to CAM. + * done with discovery and we can then proceed with initial + * scan. */ isci_controller->initial_discovery_mask &= @@ -457,7 +470,25 @@ void isci_controller_domain_discovery_co struct isci_softc *driver = isci_controller->isci; uint8_t next_index = isci_controller->index + 1; - isci_controller_attach_to_cam(isci_controller); + isci_controller->has_been_scanned = TRUE; + + /* Unfreeze simq to allow initial scan to proceed. */ + xpt_release_simq(isci_controller->sim, TRUE); + +#if __FreeBSD_version < 800000 + /* When driver is loaded after boot, we need to + * explicitly rescan here for versions <8.0, because + * CAM only automatically scans new buses at boot + * time. + */ + union ccb *ccb = xpt_alloc_ccb_nowait(); + + xpt_create_path(&ccb->ccb_h.path, xpt_periph, + cam_sim_path(isci_controller->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); + + xpt_rescan(ccb); +#endif if (next_index < driver->controller_count) { /* There are more controllers that need to Modified: head/sys/dev/isci/isci_remote_device.c ============================================================================== --- head/sys/dev/isci/isci_remote_device.c Fri Mar 23 16:24:07 2012 (r233370) +++ head/sys/dev/isci/isci_remote_device.c Fri Mar 23 16:28:11 2012 (r233371) @@ -74,13 +74,12 @@ scif_cb_remote_device_ready(SCI_CONTROLL isci_controller->remote_device[device_index] = isci_remote_device; - if (isci_controller->sim != NULL) { - /* The sim object is not NULL, meaning we have attached - * the controller to CAM already. In that case, create - * a CCB to instruct CAM to rescan this device. - * If the sim object is NULL, this device will get - * scanned as part of the initial scan when the - * controller is attached to CAM. + if (isci_controller->has_been_scanned) { + /* The sim object has been scanned at least once + * already. In that case, create a CCB to instruct + * CAM to rescan this device. + * If the sim object has not been scanned, this device + * will get scanned as part of the initial scan. */ union ccb *ccb = xpt_alloc_ccb_nowait(); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 16:44:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id C26651065670; Fri, 23 Mar 2012 16:44:12 +0000 (UTC) Date: Fri, 23 Mar 2012 16:44:12 +0000 From: Alexey Dokuchaev To: John Baldwin Message-ID: <20120323164412.GB8323@FreeBSD.org> References: <201203231206.q2NC6WRc075511@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201203231206.q2NC6WRc075511@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r233359 - in stable/8/sys: i386/conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 16:44:12 -0000 On Fri, Mar 23, 2012 at 12:06:32PM +0000, John Baldwin wrote: > Author: jhb > Date: Fri Mar 23 12:06:32 2012 > New Revision: 233359 > URL: http://svn.freebsd.org/changeset/base/233359 > > Log: > MFC 232218: > Clear the a device's description string anytime it's driver changes. > [...] Thanks John! ./danfe From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 16:59:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28C05106566B; Fri, 23 Mar 2012 16:59:04 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A3CD8FC0C; Fri, 23 Mar 2012 16:59:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NGx3GK085337; Fri, 23 Mar 2012 16:59:03 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NGx3D9085333; Fri, 23 Mar 2012 16:59:03 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201203231659.q2NGx3D9085333@svn.freebsd.org> From: Jim Harris Date: Fri, 23 Mar 2012 16:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233372 - stable/9/sys/dev/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 16:59:04 -0000 Author: jimharris Date: Fri Mar 23 16:59:03 2012 New Revision: 233372 URL: http://svn.freebsd.org/changeset/base/233372 Log: MFC r233371: Call xpt_bus_register during attach context, then freeze and do not release until domain discovery is complete. This fixes an isci(4) bug on FreeBSD 7.x where devices weren't always appearing after boot without an explicit rescan. Sponsored by: Intel Reported and tested by: Reviewed by: scottl Approved by: scottl Modified: stable/9/sys/dev/isci/isci.h stable/9/sys/dev/isci/isci_controller.c stable/9/sys/dev/isci/isci_remote_device.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/isci/isci.h ============================================================================== --- stable/9/sys/dev/isci/isci.h Fri Mar 23 16:28:11 2012 (r233371) +++ stable/9/sys/dev/isci/isci.h Fri Mar 23 16:59:03 2012 (r233372) @@ -122,6 +122,7 @@ struct ISCI_CONTROLLER SCI_CONTROLLER_HANDLE_T scif_controller_handle; struct ISCI_DOMAIN domain[SCI_MAX_DOMAINS]; BOOL is_started; + BOOL has_been_scanned; uint32_t initial_discovery_mask; BOOL is_frozen; uint8_t *remote_device_memory; Modified: stable/9/sys/dev/isci/isci_controller.c ============================================================================== --- stable/9/sys/dev/isci/isci_controller.c Fri Mar 23 16:28:11 2012 (r233371) +++ stable/9/sys/dev/isci/isci_controller.c Fri Mar 23 16:59:03 2012 (r233372) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -300,6 +303,16 @@ SCI_STATUS isci_controller_initialize(st TUNABLE_INT_FETCH("hw.isci.io_shortage", &io_shortage); controller->sim_queue_depth += io_shortage; + /* Attach to CAM using xpt_bus_register now, then immediately freeze + * the simq. It will get released later when initial domain discovery + * is complete. + */ + controller->has_been_scanned = FALSE; + mtx_lock(&controller->lock); + isci_controller_attach_to_cam(controller); + xpt_freeze_simq(controller->sim, 1); + mtx_unlock(&controller->lock); + return (scif_controller_initialize(controller->scif_controller_handle)); } @@ -441,13 +454,13 @@ void isci_controller_start(void *control void isci_controller_domain_discovery_complete( struct ISCI_CONTROLLER *isci_controller, struct ISCI_DOMAIN *isci_domain) { - if (isci_controller->sim == NULL) + if (!isci_controller->has_been_scanned) { - /* Controller has not been attached to CAM yet. We'll clear + /* Controller has not been scanned yet. We'll clear * the discovery bit for this domain, then check if all bits * are now clear. That would indicate that all domains are - * done with discovery and we can then attach the controller - * to CAM. + * done with discovery and we can then proceed with initial + * scan. */ isci_controller->initial_discovery_mask &= @@ -457,7 +470,25 @@ void isci_controller_domain_discovery_co struct isci_softc *driver = isci_controller->isci; uint8_t next_index = isci_controller->index + 1; - isci_controller_attach_to_cam(isci_controller); + isci_controller->has_been_scanned = TRUE; + + /* Unfreeze simq to allow initial scan to proceed. */ + xpt_release_simq(isci_controller->sim, TRUE); + +#if __FreeBSD_version < 800000 + /* When driver is loaded after boot, we need to + * explicitly rescan here for versions <8.0, because + * CAM only automatically scans new buses at boot + * time. + */ + union ccb *ccb = xpt_alloc_ccb_nowait(); + + xpt_create_path(&ccb->ccb_h.path, xpt_periph, + cam_sim_path(isci_controller->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); + + xpt_rescan(ccb); +#endif if (next_index < driver->controller_count) { /* There are more controllers that need to Modified: stable/9/sys/dev/isci/isci_remote_device.c ============================================================================== --- stable/9/sys/dev/isci/isci_remote_device.c Fri Mar 23 16:28:11 2012 (r233371) +++ stable/9/sys/dev/isci/isci_remote_device.c Fri Mar 23 16:59:03 2012 (r233372) @@ -74,13 +74,12 @@ scif_cb_remote_device_ready(SCI_CONTROLL isci_controller->remote_device[device_index] = isci_remote_device; - if (isci_controller->sim != NULL) { - /* The sim object is not NULL, meaning we have attached - * the controller to CAM already. In that case, create - * a CCB to instruct CAM to rescan this device. - * If the sim object is NULL, this device will get - * scanned as part of the initial scan when the - * controller is attached to CAM. + if (isci_controller->has_been_scanned) { + /* The sim object has been scanned at least once + * already. In that case, create a CCB to instruct + * CAM to rescan this device. + * If the sim object has not been scanned, this device + * will get scanned as part of the initial scan. */ union ccb *ccb = xpt_alloc_ccb_nowait(); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 17:11:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E805A1065673; Fri, 23 Mar 2012 17:11:36 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C95BB8FC1E; Fri, 23 Mar 2012 17:11:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NHBa52085800; Fri, 23 Mar 2012 17:11:36 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NHBaAZ085796; Fri, 23 Mar 2012 17:11:36 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201203231711.q2NHBaAZ085796@svn.freebsd.org> From: Jim Harris Date: Fri, 23 Mar 2012 17:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233373 - stable/8/sys/dev/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 17:11:37 -0000 Author: jimharris Date: Fri Mar 23 17:11:36 2012 New Revision: 233373 URL: http://svn.freebsd.org/changeset/base/233373 Log: MFC r233371: Call xpt_bus_register during attach context, then freeze and do not release until domain discovery is complete. This fixes an isci(4) bug on FreeBSD 7.x where devices weren't always appearing after boot without an explicit rescan. Sponsored by: Intel Reported and tested by: Reviewed by: scottl Approved by: scottl Modified: stable/8/sys/dev/isci/isci.h stable/8/sys/dev/isci/isci_controller.c stable/8/sys/dev/isci/isci_remote_device.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/isci/isci.h ============================================================================== --- stable/8/sys/dev/isci/isci.h Fri Mar 23 16:59:03 2012 (r233372) +++ stable/8/sys/dev/isci/isci.h Fri Mar 23 17:11:36 2012 (r233373) @@ -122,6 +122,7 @@ struct ISCI_CONTROLLER SCI_CONTROLLER_HANDLE_T scif_controller_handle; struct ISCI_DOMAIN domain[SCI_MAX_DOMAINS]; BOOL is_started; + BOOL has_been_scanned; uint32_t initial_discovery_mask; BOOL is_frozen; uint8_t *remote_device_memory; Modified: stable/8/sys/dev/isci/isci_controller.c ============================================================================== --- stable/8/sys/dev/isci/isci_controller.c Fri Mar 23 16:59:03 2012 (r233372) +++ stable/8/sys/dev/isci/isci_controller.c Fri Mar 23 17:11:36 2012 (r233373) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -300,6 +303,16 @@ SCI_STATUS isci_controller_initialize(st TUNABLE_INT_FETCH("hw.isci.io_shortage", &io_shortage); controller->sim_queue_depth += io_shortage; + /* Attach to CAM using xpt_bus_register now, then immediately freeze + * the simq. It will get released later when initial domain discovery + * is complete. + */ + controller->has_been_scanned = FALSE; + mtx_lock(&controller->lock); + isci_controller_attach_to_cam(controller); + xpt_freeze_simq(controller->sim, 1); + mtx_unlock(&controller->lock); + return (scif_controller_initialize(controller->scif_controller_handle)); } @@ -441,13 +454,13 @@ void isci_controller_start(void *control void isci_controller_domain_discovery_complete( struct ISCI_CONTROLLER *isci_controller, struct ISCI_DOMAIN *isci_domain) { - if (isci_controller->sim == NULL) + if (!isci_controller->has_been_scanned) { - /* Controller has not been attached to CAM yet. We'll clear + /* Controller has not been scanned yet. We'll clear * the discovery bit for this domain, then check if all bits * are now clear. That would indicate that all domains are - * done with discovery and we can then attach the controller - * to CAM. + * done with discovery and we can then proceed with initial + * scan. */ isci_controller->initial_discovery_mask &= @@ -457,7 +470,25 @@ void isci_controller_domain_discovery_co struct isci_softc *driver = isci_controller->isci; uint8_t next_index = isci_controller->index + 1; - isci_controller_attach_to_cam(isci_controller); + isci_controller->has_been_scanned = TRUE; + + /* Unfreeze simq to allow initial scan to proceed. */ + xpt_release_simq(isci_controller->sim, TRUE); + +#if __FreeBSD_version < 800000 + /* When driver is loaded after boot, we need to + * explicitly rescan here for versions <8.0, because + * CAM only automatically scans new buses at boot + * time. + */ + union ccb *ccb = xpt_alloc_ccb_nowait(); + + xpt_create_path(&ccb->ccb_h.path, xpt_periph, + cam_sim_path(isci_controller->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); + + xpt_rescan(ccb); +#endif if (next_index < driver->controller_count) { /* There are more controllers that need to Modified: stable/8/sys/dev/isci/isci_remote_device.c ============================================================================== --- stable/8/sys/dev/isci/isci_remote_device.c Fri Mar 23 16:59:03 2012 (r233372) +++ stable/8/sys/dev/isci/isci_remote_device.c Fri Mar 23 17:11:36 2012 (r233373) @@ -74,13 +74,12 @@ scif_cb_remote_device_ready(SCI_CONTROLL isci_controller->remote_device[device_index] = isci_remote_device; - if (isci_controller->sim != NULL) { - /* The sim object is not NULL, meaning we have attached - * the controller to CAM already. In that case, create - * a CCB to instruct CAM to rescan this device. - * If the sim object is NULL, this device will get - * scanned as part of the initial scan when the - * controller is attached to CAM. + if (isci_controller->has_been_scanned) { + /* The sim object has been scanned at least once + * already. In that case, create a CCB to instruct + * CAM to rescan this device. + * If the sim object has not been scanned, this device + * will get scanned as part of the initial scan. */ union ccb *ccb = xpt_alloc_ccb_nowait(); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 17:22:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D2A5D1065687; Fri, 23 Mar 2012 17:22:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A307A8FC12; Fri, 23 Mar 2012 17:22:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NHMhbQ086209; Fri, 23 Mar 2012 17:22:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NHMh5D086207; Fri, 23 Mar 2012 17:22:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231722.q2NHMh5D086207@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 17:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233374 - stable/9/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 17:22:43 -0000 Author: jhb Date: Fri Mar 23 17:22:43 2012 New Revision: 233374 URL: http://svn.freebsd.org/changeset/base/233374 Log: MFC 232570,232754: Fix boot2 to handle boot config files that only contain a custom path to a loader or kernel. Specifically, kname cannot be pointed at cmd[] since it's value is change to be an empty string after the initial call to parse, and cmd[]'s value can be changed (thus losing a prior setting for kname) due to user input at the boot prompt. While here, ensure that that initial boot config file text is nul-terminated, that ops is initialized to zero, and that kname is always initialized to a valid string. In addition, include other changes to ensure boot2 still builds with Clang. Modified: stable/9/sys/boot/i386/boot2/boot2.c Modified: stable/9/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/i386/boot2/boot2.c Fri Mar 23 17:11:36 2012 (r233373) +++ stable/9/sys/boot/i386/boot2/boot2.c Fri Mar 23 17:22:43 2012 (r233374) @@ -128,9 +128,9 @@ static struct dsk { unsigned start; int init; } dsk; -static char cmd[512], cmddup[512]; -static const char *kname; -static uint32_t opts; +static char cmd[512], cmddup[512], knamebuf[1024]; +static const char *kname = NULL; +static uint32_t opts = 0; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -223,8 +223,8 @@ main(void) { uint8_t autoboot; ino_t ino; + size_t nbyte; - kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I; @@ -240,8 +240,10 @@ main(void) autoboot = 1; if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) - fsread(ino, cmd, sizeof(cmd)); + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } if (*cmd) { memcpy(cmddup, cmd, sizeof(cmd)); @@ -258,9 +260,9 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !kname) { + if (!kname) { kname = PATH_BOOT3; - if (!keyhit(3*SECOND)) { + if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; } @@ -457,7 +459,12 @@ parse() ? DRV_HARD : 0) + drv; dsk_meta = 0; } - kname = arg; + if ((i = ep - arg)) { + if ((size_t)i >= sizeof(knamebuf)) + return -1; + memcpy(knamebuf, arg, i + 1); + kname = knamebuf; + } } arg = p; } From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 17:23:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5AA4106566C; Fri, 23 Mar 2012 17:23:40 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B63058FC0A; Fri, 23 Mar 2012 17:23:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NHNepX086284; Fri, 23 Mar 2012 17:23:40 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NHNeFC086280; Fri, 23 Mar 2012 17:23:40 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201203231723.q2NHNeFC086280@svn.freebsd.org> From: Jim Harris Date: Fri, 23 Mar 2012 17:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233375 - stable/7/sys/dev/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 17:23:40 -0000 Author: jimharris Date: Fri Mar 23 17:23:40 2012 New Revision: 233375 URL: http://svn.freebsd.org/changeset/base/233375 Log: MFC r233371: Call xpt_bus_register during attach context, then freeze and do not release until domain discovery is complete. This fixes an isci(4) bug on FreeBSD 7.x where devices weren't always appearing after boot without an explicit rescan. Sponsored by: Intel Reported and tested by: Reviewed by: scottl Approved by: scottl Modified: stable/7/sys/dev/isci/isci.h stable/7/sys/dev/isci/isci_controller.c stable/7/sys/dev/isci/isci_remote_device.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/isci/isci.h ============================================================================== --- stable/7/sys/dev/isci/isci.h Fri Mar 23 17:22:43 2012 (r233374) +++ stable/7/sys/dev/isci/isci.h Fri Mar 23 17:23:40 2012 (r233375) @@ -122,6 +122,7 @@ struct ISCI_CONTROLLER SCI_CONTROLLER_HANDLE_T scif_controller_handle; struct ISCI_DOMAIN domain[SCI_MAX_DOMAINS]; BOOL is_started; + BOOL has_been_scanned; uint32_t initial_discovery_mask; BOOL is_frozen; uint8_t *remote_device_memory; Modified: stable/7/sys/dev/isci/isci_controller.c ============================================================================== --- stable/7/sys/dev/isci/isci_controller.c Fri Mar 23 17:22:43 2012 (r233374) +++ stable/7/sys/dev/isci/isci_controller.c Fri Mar 23 17:23:40 2012 (r233375) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -300,6 +303,16 @@ SCI_STATUS isci_controller_initialize(st TUNABLE_INT_FETCH("hw.isci.io_shortage", &io_shortage); controller->sim_queue_depth += io_shortage; + /* Attach to CAM using xpt_bus_register now, then immediately freeze + * the simq. It will get released later when initial domain discovery + * is complete. + */ + controller->has_been_scanned = FALSE; + mtx_lock(&controller->lock); + isci_controller_attach_to_cam(controller); + xpt_freeze_simq(controller->sim, 1); + mtx_unlock(&controller->lock); + return (scif_controller_initialize(controller->scif_controller_handle)); } @@ -441,13 +454,13 @@ void isci_controller_start(void *control void isci_controller_domain_discovery_complete( struct ISCI_CONTROLLER *isci_controller, struct ISCI_DOMAIN *isci_domain) { - if (isci_controller->sim == NULL) + if (!isci_controller->has_been_scanned) { - /* Controller has not been attached to CAM yet. We'll clear + /* Controller has not been scanned yet. We'll clear * the discovery bit for this domain, then check if all bits * are now clear. That would indicate that all domains are - * done with discovery and we can then attach the controller - * to CAM. + * done with discovery and we can then proceed with initial + * scan. */ isci_controller->initial_discovery_mask &= @@ -457,7 +470,25 @@ void isci_controller_domain_discovery_co struct isci_softc *driver = isci_controller->isci; uint8_t next_index = isci_controller->index + 1; - isci_controller_attach_to_cam(isci_controller); + isci_controller->has_been_scanned = TRUE; + + /* Unfreeze simq to allow initial scan to proceed. */ + xpt_release_simq(isci_controller->sim, TRUE); + +#if __FreeBSD_version < 800000 + /* When driver is loaded after boot, we need to + * explicitly rescan here for versions <8.0, because + * CAM only automatically scans new buses at boot + * time. + */ + union ccb *ccb = xpt_alloc_ccb_nowait(); + + xpt_create_path(&ccb->ccb_h.path, xpt_periph, + cam_sim_path(isci_controller->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); + + xpt_rescan(ccb); +#endif if (next_index < driver->controller_count) { /* There are more controllers that need to Modified: stable/7/sys/dev/isci/isci_remote_device.c ============================================================================== --- stable/7/sys/dev/isci/isci_remote_device.c Fri Mar 23 17:22:43 2012 (r233374) +++ stable/7/sys/dev/isci/isci_remote_device.c Fri Mar 23 17:23:40 2012 (r233375) @@ -74,13 +74,12 @@ scif_cb_remote_device_ready(SCI_CONTROLL isci_controller->remote_device[device_index] = isci_remote_device; - if (isci_controller->sim != NULL) { - /* The sim object is not NULL, meaning we have attached - * the controller to CAM already. In that case, create - * a CCB to instruct CAM to rescan this device. - * If the sim object is NULL, this device will get - * scanned as part of the initial scan when the - * controller is attached to CAM. + if (isci_controller->has_been_scanned) { + /* The sim object has been scanned at least once + * already. In that case, create a CCB to instruct + * CAM to rescan this device. + * If the sim object has not been scanned, this device + * will get scanned as part of the initial scan. */ union ccb *ccb = xpt_alloc_ccb_nowait(); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 17:24:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97AB1106566C; Fri, 23 Mar 2012 17:24:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8301C8FC1B; Fri, 23 Mar 2012 17:24:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NHOTn4086349; Fri, 23 Mar 2012 17:24:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NHOTdx086348; Fri, 23 Mar 2012 17:24:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231724.q2NHOTdx086348@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 17:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233376 - stable/9/sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 17:24:29 -0000 Author: jhb Date: Fri Mar 23 17:24:29 2012 New Revision: 233376 URL: http://svn.freebsd.org/changeset/base/233376 Log: Record mergeinfo for 233374. Modified: Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 17:24:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C39E8106566C; Fri, 23 Mar 2012 17:24:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A54D98FC0C; Fri, 23 Mar 2012 17:24:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NHOqki086397; Fri, 23 Mar 2012 17:24:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NHOqS9086394; Fri, 23 Mar 2012 17:24:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231724.q2NHOqS9086394@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 17:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233377 - in stable/8/sys: boot/i386/boot2 i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 17:24:52 -0000 Author: jhb Date: Fri Mar 23 17:24:52 2012 New Revision: 233377 URL: http://svn.freebsd.org/changeset/base/233377 Log: MFC 232570,232754: Fix boot2 to handle boot config files that only contain a custom path to a loader or kernel. Specifically, kname cannot be pointed at cmd[] since it's value is change to be an empty string after the initial call to parse, and cmd[]'s value can be changed (thus losing a prior setting for kname) due to user input at the boot prompt. While here, ensure that that initial boot config file text is nul-terminated, that ops is initialized to zero, and that kname is always initialized to a valid string. In addition, include other changes to ensure boot2 still builds with Clang. Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Fri Mar 23 17:24:29 2012 (r233376) +++ stable/8/sys/boot/i386/boot2/boot2.c Fri Mar 23 17:24:52 2012 (r233377) @@ -128,9 +128,9 @@ static struct dsk { unsigned start; int init; } dsk; -static char cmd[512], cmddup[512]; -static const char *kname; -static uint32_t opts; +static char cmd[512], cmddup[512], knamebuf[1024]; +static const char *kname = NULL; +static uint32_t opts = 0; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -223,8 +223,8 @@ main(void) { uint8_t autoboot; ino_t ino; + size_t nbyte; - kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I; @@ -240,8 +240,10 @@ main(void) autoboot = 1; if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) - fsread(ino, cmd, sizeof(cmd)); + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } if (*cmd) { memcpy(cmddup, cmd, sizeof(cmd)); @@ -258,9 +260,9 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !kname) { + if (!kname) { kname = PATH_BOOT3; - if (!keyhit(3*SECOND)) { + if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; } @@ -457,7 +459,12 @@ parse() ? DRV_HARD : 0) + drv; dsk_meta = 0; } - kname = arg; + if ((i = ep - arg)) { + if ((size_t)i >= sizeof(knamebuf)) + return -1; + memcpy(knamebuf, arg, i + 1); + kname = knamebuf; + } } arg = p; } From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 17:54:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 00BBF106564A; Fri, 23 Mar 2012 17:54:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E01528FC0A; Fri, 23 Mar 2012 17:54:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NHs68m087297; Fri, 23 Mar 2012 17:54:06 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NHs6Zh087295; Fri, 23 Mar 2012 17:54:06 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203231754.q2NHs6Zh087295@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 17:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233378 - head/libexec/rtld-elf/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 17:54:07 -0000 Author: gonzo Date: Fri Mar 23 17:54:06 2012 New Revision: 233378 URL: http://svn.freebsd.org/changeset/base/233378 Log: Before jumping to application's entry point set ra == pc in order to let backtracing routine know to go no further. Modified: head/libexec/rtld-elf/mips/rtld_start.S Modified: head/libexec/rtld-elf/mips/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/mips/rtld_start.S Fri Mar 23 17:24:52 2012 (r233377) +++ head/libexec/rtld-elf/mips/rtld_start.S Fri Mar 23 17:54:06 2012 (r233378) @@ -80,7 +80,8 @@ LEAF(rtld_start) move a0, s0 /* stack pointer */ move t9, v0 PTR_SUBU sp, 4*SZREG /* ABI requires to reserve memory for 4 regs */ - jr t9 /* _start(sp, cleanup, obj); */ + move ra,t9 /* RA == PC signals backtrace routine to stop */ + j t9 /* _start(sp, cleanup, obj); */ move a3, s3 /* restore ps_strings */ END(rtld_start) From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 18:03:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35764106568A; Fri, 23 Mar 2012 18:03:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 140E58FC2D; Fri, 23 Mar 2012 18:03:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NI34TZ087667; Fri, 23 Mar 2012 18:03:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NI34pG087662; Fri, 23 Mar 2012 18:03:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231803.q2NI34pG087662@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 18:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233379 - in stable/9: share/man/man9 sys/dev/pci sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 18:03:05 -0000 Author: jhb Date: Fri Mar 23 18:03:04 2012 New Revision: 233379 URL: http://svn.freebsd.org/changeset/base/233379 Log: MFC 232360: Add pci_save_state() and pci_restore_state() wrappers around pci_cfg_save() and pci_cfg_restore() for device drivers to use when saving and restoring state (e.g. to handle device-specific resets). Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/pci.9 stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcivar.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Fri Mar 23 17:54:06 2012 (r233378) +++ stable/9/share/man/man9/Makefile Fri Mar 23 18:03:04 2012 (r233379) @@ -978,6 +978,8 @@ MLINKS+=pci.9 pci_disable_busmaster.9 \ pci.9 pci_find_device.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_read_config.9 \ + pci.9 pci_restore_state.9 \ + pci.9 pci_save_state.9 \ pci.9 pci_set_powerstate.9 \ pci.9 pci_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ Modified: stable/9/share/man/man9/pci.9 ============================================================================== --- stable/9/share/man/man9/pci.9 Fri Mar 23 17:54:06 2012 (r233378) +++ stable/9/share/man/man9/pci.9 Fri Mar 23 18:03:04 2012 (r233379) @@ -38,6 +38,8 @@ .Nm pci_disable_io , .Nm pci_set_powerstate , .Nm pci_get_powerstate , +.Nm pci_save_state , +.Nm pci_restore_state , .Nm pci_find_bsf , .Nm pci_find_dbsf , .Nm pci_find_device @@ -63,6 +65,10 @@ .Fn pci_get_powerstate "device_t dev" .Ft uint32_t .Fn pci_read_config "device_t dev" "int reg" "int width" +.Ft void +.Fn pci_save_state "device_t dev" +.Ft void +.Fn pci_restore_state "device_t dev" .Ft device_t .Fn pci_find_bsf "uint8_t bus" "uint8_t slot" "uint8_t func" .Ft device_t @@ -188,6 +194,26 @@ of is set. .Pp The +.Fn pci_save_state +and +.Fn pci_restore_state +functions can be used by a device driver to save and restore standard PCI +config registers. +The +.Fn pci_save_state +function must be invoked while the device has valid state before +.Fn pci_restore_state +can be used. +If the device is not in the fully-powered state +.Pq Dv PCI_POWERSTATE_D0 +when +.Fn pci_restore_state +is invoked, +then the device will be transitioned to +.Dv PCI_POWERSTATE_D0 +before any config registers are restored. +.Pp +The .Fn pci_find_bsf function looks up the .Vt device_t Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Fri Mar 23 17:54:06 2012 (r233378) +++ stable/9/sys/dev/pci/pci.c Fri Mar 23 18:03:04 2012 (r233379) @@ -4462,3 +4462,22 @@ pci_cfg_save(device_t dev, struct pci_de if (pci_get_powerstate(dev) != PCI_POWERSTATE_D3) pci_set_powerstate(dev, PCI_POWERSTATE_D3); } + +/* Wrapper APIs suitable for device driver use. */ +void +pci_save_state(device_t dev) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(dev); + pci_cfg_save(dev, dinfo, 0); +} + +void +pci_restore_state(device_t dev) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(dev); + pci_cfg_restore(dev, dinfo); +} Modified: stable/9/sys/dev/pci/pcivar.h ============================================================================== --- stable/9/sys/dev/pci/pcivar.h Fri Mar 23 17:54:06 2012 (r233378) +++ stable/9/sys/dev/pci/pcivar.h Fri Mar 23 18:03:04 2012 (r233379) @@ -467,6 +467,8 @@ int pci_msi_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); int pci_get_max_read_req(device_t dev); +void pci_restore_state(device_t dev); +void pci_save_state(device_t dev); int pci_set_max_read_req(device_t dev, int size); #endif /* _SYS_BUS_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 18:03:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F0491065680; Fri, 23 Mar 2012 18:03:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68A548FC1A; Fri, 23 Mar 2012 18:03:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NI3diW087721; Fri, 23 Mar 2012 18:03:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NI3dx2087716; Fri, 23 Mar 2012 18:03:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231803.q2NI3dx2087716@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 18:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233380 - in stable/8: share/man/man9 sys/dev/pci sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 18:03:39 -0000 Author: jhb Date: Fri Mar 23 18:03:38 2012 New Revision: 233380 URL: http://svn.freebsd.org/changeset/base/233380 Log: MFC 232360: Add pci_save_state() and pci_restore_state() wrappers around pci_cfg_save() and pci_cfg_restore() for device drivers to use when saving and restoring state (e.g. to handle device-specific resets). Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/pci.9 stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pcivar.h Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Fri Mar 23 18:03:04 2012 (r233379) +++ stable/8/share/man/man9/Makefile Fri Mar 23 18:03:38 2012 (r233380) @@ -944,6 +944,8 @@ MLINKS+=pci.9 pci_disable_busmaster.9 \ pci.9 pci_find_device.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_read_config.9 \ + pci.9 pci_restore_state.9 \ + pci.9 pci_save_state.9 \ pci.9 pci_set_powerstate.9 \ pci.9 pci_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ Modified: stable/8/share/man/man9/pci.9 ============================================================================== --- stable/8/share/man/man9/pci.9 Fri Mar 23 18:03:04 2012 (r233379) +++ stable/8/share/man/man9/pci.9 Fri Mar 23 18:03:38 2012 (r233380) @@ -38,6 +38,8 @@ .Nm pci_disable_io , .Nm pci_set_powerstate , .Nm pci_get_powerstate , +.Nm pci_save_state , +.Nm pci_restore_state , .Nm pci_find_bsf , .Nm pci_find_dbsf , .Nm pci_find_device @@ -63,6 +65,10 @@ .Fn pci_get_powerstate "device_t dev" .Ft uint32_t .Fn pci_read_config "device_t dev" "int reg" "int width" +.Ft void +.Fn pci_save_state "device_t dev" +.Ft void +.Fn pci_restore_state "device_t dev" .Ft device_t .Fn pci_find_bsf "uint8_t bus" "uint8_t slot" "uint8_t func" .Ft device_t @@ -188,6 +194,26 @@ of is set. .Pp The +.Fn pci_save_state +and +.Fn pci_restore_state +functions can be used by a device driver to save and restore standard PCI +config registers. +The +.Fn pci_save_state +function must be invoked while the device has valid state before +.Fn pci_restore_state +can be used. +If the device is not in the fully-powered state +.Pq Dv PCI_POWERSTATE_D0 +when +.Fn pci_restore_state +is invoked, +then the device will be transitioned to +.Dv PCI_POWERSTATE_D0 +before any config registers are restored. +.Pp +The .Fn pci_find_bsf function looks up the .Vt device_t Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Fri Mar 23 18:03:04 2012 (r233379) +++ stable/8/sys/dev/pci/pci.c Fri Mar 23 18:03:38 2012 (r233380) @@ -4171,3 +4171,22 @@ pci_cfg_save(device_t dev, struct pci_de if (pci_get_powerstate(dev) != PCI_POWERSTATE_D3) pci_set_powerstate(dev, PCI_POWERSTATE_D3); } + +/* Wrapper APIs suitable for device driver use. */ +void +pci_save_state(device_t dev) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(dev); + pci_cfg_save(dev, dinfo, 0); +} + +void +pci_restore_state(device_t dev) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(dev); + pci_cfg_restore(dev, dinfo); +} Modified: stable/8/sys/dev/pci/pcivar.h ============================================================================== --- stable/8/sys/dev/pci/pcivar.h Fri Mar 23 18:03:04 2012 (r233379) +++ stable/8/sys/dev/pci/pcivar.h Fri Mar 23 18:03:38 2012 (r233380) @@ -460,6 +460,8 @@ int pci_msi_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); int pci_get_max_read_req(device_t dev); +void pci_restore_state(device_t dev); +void pci_save_state(device_t dev); int pci_set_max_read_req(device_t dev, int size); #endif /* _SYS_BUS_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 18:07:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A10E106566C; Fri, 23 Mar 2012 18:07:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84ED08FC0A; Fri, 23 Mar 2012 18:07:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NI7D7a087894; Fri, 23 Mar 2012 18:07:13 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NI7D8i087891; Fri, 23 Mar 2012 18:07:13 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203231807.q2NI7D8i087891@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 18:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233381 - head/sys/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 18:07:13 -0000 Author: gonzo Date: Fri Mar 23 18:07:12 2012 New Revision: 233381 URL: http://svn.freebsd.org/changeset/base/233381 Log: Fix pmap_kextract prototype to align it with pmap.c change Modified: head/sys/mips/include/pmap.h Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Fri Mar 23 18:03:38 2012 (r233380) +++ head/sys/mips/include/pmap.h Fri Mar 23 18:07:12 2012 (r233381) @@ -99,7 +99,7 @@ typedef struct pmap *pmap_t; #ifdef _KERNEL pt_entry_t *pmap_pte(pmap_t, vm_offset_t); -vm_offset_t pmap_kextract(vm_offset_t va); +vm_paddr_t pmap_kextract(vm_offset_t va); #define vtophys(va) pmap_kextract(((vm_offset_t) (va))) #define pmap_asid(pmap) (pmap)->pm_asid[PCPU_GET(cpuid)].asid From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 18:12:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1B421065670; Fri, 23 Mar 2012 18:12:25 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C2638FC0C; Fri, 23 Mar 2012 18:12:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NICPjv088103; Fri, 23 Mar 2012 18:12:25 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NICPFH088101; Fri, 23 Mar 2012 18:12:25 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201203231812.q2NICPFH088101@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 23 Mar 2012 18:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233382 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 18:12:25 -0000 Author: bschmidt Date: Fri Mar 23 18:12:25 2012 New Revision: 233382 URL: http://svn.freebsd.org/changeset/base/233382 Log: Also fix the parameter usage in set80211meshpeering(). Submitted by: Monthadar Al Jaberi MFC after: 1 week X-MFC after: r233328 Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Fri Mar 23 18:07:12 2012 (r233381) +++ head/sbin/ifconfig/ifieee80211.c Fri Mar 23 18:12:25 2012 (r233382) @@ -1885,7 +1885,7 @@ DECL_CMD_FUNC(set80211meshforward, val, static DECL_CMD_FUNC(set80211meshpeering, val, d) { - set80211(s, IEEE80211_IOC_MESH_AP, atoi(val), 0, NULL); + set80211(s, IEEE80211_IOC_MESH_AP, d, 0, NULL); } static From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 18:22:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1133106564A; Fri, 23 Mar 2012 18:22:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C23718FC0A; Fri, 23 Mar 2012 18:22:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NIMKIN088458; Fri, 23 Mar 2012 18:22:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NIMKbx088456; Fri, 23 Mar 2012 18:22:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231822.q2NIMKbx088456@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 18:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233383 - in stable/9/sys: dev/e1000 i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 18:22:21 -0000 Author: jhb Date: Fri Mar 23 18:22:20 2012 New Revision: 233383 URL: http://svn.freebsd.org/changeset/base/233383 Log: MFC 232367: Properly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X allocation fails. Modified: stable/9/sys/dev/e1000/if_igb.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Fri Mar 23 18:12:25 2012 (r233382) +++ stable/9/sys/dev/e1000/if_igb.c Fri Mar 23 18:22:20 2012 (r233383) @@ -2631,7 +2631,7 @@ igb_setup_msix(struct adapter *adapter) "MSIX Configuration Problem, " "%d vectors configured, but %d queues wanted!\n", msgs, want); - return (ENXIO); + return (0); } if ((msgs) && pci_alloc_msix(dev, &msgs) == 0) { device_printf(adapter->dev, @@ -2641,9 +2641,11 @@ igb_setup_msix(struct adapter *adapter) } msi: msgs = pci_msi_count(dev); - if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0) - device_printf(adapter->dev,"Using MSI interrupt\n"); - return (msgs); + if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0) { + device_printf(adapter->dev," Using MSI interrupt\n"); + return (msgs); + } + return (0); } /********************************************************************* From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 18:22:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA3701065678; Fri, 23 Mar 2012 18:22:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A421A8FC0C; Fri, 23 Mar 2012 18:22:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NIMcXN088508; Fri, 23 Mar 2012 18:22:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NIMc1M088506; Fri, 23 Mar 2012 18:22:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231822.q2NIMc1M088506@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 18:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233384 - in stable/8/sys: dev/e1000 i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 18:22:38 -0000 Author: jhb Date: Fri Mar 23 18:22:38 2012 New Revision: 233384 URL: http://svn.freebsd.org/changeset/base/233384 Log: MFC 232367: Properly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X allocation fails. Modified: stable/8/sys/dev/e1000/if_igb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/dev/e1000/if_igb.c ============================================================================== --- stable/8/sys/dev/e1000/if_igb.c Fri Mar 23 18:22:20 2012 (r233383) +++ stable/8/sys/dev/e1000/if_igb.c Fri Mar 23 18:22:38 2012 (r233384) @@ -2702,7 +2702,7 @@ igb_setup_msix(struct adapter *adapter) "MSIX Configuration Problem, " "%d vectors configured, but %d queues wanted!\n", msgs, want); - return (ENXIO); + return (0); } if ((msgs) && pci_alloc_msix(dev, &msgs) == 0) { device_printf(adapter->dev, @@ -2712,9 +2712,11 @@ igb_setup_msix(struct adapter *adapter) } msi: msgs = pci_msi_count(dev); - if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0) - device_printf(adapter->dev,"Using MSI interrupt\n"); - return (msgs); + if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0) { + device_printf(adapter->dev," Using MSI interrupt\n"); + return (msgs); + } + return (0); } /********************************************************************* From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 18:29:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DF711065670; Fri, 23 Mar 2012 18:29:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EFBD8FC16; Fri, 23 Mar 2012 18:29:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NITAre088755; Fri, 23 Mar 2012 18:29:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NITAFU088752; Fri, 23 Mar 2012 18:29:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231829.q2NITAFU088752@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 18:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233385 - in stable/9/sys: fs/tmpfs i386/conf ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 18:29:10 -0000 Author: jhb Date: Fri Mar 23 18:29:09 2012 New Revision: 233385 URL: http://svn.freebsd.org/changeset/base/233385 Log: MFC 232401: Similar to the fixes in 226967 and 226987, purge any name cache entries associated with the previous vnode (if any) associated with the target of a rename(). Otherwise, a lookup of the target pathname concurrent with a rename() could re-add a name cache entry after the namei(RENAME) lookup in kern_renameat() had purged the target pathname. Modified: stable/9/sys/fs/tmpfs/tmpfs_vnops.c stable/9/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/9/sys/fs/tmpfs/tmpfs_vnops.c Fri Mar 23 18:22:38 2012 (r233384) +++ stable/9/sys/fs/tmpfs/tmpfs_vnops.c Fri Mar 23 18:29:09 2012 (r233385) @@ -1136,6 +1136,8 @@ tmpfs_rename(struct vop_rename_args *v) tmpfs_free_dirent(VFS_TO_TMPFS(tvp->v_mount), de, TRUE); } cache_purge(fvp); + if (tvp != NULL) + cache_purge(tvp); error = 0; Modified: stable/9/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/9/sys/ufs/ufs/ufs_vnops.c Fri Mar 23 18:22:38 2012 (r233384) +++ stable/9/sys/ufs/ufs/ufs_vnops.c Fri Mar 23 18:29:09 2012 (r233385) @@ -1534,8 +1534,15 @@ relock: * ufs_lookup_ino() and then VFS_VGET(), another thread might do a * normal lookup of the from name just before the VFS_VGET() call, * causing the cache entry to be re-instantiated. + * + * The same issue also applies to tvp if it exists as + * otherwise we may have a stale name cache entry for the new + * name that references the old i-node if it has other links + * or open file descriptors. */ cache_purge(fvp); + if (tvp) + cache_purge(tvp); unlockout: vput(fdvp); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 18:29:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F419C106566B; Fri, 23 Mar 2012 18:29:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C50598FC12; Fri, 23 Mar 2012 18:29:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NITSai088800; Fri, 23 Mar 2012 18:29:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NITSti088797; Fri, 23 Mar 2012 18:29:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231829.q2NITSti088797@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 18:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233386 - in stable/8/sys: fs/tmpfs i386/conf ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 18:29:29 -0000 Author: jhb Date: Fri Mar 23 18:29:28 2012 New Revision: 233386 URL: http://svn.freebsd.org/changeset/base/233386 Log: MFC 232401: Similar to the fixes in 226967 and 226987, purge any name cache entries associated with the previous vnode (if any) associated with the target of a rename(). Otherwise, a lookup of the target pathname concurrent with a rename() could re-add a name cache entry after the namei(RENAME) lookup in kern_renameat() had purged the target pathname. Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c stable/8/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_vnops.c Fri Mar 23 18:29:09 2012 (r233385) +++ stable/8/sys/fs/tmpfs/tmpfs_vnops.c Fri Mar 23 18:29:28 2012 (r233386) @@ -1072,6 +1072,8 @@ tmpfs_rename(struct vop_rename_args *v) tmpfs_free_dirent(VFS_TO_TMPFS(tvp->v_mount), de, TRUE); } cache_purge(fvp); + if (tvp != NULL) + cache_purge(tvp); error = 0; Modified: stable/8/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_vnops.c Fri Mar 23 18:29:09 2012 (r233385) +++ stable/8/sys/ufs/ufs/ufs_vnops.c Fri Mar 23 18:29:28 2012 (r233386) @@ -1527,8 +1527,15 @@ relock: * ufs_lookup_ino() and then VFS_VGET(), another thread might do a * normal lookup of the from name just before the VFS_VGET() call, * causing the cache entry to be re-instantiated. + * + * The same issue also applies to tvp if it exists as + * otherwise we may have a stale name cache entry for the new + * name that references the old i-node if it has other links + * or open file descriptors. */ cache_purge(fvp); + if (tvp) + cache_purge(tvp); unlockout: vput(fdvp); From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 19:32:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 073F71065670; Fri, 23 Mar 2012 19:32:31 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5AD58FC1B; Fri, 23 Mar 2012 19:32:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NJWULI090850; Fri, 23 Mar 2012 19:32:30 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NJWUQr090845; Fri, 23 Mar 2012 19:32:30 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201203231932.q2NJWUQr090845@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 23 Mar 2012 19:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233387 - in head/sys/dev: ipw iwi iwn wpi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 19:32:31 -0000 Author: bschmidt Date: Fri Mar 23 19:32:30 2012 New Revision: 233387 URL: http://svn.freebsd.org/changeset/base/233387 Log: Use suspend/resume methods provided by net80211. This ensures that the appropriate state handling takes place, not doing so results in the device doing nothing until manual intervention. Reviewed by: iwasaki Tested by: iwasaki (iwi) MFC after: 4 weeks Modified: head/sys/dev/ipw/if_ipw.c head/sys/dev/iwi/if_iwi.c head/sys/dev/iwn/if_iwn.c head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Fri Mar 23 18:29:28 2012 (r233386) +++ head/sys/dev/ipw/if_ipw.c Fri Mar 23 19:32:30 2012 (r233387) @@ -835,9 +835,9 @@ static int ipw_suspend(device_t dev) { struct ipw_softc *sc = device_get_softc(dev); + struct ieee80211com *ic = sc->sc_ifp->if_l2com; - ipw_stop(sc); - + ieee80211_suspend_all(ic); return 0; } @@ -845,13 +845,11 @@ static int ipw_resume(device_t dev) { struct ipw_softc *sc = device_get_softc(dev); - struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = sc->sc_ifp->if_l2com; pci_write_config(dev, 0x41, 0, 1); - if (ifp->if_flags & IFF_UP) - ipw_init(sc); - + ieee80211_resume_all(ic); return 0; } Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Fri Mar 23 18:29:28 2012 (r233386) +++ head/sys/dev/iwi/if_iwi.c Fri Mar 23 19:32:30 2012 (r233387) @@ -863,9 +863,9 @@ static int iwi_suspend(device_t dev) { struct iwi_softc *sc = device_get_softc(dev); + struct ieee80211com *ic = sc->sc_ifp->if_l2com; - iwi_stop(sc); - + ieee80211_suspend_all(ic); return 0; } @@ -873,13 +873,11 @@ static int iwi_resume(device_t dev) { struct iwi_softc *sc = device_get_softc(dev); - struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = sc->sc_ifp->if_l2com; pci_write_config(dev, 0x41, 0, 1); - if (ifp->if_flags & IFF_UP) - iwi_init(sc); - + ieee80211_resume_all(ic); return 0; } Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri Mar 23 18:29:28 2012 (r233386) +++ head/sys/dev/iwn/if_iwn.c Fri Mar 23 19:32:30 2012 (r233387) @@ -945,13 +945,9 @@ static int iwn_suspend(device_t dev) { struct iwn_softc *sc = device_get_softc(dev); - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct ieee80211com *ic = sc->sc_ifp->if_l2com; - iwn_stop(sc); - if (vap != NULL) - ieee80211_stop(vap); + ieee80211_suspend_all(ic); return 0; } @@ -959,20 +955,12 @@ static int iwn_resume(device_t dev) { struct iwn_softc *sc = device_get_softc(dev); - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct ieee80211com *ic = sc->sc_ifp->if_l2com; /* Clear device-specific "PCI retry timeout" register (41h). */ pci_write_config(dev, 0x41, 0, 1); - if (ifp->if_flags & IFF_UP) { - iwn_init(sc); - if (vap != NULL) - ieee80211_init(vap); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - iwn_start(ifp); - } + ieee80211_resume_all(ic); return 0; } Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Fri Mar 23 18:29:28 2012 (r233386) +++ head/sys/dev/wpi/if_wpi.c Fri Mar 23 19:32:30 2012 (r233387) @@ -1218,8 +1218,9 @@ static int wpi_suspend(device_t dev) { struct wpi_softc *sc = device_get_softc(dev); + struct ieee80211com *ic = sc->sc_ifp->if_l2com; - wpi_stop(sc); + ieee80211_suspend_all(ic); return 0; } @@ -1227,15 +1228,11 @@ static int wpi_resume(device_t dev) { struct wpi_softc *sc = device_get_softc(dev); - struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = sc->sc_ifp->if_l2com; pci_write_config(dev, 0x41, 0, 1); - if (ifp->if_flags & IFF_UP) { - wpi_init(ifp->if_softc); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - wpi_start(ifp); - } + ieee80211_resume_all(ic); return 0; } From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 19:37:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12EE51065670; Fri, 23 Mar 2012 19:37:46 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F14038FC0A; Fri, 23 Mar 2012 19:37:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NJbj8g091044; Fri, 23 Mar 2012 19:37:45 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NJbjXU091041; Fri, 23 Mar 2012 19:37:45 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203231937.q2NJbjXU091041@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 19:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233388 - in head/gnu/usr.bin/binutils/as: . mips-freebsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 19:37:46 -0000 Author: gonzo Date: Fri Mar 23 19:37:45 2012 New Revision: 233388 URL: http://svn.freebsd.org/changeset/base/233388 Log: Make default ABI for as(1) to be the same as target platform. This change makes object files compiled with default flags by gcc and as compatible. Modified: head/gnu/usr.bin/binutils/as/Makefile head/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h Modified: head/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/as/Makefile Fri Mar 23 19:32:30 2012 (r233387) +++ head/gnu/usr.bin/binutils/as/Makefile Fri Mar 23 19:37:45 2012 (r233388) @@ -43,6 +43,13 @@ SRCS+= app.c \ .if ${TARGET_CPUARCH} == "mips" SRCS+= itbl-ops.c itbl-parse.y itbl-lex.l +.if ${TARGET_ARCH:Mmips64*} != "" +CFLAGS+= -DMIPS_DEFAULT_ABI=N64_ABI -DMIPS_DEFAULT_64BIT=1 +.elif ${TARGET_ARCH:Mmipsn32*} != "" +CFLAGS+= -DMIPS_DEFAULT_ABI=N32_ABI +.else +MIPS_ABI_DEFAULT=ABI_32 +.endif .endif .if ${TARGET_ARCH} == "amd64" Modified: head/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h ============================================================================== --- head/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h Fri Mar 23 19:32:30 2012 (r233387) +++ head/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h Fri Mar 23 19:37:45 2012 (r233388) @@ -3,14 +3,17 @@ #include "itbl-mips.h" /* Choose a default ABI for MIPS targets. */ -/* XXX: Where should this be ? */ +#ifndef MIPS_DEFAULT_ABI #define MIPS_DEFAULT_ABI NO_ABI +#endif /* Default CPU for MIPS targets. */ #define MIPS_CPU_STRING_DEFAULT "from-abi" /* Generate 64-bit code by default on MIPS targets. */ +#ifndef MIPS_DEFAULT_64BIT #define MIPS_DEFAULT_64BIT 0 +#endif /* Allow use of E_MIPS_ABI_O32 on MIPS targets. */ #define USE_E_MIPS_ABI_O32 1 From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 20:05:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DA12106564A; Fri, 23 Mar 2012 20:05:42 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3FD28FC17; Fri, 23 Mar 2012 20:05:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NK5fwN091990; Fri, 23 Mar 2012 20:05:41 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NK5fEB091987; Fri, 23 Mar 2012 20:05:41 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201203232005.q2NK5fEB091987@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 23 Mar 2012 20:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233389 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 20:05:42 -0000 Author: trociny Date: Fri Mar 23 20:05:41 2012 New Revision: 233389 URL: http://svn.freebsd.org/changeset/base/233389 Log: Add a sysctl to set and retrieve binary osreldate of another process. Suggested by: kib Reviewed by: kib MFC after: 2 weeks Modified: head/sys/kern/kern_proc.c head/sys/sys/sysctl.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Mar 23 19:37:45 2012 (r233388) +++ head/sys/kern/kern_proc.c Fri Mar 23 20:05:41 2012 (r233389) @@ -2499,6 +2499,52 @@ sysctl_kern_proc_umask(SYSCTL_HANDLER_AR return (error); } +/* + * This sysctl allows a process to set and retrieve binary osreldate of + * another process. + */ +static int +sysctl_kern_proc_osrel(SYSCTL_HANDLER_ARGS) +{ + int *name = (int *)arg1; + u_int namelen = arg2; + struct proc *p; + int flags, error, osrel; + + if (namelen != 1) + return (EINVAL); + + if (req->newptr != NULL && req->newlen != sizeof(osrel)) + return (EINVAL); + + flags = PGET_HOLD | PGET_NOTWEXIT; + if (req->newptr != NULL) + flags |= PGET_CANDEBUG; + else + flags |= PGET_CANSEE; + error = pget((pid_t)name[0], flags, &p); + if (error != 0) + return (error); + + error = SYSCTL_OUT(req, &p->p_osrel, sizeof(p->p_osrel)); + if (error != 0) + goto errout; + + if (req->newptr != NULL) { + error = SYSCTL_IN(req, &osrel, sizeof(osrel)); + if (error != 0) + goto errout; + if (osrel < 0) { + error = EINVAL; + goto errout; + } + p->p_osrel = osrel; + } +errout: + PRELE(p); + return (error); +} + SYSCTL_NODE(_kern, KERN_PROC, proc, CTLFLAG_RD, 0, "Process table"); SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT| @@ -2603,3 +2649,7 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC static SYSCTL_NODE(_kern_proc, KERN_PROC_UMASK, umask, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc_umask, "Process umask"); + +static SYSCTL_NODE(_kern_proc, KERN_PROC_OSREL, osrel, CTLFLAG_RW | + CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, sysctl_kern_proc_osrel, + "Process binary osreldate"); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Fri Mar 23 19:37:45 2012 (r233388) +++ head/sys/sys/sysctl.h Fri Mar 23 20:05:41 2012 (r233389) @@ -565,6 +565,7 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a #define KERN_PROC_RLIMIT 37 /* process resource limits */ #define KERN_PROC_PS_STRINGS 38 /* get ps_strings location */ #define KERN_PROC_UMASK 39 /* process umask */ +#define KERN_PROC_OSREL 40 /* osreldate for process binary */ /* * KERN_IPC identifiers From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 20:09:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22BDC106566C; Fri, 23 Mar 2012 20:09:22 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DBFC8FC14; Fri, 23 Mar 2012 20:09:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NK9LJL092134; Fri, 23 Mar 2012 20:09:21 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NK9LJl092131; Fri, 23 Mar 2012 20:09:21 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201203232009.q2NK9LJl092131@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 23 Mar 2012 20:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233390 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 20:09:22 -0000 Author: trociny Date: Fri Mar 23 20:09:21 2012 New Revision: 233390 URL: http://svn.freebsd.org/changeset/base/233390 Log: When displaying binary information show also osreldate. Suggested by: kib MFC after: 2 weeks Modified: head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat_bin.c Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Fri Mar 23 20:05:41 2012 (r233389) +++ head/usr.bin/procstat/procstat.1 Fri Mar 23 20:09:21 2012 (r233390) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 29, 2012 +.Dd March 23, 2012 .Dt PROCSTAT 1 .Os .Sh NAME @@ -110,6 +110,8 @@ Display the process ID, command, and pat process ID .It COMM command +.It OSREL +osreldate for process binary .It PATH path to process binary (if available) .El Modified: head/usr.bin/procstat/procstat_bin.c ============================================================================== --- head/usr.bin/procstat/procstat_bin.c Fri Mar 23 20:05:41 2012 (r233389) +++ head/usr.bin/procstat/procstat_bin.c Fri Mar 23 20:09:21 2012 (r233390) @@ -43,11 +43,11 @@ void procstat_bin(struct kinfo_proc *kipp) { char pathname[PATH_MAX]; - int error, name[4]; + int error, osrel, name[4]; size_t len; if (!hflag) - printf("%5s %-16s %-53s\n", "PID", "COMM", "PATH"); + printf("%5s %-16s %8s %s\n", "PID", "COMM", "OSREL", "PATH"); name[0] = CTL_KERN; name[1] = KERN_PROC; @@ -65,7 +65,19 @@ procstat_bin(struct kinfo_proc *kipp) if (len == 0 || strlen(pathname) == 0) strcpy(pathname, "-"); + name[2] = KERN_PROC_OSREL; + + len = sizeof(osrel); + error = sysctl(name, 4, &osrel, &len, NULL, 0); + if (error < 0 && errno != ESRCH) { + warn("sysctl: kern.proc.osrel: %d", kipp->ki_pid); + return; + } + if (error < 0) + return; + printf("%5d ", kipp->ki_pid); printf("%-16s ", kipp->ki_comm); + printf("%8d ", osrel); printf("%s\n", pathname); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 20:10:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C0AE1065670; Fri, 23 Mar 2012 20:10:57 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB5CC8FC1E; Fri, 23 Mar 2012 20:10:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NKAu6P092219; Fri, 23 Mar 2012 20:10:56 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NKAuIE092217; Fri, 23 Mar 2012 20:10:56 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201203232010.q2NKAuIE092217@svn.freebsd.org> From: David Chisnall Date: Fri, 23 Mar 2012 20:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233391 - head/contrib/libstdc++/libsupc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 20:10:57 -0000 Author: theraven Date: Fri Mar 23 20:10:56 2012 New Revision: 233391 URL: http://svn.freebsd.org/changeset/base/233391 Log: Revert ABI breakage in libsupc++. Unfortunately, the ABI was broken upstream for the 4.2 release, which we imported. We then shipped the broken version for several years and certain ports (e.g. libobjc2) depend on it, so we're stuck with it for now... We should revisit this for 10.0, since we're allowed to break the ABI then, but until then we should keep the ABI we shipped with 8.x and 9.x. Reviewed by: kan Approved by: dim (mentor) MFC after: 1 week Modified: head/contrib/libstdc++/libsupc++/typeinfo Modified: head/contrib/libstdc++/libsupc++/typeinfo ============================================================================== --- head/contrib/libstdc++/libsupc++/typeinfo Fri Mar 23 20:09:21 2012 (r233390) +++ head/contrib/libstdc++/libsupc++/typeinfo Fri Mar 23 20:10:56 2012 (r233391) @@ -100,12 +100,6 @@ namespace std bool operator!=(const type_info& __arg) const { return !operator==(__arg); } - // Return true if this is a pointer type of some kind - virtual bool __is_pointer_p() const; - - // Return true if this is a function type - virtual bool __is_function_p() const; - // Try and catch a thrown type. Store an adjusted pointer to the // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then // THR_OBJ points to the thrown object. If THR_TYPE is a pointer @@ -119,6 +113,12 @@ namespace std virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target, void **__obj_ptr) const; + // Return true if this is a pointer type of some kind + virtual bool __is_pointer_p() const; + + // Return true if this is a function type + virtual bool __is_function_p() const; + protected: const char *__name; From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 20:18:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC719106564A; Fri, 23 Mar 2012 20:18:48 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B70D48FC0A; Fri, 23 Mar 2012 20:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NKIm6F092506; Fri, 23 Mar 2012 20:18:48 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NKImY7092504; Fri, 23 Mar 2012 20:18:48 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201203232018.q2NKImY7092504@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 23 Mar 2012 20:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233392 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 20:18:48 -0000 Author: trociny Date: Fri Mar 23 20:18:48 2012 New Revision: 233392 URL: http://svn.freebsd.org/changeset/base/233392 Log: Fix typo. MFC after: 3 days Modified: head/sbin/hastd/nv.c Modified: head/sbin/hastd/nv.c ============================================================================== --- head/sbin/hastd/nv.c Fri Mar 23 20:10:56 2012 (r233391) +++ head/sbin/hastd/nv.c Fri Mar 23 20:18:48 2012 (r233392) @@ -263,17 +263,17 @@ nv_validate(struct nv *nv, size_t *extra case NV_TYPE_UINT8: if (vsize == 0) vsize = 1; - /* FALLTHOUGH */ + /* FALLTHROUGH */ case NV_TYPE_INT16: case NV_TYPE_UINT16: if (vsize == 0) vsize = 2; - /* FALLTHOUGH */ + /* FALLTHROUGH */ case NV_TYPE_INT32: case NV_TYPE_UINT32: if (vsize == 0) vsize = 4; - /* FALLTHOUGH */ + /* FALLTHROUGH */ case NV_TYPE_INT64: case NV_TYPE_UINT64: if (vsize == 0) @@ -290,12 +290,12 @@ nv_validate(struct nv *nv, size_t *extra case NV_TYPE_UINT16_ARRAY: if (vsize == 0) vsize = 2; - /* FALLTHOUGH */ + /* FALLTHROUGH */ case NV_TYPE_INT32_ARRAY: case NV_TYPE_UINT32_ARRAY: if (vsize == 0) vsize = 4; - /* FALLTHOUGH */ + /* FALLTHROUGH */ case NV_TYPE_INT64_ARRAY: case NV_TYPE_UINT64_ARRAY: if (vsize == 0) @@ -906,14 +906,14 @@ nv_swap(struct nvhdr *nvh, bool tohost) case NV_TYPE_UINT16_ARRAY: if (vsize == 0) vsize = 2; - /* FALLTHOUGH */ + /* FALLTHROUGH */ case NV_TYPE_INT32: case NV_TYPE_UINT32: case NV_TYPE_INT32_ARRAY: case NV_TYPE_UINT32_ARRAY: if (vsize == 0) vsize = 4; - /* FALLTHOUGH */ + /* FALLTHROUGH */ case NV_TYPE_INT64: case NV_TYPE_UINT64: case NV_TYPE_INT64_ARRAY: From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 20:23:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 071F0106564A; Fri, 23 Mar 2012 20:23:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 66DC48FC08; Fri, 23 Mar 2012 20:23:49 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q2NKNZmj070987; Fri, 23 Mar 2012 22:23:35 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q2NKNZk7098376; Fri, 23 Mar 2012 22:23:35 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q2NKNZsI098375; Fri, 23 Mar 2012 22:23:35 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 23 Mar 2012 22:23:35 +0200 From: Konstantin Belousov To: David Chisnall Message-ID: <20120323202335.GM2358@deviant.kiev.zoral.com.ua> References: <201203232010.q2NKAuIE092217@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jRTR+8Yehy7mazmg" Content-Disposition: inline In-Reply-To: <201203232010.q2NKAuIE092217@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233391 - head/contrib/libstdc++/libsupc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 20:23:51 -0000 --jRTR+8Yehy7mazmg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 23, 2012 at 08:10:56PM +0000, David Chisnall wrote: > Author: theraven > Date: Fri Mar 23 20:10:56 2012 > New Revision: 233391 > URL: http://svn.freebsd.org/changeset/base/233391 >=20 > Log: > Revert ABI breakage in libsupc++. > =20 > Unfortunately, the ABI was broken upstream for the 4.2 release, which we > imported. We then shipped the broken version for several years and cer= tain > ports (e.g. libobjc2) depend on it, so we're stuck with it for now... > =20 > We should revisit this for 10.0, since we're allowed to break the ABI t= hen, but > until then we should keep the ABI we shipped with 8.x and 9.x. No, you are not allowed to break ABI for symvered libraries, even between major releases. --jRTR+8Yehy7mazmg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk9s28cACgkQC3+MBN1Mb4i+HgCfalTXbcOS9tmiJZIdGNQyQNDe SOwAn1FxyIyaUGTobEWkH7wEZm85gVE2 =KeoK -----END PGP SIGNATURE----- --jRTR+8Yehy7mazmg-- From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 20:25:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A59A1065670; Fri, 23 Mar 2012 20:25:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id CD7298FC18; Fri, 23 Mar 2012 20:25:50 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q2NKPh9W071136; Fri, 23 Mar 2012 22:25:43 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q2NKPhVQ098393; Fri, 23 Mar 2012 22:25:43 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q2NKPhur098392; Fri, 23 Mar 2012 22:25:43 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 23 Mar 2012 22:25:43 +0200 From: Konstantin Belousov To: Jim Harris Message-ID: <20120323202543.GN2358@deviant.kiev.zoral.com.ua> References: <201203231659.q2NGx3D9085333@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ki8osN6LALoCW/78" Content-Disposition: inline In-Reply-To: <201203231659.q2NGx3D9085333@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r233372 - stable/9/sys/dev/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 20:25:51 -0000 --ki8osN6LALoCW/78 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 23, 2012 at 04:59:03PM +0000, Jim Harris wrote: > Author: jimharris > Date: Fri Mar 23 16:59:03 2012 > New Revision: 233372 > URL: http://svn.freebsd.org/changeset/base/233372 >=20 > Log: > MFC r233371: Project policy requires to provide at least 3 days between head commit and consequent merge. This is explicitely stated in the committers guide, please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/rules.= html > =20 > Call xpt_bus_register during attach context, then freeze and do not rel= ease > until domain discovery is complete. This fixes an isci(4) bug on FreeB= SD 7.x > where devices weren't always appearing after boot without an explicit r= escan. --ki8osN6LALoCW/78 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk9s3EYACgkQC3+MBN1Mb4iaYwCfbUIwZLqlMiAAGJvDDQfq/j/K s+sAnRyDNs1yVFW4Nr/xM2XU9lrIQeuU =1rdP -----END PGP SIGNATURE----- --ki8osN6LALoCW/78-- From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 20:47:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CEAC106566C; Fri, 23 Mar 2012 20:47:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 045278FC22; Fri, 23 Mar 2012 20:47:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NKlPmK093455; Fri, 23 Mar 2012 20:47:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NKlPxK093447; Fri, 23 Mar 2012 20:47:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203232047.q2NKlPxK093447@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 20:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233393 - in stable/9/sys: dev/acpica dev/cardbus dev/pci i386/conf powerpc/ofw sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 20:47:26 -0000 Author: jhb Date: Fri Mar 23 20:47:25 2012 New Revision: 233393 URL: http://svn.freebsd.org/changeset/base/233393 Log: MFC 232403,232667: - Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge. The tag enforces a single restriction that all DMA transactions must not cross a 4GB boundary. Note that while this restriction technically only applies to PCI-express, this change applies it to all PCI devices as it is simpler to implement that way and errs on the side of caution. - Add a softc structure for PCI bus devices to hold the bus_dma tag and a new pci_attach_common() routine that performs actions common to the attach phase of all PCI bus drivers. Right now this only consists of a bootverbose printf and the allocate of a bus_dma tag if necessary. - Adjust all PCI bus drivers to allocate a PCI bus softc and to call pci_attach_common() from their attach routines. Modified: stable/9/sys/dev/acpica/acpi_pci.c stable/9/sys/dev/cardbus/cardbus.c stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_private.h stable/9/sys/powerpc/ofw/ofw_pcibus.c stable/9/sys/sparc64/pci/ofw_pcibus.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/dev/acpica/acpi_pci.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_pci.c Fri Mar 23 20:18:48 2012 (r233392) +++ stable/9/sys/dev/acpica/acpi_pci.c Fri Mar 23 20:47:25 2012 (r233393) @@ -99,7 +99,8 @@ static device_method_t acpi_pci_methods[ static devclass_t pci_devclass; -DEFINE_CLASS_1(pci, acpi_pci_driver, acpi_pci_methods, 0, pci_driver); +DEFINE_CLASS_1(pci, acpi_pci_driver, acpi_pci_methods, sizeof(struct pci_softc), + pci_driver); DRIVER_MODULE(acpi_pci, pcib, acpi_pci_driver, pci_devclass, 0, 0); MODULE_DEPEND(acpi_pci, acpi, 1, 1, 1); MODULE_DEPEND(acpi_pci, pci, 1, 1, 1); @@ -276,7 +277,11 @@ acpi_pci_probe(device_t dev) static int acpi_pci_attach(device_t dev) { - int busno, domain; + int busno, domain, error; + + error = pci_attach_common(dev); + if (error) + return (error); /* * Since there can be multiple independantly numbered PCI @@ -286,9 +291,6 @@ acpi_pci_attach(device_t dev) */ domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); - if (bootverbose) - device_printf(dev, "domain=%d, physical bus=%d\n", - domain, busno); /* * First, PCI devices are added as in the normal PCI bus driver. Modified: stable/9/sys/dev/cardbus/cardbus.c ============================================================================== --- stable/9/sys/dev/cardbus/cardbus.c Fri Mar 23 20:18:48 2012 (r233392) +++ stable/9/sys/dev/cardbus/cardbus.c Fri Mar 23 20:47:25 2012 (r233393) @@ -316,6 +316,7 @@ static device_method_t cardbus_methods[] DEVMETHOD(device_resume, cardbus_resume), /* Bus interface */ + DEVMETHOD(bus_get_dma_tag, bus_generic_get_dma_tag), DEVMETHOD(bus_read_ivar, cardbus_read_ivar), DEVMETHOD(bus_driver_added, cardbus_driver_added), Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Fri Mar 23 20:18:48 2012 (r233392) +++ stable/9/sys/dev/pci/pci.c Fri Mar 23 20:47:25 2012 (r233393) @@ -70,6 +70,21 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" #include "pci_if.h" +/* + * XXX: Due to a limitation of the bus_dma_tag_create() API, we cannot + * specify a 4GB boundary on 32-bit targets. Usually this does not + * matter as it is ok to use a boundary of 0 on these systems. + * However, in the case of PAE, DMA addresses can cross a 4GB + * boundary, so as a workaround use a 2GB boundary. + */ +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) +#ifdef PAE +#define PCI_DMA_BOUNDARY 0x80000000 +#else +#define PCI_DMA_BOUNDARY 0x100000000 +#endif +#endif + #define PCIR_IS_BIOS(cfg, reg) \ (((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) || \ ((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1)) @@ -95,6 +110,7 @@ static void pci_load_vendor_data(void); static int pci_describe_parse_line(char **ptr, int *vendor, int *device, char **desc); static char *pci_describe_device(device_t dev); +static bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev); static int pci_modevent(module_t mod, int what, void *arg); static void pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg); @@ -137,6 +153,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_setup_intr, pci_setup_intr), DEVMETHOD(bus_teardown_intr, pci_teardown_intr), + DEVMETHOD(bus_get_dma_tag, pci_get_dma_tag), DEVMETHOD(bus_get_resource_list,pci_get_resource_list), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), @@ -173,7 +190,7 @@ static device_method_t pci_methods[] = { DEVMETHOD_END }; -DEFINE_CLASS_0(pci, pci_driver, pci_methods, 0); +DEFINE_CLASS_0(pci, pci_driver, pci_methods, sizeof(struct pci_softc)); static devclass_t pci_devclass; DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, 0); @@ -3160,10 +3177,49 @@ pci_probe(device_t dev) return (BUS_PROBE_GENERIC); } +int +pci_attach_common(device_t dev) +{ + struct pci_softc *sc; + int busno, domain; +#ifdef PCI_DMA_BOUNDARY + int error, tag_valid; +#endif + + sc = device_get_softc(dev); + domain = pcib_get_domain(dev); + busno = pcib_get_bus(dev); + if (bootverbose) + device_printf(dev, "domain=%d, physical bus=%d\n", + domain, busno); +#ifdef PCI_DMA_BOUNDARY + tag_valid = 0; + if (device_get_devclass(device_get_parent(device_get_parent(dev))) != + devclass_find("pci")) { + error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, + PCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, + NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED, + BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->sc_dma_tag); + if (error) + device_printf(dev, "Failed to create DMA tag: %d\n", + error); + else + tag_valid = 1; + } + if (!tag_valid) +#endif + sc->sc_dma_tag = bus_get_dma_tag(dev); + return (0); +} + static int pci_attach(device_t dev) { - int busno, domain; + int busno, domain, error; + + error = pci_attach_common(dev); + if (error) + return (error); /* * Since there can be multiple independantly numbered PCI @@ -3173,9 +3229,6 @@ pci_attach(device_t dev) */ domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); - if (bootverbose) - device_printf(dev, "domain=%d, physical bus=%d\n", - domain, busno); pci_add_children(dev, domain, busno, sizeof(struct pci_devinfo)); return (bus_generic_attach(dev)); } @@ -4262,6 +4315,14 @@ pci_get_resource_list (device_t dev, dev return (&dinfo->resources); } +bus_dma_tag_t +pci_get_dma_tag(device_t bus, device_t dev) +{ + struct pci_softc *sc = device_get_softc(bus); + + return (sc->sc_dma_tag); +} + uint32_t pci_read_config_method(device_t dev, device_t child, int reg, int width) { Modified: stable/9/sys/dev/pci/pci_private.h ============================================================================== --- stable/9/sys/dev/pci/pci_private.h Fri Mar 23 20:18:48 2012 (r233392) +++ stable/9/sys/dev/pci/pci_private.h Fri Mar 23 20:47:25 2012 (r233393) @@ -38,6 +38,10 @@ */ DECLARE_CLASS(pci_driver); +struct pci_softc { + bus_dma_tag_t sc_dma_tag; +}; + extern int pci_do_power_resume; extern int pci_do_power_suspend; @@ -46,6 +50,7 @@ void pci_add_children(device_t dev, int void pci_add_child(device_t bus, struct pci_devinfo *dinfo); void pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask); +int pci_attach_common(device_t dev); void pci_delete_child(device_t dev, device_t child); void pci_driver_added(device_t dev, driver_t *driver); int pci_print_child(device_t dev, device_t child); Modified: stable/9/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- stable/9/sys/powerpc/ofw/ofw_pcibus.c Fri Mar 23 20:18:48 2012 (r233392) +++ stable/9/sys/powerpc/ofw/ofw_pcibus.c Fri Mar 23 20:47:25 2012 (r233393) @@ -95,8 +95,8 @@ struct ofw_pcibus_devinfo { static devclass_t pci_devclass; -DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods, 1 /* no softc */, - pci_driver); +DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods, + sizeof(struct pci_softc), pci_driver); DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcibus_driver, pci_devclass, 0, 0); MODULE_VERSION(ofw_pcibus, 1); MODULE_DEPEND(ofw_pcibus, pci, 1, 1, 1); @@ -116,12 +116,13 @@ static int ofw_pcibus_attach(device_t dev) { u_int busno, domain; + int error; + error = pci_attach_common(dev); + if (error) + return (error); domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); - if (bootverbose) - device_printf(dev, "domain=%d, physical bus=%d\n", - domain, busno); /* * Attach those children represented in the device tree. Modified: stable/9/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/9/sys/sparc64/pci/ofw_pcibus.c Fri Mar 23 20:18:48 2012 (r233392) +++ stable/9/sys/sparc64/pci/ofw_pcibus.c Fri Mar 23 20:47:25 2012 (r233393) @@ -100,8 +100,8 @@ struct ofw_pcibus_devinfo { static devclass_t pci_devclass; -DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods, 1 /* no softc */, - pci_driver); +DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods, + sizeof(struct pci_softc), pci_driver); EARLY_DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcibus_driver, pci_devclass, 0, 0, BUS_PASS_BUS); MODULE_VERSION(ofw_pcibus, 1); @@ -230,13 +230,14 @@ ofw_pcibus_attach(device_t dev) phandle_t node, child; uint32_t clock; u_int busno, domain, func, slot; + int error; + error = pci_attach_common(dev); + if (error) + return (error); pcib = device_get_parent(dev); domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); - if (bootverbose) - device_printf(dev, "domain=%d, physical bus=%d\n", - domain, busno); node = ofw_bus_get_node(dev); /* From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 20:47:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC9701065674; Fri, 23 Mar 2012 20:47:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95B838FC18; Fri, 23 Mar 2012 20:47:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NKloJQ093507; Fri, 23 Mar 2012 20:47:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NKloX5093500; Fri, 23 Mar 2012 20:47:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203232047.q2NKloX5093500@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 20:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233394 - in stable/8/sys: dev/acpica dev/cardbus dev/pci i386/conf powerpc/ofw sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 20:47:50 -0000 Author: jhb Date: Fri Mar 23 20:47:49 2012 New Revision: 233394 URL: http://svn.freebsd.org/changeset/base/233394 Log: MFC 232403,232667: - Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge. The tag enforces a single restriction that all DMA transactions must not cross a 4GB boundary. Note that while this restriction technically only applies to PCI-express, this change applies it to all PCI devices as it is simpler to implement that way and errs on the side of caution. - Add a softc structure for PCI bus devices to hold the bus_dma tag and a new pci_attach_common() routine that performs actions common to the attach phase of all PCI bus drivers. Right now this only consists of a bootverbose printf and the allocate of a bus_dma tag if necessary. - Adjust all PCI bus drivers to allocate a PCI bus softc and to call pci_attach_common() from their attach routines. Modified: stable/8/sys/dev/acpica/acpi_pci.c stable/8/sys/dev/cardbus/cardbus.c stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pci_private.h stable/8/sys/powerpc/ofw/ofw_pcibus.c stable/8/sys/sparc64/pci/ofw_pcibus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/dev/acpica/acpi_pci.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_pci.c Fri Mar 23 20:47:25 2012 (r233393) +++ stable/8/sys/dev/acpica/acpi_pci.c Fri Mar 23 20:47:49 2012 (r233394) @@ -99,7 +99,8 @@ static device_method_t acpi_pci_methods[ static devclass_t pci_devclass; -DEFINE_CLASS_1(pci, acpi_pci_driver, acpi_pci_methods, 0, pci_driver); +DEFINE_CLASS_1(pci, acpi_pci_driver, acpi_pci_methods, sizeof(struct pci_softc), + pci_driver); DRIVER_MODULE(acpi_pci, pcib, acpi_pci_driver, pci_devclass, 0, 0); MODULE_DEPEND(acpi_pci, acpi, 1, 1, 1); MODULE_DEPEND(acpi_pci, pci, 1, 1, 1); @@ -288,7 +289,11 @@ acpi_pci_probe(device_t dev) static int acpi_pci_attach(device_t dev) { - int busno, domain; + int busno, domain, error; + + error = pci_attach_common(dev); + if (error) + return (error); /* * Since there can be multiple independantly numbered PCI @@ -298,9 +303,6 @@ acpi_pci_attach(device_t dev) */ domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); - if (bootverbose) - device_printf(dev, "domain=%d, physical bus=%d\n", - domain, busno); /* * First, PCI devices are added as in the normal PCI bus driver. Modified: stable/8/sys/dev/cardbus/cardbus.c ============================================================================== --- stable/8/sys/dev/cardbus/cardbus.c Fri Mar 23 20:47:25 2012 (r233393) +++ stable/8/sys/dev/cardbus/cardbus.c Fri Mar 23 20:47:49 2012 (r233394) @@ -345,6 +345,7 @@ static device_method_t cardbus_methods[] DEVMETHOD(device_resume, cardbus_resume), /* Bus interface */ + DEVMETHOD(bus_get_dma_tag, bus_generic_get_dma_tag), DEVMETHOD(bus_read_ivar, cardbus_read_ivar), DEVMETHOD(bus_write_ivar, pci_write_ivar), DEVMETHOD(bus_driver_added, cardbus_driver_added), Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Fri Mar 23 20:47:25 2012 (r233393) +++ stable/8/sys/dev/pci/pci.c Fri Mar 23 20:47:49 2012 (r233394) @@ -76,6 +76,21 @@ __FBSDID("$FreeBSD$"); #define ACPI_PWR_FOR_SLEEP(x, y, z) #endif +/* + * XXX: Due to a limitation of the bus_dma_tag_create() API, we cannot + * specify a 4GB boundary on 32-bit targets. Usually this does not + * matter as it is ok to use a boundary of 0 on these systems. + * However, in the case of PAE, DMA addresses can cross a 4GB + * boundary, so as a workaround use a 2GB boundary. + */ +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) +#ifdef PAE +#define PCI_DMA_BOUNDARY 0x80000000 +#else +#define PCI_DMA_BOUNDARY 0x100000000 +#endif +#endif + static pci_addr_t pci_mapbase(uint64_t mapreg); static const char *pci_maptype(uint64_t mapreg); static int pci_mapsize(uint64_t testval); @@ -95,6 +110,7 @@ static void pci_load_vendor_data(void); static int pci_describe_parse_line(char **ptr, int *vendor, int *device, char **desc); static char *pci_describe_device(device_t dev); +static bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev); static int pci_modevent(module_t mod, int what, void *arg); static void pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg); @@ -137,6 +153,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_setup_intr, pci_setup_intr), DEVMETHOD(bus_teardown_intr, pci_teardown_intr), + DEVMETHOD(bus_get_dma_tag, pci_get_dma_tag), DEVMETHOD(bus_get_resource_list,pci_get_resource_list), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), @@ -173,7 +190,7 @@ static device_method_t pci_methods[] = { DEVMETHOD_END }; -DEFINE_CLASS_0(pci, pci_driver, pci_methods, 0); +DEFINE_CLASS_0(pci, pci_driver, pci_methods, sizeof(struct pci_softc)); static devclass_t pci_devclass; DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, 0); @@ -2925,10 +2942,49 @@ pci_probe(device_t dev) return (BUS_PROBE_GENERIC); } +int +pci_attach_common(device_t dev) +{ + struct pci_softc *sc; + int busno, domain; +#ifdef PCI_DMA_BOUNDARY + int error, tag_valid; +#endif + + sc = device_get_softc(dev); + domain = pcib_get_domain(dev); + busno = pcib_get_bus(dev); + if (bootverbose) + device_printf(dev, "domain=%d, physical bus=%d\n", + domain, busno); +#ifdef PCI_DMA_BOUNDARY + tag_valid = 0; + if (device_get_devclass(device_get_parent(device_get_parent(dev))) != + devclass_find("pci")) { + error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, + PCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, + NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED, + BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->sc_dma_tag); + if (error) + device_printf(dev, "Failed to create DMA tag: %d\n", + error); + else + tag_valid = 1; + } + if (!tag_valid) +#endif + sc->sc_dma_tag = bus_get_dma_tag(dev); + return (0); +} + static int pci_attach(device_t dev) { - int busno, domain; + int busno, domain, error; + + error = pci_attach_common(dev); + if (error) + return (error); /* * Since there can be multiple independantly numbered PCI @@ -2938,9 +2994,6 @@ pci_attach(device_t dev) */ domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); - if (bootverbose) - device_printf(dev, "domain=%d, physical bus=%d\n", - domain, busno); pci_add_children(dev, domain, busno, sizeof(struct pci_devinfo)); return (bus_generic_attach(dev)); } @@ -3963,6 +4016,14 @@ pci_get_resource_list (device_t dev, dev return (&dinfo->resources); } +bus_dma_tag_t +pci_get_dma_tag(device_t bus, device_t dev) +{ + struct pci_softc *sc = device_get_softc(bus); + + return (sc->sc_dma_tag); +} + uint32_t pci_read_config_method(device_t dev, device_t child, int reg, int width) { Modified: stable/8/sys/dev/pci/pci_private.h ============================================================================== --- stable/8/sys/dev/pci/pci_private.h Fri Mar 23 20:47:25 2012 (r233393) +++ stable/8/sys/dev/pci/pci_private.h Fri Mar 23 20:47:49 2012 (r233394) @@ -38,11 +38,16 @@ */ DECLARE_CLASS(pci_driver); +struct pci_softc { + bus_dma_tag_t sc_dma_tag; +}; + void pci_add_children(device_t dev, int domain, int busno, size_t dinfo_size); void pci_add_child(device_t bus, struct pci_devinfo *dinfo); void pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask); +int pci_attach_common(device_t dev); void pci_driver_added(device_t dev, driver_t *driver); int pci_print_child(device_t dev, device_t child); void pci_probe_nomatch(device_t dev, device_t child); Modified: stable/8/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- stable/8/sys/powerpc/ofw/ofw_pcibus.c Fri Mar 23 20:47:25 2012 (r233393) +++ stable/8/sys/powerpc/ofw/ofw_pcibus.c Fri Mar 23 20:47:49 2012 (r233394) @@ -95,8 +95,8 @@ struct ofw_pcibus_devinfo { static devclass_t pci_devclass; -DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods, 1 /* no softc */, - pci_driver); +DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods, + sizeof(struct pci_softc), pci_driver); DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcibus_driver, pci_devclass, 0, 0); MODULE_VERSION(ofw_pcibus, 1); MODULE_DEPEND(ofw_pcibus, pci, 1, 1, 1); @@ -116,12 +116,13 @@ static int ofw_pcibus_attach(device_t dev) { u_int busno, domain; + int error; + error = pci_attach_common(dev); + if (error) + return (error); domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); - if (bootverbose) - device_printf(dev, "domain=%d, physical bus=%d\n", - domain, busno); /* * Attach those children represented in the device tree. Modified: stable/8/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcibus.c Fri Mar 23 20:47:25 2012 (r233393) +++ stable/8/sys/sparc64/pci/ofw_pcibus.c Fri Mar 23 20:47:49 2012 (r233394) @@ -100,8 +100,8 @@ struct ofw_pcibus_devinfo { static devclass_t pci_devclass; -DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods, 1 /* no softc */, - pci_driver); +DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods, + sizeof(struct pci_softc), pci_driver); EARLY_DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcibus_driver, pci_devclass, 0, 0, BUS_PASS_BUS); MODULE_VERSION(ofw_pcibus, 1); @@ -230,13 +230,14 @@ ofw_pcibus_attach(device_t dev) phandle_t node, child; uint32_t clock; u_int busno, domain, func, slot; + int error; + error = pci_attach_common(dev); + if (error) + return (error); pcib = device_get_parent(dev); domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); - if (bootverbose) - device_printf(dev, "domain=%d, physical bus=%d\n", - domain, busno); node = ofw_bus_get_node(dev); /* From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 20:49:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBCA2106566C; Fri, 23 Mar 2012 20:49:37 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 38D938FC0C; Fri, 23 Mar 2012 20:49:36 +0000 (UTC) Received: by qcsg15 with SMTP id g15so2676499qcs.13 for ; Fri, 23 Mar 2012 13:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=kASwil1Hv85Sdyb5Y0EduU5vEQpeeGkB7jjNkpPwVVQ=; b=IxBvadZsCQo1Q9WXuYGyQpejfBDT1rduTEahuFubFQvqrwWWGqXJ3qat7+GgqTApHG XJUrqs9q4pB1yaKjfJS7xYgCIydelGSi+fQ4y/8oF5zBMTjfqcveUFTXSmepIIrryQVV xmbnLQlWsbCqhxADE9GoFxNREz6uYWIZZVaqvcJb8SnaETl8DNhJP8rg2Y2rpTIqCKhZ qCrPslthk9qpskWSWSllNOrWUNCcpvYWdsB7rYM0+PxK+n6xiwT48j7FMQXZFR4znZWi gfDvg0mOhrt2zd+qpUKNbSxmfvZfohLUnWMhwYM1zB5LaV1zOuVZySJKc5sXjTdo0W4G mDng== Received: by 10.224.33.134 with SMTP id h6mr17727845qad.15.1332535776585; Fri, 23 Mar 2012 13:49:36 -0700 (PDT) Received: from kan.dyndns.org (c-24-63-226-98.hsd1.ma.comcast.net. [24.63.226.98]) by mx.google.com with ESMTPS id gv7sm15773046qab.5.2012.03.23.13.49.34 (version=SSLv3 cipher=OTHER); Fri, 23 Mar 2012 13:49:35 -0700 (PDT) Date: Fri, 23 Mar 2012 16:49:22 -0400 From: Alexander Kabaev To: Konstantin Belousov Message-ID: <20120323164922.0bac354e@kan.dyndns.org> In-Reply-To: <20120323202335.GM2358@deviant.kiev.zoral.com.ua> References: <201203232010.q2NKAuIE092217@svn.freebsd.org> <20120323202335.GM2358@deviant.kiev.zoral.com.ua> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/KcVFX_4kJr5=dL/7Jz4Q3lm"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Chisnall Subject: Re: svn commit: r233391 - head/contrib/libstdc++/libsupc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 20:49:37 -0000 --Sig_/KcVFX_4kJr5=dL/7Jz4Q3lm Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 23 Mar 2012 22:23:35 +0200 Konstantin Belousov wrote: > On Fri, Mar 23, 2012 at 08:10:56PM +0000, David Chisnall wrote: > > Author: theraven > > Date: Fri Mar 23 20:10:56 2012 > > New Revision: 233391 > > URL: http://svn.freebsd.org/changeset/base/233391 > >=20 > > Log: > > Revert ABI breakage in libsupc++. > > =20 > > Unfortunately, the ABI was broken upstream for the 4.2 release, > > which we imported. We then shipped the broken version for several > > years and certain ports (e.g. libobjc2) depend on it, so we're > > stuck with it for now...=20 > > We should revisit this for 10.0, since we're allowed to break the > > ABI then, but until then we should keep the ABI we shipped with 8.x > > and 9.x. >=20 > No, you are not allowed to break ABI for symvered libraries, even > between major releases. You are, if we are ditching the system library in favor on one in ports. Not polite, but I do not see a polite way out of this. The libraries from ports are effectively shipped with incompatible ABI in this area for about 4 years now. Luckily for us, breakage does not seem to be affecting great many applications, as they do not use the changed interface directly themselves. libobjc2 is the only known at the moment that is known to be affected. --=20 Alexander Kabaev --Sig_/KcVFX_4kJr5=dL/7Jz4Q3lm Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iD8DBQFPbOHcQ6z1jMm+XZYRAjm4AKCrBvGXiZTqv3tXBB0U91+yr3q+wgCguq91 mlnaRHLrtfAMlQcdy638YiE= =26rW -----END PGP SIGNATURE----- --Sig_/KcVFX_4kJr5=dL/7Jz4Q3lm-- From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 20:58:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 883E0106566B; Fri, 23 Mar 2012 20:58:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 718038FC08; Fri, 23 Mar 2012 20:58:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NKwJqc093991; Fri, 23 Mar 2012 20:58:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NKwJT0093987; Fri, 23 Mar 2012 20:58:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203232058.q2NKwJT0093987@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 20:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233395 - stable/9/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 20:58:19 -0000 Author: jhb Date: Fri Mar 23 20:58:18 2012 New Revision: 233395 URL: http://svn.freebsd.org/changeset/base/233395 Log: MFC 232362,232363,232463,232553,232569,232571: - Sort function prototypes. - Update the documentation on pci_get/set_powerstate(). These methods are not ACPI-specific at all, but deal with PCI power states. Also, pci_set_powerstate() fails with EOPNOTSUPP if a request is made that the underlying device does not support rather than falling back to somehow setting D0. - Document the following routines: pci_alloc_msi(), pci_alloc_msix(), pci_find_cap(), pci_get_max_read_req(), pci_get_vpd_ident(), pci_get_vpd_readonly(), pci_msi_count(), pci_msix_count(), pci_pending_msix(), pci_release_msi(), pci_remap_msix(), and pci_set_max_read_req(). - Group the functions into five sub-sections: raw configuration access, locating devices, device information, device configuration, and message signaled interrupts. - Discourage use of pci_disable_io() and pci_enable_io() in device drivers. The PCI bus driver handles this automatically as resources are activated. Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/pci.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Fri Mar 23 20:47:49 2012 (r233394) +++ stable/9/share/man/man9/Makefile Fri Mar 23 20:58:18 2012 (r233395) @@ -969,18 +969,30 @@ MLINKS+=namei.9 NDFREE.9 \ MLINKS+=pbuf.9 getpbuf.9 \ pbuf.9 relpbuf.9 \ pbuf.9 trypbuf.9 -MLINKS+=pci.9 pci_disable_busmaster.9 \ +MLINKS+=pci.9 pci_alloc_msi.9 \ + pci.9 pci_alloc_msix.9 \ + pci.9 pci_disable_busmaster.9 \ pci.9 pci_disable_io.9 \ pci.9 pci_enable_busmaster.9 \ pci.9 pci_enable_io.9 \ pci.9 pci_find_bsf.9 \ + pci.9 pci_find_cap.9 \ pci.9 pci_find_dbsf.9 \ pci.9 pci_find_device.9 \ + pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ + pci.9 pci_get_vpd_ident.9 \ + pci.9 pci_get_vpd_readonly.9 \ + pci.9 pci_msi_count.9 \ + pci.9 pci_msix_count.9 \ + pci.9 pci_pending_msix.9 \ pci.9 pci_read_config.9 \ + pci.9 pci_release_msi.9 \ + pci.9 pci_remap_msix.9 \ pci.9 pci_restore_state.9 \ pci.9 pci_save_state.9 \ pci.9 pci_set_powerstate.9 \ + pci.9 pci_set_max_read_req.9 \ pci.9 pci_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ Modified: stable/9/share/man/man9/pci.9 ============================================================================== --- stable/9/share/man/man9/pci.9 Fri Mar 23 20:47:49 2012 (r233394) +++ stable/9/share/man/man9/pci.9 Fri Mar 23 20:58:18 2012 (r233395) @@ -25,61 +25,103 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2007 +.Dd March 5, 2012 .Dt PCI 9 .Os .Sh NAME .Nm pci , -.Nm pci_read_config , -.Nm pci_write_config , -.Nm pci_enable_busmaster , +.Nm pci_alloc_msi , +.Nm pci_alloc_msix , .Nm pci_disable_busmaster , -.Nm pci_enable_io , .Nm pci_disable_io , -.Nm pci_set_powerstate , -.Nm pci_get_powerstate , -.Nm pci_save_state , -.Nm pci_restore_state , +.Nm pci_enable_busmaster , +.Nm pci_enable_io , .Nm pci_find_bsf , +.Nm pci_find_cap , .Nm pci_find_dbsf , -.Nm pci_find_device +.Nm pci_find_device , +.Nm pci_get_max_read_req , +.Nm pci_get_powerstate , +.Nm pci_get_vpd_ident , +.Nm pci_get_vpd_readonly , +.Nm pci_msi_count , +.Nm pci_msix_count , +.Nm pci_pending_msix , +.Nm pci_read_config , +.Nm pci_release_msi , +.Nm pci_remap_msix , +.Nm pci_restore_state , +.Nm pci_save_state , +.Nm pci_set_max_read_req , +.Nm pci_set_powerstate , +.Nm pci_write_config .Nd PCI bus interface .Sh SYNOPSIS .In sys/bus.h -.In dev/pci/pcivar.h .In dev/pci/pcireg.h -.In machine/pci_cfgreg.h -.Ft void -.Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width" +.In dev/pci/pcivar.h .Ft int -.Fn pci_enable_busmaster "device_t dev" +.Fn pci_alloc_msi "device_t dev" "int *count" +.Ft int +.Fn pci_alloc_msix "device_t dev" "int *count" .Ft int .Fn pci_disable_busmaster "device_t dev" .Ft int +.Fn pci_disable_io "device_t dev" "int space" +.Ft int +.Fn pci_enable_busmaster "device_t dev" +.Ft int .Fn pci_enable_io "device_t dev" "int space" +.Ft device_t +.Fn pci_find_bsf "uint8_t bus" "uint8_t slot" "uint8_t func" .Ft int -.Fn pci_disable_io "device_t dev" "int space" +.Fn pci_find_cap "device_t dev" "int capability" "int *capreg" +.Ft device_t +.Fn pci_find_dbsf "uint32_t domain" "uint8_t bus" "uint8_t slot" "uint8_t func" +.Ft device_t +.Fn pci_find_device "uint16_t vendor" "uint16_t device" .Ft int -.Fn pci_set_powerstate "device_t dev" "int state" +.Fn pci_get_max_read_req "device_t dev" .Ft int .Fn pci_get_powerstate "device_t dev" +.Ft int +.Fn pci_get_vpd_ident "device_t dev" "const char **identptr" +.Ft int +.Fn pci_get_vpd_readonly "device_t dev" "const char *kw" "const char **vptr" +.Ft int +.Fn pci_msi_count "device_t dev" +.Ft int +.Fn pci_msix_count "device_t dev" +.Ft int +.Fn pci_pending_msix "device_t dev" "u_int index" .Ft uint32_t .Fn pci_read_config "device_t dev" "int reg" "int width" +.Ft int +.Fn pci_release_msi "device_t dev" +.Ft int +.Fn pci_remap_msix "device_t dev" "int count" "const u_int *vectors" +.Ft void +.Fn pci_restore_state "device_t dev" .Ft void .Fn pci_save_state "device_t dev" +.Ft int +.Fn pci_set_max_read_req "device_t dev" "int size" +.Ft int +.Fn pci_set_powerstate "device_t dev" "int state" .Ft void -.Fn pci_restore_state "device_t dev" -.Ft device_t -.Fn pci_find_bsf "uint8_t bus" "uint8_t slot" "uint8_t func" -.Ft device_t -.Fn pci_find_dbsf "uint32_t domain" "uint8_t bus" "uint8_t slot" "uint8_t func" -.Ft device_t -.Fn pci_find_device "uint16_t vendor" "uint16_t device" +.Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width" .Sh DESCRIPTION The .Nm set of functions are used for managing PCI devices. -.Pp +The functions are split into several groups: +raw configuration access, +locating devices, +device information, +device configuration, +and +message signaled interrupts. +.Ss Raw Configuration Access The .Fn pci_read_config function is used to read data from the PCI configuration @@ -104,6 +146,126 @@ with .Fa width specifying the size of the access. .Pp +.Em NOTE : +Device drivers should only use these functions for functionality that +is not available via another +.Fn pci +function. +.Ss Locating Devices +The +.Fn pci_find_bsf +function looks up the +.Vt device_t +of a PCI device, given its +.Fa bus , +.Fa slot , +and +.Fa func . +The +.Fa slot +number actually refers to the number of the device on the bus, +which does not necessarily indicate its geographic location +in terms of a physical slot. +Note that in case the system has multiple PCI domains, +the +.Fn pci_find_bsf +function only searches the first one. +Actually, it is equivalent to: +.Bd -literal -offset indent +pci_find_dbsf(0, bus, slot, func); +.Ed +.Pp +The +.Fn pci_find_dbsf +function looks up the +.Vt device_t +of a PCI device, given its +.Fa domain , +.Fa bus , +.Fa slot , +and +.Fa func . +The +.Fa slot +number actually refers to the number of the device on the bus, +which does not necessarily indicate its geographic location +in terms of a physical slot. +.Pp +The +.Fn pci_find_device +function looks up the +.Vt device_t +of a PCI device, given its +.Fa vendor +and +.Fa device +IDs. +Note that there can be multiple matches for this search; this function +only returns the first matching device. +.Ss Device Information +The +.Fn pci_find_cap +function is used to locate the first instance of a PCI capability +register set for the device +.Fa dev . +The capability to locate is specified by ID via +.Fa capability . +Constant macros of the form +.Dv PCIY_xxx +for standard capability IDs are defined in +.In dev/pci/pcireg.h . +If the capability is found, then +.Fa *capreg +is set to the offset in configuration space of the capability register set, +and +.Fn pci_find_cap +returns zero. +If the capability is not found or the device does not support capabilities, +.Fn pci_find_cap +returns an error. +.Pp +The +.Fn pci_get_vpd_ident +function is used to fetch a device's Vital Product Data +.Pq VPD +identifier string. +If the device +.Fa dev +supports VPD and provides an identifier string, +then +.Fa *identptr +is set to point at a read-only, null-terminated copy of the identifier +string, +and +.Fn pci_get_vpd_ident +returns zero. +If the device does not support VPD or does not provide an identifier +string, +then +.Fn pci_get_vpd_ident +returns an error. +.Pp +The +.Fn pci_get_vpd_readonly +function is used to fetch the value of a single VPD read-only keyword +for the device +.Fa dev . +The keyword to fetch is identified by the two character string +.Fa kw . +If the device supports VPD and provides a read-only value for the +requested keyword, +then +.Fa *vptr +is set to point at a read-only, null-terminated copy of the value, +and +.Fn pci_get_vpd_readonly +returns zero. +If the device does not support VPD or does not provide the requested +keyword, +then +.Fn pci_get_vpd_readonly +returns an error. +.Ss Device Configuration The .Fn pci_enable_busmaster function enables PCI bus mastering for the device @@ -138,20 +300,51 @@ argument specifies which resource is aff or .Dv SYS_RES_IOPORT as appropriate. +Device drivers should generally not use these routines directly. +The PCI bus will enable decoding automatically when a +.Dv SYS_RES_MEMORY +or +.Dv SYS_RES_IOPORT +resource is activated via +.Xr bus_alloc_resource 9 +or +.Xr bus_activate_resource 9 . .Pp -.Em NOTE : -These functions should be used in preference to manually manipulating -the configuration space. +The +.Fn pci_get_max_read_req +function returns the current maximum read request size in bytes for a +PCI-express device. +If the +.Fa dev +device is not a PCI-express device, +.Fn pci_get_max_read_req +returns zero. +.Pp +The +.Fn pci_set_max_read_req +sets the PCI-express maximum read request size for +.Fa dev . +The requested +.Fa size +may be adjusted, +and +.Fn pci_set_max_read_req +returns the actual size set in bytes. +If the +.Fa dev +device is not a PCI-express device, +.Fn pci_set_max_read_req +returns zero. .Pp The .Fn pci_get_powerstate -function returns the current ACPI power state of the device +function returns the current power state of the device .Fa dev . If the device does not support power management capabilities, then the default state of .Dv PCI_POWERSTATE_D0 is returned. -The following power states are defined by ACPI: +The following power states are defined by PCI: .Bl -hang -width ".Dv PCI_POWERSTATE_UNKNOWN" .It Dv PCI_POWERSTATE_D0 State in which device is on and running. @@ -183,15 +376,13 @@ The .Fn pci_set_powerstate function is used to transition the device .Fa dev -to the ACPI power state +to the PCI power state .Fa state . -It checks to see if the device is PCI 2.2 compliant. -If so, it checks the -capabilities pointer to determine which power states the device supports. -If the device does not have power management capabilities, the default state -of -.Dv PCI_POWERSTATE_D0 -is set. +If the device does not support power management capabilities or +it does not support the specific power state +.Fa state , +then the function will fail with +.Er EOPNOTSUPP . .Pp The .Fn pci_save_state @@ -212,57 +403,216 @@ is invoked, then the device will be transitioned to .Dv PCI_POWERSTATE_D0 before any config registers are restored. -.Pp -The -.Fn pci_find_bsf -function looks up the -.Vt device_t -of a PCI device, given its -.Fa bus , -.Fa slot , +.Ss Message Signaled Interrupts +Message Signaled Interrupts +.Pq MSI and -.Fa func . +Enhanced Message Signaled Interrupts +.Pq MSI-X +are PCI capabilities that provide an alternate method for PCI +devices to signal interrupts. +The legacy INTx interrupt is available to PCI devices as a +.Dv SYS_RES_IRQ +resource with a resource ID of zero. +MSI and MSI-X interrupts are available to PCI devices as one or more +.Dv SYS_RES_IRQ +resources with resource IDs greater than zero. +A driver must ask the PCI bus to allocate MSI or MSI-X interrupts +using +.Fn pci_alloc_msi +or +.Fn pci_alloc_msix +before it can use MSI or MSI-X +.Dv SYS_RES_IRQ +resources. +A driver is not allowed to use the legacy INTx +.Dv SYS_RES_IRQ +resource if MSI or MSI-X interrupts have been allocated, +and attempts to allocate MSI or MSI-X interrupts will fail if the +driver is currently using the legacy INTx +.Dv SYS_RES_IRQ +resource. +A driver is only allowed to use either MSI or MSI-X, +but not both. +.Pp +The +.Fn pci_count_msi +function returns the maximum number of MSI messages supported by the +device +.Fa dev. +If the device does not support MSI, +then +.Fn pci_count_msi +returns zero. +.Pp +The +.Fn pci_alloc_msi +function attempts to allocate +.Fa *count +MSI messages for the device +.Fa dev . The -.Fa slot -number actually refers to the number of the device on the bus, -which does not necessarily indicate its geographic location -in terms of a physical slot. -Note that in case the system has multiple PCI domains, -the -.Fn pci_find_bsf -function only searches the first one. -Actually, it is equivalent to: -.Bd -literal -offset indent -pci_find_dbsf(0, bus, slot, func); -.Ed +.Fn pci_alloc_msi +function may allocate fewer messages than requested for various +reasons including requests for more messages than the device +.Fa dev +supports, +or if the system has a shortage of available MSI messages. +On success, +.Fa *count +is set to the number of messages allocated and +.Fn pci_alloc_msi +returns zero. +The +.Dv SYS_RES_IRQ +resources for the allocated messages will be available at consecutive +resource IDs beginning with one. +If +.Fn pci_alloc_msi +is not able to allocate any messages, +it returns an error. +Note that MSI only supports message counts that are powers of two; +requests to allocate a non-power of two count of messages will fail. +.Pp +The +.Fn pci_release_msi +function is used to release any allocated MSI or MSI-X messages back +to the system. +If any MSI or MSI-X +.Dv SYS_RES_IRQ +resources are allocated by the driver or have a configured interrupt +handler, +this function will fail with +.Er EBUSY . +The +.Fn pci_release_msi +function returns zero on success and an error on failure. +.Pp +The +.Fn pci_count_msix +function returns the maximum number of MSI-X messages supported by the +device +.Fa dev . +If the device does not support MSI-X, +then +.Fn pci_count_msix +returns zero. .Pp The -.Fn pci_find_dbsf -function looks up the -.Vt device_t -of a PCI device, given its -.Fa domain , -.Fa bus , -.Fa slot , -and -.Fa func . +.Fn pci_alloc_msix +function attempts to allocate +.Fa *count +MSI-X messages for the device +.Fa dev . The -.Fa slot -number actually refers to the number of the device on the bus, -which does not necessarily indicate its geographic location -in terms of a physical slot. +.Fn pci_alloc_msix +function may allocate fewer messages than requested for various +reasons including requests for more messages than the device +.Fa dev +supports, +or if the system has a shortage of available MSI-X messages. +On success, +.Fa *count +is set to the number of messages allocated and +.Fn pci_alloc_msix +returns zero. +For MSI-X messages, +the resource ID for each +.Dv SYS_RES_IRQ resource identifies the index in the MSI-X table of the +corresponding message. +A resource ID of one maps to the first index of the MSI-X table; +a resource ID two identifies the second index in the table, etc. +The +.Fn pci_alloc_msix +function assigns the +.Fa *count +messages allocated to the first +.Fa *count +table indicies. +If +.Fn pci_alloc_msix +is not able to allocate any messages, +it returns an error. +Unlike MSI, +MSI-X does not require message counts that are powers of two. .Pp The -.Fn pci_find_device -function looks up the -.Vt device_t -of a PCI device, given its -.Fa vendor -and -.Fa device -IDs. -Note that there can be multiple matches for this search; this function -only returns the first matching device. +.Fn pci_pending_msix +function examines the +.Fa dev +device's Pending Bit Array +.Pq PBA +to determine the pending status of the MSI-X message at table index +.Fa index . +If the indicated message is pending, +this function returns a non-zero value; +otherwise, +it returns zero. +Passing an invalid +.Fa index +to this function will result in undefined behavior. +.Pp +As mentioned in the description of +.Fn pci_alloc_msix , +MSI-X messages are initially assigned to the first N table entries. +A driver may use a different distribution of available messages to +table entries via the +.Fn pci_remap_msix +function. +Note that this function must be called after a succesful call to +.Fn pci_alloc_msix +but before any of the +.Dv SYS_RES_IRQ +resources are allocated. +The +.Fn pci_remap_msix +function returns zero on success, +or an error on failure. +.Pp +The +.Fa vectors +array should contain +.Fa count +message vectors. +The array maps directly to the MSI-X table in that the first entry in +the array specifies the message used for the first entry in the MSI-X +table, +the second entry in the array corresponds to the second entry in the +MSI-X table, +etc. +The vector value in each array index can either be zero to indicate +that no message should be assigned to the corresponding MSI-X table entry, +or it can be a number from one to N +.Po +where N is the count returned from the previous call to +.Fn pci_alloc_msix +.Pc +to indicate which of the allocated messages should be assigned to the +corresponding MSI-X table entry. +.Pp +If +.Fn pci_remap_msix +succeeds, +each MSI-X table entry with a non-zero vector will have an associated +.Dv SYS_RES_IRQ +resource whose resource ID corresponds to the table index as described +above for +.Fn pci_alloc_msix . +MSI-X table entries that with a vector of zero will not have an +associated +.Dv SYS_RES_IRQ resource. +Additionally, +if any of the original messages allocated by +.Fn pci_alloc_msix +are not used in the new distribution of messages in the MSI-X table, +they will be released automatically. +Note that if a driver wishes to use fewer messages than were allocated by +.Fn pci_alloc_msix , +the driver must use a single, contiguous range of messages beginning +with one in the new distribution. +The +.Fn pci_remap_msix +function will fail if this condition is not met. .Sh IMPLEMENTATION NOTES The .Vt pci_addr_t @@ -295,7 +645,9 @@ space on the target architecture. .Re .Sh AUTHORS This manual page was written by -.An Bruce M Simpson Aq bms@FreeBSD.org . +.An Bruce M Simpson Aq bms@FreeBSD.org +and +.An John Baldwin Aq jhb@FreeBSD.org . .Sh BUGS The kernel PCI code has a number of references to .Dq "slot numbers" . From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 20:58:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D78C106570E; Fri, 23 Mar 2012 20:58:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6700F8FC12; Fri, 23 Mar 2012 20:58:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NKwSOb094033; Fri, 23 Mar 2012 20:58:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NKwSpl094030; Fri, 23 Mar 2012 20:58:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203232058.q2NKwSpl094030@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 20:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233396 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 20:58:28 -0000 Author: jhb Date: Fri Mar 23 20:58:27 2012 New Revision: 233396 URL: http://svn.freebsd.org/changeset/base/233396 Log: MFC 232362,232363,232463,232553,232569,232571: - Sort function prototypes. - Update the documentation on pci_get/set_powerstate(). These methods are not ACPI-specific at all, but deal with PCI power states. Also, pci_set_powerstate() fails with EOPNOTSUPP if a request is made that the underlying device does not support rather than falling back to somehow setting D0. - Document the following routines: pci_alloc_msi(), pci_alloc_msix(), pci_find_cap(), pci_get_max_read_req(), pci_get_vpd_ident(), pci_get_vpd_readonly(), pci_msi_count(), pci_msix_count(), pci_pending_msix(), pci_release_msi(), pci_remap_msix(), and pci_set_max_read_req(). - Group the functions into five sub-sections: raw configuration access, locating devices, device information, device configuration, and message signaled interrupts. - Discourage use of pci_disable_io() and pci_enable_io() in device drivers. The PCI bus driver handles this automatically as resources are activated. Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/pci.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Fri Mar 23 20:58:18 2012 (r233395) +++ stable/8/share/man/man9/Makefile Fri Mar 23 20:58:27 2012 (r233396) @@ -935,18 +935,30 @@ MLINKS+=namei.9 NDFREE.9 \ MLINKS+=pbuf.9 getpbuf.9 \ pbuf.9 relpbuf.9 \ pbuf.9 trypbuf.9 -MLINKS+=pci.9 pci_disable_busmaster.9 \ +MLINKS+=pci.9 pci_alloc_msi.9 \ + pci.9 pci_alloc_msix.9 \ + pci.9 pci_disable_busmaster.9 \ pci.9 pci_disable_io.9 \ pci.9 pci_enable_busmaster.9 \ pci.9 pci_enable_io.9 \ pci.9 pci_find_bsf.9 \ + pci.9 pci_find_cap.9 \ pci.9 pci_find_dbsf.9 \ pci.9 pci_find_device.9 \ + pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ + pci.9 pci_get_vpd_ident.9 \ + pci.9 pci_get_vpd_readonly.9 \ + pci.9 pci_msi_count.9 \ + pci.9 pci_msix_count.9 \ + pci.9 pci_pending_msix.9 \ pci.9 pci_read_config.9 \ + pci.9 pci_release_msi.9 \ + pci.9 pci_remap_msix.9 \ pci.9 pci_restore_state.9 \ pci.9 pci_save_state.9 \ pci.9 pci_set_powerstate.9 \ + pci.9 pci_set_max_read_req.9 \ pci.9 pci_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ Modified: stable/8/share/man/man9/pci.9 ============================================================================== --- stable/8/share/man/man9/pci.9 Fri Mar 23 20:58:18 2012 (r233395) +++ stable/8/share/man/man9/pci.9 Fri Mar 23 20:58:27 2012 (r233396) @@ -25,61 +25,103 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2007 +.Dd March 5, 2012 .Dt PCI 9 .Os .Sh NAME .Nm pci , -.Nm pci_read_config , -.Nm pci_write_config , -.Nm pci_enable_busmaster , +.Nm pci_alloc_msi , +.Nm pci_alloc_msix , .Nm pci_disable_busmaster , -.Nm pci_enable_io , .Nm pci_disable_io , -.Nm pci_set_powerstate , -.Nm pci_get_powerstate , -.Nm pci_save_state , -.Nm pci_restore_state , +.Nm pci_enable_busmaster , +.Nm pci_enable_io , .Nm pci_find_bsf , +.Nm pci_find_cap , .Nm pci_find_dbsf , -.Nm pci_find_device +.Nm pci_find_device , +.Nm pci_get_max_read_req , +.Nm pci_get_powerstate , +.Nm pci_get_vpd_ident , +.Nm pci_get_vpd_readonly , +.Nm pci_msi_count , +.Nm pci_msix_count , +.Nm pci_pending_msix , +.Nm pci_read_config , +.Nm pci_release_msi , +.Nm pci_remap_msix , +.Nm pci_restore_state , +.Nm pci_save_state , +.Nm pci_set_max_read_req , +.Nm pci_set_powerstate , +.Nm pci_write_config .Nd PCI bus interface .Sh SYNOPSIS .In sys/bus.h -.In dev/pci/pcivar.h .In dev/pci/pcireg.h -.In machine/pci_cfgreg.h -.Ft void -.Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width" +.In dev/pci/pcivar.h .Ft int -.Fn pci_enable_busmaster "device_t dev" +.Fn pci_alloc_msi "device_t dev" "int *count" +.Ft int +.Fn pci_alloc_msix "device_t dev" "int *count" .Ft int .Fn pci_disable_busmaster "device_t dev" .Ft int +.Fn pci_disable_io "device_t dev" "int space" +.Ft int +.Fn pci_enable_busmaster "device_t dev" +.Ft int .Fn pci_enable_io "device_t dev" "int space" +.Ft device_t +.Fn pci_find_bsf "uint8_t bus" "uint8_t slot" "uint8_t func" .Ft int -.Fn pci_disable_io "device_t dev" "int space" +.Fn pci_find_cap "device_t dev" "int capability" "int *capreg" +.Ft device_t +.Fn pci_find_dbsf "uint32_t domain" "uint8_t bus" "uint8_t slot" "uint8_t func" +.Ft device_t +.Fn pci_find_device "uint16_t vendor" "uint16_t device" .Ft int -.Fn pci_set_powerstate "device_t dev" "int state" +.Fn pci_get_max_read_req "device_t dev" .Ft int .Fn pci_get_powerstate "device_t dev" +.Ft int +.Fn pci_get_vpd_ident "device_t dev" "const char **identptr" +.Ft int +.Fn pci_get_vpd_readonly "device_t dev" "const char *kw" "const char **vptr" +.Ft int +.Fn pci_msi_count "device_t dev" +.Ft int +.Fn pci_msix_count "device_t dev" +.Ft int +.Fn pci_pending_msix "device_t dev" "u_int index" .Ft uint32_t .Fn pci_read_config "device_t dev" "int reg" "int width" +.Ft int +.Fn pci_release_msi "device_t dev" +.Ft int +.Fn pci_remap_msix "device_t dev" "int count" "const u_int *vectors" +.Ft void +.Fn pci_restore_state "device_t dev" .Ft void .Fn pci_save_state "device_t dev" +.Ft int +.Fn pci_set_max_read_req "device_t dev" "int size" +.Ft int +.Fn pci_set_powerstate "device_t dev" "int state" .Ft void -.Fn pci_restore_state "device_t dev" -.Ft device_t -.Fn pci_find_bsf "uint8_t bus" "uint8_t slot" "uint8_t func" -.Ft device_t -.Fn pci_find_dbsf "uint32_t domain" "uint8_t bus" "uint8_t slot" "uint8_t func" -.Ft device_t -.Fn pci_find_device "uint16_t vendor" "uint16_t device" +.Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width" .Sh DESCRIPTION The .Nm set of functions are used for managing PCI devices. -.Pp +The functions are split into several groups: +raw configuration access, +locating devices, +device information, +device configuration, +and +message signaled interrupts. +.Ss Raw Configuration Access The .Fn pci_read_config function is used to read data from the PCI configuration @@ -104,6 +146,126 @@ with .Fa width specifying the size of the access. .Pp +.Em NOTE : +Device drivers should only use these functions for functionality that +is not available via another +.Fn pci +function. +.Ss Locating Devices +The +.Fn pci_find_bsf +function looks up the +.Vt device_t +of a PCI device, given its +.Fa bus , +.Fa slot , +and +.Fa func . +The +.Fa slot +number actually refers to the number of the device on the bus, +which does not necessarily indicate its geographic location +in terms of a physical slot. +Note that in case the system has multiple PCI domains, +the +.Fn pci_find_bsf +function only searches the first one. +Actually, it is equivalent to: +.Bd -literal -offset indent +pci_find_dbsf(0, bus, slot, func); +.Ed +.Pp +The +.Fn pci_find_dbsf +function looks up the +.Vt device_t +of a PCI device, given its +.Fa domain , +.Fa bus , +.Fa slot , +and +.Fa func . +The +.Fa slot +number actually refers to the number of the device on the bus, +which does not necessarily indicate its geographic location +in terms of a physical slot. +.Pp +The +.Fn pci_find_device +function looks up the +.Vt device_t +of a PCI device, given its +.Fa vendor +and +.Fa device +IDs. +Note that there can be multiple matches for this search; this function +only returns the first matching device. +.Ss Device Information +The +.Fn pci_find_cap +function is used to locate the first instance of a PCI capability +register set for the device +.Fa dev . +The capability to locate is specified by ID via +.Fa capability . +Constant macros of the form +.Dv PCIY_xxx +for standard capability IDs are defined in +.In dev/pci/pcireg.h . +If the capability is found, then +.Fa *capreg +is set to the offset in configuration space of the capability register set, +and +.Fn pci_find_cap +returns zero. +If the capability is not found or the device does not support capabilities, +.Fn pci_find_cap +returns an error. +.Pp +The +.Fn pci_get_vpd_ident +function is used to fetch a device's Vital Product Data +.Pq VPD +identifier string. +If the device +.Fa dev +supports VPD and provides an identifier string, +then +.Fa *identptr +is set to point at a read-only, null-terminated copy of the identifier +string, +and +.Fn pci_get_vpd_ident +returns zero. +If the device does not support VPD or does not provide an identifier +string, +then +.Fn pci_get_vpd_ident +returns an error. +.Pp +The +.Fn pci_get_vpd_readonly +function is used to fetch the value of a single VPD read-only keyword +for the device +.Fa dev . +The keyword to fetch is identified by the two character string +.Fa kw . +If the device supports VPD and provides a read-only value for the +requested keyword, +then +.Fa *vptr +is set to point at a read-only, null-terminated copy of the value, +and +.Fn pci_get_vpd_readonly +returns zero. +If the device does not support VPD or does not provide the requested +keyword, +then +.Fn pci_get_vpd_readonly +returns an error. +.Ss Device Configuration The .Fn pci_enable_busmaster function enables PCI bus mastering for the device @@ -138,20 +300,51 @@ argument specifies which resource is aff or .Dv SYS_RES_IOPORT as appropriate. +Device drivers should generally not use these routines directly. +The PCI bus will enable decoding automatically when a +.Dv SYS_RES_MEMORY +or +.Dv SYS_RES_IOPORT +resource is activated via +.Xr bus_alloc_resource 9 +or +.Xr bus_activate_resource 9 . .Pp -.Em NOTE : -These functions should be used in preference to manually manipulating -the configuration space. +The +.Fn pci_get_max_read_req +function returns the current maximum read request size in bytes for a +PCI-express device. +If the +.Fa dev +device is not a PCI-express device, +.Fn pci_get_max_read_req +returns zero. +.Pp +The +.Fn pci_set_max_read_req +sets the PCI-express maximum read request size for +.Fa dev . +The requested +.Fa size +may be adjusted, +and +.Fn pci_set_max_read_req +returns the actual size set in bytes. +If the +.Fa dev +device is not a PCI-express device, +.Fn pci_set_max_read_req +returns zero. .Pp The .Fn pci_get_powerstate -function returns the current ACPI power state of the device +function returns the current power state of the device .Fa dev . If the device does not support power management capabilities, then the default state of .Dv PCI_POWERSTATE_D0 is returned. -The following power states are defined by ACPI: +The following power states are defined by PCI: .Bl -hang -width ".Dv PCI_POWERSTATE_UNKNOWN" .It Dv PCI_POWERSTATE_D0 State in which device is on and running. @@ -183,15 +376,13 @@ The .Fn pci_set_powerstate function is used to transition the device .Fa dev -to the ACPI power state +to the PCI power state .Fa state . -It checks to see if the device is PCI 2.2 compliant. -If so, it checks the -capabilities pointer to determine which power states the device supports. -If the device does not have power management capabilities, the default state -of -.Dv PCI_POWERSTATE_D0 -is set. +If the device does not support power management capabilities or +it does not support the specific power state +.Fa state , +then the function will fail with +.Er EOPNOTSUPP . .Pp The .Fn pci_save_state @@ -212,57 +403,216 @@ is invoked, then the device will be transitioned to .Dv PCI_POWERSTATE_D0 before any config registers are restored. -.Pp -The -.Fn pci_find_bsf -function looks up the -.Vt device_t -of a PCI device, given its -.Fa bus , -.Fa slot , +.Ss Message Signaled Interrupts +Message Signaled Interrupts +.Pq MSI and -.Fa func . +Enhanced Message Signaled Interrupts +.Pq MSI-X +are PCI capabilities that provide an alternate method for PCI +devices to signal interrupts. +The legacy INTx interrupt is available to PCI devices as a +.Dv SYS_RES_IRQ +resource with a resource ID of zero. +MSI and MSI-X interrupts are available to PCI devices as one or more +.Dv SYS_RES_IRQ +resources with resource IDs greater than zero. +A driver must ask the PCI bus to allocate MSI or MSI-X interrupts +using +.Fn pci_alloc_msi +or +.Fn pci_alloc_msix +before it can use MSI or MSI-X +.Dv SYS_RES_IRQ +resources. +A driver is not allowed to use the legacy INTx +.Dv SYS_RES_IRQ +resource if MSI or MSI-X interrupts have been allocated, +and attempts to allocate MSI or MSI-X interrupts will fail if the +driver is currently using the legacy INTx +.Dv SYS_RES_IRQ +resource. +A driver is only allowed to use either MSI or MSI-X, +but not both. +.Pp +The +.Fn pci_count_msi +function returns the maximum number of MSI messages supported by the +device +.Fa dev. +If the device does not support MSI, +then +.Fn pci_count_msi +returns zero. +.Pp +The +.Fn pci_alloc_msi +function attempts to allocate +.Fa *count +MSI messages for the device +.Fa dev . The -.Fa slot -number actually refers to the number of the device on the bus, -which does not necessarily indicate its geographic location -in terms of a physical slot. -Note that in case the system has multiple PCI domains, -the -.Fn pci_find_bsf -function only searches the first one. -Actually, it is equivalent to: -.Bd -literal -offset indent -pci_find_dbsf(0, bus, slot, func); -.Ed +.Fn pci_alloc_msi +function may allocate fewer messages than requested for various +reasons including requests for more messages than the device +.Fa dev +supports, +or if the system has a shortage of available MSI messages. +On success, +.Fa *count +is set to the number of messages allocated and +.Fn pci_alloc_msi +returns zero. +The +.Dv SYS_RES_IRQ +resources for the allocated messages will be available at consecutive +resource IDs beginning with one. +If +.Fn pci_alloc_msi +is not able to allocate any messages, +it returns an error. +Note that MSI only supports message counts that are powers of two; +requests to allocate a non-power of two count of messages will fail. +.Pp +The +.Fn pci_release_msi +function is used to release any allocated MSI or MSI-X messages back +to the system. +If any MSI or MSI-X +.Dv SYS_RES_IRQ +resources are allocated by the driver or have a configured interrupt +handler, +this function will fail with +.Er EBUSY . +The +.Fn pci_release_msi +function returns zero on success and an error on failure. +.Pp +The +.Fn pci_count_msix +function returns the maximum number of MSI-X messages supported by the +device +.Fa dev . +If the device does not support MSI-X, +then +.Fn pci_count_msix +returns zero. .Pp The -.Fn pci_find_dbsf -function looks up the -.Vt device_t -of a PCI device, given its -.Fa domain , -.Fa bus , -.Fa slot , -and -.Fa func . +.Fn pci_alloc_msix +function attempts to allocate +.Fa *count +MSI-X messages for the device +.Fa dev . The -.Fa slot -number actually refers to the number of the device on the bus, -which does not necessarily indicate its geographic location -in terms of a physical slot. +.Fn pci_alloc_msix +function may allocate fewer messages than requested for various +reasons including requests for more messages than the device +.Fa dev +supports, +or if the system has a shortage of available MSI-X messages. +On success, +.Fa *count +is set to the number of messages allocated and +.Fn pci_alloc_msix +returns zero. +For MSI-X messages, +the resource ID for each +.Dv SYS_RES_IRQ resource identifies the index in the MSI-X table of the +corresponding message. +A resource ID of one maps to the first index of the MSI-X table; +a resource ID two identifies the second index in the table, etc. +The +.Fn pci_alloc_msix +function assigns the +.Fa *count +messages allocated to the first +.Fa *count +table indicies. +If +.Fn pci_alloc_msix +is not able to allocate any messages, +it returns an error. +Unlike MSI, +MSI-X does not require message counts that are powers of two. .Pp The -.Fn pci_find_device -function looks up the -.Vt device_t -of a PCI device, given its -.Fa vendor -and -.Fa device -IDs. -Note that there can be multiple matches for this search; this function -only returns the first matching device. +.Fn pci_pending_msix +function examines the +.Fa dev +device's Pending Bit Array +.Pq PBA +to determine the pending status of the MSI-X message at table index +.Fa index . +If the indicated message is pending, +this function returns a non-zero value; +otherwise, +it returns zero. +Passing an invalid +.Fa index +to this function will result in undefined behavior. +.Pp +As mentioned in the description of +.Fn pci_alloc_msix , +MSI-X messages are initially assigned to the first N table entries. +A driver may use a different distribution of available messages to +table entries via the +.Fn pci_remap_msix +function. +Note that this function must be called after a succesful call to +.Fn pci_alloc_msix +but before any of the +.Dv SYS_RES_IRQ +resources are allocated. +The +.Fn pci_remap_msix +function returns zero on success, +or an error on failure. +.Pp +The +.Fa vectors +array should contain +.Fa count +message vectors. +The array maps directly to the MSI-X table in that the first entry in +the array specifies the message used for the first entry in the MSI-X +table, +the second entry in the array corresponds to the second entry in the +MSI-X table, +etc. +The vector value in each array index can either be zero to indicate +that no message should be assigned to the corresponding MSI-X table entry, +or it can be a number from one to N +.Po +where N is the count returned from the previous call to +.Fn pci_alloc_msix +.Pc +to indicate which of the allocated messages should be assigned to the +corresponding MSI-X table entry. +.Pp +If +.Fn pci_remap_msix +succeeds, +each MSI-X table entry with a non-zero vector will have an associated +.Dv SYS_RES_IRQ +resource whose resource ID corresponds to the table index as described +above for +.Fn pci_alloc_msix . +MSI-X table entries that with a vector of zero will not have an +associated +.Dv SYS_RES_IRQ resource. +Additionally, +if any of the original messages allocated by +.Fn pci_alloc_msix +are not used in the new distribution of messages in the MSI-X table, +they will be released automatically. +Note that if a driver wishes to use fewer messages than were allocated by +.Fn pci_alloc_msix , +the driver must use a single, contiguous range of messages beginning +with one in the new distribution. +The +.Fn pci_remap_msix +function will fail if this condition is not met. .Sh IMPLEMENTATION NOTES The .Vt pci_addr_t @@ -295,7 +645,9 @@ space on the target architecture. .Re .Sh AUTHORS This manual page was written by -.An Bruce M Simpson Aq bms@FreeBSD.org . +.An Bruce M Simpson Aq bms@FreeBSD.org +and +.An John Baldwin Aq jhb@FreeBSD.org . .Sh BUGS The kernel PCI code has a number of references to .Dq "slot numbers" . From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:07:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2385D106564A; Fri, 23 Mar 2012 21:07:11 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EF608FC17; Fri, 23 Mar 2012 21:07:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NL7AYa094362; Fri, 23 Mar 2012 21:07:10 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NL7A7k094360; Fri, 23 Mar 2012 21:07:10 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203232107.q2NL7A7k094360@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 21:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233397 - head/contrib/gcc/config/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:07:11 -0000 Author: gonzo Date: Fri Mar 23 21:07:10 2012 New Revision: 233397 URL: http://svn.freebsd.org/changeset/base/233397 Log: Disable IRIX compatibility flags for DWARF code generator. IRIX-compatible DWARF code is not compatible with CTF tools Modified: head/contrib/gcc/config/mips/freebsd.h Modified: head/contrib/gcc/config/mips/freebsd.h ============================================================================== --- head/contrib/gcc/config/mips/freebsd.h Fri Mar 23 20:58:27 2012 (r233396) +++ head/contrib/gcc/config/mips/freebsd.h Fri Mar 23 21:07:10 2012 (r233397) @@ -351,4 +351,5 @@ Boston, MA 02110-1301, USA. */ #endif /************************[ Debugger stuff ]*********************************/ - +#undef DBX_DEBUGGING_INFO +#undef MIPS_DEBUGGING_INFO From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:10:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADEF51065674; Fri, 23 Mar 2012 21:10:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 241E48FC1D; Fri, 23 Mar 2012 21:10:42 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q2NLAcoi073771; Fri, 23 Mar 2012 23:10:38 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q2NLAc6Q098770; Fri, 23 Mar 2012 23:10:38 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q2NLAcCf098769; Fri, 23 Mar 2012 23:10:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 23 Mar 2012 23:10:38 +0200 From: Konstantin Belousov To: Alexander Kabaev Message-ID: <20120323211038.GR2358@deviant.kiev.zoral.com.ua> References: <201203232010.q2NKAuIE092217@svn.freebsd.org> <20120323202335.GM2358@deviant.kiev.zoral.com.ua> <20120323164922.0bac354e@kan.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/qX1VF4Euib7a2dq" Content-Disposition: inline In-Reply-To: <20120323164922.0bac354e@kan.dyndns.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Chisnall Subject: Re: svn commit: r233391 - head/contrib/libstdc++/libsupc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:10:43 -0000 --/qX1VF4Euib7a2dq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 23, 2012 at 04:49:22PM -0400, Alexander Kabaev wrote: > On Fri, 23 Mar 2012 22:23:35 +0200 > Konstantin Belousov wrote: >=20 > > On Fri, Mar 23, 2012 at 08:10:56PM +0000, David Chisnall wrote: > > > Author: theraven > > > Date: Fri Mar 23 20:10:56 2012 > > > New Revision: 233391 > > > URL: http://svn.freebsd.org/changeset/base/233391 > > >=20 > > > Log: > > > Revert ABI breakage in libsupc++. > > > =20 > > > Unfortunately, the ABI was broken upstream for the 4.2 release, > > > which we imported. We then shipped the broken version for several > > > years and certain ports (e.g. libobjc2) depend on it, so we're > > > stuck with it for now...=20 > > > We should revisit this for 10.0, since we're allowed to break the > > > ABI then, but until then we should keep the ABI we shipped with 8.x > > > and 9.x. > >=20 > > No, you are not allowed to break ABI for symvered libraries, even > > between major releases. >=20 > You are, if we are ditching the system library in favor on one in > ports. Not polite, but I do not see a polite way out of this. The > libraries from ports are effectively shipped with incompatible ABI in > this area for about 4 years now. Luckily for us, breakage does not seem > to be affecting great many applications, as they do not use the changed > interface directly themselves. libobjc2 is the only known at the moment > that is known to be affected. The patch just committed made the base-shipped library incompatible with the ports and manual libstdc++ builds. I think it is wiser to not 'undo the undo', and instead start living with the upstream-approved ABI. For symvered library, it does not make any difference if you break it in 10.0 or 9.1. Also, I think that consumers that depend of the ABI of std::typeinfo can be hacked to understand the layout of vtable. I doubt that there are many users that utilize typeinfo. --/qX1VF4Euib7a2dq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk9s5s0ACgkQC3+MBN1Mb4ifqQCeOLY2P7mh1aPhVUeftYHnKIbY Se0AoM7mXiKMh8xhS6XvbNSdyLdVixQj =noti -----END PGP SIGNATURE----- --/qX1VF4Euib7a2dq-- From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:19:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9DAD1065670; Fri, 23 Mar 2012 21:19:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB1368FC18; Fri, 23 Mar 2012 21:19:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NLJ7p3094755; Fri, 23 Mar 2012 21:19:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NLJ7mE094753; Fri, 23 Mar 2012 21:19:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203232119.q2NLJ7mE094753@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 21:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233398 - in stable/9/sys: dev/oce i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:19:08 -0000 Author: jhb Date: Fri Mar 23 21:19:07 2012 New Revision: 233398 URL: http://svn.freebsd.org/changeset/base/233398 Log: MFC 232470: Use pci_find_cap() instead of pci_find_extcap() to locate PCI find capabilities as the latter API is deprecated for this purpose. Modified: stable/9/sys/dev/oce/oce_hw.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/dev/oce/oce_hw.c ============================================================================== --- stable/9/sys/dev/oce/oce_hw.c Fri Mar 23 21:07:10 2012 (r233397) +++ stable/9/sys/dev/oce/oce_hw.c Fri Mar 23 21:19:07 2012 (r233398) @@ -203,12 +203,12 @@ void oce_get_pci_capabilities(POCE_SOFTC { uint32_t val; - if (pci_find_extcap(sc->dev, PCIY_PCIX, &val) == 0) { + if (pci_find_cap(sc->dev, PCIY_PCIX, &val) == 0) { if (val != 0) sc->flags |= OCE_FLAGS_PCIX; } - if (pci_find_extcap(sc->dev, PCIY_EXPRESS, &val) == 0) { + if (pci_find_cap(sc->dev, PCIY_EXPRESS, &val) == 0) { if (val != 0) { uint16_t link_status = pci_read_config(sc->dev, val + 0x12, 2); @@ -219,12 +219,12 @@ void oce_get_pci_capabilities(POCE_SOFTC } } - if (pci_find_extcap(sc->dev, PCIY_MSI, &val) == 0) { + if (pci_find_cap(sc->dev, PCIY_MSI, &val) == 0) { if (val != 0) sc->flags |= OCE_FLAGS_MSI_CAPABLE; } - if (pci_find_extcap(sc->dev, PCIY_MSIX, &val) == 0) { + if (pci_find_cap(sc->dev, PCIY_MSIX, &val) == 0) { if (val != 0) { val = pci_msix_count(sc->dev); sc->flags |= OCE_FLAGS_MSIX_CAPABLE; From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:30:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67F38106566B; Fri, 23 Mar 2012 21:30:42 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 02B928FC0C; Fri, 23 Mar 2012 21:30:42 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id BDF731E2B1B; Fri, 23 Mar 2012 22:30:40 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 9D93A2847A; Fri, 23 Mar 2012 22:30:40 +0100 (CET) Date: Fri, 23 Mar 2012 22:30:40 +0100 From: Jilles Tjoelker To: Ed Schouten Message-ID: <20120323213040.GA70656@stack.nl> References: <201203230826.q2N8QW0m064618@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203230826.q2N8QW0m064618@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233345 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:30:42 -0000 On Fri, Mar 23, 2012 at 08:26:32AM +0000, Ed Schouten wrote: > Author: ed > Date: Fri Mar 23 08:26:31 2012 > New Revision: 233345 > URL: http://svn.freebsd.org/changeset/base/233345 > Log: > Make utmpx(3) thread safe if we support TLS. > Because the utmpx interface is generally not required to be thread-safe, > but it is nice to have, if easy to do so. Therefore don't make a mess > out of the code and only use it if __NO_TLS is not defined. Hmm, I think this is a portability trap, at least as long it is supported to have a platform with threading but without __NO_TLS. Besides, I am not sure if this functionality is worth 12 or 20 bytes of memory per thread because most applications do not use it. I think a pthread_key_create() when the first thread calls an utmpx function optimizes for the case where utmpx is not used or used by only one thread. A reason to make utmpx thread-safe could be that glibc does it or popular applications (almost) need it. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:59:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DDA5D1065677; Fri, 23 Mar 2012 21:59:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from zimbra.averesystems.com (75-149-8-245-Pennsylvania.hfc.comcastbusiness.net [75.149.8.245]) by mx1.freebsd.org (Postfix) with ESMTP id 702D08FC16; Fri, 23 Mar 2012 21:59:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.averesystems.com (Postfix) with ESMTP id 8FEBE44600D; Fri, 23 Mar 2012 17:59:37 -0400 (EDT) X-Virus-Scanned: amavisd-new at averesystems.com Received: from zimbra.averesystems.com ([127.0.0.1]) by localhost (zimbra.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xQigxCZXJHJO; Fri, 23 Mar 2012 17:59:33 -0400 (EDT) Received: from hqrouter.arriad.com (vm.arriad.com [10.0.1.251]) by zimbra.averesystems.com (Postfix) with ESMTP id 273BE446005; Fri, 23 Mar 2012 17:59:32 -0400 (EDT) X-Mailbox-Line: From owner-svn-src-stable-8@freebsd.org Fri Mar 23 12:05:57 2012 X-Original-To: aboyer@averesystems.com Delivered-To: aboyer@averesystems.com Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by zimbra.averesystems.com (Postfix) with ESMTP id B751A20110 for ; Fri, 23 Mar 2012 12:05:56 -0400 (EDT) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 0E11214FE02; Fri, 23 Mar 2012 15:37:58 +0000 (UTC) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 090C210656D5; Fri, 23 Mar 2012 15:37:58 +0000 (UTC) (envelope-from owner-svn-src-stable-8@freebsd.org) Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 215D41065678; Fri, 23 Mar 2012 15:37:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B4D18FC17; Fri, 23 Mar 2012 15:37:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NFbfoP082290; Fri, 23 Mar 2012 15:37:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NFbf9k082283; Fri, 23 Mar 2012 15:37:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203231537.q2NFbf9k082283@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 23 Mar 2012 15:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-svn-src-stable-8@freebsd.org Errors-To: owner-svn-src-stable-8@freebsd.org Cc: Subject: svn commit: r233365 - in stable/8/sys: kern sys vm X-BeenThere: svn-src-all@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:59:45 -0000 Author: kib Date: Fri Mar 23 15:37:41 2012 New Revision: 233365 URL: http://svn.freebsd.org/changeset/base/233365 Log: MFC r223889: Add a facility to disable processing page faults. When activated, uiomove generates EFAULT if any accessed address is not mapped, as opposed to handling the fault. Modified: stable/8/sys/kern/kern_subr.c stable/8/sys/sys/proc.h stable/8/sys/sys/systm.h stable/8/sys/sys/uio.h stable/8/sys/vm/vm_extern.h stable/8/sys/vm/vm_fault.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/kern_subr.c ============================================================================== --- stable/8/sys/kern/kern_subr.c Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/kern/kern_subr.c Fri Mar 23 15:37:41 2012 (r233365) @@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$"); SYSCTL_INT(_kern, KERN_IOV_MAX, iov_max, CTLFLAG_RD, NULL, UIO_MAXIOV, "Maximum number of elements in an I/O vector; sysconf(_SC_IOV_MAX)"); +static int uiomove_faultflag(void *cp, int n, struct uio *uio, int nofault); + #ifdef ZERO_COPY_SOCKETS /* Declared in uipc_socket.c */ extern int so_zero_copy_receive; @@ -132,23 +134,65 @@ retry: #endif /* ZERO_COPY_SOCKETS */ int +copyin_nofault(const void *udaddr, void *kaddr, size_t len) +{ + int error, save; + + save = vm_fault_disable_pagefaults(); + error = copyin(udaddr, kaddr, len); + vm_fault_enable_pagefaults(save); + return (error); +} + +int +copyout_nofault(const void *kaddr, void *udaddr, size_t len) +{ + int error, save; + + save = vm_fault_disable_pagefaults(); + error = copyout(kaddr, udaddr, len); + vm_fault_enable_pagefaults(save); + return (error); +} + +int uiomove(void *cp, int n, struct uio *uio) { - struct thread *td = curthread; + + return (uiomove_faultflag(cp, n, uio, 0)); +} + +int +uiomove_nofault(void *cp, int n, struct uio *uio) +{ + + return (uiomove_faultflag(cp, n, uio, 1)); +} + +static int +uiomove_faultflag(void *cp, int n, struct uio *uio, int nofault) +{ + struct thread *td; struct iovec *iov; u_int cnt; - int error = 0; - int save = 0; + int error, newflags, save; + + td = curthread; + error = 0; KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE, ("uiomove: mode")); - KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, + KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == td, ("uiomove proc")); - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, - "Calling uiomove()"); - - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; + if (!nofault) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "Calling uiomove()"); + + /* XXX does it make a sense to set TDP_DEADLKTREAT for UIO_SYSSPACE ? */ + newflags = TDP_DEADLKTREAT; + if (uio->uio_segflg == UIO_USERSPACE && nofault) + newflags |= TDP_NOFAULTING; + save = curthread_pflags_set(newflags); while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; @@ -191,8 +235,7 @@ uiomove(void *cp, int n, struct uio *uio n -= cnt; } out: - if (save == 0) - td->td_pflags &= ~TDP_DEADLKTREAT; + curthread_pflags_restore(save); return (error); } Modified: stable/8/sys/sys/proc.h ============================================================================== --- stable/8/sys/sys/proc.h Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/sys/proc.h Fri Mar 23 15:37:41 2012 (r233365) @@ -391,7 +391,7 @@ do { \ #define TDP_COWINPROGRESS 0x00000010 /* Snapshot copy-on-write in progress. */ #define TDP_ALTSTACK 0x00000020 /* Have alternate signal stack. */ #define TDP_DEADLKTREAT 0x00000040 /* Lock aquisition - deadlock treatment. */ -#define TDP_UNUSED80 0x00000080 /* available. */ +#define TDP_NOFAULTING 0x00000080 /* Do not handle page faults. */ #define TDP_NOSLEEPING 0x00000100 /* Thread is not allowed to sleep on a sq. */ #define TDP_OWEUPC 0x00000200 /* Call addupc() at next AST. */ #define TDP_ITHREAD 0x00000400 /* Thread is an interrupt thread. */ Modified: stable/8/sys/sys/systm.h ============================================================================== --- stable/8/sys/sys/systm.h Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/sys/systm.h Fri Mar 23 15:37:41 2012 (r233365) @@ -216,8 +216,12 @@ int copyinstr(const void * __restrict ud __nonnull(1) __nonnull(2); int copyin(const void * __restrict udaddr, void * __restrict kaddr, size_t len) __nonnull(1) __nonnull(2); +int copyin_nofault(const void * __restrict udaddr, void * __restrict kaddr, + size_t len) __nonnull(1) __nonnull(2); int copyout(const void * __restrict kaddr, void * __restrict udaddr, size_t len) __nonnull(1) __nonnull(2); +int copyout_nofault(const void * __restrict kaddr, void * __restrict udaddr, + size_t len) __nonnull(1) __nonnull(2); int fubyte(const void *base); long fuword(const void *base); Modified: stable/8/sys/sys/uio.h ============================================================================== --- stable/8/sys/sys/uio.h Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/sys/uio.h Fri Mar 23 15:37:41 2012 (r233365) @@ -101,6 +101,7 @@ int uiomove(void *cp, int n, struct uio int uiomove_frombuf(void *buf, int buflen, struct uio *uio); int uiomove_fromphys(struct vm_page *ma[], vm_offset_t offset, int n, struct uio *uio); +int uiomove_nofault(void *cp, int n, struct uio *uio); int uiomoveco(void *cp, int n, struct uio *uio, int disposable); #else /* !_KERNEL */ Modified: stable/8/sys/vm/vm_extern.h ============================================================================== --- stable/8/sys/vm/vm_extern.h Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/vm/vm_extern.h Fri Mar 23 15:37:41 2012 (r233365) @@ -61,6 +61,8 @@ int useracc(void *, int, int); int vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int); void vm_fault_copy_entry(vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t, vm_ooffset_t *); +int vm_fault_disable_pagefaults(void); +void vm_fault_enable_pagefaults(int save); void vm_fault_unwire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t); int vm_fault_wire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t); int vm_forkproc(struct thread *, struct proc *, struct thread *, struct vmspace *, int); Modified: stable/8/sys/vm/vm_fault.c ============================================================================== --- stable/8/sys/vm/vm_fault.c Fri Mar 23 14:12:51 2012 (r233364) +++ stable/8/sys/vm/vm_fault.c Fri Mar 23 15:37:41 2012 (r233365) @@ -222,6 +222,9 @@ vm_fault(vm_map_t map, vm_offset_t vaddr struct vnode *vp; int locked, error; + if ((curthread->td_pflags & TDP_NOFAULTING) != 0) + return (KERN_PROTECTION_FAILURE); + hardfault = 0; growstack = TRUE; PCPU_INC(cnt.v_vm_faults); @@ -1405,3 +1408,17 @@ vm_fault_additional_pages(m, rbehind, ra /* return number of pages */ return i; } + +int +vm_fault_disable_pagefaults(void) +{ + + return (curthread_pflags_set(TDP_NOFAULTING)); +} + +void +vm_fault_enable_pagefaults(int save) +{ + + curthread_pflags_restore(save); +} _______________________________________________ svn-src-stable-8@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:59:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25B631065678; Fri, 23 Mar 2012 21:59:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from zimbra.averesystems.com (75-149-8-245-Pennsylvania.hfc.comcastbusiness.net [75.149.8.245]) by mx1.freebsd.org (Postfix) with ESMTP id AABCC8FC17; Fri, 23 Mar 2012 21:59:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.averesystems.com (Postfix) with ESMTP id 7B04F44600A; Fri, 23 Mar 2012 17:59:43 -0400 (EDT) X-Virus-Scanned: amavisd-new at averesystems.com Received: from zimbra.averesystems.com ([127.0.0.1]) by localhost (zimbra.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x3bMoFCnoLRG; Fri, 23 Mar 2012 17:59:35 -0400 (EDT) Received: from hqrouter.arriad.com (vm.arriad.com [10.0.1.251]) by zimbra.averesystems.com (Postfix) with ESMTP id D1AED446009; Fri, 23 Mar 2012 17:59:34 -0400 (EDT) X-Mailbox-Line: From owner-svn-src-stable-8@freebsd.org Fri Mar 23 12:19:37 2012 X-Original-To: aboyer@averesystems.com Delivered-To: aboyer@averesystems.com Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by zimbra.averesystems.com (Postfix) with ESMTP id 8DA7A20097 for ; Fri, 23 Mar 2012 12:19:37 -0400 (EDT) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 3F07E1A4510; Fri, 23 Mar 2012 16:19:23 +0000 (UTC) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 2B5B810657A0; Fri, 23 Mar 2012 16:19:22 +0000 (UTC) (envelope-from owner-svn-src-stable-8@freebsd.org) Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DD9B106567F; Fri, 23 Mar 2012 16:19:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E37328FC21; Fri, 23 Mar 2012 16:19:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NGJE8l083849; Fri, 23 Mar 2012 16:19:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NGJEkQ083847; Fri, 23 Mar 2012 16:19:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203231619.q2NGJEkQ083847@svn.freebsd.org> From: Alexander Motin Date: Fri, 23 Mar 2012 16:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-svn-src-stable-8@freebsd.org Errors-To: owner-svn-src-stable-8@freebsd.org Cc: Subject: svn commit: r233369 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:59:45 -0000 Author: mav Date: Fri Mar 23 16:19:14 2012 New Revision: 233369 URL: http://svn.freebsd.org/changeset/base/233369 Log: MFC r232793: Revert r175376 and tune cpufreq(4) frequency comparison logic instead. Instead of using 25MHz equality threshold, look for the nearest value when handling dev.cpu.0.freq sysctl and for exact match when it is expected. ACPI may report extra level with frequency 1MHz above the nominal to control Intel Turbo Boost operation. It is not a bug, but feature: dev.cpu.0.freq_levels: 2934/106000 2933/95000 2800/82000 ... In this case value 2933 means 2.93GHz, but 2934 means 3.2-3.6GHz. I've found that my Core i7 based systems have Intel Turbo Boost not used by default and without this change it was absolutely invisible and hard to control. Modified: stable/8/sys/kern/kern_cpu.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/kern_cpu.c ============================================================================== --- stable/8/sys/kern/kern_cpu.c Fri Mar 23 16:17:46 2012 (r233368) +++ stable/8/sys/kern/kern_cpu.c Fri Mar 23 16:19:14 2012 (r233369) @@ -311,7 +311,7 @@ cf_set_method(device_t dev, const struct } /* If already at this level, just return. */ - if (CPUFREQ_CMP(sc->curr_level.total_set.freq, level->total_set.freq)) { + if (sc->curr_level.total_set.freq == level->total_set.freq) { CF_DEBUG("skipping freq %d, same as current level %d\n", level->total_set.freq, sc->curr_level.total_set.freq); goto skip; @@ -470,7 +470,7 @@ cf_get_method(device_t dev, struct cf_le if (CPUFREQ_DRV_GET(devs[n], &set) != 0) continue; for (i = 0; i < count; i++) { - if (CPUFREQ_CMP(set.freq, levels[i].total_set.freq)) { + if (set.freq == levels[i].total_set.freq) { sc->curr_level = levels[i]; break; } @@ -626,16 +626,6 @@ cf_levels_method(device_t dev, struct cf /* Finally, output the list of levels. */ i = 0; TAILQ_FOREACH(lev, &sc->all_levels, link) { - /* - * Skip levels that are too close in frequency to the - * previous levels. Some systems report bogus duplicate - * settings (i.e., for acpi_perf). - */ - if (i > 0 && CPUFREQ_CMP(lev->total_set.freq, - levels[i - 1].total_set.freq)) { - sc->all_count--; - continue; - } /* Skip levels that have a frequency that is too low. */ if (lev->total_set.freq < cf_lowest_freq) { @@ -869,7 +859,7 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS) { struct cpufreq_softc *sc; struct cf_level *levels; - int count, devcount, error, freq, i, n; + int best, count, diff, bdiff, devcount, error, freq, i, n; device_t *devs; devs = NULL; @@ -901,17 +891,16 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS) "cpufreq: need to increase CF_MAX_LEVELS\n"); break; } + best = 0; + bdiff = 1 << 30; for (i = 0; i < count; i++) { - if (CPUFREQ_CMP(levels[i].total_set.freq, freq)) { - error = CPUFREQ_SET(devs[n], &levels[i], - CPUFREQ_PRIO_USER); - break; + diff = abs(levels[i].total_set.freq - freq); + if (diff < bdiff) { + bdiff = diff; + best = i; } } - if (i == count) { - error = EINVAL; - break; - } + error = CPUFREQ_SET(devs[n], &levels[best], CPUFREQ_PRIO_USER); } out: _______________________________________________ svn-src-stable-8@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:59:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C0191065675; Fri, 23 Mar 2012 21:59:48 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from zimbra.averesystems.com (75-149-8-245-Pennsylvania.hfc.comcastbusiness.net [75.149.8.245]) by mx1.freebsd.org (Postfix) with ESMTP id 1F7EF8FC08; Fri, 23 Mar 2012 21:59:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.averesystems.com (Postfix) with ESMTP id 3A2DB446006; Fri, 23 Mar 2012 17:59:45 -0400 (EDT) X-Virus-Scanned: amavisd-new at averesystems.com Received: from zimbra.averesystems.com ([127.0.0.1]) by localhost (zimbra.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Em6EiwY1JUZ2; Fri, 23 Mar 2012 17:59:41 -0400 (EDT) Received: from hqrouter.arriad.com (vm.arriad.com [10.0.1.251]) by zimbra.averesystems.com (Postfix) with ESMTP id 65FC1446008; Fri, 23 Mar 2012 17:59:39 -0400 (EDT) X-Mailbox-Line: From owner-svn-src-stable-8@freebsd.org Fri Mar 23 13:12:05 2012 X-Original-To: aboyer@averesystems.com Delivered-To: aboyer@averesystems.com Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by zimbra.averesystems.com (Postfix) with ESMTP id C81DD200A8 for ; Fri, 23 Mar 2012 13:12:04 -0400 (EDT) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 550D2152B8B; Fri, 23 Mar 2012 17:11:48 +0000 (UTC) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 500151065678; Fri, 23 Mar 2012 17:11:48 +0000 (UTC) (envelope-from owner-svn-src-stable-8@freebsd.org) Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E805A1065673; Fri, 23 Mar 2012 17:11:36 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C95BB8FC1E; Fri, 23 Mar 2012 17:11:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NHBa52085800; Fri, 23 Mar 2012 17:11:36 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NHBaAZ085796; Fri, 23 Mar 2012 17:11:36 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201203231711.q2NHBaAZ085796@svn.freebsd.org> From: Jim Harris Date: Fri, 23 Mar 2012 17:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-svn-src-stable-8@freebsd.org Errors-To: owner-svn-src-stable-8@freebsd.org Cc: Subject: svn commit: r233373 - stable/8/sys/dev/isci X-BeenThere: svn-src-all@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:59:48 -0000 Author: jimharris Date: Fri Mar 23 17:11:36 2012 New Revision: 233373 URL: http://svn.freebsd.org/changeset/base/233373 Log: MFC r233371: Call xpt_bus_register during attach context, then freeze and do not release until domain discovery is complete. This fixes an isci(4) bug on FreeBSD 7.x where devices weren't always appearing after boot without an explicit rescan. Sponsored by: Intel Reported and tested by: Reviewed by: scottl Approved by: scottl Modified: stable/8/sys/dev/isci/isci.h stable/8/sys/dev/isci/isci_controller.c stable/8/sys/dev/isci/isci_remote_device.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/isci/isci.h ============================================================================== --- stable/8/sys/dev/isci/isci.h Fri Mar 23 16:59:03 2012 (r233372) +++ stable/8/sys/dev/isci/isci.h Fri Mar 23 17:11:36 2012 (r233373) @@ -122,6 +122,7 @@ struct ISCI_CONTROLLER SCI_CONTROLLER_HANDLE_T scif_controller_handle; struct ISCI_DOMAIN domain[SCI_MAX_DOMAINS]; BOOL is_started; + BOOL has_been_scanned; uint32_t initial_discovery_mask; BOOL is_frozen; uint8_t *remote_device_memory; Modified: stable/8/sys/dev/isci/isci_controller.c ============================================================================== --- stable/8/sys/dev/isci/isci_controller.c Fri Mar 23 16:59:03 2012 (r233372) +++ stable/8/sys/dev/isci/isci_controller.c Fri Mar 23 17:11:36 2012 (r233373) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -300,6 +303,16 @@ SCI_STATUS isci_controller_initialize(st TUNABLE_INT_FETCH("hw.isci.io_shortage", &io_shortage); controller->sim_queue_depth += io_shortage; + /* Attach to CAM using xpt_bus_register now, then immediately freeze + * the simq. It will get released later when initial domain discovery + * is complete. + */ + controller->has_been_scanned = FALSE; + mtx_lock(&controller->lock); + isci_controller_attach_to_cam(controller); + xpt_freeze_simq(controller->sim, 1); + mtx_unlock(&controller->lock); + return (scif_controller_initialize(controller->scif_controller_handle)); } @@ -441,13 +454,13 @@ void isci_controller_start(void *control void isci_controller_domain_discovery_complete( struct ISCI_CONTROLLER *isci_controller, struct ISCI_DOMAIN *isci_domain) { - if (isci_controller->sim == NULL) + if (!isci_controller->has_been_scanned) { - /* Controller has not been attached to CAM yet. We'll clear + /* Controller has not been scanned yet. We'll clear * the discovery bit for this domain, then check if all bits * are now clear. That would indicate that all domains are - * done with discovery and we can then attach the controller - * to CAM. + * done with discovery and we can then proceed with initial + * scan. */ isci_controller->initial_discovery_mask &= @@ -457,7 +470,25 @@ void isci_controller_domain_discovery_co struct isci_softc *driver = isci_controller->isci; uint8_t next_index = isci_controller->index + 1; - isci_controller_attach_to_cam(isci_controller); + isci_controller->has_been_scanned = TRUE; + + /* Unfreeze simq to allow initial scan to proceed. */ + xpt_release_simq(isci_controller->sim, TRUE); + +#if __FreeBSD_version < 800000 + /* When driver is loaded after boot, we need to + * explicitly rescan here for versions <8.0, because + * CAM only automatically scans new buses at boot + * time. + */ + union ccb *ccb = xpt_alloc_ccb_nowait(); + + xpt_create_path(&ccb->ccb_h.path, xpt_periph, + cam_sim_path(isci_controller->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); + + xpt_rescan(ccb); +#endif if (next_index < driver->controller_count) { /* There are more controllers that need to Modified: stable/8/sys/dev/isci/isci_remote_device.c ============================================================================== --- stable/8/sys/dev/isci/isci_remote_device.c Fri Mar 23 16:59:03 2012 (r233372) +++ stable/8/sys/dev/isci/isci_remote_device.c Fri Mar 23 17:11:36 2012 (r233373) @@ -74,13 +74,12 @@ scif_cb_remote_device_ready(SCI_CONTROLL isci_controller->remote_device[device_index] = isci_remote_device; - if (isci_controller->sim != NULL) { - /* The sim object is not NULL, meaning we have attached - * the controller to CAM already. In that case, create - * a CCB to instruct CAM to rescan this device. - * If the sim object is NULL, this device will get - * scanned as part of the initial scan when the - * controller is attached to CAM. + if (isci_controller->has_been_scanned) { + /* The sim object has been scanned at least once + * already. In that case, create a CCB to instruct + * CAM to rescan this device. + * If the sim object has not been scanned, this device + * will get scanned as part of the initial scan. */ union ccb *ccb = xpt_alloc_ccb_nowait(); _______________________________________________ svn-src-stable-8@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:59:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1FB4B10657D2; Fri, 23 Mar 2012 21:59:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from zimbra.averesystems.com (75-149-8-245-Pennsylvania.hfc.comcastbusiness.net [75.149.8.245]) by mx1.freebsd.org (Postfix) with ESMTP id BDCB68FC14; Fri, 23 Mar 2012 21:59:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.averesystems.com (Postfix) with ESMTP id 1A7E9446005; Fri, 23 Mar 2012 17:59:52 -0400 (EDT) X-Virus-Scanned: amavisd-new at averesystems.com Received: from zimbra.averesystems.com ([127.0.0.1]) by localhost (zimbra.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CtXBm18SjM2g; Fri, 23 Mar 2012 17:59:41 -0400 (EDT) Received: from hqrouter.arriad.com (vm.arriad.com [10.0.1.251]) by zimbra.averesystems.com (Postfix) with ESMTP id EE5A1446022; Fri, 23 Mar 2012 17:59:40 -0400 (EDT) X-Mailbox-Line: From owner-svn-src-stable-8@freebsd.org Fri Mar 23 13:25:42 2012 X-Original-To: aboyer@averesystems.com Delivered-To: aboyer@averesystems.com Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by zimbra.averesystems.com (Postfix) with ESMTP id 93E3020097 for ; Fri, 23 Mar 2012 13:25:42 -0400 (EDT) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id DBC761A3F4E; Fri, 23 Mar 2012 17:25:12 +0000 (UTC) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id D75F310656D8; Fri, 23 Mar 2012 17:25:12 +0000 (UTC) (envelope-from owner-svn-src-stable-8@freebsd.org) Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C39E8106566C; Fri, 23 Mar 2012 17:24:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A54D98FC0C; Fri, 23 Mar 2012 17:24:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NHOqki086397; Fri, 23 Mar 2012 17:24:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NHOqS9086394; Fri, 23 Mar 2012 17:24:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231724.q2NHOqS9086394@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 17:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-svn-src-stable-8@freebsd.org Errors-To: owner-svn-src-stable-8@freebsd.org Cc: Subject: svn commit: r233377 - in stable/8/sys: boot/i386/boot2 i386/conf X-BeenThere: svn-src-all@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:59:53 -0000 Author: jhb Date: Fri Mar 23 17:24:52 2012 New Revision: 233377 URL: http://svn.freebsd.org/changeset/base/233377 Log: MFC 232570,232754: Fix boot2 to handle boot config files that only contain a custom path to a loader or kernel. Specifically, kname cannot be pointed at cmd[] since it's value is change to be an empty string after the initial call to parse, and cmd[]'s value can be changed (thus losing a prior setting for kname) due to user input at the boot prompt. While here, ensure that that initial boot config file text is nul-terminated, that ops is initialized to zero, and that kname is always initialized to a valid string. In addition, include other changes to ensure boot2 still builds with Clang. Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Fri Mar 23 17:24:29 2012 (r233376) +++ stable/8/sys/boot/i386/boot2/boot2.c Fri Mar 23 17:24:52 2012 (r233377) @@ -128,9 +128,9 @@ static struct dsk { unsigned start; int init; } dsk; -static char cmd[512], cmddup[512]; -static const char *kname; -static uint32_t opts; +static char cmd[512], cmddup[512], knamebuf[1024]; +static const char *kname = NULL; +static uint32_t opts = 0; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -223,8 +223,8 @@ main(void) { uint8_t autoboot; ino_t ino; + size_t nbyte; - kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I; @@ -240,8 +240,10 @@ main(void) autoboot = 1; if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) - fsread(ino, cmd, sizeof(cmd)); + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } if (*cmd) { memcpy(cmddup, cmd, sizeof(cmd)); @@ -258,9 +260,9 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !kname) { + if (!kname) { kname = PATH_BOOT3; - if (!keyhit(3*SECOND)) { + if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; } @@ -457,7 +459,12 @@ parse() ? DRV_HARD : 0) + drv; dsk_meta = 0; } - kname = arg; + if ((i = ep - arg)) { + if ((size_t)i >= sizeof(knamebuf)) + return -1; + memcpy(knamebuf, arg, i + 1); + kname = knamebuf; + } } arg = p; } _______________________________________________ svn-src-stable-8@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:59:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D730106564A; Fri, 23 Mar 2012 21:59:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from zimbra.averesystems.com (75-149-8-245-Pennsylvania.hfc.comcastbusiness.net [75.149.8.245]) by mx1.freebsd.org (Postfix) with ESMTP id 183E18FC12; Fri, 23 Mar 2012 21:59:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.averesystems.com (Postfix) with ESMTP id 1E513446002; Fri, 23 Mar 2012 17:59:54 -0400 (EDT) X-Virus-Scanned: amavisd-new at averesystems.com Received: from zimbra.averesystems.com ([127.0.0.1]) by localhost (zimbra.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kzfnc5ZIRFBI; Fri, 23 Mar 2012 17:59:50 -0400 (EDT) Received: from hqrouter.arriad.com (vm.arriad.com [10.0.1.251]) by zimbra.averesystems.com (Postfix) with ESMTP id 96D0A44600A; Fri, 23 Mar 2012 17:59:46 -0400 (EDT) X-Mailbox-Line: From owner-svn-src-stable-8@freebsd.org Fri Mar 23 14:30:24 2012 X-Original-To: aboyer@averesystems.com Delivered-To: aboyer@averesystems.com Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by zimbra.averesystems.com (Postfix) with ESMTP id 51CCC20099 for ; Fri, 23 Mar 2012 14:30:24 -0400 (EDT) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 844FB1A9051; Fri, 23 Mar 2012 18:29:46 +0000 (UTC) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 651341065678; Fri, 23 Mar 2012 18:29:46 +0000 (UTC) (envelope-from owner-svn-src-stable-8@freebsd.org) Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F419C106566B; Fri, 23 Mar 2012 18:29:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C50598FC12; Fri, 23 Mar 2012 18:29:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NITSai088800; Fri, 23 Mar 2012 18:29:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NITSti088797; Fri, 23 Mar 2012 18:29:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231829.q2NITSti088797@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 18:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-svn-src-stable-8@freebsd.org Errors-To: owner-svn-src-stable-8@freebsd.org Cc: Subject: svn commit: r233386 - in stable/8/sys: fs/tmpfs i386/conf ufs/ufs X-BeenThere: svn-src-all@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:59:55 -0000 Author: jhb Date: Fri Mar 23 18:29:28 2012 New Revision: 233386 URL: http://svn.freebsd.org/changeset/base/233386 Log: MFC 232401: Similar to the fixes in 226967 and 226987, purge any name cache entries associated with the previous vnode (if any) associated with the target of a rename(). Otherwise, a lookup of the target pathname concurrent with a rename() could re-add a name cache entry after the namei(RENAME) lookup in kern_renameat() had purged the target pathname. Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c stable/8/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_vnops.c Fri Mar 23 18:29:09 2012 (r233385) +++ stable/8/sys/fs/tmpfs/tmpfs_vnops.c Fri Mar 23 18:29:28 2012 (r233386) @@ -1072,6 +1072,8 @@ tmpfs_rename(struct vop_rename_args *v) tmpfs_free_dirent(VFS_TO_TMPFS(tvp->v_mount), de, TRUE); } cache_purge(fvp); + if (tvp != NULL) + cache_purge(tvp); error = 0; Modified: stable/8/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_vnops.c Fri Mar 23 18:29:09 2012 (r233385) +++ stable/8/sys/ufs/ufs/ufs_vnops.c Fri Mar 23 18:29:28 2012 (r233386) @@ -1527,8 +1527,15 @@ relock: * ufs_lookup_ino() and then VFS_VGET(), another thread might do a * normal lookup of the from name just before the VFS_VGET() call, * causing the cache entry to be re-instantiated. + * + * The same issue also applies to tvp if it exists as + * otherwise we may have a stale name cache entry for the new + * name that references the old i-node if it has other links + * or open file descriptors. */ cache_purge(fvp); + if (tvp) + cache_purge(tvp); unlockout: vput(fdvp); _______________________________________________ svn-src-stable-8@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:59:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B7501065899; Fri, 23 Mar 2012 21:59:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from zimbra.averesystems.com (75-149-8-245-Pennsylvania.hfc.comcastbusiness.net [75.149.8.245]) by mx1.freebsd.org (Postfix) with ESMTP id 1AEB78FC1C; Fri, 23 Mar 2012 21:59:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.averesystems.com (Postfix) with ESMTP id 3F324446006; Fri, 23 Mar 2012 17:59:55 -0400 (EDT) X-Virus-Scanned: amavisd-new at averesystems.com Received: from zimbra.averesystems.com ([127.0.0.1]) by localhost (zimbra.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jM6-TcbC+cNs; Fri, 23 Mar 2012 17:59:43 -0400 (EDT) Received: from hqrouter.arriad.com (vm.arriad.com [10.0.1.251]) by zimbra.averesystems.com (Postfix) with ESMTP id 5DEEF446023; Fri, 23 Mar 2012 17:59:41 -0400 (EDT) X-Mailbox-Line: From owner-svn-src-stable-8@freebsd.org Fri Mar 23 14:04:37 2012 X-Original-To: aboyer@averesystems.com Delivered-To: aboyer@averesystems.com Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by zimbra.averesystems.com (Postfix) with ESMTP id BE59B200AF for ; Fri, 23 Mar 2012 14:04:36 -0400 (EDT) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 5B6101763D1; Fri, 23 Mar 2012 18:04:22 +0000 (UTC) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 43E7A106567A; Fri, 23 Mar 2012 18:04:22 +0000 (UTC) (envelope-from owner-svn-src-stable-8@freebsd.org) Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F0491065680; Fri, 23 Mar 2012 18:03:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68A548FC1A; Fri, 23 Mar 2012 18:03:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NI3diW087721; Fri, 23 Mar 2012 18:03:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NI3dx2087716; Fri, 23 Mar 2012 18:03:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231803.q2NI3dx2087716@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 18:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-svn-src-stable-8@freebsd.org Errors-To: owner-svn-src-stable-8@freebsd.org Cc: Subject: svn commit: r233380 - in stable/8: share/man/man9 sys/dev/pci sys/i386/conf X-BeenThere: svn-src-all@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:59:57 -0000 Author: jhb Date: Fri Mar 23 18:03:38 2012 New Revision: 233380 URL: http://svn.freebsd.org/changeset/base/233380 Log: MFC 232360: Add pci_save_state() and pci_restore_state() wrappers around pci_cfg_save() and pci_cfg_restore() for device drivers to use when saving and restoring state (e.g. to handle device-specific resets). Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/pci.9 stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pcivar.h Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Fri Mar 23 18:03:04 2012 (r233379) +++ stable/8/share/man/man9/Makefile Fri Mar 23 18:03:38 2012 (r233380) @@ -944,6 +944,8 @@ MLINKS+=pci.9 pci_disable_busmaster.9 \ pci.9 pci_find_device.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_read_config.9 \ + pci.9 pci_restore_state.9 \ + pci.9 pci_save_state.9 \ pci.9 pci_set_powerstate.9 \ pci.9 pci_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ Modified: stable/8/share/man/man9/pci.9 ============================================================================== --- stable/8/share/man/man9/pci.9 Fri Mar 23 18:03:04 2012 (r233379) +++ stable/8/share/man/man9/pci.9 Fri Mar 23 18:03:38 2012 (r233380) @@ -38,6 +38,8 @@ .Nm pci_disable_io , .Nm pci_set_powerstate , .Nm pci_get_powerstate , +.Nm pci_save_state , +.Nm pci_restore_state , .Nm pci_find_bsf , .Nm pci_find_dbsf , .Nm pci_find_device @@ -63,6 +65,10 @@ .Fn pci_get_powerstate "device_t dev" .Ft uint32_t .Fn pci_read_config "device_t dev" "int reg" "int width" +.Ft void +.Fn pci_save_state "device_t dev" +.Ft void +.Fn pci_restore_state "device_t dev" .Ft device_t .Fn pci_find_bsf "uint8_t bus" "uint8_t slot" "uint8_t func" .Ft device_t @@ -188,6 +194,26 @@ of is set. .Pp The +.Fn pci_save_state +and +.Fn pci_restore_state +functions can be used by a device driver to save and restore standard PCI +config registers. +The +.Fn pci_save_state +function must be invoked while the device has valid state before +.Fn pci_restore_state +can be used. +If the device is not in the fully-powered state +.Pq Dv PCI_POWERSTATE_D0 +when +.Fn pci_restore_state +is invoked, +then the device will be transitioned to +.Dv PCI_POWERSTATE_D0 +before any config registers are restored. +.Pp +The .Fn pci_find_bsf function looks up the .Vt device_t Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Fri Mar 23 18:03:04 2012 (r233379) +++ stable/8/sys/dev/pci/pci.c Fri Mar 23 18:03:38 2012 (r233380) @@ -4171,3 +4171,22 @@ pci_cfg_save(device_t dev, struct pci_de if (pci_get_powerstate(dev) != PCI_POWERSTATE_D3) pci_set_powerstate(dev, PCI_POWERSTATE_D3); } + +/* Wrapper APIs suitable for device driver use. */ +void +pci_save_state(device_t dev) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(dev); + pci_cfg_save(dev, dinfo, 0); +} + +void +pci_restore_state(device_t dev) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(dev); + pci_cfg_restore(dev, dinfo); +} Modified: stable/8/sys/dev/pci/pcivar.h ============================================================================== --- stable/8/sys/dev/pci/pcivar.h Fri Mar 23 18:03:04 2012 (r233379) +++ stable/8/sys/dev/pci/pcivar.h Fri Mar 23 18:03:38 2012 (r233380) @@ -460,6 +460,8 @@ int pci_msi_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); int pci_get_max_read_req(device_t dev); +void pci_restore_state(device_t dev); +void pci_save_state(device_t dev); int pci_set_max_read_req(device_t dev, int size); #endif /* _SYS_BUS_H_ */ _______________________________________________ svn-src-stable-8@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:59:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2E3F106577E; Fri, 23 Mar 2012 21:59:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from zimbra.averesystems.com (75-149-8-245-Pennsylvania.hfc.comcastbusiness.net [75.149.8.245]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3948FC08; Fri, 23 Mar 2012 21:59:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.averesystems.com (Postfix) with ESMTP id E01E0446002; Fri, 23 Mar 2012 17:59:55 -0400 (EDT) X-Virus-Scanned: amavisd-new at averesystems.com Received: from zimbra.averesystems.com ([127.0.0.1]) by localhost (zimbra.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PrFaN8vI6ckz; Fri, 23 Mar 2012 17:59:50 -0400 (EDT) Received: from hqrouter.arriad.com (vm.arriad.com [10.0.1.251]) by zimbra.averesystems.com (Postfix) with ESMTP id 6127A446009; Fri, 23 Mar 2012 17:59:44 -0400 (EDT) X-Mailbox-Line: From owner-svn-src-stable-8@freebsd.org Fri Mar 23 14:23:28 2012 X-Original-To: aboyer@averesystems.com Delivered-To: aboyer@averesystems.com Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by zimbra.averesystems.com (Postfix) with ESMTP id 66001200B5 for ; Fri, 23 Mar 2012 14:23:28 -0400 (EDT) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 4B0FB16038B; Fri, 23 Mar 2012 18:22:54 +0000 (UTC) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 72D04106567A; Fri, 23 Mar 2012 18:22:54 +0000 (UTC) (envelope-from owner-svn-src-stable-8@freebsd.org) Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA3701065678; Fri, 23 Mar 2012 18:22:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A421A8FC0C; Fri, 23 Mar 2012 18:22:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NIMcXN088508; Fri, 23 Mar 2012 18:22:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NIMc1M088506; Fri, 23 Mar 2012 18:22:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231822.q2NIMc1M088506@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 18:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-svn-src-stable-8@freebsd.org Errors-To: owner-svn-src-stable-8@freebsd.org Cc: Subject: svn commit: r233384 - in stable/8/sys: dev/e1000 i386/conf X-BeenThere: svn-src-all@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:59:58 -0000 Author: jhb Date: Fri Mar 23 18:22:38 2012 New Revision: 233384 URL: http://svn.freebsd.org/changeset/base/233384 Log: MFC 232367: Properly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X allocation fails. Modified: stable/8/sys/dev/e1000/if_igb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/dev/e1000/if_igb.c ============================================================================== --- stable/8/sys/dev/e1000/if_igb.c Fri Mar 23 18:22:20 2012 (r233383) +++ stable/8/sys/dev/e1000/if_igb.c Fri Mar 23 18:22:38 2012 (r233384) @@ -2702,7 +2702,7 @@ igb_setup_msix(struct adapter *adapter) "MSIX Configuration Problem, " "%d vectors configured, but %d queues wanted!\n", msgs, want); - return (ENXIO); + return (0); } if ((msgs) && pci_alloc_msix(dev, &msgs) == 0) { device_printf(adapter->dev, @@ -2712,9 +2712,11 @@ igb_setup_msix(struct adapter *adapter) } msi: msgs = pci_msi_count(dev); - if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0) - device_printf(adapter->dev,"Using MSI interrupt\n"); - return (msgs); + if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0) { + device_printf(adapter->dev," Using MSI interrupt\n"); + return (msgs); + } + return (0); } /********************************************************************* _______________________________________________ svn-src-stable-8@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 22:03:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD996106566B; Fri, 23 Mar 2012 22:03:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C84218FC0C; Fri, 23 Mar 2012 22:03:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NM3kQb096133; Fri, 23 Mar 2012 22:03:46 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NM3kR8096131; Fri, 23 Mar 2012 22:03:46 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203232203.q2NM3kR8096131@svn.freebsd.org> From: Eitan Adler Date: Fri, 23 Mar 2012 22:03:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233399 - stable/9/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 22:03:47 -0000 Author: eadler Date: Fri Mar 23 22:03:46 2012 New Revision: 233399 URL: http://svn.freebsd.org/changeset/base/233399 Log: MFC r230155: Make man page wording more clear PR: docs/164078 Approved by: cperciva (implicit) Modified: stable/9/lib/libc/sys/setuid.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/setuid.2 ============================================================================== --- stable/9/lib/libc/sys/setuid.2 Fri Mar 23 21:19:07 2012 (r233398) +++ stable/9/lib/libc/sys/setuid.2 Fri Mar 23 22:03:46 2012 (r233399) @@ -170,7 +170,7 @@ potentially sensitive data. .Pp To prevent these files from remaining open after an .Xr exec 3 -call, be sure to set the close-on-exec flag is set: +call, be sure to set the close-on-exec flag: .Bd -literal void pseudocode(void) From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 22:52:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CF3F1065670; Fri, 23 Mar 2012 22:52:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 481ED8FC14; Fri, 23 Mar 2012 22:52:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NMqOhN097627; Fri, 23 Mar 2012 22:52:24 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NMqOKo097625; Fri, 23 Mar 2012 22:52:24 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203232252.q2NMqOKo097625@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 22:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233400 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 22:52:24 -0000 Author: gonzo Date: Fri Mar 23 22:52:23 2012 New Revision: 233400 URL: http://svn.freebsd.org/changeset/base/233400 Log: Add define for MIPS.options Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri Mar 23 22:03:46 2012 (r233399) +++ head/sys/sys/elf_common.h Fri Mar 23 22:52:23 2012 (r233400) @@ -296,6 +296,7 @@ typedef struct { #define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ #define SHT_LOPROC 0x70000000 /* reserved range for processor */ #define SHT_AMD64_UNWIND 0x70000001 /* unwind information */ +#define SHT_MIPS_OPTIONS 0x7000000d #define SHT_MIPS_DWARF 0x7000001e /* MIPS gcc uses MIPS_DWARF */ #define SHT_HIPROC 0x7fffffff /* specific section header types */ #define SHT_LOUSER 0x80000000 /* reserved range for application */ From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 22:55:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 608FB106566C; Fri, 23 Mar 2012 22:55:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D3DA8FC15; Fri, 23 Mar 2012 22:55:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NMtcR9097827; Fri, 23 Mar 2012 22:55:38 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NMtcqZ097825; Fri, 23 Mar 2012 22:55:38 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203232255.q2NMtcqZ097825@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 22:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233401 - head/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 22:55:38 -0000 Author: gonzo Date: Fri Mar 23 22:55:37 2012 New Revision: 233401 URL: http://svn.freebsd.org/changeset/base/233401 Log: Add handler for MIPS.options section Modified: head/lib/libelf/libelf_data.c Modified: head/lib/libelf/libelf_data.c ============================================================================== --- head/lib/libelf/libelf_data.c Fri Mar 23 22:52:23 2012 (r233400) +++ head/lib/libelf/libelf_data.c Fri Mar 23 22:55:37 2012 (r233401) @@ -86,6 +86,8 @@ _libelf_xlate_shtype(uint32_t sht) #endif case SHT_MIPS_DWARF: /* FALLTHROUGH */ + case SHT_MIPS_OPTIONS: + /* FALLTHROUGH */ case SHT_AMD64_UNWIND: /* == SHT_IA_64_UNWIND */ return (ELF_T_BYTE); default: From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 23:07:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1FF971065670; Fri, 23 Mar 2012 23:07:03 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BFF58FC17; Fri, 23 Mar 2012 23:07:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NN722g098217; Fri, 23 Mar 2012 23:07:02 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NN727v098214; Fri, 23 Mar 2012 23:07:02 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203232307.q2NN727v098214@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Mar 2012 23:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233402 - head/lib/libproc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 23:07:03 -0000 Author: gonzo Date: Fri Mar 23 23:07:02 2012 New Revision: 233402 URL: http://svn.freebsd.org/changeset/base/233402 Log: Make libproc compilable for MIPS 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 Fri Mar 23 22:55:37 2012 (r233401) +++ head/lib/libproc/proc_bkpt.c Fri Mar 23 23:07:02 2012 (r233402) @@ -44,6 +44,9 @@ __FBSDID("$FreeBSD$"); #if defined(__i386__) || defined(__amd64__) #define BREAKPOINT_INSTR 0xcc /* int 0x3 */ #define BREAKPOINT_INSTR_SZ 1 +#elif defined(__mips__) +#define BREAKPOINT_INSTR 0xd /* break */ +#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 Fri Mar 23 22:55:37 2012 (r233401) +++ head/lib/libproc/proc_regs.c Fri Mar 23 23:07:02 2012 (r233402) @@ -58,6 +58,8 @@ proc_regget(struct proc_handle *phdl, pr *regvalue = regs.r_rip; #elif defined(__i386__) *regvalue = regs.r_eip; +#elif defined(__mips__) + *regvalue = regs.r_regs[PC]; #endif break; case REG_SP: @@ -65,6 +67,8 @@ proc_regget(struct proc_handle *phdl, pr *regvalue = regs.r_rsp; #elif defined(__i386__) *regvalue = regs.r_esp; +#elif defined(__mips__) + *regvalue = regs.r_regs[SP]; #endif break; default: @@ -93,6 +97,8 @@ proc_regset(struct proc_handle *phdl, pr regs.r_rip = regvalue; #elif defined(__i386__) regs.r_eip = regvalue; +#elif defined(__mips__) + regs.r_regs[PC] = regvalue; #endif break; case REG_SP: @@ -100,6 +106,8 @@ proc_regset(struct proc_handle *phdl, pr regs.r_rsp = regvalue; #elif defined(__i386__) regs.r_esp = regvalue; +#elif defined(__mips__) + regs.r_regs[PC] = regvalue; #endif break; default: From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 23:40:00 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE447106564A; Fri, 23 Mar 2012 23:40:00 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id 467C28FC18; Fri, 23 Mar 2012 23:39:59 +0000 (UTC) Received: from [192.168.0.2] (cpc1-cwma8-2-0-cust257.7-3.cable.virginmedia.com [82.20.153.2]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id q2NNdofK038880 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 23 Mar 2012 23:39:53 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <20120323211038.GR2358@deviant.kiev.zoral.com.ua> Date: Fri, 23 Mar 2012 23:39:44 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <9FDB5808-2EE9-4F38-86E6-D0C115E7677C@FreeBSD.org> References: <201203232010.q2NKAuIE092217@svn.freebsd.org> <20120323202335.GM2358@deviant.kiev.zoral.com.ua> <20120323164922.0bac354e@kan.dyndns.org> <20120323211038.GR2358@deviant.kiev.zoral.com.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Alexander Kabaev Subject: Re: svn commit: r233391 - head/contrib/libstdc++/libsupc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 23:40:00 -0000 On 23 Mar 2012, at 21:10, Konstantin Belousov wrote: > The patch just committed made the base-shipped library incompatible > with the ports and manual libstdc++ builds. To clarify - the one shipped in the base system has been incompatible = with the one in ports since late 2007... In future, however, we will want libstdc++ in ports to be using the = system ABI library (e.g. libcxxrt) so that it can be linked with = libraries using the system C++ stack, so the layout of std::type_info in = its headers doesn't matter too much because it won't be used. > I think it is wiser to > not 'undo the undo', and instead start living with the = upstream-approved > ABI. For symvered library, it does not make any difference if you = break it > in 10.0 or 9.1. Not true. The vtable layout can not be symbol versioned effectively. = The std::type_info class is required by the ABI to exist (and is in = libsupc++ / libcxxrt, so is independent of our STL implementation, = either libstdc++ or libc++). Users expect to be able to cast=20 > Also, I think that consumers that depend of the ABI of std::typeinfo = can > be hacked to understand the layout of vtable. Supporting both layouts is not really tenable. We need to do one of the = following: - Say 'we are going to break this now!' and force people to recompile = libsupc++, libcxxrt, and libobjc2. - Keep the layout that we currently ship and patch in ports. I don't mind which of these we do since I'm not the one that has to do = the work in ensuring compatibility with ports but it will need to pick = one and then stick to it... > I doubt that there are > many users that utilize typeinfo. Yes, to my knowledge there are three, and two of them are me :-( David= From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 00:30:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2D0171065675; Sat, 24 Mar 2012 00:30:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 176758FC08; Sat, 24 Mar 2012 00:30:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O0UHjZ001356; Sat, 24 Mar 2012 00:30:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O0UHxK001353; Sat, 24 Mar 2012 00:30:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203240030.q2O0UHxK001353@svn.freebsd.org> From: Marius Strobl Date: Sat, 24 Mar 2012 00:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233403 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 00:30:18 -0000 Author: marius Date: Sat Mar 24 00:30:17 2012 New Revision: 233403 URL: http://svn.freebsd.org/changeset/base/233403 Log: - Use the PCI ID macros from mpi_cnfg.h rather than duplicating them here. Note that this driver additionally probes some device IDs for the most part not know to other MPT drivers, if at all. So rename the macros not present in mpi_cnfg.h to match the naming scheme in the latter and but suffix them with a _FB in order to not cause conflicts. - Like mpt_set_config_regs(), comment out mpt_read_config_regs() as the content of the registers read isn't actually used and both functions aren't exactly up to date regarding the possible layouts of the BARs (these function might be helpful for debugging though, so don't remove them completely). - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. - Remove an unusual check for the softc being NULL. - Remove redundant zeroing of the softc. - Remove an overly banal and actually partly incorrect as well as partly outdated comment regarding the allocation of the memory resource. MFC after: 3 days Modified: head/sys/dev/mpt/mpt.h head/sys/dev/mpt/mpt_pci.c Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Fri Mar 23 23:07:02 2012 (r233402) +++ head/sys/dev/mpt/mpt.h Sat Mar 24 00:30:17 2012 (r233403) @@ -716,7 +716,9 @@ struct mpt_softc { int pci_msi_count; struct resource * pci_irq; /* Interrupt map for chip */ void * ih; /* Interrupt handle */ +#if 0 struct mpt_pci_cfg pci_cfg; /* saved PCI conf registers */ +#endif /* * DMA Mapping Stuff Modified: head/sys/dev/mpt/mpt_pci.c ============================================================================== --- head/sys/dev/mpt/mpt_pci.c Fri Mar 23 23:07:02 2012 (r233402) +++ head/sys/dev/mpt/mpt_pci.c Sat Mar 24 00:30:17 2012 (r233403) @@ -105,6 +105,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #if __FreeBSD_version < 700000 #define pci_msix_count(x) 0 #define pci_msi_count(x) 0 @@ -113,104 +115,36 @@ __FBSDID("$FreeBSD$"); #define pci_release_msi(x) do { ; } while (0) #endif -#ifndef PCI_VENDOR_LSI -#define PCI_VENDOR_LSI 0x1000 -#endif - -#ifndef PCI_PRODUCT_LSI_FC909 -#define PCI_PRODUCT_LSI_FC909 0x0620 -#endif - -#ifndef PCI_PRODUCT_LSI_FC909A -#define PCI_PRODUCT_LSI_FC909A 0x0621 -#endif - -#ifndef PCI_PRODUCT_LSI_FC919 -#define PCI_PRODUCT_LSI_FC919 0x0624 -#endif - -#ifndef PCI_PRODUCT_LSI_FC919_LAN -#define PCI_PRODUCT_LSI_FC919_LAN 0x0625 -#endif - -#ifndef PCI_PRODUCT_LSI_FC929 -#define PCI_PRODUCT_LSI_FC929 0x0622 -#endif - -#ifndef PCI_PRODUCT_LSI_FC929_LAN -#define PCI_PRODUCT_LSI_FC929_LAN 0x0623 -#endif - -#ifndef PCI_PRODUCT_LSI_FC929X -#define PCI_PRODUCT_LSI_FC929X 0x0626 -#endif - -#ifndef PCI_PRODUCT_LSI_FC929X_LAN -#define PCI_PRODUCT_LSI_FC929X_LAN 0x0627 -#endif - -#ifndef PCI_PRODUCT_LSI_FC919X -#define PCI_PRODUCT_LSI_FC919X 0x0628 -#endif - -#ifndef PCI_PRODUCT_LSI_FC919X_LAN -#define PCI_PRODUCT_LSI_FC919X_LAN 0x0629 -#endif - -#ifndef PCI_PRODUCT_LSI_FC7X04X -#define PCI_PRODUCT_LSI_FC7X04X 0x0640 -#endif - -#ifndef PCI_PRODUCT_LSI_FC646 -#define PCI_PRODUCT_LSI_FC646 0x0646 -#endif - -#ifndef PCI_PRODUCT_LSI_1030 -#define PCI_PRODUCT_LSI_1030 0x0030 -#endif - -#ifndef PCI_PRODUCT_LSI_1030ZC -#define PCI_PRODUCT_LSI_1030ZC 0x0031 -#endif - -#ifndef PCI_PRODUCT_LSI_SAS1064 -#define PCI_PRODUCT_LSI_SAS1064 0x0050 -#endif - -#ifndef PCI_PRODUCT_LSI_SAS1064A -#define PCI_PRODUCT_LSI_SAS1064A 0x005C -#endif - -#ifndef PCI_PRODUCT_LSI_SAS1064E -#define PCI_PRODUCT_LSI_SAS1064E 0x0056 -#endif +/* + * XXX it seems no other MPT driver knows about the following chips. + */ -#ifndef PCI_PRODUCT_LSI_SAS1066 -#define PCI_PRODUCT_LSI_SAS1066 0x005E +#ifndef MPI_MANUFACTPAGE_DEVICEID_FC909_FB +#define MPI_MANUFACTPAGE_DEVICEID_FC909_FB 0x0620 #endif -#ifndef PCI_PRODUCT_LSI_SAS1066E -#define PCI_PRODUCT_LSI_SAS1066E 0x005A +#ifndef MPI_MANUFACTPAGE_DEVICEID_FC919_LAN_FB +#define MPI_MANUFACTPAGE_DEVICEID_FC919_LAN_FB 0x0625 #endif -#ifndef PCI_PRODUCT_LSI_SAS1068 -#define PCI_PRODUCT_LSI_SAS1068 0x0054 +#ifndef MPI_MANUFACTPAGE_DEVICEID_FC929_LAN_FB +#define MPI_MANUFACTPAGE_DEVICEID_FC929_LAN_FB 0x0623 #endif -#ifndef PCI_PRODUCT_LSI_SAS1068A -#define PCI_PRODUCT_LSI_SAS1068A 0x0055 +#ifndef MPI_MANUFACTPAGE_DEVICEID_FC929X_LAN_FB +#define MPI_MANUFACTPAGE_DEVICEID_FC929X_LAN_FB 0x0627 #endif -#ifndef PCI_PRODUCT_LSI_SAS1068E -#define PCI_PRODUCT_LSI_SAS1068E 0x0058 +#ifndef MPI_MANUFACTPAGE_DEVICEID_FC919X_LAN_FB +#define MPI_MANUFACTPAGE_DEVICEID_FC919X_LAN_FB 0x0629 #endif -#ifndef PCI_PRODUCT_LSI_SAS1078 -#define PCI_PRODUCT_LSI_SAS1078 0x0062 +#ifndef MPI_MANUFACTPAGE_DEVID_SAS1068A_FB +#define MPI_MANUFACTPAGE_DEVID_SAS1068A_FB 0x0055 #endif -#ifndef PCI_PRODUCT_LSI_SAS1078DE -#define PCI_PRODUCT_LSI_SAS1078DE 0x007C +#ifndef MPI_MANUFACTPAGE_DEVID_SAS1078DE_FB +#define MPI_MANUFACTPAGE_DEVID_SAS1078DE_FB 0x007C #endif #ifndef PCIM_CMD_SERRESPEN @@ -224,8 +158,8 @@ static int mpt_pci_detach(device_t); static int mpt_pci_shutdown(device_t); static int mpt_dma_mem_alloc(struct mpt_softc *mpt); static void mpt_dma_mem_free(struct mpt_softc *mpt); -static void mpt_read_config_regs(struct mpt_softc *mpt); #if 0 +static void mpt_read_config_regs(struct mpt_softc *mpt); static void mpt_set_config_regs(struct mpt_softc *mpt); #endif static void mpt_pci_intr(void *); @@ -236,77 +170,76 @@ static device_method_t mpt_methods[] = { DEVMETHOD(device_attach, mpt_pci_attach), DEVMETHOD(device_detach, mpt_pci_detach), DEVMETHOD(device_shutdown, mpt_pci_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t mpt_driver = { "mpt", mpt_methods, sizeof(struct mpt_softc) }; static devclass_t mpt_devclass; -DRIVER_MODULE(mpt, pci, mpt_driver, mpt_devclass, 0, 0); +DRIVER_MODULE(mpt, pci, mpt_driver, mpt_devclass, NULL, NULL); MODULE_DEPEND(mpt, pci, 1, 1, 1); MODULE_VERSION(mpt, 1); static int mpt_pci_probe(device_t dev) { - char *desc; + const char *desc; - if (pci_get_vendor(dev) != PCI_VENDOR_LSI) { + if (pci_get_vendor(dev) != MPI_MANUFACTPAGE_VENDORID_LSILOGIC) return (ENXIO); - } switch (pci_get_device(dev)) { - case PCI_PRODUCT_LSI_FC909: + case MPI_MANUFACTPAGE_DEVICEID_FC909_FB: desc = "LSILogic FC909 FC Adapter"; break; - case PCI_PRODUCT_LSI_FC909A: + case MPI_MANUFACTPAGE_DEVICEID_FC909: desc = "LSILogic FC909A FC Adapter"; break; - case PCI_PRODUCT_LSI_FC919: + case MPI_MANUFACTPAGE_DEVICEID_FC919: desc = "LSILogic FC919 FC Adapter"; break; - case PCI_PRODUCT_LSI_FC919_LAN: + case MPI_MANUFACTPAGE_DEVICEID_FC919_LAN_FB: desc = "LSILogic FC919 LAN Adapter"; break; - case PCI_PRODUCT_LSI_FC929: + case MPI_MANUFACTPAGE_DEVICEID_FC929: desc = "Dual LSILogic FC929 FC Adapter"; break; - case PCI_PRODUCT_LSI_FC929_LAN: + case MPI_MANUFACTPAGE_DEVICEID_FC929_LAN_FB: desc = "Dual LSILogic FC929 LAN Adapter"; break; - case PCI_PRODUCT_LSI_FC919X: + case MPI_MANUFACTPAGE_DEVICEID_FC919X: desc = "LSILogic FC919 FC PCI-X Adapter"; break; - case PCI_PRODUCT_LSI_FC919X_LAN: + case MPI_MANUFACTPAGE_DEVICEID_FC919X_LAN_FB: desc = "LSILogic FC919 LAN PCI-X Adapter"; break; - case PCI_PRODUCT_LSI_FC929X: + case MPI_MANUFACTPAGE_DEVICEID_FC929X: desc = "Dual LSILogic FC929X 2Gb/s FC PCI-X Adapter"; break; - case PCI_PRODUCT_LSI_FC929X_LAN: + case MPI_MANUFACTPAGE_DEVICEID_FC929X_LAN_FB: desc = "Dual LSILogic FC929X LAN PCI-X Adapter"; break; - case PCI_PRODUCT_LSI_FC646: + case MPI_MANUFACTPAGE_DEVICEID_FC949E: desc = "Dual LSILogic FC7X04X 4Gb/s FC PCI-Express Adapter"; break; - case PCI_PRODUCT_LSI_FC7X04X: + case MPI_MANUFACTPAGE_DEVICEID_FC949X: desc = "Dual LSILogic FC7X04X 4Gb/s FC PCI-X Adapter"; break; - case PCI_PRODUCT_LSI_1030: - case PCI_PRODUCT_LSI_1030ZC: + case MPI_MANUFACTPAGE_DEVID_53C1030: + case MPI_MANUFACTPAGE_DEVID_53C1030ZC: desc = "LSILogic 1030 Ultra4 Adapter"; break; - case PCI_PRODUCT_LSI_SAS1064: - case PCI_PRODUCT_LSI_SAS1064A: - case PCI_PRODUCT_LSI_SAS1064E: - case PCI_PRODUCT_LSI_SAS1066: - case PCI_PRODUCT_LSI_SAS1066E: - case PCI_PRODUCT_LSI_SAS1068: - case PCI_PRODUCT_LSI_SAS1068A: - case PCI_PRODUCT_LSI_SAS1068E: - case PCI_PRODUCT_LSI_SAS1078: - case PCI_PRODUCT_LSI_SAS1078DE: + case MPI_MANUFACTPAGE_DEVID_SAS1064: + case MPI_MANUFACTPAGE_DEVID_SAS1064A: + case MPI_MANUFACTPAGE_DEVID_SAS1064E: + case MPI_MANUFACTPAGE_DEVID_SAS1066: + case MPI_MANUFACTPAGE_DEVID_SAS1066E: + case MPI_MANUFACTPAGE_DEVID_SAS1068: + case MPI_MANUFACTPAGE_DEVID_SAS1068A_FB: + case MPI_MANUFACTPAGE_DEVID_SAS1068E: + case MPI_MANUFACTPAGE_DEVID_SAS1078: + case MPI_MANUFACTPAGE_DEVID_SAS1078DE_FB: desc = "LSILogic SAS/SATA Adapter"; break; default: @@ -459,40 +392,35 @@ mpt_pci_attach(device_t dev) uint32_t data, cmd; int mpt_io_bar, mpt_mem_bar; - /* Allocate the softc structure */ mpt = (struct mpt_softc*)device_get_softc(dev); - if (mpt == NULL) { - device_printf(dev, "cannot allocate softc\n"); - return (ENOMEM); - } - memset(mpt, 0, sizeof(struct mpt_softc)); + switch (pci_get_device(dev)) { - case PCI_PRODUCT_LSI_FC909: - case PCI_PRODUCT_LSI_FC909A: - case PCI_PRODUCT_LSI_FC919: - case PCI_PRODUCT_LSI_FC919_LAN: - case PCI_PRODUCT_LSI_FC929: - case PCI_PRODUCT_LSI_FC929_LAN: - case PCI_PRODUCT_LSI_FC929X: - case PCI_PRODUCT_LSI_FC929X_LAN: - case PCI_PRODUCT_LSI_FC919X: - case PCI_PRODUCT_LSI_FC919X_LAN: - case PCI_PRODUCT_LSI_FC646: - case PCI_PRODUCT_LSI_FC7X04X: + case MPI_MANUFACTPAGE_DEVICEID_FC909_FB: + case MPI_MANUFACTPAGE_DEVICEID_FC909: + case MPI_MANUFACTPAGE_DEVICEID_FC919: + case MPI_MANUFACTPAGE_DEVICEID_FC919_LAN_FB: + case MPI_MANUFACTPAGE_DEVICEID_FC929: + case MPI_MANUFACTPAGE_DEVICEID_FC929_LAN_FB: + case MPI_MANUFACTPAGE_DEVICEID_FC929X: + case MPI_MANUFACTPAGE_DEVICEID_FC929X_LAN_FB: + case MPI_MANUFACTPAGE_DEVICEID_FC919X: + case MPI_MANUFACTPAGE_DEVICEID_FC919X_LAN_FB: + case MPI_MANUFACTPAGE_DEVICEID_FC949E: + case MPI_MANUFACTPAGE_DEVICEID_FC949X: mpt->is_fc = 1; break; - case PCI_PRODUCT_LSI_SAS1078: - case PCI_PRODUCT_LSI_SAS1078DE: + case MPI_MANUFACTPAGE_DEVID_SAS1078: + case MPI_MANUFACTPAGE_DEVID_SAS1078DE_FB: mpt->is_1078 = 1; /* FALLTHROUGH */ - case PCI_PRODUCT_LSI_SAS1064: - case PCI_PRODUCT_LSI_SAS1064A: - case PCI_PRODUCT_LSI_SAS1064E: - case PCI_PRODUCT_LSI_SAS1066: - case PCI_PRODUCT_LSI_SAS1066E: - case PCI_PRODUCT_LSI_SAS1068: - case PCI_PRODUCT_LSI_SAS1068A: - case PCI_PRODUCT_LSI_SAS1068E: + case MPI_MANUFACTPAGE_DEVID_SAS1064: + case MPI_MANUFACTPAGE_DEVID_SAS1064A: + case MPI_MANUFACTPAGE_DEVID_SAS1064E: + case MPI_MANUFACTPAGE_DEVID_SAS1066: + case MPI_MANUFACTPAGE_DEVID_SAS1066E: + case MPI_MANUFACTPAGE_DEVID_SAS1068: + case MPI_MANUFACTPAGE_DEVID_SAS1068A_FB: + case MPI_MANUFACTPAGE_DEVID_SAS1068E: mpt->is_sas = 1; break; default: @@ -544,12 +472,12 @@ mpt_pci_attach(device_t dev) * If so, link with our partner (around yet) */ switch (pci_get_device(dev)) { - case PCI_PRODUCT_LSI_FC929: - case PCI_PRODUCT_LSI_FC929_LAN: - case PCI_PRODUCT_LSI_FC646: - case PCI_PRODUCT_LSI_FC7X04X: - case PCI_PRODUCT_LSI_1030: - case PCI_PRODUCT_LSI_1030ZC: + case MPI_MANUFACTPAGE_DEVICEID_FC929: + case MPI_MANUFACTPAGE_DEVICEID_FC929_LAN_FB: + case MPI_MANUFACTPAGE_DEVICEID_FC949E: + case MPI_MANUFACTPAGE_DEVICEID_FC949X: + case MPI_MANUFACTPAGE_DEVID_53C1030: + case MPI_MANUFACTPAGE_DEVID_53C1030ZC: mpt_link_peer(mpt); break; default: @@ -588,7 +516,6 @@ mpt_pci_attach(device_t dev) mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); } - /* Allocate kernel virtual memory for the 9x9's Mem0 region */ mpt_mem_bar = PCIR_BAR(mpt_mem_bar); mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mpt_mem_bar, RF_ACTIVE); @@ -660,6 +587,7 @@ mpt_pci_attach(device_t dev) goto bad; } +#if 0 /* * Save the PCI config register values * @@ -671,6 +599,7 @@ mpt_pci_attach(device_t dev) */ mpt_read_config_regs(mpt); +#endif /* * Disable PIO until we need it @@ -888,6 +817,7 @@ mpt_dma_mem_free(struct mpt_softc *mpt) mpt->request_pool = NULL; } +#if 0 /* Reads modifiable (via PCI transactions) config registers */ static void mpt_read_config_regs(struct mpt_softc *mpt) @@ -906,7 +836,6 @@ mpt_read_config_regs(struct mpt_softc *m mpt->pci_cfg.PMCSR = pci_read_config(mpt->dev, 0x44, 4); } -#if 0 /* Sets modifiable config registers */ static void mpt_set_config_regs(struct mpt_softc *mpt) From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 00:37:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AFB1106564A; Sat, 24 Mar 2012 00:37:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56B258FC0A; Sat, 24 Mar 2012 00:37:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O0bvWB001687; Sat, 24 Mar 2012 00:37:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O0bvIE001685; Sat, 24 Mar 2012 00:37:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203240037.q2O0bvIE001685@svn.freebsd.org> From: Marius Strobl Date: Sat, 24 Mar 2012 00:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233404 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 00:37:57 -0000 Author: marius Date: Sat Mar 24 00:37:56 2012 New Revision: 233404 URL: http://svn.freebsd.org/changeset/base/233404 Log: As it turns out, mpi_cnfg.h already is included by mpt.h. Modified: head/sys/dev/mpt/mpt_pci.c Modified: head/sys/dev/mpt/mpt_pci.c ============================================================================== --- head/sys/dev/mpt/mpt_pci.c Sat Mar 24 00:30:17 2012 (r233403) +++ head/sys/dev/mpt/mpt_pci.c Sat Mar 24 00:37:56 2012 (r233404) @@ -105,8 +105,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #if __FreeBSD_version < 700000 #define pci_msix_count(x) 0 #define pci_msi_count(x) 0 From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 00:42:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70C85106564A; Sat, 24 Mar 2012 00:42:39 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C66F8FC16; Sat, 24 Mar 2012 00:42:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O0gdQ0001898; Sat, 24 Mar 2012 00:42:39 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O0gdDg001896; Sat, 24 Mar 2012 00:42:39 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201203240042.q2O0gdDg001896@svn.freebsd.org> From: Stanislav Sedov Date: Sat, 24 Mar 2012 00:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233405 - head/kerberos5/lib/libkafs5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 00:42:39 -0000 Author: stas Date: Sat Mar 24 00:42:38 2012 New Revision: 233405 URL: http://svn.freebsd.org/changeset/base/233405 Log: - Apply binutils workaround on mips.mips as well. Though this TARGET_ARCH is deprecated, tinderbox uses it. Modified: head/kerberos5/lib/libkafs5/Makefile Modified: head/kerberos5/lib/libkafs5/Makefile ============================================================================== --- head/kerberos5/lib/libkafs5/Makefile Sat Mar 24 00:37:56 2012 (r233404) +++ head/kerberos5/lib/libkafs5/Makefile Sat Mar 24 00:42:38 2012 (r233405) @@ -10,7 +10,8 @@ MAN= kafs5.3 # Linking with libkrb5 uncovers a bug in binutils. # See http://repo.or.cz/w/binutils.git/commit/ee05170bf71819c99cb5a36a44735c231ae03c56 . # -.if ${MACHINE_ARCH} != "mipsn32eb" && ${MACHINE_ARCH} != "mipsel" && ${MACHINE_ARCH} != "mipseb" +.if ${MACHINE_ARCH} != "mipsn32eb" && ${MACHINE_ARCH} != "mipsel" && \ + ${MACHINE_ARCH} != "mipseb" && ${MACHINE_ARCH} != "mips" LDADD+= -lkrb5 LDFLAGS= -Wl,--no-undefined .endif From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 01:02:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05110106566B; Sat, 24 Mar 2012 01:02:04 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D96608FC18; Sat, 24 Mar 2012 01:02:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O123b8002763; Sat, 24 Mar 2012 01:02:03 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O123x3002760; Sat, 24 Mar 2012 01:02:03 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201203240102.q2O123x3002760@svn.freebsd.org> From: Stanislav Sedov Date: Sat, 24 Mar 2012 01:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233406 - head/lib/libpam/modules/pam_krb5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 01:02:04 -0000 Author: stas Date: Sat Mar 24 01:02:03 2012 New Revision: 233406 URL: http://svn.freebsd.org/changeset/base/233406 Log: - Avoid using deprecated heimdal functions in pam_krb5. Modified: head/lib/libpam/modules/pam_krb5/Makefile head/lib/libpam/modules/pam_krb5/pam_krb5.c Modified: head/lib/libpam/modules/pam_krb5/Makefile ============================================================================== --- head/lib/libpam/modules/pam_krb5/Makefile Sat Mar 24 00:42:38 2012 (r233405) +++ head/lib/libpam/modules/pam_krb5/Makefile Sat Mar 24 01:02:03 2012 (r233406) @@ -32,8 +32,6 @@ CFLAGS+=-D_FREEFALL_CONFIG WARNS?= 3 .endif -NO_WERROR= yes - DPADD= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO} LDADD= -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto Modified: head/lib/libpam/modules/pam_krb5/pam_krb5.c ============================================================================== --- head/lib/libpam/modules/pam_krb5/pam_krb5.c Sat Mar 24 00:42:38 2012 (r233405) +++ head/lib/libpam/modules/pam_krb5/pam_krb5.c Sat Mar 24 01:02:03 2012 (r233406) @@ -92,6 +92,13 @@ static void compat_free_data_contents(kr #define PAM_OPT_NO_USER_CHECK "no_user_check" #define PAM_OPT_REUSE_CCACHE "reuse_ccache" +#define PAM_LOG_KRB5_ERR(ctx, rv, fmt, ...) \ + do { \ + const char *krb5msg = krb5_get_error_message(ctx, rv); \ + PAM_LOG(fmt ": %s", ##__VA_ARGS__, krb5msg); \ + krb5_free_error_message(ctx, krb5msg); \ + } while (0) + /* * authentication management */ @@ -104,7 +111,7 @@ pam_sm_authenticate(pam_handle_t *pamh, krb5_creds creds; krb5_principal princ; krb5_ccache ccache; - krb5_get_init_creds_opt opts; + krb5_get_init_creds_opt *opts; struct passwd *pwd; int retval; const void *ccache_data; @@ -139,13 +146,6 @@ pam_sm_authenticate(pam_handle_t *pamh, PAM_LOG("Context initialised"); - krb5_get_init_creds_opt_init(&opts); - - if (openpam_get_option(pamh, PAM_OPT_FORWARDABLE)) - krb5_get_init_creds_opt_set_forwardable(&opts, 1); - - PAM_LOG("Credentials initialised"); - krbret = krb5_cc_register(pam_context, &krb5_mcc_ops, FALSE); if (krbret != 0 && krbret != KRB5_CC_TYPE_EXISTS) { PAM_VERBOSE_ERROR("Kerberos 5 error"); @@ -166,8 +166,7 @@ pam_sm_authenticate(pam_handle_t *pamh, krbret = krb5_parse_name(pam_context, principal, &princ); free(principal); if (krbret != 0) { - PAM_LOG("Error krb5_parse_name(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, "Error krb5_parse_name()"); PAM_VERBOSE_ERROR("Kerberos 5 error"); retval = PAM_SERVICE_ERR; goto cleanup3; @@ -179,8 +178,8 @@ pam_sm_authenticate(pam_handle_t *pamh, princ_name = NULL; krbret = krb5_unparse_name(pam_context, princ, &princ_name); if (krbret != 0) { - PAM_LOG("Error krb5_unparse_name(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_unparse_name()"); PAM_VERBOSE_ERROR("Kerberos 5 error"); retval = PAM_SERVICE_ERR; goto cleanup2; @@ -206,8 +205,8 @@ pam_sm_authenticate(pam_handle_t *pamh, sizeof(luser), luser); if (krbret != 0) { PAM_VERBOSE_ERROR("Kerberos 5 error"); - PAM_LOG("Error krb5_aname_to_localname(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_aname_to_localname()"); retval = PAM_USER_UNKNOWN; goto cleanup2; } @@ -228,14 +227,30 @@ pam_sm_authenticate(pam_handle_t *pamh, PAM_LOG("Done getpwnam()"); } + /* Initialize credentials request options. */ + krbret = krb5_get_init_creds_opt_alloc(pam_context, &opts); + if (krbret != 0) { + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_get_init_creds_opt_alloc()"); + PAM_VERBOSE_ERROR("Kerberos 5 error"); + retval = PAM_SERVICE_ERR; + goto cleanup2; + } + + if (openpam_get_option(pamh, PAM_OPT_FORWARDABLE)) + krb5_get_init_creds_opt_set_forwardable(opts, 1); + + PAM_LOG("Credential options initialised"); + /* Get a TGT */ memset(&creds, 0, sizeof(krb5_creds)); krbret = krb5_get_init_creds_password(pam_context, &creds, princ, - pass, NULL, pamh, 0, NULL, &opts); + pass, NULL, pamh, 0, NULL, opts); + krb5_get_init_creds_opt_free(pam_context, opts); if (krbret != 0) { PAM_VERBOSE_ERROR("Kerberos 5 error"); - PAM_LOG("Error krb5_get_init_creds_password(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_get_init_creds_password()"); retval = PAM_AUTH_ERR; goto cleanup2; } @@ -243,27 +258,27 @@ pam_sm_authenticate(pam_handle_t *pamh, PAM_LOG("Got TGT"); /* Generate a temporary cache */ - krbret = krb5_cc_gen_new(pam_context, &krb5_mcc_ops, &ccache); + krbret = krb5_cc_new_unique(pam_context, krb5_cc_type_memory, NULL, &ccache); if (krbret != 0) { PAM_VERBOSE_ERROR("Kerberos 5 error"); - PAM_LOG("Error krb5_cc_gen_new(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_cc_new_unique()"); retval = PAM_SERVICE_ERR; goto cleanup; } krbret = krb5_cc_initialize(pam_context, ccache, princ); if (krbret != 0) { PAM_VERBOSE_ERROR("Kerberos 5 error"); - PAM_LOG("Error krb5_cc_initialize(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_cc_initialize()"); retval = PAM_SERVICE_ERR; goto cleanup; } krbret = krb5_cc_store_cred(pam_context, ccache, &creds); if (krbret != 0) { PAM_VERBOSE_ERROR("Kerberos 5 error"); - PAM_LOG("Error krb5_cc_store_cred(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_cc_store_cred()"); krb5_cc_destroy(pam_context, ccache); retval = PAM_SERVICE_ERR; goto cleanup; @@ -406,8 +421,8 @@ pam_sm_setcred(pam_handle_t *pamh, int f } krbret = krb5_cc_resolve(pam_context, cache_data, &ccache_temp); if (krbret != 0) { - PAM_LOG("Error krb5_cc_resolve(\"%s\"): %s", (const char *)cache_data, - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_cc_resolve(\"%s\")", (const char *)cache_data); retval = PAM_SERVICE_ERR; goto cleanup3; } @@ -479,22 +494,21 @@ pam_sm_setcred(pam_handle_t *pamh, int f /* Initialize the new ccache */ krbret = krb5_cc_get_principal(pam_context, ccache_temp, &princ); if (krbret != 0) { - PAM_LOG("Error krb5_cc_get_principal(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_cc_get_principal()"); retval = PAM_SERVICE_ERR; goto cleanup3; } krbret = krb5_cc_resolve(pam_context, cache_name, &ccache_perm); if (krbret != 0) { - PAM_LOG("Error krb5_cc_resolve(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, "Error krb5_cc_resolve()"); retval = PAM_SERVICE_ERR; goto cleanup2; } krbret = krb5_cc_initialize(pam_context, ccache_perm, princ); if (krbret != 0) { - PAM_LOG("Error krb5_cc_initialize(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_cc_initialize()"); retval = PAM_SERVICE_ERR; goto cleanup2; } @@ -504,8 +518,8 @@ pam_sm_setcred(pam_handle_t *pamh, int f /* Prepare for iteration over creds */ krbret = krb5_cc_start_seq_get(pam_context, ccache_temp, &cursor); if (krbret != 0) { - PAM_LOG("Error krb5_cc_start_seq_get(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_cc_start_seq_get()"); krb5_cc_destroy(pam_context, ccache_perm); retval = PAM_SERVICE_ERR; goto cleanup2; @@ -518,8 +532,8 @@ pam_sm_setcred(pam_handle_t *pamh, int f &cursor, &creds) == 0)) { krbret = krb5_cc_store_cred(pam_context, ccache_perm, &creds); if (krbret != 0) { - PAM_LOG("Error krb5_cc_store_cred(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_cc_store_cred()"); krb5_cc_destroy(pam_context, ccache_perm); krb5_free_cred_contents(pam_context, &creds); retval = PAM_SERVICE_ERR; @@ -620,8 +634,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int krbret = krb5_cc_resolve(pam_context, (const char *)ccache_name, &ccache); if (krbret != 0) { - PAM_LOG("Error krb5_cc_resolve(\"%s\"): %s", (const char *)ccache_name, - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_cc_resolve(\"%s\")", (const char *)ccache_name); krb5_free_context(pam_context); return (PAM_PERM_DENIED); } @@ -631,8 +645,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int krbret = krb5_cc_get_principal(pam_context, ccache, &princ); if (krbret != 0) { - PAM_LOG("Error krb5_cc_get_principal(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_cc_get_principal()"); retval = PAM_PERM_DENIED;; goto cleanup; } @@ -666,7 +680,7 @@ pam_sm_chauthtok(pam_handle_t *pamh, int krb5_context pam_context; krb5_creds creds; krb5_principal princ; - krb5_get_init_creds_opt opts; + krb5_get_init_creds_opt *opts; krb5_data result_code_string, result_string; int result_code, retval; const char *pass; @@ -690,15 +704,11 @@ pam_sm_chauthtok(pam_handle_t *pamh, int PAM_LOG("Context initialised"); - krb5_get_init_creds_opt_init(&opts); - - PAM_LOG("Credentials options initialised"); - /* Get principal name */ krbret = krb5_parse_name(pam_context, (const char *)user, &princ); if (krbret != 0) { - PAM_LOG("Error krb5_parse_name(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_parse_name()"); retval = PAM_USER_UNKNOWN; goto cleanup3; } @@ -707,8 +717,8 @@ pam_sm_chauthtok(pam_handle_t *pamh, int princ_name = NULL; krbret = krb5_unparse_name(pam_context, princ, &princ_name); if (krbret != 0) { - PAM_LOG("Error krb5_unparse_name(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_unparse_name()"); retval = PAM_SERVICE_ERR; goto cleanup2; } @@ -722,12 +732,25 @@ pam_sm_chauthtok(pam_handle_t *pamh, int PAM_LOG("Got password"); + /* Initialize credentials request options. */ + krbret = krb5_get_init_creds_opt_alloc(pam_context, &opts); + if (krbret != 0) { + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_get_init_creds_opt_alloc()"); + PAM_VERBOSE_ERROR("Kerberos 5 error"); + retval = PAM_SERVICE_ERR; + goto cleanup2; + } + + PAM_LOG("Credentials options initialised"); + memset(&creds, 0, sizeof(krb5_creds)); krbret = krb5_get_init_creds_password(pam_context, &creds, princ, - pass, NULL, pamh, 0, "kadmin/changepw", &opts); + pass, NULL, pamh, 0, "kadmin/changepw", opts); + krb5_get_init_creds_opt_free(pam_context, opts); if (krbret != 0) { - PAM_LOG("Error krb5_get_init_creds_password(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_get_init_creds_password()"); retval = PAM_AUTH_ERR; goto cleanup2; } @@ -752,12 +775,12 @@ pam_sm_chauthtok(pam_handle_t *pamh, int retval = PAM_BUF_ERR; goto cleanup; } - krbret = krb5_change_password(pam_context, &creds, passdup, + krbret = krb5_set_password(pam_context, &creds, passdup, NULL, &result_code, &result_code_string, &result_string); free(passdup); if (krbret != 0) { - PAM_LOG("Error krb5_change_password(): %s", - krb5_get_err_text(pam_context, krbret)); + PAM_LOG_KRB5_ERR(pam_context, krbret, + "Error krb5_change_password()"); retval = PAM_AUTHTOK_ERR; goto cleanup; } @@ -840,11 +863,14 @@ verify_krb_v5_tgt(krb5_context context, retval = krb5_sname_to_principal(context, NULL, *service, KRB5_NT_SRV_HST, &princ); if (retval != 0) { - if (debug) + if (debug) { + const char *msg = krb5_get_error_message( + context, retval); syslog(LOG_DEBUG, "pam_krb5: verify_krb_v5_tgt(): %s: %s", - "krb5_sname_to_principal()", - krb5_get_err_text(context, retval)); + "krb5_sname_to_principal()", msg); + krb5_free_error_message(context, msg); + } return -1; } @@ -866,11 +892,14 @@ verify_krb_v5_tgt(krb5_context context, } if (retval != 0) { /* failed to find key */ /* Keytab or service key does not exist */ - if (debug) + if (debug) { + const char *msg = krb5_get_error_message(context, + retval); syslog(LOG_DEBUG, "pam_krb5: verify_krb_v5_tgt(): %s: %s", - "krb5_kt_read_service_key()", - krb5_get_err_text(context, retval)); + "krb5_kt_read_service_key()", msg); + krb5_free_error_message(context, msg); + } retval = 0; goto cleanup; } @@ -886,11 +915,14 @@ verify_krb_v5_tgt(krb5_context context, auth_context = NULL; /* setup for rd_req */ } if (retval) { - if (debug) + if (debug) { + const char *msg = krb5_get_error_message(context, + retval); syslog(LOG_DEBUG, "pam_krb5: verify_krb_v5_tgt(): %s: %s", - "krb5_mk_req()", - krb5_get_err_text(context, retval)); + "krb5_mk_req()", msg); + krb5_free_error_message(context, msg); + } retval = -1; goto cleanup; } @@ -899,11 +931,14 @@ verify_krb_v5_tgt(krb5_context context, retval = krb5_rd_req(context, &auth_context, &packet, princ, NULL, NULL, NULL); if (retval) { - if (debug) + if (debug) { + const char *msg = krb5_get_error_message(context, + retval); syslog(LOG_DEBUG, "pam_krb5: verify_krb_v5_tgt(): %s: %s", - "krb5_rd_req()", - krb5_get_err_text(context, retval)); + "krb5_rd_req()", msg); + krb5_free_error_message(context, msg); + } retval = -1; } else From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 01:47:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F414F106564A; Sat, 24 Mar 2012 01:47:33 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D44078FC0A; Sat, 24 Mar 2012 01:47:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O1lX77004487; Sat, 24 Mar 2012 01:47:33 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O1lXiL004482; Sat, 24 Mar 2012 01:47:33 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203240147.q2O1lXiL004482@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 24 Mar 2012 01:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233407 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 01:47:34 -0000 Author: gonzo Date: Sat Mar 24 01:47:33 2012 New Revision: 233407 URL: http://svn.freebsd.org/changeset/base/233407 Log: Maintain target's byte order for multi-byte fields in CTF structures. CTF format is not cross-platform by design, e.g. it is not guaranteed that data generated by ctfconvert/ctfmerge on one architecture will be successfuly read on another. CTF structures are saved/restored using naive approach. Roughly it looks like: write(fd, &ctf_struct, sizeof(ctf_struct)) read(fd, &ctf_struct, sizeof(ctf_struct)) By sheer luck memory layout of all type-related CTF structures is the same on amd64/i386/mips32/mips64. It's different on ARM though. sparc, ia64, powerpc, and powerpc64 were not tested. So in order to get file compatible with dtrace on ARM it should be compiled on ARM. Alternative solution would be to have "signatures" for every platform and ctfmerge should convert host's reperesentation of CTF structure to target's one using "signature" as template. This patch checks byte order of ELF files used for generating CTF record and makes sure that byte order of data written to resulting files is the same as target's byte order. Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Sat Mar 24 01:02:03 2012 (r233406) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Sat Mar 24 01:47:33 2012 (r233407) @@ -62,6 +62,18 @@ struct ctf_buf { int ntholes; /* number of type holes */ }; +/* + * Macros to reverse byte order + */ +#define BSWAP_8(x) ((x) & 0xff) +#define BSWAP_16(x) ((BSWAP_8(x) << 8) | BSWAP_8((x) >> 8)) +#define BSWAP_32(x) ((BSWAP_16(x) << 16) | BSWAP_16((x) >> 16)) + +#define SWAP_16(x) (x) = BSWAP_16(x) +#define SWAP_32(x) (x) = BSWAP_32(x) + +static int target_requires_swap; + /*PRINTFLIKE1*/ static void parseterminate(const char *fmt, ...) @@ -140,6 +152,11 @@ write_label(void *arg1, void *arg2) ctl.ctl_label = strtab_insert(&b->ctb_strtab, le->le_name); ctl.ctl_typeidx = le->le_idx; + if (target_requires_swap) { + SWAP_32(ctl.ctl_label); + SWAP_32(ctl.ctl_typeidx); + } + ctf_buf_write(b, &ctl, sizeof (ctl)); return (1); @@ -152,6 +169,10 @@ write_objects(iidesc_t *idp, ctf_buf_t * ctf_buf_write(b, &id, sizeof (id)); + if (target_requires_swap) { + SWAP_16(id); + } + debug(3, "Wrote object %s (%d)\n", (idp ? idp->ii_name : "(null)"), id); } @@ -180,10 +201,21 @@ write_functions(iidesc_t *idp, ctf_buf_t fdata[0] = CTF_TYPE_INFO(CTF_K_FUNCTION, 1, nargs); fdata[1] = idp->ii_dtype->t_id; + + if (target_requires_swap) { + SWAP_16(fdata[0]); + SWAP_16(fdata[1]); + } + ctf_buf_write(b, fdata, sizeof (fdata)); for (i = 0; i < idp->ii_nargs; i++) { id = idp->ii_args[i]->t_id; + + if (target_requires_swap) { + SWAP_16(id); + } + ctf_buf_write(b, &id, sizeof (id)); } @@ -208,11 +240,25 @@ write_sized_type_rec(ctf_buf_t *b, ctf_t ctt->ctt_size = CTF_LSIZE_SENT; ctt->ctt_lsizehi = CTF_SIZE_TO_LSIZE_HI(size); ctt->ctt_lsizelo = CTF_SIZE_TO_LSIZE_LO(size); + if (target_requires_swap) { + SWAP_32(ctt->ctt_name); + SWAP_16(ctt->ctt_info); + SWAP_16(ctt->ctt_size); + SWAP_32(ctt->ctt_lsizehi); + SWAP_32(ctt->ctt_lsizelo); + } ctf_buf_write(b, ctt, sizeof (*ctt)); } else { ctf_stype_t *cts = (ctf_stype_t *)ctt; cts->ctt_size = (ushort_t)size; + + if (target_requires_swap) { + SWAP_32(cts->ctt_name); + SWAP_16(cts->ctt_info); + SWAP_16(cts->ctt_size); + } + ctf_buf_write(b, cts, sizeof (*cts)); } } @@ -222,6 +268,12 @@ write_unsized_type_rec(ctf_buf_t *b, ctf { ctf_stype_t *cts = (ctf_stype_t *)ctt; + if (target_requires_swap) { + SWAP_32(cts->ctt_name); + SWAP_16(cts->ctt_info); + SWAP_16(cts->ctt_size); + } + ctf_buf_write(b, cts, sizeof (*cts)); } @@ -296,6 +348,9 @@ write_type(void *arg1, void *arg2) encoding = ip->intr_fformat; data = CTF_INT_DATA(encoding, ip->intr_offset, ip->intr_nbits); + if (target_requires_swap) { + SWAP_32(data); + } ctf_buf_write(b, &data, sizeof (data)); break; @@ -312,6 +367,11 @@ write_type(void *arg1, void *arg2) cta.cta_contents = tp->t_ardef->ad_contents->t_id; cta.cta_index = tp->t_ardef->ad_idxtype->t_id; cta.cta_nelems = tp->t_ardef->ad_nelems; + if (target_requires_swap) { + SWAP_16(cta.cta_contents); + SWAP_16(cta.cta_index); + SWAP_32(cta.cta_nelems); + } ctf_buf_write(b, &cta, sizeof (cta)); break; @@ -341,6 +401,11 @@ write_type(void *arg1, void *arg2) offset); ctm.ctm_type = mp->ml_type->t_id; ctm.ctm_offset = mp->ml_offset; + if (target_requires_swap) { + SWAP_32(ctm.ctm_name); + SWAP_16(ctm.ctm_type); + SWAP_16(ctm.ctm_offset); + } ctf_buf_write(b, &ctm, sizeof (ctm)); } } else { @@ -355,6 +420,14 @@ write_type(void *arg1, void *arg2) CTF_OFFSET_TO_LMEMHI(mp->ml_offset); ctlm.ctlm_offsetlo = CTF_OFFSET_TO_LMEMLO(mp->ml_offset); + + if (target_requires_swap) { + SWAP_32(ctlm.ctlm_name); + SWAP_16(ctlm.ctlm_type); + SWAP_32(ctlm.ctlm_offsethi); + SWAP_32(ctlm.ctlm_offsetlo); + } + ctf_buf_write(b, &ctlm, sizeof (ctlm)); } } @@ -377,6 +450,12 @@ write_type(void *arg1, void *arg2) offset = strtab_insert(&b->ctb_strtab, ep->el_name); cte.cte_name = CTF_TYPE_NAME(CTF_STRTAB_0, offset); cte.cte_value = ep->el_number; + + if (target_requires_swap) { + SWAP_32(cte.cte_name); + SWAP_32(cte.cte_value); + } + ctf_buf_write(b, &cte, sizeof (cte)); i--; } @@ -420,6 +499,11 @@ write_type(void *arg1, void *arg2) for (i = 0; i < (int) tp->t_fndef->fn_nargs; i++) { id = tp->t_fndef->fn_args[i]->t_id; + + if (target_requires_swap) { + SWAP_16(id); + } + ctf_buf_write(b, &id, sizeof (id)); } @@ -613,6 +697,9 @@ ctf_gen(iiburst_t *iiburst, size_t *ress int i; + target_requires_swap = do_compress & CTF_SWAP_BYTES; + do_compress &= ~CTF_SWAP_BYTES; + /* * Prepare the header, and create the CTF output buffers. The data * object section and function section are both lists of 2-byte @@ -649,6 +736,18 @@ ctf_gen(iiburst_t *iiburst, size_t *ress h.cth_stroff = ctf_buf_cur(buf); h.cth_strlen = strtab_size(&buf->ctb_strtab); + if (target_requires_swap) { + SWAP_16(h.cth_preamble.ctp_magic); + SWAP_32(h.cth_parlabel); + SWAP_32(h.cth_parname); + SWAP_32(h.cth_lbloff); + SWAP_32(h.cth_objtoff); + SWAP_32(h.cth_funcoff); + SWAP_32(h.cth_typeoff); + SWAP_32(h.cth_stroff); + SWAP_32(h.cth_strlen); + } + /* * We only do compression for ctfmerge, as ctfconvert is only * supposed to be used on intermediary build objects. This is Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c Sat Mar 24 01:02:03 2012 (r233406) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c Sat Mar 24 01:47:33 2012 (r233407) @@ -620,7 +620,7 @@ copy_ctf_data(char *srcfile, char *destf terminate("No CTF data found in source file %s\n", srcfile); tmpname = mktmpname(destfile, ".ctf"); - write_ctf(srctd, destfile, tmpname, CTF_COMPRESS | keep_stabs); + write_ctf(srctd, destfile, tmpname, CTF_COMPRESS | CTF_SWAP_BYTES | keep_stabs); if (rename(tmpname, destfile) != 0) { terminate("Couldn't rename temp file %s to %s", tmpname, destfile); @@ -1015,7 +1015,7 @@ main(int argc, char **argv) tmpname = mktmpname(outfile, ".ctf"); write_ctf(savetd, outfile, tmpname, - CTF_COMPRESS | write_fuzzy_match | dynsym | keep_stabs); + CTF_COMPRESS | CTF_SWAP_BYTES | write_fuzzy_match | dynsym | keep_stabs); if (rename(tmpname, outfile) != 0) terminate("Couldn't rename output temp file %s", tmpname); free(tmpname); Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Sat Mar 24 01:02:03 2012 (r233406) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Sat Mar 24 01:47:33 2012 (r233407) @@ -391,6 +391,7 @@ void merge_into_master(tdata_t *, tdata_ #define CTF_USE_DYNSYM 0x2 /* use .dynsym not .symtab */ #define CTF_COMPRESS 0x4 /* compress CTF output */ #define CTF_KEEP_STABS 0x8 /* keep .stabs sections */ +#define CTF_SWAP_BYTES 0x10 /* target byte order is different from host */ void write_ctf(tdata_t *, const char *, const char *, int); Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Sat Mar 24 01:02:03 2012 (r233406) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Sat Mar 24 01:47:33 2012 (r233407) @@ -717,7 +717,7 @@ make_ctf_data(tdata_t *td, Elf *elf, con iiburst = sort_iidescs(elf, file, td, flags & CTF_FUZZY_MATCH, flags & CTF_USE_DYNSYM); - data = ctf_gen(iiburst, lenp, flags & CTF_COMPRESS); + data = ctf_gen(iiburst, lenp, flags & (CTF_COMPRESS | CTF_SWAP_BYTES)); iiburst_free(iiburst); @@ -730,10 +730,12 @@ write_ctf(tdata_t *td, const char *curna struct stat st; Elf *elf = NULL; Elf *telf = NULL; + GElf_Ehdr ehdr; caddr_t data; size_t len; int fd = -1; int tfd = -1; + int byteorder; (void) elf_version(EV_CURRENT); if ((fd = open(curname, O_RDONLY)) < 0 || fstat(fd, &st) < 0) @@ -746,6 +748,22 @@ write_ctf(tdata_t *td, const char *curna if ((telf = elf_begin(tfd, ELF_C_WRITE, NULL)) == NULL) elfterminate(curname, "Cannot write"); + if (gelf_getehdr(elf, &ehdr)) { +#if BYTE_ORDER == _BIG_ENDIAN + byteorder = ELFDATA2MSB; +#else + byteorder = ELFDATA2LSB; +#endif + /* + * If target and host has the same byte order + * clear byte swapping request + */ + if (ehdr.e_ident[EI_DATA] == byteorder) + flags &= ~CTF_SWAP_BYTES; + } + else + elfterminate(curname, "Failed to get EHDR"); + data = make_ctf_data(td, elf, curname, &len, flags); write_file(elf, curname, telf, newname, data, len, flags); free(data); From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 04:52:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 730841065670; Sat, 24 Mar 2012 04:52:19 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 541E78FC1C; Sat, 24 Mar 2012 04:52:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O4qJh9012854; Sat, 24 Mar 2012 04:52:19 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O4qJNS012850; Sat, 24 Mar 2012 04:52:19 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203240452.q2O4qJNS012850@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 24 Mar 2012 04:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233408 - in head/sys/cddl/contrib/opensolaris/uts: common/dtrace mips mips/dtrace mips/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 04:52:19 -0000 Author: gonzo Date: Sat Mar 24 04:52:18 2012 New Revision: 233408 URL: http://svn.freebsd.org/changeset/base/233408 Log: Add MIPS support to cddl/contrib part: - header and stub .c file for fasttrap module. It's not supported on MIPS yet, but there is no way to disable support completely - Do as amd64 trying to limit allocated memory Added: head/sys/cddl/contrib/opensolaris/uts/mips/ head/sys/cddl/contrib/opensolaris/uts/mips/dtrace/ head/sys/cddl/contrib/opensolaris/uts/mips/dtrace/fasttrap_isa.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/mips/sys/ head/sys/cddl/contrib/opensolaris/uts/mips/sys/fasttrap_isa.h (contents, props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Mar 24 01:47:33 2012 (r233407) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Mar 24 04:52:18 2012 (r233408) @@ -235,7 +235,7 @@ static dtrace_dynvar_t dtrace_dynhash_si static struct mtx dtrace_unr_mtx; MTX_SYSINIT(dtrace_unr_mtx, &dtrace_unr_mtx, "Unique resource identifier", MTX_DEF); int dtrace_in_probe; /* non-zero if executing a probe */ -#if defined(__i386__) || defined(__amd64__) +#if defined(__i386__) || defined(__amd64__) || defined(__mips__) uintptr_t dtrace_in_probe_addr; /* Address of invop when already in probe */ #endif #endif @@ -10659,7 +10659,7 @@ err: #else int i; -#if defined(__amd64__) +#if defined(__amd64__) || defined(__mips__) /* * FreeBSD isn't good at limiting the amount of memory we * ask to malloc, so let's place a limit here before trying Added: head/sys/cddl/contrib/opensolaris/uts/mips/dtrace/fasttrap_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/mips/dtrace/fasttrap_isa.c Sat Mar 24 04:52:18 2012 (r233408) @@ -0,0 +1,30 @@ +/* + * 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 MIPS fasttrap code + */ Added: head/sys/cddl/contrib/opensolaris/uts/mips/sys/fasttrap_isa.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/mips/sys/fasttrap_isa.h Sat Mar 24 04:52:18 2012 (r233408) @@ -0,0 +1,48 @@ +/* + * 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 +/* + * XXXDTRACE: placehodler for MIPS fasttrap stuff + */ + +typedef uint32_t fasttrap_instr_t; +#define FASTTRAP_SUNWDTRACE_SIZE 64 + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_ISA_H */ From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 05:14:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7AE8106566C; Sat, 24 Mar 2012 05:14:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D14508FC0A; Sat, 24 Mar 2012 05:14:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O5EbdO013748; Sat, 24 Mar 2012 05:14:37 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O5EbuF013745; Sat, 24 Mar 2012 05:14:37 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203240514.q2O5EbuF013745@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 24 Mar 2012 05:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233409 - in head/sys/cddl/dev: dtrace/mips lockstat profile X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 05:14:38 -0000 Author: gonzo Date: Sat Mar 24 05:14:37 2012 New Revision: 233409 URL: http://svn.freebsd.org/changeset/base/233409 Log: Add device part of DTrace/MIPS code Added: head/sys/cddl/dev/dtrace/mips/ head/sys/cddl/dev/dtrace/mips/dtrace_asm.S (contents, props changed) head/sys/cddl/dev/dtrace/mips/dtrace_isa.c (contents, props changed) head/sys/cddl/dev/dtrace/mips/dtrace_subr.c (contents, props changed) head/sys/cddl/dev/dtrace/mips/regset.h (contents, props changed) Modified: head/sys/cddl/dev/lockstat/lockstat.c head/sys/cddl/dev/profile/profile.c Added: head/sys/cddl/dev/dtrace/mips/dtrace_asm.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/mips/dtrace_asm.S Sat Mar 24 05:14:37 2012 (r233409) @@ -0,0 +1,303 @@ +/* + * 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 +#define LOCORE + +#include +#include + +#include +#include +#include +#include + +#include "assym.s" + + .set noreorder # Noreorder is default style! + +/* + * Primitives + */ + + .text + +/* +void dtrace_membar_producer(void) +*/ +LEAF(dtrace_membar_producer) + j ra + nop +END(dtrace_membar_producer) + +/* +void dtrace_membar_consumer(void) +*/ +LEAF(dtrace_membar_consumer) + j ra + nop +END(dtrace_membar_consumer) + +/* +dtrace_icookie_t dtrace_interrupt_disable(void) +*/ +LEAF(dtrace_interrupt_disable) + mfc0 t0, MIPS_COP_0_STATUS + move v0, t0 + and v0, v0, MIPS_SR_INT_IE + and t0, t0, ~MIPS_SR_INT_IE + mtc0 t0, MIPS_COP_0_STATUS + j ra + nop +END(dtrace_interrupt_disable) + +/* +void dtrace_interrupt_enable(dtrace_icookie_t cookie) +*/ +LEAF(dtrace_interrupt_enable) + mfc0 t0, MIPS_COP_0_STATUS + beqz a0, not_enabled + or t0, t0, MIPS_SR_INT_IE + mtc0 t0, MIPS_COP_0_STATUS +not_enabled: + j ra + nop +END(dtrace_interrupt_enable) + +/* +uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) +*/ +LEAF(dtrace_cas32) +1: + move t1, a2 + ll t0, 0(a0) + bne t0, a1, 2f + nop + sc t1, 0(a0) + beqz t1, 1b + nop +2: move v0, t0 + j ra + nop +END(dtrace_cas32) + +/* +void * +dtrace_casptr(void *target, void *cmp, void *new) +*/ +LEAF(dtrace_casptr) +1: + move t1, a2 + PTR_LL t0, 0(a0) + bne t0, a1, 2f + nop + PTR_SC t1, 0(a0) + beqz t1, 1b + nop +2: move v0, t0 + j ra + nop +END(dtrace_casptr) + + +/* +uintptr_t +dtrace_fulword(void *addr) +*/ +LEAF(dtrace_fulword) +END(dtrace_fulword) + +/* +uint8_t +dtrace_fuword8_nocheck(void *addr) +*/ +LEAF(dtrace_fuword8_nocheck) + lbu v0, 0(a0) + j ra + nop +END(dtrace_fuword8_nocheck) + +/* +uint16_t +dtrace_fuword16_nocheck(void *addr) +*/ +LEAF(dtrace_fuword16_nocheck) + lhu v0, 0(a0) + j ra + nop +END(dtrace_fuword16_nocheck) + +/* +uint32_t +dtrace_fuword32_nocheck(void *addr) +*/ +LEAF(dtrace_fuword32_nocheck) + lwu v0, 0(a0) + j ra + nop +END(dtrace_fuword32_nocheck) + +/* +uint64_t +dtrace_fuword64_nocheck(void *addr) +*/ +LEAF(dtrace_fuword64_nocheck) +#if defined(__mips_n64) || defined(__mips_n32) + ld v0, 0(a0) +#else + lw v1,4(a0) + lw v0,0(a0) +#endif + j ra + nop +END(dtrace_fuword64_nocheck) + +/* +XXX: unoptimized +void +dtrace_copy(uintptr_t src, uintptr_t dest, size_t size) +*/ +LEAF(dtrace_copy) +1: + beqz a2, 2f + nop + lbu t0, 0(a0) + sb t0, 0(a1) + daddu a0, a0, 1 + daddu a1, a1, 1 + dsubu a2, a2, 1 + j 1b + nop +2: + j ra + nop +END(dtrace_copy) + +/* +XXX: Unoptimized. Check for flags on page boundaries only(?) +void +dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +*/ +LEAF(dtrace_copystr) +1: + lbu t0, 0(a0) + sb t0, 0(a1) + daddu a0, a0, 1 + daddu a1, a1, 1 + dsubu a2, a2, 1 + beqz t0, 2f + nop + lhu t1, (a3) + and t1, t1, CPU_DTRACE_BADADDR + bnez t1, 2f + nop + + bnez a2, 1b + nop +2: + j ra + nop +END(dtrace_copystr) + +/* +void dtrace_invop_init(void) +*/ +LEAF(dtrace_invop_init) + /* XXX: impement it properly */ + dla t0, dtrace_invop_jump_addr + /* dla t1, dtrace_invop_start */ + sd zero, 0(t0) + j ra + nop +END(dtrace_invop_init) + +/* +void dtrace_invop_uninit(void) +*/ +LEAF(dtrace_invop_uninit) + dla t0, dtrace_invop_jump_addr + sd zero, 0(t0) + j ra + nop +END(dtrace_invop_uninit) + +/* + * The panic() and cmn_err() functions invoke vpanic() as a common entry point + * into the panic code implemented in panicsys(). vpanic() is responsible + * for passing through the format string and arguments, and constructing a + * regs structure on the stack into which it saves the current register + * values. If we are not dying due to a fatal trap, these registers will + * then be preserved in panicbuf as the current processor state. Before + * invoking panicsys(), vpanic() activates the first panic trigger (see + * common/os/panic.c) and switches to the panic_stack if successful. Note that + * DTrace takes a slightly different panic path if it must panic from probe + * context. Instead of calling panic, it calls into dtrace_vpanic(), which + * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and + * branches back into vpanic(). + */ + +/* +void +vpanic(const char *format, va_list alist) +*/ +LEAF(vpanic) /* Initial stack layout: */ + +vpanic_common: + j ra + nop +END(vpanic) + + + +/* +void +dtrace_vpanic(const char *format, va_list alist) +*/ +LEAF(dtrace_vpanic) /* Initial stack layout: */ + +#if 0 + jal dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */ + nop +#endif + j vpanic_common + nop + +END(dtrace_vpanic) + +/* +uintptr_t +dtrace_caller(int aframes) +*/ +LEAF(dtrace_caller) + li v0, -1 + j ra + nop +END(dtrace_caller) + Added: head/sys/cddl/dev/dtrace/mips/dtrace_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/mips/dtrace_isa.c Sat Mar 24 05:14:37 2012 (r233409) @@ -0,0 +1,698 @@ +/* + * 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 "regset.h" + +#ifdef __mips_n64 +#define MIPS_IS_VALID_KERNELADDR(reg) ((((reg) & 3) == 0) && \ + ((vm_offset_t)(reg) >= MIPS_XKPHYS_START)) +#else +#define MIPS_IS_VALID_KERNELADDR(reg) ((((reg) & 3) == 0) && \ + ((vm_offset_t)(reg) >= MIPS_KSEG0_START)) +#endif + + + +/* + * 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 *); + +static int dtrace_next_frame(register_t *pc, register_t *sp, register_t *args, int *valid_args); +static int dtrace_next_uframe(register_t *pc, register_t *sp, register_t *ra); + +void +dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, + uint32_t *intrpc) +{ + int depth = 0; + vm_offset_t callpc; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + register_t sp, ra, pc; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + sp = (register_t)(intptr_t)__builtin_frame_address(0); + ra = (register_t)(intptr_t)__builtin_return_address(0); + + __asm __volatile( + "jal 99f\n" + "nop\n" + "99:\n" + "move %0, $31\n" /* get ra */ + "move $31, %1\n" /* restore ra */ + : "=r" (pc) + : "r" (ra)); + + while (depth < pcstack_limit) { + + callpc = pc; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = callpc; + } + + if (dtrace_next_frame(&pc, &sp, NULL, NULL) < 0) + break; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} + +void +dtrace_getupcstack(uint64_t *pcstack, int pcstack_limit) +{ + proc_t *p = curproc; + struct trapframe *tf; + register_t sp, ra, pc; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = (uint64_t)tf->pc; + sp = (uint64_t)tf->sp; + ra = (uint64_t)tf->ra; + *pcstack++ = (uint64_t)tf->pc; + + /* + * Unwind, and unwind, and unwind + */ + while (1) { + if (dtrace_next_uframe(&pc, &sp, &ra) < 0) + break; + + *pcstack++ = pc; + pcstack_limit--; + + if (pcstack_limit <= 0) + break; + } + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +int +dtrace_getustackdepth(void) +{ + int n = 0; + proc_t *p = curproc; + struct trapframe *tf; + register_t sp, ra, pc; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; + + if (*flags & CPU_DTRACE_FAULT) + return (0); + + if (p == NULL || (tf = curthread->td_frame) == NULL) + return (0); + + pc = (uint64_t)tf->pc; + sp = (uint64_t)tf->sp; + ra = (uint64_t)tf->ra; + n++; + + /* + * Unwind, and unwind, and unwind + */ + while (1) { + if (dtrace_next_uframe(&pc, &sp, &ra) < 0) + break; + n++; + } + + return (n); +} + +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) +{ + int i; + register_t sp, ra, pc; + /* XXX: Fix this ugly code */ + register_t args[8]; + int valid[8]; + + sp = (register_t)(intptr_t)__builtin_frame_address(0); + ra = (register_t)(intptr_t)__builtin_return_address(0); + + __asm __volatile( + "jal 99f\n" + "nop\n" + "99:\n" + "move %0, $31\n" /* get ra */ + "move $31, %1\n" /* restore ra */ + : "=r" (pc) + : "r" (ra)); + + for (i = 0; i <= aframes + 1; i++) { + if (dtrace_next_frame(&pc, &sp, args, valid) < 0) { + printf("%s: stack ends at frame #%d\n", __func__, i); + return (0); + } + } + + if (arg < 8) { + if (valid[arg]) + return (args[arg]); + else + printf("%s: request arg%d is not valid\n", __func__, arg); + } + + return (0); +} + +int +dtrace_getstackdepth(int aframes) +{ + register_t sp, ra, pc; + int depth = 0; + + sp = (register_t)(intptr_t)__builtin_frame_address(0); + ra = (register_t)(intptr_t)__builtin_return_address(0); + + __asm __volatile( + "jal 99f\n" + "nop\n" + "99:\n" + "move %0, $31\n" /* get ra */ + "move $31, %1\n" /* restore ra */ + : "=r" (pc) + : "r" (ra)); + + for (;;) { + if (dtrace_next_frame(&pc, &sp, NULL, NULL) < 0) + break; + depth++; + } + + if (depth < aframes) + return 0; + else + return depth - aframes; +} + +ulong_t +dtrace_getreg(struct trapframe *rp, uint_t reg) +{ + + return (0); +} + +static int +dtrace_next_frame(register_t *pc, register_t *sp, + register_t *args, int *valid_args) +{ + InstFmt i; + /* + * Arrays for a0..a3 registers and flags if content + * of these registers is valid, e.g. obtained from the stack + */ + uintptr_t va; + unsigned instr, mask; + unsigned int frames = 0; + int more, stksize; + register_t ra = 0; + int arg, r; + vm_offset_t addr; + + /* + * Invalidate arguments values + */ + if (valid_args) { + for (r = 0; r < 8; r++) + valid_args[r] = 0; + } + + /* Jump here after a nonstandard (interrupt handler) frame */ + stksize = 0; + if (frames++ > 100) { + /* return breaks stackframe-size heuristics with gcc -O2 */ + goto error; /* XXX */ + } + + /* check for bad SP: could foul up next frame */ + if (!MIPS_IS_VALID_KERNELADDR(*sp)) { + goto error; + } + + /* check for bad PC */ + if (!MIPS_IS_VALID_KERNELADDR(*pc)) { + goto error; + } + + /* + * Find the beginning of the current subroutine by scanning + * backwards from the current PC for the end of the previous + * subroutine. + */ + va = *pc - sizeof(int); + while (1) { + instr = kdbpeek((int *)va); + + /* [d]addiu sp,sp,-X */ + if (((instr & 0xffff8000) == 0x27bd8000) + || ((instr & 0xffff8000) == 0x67bd8000)) + break; + + /* jr ra */ + if (instr == 0x03e00008) { + /* skip over branch-delay slot instruction */ + va += 2 * sizeof(int); + break; + } + + va -= sizeof(int); + } + + /* skip over nulls which might separate .o files */ + while ((instr = kdbpeek((int *)va)) == 0) + va += sizeof(int); + + /* scan forwards to find stack size and any saved registers */ + stksize = 0; + more = 3; + mask = 0; + for (; more; va += sizeof(int), + more = (more == 3) ? 3 : more - 1) { + /* stop if hit our current position */ + if (va >= *pc) + break; + instr = kdbpeek((int *)va); + i.word = instr; + switch (i.JType.op) { + case OP_SPECIAL: + switch (i.RType.func) { + case OP_JR: + case OP_JALR: + more = 2; /* stop after next instruction */ + break; + + case OP_SYSCALL: + case OP_BREAK: + more = 1; /* stop now */ + }; + break; + + case OP_BCOND: + case OP_J: + case OP_JAL: + case OP_BEQ: + case OP_BNE: + case OP_BLEZ: + case OP_BGTZ: + more = 2; /* stop after next instruction */ + break; + + case OP_COP0: + case OP_COP1: + case OP_COP2: + case OP_COP3: + switch (i.RType.rs) { + case OP_BCx: + case OP_BCy: + more = 2; /* stop after next instruction */ + }; + break; + + case OP_SW: + /* look for saved registers on the stack */ + if (i.IType.rs != 29) + break; + /* only restore the first one */ + if (mask & (1 << i.IType.rt)) + break; + mask |= (1 << i.IType.rt); + addr = (vm_offset_t)(*sp + (short)i.IType.imm); + switch (i.IType.rt) { + case 4:/* a0 */ + case 5:/* a1 */ + case 6:/* a2 */ + case 7:/* a3 */ +#if defined(__mips_n64) || defined(__mips_n32) + case 8:/* a4 */ + case 9:/* a5 */ + case 10:/* a6 */ + case 11:/* a7 */ +#endif + arg = i.IType.rt - 4; + if (args) + args[arg] = kdbpeek((int*)addr); + if (valid_args) + valid_args[arg] = 1; + break; + case 31: /* ra */ + ra = kdbpeek((int *)addr); + } + break; + + case OP_SD: + /* look for saved registers on the stack */ + if (i.IType.rs != 29) + break; + /* only restore the first one */ + if (mask & (1 << i.IType.rt)) + break; + mask |= (1 << i.IType.rt); + addr = (vm_offset_t)(*sp + (short)i.IType.imm); + switch (i.IType.rt) { + case 4:/* a0 */ + case 5:/* a1 */ + case 6:/* a2 */ + case 7:/* a3 */ +#if defined(__mips_n64) || defined(__mips_n32) + case 8:/* a4 */ + case 9:/* a5 */ + case 10:/* a6 */ + case 11:/* a7 */ +#endif + arg = i.IType.rt - 4; + if (args) + args[arg] = kdbpeekd((int *)addr); + if (valid_args) + valid_args[arg] = 1; + break; + + case 31: /* ra */ + ra = kdbpeekd((int *)addr); + } + break; + + case OP_ADDI: + case OP_ADDIU: + case OP_DADDI: + case OP_DADDIU: + /* look for stack pointer adjustment */ + if (i.IType.rs != 29 || i.IType.rt != 29) + break; + stksize = -((short)i.IType.imm); + } + } + + if (!MIPS_IS_VALID_KERNELADDR(ra)) + return (-1); + + *pc = ra; + *sp += stksize; + + return (0); +error: + return (-1); +} + +static int +dtrace_next_uframe(register_t *pc, register_t *sp, register_t *ra) +{ + int offset, registers_on_stack; + uint32_t opcode, mask; + register_t function_start; + int stksize; + InstFmt i; + + registers_on_stack = 0; + mask = 0; + function_start = 0; + offset = 0; + stksize = 0; + + while (offset < MAX_FUNCTION_SIZE) { + opcode = dtrace_fuword32((void *)(vm_offset_t)(*pc - offset)); + + /* [d]addiu sp, sp, -X*/ + if (((opcode & 0xffff8000) == 0x27bd8000) + || ((opcode & 0xffff8000) == 0x67bd8000)) { + function_start = *pc - offset; + registers_on_stack = 1; + break; + } + + /* lui gp, X */ + if ((opcode & 0xffff8000) == 0x3c1c0000) { + /* + * Function might start with this instruction + * Keep an eye on "jr ra" and sp correction + * with positive value further on + */ + function_start = *pc - offset; + } + + if (function_start) { + /* + * Stop looking further. Possible end of + * function instruction: it means there is no + * stack modifications, sp is unchanged + */ + + /* [d]addiu sp,sp,X */ + if (((opcode & 0xffff8000) == 0x27bd0000) + || ((opcode & 0xffff8000) == 0x67bd0000)) + break; + + if (opcode == 0x03e00008) + break; + } + + offset += sizeof(int); + } + + if (!function_start) + return (-1); + + if (registers_on_stack) { + offset = 0; + while ((offset < MAX_PROLOGUE_SIZE) + && ((function_start + offset) < *pc)) { + i.word = + dtrace_fuword32((void *)(vm_offset_t)(function_start + offset)); + switch (i.JType.op) { + case OP_SW: + /* look for saved registers on the stack */ + if (i.IType.rs != 29) + break; + /* only restore the first one */ + if (mask & (1 << i.IType.rt)) + break; + mask |= (1 << i.IType.rt); + if (i.IType.rt == 31) + *ra = dtrace_fuword32((void *)(vm_offset_t)(*sp + (short)i.IType.imm)); + break; + + case OP_SD: + /* look for saved registers on the stack */ + if (i.IType.rs != 29) + break; + /* only restore the first one */ + if (mask & (1 << i.IType.rt)) + break; + mask |= (1 << i.IType.rt); + /* ra */ + if (i.IType.rt == 31) + *ra = dtrace_fuword64((void *)(vm_offset_t)(*sp + (short)i.IType.imm)); + break; + + case OP_ADDI: + case OP_ADDIU: + case OP_DADDI: + case OP_DADDIU: + /* look for stack pointer adjustment */ + if (i.IType.rs != 29 || i.IType.rt != 29) + break; + stksize = -((short)i.IType.imm); + } + + offset += sizeof(int); + } + } + + /* + * We reached the end of backtrace + */ + if (*pc == *ra) + return (-1); + + *pc = *ra; + *sp += stksize; + + 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) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 05:15:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85C4C1065675; Sat, 24 Mar 2012 05:15:15 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7114E8FC1D; Sat, 24 Mar 2012 05:15:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O5FF8W013815; Sat, 24 Mar 2012 05:15:15 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O5FFYU013813; Sat, 24 Mar 2012 05:15:15 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203240515.q2O5FFYU013813@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 24 Mar 2012 05:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233410 - head/sys/modules/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 05:15:15 -0000 Author: gonzo Date: Sat Mar 24 05:15:14 2012 New Revision: 233410 URL: http://svn.freebsd.org/changeset/base/233410 Log: Make lockstat and profile modules x86-only Modified: head/sys/modules/dtrace/Makefile Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Sat Mar 24 05:14:37 2012 (r233409) +++ head/sys/modules/dtrace/Makefile Sat Mar 24 05:15:14 2012 (r233410) @@ -9,14 +9,12 @@ SUBDIR= dtmalloc \ dtrace \ dtraceall \ dtrace_test \ - lockstat \ - profile \ prototype \ sdt \ systrace .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -SUBDIR+= fasttrap fbt systrace_linux32 +SUBDIR+= fasttrap fbt lockstat profile systrace_linux32 .endif .if ${MACHINE_CPUARCH} == "amd64" SUBDIR+= systrace_freebsd32 From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 05:16:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BD621065674; Sat, 24 Mar 2012 05:16:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56F338FC18; Sat, 24 Mar 2012 05:16:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O5GR1W013894; Sat, 24 Mar 2012 05:16:27 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O5GR2i013892; Sat, 24 Mar 2012 05:16:27 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203240516.q2O5GR2i013892@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 24 Mar 2012 05:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233411 - head/sys/modules/cyclic X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 05:16:27 -0000 Author: gonzo Date: Sat Mar 24 05:16:26 2012 New Revision: 233411 URL: http://svn.freebsd.org/changeset/base/233411 Log: Jusy use i386 version of cyclic_machdep.c on all supported architectures. It's generic enough to cover all of them. Modified: head/sys/modules/cyclic/Makefile Modified: head/sys/modules/cyclic/Makefile ============================================================================== --- head/sys/modules/cyclic/Makefile Sat Mar 24 05:15:14 2012 (r233410) +++ head/sys/modules/cyclic/Makefile Sat Mar 24 05:16:26 2012 (r233411) @@ -10,7 +10,7 @@ SRCS+= vnode_if.h CFLAGS+= -I${.CURDIR}/../../cddl/compat/opensolaris \ -I${.CURDIR}/../../cddl/contrib/opensolaris/uts/common \ -I${.CURDIR}/../.. \ - -I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_CPUARCH:S/amd64/i386/} + -I${.CURDIR}/../../cddl/dev/cyclic/i386 CFLAGS+= -DDEBUG=1 From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 05:17:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47D13106566B; Sat, 24 Mar 2012 05:17:39 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32DF38FC1A; Sat, 24 Mar 2012 05:17:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O5HdCm013972; Sat, 24 Mar 2012 05:17:39 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O5HcKa013968; Sat, 24 Mar 2012 05:17:38 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203240517.q2O5HcKa013968@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 24 Mar 2012 05:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233412 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 05:17:39 -0000 Author: gonzo Date: Sat Mar 24 05:17:38 2012 New Revision: 233412 URL: http://svn.freebsd.org/changeset/base/233412 Log: Add DTrace-related part to machine-dependent code: - DTrace trap handler - invop-related variables (unused on MIPS but still referenced from dtrace) Modified: head/sys/mips/mips/exception.S head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Sat Mar 24 05:16:26 2012 (r233411) +++ head/sys/mips/mips/exception.S Sat Mar 24 05:17:38 2012 (r233412) @@ -55,6 +55,7 @@ */ #include "opt_ddb.h" +#include "opt_kdtrace.h" #include #include #include @@ -65,6 +66,26 @@ .set noreorder # Noreorder is default style! +#ifdef KDTRACE_HOOKS + .data + .globl dtrace_invop_jump_addr + .align 4 + .type dtrace_invop_jump_addr, @object + .size dtrace_invop_jump_addr, 8 +dtrace_invop_jump_addr: + .word 0 + .word 0 + .globl dtrace_invop_calltrap_addr + .align 4 + .type dtrace_invop_calltrap_addr, @object + .size dtrace_invop_calltrap_addr, 8 +dtrace_invop_calltrap_addr: + .word 0 + .word 0 + + .text +#endif + /* * Reasonable limit */ Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Sat Mar 24 05:16:26 2012 (r233411) +++ head/sys/mips/mips/trap.c Sat Mar 24 05:17:38 2012 (r233412) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_global.h" #include "opt_ktrace.h" +#include "opt_kdtrace.h" #define NO_REG_DEFS 1 /* Prevent asm.h from including regdef.h */ #include @@ -93,6 +94,33 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef KDTRACE_HOOKS +#include + +/* + * This is a hook which is initialised by the dtrace module + * to handle traps which might occur during DTrace probe + * execution. + */ +dtrace_trap_func_t dtrace_trap_func; + +dtrace_doubletrap_func_t dtrace_doubletrap_func; + +/* + * This is a hook which is initialised by the systrace module + * when it is loaded. This keeps the DTrace syscall provider + * implementation opaque. + */ +systrace_probe_func_t systrace_probe_func; + +/* + * These hooks are necessary for the pid, usdt and fasttrap providers. + */ +dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; +dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; +dtrace_return_probe_ptr_t dtrace_return_probe_ptr; +#endif + #ifdef TRAP_DEBUG int trap_debug = 0; SYSCTL_INT(_machdep, OID_AUTO, trap_debug, CTLFLAG_RW, @@ -529,6 +557,29 @@ trap(struct trapframe *trapframe) } } #endif + +#ifdef KDTRACE_HOOKS + /* + * A trap can occur while DTrace executes a probe. Before + * executing the probe, DTrace blocks re-scheduling and sets + * a flag in it's per-cpu flags to indicate that it doesn't + * want to fault. On returning from the probe, the no-fault + * flag is cleared and finally re-scheduling is enabled. + * + * If the DTrace kernel module has registered a trap handler, + * call it and if it returns non-zero, assume that it has + * handled the trap and modified the trap frame so that this + * function can return normally. + */ + /* + * XXXDTRACE: add fasttrap and pid probes handlers here (if ever) + */ + if (!usermode) { + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(trapframe, type)) + return (trapframe->pc); + } +#endif + switch (type) { case T_MCHECK: #ifdef DDB @@ -633,6 +684,9 @@ dofault: PROC_LOCK(p); --p->p_lock; PROC_UNLOCK(p); + /* + * XXXDTRACE: add dtrace_doubletrap_func here? + */ #ifdef VMFAULT_TRACE printf("vm_fault(%p (pmap %p), %p (%p), %x, %d) -> %x at pc %p\n", map, &vm->vm_pmap, (void *)va, (void *)(intptr_t)trapframe->badvaddr, From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 05:18:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE9A0106567E; Sat, 24 Mar 2012 05:18:28 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80BAE8FC08; Sat, 24 Mar 2012 05:18:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O5IS2C014040; Sat, 24 Mar 2012 05:18:28 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O5IScS014038; Sat, 24 Mar 2012 05:18:28 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203240518.q2O5IScS014038@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 24 Mar 2012 05:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233413 - head/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 05:18:28 -0000 Author: gonzo Date: Sat Mar 24 05:18:27 2012 New Revision: 233413 URL: http://svn.freebsd.org/changeset/base/233413 Log: Build libproc and librtld_db for MIPS Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Mar 24 05:17:38 2012 (r233412) +++ head/lib/Makefile Sat Mar 24 05:18:27 2012 (r233413) @@ -197,6 +197,11 @@ _libefi= libefi _libsmb= libsmb .endif +.if ${MACHINE_CPUARCH} == "mips" +_libproc= libproc +_librtld_db= librtld_db +.endif + .if ${MACHINE_CPUARCH} == "powerpc" _libsmb= libsmb .endif From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 05:27:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD3D11065675; Sat, 24 Mar 2012 05:27:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7ECC48FC0A; Sat, 24 Mar 2012 05:27:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O5ReO8014409; Sat, 24 Mar 2012 05:27:40 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O5Re6F014408; Sat, 24 Mar 2012 05:27:40 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203240527.q2O5Re6F014408@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 24 Mar 2012 05:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233414 - head/cddl/contrib/opensolaris/lib/libdtrace/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 05:27:40 -0000 Author: gonzo Date: Sat Mar 24 05:27:39 2012 New Revision: 233414 URL: http://svn.freebsd.org/changeset/base/233414 Log: Add stub file for pid probe. It's required although pid probe is not supported on MIPS yet Added: head/cddl/contrib/opensolaris/lib/libdtrace/mips/ head/cddl/contrib/opensolaris/lib/libdtrace/mips/dt_isadep.c (contents, props changed) Added: head/cddl/contrib/opensolaris/lib/libdtrace/mips/dt_isadep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/lib/libdtrace/mips/dt_isadep.c Sat Mar 24 05:27:39 2012 (r233414) @@ -0,0 +1,75 @@ +/* + * 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. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include +#include + +#include +#include + +/*ARGSUSED*/ +int +dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +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) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +/*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) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 05:29:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7597D106566C; Sat, 24 Mar 2012 05:29:08 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4673E8FC0A; Sat, 24 Mar 2012 05:29:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O5T8Y6014494; Sat, 24 Mar 2012 05:29:08 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O5T8Yl014490; Sat, 24 Mar 2012 05:29:08 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203240529.q2O5T8Yl014490@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 24 Mar 2012 05:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233415 - in head/cddl: lib lib/libdtrace usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 05:29:08 -0000 Author: gonzo Date: Sat Mar 24 05:29:07 2012 New Revision: 233415 URL: http://svn.freebsd.org/changeset/base/233415 Log: Enable build of DTrace-related userland parts for MIPS Modified: head/cddl/lib/Makefile head/cddl/lib/libdtrace/Makefile head/cddl/usr.sbin/Makefile Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Sat Mar 24 05:27:39 2012 (r233414) +++ head/cddl/lib/Makefile Sat Mar 24 05:29:07 2012 (r233415) @@ -19,7 +19,7 @@ _libzpool= libzpool .endif .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_CPUARCH} == "mips" _drti= drti _libdtrace= libdtrace .endif Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Sat Mar 24 05:27:39 2012 (r233414) +++ head/cddl/lib/libdtrace/Makefile Sat Mar 24 05:29:07 2012 (r233415) @@ -42,8 +42,7 @@ SRCS= dt_aggregate.c \ dt_subr.c \ dt_work.c \ dt_xlator.c \ - gmatch.c \ - dis_tables.c + gmatch.c DSRCS= errno.d \ psinfo.d \ @@ -70,12 +69,17 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/ut .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 .else # temporary hack CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel .endif .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +SRCS+= dis_tables.c DSRCS+= regs_x86.d .endif Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Sat Mar 24 05:27:39 2012 (r233414) +++ head/cddl/usr.sbin/Makefile Sat Mar 24 05:29:07 2012 (r233415) @@ -19,4 +19,8 @@ _dtruss= dtruss _lockstat= lockstat .endif +.if ${MACHINE_CPUARCH} == "mips" +_dtrace= dtrace +.endif + .include From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 05:30:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 00D04106566B; Sat, 24 Mar 2012 05:30:14 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E06968FC0A; Sat, 24 Mar 2012 05:30:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O5UDAs014575; Sat, 24 Mar 2012 05:30:13 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O5UDHw014573; Sat, 24 Mar 2012 05:30:13 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203240530.q2O5UDHw014573@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 24 Mar 2012 05:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233416 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 05:30:14 -0000 Author: gonzo Date: Sat Mar 24 05:30:13 2012 New Revision: 233416 URL: http://svn.freebsd.org/changeset/base/233416 Log: Build CTF tools as a part of toolchain for cross-compilation case Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Mar 24 05:29:07 2012 (r233415) +++ head/Makefile.inc1 Sat Mar 24 05:30:13 2012 (r233416) @@ -1047,9 +1047,11 @@ _clang_tblgen= \ usr.bin/clang/clang-tblgen .endif +# dtrace tools are required for older bootstrap env and cross-build .if ${MK_CDDL} != "no" && \ - ${BOOTSTRAPPING} < 800038 && \ - !(${BOOTSTRAPPING} >= 700112 && ${BOOTSTRAPPING} < 799999) + ((${BOOTSTRAPPING} < 800038 && \ + !(${BOOTSTRAPPING} >= 700112 && ${BOOTSTRAPPING} < 799999)) \ + || (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH})) _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge .endif From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 06:28:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6A6B106566C; Sat, 24 Mar 2012 06:28:16 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 881438FC12; Sat, 24 Mar 2012 06:28:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O6SGMW016764; Sat, 24 Mar 2012 06:28:16 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O6SGVp016760; Sat, 24 Mar 2012 06:28:16 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203240628.q2O6SGVp016760@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 24 Mar 2012 06:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233417 - head/sys/mips/cavium X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 06:28:16 -0000 Author: gonzo Date: Sat Mar 24 06:28:15 2012 New Revision: 233417 URL: http://svn.freebsd.org/changeset/base/233417 Log: Remap PMC interrupt for all cores Modified: head/sys/mips/cavium/octeon_irq.h head/sys/mips/cavium/octeon_machdep.c head/sys/mips/cavium/octeon_pmc.c Modified: head/sys/mips/cavium/octeon_irq.h ============================================================================== --- head/sys/mips/cavium/octeon_irq.h Sat Mar 24 05:30:13 2012 (r233416) +++ head/sys/mips/cavium/octeon_irq.h Sat Mar 24 06:28:15 2012 (r233417) @@ -176,4 +176,6 @@ typedef enum /* Interrupts 129 - 135 are reserved */ } octeon_irq_t; +#define OCTEON_PMC_IRQ OCTEON_IRQ_4 + #endif Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Sat Mar 24 05:30:13 2012 (r233416) +++ head/sys/mips/cavium/octeon_machdep.c Sat Mar 24 06:28:15 2012 (r233417) @@ -260,6 +260,8 @@ octeon_debug_symbol(void) void octeon_ciu_reset(void) { + uint64_t cvmctl; + /* Disable all CIU interrupts by default */ cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2), 0); cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2+1), 0); @@ -272,6 +274,14 @@ octeon_ciu_reset(void) (1ull << (OCTEON_IRQ_MBOX0 - 8)) | (1ull << (OCTEON_IRQ_MBOX1 - 8))); #endif + + /* + * Move the Performance Counter interrupt to OCTEON_PMC_IRQ + */ + cvmctl = mips_rd_cvmctl(); + cvmctl &= ~(7 << 7); + cvmctl |= (OCTEON_PMC_IRQ + 2) << 7; + mips_wr_cvmctl(cvmctl); } static void Modified: head/sys/mips/cavium/octeon_pmc.c ============================================================================== --- head/sys/mips/cavium/octeon_pmc.c Sat Mar 24 05:30:13 2012 (r233416) +++ head/sys/mips/cavium/octeon_pmc.c Sat Mar 24 06:28:15 2012 (r233417) @@ -57,8 +57,6 @@ static int octeon_pmc_probe(device_t); static int octeon_pmc_attach(device_t); static int octeon_pmc_intr(void *); -#define OCTEON_PMC_IRQ 4 - static void octeon_pmc_identify(driver_t *drv, device_t parent) { @@ -82,7 +80,6 @@ octeon_pmc_attach(device_t dev) struct octeon_pmc_softc *sc; int error; int rid; - uint64_t cvmctl; sc = device_get_softc(dev); @@ -103,14 +100,6 @@ octeon_pmc_attach(device_t dev) return (error); } - /* - * Move the Performance Counter interrupt to OCTEON_PMC_IRQ - */ - cvmctl = mips_rd_cvmctl(); - cvmctl &= ~(7 << 7); - cvmctl |= (OCTEON_PMC_IRQ + 2) << 7; - mips_wr_cvmctl(cvmctl); - return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 06:40:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 393ED106564A; Sat, 24 Mar 2012 06:40:42 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 246E78FC0C; Sat, 24 Mar 2012 06:40:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2O6efdJ017244; Sat, 24 Mar 2012 06:40:41 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2O6efD7017242; Sat, 24 Mar 2012 06:40:41 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201203240640.q2O6efD7017242@svn.freebsd.org> From: Joel Dahl Date: Sat, 24 Mar 2012 06:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233418 - head/sbin/route X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 06:40:42 -0000 Author: joel (doc committer) Date: Sat Mar 24 06:40:41 2012 New Revision: 233418 URL: http://svn.freebsd.org/changeset/base/233418 Log: Document the show alias and add an EXAMPLES section. Modified: head/sbin/route/route.8 Modified: head/sbin/route/route.8 ============================================================================== --- head/sbin/route/route.8 Sat Mar 24 06:28:15 2012 (r233417) +++ head/sbin/route/route.8 Sat Mar 24 06:40:41 2012 (r233418) @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd October 2, 2005 +.Dd March 24, 2012 .Dt ROUTE 8 .Os .Sh NAME @@ -107,6 +107,10 @@ Lookup and display the route for a desti .It Cm monitor Continuously report any changes to the routing information base, routing lookup misses, or suspected network partitionings. +.It Cm show +Another name for the +.Cm get +command. .El .Pp The monitor command has the syntax: @@ -344,6 +348,37 @@ As such, only the super-user may modify the routing tables. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Add a default route to the network routing table. +This will send all packets for destinations not available in the routing table +to the default gateway at 192.168.1.1: +.Pp +.Dl route add -net 0.0.0.0/0 192.168.1.1 +.Pp +A shorter version of adding a default route can also be written as: +.Pp +.Dl route add default 192.168.1.1 +.Pp +Add a static route to the 172.16.10.0/24 network via the 172.16.1.1 gateway: +.Pp +.Dl route add -net 172.16.10.0/24 172.16.1.1 +.Pp +Change the gateway of an already established static route in the routing table: +.Pp +.Dl route change -net 172.16.10.0/24 172.16.1.2 +.Pp +Display the route for a destination network: +.Pp +.Dl route show 172.16.10.0 +.Pp +Delete a static route from the routing table: +.Pp +.Dl route delete -net 172.16.10.0/24 172.16.1.2 +.Pp +Remove all routes from the routing table: +.Pp +.Dl route flush +.Pp .Sh DIAGNOSTICS .Bl -diag .It "add [host \&| network ] %s: gateway %s flags %x" From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 09:56:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28D711065678 for ; Sat, 24 Mar 2012 09:56:06 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 54D678FC29 for ; Sat, 24 Mar 2012 09:56:05 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so4184503bkc.13 for ; Sat, 24 Mar 2012 02:56:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=w36bMeb0K2/Zbb5kxmEEQ4v/y13XNc1zxktronhN/Lk=; b=U/j9WAU9UeOxZXoyhvSebG928/pafbZ7AeiZYXaKk8WaJ52PpfivTtxxCpYVHF5puU yIHsyZWHG3jWKKbrzVeN67vreeyLTUNTJr9rXXzVamu2HXIxiDIDnRVmRLUKoPoBCYor nwJ2iH3Fpc2qbP/TEXDN0eFojpTvJLFTI7WlOj/pbOHrb+/ynkPo9GKiFftg/dU2dZmx b/pYSBiTngVV6D8HBbZSuchPloG9erWADO3bl8JENd3J/mjilHLaVBX1LNfNmgouNxW8 AaPWszmklqB+FtDrDaBXKc9S4qTj9QMJRJBSRGKjLZohuUDw5hg88+eZ6BwW8p6i2mxS fWxw== Received: by 10.204.149.218 with SMTP id u26mr5948032bkv.82.1332582964066; Sat, 24 Mar 2012 02:56:04 -0700 (PDT) Received: from [10.254.254.77] (ppp109-252-211-172.pppoe.spdop.ru. [109.252.211.172]) by mx.google.com with ESMTPS id t17sm20795191bke.6.2012.03.24.02.56.02 (version=SSLv3 cipher=OTHER); Sat, 24 Mar 2012 02:56:03 -0700 (PDT) Message-ID: <4F6D9A2D.8060708@zonov.org> Date: Sat, 24 Mar 2012 13:55:57 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Sergey Kandaurov References: <201203140944.q2E9ilvF094386@svn.freebsd.org> In-Reply-To: <201203140944.q2E9ilvF094386@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkuw+ppcGv34l6oJaW/9Bb/gzoWDxQwgEROlAglrQ4i+MEKgg/6lWP8Ki4s7uMnK69GE5aR Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r232961 - stable/9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 09:56:06 -0000 On 14.03.2012 13:44, Sergey Kandaurov wrote: > Author: pluknet > Date: Wed Mar 14 09:44:46 2012 > New Revision: 232961 > URL: http://svn.freebsd.org/changeset/base/232961 > > Log: > MFC r232671: Add lib32 part for libutil after its version bump to 9. > > PR: misc/165523 > Submitted by: Andrey Zonov > > Modified: > stable/9/ObsoleteFiles.inc (contents, props changed) > > Modified: stable/9/ObsoleteFiles.inc > ============================================================================== > --- stable/9/ObsoleteFiles.inc Wed Mar 14 09:15:50 2012 (r232960) > +++ stable/9/ObsoleteFiles.inc Wed Mar 14 09:44:46 2012 (r232961) > @@ -352,6 +352,9 @@ OLD_FILES+=usr/share/man/man5/lastlog.5. > OLD_FILES+=usr/share/man/man5/utmp.5.gz > OLD_FILES+=usr/share/man/man5/wtmp.5.gz > OLD_LIBS+=lib/libutil.so.8 > +.if ${TARGET_ARCH} == "amd64" > +OLB_LIBS+=usr/lib32/libutil.so.8 > +.endif > # 20100105: new userland semaphore implementation > OLD_FILES+=usr/include/sys/semaphore.h > # 20100103: ntptrace(8) removed Thanks! But what about other files which I reported? -- Andrey Zonov From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 10:07:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0AE6106566B; Sat, 24 Mar 2012 10:07:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8334B8FC0C; Sat, 24 Mar 2012 10:07:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OA7M3B024791; Sat, 24 Mar 2012 10:07:22 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OA7MtS024789; Sat, 24 Mar 2012 10:07:22 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203241007.q2OA7MtS024789@svn.freebsd.org> From: Dimitry Andric Date: Sat, 24 Mar 2012 10:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233419 - head/sys/x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 10:07:22 -0000 Author: dim Date: Sat Mar 24 10:07:21 2012 New Revision: 233419 URL: http://svn.freebsd.org/changeset/base/233419 Log: Fix the following clang warning in sys/dev/dcons/dcons.c, caused by the recent changes in sys/x86/include/endian.h: sys/dev/dcons/dcons.c:190:15: error: implicit conversion from '__uint32_t' (aka 'unsigned int') to '__uint16_t' (aka 'unsigned short') changes value from 1684238190 to 28526 [-Werror,-Wconstant-conversion] buf->magic = ntohl(DCONS_MAGIC); ^~~~~~~~~~~~~~~~~~ sys/sys/param.h:306:18: note: expanded from: #define ntohl(x) __ntohl(x) ^ ./x86/endian.h:128:20: note: expanded from: #define __ntohl(x) __bswap32(x) ^ ./x86/endian.h:78:20: note: expanded from: __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x)) ^ ./x86/endian.h:68:26: note: expanded from: (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) ^ ./x86/endian.h:75:53: note: expanded from: __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x))) ~~~~~~~~~~~~~ ^ This is because the __bswapXX_gen() macros (for x86) call the regular __bswapXX() macros. Since the __bswapXX_gen() variants are only called when their arguments are constant, there is no need to do that constancy check recursively. Also, it causes the above error with clang. Fix it by calling __bswap16_gen() from __bswap32_gen(), and similarly, __bswap32_gen() from __bswap64_gen(). While here, add extra parentheses around the __bswap16_gen() macro expansion, to prevent unexpected side effects. Modified: head/sys/x86/include/endian.h Modified: head/sys/x86/include/endian.h ============================================================================== --- head/sys/x86/include/endian.h Sat Mar 24 06:40:41 2012 (r233418) +++ head/sys/x86/include/endian.h Sat Mar 24 10:07:21 2012 (r233419) @@ -63,11 +63,11 @@ #define BYTE_ORDER _BYTE_ORDER #endif -#define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8) +#define __bswap16_gen(x) ((__uint16_t)((x) << 8 | (x) >> 8)) #define __bswap32_gen(x) \ - (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) + (((__uint32_t)__bswap16_gen(x) << 16) | __bswap16_gen((x) >> 16)) #define __bswap64_gen(x) \ - (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) + (((__uint64_t)__bswap32_gen(x) << 32) | __bswap32_gen((x) >> 32)) #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P #define __bswap16(x) \ From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 10:32:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD6D01065675; Sat, 24 Mar 2012 10:32:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 7711E8FC17; Sat, 24 Mar 2012 10:32:49 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:c8dc:6e5:d0ce:fe36] (unknown [IPv6:2001:7b8:3a7:0:c8dc:6e5:d0ce:fe36]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A6B485C37; Sat, 24 Mar 2012 11:32:48 +0100 (CET) Message-ID: <4F6DA2D5.1090301@FreeBSD.org> Date: Sat, 24 Mar 2012 11:32:53 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120312 Thunderbird/11.0 MIME-Version: 1.0 To: Ed Schouten References: <201203210838.q2L8chUM062260@svn.freebsd.org> In-Reply-To: <201203210838.q2L8chUM062260@svn.freebsd.org> X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233271 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 10:32:49 -0000 On 2012-03-21 09:38, Ed Schouten wrote: > Author: ed > Date: Wed Mar 21 08:38:42 2012 > New Revision: 233271 > URL: http://svn.freebsd.org/changeset/base/233271 > > Log: > Remove pty(4) from our kernel configurations. > > As of FreeBSD 8, this driver should not be used. Applications that use > posix_openpt(2) and openpty(3) use the pts(4) that is built into the > kernel unconditionally. If it turns out high profile depend on the > pty(4) module anyway, I'd rather get those fixed. So please report any > issues to me. > > The pty(4) module is still available as a kernel module of course, so a > simple `kldload pty' can be used to run old-style pseudo-terminals. Please put at least a note in UPDATING... :) I just ran into an old program (compiled for FreeBSD 6 I think), that suddenly started failing with 'Cannot allocate master pty'. Maybe the compat ports could be updated to also enable loading of the pty module? From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 13:11:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 236BC106566B; Sat, 24 Mar 2012 13:11:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EE388FC20; Sat, 24 Mar 2012 13:11:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ODBw8U033689; Sat, 24 Mar 2012 13:11:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ODBwON033687; Sat, 24 Mar 2012 13:11:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203241311.q2ODBwON033687@svn.freebsd.org> From: Marius Strobl Date: Sat, 24 Mar 2012 13:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233421 - head/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 13:11:59 -0000 Author: marius Date: Sat Mar 24 13:11:58 2012 New Revision: 233421 URL: http://svn.freebsd.org/changeset/base/233421 Log: Given that this is a host-PCI-Express bridge driver, create the parent DMA tag with a 4 GB boundary as required by PCI-Express. With r232403 in place this actually is redundant. However, the host-PCI-Express bridge driver is the more appropriate place for implementing this restriction. MFC after: 3 days Modified: head/sys/sparc64/pci/fire.c Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Sat Mar 24 10:19:40 2012 (r233420) +++ head/sys/sparc64/pci/fire.c Sat Mar 24 13:11:58 2012 (r233421) @@ -764,7 +764,7 @@ fire_attach(device_t dev) if (sc->sc_pci_cfgt == NULL) panic("%s: could not allocate PCI configuration space tag", __func__); - if (bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0, + if (bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0x100000000, sc->sc_is.is_pmaxaddr, ~0, NULL, NULL, sc->sc_is.is_pmaxaddr, 0xff, 0xffffffff, 0, NULL, NULL, &sc->sc_pci_dmat) != 0) panic("%s: could not create PCI DMA tag", __func__); From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 13:37:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D91E91065670; Sat, 24 Mar 2012 13:37:58 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF0078FC15; Sat, 24 Mar 2012 13:37:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ODbw7H034535; Sat, 24 Mar 2012 13:37:58 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ODbvBk034496; Sat, 24 Mar 2012 13:37:57 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201203241337.q2ODbvBk034496@svn.freebsd.org> From: Joel Dahl Date: Sat, 24 Mar 2012 13:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233422 - in head/share/man: man4 man4/man4.powerpc man7 man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 13:37:58 -0000 Author: joel (doc committer) Date: Sat Mar 24 13:37:57 2012 New Revision: 233422 URL: http://svn.freebsd.org/changeset/base/233422 Log: Remove superfluous paragraph macro. Modified: head/share/man/man4/acpi_hp.4 head/share/man/man4/adv.4 head/share/man/man4/ahc.4 head/share/man/man4/atkbd.4 head/share/man/man4/bridge.4 head/share/man/man4/cas.4 head/share/man/man4/cc_vegas.4 head/share/man/man4/cy.4 head/share/man/man4/dpms.4 head/share/man/man4/ed.4 head/share/man/man4/em.4 head/share/man/man4/epair.4 head/share/man/man4/fdc.4 head/share/man/man4/fwohci.4 head/share/man/man4/gem.4 head/share/man/man4/geom_fox.4 head/share/man/man4/geom_uzip.4 head/share/man/man4/hptiop.4 head/share/man/man4/igb.4 head/share/man/man4/ip.4 head/share/man/man4/isp.4 head/share/man/man4/man4.powerpc/bm.4 head/share/man/man4/man4.powerpc/snd_ai2s.4 head/share/man/man4/man4.powerpc/snd_davbus.4 head/share/man/man4/netmap.4 head/share/man/man4/ng_netflow.4 head/share/man/man4/nvram2env.4 head/share/man/man4/oce.4 head/share/man/man4/ppbus.4 head/share/man/man4/snd_emu10kx.4 head/share/man/man4/snd_hda.4 head/share/man/man4/u3g.4 head/share/man/man7/mailaddr.7 head/share/man/man9/DB_COMMAND.9 head/share/man/man9/fail.9 head/share/man/man9/lock.9 head/share/man/man9/locking.9 head/share/man/man9/make_dev.9 Modified: head/share/man/man4/acpi_hp.4 ============================================================================== --- head/share/man/man4/acpi_hp.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/acpi_hp.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -244,7 +244,6 @@ Set maximum detail level for /dev/hpcmi .Bd -literal -offset indent sysctl dev.acpi_hp.0.cmi_detail=7 .Ed -.Pp .Sh SEE ALSO .Xr acpi 4 , .Xr acpi_wmi 4 , Modified: head/share/man/man4/adv.4 ============================================================================== --- head/share/man/man4/adv.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/adv.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -66,7 +66,6 @@ host adapter chips. The following tables list the AdvanSys products using these chips, their bus attachment type, maximum sync rate, and the maximum number of commands that can be handled by the adapter concurrently. -.Pp .Bd -ragged -offset indent .Bl -column "ABP510/5150 " "ISA PnP " "Yes " "10MHz " "Commands " Footnotes Connectivity Products: @@ -104,7 +103,6 @@ This board has been sold by SIIG as the This board has been sold by SIIG as the Fast SCSI Pro PCI. .El .Ed -.Pp .Bd -ragged -offset indent .Bl -column "ABP510/5150 " "ISA PnP " "Yes " "10MHz " Commands Single Channel Products: @@ -121,7 +119,6 @@ ABP970 PCI No 10MHz ABP970U PCI No 20MHz 240 .El .Ed -.Pp .Bd -ragged -offset indent .Bl -column "ABP510/5150 " "ISA PnP " "Yes " "10MHz " "Commands " "Channels " Multi Channel Products (Commands are per-channel): Modified: head/share/man/man4/ahc.4 ============================================================================== --- head/share/man/man4/ahc.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/ahc.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -146,7 +146,6 @@ driver. Note that wide and twin channel features, although always supported by a particular chip, may be disabled in a particular motherboard or card design. -.Pp .Bd -ragged -offset indent .Bl -column "aic7770 " "10 " "EISA/VL " "10MHz " "16bit " "SCBs " Features .Em "Chip MIPS Bus MaxSync MaxWidth SCBs Features" Modified: head/share/man/man4/atkbd.4 ============================================================================== --- head/share/man/man4/atkbd.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/atkbd.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -144,7 +144,6 @@ command. This option will disable this feature and prevent the user from changing key assignment. .El -.Pp .Ss Driver Flags The .Nm Modified: head/share/man/man4/bridge.4 ============================================================================== --- head/share/man/man4/bridge.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/bridge.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -167,7 +167,6 @@ by enabling the .Va net.link.bridge.log_stp variable using .Xr sysctl 8 . -.Pp .Sh PACKET FILTERING Packet filtering can be used with any firewall package that hooks in via the .Xr pfil 9 Modified: head/share/man/man4/cas.4 ============================================================================== --- head/share/man/man4/cas.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/cas.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -70,7 +70,6 @@ Selecting an MTU larger than 1500 bytes .Xr ifconfig 8 utility configures the adapter to receive and transmit Jumbo Frames. .Sh HARDWARE -.Pp The chips supported by the .Nm driver are: Modified: head/share/man/man4/cc_vegas.4 ============================================================================== --- head/share/man/man4/cc_vegas.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/cc_vegas.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -39,7 +39,6 @@ The Vegas congestion control algorithm uses what the authors term the actual and expected transmission rates to determine whether there is congestion along the network path i.e. -.Pp .Bl -item -offset indent .It actual rate = (total data sent in a RTT) / RTT @@ -54,7 +53,6 @@ smallest round trip time observed during .Pp The algorithm aims to keep diff between two parameters alpha and beta, such that: -.Pp .Bl -item -offset indent .It alpha < diff < beta Modified: head/share/man/man4/cy.4 ============================================================================== --- head/share/man/man4/cy.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/cy.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -44,7 +44,6 @@ .Nm cy .Nd Cyclades Cyclom-Y serial driver .Sh SYNOPSIS -.Pp For one ISA card: .Bd -ragged -offset indent -compact .Cd "device cy" Modified: head/share/man/man4/dpms.4 ============================================================================== --- head/share/man/man4/dpms.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/dpms.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -50,7 +50,6 @@ it restores the display to its state whe .Sh SEE ALSO .Xr acpi_video 4 .Sh BUGS -.Pp The VESA BIOS DPMS calls do not provide any way to identify a particular display or adapter to manipulate. As a result, Modified: head/share/man/man4/ed.4 ============================================================================== --- head/share/man/man4/ed.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/ed.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -414,7 +414,6 @@ dropped packets during heavy network tra The Mitsubishi B8895 PC Card uses a DP83902, but its ASIC part is undocumented. Neither the NE2000 nor the WD83x0 drivers work with this card. -.Pp .Sh BUGS The .Nm Modified: head/share/man/man4/em.4 ============================================================================== --- head/share/man/man4/em.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/em.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -242,7 +242,6 @@ Make the identification LED of em0 blink Turn the identification LED of em0 off again: .Pp .Dl "echo 0 > /dev/led/em0" -.Pp .Sh DIAGNOSTICS .Bl -diag .It "em%d: Unable to allocate bus resource: memory" Modified: head/share/man/man4/epair.4 ============================================================================== --- head/share/man/man4/epair.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/epair.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -97,7 +97,6 @@ one end of the interface pair can also b As with any other Ethernet interface one can configure .Xr vlan 4 support on top of it. -.Pp .Sh SEE ALSO .Xr ioctl 2 , .Xr altq 4 , Modified: head/share/man/man4/fdc.4 ============================================================================== --- head/share/man/man4/fdc.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/fdc.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -173,7 +173,6 @@ For that purpose, a per-drive device flags value of .Ar 0x20 needs to be specified. -.Pp .Ss Programming Interface In addition to the normal read and write functionality, the .Nm Modified: head/share/man/man4/fwohci.4 ============================================================================== --- head/share/man/man4/fwohci.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/fwohci.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -60,7 +60,6 @@ section for detail), put the following l .Bd -literal -offset indent hw.firewire.phydma_enable=0 .Ed -.Pp .Sh HARDWARE The .Nm Modified: head/share/man/man4/gem.4 ============================================================================== --- head/share/man/man4/gem.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/gem.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -61,7 +61,6 @@ support for the reception and transmissi .Xr vlan 4 and a 512-bit multicast hash filter. .Sh HARDWARE -.Pp Chips supported by the .Nm driver include: Modified: head/share/man/man4/geom_fox.4 ============================================================================== --- head/share/man/man4/geom_fox.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/geom_fox.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -85,7 +85,6 @@ The driver will disallow write operations to the underlying devices once the fox device has been opened for writing. .Sh EXAMPLES -.Pp .Bl -bullet -compact .It .Nm Modified: head/share/man/man4/geom_uzip.4 ============================================================================== --- head/share/man/man4/geom_uzip.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/geom_uzip.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -90,7 +90,6 @@ Consumers: Sectorsize: 512 Mode: r1w0e1 .Ed -.Pp .Sh SEE ALSO .Xr GEOM 4 , .Xr md 4 , Modified: head/share/man/man4/hptiop.4 ============================================================================== --- head/share/man/man4/hptiop.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/hptiop.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -100,7 +100,6 @@ The .Nm device driver first appeared in .Fx 7.0 . -.Pp .Sh AUTHORS The .Nm Modified: head/share/man/man4/igb.4 ============================================================================== --- head/share/man/man4/igb.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/igb.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -174,7 +174,6 @@ Make the identification LED of igb0 blin Turn the identification LED of igb0 off again: .Pp .Dl "echo 0 > /dev/led/igb0" -.Pp .Sh DIAGNOSTICS .Bl -diag .It "igb%d: Unable to allocate bus resource: memory" Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/ip.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -392,7 +392,6 @@ and .Va net.inet.ip.portrange.randomtime are 10 port allocations per second and 45 seconds correspondingly. .Ss "Multicast Options" -.Pp .Tn IP multicasting is supported only on .Dv AF_INET @@ -682,7 +681,6 @@ are used to specify an upper limit on th source filter entries which the kernel may allocate. .\"----------------------- .Ss "Raw IP Sockets" -.Pp Raw .Tn IP sockets are connectionless, Modified: head/share/man/man4/isp.4 ============================================================================== --- head/share/man/man4/isp.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/isp.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -138,7 +138,6 @@ Qlogic 2422 Optical Fibre Channel PCI ca Qlogic 2432 Optical Fibre Channel PCIe cards (4 Gigabit) .El .Sh CONFIGURATION OPTIONS -.Pp Target mode support may be enabled with the .Pp .Cd options ISP_TARGET_MODE Modified: head/share/man/man4/man4.powerpc/bm.4 ============================================================================== --- head/share/man/man4/man4.powerpc/bm.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/man4.powerpc/bm.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -54,7 +54,6 @@ G3-based Apple hardware. It is a close relative of the Sun HME controller found in contemporary Sun workstations. .Sh HARDWARE -.Pp Chips supported by the .Nm driver include: @@ -65,7 +64,6 @@ Apple BMAC Onboard Ethernet .It Apple BMAC+ Onboard Ethernet .El -.Pp .Sh SEE ALSO .Xr altq 4 , .Xr hme 4 , Modified: head/share/man/man4/man4.powerpc/snd_ai2s.4 ============================================================================== --- head/share/man/man4/man4.powerpc/snd_ai2s.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/man4.powerpc/snd_ai2s.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -54,7 +54,6 @@ predominantly in G4 and G5 machines, alo codecs. Some machines (e.g. the Mac Mini) do not have configurable codecs and so lack hardware volume control. .Sh HARDWARE -.Pp Chips supported by the .Nm driver include: @@ -65,7 +64,6 @@ Apple Tumbler Audio .It Apple Snapper Audio .El -.Pp .Sh SEE ALSO .Xr sound 4 , .Xr snd_davbus 4 Modified: head/share/man/man4/man4.powerpc/snd_davbus.4 ============================================================================== --- head/share/man/man4/man4.powerpc/snd_davbus.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/man4.powerpc/snd_davbus.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -52,7 +52,6 @@ The driver provides support for the Apple Davbus audio controllers found in many G3-era Apple machines. .Sh HARDWARE -.Pp Chips supported by the .Nm driver include: @@ -63,7 +62,6 @@ Apple Burgundy Audio .It Apple Screamer Audio .El -.Pp .Sh SEE ALSO .Xr sound 4 , .Xr snd_ai2s 4 Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/netmap.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -51,7 +51,6 @@ and can exploit the parallelism in multiqueue devices and multicore systems. .Pp -.Pp .Nm requires explicit support in device drivers. For a list of supported devices, see the end of this manual page. @@ -89,7 +88,6 @@ are relative (offsets or indexes). Some them into actual pointers. .Pp The data structures in shared memory are the following: -.Pp .Bl -tag -width XXX .It Dv struct netmap_if (one per interface) indicates the number of rings supported by an interface, their @@ -162,7 +160,6 @@ int i = txring->slot[txring->cur].buf_id char *buf = NETMAP_BUF(txring, i); .Ed .Ss IOCTLS -.Pp .Nm supports some ioctl() to synchronize the state of the rings between the kernel and the user processes, plus some Modified: head/share/man/man4/ng_netflow.4 ============================================================================== --- head/share/man/man4/ng_netflow.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/ng_netflow.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -61,7 +61,6 @@ The default is 15 seconds. .Pp Node supports IPv6 accounting (NetFlow v9 only) and is aware of multiple fibs. Different fibs are mapped to different domain_id in NetFlow V9 and different engine_id in NetFlow V5. -.Pp .Sh HOOKS This node type supports up to .Dv NG_NETFLOW_MAXIFACES Modified: head/share/man/man4/nvram2env.4 ============================================================================== --- head/share/man/man4/nvram2env.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/nvram2env.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -101,7 +101,6 @@ hint.nvram.0.base=0x1fc00400 .Ed .Pp Dynamic, editable form CFE, override values from first -.Pp .Bd -literal -offset indent hint.nvram.1.flags=0x05 # Broadcom + nocheck hint.nvram.1.base=0x1cff8000 Modified: head/share/man/man4/oce.4 ============================================================================== --- head/share/man/man4/oce.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/oce.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -90,7 +90,6 @@ Firmware can be updated by following the .Bl -enum .It Copy the below code to a Makefile: -.Pp .Bd -literal -offset indent \&.KMOD=elxflash FIRMWS=imagename.ufi:elxflash Modified: head/share/man/man4/ppbus.4 ============================================================================== --- head/share/man/man4/ppbus.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/ppbus.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -61,7 +61,6 @@ that allows parallel port access from ou with kernel-in drivers. .El .Ss Developing new drivers -.Pp The ppbus system has been designed to support the development of standard and non-standard software: .Pp @@ -74,7 +73,6 @@ It uses standard and non-standard parall .It Sy lpbb Ta "Philips official parallel port I2C bit-banging interface" .El .Ss Porting existing drivers -.Pp Another approach to the ppbus system is to port existing drivers. Various drivers have already been ported: .Pp @@ -274,7 +272,6 @@ propose an arch-independent interface to Finally, the .Em device layer gathers the parallel peripheral device drivers. -.Pp .Ss Parallel modes management We have to differentiate operating modes at various ppbus system layers. Actually, ppbus and adapter operating modes on one hands and for each Modified: head/share/man/man4/snd_emu10kx.4 ============================================================================== --- head/share/man/man4/snd_emu10kx.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/snd_emu10kx.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -164,7 +164,6 @@ DSP inputs 0..8: .It +0x3E sync substream (0xc0de) .El -.Pp .Ss Audigy substream map (in byte offsets, each substream is 2 bytes LE) .Bl -tag -width ".Dv +0x00..+0x3E" .It Dv Offset @@ -286,7 +285,6 @@ The device driver and this manual page were written by .An Yuriy Tsibizov . .Sh BUGS -.Pp The driver does not detect lost S/PDIF signals and produces noise when S/PDIF is not connected and S/PDIF volume is not zero. .Pp Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/snd_hda.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -480,7 +480,6 @@ Recording on will go from two external microphones and line-in jacks. .Li pcm1 playback will go to the internal speaker. -.Pp .Ss Example 2 Setting the .Xr device.hints 5 @@ -503,7 +502,6 @@ The .Li pcm1 device will be completely dedicated to a headset (headphones and mic) connected to the front connectors. -.Pp .Ss Example 3 Setting the .Xr device.hints 5 @@ -527,7 +525,6 @@ will give 4 independent devices: and .Li pcm3 .Pq internal speaker . -.Pp .Ss Example 4 Setting the .Xr device.hints 5 Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man4/u3g.4 Sat Mar 24 13:37:57 2012 (r233422) @@ -93,7 +93,6 @@ switching automatically, please try to a .Xr usbconfig 8 and .Xr usb_quirk 4 . -.Pp .Sh SEE ALSO .Xr tty 4 , .Xr ucom 4 , Modified: head/share/man/man7/mailaddr.7 ============================================================================== --- head/share/man/man7/mailaddr.7 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man7/mailaddr.7 Sat Mar 24 13:37:57 2012 (r233422) @@ -66,7 +66,6 @@ For example, a user on ``calder.berkeley without adding the ``berkeley.edu'' since it is the same on both sending and receiving hosts. .Ss Compatibility. -.Pp Certain old address formats are converted to the new format to provide compatibility with the previous mail system. In particular, @@ -94,16 +93,13 @@ is converted to .Pp This is normally converted back to the ``host!user'' form before being sent on for compatibility with older UUCP hosts. -.Pp .Ss Case Distinctions. -.Pp Domain names (i.e., anything after the ``@'' sign) may be given in any mixture of upper and lower case with the exception of UUCP hostnames. Most hosts accept any combination of case in user names, with the notable exception of MULTICS sites. .Ss Route-addrs. -.Pp Under some circumstances it may be necessary to route a message through several hosts to get it to the final destination. Normally this routing @@ -134,11 +130,9 @@ Many sites also support the ``percent ha .Pp is routed as indicated in the previous example. .Ss Postmaster. -.Pp Every site is required to have a user or user alias designated ``postmaster'' to which problems with the mail system may be addressed. .Ss Other Networks. -.Pp Some other networks can be reached by giving the name of the network as the last component of the domain. .Em This is not a standard feature Modified: head/share/man/man9/DB_COMMAND.9 ============================================================================== --- head/share/man/man9/DB_COMMAND.9 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man9/DB_COMMAND.9 Sat Mar 24 13:37:57 2012 (r233422) @@ -42,7 +42,6 @@ .Fn DB_SHOW_COMMAND "command_name" "command_function" .Fn DB_SHOW_ALL_COMMAND "command_name" "command_function" .Sh DESCRIPTION -.Pp The .Fn DB_COMMAND macro adds Modified: head/share/man/man9/fail.9 ============================================================================== --- head/share/man/man9/fail.9 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man9/fail.9 Sat Mar 24 13:37:57 2012 (r233422) @@ -165,7 +165,6 @@ term only cascades when passed a non-zer A pid can optionally be specified. The fail point term is only executed when invoked by a process with a matching p_pid. -.Pp .Sh EXAMPLES .Bl -tag .It Sy sysctl debug.fail_point.foobar="2.1%return(5)" Modified: head/share/man/man9/lock.9 ============================================================================== --- head/share/man/man9/lock.9 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man9/lock.9 Sat Mar 24 13:37:57 2012 (r233422) @@ -299,7 +299,6 @@ Assert that the current thread has a rec Assert that the current thread does not have a recursed lock on .Fa lkp . .El -.Pp .Sh RETURN VALUES The .Fn lockmgr Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man9/locking.9 Sat Mar 24 13:37:57 2012 (r233422) @@ -235,7 +235,6 @@ mutex before the function returns. See .Xr sleep 9 for details. -.Pp .Ss Lockmanager locks Shared/exclusive locks, used mostly in .Xr VFS 9 , Modified: head/share/man/man9/make_dev.9 ============================================================================== --- head/share/man/man9/make_dev.9 Sat Mar 24 13:11:58 2012 (r233421) +++ head/share/man/man9/make_dev.9 Sat Mar 24 13:37:57 2012 (r233422) @@ -369,7 +369,6 @@ The .Dv MAKEDEV_CHECKNAME flag was specified and the provided device name already exists. .El -.Pp .Sh SEE ALSO .Xr devctl 4 , .Xr devfs 5 , From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 15:15:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8DA01065673; Sat, 24 Mar 2012 15:15:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A45238FC1E; Sat, 24 Mar 2012 15:15:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OFFYc9037677; Sat, 24 Mar 2012 15:15:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OFFY70037675; Sat, 24 Mar 2012 15:15:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203241515.q2OFFY70037675@svn.freebsd.org> From: Marius Strobl Date: Sat, 24 Mar 2012 15:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233423 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 15:15:34 -0000 Author: marius Date: Sat Mar 24 15:15:34 2012 New Revision: 233423 URL: http://svn.freebsd.org/changeset/base/233423 Log: Initialize the mutexes used for the NVM and the swflag as MTX_DUPOK in order to avoid otherwise harmless witness warnings when these are acquired at the same time and due to both using MTX_NETWORK_LOCK as their type. The right fix actually would be to use different, descriptive types for these. However, the latter would require undesirable changes to the shared code base. Another approach would be to just supply NULL as the type, which was deemed as less desirable though as it would cause the unique but cryptic name also to be used for the type and to diverge from the type used by other network device drivers. MFC after: 1 week Modified: head/sys/dev/e1000/e1000_osdep.h Modified: head/sys/dev/e1000/e1000_osdep.h ============================================================================== --- head/sys/dev/e1000/e1000_osdep.h Sat Mar 24 13:37:57 2012 (r233422) +++ head/sys/dev/e1000/e1000_osdep.h Sat Mar 24 15:15:34 2012 (r233423) @@ -84,7 +84,8 @@ /* Mutex used in the shared code */ #define E1000_MUTEX struct mtx #define E1000_MUTEX_INIT(mutex) mtx_init((mutex), #mutex, \ - MTX_NETWORK_LOCK, MTX_DEF) + MTX_NETWORK_LOCK, \ + MTX_DEF | MTX_DUPOK) #define E1000_MUTEX_DESTROY(mutex) mtx_destroy(mutex) #define E1000_MUTEX_LOCK(mutex) mtx_lock(mutex) #define E1000_MUTEX_TRYLOCK(mutex) mtx_trylock(mutex) From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 15:17:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 908E3106566B; Sat, 24 Mar 2012 15:17:19 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61FFD8FC14; Sat, 24 Mar 2012 15:17:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OFHJh6037765; Sat, 24 Mar 2012 15:17:19 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OFHJI1037763; Sat, 24 Mar 2012 15:17:19 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201203241517.q2OFHJI1037763@svn.freebsd.org> From: Joel Dahl Date: Sat, 24 Mar 2012 15:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233424 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 15:17:19 -0000 Author: joel (doc committer) Date: Sat Mar 24 15:17:18 2012 New Revision: 233424 URL: http://svn.freebsd.org/changeset/base/233424 Log: Minor mdoc fixes. Modified: head/lib/libusb/libusb.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Sat Mar 24 15:15:34 2012 (r233423) +++ head/lib/libusb/libusb.3 Sat Mar 24 15:17:18 2012 (r233424) @@ -43,7 +43,6 @@ The library contains interfaces for directly managing a usb device. The current implementation supports v1.0 of the libusb API. .Sh LIBRARY INITIALISATION / DEINITIALISATION -.Pp .Ft int .Fn libusb_init libusb_context **ctx This function initialises libusb. @@ -270,9 +269,7 @@ LIBUSB_ERROR_NO_DEVICE if the device has been disconnected, LIBUSB_ERROR_BUSY if the driver cannot be attached because the interface is claimed by a program or driver and a LIBUSB_ERROR code on failure. -.Pp .Sh USB DESCRIPTORS -.Pp .Ft int .Fn libusb_get_device_descriptor "libusb_device *dev" "libusb_device_descriptor *desc" Get the USB device descriptor for the device @@ -349,9 +346,7 @@ libusb_free_bos_descriptor function. .Ft void .Fn libusb_free_bos_descriptor "libusb_bos_descriptor *bos" This function is NULL safe and frees a parsed BOS descriptor. -.Pp .Sh USB ASYNCHRONOUS I/O -.Pp .Ft struct libusb_transfer * .Fn libusb_alloc_transfer "int iso_packets" Allocate a transfer with the number of isochronous packet descriptors @@ -374,9 +369,7 @@ LIBUSB_ERROR code on other failure. .Fn libusb_cancel_transfer "struct libusb_transfer *tr" This function asynchronously cancels a transfer. Returns 0 on success and a LIBUSB_ERROR code on failure. -.Pp .Sh USB SYNCHRONOUS I/O -.Pp .Ft int .Fn libusb_control_transfer "libusb_device_handle *devh" "uint8_t bmRequestType" "uint8_t bRequest" "uint16_t wValue" "uint16_t wIndex" "unsigned char *data" "uint16_t wLength" "unsigned int timeout" Perform a USB control transfer. @@ -411,9 +404,7 @@ if the transfer timed out, LIBUSB_ERROR_ supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on other failure. -.Pp .Sh USB EVENTS -.Pp .Ft int .Fn libusb_try_lock_events "libusb_context *ctx" Try to acquire the event handling lock. @@ -429,7 +420,7 @@ This function is blocking. Release the event handling lock. This will wake up any thread blocked on -.B libusb_wait_for_event() . +.Fn libusb_wait_for_event . .Pp .Ft int .Fn libusb_event_handling_ok "libusb_context *ctx" @@ -506,7 +497,6 @@ Retrive a list of file descriptors that libusb event sources. Returns a NULL-terminated list on success or NULL on failure. .Sh LIBUSB VERSION 0.1 COMPATIBILITY -.Pp The library is also compliant with LibUSB version 0.1.12. .Pp .Fn usb_open From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 15:54:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 705F2106564A; Sat, 24 Mar 2012 15:54:29 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id CC8468FC15; Sat, 24 Mar 2012 15:54:28 +0000 (UTC) Received: by qcsg15 with SMTP id g15so3012734qcs.13 for ; Sat, 24 Mar 2012 08:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=NrO6jA0RKY8JViD4QUStz/rJfzSioKTL9qi9rpWxqfY=; b=obO+WjMGDvW4gd29LeD0yA99/Kt0lhUCr8/PYDpBxyIeSxASCizwkkHB4g0vExv98D Ct+ogBUHh4z1FJd4P2xnSwqILVRZxklRh+lcOij+PopIAJSTP43FCZUc6TaexiUY/p2t DeFucc2pNiV+lpUoNUKylzN1Lj0f8I5jesD8XaPbnVi68+Y+FSj5atqCLO7xscNBlZy4 Pqm9H0I7jCzVFK+diRFB1bfhTYlgV7vl1pjWXjwFibVlaWD6Wr/lm9TXwUkHhMmsMSJ5 UswAwjaJyixoOOWLs43c9GsRHBGC/Yd6RybpJCSUz4IywVM5ACY50FWi8OnPu1TYbF1h EgTw== Received: by 10.229.77.36 with SMTP id e36mr6049042qck.138.1332604468156; Sat, 24 Mar 2012 08:54:28 -0700 (PDT) Received: from kan.dyndns.org (c-24-63-226-98.hsd1.ma.comcast.net. [24.63.226.98]) by mx.google.com with ESMTPS id i19sm19875317qad.19.2012.03.24.08.54.26 (version=SSLv3 cipher=OTHER); Sat, 24 Mar 2012 08:54:27 -0700 (PDT) Date: Sat, 24 Mar 2012 11:54:21 -0400 From: Alexander Kabaev To: David Chisnall Message-ID: <20120324115421.28471627@kan.dyndns.org> In-Reply-To: <9FDB5808-2EE9-4F38-86E6-D0C115E7677C@FreeBSD.org> References: <201203232010.q2NKAuIE092217@svn.freebsd.org> <20120323202335.GM2358@deviant.kiev.zoral.com.ua> <20120323164922.0bac354e@kan.dyndns.org> <20120323211038.GR2358@deviant.kiev.zoral.com.ua> <9FDB5808-2EE9-4F38-86E6-D0C115E7677C@FreeBSD.org> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/S=x0uVkXcEP.nQ0c+/EnRt."; protocol="application/pgp-signature" Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r233391 - head/contrib/libstdc++/libsupc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 15:54:29 -0000 --Sig_/S=x0uVkXcEP.nQ0c+/EnRt. Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 23 Mar 2012 23:39:44 +0000 David Chisnall wrote: > On 23 Mar 2012, at 21:10, Konstantin Belousov wrote: >=20 > > The patch just committed made the base-shipped library incompatible > > with the ports and manual libstdc++ builds. >=20 > To clarify - the one shipped in the base system has been incompatible > with the one in ports since late 2007... > That says something about the extend of the breakage, does it not? =20 > In future, however, we will want libstdc++ in ports to be using the > system ABI library (e.g. libcxxrt) so that it can be linked with > libraries using the system C++ stack, so the layout of std::type_info > in its headers doesn't matter too much because it won't be used. >=20 > > I think it is wiser to > > not 'undo the undo', and instead start living with the > > upstream-approved ABI. For symvered library, it does not make any > > difference if you break it in 10.0 or 9.1. >=20 > Not true. The vtable layout can not be symbol versioned > effectively. The std::type_info class is required by the ABI to > exist (and is in libsupc++ / libcxxrt, so is independent of our STL > implementation, either libstdc++ or libc++). Users expect to be able > to cast=20 >=20 > > Also, I think that consumers that depend of the ABI of > > std::typeinfo can be hacked to understand the layout of vtable. >=20 > Supporting both layouts is not really tenable. We need to do one of > the following: >=20 > - Say 'we are going to break this now!' and force people to recompile > libsupc++, libcxxrt, and libobjc2. > - Keep the layout that we currently ship and patch in > ports. >=20 > I don't mind which of these we do since I'm not the one that has to > do the work in ensuring compatibility with ports but it will need to > pick one and then stick to it... >=20 > > I doubt that there are > > many users that utilize typeinfo. >=20 > Yes, to my knowledge there are three, and two of them are me :-( >=20 I will support the switch to 'default' ABI used upstream, provided David is onboard. The breakage is very limited at the moment and can only grow over time, so will grow the pain, while we insist on being diverged from GCC. We might as well bite the bullet and live through this at the cost of 9.1 release errata that only affects libobjc2. --=20 Alexander Kabaev --Sig_/S=x0uVkXcEP.nQ0c+/EnRt. Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iD8DBQFPbe4xQ6z1jMm+XZYRAgeaAKCE8v0kgAmHb34tsQu1QEf22TEGkwCfbZt9 dfPEYaIl2nOtHXeXzVShQjs= =TTbU -----END PGP SIGNATURE----- --Sig_/S=x0uVkXcEP.nQ0c+/EnRt.-- From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 16:23:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24859106564A; Sat, 24 Mar 2012 16:23:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E84D8FC18; Sat, 24 Mar 2012 16:23:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OGNLwK039772; Sat, 24 Mar 2012 16:23:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OGNLIb039758; Sat, 24 Mar 2012 16:23:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203241623.q2OGNLIb039758@svn.freebsd.org> From: Marius Strobl Date: Sat, 24 Mar 2012 16:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233425 - head/sys/dev/mpt/mpilib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 16:23:22 -0000 Author: marius Date: Sat Mar 24 16:23:21 2012 New Revision: 233425 URL: http://svn.freebsd.org/changeset/base/233425 Log: Consistently update to the MPI header set version 01.05.20 after r224761. Requested by: mjacob MFC after: 1 week Added: head/sys/dev/mpt/mpilib/mpi_log_fc.h (contents, props changed) head/sys/dev/mpt/mpilib/mpi_log_sas.h (contents, props changed) Deleted: head/sys/dev/mpt/mpilib/mpi_inb.h Modified: head/sys/dev/mpt/mpilib/mpi.h head/sys/dev/mpt/mpilib/mpi_cnfg.h head/sys/dev/mpt/mpilib/mpi_fc.h head/sys/dev/mpt/mpilib/mpi_init.h head/sys/dev/mpt/mpilib/mpi_ioc.h head/sys/dev/mpt/mpilib/mpi_lan.h head/sys/dev/mpt/mpilib/mpi_raid.h head/sys/dev/mpt/mpilib/mpi_sas.h head/sys/dev/mpt/mpilib/mpi_targ.h head/sys/dev/mpt/mpilib/mpi_tool.h head/sys/dev/mpt/mpilib/mpi_type.h Modified: head/sys/dev/mpt/mpilib/mpi.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi.h Sat Mar 24 15:17:18 2012 (r233424) +++ head/sys/dev/mpt/mpilib/mpi.h Sat Mar 24 16:23:21 2012 (r233425) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ * Title: MPI Message independent structures and definitions * Creation Date: July 27, 2000 * - * mpi.h Version: 01.05.13 + * mpi.h Version: 01.05.17 * * Version History * --------------- @@ -106,6 +106,10 @@ * 03-27-06 01.05.11 Bumped MPI_HEADER_VERSION_UNIT. * 10-11-06 01.05.12 Bumped MPI_HEADER_VERSION_UNIT. * 05-24-07 01.05.13 Bumped MPI_HEADER_VERSION_UNIT. + * 08-07-07 01.05.14 Bumped MPI_HEADER_VERSION_UNIT. + * 01-15-08 01.05.15 Bumped MPI_HEADER_VERSION_UNIT. + * 03-28-08 01.05.16 Bumped MPI_HEADER_VERSION_UNIT. + * 07-11-08 01.05.17 Bumped MPI_HEADER_VERSION_UNIT. * -------------------------------------------------------------------------- */ @@ -136,7 +140,7 @@ /* Note: The major versions of 0xe0 through 0xff are reserved */ /* versioning for this MPI header set */ -#define MPI_HEADER_VERSION_UNIT (0x10) +#define MPI_HEADER_VERSION_UNIT (0x14) #define MPI_HEADER_VERSION_DEV (0x00) #define MPI_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI_HEADER_VERSION_UNIT_SHIFT (8) Modified: head/sys/dev/mpt/mpilib/mpi_cnfg.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_cnfg.h Sat Mar 24 15:17:18 2012 (r233424) +++ head/sys/dev/mpt/mpilib/mpi_cnfg.h Sat Mar 24 16:23:21 2012 (r233425) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ * Title: MPI Config message, structures, and Pages * Creation Date: July 27, 2000 * - * mpi_cnfg.h Version: 01.05.15 + * mpi_cnfg.h Version: 01.05.19 * * Version History * --------------- @@ -335,6 +335,28 @@ * Expander Page 0 Flags field. * Fixed define for * MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY_DISABLED. + * 08-07-07 01.05.16 Added MPI_IOCPAGE6_CAP_FLAGS_MULTIPORT_DRIVE_SUPPORT + * define. + * Added BIOS Page 4 structure. + * Added MPI_RAID_PHYS_DISK1_PATH_MAX define for RAID + * Physcial Disk Page 1. + * 01-15-07 01.05.17 Added additional bit defines for ExtFlags field of + * Manufacturing Page 4. + * Added Solid State Drives Supported bit to IOC Page 6 + * Capabilities Flags. + * Added new value for AccessStatus field of SAS Device + * Page 0 (_SATA_NEEDS_INITIALIZATION). + * 03-28-08 01.05.18 Defined new bits in Manufacturing Page 4 ExtFlags field + * to control coercion size and the mixing of SAS and SATA + * SSD drives. + * 07-11-08 01.05.19 Added defines MPI_MANPAGE4_EXTFLAGS_RAID0_SINGLE_DRIVE + * and MPI_MANPAGE4_EXTFLAGS_SSD_SCRUB_DISABLE for ExtFlags + * field of Manufacturing Page 4. + * Added defines for a new bit in BIOS Page 1 BiosOptions + * field to control adapter scan order. + * Added BootDeviceWaitTime field to SAS IO Unit Page 2. + * Added MPI_SAS_PHY0_PHYINFO_PHY_VACANT for use in PhyInfo + * field of SAS Expander Page 1. * -------------------------------------------------------------------------- */ @@ -713,6 +735,16 @@ typedef struct _CONFIG_PAGE_MANUFACTURIN #define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01) /* defines for the ExtFlags field */ +#define MPI_MANPAGE4_EXTFLAGS_RAID0_SINGLE_DRIVE (0x0400) +#define MPI_MANPAGE4_EXTFLAGS_SSD_SCRUB_DISABLE (0x0200) +#define MPI_MANPAGE4_EXTFLAGS_MASK_COERCION_SIZE (0x0180) +#define MPI_MANPAGE4_EXTFLAGS_SHIFT_COERCION_SIZE (7) +#define MPI_MANPAGE4_EXTFLAGS_1GB_COERCION_SIZE (0) +#define MPI_MANPAGE4_EXTFLAGS_128MB_COERCION_SIZE (1) + +#define MPI_MANPAGE4_EXTFLAGS_NO_MIX_SSD_SAS_SATA (0x0040) +#define MPI_MANPAGE4_EXTFLAGS_MIX_SSD_AND_NON_SSD (0x0020) +#define MPI_MANPAGE4_EXTFLAGS_DUAL_PORT_SUPPORT (0x0010) #define MPI_MANPAGE4_EXTFLAGS_HIDE_NON_IR_METADATA (0x0008) #define MPI_MANPAGE4_EXTFLAGS_SAS_CACHE_DISABLE (0x0004) #define MPI_MANPAGE4_EXTFLAGS_SATA_CACHE_DISABLE (0x0002) @@ -1186,6 +1218,8 @@ typedef struct _CONFIG_PAGE_IOC_6 /* IOC Page 6 Capabilities Flags */ +#define MPI_IOCPAGE6_CAP_FLAGS_SSD_SUPPORT (0x00000020) +#define MPI_IOCPAGE6_CAP_FLAGS_MULTIPORT_DRIVE_SUPPORT (0x00000010) #define MPI_IOCPAGE6_CAP_FLAGS_DISABLE_SMART_POLLING (0x00000008) #define MPI_IOCPAGE6_CAP_FLAGS_MASK_METADATA_SIZE (0x00000006) @@ -1222,6 +1256,10 @@ typedef struct _CONFIG_PAGE_BIOS_1 #define MPI_BIOSPAGE1_OPTIONS_SPI_ENABLE (0x00000400) #define MPI_BIOSPAGE1_OPTIONS_FC_ENABLE (0x00000200) #define MPI_BIOSPAGE1_OPTIONS_SAS_ENABLE (0x00000100) + +#define MPI_BIOSPAGE1_OPTIONS_SCAN_HIGH_TO_LOW (0x00000002) +#define MPI_BIOSPAGE1_OPTIONS_SCAN_LOW_TO_HIGH (0x00000000) + #define MPI_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) /* values for the IOCSettings field */ @@ -1455,6 +1493,15 @@ typedef struct _CONFIG_PAGE_BIOS_2 #define MPI_BIOSPAGE2_FORM_SAS_WWN (0x05) #define MPI_BIOSPAGE2_FORM_ENCLOSURE_SLOT (0x06) +typedef struct _CONFIG_PAGE_BIOS_4 +{ + CONFIG_PAGE_HEADER Header; /* 00h */ + U64 ReassignmentBaseWWID; /* 04h */ +} CONFIG_PAGE_BIOS_4, MPI_POINTER PTR_CONFIG_PAGE_BIOS_4, + BIOSPage4_t, MPI_POINTER pBIOSPage4_t; + +#define MPI_BIOSPAGE4_PAGEVERSION (0x00) + /**************************************************************************** * SCSI Port Config Pages @@ -2446,6 +2493,15 @@ typedef struct _RAID_PHYS_DISK1_PATH #define MPI_RAID_PHYSDISK1_FLAG_BROKEN (0x0002) #define MPI_RAID_PHYSDISK1_FLAG_INVALID (0x0001) + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check Header.PageLength or NumPhysDiskPaths at runtime. + */ +#ifndef MPI_RAID_PHYS_DISK1_PATH_MAX +#define MPI_RAID_PHYS_DISK1_PATH_MAX (1) +#endif + typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_1 { CONFIG_PAGE_HEADER Header; /* 00h */ @@ -2453,7 +2509,7 @@ typedef struct _CONFIG_PAGE_RAID_PHYS_DI U8 PhysDiskNum; /* 05h */ U16 Reserved2; /* 06h */ U32 Reserved1; /* 08h */ - RAID_PHYS_DISK1_PATH Path[1]; /* 0Ch */ + RAID_PHYS_DISK1_PATH Path[MPI_RAID_PHYS_DISK1_PATH_MAX];/* 0Ch */ } CONFIG_PAGE_RAID_PHYS_DISK_1, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_1, RaidPhysDiskPage1_t, MPI_POINTER pRaidPhysDiskPage1_t; @@ -2578,6 +2634,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_ #define MPI_SAS_IOUNIT0_RATE_SATA_OOB_COMPLETE (0x03) #define MPI_SAS_IOUNIT0_RATE_1_5 (0x08) #define MPI_SAS_IOUNIT0_RATE_3_0 (0x09) +#define MPI_SAS_IOUNIT0_RATE_6_0 (0x0A) /* see mpi_sas.h for values for SAS IO Unit Page 0 ControllerPhyDeviceInfo values */ @@ -2697,7 +2754,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_ { CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ U8 NumDevsPerEnclosure; /* 08h */ - U8 Reserved1; /* 09h */ + U8 BootDeviceWaitTime; /* 09h */ U16 Reserved2; /* 0Ah */ U16 MaxPersistentIDs; /* 0Ch */ U16 NumPersistentIDsUsed; /* 0Eh */ @@ -2707,7 +2764,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_ } CONFIG_PAGE_SAS_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_2, SasIOUnitPage2_t, MPI_POINTER pSasIOUnitPage2_t; -#define MPI_SASIOUNITPAGE2_PAGEVERSION (0x06) +#define MPI_SASIOUNITPAGE2_PAGEVERSION (0x07) /* values for SAS IO Unit Page 2 Status field */ #define MPI_SAS_IOUNIT2_STATUS_DEVICE_LIMIT_EXCEEDED (0x08) @@ -2871,6 +2928,7 @@ typedef struct _CONFIG_PAGE_SAS_DEVICE_0 #define MPI_SAS_DEVICE0_ASTATUS_SATA_INIT_FAILED (0x01) #define MPI_SAS_DEVICE0_ASTATUS_SATA_CAPABILITY_FAILED (0x02) #define MPI_SAS_DEVICE0_ASTATUS_SATA_AFFILIATION_CONFLICT (0x03) +#define MPI_SAS_DEVICE0_ASTATUS_SATA_NEEDS_INITIALIZATION (0x04) /* specific values for SATA Init failures */ #define MPI_SAS_DEVICE0_ASTATUS_SIF_UNKNOWN (0x10) #define MPI_SAS_DEVICE0_ASTATUS_SIF_AFFILIATION_CONFLICT (0x11) @@ -2981,6 +3039,7 @@ typedef struct _CONFIG_PAGE_SAS_PHY_0 #define MPI_SAS_PHY0_FLAGS_SGPIO_DIRECT_ATTACH_ENC (0x01) /* values for SAS PHY Page 0 PhyInfo field */ +#define MPI_SAS_PHY0_PHYINFO_PHY_VACANT (0x80000000) #define MPI_SAS_PHY0_PHYINFO_SATA_PORT_ACTIVE (0x00004000) #define MPI_SAS_PHY0_PHYINFO_SATA_PORT_SELECTOR (0x00002000) #define MPI_SAS_PHY0_PHYINFO_VIRTUAL_PHY (0x00001000) Modified: head/sys/dev/mpt/mpilib/mpi_fc.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_fc.h Sat Mar 24 15:17:18 2012 (r233424) +++ head/sys/dev/mpt/mpilib/mpi_fc.h Sat Mar 24 16:23:21 2012 (r233425) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/mpt/mpilib/mpi_init.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_init.h Sat Mar 24 15:17:18 2012 (r233424) +++ head/sys/dev/mpt/mpilib/mpi_init.h Sat Mar 24 16:23:21 2012 (r233425) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/mpt/mpilib/mpi_ioc.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_ioc.h Sat Mar 24 15:17:18 2012 (r233424) +++ head/sys/dev/mpt/mpilib/mpi_ioc.h Sat Mar 24 16:23:21 2012 (r233425) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -868,6 +868,7 @@ typedef struct _EVENT_DATA_SAS_PHY_LINK_ #define MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE (0x03) #define MPI_EVENT_SAS_PLS_LR_RATE_1_5 (0x08) #define MPI_EVENT_SAS_PLS_LR_RATE_3_0 (0x09) +#define MPI_EVENT_SAS_PLS_LR_RATE_6_0 (0x0A) /* SAS Discovery Event data */ Modified: head/sys/dev/mpt/mpilib/mpi_lan.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_lan.h Sat Mar 24 15:17:18 2012 (r233424) +++ head/sys/dev/mpt/mpilib/mpi_lan.h Sat Mar 24 16:23:21 2012 (r233425) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Added: head/sys/dev/mpt/mpilib/mpi_log_fc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mpt/mpilib/mpi_log_fc.h Sat Mar 24 16:23:21 2012 (r233425) @@ -0,0 +1,117 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon including + * a substantially similar Disclaimer requirement for further binary + * redistribution. + * 3. Neither the name of the LSI Logic Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT + * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * NAME: fc_log.h + * SUMMARY: MPI IocLogInfo definitions for the SYMFC9xx chips + * DESCRIPTION: Contains the enumerated list of values that may be returned + * in the IOCLogInfo field of a MPI Default Reply Message. + * + * CREATION DATE: 6/02/2000 + * ID: $Id: fc_log.h,v 4.6 2001/07/26 14:41:33 sschremm Exp $ + */ + + +/* + * MpiIocLogInfo_t enum + * + * These 32 bit values are used in the IOCLogInfo field of the MPI reply + * messages. + * The value is 0xabcccccc where + * a = The type of log info as per the MPI spec. Since these codes are + * all for Fibre Channel this value will always be 2. + * b = Specifies a subclass of the firmware where + * 0 = FCP Initiator + * 1 = FCP Target + * 2 = LAN + * 3 = MPI Message Layer + * 4 = FC Link + * 5 = Context Manager + * 6 = Invalid Field Offset + * 7 = State Change Info + * all others are reserved for future use + * c = A specific value within the subclass. + * + * NOTE: Any new values should be added to the end of each subclass so that the + * codes remain consistent across firmware releases. + */ +typedef enum _MpiIocLogInfoFc +{ + MPI_IOCLOGINFO_FC_INIT_BASE = 0x20000000, + MPI_IOCLOGINFO_FC_INIT_ERROR_OUT_OF_ORDER_FRAME = 0x20000001, /* received an out of order frame - unsupported */ + MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_START_OF_FRAME = 0x20000002, /* Bad Rx Frame, bad start of frame primative */ + MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_END_OF_FRAME = 0x20000003, /* Bad Rx Frame, bad end of frame primative */ + MPI_IOCLOGINFO_FC_INIT_ERROR_OVER_RUN = 0x20000004, /* Bad Rx Frame, overrun */ + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OTHER = 0x20000005, /* Other errors caught by IOC which require retries */ + MPI_IOCLOGINFO_FC_INIT_ERROR_SUBPROC_DEAD = 0x20000006, /* Main processor could not initialize sub-processor */ + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OVERRUN = 0x20000007, /* Scatter Gather overrun */ + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_BAD_STATUS = 0x20000008, /* Receiver detected context mismatch via invalid header */ + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_UNEXPECTED_FRAME= 0x20000009, /* CtxMgr detected unsupported frame type */ + MPI_IOCLOGINFO_FC_INIT_ERROR_LINK_FAILURE = 0x2000000A, /* Link failure occurred */ + MPI_IOCLOGINFO_FC_INIT_ERROR_TX_TIMEOUT = 0x2000000B, /* Transmitter timeout error */ + + MPI_IOCLOGINFO_FC_TARGET_BASE = 0x21000000, + MPI_IOCLOGINFO_FC_TARGET_NO_PDISC = 0x21000001, /* not sent because we are waiting for a PDISC from the initiator */ + MPI_IOCLOGINFO_FC_TARGET_NO_LOGIN = 0x21000002, /* not sent because we are not logged in to the remote node */ + MPI_IOCLOGINFO_FC_TARGET_DOAR_KILLED_BY_LIP = 0x21000003, /* Data Out, Auto Response, not sent due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_DIAR_KILLED_BY_LIP = 0x21000004, /* Data In, Auto Response, not sent due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_DIAR_MISSING_DATA = 0x21000005, /* Data In, Auto Response, missing data frames */ + MPI_IOCLOGINFO_FC_TARGET_DONR_KILLED_BY_LIP = 0x21000006, /* Data Out, No Response, not sent due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_WRSP_KILLED_BY_LIP = 0x21000007, /* Auto-response after a write not sent due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_DINR_KILLED_BY_LIP = 0x21000008, /* Data In, No Response, not completed due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_DINR_MISSING_DATA = 0x21000009, /* Data In, No Response, missing data frames */ + MPI_IOCLOGINFO_FC_TARGET_MRSP_KILLED_BY_LIP = 0x2100000a, /* Manual Response not sent due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_NO_CLASS_3 = 0x2100000b, /* not sent because remote node does not support Class 3 */ + MPI_IOCLOGINFO_FC_TARGET_LOGIN_NOT_VALID = 0x2100000c, /* not sent because login to remote node not validated */ + MPI_IOCLOGINFO_FC_TARGET_FROM_OUTBOUND = 0x2100000e, /* cleared from the outbound queue after a logout */ + MPI_IOCLOGINFO_FC_TARGET_WAITING_FOR_DATA_IN = 0x2100000f, /* cleared waiting for data after a logout */ + + MPI_IOCLOGINFO_FC_LAN_BASE = 0x22000000, + MPI_IOCLOGINFO_FC_LAN_TRANS_SGL_MISSING = 0x22000001, /* Transaction Context Sgl Missing */ + MPI_IOCLOGINFO_FC_LAN_TRANS_WRONG_PLACE = 0x22000002, /* Transaction Context found before an EOB */ + MPI_IOCLOGINFO_FC_LAN_TRANS_RES_BITS_SET = 0x22000003, /* Transaction Context value has reserved bits set */ + MPI_IOCLOGINFO_FC_LAN_WRONG_SGL_FLAG = 0x22000004, /* Invalid SGL Flags */ + + MPI_IOCLOGINFO_FC_MSG_BASE = 0x23000000, + + MPI_IOCLOGINFO_FC_LINK_BASE = 0x24000000, + MPI_IOCLOGINFO_FC_LINK_LOOP_INIT_TIMEOUT = 0x24000001, /* Loop initialization timed out */ + MPI_IOCLOGINFO_FC_LINK_ALREADY_INITIALIZED = 0x24000002, /* Another system controller already initialized the loop */ + MPI_IOCLOGINFO_FC_LINK_LINK_NOT_ESTABLISHED = 0x24000003, /* Not synchronized to signal or still negotiating (possible cable problem) */ + MPI_IOCLOGINFO_FC_LINK_CRC_ERROR = 0x24000004, /* CRC check detected error on received frame */ + + MPI_IOCLOGINFO_FC_CTX_BASE = 0x25000000, + + MPI_IOCLOGINFO_FC_INVALID_FIELD_BYTE_OFFSET = 0x26000000, /* The lower 24 bits give the byte offset of the field in the request message that is invalid */ + MPI_IOCLOGINFO_FC_INVALID_FIELD_MAX_OFFSET = 0x26ffffff, + + MPI_IOCLOGINFO_FC_STATE_CHANGE = 0x27000000 /* The lower 24 bits give additional information concerning state change */ + +} MpiIocLogInfoFc_t; Added: head/sys/dev/mpt/mpilib/mpi_log_sas.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mpt/mpilib/mpi_log_sas.h Sat Mar 24 16:23:21 2012 (r233425) @@ -0,0 +1,352 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon including + * a substantially similar Disclaimer requirement for further binary + * redistribution. + * 3. Neither the name of the LSI Logic Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT + * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/*************************************************************************** + * * + * Description * + * ------------ * + * This include file contains SAS firmware interface IOC Log Info codes * + * * + *-------------------------------------------------------------------------* + */ + +#ifndef IOPI_IOCLOGINFO_H_INCLUDED +#define IOPI_IOCLOGINFO_H_INCLUDED + +#define SAS_LOGINFO_NEXUS_LOSS 0x31170000 +#define SAS_LOGINFO_MASK 0xFFFF0000 + +/****************************************************************************/ +/* IOC LOGINFO defines, 0x00000000 - 0x0FFFFFFF */ +/* Format: */ +/* Bits 31-28: MPI_IOCLOGINFO_TYPE_SAS (3) */ +/* Bits 27-24: IOC_LOGINFO_ORIGINATOR: 0=IOP, 1=PL, 2=IR */ +/* Bits 23-16: LOGINFO_CODE */ +/* Bits 15-0: LOGINFO_CODE Specific */ +/****************************************************************************/ + +/****************************************************************************/ +/* IOC_LOGINFO_ORIGINATOR defines */ +/****************************************************************************/ +#define IOC_LOGINFO_ORIGINATOR_IOP (0x00000000) +#define IOC_LOGINFO_ORIGINATOR_PL (0x01000000) +#define IOC_LOGINFO_ORIGINATOR_IR (0x02000000) + +#define IOC_LOGINFO_ORIGINATOR_MASK (0x0F000000) + +/****************************************************************************/ +/* LOGINFO_CODE defines */ +/****************************************************************************/ +#define IOC_LOGINFO_CODE_MASK (0x00FF0000) +#define IOC_LOGINFO_CODE_SHIFT (16) + +/****************************************************************************/ +/* IOP LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = IOP */ +/****************************************************************************/ +#define IOP_LOGINFO_CODE_INVALID_SAS_ADDRESS (0x00010000) +#define IOP_LOGINFO_CODE_UNUSED2 (0x00020000) +#define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE (0x00030000) +#define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_RT (0x00030100) /* Route Table Entry not found */ +#define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_PN (0x00030200) /* Invalid Page Number */ +#define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_FORM (0x00030300) /* Invalid FORM */ +#define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_PT (0x00030400) /* Invalid Page Type */ +#define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DNM (0x00030500) /* Device Not Mapped */ +#define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_PERSIST (0x00030600) /* Persistent Page not found */ +#define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DEFAULT (0x00030700) /* Default Page not found */ + +#define IOP_LOGINFO_CODE_FWUPLOAD_NO_FLASH_AVAILABLE (0x0003E000) /* Tried to upload from flash, but there is none */ +#define IOP_LOGINFO_CODE_FWUPLOAD_UNKNOWN_IMAGE_TYPE (0x0003E001) /* ImageType field contents were invalid */ +#define IOP_LOGINFO_CODE_FWUPLOAD_WRONG_IMAGE_SIZE (0x0003E002) /* ImageSize field in TCSGE was bad/offset in MfgPg 4 was wrong */ +#define IOP_LOGINFO_CODE_FWUPLOAD_ENTIRE_FLASH_UPLOAD_FAILED (0x0003E003) /* Error occured while attempting to upload the entire flash */ +#define IOP_LOGINFO_CODE_FWUPLOAD_REGION_UPLOAD_FAILED (0x0003E004) /* Error occured while attempting to upload single flash region */ +#define IOP_LOGINFO_CODE_FWUPLOAD_DMA_FAILURE (0x0003E005) /* Problem occured while DMAing FW to host memory */ + +#define IOP_LOGINFO_CODE_DIAG_MSG_ERROR (0x00040000) /* Error handling diag msg - or'd with diag status */ + +#define IOP_LOGINFO_CODE_TASK_TERMINATED (0x00050000) + +#define IOP_LOGINFO_CODE_ENCL_MGMT_READ_ACTION_ERR0R (0x00060001) /* Read Action not supported for SEP msg */ +#define IOP_LOGINFO_CODE_ENCL_MGMT_INVALID_BUS_ID_ERR0R (0x00060002) /* Invalid Bus/ID in SEP msg */ + +#define IOP_LOGINFO_CODE_TARGET_ASSIST_TERMINATED (0x00070001) +#define IOP_LOGINFO_CODE_TARGET_STATUS_SEND_TERMINATED (0x00070002) +#define IOP_LOGINFO_CODE_TARGET_MODE_ABORT_ALL_IO (0x00070003) +#define IOP_LOGINFO_CODE_TARGET_MODE_ABORT_EXACT_IO (0x00070004) +#define IOP_LOGINFO_CODE_TARGET_MODE_ABORT_EXACT_IO_REQ (0x00070005) + +#define IOP_LOGINFO_CODE_LOG_TIMESTAMP_EVENT (0x00080000) + +/****************************************************************************/ +/* PL LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = PL */ +/****************************************************************************/ +#define PL_LOGINFO_CODE_OPEN_FAILURE (0x00010000) /* see SUB_CODE_OPEN_FAIL_ below */ + +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_NO_DEST_TIME_OUT (0x00000001) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_PATHWAY_BLOCKED (0x00000002) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RES_CONTINUE0 (0x00000003) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RES_CONTINUE1 (0x00000004) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RES_INITIALIZE0 (0x00000005) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RES_INITIALIZE1 (0x00000006) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RES_STOP0 (0x00000007) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RES_STOP1 (0x00000008) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RETRY (0x00000009) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_BREAK (0x0000000A) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_UNUSED_0B (0x0000000B) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_OPEN_TIMEOUT_EXP (0x0000000C) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_UNUSED_0D (0x0000000D) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_DVTBLE_ACCSS_FAIL (0x0000000E) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_BAD_DEST (0x00000011) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RATE_NOT_SUPP (0x00000012) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_PROT_NOT_SUPP (0x00000013) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RESERVED_ABANDON0 (0x00000014) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RESERVED_ABANDON1 (0x00000015) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RESERVED_ABANDON2 (0x00000016) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RESERVED_ABANDON3 (0x00000017) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_STP_RESOURCES_BSY (0x00000018) +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_WRONG_DESTINATION (0x00000019) + +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_PATH_BLOCKED (0x0000001B) /* Retry Timeout */ +#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_AWT_MAXED (0x0000001C) /* Retry Timeout */ + + + +#define PL_LOGINFO_CODE_INVALID_SGL (0x00020000) +#define PL_LOGINFO_CODE_WRONG_REL_OFF_OR_FRAME_LENGTH (0x00030000) +#define PL_LOGINFO_CODE_FRAME_XFER_ERROR (0x00040000) +#define PL_LOGINFO_CODE_TX_FM_CONNECTED_LOW (0x00050000) +#define PL_LOGINFO_CODE_SATA_NON_NCQ_RW_ERR_BIT_SET (0x00060000) +#define PL_LOGINFO_CODE_SATA_READ_LOG_RECEIVE_DATA_ERR (0x00070000) +#define PL_LOGINFO_CODE_SATA_NCQ_FAIL_ALL_CMDS_AFTR_ERR (0x00080000) +#define PL_LOGINFO_CODE_SATA_ERR_IN_RCV_SET_DEV_BIT_FIS (0x00090000) +#define PL_LOGINFO_CODE_RX_FM_INVALID_MESSAGE (0x000A0000) +#define PL_LOGINFO_CODE_RX_CTX_MESSAGE_VALID_ERROR (0x000B0000) +#define PL_LOGINFO_CODE_RX_FM_CURRENT_FRAME_ERROR (0x000C0000) +#define PL_LOGINFO_CODE_SATA_LINK_DOWN (0x000D0000) +#define PL_LOGINFO_CODE_DISCOVERY_SATA_INIT_W_IOS (0x000E0000) +#define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE (0x000F0000) +#define PL_LOGINFO_CODE_CONFIG_PL_NOT_INITIALIZED (0x000F0001) /* PL not yet initialized, can't do config page req. */ +#define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_PT (0x000F0100) /* Invalid Page Type */ +#define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_NUM_PHYS (0x000F0200) /* Invalid Number of Phys */ +#define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_NOT_IMP (0x000F0300) /* Case Not Handled */ +#define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_NO_DEV (0x000F0400) /* No Device Found */ +#define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_FORM (0x000F0500) /* Invalid FORM */ +#define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_PHY (0x000F0600) /* Invalid Phy */ +#define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_NO_OWNER (0x000F0700) /* No Owner Found */ +#define PL_LOGINFO_CODE_DSCVRY_SATA_INIT_TIMEOUT (0x00100000) +#define PL_LOGINFO_CODE_RESET (0x00110000) /* See Sub-Codes below (PL_LOGINFO_SUB_CODE) */ +#define PL_LOGINFO_CODE_ABORT (0x00120000) /* See Sub-Codes below (PL_LOGINFO_SUB_CODE)*/ +#define PL_LOGINFO_CODE_IO_NOT_YET_EXECUTED (0x00130000) +#define PL_LOGINFO_CODE_IO_EXECUTED (0x00140000) +#define PL_LOGINFO_CODE_PERS_RESV_OUT_NOT_AFFIL_OWNER (0x00150000) +#define PL_LOGINFO_CODE_OPEN_TXDMA_ABORT (0x00160000) +#define PL_LOGINFO_CODE_IO_DEVICE_MISSING_DELAY_RETRY (0x00170000) +#define PL_LOGINFO_CODE_IO_CANCELLED_DUE_TO_R_ERR (0x00180000) +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE (0x00000100) +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_NO_DEST_TIMEOUT (0x00000101) +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_SATA_NEG_RATE_2HI (0x00000102) +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_RATE_NOT_SUPPORTED (0x00000103) +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_BREAK (0x00000104) +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_ZONE_VIOLATION (0x00000114) +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_ABANDON0 (0x00000114) /* Open Reject (Zone Violation) - available on SAS-2 devices */ +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_ABANDON1 (0x00000115) +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_ABANDON2 (0x00000116) +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_ABANDON3 (0x00000117) +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_ORR_TIMEOUT (0x0000011A) /* Open Reject (Retry) Timeout */ +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_PATH_BLOCKED (0x0000011B) +#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_AWT_MAXED (0x0000011C) /* Arbitration Wait Timer Maxed */ + +#define PL_LOGINFO_SUB_CODE_TARGET_BUS_RESET (0x00000120) +#define PL_LOGINFO_SUB_CODE_TRANSPORT_LAYER (0x00000130) /* Leave lower nibble (1-f) reserved. */ +#define PL_LOGINFO_SUB_CODE_PORT_LAYER (0x00000140) /* Leave lower nibble (1-f) reserved. */ + + +#define PL_LOGINFO_SUB_CODE_INVALID_SGL (0x00000200) +#define PL_LOGINFO_SUB_CODE_WRONG_REL_OFF_OR_FRAME_LENGTH (0x00000300) +#define PL_LOGINFO_SUB_CODE_FRAME_XFER_ERROR (0x00000400) /* Bits 0-3 encode Transport Status Register (offset 0x08) */ + /* Bit 0 is Status Bit 0: FrameXferErr */ + /* Bit 1 & 2 are Status Bits 16 and 17: FrameXmitErrStatus */ + /* Bit 3 is Status Bit 18 WriteDataLenghtGTDataLengthErr */ + +#define PL_LOGINFO_SUB_CODE_TX_FM_CONNECTED_LOW (0x00000500) +#define PL_LOGINFO_SUB_CODE_SATA_NON_NCQ_RW_ERR_BIT_SET (0x00000600) +#define PL_LOGINFO_SUB_CODE_SATA_READ_LOG_RECEIVE_DATA_ERR (0x00000700) +#define PL_LOGINFO_SUB_CODE_SATA_NCQ_FAIL_ALL_CMDS_AFTR_ERR (0x00000800) +#define PL_LOGINFO_SUB_CODE_SATA_ERR_IN_RCV_SET_DEV_BIT_FIS (0x00000900) +#define PL_LOGINFO_SUB_CODE_RX_FM_INVALID_MESSAGE (0x00000A00) +#define PL_LOGINFO_SUB_CODE_RX_CTX_MESSAGE_VALID_ERROR (0x00000B00) +#define PL_LOGINFO_SUB_CODE_RX_FM_CURRENT_FRAME_ERROR (0x00000C00) +#define PL_LOGINFO_SUB_CODE_SATA_LINK_DOWN (0x00000D00) +#define PL_LOGINFO_SUB_CODE_DISCOVERY_SATA_INIT_W_IOS (0x00000E00) +#define PL_LOGINFO_SUB_CODE_DISCOVERY_REMOTE_SEP_RESET (0x00000E01) +#define PL_LOGINFO_SUB_CODE_SECOND_OPEN (0x00000F00) +#define PL_LOGINFO_SUB_CODE_DSCVRY_SATA_INIT_TIMEOUT (0x00001000) +#define PL_LOGINFO_SUB_CODE_BREAK_ON_SATA_CONNECTION (0x00002000) /* not currently used in mainline */ +#define PL_LOGINFO_SUB_CODE_BREAK_ON_STUCK_LINK (0x00003000) +#define PL_LOGINFO_SUB_CODE_BREAK_ON_STUCK_LINK_AIP (0x00004000) +#define PL_LOGINFO_SUB_CODE_BREAK_ON_INCOMPLETE_BREAK_RCVD (0x00005000) + +#define PL_LOGINFO_CODE_ENCL_MGMT_SMP_FRAME_FAILURE (0x00200000) /* Can't get SMP Frame */ +#define PL_LOGINFO_CODE_ENCL_MGMT_SMP_READ_ERROR (0x00200010) /* Error occured on SMP Read */ +#define PL_LOGINFO_CODE_ENCL_MGMT_SMP_WRITE_ERROR (0x00200020) /* Error occured on SMP Write */ +#define PL_LOGINFO_CODE_ENCL_MGMT_NOT_SUPPORTED_ON_ENCL (0x00200040) /* Encl Mgmt services not available for this WWID */ +#define PL_LOGINFO_CODE_ENCL_MGMT_ADDR_MODE_NOT_SUPPORTED (0x00200050) /* Address Mode not suppored */ +#define PL_LOGINFO_CODE_ENCL_MGMT_BAD_SLOT_NUM (0x00200060) /* Invalid Slot Number in SEP Msg */ +#define PL_LOGINFO_CODE_ENCL_MGMT_SGPIO_NOT_PRESENT (0x00200070) /* SGPIO not present/enabled */ +#define PL_LOGINFO_CODE_ENCL_MGMT_GPIO_NOT_CONFIGURED (0x00200080) /* GPIO not configured */ +#define PL_LOGINFO_CODE_ENCL_MGMT_GPIO_FRAME_ERROR (0x00200090) /* GPIO can't allocate a frame */ +#define PL_LOGINFO_CODE_ENCL_MGMT_GPIO_CONFIG_PAGE_ERROR (0x002000A0) /* GPIO failed config page request */ +#define PL_LOGINFO_CODE_ENCL_MGMT_SES_FRAME_ALLOC_ERROR (0x002000B0) /* Can't get frame for SES command */ +#define PL_LOGINFO_CODE_ENCL_MGMT_SES_IO_ERROR (0x002000C0) /* I/O execution error */ +#define PL_LOGINFO_CODE_ENCL_MGMT_SES_RETRIES_EXHAUSTED (0x002000D0) /* SEP I/O retries exhausted */ +#define PL_LOGINFO_CODE_ENCL_MGMT_SMP_FRAME_ALLOC_ERROR (0x002000E0) /* Can't get frame for SMP command */ + +#define PL_LOGINFO_DA_SEP_NOT_PRESENT (0x00200100) /* SEP not present when msg received */ +#define PL_LOGINFO_DA_SEP_SINGLE_THREAD_ERROR (0x00200101) /* Can only accept 1 msg at a time */ +#define PL_LOGINFO_DA_SEP_ISTWI_INTR_IN_IDLE_STATE (0x00200102) /* ISTWI interrupt recvd. while IDLE */ +#define PL_LOGINFO_DA_SEP_RECEIVED_NACK_FROM_SLAVE (0x00200103) /* SEP NACK'd, it is busy */ +#define PL_LOGINFO_DA_SEP_DID_NOT_RECEIVE_ACK (0x00200104) /* SEP didn't rcv. ACK (Last Rcvd Bit = 1) */ +#define PL_LOGINFO_DA_SEP_BAD_STATUS_HDR_CHKSUM (0x00200105) /* SEP stopped or sent bad chksum in Hdr */ +#define PL_LOGINFO_DA_SEP_STOP_ON_DATA (0x00200106) /* SEP stopped while transfering data */ +#define PL_LOGINFO_DA_SEP_STOP_ON_SENSE_DATA (0x00200107) /* SEP stopped while transfering sense data */ +#define PL_LOGINFO_DA_SEP_UNSUPPORTED_SCSI_STATUS_1 (0x00200108) /* SEP returned unknown scsi status */ +#define PL_LOGINFO_DA_SEP_UNSUPPORTED_SCSI_STATUS_2 (0x00200109) /* SEP returned unknown scsi status */ +#define PL_LOGINFO_DA_SEP_CHKSUM_ERROR_AFTER_STOP (0x0020010A) /* SEP returned bad chksum after STOP */ +#define PL_LOGINFO_DA_SEP_CHKSUM_ERROR_AFTER_STOP_GETDATA (0x0020010B) /* SEP returned bad chksum after STOP while gettin data*/ +#define PL_LOGINFO_DA_SEP_UNSUPPORTED_COMMAND (0x0020010C) /* SEP doesn't support CDB opcode f/w location 1 */ +#define PL_LOGINFO_DA_SEP_UNSUPPORTED_COMMAND_2 (0x0020010D) /* SEP doesn't support CDB opcode f/w location 2 */ +#define PL_LOGINFO_DA_SEP_UNSUPPORTED_COMMAND_3 (0x0020010E) /* SEP doesn't support CDB opcode f/w location 3 */ + + +/****************************************************************************/ +/* IR LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = IR */ +/****************************************************************************/ +#define IR_LOGINFO_RAID_ACTION_ERROR (0x00010000) +#define IR_LOGINFO_CODE_UNUSED2 (0x00020000) + +/* Amount of information passed down for Create Volume is too large */ +#define IR_LOGINFO_VOLUME_CREATE_INVALID_LENGTH (0x00010001) +/* Creation of duplicate volume attempted (Bus/Target ID checked) */ +#define IR_LOGINFO_VOLUME_CREATE_DUPLICATE (0x00010002) +/* Creation failed due to maximum number of supported volumes exceeded */ +#define IR_LOGINFO_VOLUME_CREATE_NO_SLOTS (0x00010003) +/* Creation failed due to DMA error in trying to read from host */ +#define IR_LOGINFO_VOLUME_CREATE_DMA_ERROR (0x00010004) +/* Creation failed due to invalid volume type passed down */ +#define IR_LOGINFO_VOLUME_CREATE_INVALID_VOLUME_TYPE (0x00010005) +/* Creation failed due to error reading MFG Page 4 */ +#define IR_LOGINFO_VOLUME_MFG_PAGE4_ERROR (0x00010006) +/* Creation failed when trying to create internal structures */ +#define IR_LOGINFO_VOLUME_INTERNAL_CONFIG_STRUCTURE_ERROR (0x00010007) + +/* Activation failed due to trying to activate an already active volume */ +#define IR_LOGINFO_VOLUME_ACTIVATING_AN_ACTIVE_VOLUME (0x00010010) +/* Activation failed due to trying to active unsupported volume type */ +#define IR_LOGINFO_VOLUME_ACTIVATING_INVALID_VOLUME_TYPE (0x00010011) +/* Activation failed due to trying to active too many volumes */ +#define IR_LOGINFO_VOLUME_ACTIVATING_TOO_MANY_VOLUMES (0x00010012) +/* Activation failed due to Volume ID in use already */ +#define IR_LOGINFO_VOLUME_ACTIVATING_VOLUME_ID_IN_USE (0x00010013) +/* Activation failed call to activateVolume returned failure */ +#define IR_LOGINFO_VOLUME_ACTIVATE_VOLUME_FAILED (0x00010014) +/* Activation failed trying to import the volume */ +#define IR_LOGINFO_VOLUME_ACTIVATING_IMPORT_VOLUME_FAILED (0x00010015) +/* Activation failed trying to import the volume */ +#define IR_LOGINFO_VOLUME_ACTIVATING_TOO_MANY_PHYS_DISKS (0x00010016) + +/* Phys Disk failed, too many phys disks */ +#define IR_LOGINFO_PHYSDISK_CREATE_TOO_MANY_DISKS (0x00010020) +/* Amount of information passed down for Create Pnysdisk is too large */ +#define IR_LOGINFO_PHYSDISK_CREATE_INVALID_LENGTH (0x00010021) +/* Creation failed due to DMA error in trying to read from host */ +#define IR_LOGINFO_PHYSDISK_CREATE_DMA_ERROR (0x00010022) +/* Creation failed due to invalid Bus TargetID passed down */ +#define IR_LOGINFO_PHYSDISK_CREATE_BUS_TID_INVALID (0x00010023) +/* Creation failed due to error in creating RAID Phys Disk Config Page */ +#define IR_LOGINFO_PHYSDISK_CREATE_CONFIG_PAGE_ERROR (0x00010024) + + +/* Compatibility Error : IR Disabled */ +#define IR_LOGINFO_COMPAT_ERROR_RAID_DISABLED (0x00010030) +/* Compatibility Error : Inquiry Comand failed */ +#define IR_LOGINFO_COMPAT_ERROR_INQUIRY_FAILED (0x00010031) +/* Compatibility Error : Device not direct access device */ +#define IR_LOGINFO_COMPAT_ERROR_NOT_DIRECT_ACCESS (0x00010032) +/* Compatibility Error : Removable device found */ +#define IR_LOGINFO_COMPAT_ERROR_REMOVABLE_FOUND (0x00010033) +/* Compatibility Error : Device SCSI Version not 2 or higher */ +#define IR_LOGINFO_COMPAT_ERROR_NEED_SCSI_2_OR_HIGHER (0x00010034) +/* Compatibility Error : SATA device, 48 BIT LBA not supported */ +#define IR_LOGINFO_COMPAT_ERROR_SATA_48BIT_LBA_NOT_SUPPORTED (0x00010035) +/* Compatibility Error : Device does not have 512 byte block sizes */ +#define IR_LOGINFO_COMPAT_ERROR_DEVICE_NOT_512_BYTE_BLOCK (0x00010036) +/* Compatibility Error : Volume Type check failed */ +#define IR_LOGINFO_COMPAT_ERROR_VOLUME_TYPE_CHECK_FAILED (0x00010037) +/* Compatibility Error : Volume Type is unsupported by FW */ +#define IR_LOGINFO_COMPAT_ERROR_UNSUPPORTED_VOLUME_TYPE (0x00010038) +/* Compatibility Error : Disk drive too small for use in volume */ +#define IR_LOGINFO_COMPAT_ERROR_DISK_TOO_SMALL (0x00010039) +/* Compatibility Error : Phys disk for Create Volume not found */ +#define IR_LOGINFO_COMPAT_ERROR_PHYS_DISK_NOT_FOUND (0x0001003A) +/* Compatibility Error : membership count error, too many or too few disks for volume type */ +#define IR_LOGINFO_COMPAT_ERROR_MEMBERSHIP_COUNT (0x0001003B) +/* Compatibility Error : Disk stripe sizes must be 64KB */ +#define IR_LOGINFO_COMPAT_ERROR_NON_64K_STRIPE_SIZE (0x0001003C) +/* Compatibility Error : IME size limited to < 2TB */ +#define IR_LOGINFO_COMPAT_ERROR_IME_VOL_NOT_CURRENTLY_SUPPORTED (0x0001003D) + +/* Device Firmware Update: DFU can only be started once */ +#define IR_LOGINFO_DEV_FW_UPDATE_ERR_DFU_IN_PROGRESS (0x00010050) +/* Device Firmware Update: Volume must be Optimal/Active/non-Quiesced */ +#define IR_LOGINFO_DEV_FW_UPDATE_ERR_DEVICE_IN_INVALID_STATE (0x00010051) +/* Device Firmware Update: DFU Timeout cannot be zero */ +#define IR_LOGINFO_DEV_FW_UPDATE_ERR_INVALID_TIMEOUT (0x00010052) +/* Device Firmware Update: CREATE TIMER FAILED */ +#define IR_LOGINFO_DEV_FW_UPDATE_ERR_NO_TIMERS (0x00010053) +/* Device Firmware Update: Failed to read SAS_IO_UNIT_PG_1 */ +#define IR_LOGINFO_DEV_FW_UPDATE_ERR_READING_CFG_PAGE (0x00010054) +/* Device Firmware Update: Invalid SAS_IO_UNIT_PG_1 value(s) */ +#define IR_LOGINFO_DEV_FW_UPDATE_ERR_PORT_IO_TIMEOUTS_REQUIRED (0x00010055) +/* Device Firmware Update: Unable to allocate memory for page */ +#define IR_LOGINFO_DEV_FW_UPDATE_ERR_ALLOC_CFG_PAGE (0x00010056) +/* Device Firmware Update: */ +//#define IR_LOGINFO_DEV_FW_UPDATE_ERR_ (0x00010054) + + +/****************************************************************************/ +/* Defines for convenience */ +/****************************************************************************/ +#define IOC_LOGINFO_PREFIX_IOP ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_IOP) +#define IOC_LOGINFO_PREFIX_PL ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_PL) +#define IOC_LOGINFO_PREFIX_IR ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_IR) + +#endif /* end of file */ + Modified: head/sys/dev/mpt/mpilib/mpi_raid.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_raid.h Sat Mar 24 15:17:18 2012 (r233424) +++ head/sys/dev/mpt/mpilib/mpi_raid.h Sat Mar 24 16:23:21 2012 (r233425) @@ -33,7 +33,7 @@ * Title: MPI RAID message and structures * Creation Date: February 27, 2001 * - * mpi_raid.h Version: 01.05.03 + * mpi_raid.h Version: 01.05.05 * * Version History * --------------- @@ -61,6 +61,9 @@ * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE. * 02-28-07 01.05.03 Added new RAID Action, Device FW Update Mode, and * associated defines. + * 08-07-07 01.05.04 Added Disable Full Rebuild bit to the ActionDataWord + * for the RAID Action MPI_RAID_ACTION_DISABLE_VOLUME. + * 01-15-08 01.05.05 Added define for MPI_RAID_ACTION_SET_VOLUME_NAME. * -------------------------------------------------------------------------- */ @@ -120,6 +123,7 @@ typedef struct _MSG_RAID_ACTION #define MPI_RAID_ACTION_SET_RESYNC_RATE (0x13) #define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE (0x14) #define MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE (0x15) +#define MPI_RAID_ACTION_SET_VOLUME_NAME (0x16) /* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */ #define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001) @@ -132,6 +136,9 @@ typedef struct _MSG_RAID_ACTION #define MPI_RAID_ACTION_ADATA_KEEP_LBA0 (0x00000000) #define MPI_RAID_ACTION_ADATA_ZERO_LBA0 (0x00000002) +/* ActionDataWord defines for use with MPI_RAID_ACTION_DISABLE_VOLUME action */ +#define MPI_RAID_ACTION_ADATA_DISABLE_FULL_REBUILD (0x00000001) + /* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */ #define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL (0x00000001) Modified: head/sys/dev/mpt/mpilib/mpi_sas.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_sas.h Sat Mar 24 15:17:18 2012 (r233424) +++ head/sys/dev/mpt/mpilib/mpi_sas.h Sat Mar 24 16:23:21 2012 (r233425) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ * Title: MPI Serial Attached SCSI structures and definitions * Creation Date: August 19, 2004 * - * mpi_sas.h Version: 01.05.04 + * mpi_sas.h Version: 01.05.05 * * Version History * --------------- @@ -50,6 +50,10 @@ * reply. * 10-11-06 01.05.04 Fixed the name of a define for Operation field of SAS IO * Unit Control request. + * 01-15-08 01.05.05 Added support for MPI_SAS_OP_SET_IOC_PARAMETER, + * including adding IOCParameter and IOCParameter value + * fields to SAS IO Unit Control Request. + * Added MPI_SAS_DEVICE_INFO_PRODUCT_SPECIFIC define. * -------------------------------------------------------------------------- */ @@ -87,6 +91,8 @@ * Values for the SAS DeviceInfo field used in SAS Device Status Change Event * data and SAS IO Unit Configuration pages. */ +#define MPI_SAS_DEVICE_INFO_PRODUCT_SPECIFIC (0xF0000000) + #define MPI_SAS_DEVICE_INFO_SEP (0x00004000) #define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000) #define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000) @@ -243,7 +249,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_R U8 ChainOffset; /* 02h */ U8 Function; /* 03h */ U16 DevHandle; /* 04h */ - U8 Reserved3; /* 06h */ + U8 IOCParameter; /* 06h */ U8 MsgFlags; /* 07h */ U32 MsgContext; /* 08h */ U8 TargetID; /* 0Ch */ @@ -252,7 +258,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_R U8 PrimFlags; /* 0Fh */ U32 Primitive; /* 10h */ U64 SASAddress; /* 14h */ - U32 Reserved4; /* 1Ch */ + U32 IOCParameterValue; /* 1Ch */ } MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST, SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t; @@ -268,6 +274,8 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_R #define MPI_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL (0x0C) #define MPI_SAS_OP_TRANSMIT_REMOVE_DEVICE (0x0D) /* obsolete name */ #define MPI_SAS_OP_REMOVE_DEVICE (0x0D) +#define MPI_SAS_OP_SET_IOC_PARAMETER (0x0E) +#define MPI_SAS_OP_PRODUCT_SPECIFIC_MIN (0x80) /* values for the PrimFlags field */ #define MPI_SAS_PRIMFLAGS_SINGLE (0x08) @@ -283,7 +291,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_R U8 MsgLength; /* 02h */ U8 Function; /* 03h */ U16 DevHandle; /* 04h */ - U8 Reserved3; /* 06h */ + U8 IOCParameter; /* 06h */ U8 MsgFlags; /* 07h */ U32 MsgContext; /* 08h */ U16 Reserved4; /* 0Ch */ Modified: head/sys/dev/mpt/mpilib/mpi_targ.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_targ.h Sat Mar 24 15:17:18 2012 (r233424) +++ head/sys/dev/mpt/mpilib/mpi_targ.h Sat Mar 24 16:23:21 2012 (r233425) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/mpt/mpilib/mpi_tool.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_tool.h Sat Mar 24 15:17:18 2012 (r233424) +++ head/sys/dev/mpt/mpilib/mpi_tool.h Sat Mar 24 16:23:21 2012 (r233425) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/mpt/mpilib/mpi_type.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_type.h Sat Mar 24 15:17:18 2012 (r233424) +++ head/sys/dev/mpt/mpilib/mpi_type.h Sat Mar 24 16:23:21 2012 (r233425) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. + * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 17:48:37 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ACFB11065675; Sat, 24 Mar 2012 17:48:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx06.syd.optusnet.com.au (fallbackmx06.syd.optusnet.com.au [211.29.132.8]) by mx1.freebsd.org (Postfix) with ESMTP id 370FD8FC25; Sat, 24 Mar 2012 17:48:36 +0000 (UTC) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by fallbackmx06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q2OHmT8A001453; Sun, 25 Mar 2012 04:48:29 +1100 Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q2OHmKtn002178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 25 Mar 2012 04:48:22 +1100 Date: Sun, 25 Mar 2012 04:48:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric In-Reply-To: <201203241007.q2OA7MtS024789@svn.freebsd.org> Message-ID: <20120325040224.Q2467@besplex.bde.org> References: <201203241007.q2OA7MtS024789@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, tijl@FreeBSD.org Subject: Re: svn commit: r233419 - head/sys/x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 17:48:37 -0000 On Sat, 24 Mar 2012, Dimitry Andric wrote: > Log: > Fix the following clang warning in sys/dev/dcons/dcons.c, caused by the > recent changes in sys/x86/include/endian.h: > > sys/dev/dcons/dcons.c:190:15: error: implicit conversion from '__uint32_t' (aka 'unsigned int') to '__uint16_t' (aka 'unsigned short') changes value from 1684238190 to 28526 [-Werror,-Wconstant-conversion] > > buf->magic = ntohl(DCONS_MAGIC); > ^~~~~~~~~~~~~~~~~~ > sys/sys/param.h:306:18: note: expanded from: > #define ntohl(x) __ntohl(x) > ^ > ./x86/endian.h:128:20: note: expanded from: > #define __ntohl(x) __bswap32(x) > ^ > ./x86/endian.h:78:20: note: expanded from: > __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x)) > ^ > ./x86/endian.h:68:26: note: expanded from: > (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) > ^ > ./x86/endian.h:75:53: note: expanded from: > __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x))) > ~~~~~~~~~~~~~ ^ This warning was discussed before things were committed. gcc gives a similar warning, but according to tijl, it can't happen in normal use with either gcc or clang because -Wno-system-headers suppresses warnings in system headers. -Wnosystem-headers is the default in the kernel, where the above problem happens, so I don't see how it happens. However, bsd.sys.mk forces the non-default of -Wsystem-headers in userland at WARNS >= 1, so I don't see why there isn't a problem in userland if userland actually uses an expression like ntohl(DCONS_MAGIC). > This is because the __bswapXX_gen() macros (for x86) call the regular > __bswapXX() macros. Since the __bswapXX_gen() variants are only called > when their arguments are constant, there is no need to do that constancy > check recursively. Also, it causes the above error with clang. Not true. The __bswapXX_gen() are called with non-constant args from __bswap64_var() in the i386 case. As documented there, it is important for optimizations that __bswap64_gen() does do the constancy check recursively. This was discussed before things were committed, and again when jhb siggested breaking it similarly to this commit to avoid a problem on ia64. > Fix it by calling __bswap16_gen() from __bswap32_gen(), and similarly, > __bswap32_gen() from __bswap64_gen(). This breaks it. DIring development, I had a correct fix involving casting down the arg. > While here, add extra parentheses around the __bswap16_gen() macro > expansion, to prevent unexpected side effects. These parentheses were intentionally left out for clarity. __bswap16_gen() is not user-serving, and all places in endian.h that use it supply enough parentheses. > Modified: > head/sys/x86/include/endian.h > > Modified: head/sys/x86/include/endian.h > ============================================================================== > --- head/sys/x86/include/endian.h Sat Mar 24 06:40:41 2012 (r233418) > +++ head/sys/x86/include/endian.h Sat Mar 24 10:07:21 2012 (r233419) > @@ -63,11 +63,11 @@ > #define BYTE_ORDER _BYTE_ORDER > #endif > > -#define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8) > +#define __bswap16_gen(x) ((__uint16_t)((x) << 8 | (x) >> 8)) > #define __bswap32_gen(x) \ > - (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) > + (((__uint32_t)__bswap16_gen(x) << 16) | __bswap16_gen((x) >> 16)) > #define __bswap64_gen(x) \ > - (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) > + (((__uint64_t)__bswap32_gen(x) << 32) | __bswap32_gen((x) >> 32)) > > #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P > #define __bswap16(x) \ Hmm, __bswap32_gen() and __bswap64_gen() were sloppy about leaving out the parentheses. They have unnecssary (?) parentheses around the whole expression. These parentheses are a bit more needed than for __bswap16_gen(), since '(cast)(expr)' rarely needs more while 'foo | bar' often does. These functions also have unnecessary and style-conflicting parentheses around the '<<' expression. Such parentheses are not used for either the '<<' or the '>>' expression for __bswap16_gen(). They are needed for parameter passing for the other 2 '>>' expressions. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 18:06:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 532F1106564A; Sat, 24 Mar 2012 18:06:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E08D8FC18; Sat, 24 Mar 2012 18:06:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OI6noc042959; Sat, 24 Mar 2012 18:06:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OI6nOE042957; Sat, 24 Mar 2012 18:06:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203241806.q2OI6nOE042957@svn.freebsd.org> From: Marius Strobl Date: Sat, 24 Mar 2012 18:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233426 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 18:06:49 -0000 Author: marius Date: Sat Mar 24 18:06:48 2012 New Revision: 233426 URL: http://svn.freebsd.org/changeset/base/233426 Log: Add QGE-X to the list of known-working cards. MFC after: 1 week Modified: head/share/man/man4/cas.4 Modified: head/share/man/man4/cas.4 ============================================================================== --- head/share/man/man4/cas.4 Sat Mar 24 16:23:21 2012 (r233425) +++ head/share/man/man4/cas.4 Sat Mar 24 18:06:48 2012 (r233426) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2010 +.Dd March 24, 2012 .Dt CAS 4 .Os .Sh NAME @@ -101,6 +101,9 @@ Sun GigaSwift Ethernet UTP (GCS) .It Sun Quad GigaSwift Ethernet UTP (QGE) (part no.\& 501-6522) +.It +Sun Quad GigaSwift Ethernet PCI-X (QGE-X) +(part no.\& 501-6738) .El .Sh NOTES On sparc64 the From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 18:08:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DF6B1065676; Sat, 24 Mar 2012 18:08:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E38228FC27; Sat, 24 Mar 2012 18:08:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OI8SCL043062; Sat, 24 Mar 2012 18:08:28 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OI8S3L043059; Sat, 24 Mar 2012 18:08:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203241808.q2OI8S3L043059@svn.freebsd.org> From: Marius Strobl Date: Sat, 24 Mar 2012 18:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233427 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 18:08:29 -0000 Author: marius Date: Sat Mar 24 18:08:28 2012 New Revision: 233427 URL: http://svn.freebsd.org/changeset/base/233427 Log: Add cas(4), gem(4) and hme(4) to x86 GENERICs as suggested by netchild@ in <20120222095239.Horde.0hpYHJjmRSRPRKzXsoFRbYk@webmail.leidinger.net>. According to some private emails received, it apparently is not unpopular to use at least Quad GigaSwift cards driven by cas(4) in x86 machines. MFC after: 1 week Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sat Mar 24 18:06:48 2012 (r233426) +++ head/sys/amd64/conf/GENERIC Sat Mar 24 18:08:28 2012 (r233427) @@ -218,9 +218,12 @@ device ale # Atheros AR8121/AR8113/AR8 device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet +device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn device dc # DEC/Intel 21143 and various workalikes device et # Agere ET1310 10/100/Gigabit Ethernet device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device gem # Sun GEM/Sun ERI/Apple GMAC +device hme # Sun HME (Happy Meal Ethernet) device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet device lge # Level 1 LXT1001 gigabit Ethernet device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sat Mar 24 18:06:48 2012 (r233426) +++ head/sys/i386/conf/GENERIC Sat Mar 24 18:08:28 2012 (r233427) @@ -228,9 +228,12 @@ device ale # Atheros AR8121/AR8113/AR8 device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet +device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn device dc # DEC/Intel 21143 and various workalikes device et # Agere ET1310 10/100/Gigabit Ethernet device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device gem # Sun GEM/Sun ERI/Apple GMAC +device hme # Sun HME (Happy Meal Ethernet) device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet device lge # Level 1 LXT1001 gigabit Ethernet device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 18:25:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76B5D1065672; Sat, 24 Mar 2012 18:25:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 600538FC0C; Sat, 24 Mar 2012 18:25:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OIPHBL043620; Sat, 24 Mar 2012 18:25:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OIPH5F043611; Sat, 24 Mar 2012 18:25:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203241825.q2OIPH5F043611@svn.freebsd.org> From: Eitan Adler Date: Sat, 24 Mar 2012 18:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233428 - head/share/examples/cvsup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 18:25:17 -0000 Author: eadler Date: Sat Mar 24 18:25:16 2012 New Revision: 233428 URL: http://svn.freebsd.org/changeset/base/233428 Log: Direct users to csup instead of cvsup in the csup-file boilerplate text. Reviewed by: maxim, des, swills Approved by: cperciva MFC after: 3 days Modified: head/share/examples/cvsup/cvs-supfile head/share/examples/cvsup/doc-supfile head/share/examples/cvsup/gnats-supfile head/share/examples/cvsup/ports-supfile head/share/examples/cvsup/stable-supfile head/share/examples/cvsup/standard-supfile head/share/examples/cvsup/www-supfile Modified: head/share/examples/cvsup/cvs-supfile ============================================================================== --- head/share/examples/cvsup/cvs-supfile Sat Mar 24 18:08:28 2012 (r233427) +++ head/share/examples/cvsup/cvs-supfile Sat Mar 24 18:25:16 2012 (r233428) @@ -3,19 +3,16 @@ # This file contains all of the "CVSup collections" that make up the # CVS development tree of the FreeBSD system. # -# CVSup (CVS Update Protocol) allows you to download the latest CVS +# csup (CVS Update Protocol) allows you to download the latest CVS # tree (or any branch of development therefrom) to your system easily -# and efficiently (far more so than with sup, which CVSup is aimed -# at replacing). If you're running CVSup interactively, and are -# currently using an X display server, you should run CVSup as follows -# to keep your CVS tree up-to-date: +# and efficiently # -# cvsup cvs-supfile +# To keep your CVS tree up-to-date run: # -# If not running X, or invoking cvsup from a non-interactive script, then -# run it as follows: +# csup cvs-supfile # -# cvsup -g -L 2 cvs-supfile +# Note that this only updates the tree contents and does not +# update what is actually installed. # # You may wish to change some of the settings in this file to better # suit your system: @@ -29,7 +26,7 @@ # with cvsup's "-h host" option. # # base=/var/db -# This specifies the root where CVSup will store information +# This specifies the root where csup will store information # about the collections you have transferred to your system. # A setting of "/var/db" will generate this information in # /var/db/sup. You can override the "base" setting on the Modified: head/share/examples/cvsup/doc-supfile ============================================================================== --- head/share/examples/cvsup/doc-supfile Sat Mar 24 18:08:28 2012 (r233427) +++ head/share/examples/cvsup/doc-supfile Sat Mar 24 18:25:16 2012 (r233428) @@ -3,19 +3,16 @@ # This file contains all of the "CVSup collections" that make up the # source of the FreeBSD doc tree # -# CVSup (CVS Update Protocol) allows you to download the latest CVS +# csup (CVS Update Protocol) allows you to download the latest CVS # tree (or any branch of development therefrom) to your system easily -# and efficiently (far more so than with sup, which CVSup is aimed -# at replacing). If you're running CVSup interactively, and are -# currently using an X display server, you should run CVSup as follows -# to keep your CVS tree up-to-date: +# and efficiently # -# cvsup doc-supfile +# To keep your CVS tree up-to-date run: # -# If not running X, or invoking cvsup from a non-interactive script, then -# run it as follows: +# csup doc-supfile # -# cvsup -g -L 2 doc-supfile +# Note that this only updates the tree contents and does not +# update what is actually installed. # # You may wish to change some of the settings in this file to better # suit your system: @@ -29,7 +26,7 @@ # with cvsup's "-h host" option. # # base=/var/db -# This specifies the root where CVSup will store information +# This specifies the root where csup will store information # about the collections you have transferred to your system. # A setting of "/var/db" will generate this information in # /var/db/sup. You can override the "base" setting on the Modified: head/share/examples/cvsup/gnats-supfile ============================================================================== --- head/share/examples/cvsup/gnats-supfile Sat Mar 24 18:08:28 2012 (r233427) +++ head/share/examples/cvsup/gnats-supfile Sat Mar 24 18:25:16 2012 (r233428) @@ -3,19 +3,16 @@ # This file contains all of the "CVSup collections" that make up the # FreeBSD GNATS bug report database. # -# CVSup (CVS Update Protocol) allows you to download the latest CVS +# csup (CVS Update Protocol) allows you to download the latest CVS # tree (or any branch of development therefrom) to your system easily -# and efficiently (far more so than with sup, which CVSup is aimed -# at replacing). If you're running CVSup interactively, and are -# currently using an X display server, you should run CVSup as follows -# to keep your CVS tree up-to-date: +# and efficiently # -# cvsup gnats-supfile +# To keep your CVS tree up-to-date run: # -# If not running X, or invoking cvsup from a non-interactive script, then -# run it as follows: +# csup gnats-supfile # -# cvsup -g -L 2 gnats-supfile +# Note that this only updates the tree contents and does not +# update what is actually installed. # # You may wish to change some of the settings in this file to better # suit your system: @@ -29,7 +26,7 @@ # with cvsup's "-h host" option. # # base=/var/db -# This specifies the root where CVSup will store information +# This specifies the root where csup will store information # about the collections you have transferred to your system. # A setting of "/var/db" will generate this information in # /var/db/sup. You can override the "base" setting on the Modified: head/share/examples/cvsup/ports-supfile ============================================================================== --- head/share/examples/cvsup/ports-supfile Sat Mar 24 18:08:28 2012 (r233427) +++ head/share/examples/cvsup/ports-supfile Sat Mar 24 18:25:16 2012 (r233428) @@ -3,19 +3,16 @@ # This file contains all of the "CVSup collections" that make up the # FreeBSD-current ports collection. # -# CVSup (CVS Update Protocol) allows you to download the latest CVS +# csup (CVS Update Protocol) allows you to download the latest CVS # tree (or any branch of development therefrom) to your system easily -# and efficiently (far more so than with sup, which CVSup is aimed -# at replacing). If you're running CVSup interactively, and are -# currently using an X display server, you should run CVSup as follows -# to keep your CVS tree up-to-date: +# and efficiently # -# cvsup ports-supfile +# To keep your CVS tree up-to-date run: # -# If not running X, or invoking cvsup from a non-interactive script, then -# run it as follows: +# csup ports-supfile # -# cvsup -g -L 2 ports-supfile +# Note that this only updates the tree contents and does not +# update what is actually installed. # # You may wish to change some of the settings in this file to better # suit your system: @@ -29,7 +26,7 @@ # with cvsup's "-h host" option. # # base=/var/db -# This specifies the root where CVSup will store information +# This specifies the root where csup will store information # about the collections you have transferred to your system. # A setting of "/var/db" will generate this information in # /var/db/sup. You can override the "base" setting on the Modified: head/share/examples/cvsup/stable-supfile ============================================================================== --- head/share/examples/cvsup/stable-supfile Sat Mar 24 18:08:28 2012 (r233427) +++ head/share/examples/cvsup/stable-supfile Sat Mar 24 18:25:16 2012 (r233428) @@ -3,19 +3,16 @@ # This file contains all of the "CVSup collections" that make up the # FreeBSD-stable source tree. # -# CVSup (CVS Update Protocol) allows you to download the latest CVS +# csup (CVS Update Protocol) allows you to download the latest CVS # tree (or any branch of development therefrom) to your system easily -# and efficiently (far more so than with sup, which CVSup is aimed -# at replacing). If you're running CVSup interactively, and are -# currently using an X display server, you should run CVSup as follows -# to keep your CVS tree up-to-date: +# and efficiently # -# cvsup stable-supfile +# To keep your CVS tree up-to-date run: # -# If not running X, or invoking cvsup from a non-interactive script, then -# run it as follows: +# csup stable-supfile # -# cvsup -g -L 2 stable-supfile +# Note that this only updates the tree contents and does not +# update what is actually installed. # # You may wish to change some of the settings in this file to better # suit your system: @@ -29,7 +26,7 @@ # with cvsup's "-h host" option. # # base=/var/db -# This specifies the root where CVSup will store information +# This specifies the root where csup will store information # about the collections you have transferred to your system. # A setting of "/var/db" will generate this information in # /var/db/sup. You can override the "base" setting on the Modified: head/share/examples/cvsup/standard-supfile ============================================================================== --- head/share/examples/cvsup/standard-supfile Sat Mar 24 18:08:28 2012 (r233427) +++ head/share/examples/cvsup/standard-supfile Sat Mar 24 18:25:16 2012 (r233428) @@ -3,19 +3,16 @@ # This file contains all of the "CVSup collections" that make up the # FreeBSD-current source tree. # -# CVSup (CVS Update Protocol) allows you to download the latest CVS +# csup (CVS Update Protocol) allows you to download the latest CVS # tree (or any branch of development therefrom) to your system easily -# and efficiently (far more so than with sup, which CVSup is aimed -# at replacing). If you're running CVSup interactively, and are -# currently using an X display server, you should run CVSup as follows -# to keep your CVS tree up-to-date: +# and efficiently # -# cvsup standard-supfile +# To keep your CVS tree up-to-date run: # -# If not running X, or invoking cvsup from a non-interactive script, then -# run it as follows: +# csup standard-supfile # -# cvsup -g -L 2 standard-supfile +# Note that this only updates the tree contents and does not +# update what is actually installed. # # You may wish to change some of the settings in this file to better # suit your system: @@ -29,7 +26,7 @@ # with cvsup's "-h host" option. # # base=/var/db -# This specifies the root where CVSup will store information +# This specifies the root where csup will store information # about the collections you have transferred to your system. # A setting of "/var/db" will generate this information in # /var/db/sup. You can override the "base" setting on the Modified: head/share/examples/cvsup/www-supfile ============================================================================== --- head/share/examples/cvsup/www-supfile Sat Mar 24 18:08:28 2012 (r233427) +++ head/share/examples/cvsup/www-supfile Sat Mar 24 18:25:16 2012 (r233428) @@ -3,19 +3,16 @@ # This file contains all of the "CVSup collections" that make up the # source of the FreeBSD www tree # -# CVSup (CVS Update Protocol) allows you to download the latest CVS +# csup (CVS Update Protocol) allows you to download the latest CVS # tree (or any branch of development therefrom) to your system easily -# and efficiently (far more so than with sup, which CVSup is aimed -# at replacing). If you're running CVSup interactively, and are -# currently using an X display server, you should run CVSup as follows -# to keep your CVS tree up-to-date: +# and efficiently # -# cvsup www-supfile +# To keep your CVS tree up-to-date run: # -# If not running X, or invoking cvsup from a non-interactive script, then -# run it as follows: +# csup www-supfile # -# cvsup -g -L 2 www-supfile +# Note that this only updates the tree contents and does not +# update what is actually installed. # # You may wish to change some of the settings in this file to better # suit your system: @@ -29,7 +26,7 @@ # with cvsup's "-h host" option. # # base=/var/db -# This specifies the root where CVSup will store information +# This specifies the root where csup will store information # about the collections you have transferred to your system. # A setting of "/var/db" will generate this information in # /var/db/sup. You can override the "base" setting on the From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 18:43:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 284501065670; Sat, 24 Mar 2012 18:43:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 081408FC0C; Sat, 24 Mar 2012 18:43:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OIhIdC044274; Sat, 24 Mar 2012 18:43:18 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OIhIYu044270; Sat, 24 Mar 2012 18:43:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203241843.q2OIhIYu044270@svn.freebsd.org> From: Eitan Adler Date: Sat, 24 Mar 2012 18:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233429 - in head: etc/root share/examples share/examples/csh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 18:43:19 -0000 Author: eadler Date: Sat Mar 24 18:43:18 2012 New Revision: 233429 URL: http://svn.freebsd.org/changeset/base/233429 Log: - Make the default values for tcsh more user friendly - Add an examples file with many of the not accepted suggestions from the discussion PR: conf/160689 Reviewed by: many Discussed on: current Approved by: cperciva Added: head/share/examples/csh/ head/share/examples/csh/dot.cshrc (contents, props changed) Modified: head/etc/root/dot.cshrc head/share/examples/Makefile Modified: head/etc/root/dot.cshrc ============================================================================== --- head/etc/root/dot.cshrc Sat Mar 24 18:25:16 2012 (r233428) +++ head/etc/root/dot.cshrc Sat Mar 24 18:43:18 2012 (r233429) @@ -3,13 +3,14 @@ # .cshrc - csh resource script, read at beginning of execution by each shell # # see also csh(1), environ(7). +# more examples available at /usr/share/examples/csh/ # alias h history 25 alias j jobs -l -alias la ls -a +alias la ls -aF alias lf ls -FA -alias ll ls -lA +alias ll ls -lAF # A righteous umask umask 22 @@ -17,19 +18,30 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER more +setenv PAGER less setenv BLOCKSIZE K if ($?prompt) then # An interactive shell -- set some stuff up - set prompt = "`/bin/hostname -s`# " + set prompt = "%n@%m:%c04%# " + set promptchars = "%#" + set filec - set history = 100 - set savehist = 100 + set history = 1000 + set savehist = 1000 + set autolist = ambiguous + # Use history to aid expansion + set autoexpand + set autorehash set mail = (/var/mail/$USER) if ( $?tcsh ) then bindkey "^W" backward-delete-word bindkey -k up history-search-backward bindkey -k down history-search-forward + + bindkey "\e[1~" beginning-of-line #make Home key work; + bindkey "\e[3~" delete-char #make Delete key work; + bindkey "\e[4~" end-of-line #make End key work; endif + endif Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Sat Mar 24 18:25:16 2012 (r233428) +++ head/share/examples/Makefile Sat Mar 24 18:43:18 2012 (r233429) @@ -8,6 +8,7 @@ LDIRS= BSD_daemon \ FreeBSD_version \ IPv6 \ bootforth \ + csh \ cvsup \ diskless \ drivers \ @@ -49,6 +50,7 @@ XFILES= BSD_daemon/FreeBSD.pfa \ bootforth/menu.4th \ bootforth/menuconf.4th \ bootforth/screen.4th \ + csh/dot.cshrc \ cvsup/README \ cvsup/cvs-supfile \ cvsup/doc-supfile \ Added: head/share/examples/csh/dot.cshrc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/csh/dot.cshrc Sat Mar 24 18:43:18 2012 (r233429) @@ -0,0 +1,60 @@ +# Here are some example (t)csh options and configurations that you may find interesting +# +# $FreeBSD$ +# + +# Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running +if (${?SSH_AUTH_SOCK} != "1") then + setenv SSH_AUTH_SOCK `sockstat | grep "${USER}" | cut -d ' ' -f 6` +endif + +# Change only root's prompt +if (`id -g` == 0) + set prompt="root@%m# " +endif + +# This maps the "Delete" key to do the right thing +# Pressing CTRL-v followed by the key of interest will print the shell's +# mapping for the key +bindkey "^[[3~" delete-char-or-list-or-eof + +# Make the Ins key work +bindkey "\e[2~" overwrite-mode + +# Some common completions +complete chown 'p/1/u/' +complete man 'C/*/c/' +complete service 'n/*/`service -l`/' +complete service 'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop reload restart status rcvar onestart onestop)/' +complete kldunload 'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name` @' +complete make 'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@' +complete pkg_delete 'c/-/(i v D n p d f G x X r)/' 'n@*@`ls /var/db/pkg`@' +complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed svar/db/pkg/%%`@" +complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' +complete killall 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/' +alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1A +alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*' +complete portmaster 'c/--/(always-fetch check-depends check-port-dbdir clean-distfiles \ + clean-packages delete-build-only delete-packages force-config help \ + index index-first index-only list-origins local-packagedir no-confirm \ + no-index-fetch no-term-title packages packages-build packages-if-newer \ + packages-local packages-only show-work update-if-newer version)/' \ + 'c/-/(a b B C d D e f F g G h H i l L m n o p r R s t u v w x)/' \ + 'n@*@`_PKGS_PkGs_PoRtS_`@' + +# Alternate prompts +set prompt = '#' +set prompt = '%B%m%b%# ' +set prompt = '%B%m%b:%c03:%# ' +set prompt = '%{\033]0;%n@%m:%/\007%}%B%m%b:%c03:%# ' +set prompt = "%n@%m %c04%m%# " +set prompt = "%n@%m:%c04 %# " +set prompt = "[%n@%m]%c04%# " +set ellipsis + +# Color ls +alias ll ls -lAhG +alias ls ls -G + +# other autolist options +set autolist = TAB From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 18:46:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 528E1106564A; Sat, 24 Mar 2012 18:46:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id B8D868FC15; Sat, 24 Mar 2012 18:46:16 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q2OIk6UN069558; Sat, 24 Mar 2012 20:46:06 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q2OIk5DN025467; Sat, 24 Mar 2012 20:46:05 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q2OIk5gW025466; Sat, 24 Mar 2012 20:46:05 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 24 Mar 2012 20:46:05 +0200 From: Konstantin Belousov To: Alexander Kabaev Message-ID: <20120324184605.GW2358@deviant.kiev.zoral.com.ua> References: <201203232010.q2NKAuIE092217@svn.freebsd.org> <20120323202335.GM2358@deviant.kiev.zoral.com.ua> <20120323164922.0bac354e@kan.dyndns.org> <20120323211038.GR2358@deviant.kiev.zoral.com.ua> <9FDB5808-2EE9-4F38-86E6-D0C115E7677C@FreeBSD.org> <20120324115421.28471627@kan.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vOCZ4jhp7iwOpVgV" Content-Disposition: inline In-Reply-To: <20120324115421.28471627@kan.dyndns.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Chisnall Subject: Re: svn commit: r233391 - head/contrib/libstdc++/libsupc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 18:46:17 -0000 --vOCZ4jhp7iwOpVgV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 24, 2012 at 11:54:21AM -0400, Alexander Kabaev wrote: > On Fri, 23 Mar 2012 23:39:44 +0000 > David Chisnall wrote: >=20 > > On 23 Mar 2012, at 21:10, Konstantin Belousov wrote: > >=20 > > > The patch just committed made the base-shipped library incompatible > > > with the ports and manual libstdc++ builds. > >=20 > > To clarify - the one shipped in the base system has been incompatible > > with the one in ports since late 2007... > > > That says something about the extend of the breakage, does it not? > =20 > > In future, however, we will want libstdc++ in ports to be using the > > system ABI library (e.g. libcxxrt) so that it can be linked with > > libraries using the system C++ stack, so the layout of std::type_info > > in its headers doesn't matter too much because it won't be used. > >=20 > > > I think it is wiser to > > > not 'undo the undo', and instead start living with the > > > upstream-approved ABI. For symvered library, it does not make any > > > difference if you break it in 10.0 or 9.1. > >=20 > > Not true. The vtable layout can not be symbol versioned > > effectively. The std::type_info class is required by the ABI to > > exist (and is in libsupc++ / libcxxrt, so is independent of our STL > > implementation, either libstdc++ or libc++). Users expect to be able > > to cast=20 > >=20 > > > Also, I think that consumers that depend of the ABI of > > > std::typeinfo can be hacked to understand the layout of vtable. > >=20 > > Supporting both layouts is not really tenable. We need to do one of > > the following: > >=20 > > - Say 'we are going to break this now!' and force people to recompile > > libsupc++, libcxxrt, and libobjc2. > > - Keep the layout that we currently ship and patch in > > ports. > >=20 > > I don't mind which of these we do since I'm not the one that has to > > do the work in ensuring compatibility with ports but it will need to > > pick one and then stick to it... > >=20 > > > I doubt that there are > > > many users that utilize typeinfo. > >=20 > > Yes, to my knowledge there are three, and two of them are me :-( > >=20 >=20 > I will support the switch to 'default' ABI used upstream, provided > David is onboard. The breakage is very limited at the moment and > can only grow over time, so will grow the pain, while we insist on being > diverged from GCC. We might as well bite the bullet and live through > this at the cost of 9.1 release errata that only affects libobjc2. Right, this was my point, and you seems to agree with me: better to make a switch back to the upstream ABI sooner (9.1) rather then later (10.0). --vOCZ4jhp7iwOpVgV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk9uFm0ACgkQC3+MBN1Mb4glOQCgxbJGYl+4OcyaETdEnknM6tGH XKsAoKvvlTItoPErlV3lxfif9D/nXCUe =NmuK -----END PGP SIGNATURE----- --vOCZ4jhp7iwOpVgV-- From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 18:50:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 72322106564A; Sat, 24 Mar 2012 18:50:46 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3C8918FC08; Sat, 24 Mar 2012 18:50:45 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so4393191bkc.13 for ; Sat, 24 Mar 2012 11:50:44 -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=glXq0ibsdA2bDDIK7Nbpb4G03QOVixpfdixHjEVeayQ=; b=gcuG+nnJsAcfSOMESG3+bEAzXTGAeL8cVG+2eCkp1Jzk4w7SO/KBiMlfpTUwy/Y3EK eIYRhkIN4g7T6a5JbuUjyHfaxvyX2OAx/7moiSEIFc24rdit/MOfy1QB5I6qbXKTUuz4 3QMse3alW/+Gg2PmTA/yqb1fz0oyMz84bRpwRZIrKzFsT363PsblXw09ZG8HfYoKuQM2 njKtbM8hYCAhMS/JQq2yls9SsEZBLSiwHTagnmVPRkA1oiMs+xIdZbMxNaOiIr0SuTZ7 HkAKVsfGxL88CwcA9ohIynbBsEGm4EjZn6af7t7km5EnK3xaFVVXVcVvRrRR7tXkLgw/ Avng== MIME-Version: 1.0 Received: by 10.204.153.219 with SMTP id l27mr6532629bkw.126.1332615044313; Sat, 24 Mar 2012 11:50:44 -0700 (PDT) Received: by 10.204.202.142 with HTTP; Sat, 24 Mar 2012 11:50:44 -0700 (PDT) Received: by 10.204.202.142 with HTTP; Sat, 24 Mar 2012 11:50:44 -0700 (PDT) In-Reply-To: <201203241843.q2OIhIYu044270@svn.freebsd.org> References: <201203241843.q2OIhIYu044270@svn.freebsd.org> Date: Sat, 24 Mar 2012 18:50:44 +0000 Message-ID: From: Chris Rees To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233429 - in head: etc/root share/examples share/examples/csh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 18:50:46 -0000 On 24 Mar 2012 18:43, "Eitan Adler" wrote: > > Author: eadler > Date: Sat Mar 24 18:43:18 2012 > New Revision: 233429 > URL: http://svn.freebsd.org/changeset/base/233429 > > Log: > - Make the default values for tcsh more user friendly > - Add an examples file with many of the not accepted suggestions from the discussion > > PR: conf/160689 > Reviewed by: many > Discussed on: current > Approved by: cperciva > > Added: > head/share/examples/csh/ > head/share/examples/csh/dot.cshrc (contents, props changed) > Modified: > head/etc/root/dot.cshrc > head/share/examples/Makefile > > Modified: head/etc/root/dot.cshrc > Fantastic, thanks for getting this in. Chris From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 19:13:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA835106564A; Sat, 24 Mar 2012 19:13:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 959018FC1C; Sat, 24 Mar 2012 19:13:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OJDAvu045223; Sat, 24 Mar 2012 19:13:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OJDAAs045221; Sat, 24 Mar 2012 19:13:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203241913.q2OJDAAs045221@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 24 Mar 2012 19:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233430 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 19:13:10 -0000 Author: kib Date: Sat Mar 24 19:13:10 2012 New Revision: 233430 URL: http://svn.freebsd.org/changeset/base/233430 Log: Provide short-circuit exit(3) implementation for rtld. There is no atexit finalizers in rtld to call on rtld exiting (due to errors). Submitted by: bde No objections from: kan MFC after: 2 weeks Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Mar 24 18:43:18 2012 (r233429) +++ head/libexec/rtld-elf/rtld.c Sat Mar 24 19:13:10 2012 (r233430) @@ -4364,6 +4364,17 @@ __getosreldate(void) return (osreldate); } +void +exit(int status) +{ + + _exit(status); +} + +void (*__cleanup)(void); +int __isthreaded = 0; +int _thread_autoinit_dummy_decl = 1; + /* * No unresolved symbols for rtld. */ From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 19:14:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A40181065670; Sat, 24 Mar 2012 19:14:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F9788FC20; Sat, 24 Mar 2012 19:14:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OJEihW045304; Sat, 24 Mar 2012 19:14:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OJEiVl045301; Sat, 24 Mar 2012 19:14:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203241914.q2OJEiVl045301@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 24 Mar 2012 19:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233431 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 19:14:44 -0000 Author: kib Date: Sat Mar 24 19:14:44 2012 New Revision: 233431 URL: http://svn.freebsd.org/changeset/base/233431 Log: Remove libssp_nonshared from the rtld linking set. The only use for the library was definition for the weak alias of __stack_chk_fail. No objections from: kan MFC after: 2 weeks Modified: head/libexec/rtld-elf/Makefile head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Sat Mar 24 19:13:10 2012 (r233430) +++ head/libexec/rtld-elf/Makefile Sat Mar 24 19:14:44 2012 (r233431) @@ -40,7 +40,7 @@ CFLAGS+= -fpic CFLAGS+= -DPIC $(DEBUG) LDFLAGS+= -shared -Wl,-Bsymbolic DPADD= ${LIBC_PIC} -LDADD= -lc_pic -lssp_nonshared +LDADD= -lc_pic .if ${MK_SYMVER} == "yes" LIBCDIR= ${TOPSRCDIR}/lib/libc Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Mar 24 19:13:10 2012 (r233430) +++ head/libexec/rtld-elf/rtld.c Sat Mar 24 19:14:44 2012 (r233431) @@ -4390,6 +4390,7 @@ __stack_chk_fail(void) _rtld_error("stack overflow detected; terminated"); die(); } +__weak_reference(__stack_chk_fail, __stack_chk_fail_local); void __chk_fail(void) From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 19:16:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C066106564A for ; Sat, 24 Mar 2012 19:16:47 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0D5A58FC23 for ; Sat, 24 Mar 2012 19:16:46 +0000 (UTC) Received: by wgbds11 with SMTP id ds11so1658138wgb.1 for ; Sat, 24 Mar 2012 12:16:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=wct/IZCpAHEtaeIIDn8LEAjXxt4mb0CIEt/wbLgALQM=; b=bZOhtHRKmsuDWBBwjxehUxDpkS3wzO3OBhQQ/t5Bb5RamdLBfSaHGeyiMidRQ6DHpm Je0tnI2wsfRe5NaZD+kYp1gW1/T99vbDvfrW+gbYdvxSdJT2xvlQGO7inNk/QaxQihWU jYgGofJqGMzN2lyZFZeqL2PVXoCTVGLsk4Oa+xi/XGOOU2d7gskvlQoYQ3AvmKpvJvEb yJgUC14REOwgNhzVWYtZdPgAh6DJcl35oSPVWtYXCw404CIDbmAQ+VRIfOTmVEw3+z+q H5WSebplVOO+/tduPxewhK7Tu7q8p3PW18MDW1RyNpNXc2MkJpGGaC3zee0wtWNWYkA0 Atmg== Received: by 10.180.107.104 with SMTP id hb8mr5258571wib.8.1332616605766; Sat, 24 Mar 2012 12:16:45 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.180.106.198 with HTTP; Sat, 24 Mar 2012 12:16:25 -0700 (PDT) In-Reply-To: <201203241825.q2OIPH5F043611@svn.freebsd.org> References: <201203241825.q2OIPH5F043611@svn.freebsd.org> From: Juli Mallett Date: Sat, 24 Mar 2012 12:16:25 -0700 X-Google-Sender-Auth: t8sP07wcJh07H2BiJvWmb4nRg0o Message-ID: To: Eitan Adler Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlwlEI+X3JnUrGUsnvr6DgZqDsu3XFtbxAeWgnqqOBq+i+MOL9Oy0HVAMSRFJzckwqEd9hT Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233428 - head/share/examples/cvsup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 19:16:47 -0000 On Sat, Mar 24, 2012 at 11:25, Eitan Adler wrote: > Author: eadler > Date: Sat Mar 24 18:25:16 2012 > New Revision: 233428 > URL: http://svn.freebsd.org/changeset/base/233428 > > Log: > =C2=A0Direct users to csup instead of cvsup in the csup-file boilerplate = text. Thanks for doing this! I'm not sure about this one change that was made in several places: > -# CVSup (CVS Update Protocol) allows you to download the latest CVS > +# csup (CVS Update Protocol) allows you to download the latest CVS The name of the protocol is certainly CVSup and not csup. And the protocol is what is being referred to here (as is suggested by the parenthetical.) If the protocol weren't being referred to, it would be a literal "cvsup" since that's the spelling of the command, not "CVSup". From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 19:36:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C843106566C for ; Sat, 24 Mar 2012 19:36:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm19-vm0.bullet.mail.ne1.yahoo.com (nm19-vm0.bullet.mail.ne1.yahoo.com [98.138.91.59]) by mx1.freebsd.org (Postfix) with SMTP id C34478FC1B for ; Sat, 24 Mar 2012 19:36:36 +0000 (UTC) Received: from [98.138.90.56] by nm19.bullet.mail.ne1.yahoo.com with NNFMP; 24 Mar 2012 19:30:50 -0000 Received: from [98.138.84.40] by tm9.bullet.mail.ne1.yahoo.com with NNFMP; 24 Mar 2012 19:30:50 -0000 Received: from [127.0.0.1] by smtp108.mail.ne1.yahoo.com with NNFMP; 24 Mar 2012 19:30:50 -0000 X-Yahoo-Newman-Id: 19267.64437.bm@smtp108.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: NCYM8lcVM1mHXNXU64sK1jzbvZgWFuEaw19oLMzgVhzbPMv slFZ92MF2Rj9cWcf4G8K_eS8vU1VynQCaZ0G0eeWP1mJDXeyjxrlR.17EZUJ o9f1MeXhALuC4TlACDNV773tcpa1fY6.pohc.Gqs2fDVqzgTVgPnocGarv_s 3wFCvrQi2lZFaiLriw40cab3mWj2eZ0dQXocxsxhS2OuSlt1hgvdFbscRC9Y SQVr0I6jmTkFZgG3vas30smAbjgGWUmG8s2MXWbg9.MMwgt5Z6.Eb._yXnNd QSGlq3XZXeCEnysQ9.DGe6nrsRn.mTKZyu5FPxqwqVbdRkY7GIYxQ7Z7tMpA YPAXY_yyEX8b.xnqM.N2W2Fd_tRJk9b4H23fTbw4VtkwMJimOvE2MIfaWJVy g9wJZ4zT1fnjxE1tO7s7UdbW6RgabWI2P3lYLsrOKf7A06Qj_EZAjvvNixps jyYKzDe1L_ElAOW.gj_96nfZcC.HEgueqL01Az1NKsTt8hLxqBvAjAik0XXA UhF4IuCFaB.OXlx0pCDbR1_PttZlNqSNG8mJ1qYWtlVG215eDXOzD5.E0N4r YPKLF872fRYLVSA-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Received: from [192.168.10.102] (pfg@200.118.157.7 with plain) by smtp108.mail.ne1.yahoo.com with SMTP; 24 Mar 2012 12:30:49 -0700 PDT Message-ID: <4F6E20E7.8040206@FreeBSD.org> Date: Sat, 24 Mar 2012 14:30:47 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.2) Gecko/20120226 Thunderbird/10.0.2 MIME-Version: 1.0 To: David Chisnall References: <201203232010.q2NKAuIE092217@svn.freebsd.org> In-Reply-To: <201203232010.q2NKAuIE092217@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233391 - head/contrib/libstdc++/libsupc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 19:36:37 -0000 Ahem.. On 03/23/12 15:10, David Chisnall wrote: > Author: theraven > Date: Fri Mar 23 20:10:56 2012 > New Revision: 233391 > URL: http://svn.freebsd.org/changeset/base/233391 > > Log: > Revert ABI breakage in libsupc++. > > Unfortunately, the ABI was broken upstream for the 4.2 release, which we > imported. We then shipped the broken version for several years and certain > ports (e.g. libobjc2) depend on it, so we're stuck with it for now... > > We should revisit this for 10.0, since we're allowed to break the ABI then, but > until then we should keep the ABI we shipped with 8.x and 9.x. > > Reviewed by: kan > Approved by: dim (mentor) > MFC after: 1 week > > Modified: > head/contrib/libstdc++/libsupc++/typeinfo > > Let me try to recap: gcc-4.2.1 broke the ABI and we shipped it for a long time. The bug was detected by Apple and others: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35081 It was fixed for gcc-4.2.2 (which we didn't ship): http://gcc.gnu.org/viewcvs?view=revision&revision=129061 I inadvertently fixed the bug 3 months ago when I brought in the last LGPLv2 updates for libstdc++: http://svnweb.freebsd.org/base?view=revision&revision=228780 The fix hasn't been shipped but was MFC'd and is actually in 8.3-RC* !! David's commit actually restores the gcc 4.2.1 bug (?). Pedro. From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 19:37:00 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EB651065780; Sat, 24 Mar 2012 19:37:00 +0000 (UTC) (envelope-from flo@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D7B2C8FC26; Sat, 24 Mar 2012 19:36:59 +0000 (UTC) Received: from nibbler-wlan.fritz.box (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q2OJavOc037568; Sat, 24 Mar 2012 19:36:58 GMT (envelope-from flo@FreeBSD.org) Message-ID: <4F6E2259.70505@FreeBSD.org> Date: Sat, 24 Mar 2012 20:36:57 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120321 Thunderbird/12.0 MIME-Version: 1.0 To: Eitan Adler References: <201203241843.q2OIhIYu044270@svn.freebsd.org> In-Reply-To: <201203241843.q2OIhIYu044270@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r233429 - in head: etc/root share/examples share/examples/csh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 19:37:00 -0000 On 24.03.12 19:43, Eitan Adler wrote: > Author: eadler > Date: Sat Mar 24 18:43:18 2012 > New Revision: 233429 > URL: http://svn.freebsd.org/changeset/base/233429 > > Log: > - Make the default values for tcsh more user friendly > - Add an examples file with many of the not accepted suggestions from the discussion > > PR: conf/160689 > Reviewed by: many > Discussed on: current > Approved by: cperciva > Something like this is missing: Index: etc/mtree/BSD.usr.dist =================================================================== --- etc/mtree/BSD.usr.dist (revision 233429) +++ etc/mtree/BSD.usr.dist (working copy) @@ -209,6 +209,8 @@ .. bootforth .. + csh + .. cvs contrib .. otherwise the build fails install -o root -g wheel -m 444 /home/flo/dev/checkouts/svn-src/share/examples/csh/dot.cshrc //usr/share/examples/csh/dot.cshrc install: //usr/share/examples/csh/dot.cshrc: No such file or directory Florian From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 19:41:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3E23106564A; Sat, 24 Mar 2012 19:41:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEB1F8FC16; Sat, 24 Mar 2012 19:41:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OJfh5C046191; Sat, 24 Mar 2012 19:41:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OJfhoq046188; Sat, 24 Mar 2012 19:41:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203241941.q2OJfhoq046188@svn.freebsd.org> From: Eitan Adler Date: Sat, 24 Mar 2012 19:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233432 - in head/secure: usr.bin/ssh usr.sbin/sshd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 19:41:44 -0000 Author: eadler Date: Sat Mar 24 19:41:43 2012 New Revision: 233432 URL: http://svn.freebsd.org/changeset/base/233432 Log: Restore the ability to use a non-standard LOCALBASE to sshd Add the ability to use a non-standard LOCALBASE to ssh Submitted by: jhb Reviewed by: des Approved by: cperciva MFC after: 0 days (with r233136) Modified: head/secure/usr.bin/ssh/Makefile head/secure/usr.sbin/sshd/Makefile Modified: head/secure/usr.bin/ssh/Makefile ============================================================================== --- head/secure/usr.bin/ssh/Makefile Sat Mar 24 19:14:44 2012 (r233431) +++ head/secure/usr.bin/ssh/Makefile Sat Mar 24 19:41:43 2012 (r233432) @@ -28,6 +28,10 @@ LDADD+= -lgssapi DPADD+= ${LIBCRYPT} ${LIBCRYPTO} LDADD+= -lcrypt -lcrypto +.if defined(LOCALBASE) +CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" +.endif + .include .PATH: ${SSHDIR} Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Sat Mar 24 19:14:44 2012 (r233431) +++ head/secure/usr.sbin/sshd/Makefile Sat Mar 24 19:41:43 2012 (r233432) @@ -43,6 +43,10 @@ LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 - DPADD+= ${LIBCRYPTO} ${LIBCRYPT} LDADD+= -lcrypto -lcrypt +.if defined(LOCALBASE) +CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" +.endif + .include .PATH: ${SSHDIR} From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 19:43:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 294EC106566C; Sat, 24 Mar 2012 19:43:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B2128FC1B; Sat, 24 Mar 2012 19:43:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OJhnKu046303; Sat, 24 Mar 2012 19:43:49 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OJhns5046296; Sat, 24 Mar 2012 19:43:49 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201203241943.q2OJhns5046296@svn.freebsd.org> From: Alan Cox Date: Sat, 24 Mar 2012 19:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233433 - in head/sys: amd64/amd64 amd64/conf conf i386/conf i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 19:43:50 -0000 Author: alc Date: Sat Mar 24 19:43:49 2012 New Revision: 233433 URL: http://svn.freebsd.org/changeset/base/233433 Log: Disable detailed PV entry accounting by default. Add a config option to enable it. MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/conf/NOTES head/sys/conf/options.amd64 head/sys/conf/options.i386 head/sys/i386/conf/NOTES head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Mar 24 19:41:43 2012 (r233432) +++ head/sys/amd64/amd64/pmap.c Sat Mar 24 19:43:49 2012 (r233433) @@ -158,7 +158,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_INLINE #endif -#define PV_STATS #ifdef PV_STATS #define PV_STAT(x) do { x ; } while (0) #else Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Sat Mar 24 19:41:43 2012 (r233432) +++ head/sys/amd64/conf/NOTES Sat Mar 24 19:43:49 2012 (r233433) @@ -559,6 +559,10 @@ options LINSYSFS options KSTACK_PAGES=5 +# Enable detailed accounting by the PV entry allocator. + +options PV_STATS + ##################################################################### # More undocumented options for linting. Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Sat Mar 24 19:41:43 2012 (r233432) +++ head/sys/conf/options.amd64 Sat Mar 24 19:43:49 2012 (r233433) @@ -10,6 +10,7 @@ PERFMON MPTABLE_FORCE_HTT MP_WATCHDOG NKPT opt_pmap.h +PV_STATS opt_pmap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Sat Mar 24 19:41:43 2012 (r233432) +++ head/sys/conf/options.i386 Sat Mar 24 19:43:49 2012 (r233433) @@ -16,6 +16,7 @@ NKPT opt_pmap.h PERFMON PMAP_SHPGPERPROC opt_pmap.h POWERFAIL_NMI opt_trap.h +PV_STATS opt_pmap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Sat Mar 24 19:41:43 2012 (r233432) +++ head/sys/i386/conf/NOTES Sat Mar 24 19:43:49 2012 (r233433) @@ -976,6 +976,10 @@ device lindev options KSTACK_PAGES=3 +# Enable detailed accounting by the PV entry allocator. + +options PV_STATS + ##################################################################### # More undocumented options for linting. Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Mar 24 19:41:43 2012 (r233432) +++ head/sys/i386/i386/pmap.c Sat Mar 24 19:43:49 2012 (r233433) @@ -172,7 +172,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_INLINE #endif -#define PV_STATS #ifdef PV_STATS #define PV_STAT(x) do { x ; } while (0) #else From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 19:50:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03FEA1065677 for ; Sat, 24 Mar 2012 19:50:16 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx1.freebsd.org (Postfix) with ESMTP id 746158FC17 for ; Sat, 24 Mar 2012 19:50:15 +0000 (UTC) Received: by wibhq7 with SMTP id hq7so2561443wib.13 for ; Sat, 24 Mar 2012 12:50:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=xZUTwmIKYH1RdYn4vZOixe04bBDzBrULMtiFFwfxLnc=; b=gJuTCSSibYdvbjD5kg0Gtt6mgLFXX/iMiCQgq0owdg34ZhJWATOc4biapLlMPDTd2C /XwcN4W+GAK89iur2eCcoI+A59WojzRHwKQiO5tX820iiwr4UyF4TK8/KBuXwKNLN614 oLCnohpvKSQOFJnrU3UpHzHa4482/GxxVYZEQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=xZUTwmIKYH1RdYn4vZOixe04bBDzBrULMtiFFwfxLnc=; b=fW1eL6cDCuoZiG41YBuXhmzJ3zCuexkvk4KOgILb7gDFavFkYXR0Sltj6vIiWiHmKP ObVdk9YDpKmQKRCPxD/QOPHdwO0rPu/JIBSmbVLGpB4dkL+gBlEr3O1fJbdy9dxbQyLj Sg5njI/dDZ2GouIUdN67I3awoah0IdG6xNAEpIAT2CK+rGxPp01WU9QtM7XYe3GECQMj 6SYyCXzkttcWmVj15wg8pDCwL97Ojq1r0o25aozXFtcbD0k55zQdNSBHaz8/71PgqOmv edYT6cPHxZ+MMAdrcnztaUr/E3zjAm0Qy/2S4c+HHN8ZCbWB4xLfeGnTNredR7+YGhkn MioA== Received: by 10.180.88.169 with SMTP id bh9mr6824649wib.5.1332618614264; Sat, 24 Mar 2012 12:50:14 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.63.4 with HTTP; Sat, 24 Mar 2012 12:49:44 -0700 (PDT) In-Reply-To: <4F6E2259.70505@FreeBSD.org> References: <201203241843.q2OIhIYu044270@svn.freebsd.org> <4F6E2259.70505@FreeBSD.org> From: Eitan Adler Date: Sat, 24 Mar 2012 15:49:44 -0400 X-Google-Sender-Auth: OMkukCq6FxglsPbi1wzZHjS82j4 Message-ID: To: Florian Smeets Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmPLDsKCJIqmeOROMk7GDd1t/6t5oDwaW73DetkNCVI2NNXoO7C/iqQgfosDQ98rGwHdTgg Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233429 - in head: etc/root share/examples share/examples/csh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 19:50:16 -0000 On Sat, Mar 24, 2012 at 3:36 PM, Florian Smeets wrote: > On 24.03.12 19:43, Eitan Adler wrote: >> >> Author: eadler >> Date: Sat Mar 24 18:43:18 2012 >> New Revision: 233429 >> URL: http://svn.freebsd.org/changeset/base/233429 >> >> Log: >> =C2=A0 - Make the default values for tcsh more user friendly >> =C2=A0 - Add an examples file with many of the not accepted suggestions = from >> the discussion >> >> =C2=A0 PR: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0conf/160689 >> =C2=A0 Reviewed by: many >> =C2=A0 Discussed on: =C2=A0 =C2=A0 =C2=A0 =C2=A0current >> =C2=A0 Approved by: cperciva >> > > Something like this is missing: > > Index: etc/mtree/BSD.usr.dist > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- etc/mtree/BSD.usr.dist =C2=A0 =C2=A0 =C2=A0(revision 233429) > +++ etc/mtree/BSD.usr.dist =C2=A0 =C2=A0 =C2=A0(working copy) > @@ -209,6 +209,8 @@ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bootforth > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0csh > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cvs > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 contrib > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. > > otherwise the build fails > > install -o root -g wheel -m 444 > /home/flo/dev/checkouts/svn-src/share/examples/csh/dot.cshrc > //usr/share/examples/csh/dot.cshrc > install: //usr/share/examples/csh/dot.cshrc: No such file or directory checking this out now - it didn't fail when I did installworld in a vm but I may have missed something. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 19:59:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C5F81065670; Sat, 24 Mar 2012 19:59:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D2258FC1A; Sat, 24 Mar 2012 19:59:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OJxFaW046816; Sat, 24 Mar 2012 19:59:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OJxFf0046814; Sat, 24 Mar 2012 19:59:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203241959.q2OJxFf0046814@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 24 Mar 2012 19:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233434 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 19:59:15 -0000 Author: nwhitehorn Date: Sat Mar 24 19:59:14 2012 New Revision: 233434 URL: http://svn.freebsd.org/changeset/base/233434 Log: Following suggestions from alc, skip wired mappings in pmap_remove_pages() and remove moea64_attr_*() in favor of direct calls to vm_page_dirty() and friends. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Mar 24 19:43:49 2012 (r233433) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Mar 24 19:59:14 2012 (r233434) @@ -396,29 +396,6 @@ vm_page_to_pvoh(vm_page_t m) } static __inline void -moea64_attr_clear(vm_page_t m, u_int64_t ptebit) -{ - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - m->md.mdpg_attrs &= ~ptebit; -} - -static __inline u_int64_t -moea64_attr_fetch(vm_page_t m) -{ - - return (m->md.mdpg_attrs); -} - -static __inline void -moea64_attr_save(vm_page_t m, u_int64_t ptebit) -{ - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - m->md.mdpg_attrs |= ptebit; -} - -static __inline void moea64_pte_create(struct lpte *pt, uint64_t vsid, vm_offset_t va, uint64_t pte_lo, int flags) { @@ -1555,7 +1532,7 @@ moea64_remove_write(mmu_t mmu, vm_page_t struct pvo_entry *pvo; uintptr_t pt; pmap_t pmap; - uint64_t lo; + uint64_t lo = 0; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea64_remove_write: page %p is not managed", m)); @@ -1570,7 +1547,6 @@ moea64_remove_write(mmu_t mmu, vm_page_t (m->aflags & PGA_WRITEABLE) == 0) return; vm_page_lock_queues(); - lo = moea64_attr_fetch(m); powerpc_sync(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { pmap = pvo->pvo_pmap; @@ -1593,10 +1569,8 @@ moea64_remove_write(mmu_t mmu, vm_page_t UNLOCK_TABLE(); PMAP_UNLOCK(pmap); } - if ((lo & LPTE_CHG) != 0) { - moea64_attr_clear(m, LPTE_CHG); + if ((lo & LPTE_CHG) != 0) vm_page_dirty(m); - } vm_page_aflag_clear(m, PGA_WRITEABLE); vm_page_unlock_queues(); } @@ -1945,6 +1919,21 @@ moea64_pvo_protect(mmu_t mmu, pmap_t pm PAGE_SIZE); } } + + /* + * Update vm about the REF/CHG bits if the page is managed. + */ + if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED) { + struct vm_page *pg; + + pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); + if (pg != NULL) { + if (pvo->pvo_pte.lpte.pte_lo & LPTE_CHG) + vm_page_dirty(pg); + if (pvo->pvo_pte.lpte.pte_lo & LPTE_REF) + vm_page_aflag_set(pg, PGA_REFERENCED); + } + } UNLOCK_TABLE(); } @@ -2055,8 +2044,10 @@ moea64_remove_pages(mmu_t mmu, pmap_t pm vm_page_lock_queues(); PMAP_LOCK(pm); - LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) - moea64_pvo_remove(mmu, pvo); + LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) { + if (!(pvo->pvo_vaddr & PVO_WIRED)) + moea64_pvo_remove(mmu, pvo); + } vm_page_unlock_queues(); PMAP_UNLOCK(pm); } @@ -2115,10 +2106,8 @@ moea64_remove_all(mmu_t mmu, vm_page_t m moea64_pvo_remove(mmu, pvo); PMAP_UNLOCK(pmap); } - if ((m->aflags & PGA_WRITEABLE) && moea64_is_modified(mmu, m)) { - moea64_attr_clear(m, LPTE_CHG); + if ((m->aflags & PGA_WRITEABLE) && moea64_is_modified(mmu, m)) vm_page_dirty(m); - } vm_page_aflag_clear(m, PGA_WRITEABLE); vm_page_unlock_queues(); } @@ -2354,15 +2343,17 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ pvo->pvo_pmap->pm_stats.wired_count--; /* - * Save the REF/CHG bits into their cache if the page is managed. + * Update vm about the REF/CHG bits if the page is managed. */ if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED) { struct vm_page *pg; pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); if (pg != NULL) { - moea64_attr_save(pg, pvo->pvo_pte.lpte.pte_lo & - (LPTE_REF | LPTE_CHG)); + if (pvo->pvo_pte.lpte.pte_lo & LPTE_CHG) + vm_page_dirty(pg); + if (pvo->pvo_pte.lpte.pte_lo & LPTE_REF) + vm_page_aflag_set(pg, PGA_REFERENCED); } } @@ -2436,19 +2427,13 @@ moea64_query_bit(mmu_t mmu, vm_page_t m, struct pvo_entry *pvo; uintptr_t pt; - if (moea64_attr_fetch(m) & ptebit) - return (TRUE); - vm_page_lock_queues(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { - /* - * See if we saved the bit off. If so, cache it and return - * success. + * See if we saved the bit off. If so, return success. */ if (pvo->pvo_pte.lpte.pte_lo & ptebit) { - moea64_attr_save(m, ptebit); vm_page_unlock_queues(); return (TRUE); } @@ -2465,7 +2450,7 @@ moea64_query_bit(mmu_t mmu, vm_page_t m, /* * See if this pvo has a valid PTE. if so, fetch the * REF/CHG bits from the valid PTE. If the appropriate - * ptebit is set, cache it and return success. + * ptebit is set, return success. */ LOCK_TABLE(); pt = MOEA64_PVO_TO_PTE(mmu, pvo); @@ -2473,8 +2458,6 @@ moea64_query_bit(mmu_t mmu, vm_page_t m, MOEA64_PTE_SYNCH(mmu, pt, &pvo->pvo_pte.lpte); if (pvo->pvo_pte.lpte.pte_lo & ptebit) { UNLOCK_TABLE(); - - moea64_attr_save(m, ptebit); vm_page_unlock_queues(); return (TRUE); } @@ -2496,11 +2479,6 @@ moea64_clear_bit(mmu_t mmu, vm_page_t m, vm_page_lock_queues(); /* - * Clear the cached value. - */ - moea64_attr_clear(m, ptebit); - - /* * Sync so that any pending REF/CHG bits are flushed to the PTEs (so * we can reset the right ones). note that since the pvo entries and * list heads are accessed via BAT0 and are never placed in the page From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 20:03:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE3851065849; Sat, 24 Mar 2012 20:03:29 +0000 (UTC) (envelope-from jbeich@tormail.net) Received: from server2.allsitecontrol.com (server2.allsitecontrol.com [63.143.36.210]) by mx1.freebsd.org (Postfix) with ESMTP id 80CFE8FC17; Sat, 24 Mar 2012 20:03:29 +0000 (UTC) Received: from lumumba.torservers.net ([77.247.181.163]:30979 helo=internal.tormail.net) by server2.allsitecontrol.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.69) (envelope-from ) id 1SBXBI-003gkk-QH; Sat, 24 Mar 2012 15:03:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tormail.net; s=tm; h=Message-Id:X-TorMail-User:Content-Type:MIME-Version:References:Date:In-Reply-To:Subject:Cc:To:From; bh=KZTbtAOp7ev/AIdzMzC8LcZQj0gSAxL02y06JxkEpU8=; b=M3vJplzMwUI5O1Z+xOOuVBLbVEoriMOXsEI6hLO2uljPcqR3iK3sKTnHNSUDX9ml68I+fb/ePo9q2bfd8K0Rx+at093Bv78su1rQ4+W8Biv/r0bwiooSCxJp9YXN3kkMJBhjsnBV9w5DTkUtQ50dqq1J9HUpRCDVHq3b//4tohI=; Received: from jbeich by internal.tormail.net with local (Exim 4.63) (envelope-from ) id 1SBXAT-000Aon-CK; Sat, 24 Mar 2012 20:02:30 +0000 From: Jan Beich To: Eitan Adler In-Reply-To: <201203241843.q2OIhIYu044270@svn.freebsd.org> (Eitan Adler's message of "Sat, 24 Mar 2012 18:43:18 +0000 (UTC)") Date: Sun, 25 Mar 2012 03:00:13 +0700 References: <201203241843.q2OIhIYu044270__28697.4912429743$1332614633$gmane$org@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain X-TorMail-User: jbeich Message-Id: <1SBXAT-000Aon-CK@internal.tormail.net> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server2.allsitecontrol.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tormail.net X-Source: X-Source-Args: X-Source-Dir: Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233429 - in head: etc/root share/examples share/examples/csh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 20:03:29 -0000 Eitan Adler writes: > Author: eadler > Date: Sat Mar 24 18:43:18 2012 > New Revision: 233429 > URL: http://svn.freebsd.org/changeset/base/233429 > > Log: > - Make the default values for tcsh more user friendly [...] > Modified: head/etc/root/dot.cshrc > ============================================================================== > --- head/etc/root/dot.cshrc Sat Mar 24 18:25:16 2012 (r233428) > +++ head/etc/root/dot.cshrc Sat Mar 24 18:43:18 2012 (r233429) [...] > + bindkey "\e[1~" beginning-of-line #make Home key work; > + bindkey "\e[4~" end-of-line #make End key work; Home/End keys are already bound unless termcap is somehow broken. $ tcsh -f > bindkey ... Arrow key bindings down -> down-history up -> up-history left -> backward-char right -> forward-char home -> beginning-of-line end -> end-of-line Also, if you launch xterm with `-kt tcap' it would produce whatever kh/@7 sequences are, e.g. different under tmux/screen. > + bindkey "\e[3~" delete-char #make Delete key work; inb4 someone expands static list of arrow keys in tcsh set key_dc=`echotc kD` bindkey $key_dc delete-char From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 20:42:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 30CAF1065672 for ; Sat, 24 Mar 2012 20:42:53 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id AA56F8FC1A for ; Sat, 24 Mar 2012 20:42:52 +0000 (UTC) Received: by wgbds12 with SMTP id ds12so2890162wgb.31 for ; Sat, 24 Mar 2012 13:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=RGVSJMsbRo8b/WUvNbeGuzc0Yk+PihZl2qB03ScoCPY=; b=CWAI8DRfm+5og6wOWWeeols0foiHJgaC03TYzbiWKf9x5k+hS4IaSG+2r/EJD7Xwv2 NtdOV/y05L4tRQBgpHCY/KqiAhLi8NtG9UX8+Guw3lw/mMYNC3jF2ZZJoh0M6pnMsdWB P7M6cRirNZwZQRoKBhOL9s0tFiO6Whn10QJBc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=RGVSJMsbRo8b/WUvNbeGuzc0Yk+PihZl2qB03ScoCPY=; b=TJFGmEE2SqCmwVHk/jmU0QfwO4tRccBu56YRpRt0qFSzVKAci2cdrRRq9pRgqBQhL4 ZjBLkcalk2db3Zeu3E9emvwPdLDpGZK2+sC5weqabOlTT4Dro7U3M55xAb+y80NrQhyO 386bmQQVP1/tWc/zOh9BwemOl31qWXtpJ6OD1FZyCh5u1dZ3CkCyRy4r0/ROvhVaH8no sYICZGkdrBfsx6xzJlZqNvFdtem9GLy11FPseYRwH2FdxicycjDqTz05rxqp6tYmZktK R31V46SJnm73dNgdkrLMs+XKu6IB8AMf616CnG3xZL3RMquK8D1qhFuKCC+JM7QZDE4K RpJA== Received: by 10.180.88.169 with SMTP id bh9mr7031954wib.5.1332621771741; Sat, 24 Mar 2012 13:42:51 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.63.4 with HTTP; Sat, 24 Mar 2012 13:42:21 -0700 (PDT) In-Reply-To: References: <201203241843.q2OIhIYu044270@svn.freebsd.org> <4F6E2259.70505@FreeBSD.org> From: Eitan Adler Date: Sat, 24 Mar 2012 16:42:21 -0400 X-Google-Sender-Auth: fEAyrb4wMc81s7oIgxw-QiAMm9c Message-ID: To: Florian Smeets , Colin Percival Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmEJhOBqEhA0npwSPg8k8VHXKLk8wjkrGfk/rKnyIwXaWahI0SoJjreFzqRfbgcRcrEQbqV Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233429 - in head: etc/root share/examples share/examples/csh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 20:42:53 -0000 On Sat, Mar 24, 2012 at 3:49 PM, Eitan Adler wrote: >> Something like this is missing: ... >> otherwise the build fails Is the following correct? For some reason the build doesn't fail for me in either case so I can't actually confirm. commit 6060054640292a746de3e9ffcfee9d87ed0a8750 Author: Eitan Adler Date: Sat Mar 24 16:28:02 2012 -0400 Fix build by adding new directory to mtree in r233429 Submitted by: flo Approved by: cperciva MFC after: 1 week diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 87497b1..b9f79d2 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -209,6 +209,8 @@ .. bootforth .. + csh + .. cvs contrib .. -- Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 20:46:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACE081065672 for ; Sat, 24 Mar 2012 20:46:29 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx1.freebsd.org (Postfix) with ESMTP id 178B48FC1C for ; Sat, 24 Mar 2012 20:46:28 +0000 (UTC) Received: by wibhq7 with SMTP id hq7so2580306wib.13 for ; Sat, 24 Mar 2012 13:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=t/7dBXyC9jb9iKFfJ+1AIPO1gSXVuRedq0clkXgIupA=; b=HpzKP2thzi7zI4h8WZgr4K3XrMnNdRqe3RkRuFMr/Z/YPyw+7Q7V0Yc9wOTGiOe4mD Fwmo5dJNmgKKVLhh1CprXJyJ0Y3AlZim1u5jM7CCiLTK8S8SyCSUWp329tAPuCpTNRMw 2E4ljsFMfhhhDm776YkW/xzD9VDnz00LCrugM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=t/7dBXyC9jb9iKFfJ+1AIPO1gSXVuRedq0clkXgIupA=; b=XJwMgAqOH6v+vpgfM+QKkESgBO1gDhOHqrJ2CqAkZT6BaHzzaxd5xl61xfmbTuoUGR eGp6YsyXhyB9mN7Qq+0d3zV21KHjHhj2xyoFsijOXpw9vZMiMbvcHp0wRZL1KasCS9U5 vb4yLoR7PYFIO56XdnWrHCcK0GqZCFO5ZLl2YC0asCJPPwo1zRAAiKoQI1QrNW0NPVp2 ur4RYQnwj9Gt9isyCcfXYEs/4etzBAA8xslJyEqke7MwZIy2ritVQvAqjhxALmDneiA+ 0MNAS1LS9Oln2CnHbbgRvyobvy93gtgj0kH5qZuHl9gs2HsNnuKfy/D3b9NYZEwU55u3 U2JQ== Received: by 10.216.134.2 with SMTP id r2mr9717674wei.31.1332621987909; Sat, 24 Mar 2012 13:46:27 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.63.4 with HTTP; Sat, 24 Mar 2012 13:45:57 -0700 (PDT) In-Reply-To: References: <201203241825.q2OIPH5F043611@svn.freebsd.org> From: Eitan Adler Date: Sat, 24 Mar 2012 16:45:57 -0400 X-Google-Sender-Auth: mk0CAOfmUacqdelY4lXi5J9upeo Message-ID: To: Juli Mallett Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmzuSQBK1pXr3Tb0AJ3wAlzWcbnQUYQGuQB5Wz0yCarsT0rpMMVrqnksZ81E12UpSxh0yGs Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233428 - head/share/examples/cvsup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 20:46:29 -0000 On Sat, Mar 24, 2012 at 3:16 PM, Juli Mallett wrote: > The name of the protocol is certainly CVSup and not csup. =C2=A0And the > protocol is what is being referred to here (as is suggested by the > parenthetical.) =C2=A0If the protocol weren't being referred to, it would > be a literal "cvsup" since that's the spelling of the command, not > "CVSup". I read this as csup the program (what does csup stand for?) but I don't care much either way. I'd be happy to change it to CVSup if people care :) --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 21:10:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31CDA106564A; Sat, 24 Mar 2012 21:10:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D0BF8FC17; Sat, 24 Mar 2012 21:10:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OLAJ3n049047; Sat, 24 Mar 2012 21:10:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OLAJSZ049045; Sat, 24 Mar 2012 21:10:19 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203242110.q2OLAJSZ049045@svn.freebsd.org> From: Eitan Adler Date: Sat, 24 Mar 2012 21:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233435 - head/etc/mtree X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 21:10:20 -0000 Author: eadler Date: Sat Mar 24 21:10:19 2012 New Revision: 233435 URL: http://svn.freebsd.org/changeset/base/233435 Log: Fix build by adding new directory to mtree in r233429 Submitted by: flo Approved by: cperciva MFC after: 1 week Modified: head/etc/mtree/BSD.usr.dist Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Sat Mar 24 19:59:14 2012 (r233434) +++ head/etc/mtree/BSD.usr.dist Sat Mar 24 21:10:19 2012 (r233435) @@ -209,6 +209,8 @@ .. bootforth .. + csh + .. cvs contrib .. From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 21:19:54 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FFA3106566B; Sat, 24 Mar 2012 21:19:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id CF1FF8FC0A; Sat, 24 Mar 2012 21:19:53 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:c8dc:6e5:d0ce:fe36] (unknown [IPv6:2001:7b8:3a7:0:c8dc:6e5:d0ce:fe36]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 084F15C37; Sat, 24 Mar 2012 22:19:53 +0100 (CET) Message-ID: <4F6E3A7D.9020709@FreeBSD.org> Date: Sat, 24 Mar 2012 22:19:57 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120312 Thunderbird/11.0 MIME-Version: 1.0 To: Bruce Evans References: <201203241007.q2OA7MtS024789@svn.freebsd.org> <20120325040224.Q2467@besplex.bde.org> In-Reply-To: <20120325040224.Q2467@besplex.bde.org> X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, tijl@FreeBSD.org Subject: Re: svn commit: r233419 - head/sys/x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 21:19:54 -0000 On 2012-03-24 18:48, Bruce Evans wrote: > On Sat, 24 Mar 2012, Dimitry Andric wrote: > >> Log: >> Fix the following clang warning in sys/dev/dcons/dcons.c, caused by the >> recent changes in sys/x86/include/endian.h: >> >> sys/dev/dcons/dcons.c:190:15: error: implicit conversion from '__uint32_t' (aka 'unsigned int') to '__uint16_t' (aka 'unsigned short') changes value from 1684238190 to 28526 [-Werror,-Wconstant-conversion] >> >> buf->magic = ntohl(DCONS_MAGIC); >> ^~~~~~~~~~~~~~~~~~ >> sys/sys/param.h:306:18: note: expanded from: >> #define ntohl(x) __ntohl(x) >> ^ >> ./x86/endian.h:128:20: note: expanded from: >> #define __ntohl(x) __bswap32(x) >> ^ >> ./x86/endian.h:78:20: note: expanded from: >> __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x)) >> ^ >> ./x86/endian.h:68:26: note: expanded from: >> (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) >> ^ >> ./x86/endian.h:75:53: note: expanded from: >> __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x))) >> ~~~~~~~~~~~~~ ^ > > This warning was discussed before things were committed. Then why was it committed without fixing the warning first? > gcc gives a > similar warning, but according to tijl, it can't happen in normal use > with either gcc or clang because -Wno-system-headers suppresses warnings > in system headers. -Wnosystem-headers is the default in the kernel, > where the above problem happens, so I don't see how it happens. I don't see that option anywhere in either the world or kernel build. Why would you not want to warn about system headers? > However, bsd.sys.mk forces the non-default of -Wsystem-headers in > userland at WARNS >= 1, so I don't see why there isn't a problem in > userland if userland actually uses an expression like > ntohl(DCONS_MAGIC). It only occurs in certain cases, and I have not been able to exactly determine when. It doesn't seem to be related to -Wsystem-headers. >> This is because the __bswapXX_gen() macros (for x86) call the regular >> __bswapXX() macros. Since the __bswapXX_gen() variants are only called >> when their arguments are constant, there is no need to do that constancy >> check recursively. Also, it causes the above error with clang. > > Not true. The __bswapXX_gen() are called with non-constant args from > __bswap64_var() in the i386 case. Sure, but there it doesn't matter at all. > As documented there, it is important > for optimizations that __bswap64_gen() does do the constancy check > recursively. This was discussed before things were committed, and > again when jhb siggested breaking it similarly to this commit to avoid > a problem on ia64. Isn't it much easier, and less obtuse, to just jam in two bswaps for the i386? I never saw the reason for making the bswap macros *more* complicated instead of less. If you obfuscate them enough, no compiler will be able to optimize properly... :) >> Fix it by calling __bswap16_gen() from __bswap32_gen(), and similarly, >> __bswap32_gen() from __bswap64_gen(). > > This breaks it. DIring development, I had a correct fix involving > casting down the arg. If it works correctly with clang, please post it. >> While here, add extra parentheses around the __bswap16_gen() macro >> expansion, to prevent unexpected side effects. > > These parentheses were intentionally left out for clarity. > __bswap16_gen() is not user-serving, and all places in endian.h that > use it supply enough parentheses. Let's hope so, until a follow up commit breaks it again. From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 22:32:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D420106564A; Sat, 24 Mar 2012 22:32:20 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DBF88FC18; Sat, 24 Mar 2012 22:32:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2OMWJqi051664; Sat, 24 Mar 2012 22:32:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2OMWJIJ051662; Sat, 24 Mar 2012 22:32:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203242232.q2OMWJIJ051662@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 24 Mar 2012 22:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233436 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 22:32:20 -0000 Author: nwhitehorn Date: Sat Mar 24 22:32:19 2012 New Revision: 233436 URL: http://svn.freebsd.org/changeset/base/233436 Log: Only call vm_page_dirty() on pages that are writable in order not to confuse the VM. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Mar 24 21:10:19 2012 (r233435) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Mar 24 22:32:19 2012 (r233436) @@ -1889,6 +1889,7 @@ static void moea64_pvo_protect(mmu_t mmu, pmap_t pm, struct pvo_entry *pvo, vm_prot_t prot) { uintptr_t pt; + uint64_t oldlo; /* * Grab the PTE pointer before we diddle with the cached PTE @@ -1900,11 +1901,15 @@ moea64_pvo_protect(mmu_t mmu, pmap_t pm /* * Change the protection of the page. */ + oldlo = pvo->pvo_pte.lpte.pte_lo; pvo->pvo_pte.lpte.pte_lo &= ~LPTE_PP; - pvo->pvo_pte.lpte.pte_lo |= LPTE_BR; pvo->pvo_pte.lpte.pte_lo &= ~LPTE_NOEXEC; if ((prot & VM_PROT_EXECUTE) == 0) pvo->pvo_pte.lpte.pte_lo |= LPTE_NOEXEC; + if (prot & VM_PROT_WRITE) + pvo->pvo_pte.lpte.pte_lo |= LPTE_BW; + else + pvo->pvo_pte.lpte.pte_lo |= LPTE_BR; /* * If the PVO is in the page table, update that pte as well. @@ -1921,9 +1926,11 @@ moea64_pvo_protect(mmu_t mmu, pmap_t pm } /* - * Update vm about the REF/CHG bits if the page is managed. + * Update vm about the REF/CHG bits if the page is managed and we have + * removed write access. */ - if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED) { + if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED && + (oldlo & LPTE_PP) != LPTE_BR && !(prot && VM_PROT_WRITE)) { struct vm_page *pg; pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); @@ -2345,7 +2352,8 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ /* * Update vm about the REF/CHG bits if the page is managed. */ - if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED) { + if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED && + (pvo->pvo_pte.lpte.pte_lo & LPTE_PP) != LPTE_BR) { struct vm_page *pg; pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); From owner-svn-src-all@FreeBSD.ORG Sat Mar 24 23:10:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C01F11065687; Sat, 24 Mar 2012 23:10:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D1DD8FC1A; Sat, 24 Mar 2012 23:10:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ONAIx6052853; Sat, 24 Mar 2012 23:10:18 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ONAIP0052851; Sat, 24 Mar 2012 23:10:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203242310.q2ONAIP0052851@svn.freebsd.org> From: Eitan Adler Date: Sat, 24 Mar 2012 23:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233437 - head/share/examples/csh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 23:10:18 -0000 Author: eadler Date: Sat Mar 24 23:10:18 2012 New Revision: 233437 URL: http://svn.freebsd.org/changeset/base/233437 Log: Add a few more examples Submitted by: jmallett Approved by: cperciva (implicit) MFC after: 3 days X-MFC-With: r233429 Modified: head/share/examples/csh/dot.cshrc Modified: head/share/examples/csh/dot.cshrc ============================================================================== --- head/share/examples/csh/dot.cshrc Sat Mar 24 22:32:19 2012 (r233436) +++ head/share/examples/csh/dot.cshrc Sat Mar 24 23:10:18 2012 (r233437) @@ -32,6 +32,7 @@ complete pkg_delete 'c/-/(i v D n p complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed svar/db/pkg/%%`@" complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' complete killall 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/' +complete dd 'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/=' alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1A alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*' complete portmaster 'c/--/(always-fetch check-depends check-port-dbdir clean-distfiles \ @@ -56,5 +57,8 @@ set ellipsis alias ll ls -lAhG alias ls ls -G +# Color on many system utilities +setenv CLICOLOR 1 + # other autolist options set autolist = TAB