From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 00:04:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F2C476B; Sun, 22 Dec 2013 00:04:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7AC3A1D8E; Sun, 22 Dec 2013 00:04:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBM04pvO073843; Sun, 22 Dec 2013 00:04:51 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBM04pBK073842; Sun, 22 Dec 2013 00:04:51 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312220004.rBM04pBK073842@svn.freebsd.org> From: Justin Hibbits Date: Sun, 22 Dec 2013 00:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259699 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 00:04:51 -0000 Author: jhibbits Date: Sun Dec 22 00:04:50 2013 New Revision: 259699 URL: http://svnweb.freebsd.org/changeset/base/259699 Log: Set the PMC trapframe macros appropriately MFC after: 2 weeks Modified: head/sys/powerpc/include/pmc_mdep.h Modified: head/sys/powerpc/include/pmc_mdep.h ============================================================================== --- head/sys/powerpc/include/pmc_mdep.h Sun Dec 22 00:04:03 2013 (r259698) +++ head/sys/powerpc/include/pmc_mdep.h Sun Dec 22 00:04:50 2013 (r259699) @@ -28,8 +28,8 @@ union pmc_md_pmc { struct pmc_md_powerpc_pmc pm_powerpc; }; -#define PMC_TRAPFRAME_TO_PC(TF) (0) /* Stubs */ -#define PMC_TRAPFRAME_TO_FP(TF) (0) +#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->srr0) +#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->fixreg[1]) #define PMC_TRAPFRAME_TO_SP(TF) (0) #endif From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 00:08:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 858F19F6; Sun, 22 Dec 2013 00:08:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7220A1DA7; Sun, 22 Dec 2013 00:08:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBM081Ap074448; Sun, 22 Dec 2013 00:08:01 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBM081BG074447; Sun, 22 Dec 2013 00:08:01 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312220008.rBM081BG074447@svn.freebsd.org> From: Neel Natu Date: Sun, 22 Dec 2013 00:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259702 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 00:08:01 -0000 Author: neel Date: Sun Dec 22 00:08:00 2013 New Revision: 259702 URL: http://svnweb.freebsd.org/changeset/base/259702 Log: Consolidate the virtual apic initialization in a single function: vlapic_reset() Modified: head/sys/amd64/vmm/io/vlapic.c Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Sun Dec 22 00:07:40 2013 (r259701) +++ head/sys/amd64/vmm/io/vlapic.c Sun Dec 22 00:08:00 2013 (r259702) @@ -334,33 +334,24 @@ vlapic_update_errors(struct vlapic *vlap } static void -vlapic_init_ipi(struct vlapic *vlapic) +vlapic_reset(struct vlapic *vlapic) { - struct LAPIC *lapic = &vlapic->apic; + struct LAPIC *lapic; + + lapic = &vlapic->apic; + bzero(lapic, sizeof(struct LAPIC)); + lapic->version = VLAPIC_VERSION; lapic->version |= (VLAPIC_MAXLVT_ENTRIES << MAXLVTSHIFT); lapic->dfr = 0xffffffff; lapic->svr = APIC_SVR_VECTOR; vlapic_mask_lvts(&lapic->lvt_timer, VLAPIC_MAXLVT_ENTRIES+1); -} - -static int -vlapic_reset(struct vlapic *vlapic) -{ - struct LAPIC *lapic = &vlapic->apic; - - memset(lapic, 0, sizeof(*lapic)); - lapic->apr = vlapic->vcpuid; - vlapic_init_ipi(vlapic); vlapic_set_dcr(vlapic, 0); if (vlapic->vcpuid == 0) vlapic->boot_state = BS_RUNNING; /* BSP */ else vlapic->boot_state = BS_INIT; /* AP */ - - return 0; - } void From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 09:27:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CA3C772; Sun, 22 Dec 2013 09:27:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 062771E73; Sun, 22 Dec 2013 09:27:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBM9RvAY074693; Sun, 22 Dec 2013 09:27:57 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBM9Rvi5074692; Sun, 22 Dec 2013 09:27:57 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312220927.rBM9Rvi5074692@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 09:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259708 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 09:27:58 -0000 Author: rodrigc Date: Sun Dec 22 09:27:57 2013 New Revision: 259708 URL: http://svnweb.freebsd.org/changeset/base/259708 Log: Add item for clang 3.3 update. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 01:00:00 2013 (r259707) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 09:27:57 2013 (r259708) @@ -350,6 +350,11 @@ Userland Changes + &man.clang.1; and llvm have been updated to + version 3.3 release. Please refer to + + Clang 3.3 Release Notes. + BIND has been replaced by &man.unbound.8; for local dns resolution in the base system. With this change, nslookup and dig are no longer a part of the base system. Users should From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 09:28:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 082A78AE; Sun, 22 Dec 2013 09:28:24 +0000 (UTC) Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA4C91E78; Sun, 22 Dec 2013 09:28:23 +0000 (UTC) Received: by mail-ie0-f176.google.com with SMTP id at1so4757425iec.7 for ; Sun, 22 Dec 2013 01:28:23 -0800 (PST) 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=itRTe3CRN/X2DrHBi/V9Q+Oh7TqElJQ7nzB9Kd4EV14=; b=BL9i2d/dhH96WOjJpndKmwTKtET5MML+76Nk1fJvu9aR3Jd8FSrOZawRfRd+XhnFLt MrV9HuJUQ50CRg7XbZqro80JPYm7HxDhC2suzQFHpRB30OE6f3Zr/o91k4nuaUi5GoA5 wBuj+9YXqAo1PU4Notr3Ig+GnBZV2nimPdcI7NUxFNf9p6i0yDMIZo0Izp0mPAy6u+6d W2SLhZ6UP8iZUgE42SWpvQLgoxzctkJBAQn0yx51Drqws9Nbp79Iw3ZVeTUfbLxoAfZC 2z8WENDeWPInbhkOCN4QX+tJOhkhHTmtwo/rxIu4nJTjNQ2nofiPGauCprsi00asU2w+ wbVg== MIME-Version: 1.0 X-Received: by 10.42.226.66 with SMTP id iv2mr12450874icb.11.1387704503047; Sun, 22 Dec 2013 01:28:23 -0800 (PST) Received: by 10.64.18.14 with HTTP; Sun, 22 Dec 2013 01:28:22 -0800 (PST) In-Reply-To: <201312211623.rBLGNVaq008807@svn.freebsd.org> References: <201312211623.rBLGNVaq008807@svn.freebsd.org> Date: Sun, 22 Dec 2013 17:28:22 +0800 Message-ID: Subject: Re: svn commit: r259685 - in head/sys: arm/at91 dev/uart From: Ganbold Tsagaankhuu To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 09:28:24 -0000 On Sun, Dec 22, 2013 at 12:23 AM, Warner Losh wrote: > Author: imp > Date: Sat Dec 21 16:23:31 2013 > New Revision: 259685 > URL: http://svnweb.freebsd.org/changeset/base/259685 > > Log: > Plumb the cn_grab and cn_ungrab routines down into the uart > clients. Mask RX interrupts while grabbed on the atmel serial > driver. This UART interrupts every character. When interrupts are > enabled at the mountroot> prompt, this means the ISR eats the > characters. Rather than try to create a cooperative buffering system > for the low level kernel console, instead just mask out the ISR. For > NS8250 and decsendents this isn't needed, since interrupts only happen > after 14 or more characters (depending on the fifo settings). Plumb > such that these are optional so there's no change in behavior for all > the other UART clients. ddb worked on this platform because all > interrupts were disabled while it was running, so this problem wasn't > noticed. The mountroot> issue has been around for a very very long > time. > > MFC after: 3 days > > Modified: > head/sys/arm/at91/uart_dev_at91usart.c > head/sys/dev/uart/uart_cpu.h > head/sys/dev/uart/uart_tty.c > There is PR "kern/184919: uart infrastructure missing console grab / ungrab hooks", maybe that one should be closed. Ganbold > > Modified: head/sys/arm/at91/uart_dev_at91usart.c > > ============================================================================== > --- head/sys/arm/at91/uart_dev_at91usart.c Sat Dec 21 15:40:36 2013 > (r259684) > +++ head/sys/arm/at91/uart_dev_at91usart.c Sat Dec 21 16:23:31 2013 > (r259685) > @@ -219,6 +219,20 @@ at91_usart_param(struct uart_bas *bas, i > return (0); > } > > +static void > +at91_usart_grab(struct uart_bas *bas) > +{ > + > + WR4(bas, USART_IDR, USART_CSR_RXRDY); > +} > + > +static void > +at91_usart_ungrab(struct uart_bas *bas) > +{ > + > + WR4(bas, USART_IER, USART_CSR_RXRDY); > +} > + > static struct uart_ops at91_usart_ops = { > .probe = at91_usart_probe, > .init = at91_usart_init, > @@ -226,6 +240,8 @@ static struct uart_ops at91_usart_ops = > .putc = at91_usart_putc, > .rxready = at91_usart_rxready, > .getc = at91_usart_getc, > + .grab = at91_usart_grab, > + .ungrab = at91_usart_ungrab, > }; > > static int > > Modified: head/sys/dev/uart/uart_cpu.h > > ============================================================================== > --- head/sys/dev/uart/uart_cpu.h Sat Dec 21 15:40:36 2013 > (r259684) > +++ head/sys/dev/uart/uart_cpu.h Sat Dec 21 16:23:31 2013 > (r259685) > @@ -43,6 +43,8 @@ struct uart_ops { > void (*putc)(struct uart_bas *, int); > int (*rxready)(struct uart_bas *); > int (*getc)(struct uart_bas *, struct mtx *); > + void (*grab)(struct uart_bas *); > + void (*ungrab)(struct uart_bas *); > }; > > extern bus_space_tag_t uart_bus_space_io; > @@ -135,6 +137,27 @@ uart_putc(struct uart_devinfo *di, int c > uart_unlock(di->hwmtx); > } > > +static __inline void > +uart_grab(struct uart_devinfo *di) > +{ > + > + uart_lock(di->hwmtx); > + if (di->ops->grab) > + di->ops->grab(&di->bas); > + uart_unlock(di->hwmtx); > +} > + > +static __inline void > +uart_ungrab(struct uart_devinfo *di) > +{ > + > + uart_lock(di->hwmtx); > + if (di->ops->ungrab) > + di->ops->ungrab(&di->bas); > + uart_unlock(di->hwmtx); > +} > + > + > static __inline int > uart_rxready(struct uart_devinfo *di) > { > > Modified: head/sys/dev/uart/uart_tty.c > > ============================================================================== > --- head/sys/dev/uart/uart_tty.c Sat Dec 21 15:40:36 2013 > (r259684) > +++ head/sys/dev/uart/uart_tty.c Sat Dec 21 16:23:31 2013 > (r259685) > @@ -112,11 +112,15 @@ uart_cnterm(struct consdev *cp) > static void > uart_cngrab(struct consdev *cp) > { > + > + uart_grab(cp->cn_arg); > } > > static void > uart_cnungrab(struct consdev *cp) > { > + > + uart_ungrab(cp->cn_arg); > } > > static void > From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 09:40:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2940BE7; Sun, 22 Dec 2013 09:40:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E8E81F21; Sun, 22 Dec 2013 09:40:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBM9e38E078525; Sun, 22 Dec 2013 09:40:03 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBM9e3LG078524; Sun, 22 Dec 2013 09:40:03 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312220940.rBM9e3LG078524@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 09:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259709 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 09:40:03 -0000 Author: rodrigc Date: Sun Dec 22 09:40:03 2013 New Revision: 259709 URL: http://svnweb.freebsd.org/changeset/base/259709 Log: Add revision number for BIND removal. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 09:27:57 2013 (r259708) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 09:40:03 2013 (r259709) @@ -355,7 +355,7 @@ Clang 3.3 Release Notes. - BIND has been replaced by &man.unbound.8; for + BIND has been replaced by &man.unbound.8; for local dns resolution in the base system. With this change, nslookup and dig are no longer a part of the base system. Users should instead use &man.host.1; and &man.drill.1; Alternatively, From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 10:24:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E469B944; Sun, 22 Dec 2013 10:24:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF11011FA; Sun, 22 Dec 2013 10:24:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMAOEF8096031; Sun, 22 Dec 2013 10:24:14 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMAOEka096030; Sun, 22 Dec 2013 10:24:14 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312221024.rBMAOEka096030@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 10:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259710 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 10:24:15 -0000 Author: rodrigc Date: Sun Dec 22 10:24:14 2013 New Revision: 259710 URL: http://svnweb.freebsd.org/changeset/base/259710 Log: Mention that GCC is not built on platforms where CLANG is the default system compiler. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 09:40:03 2013 (r259709) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:24:14 2013 (r259710) @@ -350,6 +350,14 @@ Userland Changes + On platforms where &man.clang.1; is the default + system compiler, (such as i386, amd64, arm) GCC and GNU libstdc++ are no + longer built by default. &man.clang.1; and libc++ from LLVM are used on + these platforms by instead. GCC 4.2.1 and libstdc++ are still built + and used by default on pc98 and all other platforms where &man.clang.1; + is not the default system compiler. + + &man.clang.1; and llvm have been updated to version 3.3 release. Please refer to From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 10:33:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86589B3B; Sun, 22 Dec 2013 10:33:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71EB1127F; Sun, 22 Dec 2013 10:33:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMAX2h5099400; Sun, 22 Dec 2013 10:33:02 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMAX2Bp099399; Sun, 22 Dec 2013 10:33:02 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312221033.rBMAX2Bp099399@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 10:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259711 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 10:33:02 -0000 Author: rodrigc Date: Sun Dec 22 10:33:01 2013 New Revision: 259711 URL: http://svnweb.freebsd.org/changeset/base/259711 Log: Add revision number for iSCSI initiator. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:24:14 2013 (r259710) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:33:01 2013 (r259711) @@ -317,7 +317,7 @@ File Systems - A new kernel-based iSCSI target and initiator has been + A new kernel-based iSCSI target and initiator has been added UFS filesystems can now be enlarged with &man.growfs.8; while From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 10:42:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1215CF4; Sun, 22 Dec 2013 10:42:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CCAEB12F2; Sun, 22 Dec 2013 10:42:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMAglkS002894; Sun, 22 Dec 2013 10:42:47 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMAglcp002893; Sun, 22 Dec 2013 10:42:47 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312221042.rBMAglcp002893@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 10:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259712 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 10:42:48 -0000 Author: rodrigc Date: Sun Dec 22 10:42:47 2013 New Revision: 259712 URL: http://svnweb.freebsd.org/changeset/base/259712 Log: Mention TRIM support for ZFS. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:33:01 2013 (r259711) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:42:47 2013 (r259712) @@ -343,6 +343,14 @@ by a snapshot, both copies of the block are kept even though both contain the same data. + + ZFS + + TRIM support has been added for + ZFS. + + + From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 10:50:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F34F5EEF; Sun, 22 Dec 2013 10:50:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C65471324; Sun, 22 Dec 2013 10:50:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMAo99U003851; Sun, 22 Dec 2013 10:50:09 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMAo9Dc003850; Sun, 22 Dec 2013 10:50:09 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312221050.rBMAo9Dc003850@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 10:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259713 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 10:50:10 -0000 Author: rodrigc Date: Sun Dec 22 10:50:09 2013 New Revision: 259713 URL: http://svnweb.freebsd.org/changeset/base/259713 Log: Re-order ZFS items. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:42:47 2013 (r259712) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:50:09 2013 (r259713) @@ -329,26 +329,26 @@ base system. It allows the use of nearly all fusefs file systems - Support for the high performance LZ4 compression algorithm - has been added to ZFS. LZ4 is usually faster and can achieve a - higher compression ratio than LZJB, the default compression - algorithm - - Support for L2ARC compression has been added to ZFS. - - ZFS will now compare the checksums of incoming writes to - the checksum of the existing on-disk data and avoid issuing any - write I/O for data that has not changed. This will reduce I/O - as well as space usage because if the old block is referenced - by a snapshot, both copies of the block are kept even though - both contain the same data. - ZFS TRIM support has been added for ZFS. + Support for the high performance LZ4 compression algorithm + has been added to ZFS. LZ4 is usually faster and can achieve a + higher compression ratio than LZJB, the default compression + algorithm + + Support for L2ARC compression has been added to ZFS. + + ZFS will now compare the checksums of incoming writes to + the checksum of the existing on-disk data and avoid issuing any + write I/O for data that has not changed. This will reduce I/O + as well as space usage because if the old block is referenced + by a snapshot, both copies of the block are kept even though + both contain the same data. + From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 10:52:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACE69133; Sun, 22 Dec 2013 10:52:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9887A1385; Sun, 22 Dec 2013 10:52:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMAqpQL006441; Sun, 22 Dec 2013 10:52:51 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMAqpGr006440; Sun, 22 Dec 2013 10:52:51 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312221052.rBMAqpGr006440@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 10:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259714 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 10:52:51 -0000 Author: rodrigc Date: Sun Dec 22 10:52:51 2013 New Revision: 259714 URL: http://svnweb.freebsd.org/changeset/base/259714 Log: Add some revision numbers. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:50:09 2013 (r259713) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:52:51 2013 (r259714) @@ -320,12 +320,12 @@ A new kernel-based iSCSI target and initiator has been added - UFS filesystems can now be enlarged with &man.growfs.8; while + UFS filesystems can now be enlarged with &man.growfs.8; while mounted read-write. This is especially useful for virtual machines, allowing the addition of more harddrive space without interruption of service. - A state of the art FUSE implementation is now part of the + A state of the art FUSE implementation is now part of the base system. It allows the use of nearly all fusefs file systems From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 10:58:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55BDC2EF; Sun, 22 Dec 2013 10:58:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4152D13AB; Sun, 22 Dec 2013 10:58:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMAwfJi007176; Sun, 22 Dec 2013 10:58:41 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMAwflK007175; Sun, 22 Dec 2013 10:58:41 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312221058.rBMAwflK007175@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 10:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259715 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 10:58:41 -0000 Author: rodrigc Date: Sun Dec 22 10:58:40 2013 New Revision: 259715 URL: http://svnweb.freebsd.org/changeset/base/259715 Log: Mention ZFS zio nop-write improvement. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:52:51 2013 (r259714) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:58:40 2013 (r259715) @@ -342,6 +342,14 @@ Support for L2ARC compression has been added to ZFS. + The zio nop-write improvement from Illumos + was imported into &os;. To reduce I/O, nop-write skips overwriting + data if the checksum (cryptographically secure) of new data + matches the checksum of existing data. It also saves space if + snapshots are in use. This improvement only works only on + datasets with enabled compression, disabled deduplication and + sha256 checksums. + ZFS will now compare the checksums of incoming writes to the checksum of the existing on-disk data and avoid issuing any write I/O for data that has not changed. This will reduce I/O From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 11:10:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28A1D714; Sun, 22 Dec 2013 11:10:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1431414BF; Sun, 22 Dec 2013 11:10:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMBA8bC011669; Sun, 22 Dec 2013 11:10:08 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMBA8q1011668; Sun, 22 Dec 2013 11:10:08 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312221110.rBMBA8q1011668@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 11:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259716 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 11:10:09 -0000 Author: rodrigc Date: Sun Dec 22 11:10:08 2013 New Revision: 259716 URL: http://svnweb.freebsd.org/changeset/base/259716 Log: Mention addition of vmx(4). Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 10:58:40 2013 (r259715) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 11:10:08 2013 (r259716) @@ -253,6 +253,10 @@ The &man.wpi.4; driver has been updated to include a number of stability fixes. + The &man.vmx.4; driver has been added. + &man.vmx.4; is a VMware VMXNET3 ethernet driver ported from + OpenBSD. + The &man.cxgbe.4; driver has been updated to support 40G/10G Ethernet NICs based on Chelsio's Terminator 5 (T5) ASIC. From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 11:11:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C439F864; Sun, 22 Dec 2013 11:11:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B00A31512; Sun, 22 Dec 2013 11:11:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMBBNVZ013942; Sun, 22 Dec 2013 11:11:23 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMBBNQ5013941; Sun, 22 Dec 2013 11:11:23 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312221111.rBMBBNQ5013941@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sun, 22 Dec 2013 11:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259717 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 11:11:23 -0000 Author: dumbbell Date: Sun Dec 22 11:11:23 2013 New Revision: 259717 URL: http://svnweb.freebsd.org/changeset/base/259717 Log: drm: Lower priority of "EDID checksum is invalid" message The priority goes from "error" to "debug". Connectors are polled every 10 seconds. Reading EDID is part of this polling. However, when an invalid EDID is returned, this error message is logged. When using Newcons for instance, having a kernel message every 10 seconds is getting annoying. Now that it's a debug message, it'll be logged only if hw.dri.debug is enabled. This fix console spamming for some users. Tested by: Larry Rosenman Modified: head/sys/dev/drm2/drm_edid.c Modified: head/sys/dev/drm2/drm_edid.c ============================================================================== --- head/sys/dev/drm2/drm_edid.c Sun Dec 22 11:10:08 2013 (r259716) +++ head/sys/dev/drm2/drm_edid.c Sun Dec 22 11:11:23 2013 (r259717) @@ -171,7 +171,7 @@ drm_edid_block_valid(u8 *raw_edid) for (i = 0; i < EDID_LENGTH; i++) csum += raw_edid[i]; if (csum) { - DRM_ERROR("EDID checksum is invalid, remainder is %d\n", csum); + DRM_DEBUG("EDID checksum is invalid, remainder is %d\n", csum); /* allow CEA to slide through, switches mangle this */ if (raw_edid[0] != 0x02) From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 11:41:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 423EDD8B; Sun, 22 Dec 2013 11:41:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2DE7D16B6; Sun, 22 Dec 2013 11:41:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMBfRU9024506; Sun, 22 Dec 2013 11:41:27 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMBfRG7024504; Sun, 22 Dec 2013 11:41:27 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312221141.rBMBfRG7024504@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 11:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259718 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 11:41:27 -0000 Author: rodrigc Date: Sun Dec 22 11:41:26 2013 New Revision: 259718 URL: http://svnweb.freebsd.org/changeset/base/259718 Log: Mention virtio support. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 11:11:23 2013 (r259717) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 11:41:26 2013 (r259718) @@ -125,6 +125,14 @@ support. These features are on all Nehalem models and beyond (e.g. Nehalem and newer), but not on the lower-end Atom CPUs. + &man.virtio.4; support has been added. &man.virtio.4; is the + name for the paravirtualization interface developed for the Linux KVM, but + since adopted to other virtual machine hypervisors (with the notable exception of Xen). + This work brings in a BSD-licensed clean-room implementation of the virtio kernel drivers + for disk IO (&man.virtio_blk.4; and &man.virtio_scsi.4;), network IO (&man.vtnet.4;), + memory ballooning (&man.virtio_balloon.4;), and PCI. + Tested with on Qemu/KVM, VirtualBox, and &man.bhyve.4;. + The maximum amount of memory the &os; kernel can address has been increased from 1TB to 4TB. From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 12:10:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D70384CA; Sun, 22 Dec 2013 12:10:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C38411863; Sun, 22 Dec 2013 12:10:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMCAavm034004; Sun, 22 Dec 2013 12:10:36 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMCAa04034003; Sun, 22 Dec 2013 12:10:36 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312221210.rBMCAa04034003@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 22 Dec 2013 12:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259719 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 12:10:36 -0000 Author: glebius Date: Sun Dec 22 12:10:36 2013 New Revision: 259719 URL: http://svnweb.freebsd.org/changeset/base/259719 Log: Fix fallout from r258479: in pf_free_src_node() the node must already be unlinked. Reported by: Konstantin Kukushkin Sponsored by: Nginx, Inc. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Dec 22 11:41:26 2013 (r259718) +++ head/sys/netpfil/pf/pf.c Sun Dec 22 12:10:36 2013 (r259719) @@ -713,7 +713,6 @@ pf_free_src_node(struct pf_src_node *sn) { KASSERT(sn->states == 0, ("%s: %p has refs", __func__, sn)); - LIST_REMOVE(sn, entry); uma_zfree(V_pf_sources_z, sn); } From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 12:53:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C253C3F; Sun, 22 Dec 2013 12:53:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 78D4B1AAE; Sun, 22 Dec 2013 12:53:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMCrvFx049907; Sun, 22 Dec 2013 12:53:57 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMCrvHh049906; Sun, 22 Dec 2013 12:53:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312221253.rBMCrvHh049906@svn.freebsd.org> From: Dimitry Andric Date: Sun, 22 Dec 2013 12:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259720 - head/gnu/lib/csu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 12:53:57 -0000 Author: dim Date: Sun Dec 22 12:53:56 2013 New Revision: 259720 URL: http://svnweb.freebsd.org/changeset/base/259720 Log: For gnu/lib/csu, only use gcc-specific flags when compiling with gcc. MFC after: 3 days Modified: head/gnu/lib/csu/Makefile Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Sun Dec 22 12:10:36 2013 (r259719) +++ head/gnu/lib/csu/Makefile Sun Dec 22 12:53:56 2013 (r259720) @@ -15,10 +15,12 @@ OBJS= crtbegin.o crtend.o crtbeginT.o SOBJS= crtbeginS.o crtendS.o CSTD?= gnu89 CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3 -CFLAGS+= -finhibit-size-directive -fno-inline-functions \ - -fno-exceptions -fno-zero-initialized-in-bss \ - -fno-zero-initialized-in-bss -fno-toplevel-reorder \ - -fno-asynchronous-unwind-tables -fno-omit-frame-pointer +.if ${COMPILER_TYPE} == "gcc" +CFLAGS+= -finhibit-size-directive -fno-toplevel-reorder +.endif +CFLAGS+= -fno-inline-functions -fno-exceptions \ + -fno-zero-initialized-in-bss -fno-asynchronous-unwind-tables \ + -fno-omit-frame-pointer CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \ -I${CCDIR}/cc_tools CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 14:14:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C97ADDCA; Sun, 22 Dec 2013 14:14:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B69A21FF3; Sun, 22 Dec 2013 14:14:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMEErd0079642; Sun, 22 Dec 2013 14:14:53 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMEErJ7079641; Sun, 22 Dec 2013 14:14:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312221414.rBMEErJ7079641@svn.freebsd.org> From: Dimitry Andric Date: Sun, 22 Dec 2013 14:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259724 - head/contrib/file X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 14:14:53 -0000 Author: dim Date: Sun Dec 22 14:14:53 2013 New Revision: 259724 URL: http://svnweb.freebsd.org/changeset/base/259724 Log: Apply upstream commit 33312fd828e59c78ae4ee30fd70d0ca109748cf0 (by zoulasc) to contrib/file: don't write a char to a pointer. MFC after: 3 days Modified: head/contrib/file/compress.c Modified: head/contrib/file/compress.c ============================================================================== --- head/contrib/file/compress.c Sun Dec 22 14:13:00 2013 (r259723) +++ head/contrib/file/compress.c Sun Dec 22 14:14:53 2013 (r259724) @@ -480,7 +480,7 @@ uncompressbuf(struct magic_set *ms, int #endif free(*newch); n = 0; - newch[0] = '\0'; + *newch = NULL; goto err; } else { n = r; From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 15:33:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04901D33; Sun, 22 Dec 2013 15:33:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E57231468; Sun, 22 Dec 2013 15:33:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMFXF0f008075; Sun, 22 Dec 2013 15:33:15 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMFXF0I008074; Sun, 22 Dec 2013 15:33:15 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312221533.rBMFXF0I008074@svn.freebsd.org> From: Aleksandr Rybalko Date: Sun, 22 Dec 2013 15:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259727 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 15:33:16 -0000 Author: ray Date: Sun Dec 22 15:33:15 2013 New Revision: 259727 URL: http://svnweb.freebsd.org/changeset/base/259727 Log: Update names from newcons to vt(9). Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Sun Dec 22 14:57:36 2013 (r259726) +++ head/sys/dev/vt/vt_core.c Sun Dec 22 15:33:15 2013 (r259727) @@ -112,9 +112,9 @@ const struct terminal_class vt_termclass /* XXX while syscons is here. */ int sc_txtmouse_no_retrace_wait; -static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "Newcons parameters"); +static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "vt(9) parameters"); VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); -VT_SYSCTL_INT(debug, 0, "Newcons debug level"); +VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 16:09:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16CB83E3; Sun, 22 Dec 2013 16:09:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EBDA1163F; Sun, 22 Dec 2013 16:09:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMG9Thl020343; Sun, 22 Dec 2013 16:09:29 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMG9Ti5020341; Sun, 22 Dec 2013 16:09:29 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312221609.rBMG9Ti5020341@svn.freebsd.org> From: Aleksandr Rybalko Date: Sun, 22 Dec 2013 16:09:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259728 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 16:09:30 -0000 Author: ray Date: Sun Dec 22 16:09:29 2013 New Revision: 259728 URL: http://svnweb.freebsd.org/changeset/base/259728 Log: Add Freescale i.MX515 vt(9) driver. Sponsored by: The FreeBSD Foundation Added: head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c (contents, props changed) Modified: head/sys/arm/freescale/imx/files.imx51 Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Sun Dec 22 15:33:15 2013 (r259727) +++ head/sys/arm/freescale/imx/files.imx51 Sun Dec 22 16:09:29 2013 (r259728) @@ -49,4 +49,5 @@ arm/freescale/imx/i2c.c optional fslii # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc - +arm/freescale/imx/imx51_ipuv3_fbd.c optional vt +dev/vt/hw/fb/vt_early_fb.c optional vt Added: head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Sun Dec 22 16:09:29 2013 (r259728) @@ -0,0 +1,345 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012, 2013 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Oleksandr Rybalko + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include + +#include "fb_if.h" + +#define IMX51_IPU_HSP_CLOCK 665000000 + +struct ipu3sc_softc { + device_t dev; + device_t sc_fbd; /* fbd child */ + struct fb_info sc_info; + + bus_space_tag_t iot; + bus_space_handle_t ioh; + bus_space_handle_t cm_ioh; + bus_space_handle_t dp_ioh; + bus_space_handle_t di0_ioh; + bus_space_handle_t di1_ioh; + bus_space_handle_t dctmpl_ioh; + bus_space_handle_t dc_ioh; + bus_space_handle_t dmfc_ioh; + bus_space_handle_t idmac_ioh; + bus_space_handle_t cpmem_ioh; +}; + +static struct ipu3sc_softc *ipu3sc_softc; + +#define IPUV3_READ(ipuv3, module, reg) \ + bus_space_read_4((ipuv3)->iot, (ipuv3)->module##_ioh, (reg)) +#define IPUV3_WRITE(ipuv3, module, reg, val) \ + bus_space_write_4((ipuv3)->iot, (ipuv3)->module##_ioh, (reg), (val)) + +#define CPMEM_CHANNEL_OFFSET(_c) ((_c) * 0x40) +#define CPMEM_WORD_OFFSET(_w) ((_w) * 0x20) +#define CPMEM_DP_OFFSET(_d) ((_d) * 0x10000) +#define IMX_IPU_DP0 0 +#define IMX_IPU_DP1 1 +#define CPMEM_CHANNEL(_dp, _ch, _w) \ + (CPMEM_DP_OFFSET(_dp) + CPMEM_CHANNEL_OFFSET(_ch) + \ + CPMEM_WORD_OFFSET(_w)) +#define CPMEM_OFFSET(_dp, _ch, _w, _o) \ + (CPMEM_CHANNEL((_dp), (_ch), (_w)) + (_o)) + +static int ipu3_fb_probe(device_t); +static int ipu3_fb_attach(device_t); + +static void +ipu3_fb_init(struct ipu3sc_softc *sc) +{ + uint64_t w0sh96; + uint32_t w1sh96; + + /* FW W0[137:125] - 96 = [41:29] */ + /* FH W0[149:138] - 96 = [53:42] */ + w0sh96 = IPUV3_READ(sc, cpmem, CPMEM_OFFSET(IMX_IPU_DP1, 23, 0, 16)); + w0sh96 <<= 32; + w0sh96 |= IPUV3_READ(sc, cpmem, CPMEM_OFFSET(IMX_IPU_DP1, 23, 0, 12)); + + sc->sc_info.fb_width = ((w0sh96 >> 29) & 0x1fff) + 1; + sc->sc_info.fb_height = ((w0sh96 >> 42) & 0x0fff) + 1; + + /* SLY W1[115:102] - 96 = [19:6] */ + w1sh96 = IPUV3_READ(sc, cpmem, CPMEM_OFFSET(IMX_IPU_DP1, 23, 1, 12)); + sc->sc_info.fb_stride = ((w1sh96 >> 6) & 0x3fff) + 1; + + printf("%dx%d [%d]\n", sc->sc_info.fb_width, sc->sc_info.fb_height, + sc->sc_info.fb_stride); + sc->sc_info.fb_size = sc->sc_info.fb_height * sc->sc_info.fb_stride; + + sc->sc_info.fb_vbase = (intptr_t)contigmalloc(sc->sc_info.fb_size, + M_DEVBUF, M_ZERO, 0, ~0, PAGE_SIZE, 0); + sc->sc_info.fb_pbase = (intptr_t)vtophys(sc->sc_info.fb_vbase); + + /* DP1 + config_ch_23 + word_2 */ + IPUV3_WRITE(sc, cpmem, CPMEM_OFFSET(IMX_IPU_DP1, 23, 1, 0), + (((uint32_t)sc->sc_info.fb_pbase >> 3) | + (((uint32_t)sc->sc_info.fb_pbase >> 3) << 29)) & 0xffffffff); + + IPUV3_WRITE(sc, cpmem, CPMEM_OFFSET(IMX_IPU_DP1, 23, 1, 4), + (((uint32_t)sc->sc_info.fb_pbase >> 3) >> 3) & 0xffffffff); + + /* XXX: fetch or set it from/to IPU. */ + sc->sc_info.fb_bpp = sc->sc_info.fb_depth = sc->sc_info.fb_stride / + sc->sc_info.fb_width * 8; +} + +/* Use own color map, because of different RGB offset. */ +static int +ipu3_fb_init_cmap(uint32_t *cmap, int bytespp) +{ + + switch (bytespp) { + case 8: + return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, + 0x7, 5, 0x7, 2, 0x3, 0)); + case 15: + return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, + 0x1f, 10, 0x1f, 5, 0x1f, 0)); + case 16: + return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, + 0x1f, 11, 0x3f, 5, 0x1f, 0)); + case 24: + case 32: /* Ignore alpha. */ + return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, + 0xff, 16, 0xff, 8, 0xff, 0)); + default: + return (1); + } +} + +static int +ipu3_fb_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "fsl,ipu3")) + return (ENXIO); + + device_set_desc(dev, "i.MX515 Image Processing Unit (FB)"); + + return (BUS_PROBE_DEFAULT); +} + +static int +ipu3_fb_attach(device_t dev) +{ + struct ipu3sc_softc *sc = device_get_softc(dev); + bus_space_tag_t iot; + bus_space_handle_t ioh; + int err; + + ipu3sc_softc = sc; + + device_printf(dev, "\tclock gate status is %d\n", + imx51_get_clk_gating(IMX51CLK_IPU_HSP_CLK_ROOT)); + + sc->dev = dev; + + sc = device_get_softc(dev); + sc->iot = iot = fdtbus_bs_tag; + + device_printf(sc->dev, ": i.MX51 IPUV3 controller\n"); + + /* map controller registers */ + err = bus_space_map(iot, IPU_CM_BASE, IPU_CM_SIZE, 0, &ioh); + if (err) + goto fail_retarn_cm; + sc->cm_ioh = ioh; + + /* map Display Multi FIFO Controller registers */ + err = bus_space_map(iot, IPU_DMFC_BASE, IPU_DMFC_SIZE, 0, &ioh); + if (err) + goto fail_retarn_dmfc; + sc->dmfc_ioh = ioh; + + /* map Display Interface 0 registers */ + err = bus_space_map(iot, IPU_DI0_BASE, IPU_DI0_SIZE, 0, &ioh); + if (err) + goto fail_retarn_di0; + sc->di0_ioh = ioh; + + /* map Display Interface 1 registers */ + err = bus_space_map(iot, IPU_DI1_BASE, IPU_DI0_SIZE, 0, &ioh); + if (err) + goto fail_retarn_di1; + sc->di1_ioh = ioh; + + /* map Display Processor registers */ + err = bus_space_map(iot, IPU_DP_BASE, IPU_DP_SIZE, 0, &ioh); + if (err) + goto fail_retarn_dp; + sc->dp_ioh = ioh; + + /* map Display Controller registers */ + err = bus_space_map(iot, IPU_DC_BASE, IPU_DC_SIZE, 0, &ioh); + if (err) + goto fail_retarn_dc; + sc->dc_ioh = ioh; + + /* map Image DMA Controller registers */ + err = bus_space_map(iot, IPU_IDMAC_BASE, IPU_IDMAC_SIZE, 0, &ioh); + if (err) + goto fail_retarn_idmac; + sc->idmac_ioh = ioh; + + /* map CPMEM registers */ + err = bus_space_map(iot, IPU_CPMEM_BASE, IPU_CPMEM_SIZE, 0, &ioh); + if (err) + goto fail_retarn_cpmem; + sc->cpmem_ioh = ioh; + + /* map DCTEMPL registers */ + err = bus_space_map(iot, IPU_DCTMPL_BASE, IPU_DCTMPL_SIZE, 0, &ioh); + if (err) + goto fail_retarn_dctmpl; + sc->dctmpl_ioh = ioh; + +#ifdef notyet + sc->ih = imx51_ipuv3_intr_establish(IMX51_INT_IPUV3, IPL_BIO, + ipuv3intr, sc); + if (sc->ih == NULL) { + device_printf(sc->dev, + "unable to establish interrupt at irq %d\n", + IMX51_INT_IPUV3); + return (ENXIO); + } +#endif + + /* + * We have to wait until interrupts are enabled. + * Mailbox relies on it to get data from VideoCore + */ + ipu3_fb_init(sc); + + sc->sc_info.fb_name = device_get_nameunit(dev); + + ipu3_fb_init_cmap(sc->sc_info.fb_cmap, sc->sc_info.fb_depth); + sc->sc_info.fb_cmsize = 16; + + /* Ask newbus to attach framebuffer device to me. */ + sc->sc_fbd = device_add_child(dev, "fbd", device_get_unit(dev)); + if (sc->sc_fbd == NULL) + device_printf(dev, "Can't attach fbd device\n"); + + return (bus_generic_attach(dev)); + +fail_retarn_dctmpl: + bus_space_unmap(sc->iot, sc->cpmem_ioh, IPU_CPMEM_SIZE); +fail_retarn_cpmem: + bus_space_unmap(sc->iot, sc->idmac_ioh, IPU_IDMAC_SIZE); +fail_retarn_idmac: + bus_space_unmap(sc->iot, sc->dc_ioh, IPU_DC_SIZE); +fail_retarn_dp: + bus_space_unmap(sc->iot, sc->dp_ioh, IPU_DP_SIZE); +fail_retarn_dc: + bus_space_unmap(sc->iot, sc->di1_ioh, IPU_DI1_SIZE); +fail_retarn_di1: + bus_space_unmap(sc->iot, sc->di0_ioh, IPU_DI0_SIZE); +fail_retarn_di0: + bus_space_unmap(sc->iot, sc->dmfc_ioh, IPU_DMFC_SIZE); +fail_retarn_dmfc: + bus_space_unmap(sc->iot, sc->dc_ioh, IPU_CM_SIZE); +fail_retarn_cm: + device_printf(sc->dev, + "failed to map registers (errno=%d)\n", err); + return (err); +} + +static struct fb_info * +ipu3_fb_getinfo(device_t dev) +{ + struct ipu3sc_softc *sc = device_get_softc(dev); + + return (&sc->sc_info); +} + +static device_method_t ipu3_fb_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ipu3_fb_probe), + DEVMETHOD(device_attach, ipu3_fb_attach), + + /* Framebuffer service methods */ + DEVMETHOD(fb_getinfo, ipu3_fb_getinfo), + { 0, 0 } +}; + +static devclass_t ipu3_fb_devclass; + +static driver_t ipu3_fb_driver = { + "fb", + ipu3_fb_methods, + sizeof(struct ipu3sc_softc), +}; + +DRIVER_MODULE(fb, simplebus, ipu3_fb_driver, ipu3_fb_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 16:12:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A25A0714; Sun, 22 Dec 2013 16:12:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F3B116B0; Sun, 22 Dec 2013 16:12:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMGClA8023512; Sun, 22 Dec 2013 16:12:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMGCl6k023511; Sun, 22 Dec 2013 16:12:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312221612.rBMGCl6k023511@svn.freebsd.org> From: Glen Barber Date: Sun, 22 Dec 2013 16:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259729 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 16:12:47 -0000 Author: gjb Date: Sun Dec 22 16:12:47 2013 New Revision: 259729 URL: http://svnweb.freebsd.org/changeset/base/259729 Log: Bootstrap etcupdate(8) as part of the release build, similar to what is done for mergemaster(8). This allows etcupdate(8) to work out-of-box after the first upgrade of a system. Submitted by: jhb MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Sun Dec 22 16:09:29 2013 (r259728) +++ head/release/Makefile Sun Dec 22 16:12:47 2013 (r259729) @@ -104,6 +104,8 @@ base.txz: # Set up mergemaster root database sh ${.CURDIR}/scripts/mm-mtree.sh -m ${WORLDDIR} -F \ "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${.OBJDIR}/${DISTDIR}/base" + etcupdate extract -B -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \ + -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" # Package all components cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR} mv ${DISTDIR}/*.txz . From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 16:56:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC08279F for ; Sun, 22 Dec 2013 16:56:00 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8872F1977 for ; Sun, 22 Dec 2013 16:56:00 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id tp5so5117809ieb.39 for ; Sun, 22 Dec 2013 08:55:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=2tzD4u8fnIvtqld2OByrdi3+gP2ivXNccnnGZ0Rb0wU=; b=m1xuc0Z0A8AccIs/Dy6Se/o859nRrxjvFXhy+qHsX/sAeozJKic3IPrk+1IDtZoPwS 2wv3dkolrZ2byruTnrAW5VE3hMv7C0xlALC6Tx7r8S/6mtA7yVADf72E0MBdLvUR5h6W /JFNDUyAIeeUetG7+GSPuG6myabqbuXAKqY3pAnrPc6L+Twa7C0k08e6nkEc5OrzJ7Jo c11Ue7Usjky+NLfWQec9Mh+gcpHaUkRu/LVNAAOava1Zy/sW+3iCk6V8kLcg6MluDcba PSoh0eIXOGCRgB14ZV4UiHU/xpXiN3W/anSV2CmAMIxZutuGdMWEWbkXYHc0/+TtOFf2 JBRg== X-Gm-Message-State: ALoCoQn8EXBc4lGM+clm0jsCCPaQrqNOxuNu7GvYTH126tqjazRKPRn+HcIeXROsWHGNibKjXbz0 X-Received: by 10.42.226.66 with SMTP id iv2mr13705778icb.11.1387731353877; Sun, 22 Dec 2013 08:55:53 -0800 (PST) Received: from [10.0.0.23] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id d18sm7486541igz.0.2013.12.22.08.55.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 22 Dec 2013 08:55:53 -0800 (PST) Sender: Warner Losh Subject: Re: svn commit: r259685 - in head/sys: arm/at91 dev/uart Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Sun, 22 Dec 2013 09:55:53 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201312211623.rBLGNVaq008807@svn.freebsd.org> To: Ganbold Tsagaankhuu X-Mailer: Apple Mail (2.1085) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 16:56:01 -0000 On Dec 22, 2013, at 2:28 AM, Ganbold Tsagaankhuu wrote: >=20 >=20 >=20 > On Sun, Dec 22, 2013 at 12:23 AM, Warner Losh wrote: > Author: imp > Date: Sat Dec 21 16:23:31 2013 > New Revision: 259685 > URL: http://svnweb.freebsd.org/changeset/base/259685 >=20 > Log: > Plumb the cn_grab and cn_ungrab routines down into the uart > clients. Mask RX interrupts while grabbed on the atmel serial > driver. This UART interrupts every character. When interrupts are > enabled at the mountroot> prompt, this means the ISR eats the > characters. Rather than try to create a cooperative buffering system > for the low level kernel console, instead just mask out the ISR. For > NS8250 and decsendents this isn't needed, since interrupts only = happen > after 14 or more characters (depending on the fifo settings). Plumb > such that these are optional so there's no change in behavior for = all > the other UART clients. ddb worked on this platform because all > interrupts were disabled while it was running, so this problem = wasn't > noticed. The mountroot> issue has been around for a very very long > time. >=20 > MFC after: 3 days >=20 > Modified: > head/sys/arm/at91/uart_dev_at91usart.c > head/sys/dev/uart/uart_cpu.h > head/sys/dev/uart/uart_tty.c >=20 >=20 > There is PR "kern/184919: uart infrastructure missing console grab / = ungrab hooks", maybe that one should be closed. Yup. This looks to be filed 5 days ago. I had no clue it was even there = and came up with mine independently... Warner >=20 > Ganbold >=20 >=20 > =20 >=20 > Modified: head/sys/arm/at91/uart_dev_at91usart.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/arm/at91/uart_dev_at91usart.c Sat Dec 21 15:40:36 = 2013 (r259684) > +++ head/sys/arm/at91/uart_dev_at91usart.c Sat Dec 21 16:23:31 = 2013 (r259685) > @@ -219,6 +219,20 @@ at91_usart_param(struct uart_bas *bas, i > return (0); > } >=20 > +static void > +at91_usart_grab(struct uart_bas *bas) > +{ > + > + WR4(bas, USART_IDR, USART_CSR_RXRDY); > +} > + > +static void > +at91_usart_ungrab(struct uart_bas *bas) > +{ > + > + WR4(bas, USART_IER, USART_CSR_RXRDY); > +} > + > static struct uart_ops at91_usart_ops =3D { > .probe =3D at91_usart_probe, > .init =3D at91_usart_init, > @@ -226,6 +240,8 @@ static struct uart_ops at91_usart_ops =3D > .putc =3D at91_usart_putc, > .rxready =3D at91_usart_rxready, > .getc =3D at91_usart_getc, > + .grab =3D at91_usart_grab, > + .ungrab =3D at91_usart_ungrab, > }; >=20 > static int >=20 > Modified: head/sys/dev/uart/uart_cpu.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/dev/uart/uart_cpu.h Sat Dec 21 15:40:36 2013 = (r259684) > +++ head/sys/dev/uart/uart_cpu.h Sat Dec 21 16:23:31 2013 = (r259685) > @@ -43,6 +43,8 @@ struct uart_ops { > void (*putc)(struct uart_bas *, int); > int (*rxready)(struct uart_bas *); > int (*getc)(struct uart_bas *, struct mtx *); > + void (*grab)(struct uart_bas *); > + void (*ungrab)(struct uart_bas *); > }; >=20 > extern bus_space_tag_t uart_bus_space_io; > @@ -135,6 +137,27 @@ uart_putc(struct uart_devinfo *di, int c > uart_unlock(di->hwmtx); > } >=20 > +static __inline void > +uart_grab(struct uart_devinfo *di) > +{ > + > + uart_lock(di->hwmtx); > + if (di->ops->grab) > + di->ops->grab(&di->bas); > + uart_unlock(di->hwmtx); > +} > + > +static __inline void > +uart_ungrab(struct uart_devinfo *di) > +{ > + > + uart_lock(di->hwmtx); > + if (di->ops->ungrab) > + di->ops->ungrab(&di->bas); > + uart_unlock(di->hwmtx); > +} > + > + > static __inline int > uart_rxready(struct uart_devinfo *di) > { >=20 > Modified: head/sys/dev/uart/uart_tty.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/uart/uart_tty.c Sat Dec 21 15:40:36 2013 = (r259684) > +++ head/sys/dev/uart/uart_tty.c Sat Dec 21 16:23:31 2013 = (r259685) > @@ -112,11 +112,15 @@ uart_cnterm(struct consdev *cp) > static void > uart_cngrab(struct consdev *cp) > { > + > + uart_grab(cp->cn_arg); > } >=20 > static void > uart_cnungrab(struct consdev *cp) > { > + > + uart_ungrab(cp->cn_arg); > } >=20 > static void >=20 From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 17:51:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 916342AB; Sun, 22 Dec 2013 17:51:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 726D31DC7; Sun, 22 Dec 2013 17:51:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMHpac1059339; Sun, 22 Dec 2013 17:51:36 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMHpYpj059326; Sun, 22 Dec 2013 17:51:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312221751.rBMHpYpj059326@svn.freebsd.org> From: Dimitry Andric Date: Sun, 22 Dec 2013 17:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259730 - in head: gnu/lib/csu gnu/lib/libgcc gnu/lib/libstdc++ gnu/lib/libsupc++ lib/atf/libatf-c/tests share/mk sys/conf tools/tools/ath/athstats tools/tools/net80211/wlanstats usr.bi... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 17:51:36 -0000 Author: dim Date: Sun Dec 22 17:51:33 2013 New Revision: 259730 URL: http://svnweb.freebsd.org/changeset/base/259730 Log: To avoid having to explicitly test COMPILER_TYPE for setting clang-specific or gcc-specific flags, introduce the following new variables for use in Makefiles: CFLAGS.clang CFLAGS.gcc CXXFLAGS.clang CXXFLAGS.gcc In bsd.sys.mk, these get appended to the regular CFLAGS or CXXFLAGS for the right compiler. MFC after: 1 week Modified: head/gnu/lib/csu/Makefile head/gnu/lib/libgcc/Makefile head/gnu/lib/libstdc++/Makefile head/gnu/lib/libsupc++/Makefile head/lib/atf/libatf-c/tests/Makefile head/share/mk/bsd.sys.mk head/sys/conf/Makefile.arm head/tools/tools/ath/athstats/Makefile head/tools/tools/net80211/wlanstats/Makefile head/usr.bin/mkcsmapper/Makefile.inc Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Sun Dec 22 16:12:47 2013 (r259729) +++ head/gnu/lib/csu/Makefile Sun Dec 22 17:51:33 2013 (r259730) @@ -15,9 +15,7 @@ OBJS= crtbegin.o crtend.o crtbeginT.o SOBJS= crtbeginS.o crtendS.o CSTD?= gnu89 CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3 -.if ${COMPILER_TYPE} == "gcc" -CFLAGS+= -finhibit-size-directive -fno-toplevel-reorder -.endif +CFLAGS.gcc+= -finhibit-size-directive -fno-toplevel-reorder CFLAGS+= -fno-inline-functions -fno-exceptions \ -fno-zero-initialized-in-bss -fno-asynchronous-unwind-tables \ -fno-omit-frame-pointer Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Sun Dec 22 16:12:47 2013 (r259729) +++ head/gnu/lib/libgcc/Makefile Sun Dec 22 17:51:33 2013 (r259730) @@ -112,9 +112,7 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udi .if ${TARGET_CPUARCH} == "arm" # from config/arm/t-strongarm-elf CFLAGS+= -Dinhibit_libc -fno-inline -.if ${COMPILER_TYPE} == "clang" -CFLAGS+= -fheinous-gnu-extensions -.endif +CFLAGS.clang+= -fheinous-gnu-extensions LIB1ASMSRC = lib1funcs.asm LIB1ASMFUNCS = _dvmd_tls _bb_init_func Modified: head/gnu/lib/libstdc++/Makefile ============================================================================== --- head/gnu/lib/libstdc++/Makefile Sun Dec 22 16:12:47 2013 (r259729) +++ head/gnu/lib/libstdc++/Makefile Sun Dec 22 17:51:33 2013 (r259730) @@ -637,6 +637,4 @@ CLEANFILES+= ${VERSION_MAP} # Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98. CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]} -.if ${COMPILER_TYPE} == "clang" -CXXFLAGS+= -stdlib=libstdc++ -.endif +CXXFLAGS.clang+= -stdlib=libstdc++ Modified: head/gnu/lib/libsupc++/Makefile ============================================================================== --- head/gnu/lib/libsupc++/Makefile Sun Dec 22 16:12:47 2013 (r259729) +++ head/gnu/lib/libsupc++/Makefile Sun Dec 22 17:51:33 2013 (r259730) @@ -57,6 +57,4 @@ VERSION_MAP= ${.CURDIR}/Version.map # Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98. CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]} -.if ${COMPILER_TYPE} == "clang" -CXXFLAGS+= -stdlib=libstdc++ -.endif +CXXFLAGS.clang+= -stdlib=libstdc++ Modified: head/lib/atf/libatf-c/tests/Makefile ============================================================================== --- head/lib/atf/libatf-c/tests/Makefile Sun Dec 22 16:12:47 2013 (r259729) +++ head/lib/atf/libatf-c/tests/Makefile Sun Dec 22 17:51:33 2013 (r259730) @@ -10,12 +10,10 @@ ATF= ${.CURDIR:H:H:H:H}/contrib/atf CFLAGS+= -I${ATF} -.if ${COMPILER_TYPE} == "clang" # macros_test.c contains a double 'const const' which will be gone with # the import of atf-0.18. # TODO(jmmv): Remove this workaround once we do that update. -CFLAGS+= -Wno-duplicate-decl-specifier -.endif +CFLAGS.clang+= -Wno-duplicate-decl-specifier FILESDIR= ${TESTSDIR} FILES= macros_h_test.c Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sun Dec 22 16:12:47 2013 (r259729) +++ head/share/mk/bsd.sys.mk Sun Dec 22 17:51:33 2013 (r259730) @@ -114,12 +114,19 @@ CWARNFLAGS+= -Wno-format CWARNFLAGS+= -Wno-unknown-pragmas .endif # IGNORE_PRAGMA -.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD) +.if !defined(EARLY_BUILD) +.if ${COMPILER_TYPE} == "clang" CLANG_NO_IAS= -no-integrated-as CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ -mllvm -enable-load-pre=false -mllvm -simplifycfg-dup-ret CFLAGS+= -Qunused-arguments +CFLAGS+= ${CFLAGS.clang} +CXXFLAGS+= ${CXXFLAGS.clang} +.else # !CLANG +CFLAGS+= ${CFLAGS.gcc} +CXXFLAGS+= ${CXXFLAGS.gcc} .endif # CLANG +.endif # !EARLY_BUILD .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Sun Dec 22 16:12:47 2013 (r259729) +++ head/sys/conf/Makefile.arm Sun Dec 22 17:51:33 2013 (r259730) @@ -39,20 +39,16 @@ SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscri STRIP_FLAGS = -S .endif -.if ${COMPILER_TYPE} != "clang" -CFLAGS += -mno-thumb-interwork -.endif +CFLAGS.gcc += -mno-thumb-interwork .if empty(DDB_ENABLED) -.if defined(WITHOUT_ARM_EABI) && ${COMPILER_TYPE} != "clang" -CFLAGS += -mno-apcs-frame +.if defined(WITHOUT_ARM_EABI) +CFLAGS.gcc += -mno-apcs-frame .endif .elif !defined(WITHOUT_ARM_EABI) CFLAGS += -funwind-tables -.if ${COMPILER_TYPE} == "clang" # clang requires us to tell it to emit assembly with unwind information -CFLAGS += -mllvm -arm-enable-ehabi -.endif +CFLAGS.clang += -mllvm -arm-enable-ehabi .endif SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${LDFLAGS} \ Modified: head/tools/tools/ath/athstats/Makefile ============================================================================== --- head/tools/tools/ath/athstats/Makefile Sun Dec 22 16:12:47 2013 (r259729) +++ head/tools/tools/ath/athstats/Makefile Sun Dec 22 17:51:33 2013 (r259730) @@ -21,9 +21,7 @@ CLEANFILES+= opt_ah.h CFLAGS+=-DATH_SUPPORT_ANI CFLAGS+=-DATH_SUPPORT_TDMA -.if (${COMPILER_TYPE} == "clang") -CFLAGS+=-fbracket-depth=512 -.endif +CFLAGS.clang+= -fbracket-depth=512 opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h Modified: head/tools/tools/net80211/wlanstats/Makefile ============================================================================== --- head/tools/tools/net80211/wlanstats/Makefile Sun Dec 22 16:12:47 2013 (r259729) +++ head/tools/tools/net80211/wlanstats/Makefile Sun Dec 22 17:51:33 2013 (r259730) @@ -7,8 +7,6 @@ BINDIR= /usr/local/bin NO_MAN= SRCS= statfoo.c wlanstats.c main.c -.if ${COMPILER_TYPE} == "clang" -CFLAGS+= -fbracket-depth=512 -.endif +CFLAGS.clang+= -fbracket-depth=512 .include Modified: head/usr.bin/mkcsmapper/Makefile.inc ============================================================================== --- head/usr.bin/mkcsmapper/Makefile.inc Sun Dec 22 16:12:47 2013 (r259729) +++ head/usr.bin/mkcsmapper/Makefile.inc Sun Dec 22 17:51:33 2013 (r259730) @@ -6,6 +6,4 @@ SRCS+= lex.l yacc.y CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../mkcsmapper \ -I${.CURDIR}/../../lib/libc/iconv \ -I${.CURDIR}/../../lib/libiconv_modules/mapper_std -.if ${COMPILER_TYPE} == "gcc" -CFLAGS+= --param max-inline-insns-single=64 -.endif +CFLAGS.gcc+= --param max-inline-insns-single=64 From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 19:11:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62B4733B; Sun, 22 Dec 2013 19:11:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 345071228; Sun, 22 Dec 2013 19:11:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMJB7qU088424; Sun, 22 Dec 2013 19:11:07 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMJB71X088423; Sun, 22 Dec 2013 19:11:07 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312221911.rBMJB71X088423@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 19:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259732 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 19:11:07 -0000 Author: rodrigc Date: Sun Dec 22 19:11:06 2013 New Revision: 259732 URL: http://svnweb.freebsd.org/changeset/base/259732 Log: Improve section on carp(4) updates. Add some revision numbers. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 19:11:04 2013 (r259731) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 19:11:06 2013 (r259732) @@ -217,7 +217,7 @@ Multimedia Support - Support for version 2.0 of the USB Audio reference design + Support for version 2.0 of the USB Audio reference design has been added. New devices should support higher bandwidth, increased sampling frequency and wider dynamic range. @@ -288,21 +288,25 @@ Network Protocols - &man.carp.4; has been rewritten to make addresses + &man.carp.4; has been rewritten to make addresses more sane from the viewpoint of routing daemons such as quagga/zebra. It also brings support for a single redundant address on the subnet (carpdev), switching state with - ifconfig, better locking and using modern kernel - interfaces to allocate multicast memberships. + &man.ifconfig.8;, better locking and using modern kernel + interfaces to allocate multicast memberships. + Configuration of the CARP protocol via &man.ifconfig.8; has changed, as well as format + of CARP events submitted to &man.devd.8; has changed. See &man.carp.4; + for more information. The arpbalance feature of &man.carp.4; is currently + not supported anymore. - The &man.pf.4; firewall now supports fine-grain locking + The &man.pf.4; firewall now supports fine-grain locking and better utilization on multi-cpu machines resulting in significant improvements in performance. - Support for up to 65536 routing tables has been + Support for up to 65536 routing tables has been introduced. - Support for setting/matching differentiated services + Support for setting/matching differentiated services codepoints (DSCP) in IP header has been added to &man.ipfw.8;. From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 19:33:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 674478F3; Sun, 22 Dec 2013 19:33:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 52E621327; Sun, 22 Dec 2013 19:33:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMJXGBW095737; Sun, 22 Dec 2013 19:33:16 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMJXGBB095736; Sun, 22 Dec 2013 19:33:16 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312221933.rBMJXGBB095736@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 19:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259733 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 19:33:16 -0000 Author: rodrigc Date: Sun Dec 22 19:33:15 2013 New Revision: 259733 URL: http://svnweb.freebsd.org/changeset/base/259733 Log: Add a note for Microsoft Hyper-V. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 19:11:06 2013 (r259732) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 19:33:15 2013 (r259733) @@ -133,6 +133,12 @@ memory ballooning (&man.virtio_balloon.4;), and PCI. Tested with on Qemu/KVM, VirtualBox, and &man.bhyve.4;. + A paravirtualized driver named "hyperv" which + which supports Microsoft Hyper-V has been imported and made + part of the amd64 GENERIC kernel. For i386, this driver is not part of + GENERIC, so hyperv_load="YES" must be added to + /boot/loader.conf to load the driver. + The maximum amount of memory the &os; kernel can address has been increased from 1TB to 4TB. From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 19:38:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD4DEC93; Sun, 22 Dec 2013 19:38:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C898E135F; Sun, 22 Dec 2013 19:38:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMJcpcl096476; Sun, 22 Dec 2013 19:38:51 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMJcpuo096475; Sun, 22 Dec 2013 19:38:51 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312221938.rBMJcpuo096475@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 19:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259735 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 19:38:51 -0000 Author: rodrigc Date: Sun Dec 22 19:38:51 2013 New Revision: 259735 URL: http://svnweb.freebsd.org/changeset/base/259735 Log: Group virtualization items in one section. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 19:36:08 2013 (r259734) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 19:38:51 2013 (r259735) @@ -120,25 +120,6 @@ Kernel Changes - The BSD Hypervisor, &man.bhyve.8; is included - with &os;. &man.bhyve.8; requires Intel CPUs with VT-x and Extended Page Table (EPT) - support. These features are on all Nehalem models and beyond - (e.g. Nehalem and newer), but not on the lower-end Atom CPUs. - - &man.virtio.4; support has been added. &man.virtio.4; is the - name for the paravirtualization interface developed for the Linux KVM, but - since adopted to other virtual machine hypervisors (with the notable exception of Xen). - This work brings in a BSD-licensed clean-room implementation of the virtio kernel drivers - for disk IO (&man.virtio_blk.4; and &man.virtio_scsi.4;), network IO (&man.vtnet.4;), - memory ballooning (&man.virtio_balloon.4;), and PCI. - Tested with on Qemu/KVM, VirtualBox, and &man.bhyve.4;. - - A paravirtualized driver named "hyperv" which - which supports Microsoft Hyper-V has been imported and made - part of the amd64 GENERIC kernel. For i386, this driver is not part of - GENERIC, so hyperv_load="YES" must be added to - /boot/loader.conf to load the driver. - The maximum amount of memory the &os; kernel can address has been increased from 1TB to 4TB. @@ -191,6 +172,33 @@ scheduler is now the default process scheduler in GENERIC kernels. + + Virtualization support + The BSD Hypervisor, &man.bhyve.8; is included + with &os;. &man.bhyve.8; requires Intel CPUs with VT-x and Extended Page Table (EPT) + support. These features are on all Nehalem models and beyond + (e.g. Nehalem and newer), but not on the lower-end Atom CPUs. + + &man.virtio.4; support has been added. &man.virtio.4; is the + name for the paravirtualization interface developed for the Linux KVM, but + since adopted to other virtual machine hypervisors (with the notable exception of Xen). + This work brings in a BSD-licensed clean-room implementation of the virtio kernel drivers + for disk IO (&man.virtio_blk.4; and &man.virtio_scsi.4;), network IO (&man.vtnet.4;), + memory ballooning (&man.virtio_balloon.4;), and PCI. + Tested with on Qemu/KVM, VirtualBox, and &man.bhyve.4;. + + A paravirtualized driver named "hyperv" which + which supports Microsoft Hyper-V has been imported and made + part of the amd64 GENERIC kernel. For i386, this driver is not part of + GENERIC, so hyperv_load="YES" must be added to + /boot/loader.conf to load the driver. + + The &man.vmx.4; driver has been added. + &man.vmx.4; is a VMware VMXNET3 ethernet driver ported from + OpenBSD. + + + Boot Loader Changes @@ -267,10 +275,6 @@ The &man.wpi.4; driver has been updated to include a number of stability fixes. - The &man.vmx.4; driver has been added. - &man.vmx.4; is a VMware VMXNET3 ethernet driver ported from - OpenBSD. - The &man.cxgbe.4; driver has been updated to support 40G/10G Ethernet NICs based on Chelsio's Terminator 5 (T5) ASIC. From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 19:47:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F259CE20; Sun, 22 Dec 2013 19:47:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE9F413D2; Sun, 22 Dec 2013 19:47:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMJlMCh099799; Sun, 22 Dec 2013 19:47:22 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMJlMAB099798; Sun, 22 Dec 2013 19:47:22 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312221947.rBMJlMAB099798@svn.freebsd.org> From: Dimitry Andric Date: Sun, 22 Dec 2013 19:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259736 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 19:47:23 -0000 Author: dim Date: Sun Dec 22 19:47:22 2013 New Revision: 259736 URL: http://svnweb.freebsd.org/changeset/base/259736 Log: Fix incorrect header guard define in sys/netpfil/pf/pf.h, which snuck in in r257186. Found by clang 3.4. Modified: head/sys/netpfil/pf/pf.h Modified: head/sys/netpfil/pf/pf.h ============================================================================== --- head/sys/netpfil/pf/pf.h Sun Dec 22 19:38:51 2013 (r259735) +++ head/sys/netpfil/pf/pf.h Sun Dec 22 19:47:22 2013 (r259736) @@ -31,7 +31,7 @@ */ #ifndef _NET_PF_H_ -#define _NET_PFAR_H_ +#define _NET_PF_H_ #define PF_TCPS_PROXY_SRC ((TCP_NSTATES)+0) #define PF_TCPS_PROXY_DST ((TCP_NSTATES)+1) From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 20:30:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE316747; Sun, 22 Dec 2013 20:30:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 86D2E1688; Sun, 22 Dec 2013 20:30:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMKU0dS014958; Sun, 22 Dec 2013 20:30:00 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMKTxup014899; Sun, 22 Dec 2013 20:29:59 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312222029.rBMKTxup014899@svn.freebsd.org> From: Neel Natu Date: Sun, 22 Dec 2013 20:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259737 - in head: sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 20:30:00 -0000 Author: neel Date: Sun Dec 22 20:29:59 2013 New Revision: 259737 URL: http://svnweb.freebsd.org/changeset/base/259737 Log: Add a parameter to 'vcpu_set_state()' to enforce that the vcpu is in the IDLE state before the requested state transition. This guarantees that there is exactly one ioctl() operating on a vcpu at any point in time and prevents unintended state transitions. More details available here: http://lists.freebsd.org/pipermail/freebsd-virtualization/2013-December/001825.html Reviewed by: grehan Reported by: Markiyan Kushnir (markiyan.kushnir at gmail.com) MFC after: 3 days Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/bhyverun.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sun Dec 22 19:47:22 2013 (r259736) +++ head/sys/amd64/include/vmm.h Sun Dec 22 20:29:59 2013 (r259737) @@ -146,7 +146,8 @@ enum vcpu_state { VCPU_SLEEPING, }; -int vcpu_set_state(struct vm *vm, int vcpu, enum vcpu_state state); +int vcpu_set_state(struct vm *vm, int vcpu, enum vcpu_state state, + bool from_idle); enum vcpu_state vcpu_get_state(struct vm *vm, int vcpu, int *hostcpu); static int __inline Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sun Dec 22 19:47:22 2013 (r259736) +++ head/sys/amd64/vmm/vmm.c Sun Dec 22 20:29:59 2013 (r259737) @@ -804,13 +804,27 @@ save_guest_fpustate(struct vcpu *vcpu) static VMM_STAT(VCPU_IDLE_TICKS, "number of ticks vcpu was idle"); static int -vcpu_set_state_locked(struct vcpu *vcpu, enum vcpu_state newstate) +vcpu_set_state_locked(struct vcpu *vcpu, enum vcpu_state newstate, + bool from_idle) { int error; vcpu_assert_locked(vcpu); /* + * State transitions from the vmmdev_ioctl() must always begin from + * the VCPU_IDLE state. This guarantees that there is only a single + * ioctl() operating on a vcpu at any point. + */ + if (from_idle) { + while (vcpu->state != VCPU_IDLE) + msleep_spin(&vcpu->state, &vcpu->mtx, "vmstat", hz); + } else { + KASSERT(vcpu->state != VCPU_IDLE, ("invalid transition from " + "vcpu idle state")); + } + + /* * The following state transitions are allowed: * IDLE -> FROZEN -> IDLE * FROZEN -> RUNNING -> FROZEN @@ -830,12 +844,14 @@ vcpu_set_state_locked(struct vcpu *vcpu, break; } - if (error == 0) - vcpu->state = newstate; - else - error = EBUSY; + if (error) + return (EBUSY); - return (error); + vcpu->state = newstate; + if (newstate == VCPU_IDLE) + wakeup(&vcpu->state); + + return (0); } static void @@ -843,7 +859,7 @@ vcpu_require_state(struct vm *vm, int vc { int error; - if ((error = vcpu_set_state(vm, vcpuid, newstate)) != 0) + if ((error = vcpu_set_state(vm, vcpuid, newstate, false)) != 0) panic("Error %d setting state to %d\n", error, newstate); } @@ -852,7 +868,7 @@ vcpu_require_state_locked(struct vcpu *v { int error; - if ((error = vcpu_set_state_locked(vcpu, newstate)) != 0) + if ((error = vcpu_set_state_locked(vcpu, newstate, false)) != 0) panic("Error %d setting state to %d", error, newstate); } @@ -1235,7 +1251,8 @@ vm_iommu_domain(struct vm *vm) } int -vcpu_set_state(struct vm *vm, int vcpuid, enum vcpu_state newstate) +vcpu_set_state(struct vm *vm, int vcpuid, enum vcpu_state newstate, + bool from_idle) { int error; struct vcpu *vcpu; @@ -1246,7 +1263,7 @@ vcpu_set_state(struct vm *vm, int vcpuid vcpu = &vm->vcpu[vcpuid]; vcpu_lock(vcpu); - error = vcpu_set_state_locked(vcpu, newstate); + error = vcpu_set_state_locked(vcpu, newstate, from_idle); vcpu_unlock(vcpu); return (error); Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Sun Dec 22 19:47:22 2013 (r259736) +++ head/sys/amd64/vmm/vmm_dev.c Sun Dec 22 20:29:59 2013 (r259737) @@ -197,7 +197,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c goto done; } - error = vcpu_set_state(sc->vm, vcpu, VCPU_FROZEN); + error = vcpu_set_state(sc->vm, vcpu, VCPU_FROZEN, true); if (error) goto done; @@ -214,14 +214,14 @@ vmmdev_ioctl(struct cdev *cdev, u_long c */ error = 0; for (vcpu = 0; vcpu < VM_MAXCPU; vcpu++) { - error = vcpu_set_state(sc->vm, vcpu, VCPU_FROZEN); + error = vcpu_set_state(sc->vm, vcpu, VCPU_FROZEN, true); if (error) break; } if (error) { while (--vcpu >= 0) - vcpu_set_state(sc->vm, vcpu, VCPU_IDLE); + vcpu_set_state(sc->vm, vcpu, VCPU_IDLE, false); goto done; } @@ -382,10 +382,10 @@ vmmdev_ioctl(struct cdev *cdev, u_long c } if (state_changed == 1) { - vcpu_set_state(sc->vm, vcpu, VCPU_IDLE); + vcpu_set_state(sc->vm, vcpu, VCPU_IDLE, false); } else if (state_changed == 2) { for (vcpu = 0; vcpu < VM_MAXCPU; vcpu++) - vcpu_set_state(sc->vm, vcpu, VCPU_IDLE); + vcpu_set_state(sc->vm, vcpu, VCPU_IDLE, false); } done: Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Sun Dec 22 19:47:22 2013 (r259736) +++ head/usr.sbin/bhyve/bhyverun.c Sun Dec 22 20:29:59 2013 (r259737) @@ -485,19 +485,8 @@ vm_loop(struct vmctx *ctx, int vcpu, uin while (1) { error = vm_run(ctx, vcpu, rip, &vmexit[vcpu]); - if (error != 0) { - /* - * It is possible that 'vmmctl' or some other process - * has transitioned the vcpu to CANNOT_RUN state right - * before we tried to transition it to RUNNING. - * - * This is expected to be temporary so just retry. - */ - if (errno == EBUSY) - continue; - else - break; - } + if (error != 0) + break; prevcpu = vcpu; From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 20:40:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB6A6E1F; Sun, 22 Dec 2013 20:40:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B916177A; Sun, 22 Dec 2013 20:40:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMKeuOu021019; Sun, 22 Dec 2013 20:40:56 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMKeuch021018; Sun, 22 Dec 2013 20:40:56 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312222040.rBMKeuch021018@svn.freebsd.org> From: Ian Lepore Date: Sun, 22 Dec 2013 20:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259739 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 20:40:56 -0000 Author: ian Date: Sun Dec 22 20:40:56 2013 New Revision: 259739 URL: http://svnweb.freebsd.org/changeset/base/259739 Log: Shorten the DMTIMER_ prefix used for register names to DMT_. This is in preparation for adding more complete register defintions, some of which have fairly long names. Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Dec 22 20:31:40 2013 (r259738) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Dec 22 20:40:56 2013 (r259739) @@ -53,23 +53,23 @@ __FBSDID("$FreeBSD$"); #define AM335X_NUM_TIMERS 8 -#define DMTIMER_TIDR 0x00 /* Identification Register */ -#define DMTIMER_TIOCP_CFG 0x10 /* Timer OCP Configuration Reg */ -#define DMTIMER_IQR_EOI 0x20 /* Timer IRQ End-Of-Interrupt Reg */ -#define DMTIMER_IRQSTATUS_RAW 0x24 /* Timer IRQSTATUS Raw Reg */ -#define DMTIMER_IRQSTATUS 0x28 /* Timer IRQSTATUS Reg */ -#define DMTIMER_IRQENABLE_SET 0x2c /* Timer IRQSTATUS Set Reg */ -#define DMTIMER_IRQENABLE_CLR 0x30 /* Timer IRQSTATUS Clear Reg */ -#define DMTIMER_IRQWAKEEN 0x34 /* Timer IRQ Wakeup Enable Reg */ -#define DMTIMER_TCLR 0x38 /* Timer Control Register */ -#define DMTIMER_TCRR 0x3C /* Timer Counter Register */ -#define DMTIMER_TLDR 0x40 /* Timer Load Reg */ -#define DMTIMER_TTGR 0x44 /* Timer Trigger Reg */ -#define DMTIMER_TWPS 0x48 /* Timer Write Posted Status Reg */ -#define DMTIMER_TMAR 0x4C /* Timer Match Reg */ -#define DMTIMER_TCAR1 0x50 /* Timer Capture Reg */ -#define DMTIMER_TSICR 0x54 /* Timer Synchr. Interface Control Reg */ -#define DMTIMER_TCAR2 0x48 /* Timer Capture Reg */ +#define DMT_TIDR 0x00 /* Identification Register */ +#define DMT_TIOCP_CFG 0x10 /* Timer OCP Configuration Reg */ +#define DMT_IQR_EOI 0x20 /* Timer IRQ End-Of-Interrupt Reg */ +#define DMT_IRQSTATUS_RAW 0x24 /* Timer IRQSTATUS Raw Reg */ +#define DMT_IRQSTATUS 0x28 /* Timer IRQSTATUS Reg */ +#define DMT_IRQENABLE_SET 0x2c /* Timer IRQSTATUS Set Reg */ +#define DMT_IRQENABLE_CLR 0x30 /* Timer IRQSTATUS Clear Reg */ +#define DMT_IRQWAKEEN 0x34 /* Timer IRQ Wakeup Enable Reg */ +#define DMT_TCLR 0x38 /* Timer Control Register */ +#define DMT_TCRR 0x3C /* Timer Counter Register */ +#define DMT_TLDR 0x40 /* Timer Load Reg */ +#define DMT_TTGR 0x44 /* Timer Trigger Reg */ +#define DMT_TWPS 0x48 /* Timer Write Posted Status Reg */ +#define DMT_TMAR 0x4C /* Timer Match Reg */ +#define DMT_TCAR1 0x50 /* Timer Capture Reg */ +#define DMT_TSICR 0x54 /* Timer Synchr. Interface Control Reg */ +#define DMT_TCAR2 0x48 /* Timer Capture Reg */ struct am335x_dmtimer_softc { @@ -138,7 +138,7 @@ static struct timecounter am335x_dmtimer static unsigned am335x_dmtimer_tc_get_timecount(struct timecounter *tc) { - return am335x_dmtimer_tc_read_4(DMTIMER_TCRR); + return am335x_dmtimer_tc_read_4(DMT_TCRR); } static int @@ -162,23 +162,23 @@ am335x_dmtimer_start(struct eventtimer * count = load; /* Reset Timer */ - am335x_dmtimer_et_write_4(DMTIMER_TSICR, 2); + am335x_dmtimer_et_write_4(DMT_TSICR, 2); /* Wait for reset to complete */ - while (am335x_dmtimer_et_read_4(DMTIMER_TIOCP_CFG) & 1); + while (am335x_dmtimer_et_read_4(DMT_TIOCP_CFG) & 1); /* set load value */ - am335x_dmtimer_et_write_4(DMTIMER_TLDR, 0xFFFFFFFE - load); + am335x_dmtimer_et_write_4(DMT_TLDR, 0xFFFFFFFE - load); /* set counter value */ - am335x_dmtimer_et_write_4(DMTIMER_TCRR, 0xFFFFFFFE - count); + am335x_dmtimer_et_write_4(DMT_TCRR, 0xFFFFFFFE - count); /* enable overflow interrupt */ - am335x_dmtimer_et_write_4(DMTIMER_IRQENABLE_SET, 2); + am335x_dmtimer_et_write_4(DMT_IRQENABLE_SET, 2); /* start timer(ST) */ tclr |= 1; - am335x_dmtimer_et_write_4(DMTIMER_TCLR, tclr); + am335x_dmtimer_et_write_4(DMT_TCLR, tclr); return (0); } @@ -189,10 +189,10 @@ am335x_dmtimer_stop(struct eventtimer *e struct am335x_dmtimer *tmr = (struct am335x_dmtimer *)et->et_priv; /* Disable all interrupts */ - am335x_dmtimer_et_write_4(DMTIMER_IRQENABLE_CLR, 7); + am335x_dmtimer_et_write_4(DMT_IRQENABLE_CLR, 7); /* Stop Timer */ - am335x_dmtimer_et_write_4(DMTIMER_TCLR, 0); + am335x_dmtimer_et_write_4(DMT_TCLR, 0); return (0); } @@ -203,7 +203,7 @@ am335x_dmtimer_intr(void *arg) struct am335x_dmtimer *tmr = (struct am335x_dmtimer *)arg; /* Ack interrupt */ - am335x_dmtimer_et_write_4(DMTIMER_IRQSTATUS, 7); + am335x_dmtimer_et_write_4(DMT_IRQSTATUS, 7); if (tmr->et.et_active) tmr->et.et_event_cb(&tmr->et, tmr->et.et_arg); @@ -277,19 +277,19 @@ am335x_dmtimer_attach(device_t dev) am335x_dmtimer_tc_tmr = &sc->t[2]; /* Reset Timer */ - am335x_dmtimer_tc_write_4(DMTIMER_TSICR, 2); + am335x_dmtimer_tc_write_4(DMT_TSICR, 2); /* Wait for reset to complete */ - while (am335x_dmtimer_tc_read_4(DMTIMER_TIOCP_CFG) & 1); + while (am335x_dmtimer_tc_read_4(DMT_TIOCP_CFG) & 1); /* set load value */ - am335x_dmtimer_tc_write_4(DMTIMER_TLDR, 0); + am335x_dmtimer_tc_write_4(DMT_TLDR, 0); /* set counter value */ - am335x_dmtimer_tc_write_4(DMTIMER_TCRR, 0); + am335x_dmtimer_tc_write_4(DMT_TCRR, 0); /* Set Timer autoreload(AR) and start timer(ST) */ - am335x_dmtimer_tc_write_4(DMTIMER_TCLR, 3); + am335x_dmtimer_tc_write_4(DMT_TCLR, 3); am335x_dmtimer_tc.tc_frequency = sc->sysclk_freq; tc_init(&am335x_dmtimer_tc); @@ -361,10 +361,10 @@ DELAY(int usec) /* Get the number of times to count */ counts = usec * (am335x_dmtimer_tc.tc_frequency / 1000000) + 1; - first = am335x_dmtimer_tc_read_4(DMTIMER_TCRR); + first = am335x_dmtimer_tc_read_4(DMT_TCRR); while (counts > 0) { - last = am335x_dmtimer_tc_read_4(DMTIMER_TCRR); + last = am335x_dmtimer_tc_read_4(DMT_TCRR); if (last>first) { counts -= (int32_t)(last - first); } else { From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 20:46:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67C2FF85; Sun, 22 Dec 2013 20:46:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5391B1791; Sun, 22 Dec 2013 20:46:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMKkWE8021949; Sun, 22 Dec 2013 20:46:32 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMKkWgZ021948; Sun, 22 Dec 2013 20:46:32 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312222046.rBMKkWgZ021948@svn.freebsd.org> From: Dimitry Andric Date: Sun, 22 Dec 2013 20:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259740 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 20:46:32 -0000 Author: dim Date: Sun Dec 22 20:46:31 2013 New Revision: 259740 URL: http://svnweb.freebsd.org/changeset/base/259740 Log: In usr.bin/sort/radixsort.c, pop_ls_mt() is only referenced if SORT_THREADS is defined, so make the whole function conditional, instead of just the pthread calls in it. MFC after: 3 days Modified: head/usr.bin/sort/radixsort.c Modified: head/usr.bin/sort/radixsort.c ============================================================================== --- head/usr.bin/sort/radixsort.c Sun Dec 22 20:40:56 2013 (r259739) +++ head/usr.bin/sort/radixsort.c Sun Dec 22 20:46:31 2013 (r259740) @@ -171,6 +171,8 @@ pop_ls_st(void) return (sl); } +#if defined(SORT_THREADS) + /* * Pop sort level from the stack (multi-threaded style) */ @@ -180,9 +182,7 @@ pop_ls_mt(void) struct level_stack *saved_ls; struct sort_level *sl; -#if defined(SORT_THREADS) pthread_mutex_lock(&g_ls_mutex); -#endif if (g_ls) { sl = g_ls->sl; @@ -193,15 +193,15 @@ pop_ls_mt(void) saved_ls = NULL; } -#if defined(SORT_THREADS) pthread_mutex_unlock(&g_ls_mutex); -#endif sort_free(saved_ls); return (sl); } +#endif /* defined(SORT_THREADS) */ + static void add_to_sublevel(struct sort_level *sl, struct sort_list_item *item, size_t indx) { From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 21:35:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2019B15; Sun, 22 Dec 2013 21:35:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE1631A7B; Sun, 22 Dec 2013 21:35:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMLZIBF039986; Sun, 22 Dec 2013 21:35:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMLZI5R039985; Sun, 22 Dec 2013 21:35:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312222135.rBMLZI5R039985@svn.freebsd.org> From: Ian Lepore Date: Sun, 22 Dec 2013 21:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259743 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 21:35:19 -0000 Author: ian Date: Sun Dec 22 21:35:18 2013 New Revision: 259743 URL: http://svnweb.freebsd.org/changeset/base/259743 Log: Map out all the timer-related registers, and define named constants for the bits within the registers. Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Dec 22 21:18:21 2013 (r259742) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Dec 22 21:35:18 2013 (r259743) @@ -51,26 +51,49 @@ __FBSDID("$FreeBSD$"); #include -#define AM335X_NUM_TIMERS 8 +#define AM335X_NUM_TIMERS 8 -#define DMT_TIDR 0x00 /* Identification Register */ -#define DMT_TIOCP_CFG 0x10 /* Timer OCP Configuration Reg */ -#define DMT_IQR_EOI 0x20 /* Timer IRQ End-Of-Interrupt Reg */ -#define DMT_IRQSTATUS_RAW 0x24 /* Timer IRQSTATUS Raw Reg */ -#define DMT_IRQSTATUS 0x28 /* Timer IRQSTATUS Reg */ -#define DMT_IRQENABLE_SET 0x2c /* Timer IRQSTATUS Set Reg */ -#define DMT_IRQENABLE_CLR 0x30 /* Timer IRQSTATUS Clear Reg */ -#define DMT_IRQWAKEEN 0x34 /* Timer IRQ Wakeup Enable Reg */ -#define DMT_TCLR 0x38 /* Timer Control Register */ -#define DMT_TCRR 0x3C /* Timer Counter Register */ -#define DMT_TLDR 0x40 /* Timer Load Reg */ -#define DMT_TTGR 0x44 /* Timer Trigger Reg */ -#define DMT_TWPS 0x48 /* Timer Write Posted Status Reg */ -#define DMT_TMAR 0x4C /* Timer Match Reg */ -#define DMT_TCAR1 0x50 /* Timer Capture Reg */ -#define DMT_TSICR 0x54 /* Timer Synchr. Interface Control Reg */ -#define DMT_TCAR2 0x48 /* Timer Capture Reg */ - +#define DMT_TIDR 0x00 /* Identification Register */ +#define DMT_TIOCP_CFG 0x10 /* OCP Configuration Reg */ +#define DMT_TIOCP_RESET (1 << 0) /* TIOCP perform soft reset */ +#define DMT_IQR_EOI 0x20 /* IRQ End-Of-Interrupt Reg */ +#define DMT_IRQSTATUS_RAW 0x24 /* IRQSTATUS Raw Reg */ +#define DMT_IRQSTATUS 0x28 /* IRQSTATUS Reg */ +#define DMT_IRQENABLE_SET 0x2c /* IRQSTATUS Set Reg */ +#define DMT_IRQENABLE_CLR 0x30 /* IRQSTATUS Clear Reg */ +#define DMT_IRQWAKEEN 0x34 /* IRQ Wakeup Enable Reg */ +#define DMT_IRQ_TCAR (1 << 0) /* IRQ: Capture */ +#define DMT_IRQ_OVF (1 << 1) /* IRQ: Overflow */ +#define DMT_IRQ_MAT (1 << 2) /* IRQ: Match */ +#define DMT_IRQ_MASK (DMT_IRQ_TCAR | DMT_IRQ_OVF | DMT_IRQ_MAT) +#define DMT_TCLR 0x38 /* Control Register */ +#define DMT_TCLR_START (1 << 0) /* Start timer */ +#define DMT_TCLR_AUTOLOAD (1 << 1) /* Auto-reload on overflow */ +#define DMT_TCLR_PRES_MASK (7 << 2) /* Prescaler mask */ +#define DMT_TCLR_PRES_ENABLE (1 << 5) /* Prescaler enable */ +#define DMT_TCLR_COMP_ENABLE (1 << 6) /* Compare enable */ +#define DMT_TCLR_PWM_HIGH (1 << 7) /* PWM default output high */ +#define DMT_TCLR_CAPTRAN_MASK (3 << 8) /* Capture transition mask */ +#define DMT_TCLR_CAPTRAN_NONE (0 << 8) /* Capture: none */ +#define DMT_TCLR_CAPTRAN_LOHI (1 << 8) /* Capture lo->hi transition */ +#define DMT_TCLR_CAPTRAN_HILO (2 << 8) /* Capture hi->lo transition */ +#define DMT_TCLR_CAPTRAN_BOTH (3 << 8) /* Capture both transitions */ +#define DMT_TCLR_TRGMODE_MASK (3 << 10) /* Trigger output mode mask */ +#define DMT_TCLR_TRGMODE_NONE (0 << 10) /* Trigger off */ +#define DMT_TCLR_TRGMODE_OVFL (1 << 10) /* Trigger on overflow */ +#define DMT_TCLR_TRGMODE_BOTH (2 << 10) /* Trigger on match + ovflow */ +#define DMT_TCLR_PWM_PTOGGLE (1 << 12) /* PWM toggles */ +#define DMT_TCLR_CAP_MODE_2ND (1 << 13) /* Capture second event mode */ +#define DMT_TCLR_GPO_CFG (1 << 14) /* (no descr in datasheet) */ +#define DMT_TCRR 0x3C /* Counter Register */ +#define DMT_TLDR 0x40 /* Load Reg */ +#define DMT_TTGR 0x44 /* Trigger Reg */ +#define DMT_TWPS 0x48 /* Write Posted Status Reg */ +#define DMT_TMAR 0x4C /* Match Reg */ +#define DMT_TCAR1 0x50 /* Capture Reg */ +#define DMT_TSICR 0x54 /* Synchr. Interface Ctrl Reg */ +#define DMT_TSICR_RESET 0x02 /* TSICR perform soft reset */ +#define DMT_TCAR2 0x48 /* Capture Reg */ struct am335x_dmtimer_softc { struct resource * tmr_mem_res[AM335X_NUM_TIMERS]; From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 21:44:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53482D9A; Sun, 22 Dec 2013 21:44:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3E3821AED; Sun, 22 Dec 2013 21:44:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMLiXgU043329; Sun, 22 Dec 2013 21:44:33 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMLiXdj043327; Sun, 22 Dec 2013 21:44:33 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312222144.rBMLiXdj043327@svn.freebsd.org> From: Ian Lepore Date: Sun, 22 Dec 2013 21:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259744 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 21:44:33 -0000 Author: ian Date: Sun Dec 22 21:44:32 2013 New Revision: 259744 URL: http://svnweb.freebsd.org/changeset/base/259744 Log: A variety of cleanups... - Use named constants for register bits, instead of mystery numebrs scattered around in the code. - Use inline functions for bus space read/write, instead of macros that rely on global variables. - Move the timecounter struct into the softc instead of treating it as a global variable. Backlink from it to the softc. - This leaves a pointer to the softc as the only static/global variable and it's now used only by DELAY(). Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Dec 22 21:35:18 2013 (r259743) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Dec 22 21:44:32 2013 (r259744) @@ -99,13 +99,16 @@ struct am335x_dmtimer_softc { struct resource * tmr_mem_res[AM335X_NUM_TIMERS]; struct resource * tmr_irq_res[AM335X_NUM_TIMERS]; uint32_t sysclk_freq; - struct am335x_dmtimer { - bus_space_tag_t bst; - bus_space_handle_t bsh; - struct eventtimer et; - } t[AM335X_NUM_TIMERS]; + uint32_t tc_num; /* Which timer number is tc. */ + uint32_t et_num; /* Which timer number is et. */ + struct resource * tc_memres; /* Resources for tc timer. */ + struct resource * et_memres; /* Resources for et timer. */ + struct timecounter tc; + struct eventtimer et; }; +static struct am335x_dmtimer_softc *am335x_dmtimer_sc; + static struct resource_spec am335x_dmtimer_mem_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_MEMORY, 1, RF_ACTIVE }, @@ -129,51 +132,58 @@ static struct resource_spec am335x_dmtim { -1, 0, 0 } }; -static struct am335x_dmtimer *am335x_dmtimer_tc_tmr = NULL; +static inline uint32_t +am335x_dmtimer_tc_read_4(struct am335x_dmtimer_softc *sc, uint32_t reg) +{ -/* Read/Write macros for Timer used as timecounter */ -#define am335x_dmtimer_tc_read_4(reg) \ - bus_space_read_4(am335x_dmtimer_tc_tmr->bst, \ - am335x_dmtimer_tc_tmr->bsh, reg) - -#define am335x_dmtimer_tc_write_4(reg, val) \ - bus_space_write_4(am335x_dmtimer_tc_tmr->bst, \ - am335x_dmtimer_tc_tmr->bsh, reg, val) - -/* Read/Write macros for Timer used as eventtimer */ -#define am335x_dmtimer_et_read_4(reg) \ - bus_space_read_4(tmr->bst, tmr->bsh, reg) - -#define am335x_dmtimer_et_write_4(reg, val) \ - bus_space_write_4(tmr->bst, tmr->bsh, reg, val) - -static unsigned am335x_dmtimer_tc_get_timecount(struct timecounter *); - -static struct timecounter am335x_dmtimer_tc = { - .tc_name = "AM335x Timecounter", - .tc_get_timecount = am335x_dmtimer_tc_get_timecount, - .tc_poll_pps = NULL, - .tc_counter_mask = ~0u, - .tc_frequency = 0, - .tc_quality = 1000, -}; + return (bus_read_4(sc->tc_memres, reg)); +} + +static inline void +am335x_dmtimer_tc_write_4(struct am335x_dmtimer_softc *sc, uint32_t reg, + uint32_t val) +{ + + bus_write_4(sc->tc_memres, reg, val); +} + +static inline uint32_t +am335x_dmtimer_et_read_4(struct am335x_dmtimer_softc *sc, uint32_t reg) +{ + + return (bus_read_4(sc->et_memres, reg)); +} + +static inline void +am335x_dmtimer_et_write_4(struct am335x_dmtimer_softc *sc, uint32_t reg, + uint32_t val) +{ + + bus_write_4(sc->et_memres, reg, val); +} static unsigned am335x_dmtimer_tc_get_timecount(struct timecounter *tc) { - return am335x_dmtimer_tc_read_4(DMT_TCRR); + struct am335x_dmtimer_softc *sc; + + sc = tc->tc_priv; + + return (am335x_dmtimer_tc_read_4(sc, DMT_TCRR)); } static int am335x_dmtimer_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { - struct am335x_dmtimer *tmr = (struct am335x_dmtimer *)et->et_priv; - uint32_t load, count; - uint32_t tclr = 0; + struct am335x_dmtimer_softc *sc; + uint32_t count, load, tclr; + + sc = et->et_priv; + tclr = 0; if (period != 0) { load = ((uint32_t)et->et_frequency * period) >> 32; - tclr |= 2; /* autoreload bit */ + tclr |= DMT_TCLR_AUTOLOAD; panic("periodic timer not implemented\n"); } else { load = 0; @@ -185,23 +195,24 @@ am335x_dmtimer_start(struct eventtimer * count = load; /* Reset Timer */ - am335x_dmtimer_et_write_4(DMT_TSICR, 2); + am335x_dmtimer_et_write_4(sc, DMT_TSICR, DMT_TSICR_RESET); /* Wait for reset to complete */ - while (am335x_dmtimer_et_read_4(DMT_TIOCP_CFG) & 1); + while (am335x_dmtimer_et_read_4(sc, DMT_TIOCP_CFG) & DMT_TIOCP_RESET) + continue; /* set load value */ - am335x_dmtimer_et_write_4(DMT_TLDR, 0xFFFFFFFE - load); + am335x_dmtimer_et_write_4(sc, DMT_TLDR, 0xFFFFFFFE - load); /* set counter value */ - am335x_dmtimer_et_write_4(DMT_TCRR, 0xFFFFFFFE - count); + am335x_dmtimer_et_write_4(sc, DMT_TCRR, 0xFFFFFFFE - count); /* enable overflow interrupt */ - am335x_dmtimer_et_write_4(DMT_IRQENABLE_SET, 2); + am335x_dmtimer_et_write_4(sc, DMT_IRQENABLE_SET, DMT_IRQ_OVF); /* start timer(ST) */ - tclr |= 1; - am335x_dmtimer_et_write_4(DMT_TCLR, tclr); + tclr |= DMT_TCLR_START; + am335x_dmtimer_et_write_4(sc, DMT_TCLR, tclr); return (0); } @@ -209,13 +220,15 @@ am335x_dmtimer_start(struct eventtimer * static int am335x_dmtimer_stop(struct eventtimer *et) { - struct am335x_dmtimer *tmr = (struct am335x_dmtimer *)et->et_priv; + struct am335x_dmtimer_softc *sc; + + sc = et->et_priv; /* Disable all interrupts */ - am335x_dmtimer_et_write_4(DMT_IRQENABLE_CLR, 7); + am335x_dmtimer_et_write_4(sc, DMT_IRQENABLE_CLR, DMT_IRQ_MASK); /* Stop Timer */ - am335x_dmtimer_et_write_4(DMT_TCLR, 0); + am335x_dmtimer_et_write_4(sc, DMT_TCLR, 0); return (0); } @@ -223,12 +236,13 @@ am335x_dmtimer_stop(struct eventtimer *e static int am335x_dmtimer_intr(void *arg) { - struct am335x_dmtimer *tmr = (struct am335x_dmtimer *)arg; + struct am335x_dmtimer_softc *sc; + sc = arg; /* Ack interrupt */ - am335x_dmtimer_et_write_4(DMT_IRQSTATUS, 7); - if (tmr->et.et_active) - tmr->et.et_event_cb(&tmr->et, tmr->et.et_arg); + am335x_dmtimer_et_write_4(sc, DMT_IRQSTATUS, DMT_IRQ_OVF); + if (sc->et.et_active) + sc->et.et_event_cb(&sc->et, sc->et.et_arg); return (FILTER_HANDLED); } @@ -236,8 +250,6 @@ am335x_dmtimer_intr(void *arg) static int am335x_dmtimer_probe(device_t dev) { - struct am335x_dmtimer_softc *sc; - sc = (struct am335x_dmtimer_softc *)device_get_softc(dev); if (ofw_bus_is_compatible(dev, "ti,am335x-dmtimer")) { device_set_desc(dev, "AM335x DMTimer"); @@ -250,22 +262,29 @@ am335x_dmtimer_probe(device_t dev) static int am335x_dmtimer_attach(device_t dev) { - struct am335x_dmtimer_softc *sc = device_get_softc(dev); + struct am335x_dmtimer_softc *sc; void *ihl; int err; - int i; - if (am335x_dmtimer_tc_tmr != NULL) + /* + * Note that if this routine returns an error status rather than running + * to completion it makes no attempt to clean up allocated resources; + * the system is essentially dead anyway without functional timers. + */ + + sc = device_get_softc(dev); + + if (am335x_dmtimer_sc != NULL) return (EINVAL); - /* Get the base clock frequency */ + /* Get the base clock frequency. */ err = ti_prcm_clk_get_source_freq(SYS_CLK, &sc->sysclk_freq); if (err) { device_printf(dev, "Error: could not get sysclk frequency\n"); return (ENXIO); } - /* Request the memory resources */ + /* Request the memory resources. */ err = bus_alloc_resources(dev, am335x_dmtimer_mem_spec, sc->tmr_mem_res); if (err) { @@ -273,7 +292,7 @@ am335x_dmtimer_attach(device_t dev) return (ENXIO); } - /* Request the IRQ resources */ + /* Request the IRQ resources. */ err = bus_alloc_resources(dev, am335x_dmtimer_irq_spec, sc->tmr_irq_res); if (err) { @@ -281,65 +300,64 @@ am335x_dmtimer_attach(device_t dev) return (ENXIO); } - for(i=0;it[i].bst = rman_get_bustag(sc->tmr_mem_res[i]); - sc->t[i].bsh = rman_get_bushandle(sc->tmr_mem_res[i]); - } - - /* Configure DMTimer2 and DMTimer3 source and enable them */ - err = ti_prcm_clk_set_source(DMTIMER2_CLK, SYSCLK_CLK); - err |= ti_prcm_clk_enable(DMTIMER2_CLK); - err |= ti_prcm_clk_set_source(DMTIMER3_CLK, SYSCLK_CLK); - err |= ti_prcm_clk_enable(DMTIMER3_CLK); + /* Configure DMTimer3 as eventtimer and DMTimer4 as timecounter. */ + sc->et_num = 3; + sc->tc_num = 2; + sc->et_memres = sc->tmr_mem_res[sc->et_num]; + sc->tc_memres = sc->tmr_mem_res[sc->tc_num]; + + err = ti_prcm_clk_set_source(DMTIMER0_CLK + sc->et_num, SYSCLK_CLK); + err |= ti_prcm_clk_enable(DMTIMER0_CLK + sc->et_num); + err |= ti_prcm_clk_set_source(DMTIMER0_CLK + sc->tc_num, SYSCLK_CLK); + err |= ti_prcm_clk_enable(DMTIMER0_CLK + sc->tc_num); if (err) { device_printf(dev, "Error: could not setup timer clock\n"); return (ENXIO); } - /* Take DMTimer2 for TC */ - am335x_dmtimer_tc_tmr = &sc->t[2]; - - /* Reset Timer */ - am335x_dmtimer_tc_write_4(DMT_TSICR, 2); - - /* Wait for reset to complete */ - while (am335x_dmtimer_tc_read_4(DMT_TIOCP_CFG) & 1); - - /* set load value */ - am335x_dmtimer_tc_write_4(DMT_TLDR, 0); - - /* set counter value */ - am335x_dmtimer_tc_write_4(DMT_TCRR, 0); - - /* Set Timer autoreload(AR) and start timer(ST) */ - am335x_dmtimer_tc_write_4(DMT_TCLR, 3); - - am335x_dmtimer_tc.tc_frequency = sc->sysclk_freq; - tc_init(&am335x_dmtimer_tc); - - /* Register DMTimer3 as ET */ - - /* Setup and enable the timer */ - if (bus_setup_intr(dev, sc->tmr_irq_res[3], INTR_TYPE_CLK, - am335x_dmtimer_intr, NULL, &sc->t[3], &ihl) != 0) { + /* Set up timecounter; register tc. */ + am335x_dmtimer_tc_write_4(sc, DMT_TSICR, DMT_TSICR_RESET); + while (am335x_dmtimer_tc_read_4(sc, DMT_TIOCP_CFG) & DMT_TIOCP_RESET) + continue; + + am335x_dmtimer_tc_write_4(sc, DMT_TLDR, 0); + am335x_dmtimer_tc_write_4(sc, DMT_TCRR, 0); + am335x_dmtimer_tc_write_4(sc, DMT_TCLR, + DMT_TCLR_START | DMT_TCLR_AUTOLOAD); + + sc->tc.tc_name = "AM335x Timecounter"; + sc->tc.tc_get_timecount = am335x_dmtimer_tc_get_timecount; + sc->tc.tc_poll_pps = NULL; + sc->tc.tc_counter_mask = ~0u; + sc->tc.tc_frequency = sc->sysclk_freq; + sc->tc.tc_quality = 1000; + sc->tc.tc_priv = sc; + tc_init(&sc->tc); + + /* Setup eventtimer; register et. */ + if (bus_setup_intr(dev, sc->tmr_irq_res[sc->et_num], INTR_TYPE_CLK, + am335x_dmtimer_intr, NULL, sc, &ihl) != 0) { bus_release_resources(dev, am335x_dmtimer_irq_spec, sc->tmr_irq_res); device_printf(dev, "Unable to setup the clock irq handler.\n"); return (ENXIO); } - sc->t[3].et.et_name = "AM335x Eventtimer0"; - sc->t[3].et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT; - sc->t[3].et.et_quality = 1000; - sc->t[3].et.et_frequency = sc->sysclk_freq; - sc->t[3].et.et_min_period = - (0x00000002LLU << 32) / sc->t[3].et.et_frequency; - sc->t[3].et.et_max_period = - (0xfffffffeLLU << 32) / sc->t[3].et.et_frequency; - sc->t[3].et.et_start = am335x_dmtimer_start; - sc->t[3].et.et_stop = am335x_dmtimer_stop; - sc->t[3].et.et_priv = &sc->t[3]; - et_register(&sc->t[3].et); + sc->et.et_name = "AM335x Eventtimer"; + sc->et.et_flags = ET_FLAGS_ONESHOT; + sc->et.et_quality = 1000; + sc->et.et_frequency = sc->sysclk_freq; + sc->et.et_min_period = + ((0x00000005LLU << 32) / sc->et.et_frequency); + sc->et.et_max_period = + (0xfffffffeLLU << 32) / sc->et.et_frequency; + sc->et.et_start = am335x_dmtimer_start; + sc->et.et_stop = am335x_dmtimer_stop; + sc->et.et_priv = sc; + et_register(&sc->et); + + /* Store a pointer to the softc for use in DELAY(). */ + am335x_dmtimer_sc = sc; return (0); } @@ -370,10 +388,13 @@ cpu_initclocks(void) void DELAY(int usec) { - int32_t counts; + struct am335x_dmtimer_softc *sc; + int32_t counts; uint32_t first, last; - if (am335x_dmtimer_tc_tmr == NULL) { + sc = am335x_dmtimer_sc; + + if (sc == NULL) { for (; usec > 0; usec--) for (counts = 200; counts > 0; counts--) /* Prevent gcc from optimizing out the loop */ @@ -382,13 +403,13 @@ DELAY(int usec) } /* Get the number of times to count */ - counts = usec * (am335x_dmtimer_tc.tc_frequency / 1000000) + 1; + counts = (usec + 1) * (sc->sysclk_freq / 1000000); - first = am335x_dmtimer_tc_read_4(DMT_TCRR); + first = am335x_dmtimer_tc_read_4(sc, DMT_TCRR); while (counts > 0) { - last = am335x_dmtimer_tc_read_4(DMT_TCRR); - if (last>first) { + last = am335x_dmtimer_tc_read_4(sc, DMT_TCRR); + if (last > first) { counts -= (int32_t)(last - first); } else { counts -= (int32_t)((0xFFFFFFFF - first) + last); From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 22:56:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3825E64; Sun, 22 Dec 2013 22:56:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84A9D1F7D; Sun, 22 Dec 2013 22:56:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMMujGS068587; Sun, 22 Dec 2013 22:56:45 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMMujDJ068586; Sun, 22 Dec 2013 22:56:45 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312222256.rBMMujDJ068586@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 22 Dec 2013 22:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259749 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 22:56:45 -0000 Author: rodrigc Date: Sun Dec 22 22:56:45 2013 New Revision: 259749 URL: http://svnweb.freebsd.org/changeset/base/259749 Log: Add updates for Raspberry PI support, unmapped VMIO, netmap(4), nvme(4). Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 22:31:39 2013 (r259748) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Dec 22 22:56:45 2013 (r259749) @@ -120,6 +120,16 @@ Kernel Changes + Raspberry PI support has been added. + Refer to these setup instructions + and quick start + guide. + + The use of unmapped VMIO buffers eliminates the need to perform + TLB shootdown for mapping on buffer creation and reuse, greatly reducing the + amount of IPIs for shootdown on big-SMP machines and eliminating up to 25-30% + of the system time on i/o intensive workloads. + The maximum amount of memory the &os; kernel can address has been increased from 1TB to 4TB. @@ -292,6 +302,13 @@ for dynamically loading kernel modules for Infiniband core (ibcore) and IP over Infiniband (ipoib). + &man.netmap.4; has been added. &man.netmap.4; is a framework for + high-performance direct-to-hardware packet IO, offering low latency and high PPS + rates to userland applications while bypassing any kernel-side packet processing. + With &man.netmap.4; it is trivially possible to fully saturate a 10 Gbps network interface with + minimal packet sizes. For more information, see: + Netmap Project. + @@ -338,6 +355,11 @@ The &man.hptrr.4; driver has been updated to version 1.2 from Highpoint. + &man.nvme.4; has been added and provides NVM Express support. + NVM Express is an optimized register interface, command set and feature set of + PCI Express (PCIe)-based Solid-State Drives (SSDs). For more information, + see nvmexpress.org. + From owner-svn-src-head@FreeBSD.ORG Sun Dec 22 23:03:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02AB5191; Sun, 22 Dec 2013 23:03:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E12D0100C; Sun, 22 Dec 2013 23:03:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMN3THP071925; Sun, 22 Dec 2013 23:03:29 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMN3Th4071924; Sun, 22 Dec 2013 23:03:29 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312222303.rBMN3Th4071924@svn.freebsd.org> From: Ian Lepore Date: Sun, 22 Dec 2013 23:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259750 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 23:03:30 -0000 Author: ian Date: Sun Dec 22 23:03:29 2013 New Revision: 259750 URL: http://svnweb.freebsd.org/changeset/base/259750 Log: Add PPS support to the am335x timer driver. This uses the timer hardware's capture mode together with the timecounter's PPS polling feature to get very accurate PPS capture without any interrupt processing (or latency). Hardware timers 4 through 7 have associated capture-trigger input pins. When the PPS support is compiled in the code automatically chooses the first timer it finds that has the capture-trigger pin set to input mode (this is configured via the fdt data). Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Dec 22 22:56:45 2013 (r259749) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Dec 22 23:03:29 2013 (r259750) @@ -30,17 +30,22 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include +#include #include #include #include #include #include +#include "opt_ntp.h" + #include #include #include @@ -50,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #define AM335X_NUM_TIMERS 8 @@ -62,9 +68,9 @@ __FBSDID("$FreeBSD$"); #define DMT_IRQENABLE_SET 0x2c /* IRQSTATUS Set Reg */ #define DMT_IRQENABLE_CLR 0x30 /* IRQSTATUS Clear Reg */ #define DMT_IRQWAKEEN 0x34 /* IRQ Wakeup Enable Reg */ -#define DMT_IRQ_TCAR (1 << 0) /* IRQ: Capture */ +#define DMT_IRQ_MAT (1 << 0) /* IRQ: Match */ #define DMT_IRQ_OVF (1 << 1) /* IRQ: Overflow */ -#define DMT_IRQ_MAT (1 << 2) /* IRQ: Match */ +#define DMT_IRQ_TCAR (1 << 2) /* IRQ: Capture */ #define DMT_IRQ_MASK (DMT_IRQ_TCAR | DMT_IRQ_OVF | DMT_IRQ_MAT) #define DMT_TCLR 0x38 /* Control Register */ #define DMT_TCLR_START (1 << 0) /* Start timer */ @@ -92,17 +98,32 @@ __FBSDID("$FreeBSD$"); #define DMT_TMAR 0x4C /* Match Reg */ #define DMT_TCAR1 0x50 /* Capture Reg */ #define DMT_TSICR 0x54 /* Synchr. Interface Ctrl Reg */ -#define DMT_TSICR_RESET 0x02 /* TSICR perform soft reset */ +#define DMT_TSICR_RESET (1 << 1) /* TSICR perform soft reset */ #define DMT_TCAR2 0x48 /* Capture Reg */ +/* + * Use timer 2 for the eventtimer. When PPS support is not compiled in, there's + * no need to use a timer that has an associated capture-input pin, so use timer + * 3 for timecounter. When PPS is compiled in we ignore the default and use + * whichever of timers 4-7 have the capture pin configured. + */ +#define DEFAULT_ET_TIMER 2 +#define DEFAULT_TC_TIMER 3 + struct am335x_dmtimer_softc { struct resource * tmr_mem_res[AM335X_NUM_TIMERS]; struct resource * tmr_irq_res[AM335X_NUM_TIMERS]; uint32_t sysclk_freq; uint32_t tc_num; /* Which timer number is tc. */ - uint32_t et_num; /* Which timer number is et. */ + uint32_t tc_tclr; /* Cached tc TCLR register. */ struct resource * tc_memres; /* Resources for tc timer. */ + uint32_t et_num; /* Which timer number is et. */ + uint32_t et_tclr; /* Cached et TCLR register. */ struct resource * et_memres; /* Resources for et timer. */ + int pps_curmode; /* Edge mode now set in hw. */ + struct task pps_task; /* For pps_event handling. */ + struct cdev * pps_cdev; + struct pps_state pps; struct timecounter tc; struct eventtimer et; }; @@ -162,6 +183,255 @@ am335x_dmtimer_et_write_4(struct am335x_ bus_write_4(sc->et_memres, reg, val); } +/* + * PPS driver routines, included when the kernel is built with option PPS_SYNC. + * + * Note that this PPS driver does not use an interrupt. Instead it uses the + * hardware's ability to latch the timer's count register in response to a + * signal on an IO pin. Each of timers 4-7 have an associated pin, and this + * code allows any one of those to be used. + * + * The timecounter routines in kern_tc.c call the pps poll routine periodically + * to see if a new counter value has been latched. When a new value has been + * latched, the only processing done in the poll routine is to capture the + * current set of timecounter timehands (done with pps_capture()) and the + * latched value from the timer. The remaining work (done by pps_event()) is + * scheduled to be done later in a non-interrupt context. + */ +#ifdef PPS_SYNC + +#define PPS_CDEV_NAME "pps" + +static void +am335x_dmtimer_set_capture_mode(struct am335x_dmtimer_softc *sc, bool force_off) +{ + int newmode; + + if (force_off) + newmode = 0; + else + newmode = sc->pps.ppsparam.mode & PPS_CAPTUREBOTH; + + if (newmode == sc->pps_curmode) + return; + + sc->pps_curmode = newmode; + sc->tc_tclr &= ~DMT_TCLR_CAPTRAN_MASK; + switch (newmode) { + case PPS_CAPTUREASSERT: + sc->tc_tclr |= DMT_TCLR_CAPTRAN_LOHI; + break; + case PPS_CAPTURECLEAR: + sc->tc_tclr |= DMT_TCLR_CAPTRAN_HILO; + break; + default: + /* It can't be BOTH, so it's disabled. */ + break; + } + am335x_dmtimer_tc_write_4(sc, DMT_TCLR, sc->tc_tclr); +} + +static void +am335x_dmtimer_tc_poll_pps(struct timecounter *tc) +{ + struct am335x_dmtimer_softc *sc; + + sc = tc->tc_priv; + + /* + * Note that we don't have the TCAR interrupt enabled, but the hardware + * still provides the status bits in the "RAW" status register even when + * they're masked from generating an irq. However, when clearing the + * TCAR status to re-arm the capture for the next second, we have to + * write to the IRQ status register, not the RAW register. Quirky. + */ + if (am335x_dmtimer_tc_read_4(sc, DMT_IRQSTATUS_RAW) & DMT_IRQ_TCAR) { + pps_capture(&sc->pps); + sc->pps.capcount = am335x_dmtimer_tc_read_4(sc, DMT_TCAR1); + am335x_dmtimer_tc_write_4(sc, DMT_IRQSTATUS, DMT_IRQ_TCAR); + taskqueue_enqueue_fast(taskqueue_fast, &sc->pps_task); + } +} + +static void +am335x_dmtimer_process_pps_event(void *arg, int pending) +{ + struct am335x_dmtimer_softc *sc; + + sc = arg; + + /* This is the task function that gets enqueued by poll_pps. Once the + * time has been captured in the hw interrupt context, the remaining + * (more expensive) work to process the event is done later in a + * non-fast-interrupt context. + * + * We only support capture of the rising or falling edge, not both at + * once; tell the kernel to process whichever mode is currently active. + */ + pps_event(&sc->pps, sc->pps.ppsparam.mode & PPS_CAPTUREBOTH); +} + +static int +am335x_dmtimer_pps_open(struct cdev *dev, int flags, int fmt, + struct thread *td) +{ + struct am335x_dmtimer_softc *sc; + + sc = dev->si_drv1; + + /* Enable capture on open. Harmless if already open. */ + am335x_dmtimer_set_capture_mode(sc, 0); + + return 0; +} + +static int +am335x_dmtimer_pps_close(struct cdev *dev, int flags, int fmt, + struct thread *td) +{ + struct am335x_dmtimer_softc *sc; + + sc = dev->si_drv1; + + /* + * Disable capture on last close. Use the force-off flag to override + * the configured mode and turn off the hardware capture. + */ + am335x_dmtimer_set_capture_mode(sc, 1); + + return 0; +} + +static int +am335x_dmtimer_pps_ioctl(struct cdev *dev, u_long cmd, caddr_t data, + int flags, struct thread *td) +{ + struct am335x_dmtimer_softc *sc; + int err; + + sc = dev->si_drv1; + + /* + * The hardware has a "capture both edges" mode, but we can't do + * anything useful with it in terms of PPS capture, so don't even try. + */ + if ((sc->pps.ppsparam.mode & PPS_CAPTUREBOTH) == PPS_CAPTUREBOTH) + return (EINVAL); + + /* Let the kernel do the heavy lifting for ioctl. */ + err = pps_ioctl(cmd, data, &sc->pps); + if (err != 0) + return (err); + + /* + * The capture mode could have changed, set the hardware to whatever + * mode is now current. Effectively a no-op if nothing changed. + */ + am335x_dmtimer_set_capture_mode(sc, 0); + + return (err); +} + +static struct cdevsw am335x_dmtimer_pps_cdevsw = { + .d_version = D_VERSION, + .d_open = am335x_dmtimer_pps_open, + .d_close = am335x_dmtimer_pps_close, + .d_ioctl = am335x_dmtimer_pps_ioctl, + .d_name = PPS_CDEV_NAME, +}; + +/* + * Set up the PPS cdev and the the kernel timepps stuff. + * + * Note that this routine cannot touch the hardware, because bus space resources + * are not fully set up yet when this is called. + */ +static int +am335x_dmtimer_pps_init(device_t dev, struct am335x_dmtimer_softc *sc) +{ + int i, timer_num, unit; + unsigned int padstate; + const char * padmux; + struct padinfo { + char * ballname; + char * muxname; + int timer_num; + } padinfo[] = { + {"GPMC_ADVn_ALE", "timer4", 4}, + {"GPMC_BEn0_CLE", "timer5", 5}, + {"GPMC_WEn", "timer6", 6}, + {"GPMC_OEn_REn", "timer7", 7}, + }; + + /* + * Figure out which pin the user has set up for pps. We'll use the + * first timer that has an external caputure pin configured as input. + * + * XXX The hieroglyphic "(padstate & (0x01 << 5)))" checks that the pin + * is configured for input. The right symbolic values aren't exported + * yet from ti_scm.h. + */ + timer_num = 0; + for (i = 0; nitems(padinfo) && timer_num == 0; ++i) { + if (ti_scm_padconf_get(padinfo[i].ballname, &padmux, + &padstate) == 0) { + if (strcasecmp(padinfo[i].muxname, padmux) == 0 && + (padstate & (0x01 << 5))) + timer_num = padinfo[i].timer_num; + } + } + + if (timer_num == 0) { + device_printf(dev, "No DMTimer found with capture pin " + "configured as input; PPS driver disabled.\n"); + return (DEFAULT_TC_TIMER); + } + + /* + * Indicate our capabilities (pretty much just capture of either edge). + * Have the kernel init its part of the pps_state struct and add its + * capabilities. + */ + sc->pps.ppscap = PPS_CAPTUREBOTH; + pps_init(&sc->pps); + + /* + * Set up to capture the PPS via timecounter polling, and init the task + * that does deferred pps_event() processing after capture. + */ + sc->tc.tc_poll_pps = am335x_dmtimer_tc_poll_pps; + TASK_INIT(&sc->pps_task, 0, am335x_dmtimer_process_pps_event, sc); + + /* Create the PPS cdev. */ + unit = device_get_unit(dev); + sc->pps_cdev = make_dev(&am335x_dmtimer_pps_cdevsw, unit, + UID_ROOT, GID_WHEEL, 0600, PPS_CDEV_NAME "%d", unit); + sc->pps_cdev->si_drv1 = sc; + + device_printf(dev, "Using DMTimer%d for PPS device /dev/%s%d\n", + timer_num, PPS_CDEV_NAME, unit); + + return (timer_num); +} + +#else /* PPS_SYNC */ + +static int +am335x_dmtimer_pps_init(device_t dev, struct am335x_dmtimer_softc *sc) +{ + + /* + * When PPS support is not compiled in, there's no need to use a timer + * that has an associated capture-input pin, so use the default. + */ + return (DEFAULT_TC_TIMER); +} + +#endif /* PPS_SYNC */ +/* + * End of PPS driver code. + */ + static unsigned am335x_dmtimer_tc_get_timecount(struct timecounter *tc) { @@ -176,43 +446,50 @@ static int am335x_dmtimer_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { struct am335x_dmtimer_softc *sc; - uint32_t count, load, tclr; + uint32_t initial_count, reload_count; sc = et->et_priv; - tclr = 0; + /* + * Stop the timer before changing it. This routine will often be called + * while the timer is still running, to either lengthen or shorten the + * current event time. We need to ensure the timer doesn't expire while + * we're working with it. + * + * Also clear any pending interrupt status, because it's at least + * theoretically possible that we're running in a primary interrupt + * context now, and a timer interrupt could be pending even before we + * stopped the timer. The more likely case is that we're being called + * from the et_event_cb() routine dispatched from our own handler, but + * it's not clear to me that that's the only case possible. + */ + sc->et_tclr &= ~(DMT_TCLR_START | DMT_TCLR_AUTOLOAD); + am335x_dmtimer_et_write_4(sc, DMT_TCLR, sc->et_tclr); + am335x_dmtimer_et_write_4(sc, DMT_IRQSTATUS, DMT_IRQ_OVF); + if (period != 0) { - load = ((uint32_t)et->et_frequency * period) >> 32; - tclr |= DMT_TCLR_AUTOLOAD; - panic("periodic timer not implemented\n"); + reload_count = ((uint32_t)et->et_frequency * period) >> 32; + sc->et_tclr |= DMT_TCLR_AUTOLOAD; } else { - load = 0; + reload_count = 0; } if (first != 0) - count = ((uint32_t)et->et_frequency * first) >> 32; + initial_count = ((uint32_t)et->et_frequency * first) >> 32; else - count = load; - - /* Reset Timer */ - am335x_dmtimer_et_write_4(sc, DMT_TSICR, DMT_TSICR_RESET); - - /* Wait for reset to complete */ - while (am335x_dmtimer_et_read_4(sc, DMT_TIOCP_CFG) & DMT_TIOCP_RESET) - continue; + initial_count = reload_count; - /* set load value */ - am335x_dmtimer_et_write_4(sc, DMT_TLDR, 0xFFFFFFFE - load); - - /* set counter value */ - am335x_dmtimer_et_write_4(sc, DMT_TCRR, 0xFFFFFFFE - count); + /* + * Set auto-reload and current-count values. This timer hardware counts + * up from the initial/reload value and interrupts on the zero rollover. + */ + am335x_dmtimer_et_write_4(sc, DMT_TLDR, 0xFFFFFFFF - reload_count); + am335x_dmtimer_et_write_4(sc, DMT_TCRR, 0xFFFFFFFF - initial_count); - /* enable overflow interrupt */ + /* Enable overflow interrupt, and start the timer. */ am335x_dmtimer_et_write_4(sc, DMT_IRQENABLE_SET, DMT_IRQ_OVF); - - /* start timer(ST) */ - tclr |= DMT_TCLR_START; - am335x_dmtimer_et_write_4(sc, DMT_TCLR, tclr); + sc->et_tclr |= DMT_TCLR_START; + am335x_dmtimer_et_write_4(sc, DMT_TCLR, sc->et_tclr); return (0); } @@ -224,12 +501,11 @@ am335x_dmtimer_stop(struct eventtimer *e sc = et->et_priv; - /* Disable all interrupts */ - am335x_dmtimer_et_write_4(sc, DMT_IRQENABLE_CLR, DMT_IRQ_MASK); - - /* Stop Timer */ - am335x_dmtimer_et_write_4(sc, DMT_TCLR, 0); - + /* Stop timer, disable and clear interrupt. */ + sc->et_tclr &= ~(DMT_TCLR_START | DMT_TCLR_AUTOLOAD); + am335x_dmtimer_et_write_4(sc, DMT_TCLR, sc->et_tclr); + am335x_dmtimer_et_write_4(sc, DMT_IRQENABLE_CLR, DMT_IRQ_OVF); + am335x_dmtimer_et_write_4(sc, DMT_IRQSTATUS, DMT_IRQ_OVF); return (0); } @@ -239,7 +515,8 @@ am335x_dmtimer_intr(void *arg) struct am335x_dmtimer_softc *sc; sc = arg; - /* Ack interrupt */ + + /* Ack the interrupt, and invoke the callback if it's still enabled. */ am335x_dmtimer_et_write_4(sc, DMT_IRQSTATUS, DMT_IRQ_OVF); if (sc->et.et_active) sc->et.et_event_cb(&sc->et, sc->et.et_arg); @@ -300,51 +577,53 @@ am335x_dmtimer_attach(device_t dev) return (ENXIO); } - /* Configure DMTimer3 as eventtimer and DMTimer4 as timecounter. */ - sc->et_num = 3; - sc->tc_num = 2; + /* + * Use the default eventtimer. Let the PPS init routine decide which + * timer to use for the timecounter. + */ + sc->et_num = DEFAULT_ET_TIMER; + sc->tc_num = am335x_dmtimer_pps_init(dev, sc); + sc->et_memres = sc->tmr_mem_res[sc->et_num]; sc->tc_memres = sc->tmr_mem_res[sc->tc_num]; + /* Enable clocks and power on the chosen devices. */ err = ti_prcm_clk_set_source(DMTIMER0_CLK + sc->et_num, SYSCLK_CLK); err |= ti_prcm_clk_enable(DMTIMER0_CLK + sc->et_num); err |= ti_prcm_clk_set_source(DMTIMER0_CLK + sc->tc_num, SYSCLK_CLK); err |= ti_prcm_clk_enable(DMTIMER0_CLK + sc->tc_num); if (err) { - device_printf(dev, "Error: could not setup timer clock\n"); + device_printf(dev, "Error: could not enable timer clock\n"); return (ENXIO); } - /* Set up timecounter; register tc. */ + /* Setup eventtimer interrupt handler. */ + if (bus_setup_intr(dev, sc->tmr_irq_res[sc->et_num], INTR_TYPE_CLK, + am335x_dmtimer_intr, NULL, sc, &ihl) != 0) { + device_printf(dev, "Unable to setup the clock irq handler.\n"); + return (ENXIO); + } + + /* Set up timecounter, start it, register it. */ am335x_dmtimer_tc_write_4(sc, DMT_TSICR, DMT_TSICR_RESET); while (am335x_dmtimer_tc_read_4(sc, DMT_TIOCP_CFG) & DMT_TIOCP_RESET) continue; + sc->tc_tclr |= DMT_TCLR_START | DMT_TCLR_AUTOLOAD; am335x_dmtimer_tc_write_4(sc, DMT_TLDR, 0); am335x_dmtimer_tc_write_4(sc, DMT_TCRR, 0); - am335x_dmtimer_tc_write_4(sc, DMT_TCLR, - DMT_TCLR_START | DMT_TCLR_AUTOLOAD); + am335x_dmtimer_tc_write_4(sc, DMT_TCLR, sc->tc_tclr); sc->tc.tc_name = "AM335x Timecounter"; sc->tc.tc_get_timecount = am335x_dmtimer_tc_get_timecount; - sc->tc.tc_poll_pps = NULL; sc->tc.tc_counter_mask = ~0u; sc->tc.tc_frequency = sc->sysclk_freq; sc->tc.tc_quality = 1000; sc->tc.tc_priv = sc; tc_init(&sc->tc); - /* Setup eventtimer; register et. */ - if (bus_setup_intr(dev, sc->tmr_irq_res[sc->et_num], INTR_TYPE_CLK, - am335x_dmtimer_intr, NULL, sc, &ihl) != 0) { - bus_release_resources(dev, am335x_dmtimer_irq_spec, - sc->tmr_irq_res); - device_printf(dev, "Unable to setup the clock irq handler.\n"); - return (ENXIO); - } - sc->et.et_name = "AM335x Eventtimer"; - sc->et.et_flags = ET_FLAGS_ONESHOT; + sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT; sc->et.et_quality = 1000; sc->et.et_frequency = sc->sysclk_freq; sc->et.et_min_period = From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 00:02:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D3C0126; Mon, 23 Dec 2013 00:02:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48B0E13B8; Mon, 23 Dec 2013 00:02:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBN02JlA093692; Mon, 23 Dec 2013 00:02:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBN02JsA093691; Mon, 23 Dec 2013 00:02:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312230002.rBN02JsA093691@svn.freebsd.org> From: Dimitry Andric Date: Mon, 23 Dec 2013 00:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259756 - head/contrib/gperf/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 00:02:19 -0000 Author: dim Date: Mon Dec 23 00:02:18 2013 New Revision: 259756 URL: http://svnweb.freebsd.org/changeset/base/259756 Log: Get rid of register keyword usage in gperf, it is totally obsolete for C++, and this allows gperf to be compiled for C++11 without a warning about it. MFC after: 3 days Modified: head/contrib/gperf/lib/getline.cc Modified: head/contrib/gperf/lib/getline.cc ============================================================================== --- head/contrib/gperf/lib/getline.cc Sun Dec 22 23:52:11 2013 (r259755) +++ head/contrib/gperf/lib/getline.cc Mon Dec 23 00:02:18 2013 (r259756) @@ -57,7 +57,7 @@ getstr (char **lineptr, size_t *n, FILE for (;;) { - register int c = getc (stream); + int c = getc (stream); /* We always want at least one char left in the buffer, since we always (unless we get an error while reading the first char) From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 05:47:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35B26DD0; Mon, 23 Dec 2013 05:47:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 21BBD1A8F; Mon, 23 Dec 2013 05:47:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBN5lRQj017004; Mon, 23 Dec 2013 05:47:27 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBN5lRU8017003; Mon, 23 Dec 2013 05:47:27 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201312230547.rBN5lRU8017003@svn.freebsd.org> From: Ed Schouten Date: Mon, 23 Dec 2013 05:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259761 - head/sys/teken X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 05:47:28 -0000 Author: ed Date: Mon Dec 23 05:47:27 2013 New Revision: 259761 URL: http://svnweb.freebsd.org/changeset/base/259761 Log: Fix linewrapping behaviour for CJK fullwidth characters. Instead of only wrapping when in the 'wrapped state', also force wrapping when the character to be rendered does not fit on the line anymore. Tested by: lwhsu Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Mon Dec 23 04:38:56 2013 (r259760) +++ head/sys/teken/teken_subr.h Mon Dec 23 05:47:27 2013 (r259761) @@ -840,13 +840,18 @@ teken_subr_regular_character(teken_t *t, } t->t_cursor.tp_col = 0; } - } else if (t->t_cursor.tp_col == t->t_winsize.tp_col - 1 && - (t->t_stateflags & (TS_WRAPPED|TS_AUTOWRAP)) == - (TS_WRAPPED|TS_AUTOWRAP)) { + } else if (t->t_stateflags & TS_AUTOWRAP && + ((t->t_stateflags & TS_WRAPPED && + t->t_cursor.tp_col + 1 == t->t_winsize.tp_col) || + t->t_cursor.tp_col + width > t->t_winsize.tp_col)) { teken_pos_t tp; - /* Perform line wrapping. */ - + /* + * Perform line wrapping, if: + * - Autowrapping is enabled, and + * - We're in the wrapped state at the last column, or + * - The character to be printed does not fit anymore. + */ if (t->t_cursor.tp_row == t->t_scrollreg.ts_end - 1) { /* Perform scrolling. */ teken_subr_do_scroll(t, 1); From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 07:35:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4E5A978; Mon, 23 Dec 2013 07:35:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C05BE118E; Mon, 23 Dec 2013 07:35:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBN7ZY5E053800; Mon, 23 Dec 2013 07:35:34 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBN7ZYmo053799; Mon, 23 Dec 2013 07:35:34 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312230735.rBN7ZYmo053799@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 23 Dec 2013 07:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259762 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 07:35:34 -0000 Author: rodrigc Date: Mon Dec 23 07:35:34 2013 New Revision: 259762 URL: http://svnweb.freebsd.org/changeset/base/259762 Log: Fix text for loading Hyper-V drivers via loader.conf. Noticed by: hrs Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 05:47:27 2013 (r259761) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 07:35:34 2013 (r259762) @@ -197,11 +197,17 @@ memory ballooning (&man.virtio_balloon.4;), and PCI. Tested with on Qemu/KVM, VirtualBox, and &man.bhyve.4;. - A paravirtualized driver named "hyperv" which - which supports Microsoft Hyper-V has been imported and made - part of the amd64 GENERIC kernel. For i386, this driver is not part of - GENERIC, so hyperv_load="YES" must be added to - /boot/loader.conf to load the driver. + Paravirtualized drivers which + support Microsoft Hyper-V have been imported and made + part of the amd64 GENERIC kernel. For i386, these drivers are not part of + GENERIC, so the following lines must be added to + /boot/loader.conf to load these drivers: + hv_ata_pci_disengage_load="YES" +hv_netsvc_load="YES" +hv_utils_load="YES" +hv_vmbus_load="YES" Alternatively, the Hyper-V drivers can be added to the i386 + kernel by adding device hyperv to the kernel config, and then + recompiling the kernel. The &man.vmx.4; driver has been added. &man.vmx.4; is a VMware VMXNET3 ethernet driver ported from From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 07:58:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 998C8C77; Mon, 23 Dec 2013 07:58:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B5CD12B2; Mon, 23 Dec 2013 07:58:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBN7wlDb060896; Mon, 23 Dec 2013 07:58:47 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBN7wlTK060895; Mon, 23 Dec 2013 07:58:47 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312230758.rBN7wlTK060895@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 23 Dec 2013 07:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259763 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 07:58:47 -0000 Author: rodrigc Date: Mon Dec 23 07:58:46 2013 New Revision: 259763 URL: http://svnweb.freebsd.org/changeset/base/259763 Log: Add notes for ARM. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 07:35:34 2013 (r259762) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 07:58:46 2013 (r259763) @@ -120,11 +120,6 @@ Kernel Changes - Raspberry PI support has been added. - Refer to these setup instructions - and quick start - guide. - The use of unmapped VMIO buffers eliminates the need to perform TLB shootdown for mapping on buffer creation and reuse, greatly reducing the amount of IPIs for shootdown on big-SMP machines and eliminating up to 25-30% @@ -215,6 +210,32 @@ hv_vmbus_load="YES" Al + + ARM support + + Raspberry PI support has been added. + Refer to these setup instructions + and quick start + guide. + + The default ABI on ARM is now the ARM EABI. This brings a number of + improvements and allows future support for VFP and Thumb-2. + + ARM support has been greatly improved, including support + for ARMv6 and ARMv7, SMP and thread-local storage (TLS). + Additionally support for some newer SoC like the MV78x60 and OMAP4 was added. + See this announcement + for further details. + + Superpages support on ARM has been added. Superpages support + provides improved performance and scalability by allowing TLB + translations to dynamically cover large physical memory regions. + All ARMv6 and ARMv7-based platforms can take advantage of this feature. + See this page + for further details. + + + Boot Loader Changes From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 08:22:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 431CCFFA; Mon, 23 Dec 2013 08:22:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2E6FD1488; Mon, 23 Dec 2013 08:22:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBN8M9li070806; Mon, 23 Dec 2013 08:22:09 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBN8M9l0070805; Mon, 23 Dec 2013 08:22:09 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312230822.rBN8M9l0070805@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 23 Dec 2013 08:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259764 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 08:22:09 -0000 Author: rodrigc Date: Mon Dec 23 08:22:08 2013 New Revision: 259764 URL: http://svnweb.freebsd.org/changeset/base/259764 Log: Mention RDRAND and Xen PVHVM. Add a revision number for 4TB RAM support on amd64. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 07:58:46 2013 (r259763) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 08:22:08 2013 (r259764) @@ -125,7 +125,7 @@ amount of IPIs for shootdown on big-SMP machines and eliminating up to 25-30% of the system time on i/o intensive workloads. - The maximum amount of memory the &os; kernel + The maximum amount of memory the &os; kernel can address has been increased from 1TB to 4TB. A new &man.cpuset.2; API has been added @@ -177,6 +177,11 @@ scheduler is now the default process scheduler in GENERIC kernels. + Support was added for + the new Intel on-CPU Bull Mountain random number + generator, found on IvyBridge and supposedly later CPUs, + accessible with RDRAND instruction. + Virtualization support The BSD Hypervisor, &man.bhyve.8; is included @@ -208,6 +213,9 @@ hv_vmbus_load="YES" Al &man.vmx.4; is a VMware VMXNET3 ethernet driver ported from OpenBSD. + Xen PVHVM virtualization is now + part of the GENERIC kernel. + From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 08:43:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F02E2433; Mon, 23 Dec 2013 08:43:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CFF6915D8; Mon, 23 Dec 2013 08:43:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBN8hHl4077905; Mon, 23 Dec 2013 08:43:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBN8hHTx077901; Mon, 23 Dec 2013 08:43:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312230843.rBN8hHTx077901@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Dec 2013 08:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259765 - in head/sys: fs/nfsserver nfs nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 08:43:18 -0000 Author: mav Date: Mon Dec 23 08:43:16 2013 New Revision: 259765 URL: http://svnweb.freebsd.org/changeset/base/259765 Log: Fix RPC server threads file handle affinity to work better with ZFS. Instead of taking 8 specific bytes of file handle to identify file during RPC thread affitinity handling, use trivial hash of the full file handle. ZFS's struct zfid_short does not have padding field after the length field, as result, originally picked 8 bytes are loosing lower 16 bits of object ID, causing many false matches and unneeded requests affinity to same thread. This fix substantially improves NFS server latency and scalability in SPEC NFS benchmark by more flexible use of multiple NFS threads. Sponsored by: iXsystems, Inc. Modified: head/sys/fs/nfsserver/nfs_fha_new.c head/sys/nfs/nfs_fha.c head/sys/nfs/nfs_fha.h head/sys/nfsserver/nfs_fha_old.c Modified: head/sys/fs/nfsserver/nfs_fha_new.c ============================================================================== --- head/sys/fs/nfsserver/nfs_fha_new.c Mon Dec 23 08:22:08 2013 (r259764) +++ head/sys/fs/nfsserver/nfs_fha_new.c Mon Dec 23 08:43:16 2013 (r259765) @@ -41,7 +41,7 @@ static void fhanew_init(void *foo); static void fhanew_uninit(void *foo); rpcproc_t fhanew_get_procnum(rpcproc_t procnum); int fhanew_realign(struct mbuf **mb, int malloc_flags); -int fhanew_get_fh(fhandle_t *fh, int v3, struct mbuf **md, caddr_t *dpos); +int fhanew_get_fh(uint64_t *fh, int v3, struct mbuf **md, caddr_t *dpos); int fhanew_is_read(rpcproc_t procnum); int fhanew_is_write(rpcproc_t procnum); int fhanew_get_offset(struct mbuf **md, caddr_t *dpos, int v3, @@ -128,11 +128,13 @@ fhanew_realign(struct mbuf **mb, int mal } int -fhanew_get_fh(fhandle_t *fh, int v3, struct mbuf **md, caddr_t *dpos) +fhanew_get_fh(uint64_t *fh, int v3, struct mbuf **md, caddr_t *dpos) { struct nfsrv_descript lnd, *nd; uint32_t *tl; - int error, len; + uint8_t *buf; + uint64_t t; + int error, len, i; error = 0; len = 0; @@ -151,11 +153,13 @@ fhanew_get_fh(fhandle_t *fh, int v3, str len = NFSX_V2FH; } + t = 0; if (len != 0) { - NFSM_DISSECT_NONBLOCK(tl, uint32_t *, len); - bcopy(tl, fh, len); - } else - bzero(fh, sizeof(*fh)); + NFSM_DISSECT_NONBLOCK(buf, uint8_t *, len); + for (i = 0; i < len; i++) + t ^= ((uint64_t)buf[i] << (i & 7) * 8); + } + *fh = t; nfsmout: *md = nd->nd_md; Modified: head/sys/nfs/nfs_fha.c ============================================================================== --- head/sys/nfs/nfs_fha.c Mon Dec 23 08:22:08 2013 (r259764) +++ head/sys/nfs/nfs_fha.c Mon Dec 23 08:43:16 2013 (r259765) @@ -130,7 +130,6 @@ fha_extract_info(struct svc_req *req, st struct fha_callbacks *cb) { struct mbuf *md; - fhandle_t fh; caddr_t dpos; static u_int64_t random_fh = 0; int error; @@ -177,12 +176,10 @@ fha_extract_info(struct svc_req *req, st dpos = mtod(md, caddr_t); /* Grab the filehandle. */ - error = cb->get_fh(&fh, v3, &md, &dpos); + error = cb->get_fh(&i->fh, v3, &md, &dpos); if (error) goto out; - bcopy(fh.fh_fid.fid_data, &i->fh, sizeof(i->fh)); - /* Content ourselves with zero offset for all but reads. */ if (cb->is_read(procnum) || cb->is_write(procnum)) cb->get_offset(&md, &dpos, v3, i); Modified: head/sys/nfs/nfs_fha.h ============================================================================== --- head/sys/nfs/nfs_fha.h Mon Dec 23 08:22:08 2013 (r259764) +++ head/sys/nfs/nfs_fha.h Mon Dec 23 08:43:16 2013 (r259765) @@ -82,7 +82,7 @@ struct fha_info { struct fha_callbacks { rpcproc_t (*get_procnum)(rpcproc_t procnum); int (*realign)(struct mbuf **mb, int malloc_flags); - int (*get_fh)(fhandle_t *fh, int v3, struct mbuf **md, caddr_t *dpos); + int (*get_fh)(uint64_t *fh, int v3, struct mbuf **md, caddr_t *dpos); int (*is_read)(rpcproc_t procnum); int (*is_write)(rpcproc_t procnum); int (*get_offset)(struct mbuf **md, caddr_t *dpos, int v3, struct Modified: head/sys/nfsserver/nfs_fha_old.c ============================================================================== --- head/sys/nfsserver/nfs_fha_old.c Mon Dec 23 08:22:08 2013 (r259764) +++ head/sys/nfsserver/nfs_fha_old.c Mon Dec 23 08:43:16 2013 (r259765) @@ -49,7 +49,7 @@ static void fhaold_init(void *foo); static void fhaold_uninit(void *foo); rpcproc_t fhaold_get_procnum(rpcproc_t procnum); int fhaold_realign(struct mbuf **mb, int malloc_flags); -int fhaold_get_fh(fhandle_t *fh, int v3, struct mbuf **md, caddr_t *dpos); +int fhaold_get_fh(uint64_t *fh, int v3, struct mbuf **md, caddr_t *dpos); int fhaold_is_read(rpcproc_t procnum); int fhaold_is_write(rpcproc_t procnum); int fhaold_get_offset(struct mbuf **md, caddr_t *dpos, int v3, @@ -135,9 +135,33 @@ fhaold_realign(struct mbuf **mb, int mal } int -fhaold_get_fh(fhandle_t *fh, int v3, struct mbuf **md, caddr_t *dpos) +fhaold_get_fh(uint64_t *fh, int v3, struct mbuf **md, caddr_t *dpos) { - return (nfsm_srvmtofh_xx(fh, v3, md, dpos)); + u_int32_t *tl; + uint8_t *buf; + uint64_t t; + int fhlen, i; + + if (v3) { + tl = nfsm_dissect_xx_nonblock(NFSX_UNSIGNED, md, dpos); + if (tl == NULL) + return EBADRPC; + fhlen = fxdr_unsigned(int, *tl); + if (fhlen != 0 && fhlen != NFSX_V3FH) + return EBADRPC; + } else { + fhlen = NFSX_V2FH; + } + t = 0; + if (fhlen != 0) { + buf = nfsm_dissect_xx_nonblock(fhlen, md, dpos); + if (buf == NULL) + return EBADRPC; + for (i = 0; i < fhlen; i++) + t ^= ((uint64_t)buf[i] << (i & 7) * 8); + } + *fh = t; + return 0; } int From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 08:57:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E138678F; Mon, 23 Dec 2013 08:57:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CCC811675; Mon, 23 Dec 2013 08:57:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBN8vnS4082091; Mon, 23 Dec 2013 08:57:49 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBN8vn1C082090; Mon, 23 Dec 2013 08:57:49 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312230857.rBN8vn1C082090@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 23 Dec 2013 08:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259766 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 08:57:50 -0000 Author: rodrigc Date: Mon Dec 23 08:57:49 2013 New Revision: 259766 URL: http://svnweb.freebsd.org/changeset/base/259766 Log: Mention that sysinstall is gone, replaced by bsdinstall and bsdconfig. Mention that bsdinstall supports installing ZFS on root. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 08:43:16 2013 (r259765) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 08:57:49 2013 (r259766) @@ -415,6 +415,13 @@ hv_vmbus_load="YES" Al ZFS + &man.bsdinstall.8; now supports installing + ZFS on the root file system. It includes a single configuration menu + that allows you to select all of the required details, including + which drives to use, what ZFS RAID level to use (taking into consideration + the selected number of drives), GPT or MBR, GELI encryption, forcing 4K sectors, + pool name, etc. + TRIM support has been added for ZFS. @@ -469,6 +476,9 @@ hv_vmbus_load="YES" Al nslookup and dig can be obtained by installing the dns/bind-tools port. + sysinstall has been removed from the base system. + sysinstall has been replaced by &man.bsdinstall.8; and &man.bsdconfig.8;. + The &man.adduser.8; utility now supports a option to set the mode of a new user's home directory. From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 11:03:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74A7A25A; Mon, 23 Dec 2013 11:03:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 533A81131; Mon, 23 Dec 2013 11:03:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNB3co5026321; Mon, 23 Dec 2013 11:03:38 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNB3c3F026320; Mon, 23 Dec 2013 11:03:38 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312231103.rBNB3c3F026320@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 23 Dec 2013 11:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259767 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 11:03:38 -0000 Author: rodrigc Date: Mon Dec 23 11:03:37 2013 New Revision: 259767 URL: http://svnweb.freebsd.org/changeset/base/259767 Log: Updates for various userland tools. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 08:57:49 2013 (r259766) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 11:03:37 2013 (r259767) @@ -477,8 +477,30 @@ hv_vmbus_load="YES" Al dns/bind-tools port. sysinstall has been removed from the base system. - sysinstall has been replaced by &man.bsdinstall.8; and &man.bsdconfig.8;. - + Auxiliary libraries and tools used by sysinstall such as libdisk, libftpio, + and sade have also been removed. sysinstall has been replaced by + &man.bsdinstall.8; and &man.bsdconfig.8;. + + &man.freebsd-version.1; has been added. This tool + makes a best effort to determine the version and patch level of + the installed kernel and userland. + + GNU patch has been removed from the base system, and replaced + by a BSD-licensed &man.patch.1; program. + + GNU sort has been removed from the base system, and replaced + by a BSD-licensed &man.sort.1; program. + + Berkely yacc (byacc) has been imported + from invisible island. + This brings bison compatibilities to &man.yacc.1; while preserving full + backwards compatibility with previous version of &man.yacc.1;. + + &man.lex.1; has been replaced by flex 2.5.37 + + &man.make.1; has been replaced with the + "Portable" BSD make tool (bmake) from NetBSD. + The &man.adduser.8; utility now supports a option to set the mode of a new user's home directory. @@ -611,29 +633,32 @@ hv_vmbus_load="YES" Al bzip2 has been updated from 1.0.4 to 1.0.5. - CVS has been removed from the + CVS has been removed from the base system, but is still available from ports - FILE has been updated from 4.23 - to 5.03. + Subversion has been imported into the base system and + is installed as svnlite. svnlite + should only be used for checking out &os; source and committing, and does not + replace the full Subversion port. + + file has been updated to 5.11. - hostapd has been + hostapd has been updated from 0.5.8 to 0.5.10. - IPFilter has been updated from - 4.1.23 to 4.1.28. + IPFilter has been updated to 5.1.2. - less has been updated from - v408 to v429. + less has been updated to + v458. ncurses has been updated from - 5.6-20061217 to 5.6-20080503. + to 5.7-20081102. OpenSSH has been updated - from 4.5p1 to 5.1p1. + to 6.4. - OpenPAM has been updated from the - Figwort release to the Hydrangea release. + OpenPAM has been updated to + the Micrampelis release. sendmail has been updated from 8.14.1 to 8.14.7. @@ -649,12 +674,16 @@ hv_vmbus_load="YES" Al then please run &man.tzsetup.8; to install a new /etc/localtime. - WPA Supplicant has been - updated from 0.5.8 to 0.5.10. + WPA Supplicant has been + updated to 2.0. xz has been updated from snapshot as of 12 April 2010 to 5.0.0. + &man.nvi.1; has been updated to 2.1.2. + + &man.nvi.1; supports wide character locales. + From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 11:14:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F674FD; Mon, 23 Dec 2013 11:14:56 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8EDDA13D6; Mon, 23 Dec 2013 11:14:55 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBNBEo4V084118; Mon, 23 Dec 2013 13:14:50 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBNBEo4V084118 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBNBEoO4084117; Mon, 23 Dec 2013 13:14:50 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 23 Dec 2013 13:14:50 +0200 From: Konstantin Belousov To: Alexander Motin Subject: Re: svn commit: r259765 - in head/sys: fs/nfsserver nfs nfsserver Message-ID: <20131223111450.GB59496@kib.kiev.ua> References: <201312230843.rBN8hHTx077901@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tI9MNtoWUQpHAhYF" Content-Disposition: inline In-Reply-To: <201312230843.rBN8hHTx077901@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 11:14:56 -0000 --tI9MNtoWUQpHAhYF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 23, 2013 at 08:43:17AM +0000, Alexander Motin wrote: > Author: mav > Date: Mon Dec 23 08:43:16 2013 > New Revision: 259765 > URL: http://svnweb.freebsd.org/changeset/base/259765 >=20 > Log: > Fix RPC server threads file handle affinity to work better with ZFS. > =20 > Instead of taking 8 specific bytes of file handle to identify file du= ring > RPC thread affitinity handling, use trivial hash of the full file handl= e. > ZFS's struct zfid_short does not have padding field after the length fi= eld, > as result, originally picked 8 bytes are loosing lower 16 bits of objec= t ID, > causing many false matches and unneeded requests affinity to same threa= d. > This fix substantially improves NFS server latency and scalability in= SPEC > NFS benchmark by more flexible use of multiple NFS threads. > =20 > Sponsored by: iXsystems, Inc. Did you audited all other filesystems to ensure that struct fid. fid_data0 is filled (zeroed) consistently ? Also, this constitues subtle VFS KBI change. --tI9MNtoWUQpHAhYF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSuBspAAoJEJDCuSvBvK1BwMEP+wamI6B68N8YfFdv6dNGtfQC rKefbACswFJqM4XPFtQ/i0GbWXlcyAldlsSnAzw9goqkIq19uumr7q514SCHckQ5 TGdDoIC1GOXsSisbUU6Qjl1wJgDy7YqNn+CFCWI8DYsD65Dq2W+jZMWgNsJoWWA7 j5PLQcyBVuBNeXy+oQnOaBBXtCRDnSct0HVibAUFheWOwR+gerxvGpo2QJAMs7d+ LziMnnZAgbnDdFidYU+DaL4M1QzfYNVT2plcKE0ZObhxdjWT+0qCU+MjzwK7Th3d 5WOGDJsDbHkta1iOzA1bE0n3DuGN102pr2agIHPru9l23p8AuQNAhHyQAb7YZ5Mc p234zWzJksfI/lZ4mV3QH9LutPmKSdsWOC5VpEJ6glK9K3iyiwor5z7twmRr9+7F lxbUtiJF7G7WTxCrFI9vuQiAfPecf7L1Fk5qw1fOpUyEjiCI0wzCzeC0dhwXNoEU XJfamXWgLWnAlskNY6oFcfnL/u47TpVwCzuMOx/54p25XB+/3zSoo2WWF/l4LtvL +wNOwunAYVB3zci5gOM9ZEvo11kJ/LR19mSIQEEWlN6MSqH7Y8AFdhdQM9Lk328F N6T5A+502OKWiMlG9oQZg1zeJ41TKQoUVHcDcj1th6MK0gTwaMhlEeQ+r6VP4uID NNIUreOqK2Y2qpE69Vbe =z3J2 -----END PGP SIGNATURE----- --tI9MNtoWUQpHAhYF-- From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 11:35:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F39551D; Mon, 23 Dec 2013 11:35:57 +0000 (UTC) Received: from mail-ea0-x233.google.com (mail-ea0-x233.google.com [IPv6:2a00:1450:4013:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4AB5E1554; Mon, 23 Dec 2013 11:35:56 +0000 (UTC) Received: by mail-ea0-f179.google.com with SMTP id r15so2279281ead.24 for ; Mon, 23 Dec 2013 03:35:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/K5RpAobSt7ks66/YYCrzp82e+9yGRF55tzgOQ7Eay0=; b=U+Uw4FXYY2huYwz7vHkfo5NzlDKvBWpNHJ4fKHibVuB2jZ5CHacLs+KO4Tg0Z36reg J4SqVw5p54sN3rfsNQmSazt4pQFdCOPL9/aRWYyPKyil8RDRU3tQj5W/bfP/zQouPr1/ WcSXUrLuX167y5Q6Iovpcm/auK2S8lGDscTQud5UBPLJ3lRASsOe9hZ1DrwsVIchEe5Y +lXAsGQ7+Dprs/rbQeQ6QB/C0iCatPQZEESSa+cPjUBb5/KgcY/K7JSd5cYyPhBVpfAo 8FyfuMKjz2F4I2NiYnB6mOhEor8RVFHvQPMCk7pjFF4AGpsq3MXNSLjO90P6iOFBCcmN Uq3w== X-Received: by 10.14.184.66 with SMTP id r42mr617586eem.86.1387798554596; Mon, 23 Dec 2013 03:35:54 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id v1sm44766781eef.9.2013.12.23.03.35.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 03:35:53 -0800 (PST) Sender: Alexander Motin Message-ID: <52B82017.1040706@FreeBSD.org> Date: Mon, 23 Dec 2013 13:35:51 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r259765 - in head/sys: fs/nfsserver nfs nfsserver References: <201312230843.rBN8hHTx077901@svn.freebsd.org> <20131223111450.GB59496@kib.kiev.ua> In-Reply-To: <20131223111450.GB59496@kib.kiev.ua> 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 11:35:57 -0000 On 23.12.2013 13:14, Konstantin Belousov wrote: > On Mon, Dec 23, 2013 at 08:43:17AM +0000, Alexander Motin wrote: >> Author: mav >> Date: Mon Dec 23 08:43:16 2013 >> New Revision: 259765 >> URL: http://svnweb.freebsd.org/changeset/base/259765 >> >> Log: >> Fix RPC server threads file handle affinity to work better with ZFS. >> >> Instead of taking 8 specific bytes of file handle to identify file during >> RPC thread affitinity handling, use trivial hash of the full file handle. >> ZFS's struct zfid_short does not have padding field after the length field, >> as result, originally picked 8 bytes are loosing lower 16 bits of object ID, >> causing many false matches and unneeded requests affinity to same thread. >> This fix substantially improves NFS server latency and scalability in SPEC >> NFS benchmark by more flexible use of multiple NFS threads. >> >> Sponsored by: iXsystems, Inc. > > Did you audited all other filesystems to ensure that struct fid. > fid_data0 is filled (zeroed) consistently ? Yes, I did a tree search and in all found cases the structure was pre-erased. > Also, this constitues subtle VFS KBI change. In what way it touched VFS KBI? I indeed modified RPC FHA KPI to make it more safe, but I don't see how it may touch anything else then two of our NFS servers. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 11:51:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8771C8BF; Mon, 23 Dec 2013 11:51:00 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 281C91659; Mon, 23 Dec 2013 11:50:59 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBNBot9t092641; Mon, 23 Dec 2013 13:50:55 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBNBot9t092641 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBNBotXE092640; Mon, 23 Dec 2013 13:50:55 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 23 Dec 2013 13:50:55 +0200 From: Konstantin Belousov To: Alexander Motin Subject: Re: svn commit: r259765 - in head/sys: fs/nfsserver nfs nfsserver Message-ID: <20131223115055.GC59496@kib.kiev.ua> References: <201312230843.rBN8hHTx077901@svn.freebsd.org> <20131223111450.GB59496@kib.kiev.ua> <52B82017.1040706@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="80KblFqI5cx0eMF+" Content-Disposition: inline In-Reply-To: <52B82017.1040706@FreeBSD.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 11:51:00 -0000 --80KblFqI5cx0eMF+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 23, 2013 at 01:35:51PM +0200, Alexander Motin wrote: > On 23.12.2013 13:14, Konstantin Belousov wrote: > > On Mon, Dec 23, 2013 at 08:43:17AM +0000, Alexander Motin wrote: > >> Author: mav > >> Date: Mon Dec 23 08:43:16 2013 > >> New Revision: 259765 > >> URL: http://svnweb.freebsd.org/changeset/base/259765 > >> > >> Log: > >> Fix RPC server threads file handle affinity to work better with ZFS. > >> > >> Instead of taking 8 specific bytes of file handle to identify fil= e during > >> RPC thread affitinity handling, use trivial hash of the full file h= andle. > >> ZFS's struct zfid_short does not have padding field after the lengt= h field, > >> as result, originally picked 8 bytes are loosing lower 16 bits of o= bject ID, > >> causing many false matches and unneeded requests affinity to same t= hread. > >> This fix substantially improves NFS server latency and scalabilit= y in SPEC > >> NFS benchmark by more flexible use of multiple NFS threads. > >> > >> Sponsored by: iXsystems, Inc. > > > > Did you audited all other filesystems to ensure that struct fid. > > fid_data0 is filled (zeroed) consistently ? >=20 > Yes, I did a tree search and in all found cases the structure was=20 > pre-erased. I.e. you checked all in-tree VOP_VPTOFH implementations, right ? >=20 > > Also, this constitues subtle VFS KBI change. >=20 > In what way it touched VFS KBI? I indeed modified RPC FHA KPI to make it= =20 > more safe, but I don't see how it may touch anything else then two of=20 > our NFS servers. See above, it is now required to ensure that fid_data0 is zeroed, for filesystems which only fill fid_data. --80KblFqI5cx0eMF+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSuCOeAAoJEJDCuSvBvK1BHfUP/0rNbkR7C3N60lPd0NAHl3Wu 19zB7p0SPtVtUmtJf5KuSQL3gSCLuKp3jeHzgGIS1+l/feL37nzRVvR91JAiFqgX krso2QQ/chgxHlAdLGgvTx7UIb1Ppbcw3LbUe2TLD54YLMSSlZ17ADsCOt3Imjcz tbZqrGH54P9GZ7lJbnNUzYrhnrSKwzRb2JHZM92N14lOCN+8vetIjI4ABkGyjBlS 9SYEdfqWCKRqKdpFaQTJ4oQDL78eLYLugHbXwVn3dgYuZGMfiTPvW20D9i+K60na LqPaMPPKkGiuZAS61Qdpo8VUiXCG6aHGfFGQOzH61X33s2iX6t1ziQnNdCCoE7uX Jtz8DdKfO7hKb9Cn4juuSz0YcjSQgReSQiE0+Lw16E8+5jovizAo5GI9X0iK+I3V ofHjQIEr7AYApSQf+fdtrVq84bq9f8DZzzAxHYlQIpz2rt8nb154RJT1wK2hnDlX 3CQJ3nQQg4snpTMGSw5VNBdAmuTfESXki0Tkgm4YKiUPR7b4pZQGWffljrVHe1i1 Z+6Nj4W/LrgBznSQ0VkiPV6aUzfgsvzwpmckul6KU+qrfhI//+32JWEH/ixXPmUa QobaO7dir0rACCMLMtgkvioVp8v14CHPEPm7T00qG8bTlcQmM5hQ2Wd8H5hY4hbd D5w5USVVFBoymosAPK2B =jvNy -----END PGP SIGNATURE----- --80KblFqI5cx0eMF+-- From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 11:55:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E599AA33; Mon, 23 Dec 2013 11:55:55 +0000 (UTC) Received: from mail-ee0-x233.google.com (mail-ee0-x233.google.com [IPv6:2a00:1450:4013:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A734167D; Mon, 23 Dec 2013 11:55:55 +0000 (UTC) Received: by mail-ee0-f51.google.com with SMTP id b15so2293397eek.38 for ; Mon, 23 Dec 2013 03:55:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=FQfo+oMDNHx7w774Z35NCOfniOpMgp2S4Socnzw6ncE=; b=CGL1o7GmkDc6EZv5DIH9OoY/A/it1nfq7rBndtkEDctmXpuW/Cp3YRVY+MNXjbhIcm 11GgHOPLBlK/vnKDUm7GdbE1HV+uBKzOXyvTNhvZcxXYwByEOKomjssFlhOqSRybLfqt NB+QVyr5yGW4OYLAA2Atc94XMvwykLYN6DxUr4xPtQ2/GglRygwMiyVJgTDk09VfCvr+ Ac416VDiS7biQl/9JlBotYrYiqwbIweo0rxBZXOxnbCFpysCHOq/M77PdUDFMNzcOXXq DdhfwnfYMyoRHG/jecdB2KbLDrGOudyxTJIYd2UcGYZJuGqP/7sljlBf8cwb7rMcT+1T /8zg== X-Received: by 10.15.74.200 with SMTP id j48mr82508eey.102.1387799753491; Mon, 23 Dec 2013 03:55:53 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id a51sm44906364eeh.8.2013.12.23.03.55.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 03:55:52 -0800 (PST) Sender: Alexander Motin Message-ID: <52B824C5.1020804@FreeBSD.org> Date: Mon, 23 Dec 2013 13:55:49 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r259765 - in head/sys: fs/nfsserver nfs nfsserver References: <201312230843.rBN8hHTx077901@svn.freebsd.org> <20131223111450.GB59496@kib.kiev.ua> <52B82017.1040706@FreeBSD.org> <20131223115055.GC59496@kib.kiev.ua> In-Reply-To: <20131223115055.GC59496@kib.kiev.ua> 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 11:55:56 -0000 On 23.12.2013 13:50, Konstantin Belousov wrote: > On Mon, Dec 23, 2013 at 01:35:51PM +0200, Alexander Motin wrote: >> On 23.12.2013 13:14, Konstantin Belousov wrote: >>> On Mon, Dec 23, 2013 at 08:43:17AM +0000, Alexander Motin wrote: >>>> Author: mav >>>> Date: Mon Dec 23 08:43:16 2013 >>>> New Revision: 259765 >>>> URL: http://svnweb.freebsd.org/changeset/base/259765 >>>> >>>> Log: >>>> Fix RPC server threads file handle affinity to work better with ZFS. >>>> >>>> Instead of taking 8 specific bytes of file handle to identify file during >>>> RPC thread affitinity handling, use trivial hash of the full file handle. >>>> ZFS's struct zfid_short does not have padding field after the length field, >>>> as result, originally picked 8 bytes are loosing lower 16 bits of object ID, >>>> causing many false matches and unneeded requests affinity to same thread. >>>> This fix substantially improves NFS server latency and scalability in SPEC >>>> NFS benchmark by more flexible use of multiple NFS threads. >>>> >>>> Sponsored by: iXsystems, Inc. >>> >>> Did you audited all other filesystems to ensure that struct fid. >>> fid_data0 is filled (zeroed) consistently ? >> >> Yes, I did a tree search and in all found cases the structure was >> pre-erased. > I.e. you checked all in-tree VOP_VPTOFH implementations, right ? I checked all call places of VOP_VPTOFH and VOP_FID in a tree. As I can see these structures are normally pre-erased by callers. >>> Also, this constitues subtle VFS KBI change. >> >> In what way it touched VFS KBI? I indeed modified RPC FHA KPI to make it >> more safe, but I don't see how it may touch anything else then two of >> our NFS servers. > > See above, it is now required to ensure that fid_data0 is zeroed, for > filesystems which only fill fid_data. I believe the only that really important is that NFS itself erases the structure before calling these VFS methods. But I'll recheck NFS code once more just to be sure. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 14:23:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37785B55; Mon, 23 Dec 2013 14:23:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 235DA10DE; Mon, 23 Dec 2013 14:23:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNENIZL098229; Mon, 23 Dec 2013 14:23:18 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNENHNZ098227; Mon, 23 Dec 2013 14:23:17 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201312231423.rBNENHNZ098227@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 23 Dec 2013 14:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259769 - in head/kerberos5/lib: . libkafs5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 14:23:18 -0000 Author: uqs Date: Mon Dec 23 14:23:17 2013 New Revision: 259769 URL: http://svnweb.freebsd.org/changeset/base/259769 Log: Try and fix the dependency/bootstrap issues in kerberos5 libkafs5 needs a header from libkrb5, it includes this from ${.OBJDIR}/mumble, this used to work fine as long as you happen to have a krb_err.h in your base system, this doesn't work for bootstrapping or using a cross-compiler with a different sysroot. This is just a best-effort bandaid, sufficient parallelism can still break it. Fix a SRCS override that dropped krb5_err.h. Discussed with: stas Modified: head/kerberos5/lib/Makefile head/kerberos5/lib/libkafs5/Makefile Modified: head/kerberos5/lib/Makefile ============================================================================== --- head/kerberos5/lib/Makefile Mon Dec 23 11:48:22 2013 (r259768) +++ head/kerberos5/lib/Makefile Mon Dec 23 14:23:17 2013 (r259769) @@ -2,7 +2,9 @@ # $FreeBSD$ SUBDIR= libasn1 libgssapi_krb5 libgssapi_ntlm libgssapi_spnego libhdb \ - libheimntlm libhx509 libkadm5clnt libkadm5srv libkafs5 libkrb5 \ + libheimntlm libhx509 libkadm5clnt libkadm5srv libkrb5 \ libroken libsl libvers libkdc libwind libheimsqlite libheimbase libheimipcc libheimipcs +SUBDIR+= libkafs5 # requires krb_err.h from libkrb5 + .include Modified: head/kerberos5/lib/libkafs5/Makefile ============================================================================== --- head/kerberos5/lib/libkafs5/Makefile Mon Dec 23 11:48:22 2013 (r259768) +++ head/kerberos5/lib/libkafs5/Makefile Mon Dec 23 14:23:17 2013 (r259769) @@ -24,9 +24,6 @@ MLINKS= kafs5.3 k_afs_cell_of_file.3 \ kafs5.3 krb_afslog_uid.3 SRCS= afssys.c afskrb5.c common.c krb5_err.h -SRCS= afssys.c \ - afskrb5.c \ - common.c CFLAGS+= -I${KRB5DIR}/lib/kafs \ -I${KRB5DIR}/lib/krb5 \ From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 15:00:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BD1F697; Mon, 23 Dec 2013 15:00:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7777B1381; Mon, 23 Dec 2013 15:00:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNF0GYc009818; Mon, 23 Dec 2013 15:00:16 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNF0G99009816; Mon, 23 Dec 2013 15:00:16 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201312231500.rBNF0G99009816@svn.freebsd.org> From: Joel Dahl Date: Mon, 23 Dec 2013 15:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259770 - in head: share/man/man4 usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 15:00:16 -0000 Author: joel (doc committer) Date: Mon Dec 23 15:00:15 2013 New Revision: 259770 URL: http://svnweb.freebsd.org/changeset/base/259770 Log: mdoc: nuke whitespace. Modified: head/share/man/man4/cxgbe.4 head/usr.sbin/bhyve/bhyve.8 Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Mon Dec 23 14:23:17 2013 (r259769) +++ head/share/man/man4/cxgbe.4 Mon Dec 23 15:00:15 2013 (r259770) @@ -71,7 +71,6 @@ Note that ports of T5 cards are named cx Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 cards. The sysctl MIBs are at dev.t5nex and dev.cxl for T5 cards and at dev.t4nex and dev.cxgbe for T4 cards. - .Pp For more information on configuring this device, see .Xr ifconfig 8 . Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Mon Dec 23 14:23:17 2013 (r259769) +++ head/usr.sbin/bhyve/bhyve.8 Mon Dec 23 15:00:15 2013 (r259770) @@ -229,7 +229,7 @@ Force .Nm to exit when a guest issues an access to an I/O port that is not emulated. This is intended for debug purposes. -.It Fl w +.It Fl w Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes. .It Fl h Print help message and exit. From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 15:16:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D55E8A59; Mon, 23 Dec 2013 15:16:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5A9E1499; Mon, 23 Dec 2013 15:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNFGrVa016865; Mon, 23 Dec 2013 15:16:53 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNFGr9o016864; Mon, 23 Dec 2013 15:16:53 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201312231516.rBNFGr9o016864@svn.freebsd.org> From: Rick Macklem Date: Mon, 23 Dec 2013 15:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259771 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 15:16:54 -0000 Author: rmacklem Date: Mon Dec 23 15:16:53 2013 New Revision: 259771 URL: http://svnweb.freebsd.org/changeset/base/259771 Log: The NFSv4.1 client didn't return NFSv4.1 specific error codes for the Getattr and Recall callbacks. This patch fixes it. Since the NFSv4.1 specific error codes would only happen for abnormal circumstances, this patch has little effect, in practice. MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Mon Dec 23 15:00:15 2013 (r259770) +++ head/sys/fs/nfsclient/nfs_clstate.c Mon Dec 23 15:16:53 2013 (r259771) @@ -146,7 +146,7 @@ static int nfscl_trylock(struct nfsmount static int nfsrpc_reopen(struct nfsmount *, u_int8_t *, int, u_int32_t, struct nfsclopen *, struct nfscldeleg **, struct ucred *, NFSPROC_T *); static void nfscl_freedeleg(struct nfscldeleghead *, struct nfscldeleg *); -static int nfscl_errmap(struct nfsrv_descript *); +static int nfscl_errmap(struct nfsrv_descript *, u_int32_t); static void nfscl_cleanup_common(struct nfsclclient *, u_int8_t *); static int nfscl_recalldeleg(struct nfsclclient *, struct nfsmount *, struct nfscldeleg *, vnode_t, struct ucred *, NFSPROC_T *, int); @@ -3146,7 +3146,7 @@ nfscl_docb(struct nfsrv_descript *nd, NF struct nfsclclient *clp; struct nfscldeleg *dp = NULL; int numops, taglen = -1, error = 0, trunc; - u_int32_t minorvers, retops = 0, *retopsp = NULL, *repp, cbident; + u_int32_t minorvers = 0, retops = 0, *retopsp = NULL, *repp, cbident; u_char tag[NFSV4_SMALLSTR + 1], *tagstr; vnode_t vp = NULL; struct nfsnode *np; @@ -3210,7 +3210,7 @@ nfscl_docb(struct nfsrv_descript *nd, NF (op > NFSV4OP_CBNOTIFYDEVID && minorvers == NFSV41_MINORVERSION)) { nd->nd_repstat = NFSERR_OPILLEGAL; - *repp = nfscl_errmap(nd); + *repp = nfscl_errmap(nd, minorvers); retops++; break; } @@ -3518,7 +3518,7 @@ nfscl_docb(struct nfsrv_descript *nd, NF } retops++; if (nd->nd_repstat) { - *repp = nfscl_errmap(nd); + *repp = nfscl_errmap(nd, minorvers); break; } else *repp = 0; /* NFS4_OK */ @@ -3539,7 +3539,7 @@ nfsmout: } else { *retopsp = txdr_unsigned(retops); } - *nd->nd_errp = nfscl_errmap(nd); + *nd->nd_errp = nfscl_errmap(nd, minorvers); out: if (gotseq_ok != 0) { rep = m_copym(nd->nd_mreq, 0, M_COPYALL, M_WAITOK); @@ -4645,7 +4645,7 @@ nfscl_deleggetmodtime(vnode_t vp, struct } static int -nfscl_errmap(struct nfsrv_descript *nd) +nfscl_errmap(struct nfsrv_descript *nd, u_int32_t minorvers) { short *defaulterrp, *errp; @@ -4658,6 +4658,11 @@ nfscl_errmap(struct nfsrv_descript *nd) if (nd->nd_repstat == NFSERR_MINORVERMISMATCH || nd->nd_repstat == NFSERR_OPILLEGAL) return (txdr_unsigned(nd->nd_repstat)); + if (nd->nd_repstat >= NFSERR_BADIOMODE && nd->nd_repstat < 20000 && + minorvers > NFSV4_MINORVERSION) { + /* NFSv4.n error. */ + return (txdr_unsigned(nd->nd_repstat)); + } if (nd->nd_procnum < NFSV4OP_CBNOPS) errp = defaulterrp = nfscl_cberrmap[nd->nd_procnum]; else From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 16:18:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA93C77C; Mon, 23 Dec 2013 16:18:41 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C44018BC; Mon, 23 Dec 2013 16:18:41 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A5064B979; Mon, 23 Dec 2013 11:18:40 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r259562 - head/usr.bin/netstat Date: Mon, 23 Dec 2013 11:18:33 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312181825.rBIIPR25014515@svn.freebsd.org> <201312191552.04202.jhb@freebsd.org> <20131220002849.GH71033@FreeBSD.org> In-Reply-To: <20131220002849.GH71033@FreeBSD.org> MIME-Version: 1.0 Message-Id: <201312231118.34054.jhb@freebsd.org> Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 23 Dec 2013 11:18:40 -0500 (EST) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, "Alexander V. Chernikov" , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 16:18:42 -0000 On Thursday, December 19, 2013 7:28:50 pm Gleb Smirnoff wrote: > John, > > On Thu, Dec 19, 2013 at 03:52:03PM -0500, John Baldwin wrote: > J> > J> Please don't gratuitiously break things that /usr/sbin/crashinfo runs. It's > J> > J> fine if kvm mode is fragile and requires the binary to be in sync with the > J> > J> kernel and is only used for crash dumps, but it is very useful to extract > J> > J> all sorts of info out of a crash dump. > J> > > J> > The problem is that these tools (netstat, and some others) prevent us from > J> > improving the kernel network stack. We can't make improvements that are > J> > mergeable to stable/x branch, since the tools would be broken. > J> > J> No, I explicitly said "it's fine if the kvm mode is fragile and requires the > J> binary to be in sync and is only used for crash dumps". That means it's > J> fine to merge changes as long as you merge the whole thing together. It also > J> means you don't have to support all possible internal kernel ABIs in a branch. > > Sorry but this is not true. Yeah, I'm grateful that you personally allow me to > break ABIs, but the general FreeBSD project policy doesn't allow that anymore > in stable branches. No. Not all ABIs have the same guarantee and this has _always_ been true. ABIs for external symbols in shared libraries: yes. Some ABIs used by kernel modules (like VFS and things ifnet drivers use, cvdevsw, etc.): yes. Various other in-kernel ABIs: no. Implementation details of internal data structures that are only examined by tools using kvm: no. This isn't a new policy, this is the one we've actually had over the past N years. In terms of rewriting this in some other language: you could use CTF to handle structure layout changes transparently, but recompiling C does that as well. However, simply writing things in gdb script or D will not magically parse changes to the data structures themselves. That will require the same level of work to maintain. And while I can certainly hack on gdb scripts, the language for it is horrible compared to C. No switch statements, no break or continue for loops, etc. You can't possibly tell me gdb is comparable to C in that regard. Take this for example to output the type of a vnode: # vtypename # helper function for vprint define vtypename if ($arg0 == VNON) printf "VNON" else if ($arg0 == VREG) printf "VREG" else if ($arg0 == VDIR) printf "VDIR" else if ($arg0 == VBLK) printf "VBLK" else if ($arg0 == VCHR) printf "VCHR" else if ($arg0 == VLNK) printf "VLNK" else if ($arg0 == VSOCK) printf "VSOCK" else if ($arg0 == VFIFO) printf "VFIFO" else if ($arg0 == VBAD) printf "VBAD" else if ($arg0 == VMARKER) printf "VMARKER" else printf "V??:%d", $arg0 end end end end end end end end end end end I don't imagine anyone hinks that is as readable as the equivalent switch statement in C. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 17:14:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4289E84D; Mon, 23 Dec 2013 17:14:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A44E1E2C; Mon, 23 Dec 2013 17:14:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNHEC7U059329; Mon, 23 Dec 2013 17:14:12 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNHEC1x059328; Mon, 23 Dec 2013 17:14:12 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201312231714.rBNHEC1x059328@svn.freebsd.org> From: Ed Maste Date: Mon, 23 Dec 2013 17:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259772 - head/tools/tools/vt/mkkfont X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 17:14:12 -0000 Author: emaste Date: Mon Dec 23 17:14:11 2013 New Revision: 259772 URL: http://svnweb.freebsd.org/changeset/base/259772 Log: Output all {normal,bold} {left,right} maps This change was missed in r259680. Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/vt/mkkfont/mkkfont.c Modified: head/tools/tools/vt/mkkfont/mkkfont.c ============================================================================== --- head/tools/tools/vt/mkkfont/mkkfont.c Mon Dec 23 15:16:53 2013 (r259771) +++ head/tools/tools/vt/mkkfont/mkkfont.c Mon Dec 23 17:14:11 2013 (r259772) @@ -154,6 +154,7 @@ int main(int argc __unused, char *argv[] __unused) { struct file_header fh; + unsigned int i; if (fread(&fh, sizeof fh, 1, stdin) != 1) { perror("file_header"); @@ -169,10 +170,9 @@ main(int argc __unused, char *argv[] __u if (print_glyphs(&fh) != 0) return (1); - if (print_mappings(&fh, 0) != 0) - return (1); - if (print_mappings(&fh, 1) != 0) - return (1); + for (i = 0; i < 4; i++) + if (print_mappings(&fh, i) != 0) + return (1); if (print_info(&fh) != 0) return (1); From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 17:16:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B27EFB96; Mon, 23 Dec 2013 17:16:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9ED0F1E6B; Mon, 23 Dec 2013 17:16:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNHGidT059757; Mon, 23 Dec 2013 17:16:44 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNHGiMv059756; Mon, 23 Dec 2013 17:16:44 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201312231716.rBNHGiMv059756@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 23 Dec 2013 17:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259773 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 17:16:44 -0000 Author: bapt Date: Mon Dec 23 17:16:44 2013 New Revision: 259773 URL: http://svnweb.freebsd.org/changeset/base/259773 Log: Do not print a question in non-interractive mode but explain why boostrapping has failed and how to allow it to happen Reported by: jmmv Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Mon Dec 23 17:14:11 2013 (r259772) +++ head/usr.sbin/pkg/pkg.c Mon Dec 23 17:16:44 2013 (r259773) @@ -821,6 +821,11 @@ static const char confirmation_message[] "The package management tool is not yet installed on your system.\n" "Do you want to fetch and install it now? [y/N]: "; +static const char non_interractive_message[] = +"The package management tool is not yet installed on your system.\n" +"Please set ASSUME_ALWAYS_YES=yes environement variable to be able to boostrap " +"in non-interractive (stdin not being a tty)\n"; + static int pkg_query_yes_no(void) { @@ -939,10 +944,12 @@ main(int argc, char *argv[]) */ config_bool(ASSUME_ALWAYS_YES, &yes); if (!yes) { - printf("%s", confirmation_message); - if (!isatty(fileno(stdin))) + if (!isatty(fileno(stdin))) { + fprintf(stderr, non_interractive_message); exit(EXIT_FAILURE); + } + printf("%s", confirmation_message); if (pkg_query_yes_no() == 0) exit(EXIT_FAILURE); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 17:26:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43317F5D; Mon, 23 Dec 2013 17:26:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F6421F25; Mon, 23 Dec 2013 17:26:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNHQvZC063357; Mon, 23 Dec 2013 17:26:57 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNHQv9U063356; Mon, 23 Dec 2013 17:26:57 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201312231726.rBNHQv9U063356@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 23 Dec 2013 17:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259774 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 17:26:57 -0000 Author: bapt Date: Mon Dec 23 17:26:56 2013 New Revision: 259774 URL: http://svnweb.freebsd.org/changeset/base/259774 Log: Fix typos Reported by: bryanv Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Mon Dec 23 17:16:44 2013 (r259773) +++ head/usr.sbin/pkg/pkg.c Mon Dec 23 17:26:56 2013 (r259774) @@ -821,10 +821,10 @@ static const char confirmation_message[] "The package management tool is not yet installed on your system.\n" "Do you want to fetch and install it now? [y/N]: "; -static const char non_interractive_message[] = +static const char non_interactive_message[] = "The package management tool is not yet installed on your system.\n" -"Please set ASSUME_ALWAYS_YES=yes environement variable to be able to boostrap " -"in non-interractive (stdin not being a tty)\n"; +"Please set ASSUME_ALWAYS_YES=yes environment variable to be able to boostrap " +"in non-interactive (stdin not being a tty)\n"; static int pkg_query_yes_no(void) @@ -945,7 +945,7 @@ main(int argc, char *argv[]) config_bool(ASSUME_ALWAYS_YES, &yes); if (!yes) { if (!isatty(fileno(stdin))) { - fprintf(stderr, non_interractive_message); + fprintf(stderr, non_interactive_message); exit(EXIT_FAILURE); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 17:47:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A12A851E; Mon, 23 Dec 2013 17:47:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A202106D; Mon, 23 Dec 2013 17:47:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNHl5LV070467; Mon, 23 Dec 2013 17:47:05 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNHl5J7070466; Mon, 23 Dec 2013 17:47:05 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201312231747.rBNHl5J7070466@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 23 Dec 2013 17:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259775 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 17:47:05 -0000 Author: bapt Date: Mon Dec 23 17:47:04 2013 New Revision: 259775 URL: http://svnweb.freebsd.org/changeset/base/259775 Log: Fix yet another typo Reported by: kib Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Mon Dec 23 17:26:56 2013 (r259774) +++ head/usr.sbin/pkg/pkg.c Mon Dec 23 17:47:04 2013 (r259775) @@ -823,7 +823,7 @@ static const char confirmation_message[] static const char non_interactive_message[] = "The package management tool is not yet installed on your system.\n" -"Please set ASSUME_ALWAYS_YES=yes environment variable to be able to boostrap " +"Please set ASSUME_ALWAYS_YES=yes environment variable to be able to bootstrap " "in non-interactive (stdin not being a tty)\n"; static int From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 17:49:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97B8677C; Mon, 23 Dec 2013 17:49:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8404F108C; Mon, 23 Dec 2013 17:49:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNHnCvT070804; Mon, 23 Dec 2013 17:49:12 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNHnCVk070803; Mon, 23 Dec 2013 17:49:12 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201312231749.rBNHnCVk070803@svn.freebsd.org> From: Ed Maste Date: Mon, 23 Dec 2013 17:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259776 - head/sys/dev/vt/font X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 17:49:12 -0000 Author: emaste Date: Mon Dec 23 17:49:12 2013 New Revision: 259776 URL: http://svnweb.freebsd.org/changeset/base/259776 Log: Update whitespace to match mkkfont output Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/font/vt_font_default.c Modified: head/sys/dev/vt/font/vt_font_default.c ============================================================================== --- head/sys/dev/vt/font/vt_font_default.c Mon Dec 23 17:47:04 2013 (r259775) +++ head/sys/dev/vt/font/vt_font_default.c Mon Dec 23 17:49:12 2013 (r259776) @@ -2194,8 +2194,12 @@ struct vt_font vt_font_default = { .vf_width = 8, .vf_height = 16, .vf_bytes = font_bytes, - .vf_map = { font_mapping_normal, NULL, - font_mapping_bold, NULL }, + .vf_map = { + font_mapping_normal, + NULL, + font_mapping_bold, + NULL, + }, .vf_map_count = { 248, 0, 260, 0 }, .vf_refcount = 1, }; From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 18:09:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7070AFEB; Mon, 23 Dec 2013 18:09:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5AFCB11CD; Mon, 23 Dec 2013 18:09:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNI9CMA078522; Mon, 23 Dec 2013 18:09:12 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNI9ACn078511; Mon, 23 Dec 2013 18:09:10 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312231809.rBNI9ACn078511@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 23 Dec 2013 18:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259777 - in head/sys: dev/fb dev/vt dev/vt/hw/fb kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 18:09:12 -0000 Author: ray Date: Mon Dec 23 18:09:10 2013 New Revision: 259777 URL: http://svnweb.freebsd.org/changeset/base/259777 Log: o Add virtual terminal mmap request handler. o Forward termianl framebuffer ioctl to fbd. o Forward terminal mmap request to fbd. o Move inclusion of sys/conf.h to vt.h. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/fb/fbd.c head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/vt.h head/sys/dev/vt/vt_consolectl.c head/sys/dev/vt/vt_core.c head/sys/dev/vt/vt_sysmouse.c head/sys/kern/subr_terminal.c head/sys/sys/fbio.h head/sys/sys/terminal.h Modified: head/sys/dev/fb/fbd.c ============================================================================== --- head/sys/dev/fb/fbd.c Mon Dec 23 17:49:12 2013 (r259776) +++ head/sys/dev/fb/fbd.c Mon Dec 23 18:09:10 2013 (r259777) @@ -255,8 +255,12 @@ fb_probe(struct fb_info *info) info->wr4 = &vt_fb_indir_wr4; info->copy = &vt_fb_indir_copy; } else if (info->fb_vbase != 0) { - if (info->fb_pbase == 0) + if (info->fb_pbase == 0) { info->fb_flags |= FB_FLAG_NOMMAP; + } else { + if (info->fb_mmap == NULL) + info->fb_mmap = &fb_mmap; + } info->wr1 = &vt_fb_mem_wr1; info->wr2 = &vt_fb_mem_wr2; info->wr4 = &vt_fb_mem_wr4; @@ -264,6 +268,10 @@ fb_probe(struct fb_info *info) } else return (ENXIO); + if (info->fb_ioctl == NULL) + info->fb_ioctl = &fb_ioctl; + + return (0); } @@ -277,6 +285,7 @@ fb_init(struct fb_list_entry *entry, int entry->fb_si = make_dev(&fb_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "fb%d", unit); entry->fb_si->si_drv1 = info; + info->fb_cdev = entry->fb_si; return (0); } Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Mon Dec 23 17:49:12 2013 (r259776) +++ head/sys/dev/vt/hw/fb/vt_fb.c Mon Dec 23 18:09:10 2013 (r259777) @@ -41,14 +41,47 @@ __FBSDID("$FreeBSD$"); #include #include +static int vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, + struct thread *td); +static int vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, + vm_paddr_t *paddr, int prot, vm_memattr_t *memattr); + static struct vt_driver vt_fb_driver = { .vd_init = vt_fb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, .vd_postswitch = vt_fb_postswitch, .vd_priority = VD_PRIORITY_GENERIC+10, + .vd_fb_ioctl = vt_fb_ioctl, + .vd_fb_mmap = vt_fb_mmap, }; +static int +vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, struct thread *td) +{ + struct fb_info *info; + + info = vd->vd_softc; + + if (info->fb_ioctl == NULL) + return (-1); + + return (info->fb_ioctl(info->fb_cdev, cmd, data, 0, td)); +} + +static int vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, + vm_paddr_t *paddr, int prot, vm_memattr_t *memattr) +{ + struct fb_info *info; + + info = vd->vd_softc; + + if (info->fb_ioctl == NULL) + return (ENXIO); + + return (info->fb_mmap(info->fb_cdev, offset, paddr, prot, memattr)); +} + void vt_fb_blank(struct vt_device *vd, term_color_t color) { Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Mon Dec 23 17:49:12 2013 (r259776) +++ head/sys/dev/vt/vt.h Mon Dec 23 18:09:10 2013 (r259777) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -282,6 +283,9 @@ typedef void vd_bitbltchr_t(struct vt_de unsigned int width, unsigned int height, term_color_t fg, term_color_t bg); typedef void vd_putchar_t(struct vt_device *vd, term_char_t, vt_axis_t top, vt_axis_t left, term_color_t fg, term_color_t bg); +typedef int vd_fb_ioctl_t(struct vt_device *, u_long, caddr_t, struct thread *); +typedef int vd_fb_mmap_t(struct vt_device *, vm_ooffset_t, vm_paddr_t *, int, + vm_memattr_t *); struct vt_driver { /* Console attachment. */ @@ -291,6 +295,12 @@ struct vt_driver { vd_blank_t *vd_blank; vd_bitbltchr_t *vd_bitbltchr; + /* Framebuffer ioctls, if present. */ + vd_fb_ioctl_t *vd_fb_ioctl; + + /* Framebuffer mmap, if present. */ + vd_fb_mmap_t *vd_fb_mmap; + /* Text mode operation. */ vd_putchar_t *vd_putchar; Modified: head/sys/dev/vt/vt_consolectl.c ============================================================================== --- head/sys/dev/vt/vt_consolectl.c Mon Dec 23 17:49:12 2013 (r259776) +++ head/sys/dev/vt/vt_consolectl.c Mon Dec 23 18:09:10 2013 (r259777) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon Dec 23 17:49:12 2013 (r259776) +++ head/sys/dev/vt/vt_core.c Mon Dec 23 18:09:10 2013 (r259777) @@ -72,6 +72,7 @@ static tc_cngetc_t vtterm_cngetc; static tc_opened_t vtterm_opened; static tc_ioctl_t vtterm_ioctl; +static tc_mmap_t vtterm_mmap; const struct terminal_class vt_termclass = { .tc_bell = vtterm_bell, @@ -87,6 +88,7 @@ const struct terminal_class vt_termclass .tc_opened = vtterm_opened, .tc_ioctl = vtterm_ioctl, + .tc_mmap = vtterm_mmap, }; /* @@ -1348,6 +1350,20 @@ vt_mouse_state(int show) #endif static int +vtterm_mmap(struct terminal *tm, vm_ooffset_t offset, vm_paddr_t * paddr, + int nprot, vm_memattr_t *memattr) +{ + struct vt_window *vw = tm->tm_softc; + struct vt_device *vd = vw->vw_device; + + if (vd->vd_driver->vd_fb_mmap) + return (vd->vd_driver->vd_fb_mmap(vd, offset, paddr, nprot, + memattr)); + + return (ENXIO); +} + +static int vtterm_ioctl(struct terminal *tm, u_long cmd, caddr_t data, struct thread *td) { @@ -1474,6 +1490,14 @@ skip_thunk: return (EINVAL); } } + case FBIOGTYPE: + case FBIO_GETWINORG: /* get frame buffer window origin */ + case FBIO_GETDISPSTART: /* get display start address */ + case FBIO_GETLINEWIDTH: /* get scan line width in bytes */ + case FBIO_BLANK: /* blank display */ + if (vd->vd_driver->vd_fb_ioctl) + return (vd->vd_driver->vd_fb_ioctl(vd, cmd, data, td)); + break; case CONS_BLANKTIME: /* XXX */ return (0); Modified: head/sys/dev/vt/vt_sysmouse.c ============================================================================== --- head/sys/dev/vt/vt_sysmouse.c Mon Dec 23 17:49:12 2013 (r259776) +++ head/sys/dev/vt/vt_sysmouse.c Mon Dec 23 18:09:10 2013 (r259777) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/kern/subr_terminal.c ============================================================================== --- head/sys/kern/subr_terminal.c Mon Dec 23 17:49:12 2013 (r259776) +++ head/sys/kern/subr_terminal.c Mon Dec 23 18:09:10 2013 (r259777) @@ -85,12 +85,14 @@ static tsw_open_t termtty_open; static tsw_close_t termtty_close; static tsw_outwakeup_t termtty_outwakeup; static tsw_ioctl_t termtty_ioctl; +static tsw_mmap_t termtty_mmap; static struct ttydevsw terminal_tty_class = { .tsw_open = termtty_open, .tsw_close = termtty_close, .tsw_outwakeup = termtty_outwakeup, .tsw_ioctl = termtty_ioctl, + .tsw_mmap = termtty_mmap, }; /* @@ -409,6 +411,15 @@ termtty_ioctl(struct tty *tp, u_long cmd return (error); } +static int +termtty_mmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t * paddr, + int nprot, vm_memattr_t *memattr) +{ + struct terminal *tm = tty_softc(tp); + + return (tm->tm_class->tc_mmap(tm, offset, paddr, nprot, memattr)); +} + /* * Binding with the kernel and debug console. */ Modified: head/sys/sys/fbio.h ============================================================================== --- head/sys/sys/fbio.h Mon Dec 23 17:49:12 2013 (r259776) +++ head/sys/sys/fbio.h Mon Dec 23 18:09:10 2013 (r259777) @@ -125,6 +125,10 @@ typedef void fb_wr1_t(struct fb_info *sc typedef void fb_wr2_t(struct fb_info *sc, uint32_t offset, uint16_t value); typedef void fb_wr4_t(struct fb_info *sc, uint32_t offset, uint32_t value); +typedef int fb_ioctl_t(struct cdev *, u_long, caddr_t, int, struct thread *); +typedef int fb_mmap_t(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr); + struct fb_info { /* Raw copy of fbtype. Do not change. */ int fb_type; /* as defined above */ @@ -137,6 +141,10 @@ struct fb_info { /* Methods. */ fb_write_t *fb_write; /* if NULL, direct mem write. */ fb_read_t *fb_read; /* if NULL, direct mem read. */ + fb_ioctl_t *fb_ioctl; /* Can be NULL. */ + fb_mmap_t *fb_mmap; /* Can be NULL. */ + + struct cdev *fb_cdev; fb_wr1_t *wr1; fb_wr2_t *wr2; Modified: head/sys/sys/terminal.h ============================================================================== --- head/sys/sys/terminal.h Mon Dec 23 17:49:12 2013 (r259776) +++ head/sys/sys/terminal.h Mon Dec 23 18:09:10 2013 (r259777) @@ -95,6 +95,8 @@ typedef int tc_cngetc_t(struct terminal typedef void tc_opened_t(struct terminal *tm, int opened); typedef int tc_ioctl_t(struct terminal *tm, u_long cmd, caddr_t data, struct thread *td); +typedef int tc_mmap_t(struct terminal *tm, vm_ooffset_t offset, + vm_paddr_t * paddr, int nprot, vm_memattr_t *memattr); typedef void tc_bell_t(struct terminal *tm); struct terminal_class { @@ -109,10 +111,11 @@ struct terminal_class { /* Low-level console interface. */ tc_cnprobe_t *tc_cnprobe; tc_cngetc_t *tc_cngetc; - + /* Misc. */ tc_opened_t *tc_opened; tc_ioctl_t *tc_ioctl; + tc_mmap_t *tc_mmap; tc_bell_t *tc_bell; }; From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 19:29:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6949CEA0; Mon, 23 Dec 2013 19:29:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 494D117D1; Mon, 23 Dec 2013 19:29:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNJTAaE007996; Mon, 23 Dec 2013 19:29:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNJT889007977; Mon, 23 Dec 2013 19:29:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312231929.rBNJT889007977@svn.freebsd.org> From: John Baldwin Date: Mon, 23 Dec 2013 19:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259779 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 19:29:10 -0000 Author: jhb Date: Mon Dec 23 19:29:07 2013 New Revision: 259779 URL: http://svnweb.freebsd.org/changeset/base/259779 Log: Extend the support for local interrupts on the local APIC: - Add a generic routine to trigger an LVT interrupt that supports both fixed and NMI delivery modes. - Add an ioctl and bhyvectl command to trigger local interrupts inside a guest. In particular, a global NMI similar to that raised by SERR# or PERR# can be simulated by asserting LINT1 on all vCPUs. - Extend the LVT table in the vCPU local APIC to support CMCI. - Flesh out the local APIC error reporting a bit to cache errors and report them via ESR when ESR is written to. Add support for asserting the error LVT when an error occurs. Raise illegal vector errors when attempting to signal an invalid vector for an interrupt or when sending an IPI. - Ignore writes to reserved bits in LVT entries. - Export table entries the MADT and MP Table advertising the stock x86 config of LINT0 set to ExtInt and LINT1 wired to NMI. Reviewed by: neel (earlier version) Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_lapic.c head/sys/amd64/vmm/vmm_lapic.h head/usr.sbin/bhyve/acpi.c head/usr.sbin/bhyve/mptbl.c head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Mon Dec 23 19:04:14 2013 (r259778) +++ head/lib/libvmmapi/vmmapi.c Mon Dec 23 19:29:07 2013 (r259779) @@ -397,6 +397,18 @@ vm_lapic_irq(struct vmctx *ctx, int vcpu } int +vm_lapic_local_irq(struct vmctx *ctx, int vcpu, int vector) +{ + struct vm_lapic_irq vmirq; + + bzero(&vmirq, sizeof(vmirq)); + vmirq.cpuid = vcpu; + vmirq.vector = vector; + + return (ioctl(ctx->fd, VM_LAPIC_LOCAL_IRQ, &vmirq)); +} + +int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg) { struct vm_lapic_msi vmmsi; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Mon Dec 23 19:04:14 2013 (r259778) +++ head/lib/libvmmapi/vmmapi.h Mon Dec 23 19:29:07 2013 (r259779) @@ -67,6 +67,7 @@ int vm_inject_event(struct vmctx *ctx, i int vm_inject_event2(struct vmctx *ctx, int vcpu, enum vm_event_type type, int vector, int error_code); int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector); +int vm_lapic_local_irq(struct vmctx *ctx, int vcpu, int vector); int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg); int vm_ioapic_assert_irq(struct vmctx *ctx, int irq); int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Mon Dec 23 19:04:14 2013 (r259778) +++ head/sys/amd64/include/vmm_dev.h Mon Dec 23 19:29:07 2013 (r259779) @@ -181,6 +181,7 @@ enum { IOCNUM_IOAPIC_DEASSERT_IRQ = 34, IOCNUM_IOAPIC_PULSE_IRQ = 35, IOCNUM_LAPIC_MSI = 36, + IOCNUM_LAPIC_LOCAL_IRQ = 37, /* PCI pass-thru */ IOCNUM_BIND_PPTDEV = 40, @@ -217,6 +218,8 @@ enum { _IOW('v', IOCNUM_INJECT_EVENT, struct vm_event) #define VM_LAPIC_IRQ \ _IOW('v', IOCNUM_LAPIC_IRQ, struct vm_lapic_irq) +#define VM_LAPIC_LOCAL_IRQ \ + _IOW('v', IOCNUM_LAPIC_LOCAL_IRQ, struct vm_lapic_irq) #define VM_LAPIC_MSI \ _IOW('v', IOCNUM_LAPIC_MSI, struct vm_lapic_msi) #define VM_IOAPIC_ASSERT_IRQ \ Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Mon Dec 23 19:04:14 2013 (r259778) +++ head/sys/amd64/vmm/io/vlapic.c Mon Dec 23 19:29:07 2013 (r259779) @@ -91,7 +91,7 @@ static MALLOC_DEFINE(M_VLAPIC, "vlapic", #define PRIO(x) ((x) >> 4) #define VLAPIC_VERSION (16) -#define VLAPIC_MAXLVT_ENTRIES (5) +#define VLAPIC_MAXLVT_ENTRIES (APIC_LVT_CMCI) #define x2apic(vlapic) (((vlapic)->msr_apicbase & APICBASE_X2APIC) ? 1 : 0) @@ -107,7 +107,8 @@ struct vlapic { struct LAPIC apic; - int esr_update; + uint32_t esr_pending; + int esr_firing; struct callout callout; /* vlapic timer */ struct bintime timer_fire_bt; /* callout expiry time */ @@ -330,7 +331,8 @@ static void vlapic_update_errors(struct vlapic *vlapic) { struct LAPIC *lapic = &vlapic->apic; - lapic->esr = 0; // XXX + lapic->esr = vlapic->esr_pending; + vlapic->esr_pending = 0; } static void @@ -345,7 +347,8 @@ vlapic_reset(struct vlapic *vlapic) lapic->version |= (VLAPIC_MAXLVT_ENTRIES << MAXLVTSHIFT); lapic->dfr = 0xffffffff; lapic->svr = APIC_SVR_VECTOR; - vlapic_mask_lvts(&lapic->lvt_timer, VLAPIC_MAXLVT_ENTRIES+1); + vlapic_mask_lvts(&lapic->lvt_timer, 6); + vlapic_mask_lvts(&lapic->lvt_cmci, 1); vlapic_set_dcr(vlapic, 0); if (vlapic->vcpuid == 0) @@ -370,6 +373,11 @@ vlapic_set_intr_ready(struct vlapic *vla return; } + if (vector < 16) { + vlapic_set_error(vlapic, APIC_ESR_RECEIVE_ILLEGAL_VECTOR); + return; + } + idx = (vector / 32) * 4; mask = 1 << (vector % 32); @@ -396,11 +404,15 @@ vlapic_get_lvtptr(struct vlapic *vlapic, struct LAPIC *lapic = &vlapic->apic; int i; - if (offset < APIC_OFFSET_TIMER_LVT || offset > APIC_OFFSET_ERROR_LVT) { + switch (offset) { + case APIC_OFFSET_CMCI_LVT: + return (&lapic->lvt_cmci); + case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: + i = (offset - APIC_OFFSET_TIMER_LVT) >> 2; + return ((&lapic->lvt_timer) + i);; + default: panic("vlapic_get_lvt: invalid LVT\n"); } - i = (offset - APIC_OFFSET_TIMER_LVT) >> 2; - return ((&lapic->lvt_timer) + i);; } static __inline uint32_t @@ -413,7 +425,7 @@ vlapic_get_lvt(struct vlapic *vlapic, ui static void vlapic_set_lvt(struct vlapic *vlapic, uint32_t offset, uint32_t val) { - uint32_t *lvtptr; + uint32_t *lvtptr, mask; struct LAPIC *lapic; lapic = &vlapic->apic; @@ -424,12 +436,57 @@ vlapic_set_lvt(struct vlapic *vlapic, ui if (!(lapic->svr & APIC_SVR_ENABLE)) val |= APIC_LVT_M; - *lvtptr = val; + mask = APIC_LVT_M | APIC_LVT_DS | APIC_LVT_VECTOR; + switch (offset) { + case APIC_OFFSET_TIMER_LVT: + mask |= APIC_LVTT_TM; + break; + case APIC_OFFSET_ERROR_LVT: + break; + case APIC_OFFSET_LINT0_LVT: + case APIC_OFFSET_LINT1_LVT: + mask |= APIC_LVT_TM | APIC_LVT_RIRR | APIC_LVT_IIPP; + /* FALLTHROUGH */ + default: + mask |= APIC_LVT_DM; + break; + } + *lvtptr = val & mask; if (offset == APIC_OFFSET_TIMER_LVT) VLAPIC_TIMER_UNLOCK(vlapic); } +static int +vlapic_fire_lvt(struct vlapic *vlapic, uint32_t lvt) +{ + uint32_t vec, mode; + + if (lvt & APIC_LVT_M) + return (0); + + vec = lvt & APIC_LVT_VECTOR; + mode = lvt & APIC_LVT_DM; + + switch (mode) { + case APIC_LVT_DM_FIXED: + if (vec < 16) { + vlapic_set_error(vlapic, APIC_ESR_SEND_ILLEGAL_VECTOR); + return (0); + } + vlapic_set_intr_ready(vlapic, vec, false); + vcpu_notify_event(vlapic->vm, vlapic->vcpuid); + break; + case APIC_LVT_DM_NMI: + vm_inject_nmi(vlapic->vm, vlapic->vcpuid); + break; + default: + // Other modes ignored + return (0); + } + return (1); +} + #if 1 static void dump_isrvec_stk(struct vlapic *vlapic) @@ -568,26 +625,98 @@ vlapic_periodic_timer(struct vlapic *vla return (vlapic_get_lvt_field(lvt, APIC_LVTT_TM_PERIODIC)); } +static VMM_STAT(VLAPIC_INTR_ERROR, "error interrupts generated by vlapic"); + +void +vlapic_set_error(struct vlapic *vlapic, uint32_t mask) +{ + uint32_t lvt; + + vlapic->esr_pending |= mask; + if (vlapic->esr_firing) + return; + vlapic->esr_firing = 1; + + // The error LVT always uses the fixed delivery mode. + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_ERROR_LVT); + if (vlapic_fire_lvt(vlapic, lvt | APIC_LVT_DM_FIXED)) { + vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_ERROR, 1); + } + vlapic->esr_firing = 0; +} + static VMM_STAT(VLAPIC_INTR_TIMER, "timer interrupts generated by vlapic"); static void vlapic_fire_timer(struct vlapic *vlapic) { - int vector; uint32_t lvt; KASSERT(VLAPIC_TIMER_LOCKED(vlapic), ("vlapic_fire_timer not locked")); + // The timer LVT always uses the fixed delivery mode. lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_TIMER_LVT); - - if (!vlapic_get_lvt_field(lvt, APIC_LVTT_M)) { + if (vlapic_fire_lvt(vlapic, lvt | APIC_LVT_DM_FIXED)) { vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_TIMER, 1); - vector = vlapic_get_lvt_field(lvt, APIC_LVTT_VECTOR); - vlapic_set_intr_ready(vlapic, vector, false); - vcpu_notify_event(vlapic->vm, vlapic->vcpuid); } } +static VMM_STAT(VLAPIC_INTR_CMC, + "corrected machine check interrupts generated by vlapic"); + +void +vlapic_fire_cmci(struct vlapic *vlapic) +{ + uint32_t lvt; + + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_CMCI_LVT); + if (vlapic_fire_lvt(vlapic, lvt)) { + vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_CMC, 1); + } +} + +static VMM_STAT_ARRAY(LVTS_TRIGGERRED, VLAPIC_MAXLVT_ENTRIES, + "lvts triggered"); + +int +vlapic_trigger_lvt(struct vlapic *vlapic, int vector) +{ + uint32_t lvt; + + switch (vector) { + case APIC_LVT_LINT0: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_LINT0_LVT); + break; + case APIC_LVT_LINT1: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_LINT1_LVT); + break; + case APIC_LVT_TIMER: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_TIMER_LVT); + lvt |= APIC_LVT_DM_FIXED; + break; + case APIC_LVT_ERROR: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_ERROR_LVT); + lvt |= APIC_LVT_DM_FIXED; + break; + case APIC_LVT_PMC: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_PERF_LVT); + break; + case APIC_LVT_THERMAL: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_THERM_LVT); + break; + case APIC_LVT_CMCI: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_CMCI_LVT); + break; + default: + return (EINVAL); + } + if (vlapic_fire_lvt(vlapic, lvt)) { + vmm_stat_array_incr(vlapic->vm, vlapic->vcpuid, + LVTS_TRIGGERRED, vector, 1); + } + return (0); +} + static void vlapic_callout_handler(void *arg) { @@ -800,6 +929,11 @@ lapic_process_icr(struct vlapic *vlapic, vec = icrval & APIC_VECTOR_MASK; mode = icrval & APIC_DELMODE_MASK; + if (mode == APIC_DELMODE_FIXED && vec < 16) { + vlapic_set_error(vlapic, APIC_ESR_SEND_ILLEGAL_VECTOR); + return (0); + } + if (mode == APIC_DELMODE_FIXED || mode == APIC_DELMODE_NMI) { switch (icrval & APIC_DEST_MASK) { case APIC_DEST_DESTFLD: @@ -1044,6 +1178,7 @@ vlapic_read(struct vlapic *vlapic, uint6 case APIC_OFFSET_ICR_HI: *data = lapic->icr_hi; break; + case APIC_OFFSET_CMCI_LVT: case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: *data = vlapic_get_lvt(vlapic, offset); break; @@ -1113,6 +1248,7 @@ vlapic_write(struct vlapic *vlapic, uint lapic->icr_hi = data; } break; + case APIC_OFFSET_CMCI_LVT: case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: vlapic_set_lvt(vlapic, offset, data); break; Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Mon Dec 23 19:04:14 2013 (r259778) +++ head/sys/amd64/vmm/io/vlapic.h Mon Dec 23 19:29:07 2013 (r259779) @@ -69,6 +69,7 @@ struct vm; #define APIC_OFFSET_IRR6 0x260 // IRR 192-223 R #define APIC_OFFSET_IRR7 0x270 // IRR 224-255 R #define APIC_OFFSET_ESR 0x280 // Error Status Register R +#define APIC_OFFSET_CMCI_LVT 0x2F0 // Local Vector Table (CMCI) R/W #define APIC_OFFSET_ICR_LOW 0x300 // Interrupt Command Reg. (0-31) R/W #define APIC_OFFSET_ICR_HI 0x310 // Interrupt Command Reg. (32-63) R/W #define APIC_OFFSET_TIMER_LVT 0x320 // Local Vector Table (Timer) R/W @@ -97,6 +98,9 @@ int vlapic_read(struct vlapic *vlapic, u int vlapic_pending_intr(struct vlapic *vlapic); void vlapic_intr_accepted(struct vlapic *vlapic, int vector); void vlapic_set_intr_ready(struct vlapic *vlapic, int vector, bool level); +void vlapic_set_error(struct vlapic *vlapic, uint32_t mask); +void vlapic_fire_cmci(struct vlapic *vlapic); +int vlapic_trigger_lvt(struct vlapic *vlapic, int vector); uint64_t vlapic_get_apicbase(struct vlapic *vlapic); void vlapic_set_apicbase(struct vlapic *vlapic, uint64_t val); Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Mon Dec 23 19:04:14 2013 (r259778) +++ head/sys/amd64/vmm/vmm_dev.c Mon Dec 23 19:29:07 2013 (r259779) @@ -297,6 +297,11 @@ vmmdev_ioctl(struct cdev *cdev, u_long c vmirq = (struct vm_lapic_irq *)data; error = lapic_intr_edge(sc->vm, vmirq->cpuid, vmirq->vector); break; + case VM_LAPIC_LOCAL_IRQ: + vmirq = (struct vm_lapic_irq *)data; + error = lapic_set_local_intr(sc->vm, vmirq->cpuid, + vmirq->vector); + break; case VM_LAPIC_MSI: vmmsi = (struct vm_lapic_msi *)data; error = lapic_intr_msi(sc->vm, vmmsi->addr, vmmsi->msg); Modified: head/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.c Mon Dec 23 19:04:14 2013 (r259778) +++ head/sys/amd64/vmm/vmm_lapic.c Mon Dec 23 19:29:07 2013 (r259779) @@ -90,6 +90,33 @@ lapic_set_intr(struct vm *vm, int cpu, i } int +lapic_set_local_intr(struct vm *vm, int cpu, int vector) +{ + struct vlapic *vlapic; + cpuset_t dmask; + int error; + + if (cpu < -1 || cpu >= VM_MAXCPU) + return (EINVAL); + + if (cpu == -1) + dmask = vm_active_cpus(vm); + else + CPU_SETOF(cpu, &dmask); + error = 0; + while ((cpu = CPU_FFS(&dmask)) != 0) { + cpu--; + CPU_CLR(cpu, &dmask); + vlapic = vm_lapic(vm, cpu); + error = vlapic_trigger_lvt(vlapic, vector); + if (error) + break; + } + + return (error); +} + +int lapic_intr_msi(struct vm *vm, uint64_t addr, uint64_t msg) { int delmode, vec; Modified: head/sys/amd64/vmm/vmm_lapic.h ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.h Mon Dec 23 19:04:14 2013 (r259778) +++ head/sys/amd64/vmm/vmm_lapic.h Mon Dec 23 19:29:07 2013 (r259779) @@ -84,5 +84,12 @@ lapic_intr_edge(struct vm *vm, int cpu, return (lapic_set_intr(vm, cpu, vector, LAPIC_TRIG_EDGE)); } +/* + * Triggers the LAPIC local interrupt (LVT) 'vector' on 'cpu'. 'cpu' can + * be set to -1 to trigger the interrupt on all CPUs. + */ +int lapic_set_local_intr(struct vm *vm, int cpu, int vector); + int lapic_intr_msi(struct vm *vm, uint64_t addr, uint64_t msg); + #endif Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Mon Dec 23 19:04:14 2013 (r259778) +++ head/usr.sbin/bhyve/acpi.c Mon Dec 23 19:29:07 2013 (r259779) @@ -290,6 +290,16 @@ basl_fwrite_madt(FILE *fp) EFPRINTF(fp, "\t\t\tTrigger Mode : 0\n"); EFPRINTF(fp, "\n"); + /* Local APIC NMI is connected to LINT 1 on all CPUs */ + EFPRINTF(fp, "[0001]\t\tSubtable Type : 04\n"); + EFPRINTF(fp, "[0001]\t\tLength : 06\n"); + EFPRINTF(fp, "[0001]\t\tProcessorId : FF\n"); + EFPRINTF(fp, "[0002]\t\tFlags (decoded below) : 0005\n"); + EFPRINTF(fp, "\t\t\tPolarity : 1\n"); + EFPRINTF(fp, "\t\t\tTrigger Mode : 1\n"); + EFPRINTF(fp, "[0001]\t\tInterrupt : 01\n"); + EFPRINTF(fp, "\n"); + EFFLUSH(fp); return (0); Modified: head/usr.sbin/bhyve/mptbl.c ============================================================================== --- head/usr.sbin/bhyve/mptbl.c Mon Dec 23 19:04:14 2013 (r259778) +++ head/usr.sbin/bhyve/mptbl.c Mon Dec 23 19:29:07 2013 (r259779) @@ -71,6 +71,9 @@ __FBSDID("$FreeBSD$"); #define MPEP_FEATURES (0xBFEBFBFF) /* XXX Intel i7 */ +/* Number of local intr entries */ +#define MPEII_NUM_LOCAL_IRQ 2 + /* Number of i/o intr entries */ #define MPEII_MAX_IRQ 24 @@ -140,6 +143,30 @@ mpt_build_proc_entries(proc_entry_ptr mp } static void +mpt_build_localint_entries(int_entry_ptr mpie) +{ + + /* Hardcode LINT0 as ExtINT on all CPUs. */ + memset(mpie, 0, sizeof(*mpie)); + mpie->type = MPCT_ENTRY_LOCAL_INT; + mpie->int_type = INTENTRY_TYPE_EXTINT; + mpie->int_flags = INTENTRY_FLAGS_POLARITY_CONFORM | + INTENTRY_FLAGS_TRIGGER_CONFORM; + mpie->dst_apic_id = 0xff; + mpie->dst_apic_int = 0; + mpie++; + + /* Hardcode LINT1 as NMI on all CPUs. */ + memset(mpie, 0, sizeof(*mpie)); + mpie->type = MPCT_ENTRY_LOCAL_INT; + mpie->int_type = INTENTRY_TYPE_NMI; + mpie->int_flags = INTENTRY_FLAGS_POLARITY_CONFORM | + INTENTRY_FLAGS_TRIGGER_CONFORM; + mpie->dst_apic_id = 0xff; + mpie->dst_apic_int = 1; +} + +static void mpt_build_bus_entries(bus_entry_ptr mpeb) { @@ -275,6 +302,11 @@ mptable_build(struct vmctx *ctx, int ncp curraddr += sizeof(*mpie) * MPEII_MAX_IRQ; mpch->entry_count += MPEII_MAX_IRQ; + mpie = (int_entry_ptr)curraddr; + mpt_build_localint_entries(mpie); + curraddr += sizeof(*mpie) * MPEII_NUM_LOCAL_IRQ; + mpch->entry_count += MPEII_NUM_LOCAL_IRQ; + if (oem_tbl_start) { mpch->oem_table_pointer = curraddr - startaddr + MPTABLE_BASE; mpch->oem_table_size = oem_tbl_size; Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Mon Dec 23 19:04:14 2013 (r259778) +++ head/usr.sbin/bhyvectl/bhyvectl.c Mon Dec 23 19:29:07 2013 (r259779) @@ -190,13 +190,14 @@ usage(void) " [--get-lowmem]\n" " [--get-highmem]\n" " [--get-gpa-pmap]\n" + " [--assert-lapic-lvt=]\n" " [--inject-nmi]\n", progname); exit(1); } static int get_stats, getcap, setcap, capval, get_gpa_pmap; -static int inject_nmi; +static int inject_nmi, assert_lapic_lvt; static const char *capname; static int create, destroy, get_lowmem, get_highmem; static uint64_t memsize; @@ -381,6 +382,7 @@ enum { CAPNAME, UNASSIGN_PPTDEV, GET_GPA_PMAP, + ASSERT_LAPIC_LVT, }; int @@ -433,6 +435,7 @@ main(int argc, char *argv[]) { "unassign-pptdev", REQ_ARG, 0, UNASSIGN_PPTDEV }, { "setcap", REQ_ARG, 0, SET_CAP }, { "get-gpa-pmap", REQ_ARG, 0, GET_GPA_PMAP }, + { "assert-lapic-lvt", REQ_ARG, 0, ASSERT_LAPIC_LVT }, { "getcap", NO_ARG, &getcap, 1 }, { "get-stats", NO_ARG, &get_stats, 1 }, { "get-desc-ds",NO_ARG, &get_desc_ds, 1 }, @@ -564,6 +567,7 @@ main(int argc, char *argv[]) }; vcpu = 0; + assert_lapic_lvt = -1; progname = basename(argv[0]); while ((ch = getopt_long(argc, argv, "", opts, NULL)) != -1) { @@ -685,6 +689,9 @@ main(int argc, char *argv[]) if (sscanf(optarg, "%d/%d/%d", &bus, &slot, &func) != 3) usage(); break; + case ASSERT_LAPIC_LVT: + assert_lapic_lvt = atoi(optarg); + break; default: usage(); } @@ -832,6 +839,10 @@ main(int argc, char *argv[]) error = vm_inject_nmi(ctx, vcpu); } + if (!error && assert_lapic_lvt != -1) { + error = vm_lapic_local_irq(ctx, vcpu, assert_lapic_lvt); + } + if (!error && (get_lowmem || get_all)) { gpa = 0; error = vm_get_memory_seg(ctx, gpa, &len, &wired); From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 19:47:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC2E7DC0; Mon, 23 Dec 2013 19:47:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D819419D5; Mon, 23 Dec 2013 19:47:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNJlYYY014940; Mon, 23 Dec 2013 19:47:34 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNJlYHW014939; Mon, 23 Dec 2013 19:47:34 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312231947.rBNJlYHW014939@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 23 Dec 2013 19:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259780 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 19:47:35 -0000 Author: pfg Date: Mon Dec 23 19:47:34 2013 New Revision: 259780 URL: http://svnweb.freebsd.org/changeset/base/259780 Log: ext2fs: make the hashing algorithm match the linux code. There appears to be a hash function compatibility issue. The code is currently disabled but fix it nevertheless. PR: kern/183230 MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_hash.c Modified: head/sys/fs/ext2fs/ext2_hash.c ============================================================================== --- head/sys/fs/ext2fs/ext2_hash.c Mon Dec 23 19:29:07 2013 (r259779) +++ head/sys/fs/ext2fs/ext2_hash.c Mon Dec 23 19:47:34 2013 (r259780) @@ -289,8 +289,8 @@ ext2_htree_hash(const char *name, int le len -= 32; name += 32; } - major = hash[0]; - minor = hash[1]; + major = hash[1]; + minor = hash[2]; break; default: goto error; From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 19:48:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E9DAEFF; Mon, 23 Dec 2013 19:48:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A8D519DA; Mon, 23 Dec 2013 19:48:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNJm3aN015031; Mon, 23 Dec 2013 19:48:03 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNJm354015030; Mon, 23 Dec 2013 19:48:03 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312231948.rBNJm354015030@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 23 Dec 2013 19:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259781 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 19:48:03 -0000 Author: rodrigc Date: Mon Dec 23 19:48:02 2013 New Revision: 259781 URL: http://svnweb.freebsd.org/changeset/base/259781 Log: Mention jemalloc upgrade to 3.4.0 Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 19:47:34 2013 (r259780) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 23 19:48:02 2013 (r259781) @@ -624,6 +624,10 @@ hv_vmbus_load="YES" Al Contributed Software + &man.jemalloc.3; has been updated to 3.4.0. + See this link. + for more details. + AMD has been updated from 6.0.10 to 6.1.5. From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 19:48:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF1C0D3; Mon, 23 Dec 2013 19:48:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA44819E2; Mon, 23 Dec 2013 19:48:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNJmOT2015126; Mon, 23 Dec 2013 19:48:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNJmNAF015115; Mon, 23 Dec 2013 19:48:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312231948.rBNJmNAF015115@svn.freebsd.org> From: John Baldwin Date: Mon, 23 Dec 2013 19:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259782 - in head/sys: amd64/amd64 amd64/include amd64/vmm amd64/vmm/amd amd64/vmm/intel x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 19:48:25 -0000 Author: jhb Date: Mon Dec 23 19:48:22 2013 New Revision: 259782 URL: http://svnweb.freebsd.org/changeset/base/259782 Log: Add a resume hook for bhyve that runs a function on all CPUs during resume. For Intel CPUs, invoke vmxon for CPUs that were in VMX mode at the time of suspend. Reviewed by: neel Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/cpu.h head/sys/amd64/include/vmm.h head/sys/amd64/vmm/amd/amdv.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Dec 23 19:48:02 2013 (r259781) +++ head/sys/amd64/amd64/machdep.c Mon Dec 23 19:48:22 2013 (r259782) @@ -215,6 +215,8 @@ struct mem_range_softc mem_range_softc; struct mtx dt_lock; /* lock for GDT and LDT */ +void (*vmm_resume_p)(void); + static void cpu_startup(dummy) void *dummy; Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Dec 23 19:48:02 2013 (r259781) +++ head/sys/amd64/amd64/mp_machdep.c Mon Dec 23 19:48:22 2013 (r259782) @@ -1483,6 +1483,8 @@ cpususpend_handler(void) if (cpu_ops.cpu_resume) cpu_ops.cpu_resume(); + if (vmm_resume_p) + vmm_resume_p(); /* Resume MCA and local APIC */ mca_resume(); Modified: head/sys/amd64/include/cpu.h ============================================================================== --- head/sys/amd64/include/cpu.h Mon Dec 23 19:48:02 2013 (r259781) +++ head/sys/amd64/include/cpu.h Mon Dec 23 19:48:22 2013 (r259782) @@ -70,6 +70,9 @@ extern struct cpu_ops cpu_ops; extern char btext[]; extern char etext[]; +/* Resume hook for VMM. */ +extern void (*vmm_resume_p)(void); + void cpu_halt(void); void cpu_reset(void); void fork_trampoline(void); Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Mon Dec 23 19:48:02 2013 (r259781) +++ head/sys/amd64/include/vmm.h Mon Dec 23 19:48:22 2013 (r259782) @@ -49,6 +49,7 @@ enum x2apic_state; typedef int (*vmm_init_func_t)(void); typedef int (*vmm_cleanup_func_t)(void); +typedef void (*vmm_resume_func_t)(void); typedef void * (*vmi_init_func_t)(struct vm *vm, struct pmap *pmap); typedef int (*vmi_run_func_t)(void *vmi, int vcpu, register_t rip, struct pmap *pmap); @@ -72,6 +73,7 @@ typedef void (*vmi_vmspace_free)(struct struct vmm_ops { vmm_init_func_t init; /* module wide initialization */ vmm_cleanup_func_t cleanup; + vmm_resume_func_t resume; vmi_init_func_t vminit; /* vm-specific initialization */ vmi_run_func_t vmrun; Modified: head/sys/amd64/vmm/amd/amdv.c ============================================================================== --- head/sys/amd64/vmm/amd/amdv.c Mon Dec 23 19:48:02 2013 (r259781) +++ head/sys/amd64/vmm/amd/amdv.c Mon Dec 23 19:48:22 2013 (r259782) @@ -53,6 +53,11 @@ amdv_cleanup(void) return (ENXIO); } +static void +amdv_resume(void) +{ +} + static void * amdv_vminit(struct vm *vm, struct pmap *pmap) { @@ -153,6 +158,7 @@ amdv_vmspace_free(struct vmspace *vmspac struct vmm_ops vmm_ops_amd = { amdv_init, amdv_cleanup, + amdv_resume, amdv_vminit, amdv_vmrun, amdv_vmcleanup, Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Mon Dec 23 19:48:02 2013 (r259781) +++ head/sys/amd64/vmm/intel/vmx.c Mon Dec 23 19:48:22 2013 (r259782) @@ -524,6 +524,14 @@ vmx_enable(void *arg __unused) vmxon_enabled[curcpu] = 1; } +static void +vmx_restore(void) +{ + + if (vmxon_enabled[curcpu]) + vmxon(vmxon_region[curcpu]); +} + static int vmx_init(void) { @@ -1958,6 +1966,7 @@ vmx_setcap(void *arg, int vcpu, int type struct vmm_ops vmm_ops_intel = { vmx_init, vmx_cleanup, + vmx_restore, vmx_vminit, vmx_run, vmx_vmcleanup, Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Mon Dec 23 19:48:02 2013 (r259781) +++ head/sys/amd64/vmm/vmm.c Mon Dec 23 19:48:22 2013 (r259782) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -131,6 +132,7 @@ static int vmm_initialized; static struct vmm_ops *ops; #define VMM_INIT() (ops != NULL ? (*ops->init)() : 0) #define VMM_CLEANUP() (ops != NULL ? (*ops->cleanup)() : 0) +#define VMM_RESUME() (ops != NULL ? (*ops->resume)() : 0) #define VMINIT(vm, pmap) (ops != NULL ? (*ops->vminit)(vm, pmap): NULL) #define VMRUN(vmi, vcpu, rip, pmap) \ @@ -202,6 +204,12 @@ vm_exitinfo(struct vm *vm, int cpuid) return (&vcpu->exitinfo); } +static void +vmm_resume(void) +{ + VMM_RESUME(); +} + static int vmm_init(void) { @@ -222,6 +230,7 @@ vmm_init(void) return (ENXIO); vmm_msr_init(); + vmm_resume_p = vmm_resume; return (VMM_INIT()); } @@ -242,6 +251,7 @@ vmm_handler(module_t mod, int what, void case MOD_UNLOAD: error = vmmdev_cleanup(); if (error == 0) { + vmm_resume_p = NULL; iommu_cleanup(); vmm_ipi_cleanup(); error = VMM_CLEANUP(); Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Mon Dec 23 19:48:02 2013 (r259781) +++ head/sys/x86/acpica/acpi_wakeup.c Mon Dec 23 19:48:22 2013 (r259782) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -266,6 +267,10 @@ acpi_wakeup_machdep(struct acpi_softc *s restart_cpus(suspcpus); #endif mca_resume(); +#ifdef __amd64__ + if (vmm_resume_p != NULL) + vmm_resume_p(); +#endif intr_resume(/*suspend_cancelled*/false); AcpiSetFirmwareWakingVector(0); From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 19:57:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35F3252F; Mon, 23 Dec 2013 19:57:03 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BC511A96; Mon, 23 Dec 2013 19:57:03 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 11F70B943; Mon, 23 Dec 2013 14:57:02 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r259782 - in head/sys: amd64/amd64 amd64/include amd64/vmm amd64/vmm/amd amd64/vmm/intel x86/acpica Date: Mon, 23 Dec 2013 14:50:24 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312231948.rBNJmNAF015115@svn.freebsd.org> In-Reply-To: <201312231948.rBNJmNAF015115@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201312231450.24443.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 23 Dec 2013 14:57:02 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 19:57:03 -0000 On Monday, December 23, 2013 2:48:23 pm John Baldwin wrote: > Author: jhb > Date: Mon Dec 23 19:48:22 2013 > New Revision: 259782 > URL: http://svnweb.freebsd.org/changeset/base/259782 > > Log: > Add a resume hook for bhyve that runs a function on all CPUs during > resume. For Intel CPUs, invoke vmxon for CPUs that were in VMX mode > at the time of suspend. Prior to this, starting up bhyve after resuming was an insta-panic. With this fix, I can start new guests after resume and can even suspend/resume with a guest active and have everything work ok. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 20:39:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62C214E0; Mon, 23 Dec 2013 20:39:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E6191E32; Mon, 23 Dec 2013 20:39:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNKdtFR033889; Mon, 23 Dec 2013 20:39:55 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNKdtCX033888; Mon, 23 Dec 2013 20:39:55 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312232039.rBNKdtCX033888@svn.freebsd.org> From: Glen Barber Date: Mon, 23 Dec 2013 20:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259787 - head/release/doc/share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 20:39:55 -0000 Author: gjb Date: Mon Dec 23 20:39:54 2013 New Revision: 259787 URL: http://svnweb.freebsd.org/changeset/base/259787 Log: Update FreeBSD version entities to reflect head/ is 11.0-CURRENT. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/share/xml/release.ent Modified: head/release/doc/share/xml/release.ent ============================================================================== --- head/release/doc/share/xml/release.ent Mon Dec 23 20:21:46 2013 (r259786) +++ head/release/doc/share/xml/release.ent Mon Dec 23 20:39:54 2013 (r259787) @@ -6,23 +6,23 @@ - + - + - + - + - + From owner-svn-src-head@FreeBSD.ORG Mon Dec 23 21:58:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A7B5B53; Mon, 23 Dec 2013 21:58:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3702912D4; Mon, 23 Dec 2013 21:58:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNLw4wE062871; Mon, 23 Dec 2013 21:58:04 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNLw4Rb062870; Mon, 23 Dec 2013 21:58:04 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312232158.rBNLw4Rb062870@svn.freebsd.org> From: Glen Barber Date: Mon, 23 Dec 2013 21:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259792 - head/release/doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 21:58:04 -0000 Author: gjb Date: Mon Dec 23 21:58:03 2013 New Revision: 259792 URL: http://svnweb.freebsd.org/changeset/base/259792 Log: Remove references to SUP_UPDATE and CVS_UPDATE. Include base svn when evaluating if svn(1) exists. MFC after: 3-days X-MFC-to: stable/10 only Sponsored by: The FreeBSD Foundation Modified: head/release/doc/Makefile Modified: head/release/doc/Makefile ============================================================================== --- head/release/doc/Makefile Mon Dec 23 21:55:54 2013 (r259791) +++ head/release/doc/Makefile Mon Dec 23 21:58:03 2013 (r259792) @@ -12,31 +12,27 @@ SUBDIR+= share/xml RELN_ROOT?= ${.CURDIR} +.if exists(/usr/local/bin/svn) SVN?= /usr/local/bin/svn +.elif exists(/usr/bin/svn) +SVN?= /usr/bin/svn +.else +SVN?= /usr/bin/svnlite +.endif + SVNFLAGS?= -r HEAD update: -.if (defined(CVS_UPDATE) || defined(SUP_UPDATE)) && !defined(SVN_UPDATE) - @echo "--------------------------------------------------------------" - @echo "CVS_UPDATE and SUP_UPDATE are no longer supported." - @echo "Please see: https://wiki.freebsd.org/CvsIsDeprecated" - @echo "--------------------------------------------------------------" - @exit 1 -.endif -.if defined(SVN_UPDATE) -. if !exists(${SVN}) +.if !exists(${SVN}) @echo "--------------------------------------------------------------" @echo ">>> Updating ${RELN_ROOT} requires ${SVN}." @echo "--------------------------------------------------------------" @exit 1 -. endif +.endif @echo "--------------------------------------------------------------" - @echo ">>> Updating ${.CURDIR} using Subversion" + @echo ">>> Updating ${.CURDIR}" @echo "--------------------------------------------------------------" @(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS}) -.else - @echo "Error: Please define SVN_UPDATE first." -.endif .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.subdir.mk" From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 00:48:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2A3226C; Tue, 24 Dec 2013 00:48:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A455C1E1B; Tue, 24 Dec 2013 00:48:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBO0meKT025772; Tue, 24 Dec 2013 00:48:40 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBO0meBj025770; Tue, 24 Dec 2013 00:48:40 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201312240048.rBO0meBj025770@svn.freebsd.org> From: Rick Macklem Date: Tue, 24 Dec 2013 00:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259801 - in head/sys/fs: nfs nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 00:48:40 -0000 Author: rmacklem Date: Tue Dec 24 00:48:39 2013 New Revision: 259801 URL: http://svnweb.freebsd.org/changeset/base/259801 Log: The NFSv4 client was passing both the p and cred arguments to nfsv4_fillattr() as NULLs for the Getattr callback. This caused nfsv4_fillattr() to not fill in the Change attribute for the reply. I believe this was a violation of the RFC, but had little effect on server behaviour. This patch passes a non-NULL p argument to fix this. MFC after: 1 week Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Mon Dec 23 23:50:18 2013 (r259800) +++ head/sys/fs/nfs/nfs_commonsubs.c Tue Dec 24 00:48:39 2013 (r259801) @@ -2011,7 +2011,12 @@ nfsv4_fillattr(struct nfsrv_descript *nd * First, set the bits that can be filled and get fsinfo. */ NFSSET_ATTRBIT(retbitp, attrbitp); - /* If p and cred are NULL, it is a client side call */ + /* + * If both p and cred are NULL, it is a client side setattr call. + * If both p and cred are not NULL, it is a server side reply call. + * If p is not NULL and cred is NULL, it is a client side callback + * reply call. + */ if (p == NULL && cred == NULL) { NFSCLRNOTSETABLE_ATTRBIT(retbitp); aclp = saclp; Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Mon Dec 23 23:50:18 2013 (r259800) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue Dec 24 00:48:39 2013 (r259801) @@ -3279,7 +3279,7 @@ nfscl_docb(struct nfsrv_descript *nd, NF FREE((caddr_t)nfhp, M_NFSFH); if (!error) (void) nfsv4_fillattr(nd, NULL, NULL, NULL, &va, - NULL, 0, &rattrbits, NULL, NULL, 0, 0, 0, 0, + NULL, 0, &rattrbits, NULL, p, 0, 0, 0, 0, (uint64_t)0); break; case NFSV4OP_CBRECALL: From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 05:10:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31362BE6; Tue, 24 Dec 2013 05:10:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D59C1DB3; Tue, 24 Dec 2013 05:10:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBO5AfJI019400; Tue, 24 Dec 2013 05:10:41 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBO5Af71019399; Tue, 24 Dec 2013 05:10:41 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312240510.rBO5Af71019399@svn.freebsd.org> From: Craig Rodrigues Date: Tue, 24 Dec 2013 05:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259808 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 05:10:42 -0000 Author: rodrigc Date: Tue Dec 24 05:10:41 2013 New Revision: 259808 URL: http://svnweb.freebsd.org/changeset/base/259808 Log: Add pointer to wiki for Hyper-V information. Wiki content for Hyper-V in FreeBSD 10 was significantly updated by Abhishek Gupta . Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 24 04:27:11 2013 (r259807) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 24 05:10:41 2013 (r259808) @@ -207,7 +207,9 @@ hv_netsvc_load="YES" hv_utils_load="YES" hv_vmbus_load="YES" Alternatively, the Hyper-V drivers can be added to the i386 kernel by adding device hyperv to the kernel config, and then - recompiling the kernel. + recompiling the kernel. Please refer to: + FreeBSD and Microsoft Windows Server Hyper-V support + for full instructions on how to set up Hyper-V support under FreeBSD. The &man.vmx.4; driver has been added. &man.vmx.4; is a VMware VMXNET3 ethernet driver ported from From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 06:56:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25058C71; Tue, 24 Dec 2013 06:56:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0FA1C14AA; Tue, 24 Dec 2013 06:56:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBO6uIjH056906; Tue, 24 Dec 2013 06:56:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBO6uIMc056903; Tue, 24 Dec 2013 06:56:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312240656.rBO6uIMc056903@svn.freebsd.org> From: Xin LI Date: Tue, 24 Dec 2013 06:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259811 - in head: cddl/contrib/opensolaris/cmd/zhack sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 06:56:19 -0000 Author: delphij Date: Tue Dec 24 06:56:17 2013 New Revision: 259811 URL: http://svnweb.freebsd.org/changeset/base/259811 Log: MFV r258373: 4168 ztest assertion failure in dbuf_undirty 4169 verbatim import causes zdb to segfa 4170 zhack leaves pool in ACTIVE state illumos/illumos-gate@7fdd916c474ea52896c671bbe7b56ba34a1ca132 MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zhack/zhack.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zhack/zhack.c Tue Dec 24 05:27:45 2013 (r259810) +++ head/cddl/contrib/opensolaris/cmd/zhack/zhack.c Tue Dec 24 06:56:17 2013 (r259811) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -85,10 +85,15 @@ usage(void) static void -fatal(const char *fmt, ...) +fatal(spa_t *spa, void *tag, const char *fmt, ...) { va_list ap; + if (spa != NULL) { + spa_close(spa, tag); + (void) spa_export(g_pool, NULL, B_TRUE, B_FALSE); + } + va_start(ap, fmt); (void) fprintf(stderr, "%s: ", cmdname); (void) vfprintf(stderr, fmt, ap); @@ -159,13 +164,14 @@ import_pool(const char *target, boolean_ g_importargs.can_be_active = B_TRUE; if (zpool_search_import(g_zfs, &g_importargs) != NULL || spa_open(target, &spa, FTAG) == 0) { - fatal("cannot import '%s': pool is active; run " - "\"zpool export %s\" first\n", - g_pool, g_pool); + fatal(spa, FTAG, "cannot import '%s': pool is " + "active; run " "\"zpool export %s\" " + "first\n", g_pool, g_pool); } } - fatal("cannot import '%s': no such pool available\n", g_pool); + fatal(NULL, FTAG, "cannot import '%s': no such pool " + "available\n", g_pool); } elem = nvlist_next_nvpair(pools, NULL); @@ -186,7 +192,8 @@ import_pool(const char *target, boolean_ error = 0; if (error) - fatal("can't import '%s': %s", name, strerror(error)); + fatal(NULL, FTAG, "can't import '%s': %s", name, + strerror(error)); } static void @@ -201,10 +208,11 @@ zhack_spa_open(const char *target, boole zfeature_checks_disable = B_FALSE; if (err != 0) - fatal("cannot open '%s': %s", target, strerror(err)); + fatal(*spa, FTAG, "cannot open '%s': %s", target, + strerror(err)); if (spa_version(*spa) < SPA_VERSION_FEATURES) { - fatal("'%s' has version %d, features not enabled", target, - (int)spa_version(*spa)); + fatal(*spa, FTAG, "'%s' has version %d, features not enabled", + target, (int)spa_version(*spa)); } } @@ -336,15 +344,16 @@ zhack_do_feature_enable(int argc, char * feature.fi_guid = argv[1]; if (!zfeature_is_valid_guid(feature.fi_guid)) - fatal("invalid feature guid: %s", feature.fi_guid); + fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid); zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) - fatal("'%s' is a real feature, will not enable"); + fatal(spa, FTAG, "'%s' is a real feature, will not enable"); if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid)) - fatal("feature already enabled: %s", feature.fi_guid); + fatal(spa, FTAG, "feature already enabled: %s", + feature.fi_guid); VERIFY0(dsl_sync_task(spa_name(spa), NULL, feature_enable_sync, &feature, 5)); @@ -423,13 +432,14 @@ zhack_do_feature_ref(int argc, char **ar feature.fi_guid = argv[1]; if (!zfeature_is_valid_guid(feature.fi_guid)) - fatal("invalid feature guid: %s", feature.fi_guid); + fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid); zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) - fatal("'%s' is a real feature, will not change refcount"); + fatal(spa, FTAG, "'%s' is a real feature, will not change " + "refcount"); if (0 == zap_contains(mos, spa->spa_feat_for_read_obj, feature.fi_guid)) { @@ -438,11 +448,12 @@ zhack_do_feature_ref(int argc, char **ar feature.fi_guid)) { feature.fi_can_readonly = B_TRUE; } else { - fatal("feature is not enabled: %s", feature.fi_guid); + fatal(spa, FTAG, "feature is not enabled: %s", feature.fi_guid); } if (decr && !spa_feature_is_active(spa, &feature)) - fatal("feature refcount already 0: %s", feature.fi_guid); + fatal(spa, FTAG, "feature refcount already 0: %s", + feature.fi_guid); VERIFY0(dsl_sync_task(spa_name(spa), NULL, decr ? feature_decr_sync : feature_incr_sync, &feature, 5)); @@ -530,8 +541,8 @@ main(int argc, char **argv) usage(); } - if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_TRUE) != 0) { - fatal("pool export failed; " + if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_FALSE) != 0) { + fatal(NULL, FTAG, "pool export failed; " "changes may not be committed to disk\n"); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Dec 24 05:27:45 2013 (r259810) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Dec 24 06:56:17 2013 (r259811) @@ -1334,14 +1334,6 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_ DB_DNODE_ENTER(db); dn = DB_DNODE(db); - /* - * Note: This code will probably work even if there are concurrent - * holders, but it is untested in that scenerio, as the ZPL and - * ztest have additional locking (the range locks) that prevents - * that type of concurrent access. - */ - ASSERT3U(refcount_count(&db->db_holds), ==, db->db_dirtycnt); - dprintf_dbuf(db, "size=%llx\n", (u_longlong_t)db->db.db_size); ASSERT(db->db.db_size != 0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Dec 24 05:27:45 2013 (r259810) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Dec 24 06:56:17 2013 (r259811) @@ -4103,8 +4103,6 @@ spa_import(const char *pool, nvlist_t *c spa_config_sync(spa, B_FALSE, B_TRUE); mutex_exit(&spa_namespace_lock); - spa_history_log_version(spa, "import"); - return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 07:02:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3481E78; Tue, 24 Dec 2013 07:02:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BF63C1531; Tue, 24 Dec 2013 07:02:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBO725HC060123; Tue, 24 Dec 2013 07:02:05 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBO7256Q060118; Tue, 24 Dec 2013 07:02:05 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201312240702.rBO7256Q060118@svn.freebsd.org> From: Kevin Lo Date: Tue, 24 Dec 2013 07:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259812 - in head/sys/dev/usb: . wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 07:02:05 -0000 Author: kevlo Date: Tue Dec 24 07:02:05 2013 New Revision: 259812 URL: http://svnweb.freebsd.org/changeset/base/259812 Log: Some devices have a dual mode such as Tenda W326U and ZyXEL NWD2705, add the product id and use a standard scsi eject. Tested on the ZyXEL NWD2705 wlan dongle. Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Dec 24 06:56:17 2013 (r259811) +++ head/sys/dev/usb/usbdevs Tue Dec 24 07:02:05 2013 (r259812) @@ -3601,6 +3601,7 @@ product RALINK RT2573 0x2573 RT2501USB product RALINK RT2671 0x2671 RT2601USB Wireless Adapter product RALINK RT2770 0x2770 RT2770 product RALINK RT2870 0x2870 RT2870 +product RALINK RT_STOR 0x2878 USB Storage product RALINK RT3070 0x3070 RT3070 product RALINK RT3071 0x3071 RT3071 product RALINK RT3072 0x3072 RT3072 @@ -4480,3 +4481,4 @@ product ZYXEL G202 0x3410 G-202 product ZYXEL RT2870_1 0x3416 RT2870 product ZYXEL RT2870_2 0x341a RT2870 product ZYXEL RTL8192CU 0x341f RTL8192CU +product ZYXEL NWD2705 0x3421 NWD2705 Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Tue Dec 24 06:56:17 2013 (r259811) +++ head/sys/dev/usb/wlan/if_run.c Tue Dec 24 07:02:05 2013 (r259812) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #define USB_DEBUG_VAR run_debug #include +#include #include #include @@ -98,6 +99,8 @@ SYSCTL_INT(_hw_usb_run, OID_AUTO, debug, static const STRUCT_USB_HOST_ID run_devs[] = { #define RUN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } +#define RUN_DEV_EJECT(v,p) \ + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, 0) } RUN_DEV(ABOCOM, RT2770), RUN_DEV(ABOCOM, RT2870), RUN_DEV(ABOCOM, RT3070), @@ -307,6 +310,8 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(ZINWELL, RT3072_2), RUN_DEV(ZYXEL, RT2870_1), RUN_DEV(ZYXEL, RT2870_2), + RUN_DEV_EJECT(RALINK, RT_STOR), +#undef RUN_DEV_EJECT #undef RUN_DEV }; @@ -322,6 +327,9 @@ static usb_callback_t run_bulk_tx_callba static usb_callback_t run_bulk_tx_callback4; static usb_callback_t run_bulk_tx_callback5; +static void run_autoinst(void *, struct usb_device *, + struct usb_attach_arg *); +static int run_driver_loaded(struct module *, int, void *); static void run_bulk_tx_callbackN(struct usb_xfer *xfer, usb_error_t error, u_int index); static struct ieee80211vap *run_vap_create(struct ieee80211com *, @@ -438,6 +446,8 @@ static void run_init_locked(struct run_s static void run_stop(void *); static void run_delay(struct run_softc *, u_int); +static eventhandler_tag run_etag; + static const struct rt2860_rate { uint8_t rate; uint8_t mcs; @@ -614,6 +624,46 @@ static const struct usb_config run_confi } }; +static void +run_autoinst(void *arg, struct usb_device *udev, + struct usb_attach_arg *uaa) +{ + struct usb_interface *iface; + struct usb_interface_descriptor *id; + + if (uaa->dev_state != UAA_DEV_READY) + return; + + iface = usbd_get_iface(udev, 0); + if (iface == NULL) + return; + id = iface->idesc; + if (id == NULL || id->bInterfaceClass != UICLASS_MASS) + return; + if (usbd_lookup_id_by_uaa(run_devs, sizeof(run_devs), uaa)) + return; + + if (usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT) == 0) + uaa->dev_state = UAA_DEV_EJECTING; +} + +static int +run_driver_loaded(struct module *mod, int what, void *arg) +{ + switch (what) { + case MOD_LOAD: + run_etag = EVENTHANDLER_REGISTER(usb_dev_configured, + run_autoinst, NULL, EVENTHANDLER_PRI_ANY); + break; + case MOD_UNLOAD: + EVENTHANDLER_DEREGISTER(usb_dev_configured, run_etag); + break; + default: + return (EOPNOTSUPP); + } + return (0); +} + static int run_match(device_t self) { @@ -5793,7 +5843,7 @@ static driver_t run_driver = { static devclass_t run_devclass; -DRIVER_MODULE(run, uhub, run_driver, run_devclass, NULL, NULL); +DRIVER_MODULE(run, uhub, run_driver, run_devclass, run_driver_loaded, NULL); MODULE_DEPEND(run, wlan, 1, 1, 1); MODULE_DEPEND(run, usb, 1, 1, 1); MODULE_DEPEND(run, firmware, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 07:14:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6224BDE; Tue, 24 Dec 2013 07:14:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A6E015C3; Tue, 24 Dec 2013 07:14:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBO7EV5c064303; Tue, 24 Dec 2013 07:14:31 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBO7EQoT064268; Tue, 24 Dec 2013 07:14:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312240714.rBO7EQoT064268@svn.freebsd.org> From: Xin LI Date: Tue, 24 Dec 2013 07:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259813 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/ope... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 07:14:31 -0000 Author: delphij Date: Tue Dec 24 07:14:25 2013 New Revision: 259813 URL: http://svnweb.freebsd.org/changeset/base/259813 Log: MFV r258374: 4171 clean up spa_feature_*() interfaces 4172 implement extensible_dataset feature for use by other zpool features illumos/illumos-gate@2acef22db7808606888f8f92715629ff3ba555b9 MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/zhack/zhack.c head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Dec 24 07:14:25 2013 (r259813) @@ -559,16 +559,20 @@ get_metaslab_refcount(vdev_t *vd) static int verify_spacemap_refcounts(spa_t *spa) { - int expected_refcount, actual_refcount; + uint64_t expected_refcount = 0; + uint64_t actual_refcount; - expected_refcount = spa_feature_get_refcount(spa, - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]); + (void) feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM], + &expected_refcount); actual_refcount = get_dtl_refcount(spa->spa_root_vdev); actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); if (expected_refcount != actual_refcount) { - (void) printf("space map refcount mismatch: expected %d != " - "actual %d\n", expected_refcount, actual_refcount); + (void) printf("space map refcount mismatch: expected %lld != " + "actual %lld\n", + (longlong_t)expected_refcount, + (longlong_t)actual_refcount); return (2); } return (0); @@ -670,8 +674,7 @@ dump_metaslab(metaslab_t *msp) } if (dump_opt['m'] > 1 && sm != NULL && - spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) { + spa_feature_is_active(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { /* * The space map histogram represents free space in chunks * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). @@ -2417,8 +2420,7 @@ dump_block_stats(spa_t *spa) (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, count_block_cb, &zcb, NULL); } - if (spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + if (spa_feature_is_active(spa, SPA_FEATURE_ASYNC_DESTROY)) { VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset, spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb, &zcb, NULL)); @@ -2719,7 +2721,7 @@ dump_zpool(spa_t *spa) } if (spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + SPA_FEATURE_ASYNC_DESTROY)) { dump_bptree(spa->spa_meta_objset, spa->spa_dsl_pool->dp_bptree_obj, "Pool dataset frees"); Modified: head/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zhack/zhack.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/cddl/contrib/opensolaris/cmd/zhack/zhack.c Tue Dec 24 07:14:25 2013 (r259813) @@ -283,12 +283,13 @@ zhack_do_feature_stat(int argc, char **a } static void -feature_enable_sync(void *arg, dmu_tx_t *tx) +zhack_feature_enable_sync(void *arg, dmu_tx_t *tx) { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; - spa_feature_enable(spa, feature, tx); + feature_enable_sync(spa, feature, tx); + spa_history_log_internal(spa, "zhack enable feature", tx, "name=%s can_readonly=%u", feature->fi_guid, feature->fi_can_readonly); @@ -302,7 +303,7 @@ zhack_do_feature_enable(int argc, char * spa_t *spa; objset_t *mos; zfeature_info_t feature; - zfeature_info_t *nodeps[] = { NULL }; + spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; /* * Features are not added to the pool's label until their refcounts @@ -349,14 +350,14 @@ zhack_do_feature_enable(int argc, char * zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; - if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) + if (zfeature_is_supported(feature.fi_guid)) fatal(spa, FTAG, "'%s' is a real feature, will not enable"); if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid)) fatal(spa, FTAG, "feature already enabled: %s", feature.fi_guid); VERIFY0(dsl_sync_task(spa_name(spa), NULL, - feature_enable_sync, &feature, 5)); + zhack_feature_enable_sync, &feature, 5)); spa_close(spa, FTAG); @@ -368,8 +369,10 @@ feature_incr_sync(void *arg, dmu_tx_t *t { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; + uint64_t refcount; - spa_feature_incr(spa, feature, tx); + VERIFY0(feature_get_refcount(spa, feature, &refcount)); + feature_sync(spa, feature, refcount + 1, tx); spa_history_log_internal(spa, "zhack feature incr", tx, "name=%s", feature->fi_guid); } @@ -379,8 +382,10 @@ feature_decr_sync(void *arg, dmu_tx_t *t { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; + uint64_t refcount; - spa_feature_decr(spa, feature, tx); + VERIFY0(feature_get_refcount(spa, feature, &refcount)); + feature_sync(spa, feature, refcount - 1, tx); spa_history_log_internal(spa, "zhack feature decr", tx, "name=%s", feature->fi_guid); } @@ -394,7 +399,7 @@ zhack_do_feature_ref(int argc, char **ar spa_t *spa; objset_t *mos; zfeature_info_t feature; - zfeature_info_t *nodeps[] = { NULL }; + spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; /* * fi_desc does not matter here because it was written to disk @@ -437,9 +442,10 @@ zhack_do_feature_ref(int argc, char **ar zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; - if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) - fatal(spa, FTAG, "'%s' is a real feature, will not change " - "refcount"); + if (zfeature_is_supported(feature.fi_guid)) { + fatal(spa, FTAG, + "'%s' is a real feature, will not change refcount"); + } if (0 == zap_contains(mos, spa->spa_feat_for_read_obj, feature.fi_guid)) { @@ -451,9 +457,14 @@ zhack_do_feature_ref(int argc, char **ar fatal(spa, FTAG, "feature is not enabled: %s", feature.fi_guid); } - if (decr && !spa_feature_is_active(spa, &feature)) - fatal(spa, FTAG, "feature refcount already 0: %s", - feature.fi_guid); + if (decr) { + uint64_t count; + if (feature_get_refcount(spa, &feature, &count) == 0 && + count != 0) { + fatal(spa, FTAG, "feature refcount already 0: %s", + feature.fi_guid); + } + } VERIFY0(dsl_sync_task(spa_name(spa), NULL, decr ? feature_decr_sync : feature_incr_sync, &feature, 5)); Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Dec 24 07:02:05 2013 (r259812) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Dec 24 07:14:25 2013 (r259813) @@ -270,6 +270,23 @@ Once the feature is .Sy active , it will remain in that state until the pool is destroyed. .El +.It Sy extensible_dataset +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:extensible_dataset" +.It GUID Ta com.delphix:extensible_dataset +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +This feature allows more flexible use of internal ZFS data structures, +and exists for other features to depend on. +.Pp +This feature will be +.Sy active +when the first dependent feature uses it, +and will be returned to the +.Sy enabled +state when all datasets that use +this feature are destroyed. .Sh SEE ALSO .Xr zpool 8 .Sh AUTHORS Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Dec 24 07:14:25 2013 (r259813) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. @@ -1004,7 +1004,7 @@ zpool_do_create(int argc, char **argv) * Hand off to libzfs. */ if (enable_all_pool_feat) { - int i; + spa_feature_t i; for (i = 0; i < SPA_FEATURES; i++) { char propname[MAXPATHLEN]; zfeature_info_t *feat = &spa_feature_table[i]; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Tue Dec 24 07:14:25 2013 (r259813) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -443,10 +443,9 @@ zpool_valid_proplist(libzfs_handle_t *hd prop = zpool_name_to_prop(propname); if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) { int err; - zfeature_info_t *feature; char *fname = strchr(propname, '@') + 1; - err = zfeature_lookup_name(fname, &feature); + err = zfeature_lookup_name(fname, NULL); if (err != 0) { ASSERT3U(err, ==, ENOENT); zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, @@ -839,14 +838,14 @@ zpool_prop_get_feature(zpool_handle_t *z */ if (supported) { int ret; - zfeature_info_t *fi; + spa_feature_t fid; - ret = zfeature_lookup_name(feature, &fi); + ret = zfeature_lookup_name(feature, &fid); if (ret != 0) { (void) strlcpy(buf, "-", len); return (ENOTSUP); } - feature = fi->fi_guid; + feature = spa_feature_table[fid].fi_guid; } if (nvlist_lookup_uint64(features, feature, &refcount) == 0) Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Tue Dec 24 07:14:25 2013 (r259813) @@ -91,32 +91,22 @@ zfeature_is_supported(const char *guid) if (zfeature_checks_disable) return (B_TRUE); - return (0 == zfeature_lookup_guid(guid, NULL)); -} - -int -zfeature_lookup_guid(const char *guid, zfeature_info_t **res) -{ - for (int i = 0; i < SPA_FEATURES; i++) { + for (spa_feature_t i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *feature = &spa_feature_table[i]; - if (strcmp(guid, feature->fi_guid) == 0) { - if (res != NULL) - *res = feature; - return (0); - } + if (strcmp(guid, feature->fi_guid) == 0) + return (B_TRUE); } - - return (ENOENT); + return (B_FALSE); } int -zfeature_lookup_name(const char *name, zfeature_info_t **res) +zfeature_lookup_name(const char *name, spa_feature_t *res) { - for (int i = 0; i < SPA_FEATURES; i++) { + for (spa_feature_t i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *feature = &spa_feature_table[i]; if (strcmp(name, feature->fi_uname) == 0) { if (res != NULL) - *res = feature; + *res = i; return (0); } } @@ -125,11 +115,12 @@ zfeature_lookup_name(const char *name, z } static void -zfeature_register(int fid, const char *guid, const char *name, const char *desc, - boolean_t readonly, boolean_t mos, zfeature_info_t **deps) +zfeature_register(spa_feature_t fid, const char *guid, const char *name, + const char *desc, boolean_t readonly, boolean_t mos, + const spa_feature_t *deps) { zfeature_info_t *feature = &spa_feature_table[fid]; - static zfeature_info_t *nodeps[] = { NULL }; + static spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; ASSERT(name != NULL); ASSERT(desc != NULL); @@ -140,6 +131,7 @@ zfeature_register(int fid, const char *g if (deps == NULL) deps = nodeps; + feature->fi_feature = fid; feature->fi_guid = guid; feature->fi_uname = name; feature->fi_desc = desc; @@ -166,4 +158,8 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, "com.delphix:spacemap_histogram", "spacemap_histogram", "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_EXTENSIBLE_DATASET, + "com.delphix:extensible_dataset", "extensible_dataset", + "Enhanced dataset functionality, used by other features.", + B_FALSE, B_FALSE, NULL); } Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Tue Dec 24 07:14:25 2013 (r259813) @@ -37,35 +37,38 @@ extern "C" { struct zfeature_info; +typedef enum spa_feature { + SPA_FEATURE_NONE = -1, + SPA_FEATURE_ASYNC_DESTROY, + SPA_FEATURE_EMPTY_BPOBJ, + SPA_FEATURE_LZ4_COMPRESS, + SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + SPA_FEATURE_SPACEMAP_HISTOGRAM, + SPA_FEATURE_EXTENSIBLE_DATASET, + SPA_FEATURES +} spa_feature_t; + typedef struct zfeature_info { + spa_feature_t fi_feature; const char *fi_uname; /* User-facing feature name */ const char *fi_guid; /* On-disk feature identifier */ const char *fi_desc; /* Feature description */ boolean_t fi_can_readonly; /* Can open pool readonly w/o support? */ boolean_t fi_mos; /* Is the feature necessary to read the MOS? */ - struct zfeature_info **fi_depends; /* array; null terminated */ + /* array of dependencies, terminated by SPA_FEATURE_NONE */ + const spa_feature_t *fi_depends; } zfeature_info_t; typedef int (zfeature_func_t)(zfeature_info_t *fi, void *arg); #define ZFS_FEATURE_DEBUG -static enum spa_feature { - SPA_FEATURE_ASYNC_DESTROY, - SPA_FEATURE_EMPTY_BPOBJ, - SPA_FEATURE_LZ4_COMPRESS, - SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, - SPA_FEATURE_SPACEMAP_HISTOGRAM, - SPA_FEATURES -} spa_feature_t; - extern zfeature_info_t spa_feature_table[SPA_FEATURES]; extern boolean_t zfeature_is_valid_guid(const char *); extern boolean_t zfeature_is_supported(const char *); -extern int zfeature_lookup_guid(const char *, zfeature_info_t **res); -extern int zfeature_lookup_name(const char *, zfeature_info_t **res); +extern int zfeature_lookup_name(const char *name, spa_feature_t *res); extern void zpool_feature_init(void); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Tue Dec 24 07:14:25 2013 (r259813) @@ -36,13 +36,11 @@ uint64_t bpobj_alloc_empty(objset_t *os, int blocksize, dmu_tx_t *tx) { - zfeature_info_t *empty_bpobj_feat = - &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; spa_t *spa = dmu_objset_spa(os); dsl_pool_t *dp = dmu_objset_pool(os); - if (spa_feature_is_enabled(spa, empty_bpobj_feat)) { - if (!spa_feature_is_active(spa, empty_bpobj_feat)) { + if (spa_feature_is_enabled(spa, SPA_FEATURE_EMPTY_BPOBJ)) { + if (!spa_feature_is_active(spa, SPA_FEATURE_EMPTY_BPOBJ)) { ASSERT0(dp->dp_empty_bpobj); dp->dp_empty_bpobj = bpobj_alloc(os, SPA_MAXBLOCKSIZE, tx); @@ -51,7 +49,7 @@ bpobj_alloc_empty(objset_t *os, int bloc DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, &dp->dp_empty_bpobj, tx) == 0); } - spa_feature_incr(spa, empty_bpobj_feat, tx); + spa_feature_incr(spa, SPA_FEATURE_EMPTY_BPOBJ, tx); ASSERT(dp->dp_empty_bpobj != 0); return (dp->dp_empty_bpobj); } else { @@ -62,12 +60,11 @@ bpobj_alloc_empty(objset_t *os, int bloc void bpobj_decr_empty(objset_t *os, dmu_tx_t *tx) { - zfeature_info_t *empty_bpobj_feat = - &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; dsl_pool_t *dp = dmu_objset_pool(os); - spa_feature_decr(dmu_objset_spa(os), empty_bpobj_feat, tx); - if (!spa_feature_is_active(dmu_objset_spa(os), empty_bpobj_feat)) { + spa_feature_decr(dmu_objset_spa(os), SPA_FEATURE_EMPTY_BPOBJ, tx); + if (!spa_feature_is_active(dmu_objset_spa(os), + SPA_FEATURE_EMPTY_BPOBJ)) { VERIFY3U(0, ==, zap_remove(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_EMPTY_BPOBJ, tx)); @@ -265,6 +262,7 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_i mutex_exit(&bpo->bpo_lock); return (err); } + ASSERT3U(doi.doi_type, ==, DMU_OT_BPOBJ_SUBOBJ); epb = doi.doi_data_block_size / sizeof (uint64_t); for (i = bpo->bpo_phys->bpo_num_subobjs - 1; i >= 0; i--) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Tue Dec 24 07:14:25 2013 (r259813) @@ -27,6 +27,8 @@ #include #include #include +#include +#include uint64_t dmu_object_alloc(objset_t *os, dmu_object_type_t ot, int blocksize, @@ -195,3 +197,54 @@ dmu_object_next(objset_t *os, uint64_t * return (error); } + +/* + * Turn this object from old_type into DMU_OTN_ZAP_METADATA, and bump the + * refcount on SPA_FEATURE_EXTENSIBLE_DATASET. + * + * Only for use from syncing context, on MOS objects. + */ +void +dmu_object_zapify(objset_t *mos, uint64_t object, dmu_object_type_t old_type, + dmu_tx_t *tx) +{ + dnode_t *dn; + + ASSERT(dmu_tx_is_syncing(tx)); + + VERIFY0(dnode_hold(mos, object, FTAG, &dn)); + if (dn->dn_type == DMU_OTN_ZAP_METADATA) { + dnode_rele(dn, FTAG); + return; + } + ASSERT3U(dn->dn_type, ==, old_type); + ASSERT0(dn->dn_maxblkid); + dn->dn_next_type[tx->tx_txg & TXG_MASK] = dn->dn_type = + DMU_OTN_ZAP_METADATA; + dnode_setdirty(dn, tx); + dnode_rele(dn, FTAG); + + mzap_create_impl(mos, object, 0, 0, tx); + + spa_feature_incr(dmu_objset_spa(mos), + SPA_FEATURE_EXTENSIBLE_DATASET, tx); +} + +void +dmu_object_free_zapified(objset_t *mos, uint64_t object, dmu_tx_t *tx) +{ + dnode_t *dn; + dmu_object_type_t t; + + ASSERT(dmu_tx_is_syncing(tx)); + + VERIFY0(dnode_hold(mos, object, FTAG, &dn)); + t = dn->dn_type; + dnode_rele(dn, FTAG); + + if (t == DMU_OTN_ZAP_METADATA) { + spa_feature_decr(dmu_objset_spa(mos), + SPA_FEATURE_EXTENSIBLE_DATASET, tx); + } + VERIFY0(dmu_object_free(mos, object, tx)); +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Tue Dec 24 07:14:25 2013 (r259813) @@ -605,7 +605,7 @@ traverse_pool(spa_t *spa, uint64_t txg_s continue; } - if (doi.doi_type == DMU_OT_DSL_DATASET) { + if (doi.doi_bonus_type == DMU_OT_DSL_DATASET) { dsl_dataset_t *ds; uint64_t txg = txg_start; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Tue Dec 24 07:14:25 2013 (r259813) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -577,7 +577,12 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) BP_GET_LSIZE(&dnp->dn_blkptr[0]) == dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT); - if (dn->dn_next_blksz[txgoff]) { + if (dn->dn_next_type[txgoff] != 0) { + dnp->dn_type = dn->dn_type; + dn->dn_next_type[txgoff] = 0; + } + + if (dn->dn_next_blksz[txgoff] != 0) { ASSERT(P2PHASE(dn->dn_next_blksz[txgoff], SPA_MINBLOCKSIZE) == 0); ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[0]) || @@ -590,7 +595,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dn->dn_next_blksz[txgoff] = 0; } - if (dn->dn_next_bonuslen[txgoff]) { + if (dn->dn_next_bonuslen[txgoff] != 0) { if (dn->dn_next_bonuslen[txgoff] == DN_ZERO_BONUSLEN) dnp->dn_bonuslen = 0; else @@ -599,7 +604,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dn->dn_next_bonuslen[txgoff] = 0; } - if (dn->dn_next_bonustype[txgoff]) { + if (dn->dn_next_bonustype[txgoff] != 0) { ASSERT(DMU_OT_IS_VALID(dn->dn_next_bonustype[txgoff])); dnp->dn_bonustype = dn->dn_next_bonustype[txgoff]; dn->dn_next_bonustype[txgoff] = 0; @@ -617,7 +622,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dn->dn_rm_spillblk[txgoff] = 0; } - if (dn->dn_next_indblkshift[txgoff]) { + if (dn->dn_next_indblkshift[txgoff] != 0) { ASSERT(dnp->dn_nlevels == 1); dnp->dn_indblkshift = dn->dn_next_indblkshift[txgoff]; dn->dn_next_indblkshift[txgoff] = 0; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Dec 24 07:14:25 2013 (r259813) @@ -357,7 +357,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin /* Make sure dsobj has the correct object type. */ dmu_object_info_from_db(dbuf, &doi); - if (doi.doi_type != DMU_OT_DSL_DATASET) { + if (doi.doi_bonus_type != DMU_OT_DSL_DATASET) { dmu_buf_rele(dbuf, tag); return (SET_ERROR(EINVAL)); } @@ -3052,3 +3052,11 @@ dsl_dataset_is_before(dsl_dataset_t *lat dsl_dataset_rele(origin, FTAG); return (ret); } + + +void +dsl_dataset_zapify(dsl_dataset_t *ds, dmu_tx_t *tx) +{ + objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; + dmu_object_zapify(mos, ds->ds_object, DMU_OT_DSL_DATASET, tx); +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Dec 24 07:14:25 2013 (r259813) @@ -38,6 +38,7 @@ #include #include #include +#include typedef struct dmu_snapshots_destroy_arg { nvlist_t *dsda_snaps; @@ -448,7 +449,7 @@ dsl_destroy_snapshot_sync_impl(dsl_datas VERIFY0(zap_destroy(mos, ds->ds_phys->ds_userrefs_obj, tx)); dsl_dir_rele(ds->ds_dir, ds); ds->ds_dir = NULL; - VERIFY0(dmu_object_free(mos, obj, tx)); + dmu_object_free_zapified(mos, obj, tx); } static void @@ -671,7 +672,7 @@ dsl_dir_destroy_sync(uint64_t ddobj, dmu dd->dd_parent->dd_phys->dd_child_dir_zapobj, dd->dd_myname, tx)); dsl_dir_rele(dd, FTAG); - VERIFY0(dmu_object_free(mos, ddobj, tx)); + dmu_object_free_zapified(mos, ddobj, tx); } void @@ -724,10 +725,6 @@ dsl_destroy_head_sync_impl(dsl_dataset_t ds->ds_prev->ds_phys->ds_num_children--; } - zfeature_info_t *async_destroy = - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]; - objset_t *os; - /* * Destroy the deadlist. Unless it's a clone, the * deadlist should be empty. (If it's a clone, it's @@ -738,9 +735,10 @@ dsl_destroy_head_sync_impl(dsl_dataset_t dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_phys->ds_deadlist_obj = 0; + objset_t *os; VERIFY0(dmu_objset_from_ds(ds, &os)); - if (!spa_feature_is_enabled(dp->dp_spa, async_destroy)) { + if (!spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY)) { old_synchronous_dataset_destroy(ds, tx); } else { /* @@ -751,10 +749,11 @@ dsl_destroy_head_sync_impl(dsl_dataset_t zil_destroy_sync(dmu_objset_zil(os), tx); - if (!spa_feature_is_active(dp->dp_spa, async_destroy)) { + if (!spa_feature_is_active(dp->dp_spa, + SPA_FEATURE_ASYNC_DESTROY)) { dsl_scan_t *scn = dp->dp_scan; - - spa_feature_incr(dp->dp_spa, async_destroy, tx); + spa_feature_incr(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY, + tx); dp->dp_bptree_obj = bptree_alloc(mos, tx); VERIFY0(zap_add(mos, DMU_POOL_DIRECTORY_OBJECT, @@ -814,7 +813,7 @@ dsl_destroy_head_sync_impl(dsl_dataset_t ASSERT0(ds->ds_phys->ds_userrefs_obj); dsl_dir_rele(ds->ds_dir, ds); ds->ds_dir = NULL; - VERIFY0(dmu_object_free(mos, obj, tx)); + dmu_object_free_zapified(mos, obj, tx); dsl_dir_destroy_sync(ddobj, tx); @@ -870,8 +869,7 @@ dsl_destroy_head(const char *name) error = spa_open(name, &spa, FTAG); if (error != 0) return (error); - isenabled = spa_feature_is_enabled(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]); + isenabled = spa_feature_is_enabled(spa, SPA_FEATURE_ASYNC_DESTROY); spa_close(spa, FTAG); ddha.ddha_name = name; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Dec 24 07:14:25 2013 (r259813) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -93,7 +94,7 @@ dsl_dir_hold_obj(dsl_pool_t *dp, uint64_ { dmu_object_info_t doi; dmu_object_info_from_db(dbuf, &doi); - ASSERT3U(doi.doi_type, ==, DMU_OT_DSL_DIR); + ASSERT3U(doi.doi_bonus_type, ==, DMU_OT_DSL_DIR); ASSERT3U(doi.doi_bonus_size, >=, sizeof (dsl_dir_phys_t)); } #endif @@ -1363,3 +1364,10 @@ dsl_dir_snap_cmtime_update(dsl_dir_t *dd dd->dd_snap_cmtime = t; mutex_exit(&dd->dd_lock); } + +void +dsl_dir_zapify(dsl_dir_t *dd, dmu_tx_t *tx) +{ + objset_t *mos = dd->dd_pool->dp_meta_objset; + dmu_object_zapify(mos, dd->dd_object, DMU_OT_DSL_DIR, tx); +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Tue Dec 24 07:14:25 2013 (r259813) @@ -278,8 +278,7 @@ dsl_pool_open(dsl_pool_t *dp) dp->dp_meta_objset, obj)); } - if (spa_feature_is_active(dp->dp_spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY)) { err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1, &dp->dp_bptree_obj); @@ -287,8 +286,7 @@ dsl_pool_open(dsl_pool_t *dp) goto out; } - if (spa_feature_is_active(dp->dp_spa, - &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ])) { + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_EMPTY_BPOBJ)) { err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, &dp->dp_empty_bpobj); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Tue Dec 24 07:14:25 2013 (r259813) @@ -132,7 +132,7 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t t */ ASSERT(!scn->scn_async_destroying); scn->scn_async_destroying = spa_feature_is_active(dp->dp_spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]); + SPA_FEATURE_ASYNC_DESTROY); err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, "scrub_func", sizeof (uint64_t), 1, &f); @@ -1384,7 +1384,6 @@ dsl_scan_active(dsl_scan_t *scn) return (B_FALSE); if (spa_shutting_down(spa)) return (B_FALSE); - if (scn->scn_phys.scn_state == DSS_SCANNING || scn->scn_async_destroying) return (B_TRUE); @@ -1443,7 +1442,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * VERIFY3U(0, ==, zio_wait(scn->scn_zio_root)); if (err == 0 && spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + SPA_FEATURE_ASYNC_DESTROY)) { ASSERT(scn->scn_async_destroying); scn->scn_is_bptree = B_TRUE; scn->scn_zio_root = zio_root(dp->dp_spa, NULL, @@ -1454,11 +1453,11 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * VERIFY0(zio_wait(scn->scn_zio_root)); if (err == 0) { - zfeature_info_t *feat = &spa_feature_table - [SPA_FEATURE_ASYNC_DESTROY]; /* finished; deactivate async destroy feature */ - spa_feature_decr(spa, feat, tx); - ASSERT(!spa_feature_is_active(spa, feat)); + spa_feature_decr(spa, SPA_FEATURE_ASYNC_DESTROY, + tx); + ASSERT(!spa_feature_is_active(spa, + SPA_FEATURE_ASYNC_DESTROY)); VERIFY0(zap_remove(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, tx)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Dec 24 07:14:25 2013 (r259813) @@ -2350,14 +2350,12 @@ spa_load_impl(spa_t *spa, uint64_t pool_ enabled_feat = fnvlist_alloc(); unsup_feat = fnvlist_alloc(); - if (!feature_is_supported(spa->spa_meta_objset, - spa->spa_feat_for_read_obj, spa->spa_feat_desc_obj, + if (!spa_features_check(spa, B_FALSE, unsup_feat, enabled_feat)) missing_feat_read = B_TRUE; if (spa_writeable(spa) || state == SPA_LOAD_TRYIMPORT) { - if (!feature_is_supported(spa->spa_meta_objset, - spa->spa_feat_for_write_obj, spa->spa_feat_desc_obj, + if (!spa_features_check(spa, B_TRUE, unsup_feat, enabled_feat)) { missing_feat_write = B_TRUE; } @@ -6231,7 +6229,7 @@ spa_sync_props(void *arg, dmu_tx_t *tx) zpool_prop_t prop; const char *propname; zprop_type_t proptype; - zfeature_info_t *feature; + spa_feature_t fid; switch (prop = zpool_name_to_prop(nvpair_name(elem))) { case ZPROP_INVAL: @@ -6241,9 +6239,9 @@ spa_sync_props(void *arg, dmu_tx_t *tx) ASSERT(zpool_prop_feature(nvpair_name(elem))); fname = strchr(nvpair_name(elem), '@') + 1; - VERIFY0(zfeature_lookup_name(fname, &feature)); + VERIFY0(zfeature_lookup_name(fname, &fid)); - spa_feature_enable(spa, feature, tx); + spa_feature_enable(spa, fid, tx); spa_history_log_internal(spa, "set", tx, "%s=enabled", nvpair_name(elem)); break; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Dec 24 07:14:25 2013 (r259813) @@ -1193,15 +1193,17 @@ spa_vdev_state_exit(spa_t *spa, vdev_t * void spa_activate_mos_feature(spa_t *spa, const char *feature) { - (void) nvlist_add_boolean(spa->spa_label_features, feature); - vdev_config_dirty(spa->spa_root_vdev); + if (!nvlist_exists(spa->spa_label_features, feature)) { + fnvlist_add_boolean(spa->spa_label_features, feature); + vdev_config_dirty(spa->spa_root_vdev); + } } void spa_deactivate_mos_feature(spa_t *spa, const char *feature) { - (void) nvlist_remove_all(spa->spa_label_features, feature); - vdev_config_dirty(spa->spa_root_vdev); + if (nvlist_remove_all(spa->spa_label_features, feature) == 0) + vdev_config_dirty(spa->spa_root_vdev); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Tue Dec 24 07:14:25 2013 (r259813) @@ -474,8 +474,6 @@ space_map_truncate(space_map_t *sm, dmu_ { objset_t *os = sm->sm_os; spa_t *spa = dmu_objset_spa(os); - zfeature_info_t *space_map_histogram = - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]; dmu_object_info_t doi; int bonuslen; @@ -485,7 +483,7 @@ space_map_truncate(space_map_t *sm, dmu_ VERIFY0(dmu_free_range(os, space_map_object(sm), 0, -1ULL, tx)); dmu_object_info_from_db(sm->sm_dbuf, &doi); - if (spa_feature_is_enabled(spa, space_map_histogram)) { + if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { bonuslen = sizeof (space_map_phys_t); ASSERT3U(bonuslen, <=, dmu_bonus_max()); } else { @@ -525,13 +523,11 @@ uint64_t space_map_alloc(objset_t *os, dmu_tx_t *tx) { spa_t *spa = dmu_objset_spa(os); - zfeature_info_t *space_map_histogram = - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]; uint64_t object; int bonuslen; - if (spa_feature_is_enabled(spa, space_map_histogram)) { - spa_feature_incr(spa, space_map_histogram, tx); + if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { + spa_feature_incr(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM, tx); bonuslen = sizeof (space_map_phys_t); ASSERT3U(bonuslen, <=, dmu_bonus_max()); } else { @@ -549,20 +545,20 @@ void space_map_free(space_map_t *sm, dmu_tx_t *tx) { spa_t *spa; - zfeature_info_t *space_map_histogram = - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]; if (sm == NULL) return; spa = dmu_objset_spa(sm->sm_os); - if (spa_feature_is_enabled(spa, space_map_histogram)) { + if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { dmu_object_info_t doi; dmu_object_info_from_db(sm->sm_dbuf, &doi); if (doi.doi_bonus_size != SPACE_MAP_SIZE_V0) { - VERIFY(spa_feature_is_active(spa, space_map_histogram)); - spa_feature_decr(spa, space_map_histogram, tx); + VERIFY(spa_feature_is_active(spa, + SPA_FEATURE_SPACEMAP_HISTOGRAM)); + spa_feature_decr(spa, + SPA_FEATURE_SPACEMAP_HISTOGRAM, tx); } } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Tue Dec 24 07:14:25 2013 (r259813) @@ -301,6 +301,8 @@ typedef struct dmu_sendarg { uint64_t dsa_last_data_offset; } dmu_sendarg_t; +void dmu_object_zapify(objset_t *, uint64_t, dmu_object_type_t, dmu_tx_t *); +void dmu_object_free_zapified(objset_t *, uint64_t, dmu_tx_t *); #ifdef __cplusplus } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Tue Dec 24 07:14:25 2013 (r259813) @@ -178,6 +178,7 @@ typedef struct dnode { uint16_t dn_datablkszsec; /* in 512b sectors */ uint32_t dn_datablksz; /* in bytes */ uint64_t dn_maxblkid; + uint8_t dn_next_type[TXG_SIZE]; uint8_t dn_next_nblkptr[TXG_SIZE]; uint8_t dn_next_nlevels[TXG_SIZE]; uint8_t dn_next_indblkshift[TXG_SIZE]; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Dec 24 07:14:25 2013 (r259813) @@ -49,9 +49,9 @@ struct dsl_pool; #define DS_FLAG_INCONSISTENT (1ULL<<0) #define DS_IS_INCONSISTENT(ds) \ ((ds)->ds_phys->ds_flags & DS_FLAG_INCONSISTENT) + /* - * Note: nopromote can not yet be set, but we want support for it in this - * on-disk version, so that we don't need to upgrade for it later. + * Do not allow this dataset to be promoted. */ #define DS_FLAG_NOPROMOTE (1ULL<<1) @@ -71,6 +71,11 @@ struct dsl_pool; ((ds)->ds_phys->ds_flags & DS_FLAG_DEFER_DESTROY) /* + * DS_FIELD_* are strings that are used in the "extensified" dataset zap object. + * They should be of the format :. + */ + +/* * DS_FLAG_CI_DATASET is set if the dataset contains a file system whose * name lookups should be performed case-insensitively. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Tue Dec 24 07:14:25 2013 (r259813) @@ -141,6 +141,12 @@ uint64_t zap_create_link(objset_t *os, d uint64_t parent_obj, const char *name, dmu_tx_t *tx); /* + * Initialize an already-allocated object. + */ +void mzap_create_impl(objset_t *os, uint64_t obj, int normflags, + zap_flags_t flags, dmu_tx_t *tx); + +/* * Create a new zapobj with no attributes from the given (unallocated) * object number. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h Tue Dec 24 07:14:25 2013 (r259813) @@ -27,6 +27,7 @@ #define _SYS_ZFEATURE_H #include +#include #include "zfeature_common.h" #ifdef __cplusplus @@ -37,17 +38,25 @@ struct spa; struct dmu_tx; struct objset; -extern boolean_t feature_is_supported(struct objset *os, uint64_t obj, - uint64_t desc_obj, nvlist_t *unsup_feat, nvlist_t *enabled_feat); - extern void spa_feature_create_zap_objects(struct spa *, struct dmu_tx *); -extern void spa_feature_enable(struct spa *, zfeature_info_t *, +extern void spa_feature_enable(struct spa *, spa_feature_t, + struct dmu_tx *); +extern void spa_feature_incr(struct spa *, spa_feature_t, struct dmu_tx *); +extern void spa_feature_decr(struct spa *, spa_feature_t, struct dmu_tx *); +extern boolean_t spa_feature_is_enabled(struct spa *, spa_feature_t); +extern boolean_t spa_feature_is_active(struct spa *, spa_feature_t); +extern uint64_t spa_feature_refcount(spa_t *, spa_feature_t, uint64_t); +extern boolean_t spa_features_check(spa_t *, boolean_t, nvlist_t *, nvlist_t *); + +/* + * These functions are only exported for zhack and zdb; normal callers should + * use the above interfaces. + */ +extern int feature_get_refcount(struct spa *, zfeature_info_t *, uint64_t *); +extern void feature_enable_sync(struct spa *, zfeature_info_t *, + struct dmu_tx *); +extern void feature_sync(struct spa *, zfeature_info_t *, uint64_t, struct dmu_tx *); -extern void spa_feature_incr(struct spa *, zfeature_info_t *, struct dmu_tx *); -extern void spa_feature_decr(struct spa *, zfeature_info_t *, struct dmu_tx *); -extern boolean_t spa_feature_is_enabled(struct spa *, zfeature_info_t *); -extern boolean_t spa_feature_is_active(struct spa *, zfeature_info_t *); -extern int spa_feature_get_refcount(struct spa *, zfeature_info_t *); #ifdef __cplusplus } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Tue Dec 24 07:02:05 2013 (r259812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Tue Dec 24 07:14:25 2013 (r259813) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 07:27:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48ECD5E0; Tue, 24 Dec 2013 07:27:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 34A8F1649; Tue, 24 Dec 2013 07:27:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBO7RuBx068354; Tue, 24 Dec 2013 07:27:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBO7RuGG068353; Tue, 24 Dec 2013 07:27:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312240727.rBO7RuGG068353@svn.freebsd.org> From: Xin LI Date: Tue, 24 Dec 2013 07:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259816 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 07:27:56 -0000 Author: delphij Date: Tue Dec 24 07:27:55 2013 New Revision: 259816 URL: http://svnweb.freebsd.org/changeset/base/259816 Log: Fix incorrect markup introduced in r259813. Pointy hat to: delphij X-MFC-after: r259813 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Dec 24 07:26:43 2013 (r259815) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Dec 24 07:27:55 2013 (r259816) @@ -269,7 +269,6 @@ an existing space map is upgraded to the Once the feature is .Sy active , it will remain in that state until the pool is destroyed. -.El .It Sy extensible_dataset .Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:extensible_dataset" .It GUID Ta com.delphix:extensible_dataset @@ -287,6 +286,7 @@ and will be returned to the .Sy enabled state when all datasets that use this feature are destroyed. +.El .Sh SEE ALSO .Xr zpool 8 .Sh AUTHORS From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 14:48:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7AE4AA1; Tue, 24 Dec 2013 14:48:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B446A1640; Tue, 24 Dec 2013 14:48:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOEmqZ4028223; Tue, 24 Dec 2013 14:48:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOEmq73028222; Tue, 24 Dec 2013 14:48:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312241448.rBOEmq73028222@svn.freebsd.org> From: John Baldwin Date: Tue, 24 Dec 2013 14:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259823 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 14:48:52 -0000 Author: jhb Date: Tue Dec 24 14:48:52 2013 New Revision: 259823 URL: http://svnweb.freebsd.org/changeset/base/259823 Log: Fix i386 build. Pointy hat to: jhb Modified: head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Tue Dec 24 14:26:31 2013 (r259822) +++ head/sys/x86/acpica/acpi_wakeup.c Tue Dec 24 14:48:52 2013 (r259823) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 15:56:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C24E332; Tue, 24 Dec 2013 15:56:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88D391CBA; Tue, 24 Dec 2013 15:56:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOFuG33057260; Tue, 24 Dec 2013 15:56:16 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOFuG5X057259; Tue, 24 Dec 2013 15:56:16 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312241556.rBOFuG5X057259@svn.freebsd.org> From: Dimitry Andric Date: Tue, 24 Dec 2013 15:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259825 - head/sys/dev/advansys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 15:56:16 -0000 Author: dim Date: Tue Dec 24 15:56:16 2013 New Revision: 259825 URL: http://svnweb.freebsd.org/changeset/base/259825 Log: Remove unused static function adwccbstatus() from adw(4). Reviewed by: gibbs MFC after: 3 days Modified: head/sys/dev/advansys/adwcam.c Modified: head/sys/dev/advansys/adwcam.c ============================================================================== --- head/sys/dev/advansys/adwcam.c Tue Dec 24 15:44:09 2013 (r259824) +++ head/sys/dev/advansys/adwcam.c Tue Dec 24 15:56:16 2013 (r259825) @@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$"); #define ccb_acb_ptr spriv_ptr0 #define ccb_adw_ptr spriv_ptr1 -static __inline cam_status adwccbstatus(union ccb*); static __inline struct acb* adwgetacb(struct adw_softc *adw); static __inline void adwfreeacb(struct adw_softc *adw, struct acb *acb); @@ -100,12 +99,6 @@ static void adw_handle_device_reset(str static void adw_handle_bus_reset(struct adw_softc *adw, int initiated); -static __inline cam_status -adwccbstatus(union ccb* ccb) -{ - return (ccb->ccb_h.status & CAM_STATUS_MASK); -} - static __inline struct acb* adwgetacb(struct adw_softc *adw) { From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 16:14:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 662A3DE1; Tue, 24 Dec 2013 16:14:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5129A1E34; Tue, 24 Dec 2013 16:14:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOGELOV067294; Tue, 24 Dec 2013 16:14:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOGEKDb067288; Tue, 24 Dec 2013 16:14:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312241614.rBOGEKDb067288@svn.freebsd.org> From: John Baldwin Date: Tue, 24 Dec 2013 16:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259826 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 16:14:21 -0000 Author: jhb Date: Tue Dec 24 16:14:19 2013 New Revision: 259826 URL: http://svnweb.freebsd.org/changeset/base/259826 Log: Support soft power-off via the ACPI S5 state for bhyve guests. - Implement the PM1_EVT and PM1_CTL registers required by ACPI. The PM1_EVT register is mostly a dummy as bhyve doesn't support any of the hardware-initiated events. The only bit of PM1_CNT that is implemented are the sleep request bits (SPL_EN and SLP_TYP) which request a graceful power off for S5. In particular, for S5, bhyve exits with a non-zero value which terminates the loop in vmrun.sh. - Emulate the Reset Control register at I/O port 0xcf9 and advertise it as the reset register via ACPI. - Advertise an _S5 package. - Extend the in/out interface to allow an in/out handler to request that the hypervisor trigger a reset or power-off. - While here, note that all vCPUs in a guest support C1 ("hlt"). Reviewed by: neel (earlier version) Added: head/usr.sbin/bhyve/pm.c (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/acpi.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/inout.h Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Tue Dec 24 15:56:16 2013 (r259825) +++ head/usr.sbin/bhyve/Makefile Tue Dec 24 16:14:19 2013 (r259826) @@ -10,7 +10,7 @@ MAN= bhyve.8 SRCS= acpi.c atpic.c bhyverun.c block_if.c consport.c dbgport.c elcr.c SRCS+= inout.c legacy_irq.c mem.c mevent.c mptbl.c pci_ahci.c SRCS+= pci_emul.c pci_hostbridge.c pci_lpc.c pci_passthru.c pci_virtio_block.c -SRCS+= pci_virtio_net.c pci_uart.c pit_8254.c pmtmr.c post.c rtc.c +SRCS+= pci_virtio_net.c pci_uart.c pit_8254.c pm.c pmtmr.c post.c rtc.c SRCS+= uart_emul.c virtio.c xmsr.c spinup_ap.c .PATH: ${.CURDIR}/../../sys/amd64/vmm Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Tue Dec 24 15:56:16 2013 (r259825) +++ head/usr.sbin/bhyve/acpi.c Tue Dec 24 16:14:19 2013 (r259826) @@ -85,6 +85,8 @@ __FBSDID("$FreeBSD$"); #define BHYVE_ASL_SUFFIX ".aml" #define BHYVE_ASL_COMPILER "/usr/sbin/iasl" +#define BHYVE_PM1A_EVT_ADDR 0x400 +#define BHYVE_PM1A_CNT_ADDR 0x404 #define BHYVE_PM_TIMER_ADDR 0x408 static int basl_keep_temps; @@ -342,9 +344,11 @@ basl_fwrite_fadt(FILE *fp) EFPRINTF(fp, "[0001]\t\tACPI Disable Value : 00\n"); EFPRINTF(fp, "[0001]\t\tS4BIOS Command : 00\n"); EFPRINTF(fp, "[0001]\t\tP-State Control : 00\n"); - EFPRINTF(fp, "[0004]\t\tPM1A Event Block Address : 00000000\n"); + EFPRINTF(fp, "[0004]\t\tPM1A Event Block Address : %08X\n", + BHYVE_PM1A_EVT_ADDR); EFPRINTF(fp, "[0004]\t\tPM1B Event Block Address : 00000000\n"); - EFPRINTF(fp, "[0004]\t\tPM1A Control Block Address : 00000000\n"); + EFPRINTF(fp, "[0004]\t\tPM1A Control Block Address : %08X\n", + BHYVE_PM1A_CNT_ADDR); EFPRINTF(fp, "[0004]\t\tPM1B Control Block Address : 00000000\n"); EFPRINTF(fp, "[0004]\t\tPM2 Control Block Address : 00000000\n"); EFPRINTF(fp, "[0004]\t\tPM Timer Block Address : %08X\n", @@ -379,7 +383,7 @@ basl_fwrite_fadt(FILE *fp) EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 00000000\n"); EFPRINTF(fp, "\t\t\tWBINVD instruction is operational (V1) : 1\n"); EFPRINTF(fp, "\t\t\tWBINVD flushes all caches (V1) : 0\n"); - EFPRINTF(fp, "\t\t\tAll CPUs support C1 (V1) : 0\n"); + EFPRINTF(fp, "\t\t\tAll CPUs support C1 (V1) : 1\n"); EFPRINTF(fp, "\t\t\tC2 works on MP system (V1) : 0\n"); EFPRINTF(fp, "\t\t\tControl Method Power Button (V1) : 1\n"); EFPRINTF(fp, "\t\t\tControl Method Sleep Button (V1) : 1\n"); @@ -387,7 +391,7 @@ basl_fwrite_fadt(FILE *fp) EFPRINTF(fp, "\t\t\tRTC can wake system from S4 (V1) : 0\n"); EFPRINTF(fp, "\t\t\t32-bit PM Timer (V1) : 1\n"); EFPRINTF(fp, "\t\t\tDocking Supported (V1) : 0\n"); - EFPRINTF(fp, "\t\t\tReset Register Supported (V2) : 0\n"); + EFPRINTF(fp, "\t\t\tReset Register Supported (V2) : 1\n"); EFPRINTF(fp, "\t\t\tSealed Case (V3) : 0\n"); EFPRINTF(fp, "\t\t\tHeadless - No Video (V3) : 1\n"); EFPRINTF(fp, "\t\t\tUse native instr after SLP_TYPx (V3) : 0\n"); @@ -407,10 +411,10 @@ basl_fwrite_fadt(FILE *fp) EFPRINTF(fp, "[0001]\t\tBit Width : 08\n"); EFPRINTF(fp, "[0001]\t\tBit Offset : 00\n"); EFPRINTF(fp, "[0001]\t\tEncoded Access Width : 01 [Byte Access:8]\n"); - EFPRINTF(fp, "[0008]\t\tAddress : 0000000000000001\n"); + EFPRINTF(fp, "[0008]\t\tAddress : 0000000000000CF9\n"); EFPRINTF(fp, "\n"); - EFPRINTF(fp, "[0001]\t\tValue to cause reset : 00\n"); + EFPRINTF(fp, "[0001]\t\tValue to cause reset : 06\n"); EFPRINTF(fp, "[0003]\t\tReserved : 000000\n"); EFPRINTF(fp, "[0008]\t\tFACS Address : 00000000%08X\n", basl_acpi_base + FACS_OFFSET); @@ -422,7 +426,8 @@ basl_fwrite_fadt(FILE *fp) EFPRINTF(fp, "[0001]\t\tBit Width : 20\n"); EFPRINTF(fp, "[0001]\t\tBit Offset : 00\n"); EFPRINTF(fp, "[0001]\t\tEncoded Access Width : 02 [Word Access:16]\n"); - EFPRINTF(fp, "[0008]\t\tAddress : 0000000000000001\n"); + EFPRINTF(fp, "[0008]\t\tAddress : 00000000%08X\n", + BHYVE_PM1A_EVT_ADDR); EFPRINTF(fp, "\n"); EFPRINTF(fp, @@ -441,7 +446,8 @@ basl_fwrite_fadt(FILE *fp) EFPRINTF(fp, "[0001]\t\tBit Width : 10\n"); EFPRINTF(fp, "[0001]\t\tBit Offset : 00\n"); EFPRINTF(fp, "[0001]\t\tEncoded Access Width : 02 [Word Access:16]\n"); - EFPRINTF(fp, "[0008]\t\tAddress : 0000000000000001\n"); + EFPRINTF(fp, "[0008]\t\tAddress : 00000000%08X\n", + BHYVE_PM1A_CNT_ADDR); EFPRINTF(fp, "\n"); EFPRINTF(fp, @@ -613,6 +619,11 @@ basl_fwrite_dsdt(FILE *fp) EFPRINTF(fp, "DefinitionBlock (\"bhyve_dsdt.aml\", \"DSDT\", 2," "\"BHYVE \", \"BVDSDT \", 0x00000001)\n"); EFPRINTF(fp, "{\n"); + EFPRINTF(fp, " Name (_S5, Package (0x02)\n"); + EFPRINTF(fp, " {\n"); + EFPRINTF(fp, " 0x05,\n"); + EFPRINTF(fp, " Zero,\n"); + EFPRINTF(fp, " })\n"); EFPRINTF(fp, " Scope (_SB)\n"); EFPRINTF(fp, " {\n"); EFPRINTF(fp, " Device (PCI0)\n"); Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Tue Dec 24 15:56:16 2013 (r259825) +++ head/usr.sbin/bhyve/bhyverun.c Tue Dec 24 16:14:19 2013 (r259826) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #define VMEXIT_RESTART 2 /* restart current instruction */ #define VMEXIT_ABORT 3 /* abort the vm run loop */ #define VMEXIT_RESET 4 /* guest machine has reset */ +#define VMEXIT_POWEROFF 5 /* guest machine has powered off */ #define MB (1024UL * 1024) #define GB (1024UL * MB) @@ -296,12 +297,17 @@ vmexit_inout(struct vmctx *ctx, struct v return (vmexit_handle_notify(ctx, vme, pvcpu, eax)); error = emulate_inout(ctx, vcpu, in, port, bytes, &eax, strictio); - if (error == 0 && in) + if (error == INOUT_OK && in) error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RAX, eax); - if (error == 0) + switch (error) { + case INOUT_OK: return (VMEXIT_CONTINUE); - else { + case INOUT_RESET: + return (VMEXIT_RESET); + case INOUT_POWEROFF: + return (VMEXIT_POWEROFF); + default: fprintf(stderr, "Unhandled %s%c 0x%04x\n", in ? "in" : "out", bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port); Modified: head/usr.sbin/bhyve/inout.h ============================================================================== --- head/usr.sbin/bhyve/inout.h Tue Dec 24 15:56:16 2013 (r259825) +++ head/usr.sbin/bhyve/inout.h Tue Dec 24 16:14:19 2013 (r259826) @@ -33,6 +33,12 @@ struct vmctx; +/* Handler return values. */ +#define INOUT_ERROR -1 +#define INOUT_OK 0 +#define INOUT_RESET 1 +#define INOUT_POWEROFF 2 + typedef int (*inout_func_t)(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg); Added: head/usr.sbin/bhyve/pm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pm.c Tue Dec 24 16:14:19 2013 (r259826) @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 2013 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * 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 "inout.h" + +#define PM1A_EVT_ADDR 0x400 +#define PM1A_CNT_ADDR 0x404 + +/* + * Reset Control register at I/O port 0xcf9. Bit 2 forces a system + * reset when it transitions from 0 to 1. Bit 1 selects the type of + * reset to attempt: 0 selects a "soft" reset, and 1 selects a "hard" + * reset. + */ +static int +reset_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, + uint32_t *eax, void *arg) +{ + static uint8_t reset_control; + + if (bytes != 1) + return (-1); + if (in) + *eax = reset_control; + else { + reset_control = *eax; + + /* Treat hard and soft resets the same. */ + if (reset_control & 0x4) + return (INOUT_RESET); + } + return (0); +} +INOUT_PORT(reset_reg, 0xCF9, IOPORT_F_INOUT, reset_handler); + +/* + * Power Management 1 Event Registers + * + * bhyve doesn't support any power management events currently, so the + * status register always returns zero. The enable register preserves + * its value but has no effect. + */ +static int +pm1_status_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, + uint32_t *eax, void *arg) +{ + + if (bytes != 2) + return (-1); + if (in) + *eax = 0; + return (0); +} + +static int +pm1_enable_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, + uint32_t *eax, void *arg) +{ + static uint16_t pm1_enable; + + if (bytes != 2) + return (-1); + if (in) + *eax = pm1_enable; + else + pm1_enable = *eax; + return (0); +} +INOUT_PORT(pm1_status, PM1A_EVT_ADDR, IOPORT_F_INOUT, pm1_status_handler); +INOUT_PORT(pm1_enable, PM1A_EVT_ADDR + 2, IOPORT_F_INOUT, pm1_enable_handler); + +/* + * Power Management 1 Control Register + * + * This is mostly unimplemented except that we wish to handle writes that + * set SPL_EN to handle S5 (soft power off). + */ +#define PM1_SLP_TYP 0x1c00 +#define PM1_SLP_EN 0x2000 +#define PM1_ALWAYS_ZERO 0xc003 + +static int +pm1_control_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, + uint32_t *eax, void *arg) +{ + static uint16_t pm1_control; + + if (bytes != 2) + return (-1); + if (in) + *eax = pm1_control; + else { + /* + * Various bits are write-only or reserved, so force them + * to zero in pm1_control. + */ + pm1_control = *eax & ~(PM1_SLP_EN | PM1_ALWAYS_ZERO); + + /* + * If SLP_EN is set, check for S5. Bhyve's _S5_ method + * says that '5' should be stored in SLP_TYP for S5. + */ + if (*eax & PM1_SLP_EN) { + if ((pm1_control & PM1_SLP_TYP) >> 10 == 5) + return (INOUT_POWEROFF); + } + } + return (0); +} +INOUT_PORT(pm1_control, PM1A_CNT_ADDR, IOPORT_F_INOUT, pm1_control_handler); From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 16:46:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04B6C3AF; Tue, 24 Dec 2013 16:46:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E4F6F1005; Tue, 24 Dec 2013 16:46:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOGk6Jw078334; Tue, 24 Dec 2013 16:46:06 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOGk6o0078333; Tue, 24 Dec 2013 16:46:06 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312241646.rBOGk6o0078333@svn.freebsd.org> From: Dimitry Andric Date: Tue, 24 Dec 2013 16:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259827 - head/sys/dev/aic7xxx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 16:46:07 -0000 Author: dim Date: Tue Dec 24 16:46:06 2013 New Revision: 259827 URL: http://svnweb.freebsd.org/changeset/base/259827 Log: Remove unused static const variable num_chip_names from aic79xx.c. Reviewed by: gibbs MFC after: 3 days Modified: head/sys/dev/aic7xxx/aic79xx.c Modified: head/sys/dev/aic7xxx/aic79xx.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx.c Tue Dec 24 16:14:19 2013 (r259826) +++ head/sys/dev/aic7xxx/aic79xx.c Tue Dec 24 16:46:06 2013 (r259827) @@ -64,7 +64,6 @@ char *ahd_chip_names[] = "aic7902", "aic7901A" }; -static const u_int num_chip_names = NUM_ELEMENTS(ahd_chip_names); /* * Hardware error codes. From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 17:28:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1697A2EF; Tue, 24 Dec 2013 17:28:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0283112DB; Tue, 24 Dec 2013 17:28:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOHSRAd093309; Tue, 24 Dec 2013 17:28:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOHSRCw093308; Tue, 24 Dec 2013 17:28:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312241728.rBOHSRCw093308@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Dec 2013 17:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259828 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 17:28:28 -0000 Author: mav Date: Tue Dec 24 17:28:27 2013 New Revision: 259828 URL: http://svnweb.freebsd.org/changeset/base/259828 Log: Fix a bug introduced at r259632, triggering infinite loop in some cases. Modified: head/sys/rpc/svc_vc.c Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Tue Dec 24 16:46:06 2013 (r259827) +++ head/sys/rpc/svc_vc.c Tue Dec 24 17:28:27 2013 (r259828) @@ -555,7 +555,7 @@ svc_vc_backchannel_stat(SVCXPRT *xprt) * leaving the result in cd->mreq. If we don't have a complete record, leave * the partial result in cd->mreq and try to read more from the socket. */ -static void +static int svc_vc_process_pending(SVCXPRT *xprt) { struct cf_conn *cd = (struct cf_conn *) xprt->xp_p1; @@ -584,7 +584,7 @@ svc_vc_process_pending(SVCXPRT *xprt) } if (n < sizeof(uint32_t)) { so->so_rcv.sb_lowat = sizeof(uint32_t) - n; - return; + return (FALSE); } m_copydata(cd->mpending, 0, sizeof(header), (char *)&header); @@ -620,6 +620,7 @@ svc_vc_process_pending(SVCXPRT *xprt) } so->so_rcv.sb_lowat = imax(1, imin(cd->resid, so->so_rcv.sb_hiwat / 2)); + return (TRUE); } static bool_t @@ -642,8 +643,10 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms for (;;) { /* If we have no request ready, check pending queue. */ while (cd->mpending && - (cd->mreq == NULL || cd->resid != 0 || !cd->eor)) - svc_vc_process_pending(xprt); + (cd->mreq == NULL || cd->resid != 0 || !cd->eor)) { + if (!svc_vc_process_pending(xprt)) + break; + } /* Process and return complete request in cd->mreq. */ if (cd->mreq != NULL && cd->resid == 0 && cd->eor) { From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 18:42:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B67ACA1; Tue, 24 Dec 2013 18:42:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77ED71723; Tue, 24 Dec 2013 18:42:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOIgRrA021244; Tue, 24 Dec 2013 18:42:27 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOIgRWh021243; Tue, 24 Dec 2013 18:42:27 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201312241842.rBOIgRWh021243@svn.freebsd.org> From: Ed Schouten Date: Tue, 24 Dec 2013 18:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259830 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 18:42:27 -0000 Author: ed Date: Tue Dec 24 18:42:26 2013 New Revision: 259830 URL: http://svnweb.freebsd.org/changeset/base/259830 Log: Fix copy-pasting of CJK fullwidth characters. They are stored as two separate characters in the vtbuf, so copy-pasting will cause them to be passed to terminal_input_char() twice. Extend terminal_input_char() to explicitly discard characters with TF_CJK_RIGHT set. This causes only the left part to generate input. Modified: head/sys/kern/subr_terminal.c Modified: head/sys/kern/subr_terminal.c ============================================================================== --- head/sys/kern/subr_terminal.c Tue Dec 24 18:41:17 2013 (r259829) +++ head/sys/kern/subr_terminal.c Tue Dec 24 18:42:26 2013 (r259830) @@ -249,7 +249,13 @@ terminal_input_char(struct terminal *tm, if (tp == NULL) return; - /* Strip off any attributes. */ + /* + * Strip off any attributes. Also ignore input of second part of + * CJK fullwidth characters, as we don't want to return these + * characters twice. + */ + if (TCHAR_FORMAT(c) & TF_CJK_RIGHT) + return; c = TCHAR_CHARACTER(c); tty_lock(tp); From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 18:52:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C14D1CA; Tue, 24 Dec 2013 18:52:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 189FD17B7; Tue, 24 Dec 2013 18:52:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOIqavk024796; Tue, 24 Dec 2013 18:52:36 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOIqaaM024795; Tue, 24 Dec 2013 18:52:36 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312241852.rBOIqaaM024795@svn.freebsd.org> From: Dimitry Andric Date: Tue, 24 Dec 2013 18:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259833 - head/sys/dev/aic7xxx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 18:52:37 -0000 Author: dim Date: Tue Dec 24 18:52:36 2013 New Revision: 259833 URL: http://svnweb.freebsd.org/changeset/base/259833 Log: Remove another unused static const variable num_chip_names, from aic7xxx.c this time. Noticed by: pluknet MFC after: 3 days Modified: head/sys/dev/aic7xxx/aic7xxx.c Modified: head/sys/dev/aic7xxx/aic7xxx.c ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx.c Tue Dec 24 18:49:24 2013 (r259832) +++ head/sys/dev/aic7xxx/aic7xxx.c Tue Dec 24 18:52:36 2013 (r259833) @@ -73,7 +73,6 @@ char *ahc_chip_names[] = "aic7892", "aic7899" }; -static const u_int num_chip_names = NUM_ELEMENTS(ahc_chip_names); /* * Hardware error codes. From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 19:58:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83919CAD; Tue, 24 Dec 2013 19:58:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F4AD1B31; Tue, 24 Dec 2013 19:58:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOJwSXV047152; Tue, 24 Dec 2013 19:58:28 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOJwS32047151; Tue, 24 Dec 2013 19:58:28 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312241958.rBOJwS32047151@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 24 Dec 2013 19:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259838 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 19:58:28 -0000 Author: marcel Date: Tue Dec 24 19:58:27 2013 New Revision: 259838 URL: http://svnweb.freebsd.org/changeset/base/259838 Log: Add another HP iLO serial (console) port, found on Itanium servers. Derived from information provided by: felip.nadal@hob.de Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Tue Dec 24 19:10:56 2013 (r259837) +++ head/sys/dev/uart/uart_bus_pci.c Tue Dec 24 19:58:27 2013 (r259838) @@ -82,6 +82,7 @@ static const struct pci_id pci_ns8250_id 0x10 }, { 0x103c, 0x1048, 0x103c, 0x1301, "HP Diva RMP3", 0x14 }, { 0x103c, 0x1290, 0xffff, 0, "HP Auxiliary Diva Serial Port", 0x18 }, +{ 0x103c, 0x3301, 0xffff, 0, "HP iLO serial port", 0x10 }, { 0x11c1, 0x0480, 0xffff, 0, "Agere Systems Venus Modem (V90, 56KFlex)", 0x14 }, { 0x115d, 0x0103, 0xffff, 0, "Xircom Cardbus Ethernet + 56k Modem", 0x10 }, { 0x1282, 0x6585, 0xffff, 0, "Davicom 56PDV PCI Modem", 0x10 }, From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 20:25:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F277267; Tue, 24 Dec 2013 20:25:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B3E21DD9; Tue, 24 Dec 2013 20:25:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOKPJhw057991; Tue, 24 Dec 2013 20:25:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOKPJ2N057990; Tue, 24 Dec 2013 20:25:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312242025.rBOKPJ2N057990@svn.freebsd.org> From: Dimitry Andric Date: Tue, 24 Dec 2013 20:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259839 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 20:25:19 -0000 Author: dim Date: Tue Dec 24 20:25:18 2013 New Revision: 259839 URL: http://svnweb.freebsd.org/changeset/base/259839 Log: In sys/netinet/in_mcast.c, inm_is_ifp_detached() is only used whenever KTR is defined, so put it between #ifdef KTR guards. This avoids a warning about a unused function if KTR is not enabled. MFC after: 3 days Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Tue Dec 24 19:58:27 2013 (r259838) +++ head/sys/netinet/in_mcast.c Tue Dec 24 20:25:18 2013 (r259839) @@ -140,7 +140,9 @@ static int in_getmulti(struct ifnet *, c struct in_multi **); static int inm_get_source(struct in_multi *inm, const in_addr_t haddr, const int noalloc, struct ip_msource **pims); +#ifdef KTR static int inm_is_ifp_detached(const struct in_multi *); +#endif static int inm_merge(struct in_multi *, /*const*/ struct in_mfilter *); static void inm_purge(struct in_multi *); static void inm_reap(struct in_multi *); @@ -187,6 +189,7 @@ static STAILQ_HEAD(, ip_moptions) imo_gc STAILQ_HEAD_INITIALIZER(imo_gc_list); static struct task imo_gc_task = TASK_INITIALIZER(0, inp_gcmoptions, NULL); +#ifdef KTR /* * Inline function which wraps assertions for a valid ifp. * The ifnet layer will set the ifma's ifp pointer to NULL if the ifp @@ -209,6 +212,7 @@ inm_is_ifp_detached(const struct in_mult return (ifp == NULL); } +#endif /* * Initialize an in_mfilter structure to a known state at t0, t1 From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 20:30:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3D2744A; Tue, 24 Dec 2013 20:30:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B03FA1E01; Tue, 24 Dec 2013 20:30:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOKUD0N058637; Tue, 24 Dec 2013 20:30:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOKUDKI058636; Tue, 24 Dec 2013 20:30:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312242030.rBOKUDKI058636@svn.freebsd.org> From: Dimitry Andric Date: Tue, 24 Dec 2013 20:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259840 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 20:30:13 -0000 Author: dim Date: Tue Dec 24 20:30:13 2013 New Revision: 259840 URL: http://svnweb.freebsd.org/changeset/base/259840 Log: In sys/netinet6/in6_mcast.c, in6m_is_ifp_detached() is only used whenever KTR is defined, so put it between #ifdef KTR guards. This avoids a warning about a unused function if KTR is not enabled. MFC after: 3 days Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Tue Dec 24 20:25:18 2013 (r259839) +++ head/sys/netinet6/in6_mcast.c Tue Dec 24 20:30:13 2013 (r259840) @@ -132,7 +132,9 @@ static int in6_mc_get(struct ifnet *, co static int in6m_get_source(struct in6_multi *inm, const struct in6_addr *addr, const int noalloc, struct ip6_msource **pims); +#ifdef KTR static int in6m_is_ifp_detached(const struct in6_multi *); +#endif static int in6m_merge(struct in6_multi *, /*const*/ struct in6_mfilter *); static void in6m_purge(struct in6_multi *); static void in6m_reap(struct in6_multi *); @@ -176,6 +178,7 @@ static SYSCTL_NODE(_net_inet6_ip6_mcast, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_ip6_mcast_filters, "Per-interface stack-wide source filters"); +#ifdef KTR /* * Inline function which wraps assertions for a valid ifp. * The ifnet layer will set the ifma's ifp pointer to NULL if the ifp @@ -198,6 +201,7 @@ in6m_is_ifp_detached(const struct in6_mu return (ifp == NULL); } +#endif /* * Initialize an in6_mfilter structure to a known state at t0, t1 From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 20:42:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81A737E2; Tue, 24 Dec 2013 20:42:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D4D11EE3; Tue, 24 Dec 2013 20:42:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOKgnpg064812; Tue, 24 Dec 2013 20:42:49 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOKgmGk064806; Tue, 24 Dec 2013 20:42:48 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312242042.rBOKgmGk064806@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 24 Dec 2013 20:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259841 - in head/contrib/gcc: . config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 20:42:49 -0000 Author: pfg Date: Tue Dec 24 20:42:48 2013 New Revision: 259841 URL: http://svnweb.freebsd.org/changeset/base/259841 Log: gcc: Add ability to generate DWARF pubtypes section if DEBUG_PUBTYPES_SECTION is defined. Obtained from: gcc 4.3 (rev. 118826; GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/config/darwin.c head/contrib/gcc/config/darwin.h head/contrib/gcc/dwarf2out.c Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Tue Dec 24 20:30:13 2013 (r259840) +++ head/contrib/gcc/ChangeLog.gcc43 Tue Dec 24 20:42:48 2013 (r259841) @@ -550,6 +550,37 @@ (override_options): Add entries for Core2. (ix86_issue_rate): Add case for Core2. +2006-11-14 Caroline Tice (r118826) + + * dwarf2out.c (debug_pubtypes_section): New static global variable. + (pubname_entry): Add DEF_VEC_O and DEF_VEC_ALLOC_O statements for + this type. + (pubname_table): Redefine as a vector. + (pubtype_table): New static global variable, defined as a vector. + (pubname_table_allocated): Remove static global variable. + (pubname_table_in_use): Remove static global variable. + (PUBNAME_TABLE_INCREMENT): Remove constant. + (size_of_pubnames): Add parameter to deal with either pubnames or + pubtypes, and change code to deal with table being a vector. + (add_pubname): Change to deal with table being a vector. + (add_pubtype): New function. + (output_pubnames): Add parameter to deal with either pubnames or + pubtypes, and change code to deal with table being a vector. + (gen_array_type_die): Add call to add_pubtype. + (gen_enumeration_type_die): Add call to add_pubtype. + (gen_struct_or_union_type_die): Add call to add_pubtype. + (gen_subroutine_type_die): Add call to add_pubtype. + (gen_typedef_die): Add call to add_pubtype. + (dwarf2out_init): Add code to initialize pubname_table and + pubtype_table vectors; also initialize debug_pubtypes_section. + (prune_unused_types): Change to deal with pubnames being a vector. + (dwarf2out_finish): Change to deal with pubnames being a vector; add + pubnames table to call to output_pubnames; Add code to output pubtypes + table if DEBUG_PUBTYPES_SECTION is defined. + * config/darwin.c (darwin_file_start): Add DEBUG_PUBTYPES_SECTION to + debugnames. + * config/darwin.h (DEBUG_PUBTYPES_SECTION): Define new global variable. + 2006-11-07 Eric Christopher (r118576) * libgcc2.c (__bswapdi2): Rename from bswapDI2. Modified: head/contrib/gcc/config/darwin.c ============================================================================== --- head/contrib/gcc/config/darwin.c Tue Dec 24 20:30:13 2013 (r259840) +++ head/contrib/gcc/config/darwin.c Tue Dec 24 20:42:48 2013 (r259841) @@ -1517,6 +1517,7 @@ darwin_file_start (void) DEBUG_LINE_SECTION, DEBUG_LOC_SECTION, DEBUG_PUBNAMES_SECTION, + DEBUG_PUBTYPES_SECTION, DEBUG_STR_SECTION, DEBUG_RANGES_SECTION }; Modified: head/contrib/gcc/config/darwin.h ============================================================================== --- head/contrib/gcc/config/darwin.h Tue Dec 24 20:30:13 2013 (r259840) +++ head/contrib/gcc/config/darwin.h Tue Dec 24 20:42:48 2013 (r259841) @@ -401,6 +401,7 @@ extern GTY(()) int darwin_ms_struct; #define DEBUG_LINE_SECTION "__DWARF,__debug_line,regular,debug" #define DEBUG_LOC_SECTION "__DWARF,__debug_loc,regular,debug" #define DEBUG_PUBNAMES_SECTION "__DWARF,__debug_pubnames,regular,debug" +#define DEBUG_PUBTYPES_SECTION "__DWARF,__debug_pubtypes,regular,debug" #define DEBUG_STR_SECTION "__DWARF,__debug_str,regular,debug" #define DEBUG_RANGES_SECTION "__DWARF,__debug_ranges,regular,debug" Modified: head/contrib/gcc/dwarf2out.c ============================================================================== --- head/contrib/gcc/dwarf2out.c Tue Dec 24 20:30:13 2013 (r259840) +++ head/contrib/gcc/dwarf2out.c Tue Dec 24 20:42:48 2013 (r259841) @@ -156,6 +156,7 @@ static GTY(()) section *debug_macinfo_se static GTY(()) section *debug_line_section; static GTY(()) section *debug_loc_section; static GTY(()) section *debug_pubnames_section; +static GTY(()) section *debug_pubtypes_section; static GTY(()) section *debug_str_section; static GTY(()) section *debug_ranges_section; static GTY(()) section *debug_frame_section; @@ -3759,6 +3760,9 @@ typedef struct pubname_struct GTY(()) } pubname_entry; +DEF_VEC_O(pubname_entry); +DEF_VEC_ALLOC_O(pubname_entry, gc); + struct dw_ranges_struct GTY(()) { int block_num; @@ -3940,17 +3944,11 @@ static GTY(()) unsigned separate_line_in /* A pointer to the base of a table that contains a list of publicly accessible names. */ -static GTY ((length ("pubname_table_allocated"))) pubname_ref pubname_table; - -/* Number of elements currently allocated for pubname_table. */ -static GTY(()) unsigned pubname_table_allocated; - -/* Number of elements in pubname_table currently in use. */ -static GTY(()) unsigned pubname_table_in_use; +static GTY (()) VEC (pubname_entry, gc) * pubname_table; -/* Size (in elements) of increments by which we may expand the - pubname_table. */ -#define PUBNAME_TABLE_INCREMENT 64 +/* A pointer to the base of a table that contains a list of publicly + accessible types. */ +static GTY (()) VEC (pubname_entry, gc) * pubtype_table; /* Array of dies for which we should generate .debug_arange info. */ static GTY((length ("arange_table_allocated"))) dw_die_ref *arange_table; @@ -4115,7 +4113,7 @@ static void calc_die_sizes (dw_die_ref); static void mark_dies (dw_die_ref); static void unmark_dies (dw_die_ref); static void unmark_all_dies (dw_die_ref); -static unsigned long size_of_pubnames (void); +static unsigned long size_of_pubnames (VEC (pubname_entry,gc) *); static unsigned long size_of_aranges (void); static enum dwarf_form value_format (dw_attr_ref); static void output_value_format (dw_attr_ref); @@ -4126,7 +4124,8 @@ static void output_compilation_unit_head static void output_comp_unit (dw_die_ref, int); static const char *dwarf2_name (tree, int); static void add_pubname (tree, dw_die_ref); -static void output_pubnames (void); +static void add_pubtype (tree, dw_die_ref); +static void output_pubnames (VEC (pubname_entry,gc) *); static void add_arange (tree, dw_die_ref); static void output_aranges (void); static unsigned int add_ranges (tree); @@ -6750,21 +6749,22 @@ unmark_all_dies (dw_die_ref die) unmark_all_dies (AT_ref (a)); } -/* Return the size of the .debug_pubnames table generated for the - compilation unit. */ +/* Return the size of the .debug_pubnames or .debug_pubtypes table + generated for the compilation unit. */ static unsigned long -size_of_pubnames (void) +size_of_pubnames (VEC (pubname_entry, gc) * names) { unsigned long size; unsigned i; + pubname_ref p; size = DWARF_PUBNAMES_HEADER_SIZE; - for (i = 0; i < pubname_table_in_use; i++) - { - pubname_ref p = &pubname_table[i]; - size += DWARF_OFFSET_SIZE + strlen (p->name) + 1; - } + for (i = 0; VEC_iterate (pubname_entry, names, i, p); i++) + if (names != pubtype_table + || p->die->die_offset != 0 + || !flag_eliminate_unused_debug_types) + size += strlen (p->name) + DWARF_OFFSET_SIZE + 1; size += DWARF_OFFSET_SIZE; return size; @@ -7332,41 +7332,73 @@ dwarf2_name (tree decl, int scope) static void add_pubname (tree decl, dw_die_ref die) { - pubname_ref p; + pubname_entry e; if (! TREE_PUBLIC (decl)) return; - if (pubname_table_in_use == pubname_table_allocated) + e.die = die; + e.name = xstrdup (dwarf2_name (decl, 1)); + VEC_safe_push (pubname_entry, gc, pubname_table, &e); +} + +/* Add a new entry to .debug_pubtypes if appropriate. */ + +static void +add_pubtype (tree decl, dw_die_ref die) +{ + pubname_entry e; + + e.name = NULL; + if ((TREE_PUBLIC (decl) + || die->die_parent == comp_unit_die) + && (die->die_tag == DW_TAG_typedef || COMPLETE_TYPE_P (decl))) { - pubname_table_allocated += PUBNAME_TABLE_INCREMENT; - pubname_table - = ggc_realloc (pubname_table, - (pubname_table_allocated * sizeof (pubname_entry))); - memset (pubname_table + pubname_table_in_use, 0, - PUBNAME_TABLE_INCREMENT * sizeof (pubname_entry)); - } + e.die = die; + if (TYPE_P (decl)) + { + if (TYPE_NAME (decl)) + { + if (TREE_CODE (TYPE_NAME (decl)) == IDENTIFIER_NODE) + e.name = xstrdup ((const char *) IDENTIFIER_POINTER + (TYPE_NAME (decl))); + else if (TREE_CODE (TYPE_NAME (decl)) == TYPE_DECL + && DECL_NAME (TYPE_NAME (decl))) + e.name = xstrdup ((const char *) IDENTIFIER_POINTER + (DECL_NAME (TYPE_NAME (decl)))); + else + e.name = xstrdup ((const char *) get_AT_string (die, DW_AT_name)); + } + } + else + e.name = xstrdup (dwarf2_name (decl, 1)); - p = &pubname_table[pubname_table_in_use++]; - p->die = die; - p->name = xstrdup (dwarf2_name (decl, 1)); + /* If we don't have a name for the type, there's no point in adding + it to the table. */ + if (e.name && e.name[0] != '\0') + VEC_safe_push (pubname_entry, gc, pubtype_table, &e); + } } /* Output the public names table used to speed up access to externally - visible names. For now, only generate entries for externally - visible procedures. */ + visible names; or the public types table used to find type definitions. */ static void -output_pubnames (void) +output_pubnames (VEC (pubname_entry, gc) * names) { unsigned i; - unsigned long pubnames_length = size_of_pubnames (); + unsigned long pubnames_length = size_of_pubnames (names); + pubname_ref pub; if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4) dw2_asm_output_data (4, 0xffffffff, "Initial length escape value indicating 64-bit DWARF extension"); - dw2_asm_output_data (DWARF_OFFSET_SIZE, pubnames_length, - "Length of Public Names Info"); + if (names == pubname_table) + dw2_asm_output_data (DWARF_OFFSET_SIZE, pubnames_length, + "Length of Public Names Info"); + else + dw2_asm_output_data (DWARF_OFFSET_SIZE, pubnames_length, + "Length of Public Type Names Info"); dw2_asm_output_data (2, DWARF_VERSION, "DWARF Version"); dw2_asm_output_offset (DWARF_OFFSET_SIZE, debug_info_section_label, debug_info_section, @@ -7374,17 +7406,21 @@ output_pubnames (void) dw2_asm_output_data (DWARF_OFFSET_SIZE, next_die_offset, "Compilation Unit Length"); - for (i = 0; i < pubname_table_in_use; i++) + for (i = 0; VEC_iterate (pubname_entry, names, i, pub); i++) { - pubname_ref pub = &pubname_table[i]; - - /* We shouldn't see pubnames for DIEs outside of the main CU. */ - gcc_assert (pub->die->die_mark); + /* We shouldn't see pubnames for DIEs outside of the main CU. */ + if (names == pubname_table) + gcc_assert (pub->die->die_mark); - dw2_asm_output_data (DWARF_OFFSET_SIZE, pub->die->die_offset, - "DIE offset"); + if (names != pubtype_table + || pub->die->die_offset != 0 + || !flag_eliminate_unused_debug_types) + { + dw2_asm_output_data (DWARF_OFFSET_SIZE, pub->die->die_offset, + "DIE offset"); - dw2_asm_output_nstring (pub->name, -1, "external name"); + dw2_asm_output_nstring (pub->name, -1, "external name"); + } } dw2_asm_output_data (DWARF_OFFSET_SIZE, 0, NULL); @@ -11298,6 +11334,9 @@ gen_array_type_die (tree type, dw_die_re #endif add_type_attribute (array_die, element_type, 0, 0, context_die); + + if (get_AT (array_die, DW_AT_name)) + add_pubtype (type, array_die); } #if 0 @@ -11433,6 +11472,9 @@ gen_enumeration_type_die (tree type, dw_ else add_AT_flag (type_die, DW_AT_declaration, 1); + if (get_AT (type_die, DW_AT_name)) + add_pubtype (type, type_die); + return type_die; } @@ -12553,6 +12595,9 @@ gen_struct_or_union_type_die (tree type, && ! decl_function_context (TYPE_STUB_DECL (type))) VEC_safe_push (tree, gc, incomplete_types, type); } + + if (get_AT (type_die, DW_AT_name)) + add_pubtype (type, type_die); } /* Generate a DIE for a subroutine _type_. */ @@ -12569,6 +12614,9 @@ gen_subroutine_type_die (tree type, dw_d add_prototyped_attribute (subr_die, type); add_type_attribute (subr_die, return_type, 0, 0, context_die); gen_formal_types_die (type, subr_die); + + if (get_AT (subr_die, DW_AT_name)) + add_pubtype (type, subr_die); } /* Generate a DIE for a type definition. */ @@ -12608,6 +12656,9 @@ gen_typedef_die (tree decl, dw_die_ref c if (DECL_ABSTRACT (decl)) equate_decl_number_to_die (decl, type_die); + + if (get_AT (type_die, DW_AT_name)) + add_pubtype (decl, type_die); } /* Generate a type description DIE. */ @@ -13932,6 +13983,10 @@ dwarf2out_init (const char *filename ATT /* Zero-th entry is allocated, but unused. */ line_info_table_in_use = 1; + /* Allocate the pubtypes and pubnames vectors. */ + pubname_table = VEC_alloc (pubname_entry, gc, 32); + pubtype_table = VEC_alloc (pubname_entry, gc, 32); + /* Generate the initial DIE for the .debug section. Note that the (string) value given in the DW_AT_name attribute of the DW_TAG_compile_unit DIE will (typically) be a relative pathname and that this pathname should be @@ -13958,6 +14013,10 @@ dwarf2out_init (const char *filename ATT SECTION_DEBUG, NULL); debug_pubnames_section = get_section (DEBUG_PUBNAMES_SECTION, SECTION_DEBUG, NULL); +#ifdef DEBUG_PUBTYPES_SECTION + debug_pubtypes_section = get_section (DEBUG_PUBTYPES_SECTION, + SECTION_DEBUG, NULL); +#endif debug_str_section = get_section (DEBUG_STR_SECTION, DEBUG_STR_SECTION_FLAGS, NULL); debug_ranges_section = get_section (DEBUG_RANGES_SECTION, @@ -14240,6 +14299,7 @@ prune_unused_types (void) { unsigned int i; limbo_die_node *node; + pubname_ref pub; #if ENABLE_ASSERT_CHECKING /* All the marks should already be clear. */ @@ -14255,8 +14315,8 @@ prune_unused_types (void) /* Also set the mark on nodes referenced from the pubname_table or arange_table. */ - for (i = 0; i < pubname_table_in_use; i++) - prune_unused_types_mark (pubname_table[i].die, 1); + for (i = 0; VEC_iterate (pubname_entry, pubname_table, i, pub); i++) + prune_unused_types_mark (pub->die, 1); for (i = 0; i < arange_table_in_use; i++) prune_unused_types_mark (arange_table[i], 1); @@ -14437,12 +14497,21 @@ dwarf2out_finish (const char *filename) output_abbrev_section (); /* Output public names table if necessary. */ - if (pubname_table_in_use) + if (!VEC_empty (pubname_entry, pubname_table)) { switch_to_section (debug_pubnames_section); - output_pubnames (); + output_pubnames (pubname_table); } +#ifdef DEBUG_PUBTYPES_SECTION + /* Output public types table if necessary. */ + if (!VEC_empty (pubname_entry, pubtype_table)) + { + switch_to_section (debug_pubtypes_section); + output_pubnames (pubtype_table); + } +#endif + /* Output the address range information. We only put functions in the arange table, so don't write it out if we don't have any. */ if (fde_table_in_use) From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 20:55:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC16BD9B; Tue, 24 Dec 2013 20:55:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 982991FEB; Tue, 24 Dec 2013 20:55:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOKtNRr068664; Tue, 24 Dec 2013 20:55:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOKtNpt068662; Tue, 24 Dec 2013 20:55:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312242055.rBOKtNpt068662@svn.freebsd.org> From: Dimitry Andric Date: Tue, 24 Dec 2013 20:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259842 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 20:55:23 -0000 Author: dim Date: Tue Dec 24 20:55:22 2013 New Revision: 259842 URL: http://svnweb.freebsd.org/changeset/base/259842 Log: Remove some unused static const strings under sys/rpc, which have never been used since the initial commit (r177633). MFC after: 3 days Modified: head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_vc.c Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Tue Dec 24 20:42:48 2013 (r259841) +++ head/sys/rpc/clnt_dg.c Tue Dec 24 20:55:22 2013 (r259842) @@ -92,8 +92,6 @@ static struct clnt_ops clnt_dg_ops = { .cl_control = clnt_dg_control }; -static const char mem_err_clnt_dg[] = "clnt_dg_create: out of memory"; - /* * A pending RPC request which awaits a reply. Requests which have * received their reply will have cr_xid set to zero and cr_mrep to Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Tue Dec 24 20:42:48 2013 (r259841) +++ head/sys/rpc/clnt_vc.c Tue Dec 24 20:55:22 2013 (r259842) @@ -107,11 +107,6 @@ static struct clnt_ops clnt_vc_ops = { static void clnt_vc_upcallsdone(struct ct_data *); -static const char clnt_vc_errstr[] = "%s : %s"; -static const char clnt_vc_str[] = "clnt_vc_create"; -static const char clnt_read_vc_str[] = "read_vc"; -static const char __no_mem_str[] = "out of memory"; - /* * Create a client handle for a connection. * Default options are set, which the user can change using clnt_control()'s. From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 20:57:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84234EE5; Tue, 24 Dec 2013 20:57:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 705C91FF5; Tue, 24 Dec 2013 20:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOKvRi1068903; Tue, 24 Dec 2013 20:57:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOKvRXI068902; Tue, 24 Dec 2013 20:57:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312242057.rBOKvRXI068902@svn.freebsd.org> From: Dimitry Andric Date: Tue, 24 Dec 2013 20:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259843 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 20:57:27 -0000 Author: dim Date: Tue Dec 24 20:57:26 2013 New Revision: 259843 URL: http://svnweb.freebsd.org/changeset/base/259843 Log: Move a static const variable to the #if 0 part where it is only used. (Note the #if 0 part has been inactive since the initial commit, r177633, so maybe it should be removed altogether). MFC after: 3 days Modified: head/sys/rpc/rpcb_clnt.c Modified: head/sys/rpc/rpcb_clnt.c ============================================================================== --- head/sys/rpc/rpcb_clnt.c Tue Dec 24 20:55:22 2013 (r259842) +++ head/sys/rpc/rpcb_clnt.c Tue Dec 24 20:57:26 2013 (r259843) @@ -64,13 +64,13 @@ __FBSDID("$FreeBSD$"); #include static struct timeval tottimeout = { 60, 0 }; -static const struct timeval rmttimeout = { 3, 0 }; static const char nullstring[] = "\000"; static CLIENT *local_rpcb(void); #if 0 +static const struct timeval rmttimeout = { 3, 0 }; static struct timeval rpcbrmttime = { 15, 0 }; #define CACHESIZE 6 From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 22:04:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91E68E68; Tue, 24 Dec 2013 22:04:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63BD213E1; Tue, 24 Dec 2013 22:04:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOM4j98095260; Tue, 24 Dec 2013 22:04:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOM4jS5095259; Tue, 24 Dec 2013 22:04:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201312242204.rBOM4jS5095259@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 24 Dec 2013 22:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259844 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 22:04:45 -0000 Author: jilles Date: Tue Dec 24 22:04:44 2013 New Revision: 259844 URL: http://svnweb.freebsd.org/changeset/base/259844 Log: sh: Remove an unused variable. Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Tue Dec 24 20:57:26 2013 (r259843) +++ head/bin/sh/var.c Tue Dec 24 22:04:44 2013 (r259844) @@ -92,7 +92,6 @@ struct var vppid; struct var vps1; struct var vps2; struct var vps4; -struct var vvers; static struct var voptind; struct var vdisvfork; From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 22:24:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70A0527E; Tue, 24 Dec 2013 22:24:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42733156C; Tue, 24 Dec 2013 22:24:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOMOInZ002731; Tue, 24 Dec 2013 22:24:18 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOMOIAv002730; Tue, 24 Dec 2013 22:24:18 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201312242224.rBOMOIAv002730@svn.freebsd.org> From: Rick Macklem Date: Tue, 24 Dec 2013 22:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259845 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 22:24:18 -0000 Author: rmacklem Date: Tue Dec 24 22:24:17 2013 New Revision: 259845 URL: http://svnweb.freebsd.org/changeset/base/259845 Log: An intermittent problem with NFSv4 exporting of ZFS snapshots was reported to the freebsd-fs mailing list. I believe the problem was caused by the Readdir operation using VFS_VGET() for a snapshot file entry instead of VOP_LOOKUP(). This would not occur for NFSv3, since it will do a VFS_VGET() of "." which fails with ENOTSUPP at the beginning of the directory, whereas NFSv4 does not check "." or "..". This patch adds a call to VFS_VGET() for the directory being read to check for ENOTSUPP. I also observed that the mount_on_fileid and fsid attributes were not correct at the snapshot's auto mountpoints when looking at packet traces for the Readdir. This patch fixes the attributes by doing a check for different v_mount structure, even if the vnode v_mountedhere is not set. Reported by: jas@cse.yorku.ca Tested by: jas@cse.yorku.ca Reviewed by: asomers MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Tue Dec 24 22:04:44 2013 (r259844) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Tue Dec 24 22:24:17 2013 (r259845) @@ -1984,6 +1984,27 @@ again: } /* + * Check to see if entries in this directory can be safely acquired + * via VFS_VGET() or if a switch to VOP_LOOKUP() is required. + * ZFS snapshot directories need VOP_LOOKUP(), so that any + * automount of the snapshot directory that is required will + * be done. + * This needs to be done here for NFSv4, since NFSv4 never does + * a VFS_VGET() for "." or "..". + */ + if (not_zfs == 0) { + r = VFS_VGET(mp, at.na_fileid, LK_SHARED, &nvp); + if (r == EOPNOTSUPP) { + usevget = 0; + cn.cn_nameiop = LOOKUP; + cn.cn_lkflags = LK_SHARED | LK_RETRY; + cn.cn_cred = nd->nd_cred; + cn.cn_thread = p; + } else if (r == 0) + vput(nvp); + } + + /* * Save this position, in case there is an error before one entry * is created. */ @@ -2120,6 +2141,22 @@ again: if (!r) r = nfsvno_getattr(nvp, nvap, nd->nd_cred, p, 1); + if (r == 0 && not_zfs == 0 && + nfsrv_enable_crossmntpt != 0 && + (nd->nd_flag & ND_NFSV4) != 0 && + nvp->v_type == VDIR && + vp->v_mount != nvp->v_mount) { + /* + * For a ZFS snapshot, there is a + * pseudo mount that does not set + * v_mountedhere, so it needs to + * be detected via a different + * mount structure. + */ + at_root = 1; + if (new_mp == mp) + new_mp = nvp->v_mount; + } } } else { nvp = NULL; From owner-svn-src-head@FreeBSD.ORG Tue Dec 24 22:38:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE73D61E; Tue, 24 Dec 2013 22:38:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 997EE1626; Tue, 24 Dec 2013 22:38:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOMcP0Z006759; Tue, 24 Dec 2013 22:38:25 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOMcP2S006756; Tue, 24 Dec 2013 22:38:25 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201312242238.rBOMcP2S006756@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 24 Dec 2013 22:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259846 - in head/bin/sh: . tests/parameters X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 22:38:25 -0000 Author: jilles Date: Tue Dec 24 22:38:24 2013 New Revision: 259846 URL: http://svnweb.freebsd.org/changeset/base/259846 Log: sh: Initialize OPTIND=1 even if it came from the environment. Added: head/bin/sh/tests/parameters/optind2.0 (contents, props changed) Modified: head/bin/sh/tests/parameters/Makefile head/bin/sh/var.c Modified: head/bin/sh/tests/parameters/Makefile ============================================================================== --- head/bin/sh/tests/parameters/Makefile Tue Dec 24 22:24:17 2013 (r259845) +++ head/bin/sh/tests/parameters/Makefile Tue Dec 24 22:38:24 2013 (r259846) @@ -10,6 +10,7 @@ FILES+= exitstatus1.0 FILES+= mail1.0 FILES+= mail2.0 FILES+= optind1.0 +FILES+= optind2.0 FILES+= positional1.0 FILES+= positional2.0 FILES+= pwd1.0 Added: head/bin/sh/tests/parameters/optind2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parameters/optind2.0 Tue Dec 24 22:38:24 2013 (r259846) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +[ "$(OPTIND=42 ${SH} -c 'printf %s "$OPTIND"')" = 1 ] Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Tue Dec 24 22:24:17 2013 (r259845) +++ head/bin/sh/var.c Tue Dec 24 22:38:24 2013 (r259846) @@ -188,6 +188,7 @@ initvar(void) setvareq(*envp, VEXPORT|VTEXTFIXED); } } + setvareq("OPTIND=1", VTEXTFIXED); } /* From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 00:39:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7294178; Wed, 25 Dec 2013 00:39:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A0E3D1E93; Wed, 25 Dec 2013 00:39:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBP0d5lo051662; Wed, 25 Dec 2013 00:39:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBP0d4hg051655; Wed, 25 Dec 2013 00:39:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312250039.rBP0d4hg051655@svn.freebsd.org> From: Xin LI Date: Wed, 25 Dec 2013 00:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259850 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 00:39:05 -0000 Author: delphij Date: Wed Dec 25 00:39:04 2013 New Revision: 259850 URL: http://svnweb.freebsd.org/changeset/base/259850 Log: MFV r258384: 2583 Add -p (parsable) option to zfs list illumos/illumos-gate@43d68d68c1ce08fb35026bebfb141af422e7082e MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Dec 24 23:50:35 2013 (r259849) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Dec 25 00:39:04 2013 (r259850) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2013 +.Dd December 24, 2013 .Dt ZFS 8 .Os .Sh NAME @@ -102,7 +102,7 @@ .Nm .Cm list .Op Fl r Ns | Ns Fl d Ar depth -.Op Fl H +.Op Fl Hp .Op Fl o Ar property Ns Oo , Ns property Ns Oc Ns ... .Op Fl t Ar type Ns Oo , Ns type Ns Oc Ns ... .Oo Fl s Ar property Oc Ns ... @@ -1807,7 +1807,7 @@ only dataset that can be renamed recursi .Nm .Cm list .Op Fl r Ns | Ns Fl d Ar depth -.Op Fl H +.Op Fl Hp .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... .Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... .Oo Fl s Ar property Oc Ns ... @@ -1838,6 +1838,8 @@ will display only the dataset and its di .It Fl H Used for scripting mode. Do not print headers and separate fields by a single tab instead of arbitrary white space. +.It Fl p +Display numbers in parsable (exact) values. .It Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... A comma-separated list of properties to display. The property must be: .Bl -bullet -offset 2n @@ -1978,7 +1980,7 @@ Display output in a form more easily par omitted, and fields are explicitly separated by a single tab instead of an arbitrary amount of space. .It Fl p -Display numbers in parseable (exact) values. +Display numbers in parsable (exact) values. .It Fl o Cm all | Ar field Ns Oo , Ns Ar field Oc Ns ... A comma-separated list of columns to display. Supported values are .Sy name,property,value,received,source . @@ -2820,7 +2822,7 @@ option of .It \&P Ta event port (not supported on Fx ) .El .It Fl H -Give more parseable tab-separated output, without header lines and without +Give more parsable tab-separated output, without header lines and without arrows. .It Fl t Display the path's inode change time as the first column of output. Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Tue Dec 24 23:50:35 2013 (r259849) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Wed Dec 25 00:39:04 2013 (r259850) @@ -18,10 +18,12 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -109,7 +111,8 @@ zfs_callback(zfs_handle_t *zhp, void *da cb->cb_props_table); if (zfs_expand_proplist(zhp, cb->cb_proplist, - (cb->cb_flags & ZFS_ITER_RECVD_PROPS)) + (cb->cb_flags & ZFS_ITER_RECVD_PROPS), + (cb->cb_flags & ZFS_ITER_LITERAL_PROPS)) != 0) { free(node); return (-1); Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h Tue Dec 24 23:50:35 2013 (r259849) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h Wed Dec 25 00:39:04 2013 (r259850) @@ -18,9 +18,11 @@ * * CDDL HEADER END */ + /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #ifndef ZFS_ITER_H @@ -44,6 +46,7 @@ typedef struct zfs_sort_column { #define ZFS_ITER_DEPTH_LIMIT (1 << 3) #define ZFS_ITER_RECVD_PROPS (1 << 4) #define ZFS_ITER_SIMPLE (1 << 5) +#define ZFS_ITER_LITERAL_PROPS (1 << 6) int zfs_for_each(int, char **, int options, zfs_type_t, zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *); Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Dec 24 23:50:35 2013 (r259849) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Dec 25 00:39:04 2013 (r259850) @@ -21,7 +21,6 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. @@ -29,6 +28,7 @@ * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -249,9 +249,8 @@ get_usage(zfs_help_t idx) case HELP_UNJAIL: return (gettext("\tunjail \n")); case HELP_LIST: - return (gettext("\tlist [-rH][-d max] " - "[-o property[,...]] [-t type[,...]] [-s property] ...\n" - "\t [-S property] ... " + return (gettext("\tlist [-Hp] [-r|-d max] [-o property[,...]] " + "[-s property]...\n\t [-S property]... [-t type[,...]] " "[filesystem|volume|snapshot] ...\n")); case HELP_MOUNT: return (gettext("\tmount\n" @@ -310,12 +309,12 @@ get_usage(zfs_help_t idx) "\n")); case HELP_USERSPACE: return (gettext("\tuserspace [-Hinp] [-o field[,...]] " - "[-s field] ...\n\t[-S field] ... " - "[-t type[,...]] \n")); + "[-s field]...\n\t [-S field]... [-t type[,...]] " + "\n")); case HELP_GROUPSPACE: return (gettext("\tgroupspace [-Hinp] [-o field[,...]] " - "[-s field] ...\n\t[-S field] ... " - "[-t type[,...]] \n")); + "[-s field]...\n\t [-S field]... [-t type[,...]] " + "\n")); case HELP_HOLD: return (gettext("\thold [-r] ...\n")); case HELP_HOLDS: @@ -2124,7 +2123,7 @@ zfs_do_upgrade(int argc, char **argv) * -i Translate SID to POSIX ID. * -n Print numeric ID instead of user/group name. * -o Control which fields to display. - * -p Use exact (parseable) numeric output. + * -p Use exact (parsable) numeric output. * -s Specify sort columns, descending order. * -S Specify sort columns, ascending order. * -t Control which object types to display. @@ -2811,24 +2810,25 @@ zfs_do_userspace(int argc, char **argv) } /* - * list [-r][-d max] [-H] [-o property[,property]...] [-t type[,type]...] - * [-s property [-s property]...] [-S property [-S property]...] - * ... + * list [-Hp][-r|-d max] [-o property[,...]] [-s property] ... [-S property] ... + * [-t type[,...]] [filesystem|volume|snapshot] ... * - * -r Recurse over all children + * -H Scripted mode; elide headers and separate columns by tabs. + * -p Display values in parsable (literal) format. + * -r Recurse over all children. * -d Limit recursion by depth. - * -H Scripted mode; elide headers and separate columns by tabs * -o Control which fields to display. - * -t Control which object types to display. * -s Specify sort columns, descending order. * -S Specify sort columns, ascending order. + * -t Control which object types to display. * - * When given no arguments, lists all filesystems in the system. + * When given no arguments, list all filesystems in the system. * Otherwise, list the specified datasets, optionally recursing down them if * '-r' is specified. */ typedef struct list_cbdata { boolean_t cb_first; + boolean_t cb_literal; boolean_t cb_scripted; zprop_list_t *cb_proplist; } list_cbdata_t; @@ -2837,8 +2837,9 @@ typedef struct list_cbdata { * Given a list of columns to display, output appropriate headers for each one. */ static void -print_header(zprop_list_t *pl) +print_header(list_cbdata_t *cb) { + zprop_list_t *pl = cb->cb_proplist; char headerbuf[ZFS_MAXPROPLEN]; const char *header; int i; @@ -2879,19 +2880,19 @@ print_header(zprop_list_t *pl) * to the described layout. */ static void -print_dataset(zfs_handle_t *zhp, zprop_list_t *pl, boolean_t scripted) +print_dataset(zfs_handle_t *zhp, list_cbdata_t *cb) { + zprop_list_t *pl = cb->cb_proplist; boolean_t first = B_TRUE; char property[ZFS_MAXPROPLEN]; nvlist_t *userprops = zfs_get_user_props(zhp); nvlist_t *propval; char *propstr; boolean_t right_justify; - int width; for (; pl != NULL; pl = pl->pl_next) { if (!first) { - if (scripted) + if (cb->cb_scripted) (void) printf("\t"); else (void) printf(" "); @@ -2906,22 +2907,22 @@ print_dataset(zfs_handle_t *zhp, zprop_l right_justify = zfs_prop_align_right(pl->pl_prop); } else if (pl->pl_prop != ZPROP_INVAL) { if (zfs_prop_get(zhp, pl->pl_prop, property, - sizeof (property), NULL, NULL, 0, B_FALSE) != 0) + sizeof (property), NULL, NULL, 0, + cb->cb_literal) != 0) propstr = "-"; else propstr = property; - right_justify = zfs_prop_align_right(pl->pl_prop); } else if (zfs_prop_userquota(pl->pl_user_prop)) { if (zfs_prop_get_userquota(zhp, pl->pl_user_prop, - property, sizeof (property), B_FALSE) != 0) + property, sizeof (property), cb->cb_literal) != 0) propstr = "-"; else propstr = property; right_justify = B_TRUE; } else if (zfs_prop_written(pl->pl_user_prop)) { if (zfs_prop_get_written(zhp, pl->pl_user_prop, - property, sizeof (property), B_FALSE) != 0) + property, sizeof (property), cb->cb_literal) != 0) propstr = "-"; else propstr = property; @@ -2936,19 +2937,17 @@ print_dataset(zfs_handle_t *zhp, zprop_l right_justify = B_FALSE; } - width = pl->pl_width; - /* * If this is being called in scripted mode, or if this is the * last column and it is left-justified, don't include a width * format specifier. */ - if (scripted || (pl->pl_next == NULL && !right_justify)) + if (cb->cb_scripted || (pl->pl_next == NULL && !right_justify)) (void) printf("%s", propstr); else if (right_justify) - (void) printf("%*s", width, propstr); + (void) printf("%*s", pl->pl_width, propstr); else - (void) printf("%-*s", width, propstr); + (void) printf("%-*s", pl->pl_width, propstr); } (void) printf("\n"); @@ -2964,11 +2963,11 @@ list_callback(zfs_handle_t *zhp, void *d if (cbp->cb_first) { if (!cbp->cb_scripted) - print_header(cbp->cb_proplist); + print_header(cbp); cbp->cb_first = B_FALSE; } - print_dataset(zhp, cbp->cb_proplist, cbp->cb_scripted); + print_dataset(zhp, cbp); return (0); } @@ -2977,7 +2976,6 @@ static int zfs_do_list(int argc, char **argv) { int c; - boolean_t scripted = B_FALSE; static char default_fields[] = "name,used,available,referenced,mountpoint"; int types = ZFS_TYPE_DATASET; @@ -2991,11 +2989,15 @@ zfs_do_list(int argc, char **argv) int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS; /* check options */ - while ((c = getopt(argc, argv, ":d:o:rt:Hs:S:")) != -1) { + while ((c = getopt(argc, argv, "HS:d:o:prs:t:")) != -1) { switch (c) { case 'o': fields = optarg; break; + case 'p': + cb.cb_literal = B_TRUE; + flags |= ZFS_ITER_LITERAL_PROPS; + break; case 'd': limit = parse_depth(optarg, &flags); break; @@ -3003,7 +3005,7 @@ zfs_do_list(int argc, char **argv) flags |= ZFS_ITER_RECURSE; break; case 'H': - scripted = B_TRUE; + cb.cb_scripted = B_TRUE; break; case 's': if (zfs_add_sort_column(&sortcol, optarg, @@ -3093,7 +3095,6 @@ zfs_do_list(int argc, char **argv) != 0) usage(B_FALSE); - cb.cb_scripted = scripted; cb.cb_first = B_TRUE; ret = zfs_for_each(argc, argv, flags, types, sortcol, &cb.cb_proplist, Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Dec 24 23:50:35 2013 (r259849) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Wed Dec 25 00:39:04 2013 (r259850) @@ -21,13 +21,13 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #ifndef _LIBZFS_H @@ -463,7 +463,8 @@ typedef struct zprop_list { boolean_t pl_fixed; } zprop_list_t; -extern int zfs_expand_proplist(zfs_handle_t *, zprop_list_t **, boolean_t); +extern int zfs_expand_proplist(zfs_handle_t *, zprop_list_t **, boolean_t, + boolean_t); extern void zfs_prune_proplist(zfs_handle_t *, uint8_t *); #define ZFS_MOUNTPOINT_NONE "none" Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Dec 24 23:50:35 2013 (r259849) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Dec 25 00:39:04 2013 (r259850) @@ -23,11 +23,11 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -3882,7 +3882,8 @@ zfs_get_recvd_props(zfs_handle_t *zhp) * of the RECEIVED column. */ int -zfs_expand_proplist(zfs_handle_t *zhp, zprop_list_t **plp, boolean_t received) +zfs_expand_proplist(zfs_handle_t *zhp, zprop_list_t **plp, boolean_t received, + boolean_t literal) { libzfs_handle_t *hdl = zhp->zfs_hdl; zprop_list_t *entry; @@ -3944,18 +3945,18 @@ zfs_expand_proplist(zfs_handle_t *zhp, z * Now go through and check the width of any non-fixed columns */ for (entry = *plp; entry != NULL; entry = entry->pl_next) { - if (entry->pl_fixed) + if (entry->pl_fixed && !literal) continue; if (entry->pl_prop != ZPROP_INVAL) { if (zfs_prop_get(zhp, entry->pl_prop, - buf, sizeof (buf), NULL, NULL, 0, B_FALSE) == 0) { + buf, sizeof (buf), NULL, NULL, 0, literal) == 0) { if (strlen(buf) > entry->pl_width) entry->pl_width = strlen(buf); } if (received && zfs_prop_get_recvd(zhp, zfs_prop_to_name(entry->pl_prop), - buf, sizeof (buf), B_FALSE) == 0) + buf, sizeof (buf), literal) == 0) if (strlen(buf) > entry->pl_recvd_width) entry->pl_recvd_width = strlen(buf); } else { @@ -3968,7 +3969,7 @@ zfs_expand_proplist(zfs_handle_t *zhp, z } if (received && zfs_prop_get_recvd(zhp, entry->pl_user_prop, - buf, sizeof (buf), B_FALSE) == 0) + buf, sizeof (buf), literal) == 0) if (strlen(buf) > entry->pl_recvd_width) entry->pl_recvd_width = strlen(buf); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 01:03:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5593B4D; Wed, 25 Dec 2013 01:03:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 853051023; Wed, 25 Dec 2013 01:03:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBP13FZK062282; Wed, 25 Dec 2013 01:03:15 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBP13EX1062277; Wed, 25 Dec 2013 01:03:14 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201312250103.rBP13EX1062277@svn.freebsd.org> From: Rick Macklem Date: Wed, 25 Dec 2013 01:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259854 - in head/sys/fs: nfs nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 01:03:15 -0000 Author: rmacklem Date: Wed Dec 25 01:03:14 2013 New Revision: 259854 URL: http://svnweb.freebsd.org/changeset/base/259854 Log: The NFSv4 server would call VOP_SETATTR() with a shared locked vnode when a Getattr for a file is done by a client other than the one that holds the file's delegation. This would only happen when delegations are enabled and the problem is fixed by this patch. MFC after: 1 week Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Wed Dec 25 00:53:48 2013 (r259853) +++ head/sys/fs/nfs/nfs_var.h Wed Dec 25 01:03:14 2013 (r259854) @@ -613,7 +613,7 @@ void nfsvno_open(struct nfsrv_descript * nfsv4stateid_t *, struct nfsstate *, int *, struct nfsvattr *, int32_t *, int, NFSACL_T *, nfsattrbit_t *, struct ucred *, NFSPROC_T *, struct nfsexstuff *, vnode_t *); -void nfsvno_updfilerev(vnode_t, struct nfsvattr *, struct ucred *, +int nfsvno_updfilerev(vnode_t, struct nfsvattr *, struct ucred *, NFSPROC_T *); int nfsvno_fillattr(struct nfsrv_descript *, struct mount *, vnode_t, struct nfsvattr *, fhandle_t *, int, nfsattrbit_t *, Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 25 00:53:48 2013 (r259853) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 25 01:03:14 2013 (r259854) @@ -1469,8 +1469,9 @@ nfsvno_open(struct nfsrv_descript *nd, s * Updates the file rev and sets the mtime and ctime * to the current clock time, returning the va_filerev and va_Xtime * values. + * Return ESTALE to indicate the vnode is VI_DOOMED. */ -void +int nfsvno_updfilerev(struct vnode *vp, struct nfsvattr *nvap, struct ucred *cred, struct thread *p) { @@ -1478,8 +1479,14 @@ nfsvno_updfilerev(struct vnode *vp, stru VATTR_NULL(&va); vfs_timestamp(&va.va_mtime); + if (NFSVOPISLOCKED(vp) != LK_EXCLUSIVE) { + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) != 0) + return (ESTALE); + } (void) VOP_SETATTR(vp, &va, cred); (void) nfsvno_getattr(vp, nvap, cred, p, 1); + return (0); } /* Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Wed Dec 25 00:53:48 2013 (r259853) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Wed Dec 25 01:03:14 2013 (r259854) @@ -4853,15 +4853,15 @@ nfsrv_checkgetattr(struct nfsrv_descript nva.na_filerev > delegfilerev) || (NFSVNO_ISSETSIZE(&nva) && nva.na_size != nvap->na_size)) { - nfsvno_updfilerev(vp, nvap, cred, p); + error = nfsvno_updfilerev(vp, nvap, cred, p); if (NFSVNO_ISSETSIZE(&nva)) nvap->na_size = nva.na_size; } - } + } else + error = 0; /* Ignore callback errors for now. */ } else { NFSUNLOCKSTATE(); } - error = 0; out: NFSEXITCODE2(error, nd); From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 01:20:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D712DC6; Wed, 25 Dec 2013 01:20:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5974910D3; Wed, 25 Dec 2013 01:20:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBP1KFoI067415; Wed, 25 Dec 2013 01:20:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBP1KF0H067414; Wed, 25 Dec 2013 01:20:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312250120.rBP1KF0H067414@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 25 Dec 2013 01:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259855 - head/usr.sbin/ndiscvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 01:20:15 -0000 Author: glebius Date: Wed Dec 25 01:20:14 2013 New Revision: 259855 URL: http://svnweb.freebsd.org/changeset/base/259855 Log: We have in base iconv. PR: 185135 Submitted by: Lars Engels Modified: head/usr.sbin/ndiscvt/ndisgen.sh Modified: head/usr.sbin/ndiscvt/ndisgen.sh ============================================================================== --- head/usr.sbin/ndiscvt/ndisgen.sh Wed Dec 25 01:03:14 2013 (r259854) +++ head/usr.sbin/ndiscvt/ndisgen.sh Wed Dec 25 01:20:14 2013 (r259855) @@ -493,7 +493,7 @@ convert_driver () { return } -ICONVPATH=/usr/local/bin/iconv +ICONVPATH=/usr/bin/iconv NDISCVT=/usr/sbin/ndiscvt STUBPATH=/usr/share/misc STUBFILE=windrv_stub.c From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 01:58:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD2A5583; Wed, 25 Dec 2013 01:58:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D83514B4; Wed, 25 Dec 2013 01:58:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBP1wKDb080978; Wed, 25 Dec 2013 01:58:20 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBP1wKOm080976; Wed, 25 Dec 2013 01:58:20 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312250158.rBP1wKOm080976@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 25 Dec 2013 01:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259857 - head/sys/netinet/libalias X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 01:58:20 -0000 Author: glebius Date: Wed Dec 25 01:58:19 2013 New Revision: 259857 URL: http://svnweb.freebsd.org/changeset/base/259857 Log: Remove from kernel the "dll" code. Modified: head/sys/netinet/libalias/alias_mod.c head/sys/netinet/libalias/alias_mod.h Modified: head/sys/netinet/libalias/alias_mod.c ============================================================================== --- head/sys/netinet/libalias/alias_mod.c Wed Dec 25 01:52:55 2013 (r259856) +++ head/sys/netinet/libalias/alias_mod.c Wed Dec 25 01:58:19 2013 (r259857) @@ -245,8 +245,8 @@ first_handler(void) return (LIST_FIRST(&handler_chain)); } +#ifndef _KERNEL /* Dll manipulation code - this code is not thread safe... */ - int attach_dll(struct dll *p) { @@ -288,3 +288,4 @@ walk_dll_chain(void) SLIST_REMOVE_HEAD(&dll_chain, next); return (t); } +#endif /* !_KERNEL */ Modified: head/sys/netinet/libalias/alias_mod.h ============================================================================== --- head/sys/netinet/libalias/alias_mod.h Wed Dec 25 01:52:55 2013 (r259856) +++ head/sys/netinet/libalias/alias_mod.h Wed Dec 25 01:58:19 2013 (r259857) @@ -82,8 +82,22 @@ struct proto_handler { int (*protohandler)(struct libalias *, struct ip *, struct alias_data *); LIST_ENTRY(proto_handler) entries; -}; +} +; +/* End of handlers. */ +#define EOH -1 + +/* Functions used with protocol handlers. */ +void handler_chain_init(void); +void handler_chain_destroy(void); +int LibAliasAttachHandlers(struct proto_handler *); +int LibAliasDetachHandlers(struct proto_handler *); +int detach_handler(struct proto_handler *); +int find_handler(int8_t, int8_t, struct libalias *, struct ip *, + struct alias_data *); +struct proto_handler *first_handler(void); +#ifndef _KERNEL /* * Used only in userland when libalias needs to keep track of all * module loaded. In kernel land (kld mode) we don't need to care @@ -101,16 +115,6 @@ struct dll { SLIST_ENTRY(dll) next; }; -/* Functions used with protocol handlers. */ -void handler_chain_init(void); -void handler_chain_destroy(void); -int LibAliasAttachHandlers(struct proto_handler *); -int LibAliasDetachHandlers(struct proto_handler *); -int detach_handler(struct proto_handler *); -int find_handler(int8_t, int8_t, struct libalias *, struct ip *, - struct alias_data *); -struct proto_handler *first_handler(void); - /* Functions used with dll module. */ void dll_chain_init(void); void dll_chain_destroy(void); @@ -118,14 +122,10 @@ int attach_dll(struct dll *); void *detach_dll(char *); struct dll *walk_dll_chain(void); -/* End of handlers. */ -#define EOH -1 - /* * Some defines borrowed from sys/module.h used to compile a kld * in userland as a shared lib. */ -#ifndef _KERNEL typedef enum modeventtype { MOD_LOAD, MOD_UNLOAD, @@ -144,6 +144,6 @@ typedef struct moduledata { modeventhand_t evhand; /* event handler */ void *priv; /* extra data */ } moduledata_t; -#endif +#endif /* !_KERNEL */ #endif /* !_ALIAS_MOD_H_ */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 01:52:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25005212; Wed, 25 Dec 2013 01:52:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 107781485; Wed, 25 Dec 2013 01:52:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBP1qtQl080352; Wed, 25 Dec 2013 01:52:55 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBP1qtlY080350; Wed, 25 Dec 2013 01:52:55 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312250152.rBP1qtlY080350@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 25 Dec 2013 01:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259856 - head/sys/netinet/libalias X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 01:52:56 -0000 Author: glebius Date: Wed Dec 25 01:52:55 2013 New Revision: 259856 URL: http://svnweb.freebsd.org/changeset/base/259856 Log: Whitespace cleanup. Modified: head/sys/netinet/libalias/alias_mod.c head/sys/netinet/libalias/alias_mod.h Modified: head/sys/netinet/libalias/alias_mod.c ============================================================================== --- head/sys/netinet/libalias/alias_mod.c Wed Dec 25 01:20:14 2013 (r259855) +++ head/sys/netinet/libalias/alias_mod.c Wed Dec 25 01:52:55 2013 (r259856) @@ -56,15 +56,15 @@ LIST_HEAD(handler_chain, proto_handler) #ifdef _KERNEL struct rwlock handler_rw; #endif -SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(dll_chain); +SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(dll_chain); #ifdef _KERNEL #define LIBALIAS_RWLOCK_INIT() \ - rw_init(&handler_rw, "Libalias_modules_rwlock") + rw_init(&handler_rw, "Libalias_modules_rwlock") #define LIBALIAS_RWLOCK_DESTROY() rw_destroy(&handler_rw) #define LIBALIAS_WLOCK_ASSERT() \ - rw_assert(&handler_rw, RA_WLOCKED) + rw_assert(&handler_rw, RA_WLOCKED) static __inline void LIBALIAS_RLOCK(void) @@ -116,7 +116,7 @@ _handler_chain_destroy(void) #define LIBALIAS_WUNLOCK() ; #define _handler_chain_init() ; #define _handler_chain_destroy() ; -#endif +#endif void handler_chain_init(void) @@ -138,7 +138,7 @@ _attach_handler(struct proto_handler *p) LIBALIAS_WLOCK_ASSERT(); b = NULL; LIST_FOREACH(b, &handler_chain, entries) { - if ((b->pri == p->pri) && + if ((b->pri == p->pri) && (b->dir == p->dir) && (b->proto == p->proto)) return (EEXIST); /* Priority conflict. */ @@ -160,7 +160,7 @@ _detach_handler(struct proto_handler *p) { struct proto_handler *b, *b_tmp; - LIBALIAS_WLOCK_ASSERT(); + LIBALIAS_WLOCK_ASSERT(); LIST_FOREACH_SAFE(b, &handler_chain, entries, b_tmp) { if (b == p) { LIST_REMOVE(b, entries); @@ -178,10 +178,10 @@ LibAliasAttachHandlers(struct proto_hand LIBALIAS_WLOCK(); error = -1; for (i = 0; 1; i++) { - if (*((int *)&_p[i]) == EOH) + if (*((int *)&_p[i]) == EOH) break; error = _attach_handler(&_p[i]); - if (error != 0) + if (error != 0) break; } LIBALIAS_WUNLOCK(); @@ -196,10 +196,10 @@ LibAliasDetachHandlers(struct proto_hand LIBALIAS_WLOCK(); error = -1; for (i = 0; 1; i++) { - if (*((int *)&_p[i]) == EOH) + if (*((int *)&_p[i]) == EOH) break; error = _detach_handler(&_p[i]); - if (error != 0) + if (error != 0) break; } LIBALIAS_WUNLOCK(); @@ -219,7 +219,7 @@ detach_handler(struct proto_handler *_p) } int -find_handler(int8_t dir, int8_t proto, struct libalias *la, __unused struct ip *pip, +find_handler(int8_t dir, int8_t proto, struct libalias *la, __unused struct ip *pip, struct alias_data *ad) { struct proto_handler *p; @@ -235,14 +235,14 @@ find_handler(int8_t dir, int8_t proto, s } } LIBALIAS_RUNLOCK(); - return (error); + return (error); } struct proto_handler * first_handler(void) { - - return (LIST_FIRST(&handler_chain)); + + return (LIST_FIRST(&handler_chain)); } /* Dll manipulation code - this code is not thread safe... */ @@ -270,7 +270,7 @@ detach_dll(char *p) error = NULL; SLIST_FOREACH_SAFE(b, &dll_chain, next, b_tmp) if (!strncmp(b->name, p, DLL_LEN)) { - SLIST_REMOVE(&dll_chain, b, dll, next); + SLIST_REMOVE(&dll_chain, b, dll, next); error = b; break; } Modified: head/sys/netinet/libalias/alias_mod.h ============================================================================== --- head/sys/netinet/libalias/alias_mod.h Wed Dec 25 01:20:14 2013 (r259855) +++ head/sys/netinet/libalias/alias_mod.h Wed Dec 25 01:52:55 2013 (r259856) @@ -45,102 +45,94 @@ MALLOC_DECLARE(M_ALIAS); #endif #endif -/* Protocol handlers struct & function. */ - /* Packet flow direction. */ -#define IN 1 -#define OUT 2 +#define IN 1 +#define OUT 2 /* Working protocol. */ -#define IP 1 -#define TCP 2 -#define UDP 4 +#define IP 1 +#define TCP 2 +#define UDP 4 -/* +/* * Data passed to protocol handler module, it must be filled * right before calling find_handler() to determine which * module is elegible to be called. */ +struct alias_data { + struct alias_link *lnk; + struct in_addr *oaddr; /* Original address. */ + struct in_addr *aaddr; /* Alias address. */ + uint16_t *aport; /* Alias port. */ + uint16_t *sport, *dport; /* Source & destination port */ + uint16_t maxpktsize; /* Max packet size. */ +}; -struct alias_data { - struct alias_link *lnk; - struct in_addr *oaddr; /* Original address. */ - struct in_addr *aaddr; /* Alias address. */ - uint16_t *aport; /* Alias port. */ - uint16_t *sport, *dport; /* Source & destination port */ - uint16_t maxpktsize; /* Max packet size. */ -}; - -/* +/* * This structure contains all the information necessary to make * a protocol handler correctly work. */ - struct proto_handler { - u_int pri; /* Handler priority. */ - int16_t dir; /* Flow direction. */ - uint8_t proto; /* Working protocol. */ - int (*fingerprint)(struct libalias *, /* Fingerprint * function. */ - struct alias_data *); - int (*protohandler)(struct libalias *, /* Aliasing * function. */ - struct ip *, struct alias_data *); + u_int pri; /* Handler priority. */ + int16_t dir; /* Flow direction. */ + uint8_t proto; /* Working protocol. */ + /* Fingerprint * function. */ + int (*fingerprint)(struct libalias *, struct alias_data *); + /* Aliasing * function. */ + int (*protohandler)(struct libalias *, struct ip *, + struct alias_data *); LIST_ENTRY(proto_handler) entries; }; - -/* +/* * Used only in userland when libalias needs to keep track of all * module loaded. In kernel land (kld mode) we don't need to care * care about libalias modules cause it's kld to do it for us. */ - -#define DLL_LEN 32 -struct dll { - char name[DLL_LEN]; /* Name of module. */ - void *handle; /* - * Ptr to shared obj obtained through - * dlopen() - use this ptr to get access - * to any symbols from a loaded module - * via dlsym(). - */ - SLIST_ENTRY(dll) next; +#define DLL_LEN 32 +struct dll { + char name[DLL_LEN]; /* Name of module. */ + void *handle; /* + * Ptr to shared obj obtained through + * dlopen() - use this ptr to get access + * to any symbols from a loaded module + * via dlsym(). + */ + SLIST_ENTRY(dll) next; }; /* Functions used with protocol handlers. */ - -void handler_chain_init(void); -void handler_chain_destroy(void); -int LibAliasAttachHandlers(struct proto_handler *); -int LibAliasDetachHandlers(struct proto_handler *); -int detach_handler(struct proto_handler *); -int find_handler(int8_t, int8_t, struct libalias *, - struct ip *, struct alias_data *); +void handler_chain_init(void); +void handler_chain_destroy(void); +int LibAliasAttachHandlers(struct proto_handler *); +int LibAliasDetachHandlers(struct proto_handler *); +int detach_handler(struct proto_handler *); +int find_handler(int8_t, int8_t, struct libalias *, struct ip *, + struct alias_data *); struct proto_handler *first_handler(void); /* Functions used with dll module. */ - -void dll_chain_init(void); -void dll_chain_destroy(void); -int attach_dll(struct dll *); -void *detach_dll(char *); -struct dll *walk_dll_chain(void); +void dll_chain_init(void); +void dll_chain_destroy(void); +int attach_dll(struct dll *); +void *detach_dll(char *); +struct dll *walk_dll_chain(void); /* End of handlers. */ #define EOH -1 -/* +/* * Some defines borrowed from sys/module.h used to compile a kld * in userland as a shared lib. */ - #ifndef _KERNEL typedef enum modeventtype { - MOD_LOAD, - MOD_UNLOAD, - MOD_SHUTDOWN, - MOD_QUIESCE + MOD_LOAD, + MOD_UNLOAD, + MOD_SHUTDOWN, + MOD_QUIESCE } modeventtype_t; - + typedef struct module *module_t; typedef int (*modeventhand_t)(module_t, int /* modeventtype_t */, void *); @@ -148,10 +140,10 @@ typedef int (*modeventhand_t)(module_t, * Struct for registering modules statically via SYSINIT. */ typedef struct moduledata { - const char *name; /* module name */ - modeventhand_t evhand; /* event handler */ - void *priv; /* extra data */ + const char *name; /* module name */ + modeventhand_t evhand; /* event handler */ + void *priv; /* extra data */ } moduledata_t; #endif -#endif /* !_ALIAS_MOD_H_ */ +#endif /* !_ALIAS_MOD_H_ */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 02:06:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D35FA59; Wed, 25 Dec 2013 02:06:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 57DC11571; Wed, 25 Dec 2013 02:06:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBP26xoh084904; Wed, 25 Dec 2013 02:06:59 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBP26wsD084895; Wed, 25 Dec 2013 02:06:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312250206.rBP26wsD084895@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 25 Dec 2013 02:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259858 - head/sys/netinet/libalias X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 02:06:59 -0000 Author: glebius Date: Wed Dec 25 02:06:57 2013 New Revision: 259858 URL: http://svnweb.freebsd.org/changeset/base/259858 Log: Kill space at eols. Modified: head/sys/netinet/libalias/alias_cuseeme.c head/sys/netinet/libalias/alias_dummy.c head/sys/netinet/libalias/alias_irc.c head/sys/netinet/libalias/alias_nbt.c head/sys/netinet/libalias/alias_pptp.c head/sys/netinet/libalias/alias_skinny.c head/sys/netinet/libalias/alias_smedia.c Modified: head/sys/netinet/libalias/alias_cuseeme.c ============================================================================== --- head/sys/netinet/libalias/alias_cuseeme.c Wed Dec 25 01:58:19 2013 (r259857) +++ head/sys/netinet/libalias/alias_cuseeme.c Wed Dec 25 02:06:57 2013 (r259858) @@ -56,14 +56,14 @@ __FBSDID("$FreeBSD$"); #define CUSEEME_PORT_NUMBER 7648 static void -AliasHandleCUSeeMeOut(struct libalias *la, struct ip *pip, +AliasHandleCUSeeMeOut(struct libalias *la, struct ip *pip, struct alias_link *lnk); static void -AliasHandleCUSeeMeIn(struct libalias *la, struct ip *pip, +AliasHandleCUSeeMeIn(struct libalias *la, struct ip *pip, struct in_addr original_addr); -static int +static int fingerprint(struct libalias *la, struct alias_data *ah) { @@ -74,7 +74,7 @@ fingerprint(struct libalias *la, struct return (-1); } -static int +static int protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -82,7 +82,7 @@ protohandlerin(struct libalias *la, stru return (0); } -static int +static int protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -92,20 +92,20 @@ protohandlerout(struct libalias *la, str /* Kernel module definition. */ struct proto_handler handlers[] = { - { - .pri = 120, - .dir = OUT, - .proto = UDP, - .fingerprint = &fingerprint, + { + .pri = 120, + .dir = OUT, + .proto = UDP, + .fingerprint = &fingerprint, .protohandler = &protohandlerout - }, + }, { - .pri = 120, - .dir = IN, - .proto = UDP, - .fingerprint = &fingerprint, + .pri = 120, + .dir = IN, + .proto = UDP, + .fingerprint = &fingerprint, .protohandler = &protohandlerin - }, + }, { EOH } }; @@ -130,9 +130,9 @@ mod_handler(module_t mod, int type, void } #ifdef _KERNEL -static +static #endif -moduledata_t +moduledata_t alias_mod = { "alias_cuseeme", mod_handler, NULL }; Modified: head/sys/netinet/libalias/alias_dummy.c ============================================================================== --- head/sys/netinet/libalias/alias_dummy.c Wed Dec 25 01:58:19 2013 (r259857) +++ head/sys/netinet/libalias/alias_dummy.c Wed Dec 25 02:06:57 2013 (r259858) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -/* +/* * Alias_dummy is just an empty skeleton used to demostrate how to write * a module for libalias, that will run unalterated in userland or in * kernel land. @@ -59,19 +59,19 @@ __FBSDID("$FreeBSD$"); static void AliasHandleDummy(struct libalias *la, struct ip *ip, struct alias_data *ah); -static int +static int fingerprint(struct libalias *la, struct alias_data *ah) { - /* - * Check here all the data that will be used later, if any field + /* + * Check here all the data that will be used later, if any field * is empy/NULL, return a -1 value. */ - if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->maxpktsize == 0) return (-1); - /* - * Fingerprint the incoming packet, if it matches any conditions + /* + * Fingerprint the incoming packet, if it matches any conditions * return an OK value. */ if (ntohs(*ah->dport) == 123 @@ -80,12 +80,12 @@ fingerprint(struct libalias *la, struct return (-1); /* I don't recognize this packet. */ } -/* - * Wrap in this general purpose function, the real function used to alias the +/* + * Wrap in this general purpose function, the real function used to alias the * packets. */ -static int +static int protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -93,22 +93,22 @@ protohandler(struct libalias *la, struct return (0); } -/* - * NOTA BENE: the next variable MUST NOT be renamed in any case if you want - * your module to work in userland, cause it's used to find and use all +/* + * NOTA BENE: the next variable MUST NOT be renamed in any case if you want + * your module to work in userland, cause it's used to find and use all * the protocol handlers present in every module. - * So WATCH OUT, your module needs this variables and it needs it with + * So WATCH OUT, your module needs this variables and it needs it with * ITS EXACT NAME: handlers. */ struct proto_handler handlers [] = { - { - .pri = 666, - .dir = IN|OUT, - .proto = UDP|TCP, - .fingerprint = &fingerprint, + { + .pri = 666, + .dir = IN|OUT, + .proto = UDP|TCP, + .fingerprint = &fingerprint, .protohandler = &protohandler - }, + }, { EOH } }; @@ -117,7 +117,7 @@ mod_handler(module_t mod, int type, void { int error; - switch (type) { + switch (type) { case MOD_LOAD: error = 0; LibAliasAttachHandlers(handlers); Modified: head/sys/netinet/libalias/alias_irc.c ============================================================================== --- head/sys/netinet/libalias/alias_irc.c Wed Dec 25 01:58:19 2013 (r259857) +++ head/sys/netinet/libalias/alias_irc.c Wed Dec 25 02:06:57 2013 (r259858) @@ -92,11 +92,11 @@ static void AliasHandleIrcOut(struct libalias *, struct ip *, struct alias_link *, int maxpacketsize); -static int +static int fingerprint(struct libalias *la, struct alias_data *ah) { - if (ah->dport == NULL || ah->dport == NULL || ah->lnk == NULL || + if (ah->dport == NULL || ah->dport == NULL || ah->lnk == NULL || ah->maxpktsize == 0) return (-1); if (ntohs(*ah->dport) == IRC_CONTROL_PORT_NUMBER_1 @@ -105,7 +105,7 @@ fingerprint(struct libalias *la, struct return (-1); } -static int +static int protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -118,13 +118,13 @@ protohandler(struct libalias *la, struct } struct proto_handler handlers[] = { - { - .pri = 90, - .dir = OUT, - .proto = TCP, - .fingerprint = &fingerprint, + { + .pri = 90, + .dir = OUT, + .proto = TCP, + .fingerprint = &fingerprint, .protohandler = &protohandler - }, + }, { EOH } }; @@ -149,7 +149,7 @@ mod_handler(module_t mod, int type, void } #ifdef _KERNEL -static +static #endif moduledata_t alias_mod = { "alias_irc", mod_handler, NULL Modified: head/sys/netinet/libalias/alias_nbt.c ============================================================================== --- head/sys/netinet/libalias/alias_nbt.c Wed Dec 25 01:58:19 2013 (r259857) +++ head/sys/netinet/libalias/alias_nbt.c Wed Dec 25 02:06:57 2013 (r259858) @@ -70,17 +70,17 @@ __FBSDID("$FreeBSD$"); #define NETBIOS_DGM_PORT_NUMBER 138 static int -AliasHandleUdpNbt(struct libalias *, struct ip *, struct alias_link *, +AliasHandleUdpNbt(struct libalias *, struct ip *, struct alias_link *, struct in_addr *, u_short); static int AliasHandleUdpNbtNS(struct libalias *, struct ip *, struct alias_link *, struct in_addr *, u_short *, struct in_addr *, u_short *); -static int +static int fingerprint1(struct libalias *la, struct alias_data *ah) { - if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->aaddr == NULL || ah->aport == NULL) return (-1); if (ntohs(*ah->dport) == NETBIOS_DGM_PORT_NUMBER @@ -89,18 +89,18 @@ fingerprint1(struct libalias *la, struct return (-1); } -static int +static int protohandler1(struct libalias *la, struct ip *pip, struct alias_data *ah) { return (AliasHandleUdpNbt(la, pip, ah->lnk, ah->aaddr, *ah->aport)); } -static int +static int fingerprint2(struct libalias *la, struct alias_data *ah) { - if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->aaddr == NULL || ah->aport == NULL) return (-1); if (ntohs(*ah->dport) == NETBIOS_NS_PORT_NUMBER @@ -109,7 +109,7 @@ fingerprint2(struct libalias *la, struct return (-1); } -static int +static int protohandler2in(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -118,7 +118,7 @@ protohandler2in(struct libalias *la, str return (0); } -static int +static int protohandler2out(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -128,27 +128,27 @@ protohandler2out(struct libalias *la, st /* Kernel module definition. */ struct proto_handler handlers[] = { - { - .pri = 130, - .dir = IN|OUT, - .proto = UDP, - .fingerprint = &fingerprint1, + { + .pri = 130, + .dir = IN|OUT, + .proto = UDP, + .fingerprint = &fingerprint1, .protohandler = &protohandler1 - }, - { - .pri = 140, - .dir = IN, - .proto = UDP, - .fingerprint = &fingerprint2, + }, + { + .pri = 140, + .dir = IN, + .proto = UDP, + .fingerprint = &fingerprint2, .protohandler = &protohandler2in - }, - { - .pri = 140, - .dir = OUT, - .proto = UDP, - .fingerprint = &fingerprint2, + }, + { + .pri = 140, + .dir = OUT, + .proto = UDP, + .fingerprint = &fingerprint2, .protohandler = &protohandler2out - }, + }, { EOH } }; @@ -173,7 +173,7 @@ mod_handler(module_t mod, int type, void } #ifdef _KERNEL -static +static #endif moduledata_t alias_mod = { "alias_nbt", mod_handler, NULL Modified: head/sys/netinet/libalias/alias_pptp.c ============================================================================== --- head/sys/netinet/libalias/alias_pptp.c Wed Dec 25 01:58:19 2013 (r259857) +++ head/sys/netinet/libalias/alias_pptp.c Wed Dec 25 02:06:57 2013 (r259858) @@ -78,7 +78,7 @@ AliasHandlePptpGreOut(struct libalias *, static int AliasHandlePptpGreIn(struct libalias *, struct ip *); -static int +static int fingerprint(struct libalias *la, struct alias_data *ah) { @@ -90,14 +90,14 @@ fingerprint(struct libalias *la, struct return (-1); } -static int +static int fingerprintgre(struct libalias *la, struct alias_data *ah) { return (0); } -static int +static int protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -105,7 +105,7 @@ protohandlerin(struct libalias *la, stru return (0); } -static int +static int protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -113,7 +113,7 @@ protohandlerout(struct libalias *la, str return (0); } -static int +static int protohandlergrein(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -123,7 +123,7 @@ protohandlergrein(struct libalias *la, s return (-1); } -static int +static int protohandlergreout(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -134,39 +134,39 @@ protohandlergreout(struct libalias *la, /* Kernel module definition. */ struct proto_handler handlers[] = { - { - .pri = 200, - .dir = IN, - .proto = TCP, - .fingerprint = &fingerprint, + { + .pri = 200, + .dir = IN, + .proto = TCP, + .fingerprint = &fingerprint, .protohandler = &protohandlerin }, - { - .pri = 210, - .dir = OUT, - .proto = TCP, - .fingerprint = &fingerprint, + { + .pri = 210, + .dir = OUT, + .proto = TCP, + .fingerprint = &fingerprint, .protohandler = &protohandlerout }, -/* - * WATCH OUT!!! these 2 handlers NEED a priority of INT_MAX (highest possible) +/* + * WATCH OUT!!! these 2 handlers NEED a priority of INT_MAX (highest possible) * cause they will ALWAYS process packets, so they must be the last one * in chain: look fingerprintgre() above. */ - { - .pri = INT_MAX, - .dir = IN, - .proto = IP, - .fingerprint = &fingerprintgre, + { + .pri = INT_MAX, + .dir = IN, + .proto = IP, + .fingerprint = &fingerprintgre, .protohandler = &protohandlergrein }, - { - .pri = INT_MAX, - .dir = OUT, - .proto = IP, - .fingerprint = &fingerprintgre, + { + .pri = INT_MAX, + .dir = OUT, + .proto = IP, + .fingerprint = &fingerprintgre, .protohandler = &protohandlergreout - }, + }, { EOH } }; static int @@ -190,7 +190,7 @@ mod_handler(module_t mod, int type, void } #ifdef _KERNEL -static +static #endif moduledata_t alias_mod = { "alias_pptp", mod_handler, NULL Modified: head/sys/netinet/libalias/alias_skinny.c ============================================================================== --- head/sys/netinet/libalias/alias_skinny.c Wed Dec 25 01:58:19 2013 (r259857) +++ head/sys/netinet/libalias/alias_skinny.c Wed Dec 25 02:06:57 2013 (r259858) @@ -56,7 +56,7 @@ static void AliasHandleSkinny(struct libalias *, struct ip *, struct alias_link *); -static int +static int fingerprint(struct libalias *la, struct alias_data *ah) { @@ -68,7 +68,7 @@ fingerprint(struct libalias *la, struct return (-1); } -static int +static int protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -77,13 +77,13 @@ protohandler(struct libalias *la, struct } struct proto_handler handlers[] = { - { - .pri = 110, - .dir = IN|OUT, - .proto = TCP, - .fingerprint = &fingerprint, + { + .pri = 110, + .dir = IN|OUT, + .proto = TCP, + .fingerprint = &fingerprint, .protohandler = &protohandler - }, + }, { EOH } }; @@ -108,7 +108,7 @@ mod_handler(module_t mod, int type, void } #ifdef _KERNEL -static +static #endif moduledata_t alias_mod = { "alias_skinny", mod_handler, NULL Modified: head/sys/netinet/libalias/alias_smedia.c ============================================================================== --- head/sys/netinet/libalias/alias_smedia.c Wed Dec 25 01:58:19 2013 (r259857) +++ head/sys/netinet/libalias/alias_smedia.c Wed Dec 25 02:06:57 2013 (r259858) @@ -131,14 +131,14 @@ __FBSDID("$FreeBSD$"); static void AliasHandleRtspOut(struct libalias *, struct ip *, struct alias_link *, int maxpacketsize); -static int +static int fingerprint(struct libalias *la, struct alias_data *ah) { if (ah->dport != NULL && ah->aport != NULL && ah->sport != NULL && ntohs(*ah->dport) == TFTP_PORT_NUMBER) return (0); - if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->maxpktsize == 0) return (-1); if (ntohs(*ah->dport) == RTSP_CONTROL_PORT_NUMBER_1 @@ -149,7 +149,7 @@ fingerprint(struct libalias *la, struct return (-1); } -static int +static int protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -161,13 +161,13 @@ protohandler(struct libalias *la, struct } struct proto_handler handlers[] = { - { - .pri = 100, - .dir = OUT, + { + .pri = 100, + .dir = OUT, .proto = TCP|UDP, - .fingerprint = &fingerprint, + .fingerprint = &fingerprint, .protohandler = &protohandler - }, + }, { EOH } }; @@ -192,7 +192,7 @@ mod_handler(module_t mod, int type, void } #ifdef _KERNEL -static +static #endif moduledata_t alias_mod = { "alias_smedia", mod_handler, NULL @@ -406,7 +406,7 @@ alias_rtsp_out(struct libalias *la, stru SetAckModified(lnk); tc = (struct tcphdr *)ip_next(pip); delta = GetDeltaSeqOut(tc->th_seq, lnk); - AddSeq(lnk, delta + new_dlen - dlen, pip->ip_hl, pip->ip_len, + AddSeq(lnk, delta + new_dlen - dlen, pip->ip_hl, pip->ip_len, tc->th_seq, tc->th_off); new_len = htons(hlen + new_dlen); From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 03:24:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C41297B6; Wed, 25 Dec 2013 03:24:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF2371AB8; Wed, 25 Dec 2013 03:24:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBP3OL3S015387; Wed, 25 Dec 2013 03:24:21 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBP3OKqV015383; Wed, 25 Dec 2013 03:24:20 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312250324.rBP3OKqV015383@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 25 Dec 2013 03:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259859 - head/sys/netinet/libalias X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 03:24:21 -0000 Author: glebius Date: Wed Dec 25 03:24:20 2013 New Revision: 259859 URL: http://svnweb.freebsd.org/changeset/base/259859 Log: Cleanup alias module handler register/unregister. - Remove locking, since all module(9) events are running under &Giant. - Use TAILQ for protocol handlers and fix a bug which led to infinite cycle. Bug found in VirtualBox [1] - Simplify code everywhere. - Fix documentation. [1] https://www.virtualbox.org/pipermail/vbox-dev/2013-November/011936.html PR: 183792 [1] Submitted by: Valery Ushakov [1] Sponsored by: Nginx, Inc. Modified: head/sys/netinet/libalias/alias_db.c head/sys/netinet/libalias/alias_mod.c head/sys/netinet/libalias/alias_mod.h head/sys/netinet/libalias/libalias.3 Modified: head/sys/netinet/libalias/alias_db.c ============================================================================== --- head/sys/netinet/libalias/alias_db.c Wed Dec 25 02:06:57 2013 (r259858) +++ head/sys/netinet/libalias/alias_db.c Wed Dec 25 03:24:20 2013 (r259859) @@ -349,24 +349,16 @@ MODULE_VERSION(libalias, 1); static int alias_mod_handler(module_t mod, int type, void *data) { - int error; switch (type) { - case MOD_LOAD: - error = 0; - handler_chain_init(); - break; case MOD_QUIESCE: case MOD_UNLOAD: - handler_chain_destroy(); finishoff(); - error = 0; - break; + case MOD_LOAD: + return (0); default: - error = EINVAL; + return (EINVAL); } - - return (error); } static moduledata_t alias_mod = { Modified: head/sys/netinet/libalias/alias_mod.c ============================================================================== --- head/sys/netinet/libalias/alias_mod.c Wed Dec 25 02:06:57 2013 (r259858) +++ head/sys/netinet/libalias/alias_mod.c Wed Dec 25 03:24:20 2013 (r259859) @@ -52,201 +52,82 @@ __FBSDID("$FreeBSD$"); #endif /* Protocol and userland module handlers chains. */ -LIST_HEAD(handler_chain, proto_handler) handler_chain = LIST_HEAD_INITIALIZER(handler_chain); -#ifdef _KERNEL -struct rwlock handler_rw; -#endif -SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(dll_chain); - -#ifdef _KERNEL - -#define LIBALIAS_RWLOCK_INIT() \ - rw_init(&handler_rw, "Libalias_modules_rwlock") -#define LIBALIAS_RWLOCK_DESTROY() rw_destroy(&handler_rw) -#define LIBALIAS_WLOCK_ASSERT() \ - rw_assert(&handler_rw, RA_WLOCKED) - -static __inline void -LIBALIAS_RLOCK(void) -{ - rw_rlock(&handler_rw); -} - -static __inline void -LIBALIAS_RUNLOCK(void) -{ - rw_runlock(&handler_rw); -} - -static __inline void -LIBALIAS_WLOCK(void) -{ - rw_wlock(&handler_rw); -} - -static __inline void -LIBALIAS_WUNLOCK(void) -{ - rw_wunlock(&handler_rw); -} - -static void -_handler_chain_init(void) -{ - - if (!rw_initialized(&handler_rw)) - LIBALIAS_RWLOCK_INIT(); -} - -static void -_handler_chain_destroy(void) -{ - - if (rw_initialized(&handler_rw)) - LIBALIAS_RWLOCK_DESTROY(); -} - -#else -#define LIBALIAS_RWLOCK_INIT() ; -#define LIBALIAS_RWLOCK_DESTROY() ; -#define LIBALIAS_WLOCK_ASSERT() ; -#define LIBALIAS_RLOCK() ; -#define LIBALIAS_RUNLOCK() ; -#define LIBALIAS_WLOCK() ; -#define LIBALIAS_WUNLOCK() ; -#define _handler_chain_init() ; -#define _handler_chain_destroy() ; -#endif - -void -handler_chain_init(void) -{ - _handler_chain_init(); -} - -void -handler_chain_destroy(void) -{ - _handler_chain_destroy(); -} +static TAILQ_HEAD(handler_chain, proto_handler) handler_chain = + TAILQ_HEAD_INITIALIZER(handler_chain); static int -_attach_handler(struct proto_handler *p) +attach_handler(struct proto_handler *p) { struct proto_handler *b; - LIBALIAS_WLOCK_ASSERT(); - b = NULL; - LIST_FOREACH(b, &handler_chain, entries) { + TAILQ_FOREACH(b, &handler_chain, link) { if ((b->pri == p->pri) && (b->dir == p->dir) && (b->proto == p->proto)) - return (EEXIST); /* Priority conflict. */ + return (EEXIST); if (b->pri > p->pri) { - LIST_INSERT_BEFORE(b, p, entries); + TAILQ_INSERT_BEFORE(b, p, link); return (0); } } - /* End of list or found right position, inserts here. */ - if (b) - LIST_INSERT_AFTER(b, p, entries); - else - LIST_INSERT_HEAD(&handler_chain, p, entries); - return (0); -} -static int -_detach_handler(struct proto_handler *p) -{ - struct proto_handler *b, *b_tmp; + TAILQ_INSERT_TAIL(&handler_chain, p, link); - LIBALIAS_WLOCK_ASSERT(); - LIST_FOREACH_SAFE(b, &handler_chain, entries, b_tmp) { - if (b == p) { - LIST_REMOVE(b, entries); - return (0); - } - } - return (ENOENT); /* Handler not found. */ + return (0); } int -LibAliasAttachHandlers(struct proto_handler *_p) +LibAliasAttachHandlers(struct proto_handler *p) { - int i, error; + int error; - LIBALIAS_WLOCK(); - error = -1; - for (i = 0; 1; i++) { - if (*((int *)&_p[i]) == EOH) - break; - error = _attach_handler(&_p[i]); - if (error != 0) - break; + while (p->dir != NODIR) { + error = attach_handler(p); + if (error) + return (error); + p++; } - LIBALIAS_WUNLOCK(); - return (error); + + return (0); } +/* XXXGL: should be void, but no good reason to break ABI */ int -LibAliasDetachHandlers(struct proto_handler *_p) +LibAliasDetachHandlers(struct proto_handler *p) { - int i, error; - LIBALIAS_WLOCK(); - error = -1; - for (i = 0; 1; i++) { - if (*((int *)&_p[i]) == EOH) - break; - error = _detach_handler(&_p[i]); - if (error != 0) - break; + while (p->dir != NODIR) { + TAILQ_REMOVE(&handler_chain, p, link); + p++; } - LIBALIAS_WUNLOCK(); - return (error); -} - -int -detach_handler(struct proto_handler *_p) -{ - int error; - LIBALIAS_WLOCK(); - error = -1; - error = _detach_handler(_p); - LIBALIAS_WUNLOCK(); - return (error); + return (0); } int -find_handler(int8_t dir, int8_t proto, struct libalias *la, __unused struct ip *pip, +find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *ip, struct alias_data *ad) { struct proto_handler *p; - int error; - LIBALIAS_RLOCK(); - error = ENOENT; - LIST_FOREACH(p, &handler_chain, entries) { - if ((p->dir & dir) && (p->proto & proto)) - if (p->fingerprint(la, ad) == 0) { - error = p->protohandler(la, pip, ad); - break; - } - } - LIBALIAS_RUNLOCK(); - return (error); + TAILQ_FOREACH(p, &handler_chain, link) + if ((p->dir & dir) && (p->proto & proto) && + p->fingerprint(la, ad) == 0) + return (p->protohandler(la, ip, ad)); + + return (ENOENT); } struct proto_handler * first_handler(void) { - return (LIST_FIRST(&handler_chain)); + return (TAILQ_FIRST(&handler_chain)); } #ifndef _KERNEL /* Dll manipulation code - this code is not thread safe... */ +SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(dll_chain); int attach_dll(struct dll *p) { Modified: head/sys/netinet/libalias/alias_mod.h ============================================================================== --- head/sys/netinet/libalias/alias_mod.h Wed Dec 25 02:06:57 2013 (r259858) +++ head/sys/netinet/libalias/alias_mod.h Wed Dec 25 03:24:20 2013 (r259859) @@ -45,14 +45,15 @@ MALLOC_DECLARE(M_ALIAS); #endif #endif -/* Packet flow direction. */ -#define IN 1 -#define OUT 2 - -/* Working protocol. */ -#define IP 1 -#define TCP 2 -#define UDP 4 +/* Packet flow direction flags. */ +#define IN 0x0001 +#define OUT 0x0002 +#define NODIR 0x4000 + +/* Working protocol flags. */ +#define IP 0x01 +#define TCP 0x02 +#define UDP 0x04 /* * Data passed to protocol handler module, it must be filled @@ -81,18 +82,15 @@ struct proto_handler { /* Aliasing * function. */ int (*protohandler)(struct libalias *, struct ip *, struct alias_data *); - LIST_ENTRY(proto_handler) entries; -} -; + TAILQ_ENTRY(proto_handler) link; +}; + /* End of handlers. */ -#define EOH -1 +#define EOH .dir = NODIR /* Functions used with protocol handlers. */ -void handler_chain_init(void); -void handler_chain_destroy(void); int LibAliasAttachHandlers(struct proto_handler *); int LibAliasDetachHandlers(struct proto_handler *); -int detach_handler(struct proto_handler *); int find_handler(int8_t, int8_t, struct libalias *, struct ip *, struct alias_data *); struct proto_handler *first_handler(void); Modified: head/sys/netinet/libalias/libalias.3 ============================================================================== --- head/sys/netinet/libalias/libalias.3 Wed Dec 25 02:06:57 2013 (r259858) +++ head/sys/netinet/libalias/libalias.3 Wed Dec 25 03:24:20 2013 (r259859) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2011 +.Dd December 25, 2013 .Dt LIBALIAS 3 .Os .Sh NAME @@ -1103,7 +1103,7 @@ struct proto_handler { struct ip *pip, struct alias_data *ah); int (*protohandler)(struct libalias *la, struct ip *pip, struct alias_data *ah); - LIST_ENTRY(proto_handler) entries; + TAILQ_ENTRY(proto_handler) link; }; .Ed .Pp @@ -1262,8 +1262,16 @@ Here we analyse some parts of that modul From .Pa alias_dummy.c : .Bd -literal -struct proto_handler handlers [] = {{666, IN|OUT, UDP|TCP, - &fingerprint, &protohandler}}; +struct proto_handler handlers[] = { + { + .pri = 666, + .dir = IN|OUT, + .proto = UDP|TCP, + .fingerprint = fingerprint, + .protohandler= protohandler, + }, + { EOH } +}; .Ed .Pp The variable @@ -1299,12 +1307,10 @@ mod_handler(module_t mod, int type, void switch (type) { case MOD_LOAD: - error = 0; - attach_handlers(handlers); + error = LibAliasAttachHandlers(handlers); break; case MOD_UNLOAD: - error = 0; - detach_handlers(handlers; + error = LibAliasDetachHandlers(handlers); break; default: error = EINVAL; @@ -1315,9 +1321,9 @@ mod_handler(module_t mod, int type, void When running as KLD, .Fn mod_handler registers/deregisters the module using -.Fn attach_handlers +.Fn LibAliasAttachHandlers and -.Fn detach_handlers , +.Fn LibAliasDetachHandlers , respectively. .Pp Every module must contain at least 2 functions: one fingerprint From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 04:51:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5183112E; Wed, 25 Dec 2013 04:51:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24FAA10AE; Wed, 25 Dec 2013 04:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBP4pu1C047211; Wed, 25 Dec 2013 04:51:56 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBP4pu4S047209; Wed, 25 Dec 2013 04:51:56 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201312250451.rBP4pu4S047209@svn.freebsd.org> From: Matt Jacob Date: Wed, 25 Dec 2013 04:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259860 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 04:51:57 -0000 Author: mjacob Date: Wed Dec 25 04:51:56 2013 New Revision: 259860 URL: http://svnweb.freebsd.org/changeset/base/259860 Log: Harvest one no longer used constant string. Remove another and place it into play in the normally ifdef protected zone it would be used int. Noticed by: dim Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Wed Dec 25 03:24:20 2013 (r259859) +++ head/sys/dev/isp/isp.c Wed Dec 25 04:51:56 2013 (r259860) @@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$"); static const char fconf[] = "Chan %d PortDB[%d] changed:\n current =(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)\n database=(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)"; static const char notresp[] = "Not RESPONSE in RESPONSE Queue (type 0x%x) @ idx %d (next %d) nlooked %d"; static const char topology[] = "Chan %d WWPN 0x%08x%08x PortID 0x%06x N-Port Handle %d, Connection '%s'"; -static const char sc4[] = "NVRAM"; static const char bun[] = "bad underrun (count %d, resid %d, status %s)"; static const char lipd[] = "Chan %d LIP destroyed %d active commands"; static const char sacq[] = "unable to acquire scratch area"; Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Wed Dec 25 03:24:20 2013 (r259859) +++ head/sys/dev/isp/isp_freebsd.c Wed Dec 25 04:51:56 2013 (r259860) @@ -56,7 +56,6 @@ int isp_quickboot_time = 7; /* don't wai int isp_gone_device_time = 30; /* grace time before reporting device lost */ int isp_autoconfig = 1; /* automatically attach/detach devices */ static const char prom3[] = "Chan %d PortID 0x%06x Departed from Target %u because of %s"; -static const char rqo[] = "%s: Request Queue Overflow\n"; static void isp_freeze_loopdown(ispsoftc_t *, int, char *); static d_ioctl_t ispioctl; @@ -2152,7 +2151,8 @@ isp_target_putback_atio(union ccb *ccb) qe = isp_getrqentry(isp); if (qe == NULL) { - xpt_print(ccb->ccb_h.path, rqo, __func__); + xpt_print(ccb->ccb_h.path, + "%s: Request Queue Overflow\n", __func__); (void) timeout(isp_refire_putback_atio, ccb, 10); return; } From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 06:46:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92427F3B; Wed, 25 Dec 2013 06:46:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7C5131714; Wed, 25 Dec 2013 06:46:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBP6kXAD087995; Wed, 25 Dec 2013 06:46:33 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBP6kVDp087983; Wed, 25 Dec 2013 06:46:31 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312250646.rBP6kVDp087983@svn.freebsd.org> From: Neel Natu Date: Wed, 25 Dec 2013 06:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259863 - in head/sys/amd64: include vmm vmm/amd vmm/intel vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 06:46:33 -0000 Author: neel Date: Wed Dec 25 06:46:31 2013 New Revision: 259863 URL: http://svnweb.freebsd.org/changeset/base/259863 Log: vlapic code restructuring to make it easy to support hardware-assist for APIC emulation. The vlapic initialization and cleanup is done via processor specific vmm_ops. This will allow the VT-x/SVM modules to layer any hardware-assist for APIC emulation or virtual interrupt delivery on top of the vlapic device model. Add a parameter to 'vcpu_notify_event()' to distinguish between vlapic interrupts versus other events (e.g. NMI). This provides an opportunity to use hardware-assists like Posted Interrupts (VT-x) or doorbell MSR (SVM) to deliver an interrupt to a guest without causing a VM-exit. Get rid of lapic_pending_intr() and lapic_intr_accepted() and use the vlapic_xxx() counterparts directly. Associate an 'Apic Page' with each vcpu and reference it from the 'vlapic'. The 'Apic Page' is intended to be referenced from the Intel VMCS as the 'virtual APIC page' or from the AMD VMCB as the 'vAPIC backing page'. Added: head/sys/amd64/vmm/io/vlapic_priv.h (contents, props changed) Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/amd/amdv.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx.h head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_lapic.c head/sys/amd64/vmm/vmm_lapic.h Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed Dec 25 06:09:31 2013 (r259862) +++ head/sys/amd64/include/vmm.h Wed Dec 25 06:46:31 2013 (r259863) @@ -69,6 +69,8 @@ typedef int (*vmi_get_cap_t)(void *vmi, typedef int (*vmi_set_cap_t)(void *vmi, int vcpu, int num, int val); typedef struct vmspace * (*vmi_vmspace_alloc)(vm_offset_t min, vm_offset_t max); typedef void (*vmi_vmspace_free)(struct vmspace *vmspace); +typedef struct vlapic * (*vmi_vlapic_init)(void *vmi, int vcpu); +typedef void (*vmi_vlapic_cleanup)(void *vmi, struct vlapic *vlapic); struct vmm_ops { vmm_init_func_t init; /* module wide initialization */ @@ -87,6 +89,8 @@ struct vmm_ops { vmi_set_cap_t vmsetcap; vmi_vmspace_alloc vmspace_alloc; vmi_vmspace_free vmspace_free; + vmi_vlapic_init vlapic_init; + vmi_vlapic_cleanup vlapic_cleanup; }; extern struct vmm_ops vmm_ops_intel; @@ -159,7 +163,7 @@ vcpu_is_running(struct vm *vm, int vcpu, } void *vcpu_stats(struct vm *vm, int vcpu); -void vcpu_notify_event(struct vm *vm, int vcpuid); +void vcpu_notify_event(struct vm *vm, int vcpuid, bool lapic_intr); struct vmspace *vm_get_vmspace(struct vm *vm); int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func); int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); Modified: head/sys/amd64/vmm/amd/amdv.c ============================================================================== --- head/sys/amd64/vmm/amd/amdv.c Wed Dec 25 06:09:31 2013 (r259862) +++ head/sys/amd64/vmm/amd/amdv.c Wed Dec 25 06:46:31 2013 (r259863) @@ -155,6 +155,20 @@ amdv_vmspace_free(struct vmspace *vmspac return; } +static struct vlapic * +amdv_vlapic_init(void *arg, int vcpuid) +{ + + panic("amdv_vlapic_init: not implmented"); +} + +static void +amdv_vlapic_cleanup(void *arg, struct vlapic *vlapic) +{ + + panic("amdv_vlapic_cleanup: not implemented"); +} + struct vmm_ops vmm_ops_amd = { amdv_init, amdv_cleanup, @@ -171,6 +185,8 @@ struct vmm_ops vmm_ops_amd = { amdv_setcap, amdv_vmspace_alloc, amdv_vmspace_free, + amdv_vlapic_init, + amdv_vlapic_cleanup, }; static int Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Dec 25 06:09:31 2013 (r259862) +++ head/sys/amd64/vmm/intel/vmx.c Wed Dec 25 06:46:31 2013 (r259863) @@ -50,10 +50,11 @@ __FBSDID("$FreeBSD$"); #include #include "vmm_host.h" -#include "vmm_lapic.h" #include "vmm_msr.h" #include "vmm_ktr.h" #include "vmm_stat.h" +#include "vlapic.h" +#include "vlapic_priv.h" #include "vmx_msr.h" #include "ept.h" @@ -112,7 +113,8 @@ __FBSDID("$FreeBSD$"); #define HANDLED 1 #define UNHANDLED 0 -MALLOC_DEFINE(M_VMX, "vmx", "vmx"); +static MALLOC_DEFINE(M_VMX, "vmx", "vmx"); +static MALLOC_DEFINE(M_VLAPIC, "vlapic", "vlapic"); SYSCTL_DECL(_hw_vmm); SYSCTL_NODE(_hw_vmm, OID_AUTO, vmx, CTLFLAG_RW, NULL, NULL); @@ -1033,7 +1035,7 @@ nmiblocked: } static void -vmx_inject_interrupts(struct vmx *vmx, int vcpu) +vmx_inject_interrupts(struct vmx *vmx, int vcpu, struct vlapic *vlapic) { int vector; uint64_t info, rflags, interruptibility; @@ -1059,7 +1061,7 @@ vmx_inject_interrupts(struct vmx *vmx, i return; /* Ask the local apic for a vector to inject */ - vector = lapic_pending_intr(vmx->vm, vcpu); + vector = vlapic_pending_intr(vlapic); if (vector < 0) return; @@ -1081,7 +1083,7 @@ vmx_inject_interrupts(struct vmx *vmx, i vmcs_write(VMCS_ENTRY_INTR_INFO, info); /* Update the Local APIC ISR */ - lapic_intr_accepted(vmx->vm, vcpu, vector); + vlapic_intr_accepted(vlapic, vector); VCPU_CTR1(vmx->vm, vcpu, "Injecting hwintr at vector %d", vector); @@ -1459,11 +1461,13 @@ vmx_run(void *arg, int vcpu, register_t struct vmxctx *vmxctx; struct vmcs *vmcs; struct vm_exit *vmexit; + struct vlapic *vlapic; vmx = arg; vmcs = &vmx->vmcs[vcpu]; vmxctx = &vmx->ctx[vcpu]; vmxctx->launched = 0; + vlapic = vm_lapic(vmx->vm, vcpu); astpending = 0; vmexit = vm_exitinfo(vmx->vm, vcpu); @@ -1491,7 +1495,7 @@ vmx_run(void *arg, int vcpu, register_t vmx_set_pcpu_defaults(vmx, vcpu); do { - vmx_inject_interrupts(vmx, vcpu); + vmx_inject_interrupts(vmx, vcpu, vlapic); vmx_run_trace(vmx, vcpu); rc = vmx_setjmp(vmxctx); #ifdef SETJMP_TRACE @@ -1963,6 +1967,32 @@ vmx_setcap(void *arg, int vcpu, int type return (retval); } +static struct vlapic * +vmx_vlapic_init(void *arg, int vcpuid) +{ + struct vmx *vmx; + struct vlapic *vlapic; + + vmx = arg; + + vlapic = malloc(sizeof(struct vlapic), M_VLAPIC, M_WAITOK | M_ZERO); + vlapic->vm = vmx->vm; + vlapic->vcpuid = vcpuid; + vlapic->apic_page = (struct LAPIC *)&vmx->apic_page[vcpuid]; + + vlapic_init(vlapic); + + return (vlapic); +} + +static void +vmx_vlapic_cleanup(void *arg, struct vlapic *vlapic) +{ + + vlapic_cleanup(vlapic); + free(vlapic, M_VLAPIC); +} + struct vmm_ops vmm_ops_intel = { vmx_init, vmx_cleanup, @@ -1979,4 +2009,6 @@ struct vmm_ops vmm_ops_intel = { vmx_setcap, ept_vmspace_alloc, ept_vmspace_free, + vmx_vlapic_init, + vmx_vlapic_cleanup, }; Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Wed Dec 25 06:09:31 2013 (r259862) +++ head/sys/amd64/vmm/intel/vmx.h Wed Dec 25 06:46:31 2013 (r259863) @@ -92,9 +92,15 @@ struct vmxstate { uint16_t vpid; }; +struct apic_page { + uint32_t reg[PAGE_SIZE / 4]; +}; +CTASSERT(sizeof(struct apic_page) == PAGE_SIZE); + /* virtual machine softc */ struct vmx { struct vmcs vmcs[VM_MAXCPU]; /* one vmcs per virtual cpu */ + struct apic_page apic_page[VM_MAXCPU]; /* one apic page per vcpu */ char msr_bitmap[PAGE_SIZE]; struct msr_entry guest_msrs[VM_MAXCPU][GUEST_MSR_MAX_ENTRIES]; struct vmxctx ctx[VM_MAXCPU]; Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Wed Dec 25 06:09:31 2013 (r259862) +++ head/sys/amd64/vmm/io/vlapic.c Wed Dec 25 06:46:31 2013 (r259863) @@ -37,16 +37,21 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include +#include +#include + #include -#include "vmm_stat.h" +#include "vmm_ipi.h" #include "vmm_lapic.h" #include "vmm_ktr.h" +#include "vmm_stat.h" + #include "vlapic.h" +#include "vlapic_priv.h" #include "vioapic.h" #define VLAPIC_CTR0(vlapic, format) \ @@ -60,7 +65,7 @@ __FBSDID("$FreeBSD$"); #define VLAPIC_CTR_IRR(vlapic, msg) \ do { \ - uint32_t *irrptr = &(vlapic)->apic.irr0; \ + uint32_t *irrptr = &(vlapic)->apic_page->irr0; \ irrptr[0] = irrptr[0]; /* silence compiler */ \ VLAPIC_CTR1((vlapic), msg " irr0 0x%08x", irrptr[0 << 2]); \ VLAPIC_CTR1((vlapic), msg " irr1 0x%08x", irrptr[1 << 2]); \ @@ -74,7 +79,7 @@ do { \ #define VLAPIC_CTR_ISR(vlapic, msg) \ do { \ - uint32_t *isrptr = &(vlapic)->apic.isr0; \ + uint32_t *isrptr = &(vlapic)->apic_page->isr0; \ isrptr[0] = isrptr[0]; /* silence compiler */ \ VLAPIC_CTR1((vlapic), msg " isr0 0x%08x", isrptr[0 << 2]); \ VLAPIC_CTR1((vlapic), msg " isr1 0x%08x", isrptr[1 << 2]); \ @@ -86,8 +91,6 @@ do { \ VLAPIC_CTR1((vlapic), msg " isr7 0x%08x", isrptr[7 << 2]); \ } while (0) -static MALLOC_DEFINE(M_VLAPIC, "vlapic", "vlapic"); - #define PRIO(x) ((x) >> 4) #define VLAPIC_VERSION (16) @@ -95,40 +98,6 @@ static MALLOC_DEFINE(M_VLAPIC, "vlapic", #define x2apic(vlapic) (((vlapic)->msr_apicbase & APICBASE_X2APIC) ? 1 : 0) -enum boot_state { - BS_INIT, - BS_SIPI, - BS_RUNNING -}; - -struct vlapic { - struct vm *vm; - int vcpuid; - - struct LAPIC apic; - - uint32_t esr_pending; - int esr_firing; - - struct callout callout; /* vlapic timer */ - struct bintime timer_fire_bt; /* callout expiry time */ - struct bintime timer_freq_bt; /* timer frequency */ - struct bintime timer_period_bt; /* timer period */ - struct mtx timer_mtx; - - /* - * The 'isrvec_stk' is a stack of vectors injected by the local apic. - * A vector is popped from the stack when the processor does an EOI. - * The vector on the top of the stack is used to compute the - * Processor Priority in conjunction with the TPR. - */ - uint8_t isrvec_stk[ISRVEC_STK_SIZE]; - int isrvec_stk_top; - - uint64_t msr_apicbase; - enum boot_state boot_state; -}; - /* * The 'vlapic->timer_mtx' is used to provide mutual exclusion between the * vlapic_callout_handler() and vcpu accesses to the following registers: @@ -163,7 +132,7 @@ vlapic_get_ldr(struct vlapic *vlapic) int apicid; uint32_t ldr; - lapic = &vlapic->apic; + lapic = vlapic->apic_page; if (x2apic(vlapic)) { apicid = vlapic_get_id(vlapic); ldr = 1 << (apicid & 0xf); @@ -178,7 +147,7 @@ vlapic_get_dfr(struct vlapic *vlapic) { struct LAPIC *lapic; - lapic = &vlapic->apic; + lapic = vlapic->apic_page; if (x2apic(vlapic)) return (0); else @@ -196,7 +165,7 @@ vlapic_set_dfr(struct vlapic *vlapic, ui return; } - lapic = &vlapic->apic; + lapic = vlapic->apic_page; dfr = (lapic->dfr & APIC_DFR_RESERVED) | (data & APIC_DFR_MODEL_MASK); if ((dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_FLAT) VLAPIC_CTR0(vlapic, "vlapic DFR in Flat Model"); @@ -219,7 +188,7 @@ vlapic_set_ldr(struct vlapic *vlapic, ui return; } - lapic = &vlapic->apic; + lapic = vlapic->apic_page; lapic->ldr = data & ~APIC_LDR_RESERVED; VLAPIC_CTR1(vlapic, "vlapic LDR set to %#x", lapic->ldr); } @@ -277,7 +246,7 @@ vlapic_get_ccr(struct vlapic *vlapic) uint32_t ccr; ccr = 0; - lapic = &vlapic->apic; + lapic = vlapic->apic_page; VLAPIC_TIMER_LOCK(vlapic); if (callout_active(&vlapic->callout)) { @@ -307,7 +276,7 @@ vlapic_set_dcr(struct vlapic *vlapic, ui struct LAPIC *lapic; int divisor; - lapic = &vlapic->apic; + lapic = vlapic->apic_page; VLAPIC_TIMER_LOCK(vlapic); lapic->dcr_timer = dcr; @@ -330,7 +299,9 @@ vlapic_set_dcr(struct vlapic *vlapic, ui static void vlapic_update_errors(struct vlapic *vlapic) { - struct LAPIC *lapic = &vlapic->apic; + struct LAPIC *lapic; + + lapic = vlapic->apic_page; lapic->esr = vlapic->esr_pending; vlapic->esr_pending = 0; } @@ -340,7 +311,7 @@ vlapic_reset(struct vlapic *vlapic) { struct LAPIC *lapic; - lapic = &vlapic->apic; + lapic = vlapic->apic_page; bzero(lapic, sizeof(struct LAPIC)); lapic->version = VLAPIC_VERSION; @@ -360,7 +331,7 @@ vlapic_reset(struct vlapic *vlapic) void vlapic_set_intr_ready(struct vlapic *vlapic, int vector, bool level) { - struct LAPIC *lapic = &vlapic->apic; + struct LAPIC *lapic = vlapic->apic_page; uint32_t *irrptr, *tmrptr, mask; int idx; @@ -401,7 +372,7 @@ vlapic_set_intr_ready(struct vlapic *vla static __inline uint32_t * vlapic_get_lvtptr(struct vlapic *vlapic, uint32_t offset) { - struct LAPIC *lapic = &vlapic->apic; + struct LAPIC *lapic = vlapic->apic_page; int i; switch (offset) { @@ -428,7 +399,7 @@ vlapic_set_lvt(struct vlapic *vlapic, ui uint32_t *lvtptr, mask; struct LAPIC *lapic; - lapic = &vlapic->apic; + lapic = vlapic->apic_page; lvtptr = vlapic_get_lvtptr(vlapic, offset); if (offset == APIC_OFFSET_TIMER_LVT) @@ -475,7 +446,7 @@ vlapic_fire_lvt(struct vlapic *vlapic, u return (0); } vlapic_set_intr_ready(vlapic, vec, false); - vcpu_notify_event(vlapic->vm, vlapic->vcpuid); + vcpu_notify_event(vlapic->vm, vlapic->vcpuid, true); break; case APIC_LVT_DM_NMI: vm_inject_nmi(vlapic->vm, vlapic->vcpuid); @@ -494,7 +465,7 @@ dump_isrvec_stk(struct vlapic *vlapic) int i; uint32_t *isrptr; - isrptr = &vlapic->apic.isr0; + isrptr = &vlapic->apic_page->isr0; for (i = 0; i < 8; i++) printf("ISR%d 0x%08x\n", i, isrptr[i * 4]); @@ -519,7 +490,7 @@ vlapic_update_ppr(struct vlapic *vlapic) * bits is set in the ISRx registers. */ isrvec = vlapic->isrvec_stk[vlapic->isrvec_stk_top]; - tpr = vlapic->apic.tpr; + tpr = vlapic->apic_page->tpr; #if 1 { @@ -548,7 +519,7 @@ vlapic_update_ppr(struct vlapic *vlapic) * corresponding entry on the isrvec stack. */ i = 1; - isrptr = &vlapic->apic.isr0; + isrptr = &vlapic->apic_page->isr0; for (vector = 0; vector < 256; vector++) { idx = (vector / 32) * 4; if (isrptr[idx] & (1 << (vector % 32))) { @@ -568,14 +539,14 @@ vlapic_update_ppr(struct vlapic *vlapic) else ppr = isrvec & 0xf0; - vlapic->apic.ppr = ppr; + vlapic->apic_page->ppr = ppr; VLAPIC_CTR1(vlapic, "vlapic_update_ppr 0x%02x", ppr); } static void vlapic_process_eoi(struct vlapic *vlapic) { - struct LAPIC *lapic = &vlapic->apic; + struct LAPIC *lapic = vlapic->apic_page; uint32_t *isrptr, *tmrptr; int i, idx, bitpos, vector; @@ -735,7 +706,7 @@ vlapic_callout_handler(void *arg) callout_deactivate(&vlapic->callout); - KASSERT(vlapic->apic.icr_timer != 0, ("vlapic timer is disabled")); + KASSERT(vlapic->apic_page->icr_timer != 0, ("timer is disabled")); vlapic_fire_timer(vlapic); @@ -789,7 +760,7 @@ vlapic_set_icr_timer(struct vlapic *vlap VLAPIC_TIMER_LOCK(vlapic); - lapic = &vlapic->apic; + lapic = vlapic->apic_page; lapic->icr_timer = icr_timer; vlapic->timer_period_bt = vlapic->timer_freq_bt; @@ -1021,7 +992,7 @@ lapic_process_icr(struct vlapic *vlapic, int vlapic_pending_intr(struct vlapic *vlapic) { - struct LAPIC *lapic = &vlapic->apic; + struct LAPIC *lapic = vlapic->apic_page; int idx, i, bitpos, vector; uint32_t *irrptr, val; @@ -1050,7 +1021,7 @@ vlapic_pending_intr(struct vlapic *vlapi void vlapic_intr_accepted(struct vlapic *vlapic, int vector) { - struct LAPIC *lapic = &vlapic->apic; + struct LAPIC *lapic = vlapic->apic_page; uint32_t *irrptr, *isrptr; int idx, stk_top; @@ -1087,7 +1058,7 @@ lapic_set_svr(struct vlapic *vlapic, uin struct LAPIC *lapic; uint32_t old, changed; - lapic = &vlapic->apic; + lapic = vlapic->apic_page; old = lapic->svr; changed = old ^ new; if ((changed & APIC_SVR_ENABLE) != 0) { @@ -1115,7 +1086,7 @@ lapic_set_svr(struct vlapic *vlapic, uin int vlapic_read(struct vlapic *vlapic, uint64_t offset, uint64_t *data, bool *retu) { - struct LAPIC *lapic = &vlapic->apic; + struct LAPIC *lapic = vlapic->apic_page; uint32_t *reg; int i; @@ -1182,13 +1153,13 @@ vlapic_read(struct vlapic *vlapic, uint6 case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: *data = vlapic_get_lvt(vlapic, offset); break; - case APIC_OFFSET_ICR: + case APIC_OFFSET_TIMER_ICR: *data = lapic->icr_timer; break; - case APIC_OFFSET_CCR: + case APIC_OFFSET_TIMER_CCR: *data = vlapic_get_ccr(vlapic); break; - case APIC_OFFSET_DCR: + case APIC_OFFSET_TIMER_DCR: *data = lapic->dcr_timer; break; case APIC_OFFSET_RRR: @@ -1204,7 +1175,7 @@ done: int vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data, bool *retu) { - struct LAPIC *lapic = &vlapic->apic; + struct LAPIC *lapic = vlapic->apic_page; int retval; VLAPIC_CTR2(vlapic, "vlapic write offset %#x, data %#lx", offset, data); @@ -1252,11 +1223,11 @@ vlapic_write(struct vlapic *vlapic, uint case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: vlapic_set_lvt(vlapic, offset, data); break; - case APIC_OFFSET_ICR: + case APIC_OFFSET_TIMER_ICR: vlapic_set_icr_timer(vlapic, data); break; - case APIC_OFFSET_DCR: + case APIC_OFFSET_TIMER_DCR: vlapic_set_dcr(vlapic, data); break; @@ -1270,7 +1241,7 @@ vlapic_write(struct vlapic *vlapic, uint case APIC_OFFSET_ISR0 ... APIC_OFFSET_ISR7: case APIC_OFFSET_TMR0 ... APIC_OFFSET_TMR7: case APIC_OFFSET_IRR0 ... APIC_OFFSET_IRR7: - case APIC_OFFSET_CCR: + case APIC_OFFSET_TIMER_CCR: default: // Read only. break; @@ -1279,14 +1250,14 @@ vlapic_write(struct vlapic *vlapic, uint return (retval); } -struct vlapic * -vlapic_init(struct vm *vm, int vcpuid) +void +vlapic_init(struct vlapic *vlapic) { - struct vlapic *vlapic; - - vlapic = malloc(sizeof(struct vlapic), M_VLAPIC, M_WAITOK | M_ZERO); - vlapic->vm = vm; - vlapic->vcpuid = vcpuid; + KASSERT(vlapic->vm != NULL, ("vlapic_init: vm is not initialized")); + KASSERT(vlapic->vcpuid >= 0 && vlapic->vcpuid < VM_MAXCPU, + ("vlapic_init: vcpuid is not initialized")); + KASSERT(vlapic->apic_page != NULL, ("vlapic_init: apic_page is not " + "initialized")); /* * If the vlapic is configured in x2apic mode then it will be @@ -1300,12 +1271,10 @@ vlapic_init(struct vm *vm, int vcpuid) vlapic->msr_apicbase = DEFAULT_APIC_BASE | APICBASE_ENABLED; - if (vcpuid == 0) + if (vlapic->vcpuid == 0) vlapic->msr_apicbase |= APICBASE_BSP; vlapic_reset(vlapic); - - return (vlapic); } void @@ -1313,7 +1282,6 @@ vlapic_cleanup(struct vlapic *vlapic) { callout_drain(&vlapic->callout); - free(vlapic, M_VLAPIC); } uint64_t @@ -1378,10 +1346,25 @@ vlapic_deliver_intr(struct vm *vm, bool } } +void +vlapic_post_intr(struct vlapic *vlapic, int hostcpu) +{ + /* + * Post an interrupt to the vcpu currently running on 'hostcpu'. + * + * This is done by leveraging features like Posted Interrupts (Intel) + * Doorbell MSR (AMD AVIC) that avoid a VM exit. + * + * If neither of these features are available then fallback to + * sending an IPI to 'hostcpu'. + */ + ipi_cpu(hostcpu, vmm_ipinum); +} + bool vlapic_enabled(struct vlapic *vlapic) { - struct LAPIC *lapic = &vlapic->apic; + struct LAPIC *lapic = vlapic->apic_page; if ((vlapic->msr_apicbase & APICBASE_ENABLED) != 0 && (lapic->svr & APIC_SVR_ENABLE) != 0) Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Wed Dec 25 06:09:31 2013 (r259862) +++ head/sys/amd64/vmm/io/vlapic.h Wed Dec 25 06:46:31 2013 (r259863) @@ -30,73 +30,33 @@ #define _VLAPIC_H_ struct vm; - -/* - * Map of APIC Registers: Offset Description Access - */ -#define APIC_OFFSET_ID 0x20 // Local APIC ID R/W -#define APIC_OFFSET_VER 0x30 // Local APIC Version R -#define APIC_OFFSET_TPR 0x80 // Task Priority Register R/W -#define APIC_OFFSET_APR 0x90 // Arbitration Priority Register R -#define APIC_OFFSET_PPR 0xA0 // Processor Priority Register R -#define APIC_OFFSET_EOI 0xB0 // EOI Register W -#define APIC_OFFSET_RRR 0xC0 // Remote read R -#define APIC_OFFSET_LDR 0xD0 // Logical Destination R/W -#define APIC_OFFSET_DFR 0xE0 // Destination Format Register 0..27 R; 28..31 R/W -#define APIC_OFFSET_SVR 0xF0 // Spurious Interrupt Vector Reg. 0..3 R; 4..9 R/W -#define APIC_OFFSET_ISR0 0x100 // ISR 000-031 R -#define APIC_OFFSET_ISR1 0x110 // ISR 032-063 R -#define APIC_OFFSET_ISR2 0x120 // ISR 064-095 R -#define APIC_OFFSET_ISR3 0x130 // ISR 095-128 R -#define APIC_OFFSET_ISR4 0x140 // ISR 128-159 R -#define APIC_OFFSET_ISR5 0x150 // ISR 160-191 R -#define APIC_OFFSET_ISR6 0x160 // ISR 192-223 R -#define APIC_OFFSET_ISR7 0x170 // ISR 224-255 R -#define APIC_OFFSET_TMR0 0x180 // TMR 000-031 R -#define APIC_OFFSET_TMR1 0x190 // TMR 032-063 R -#define APIC_OFFSET_TMR2 0x1A0 // TMR 064-095 R -#define APIC_OFFSET_TMR3 0x1B0 // TMR 095-128 R -#define APIC_OFFSET_TMR4 0x1C0 // TMR 128-159 R -#define APIC_OFFSET_TMR5 0x1D0 // TMR 160-191 R -#define APIC_OFFSET_TMR6 0x1E0 // TMR 192-223 R -#define APIC_OFFSET_TMR7 0x1F0 // TMR 224-255 R -#define APIC_OFFSET_IRR0 0x200 // IRR 000-031 R -#define APIC_OFFSET_IRR1 0x210 // IRR 032-063 R -#define APIC_OFFSET_IRR2 0x220 // IRR 064-095 R -#define APIC_OFFSET_IRR3 0x230 // IRR 095-128 R -#define APIC_OFFSET_IRR4 0x240 // IRR 128-159 R -#define APIC_OFFSET_IRR5 0x250 // IRR 160-191 R -#define APIC_OFFSET_IRR6 0x260 // IRR 192-223 R -#define APIC_OFFSET_IRR7 0x270 // IRR 224-255 R -#define APIC_OFFSET_ESR 0x280 // Error Status Register R -#define APIC_OFFSET_CMCI_LVT 0x2F0 // Local Vector Table (CMCI) R/W -#define APIC_OFFSET_ICR_LOW 0x300 // Interrupt Command Reg. (0-31) R/W -#define APIC_OFFSET_ICR_HI 0x310 // Interrupt Command Reg. (32-63) R/W -#define APIC_OFFSET_TIMER_LVT 0x320 // Local Vector Table (Timer) R/W -#define APIC_OFFSET_THERM_LVT 0x330 // Local Vector Table (Thermal) R/W (PIV+) -#define APIC_OFFSET_PERF_LVT 0x340 // Local Vector Table (Performance) R/W (P6+) -#define APIC_OFFSET_LINT0_LVT 0x350 // Local Vector Table (LINT0) R/W -#define APIC_OFFSET_LINT1_LVT 0x360 // Local Vector Table (LINT1) R/W -#define APIC_OFFSET_ERROR_LVT 0x370 // Local Vector Table (ERROR) R/W -#define APIC_OFFSET_ICR 0x380 // Initial Count Reg. for Timer R/W -#define APIC_OFFSET_CCR 0x390 // Current Count of Timer R -#define APIC_OFFSET_DCR 0x3E0 // Timer Divide Configuration Reg. R/W - -/* - * 16 priority levels with at most one vector injected per level. - */ -#define ISRVEC_STK_SIZE (16 + 1) - enum x2apic_state; -struct vlapic *vlapic_init(struct vm *vm, int vcpuid); -void vlapic_cleanup(struct vlapic *vlapic); int vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data, bool *retu); int vlapic_read(struct vlapic *vlapic, uint64_t offset, uint64_t *data, bool *retu); + +/* + * Returns a vector between 32 and 255 if an interrupt is pending in the + * IRR that can be delivered based on the current state of ISR and TPR. + * + * Note that the vector does not automatically transition to the ISR as a + * result of calling this function. + * + * Returns -1 if there is no eligible vector that can be delivered to the + * guest at this time. + */ int vlapic_pending_intr(struct vlapic *vlapic); + +/* + * Transition 'vector' from IRR to ISR. This function is called with the + * vector returned by 'vlapic_pending_intr()' when the guest is able to + * accept this interrupt (i.e. RFLAGS.IF = 1 and no conditions exist that + * block interrupt delivery). + */ void vlapic_intr_accepted(struct vlapic *vlapic, int vector); + void vlapic_set_intr_ready(struct vlapic *vlapic, int vector, bool level); void vlapic_set_error(struct vlapic *vlapic, uint32_t mask); void vlapic_fire_cmci(struct vlapic *vlapic); @@ -109,4 +69,5 @@ bool vlapic_enabled(struct vlapic *vlapi void vlapic_deliver_intr(struct vm *vm, bool level, uint32_t dest, bool phys, int delmode, int vec); +void vlapic_post_intr(struct vlapic *vlapic, int hostcpu); #endif /* _VLAPIC_H_ */ Added: head/sys/amd64/vmm/io/vlapic_priv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/vmm/io/vlapic_priv.h Wed Dec 25 06:46:31 2013 (r259863) @@ -0,0 +1,124 @@ +/*- + * Copyright (c) 2013 Neel Natu + * 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 NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VLAPIC_PRIV_H_ +#define _VLAPIC_PRIV_H_ + +/* + * APIC Register: Offset Description + */ +#define APIC_OFFSET_ID 0x20 /* Local APIC ID */ +#define APIC_OFFSET_VER 0x30 /* Local APIC Version */ +#define APIC_OFFSET_TPR 0x80 /* Task Priority Register */ +#define APIC_OFFSET_APR 0x90 /* Arbitration Priority */ +#define APIC_OFFSET_PPR 0xA0 /* Processor Priority Register */ +#define APIC_OFFSET_EOI 0xB0 /* EOI Register */ +#define APIC_OFFSET_RRR 0xC0 /* Remote read */ +#define APIC_OFFSET_LDR 0xD0 /* Logical Destination */ +#define APIC_OFFSET_DFR 0xE0 /* Destination Format Register */ +#define APIC_OFFSET_SVR 0xF0 /* Spurious Vector Register */ +#define APIC_OFFSET_ISR0 0x100 /* In Service Register */ +#define APIC_OFFSET_ISR1 0x110 +#define APIC_OFFSET_ISR2 0x120 +#define APIC_OFFSET_ISR3 0x130 +#define APIC_OFFSET_ISR4 0x140 +#define APIC_OFFSET_ISR5 0x150 +#define APIC_OFFSET_ISR6 0x160 +#define APIC_OFFSET_ISR7 0x170 +#define APIC_OFFSET_TMR0 0x180 /* Trigger Mode Register */ +#define APIC_OFFSET_TMR1 0x190 +#define APIC_OFFSET_TMR2 0x1A0 +#define APIC_OFFSET_TMR3 0x1B0 +#define APIC_OFFSET_TMR4 0x1C0 +#define APIC_OFFSET_TMR5 0x1D0 +#define APIC_OFFSET_TMR6 0x1E0 +#define APIC_OFFSET_TMR7 0x1F0 +#define APIC_OFFSET_IRR0 0x200 /* Interrupt Request Register */ +#define APIC_OFFSET_IRR1 0x210 +#define APIC_OFFSET_IRR2 0x220 +#define APIC_OFFSET_IRR3 0x230 +#define APIC_OFFSET_IRR4 0x240 +#define APIC_OFFSET_IRR5 0x250 +#define APIC_OFFSET_IRR6 0x260 +#define APIC_OFFSET_IRR7 0x270 +#define APIC_OFFSET_ESR 0x280 /* Error Status Register */ +#define APIC_OFFSET_CMCI_LVT 0x2F0 /* Local Vector Table (CMCI) */ +#define APIC_OFFSET_ICR_LOW 0x300 /* Interrupt Command Register */ +#define APIC_OFFSET_ICR_HI 0x310 +#define APIC_OFFSET_TIMER_LVT 0x320 /* Local Vector Table (Timer) */ +#define APIC_OFFSET_THERM_LVT 0x330 /* Local Vector Table (Thermal) */ +#define APIC_OFFSET_PERF_LVT 0x340 /* Local Vector Table (PMC) */ +#define APIC_OFFSET_LINT0_LVT 0x350 /* Local Vector Table (LINT0) */ +#define APIC_OFFSET_LINT1_LVT 0x360 /* Local Vector Table (LINT1) */ +#define APIC_OFFSET_ERROR_LVT 0x370 /* Local Vector Table (ERROR) */ +#define APIC_OFFSET_TIMER_ICR 0x380 /* Timer's Initial Count */ +#define APIC_OFFSET_TIMER_CCR 0x390 /* Timer's Current Count */ +#define APIC_OFFSET_TIMER_DCR 0x3E0 /* Timer's Divide Configuration */ + +enum boot_state { + BS_INIT, + BS_SIPI, + BS_RUNNING +}; + +/* + * 16 priority levels with at most one vector injected per level. + */ +#define ISRVEC_STK_SIZE (16 + 1) + +struct vlapic { + struct vm *vm; + int vcpuid; + struct LAPIC *apic_page; + + uint32_t esr_pending; + int esr_firing; + + struct callout callout; /* vlapic timer */ + struct bintime timer_fire_bt; /* callout expiry time */ + struct bintime timer_freq_bt; /* timer frequency */ + struct bintime timer_period_bt; /* timer period */ + struct mtx timer_mtx; + + /* + * The 'isrvec_stk' is a stack of vectors injected by the local apic. + * A vector is popped from the stack when the processor does an EOI. + * The vector on the top of the stack is used to compute the + * Processor Priority in conjunction with the TPR. + */ + uint8_t isrvec_stk[ISRVEC_STK_SIZE]; + int isrvec_stk_top; + + uint64_t msr_apicbase; + enum boot_state boot_state; +}; + +void vlapic_init(struct vlapic *vlapic); +void vlapic_cleanup(struct vlapic *vlapic); + +#endif /* _VLAPIC_PRIV_H_ */ Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Wed Dec 25 06:09:31 2013 (r259862) +++ head/sys/amd64/vmm/vmm.c Wed Dec 25 06:46:31 2013 (r259863) @@ -156,6 +156,10 @@ static struct vmm_ops *ops; (ops != NULL ? (*ops->vmgetcap)(vmi, vcpu, num, retval) : ENXIO) #define VMSETCAP(vmi, vcpu, num, val) \ (ops != NULL ? (*ops->vmsetcap)(vmi, vcpu, num, val) : ENXIO) +#define VLAPIC_INIT(vmi, vcpu) \ + (ops != NULL ? (*ops->vlapic_init)(vmi, vcpu) : NULL) +#define VLAPIC_CLEANUP(vmi, vlapic) \ + (ops != NULL ? (*ops->vlapic_cleanup)(vmi, vlapic) : NULL) #define fpu_start_emulating() load_cr0(rcr0() | CR0_TS) #define fpu_stop_emulating() clts() @@ -167,9 +171,11 @@ CTASSERT(VMM_MSR_NUM <= 64); /* msr_mask static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcpu total runtime"); static void -vcpu_cleanup(struct vcpu *vcpu) +vcpu_cleanup(struct vm *vm, int i) { - vlapic_cleanup(vcpu->vlapic); + struct vcpu *vcpu = &vm->vcpu[i]; + + VLAPIC_CLEANUP(vm->cookie, vcpu->vlapic); vmm_stat_free(vcpu->stats); fpu_save_area_free(vcpu->guestfpu); } @@ -184,7 +190,7 @@ vcpu_init(struct vm *vm, uint32_t vcpu_i vcpu_lock_init(vcpu); vcpu->hostcpu = NOCPU; vcpu->vcpuid = vcpu_id; - vcpu->vlapic = vlapic_init(vm, vcpu_id); + vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); vm_set_x2apic_state(vm, vcpu_id, X2APIC_ENABLED); vcpu->guestfpu = fpu_save_area_alloc(); fpu_save_area_reset(vcpu->guestfpu); @@ -360,7 +366,7 @@ vm_destroy(struct vm *vm) vm->num_mem_segs = 0; for (i = 0; i < VM_MAXCPU; i++) - vcpu_cleanup(&vm->vcpu[i]); + vcpu_cleanup(vm, i); VMSPACE_FREE(vm->vmspace); @@ -1127,7 +1133,7 @@ vm_inject_nmi(struct vm *vm, int vcpuid) vcpu = &vm->vcpu[vcpuid]; vcpu->nmi_pending = 1; - vcpu_notify_event(vm, vcpuid); + vcpu_notify_event(vm, vcpuid, false); return (0); } @@ -1356,7 +1362,7 @@ vm_set_x2apic_state(struct vm *vm, int v * to the host_cpu to cause the vcpu to trap into the hypervisor. */ void -vcpu_notify_event(struct vm *vm, int vcpuid) +vcpu_notify_event(struct vm *vm, int vcpuid, bool lapic_intr) { int hostcpu; struct vcpu *vcpu; @@ -1371,8 +1377,12 @@ vcpu_notify_event(struct vm *vm, int vcp } else { if (vcpu->state != VCPU_RUNNING) panic("invalid vcpu state %d", vcpu->state); - if (hostcpu != curcpu) - ipi_cpu(hostcpu, vmm_ipinum); + if (hostcpu != curcpu) { + if (lapic_intr) + vlapic_post_intr(vcpu->vlapic, hostcpu); + else + ipi_cpu(hostcpu, vmm_ipinum); + } } vcpu_unlock(vcpu); } Modified: head/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.c Wed Dec 25 06:09:31 2013 (r259862) +++ head/sys/amd64/vmm/vmm_lapic.c Wed Dec 25 06:46:31 2013 (r259863) @@ -51,26 +51,6 @@ __FBSDID("$FreeBSD$"); #define MSI_X86_ADDR_LOG 0x00000004 /* Destination Mode */ int -lapic_pending_intr(struct vm *vm, int cpu) -{ - struct vlapic *vlapic; - - vlapic = vm_lapic(vm, cpu); - - return (vlapic_pending_intr(vlapic)); -} - -void -lapic_intr_accepted(struct vm *vm, int cpu, int vector) -{ - struct vlapic *vlapic; - - vlapic = vm_lapic(vm, cpu); - - vlapic_intr_accepted(vlapic, vector); -} - -int lapic_set_intr(struct vm *vm, int cpu, int vector, bool level) { struct vlapic *vlapic; @@ -83,9 +63,7 @@ lapic_set_intr(struct vm *vm, int cpu, i vlapic = vm_lapic(vm, cpu); vlapic_set_intr_ready(vlapic, vector, level); - - vcpu_notify_event(vm, cpu); - + vcpu_notify_event(vm, cpu, true); return (0); } Modified: head/sys/amd64/vmm/vmm_lapic.h ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.h Wed Dec 25 06:09:31 2013 (r259862) +++ head/sys/amd64/vmm/vmm_lapic.h Wed Dec 25 06:46:31 2013 (r259863) @@ -43,26 +43,6 @@ int lapic_mmio_write(void *vm, int cpu, uint64_t wval, int size, void *arg); /* - * Returns a vector between 32 and 255 if an interrupt is pending in the - * IRR that can be delivered based on the current state of ISR and TPR. - * - * Note that the vector does not automatically transition to the ISR as a - * result of calling this function. - * - * Returns -1 if there is no eligible vector that can be delivered to the - * guest at this time. - */ -int lapic_pending_intr(struct vm *vm, int cpu); - -/* - * Transition 'vector' from IRR to ISR. This function is called with the - * vector returned by 'lapic_pending_intr()' when the guest is able to - * accept this interrupt (i.e. RFLAGS.IF = 1 and no conditions exist that - * block interrupt delivery). - */ -void lapic_intr_accepted(struct vm *vm, int cpu, int vector); - -/* * Signals to the LAPIC that an interrupt at 'vector' needs to be generated * to the 'cpu', the state is recorded in IRR. */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 09:43:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07DD4F4; Wed, 25 Dec 2013 09:43:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E76D815D0; Wed, 25 Dec 2013 09:43:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBP9hpbu054963; Wed, 25 Dec 2013 09:43:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBP9hpjs054962; Wed, 25 Dec 2013 09:43:51 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312250943.rBP9hpjs054962@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 25 Dec 2013 09:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259865 - head/sys/netinet/libalias X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 09:43:52 -0000 Author: glebius Date: Wed Dec 25 09:43:51 2013 New Revision: 259865 URL: http://svnweb.freebsd.org/changeset/base/259865 Log: It'll be okay to use LibAliasDetachHandlers() here, relying on the fact that all handlers come from modules' bss and are followed by NODIR handler. Modified: head/sys/netinet/libalias/alias.c Modified: head/sys/netinet/libalias/alias.c ============================================================================== --- head/sys/netinet/libalias/alias.c Wed Dec 25 08:34:35 2013 (r259864) +++ head/sys/netinet/libalias/alias.c Wed Dec 25 09:43:51 2013 (r259865) @@ -1722,7 +1722,7 @@ LibAliasUnLoadAllModule(void) /* Unload all modules then reload everything. */ while ((p = first_handler()) != NULL) { - detach_handler(p); + LibAliasDetachHandlers(p); } while ((t = walk_dll_chain()) != NULL) { dlclose(t->handle); From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 13:57:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94FB1A7D; Wed, 25 Dec 2013 13:57:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 817DB17E8; Wed, 25 Dec 2013 13:57:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPDvNO8046644; Wed, 25 Dec 2013 13:57:23 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPDvNYU046643; Wed, 25 Dec 2013 13:57:23 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201312251357.rBPDvNYU046643@svn.freebsd.org> From: Julio Merino Date: Wed, 25 Dec 2013 13:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259868 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 13:57:23 -0000 Author: jmmv Date: Wed Dec 25 13:57:23 2013 New Revision: 259868 URL: http://svnweb.freebsd.org/changeset/base/259868 Log: Delay copying of resolv.conf into the chroot until /etc exists. With an unpopulated chroot dir, release building was failing because the script was attempting to copy resolv.conf into a non-existent /etc directory of the chroot. Fix this by copying the file only after the installworld has happened, which will create this directory. Reviewed by: gjb Approved by: rpaulo (mentor) Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Wed Dec 25 13:51:14 2013 (r259867) +++ head/release/release.sh Wed Dec 25 13:57:23 2013 (r259868) @@ -162,12 +162,12 @@ if [ "x${NOPORTS}" = "x" ]; then svn co ${SVNROOT}/${PORTBRANCH} ${CHROOTDIR}/usr/ports fi -cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf cd ${CHROOTDIR}/usr/src make ${CHROOT_WMAKEFLAGS} buildworld make ${CHROOT_IMAKEFLAGS} installworld DESTDIR=${CHROOTDIR} make ${CHROOT_DMAKEFLAGS} distribution DESTDIR=${CHROOTDIR} mount -t devfs devfs ${CHROOTDIR}/dev +cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit build_doc_ports() { From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 14:48:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02674149; Wed, 25 Dec 2013 14:48:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2D1B1AB4; Wed, 25 Dec 2013 14:48:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPEmR0h065305; Wed, 25 Dec 2013 14:48:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPEmRJF065304; Wed, 25 Dec 2013 14:48:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312251448.rBPEmRJF065304@svn.freebsd.org> From: Dimitry Andric Date: Wed, 25 Dec 2013 14:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259869 - head/sys/dev/mwl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 14:48:28 -0000 Author: dim Date: Wed Dec 25 14:48:27 2013 New Revision: 259869 URL: http://svnweb.freebsd.org/changeset/base/259869 Log: In sys/dev/mwl/if_mwl.c, put the static RD4() function under #ifdef MWL_DEBUG guards, since it only used in DPRINTF statements. MFC after: 3 days Modified: head/sys/dev/mwl/if_mwl.c Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Wed Dec 25 13:57:23 2013 (r259868) +++ head/sys/dev/mwl/if_mwl.c Wed Dec 25 14:48:27 2013 (r259869) @@ -282,11 +282,13 @@ struct mwltxrec { * that all BAR 1 operations are done in the "hal" and * there should be no reference to them here. */ +#ifdef MWL_DEBUG static __inline uint32_t RD4(struct mwl_softc *sc, bus_size_t off) { return bus_space_read_4(sc->sc_io0t, sc->sc_io0h, off); } +#endif static __inline void WR4(struct mwl_softc *sc, bus_size_t off, uint32_t val) From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 15:23:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40BC3D19; Wed, 25 Dec 2013 15:23:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C3FE1DF0; Wed, 25 Dec 2013 15:23:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPFN2BJ080423; Wed, 25 Dec 2013 15:23:02 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPFN2eQ080422; Wed, 25 Dec 2013 15:23:02 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312251523.rBPFN2eQ080422@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 25 Dec 2013 15:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259870 - head/usr.sbin/crashinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 15:23:02 -0000 Author: pluknet Date: Wed Dec 25 15:23:01 2013 New Revision: 259870 URL: http://svnweb.freebsd.org/changeset/base/259870 Log: Do not truncate the ``command'' column in ``ps'' output. Reviewed by: jhb MFC after: 1 week Modified: head/usr.sbin/crashinfo/crashinfo.sh Modified: head/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- head/usr.sbin/crashinfo/crashinfo.sh Wed Dec 25 14:48:27 2013 (r259869) +++ head/usr.sbin/crashinfo/crashinfo.sh Wed Dec 25 15:23:01 2013 (r259870) @@ -181,9 +181,9 @@ fi echo echo "------------------------------------------------------------------------" -echo "ps -axl" +echo "ps -axlww" echo -ps -M $VMCORE -N $KERNEL -axl +ps -M $VMCORE -N $KERNEL -axlww echo echo "------------------------------------------------------------------------" From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 16:01:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 879EA204; Wed, 25 Dec 2013 16:01:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 72E291FDA; Wed, 25 Dec 2013 16:01:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPG1U3R094681; Wed, 25 Dec 2013 16:01:30 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPG1UTP094680; Wed, 25 Dec 2013 16:01:30 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312251601.rBPG1UTP094680@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 25 Dec 2013 16:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259872 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 16:01:30 -0000 Author: pluknet Date: Wed Dec 25 16:01:29 2013 New Revision: 259872 URL: http://svnweb.freebsd.org/changeset/base/259872 Log: The compile time constant limit on number of swap devices was removed in 5.2. As such, remove the EINVAL error saying so. Currently the vm.nswapdev sysctl just represents the number of added swap devices. MFC after: 1 week Modified: head/lib/libc/sys/swapon.2 Modified: head/lib/libc/sys/swapon.2 ============================================================================== --- head/lib/libc/sys/swapon.2 Wed Dec 25 15:40:15 2013 (r259871) +++ head/lib/libc/sys/swapon.2 Wed Dec 25 16:01:29 2013 (r259872) @@ -28,7 +28,7 @@ .\" @(#)swapon.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd October 4, 2013 .Dt SWAPON 2 .Os .Sh NAME @@ -98,10 +98,6 @@ Additionally, .Fn swapon can fail for the following reasons: .Bl -tag -width Er -.It Bq Er EINVAL -The system has reached the boot-time limit on the number of -swap devices, -.Va vm.nswapdev . .It Bq Er ENOTBLK The .Fa special From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 16:01:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A8BC341; Wed, 25 Dec 2013 16:01:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15C961FDE; Wed, 25 Dec 2013 16:01:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPG1mB4094764; Wed, 25 Dec 2013 16:01:48 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPG1meP094760; Wed, 25 Dec 2013 16:01:48 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312251601.rBPG1meP094760@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 25 Dec 2013 16:01:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259873 - in head/contrib/gcc: . config/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 16:01:49 -0000 Author: pfg Date: Wed Dec 25 16:01:48 2013 New Revision: 259873 URL: http://svnweb.freebsd.org/changeset/base/259873 Log: gcc: small enhancements for the arm support. Very small updates: fixes GCC-PR target/31152 Tested by building the cross-compiler. Obtained from: gcc 4.3 (rev. r118461, 125973: GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/config/arm/arm.c head/contrib/gcc/config/arm/arm.md Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Wed Dec 25 16:01:29 2013 (r259872) +++ head/contrib/gcc/ChangeLog.gcc43 Wed Dec 25 16:01:48 2013 (r259873) @@ -65,6 +65,12 @@ fvisibility-ms-compat. * c.opt (fvisibility-ms-compat): New. +2007-06-23 Richard Earnshaw (r125973) + + PR target/31152 + * arm.md (negscc): Match the correct operand for optimized LT0 test. + Remove optimization for GT. + 2007-06-05 Joerg Wunsch (r125346) PR preprocessor/23479 @@ -589,6 +595,14 @@ * config/i386/i386.md (bswapsi2): New. (bswapdi2): Ditto. +2006-11-03 Paul Brook (r118461) + + gcc/ + * config/arm/arm.c (arm_file_start): New function. + (TARGET_ASM_FILE_START): Define. + (arm_default_cpu): New variable. + (arm_override_options): Set arm_default_cpu. + 2006-10-31 Geoffrey Keating (r118360) * coverage.c (coverage_checksum_string): Update comment. Modified: head/contrib/gcc/config/arm/arm.c ============================================================================== --- head/contrib/gcc/config/arm/arm.c Wed Dec 25 16:01:29 2013 (r259872) +++ head/contrib/gcc/config/arm/arm.c Wed Dec 25 16:01:48 2013 (r259873) @@ -154,6 +154,7 @@ static void arm_encode_section_info (tre #endif static void arm_file_end (void); +static void arm_file_start (void); #ifdef AOF_ASSEMBLER static void aof_globalize_label (FILE *, const char *); @@ -202,6 +203,9 @@ static bool arm_tls_symbol_p (rtx x); #undef TARGET_ATTRIBUTE_TABLE #define TARGET_ATTRIBUTE_TABLE arm_attribute_table +#undef TARGET_ASM_FILE_START +#define TARGET_ASM_FILE_START arm_file_start + #undef TARGET_ASM_FILE_END #define TARGET_ASM_FILE_END arm_file_end @@ -390,6 +394,9 @@ rtx arm_compare_op0, arm_compare_op1; /* The processor for which instructions should be scheduled. */ enum processor_type arm_tune = arm_none; +/* The default processor used if not overriden by commandline. */ +static enum processor_type arm_default_cpu = arm_none; + /* Which floating point model to use. */ enum arm_fp_model arm_fp_model; @@ -1020,8 +1027,9 @@ arm_override_options (void) insn_flags = sel->flags; } sprintf (arm_arch_name, "__ARM_ARCH_%s__", sel->arch); + arm_default_cpu = (enum processor_type) (sel - all_cores); if (arm_tune == arm_none) - arm_tune = (enum processor_type) (sel - all_cores); + arm_tune = arm_default_cpu; } /* The processor for which we should tune should now have been @@ -14458,6 +14466,105 @@ arm_asm_output_labelref (FILE *stream, c } static void +arm_file_start (void) +{ + int val; + + if (TARGET_BPABI) + { + const char *fpu_name; + if (arm_select[0].string) + asm_fprintf (asm_out_file, "\t.cpu %s\n", arm_select[0].string); + else if (arm_select[1].string) + asm_fprintf (asm_out_file, "\t.arch %s\n", arm_select[1].string); + else + asm_fprintf (asm_out_file, "\t.cpu %s\n", + all_cores[arm_default_cpu].name); + + if (TARGET_SOFT_FLOAT) + { + if (TARGET_VFP) + fpu_name = "softvfp"; + else + fpu_name = "softfpa"; + } + else + { + switch (arm_fpu_arch) + { + case FPUTYPE_FPA: + fpu_name = "fpa"; + break; + case FPUTYPE_FPA_EMU2: + fpu_name = "fpe2"; + break; + case FPUTYPE_FPA_EMU3: + fpu_name = "fpe3"; + break; + case FPUTYPE_MAVERICK: + fpu_name = "maverick"; + break; + case FPUTYPE_VFP: + if (TARGET_HARD_FLOAT) + asm_fprintf (asm_out_file, "\t.eabi_attribute 27, 3\n"); + if (TARGET_HARD_FLOAT_ABI) + asm_fprintf (asm_out_file, "\t.eabi_attribute 28, 1\n"); + fpu_name = "vfp"; + break; + default: + abort(); + } + } + asm_fprintf (asm_out_file, "\t.fpu %s\n", fpu_name); + + /* Some of these attributes only apply when the corresponding features + are used. However we don't have any easy way of figuring this out. + Conservatively record the setting that would have been used. */ + + /* Tag_ABI_PCS_wchar_t. */ + asm_fprintf (asm_out_file, "\t.eabi_attribute 18, %d\n", + (int)WCHAR_TYPE_SIZE / BITS_PER_UNIT); + + /* Tag_ABI_FP_rounding. */ + if (flag_rounding_math) + asm_fprintf (asm_out_file, "\t.eabi_attribute 19, 1\n"); + if (!flag_unsafe_math_optimizations) + { + /* Tag_ABI_FP_denomal. */ + asm_fprintf (asm_out_file, "\t.eabi_attribute 20, 1\n"); + /* Tag_ABI_FP_exceptions. */ + asm_fprintf (asm_out_file, "\t.eabi_attribute 21, 1\n"); + } + /* Tag_ABI_FP_user_exceptions. */ + if (flag_signaling_nans) + asm_fprintf (asm_out_file, "\t.eabi_attribute 22, 1\n"); + /* Tag_ABI_FP_number_model. */ + asm_fprintf (asm_out_file, "\t.eabi_attribute 23, %d\n", + flag_finite_math_only ? 1 : 3); + + /* Tag_ABI_align8_needed. */ + asm_fprintf (asm_out_file, "\t.eabi_attribute 24, 1\n"); + /* Tag_ABI_align8_preserved. */ + asm_fprintf (asm_out_file, "\t.eabi_attribute 25, 1\n"); + /* Tag_ABI_enum_size. */ + asm_fprintf (asm_out_file, "\t.eabi_attribute 26, %d\n", + flag_short_enums ? 1 : 2); + + /* Tag_ABI_optimization_goals. */ + if (optimize_size) + val = 4; + else if (optimize >= 2) + val = 2; + else if (optimize) + val = 1; + else + val = 6; + asm_fprintf (asm_out_file, "\t.eabi_attribute 30, %d\n", val); + } + default_file_start(); +} + +static void arm_file_end (void) { int regno; Modified: head/contrib/gcc/config/arm/arm.md ============================================================================== --- head/contrib/gcc/config/arm/arm.md Wed Dec 25 16:01:29 2013 (r259872) +++ head/contrib/gcc/config/arm/arm.md Wed Dec 25 16:01:48 2013 (r259873) @@ -8841,15 +8841,12 @@ (clobber (reg:CC CC_REGNUM))] "TARGET_ARM" "* - if (GET_CODE (operands[3]) == LT && operands[3] == const0_rtx) + if (GET_CODE (operands[3]) == LT && operands[2] == const0_rtx) return \"mov\\t%0, %1, asr #31\"; if (GET_CODE (operands[3]) == NE) return \"subs\\t%0, %1, %2\;mvnne\\t%0, #0\"; - if (GET_CODE (operands[3]) == GT) - return \"subs\\t%0, %1, %2\;mvnne\\t%0, %0, asr #31\"; - output_asm_insn (\"cmp\\t%1, %2\", operands); output_asm_insn (\"mov%D3\\t%0, #0\", operands); return \"mvn%d3\\t%0, #0\"; From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 16:14:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A4395E8; Wed, 25 Dec 2013 16:14:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 86A86109C; Wed, 25 Dec 2013 16:14:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPGE3ua099046; Wed, 25 Dec 2013 16:14:03 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPGE3vG099043; Wed, 25 Dec 2013 16:14:03 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201312251614.rBPGE3vG099043@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 25 Dec 2013 16:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259874 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 16:14:03 -0000 Author: jilles Date: Wed Dec 25 16:14:02 2013 New Revision: 259874 URL: http://svnweb.freebsd.org/changeset/base/259874 Log: sh: Simplify code related to PPID variable. Modified: head/bin/sh/var.c head/bin/sh/var.h Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Wed Dec 25 16:01:48 2013 (r259873) +++ head/bin/sh/var.c Wed Dec 25 16:14:02 2013 (r259874) @@ -88,7 +88,6 @@ struct var vifs; struct var vmail; struct var vmpath; struct var vpath; -struct var vppid; struct var vps1; struct var vps2; struct var vps4; @@ -110,8 +109,6 @@ static const struct varinit varinit[] = NULL }, { &vpath, 0, "PATH=" _PATH_DEFPATH, changepath }, - { &vppid, VUNSET, "PPID=", - NULL }, /* * vps1 depends on uid */ @@ -179,10 +176,8 @@ initvar(void) vps1.text = __DECONST(char *, geteuid() ? "PS1=$ " : "PS1=# "); vps1.flags = VSTRFIXED|VTEXTFIXED; } - if ((vppid.flags & VEXPORT) == 0) { - fmtstr(ppid, sizeof(ppid), "%d", (int)getppid()); - setvarsafe("PPID", ppid, 0); - } + fmtstr(ppid, sizeof(ppid), "%d", (int)getppid()); + setvarsafe("PPID", ppid, 0); for (envp = environ ; *envp ; envp++) { if (strchr(*envp, '=')) { setvareq(*envp, VEXPORT|VTEXTFIXED); Modified: head/bin/sh/var.h ============================================================================== --- head/bin/sh/var.h Wed Dec 25 16:01:48 2013 (r259873) +++ head/bin/sh/var.h Wed Dec 25 16:14:02 2013 (r259874) @@ -75,7 +75,6 @@ extern struct var vifs; extern struct var vmail; extern struct var vmpath; extern struct var vpath; -extern struct var vppid; extern struct var vps1; extern struct var vps2; extern struct var vps4; From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 16:25:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7872859; Wed, 25 Dec 2013 16:25:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93F29111F; Wed, 25 Dec 2013 16:25:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPGPsP8003037; Wed, 25 Dec 2013 16:25:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPGPsqq003036; Wed, 25 Dec 2013 16:25:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312251625.rBPGPsqq003036@svn.freebsd.org> From: Dimitry Andric Date: Wed, 25 Dec 2013 16:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259875 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 16:25:54 -0000 Author: dim Date: Wed Dec 25 16:25:54 2013 New Revision: 259875 URL: http://svnweb.freebsd.org/changeset/base/259875 Log: In sys/kern/sched_ule.c, remove static function sched_both(), which is unused since r232207. MFC after: 3 days Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Dec 25 16:14:02 2013 (r259874) +++ head/sys/kern/sched_ule.c Wed Dec 25 16:25:54 2013 (r259875) @@ -813,30 +813,6 @@ sched_highest(const struct cpu_group *cg return high.cs_cpu; } -/* - * Simultaneously find the highest and lowest loaded cpu reachable via - * cg. - */ -static inline void -sched_both(const struct cpu_group *cg, cpuset_t mask, int *lowcpu, int *highcpu) -{ - struct cpu_search high; - struct cpu_search low; - - low.cs_cpu = -1; - low.cs_prefer = -1; - low.cs_pri = -1; - low.cs_limit = INT_MAX; - low.cs_mask = mask; - high.cs_cpu = -1; - high.cs_limit = -1; - high.cs_mask = mask; - cpu_search_both(cg, &low, &high); - *lowcpu = low.cs_cpu; - *highcpu = high.cs_cpu; - return; -} - static void sched_balance_group(struct cpu_group *cg) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 16:58:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EFA6D01; Wed, 25 Dec 2013 16:58:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6AFA012AD; Wed, 25 Dec 2013 16:58:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPGwFR2014278; Wed, 25 Dec 2013 16:58:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPGwFJe014277; Wed, 25 Dec 2013 16:58:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312251658.rBPGwFJe014277@svn.freebsd.org> From: Dimitry Andric Date: Wed, 25 Dec 2013 16:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259876 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 16:58:15 -0000 Author: dim Date: Wed Dec 25 16:58:14 2013 New Revision: 259876 URL: http://svnweb.freebsd.org/changeset/base/259876 Log: In sys/kern/subr_witness.c, remove static function witness_lock_order_key_empty(), which is unused since r181695. MFC after: 3 days Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Wed Dec 25 16:25:54 2013 (r259875) +++ head/sys/kern/subr_witness.c Wed Dec 25 16:58:14 2013 (r259876) @@ -305,13 +305,6 @@ witness_lock_type_equal(struct witness * } static __inline int -witness_lock_order_key_empty(const struct witness_lock_order_key *key) -{ - - return (key->from == 0 && key->to == 0); -} - -static __inline int witness_lock_order_key_equal(const struct witness_lock_order_key *a, const struct witness_lock_order_key *b) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 16:58:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DD26E43; Wed, 25 Dec 2013 16:58:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E81F12B5; Wed, 25 Dec 2013 16:58:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPGwhSh014358; Wed, 25 Dec 2013 16:58:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPGwh1g014357; Wed, 25 Dec 2013 16:58:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312251658.rBPGwh1g014357@svn.freebsd.org> From: Alexander Motin Date: Wed, 25 Dec 2013 16:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259877 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 16:58:43 -0000 Author: mav Date: Wed Dec 25 16:58:42 2013 New Revision: 259877 URL: http://svnweb.freebsd.org/changeset/base/259877 Log: Slightly simplify expiration logic introduced in r254337. - Do not update the histogram for items we are any way deleting from cache. - Do not update the histogram if nfsrc_tcphighwater is not set. - Remove some extra math operations. Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdcache.c Wed Dec 25 16:58:14 2013 (r259876) +++ head/sys/fs/nfsserver/nfs_nfsdcache.c Wed Dec 25 16:58:42 2013 (r259877) @@ -832,6 +832,7 @@ nfsrvd_cleancache(void) nfsrc_tcpsavedreplies = 0; } +#define HISTSIZE 16 /* * The basic rule is to get rid of entries that are expired. */ @@ -839,7 +840,7 @@ static void nfsrc_trimcache(u_int64_t sockref, struct socket *so) { struct nfsrvcache *rp, *nextrp; - int i, j, k, time_histo[10]; + int i, j, k, tto, time_histo[HISTSIZE]; time_t thisstamp; static time_t udp_lasttrim = 0, tcp_lasttrim = 0; static int onethread = 0; @@ -863,8 +864,9 @@ nfsrc_trimcache(u_int64_t sockref, struc } if (NFSD_MONOSEC != tcp_lasttrim || nfsrc_tcpsavedreplies >= nfsrc_tcphighwater) { - for (i = 0; i < 10; i++) + for (i = 0; i < HISTSIZE; i++) time_histo[i] = 0; + tto = nfsrc_tcptimeout; for (i = 0; i < NFSRVCACHE_HASHSIZE; i++) { mtx_lock(&nfsrchash_table[i].mtx); if (i == 0) @@ -874,6 +876,15 @@ nfsrc_trimcache(u_int64_t sockref, struc if (!(rp->rc_flag & (RC_INPROG|RC_LOCKED|RC_WANTED)) && rp->rc_refcnt == 0) { + if ((rp->rc_flag & RC_REFCNT) || + tcp_lasttrim > rp->rc_timestamp || + nfsrc_activesocket(rp, sockref, so)) { + nfsrc_freecache(rp); + continue; + } + + if (nfsrc_tcphighwater == 0) + continue; /* * The timestamps range from roughly the * present (tcp_lasttrim) to the present @@ -881,16 +892,13 @@ nfsrc_trimcache(u_int64_t sockref, struc * histogram of where the timeouts fall. */ j = rp->rc_timestamp - tcp_lasttrim; - if (j >= nfsrc_tcptimeout) - j = nfsrc_tcptimeout - 1; - if (j < 0) + if (j >= tto) + j = HISTSIZE - 1; + else if (j < 0) j = 0; - j = (j * 10 / nfsrc_tcptimeout) % 10; + else + j = j * HISTSIZE / tto; time_histo[j]++; - if ((rp->rc_flag & RC_REFCNT) || - tcp_lasttrim > rp->rc_timestamp || - nfsrc_activesocket(rp, sockref, so)) - nfsrc_freecache(rp); } } mtx_unlock(&nfsrchash_table[i].mtx); @@ -903,12 +911,12 @@ nfsrc_trimcache(u_int64_t sockref, struc * 80% of the nfsrc_tcphighwater. */ k = 0; - for (i = 0; i < 8; i++) { + for (i = 0; i < (HISTSIZE - 2); i++) { k += time_histo[i]; if (k > j) break; } - k = nfsrc_tcptimeout * (i + 1) / 10; + k = tto * (i + 1) / HISTSIZE; if (k < 1) k = 1; thisstamp = tcp_lasttrim + k; From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 17:11:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48A3A1B8; Wed, 25 Dec 2013 17:11:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3013C13A0; Wed, 25 Dec 2013 17:11:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPHBoka021405; Wed, 25 Dec 2013 17:11:50 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPHBoZE021404; Wed, 25 Dec 2013 17:11:50 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312251711.rBPHBoZE021404@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 25 Dec 2013 17:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259878 - head/lib/libdevstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 17:11:50 -0000 Author: pluknet Date: Wed Dec 25 17:11:49 2013 New Revision: 259878 URL: http://svnweb.freebsd.org/changeset/base/259878 Log: For vmcore, calculate time relative to device creation upon time_uptime. Previously it used a clock from live kernel. MFC after: 2 weeks Modified: head/lib/libdevstat/devstat.c Modified: head/lib/libdevstat/devstat.c ============================================================================== --- head/lib/libdevstat/devstat.c Wed Dec 25 16:58:42 2013 (r259877) +++ head/lib/libdevstat/devstat.c Wed Dec 25 17:11:49 2013 (r259878) @@ -150,7 +150,9 @@ static const char *namelist[] = { "_devstat_version", #define X_DEVICE_STATQ 3 "_device_statq", -#define X_END 4 +#define X_TIME_UPTIME 4 + "_time_uptime", +#define X_END 5 }; /* @@ -349,10 +351,10 @@ devstat_getdevs(kvm_t *kd, struct statin oldnumdevs = dinfo->numdevs; oldgeneration = dinfo->generation; - clock_gettime(CLOCK_MONOTONIC, &ts); - stats->snap_time = ts.tv_sec + ts.tv_nsec * 1e-9; - if (kd == NULL) { + clock_gettime(CLOCK_MONOTONIC, &ts); + stats->snap_time = ts.tv_sec + ts.tv_nsec * 1e-9; + /* If this is our first time through, mem_ptr will be null. */ if (dinfo->mem_ptr == NULL) { /* @@ -433,6 +435,11 @@ devstat_getdevs(kvm_t *kd, struct statin } } else { + if (KREADNL(kd, X_TIME_UPTIME, ts.tv_sec) == -1) + return(-1); + else + stats->snap_time = ts.tv_sec; + /* * This is of course non-atomic, but since we are working * on a core dump, the generation is unlikely to change From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 17:28:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55F4A3D1; Wed, 25 Dec 2013 17:28:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4047C150A; Wed, 25 Dec 2013 17:28:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPHSBYY025727; Wed, 25 Dec 2013 17:28:11 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPHS9Uo025716; Wed, 25 Dec 2013 17:28:09 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312251728.rBPHS9Uo025716@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 25 Dec 2013 17:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259879 - in head/share/man: man5 man7 man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 17:28:11 -0000 Author: pluknet Date: Wed Dec 25 17:28:08 2013 New Revision: 259879 URL: http://svnweb.freebsd.org/changeset/base/259879 Log: Clean up manual pages after BIND removal. MFC after: 1 week Modified: head/share/man/man5/hosts.5 head/share/man/man5/hosts.equiv.5 head/share/man/man5/nsswitch.conf.5 head/share/man/man5/periodic.conf.5 head/share/man/man5/rc.conf.5 head/share/man/man5/resolver.5 head/share/man/man7/hier.7 head/share/man/man7/hostname.7 head/share/man/man7/security.7 head/share/man/man8/rc.8 Modified: head/share/man/man5/hosts.5 ============================================================================== --- head/share/man/man5/hosts.5 Wed Dec 25 17:11:49 2013 (r259878) +++ head/share/man/man5/hosts.5 Wed Dec 25 17:28:08 2013 (r259879) @@ -32,7 +32,7 @@ .\" @(#)hosts.5 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 11, 1993 +.Dd December 25, 2013 .Dt HOSTS 5 .Os .Sh NAME @@ -60,9 +60,7 @@ A ``#'' indicates the beginning of a comment; characters up to the end of the line are not interpreted by routines which search the file. .Pp -When using the name server -.Xr named 8 , -this file provides a backup used when the name server +This file provides a backup used when the name server is not running. For the name server, it is suggested that only a few addresses be included in this file. @@ -104,8 +102,7 @@ file resides in .Sh SEE ALSO .Xr gethostbyname 3 , .Xr nsswitch.conf 5 , -.Xr ifconfig 8 , -.Xr named 8 +.Xr ifconfig 8 .Rs .%T "Name Server Operations Guide for BIND" .Re Modified: head/share/man/man5/hosts.equiv.5 ============================================================================== --- head/share/man/man5/hosts.equiv.5 Wed Dec 25 17:11:49 2013 (r259878) +++ head/share/man/man5/hosts.equiv.5 Wed Dec 25 17:28:08 2013 (r259879) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2007 +.Dd December 25, 2013 .Dt HOSTS.EQUIV 5 .Os .Sh NAME @@ -139,7 +139,6 @@ except users from netgroup .Xr ruserok 3 , .Xr netgroup 5 , .Xr ifconfig 8 , -.Xr named 8 , .Xr yp 8 .Sh BUGS This manual page is incomplete. Modified: head/share/man/man5/nsswitch.conf.5 ============================================================================== --- head/share/man/man5/nsswitch.conf.5 Wed Dec 25 17:11:49 2013 (r259878) +++ head/share/man/man5/nsswitch.conf.5 Wed Dec 25 17:28:08 2013 (r259879) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2010 +.Dd December 25, 2013 .Dt NSSWITCH.CONF 5 .Os .Sh NAME @@ -362,7 +362,6 @@ databases. .Xr nscd.conf 5 , .Xr resolv.conf 5 , .Xr nscd 8 , -.Xr named 8 , .Xr ypbind 8 .Sh HISTORY The Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Wed Dec 25 17:11:49 2013 (r259878) +++ head/share/man/man5/periodic.conf.5 Wed Dec 25 17:28:08 2013 (r259879) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2012 +.Dd December 25, 2013 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -493,17 +493,6 @@ for the previous day. .Pq Vt num Set to the number of maillog files that should be checked for yesterday's mail rejects. -.It Va daily_status_named_enable -.Pq Vt bool -Set to -.Dq Li YES -if you want to summarise denied zone transfers (AXFR and IXFR) -for the previous day. -.It Va daily_status_named_usedns -.Pq Vt bool -Set to -.Dq Li YES -if you want to enable reverse DNS lookups. .It Va daily_status_ntpd .Pq Vt bool Set to Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Dec 25 17:11:49 2013 (r259878) +++ head/share/man/man5/rc.conf.5 Wed Dec 25 17:28:08 2013 (r259879) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2013 +.Dd December 25, 2013 .Dt RC.CONF 5 .Os .Sh NAME @@ -2061,85 +2061,6 @@ If set to run the .Xr unbound 8 daemon as a local caching resolver. -.It Va named_enable -.Pq Vt bool -If set to -.Dq Li YES , -run the -.Xr named 8 -daemon. -.It Va named_program -.Pq Vt str -Path to -.Xr named 8 -(default -.Pa /usr/sbin/named ) . -.It Va named_conf -.Pq Vt str -Path to -.Xr named 8 -configuration file, (default -.Pa /etc/namedb/named.conf ) . -.It Va named_flags -.Pq Vt str -If -.Va named_enable -is set to -.Dq Li YES , -these are the flags to pass to -.Xr named 8 . -.It Va named_uid -.Pq Vt str -The user that the -.Xr named 8 -process should be run as. -.It Va named_chrootdir -.Pq Vt str -The root directory for a name server run in a -.Xr chroot 8 -environment (default -.Pa /var/named ) . -If left empty -.Xr named 8 -will not be run in a -.Xr chroot 8 -environment. -.It Va named_chroot_autoupdate -.Pq Vt bool -Set to -.Dq Li NO -to disable automatic update of the -.Xr chroot 8 -environment. -.It Va named_symlink_enable -.Pq Vt bool -Set to -.Dq Li NO -to disable symlinking of -daemon's PID file -into the -.Xr chroot 8 -environment. -.It Va named_wait -.Pq Vt bool -Set to have -.Pa /etc/rc.d/named -loop until working name service is established. -.It Va named_wait_host -.Pq Vt str -Name of host to lookup for the named_wait option. -(Default localhost) -.It Va named_auto_forward -.Pq Vt bool -Set to enable automatic creation of a forwarder -configuration file derived from -.Pa /etc/resolv.conf . -.It Va named_auto_forward_only -.Pq Vt bool -Set to change the default forwarder configuration from -.Dq forward first -to -.Dq forward only . .It Va kerberos5_server_enable .Pq Vt bool Set to @@ -4572,7 +4493,6 @@ The default is 30. .Xr mountd 8 , .Xr moused 8 , .Xr mrouted 8 , -.Xr named 8 , .Xr newfs 8 , .Xr newsyslog 8 , .Xr nfsd 8 , Modified: head/share/man/man5/resolver.5 ============================================================================== --- head/share/man/man5/resolver.5 Wed Dec 25 17:11:49 2013 (r259878) +++ head/share/man/man5/resolver.5 Wed Dec 25 17:28:08 2013 (r259879) @@ -32,7 +32,7 @@ .\" @(#)resolver.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd September 9, 2004 +.Dd December 25, 2013 .Dt RESOLVER 5 .Os .Sh NAME @@ -210,8 +210,7 @@ resides in .Sh SEE ALSO .Xr gethostbyname 3 , .Xr resolver 3 , -.Xr hostname 7 , -.Xr named 8 +.Xr hostname 7 .Rs .%T "Name Server Operations Guide for BIND" .Re Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Wed Dec 25 17:11:49 2013 (r259878) +++ head/share/man/man7/hier.7 Wed Dec 25 17:28:08 2013 (r259879) @@ -32,7 +32,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 29, 2013 +.Dd December 25, 2013 .Dt HIER 7 .Os .Sh NAME @@ -104,10 +104,6 @@ Sendmail control files mtree configuration files; see .Xr mtree 8 -.It Pa namedb/ -named configuration files; -see -.Xr named 8 .It Pa pam.d/ configuration files for the Pluggable Authentication Modules (PAM) library @@ -804,11 +800,6 @@ system information files describing vari system since it was booted .Pp .Bl -tag -width Fl -compact -.It Pa named/ -writable by the -.Dq bind -user; see -.Xr named 8 .It Pa ppp/ writable by the .Dq network Modified: head/share/man/man7/hostname.7 ============================================================================== --- head/share/man/man7/hostname.7 Wed Dec 25 17:11:49 2013 (r259878) +++ head/share/man/man7/hostname.7 Wed Dec 25 17:28:08 2013 (r259879) @@ -32,7 +32,7 @@ .\" @(#)hostname.7 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd December 30, 1993 +.Dd December 25, 2013 .Dt HOSTNAME 7 .Os .Sh NAME @@ -86,8 +86,7 @@ by a system-wide configuration file (see .Sh SEE ALSO .Xr gethostbyname 3 , .Xr resolver 5 , -.Xr mailaddr 7 , -.Xr named 8 +.Xr mailaddr 7 .Sh HISTORY .Nm Hostname appeared in Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Wed Dec 25 17:11:49 2013 (r259878) +++ head/share/man/man7/security.7 Wed Dec 25 17:28:08 2013 (r259879) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd December 25, 2013 .Dt SECURITY 7 .Os .Sh NAME @@ -350,13 +350,6 @@ now defaults to running and .Xr fingerd 8 in a sandbox. -Another program which may be a candidate for running in a sandbox is -.Xr named 8 . -The default -.Pa rc.conf -includes the arguments necessary to run -.Xr named 8 -in a sandbox in a commented-out form. Depending on whether you are installing a new system or upgrading an existing system, the special user accounts used by these sandboxes may not be installed. @@ -825,8 +818,6 @@ ports A, B, C, D, and M-Z This way you can firewall off all of your low ports except for certain specific services such as -.Xr named 8 -(if you are primary for a zone), .Xr talkd 8 , .Xr sendmail 8 , and other internet-accessible services. Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Wed Dec 25 17:11:49 2013 (r259878) +++ head/share/man/man8/rc.8 Wed Dec 25 17:28:08 2013 (r259879) @@ -35,7 +35,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd October 19, 2013 +.Dd December 25, 2013 .Dt RC 8 .Os .Sh NAME @@ -242,7 +242,7 @@ network configuration. .It Pa SERVERS Ensure basic services exist for services that start early (such as -.Pa named ) , +.Pa nisdomain ) , because they are required by .Pa DAEMON below. From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 17:28:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8FE84A8; Wed, 25 Dec 2013 17:28:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D65BA150C; Wed, 25 Dec 2013 17:28:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPHSIWg025779; Wed, 25 Dec 2013 17:28:18 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPHSIjY025778; Wed, 25 Dec 2013 17:28:18 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312251728.rBPHSIjY025778@svn.freebsd.org> From: Dimitry Andric Date: Wed, 25 Dec 2013 17:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259880 - head/sys/dev/sym X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 17:28:19 -0000 Author: dim Date: Wed Dec 25 17:28:18 2013 New Revision: 259880 URL: http://svnweb.freebsd.org/changeset/base/259880 Log: In sys/dev/sym/sym_hipd.c, remove static functions sym_que_first(), sym_que_last() and sym_remque_tail(), which are all unused since r53790. MFC after: 3 days Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Wed Dec 25 17:28:08 2013 (r259879) +++ head/sys/dev/sym/sym_hipd.c Wed Dec 25 17:28:18 2013 (r259880) @@ -154,16 +154,6 @@ typedef struct sym_quehead { (ptr)->flink = (ptr); (ptr)->blink = (ptr); \ } while (0) -static __inline struct sym_quehead *sym_que_first(struct sym_quehead *head) -{ - return (head->flink == head) ? NULL : head->flink; -} - -static __inline struct sym_quehead *sym_que_last(struct sym_quehead *head) -{ - return (head->blink == head) ? NULL : head->blink; -} - static __inline void __sym_que_add(struct sym_quehead * new, struct sym_quehead * blink, struct sym_quehead * flink) @@ -225,17 +215,6 @@ static __inline struct sym_quehead *sym_ #define sym_insque_tail(new, head) __sym_que_add(new, (head)->blink, head) -static __inline struct sym_quehead *sym_remque_tail(struct sym_quehead *head) -{ - struct sym_quehead *elem = head->blink; - - if (elem != head) - __sym_que_del(elem->blink, head); - else - elem = NULL; - return elem; -} - /* * This one may be useful. */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 18:25:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 398F5F1B; Wed, 25 Dec 2013 18:25:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 267DC18BB; Wed, 25 Dec 2013 18:25:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPIPxuP047854; Wed, 25 Dec 2013 18:25:59 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPIPxNo047853; Wed, 25 Dec 2013 18:25:59 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201312251825.rBPIPxNo047853@svn.freebsd.org> From: Julio Merino Date: Wed, 25 Dec 2013 18:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259881 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 18:25:59 -0000 Author: jmmv Date: Wed Dec 25 18:25:58 2013 New Revision: 259881 URL: http://svnweb.freebsd.org/changeset/base/259881 Log: Put the release objdir inside the chroot. When building the system from outside the chroot as part of the release process, ensure the objdir is within the chroot so that the whole output of the release.sh script is self-contained in a single directory. Use CHROOTDIR/tmp/obj instead of CHROOTDIR/usr/obj to minimize possible interferences with the output of the build itself. Reviewed by: gjb Approved by: rpaulo (mentor) Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Wed Dec 25 17:28:18 2013 (r259880) +++ head/release/release.sh Wed Dec 25 18:25:58 2013 (r259881) @@ -126,6 +126,7 @@ if [ "x${TARGET}" != "x" ] && [ "x${TARG else ARCH_FLAGS= fi +CHROOT_MAKEENV="MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" CHROOT_IMAKEFLAGS="${CONF_FILES}" CHROOT_DMAKEFLAGS="${CONF_FILES}" @@ -163,9 +164,11 @@ if [ "x${NOPORTS}" = "x" ]; then fi cd ${CHROOTDIR}/usr/src -make ${CHROOT_WMAKEFLAGS} buildworld -make ${CHROOT_IMAKEFLAGS} installworld DESTDIR=${CHROOTDIR} -make ${CHROOT_DMAKEFLAGS} distribution DESTDIR=${CHROOTDIR} +env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld +env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \ + DESTDIR=${CHROOTDIR} +env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \ + DESTDIR=${CHROOTDIR} mount -t devfs devfs ${CHROOTDIR}/dev cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 19:07:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 707465BD; Wed, 25 Dec 2013 19:07:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D17D1B14; Wed, 25 Dec 2013 19:07:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPJ7Fsg062666; Wed, 25 Dec 2013 19:07:15 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPJ7FnY062664; Wed, 25 Dec 2013 19:07:15 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312251907.rBPJ7FnY062664@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 25 Dec 2013 19:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259882 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 19:07:15 -0000 Author: ray Date: Wed Dec 25 19:07:14 2013 New Revision: 259882 URL: http://svnweb.freebsd.org/changeset/base/259882 Log: Use statndard (syscons) way to disable bell. Testesd by: markj Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Wed Dec 25 18:25:58 2013 (r259881) +++ head/sys/dev/vt/vt.h Wed Dec 25 19:07:14 2013 (r259882) @@ -135,6 +135,7 @@ struct vt_device { #define VDF_DEAD 0x10 /* Early probing found nothing. */ #define VDF_INITIALIZED 0x20 /* vtterm_cnprobe already done. */ #define VDF_MOUSECURSOR 0x40 /* Mouse cursor visible. */ +#define VDF_QUIET_BELL 0x80 /* Disable bell. */ int vd_keyboard; /* (G) Keyboard index. */ unsigned int vd_kbstate; /* (?) Device unit. */ unsigned int vd_unit; /* (c) Device unit. */ Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Dec 25 18:25:58 2013 (r259881) +++ head/sys/dev/vt/vt_core.c Wed Dec 25 19:07:14 2013 (r259882) @@ -589,6 +589,11 @@ vt_allocate_keyboard(struct vt_device *v static void vtterm_bell(struct terminal *tm) { + struct vt_window *vw = tm->tm_softc; + struct vt_device *vd = vw->vw_device; + + if (vd->vd_flags & VDF_QUIET_BELL) + return; sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION); } @@ -1505,6 +1510,12 @@ skip_thunk: /* XXX */ *(int *)data = M_CG640x480; return (0); + case CONS_BELLTYPE: /* set bell type sound */ + if ((*(int *)data) & CONS_QUIET_BELL) + vd->vd_flags |= VDF_QUIET_BELL; + else + vd->vd_flags &= ~VDF_QUIET_BELL; + return (0); case CONS_GETINFO: { vid_info_t *vi = (vid_info_t *)data; From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 19:38:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12504C9D; Wed, 25 Dec 2013 19:38:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F2DFC1DE4; Wed, 25 Dec 2013 19:38:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPJcGBH073905; Wed, 25 Dec 2013 19:38:16 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPJcGOI073904; Wed, 25 Dec 2013 19:38:16 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312251938.rBPJcGOI073904@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 25 Dec 2013 19:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259883 - head/lib/libdevstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 19:38:17 -0000 Author: pluknet Date: Wed Dec 25 19:38:16 2013 New Revision: 259883 URL: http://svnweb.freebsd.org/changeset/base/259883 Log: Fix a typo. Modified: head/lib/libdevstat/devstat.c Modified: head/lib/libdevstat/devstat.c ============================================================================== --- head/lib/libdevstat/devstat.c Wed Dec 25 19:07:14 2013 (r259882) +++ head/lib/libdevstat/devstat.c Wed Dec 25 19:38:16 2013 (r259883) @@ -201,7 +201,7 @@ devstat_getnumdevs(kvm_t *kd) * supplied in a more atmoic manner by the kern.devstat.all sysctl. * Because this generation sysctl is separate from the statistics sysctl, * the device list and the generation could change between the time that - * this function is called and the device list is retreived. + * this function is called and the device list is retrieved. */ long devstat_getgeneration(kvm_t *kd) From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 20:08:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87F0D7B5; Wed, 25 Dec 2013 20:08:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 745341FA3; Wed, 25 Dec 2013 20:08:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPK8jwA085794; Wed, 25 Dec 2013 20:08:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPK8jIp085793; Wed, 25 Dec 2013 20:08:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201312252008.rBPK8jIp085793@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 25 Dec 2013 20:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259884 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 20:08:45 -0000 Author: bz Date: Wed Dec 25 20:08:44 2013 New Revision: 259884 URL: http://svnweb.freebsd.org/changeset/base/259884 Log: Correct warnings comparing unsigned variables < 0 constantly reported while building kernels. All instances removed are indeed unsigned so the expressions could not be true. MFC after: 1 week Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Wed Dec 25 19:38:16 2013 (r259883) +++ head/sys/netinet6/in6_mcast.c Wed Dec 25 20:08:44 2013 (r259884) @@ -1851,8 +1851,7 @@ in6p_join_group(struct inpcb *inp, struc if (mreq.ipv6mr_interface == 0) { ifp = in6p_lookup_mcast_ifp(inp, &gsa->sin6); } else { - if (mreq.ipv6mr_interface < 0 || - V_if_index < mreq.ipv6mr_interface) + if (V_if_index < mreq.ipv6mr_interface) return (EADDRNOTAVAIL); ifp = ifnet_byindex(mreq.ipv6mr_interface); } @@ -2198,7 +2197,7 @@ in6p_leave_group(struct inpcb *inp, stru * XXX SCOPE6 lock potentially taken here. */ if (ifindex != 0) { - if (ifindex < 0 || V_if_index < ifindex) + if (V_if_index < ifindex) return (EADDRNOTAVAIL); ifp = ifnet_byindex(ifindex); if (ifp == NULL) @@ -2356,7 +2355,7 @@ in6p_set_multicast_if(struct inpcb *inp, error = sooptcopyin(sopt, &ifindex, sizeof(u_int), sizeof(u_int)); if (error) return (error); - if (ifindex < 0 || V_if_index < ifindex) + if (V_if_index < ifindex) return (EINVAL); ifp = ifnet_byindex(ifindex); From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 20:10:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97EDB95E; Wed, 25 Dec 2013 20:10:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84A131FFC; Wed, 25 Dec 2013 20:10:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPKAHXw086541; Wed, 25 Dec 2013 20:10:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPKAHwN086539; Wed, 25 Dec 2013 20:10:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201312252010.rBPKAHwN086539@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 25 Dec 2013 20:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259885 - head/sys/security/mac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 20:10:17 -0000 Author: bz Date: Wed Dec 25 20:10:17 2013 New Revision: 259885 URL: http://svnweb.freebsd.org/changeset/base/259885 Log: As constantly reported during kernel compilation, m_buflen is unsigned so can never be < 0. Remove the expression, which can never be true. MFC after: 1 week Modified: head/sys/security/mac/mac_framework.c Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Wed Dec 25 20:08:44 2013 (r259884) +++ head/sys/security/mac/mac_framework.c Wed Dec 25 20:10:17 2013 (r259885) @@ -586,8 +586,7 @@ int mac_check_structmac_consistent(struct mac *mac) { - if (mac->m_buflen < 0 || - mac->m_buflen > MAC_MAX_LABEL_BUF_LEN) + if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN) return (EINVAL); return (0); From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 20:15:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93DB4C7B; Wed, 25 Dec 2013 20:15:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F5911026; Wed, 25 Dec 2013 20:15:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPKFma2089585; Wed, 25 Dec 2013 20:15:48 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPKFmsT089584; Wed, 25 Dec 2013 20:15:48 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201312252015.rBPKFmsT089584@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 25 Dec 2013 20:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259886 - head/sys/dev/ie X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 20:15:48 -0000 Author: bz Date: Wed Dec 25 20:15:48 2013 New Revision: 259886 URL: http://svnweb.freebsd.org/changeset/base/259886 Log: Bite the bullet and start removing the first compile time warnings by removing unsued file local functions and then unused callees. A lot more warnings to resolve but someone had to break the ice. MFC after: 10 days X-Comment: I am not the new maintainer; chime in, it's ours. Modified: head/sys/dev/ie/if_ie.c Modified: head/sys/dev/ie/if_ie.c ============================================================================== --- head/sys/dev/ie/if_ie.c Wed Dec 25 20:10:17 2013 (r259885) +++ head/sys/dev/ie/if_ie.c Wed Dec 25 20:15:48 2013 (r259886) @@ -173,17 +173,12 @@ static void iestart_locked (struct ifne static __inline void ee16_interrupt_enable (struct ie_softc *); -static void ee16_eeprom_outbits (struct ie_softc *, int, int); -static void ee16_eeprom_clock (struct ie_softc *, int); -static u_short ee16_read_eeprom (struct ie_softc *, int); -static int ee16_eeprom_inbits (struct ie_softc *); static __inline void ie_ack (struct ie_softc *, u_int); static void iereset (struct ie_softc *); static void ie_readframe (struct ie_softc *, int); static void ie_drop_packet_buffer (struct ie_softc *); -static void find_ie_mem_size (struct ie_softc *); static int command_and_wait (struct ie_softc *, int, void volatile *, int); static void run_tdr (struct ie_softc *, @@ -1091,26 +1086,6 @@ check_ie_present(struct ie_softc *sc) return (1); } -/* - * Divine the memory size of ie board UNIT. - * Better hope there's nothing important hiding just below the ie card... - */ -static void -find_ie_mem_size(struct ie_softc *sc) -{ - unsigned size; - - sc->iosize = 0; - - for (size = 65536; size >= 8192; size -= 8192) { - if (check_ie_present(sc)) { - return; - } - } - - return; -} - void el_reset_586(struct ie_softc *sc) { @@ -1153,82 +1128,6 @@ ee16_chan_attn(struct ie_softc *sc) outb(PORT(sc) + IEE16_ATTN, 0); } -u_short -ee16_read_eeprom(struct ie_softc *sc, int location) -{ - int ectrl, edata; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= IEE16_ECTRL_MASK; - ectrl |= IEE16_ECTRL_EECS; - outb(sc->port + IEE16_ECTRL, ectrl); - - ee16_eeprom_outbits(sc, IEE16_EEPROM_READ, IEE16_EEPROM_OPSIZE1); - ee16_eeprom_outbits(sc, location, IEE16_EEPROM_ADDR_SIZE); - edata = ee16_eeprom_inbits(sc); - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~(IEE16_RESET_ASIC | IEE16_ECTRL_EEDI | IEE16_ECTRL_EECS); - outb(sc->port + IEE16_ECTRL, ectrl); - ee16_eeprom_clock(sc, 1); - ee16_eeprom_clock(sc, 0); - return edata; -} - -static void -ee16_eeprom_outbits(struct ie_softc *sc, int edata, int count) -{ - int ectrl, i; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~IEE16_RESET_ASIC; - for (i = count - 1; i >= 0; i--) { - ectrl &= ~IEE16_ECTRL_EEDI; - if (edata & (1 << i)) { - ectrl |= IEE16_ECTRL_EEDI; - } - outb(sc->port + IEE16_ECTRL, ectrl); - DELAY(1); /* eeprom data must be setup for 0.4 uSec */ - ee16_eeprom_clock(sc, 1); - ee16_eeprom_clock(sc, 0); - } - ectrl &= ~IEE16_ECTRL_EEDI; - outb(sc->port + IEE16_ECTRL, ectrl); - DELAY(1); /* eeprom data must be held for 0.4 uSec */ -} - -static int -ee16_eeprom_inbits(struct ie_softc *sc) -{ - int ectrl, edata, i; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~IEE16_RESET_ASIC; - for (edata = 0, i = 0; i < 16; i++) { - edata = edata << 1; - ee16_eeprom_clock(sc, 1); - ectrl = inb(sc->port + IEE16_ECTRL); - if (ectrl & IEE16_ECTRL_EEDO) { - edata |= 1; - } - ee16_eeprom_clock(sc, 0); - } - return (edata); -} - -static void -ee16_eeprom_clock(struct ie_softc *sc, int state) -{ - int ectrl; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~(IEE16_RESET_ASIC | IEE16_ECTRL_EESK); - if (state) { - ectrl |= IEE16_ECTRL_EESK; - } - outb(sc->port + IEE16_ECTRL, ectrl); - DELAY(9); /* EESK must be stable for 8.38 uSec */ -} - static __inline void ee16_interrupt_enable(struct ie_softc *sc) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 20:26:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B41BB28F; Wed, 25 Dec 2013 20:26:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9F30110CD; Wed, 25 Dec 2013 20:26:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPKQnMm093613; Wed, 25 Dec 2013 20:26:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPKQn0c093612; Wed, 25 Dec 2013 20:26:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201312252026.rBPKQn0c093612@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 25 Dec 2013 20:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259887 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 20:26:49 -0000 Author: bz Date: Wed Dec 25 20:26:49 2013 New Revision: 259887 URL: http://svnweb.freebsd.org/changeset/base/259887 Log: Add more (IPv6) related Internet Protocols: - Host Identity Protocol (RFC5201) - Shim6 Protocol (RFC5533) - 2x experimentation and testing (RFC3692, RFC4727) This does not indicate interest to implement/support these protocols, but they are part of the "IPv6 Extension Header Types" [1] based on RFC7045 and might thus be needed by filtering and next header parsing implementations. References: [1] http://www.iana.org/assignments/ipv6-parameters Obtained from: http://www.iana.org/assignments/protocol-numbers MFC after: 1 week Modified: head/sys/netinet/in.h Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Wed Dec 25 20:15:48 2013 (r259886) +++ head/sys/netinet/in.h Wed Dec 25 20:26:49 2013 (r259887) @@ -237,12 +237,16 @@ __END_DECLS #define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */ #define IPPROTO_SCTP 132 /* SCTP */ #define IPPROTO_MH 135 /* IPv6 Mobility Header */ +#define IPPROTO_HIP 139 /* IP6 Host Identity Protocol */ +#define IPPROTO_SHIM6 140 /* IP6 Shim6 Protocol */ /* 101-254: Partly Unassigned */ #define IPPROTO_PIM 103 /* Protocol Independent Mcast */ #define IPPROTO_CARP 112 /* CARP */ #define IPPROTO_PGM 113 /* PGM */ #define IPPROTO_MPLS 137 /* MPLS-in-IP */ #define IPPROTO_PFSYNC 240 /* PFSYNC */ +#define IPPROTO_RESERVED_253 253 /* Reserved */ +#define IPPROTO_RESERVED_254 254 /* Reserved */ /* 255: Reserved */ /* BSD Private, local use, namespace incursion, no longer used */ #define IPPROTO_OLD_DIVERT 254 /* OLD divert pseudo-proto */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 20:58:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86517591; Wed, 25 Dec 2013 20:58:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 59A8E125E; Wed, 25 Dec 2013 20:58:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPKw3PB005208; Wed, 25 Dec 2013 20:58:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPKw3De005207; Wed, 25 Dec 2013 20:58:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312252058.rBPKw3De005207@svn.freebsd.org> From: Dimitry Andric Date: Wed, 25 Dec 2013 20:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259888 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 20:58:03 -0000 Author: dim Date: Wed Dec 25 20:58:02 2013 New Revision: 259888 URL: http://svnweb.freebsd.org/changeset/base/259888 Log: Pull in r183971 from upstream llvm trunk: X86: cvtpi2ps is just an SSE instruction with MMX operands. It has no AVX equivalent. Give it the right register format so we can also emit it when AVX is enabled. This should fix a "Cannot select: intrinsic %llvm.x86.sse.cvtpi2ps" fatal error in clang while building the gnuradio port for amd64. Reported by: db MFC after: 3 days Modified: head/contrib/llvm/lib/Target/X86/X86InstrMMX.td Modified: head/contrib/llvm/lib/Target/X86/X86InstrMMX.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrMMX.td Wed Dec 25 20:26:49 2013 (r259887) +++ head/contrib/llvm/lib/Target/X86/X86InstrMMX.td Wed Dec 25 20:58:02 2013 (r259888) @@ -189,13 +189,14 @@ multiclass sse12_cvt_pint opc, R multiclass sse12_cvt_pint_3addr opc, RegisterClass SrcRC, RegisterClass DstRC, Intrinsic Int, X86MemOperand x86memop, PatFrag ld_frag, string asm, Domain d> { - def irr : PI; - def irm : PI; + def irr : MMXPI; + def irm : MMXPI; } //===----------------------------------------------------------------------===// From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 22:14:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C0D388D; Wed, 25 Dec 2013 22:14:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 280D51785; Wed, 25 Dec 2013 22:14:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPMEh3U035302; Wed, 25 Dec 2013 22:14:43 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPMEhbn035301; Wed, 25 Dec 2013 22:14:43 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312252214.rBPMEhbn035301@svn.freebsd.org> From: Dimitry Andric Date: Wed, 25 Dec 2013 22:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259892 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 22:14:43 -0000 Author: dim Date: Wed Dec 25 22:14:42 2013 New Revision: 259892 URL: http://svnweb.freebsd.org/changeset/base/259892 Log: In sys/kern/vfs_mountroot.c, remove static function parse_isspace(), which is unused since r214006. MFC after: 3 days Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Wed Dec 25 22:00:25 2013 (r259891) +++ head/sys/kern/vfs_mountroot.c Wed Dec 25 22:14:42 2013 (r259892) @@ -389,13 +389,6 @@ parse_advance(char **conf) (*conf)++; } -static __inline int -parse_isspace(int c) -{ - - return ((c == ' ' || c == '\t' || c == '\n') ? 1 : 0); -} - static int parse_skipto(char **conf, int mc) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 22:32:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88211AD8; Wed, 25 Dec 2013 22:32:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7297B1895; Wed, 25 Dec 2013 22:32:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPMWZAT042377; Wed, 25 Dec 2013 22:32:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPMWZ6a042376; Wed, 25 Dec 2013 22:32:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312252232.rBPMWZ6a042376@svn.freebsd.org> From: Dimitry Andric Date: Wed, 25 Dec 2013 22:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259893 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 22:32:35 -0000 Author: dim Date: Wed Dec 25 22:32:34 2013 New Revision: 259893 URL: http://svnweb.freebsd.org/changeset/base/259893 Log: In sys/vm/vm_pageout.c, since vm_pageout_worker() takes a void * as argument, cast the incoming 0 argument to void *, to silence a warning from clang 3.4 ("expression which evaluates to zero treated as a null pointer constant of type 'void *' [-Wnon-literal-null-conversion]"). MFC after: 3 days Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Dec 25 22:14:42 2013 (r259892) +++ head/sys/vm/vm_pageout.c Wed Dec 25 22:32:34 2013 (r259893) @@ -1699,7 +1699,7 @@ vm_pageout(void) } } #endif - vm_pageout_worker((uintptr_t)0); + vm_pageout_worker((void *)(uintptr_t)0); } /* From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 22:45:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30443FFC; Wed, 25 Dec 2013 22:45:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C3E1194B; Wed, 25 Dec 2013 22:45:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPMjX51046557; Wed, 25 Dec 2013 22:45:33 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPMjX5J046556; Wed, 25 Dec 2013 22:45:33 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312252245.rBPMjX5J046556@svn.freebsd.org> From: Dimitry Andric Date: Wed, 25 Dec 2013 22:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259896 - head/sys/dev/cxgb/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 22:45:34 -0000 Author: dim Date: Wed Dec 25 22:45:33 2013 New Revision: 259896 URL: http://svnweb.freebsd.org/changeset/base/259896 Log: In sys/dev/cxgb/common/cxgb_mc5.c, remove static function dbgi_wr_addr3(), which is unused since r167514. MFC after: 3 days Modified: head/sys/dev/cxgb/common/cxgb_mc5.c Modified: head/sys/dev/cxgb/common/cxgb_mc5.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_mc5.c Wed Dec 25 22:36:27 2013 (r259895) +++ head/sys/dev/cxgb/common/cxgb_mc5.c Wed Dec 25 22:45:33 2013 (r259896) @@ -98,13 +98,6 @@ static int mc5_cmd_write(adapter_t *adap F_DBGIRSPVALID, 1, MAX_WRITE_ATTEMPTS, 1); } -static inline void dbgi_wr_addr3(adapter_t *adapter, u32 v1, u32 v2, u32 v3) -{ - t3_write_reg(adapter, A_MC5_DB_DBGI_REQ_ADDR0, v1); - t3_write_reg(adapter, A_MC5_DB_DBGI_REQ_ADDR1, v2); - t3_write_reg(adapter, A_MC5_DB_DBGI_REQ_ADDR2, v3); -} - static inline void dbgi_wr_data3(adapter_t *adapter, u32 v1, u32 v2, u32 v3) { t3_write_reg(adapter, A_MC5_DB_DBGI_REQ_DATA0, v1); From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 22:49:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7F3A1F3; Wed, 25 Dec 2013 22:49:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 790921965; Wed, 25 Dec 2013 22:49:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPMntu6047048; Wed, 25 Dec 2013 22:49:55 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPMntl1047047; Wed, 25 Dec 2013 22:49:55 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312252249.rBPMntl1047047@svn.freebsd.org> From: Dimitry Andric Date: Wed, 25 Dec 2013 22:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259897 - head/sys/dev/cxgb/ulp/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 22:49:55 -0000 Author: dim Date: Wed Dec 25 22:49:54 2013 New Revision: 259897 URL: http://svnweb.freebsd.org/changeset/base/259897 Log: In sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c, remove static functions mk_cpl_barrier_ulp(), mk_get_tcb_ulp() and mk_set_tcb_field_ulp(), which are all unused since r237263. MFC after: 3 days Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Dec 25 22:45:33 2013 (r259896) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Dec 25 22:49:54 2013 (r259897) @@ -1795,53 +1795,6 @@ do_wr_ack(struct sge_qset *qs, struct rs return (0); } -/* - * Build a CPL_BARRIER message as payload of a ULP_TX_PKT command. - */ -static inline void -mk_cpl_barrier_ulp(struct cpl_barrier *b) -{ - struct ulp_txpkt *txpkt = (struct ulp_txpkt *)b; - - txpkt->cmd_dest = htonl(V_ULPTX_CMD(ULP_TXPKT)); - txpkt->len = htonl(V_ULPTX_NFLITS(sizeof(*b) / 8)); - b->opcode = CPL_BARRIER; -} - -/* - * Build a CPL_GET_TCB message as payload of a ULP_TX_PKT command. - */ -static inline void -mk_get_tcb_ulp(struct cpl_get_tcb *req, unsigned int tid, unsigned int cpuno) -{ - struct ulp_txpkt *txpkt = (struct ulp_txpkt *)req; - - txpkt = (struct ulp_txpkt *)req; - txpkt->cmd_dest = htonl(V_ULPTX_CMD(ULP_TXPKT)); - txpkt->len = htonl(V_ULPTX_NFLITS(sizeof(*req) / 8)); - OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_GET_TCB, tid)); - req->cpuno = htons(cpuno); -} - -/* - * Build a CPL_SET_TCB_FIELD message as payload of a ULP_TX_PKT command. - */ -static inline void -mk_set_tcb_field_ulp(struct cpl_set_tcb_field *req, unsigned int tid, - unsigned int word, uint64_t mask, uint64_t val) -{ - struct ulp_txpkt *txpkt = (struct ulp_txpkt *)req; - - txpkt->cmd_dest = htonl(V_ULPTX_CMD(ULP_TXPKT)); - txpkt->len = htonl(V_ULPTX_NFLITS(sizeof(*req) / 8)); - OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid)); - req->reply = V_NO_REPLY(1); - req->cpu_idx = 0; - req->word = htons(word); - req->mask = htobe64(mask); - req->val = htobe64(val); -} - void t3_init_cpl_io(struct adapter *sc) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 23:15:13 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ED3669C; Wed, 25 Dec 2013 23:15:13 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F6051B23; Wed, 25 Dec 2013 23:15:12 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VvxQX-00018J-QK; Wed, 25 Dec 2013 22:59:45 +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 rBPMxhVf007116; Wed, 25 Dec 2013 15:59:43 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18n2oky8YWULJmf1WJrbGsX Subject: Re: svn commit: r259893 - head/sys/vm From: Ian Lepore To: Dimitry Andric In-Reply-To: <201312252232.rBPMWZ6a042376@svn.freebsd.org> References: <201312252232.rBPMWZ6a042376@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Wed, 25 Dec 2013 15:59:42 -0700 Message-ID: <1388012382.1158.128.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 23:15:13 -0000 On Wed, 2013-12-25 at 22:32 +0000, Dimitry Andric wrote: > Author: dim > Date: Wed Dec 25 22:32:34 2013 > New Revision: 259893 > URL: http://svnweb.freebsd.org/changeset/base/259893 > > Log: > In sys/vm/vm_pageout.c, since vm_pageout_worker() takes a void * as > argument, cast the incoming 0 argument to void *, to silence a warning > from clang 3.4 ("expression which evaluates to zero treated as a null > pointer constant of type 'void *' [-Wnon-literal-null-conversion]"). > > MFC after: 3 days > > Modified: > head/sys/vm/vm_pageout.c > > Modified: head/sys/vm/vm_pageout.c > ============================================================================== > --- head/sys/vm/vm_pageout.c Wed Dec 25 22:14:42 2013 (r259892) > +++ head/sys/vm/vm_pageout.c Wed Dec 25 22:32:34 2013 (r259893) > @@ -1699,7 +1699,7 @@ vm_pageout(void) > } > } > #endif > - vm_pageout_worker((uintptr_t)0); > + vm_pageout_worker((void *)(uintptr_t)0); > } > > /* Why isn't the fix for this just vm_pageout_worker(NULL); ? -- Ian From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 23:26:45 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 317829C2; Wed, 25 Dec 2013 23:26:45 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF6631CC9; Wed, 25 Dec 2013 23:26:44 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::559:dc8f:9307:627e] (unknown [IPv6:2001:7b8:3a7:0:559:dc8f:9307:627e]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A141D5C43; Thu, 26 Dec 2013 00:26:41 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_9C59DB62-B4DA-4A82-A008-1F846AC7BE49"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r259893 - head/sys/vm From: Dimitry Andric In-Reply-To: <1388012382.1158.128.camel@revolution.hippie.lan> Date: Thu, 26 Dec 2013 00:26:25 +0100 Message-Id: References: <201312252232.rBPMWZ6a042376@svn.freebsd.org> <1388012382.1158.128.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 23:26:45 -0000 --Apple-Mail=_9C59DB62-B4DA-4A82-A008-1F846AC7BE49 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 25 Dec 2013, at 23:59, Ian Lepore wrote: > On Wed, 2013-12-25 at 22:32 +0000, Dimitry Andric wrote: >> Author: dim >> Date: Wed Dec 25 22:32:34 2013 >> New Revision: 259893 >> URL: http://svnweb.freebsd.org/changeset/base/259893 >>=20 >> Log: >> In sys/vm/vm_pageout.c, since vm_pageout_worker() takes a void * as >> argument, cast the incoming 0 argument to void *, to silence a = warning >> from clang 3.4 ("expression which evaluates to zero treated as a = null >> pointer constant of type 'void *' [-Wnon-literal-null-conversion]"). >>=20 >> MFC after: 3 days >>=20 >> Modified: >> head/sys/vm/vm_pageout.c >>=20 >> Modified: head/sys/vm/vm_pageout.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/vm/vm_pageout.c Wed Dec 25 22:14:42 2013 = (r259892) >> +++ head/sys/vm/vm_pageout.c Wed Dec 25 22:32:34 2013 = (r259893) >> @@ -1699,7 +1699,7 @@ vm_pageout(void) >> } >> } >> #endif >> - vm_pageout_worker((uintptr_t)0); >> + vm_pageout_worker((void *)(uintptr_t)0); >> } >>=20 >> /* >=20 > Why isn't the fix for this just vm_pageout_worker(NULL); ? Because the argument is meant as a literal zero, in this case. The vm_pageout_worker() function only has a void * argument, because it is used as a thread function for kthread_add(9); see just a few lines above: error =3D kthread_add(vm_pageout_worker, (void = *)(uintptr_t)i, [...] Upon entry to vm_pageout_worker(), the incoming 'pointer' is immediately converted back into an intptr_t: static void vm_pageout_worker(void *arg) { struct vm_domain *domain; int domidx; domidx =3D (uintptr_t)arg; [...] -Dimitry --Apple-Mail=_9C59DB62-B4DA-4A82-A008-1F846AC7BE49 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlK7aagACgkQsF6jCi4glqPcfwCg03UHkMblSxl2AgiU6fuexbH6 EIMAoPc8QIAn0Jne12KKWo35W2FiSUSd =dOz+ -----END PGP SIGNATURE----- --Apple-Mail=_9C59DB62-B4DA-4A82-A008-1F846AC7BE49-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 00:11:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CB5A9DD; Thu, 26 Dec 2013 00:11:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4FFB71F71; Thu, 26 Dec 2013 00:11:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQ0BKa2081863; Thu, 26 Dec 2013 00:11:20 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQ0BKax081862; Thu, 26 Dec 2013 00:11:20 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312260011.rBQ0BKax081862@svn.freebsd.org> From: Dimitry Andric Date: Thu, 26 Dec 2013 00:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259902 - head/sys/dev/drm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 00:11:20 -0000 Author: dim Date: Thu Dec 26 00:11:19 2013 New Revision: 259902 URL: http://svnweb.freebsd.org/changeset/base/259902 Log: In sys/dev/drm/mach64_dma.c, remove static function mach64_set_dma_eol(), which has never been used, even by upstream, since its initial upstream commit (see http://cgit.freedesktop.org/mesa/drm/commit/?id=873e1c4d ) MFC after: 3 days Modified: head/sys/dev/drm/mach64_dma.c Modified: head/sys/dev/drm/mach64_dma.c ============================================================================== --- head/sys/dev/drm/mach64_dma.c Thu Dec 26 00:05:31 2013 (r259901) +++ head/sys/dev/drm/mach64_dma.c Thu Dec 26 00:11:19 2013 (r259902) @@ -559,54 +559,6 @@ void mach64_dump_ring_info(drm_mach64_pr /*@{*/ /** - * Add the end mark to the ring's new tail position. - * - * The bus master engine will keep processing the DMA buffers listed in the ring - * until it finds this mark, making it stop. - * - * \sa mach64_clear_dma_eol - */ -static __inline__ void mach64_set_dma_eol(volatile u32 *addr) -{ -#if defined(__i386__) - int nr = 31; - - /* Taken from include/asm-i386/bitops.h linux header */ - __asm__ __volatile__("lock;" "btsl %1,%0":"=m"(*addr) - :"Ir"(nr)); -#elif defined(__powerpc__) - u32 old; - u32 mask = cpu_to_le32(MACH64_DMA_EOL); - - /* Taken from the include/asm-ppc/bitops.h linux header */ - __asm__ __volatile__("\n\ -1: lwarx %0,0,%3 \n\ - or %0,%0,%2 \n\ - stwcx. %0,0,%3 \n\ - bne- 1b":"=&r"(old), "=m"(*addr) - :"r"(mask), "r"(addr), "m"(*addr) - :"cc"); -#elif defined(__alpha__) - u32 temp; - u32 mask = MACH64_DMA_EOL; - - /* Taken from the include/asm-alpha/bitops.h linux header */ - __asm__ __volatile__("1: ldl_l %0,%3\n" - " bis %0,%2,%0\n" - " stl_c %0,%1\n" - " beq %0,2f\n" - ".subsection 2\n" - "2: br 1b\n" - ".previous":"=&r"(temp), "=m"(*addr) - :"Ir"(mask), "m"(*addr)); -#else - u32 mask = cpu_to_le32(MACH64_DMA_EOL); - - *addr |= mask; -#endif -} - -/** * Remove the end mark from the ring's old tail position. * * It should be called after calling mach64_set_dma_eol to mark the ring's new From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 01:51:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34A0D3C6; Thu, 26 Dec 2013 01:51:16 +0000 (UTC) Received: from mail-qe0-x234.google.com (mail-qe0-x234.google.com [IPv6:2607:f8b0:400d:c02::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B385414A7; Thu, 26 Dec 2013 01:51:15 +0000 (UTC) Received: by mail-qe0-f52.google.com with SMTP id ne12so7669680qeb.11 for ; Wed, 25 Dec 2013 17:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=bldE/JiDiBwjh05/qG/kMkXmMQ5PfekuYQeCc+cJvv8=; b=ipXIxuinxRFhTNOlJ0V1lhi066sMhpmucGdIHGNFNs2y7IaCXXDYTsxCuEVi7XX+HX gJCtkldRGecw7+v1LiLDqcZ02d72WhxLjzW9M05UgB9lDmwKPfe7DTUa8njZR7YpTu6r lox8s8JUlVCSHWyJYHvGVifO+q4/KjQXqy/XQlk7tI/Ws7FJvnEQoixbuhYMm9ETq6aE 0W+CSrKG1th76gaQZPBTQGEqFb7JTYfyv5nI53oPmVTqlQnPkLo5xtpaQsMLEjainiZm dUaPHH/5TXHvptLe2YL7TzZwASMGJsbSPuY0kdPeRQUHzMPa7XDNfFrhmRjAdDWuX1wd bb9Q== MIME-Version: 1.0 X-Received: by 10.49.34.207 with SMTP id b15mr67581708qej.49.1388022674840; Wed, 25 Dec 2013 17:51:14 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Wed, 25 Dec 2013 17:51:14 -0800 (PST) In-Reply-To: <201312252245.rBPMjX5J046556@svn.freebsd.org> References: <201312252245.rBPMjX5J046556@svn.freebsd.org> Date: Wed, 25 Dec 2013 17:51:14 -0800 X-Google-Sender-Auth: 6CvOiXzgvDdvp1icsriHpW8HbrQ Message-ID: Subject: Re: svn commit: r259896 - head/sys/dev/cxgb/common From: Adrian Chadd To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 01:51:16 -0000 Hi Dim, I'd prefer you didn't remove unused code in drivers like this. If you must, #if 0 them out. Future people hacking on the driver may find it nice to have as much code in there which talks to the hardware. It may not be currently called, but it's at least there. Thanks, -adrian On 25 December 2013 14:45, Dimitry Andric wrote: > Author: dim > Date: Wed Dec 25 22:45:33 2013 > New Revision: 259896 > URL: http://svnweb.freebsd.org/changeset/base/259896 > > Log: > In sys/dev/cxgb/common/cxgb_mc5.c, remove static function > dbgi_wr_addr3(), which is unused since r167514. > > MFC after: 3 days > > Modified: > head/sys/dev/cxgb/common/cxgb_mc5.c > > Modified: head/sys/dev/cxgb/common/cxgb_mc5.c > ============================================================================== > --- head/sys/dev/cxgb/common/cxgb_mc5.c Wed Dec 25 22:36:27 2013 (r259895) > +++ head/sys/dev/cxgb/common/cxgb_mc5.c Wed Dec 25 22:45:33 2013 (r259896) > @@ -98,13 +98,6 @@ static int mc5_cmd_write(adapter_t *adap > F_DBGIRSPVALID, 1, MAX_WRITE_ATTEMPTS, 1); > } > > -static inline void dbgi_wr_addr3(adapter_t *adapter, u32 v1, u32 v2, u32 v3) > -{ > - t3_write_reg(adapter, A_MC5_DB_DBGI_REQ_ADDR0, v1); > - t3_write_reg(adapter, A_MC5_DB_DBGI_REQ_ADDR1, v2); > - t3_write_reg(adapter, A_MC5_DB_DBGI_REQ_ADDR2, v3); > -} > - > static inline void dbgi_wr_data3(adapter_t *adapter, u32 v1, u32 v2, u32 v3) > { > t3_write_reg(adapter, A_MC5_DB_DBGI_REQ_DATA0, v1); From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 03:19:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1266AEF; Thu, 26 Dec 2013 03:19:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CBE0E197A; Thu, 26 Dec 2013 03:19:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQ3J8L3055363; Thu, 26 Dec 2013 03:19:08 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQ3J8l4055361; Thu, 26 Dec 2013 03:19:08 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201312260319.rBQ3J8l4055361@svn.freebsd.org> From: Mark Johnston Date: Thu, 26 Dec 2013 03:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259905 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 03:19:09 -0000 Author: markj Date: Thu Dec 26 03:19:08 2013 New Revision: 259905 URL: http://svnweb.freebsd.org/changeset/base/259905 Log: Remove some unneeded declarations which should have been removed in r257037. Modified: head/sys/sys/dtrace_bsd.h Modified: head/sys/sys/dtrace_bsd.h ============================================================================== --- head/sys/sys/dtrace_bsd.h Thu Dec 26 01:12:35 2013 (r259904) +++ head/sys/sys/dtrace_bsd.h Thu Dec 26 03:19:08 2013 (r259905) @@ -38,8 +38,6 @@ struct thread; struct vattr; struct vnode; struct reg; -struct devstat; -struct bio; /* * Cyclic clock function type definition used to hook the cyclic @@ -168,23 +166,6 @@ extern dtrace_nfsclient_nfs23_done_probe extern dtrace_nfsclient_nfs23_done_probe_func_t dtrace_nfscl_nfs234_done_probe; -/* IO Provider hooks, really hook into devstat */ -typedef void (*dtrace_io_start_probe_func_t)(uint32_t, struct bio *, - struct devstat *); -extern dtrace_io_start_probe_func_t dtrace_io_start_probe; - -typedef void (*dtrace_io_done_probe_func_t)(uint32_t, struct bio *, - struct devstat *); -extern dtrace_io_done_probe_func_t dtrace_io_done_probe; - -typedef void (*dtrace_io_wait_start_probe_func_t)(uint32_t, uintptr_t *, - struct devstat *); -extern dtrace_io_wait_start_probe_func_t dtrace_io_wait_start_probe; - -typedef void (*dtrace_io_wait_done_probe_func_t)(uint32_t, uintptr_t *, - struct devstat *); -extern dtrace_io_wait_done_probe_func_t dtrace_io_wait_done_probe; - /* * Functions which allow the dtrace module to check that the kernel * hooks have been compiled with sufficient space for it's private From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 04:24:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 088EA78; Thu, 26 Dec 2013 04:24:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E800D1E18; Thu, 26 Dec 2013 04:24:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQ4O8VZ080273; Thu, 26 Dec 2013 04:24:08 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQ4O8JW080272; Thu, 26 Dec 2013 04:24:08 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312260424.rBQ4O8JW080272@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 26 Dec 2013 04:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259906 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 04:24:09 -0000 Author: pluknet Date: Thu Dec 26 04:24:08 2013 New Revision: 259906 URL: http://svnweb.freebsd.org/changeset/base/259906 Log: Draft-ietf-tcpm-initcwnd-05 became RFC6928. MFC after: 1 week Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Dec 26 03:19:08 2013 (r259905) +++ head/sys/netinet/tcp_input.c Thu Dec 26 04:24:08 2013 (r259906) @@ -162,7 +162,7 @@ SYSCTL_NODE(_net_inet_tcp, OID_AUTO, exp VNET_DEFINE(int, tcp_do_initcwnd10) = 1; SYSCTL_VNET_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_RW, &VNET_NAME(tcp_do_initcwnd10), 0, - "Enable draft-ietf-tcpm-initcwnd-05 (Increasing initial CWND to 10)"); + "Enable RFC 6928 (Increasing initial CWND to 10)"); VNET_DEFINE(int, tcp_do_rfc3465) = 1; SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW, @@ -360,7 +360,7 @@ cc_conn_init(struct tcpcb *tp) * * RFC5681 Section 3.1 specifies the default conservative values. * RFC3390 specifies slightly more aggressive values. - * Draft-ietf-tcpm-initcwnd-05 increases it to ten segments. + * RFC6928 increases it to ten segments. * * If a SYN or SYN/ACK was lost and retransmitted, we have to * reduce the initial CWND to one segment as congestion is likely From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 05:22:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2586959D; Thu, 26 Dec 2013 05:22:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 124451101; Thu, 26 Dec 2013 05:22:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQ5McAY002010; Thu, 26 Dec 2013 05:22:38 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQ5McUS002009; Thu, 26 Dec 2013 05:22:38 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201312260522.rBQ5McUS002009@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 26 Dec 2013 05:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259907 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 05:22:39 -0000 Author: luigi Date: Thu Dec 26 05:22:38 2013 New Revision: 259907 URL: http://svnweb.freebsd.org/changeset/base/259907 Log: use the correct netmap <-> nic slot mapping on the transmit ring for 'lem'. This bug would manifest only in netmap mode and on packets transmitted after a NIC reset while netmap mode is active. MFC after: 3 days Modified: head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Thu Dec 26 04:24:08 2013 (r259906) +++ head/sys/dev/e1000/if_lem.c Thu Dec 26 05:22:38 2013 (r259907) @@ -2679,7 +2679,7 @@ lem_setup_transmit_structures(struct ada void *addr; addr = PNMB(slot + si, &paddr); - adapter->tx_desc_base[si].buffer_addr = htole64(paddr); + adapter->tx_desc_base[i].buffer_addr = htole64(paddr); /* reload the map for netmap mode */ netmap_load_map(adapter->txtag, tx_buffer->map, addr); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 05:46:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4426896; Thu, 26 Dec 2013 05:46:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 904C81223; Thu, 26 Dec 2013 05:46:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQ5kAAh009799; Thu, 26 Dec 2013 05:46:10 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQ5kAoJ009798; Thu, 26 Dec 2013 05:46:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312260546.rBQ5kAoJ009798@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 26 Dec 2013 05:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259908 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 05:46:10 -0000 Author: marcel Date: Thu Dec 26 05:46:10 2013 New Revision: 259908 URL: http://svnweb.freebsd.org/changeset/base/259908 Log: For ia64, use pmap_remove_pages() and not pmap_remove(). The problem is that we don't have a good way (yet) to iterate over the mapped pages by virtual address and simply try each page within the range. Given that we call pmap_remove() over the entire 2^63 bytes of address space, it takes a while for pmap_remove to have tried all 2^50 pages. By using pmap_remove_pages() we use the PV list to find all mappings. Change derived from a patch by: alc Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Dec 26 05:22:38 2013 (r259907) +++ head/sys/vm/vm_pageout.c Thu Dec 26 05:46:10 2013 (r259908) @@ -875,6 +875,14 @@ vm_pageout_map_deactivate_pages(map, des tmpe = tmpe->next; } +#ifdef __ia64__ + /* + * Remove all non-wired, managed mappings if a process is swapped out. + * This will free page table pages. + */ + if (desired == 0) + pmap_remove_pages(map->pmap); +#else /* * Remove all mappings if a process is swapped out, this will free page * table pages. @@ -883,6 +891,8 @@ vm_pageout_map_deactivate_pages(map, des pmap_remove(vm_map_pmap(map), vm_map_min(map), vm_map_max(map)); } +#endif + vm_map_unlock(map); } #endif /* !defined(NO_SWAPPING) */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 07:10:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58C38711; Thu, 26 Dec 2013 07:10:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 450E917AC; Thu, 26 Dec 2013 07:10:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQ7AtJv042028; Thu, 26 Dec 2013 07:10:55 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQ7Attk042027; Thu, 26 Dec 2013 07:10:55 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312260710.rBQ7Attk042027@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 26 Dec 2013 07:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259910 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 07:10:55 -0000 Author: marcel Date: Thu Dec 26 07:10:54 2013 New Revision: 259910 URL: http://svnweb.freebsd.org/changeset/base/259910 Log: Fix "kptdir is itself virtual" error, caused by having the kptdir in PBVM. While here improve errors by having them include addresses (either virtual or physical). Modified: head/lib/libkvm/kvm_ia64.c Modified: head/lib/libkvm/kvm_ia64.c ============================================================================== --- head/lib/libkvm/kvm_ia64.c Thu Dec 26 05:54:58 2013 (r259909) +++ head/lib/libkvm/kvm_ia64.c Thu Dec 26 07:10:54 2013 (r259910) @@ -100,20 +100,23 @@ _kvm_pa2off(kvm_t *kd, uint64_t pa, off_ Elf64_Phdr *p = (Elf64_Phdr*)((char*)e + e->e_phoff); int n = e->e_phnum; - if (pa != REGION_ADDR(pa)) { - _kvm_err(kd, kd->program, "internal error"); - return (0); - } + if (pa != REGION_ADDR(pa)) + goto fail; while (n && (pa < p->p_paddr || pa >= p->p_paddr + p->p_memsz)) p++, n--; if (n == 0) - return (0); + goto fail; *ofs = (pa - p->p_paddr) + p->p_offset; if (pgsz == 0) return (p->p_memsz - (pa - p->p_paddr)); return (pgsz - ((size_t)pa & (pgsz - 1))); + + fail: + _kvm_err(kd, kd->program, "invalid physical address %#llx", + (unsigned long long)pa); + return (0); } static ssize_t @@ -225,7 +228,7 @@ _kvm_initvtop(kvm_t *kd) return (-1); } - if (va < REGION_BASE(6)) { + if (va == REGION_BASE(5)) { _kvm_err(kd, kd->program, "kptdir is itself virtual"); return (-1); } @@ -286,7 +289,8 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t } fail: - _kvm_err(kd, kd->program, "invalid kernel virtual address"); + _kvm_err(kd, kd->program, "invalid kernel virtual address %#llx", + (unsigned long long)va); *ofs = ~0UL; return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 11:13:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBF6CE4D; Thu, 26 Dec 2013 11:13:31 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8327516C0; Thu, 26 Dec 2013 11:13:31 +0000 (UTC) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 226E75C43; Thu, 26 Dec 2013 12:13:28 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_637353EF-78EA-4887-B074-A0582A619A1E"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r259896 - head/sys/dev/cxgb/common From: Dimitry Andric In-Reply-To: Date: Thu, 26 Dec 2013 12:13:17 +0100 Message-Id: <76C5CECF-1A27-4245-B5D1-335C46B253E7@FreeBSD.org> References: <201312252245.rBPMjX5J046556@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1827) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 11:13:31 -0000 --Apple-Mail=_637353EF-78EA-4887-B074-A0582A619A1E Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=iso-8859-1 On 26 Dec 2013, at 02:51, Adrian Chadd wrote: > I'd prefer you didn't remove unused code in drivers like this. If you > must, #if 0 them out. I don't mind either way, but some other people are very much opposed to littering code with #if 0'd sections. So, how do to determine what is right in each situation? :-) > Future people hacking on the driver may find it nice to have as much > code in there which talks to the hardware. It may not be currently > called, but it's at least there. In this particular case, the code has never been used, even when the file was originally committed, so I would say the chances of it ever being used again are near zero. (And even after deletion, the old versions are available in our repository.) For more "active" drivers, I will certainly just use #if, or simply turn off the -Wunused-function warning. And hope the code gets used eventually. :-) -Dimitry --Apple-Mail=_637353EF-78EA-4887-B074-A0582A619A1E Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlK8D1UACgkQsF6jCi4glqM0HwCeNoNZZ832zpI7e6O/LZCC65ML 97QAoIfvOAmGieRcxo8K2ZMdvG/6n6gQ =bgxR -----END PGP SIGNATURE----- --Apple-Mail=_637353EF-78EA-4887-B074-A0582A619A1E-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 11:32:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17D0D3CF; Thu, 26 Dec 2013 11:32:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01AA917F5; Thu, 26 Dec 2013 11:32:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQBWfhr042923; Thu, 26 Dec 2013 11:32:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQBWdCi042908; Thu, 26 Dec 2013 11:32:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312261132.rBQBWdCi042908@svn.freebsd.org> From: Dimitry Andric Date: Thu, 26 Dec 2013 11:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259913 - in head: lib/libstand sys/boot/ficl sys/boot/i386 sys/boot/i386/boot2 sys/boot/pc98 sys/boot/usb sys/boot/userboot/ficl sys/boot/userboot/libstand sys/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 11:32:42 -0000 Author: dim Date: Thu Dec 26 11:32:39 2013 New Revision: 259913 URL: http://svnweb.freebsd.org/changeset/base/259913 Log: For libstand and sys/boot, split off gcc-only flags into CFLAGS.gcc. MFC after: 3 days X-MFC-With: r259730 Modified: head/lib/libstand/Makefile head/sys/boot/ficl/Makefile head/sys/boot/i386/Makefile.inc head/sys/boot/i386/boot2/Makefile head/sys/boot/pc98/Makefile.inc head/sys/boot/usb/Makefile head/sys/boot/usb/Makefile.test head/sys/boot/userboot/ficl/Makefile head/sys/boot/userboot/libstand/Makefile head/sys/boot/zfs/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Thu Dec 26 10:45:17 2013 (r259912) +++ head/lib/libstand/Makefile Thu Dec 26 11:32:39 2013 (r259913) @@ -21,7 +21,7 @@ CFLAGS+= -ffreestanding -Wformat CFLAGS+= -I${.CURDIR} .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -mpreferred-stack-boundary=2 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif .if ${MACHINE} == "pc98" Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Thu Dec 26 10:45:17 2013 (r259912) +++ head/sys/boot/ficl/Makefile Thu Dec 26 11:32:39 2013 (r259913) @@ -17,7 +17,7 @@ CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" .if !defined(FICL64) CFLAGS+= -march=i386 -CFLAGS+= -mpreferred-stack-boundary=2 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif Modified: head/sys/boot/i386/Makefile.inc ============================================================================== --- head/sys/boot/i386/Makefile.inc Thu Dec 26 10:45:17 2013 (r259912) +++ head/sys/boot/i386/Makefile.inc Thu Dec 26 11:32:39 2013 (r259913) @@ -5,8 +5,9 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= -march=i386 -ffreestanding +CFLAGS.gcc+= -mpreferred-stack-boundary=2 +CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float LDFLAGS+= -nostdlib .if ${MACHINE_CPUARCH} == "amd64" Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Thu Dec 26 10:45:17 2013 (r259912) +++ head/sys/boot/i386/boot2/Makefile Thu Dec 26 11:32:39 2013 (r259913) @@ -23,10 +23,7 @@ BOOT2_UFS?= UFS1_AND_UFS2 #BOOT2_UFS?= UFS1_ONLY CFLAGS= -Os \ - -fno-guess-branch-probability \ -fomit-frame-pointer \ - -fno-unit-at-a-time \ - -mno-align-long-strings \ -mrtd \ -mregparm=3 \ -DUSE_XREAD \ @@ -43,6 +40,10 @@ CFLAGS= -Os \ -Winline --param max-inline-insns-single=100 \ ${CLANG_OPT_SMALL} +CFLAGS.gcc+= -fno-guess-branch-probability \ + -fno-unit-at-a-time \ + -mno-align-long-strings \ + LDFLAGS=-static -N --gc-sections # Pick up ../Makefile.inc early. Modified: head/sys/boot/pc98/Makefile.inc ============================================================================== --- head/sys/boot/pc98/Makefile.inc Thu Dec 26 10:45:17 2013 (r259912) +++ head/sys/boot/pc98/Makefile.inc Thu Dec 26 11:32:39 2013 (r259913) @@ -5,8 +5,9 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= -march=i386 -ffreestanding +CFLAGS.gcc+= -mpreferred-stack-boundary=2 +CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float CFLAGS+= -Os -DPC98 LDFLAGS+= -nostdlib Modified: head/sys/boot/usb/Makefile ============================================================================== --- head/sys/boot/usb/Makefile Thu Dec 26 10:45:17 2013 (r259912) +++ head/sys/boot/usb/Makefile Thu Dec 26 11:32:39 2013 (r259913) @@ -53,7 +53,7 @@ CFLAGS+= -g .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -march=i386 -CFLAGS+= -mpreferred-stack-boundary=2 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 Modified: head/sys/boot/usb/Makefile.test ============================================================================== --- head/sys/boot/usb/Makefile.test Thu Dec 26 10:45:17 2013 (r259912) +++ head/sys/boot/usb/Makefile.test Thu Dec 26 11:32:39 2013 (r259913) @@ -40,7 +40,7 @@ CFLAGS+= -g .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -march=i386 -CFLAGS+= -mpreferred-stack-boundary=2 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 Modified: head/sys/boot/userboot/ficl/Makefile ============================================================================== --- head/sys/boot/userboot/ficl/Makefile Thu Dec 26 10:45:17 2013 (r259912) +++ head/sys/boot/userboot/ficl/Makefile Thu Dec 26 11:32:39 2013 (r259913) @@ -16,7 +16,7 @@ CFLAGS+= -ffreestanding -fPIC CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif .if ${MACHINE_CPUARCH} == "i386" -CFLAGS+= -mpreferred-stack-boundary=2 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-sse3 .endif .if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" Modified: head/sys/boot/userboot/libstand/Makefile ============================================================================== --- head/sys/boot/userboot/libstand/Makefile Thu Dec 26 10:45:17 2013 (r259912) +++ head/sys/boot/userboot/libstand/Makefile Thu Dec 26 11:32:39 2013 (r259913) @@ -28,7 +28,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif .if ${MACHINE_CPUARCH} == "i386" -CFLAGS+= -mpreferred-stack-boundary=2 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-sse3 .endif .if ${MACHINE} == "pc98" Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Thu Dec 26 10:45:17 2013 (r259912) +++ head/sys/boot/zfs/Makefile Thu Dec 26 11:32:39 2013 (r259913) @@ -13,7 +13,7 @@ CFLAGS+= -I${.CURDIR}/../../cddl/boot/zf CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -march=i386 -CFLAGS+= -mpreferred-stack-boundary=2 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif .if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 11:38:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0299553; Thu, 26 Dec 2013 11:38:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C056182B; Thu, 26 Dec 2013 11:38:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQBcXTc044114; Thu, 26 Dec 2013 11:38:33 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQBcXPQ044113; Thu, 26 Dec 2013 11:38:33 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <201312261138.rBQBcXPQ044113@svn.freebsd.org> From: Doug Rabson Date: Thu, 26 Dec 2013 11:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259914 - head/usr.bin/rpcgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 11:38:33 -0000 Author: dfr Date: Thu Dec 26 11:38:33 2013 New Revision: 259914 URL: http://svnweb.freebsd.org/changeset/base/259914 Log: Generate client sample code which compiles without warnings. For 'rpcgen -a', generate a makefile where 'make clean all' works. Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Thu Dec 26 11:32:39 2013 (r259913) +++ head/usr.bin/rpcgen/rpc_main.c Thu Dec 26 11:38:33 2013 (r259914) @@ -776,6 +776,8 @@ clnt_output(const char *infile, const ch free(include); } else f_print(fout, "#include \n"); + f_print(fout, "#include \n"); + f_print(fout, "#include \n"); tell = ftell(fout); while ( (def = get_definition()) ) { has_program += write_sample_clnt(def); @@ -863,6 +865,10 @@ $(TARGETS_SVC.c:%%.c=%%.o) "); f_print(fout, "all : $(CLIENT) $(SERVER)\n\n"); f_print(fout, "$(TARGETS) : $(SOURCES.x) \n"); f_print(fout, "\trpcgen $(RPCGENFLAGS) $(SOURCES.x)\n\n"); + if (allfiles) { + f_print(fout, "\trpcgen -Sc $(RPCGENFLAGS) $(SOURCES.x) -o %s\n\n", clientname); + f_print(fout, "\trpcgen -Ss $(RPCGENFLAGS) $(SOURCES.x) -o %s\n\n", servername); + } f_print(fout, "$(OBJECTS_CLNT) : $(SOURCES_CLNT.c) $(SOURCES_CLNT.h) \ $(TARGETS_CLNT.c) \n\n"); From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 14:25:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF7503E7; Thu, 26 Dec 2013 14:25:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB8EE14AA; Thu, 26 Dec 2013 14:25:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQEPbHt018599; Thu, 26 Dec 2013 14:25:37 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQEPbHa018598; Thu, 26 Dec 2013 14:25:37 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312261425.rBQEPbHa018598@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 26 Dec 2013 14:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259915 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 14:25:37 -0000 Author: ray Date: Thu Dec 26 14:25:37 2013 New Revision: 259915 URL: http://svnweb.freebsd.org/changeset/base/259915 Log: Fix AltGr, we should not only skip RAlt key release if enable_altgr is set, but also process RAlt key press same way. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Dec 26 11:38:33 2013 (r259914) +++ head/sys/dev/vt/vt_core.c Thu Dec 26 14:25:37 2013 (r259915) @@ -417,6 +417,8 @@ vt_processkey(keyboard_t *kbd, struct vt } else { switch (c & ~RELKEY) { case (SPCLKEY | RALT): + if (vt_enable_altgr != 0) + break; case (SPCLKEY | LALT): vd->vd_kbstate |= ALKED; } From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 15:51:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49B048B0; Thu, 26 Dec 2013 15:51:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 367FD1A61; Thu, 26 Dec 2013 15:51:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQFpFjD052475; Thu, 26 Dec 2013 15:51:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQFpETO052471; Thu, 26 Dec 2013 15:51:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201312261551.rBQFpETO052471@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 26 Dec 2013 15:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259916 - head/sbin/pfctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 15:51:15 -0000 Author: bz Date: Thu Dec 26 15:51:14 2013 New Revision: 259916 URL: http://svnweb.freebsd.org/changeset/base/259916 Log: Use feature_present(3) to determine whether to open an INET or an INET6 socket when needed to allow pfctl to work on noinet and noinet6 kernels (and try to provide a fallback using AF_LINK as best effort). Adjust the Makefile to also respect relevant src.conf(5) options for compile time decisions on INET and INET6 support. Reviewed by: glebius (no objections) MFC after: 1 week Modified: head/sbin/pfctl/Makefile head/sbin/pfctl/pfctl_altq.c head/sbin/pfctl/pfctl_parser.c head/sbin/pfctl/pfctl_parser.h Modified: head/sbin/pfctl/Makefile ============================================================================== --- head/sbin/pfctl/Makefile Thu Dec 26 14:25:37 2013 (r259915) +++ head/sbin/pfctl/Makefile Thu Dec 26 15:51:14 2013 (r259916) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + # pf_ruleset.c is shared between kernel and pfctl .PATH: ${.CURDIR}/../../sys/netpfil/pf @@ -16,6 +18,14 @@ CFLAGS+= -Wall -Wmissing-prototypes -Wno CFLAGS+= -Wstrict-prototypes CFLAGS+= -DENABLE_ALTQ -I${.CURDIR} +# Need to use "WITH_" prefix to not conflict with the l/y INET/INET6 keywords +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+= -DWITH_INET6 +.endif +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DWITH_INET +.endif + YFLAGS= LDADD+= -lm -lmd Modified: head/sbin/pfctl/pfctl_altq.c ============================================================================== --- head/sbin/pfctl/pfctl_altq.c Thu Dec 26 14:25:37 2013 (r259915) +++ head/sbin/pfctl/pfctl_altq.c Thu Dec 26 15:51:14 2013 (r259916) @@ -1122,7 +1122,7 @@ getifspeed(char *ifname) struct ifreq ifr; struct if_data ifrdat; - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) + if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) < 0) err(1, "socket"); bzero(&ifr, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= @@ -1143,7 +1143,7 @@ getifmtu(char *ifname) int s; struct ifreq ifr; - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) + if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) < 0) err(1, "socket"); bzero(&ifr, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= Modified: head/sbin/pfctl/pfctl_parser.c ============================================================================== --- head/sbin/pfctl/pfctl_parser.c Thu Dec 26 14:25:37 2013 (r259915) +++ head/sbin/pfctl/pfctl_parser.c Thu Dec 26 15:51:14 2013 (r259916) @@ -1231,6 +1231,26 @@ ifa_load(void) freeifaddrs(ifap); } +int +get_socket_domain(void) +{ + int sdom; + + sdom = AF_UNSPEC; +#ifdef WITH_INET6 + if (sdom == AF_UNSPEC && feature_present("inet6")) + sdom = AF_INET6; +#endif +#ifdef WITH_INET + if (sdom == AF_UNSPEC && feature_present("inet")) + sdom = AF_INET; +#endif + if (sdom == AF_UNSPEC) + sdom = AF_LINK; + + return (sdom); +} + struct node_host * ifa_exists(const char *ifa_name) { @@ -1242,7 +1262,7 @@ ifa_exists(const char *ifa_name) ifa_load(); /* check wether this is a group */ - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) + if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) == -1) err(1, "socket"); bzero(&ifgr, sizeof(ifgr)); strlcpy(ifgr.ifgr_name, ifa_name, sizeof(ifgr.ifgr_name)); @@ -1273,7 +1293,7 @@ ifa_grouplookup(const char *ifa_name, in int s, len; struct node_host *n, *h = NULL; - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) + if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) == -1) err(1, "socket"); bzero(&ifgr, sizeof(ifgr)); strlcpy(ifgr.ifgr_name, ifa_name, sizeof(ifgr.ifgr_name)); Modified: head/sbin/pfctl/pfctl_parser.h ============================================================================== --- head/sbin/pfctl/pfctl_parser.h Thu Dec 26 14:25:37 2013 (r259915) +++ head/sbin/pfctl/pfctl_parser.h Thu Dec 26 15:51:14 2013 (r259916) @@ -294,6 +294,7 @@ void set_ipmask(struct node_host *, u int check_netmask(struct node_host *, sa_family_t); int unmask(struct pf_addr *, sa_family_t); void ifa_load(void); +int get_socket_domain(void); struct node_host *ifa_exists(const char *); struct node_host *ifa_lookup(const char *, int); struct node_host *host(const char *); From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 16:38:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4696E2EB; Thu, 26 Dec 2013 16:38:08 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1CCA01EFB; Thu, 26 Dec 2013 16:38:08 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D620FB941; Thu, 26 Dec 2013 11:38:06 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r259859 - head/sys/netinet/libalias Date: Thu, 26 Dec 2013 11:04:54 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312250324.rBP3OKqV015383@svn.freebsd.org> In-Reply-To: <201312250324.rBP3OKqV015383@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201312261104.54970.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 26 Dec 2013 11:38:06 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 16:38:08 -0000 On Tuesday, December 24, 2013 10:24:20 pm Gleb Smirnoff wrote: > Author: glebius > Date: Wed Dec 25 03:24:20 2013 > New Revision: 259859 > URL: http://svnweb.freebsd.org/changeset/base/259859 > > Log: > Cleanup alias module handler register/unregister. > > - Remove locking, since all module(9) events are running under &Giant. Eh, at some point that will go away. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 16:38:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74B8E2ED; Thu, 26 Dec 2013 16:38:11 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BE491EFC; Thu, 26 Dec 2013 16:38:11 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4DEB8B965; Thu, 26 Dec 2013 11:38:10 -0500 (EST) From: John Baldwin To: Julio Merino Subject: Re: svn commit: r259881 - head/release Date: Thu, 26 Dec 2013 11:14:10 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312251825.rBPIPxNo047853@svn.freebsd.org> In-Reply-To: <201312251825.rBPIPxNo047853@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201312261114.10411.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 26 Dec 2013 11:38:10 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 16:38:11 -0000 On Wednesday, December 25, 2013 1:25:58 pm Julio Merino wrote: > Author: jmmv > Date: Wed Dec 25 18:25:58 2013 > New Revision: 259881 > URL: http://svnweb.freebsd.org/changeset/base/259881 > > Log: > Put the release objdir inside the chroot. Hmm in my local releases of 10 this was already true that the release bits ended up in ${CHROOTDIR}/usr/obj/usr/src/release and not /usr/obj/usr/src/release. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 18:09:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3CD36BA; Thu, 26 Dec 2013 18:09:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A43F11595; Thu, 26 Dec 2013 18:09:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQI9HFc007544; Thu, 26 Dec 2013 18:09:17 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQI9Hbb007540; Thu, 26 Dec 2013 18:09:17 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312261809.rBQI9Hbb007540@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 26 Dec 2013 18:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259920 - in head/contrib/gcc: . doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 18:09:17 -0000 Author: pfg Date: Thu Dec 26 18:09:16 2013 New Revision: 259920 URL: http://svnweb.freebsd.org/changeset/base/259920 Log: gcc: Implement -Wmost for compatibility with clang. This is equivalent to -Wall -Wno-parentheses. Obtained from: Apple GCC 4.2 - 5531 MFC after: 1 week Modified: head/contrib/gcc/c-opts.c head/contrib/gcc/c.opt head/contrib/gcc/doc/invoke.texi Modified: head/contrib/gcc/c-opts.c ============================================================================== --- head/contrib/gcc/c-opts.c Thu Dec 26 16:59:50 2013 (r259919) +++ head/contrib/gcc/c-opts.c Thu Dec 26 18:09:16 2013 (r259920) @@ -385,12 +385,17 @@ c_common_handle_option (size_t scode, co break; case OPT_Wall: + /* APPLE LOCAL -Wmost */ + case OPT_Wmost: set_Wunused (value); set_Wformat (value); set_Wimplicit (value); warn_char_subscripts = value; warn_missing_braces = value; - warn_parentheses = value; + /* APPLE LOCAL begin -Wmost --dpatel */ + if (code != OPT_Wmost) + warn_parentheses = value; + /* APPLE LOCAL end -Wmost --dpatel */ warn_return_type = value; warn_sequence_point = value; /* Was C only. */ if (c_dialect_cxx ()) Modified: head/contrib/gcc/c.opt ============================================================================== --- head/contrib/gcc/c.opt Thu Dec 26 16:59:50 2013 (r259919) +++ head/contrib/gcc/c.opt Thu Dec 26 18:09:16 2013 (r259920) @@ -284,6 +284,12 @@ Wmissing-prototypes C ObjC Var(warn_missing_prototypes) Warn about global functions without prototypes +; APPLE LOCAL begin -Wmost +Wmost +C ObjC C++ ObjC++ +Like -Wall but without -Wparentheses +; APPLE LOCAL end -Wmost + Wmultichar C ObjC C++ ObjC++ Warn about use of multi-character character constants Modified: head/contrib/gcc/doc/invoke.texi ============================================================================== --- head/contrib/gcc/doc/invoke.texi Thu Dec 26 16:59:50 2013 (r259919) +++ head/contrib/gcc/doc/invoke.texi Thu Dec 26 18:09:16 2013 (r259920) @@ -222,6 +222,8 @@ in the following sections. -Wmain -Wmissing-braces -Wmissing-field-initializers @gol -Wmissing-format-attribute -Wmissing-include-dirs @gol -Wmissing-noreturn @gol +@c APPLE LOCAL -Wmost +-Wmost (APPLE ONLY) @gol -Wno-multichar -Wnonnull -Wno-overflow @gol -Woverlength-strings -Wpacked -Wpadded @gol -Wparentheses -Wpointer-arith -Wno-pointer-to-int-cast @gol @@ -2652,7 +2654,12 @@ warnings about constructions that some u that are easy to avoid (or modify to prevent the warning), even in conjunction with macros. This also enables some language-specific warnings described in @ref{C++ Dialect Options}. +@c APPLE LOCAL begin -Wmost +@item -Wmost +@opindex Wmost +This is equivalent to -Wall -Wno-parentheses. (Apple compatible) @end table +@c APPLE LOCAL end -Wmost The following @option{-W@dots{}} options are not implied by @option{-Wall}. Some of them warn about constructions that users generally do not From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 18:54:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 682C892B for ; Thu, 26 Dec 2013 18:54:29 +0000 (UTC) Received: from mail-ie0-f175.google.com (mail-ie0-f175.google.com [209.85.223.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33E8918E6 for ; Thu, 26 Dec 2013 18:54:28 +0000 (UTC) Received: by mail-ie0-f175.google.com with SMTP id x13so8618314ief.6 for ; Thu, 26 Dec 2013 10:54:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=ay73nI9SKYeU8jXh5oamDQXYoKrpH7P0DUcUymRZ2fE=; b=aJeYd51npgPshDFmd5OY6zjI7U7+K8t/qcFUAHVRTRtl8/xDTZQxiepWQ3hz/mqdPm JcQhh593qIYNIAfS9pT4QQ+zb0xXDgy1to7gmH5gICc5dDi1nxFS5F3VVPDoS8vmBmB5 hZAX/CnAJr2k3cLU7HBrePJhwtI5Q4LmETA4UBNaKebKY/zA6K4vlBSSCFMT8dIMOTh2 vsIlq0+OkkckE2CTr6uJJsJ3xnx6AAc2D+TgrrkjYmy2MtzjETY6XLmiSJcNP5o+WEaG CpvVewPPXKc0fEKsxPwOeBbpWyiTjQlcHyjfyztOcMrSgSeCHRiBRCbkyNVq8V4Get7E B6bg== X-Gm-Message-State: ALoCoQm/hXwxO54UN3eHs0AP9xBM0UexwaCLD5eZxyIP9PggJHeVzr7/WmCo/8h8pXhXPEqo4k4r X-Received: by 10.50.41.106 with SMTP id e10mr19623728igl.37.1388084068184; Thu, 26 Dec 2013 10:54:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.31.36 with HTTP; Thu, 26 Dec 2013 10:54:08 -0800 (PST) X-Originating-IP: [2620:0:1003:1007:a41a:6bb9:7290:5240] In-Reply-To: <201312261114.10411.jhb@freebsd.org> References: <201312251825.rBPIPxNo047853@svn.freebsd.org> <201312261114.10411.jhb@freebsd.org> From: Julio Merino Date: Thu, 26 Dec 2013 13:54:08 -0500 Message-ID: Subject: Re: svn commit: r259881 - head/release To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 18:54:29 -0000 On Thu, Dec 26, 2013 at 11:14 AM, John Baldwin wrote: > On Wednesday, December 25, 2013 1:25:58 pm Julio Merino wrote: > > Author: jmmv > > Date: Wed Dec 25 18:25:58 2013 > > New Revision: 259881 > > URL: http://svnweb.freebsd.org/changeset/base/259881 > > > > Log: > > Put the release objdir inside the chroot. > > Hmm in my local releases of 10 this was already true that the release bits > ended up in ${CHROOTDIR}/usr/obj/usr/src/release and not > /usr/obj/usr/src/release. > Note that make is invoked *both* from inside and outside the chroot. This means that you indeed have stuff in CHROOTDIR/usr/obj -- but that's not all. I suspect you can also see stuff in /usr/obj/scratch/. -- Julio Merino / @jmmv From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 19:16:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B55E71B4; Thu, 26 Dec 2013 19:16:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9592F1A8C; Thu, 26 Dec 2013 19:16:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQJGVwo034017; Thu, 26 Dec 2013 19:16:31 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQJGVcs034015; Thu, 26 Dec 2013 19:16:31 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312261916.rBQJGVcs034015@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 26 Dec 2013 19:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259921 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 19:16:31 -0000 Author: pluknet Date: Thu Dec 26 19:16:30 2013 New Revision: 259921 URL: http://svnweb.freebsd.org/changeset/base/259921 Log: Provide the manual page for aio_fsync(2). Reviewed by: davidxu MFC after: 1 week Added: head/lib/libc/sys/aio_fsync.2 (contents, props changed) Modified: head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Thu Dec 26 18:09:16 2013 (r259920) +++ head/lib/libc/sys/Makefile.inc Thu Dec 26 19:16:30 2013 (r259921) @@ -85,6 +85,7 @@ MAN+= abort2.2 \ adjtime.2 \ aio_cancel.2 \ aio_error.2 \ + aio_fsync.2 \ aio_mlock.2 \ aio_read.2 \ aio_return.2 \ Added: head/lib/libc/sys/aio_fsync.2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/aio_fsync.2 Thu Dec 26 19:16:30 2013 (r259921) @@ -0,0 +1,152 @@ +.\" Copyright (c) 2013 Sergey Kandaurov +.\" 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 May 4, 2013 +.Dt AIO_FSYNC 2 +.Os +.Sh NAME +.Nm aio_fsync +.Nd asynchronous file synchronization (REALTIME) +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In aio.h +.Ft int +.Fn aio_fsync "int op" "struct aiocb *iocb" +.Sh DESCRIPTION +The +.Fn aio_fsync +system call allows the calling process to move all modified data +associated with the descriptor +.Fa iocb->aio_fildes +to a permanent storage device. +The call returns immediately after the synchronization request has been +enqueued to the descriptor; the synchronization may or may not have +completed at the time the call returns. +.Pp +The +.Fa op +argument could be set only to +.Dv O_SYNC +to cause all currently queued I/O operations to be completed +as if by a call to +.Xr fsync 2 . +.Pp +If _POSIX_PRIORITIZED_IO is defined, and the descriptor supports it, +then the enqueued operation is submitted at a priority equal to that +of the calling process minus +.Fa iocb->aio_reqprio . +.Pp +The +.Fa iocb +pointer may be subsequently used as an argument to +.Fn aio_return +and +.Fn aio_error +in order to determine return or error status for the enqueued operation +while it is in progress. +.Pp +If the request could not be enqueued (generally due to invalid arguments), +the call returns without having enqueued the request. +.Sh RETURN VALUES +.Rv -std aio_fsync +.Sh ERRORS +The +.Fn aio_fsync +system call will fail if: +.Bl -tag -width Er +.It Bq Er EAGAIN +The request was not queued because of system resource limitations. +.It Bq Er ENOSYS +The +.Fn aio_fsync +system call is not supported. +.It Bq Er EINVAL +A value of the +.Fa op +argument is not set to +.Dv O_SYNC . +.El +.Pp +The following conditions may be synchronously detected when the +.Fn aio_fsync +system call is made, or asynchronously, at any time thereafter. +If they are detected at call time, +.Fn aio_fsync +returns -1 and sets +.Va errno +appropriately; otherwise the +.Fn aio_return +system call must be called, and will return -1, and +.Fn aio_error +must be called to determine the actual value that would have been +returned in +.Va errno . +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa iocb->aio_fildes +is invalid for writing. +.It Bq Er EINVAL +This implementation does not support synchronized I/O for this file. +.El +.Pp +If the request is successfully enqueued, but subsequently cancelled +or an error occurs, the value returned by the +.Fn aio_return +system call is per the +.Xr read 2 +and +.Xr write 2 +system calls, and the value returned by the +.Fn aio_error +system call is one of the error returns from the +.Xr read 2 +or +.Xr write 2 +system calls. +.Sh SEE ALSO +.Xr aio_cancel 2 , +.Xr aio_error 2 , +.Xr aio_read 2 , +.Xr aio_return 2 , +.Xr aio_suspend 2 , +.Xr aio_waitcomplete 2 , +.Xr aio_write 2 , +.Xr fsync 2 , +.Xr siginfo 3 , +.Xr aio 4 +.Sh STANDARDS +The +.Fn aio_fsync +system call is expected to conform to the +.St -p1003.1 +standard. +.Sh HISTORY +The +.Fn aio_fsync +system call first appeared in +.Fx 7.0 . From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 19:18:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 233FF4C2; Thu, 26 Dec 2013 19:18:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0EDFE1AA0; Thu, 26 Dec 2013 19:18:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQJIhwL034409; Thu, 26 Dec 2013 19:18:43 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQJIhvb034408; Thu, 26 Dec 2013 19:18:43 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312261918.rBQJIhvb034408@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 26 Dec 2013 19:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259922 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 19:18:44 -0000 Author: pluknet Date: Thu Dec 26 19:18:43 2013 New Revision: 259922 URL: http://svnweb.freebsd.org/changeset/base/259922 Log: Fix an apparent typo. MFC after: 3 days Modified: head/lib/libc/sys/aio_mlock.2 Modified: head/lib/libc/sys/aio_mlock.2 ============================================================================== --- head/lib/libc/sys/aio_mlock.2 Thu Dec 26 19:16:30 2013 (r259921) +++ head/lib/libc/sys/aio_mlock.2 Thu Dec 26 19:18:43 2013 (r259922) @@ -87,7 +87,7 @@ request has completed, are not allowed. .Rv -std aio_mlock .Sh ERRORS The -.Fn aio_read +.Fn aio_mlock system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 19:58:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95E4946D; Thu, 26 Dec 2013 19:58:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 75D611DEF; Thu, 26 Dec 2013 19:58:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQJwV4l049529; Thu, 26 Dec 2013 19:58:31 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQJwVT1049527; Thu, 26 Dec 2013 19:58:31 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312261958.rBQJwVT1049527@svn.freebsd.org> From: Neel Natu Date: Thu, 26 Dec 2013 19:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259924 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 19:58:31 -0000 Author: neel Date: Thu Dec 26 19:58:30 2013 New Revision: 259924 URL: http://svnweb.freebsd.org/changeset/base/259924 Log: Modify handling of writes to the vlapic ID, LDR and DFR registers. The handlers are now called after the register value is updated in the virtual APIC page. This will make it easier to handle APIC-write VM-exits with APIC register virtualization turned on. Additionally, we need to ensure that the value of these registers is always correctly reflected in the virtual APIC page, because there is no VM exit when the guest reads these registers with APIC register virtualization. Modified: head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Thu Dec 26 19:39:23 2013 (r259923) +++ head/sys/amd64/vmm/io/vlapic.c Thu Dec 26 19:58:30 2013 (r259924) @@ -125,72 +125,71 @@ vlapic_get_id(struct vlapic *vlapic) return (vlapic->vcpuid << 24); } -static __inline uint32_t -vlapic_get_ldr(struct vlapic *vlapic) +static uint32_t +x2apic_ldr(struct vlapic *vlapic) { - struct LAPIC *lapic; int apicid; uint32_t ldr; - lapic = vlapic->apic_page; - if (x2apic(vlapic)) { - apicid = vlapic_get_id(vlapic); - ldr = 1 << (apicid & 0xf); - ldr |= (apicid & 0xffff0) << 12; - return (ldr); - } else - return (lapic->ldr); + apicid = vlapic_get_id(vlapic); + ldr = 1 << (apicid & 0xf); + ldr |= (apicid & 0xffff0) << 12; + return (ldr); } -static __inline uint32_t -vlapic_get_dfr(struct vlapic *vlapic) +void +vlapic_dfr_write_handler(struct vlapic *vlapic) { struct LAPIC *lapic; lapic = vlapic->apic_page; - if (x2apic(vlapic)) - return (0); - else - return (lapic->dfr); -} - -static void -vlapic_set_dfr(struct vlapic *vlapic, uint32_t data) -{ - uint32_t dfr; - struct LAPIC *lapic; - if (x2apic(vlapic)) { - VM_CTR1(vlapic->vm, "write to DFR in x2apic mode: %#x", data); + VM_CTR1(vlapic->vm, "ignoring write to DFR in x2apic mode: %#x", + lapic->dfr); + lapic->dfr = 0; return; } - lapic = vlapic->apic_page; - dfr = (lapic->dfr & APIC_DFR_RESERVED) | (data & APIC_DFR_MODEL_MASK); - if ((dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_FLAT) + lapic->dfr &= APIC_DFR_MODEL_MASK; + lapic->dfr |= APIC_DFR_RESERVED; + + if ((lapic->dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_FLAT) VLAPIC_CTR0(vlapic, "vlapic DFR in Flat Model"); - else if ((dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_CLUSTER) + else if ((lapic->dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_CLUSTER) VLAPIC_CTR0(vlapic, "vlapic DFR in Cluster Model"); else - VLAPIC_CTR1(vlapic, "vlapic DFR in Unknown Model %#x", dfr); - - lapic->dfr = dfr; + VLAPIC_CTR1(vlapic, "DFR in Unknown Model %#x", lapic->dfr); } -static void -vlapic_set_ldr(struct vlapic *vlapic, uint32_t data) +void +vlapic_ldr_write_handler(struct vlapic *vlapic) { struct LAPIC *lapic; + lapic = vlapic->apic_page; + /* LDR is read-only in x2apic mode */ if (x2apic(vlapic)) { - VLAPIC_CTR1(vlapic, "write to LDR in x2apic mode: %#x", data); - return; + VLAPIC_CTR1(vlapic, "ignoring write to LDR in x2apic mode: %#x", + lapic->ldr); + lapic->ldr = x2apic_ldr(vlapic); + } else { + lapic->ldr &= ~APIC_LDR_RESERVED; + VLAPIC_CTR1(vlapic, "vlapic LDR set to %#x", lapic->ldr); } +} +void +vlapic_id_write_handler(struct vlapic *vlapic) +{ + struct LAPIC *lapic; + + /* + * We don't allow the ID register to be modified so reset it back to + * its default value. + */ lapic = vlapic->apic_page; - lapic->ldr = data & ~APIC_LDR_RESERVED; - VLAPIC_CTR1(vlapic, "vlapic LDR set to %#x", lapic->ldr); + lapic->id = vlapic_get_id(vlapic); } static int @@ -314,6 +313,7 @@ vlapic_reset(struct vlapic *vlapic) lapic = vlapic->apic_page; bzero(lapic, sizeof(struct LAPIC)); + lapic->id = vlapic_get_id(vlapic); lapic->version = VLAPIC_VERSION; lapic->version |= (VLAPIC_MAXLVT_ENTRIES << MAXLVTSHIFT); lapic->dfr = 0xffffffff; @@ -843,8 +843,8 @@ vlapic_calcdest(struct vm *vm, cpuset_t CPU_CLR(vcpuid, &amask); vlapic = vm_lapic(vm, vcpuid); - dfr = vlapic_get_dfr(vlapic); - ldr = vlapic_get_ldr(vlapic); + dfr = vlapic->apic_page->dfr; + ldr = vlapic->apic_page->ldr; if ((dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_FLAT) { @@ -1099,7 +1099,7 @@ vlapic_read(struct vlapic *vlapic, uint6 switch(offset) { case APIC_OFFSET_ID: - *data = vlapic_get_id(vlapic); + *data = lapic->id; break; case APIC_OFFSET_VER: *data = lapic->version; @@ -1117,10 +1117,10 @@ vlapic_read(struct vlapic *vlapic, uint6 *data = lapic->eoi; break; case APIC_OFFSET_LDR: - *data = vlapic_get_ldr(vlapic); + *data = lapic->ldr; break; case APIC_OFFSET_DFR: - *data = vlapic_get_dfr(vlapic); + *data = lapic->dfr; break; case APIC_OFFSET_SVR: *data = lapic->svr; @@ -1178,6 +1178,9 @@ vlapic_write(struct vlapic *vlapic, uint struct LAPIC *lapic = vlapic->apic_page; int retval; + KASSERT((offset & 0xf) == 0 && offset < PAGE_SIZE, + ("vlapic_write: invalid offset %#lx", offset)); + VLAPIC_CTR2(vlapic, "vlapic write offset %#x, data %#lx", offset, data); if (offset > sizeof(*lapic)) { @@ -1185,10 +1188,11 @@ vlapic_write(struct vlapic *vlapic, uint } retval = 0; - offset &= ~3; switch(offset) { case APIC_OFFSET_ID: + lapic->id = data; + vlapic_id_write_handler(vlapic); break; case APIC_OFFSET_TPR: lapic->tpr = data & 0xff; @@ -1198,10 +1202,12 @@ vlapic_write(struct vlapic *vlapic, uint vlapic_process_eoi(vlapic); break; case APIC_OFFSET_LDR: - vlapic_set_ldr(vlapic, data); + lapic->ldr = data; + vlapic_ldr_write_handler(vlapic); break; case APIC_OFFSET_DFR: - vlapic_set_dfr(vlapic, data); + lapic->dfr = data; + vlapic_dfr_write_handler(vlapic); break; case APIC_OFFSET_SVR: lapic_set_svr(vlapic, data); @@ -1292,19 +1298,38 @@ vlapic_get_apicbase(struct vlapic *vlapi } void -vlapic_set_apicbase(struct vlapic *vlapic, uint64_t val) +vlapic_set_apicbase(struct vlapic *vlapic, uint64_t new) { - int err; + struct LAPIC *lapic; enum x2apic_state state; + uint64_t old; + int err; err = vm_get_x2apic_state(vlapic->vm, vlapic->vcpuid, &state); if (err) panic("vlapic_set_apicbase: err %d fetching x2apic state", err); if (state == X2APIC_DISABLED) - val &= ~APICBASE_X2APIC; + new &= ~APICBASE_X2APIC; + + old = vlapic->msr_apicbase; + vlapic->msr_apicbase = new; - vlapic->msr_apicbase = val; + /* + * If the vlapic is switching between xAPIC and x2APIC modes then + * reset the mode-dependent registers. + */ + if ((old ^ new) & APICBASE_X2APIC) { + lapic = vlapic->apic_page; + lapic->id = vlapic_get_id(vlapic); + if (x2apic(vlapic)) { + lapic->ldr = x2apic_ldr(vlapic); + lapic->dfr = 0; + } else { + lapic->ldr = 0; + lapic->dfr = 0xffffffff; + } + } } void Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Thu Dec 26 19:39:23 2013 (r259923) +++ head/sys/amd64/vmm/io/vlapic.h Thu Dec 26 19:58:30 2013 (r259924) @@ -70,4 +70,9 @@ bool vlapic_enabled(struct vlapic *vlapi void vlapic_deliver_intr(struct vm *vm, bool level, uint32_t dest, bool phys, int delmode, int vec); void vlapic_post_intr(struct vlapic *vlapic, int hostcpu); + +/* APIC write handlers */ +void vlapic_id_write_handler(struct vlapic *vlapic); +void vlapic_ldr_write_handler(struct vlapic *vlapic); +void vlapic_dfr_write_handler(struct vlapic *vlapic); #endif /* _VLAPIC_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 20:07:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 963B48F7; Thu, 26 Dec 2013 20:07:44 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1BD8D1E98; Thu, 26 Dec 2013 20:07:43 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBQK7fYH019071 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 27 Dec 2013 00:07:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBQK7fa3019070; Fri, 27 Dec 2013 00:07:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 27 Dec 2013 00:07:41 +0400 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r259859 - head/sys/netinet/libalias Message-ID: <20131226200741.GV71033@FreeBSD.org> References: <201312250324.rBP3OKqV015383@svn.freebsd.org> <201312261104.54970.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312261104.54970.jhb@freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 20:07:44 -0000 On Thu, Dec 26, 2013 at 11:04:54AM -0500, John Baldwin wrote: J> On Tuesday, December 24, 2013 10:24:20 pm Gleb Smirnoff wrote: J> > Author: glebius J> > Date: Wed Dec 25 03:24:20 2013 J> > New Revision: 259859 J> > URL: http://svnweb.freebsd.org/changeset/base/259859 J> > J> > Log: J> > Cleanup alias module handler register/unregister. J> > J> > - Remove locking, since all module(9) events are running under &Giant. J> J> Eh, at some point that will go away. Are they going to be serialized by default? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 20:44:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32D23124; Thu, 26 Dec 2013 20:44:48 +0000 (UTC) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EAC2210CA; Thu, 26 Dec 2013 20:44:47 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C35233592DC; Thu, 26 Dec 2013 21:44:45 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id B0E6128497; Thu, 26 Dec 2013 21:44:45 +0100 (CET) Date: Thu, 26 Dec 2013 21:44:45 +0100 From: Jilles Tjoelker To: Sergey Kandaurov Subject: Re: svn commit: r259921 - head/lib/libc/sys Message-ID: <20131226204445.GA54038@stack.nl> References: <201312261916.rBQJGVcs034015@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312261916.rBQJGVcs034015@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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 20:44:48 -0000 On Thu, Dec 26, 2013 at 07:16:31PM +0000, Sergey Kandaurov wrote: > Author: pluknet > Date: Thu Dec 26 19:16:30 2013 > New Revision: 259921 > URL: http://svnweb.freebsd.org/changeset/base/259921 > Log: > Provide the manual page for aio_fsync(2). > Reviewed by: davidxu > MFC after: 1 week > Added: head/lib/libc/sys/aio_fsync.2 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libc/sys/aio_fsync.2 Thu Dec 26 19:16:30 2013 (r259921) > @@ -0,0 +1,152 @@ > [snip] > +The > +.Fa op > +argument could be set only to I suppose the op argument "must" be set to O_SYNC, rather than "could only" be set to O_SYNC. Alternatively, it "can only" be set to O_SYNC. > +.Dv O_SYNC > +to cause all currently queued I/O operations to be completed > +as if by a call to > +.Xr fsync 2 . > +.Pp > [snip] > +.Bl -tag -width Er > +.It Bq Er EBADF > +The > +.Fa iocb->aio_fildes > +is invalid for writing. This is what current POSIX standards say, but it does not make sense and does not work that way. Any open file descriptor is sufficient, since the access mode does not affect whether there are pending I/O operations on the underlying file. See http://austingroupbugs.net/view.php?id=671 which FreeBSD already implements (from reading the code). The text from fsync(2) can be used: .It Bq Er EBADF The .Fa iocb->aio_fildes argument is not a valid descriptor. > [snip] > +.Pp > +If the request is successfully enqueued, but subsequently cancelled > +or an error occurs, the value returned by the > +.Fn aio_return > +system call is per the > +.Xr read 2 > +and > +.Xr write 2 > +system calls, and the value returned by the > +.Fn aio_error > +system call is one of the error returns from the > +.Xr read 2 > +or > +.Xr write 2 > +system calls. The reference to read() and write() is in fact correct, and is missing from the fsync(2) page. For example, [EDQUOT] or [ENOSPC] may be seen on a network filesystem. > [snip] -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 21:06:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EF1D5DB; Thu, 26 Dec 2013 21:06:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F2DF11E8; Thu, 26 Dec 2013 21:06:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQL6D2L075558; Thu, 26 Dec 2013 21:06:13 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQL6CCl075552; Thu, 26 Dec 2013 21:06:12 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201312262106.rBQL6CCl075552@svn.freebsd.org> From: Dmitry Morozovsky Date: Thu, 26 Dec 2013 21:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259925 - in head/sys: geom/part sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 21:06:13 -0000 Author: marck (doc committer) Date: Thu Dec 26 21:06:12 2013 New Revision: 259925 URL: http://svnweb.freebsd.org/changeset/base/259925 Log: Add GPT UUID for VMware vSAN meta-data partition. Approved by: ae MFC after: 2 weeks Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_gpt.c head/sys/sys/gpt.h Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Thu Dec 26 19:58:30 2013 (r259924) +++ head/sys/geom/part/g_part.c Thu Dec 26 21:06:12 2013 (r259925) @@ -107,6 +107,7 @@ struct g_part_alias_list { { "vmware-vmfs", G_PART_ALIAS_VMFS }, { "vmware-vmkdiag", G_PART_ALIAS_VMKDIAG }, { "vmware-reserved", G_PART_ALIAS_VMRESERVED }, + { "vmware-vsanhdr", G_PART_ALIAS_VMVSANHDR }, }; SYSCTL_DECL(_kern_geom); Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Thu Dec 26 19:58:30 2013 (r259924) +++ head/sys/geom/part/g_part.h Thu Dec 26 21:06:12 2013 (r259925) @@ -74,6 +74,7 @@ enum g_part_alias { G_PART_ALIAS_VMFS, /* A VMware VMFS partition entry */ G_PART_ALIAS_VMKDIAG, /* A VMware vmkDiagnostic partition entry */ G_PART_ALIAS_VMRESERVED, /* A VMware reserved partition entry */ + G_PART_ALIAS_VMVSANHDR, /* A VMware vSAN header partition entry */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Thu Dec 26 19:58:30 2013 (r259924) +++ head/sys/geom/part/g_part_gpt.c Thu Dec 26 21:06:12 2013 (r259925) @@ -167,6 +167,7 @@ static struct uuid gpt_uuid_linux_swap = static struct uuid gpt_uuid_vmfs = GPT_ENT_TYPE_VMFS; static struct uuid gpt_uuid_vmkdiag = GPT_ENT_TYPE_VMKDIAG; static struct uuid gpt_uuid_vmreserved = GPT_ENT_TYPE_VMRESERVED; +static struct uuid gpt_uuid_vmvsanhdr = GPT_ENT_TYPE_VMVSANHDR; static struct uuid gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; static struct uuid gpt_uuid_ms_reserved = GPT_ENT_TYPE_MS_RESERVED; static struct uuid gpt_uuid_ms_ldm_data = GPT_ENT_TYPE_MS_LDM_DATA; @@ -208,6 +209,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_vmfs, G_PART_ALIAS_VMFS, 0 }, { &gpt_uuid_vmkdiag, G_PART_ALIAS_VMKDIAG, 0 }, { &gpt_uuid_vmreserved, G_PART_ALIAS_VMRESERVED, 0 }, + { &gpt_uuid_vmvsanhdr, G_PART_ALIAS_VMVSANHDR, 0 }, { &gpt_uuid_mbr, G_PART_ALIAS_MBR, 0 }, { &gpt_uuid_ms_basic_data, G_PART_ALIAS_MS_BASIC_DATA, 0x0b }, { &gpt_uuid_ms_ldm_data, G_PART_ALIAS_MS_LDM_DATA, 0 }, Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Thu Dec 26 19:58:30 2013 (r259924) +++ head/sys/sys/gpt.h Thu Dec 26 21:06:12 2013 (r259925) @@ -128,6 +128,8 @@ struct gpt_ent { {0x9d275380,0x40ad,0x11db,0xbf,0x97,{0x00,0x0c,0x29,0x11,0xd1,0xb8}} #define GPT_ENT_TYPE_VMRESERVED \ {0x9198effc,0x31c0,0x11db,0x8f,0x78,{0x00,0x0c,0x29,0x11,0xd1,0xb8}} +#define GPT_ENT_TYPE_VSANHDR + {0x381cfccc,0x7288,0x11e0,0x92,0xee,{0x00,0x0c,0x29,0x11,0xd0,0xb2}} #define GPT_ENT_TYPE_APPLE_BOOT \ {0x426F6F74,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 22:28:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C93AD74; Thu, 26 Dec 2013 22:28:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08B011738; Thu, 26 Dec 2013 22:28:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQMSFY8006101; Thu, 26 Dec 2013 22:28:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQMSFRi006100; Thu, 26 Dec 2013 22:28:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312262228.rBQMSFRi006100@svn.freebsd.org> From: Dimitry Andric Date: Thu, 26 Dec 2013 22:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259926 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 22:28:16 -0000 Author: dim Date: Thu Dec 26 22:28:15 2013 New Revision: 259926 URL: http://svnweb.freebsd.org/changeset/base/259926 Log: In sys/sys/gpt.h, add a missing backslash at the end of the GPT_ENT_TYPE_VSANHDR define. Pointy hat to: marck MFC after: 2 weeks X-MFC-With: r259925 Modified: head/sys/sys/gpt.h Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Thu Dec 26 21:06:12 2013 (r259925) +++ head/sys/sys/gpt.h Thu Dec 26 22:28:15 2013 (r259926) @@ -128,7 +128,7 @@ struct gpt_ent { {0x9d275380,0x40ad,0x11db,0xbf,0x97,{0x00,0x0c,0x29,0x11,0xd1,0xb8}} #define GPT_ENT_TYPE_VMRESERVED \ {0x9198effc,0x31c0,0x11db,0x8f,0x78,{0x00,0x0c,0x29,0x11,0xd1,0xb8}} -#define GPT_ENT_TYPE_VSANHDR +#define GPT_ENT_TYPE_VSANHDR \ {0x381cfccc,0x7288,0x11e0,0x92,0xee,{0x00,0x0c,0x29,0x11,0xd0,0xb2}} #define GPT_ENT_TYPE_APPLE_BOOT \ From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 22:31:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AF86FBA; Thu, 26 Dec 2013 22:31:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 26E5B1796; Thu, 26 Dec 2013 22:31:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQMVmEj009028; Thu, 26 Dec 2013 22:31:48 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQMVmA6009027; Thu, 26 Dec 2013 22:31:48 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312262231.rBQMVmA6009027@svn.freebsd.org> From: Dimitry Andric Date: Thu, 26 Dec 2013 22:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259927 - head/sys/boot/pc98/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 22:31:48 -0000 Author: dim Date: Thu Dec 26 22:31:47 2013 New Revision: 259927 URL: http://svnweb.freebsd.org/changeset/base/259927 Log: Fix pc98 build, by also forcing COMPILER_TYPE in sys/boot/pc98/boot2's Makefile. Pointy hat to: dim MFC after: 3 days X-MFC-With: r259730 Modified: head/sys/boot/pc98/boot2/Makefile Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Thu Dec 26 22:28:15 2013 (r259926) +++ head/sys/boot/pc98/boot2/Makefile Thu Dec 26 22:31:47 2013 (r259927) @@ -4,6 +4,7 @@ # XXX: clang can compile the boot code just fine, but boot2 gets too big CC:= gcc +COMPILER_TYPE:= gcc FILES= boot boot1 boot2 From owner-svn-src-head@FreeBSD.ORG Thu Dec 26 22:42:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0810B67B; Thu, 26 Dec 2013 22:42:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E7C9C185F; Thu, 26 Dec 2013 22:42:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQMgBs0012870; Thu, 26 Dec 2013 22:42:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQMgB97012869; Thu, 26 Dec 2013 22:42:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312262242.rBQMgB97012869@svn.freebsd.org> From: Dimitry Andric Date: Thu, 26 Dec 2013 22:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259928 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 22:42:12 -0000 Author: dim Date: Thu Dec 26 22:42:11 2013 New Revision: 259928 URL: http://svnweb.freebsd.org/changeset/base/259928 Log: In sys/dev/bxe/bxe.c, remove static function bxe_has_tx_work_unload(), which has never been used. Reviewed by: edavis MFC after: 3 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Thu Dec 26 22:31:47 2013 (r259927) +++ head/sys/dev/bxe/bxe.c Thu Dec 26 22:42:11 2013 (r259928) @@ -2745,13 +2745,6 @@ bxe_drv_pulse(struct bxe_softc *sc) sc->fw_drv_pulse_wr_seq); } -static inline int -bxe_has_tx_work_unload(struct bxe_fastpath *fp) -{ - mb(); /* consumer and producer can change */ - return (fp->tx_pkt_prod != fp->tx_pkt_cons); -} - static inline uint16_t bxe_tx_avail(struct bxe_softc *sc, struct bxe_fastpath *fp) From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 02:43:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6032B6E5; Fri, 27 Dec 2013 02:43:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 407441635; Fri, 27 Dec 2013 02:43:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR2htiP002850; Fri, 27 Dec 2013 02:43:55 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR2hsLH002842; Fri, 27 Dec 2013 02:43:54 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312270243.rBR2hsLH002842@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 27 Dec 2013 02:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259929 - in head: sbin/geom/class/mirror sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 02:43:55 -0000 Author: ae Date: Fri Dec 27 02:43:53 2013 New Revision: 259929 URL: http://svnweb.freebsd.org/changeset/base/259929 Log: Add an ability to stop gmirror and clear its metadata in one command. This fixes the problem, when gmirror starts again just after stop. The problem occurs when gmirror's component has geom label with equal size. E.g. gpt and gptid have the same size as partition, diskid has the same size as entire disk. When gmirror's geom has been destroyed, glabel creates its providers and this initiate retaste. Now "gmirror destroy" command is available. It destroys geom and also erases gmirror's metadata. MFC after: 2 weeks Modified: head/sbin/geom/class/mirror/geom_mirror.c head/sbin/geom/class/mirror/gmirror.8 head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror.h head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- head/sbin/geom/class/mirror/geom_mirror.c Thu Dec 26 22:42:11 2013 (r259928) +++ head/sbin/geom/class/mirror/geom_mirror.c Fri Dec 27 02:43:53 2013 (r259929) @@ -82,6 +82,13 @@ struct g_command class_commands[] = { { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v] name prov ..." }, + { "destroy", G_FLAG_VERBOSE, NULL, + { + { 'f', "force", NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + "[-fv] name ..." + }, { "dump", 0, mirror_main, G_NULL_OPTS, "prov ..." }, Modified: head/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- head/sbin/geom/class/mirror/gmirror.8 Thu Dec 26 22:42:11 2013 (r259928) +++ head/sbin/geom/class/mirror/gmirror.8 Fri Dec 27 02:43:53 2013 (r259929) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2013 +.Dd December 27, 2013 .Dt GMIRROR 8 .Os .Sh NAME @@ -86,6 +86,10 @@ .Ar name .Ar prov ... .Nm +.Cm destroy +.Op Fl fv +.Ar name ... +.Nm .Cm forget .Op Fl v .Ar name ... @@ -227,6 +231,14 @@ Activate the given component(s), which w .It Cm deactivate Mark the given component(s) as inactive, so it will not be automatically connected to the mirror. +.It Cm destroy +Stop the given mirror and clear metadata on all its components. +.Pp +Additional options include: +.Bl -tag -width ".Fl f" +.It Fl f +Stop the given mirror even if it is opened. +.El .It Cm forget Forget about components which are not connected. This command is useful when a disk has failed and cannot be reconnected, preventing the Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Thu Dec 26 22:42:11 2013 (r259928) +++ head/sys/geom/mirror/g_mirror.c Fri Dec 27 02:43:53 2013 (r259929) @@ -642,7 +642,8 @@ g_mirror_write_metadata(struct g_mirror_ length = cp->provider->sectorsize; offset = cp->provider->mediasize - length; sector = malloc((size_t)length, M_MIRROR, M_WAITOK | M_ZERO); - if (md != NULL) { + if (md != NULL && + (sc->sc_flags & G_MIRROR_DEVICE_FLAG_WIPE) == 0) { /* * Handle the case, when the size of parent provider reduced. */ @@ -749,7 +750,8 @@ g_mirror_update_metadata(struct g_mirror sc = disk->d_softc; sx_assert(&sc->sc_lock, SX_LOCKED); - g_mirror_fill_metadata(sc, disk, &md); + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_WIPE) == 0) + g_mirror_fill_metadata(sc, disk, &md); error = g_mirror_write_metadata(disk, &md); if (error == 0) { G_MIRROR_DEBUG(2, "Metadata on %s updated.", Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Thu Dec 26 22:42:11 2013 (r259928) +++ head/sys/geom/mirror/g_mirror.h Fri Dec 27 02:43:53 2013 (r259929) @@ -160,6 +160,7 @@ struct g_mirror_event { #define G_MIRROR_DEVICE_FLAG_WAIT 0x0200000000000000ULL #define G_MIRROR_DEVICE_FLAG_DESTROYING 0x0400000000000000ULL #define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL +#define G_MIRROR_DEVICE_FLAG_WIPE 0x1000000000000000ULL #define G_MIRROR_DEVICE_STATE_STARTING 0 #define G_MIRROR_DEVICE_STATE_RUNNING 1 Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Thu Dec 26 22:42:11 2013 (r259928) +++ head/sys/geom/mirror/g_mirror_ctl.c Fri Dec 27 02:43:53 2013 (r259929) @@ -797,7 +797,7 @@ g_mirror_ctl_forget(struct gctl_req *req } static void -g_mirror_ctl_stop(struct gctl_req *req, struct g_class *mp) +g_mirror_ctl_stop(struct gctl_req *req, struct g_class *mp, int wipe) { struct g_mirror_softc *sc; int *force, *nargs, error; @@ -838,10 +838,14 @@ g_mirror_ctl_stop(struct gctl_req *req, return; } g_cancel_event(sc); + if (wipe) + sc->sc_flags |= G_MIRROR_DEVICE_FLAG_WIPE; error = g_mirror_destroy(sc, how); if (error != 0) { gctl_error(req, "Cannot destroy device %s (error=%d).", sc->sc_geom->name, error); + if (wipe) + sc->sc_flags &= ~G_MIRROR_DEVICE_FLAG_WIPE; sx_xunlock(&sc->sc_lock); return; } @@ -882,7 +886,9 @@ g_mirror_config(struct gctl_req *req, st else if (strcmp(verb, "forget") == 0) g_mirror_ctl_forget(req, mp); else if (strcmp(verb, "stop") == 0) - g_mirror_ctl_stop(req, mp); + g_mirror_ctl_stop(req, mp, 0); + else if (strcmp(verb, "destroy") == 0) + g_mirror_ctl_stop(req, mp, 1); else gctl_error(req, "Unknown verb."); g_topology_lock(); From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 05:01:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C662436A; Fri, 27 Dec 2013 05:01:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B2DD4100B; Fri, 27 Dec 2013 05:01:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR51D5I055123; Fri, 27 Dec 2013 05:01:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR51DIs055122; Fri, 27 Dec 2013 05:01:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312270501.rBR51DIs055122@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Dec 2013 05:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259936 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 05:01:13 -0000 Author: adrian Date: Fri Dec 27 05:01:13 2013 New Revision: 259936 URL: http://svnweb.freebsd.org/changeset/base/259936 Log: Revert r252694 - which attempted to fix bit emulation for armv6/armv7. This seems to cause issues with jemalloc + {dhclient, sshd}. Thus, revert this for now until the root cause can be found and fixed. This should quieten some runtime problems with the Raspberry Pi. PR: kern/185046 MFC after: 3 days Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Dec 27 04:30:32 2013 (r259935) +++ head/sys/arm/arm/pmap-v6.c Fri Dec 27 05:01:13 2013 (r259936) @@ -3094,21 +3094,16 @@ validate: if ((m->oflags & VPO_UNMANAGED) == 0) { vm_page_aflag_set(m, PGA_WRITEABLE); /* - * Enable write permission if the access type - * indicates write intention. Emulate modified - * bit otherwise. + * XXX: Skip modified bit emulation for now. + * The emulation reveals problems + * that result in random failures + * during memory allocation on some + * platforms. + * Therefore, the page is marked RW + * immediately. */ - if ((access & VM_PROT_WRITE) != 0) { - npte &= ~(L2_APX); - /* - * The access type and permissions - * indicate that the page will be - * written as soon as returned from - * fault service. - * Mark it dirty from the outset. - */ - vm_page_dirty(m); - } + npte &= ~(L2_APX); + vm_page_dirty(m); } else npte &= ~(L2_APX); } From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 07:01:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89466E44; Fri, 27 Dec 2013 07:01:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 756E41653; Fri, 27 Dec 2013 07:01:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR71h7r098788; Fri, 27 Dec 2013 07:01:43 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR71gtN098784; Fri, 27 Dec 2013 07:01:42 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312270701.rBR71gtN098784@svn.freebsd.org> From: Neel Natu Date: Fri, 27 Dec 2013 07:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259937 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 07:01:43 -0000 Author: neel Date: Fri Dec 27 07:01:42 2013 New Revision: 259937 URL: http://svnweb.freebsd.org/changeset/base/259937 Log: Modify handling of write to the vlapic SVR register. The handler is now called after the register value is updated in the virtual APIC page. This will make it easier to handle APIC-write VM-exits with APIC register virtualization turned on. Additionally, mask all the LVT entries when the vlapic is software-disabled. Modified: head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/io/vlapic_priv.h Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Fri Dec 27 05:01:13 2013 (r259936) +++ head/sys/amd64/vmm/io/vlapic.c Fri Dec 27 07:01:42 2013 (r259937) @@ -218,13 +218,17 @@ vlapic_timer_divisor(uint32_t dcr) } static void -vlapic_mask_lvts(uint32_t *lvts, int num_lvt) +vlapic_mask_lvts(struct vlapic *vlapic) { - int i; - for (i = 0; i < num_lvt; i++) { - *lvts |= APIC_LVT_M; - lvts += 4; - } + struct LAPIC *lapic = vlapic->apic_page; + + lapic->lvt_cmci |= APIC_LVT_M; + lapic->lvt_timer |= APIC_LVT_M; + lapic->lvt_thermal |= APIC_LVT_M; + lapic->lvt_pcint |= APIC_LVT_M; + lapic->lvt_lint0 |= APIC_LVT_M; + lapic->lvt_lint1 |= APIC_LVT_M; + lapic->lvt_error |= APIC_LVT_M; } #if 0 @@ -318,14 +322,15 @@ vlapic_reset(struct vlapic *vlapic) lapic->version |= (VLAPIC_MAXLVT_ENTRIES << MAXLVTSHIFT); lapic->dfr = 0xffffffff; lapic->svr = APIC_SVR_VECTOR; - vlapic_mask_lvts(&lapic->lvt_timer, 6); - vlapic_mask_lvts(&lapic->lvt_cmci, 1); + vlapic_mask_lvts(vlapic); vlapic_set_dcr(vlapic, 0); if (vlapic->vcpuid == 0) vlapic->boot_state = BS_RUNNING; /* BSP */ else vlapic->boot_state = BS_INIT; /* AP */ + + vlapic->svr_last = lapic->svr; } void @@ -1052,24 +1057,30 @@ vlapic_intr_accepted(struct vlapic *vlap vlapic_update_ppr(vlapic); } -static void -lapic_set_svr(struct vlapic *vlapic, uint32_t new) +void +vlapic_svr_write_handler(struct vlapic *vlapic) { struct LAPIC *lapic; - uint32_t old, changed; + uint32_t old, new, changed; lapic = vlapic->apic_page; - old = lapic->svr; + + new = lapic->svr; + old = vlapic->svr_last; + vlapic->svr_last = new; + changed = old ^ new; if ((changed & APIC_SVR_ENABLE) != 0) { if ((new & APIC_SVR_ENABLE) == 0) { /* - * The apic is now disabled so stop the apic timer. + * The apic is now disabled so stop the apic timer + * and mask all the LVT entries. */ VLAPIC_CTR0(vlapic, "vlapic is software-disabled"); VLAPIC_TIMER_LOCK(vlapic); callout_stop(&vlapic->callout); VLAPIC_TIMER_UNLOCK(vlapic); + vlapic_mask_lvts(vlapic); } else { /* * The apic is now enabled so restart the apic timer @@ -1080,7 +1091,6 @@ lapic_set_svr(struct vlapic *vlapic, uin vlapic_set_icr_timer(vlapic, lapic->icr_timer); } } - lapic->svr = new; } int @@ -1210,7 +1220,8 @@ vlapic_write(struct vlapic *vlapic, uint vlapic_dfr_write_handler(vlapic); break; case APIC_OFFSET_SVR: - lapic_set_svr(vlapic, data); + lapic->svr = data; + vlapic_svr_write_handler(vlapic); break; case APIC_OFFSET_ICR_LOW: if (!x2apic(vlapic)) { Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Fri Dec 27 05:01:13 2013 (r259936) +++ head/sys/amd64/vmm/io/vlapic.h Fri Dec 27 07:01:42 2013 (r259937) @@ -75,4 +75,5 @@ void vlapic_post_intr(struct vlapic *vla void vlapic_id_write_handler(struct vlapic *vlapic); void vlapic_ldr_write_handler(struct vlapic *vlapic); void vlapic_dfr_write_handler(struct vlapic *vlapic); +void vlapic_svr_write_handler(struct vlapic *vlapic); #endif /* _VLAPIC_H_ */ Modified: head/sys/amd64/vmm/io/vlapic_priv.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic_priv.h Fri Dec 27 05:01:13 2013 (r259936) +++ head/sys/amd64/vmm/io/vlapic_priv.h Fri Dec 27 07:01:42 2013 (r259937) @@ -116,6 +116,7 @@ struct vlapic { uint64_t msr_apicbase; enum boot_state boot_state; + uint32_t svr_last; }; void vlapic_init(struct vlapic *vlapic); From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 07:02:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1509F92; Fri, 27 Dec 2013 07:02:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E519165C; Fri, 27 Dec 2013 07:02:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR7276Z098892; Fri, 27 Dec 2013 07:02:07 GMT (envelope-from avatar@svn.freebsd.org) Received: (from avatar@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR727Nl098891; Fri, 27 Dec 2013 07:02:07 GMT (envelope-from avatar@svn.freebsd.org) Message-Id: <201312270702.rBR727Nl098891@svn.freebsd.org> From: Tai-hwa Liang Date: Fri, 27 Dec 2013 07:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259938 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 07:02:07 -0000 Author: avatar Date: Fri Dec 27 07:02:07 2013 New Revision: 259938 URL: http://svnweb.freebsd.org/changeset/base/259938 Log: Fixing build bustage. Modified: head/sys/sys/gpt.h Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Fri Dec 27 07:01:42 2013 (r259937) +++ head/sys/sys/gpt.h Fri Dec 27 07:02:07 2013 (r259938) @@ -128,7 +128,7 @@ struct gpt_ent { {0x9d275380,0x40ad,0x11db,0xbf,0x97,{0x00,0x0c,0x29,0x11,0xd1,0xb8}} #define GPT_ENT_TYPE_VMRESERVED \ {0x9198effc,0x31c0,0x11db,0x8f,0x78,{0x00,0x0c,0x29,0x11,0xd1,0xb8}} -#define GPT_ENT_TYPE_VSANHDR \ +#define GPT_ENT_TYPE_VMVSANHDR \ {0x381cfccc,0x7288,0x11e0,0x92,0xee,{0x00,0x0c,0x29,0x11,0xd0,0xb2}} #define GPT_ENT_TYPE_APPLE_BOOT \ From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 08:03:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45655AC1; Fri, 27 Dec 2013 08:03:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 173771A21; Fri, 27 Dec 2013 08:03:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR83rRr021000; Fri, 27 Dec 2013 08:03:53 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR83rWd020996; Fri, 27 Dec 2013 08:03:53 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201312270803.rBR83rWd020996@svn.freebsd.org> From: Kevin Lo Date: Fri, 27 Dec 2013 08:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259939 - in head: share/man/man4 sys/dev/usb sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 08:03:54 -0000 Author: kevlo Date: Fri Dec 27 08:03:53 2013 New Revision: 259939 URL: http://svnweb.freebsd.org/changeset/base/259939 Log: Add D-Link DWA-140 rev D1, another RT5372/run(4). From Anton Mazunin. Modified: head/share/man/man4/run.4 head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_run.c Modified: head/share/man/man4/run.4 ============================================================================== --- head/share/man/man4/run.4 Fri Dec 27 07:02:07 2013 (r259938) +++ head/share/man/man4/run.4 Fri Dec 27 08:03:53 2013 (r259939) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2013 +.Dd December 27, 2013 .Dt RUN 4 .Os .Sh NAME @@ -132,7 +132,7 @@ driver supports the following wireless a .It Corega CG-WLUSB300AGN .It Corega CG-WLUSB300GNM .It D-Link DWA-130 rev B1 -.It D-Link DWA-140 rev B1, B2, B3 +.It D-Link DWA-140 rev B1, B2, B3, D1 .It D-Link DWA-160 rev B2 .It DrayTek Vigor N61 .It Edimax EW-7711UAn Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Dec 27 07:02:07 2013 (r259938) +++ head/sys/dev/usb/usbdevs Fri Dec 27 08:03:53 2013 (r259939) @@ -1558,6 +1558,7 @@ product DLINK RT3072 0x3c0a RT3072 product DLINK DWA140B3 0x3c15 DWA-140 rev B3 product DLINK DWA160B2 0x3c1a DWA-160 rev B2 product DLINK DWA127 0x3c1b DWA-127 Wireless Adapter +product DLINK DWA140D1 0x3c20 DWA-140 rev D1 product DLINK DSB650C 0x4000 10Mbps Ethernet product DLINK DSB650TX1 0x4001 10/100 Ethernet product DLINK DSB650TX 0x4002 10/100 Ethernet Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Fri Dec 27 07:02:07 2013 (r259938) +++ head/sys/dev/usb/wlan/if_run.c Fri Dec 27 08:03:53 2013 (r259939) @@ -178,6 +178,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(DLINK, DWA127), RUN_DEV(DLINK, DWA140B3), RUN_DEV(DLINK, DWA160B2), + RUN_DEV(DLINK, DWA140D1), RUN_DEV(DLINK2, DWA130), RUN_DEV(DLINK2, RT2870_1), RUN_DEV(DLINK2, RT2870_2), From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 08:06:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9311CC25; Fri, 27 Dec 2013 08:06:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7FCA11A35; Fri, 27 Dec 2013 08:06:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR86NLK021420; Fri, 27 Dec 2013 08:06:23 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR86NCS021419; Fri, 27 Dec 2013 08:06:23 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201312270806.rBR86NCS021419@svn.freebsd.org> From: Kevin Lo Date: Fri, 27 Dec 2013 08:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259940 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 08:06:23 -0000 Author: kevlo Date: Fri Dec 27 08:06:23 2013 New Revision: 259940 URL: http://svnweb.freebsd.org/changeset/base/259940 Log: Regen. Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Fri Dec 27 08:03:53 2013 (r259939) +++ head/etc/devd/usb.conf Fri Dec 27 08:06:23 2013 (r259940) @@ -4625,7 +4625,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a|0x3c1b)"; + match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a|0x3c1b|0x3c20)"; action "kldload -n if_run"; }; @@ -5341,5 +5341,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2576 USB entries processed +# 2577 USB entries processed From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 12:15:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B1C79A7; Fri, 27 Dec 2013 12:15:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 577671B29; Fri, 27 Dec 2013 12:15:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRCFsG7019185; Fri, 27 Dec 2013 12:15:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRCFsat019184; Fri, 27 Dec 2013 12:15:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312271215.rBRCFsat019184@svn.freebsd.org> From: Dimitry Andric Date: Fri, 27 Dec 2013 12:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259942 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 12:15:54 -0000 Author: dim Date: Fri Dec 27 12:15:53 2013 New Revision: 259942 URL: http://svnweb.freebsd.org/changeset/base/259942 Log: In sys/amd64/vmm/intel/vmx.c, silence a (incorrect) gcc warning about regval possibly being used uninitialized. Reviewed by: neel Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Dec 27 11:10:32 2013 (r259941) +++ head/sys/amd64/vmm/intel/vmx.c Fri Dec 27 12:15:53 2013 (r259942) @@ -1114,6 +1114,7 @@ vmx_emulate_cr_access(struct vmx *vmx, i if (cr != 0 && cr != 4) return (UNHANDLED); + regval = 0; /* silence gcc */ vmxctx = &vmx->ctx[vcpu]; /* From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 13:07:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DABB63F4; Fri, 27 Dec 2013 13:07:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C5E381EED; Fri, 27 Dec 2013 13:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRD70dt037759; Fri, 27 Dec 2013 13:07:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRD70oM037757; Fri, 27 Dec 2013 13:07:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201312271307.rBRD70oM037757@svn.freebsd.org> From: Michael Tuexen Date: Fri, 27 Dec 2013 13:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259943 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 13:07:00 -0000 Author: tuexen Date: Fri Dec 27 13:07:00 2013 New Revision: 259943 URL: http://svnweb.freebsd.org/changeset/base/259943 Log: Address some warnings which showed up on the userland version. MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Fri Dec 27 12:15:53 2013 (r259942) +++ head/sys/netinet/sctp_usrreq.c Fri Dec 27 13:07:00 2013 (r259943) @@ -2788,7 +2788,7 @@ flags_out: if (stcb) { /* simply copy out the sockaddr_storage... */ - int len; + size_t len; len = *optsize; if (len > stcb->asoc.primary_destination->ro._l_addr.sa.sa_len) Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Dec 27 12:15:53 2013 (r259942) +++ head/sys/netinet/sctputil.c Fri Dec 27 13:07:00 2013 (r259943) @@ -5868,8 +5868,8 @@ get_more_data: goto release; } if ((uio->uio_resid == 0) || - ((in_eeor_mode) && (copied_so_far >= max(so->so_rcv.sb_lowat, 1))) - ) { + ((in_eeor_mode) && + (copied_so_far >= (uint32_t) max(so->so_rcv.sb_lowat, 1)))) { goto release; } /* From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 15:15:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C2ED369; Fri, 27 Dec 2013 15:15:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77D5116AF; Fri, 27 Dec 2013 15:15:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRFFoPS086557; Fri, 27 Dec 2013 15:15:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRFFovI086555; Fri, 27 Dec 2013 15:15:50 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312271515.rBRFFovI086555@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 27 Dec 2013 15:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259944 - head/contrib/gcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 15:15:50 -0000 Author: pfg Date: Fri Dec 27 15:15:49 2013 New Revision: 259944 URL: http://svnweb.freebsd.org/changeset/base/259944 Log: gcc: merge small upstream change. Backport from mainline: 2007-04-24 Hui-May Chang * reload1.c (merge_assigned_reloads) : Do not merge a RELOAD_OTHER instruction with a RELOAD_FOR_OPERAND_ADDRESS instruction. Obtained from: gcc 4.3 (rev. r124115: GPLv2) MFC after: 1 week Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/reload1.c Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Fri Dec 27 13:07:00 2013 (r259943) +++ head/contrib/gcc/ChangeLog.gcc43 Fri Dec 27 15:15:49 2013 (r259944) @@ -151,6 +151,11 @@ alignment for amdfam10 architecture. Increasing the max loop alignment to 24 bytes. +2007-04-24 Hui-May Chang (r124115) + + * reload1.c (merge_assigned_reloads) : Do not merge a RELOAD_OTHER + instruction with a RELOAD_FOR_OPERAND_ADDRESS instruction. + 2007-04-16 Lawrence Crowl (r123909) * doc/invoke.texi (Debugging Options): Add documentation for the Modified: head/contrib/gcc/reload1.c ============================================================================== --- head/contrib/gcc/reload1.c Fri Dec 27 13:07:00 2013 (r259943) +++ head/contrib/gcc/reload1.c Fri Dec 27 15:15:49 2013 (r259944) @@ -6238,15 +6238,23 @@ merge_assigned_reloads (rtx insn) transfer_replacements (i, j); } - /* If this is now RELOAD_OTHER, look for any reloads that load - parts of this operand and set them to RELOAD_FOR_OTHER_ADDRESS - if they were for inputs, RELOAD_OTHER for outputs. Note that - this test is equivalent to looking for reloads for this operand - number. */ - /* We must take special care with RELOAD_FOR_OUTPUT_ADDRESS; it may - share registers with a RELOAD_FOR_INPUT, so we can not change it - to RELOAD_FOR_OTHER_ADDRESS. We should never need to, since we - do not modify RELOAD_FOR_OUTPUT. */ + /* If this is now RELOAD_OTHER, look for any reloads that + load parts of this operand and set them to + RELOAD_FOR_OTHER_ADDRESS if they were for inputs, + RELOAD_OTHER for outputs. Note that this test is + equivalent to looking for reloads for this operand + number. + + We must take special care with RELOAD_FOR_OUTPUT_ADDRESS; + it may share registers with a RELOAD_FOR_INPUT, so we can + not change it to RELOAD_FOR_OTHER_ADDRESS. We should + never need to, since we do not modify RELOAD_FOR_OUTPUT. + + It is possible that the RELOAD_FOR_OPERAND_ADDRESS + instruction is assigned the same register as the earlier + RELOAD_FOR_OTHER_ADDRESS instruction. Merging these two + instructions will cause the RELOAD_FOR_OTHER_ADDRESS + instruction to be deleted later on. */ if (rld[i].when_needed == RELOAD_OTHER) for (j = 0; j < n_reloads; j++) @@ -6254,6 +6262,7 @@ merge_assigned_reloads (rtx insn) && rld[j].when_needed != RELOAD_OTHER && rld[j].when_needed != RELOAD_FOR_OTHER_ADDRESS && rld[j].when_needed != RELOAD_FOR_OUTPUT_ADDRESS + && rld[j].when_needed != RELOAD_FOR_OPERAND_ADDRESS && (! conflicting_input || rld[j].when_needed == RELOAD_FOR_INPUT_ADDRESS || rld[j].when_needed == RELOAD_FOR_INPADDR_ADDRESS) From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 15:52:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82ECB233; Fri, 27 Dec 2013 15:52:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F2F81923; Fri, 27 Dec 2013 15:52:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRFqJ9W099870; Fri, 27 Dec 2013 15:52:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRFqJNw099869; Fri, 27 Dec 2013 15:52:19 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201312271552.rBRFqJNw099869@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 27 Dec 2013 15:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259946 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 15:52:19 -0000 Author: jilles Date: Fri Dec 27 15:52:18 2013 New Revision: 259946 URL: http://svnweb.freebsd.org/changeset/base/259946 Log: sh: Don't check input for non-whitespace if history is disabled. preadbuffer() maintained a flag whether there was any non-whitespace character. This flag is only useful when history is enabled (in that case, lines containing only whitespace are not added to history). Instead, check using strspn() when history is enabled. There is an approximate 2% speedup when running sh -c '. /etc/rc.subr; . /etc/defaults/rc.conf; source_rc_confs' with hot cache. Modified: head/bin/sh/input.c Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Fri Dec 27 15:44:16 2013 (r259945) +++ head/bin/sh/input.c Fri Dec 27 15:52:18 2013 (r259946) @@ -228,7 +228,6 @@ preadbuffer(void) { char *p, *q; int more; - int something; char savec; if (parsefile->strpush) { @@ -252,24 +251,18 @@ again: q = p = parsefile->buf + (parsenextc - parsefile->buf); /* delete nul characters */ - something = 0; for (more = 1; more;) { switch (*p) { case '\0': p++; /* Skip nul */ goto check; - case '\t': - case ' ': - break; - case '\n': parsenleft = q - parsenextc; more = 0; /* Stop processing here */ break; default: - something = 1; break; } @@ -288,7 +281,8 @@ check: *q = '\0'; #ifndef NO_HISTORY - if (parsefile->fd == 0 && hist && something) { + if (parsefile->fd == 0 && hist && + parsenextc[strspn(parsenextc, " \t\n")] != '\0') { HistEvent he; INTOFF; history(hist, &he, whichprompt == 1 ? H_ENTER : H_ADD, From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 16:48:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05C9DDF2; Fri, 27 Dec 2013 16:48:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E62C61E08; Fri, 27 Dec 2013 16:48:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRGmbLP019695; Fri, 27 Dec 2013 16:48:37 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRGmbeg019693; Fri, 27 Dec 2013 16:48:37 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201312271648.rBRGmbeg019693@svn.freebsd.org> From: Joel Dahl Date: Fri, 27 Dec 2013 16:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259949 - head/sbin/geom/class/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 16:48:38 -0000 Author: joel (doc committer) Date: Fri Dec 27 16:48:37 2013 New Revision: 259949 URL: http://svnweb.freebsd.org/changeset/base/259949 Log: Improve wording slightly. Modified: head/sbin/geom/class/mirror/gmirror.8 Modified: head/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- head/sbin/geom/class/mirror/gmirror.8 Fri Dec 27 16:08:34 2013 (r259948) +++ head/sbin/geom/class/mirror/gmirror.8 Fri Dec 27 16:48:37 2013 (r259949) @@ -327,9 +327,7 @@ gmirror activate data da1 .Sh NOTES Doing kernel dumps to .Nm -providers. -.Pp -This is possible, but some conditions have to be met. +providers is possible, but some conditions have to be met. First of all, a kernel dump will go only to one component and .Nm always chooses the component with the highest priority. From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 16:57:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 953F529B; Fri, 27 Dec 2013 16:57:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8120E1E87; Fri, 27 Dec 2013 16:57:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRGvcse024062; Fri, 27 Dec 2013 16:57:38 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRGvc9i024061; Fri, 27 Dec 2013 16:57:38 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312271657.rBRGvc9i024061@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 27 Dec 2013 16:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259950 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 16:57:38 -0000 Author: pluknet Date: Fri Dec 27 16:57:38 2013 New Revision: 259950 URL: http://svnweb.freebsd.org/changeset/base/259950 Log: - Fix EBADF description, in following the future POSIX tc and what FreeBSD actually implements. - Improve grammar: use more preferred "can", not "could". Submitted by: jilles Modified: head/lib/libc/sys/aio_fsync.2 Modified: head/lib/libc/sys/aio_fsync.2 ============================================================================== --- head/lib/libc/sys/aio_fsync.2 Fri Dec 27 16:48:37 2013 (r259949) +++ head/lib/libc/sys/aio_fsync.2 Fri Dec 27 16:57:38 2013 (r259950) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 4, 2013 +.Dd December 27, 2013 .Dt AIO_FSYNC 2 .Os .Sh NAME @@ -49,7 +49,7 @@ completed at the time the call returns. .Pp The .Fa op -argument could be set only to +argument can only be set to .Dv O_SYNC to cause all currently queued I/O operations to be completed as if by a call to @@ -109,7 +109,8 @@ returned in .It Bq Er EBADF The .Fa iocb->aio_fildes -is invalid for writing. +argument +is not a valid descriptor. .It Bq Er EINVAL This implementation does not support synchronized I/O for this file. .El From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 16:59:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 265403F2; Fri, 27 Dec 2013 16:59:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12C3A1E95; Fri, 27 Dec 2013 16:59:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRGxlP1024302; Fri, 27 Dec 2013 16:59:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRGxlHR024301; Fri, 27 Dec 2013 16:59:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312271659.rBRGxlHR024301@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 27 Dec 2013 16:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259951 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 16:59:48 -0000 Author: kib Date: Fri Dec 27 16:59:47 2013 New Revision: 259951 URL: http://svnweb.freebsd.org/changeset/base/259951 Log: Do not coalesce stack entry, vm_map_stack() asserts that the requested region is claimed by a new entry. Pass MAP_STACK_GROWS_DOWN and MAP_STACK_GROWS_UP flags to vm_map_insert() from vm_map_stack(), to really turn off coalescing code and call to vm_map_simplify_entry() [1]. Reported by: avg, peter, many Tested by: avg, peter Noted by: avg [1] Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Dec 27 16:57:38 2013 (r259950) +++ head/sys/vm/vm_map.c Fri Dec 27 16:59:47 2013 (r259951) @@ -1207,6 +1207,7 @@ charged: } else if ((prev_entry != &map->header) && (prev_entry->eflags == protoeflags) && + (cow & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP)) == 0 && (prev_entry->end == start) && (prev_entry->wired_count == 0) && (prev_entry->cred == cred || @@ -3339,7 +3340,6 @@ vm_map_stack(vm_map_t map, vm_offset_t a * NOTE: We explicitly allow bi-directional stacks. */ orient = cow & (MAP_STACK_GROWS_DOWN|MAP_STACK_GROWS_UP); - cow &= ~orient; KASSERT(orient != 0, ("No stack grow direction")); if (addrbos < vm_map_min(map) || From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 17:01:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F960546; Fri, 27 Dec 2013 17:01:48 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 83C811EEE; Fri, 27 Dec 2013 17:01:47 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id x13so8416943wgg.7 for ; Fri, 27 Dec 2013 09:01:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=oxGQUZh3Or8jfSfi3Lrq39gSAvb30fffWEXkzbQ581I=; b=Gu4LZSHiNSIX3EZaF8b5HDXg6JITITjYgL6uXZLfZMIUXvV2uOsclcIyX87OQTRGSm AoSr0HGueIr6NgABZ8SvAualcqROSgWe0BEoq1II2NmAt6vhlDljKsSQSgZYnSGZ5f6m rI1Aw0EhFi4cqpeXChKbgR0J997dLM1uxrQ1Q371MiJFapMPG7IxfK4sMVpqa5OIWYmQ Vi0DYBiow6J52EBqjS3yK+MDsO+LGVdZTiYy2WYE/obKLIaYZt+s12ZG2MaiV0lklakC ztObe+r1HN8v6CvNw9D0v3qekbcnd81/fxqhi8wss293wLiZI4HynMOXLPGtLTn7WFbC rSbw== MIME-Version: 1.0 X-Received: by 10.180.108.132 with SMTP id hk4mr34743908wib.12.1388163705169; Fri, 27 Dec 2013 09:01:45 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.217.117.197 with HTTP; Fri, 27 Dec 2013 09:01:45 -0800 (PST) In-Reply-To: <20131226204445.GA54038@stack.nl> References: <201312261916.rBQJGVcs034015@svn.freebsd.org> <20131226204445.GA54038@stack.nl> Date: Fri, 27 Dec 2013 21:01:45 +0400 X-Google-Sender-Auth: j8JQRW94ibYhIxDaQJRSUQwyQOw Message-ID: Subject: Re: svn commit: r259921 - head/lib/libc/sys From: Sergey Kandaurov To: Jilles Tjoelker Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 17:01:48 -0000 On 27 December 2013 00:44, Jilles Tjoelker wrote: > On Thu, Dec 26, 2013 at 07:16:31PM +0000, Sergey Kandaurov wrote: >> Author: pluknet >> Date: Thu Dec 26 19:16:30 2013 >> New Revision: 259921 >> URL: http://svnweb.freebsd.org/changeset/base/259921 > >> Log: >> Provide the manual page for aio_fsync(2). > >> Reviewed by: davidxu >> MFC after: 1 week > >> Added: head/lib/libc/sys/aio_fsync.2 >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/lib/libc/sys/aio_fsync.2 Thu Dec 26 19:16:30 2013 (r259921) >> @@ -0,0 +1,152 @@ >> [snip] >> +The >> +.Fa op >> +argument could be set only to > > I suppose the op argument "must" be set to O_SYNC, rather than "could > only" be set to O_SYNC. Alternatively, it "can only" be set to O_SYNC. Thank you for feedback. Right, this can/could was overlooked. > >> +.Dv O_SYNC >> +to cause all currently queued I/O operations to be completed >> +as if by a call to >> +.Xr fsync 2 . >> +.Pp >> [snip] >> +.Bl -tag -width Er >> +.It Bq Er EBADF >> +The >> +.Fa iocb->aio_fildes >> +is invalid for writing. > > This is what current POSIX standards say, but it does not make sense and > does not work that way. Any open file descriptor is sufficient, since > the access mode does not affect whether there are pending I/O operations > on the underlying file. See http://austingroupbugs.net/view.php?id=671 > which FreeBSD already implements (from reading the code). > > The text from fsync(2) can be used: > > .It Bq Er EBADF > The > .Fa iocb->aio_fildes > argument > is not a valid descriptor. This was one of those tricky parts in writing this man page... > >> [snip] >> +.Pp >> +If the request is successfully enqueued, but subsequently cancelled >> +or an error occurs, the value returned by the >> +.Fn aio_return >> +system call is per the >> +.Xr read 2 >> +and >> +.Xr write 2 >> +system calls, and the value returned by the >> +.Fn aio_error >> +system call is one of the error returns from the >> +.Xr read 2 >> +or >> +.Xr write 2 >> +system calls. > > The reference to read() and write() is in fact correct, and is missing > from the fsync(2) page. For example, [EDQUOT] or [ENOSPC] may be seen on > a network filesystem. Ok. -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 17:04:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8ABC46AD; Fri, 27 Dec 2013 17:04:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77C4C1EFE; Fri, 27 Dec 2013 17:04:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRH4qiu027659; Fri, 27 Dec 2013 17:04:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRH4qL1027658; Fri, 27 Dec 2013 17:04:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312271704.rBRH4qL1027658@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 27 Dec 2013 17:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259952 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 17:04:52 -0000 Author: kib Date: Fri Dec 27 17:04:51 2013 New Revision: 259952 URL: http://svnweb.freebsd.org/changeset/base/259952 Log: Revert r259200. There are geoms/drivers which do not update bio_completed, only manage bio_resid, e.g. sa(4). Reported and tested by: Manfred Antar Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Dec 27 16:59:47 2013 (r259951) +++ head/sys/kern/vfs_bio.c Fri Dec 27 17:04:51 2013 (r259952) @@ -3678,7 +3678,7 @@ bufdonebio(struct bio *bip) struct buf *bp; bp = bip->bio_caller2; - bp->b_resid = bp->b_bcount - bip->bio_completed; + bp->b_resid = bip->bio_resid; bp->b_ioflags = bip->bio_flags; bp->b_error = bip->bio_error; if (bp->b_error) From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 17:09:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7A0782E; Fri, 27 Dec 2013 17:09:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3AAD1F1B; Fri, 27 Dec 2013 17:09:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRH9xWg028398; Fri, 27 Dec 2013 17:09:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRH9xoU028397; Fri, 27 Dec 2013 17:09:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312271709.rBRH9xoU028397@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 27 Dec 2013 17:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259953 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 17:10:00 -0000 Author: kib Date: Fri Dec 27 17:09:59 2013 New Revision: 259953 URL: http://svnweb.freebsd.org/changeset/base/259953 Log: Fix accounting for the negative cache entries when reusing v_cache_dd. Having ncneg diverge with the actual length of the ncneg tailq causes NULL dereference. Add assertion that an entry taken from ncneg queue is indeed negative. Reported by and discussed with: avg Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Dec 27 17:04:51 2013 (r259952) +++ head/sys/kern/vfs_cache.c Fri Dec 27 17:09:59 2013 (r259953) @@ -748,16 +748,20 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp ncp->nc_flag & NCF_ISDOTDOT) { KASSERT(ncp->nc_dvp == dvp, ("wrong isdotdot parent")); - if (ncp->nc_vp != NULL) + if (ncp->nc_vp != NULL) { TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); - else + } else { TAILQ_REMOVE(&ncneg, ncp, nc_dst); - if (vp != NULL) + numneg--; + } + if (vp != NULL) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); - else + } else { TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); + numneg++; + } ncp->nc_vp = vp; CACHE_WUNLOCK(); return; @@ -893,6 +897,8 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp } if (numneg * ncnegfactor > numcache) { ncp = TAILQ_FIRST(&ncneg); + KASSERT(ncp->nc_vp == NULL, ("ncp %p vp %p on ncneg", + ncp, ncp->nc_vp)); zap = 1; } if (hold) From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 17:10:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5E3B969; Fri, 27 Dec 2013 17:10:27 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99E4A1F1F; Fri, 27 Dec 2013 17:10:27 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 40CC7B946; Fri, 27 Dec 2013 12:10:26 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r259859 - head/sys/netinet/libalias Date: Fri, 27 Dec 2013 11:26:47 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312250324.rBP3OKqV015383@svn.freebsd.org> <201312261104.54970.jhb@freebsd.org> <20131226200741.GV71033@FreeBSD.org> In-Reply-To: <20131226200741.GV71033@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201312271126.47194.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 27 Dec 2013 12:10:26 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 17:10:27 -0000 On Thursday, December 26, 2013 3:07:41 pm Gleb Smirnoff wrote: > On Thu, Dec 26, 2013 at 11:04:54AM -0500, John Baldwin wrote: > J> On Tuesday, December 24, 2013 10:24:20 pm Gleb Smirnoff wrote: > J> > Author: glebius > J> > Date: Wed Dec 25 03:24:20 2013 > J> > New Revision: 259859 > J> > URL: http://svnweb.freebsd.org/changeset/base/259859 > J> > > J> > Log: > J> > Cleanup alias module handler register/unregister. > J> > > J> > - Remove locking, since all module(9) events are running under &Giant. > J> > J> Eh, at some point that will go away. > > Are they going to be serialized by default? Wasn't really planning on that. Perhaps they should be however. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 17:36:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8236215; Fri, 27 Dec 2013 17:36:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9CBF1117D; Fri, 27 Dec 2013 17:36:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRHahgl039969; Fri, 27 Dec 2013 17:36:43 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRHahLb039968; Fri, 27 Dec 2013 17:36:43 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312271736.rBRHahLb039968@svn.freebsd.org> From: Glen Barber Date: Fri, 27 Dec 2013 17:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259955 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 17:36:43 -0000 Author: gjb Date: Fri Dec 27 17:36:43 2013 New Revision: 259955 URL: http://svnweb.freebsd.org/changeset/base/259955 Log: Move build_doc_ports() to the if...fi block from which it is called. Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Fri Dec 27 17:32:48 2013 (r259954) +++ head/release/release.sh Fri Dec 27 17:36:43 2013 (r259955) @@ -173,21 +173,6 @@ mount -t devfs devfs ${CHROOTDIR}/dev cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit -build_doc_ports() { - # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints - # is created. This is needed by ports-mgmt/pkg. - chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart - - ## Trick the ports 'run-autotools-fixup' target to do the right thing. - _OSVERSION=$(sysctl -n kern.osreldate) - if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then - PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" - PBUILD_FLAGS="${PBUILD_FLAGS}" - chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ - ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" install clean distclean - fi -} - # If MAKE_CONF and/or SRC_CONF are set and not character devices (/dev/null), # copy them to the chroot. if [ -e ${MAKE_CONF} ] && [ ! -c ${MAKE_CONF} ]; then @@ -200,7 +185,18 @@ if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CO fi if [ -d ${CHROOTDIR}/usr/ports ]; then - build_doc_ports ${CHROOTDIR} + # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints + # is created. This is needed by ports-mgmt/pkg. + chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart + + ## Trick the ports 'run-autotools-fixup' target to do the right thing. + _OSVERSION=$(sysctl -n kern.osreldate) + if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then + PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" + PBUILD_FLAGS="${PBUILD_FLAGS}" + chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ + ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" install clean distclean + fi fi if [ "x${RELSTRING}" = "x" ]; then From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 19:51:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75CEAC9C; Fri, 27 Dec 2013 19:51:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 57FA21A9C; Fri, 27 Dec 2013 19:51:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRJpITi091561; Fri, 27 Dec 2013 19:51:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRJpIwf091560; Fri, 27 Dec 2013 19:51:18 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312271951.rBRJpIwf091560@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 27 Dec 2013 19:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259959 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 19:51:18 -0000 Author: marcel Date: Fri Dec 27 19:51:17 2013 New Revision: 259959 URL: http://svnweb.freebsd.org/changeset/base/259959 Log: Add the scaffolding for minidumps. They're just like physical dumps, except the chunks aren't physical memory regions but virtual memory regions. In both cases, the core file is an ELF file and flags in the header allow libkvm to distinguish one from the other. Modified: head/sys/ia64/ia64/dump_machdep.c Modified: head/sys/ia64/ia64/dump_machdep.c ============================================================================== --- head/sys/ia64/ia64/dump_machdep.c Fri Dec 27 18:00:38 2013 (r259958) +++ head/sys/ia64/ia64/dump_machdep.c Fri Dec 27 19:51:17 2013 (r259959) @@ -56,7 +56,10 @@ CTASSERT(sizeof(struct kerneldumpheader) #define MD_ALIGN(x) (((off_t)(x) + EFI_PAGE_MASK) & ~EFI_PAGE_MASK) #define DEV_ALIGN(x) (((off_t)(x) + (DEV_BSIZE-1)) & ~(DEV_BSIZE-1)) -typedef int callback_t(struct efi_md*, int, void*); +static int minidump = 0; +TUNABLE_INT("debug.minidump", &minidump); +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &minidump, 0, + "Enable mini crash dumps"); static struct kerneldumpheader kdh; static off_t dumplo, fileofs; @@ -83,7 +86,7 @@ buf_write(struct dumperinfo *di, char *p error = dump_write(di, buffer, 0, dumplo, DEV_BSIZE); if (error) - return error; + return (error); dumplo += DEV_BSIZE; fragsz = 0; } @@ -106,8 +109,14 @@ buf_flush(struct dumperinfo *di) return (error); } +/* + * Physical dump support + */ + +typedef int phys_callback_t(struct efi_md*, int, void*); + static int -cb_dumpdata(struct efi_md *mdp, int seqnr, void *arg) +phys_cb_dumpdata(struct efi_md *mdp, int seqnr, void *arg) { struct dumperinfo *di = (struct dumperinfo*)arg; vm_offset_t pa; @@ -153,7 +162,7 @@ cb_dumpdata(struct efi_md *mdp, int seqn } static int -cb_dumphdr(struct efi_md *mdp, int seqnr, void *arg) +phys_cb_dumphdr(struct efi_md *mdp, int seqnr, void *arg) { struct dumperinfo *di = (struct dumperinfo*)arg; Elf64_Phdr phdr; @@ -175,7 +184,7 @@ cb_dumphdr(struct efi_md *mdp, int seqnr } static int -cb_size(struct efi_md *mdp, int seqnr, void *arg) +phys_cb_size(struct efi_md *mdp, int seqnr, void *arg) { uint64_t *sz = (uint64_t*)arg; @@ -184,7 +193,7 @@ cb_size(struct efi_md *mdp, int seqnr, v } static int -foreach_chunk(callback_t cb, void *arg) +phys_foreach(phys_callback_t cb, void *arg) { struct efi_md *mdp; int error, seqnr; @@ -206,6 +215,31 @@ foreach_chunk(callback_t cb, void *arg) return (seqnr); } +/* + * Virtual dump (aka minidump) support + */ + +static int +virt_size(uint64_t *dumpsize) +{ + + return (0); +} + +static int +virt_dumphdrs(struct dumperinfo *di) +{ + + return (-ENOSYS); +} + +static int +virt_dumpdata(struct dumperinfo *di) +{ + + return (-ENOSYS); +} + void dumpsys(struct dumperinfo *di) { @@ -213,7 +247,7 @@ dumpsys(struct dumperinfo *di) uint64_t dumpsize; off_t hdrgap; size_t hdrsz; - int error; + int error, status; bzero(&ehdr, sizeof(ehdr)); ehdr.e_ident[EI_MAG0] = ELFMAG0; @@ -230,18 +264,25 @@ dumpsys(struct dumperinfo *di) ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ ehdr.e_type = ET_CORE; ehdr.e_machine = EM_IA_64; - ehdr.e_entry = ia64_tpa((uintptr_t)bootinfo); + ehdr.e_entry = (minidump) ? (uintptr_t)bootinfo : + ia64_tpa((uintptr_t)bootinfo); ehdr.e_phoff = sizeof(ehdr); - ehdr.e_flags = EF_IA_64_ABSOLUTE; /* XXX misuse? */ + ehdr.e_flags = (minidump) ? 0 : EF_IA_64_ABSOLUTE; /* XXX misuse? */ ehdr.e_ehsize = sizeof(ehdr); ehdr.e_phentsize = sizeof(Elf64_Phdr); ehdr.e_shentsize = sizeof(Elf64_Shdr); /* Calculate dump size. */ dumpsize = 0L; - ehdr.e_phnum = foreach_chunk(cb_size, &dumpsize); + status = (minidump) ? virt_size(&dumpsize) : + phys_foreach(phys_cb_size, &dumpsize); + if (status < 0) { + error = -status; + goto fail; + } + ehdr.e_phnum = status; hdrsz = ehdr.e_phoff + ehdr.e_phnum * ehdr.e_phentsize; - fileofs = MD_ALIGN(hdrsz); + fileofs = (minidump) ? round_page(hdrsz) : MD_ALIGN(hdrsz); dumpsize += fileofs; hdrgap = fileofs - DEV_ALIGN(hdrsz); @@ -270,24 +311,30 @@ dumpsys(struct dumperinfo *di) goto fail; /* Dump program headers */ - error = foreach_chunk(cb_dumphdr, di); - if (error < 0) + status = (minidump) ? virt_dumphdrs(di) : + phys_foreach(phys_cb_dumphdr, di); + if (status < 0) { + error = -status; goto fail; + } buf_flush(di); /* * All headers are written using blocked I/O, so we know the - * current offset is (still) block aligned. Skip the alignement + * current offset is (still) block aligned. Skip the alignment * in the file to have the segment contents aligned at page - * boundary. We cannot use MD_ALIGN on dumplo, because we don't - * care and may very well be unaligned within the dump device. + * boundary. For physical dumps, it's the EFI page size (= 4K). + * For minidumps it's the kernel's page size (= 8K). */ dumplo += hdrgap; /* Dump memory chunks (updates dumplo) */ - error = foreach_chunk(cb_dumpdata, di); - if (error < 0) + status = (minidump) ? virt_dumpdata(di) : + phys_foreach(phys_cb_dumpdata, di); + if (status < 0) { + error = -status; goto fail; + } /* Dump trailer */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); @@ -300,9 +347,6 @@ dumpsys(struct dumperinfo *di) return; fail: - if (error < 0) - error = -error; - if (error == ECANCELED) printf("\nDump aborted\n"); else From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 20:18:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C06FE4E4; Fri, 27 Dec 2013 20:18:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC8B51D1C; Fri, 27 Dec 2013 20:18:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRKIKXf002125; Fri, 27 Dec 2013 20:18:20 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRKIKEN002123; Fri, 27 Dec 2013 20:18:20 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312272018.rBRKIKEN002123@svn.freebsd.org> From: Neel Natu Date: Fri, 27 Dec 2013 20:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259961 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 20:18:20 -0000 Author: neel Date: Fri Dec 27 20:18:19 2013 New Revision: 259961 URL: http://svnweb.freebsd.org/changeset/base/259961 Log: Modify handling of writes to the vlapic ICR_TIMER, DCR_TIMER, ICRLO and ESR registers. The handler is now called after the register value is updated in the virtual APIC page. This will make it easier to handle APIC-write VM-exits with APIC register virtualization turned on. We can no longer rely on the value of 'icr_timer' on the APIC page in the callout handler. With APIC register virtualization the value of 'icr_timer' will be updated by the processor in guest-context before an APIC-write VM-exit. Clear the 'delivery status' bit in the ICRLO register in the write handler. With APIC register virtualization the write happens in guest-context and we cannot prevent a (buggy) guest from setting this bit. Modified: head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Fri Dec 27 19:53:42 2013 (r259960) +++ head/sys/amd64/vmm/io/vlapic.c Fri Dec 27 20:18:19 2013 (r259961) @@ -100,14 +100,9 @@ do { \ /* * The 'vlapic->timer_mtx' is used to provide mutual exclusion between the - * vlapic_callout_handler() and vcpu accesses to the following registers: - * - initial count register aka icr_timer - * - current count register aka ccr_timer - * - divide config register aka dcr_timer + * vlapic_callout_handler() and vcpu accesses to: + * - timer_freq_bt, timer_period_bt, timer_fire_bt * - timer LVT register - * - * Note that the vlapic_callout_handler() does not write to any of these - * registers so they can be safely read from the vcpu context without locking. */ #define VLAPIC_TIMER_LOCK(vlapic) mtx_lock_spin(&((vlapic)->timer_mtx)) #define VLAPIC_TIMER_UNLOCK(vlapic) mtx_unlock_spin(&((vlapic)->timer_mtx)) @@ -273,8 +268,8 @@ vlapic_get_ccr(struct vlapic *vlapic) return (ccr); } -static void -vlapic_set_dcr(struct vlapic *vlapic, uint32_t dcr) +void +vlapic_dcr_write_handler(struct vlapic *vlapic) { struct LAPIC *lapic; int divisor; @@ -282,9 +277,9 @@ vlapic_set_dcr(struct vlapic *vlapic, ui lapic = vlapic->apic_page; VLAPIC_TIMER_LOCK(vlapic); - lapic->dcr_timer = dcr; - divisor = vlapic_timer_divisor(dcr); - VLAPIC_CTR2(vlapic, "vlapic dcr_timer=%#x, divisor=%d", dcr, divisor); + divisor = vlapic_timer_divisor(lapic->dcr_timer); + VLAPIC_CTR2(vlapic, "vlapic dcr_timer=%#x, divisor=%d", + lapic->dcr_timer, divisor); /* * Update the timer frequency and the timer period. @@ -299,8 +294,8 @@ vlapic_set_dcr(struct vlapic *vlapic, ui VLAPIC_TIMER_UNLOCK(vlapic); } -static void -vlapic_update_errors(struct vlapic *vlapic) +void +vlapic_esr_write_handler(struct vlapic *vlapic) { struct LAPIC *lapic; @@ -323,7 +318,9 @@ vlapic_reset(struct vlapic *vlapic) lapic->dfr = 0xffffffff; lapic->svr = APIC_SVR_VECTOR; vlapic_mask_lvts(vlapic); - vlapic_set_dcr(vlapic, 0); + + lapic->dcr_timer = 0; + vlapic_dcr_write_handler(vlapic); if (vlapic->vcpuid == 0) vlapic->boot_state = BS_RUNNING; /* BSP */ @@ -711,8 +708,6 @@ vlapic_callout_handler(void *arg) callout_deactivate(&vlapic->callout); - KASSERT(vlapic->apic_page->icr_timer != 0, ("timer is disabled")); - vlapic_fire_timer(vlapic); if (vlapic_periodic_timer(vlapic)) { @@ -757,16 +752,17 @@ done: VLAPIC_TIMER_UNLOCK(vlapic); } -static void -vlapic_set_icr_timer(struct vlapic *vlapic, uint32_t icr_timer) +void +vlapic_icrtmr_write_handler(struct vlapic *vlapic) { struct LAPIC *lapic; sbintime_t sbt; + uint32_t icr_timer; VLAPIC_TIMER_LOCK(vlapic); lapic = vlapic->apic_page; - lapic->icr_timer = icr_timer; + icr_timer = lapic->icr_timer; vlapic->timer_period_bt = vlapic->timer_freq_bt; bintime_mul(&vlapic->timer_period_bt, icr_timer); @@ -888,16 +884,22 @@ vlapic_calcdest(struct vm *vm, cpuset_t static VMM_STAT_ARRAY(IPIS_SENT, VM_MAXCPU, "ipis sent to vcpu"); -static int -lapic_process_icr(struct vlapic *vlapic, uint64_t icrval, bool *retu) +int +vlapic_icrlo_write_handler(struct vlapic *vlapic, bool *retu) { int i; bool phys; cpuset_t dmask; + uint64_t icrval; uint32_t dest, vec, mode; struct vlapic *vlapic2; struct vm_exit *vmexit; - + struct LAPIC *lapic; + + lapic = vlapic->apic_page; + lapic->icr_lo &= ~APIC_DELSTAT_PEND; + icrval = ((uint64_t)lapic->icr_hi << 32) | lapic->icr_lo; + if (x2apic(vlapic)) dest = icrval >> 32; else @@ -1088,7 +1090,7 @@ vlapic_svr_write_handler(struct vlapic * */ VLAPIC_CTR0(vlapic, "vlapic is software-enabled"); if (vlapic_periodic_timer(vlapic)) - vlapic_set_icr_timer(vlapic, lapic->icr_timer); + vlapic_icrtmr_write_handler(vlapic); } } } @@ -1155,6 +1157,8 @@ vlapic_read(struct vlapic *vlapic, uint6 break; case APIC_OFFSET_ICR_LOW: *data = lapic->icr_lo; + if (x2apic(vlapic)) + *data |= (uint64_t)lapic->icr_hi << 32; break; case APIC_OFFSET_ICR_HI: *data = lapic->icr_hi; @@ -1224,32 +1228,30 @@ vlapic_write(struct vlapic *vlapic, uint vlapic_svr_write_handler(vlapic); break; case APIC_OFFSET_ICR_LOW: - if (!x2apic(vlapic)) { - data &= 0xffffffff; - data |= (uint64_t)lapic->icr_hi << 32; - } - retval = lapic_process_icr(vlapic, data, retu); + lapic->icr_lo = data; + if (x2apic(vlapic)) + lapic->icr_hi = data >> 32; + retval = vlapic_icrlo_write_handler(vlapic, retu); break; case APIC_OFFSET_ICR_HI: - if (!x2apic(vlapic)) { - retval = 0; - lapic->icr_hi = data; - } + lapic->icr_hi = data; break; case APIC_OFFSET_CMCI_LVT: case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: vlapic_set_lvt(vlapic, offset, data); break; case APIC_OFFSET_TIMER_ICR: - vlapic_set_icr_timer(vlapic, data); + lapic->icr_timer = data; + vlapic_icrtmr_write_handler(vlapic); break; case APIC_OFFSET_TIMER_DCR: - vlapic_set_dcr(vlapic, data); + lapic->dcr_timer = data; + vlapic_dcr_write_handler(vlapic); break; case APIC_OFFSET_ESR: - vlapic_update_errors(vlapic); + vlapic_esr_write_handler(vlapic); break; case APIC_OFFSET_VER: case APIC_OFFSET_APR: Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Fri Dec 27 19:53:42 2013 (r259960) +++ head/sys/amd64/vmm/io/vlapic.h Fri Dec 27 20:18:19 2013 (r259961) @@ -76,4 +76,8 @@ void vlapic_id_write_handler(struct vlap void vlapic_ldr_write_handler(struct vlapic *vlapic); void vlapic_dfr_write_handler(struct vlapic *vlapic); void vlapic_svr_write_handler(struct vlapic *vlapic); +void vlapic_esr_write_handler(struct vlapic *vlapic); +int vlapic_icrlo_write_handler(struct vlapic *vlapic, bool *retu); +void vlapic_icrtmr_write_handler(struct vlapic *vlapic); +void vlapic_dcr_write_handler(struct vlapic *vlapic); #endif /* _VLAPIC_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 23:06:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DF61DF3; Fri, 27 Dec 2013 23:06:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6FE561864; Fri, 27 Dec 2013 23:06:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRN6G1A067323; Fri, 27 Dec 2013 23:06:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRN6GON067322; Fri, 27 Dec 2013 23:06:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312272306.rBRN6GON067322@svn.freebsd.org> From: Xin LI Date: Fri, 27 Dec 2013 23:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259973 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 23:06:16 -0000 Author: delphij Date: Fri Dec 27 23:06:15 2013 New Revision: 259973 URL: http://svnweb.freebsd.org/changeset/base/259973 Log: Tighten default restrictions for ntpd(8) server and provide a link to NTP access restriction documentation. The new default restrictions would allow only time queries from a remote system and will KoD all other requests, but still allow localhost to do make all requests. These restrictions are also recommended for all Internet-facing public NTP servers. This changeset is intended for an instant MFC to stable/10 and releng/10.0. Modified: head/etc/ntp.conf Modified: head/etc/ntp.conf ============================================================================== --- head/etc/ntp.conf Fri Dec 27 23:00:56 2013 (r259972) +++ head/etc/ntp.conf Fri Dec 27 23:06:15 2013 (r259973) @@ -17,7 +17,7 @@ # users with a static IP and good upstream NTP servers to add a server # to the pool. See http://www.pool.ntp.org/join.html if you are interested. # -# The option `iburst' is used for faster initial synchronisation. +# The option `iburst' is used for faster initial synchronization. # server 0.freebsd.pool.ntp.org iburst server 1.freebsd.pool.ntp.org iburst @@ -35,21 +35,37 @@ server 2.freebsd.pool.ntp.org iburst # server 2.CC.pool.ntp.org iburst # -# Security: Only accept NTP traffic from the following hosts. -# The following configuration example only accepts traffic from the -# above defined servers. +# Security: +# +# By default, only allow time queries and block all other requests +# from unauthenticated clients. +# +# See http://support.ntp.org/bin/view/Support/AccessRestrictions +# for more information. +# +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery +# +# Alternatively, the following rules would block all unauthorized access. +# +#restrict default ignore +#restrict -6 default ignore +# +# In this case, all remote NTP time servers also need to be explicitly +# allowed or they would not be able to exchange time information with +# this server. # # Please note that this example doesn't work for the servers in # the pool.ntp.org domain since they return multiple A records. -# (This is the reason that by default they are commented out) # -#restrict default ignore #restrict 0.pool.ntp.org nomodify nopeer noquery notrap #restrict 1.pool.ntp.org nomodify nopeer noquery notrap #restrict 2.pool.ntp.org nomodify nopeer noquery notrap -#restrict 127.0.0.1 -#restrict -6 ::1 -#restrict 127.127.1.0 +# +# The following settings allow unrestricted access from the localhost +restrict 127.0.0.1 +restrict -6 ::1 +restrict 127.127.1.0 # # If a server loses sync with all upstream servers, NTP clients From owner-svn-src-head@FreeBSD.ORG Fri Dec 27 23:16:34 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DE6E7EA; Fri, 27 Dec 2013 23:16:34 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F45E191A; Fri, 27 Dec 2013 23:16:33 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Vwgdm-0001Hr-V0; Fri, 27 Dec 2013 23:16:27 +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 rBRNGONT009658; Fri, 27 Dec 2013 16:16:24 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/MSyk1FOeN46VOXaNZZD20 Subject: Re: svn commit: r259973 - head/etc From: Ian Lepore To: Xin LI In-Reply-To: <201312272306.rBRN6GON067322@svn.freebsd.org> References: <201312272306.rBRN6GON067322@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 27 Dec 2013 16:16:24 -0700 Message-ID: <1388186184.1158.156.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 23:16:34 -0000 On Fri, 2013-12-27 at 23:06 +0000, Xin LI wrote: > Author: delphij > Date: Fri Dec 27 23:06:15 2013 > New Revision: 259973 > URL: http://svnweb.freebsd.org/changeset/base/259973 > > Log: > Tighten default restrictions for ntpd(8) server and provide a link > to NTP access restriction documentation. > > The new default restrictions would allow only time queries from a > remote system and will KoD all other requests, but still allow > localhost to do make all requests. > > These restrictions are also recommended for all Internet-facing > public NTP servers. > > This changeset is intended for an instant MFC to stable/10 and > releng/10.0. > > Modified: > head/etc/ntp.conf > > Modified: head/etc/ntp.conf > ============================================================================== > --- head/etc/ntp.conf Fri Dec 27 23:00:56 2013 (r259972) > +++ head/etc/ntp.conf Fri Dec 27 23:06:15 2013 (r259973) > @@ -17,7 +17,7 @@ > # users with a static IP and good upstream NTP servers to add a server > # to the pool. See http://www.pool.ntp.org/join.html if you are interested. > # > -# The option `iburst' is used for faster initial synchronisation. > +# The option `iburst' is used for faster initial synchronization. > # > server 0.freebsd.pool.ntp.org iburst > server 1.freebsd.pool.ntp.org iburst > @@ -35,21 +35,37 @@ server 2.freebsd.pool.ntp.org iburst > # server 2.CC.pool.ntp.org iburst > > # > -# Security: Only accept NTP traffic from the following hosts. > -# The following configuration example only accepts traffic from the > -# above defined servers. > +# Security: > +# > +# By default, only allow time queries and block all other requests > +# from unauthenticated clients. > +# > +# See http://support.ntp.org/bin/view/Support/AccessRestrictions > +# for more information. > +# > +restrict default kod nomodify notrap nopeer noquery > +restrict -6 default kod nomodify notrap nopeer noquery > +# > +# Alternatively, the following rules would block all unauthorized access. > +# > +#restrict default ignore > +#restrict -6 default ignore > +# > +# In this case, all remote NTP time servers also need to be explicitly > +# allowed or they would not be able to exchange time information with > +# this server. > # This comment is incorrect. To quote the ntpd docs for nopeer: Deny packets that might mobilize an association unless authenticated. This includes broadcast, symmetric-active and manycast server packets when a configured association does not exist. In other words, peer relationships which are explicitly configured in the ntp.conf file(s) are not affected, the nopeer option only prevents *packets* that would create a new peer association. > # Please note that this example doesn't work for the servers in > # the pool.ntp.org domain since they return multiple A records. > -# (This is the reason that by default they are commented out) > # > -#restrict default ignore > #restrict 0.pool.ntp.org nomodify nopeer noquery notrap > #restrict 1.pool.ntp.org nomodify nopeer noquery notrap > #restrict 2.pool.ntp.org nomodify nopeer noquery notrap The foregoing implies that these lines aren't needed. > -#restrict 127.0.0.1 > -#restrict -6 ::1 > -#restrict 127.127.1.0 > +# > +# The following settings allow unrestricted access from the localhost > +restrict 127.0.0.1 > +restrict -6 ::1 > +restrict 127.127.1.0 > > # > # If a server loses sync with all upstream servers, NTP clients -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 00:20:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1873C882; Sat, 28 Dec 2013 00:20:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03FC31D85; Sat, 28 Dec 2013 00:20:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBS0KthJ097575; Sat, 28 Dec 2013 00:20:55 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBS0Ktlo097572; Sat, 28 Dec 2013 00:20:55 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312280020.rBS0Ktlo097572@svn.freebsd.org> From: Neel Natu Date: Sat, 28 Dec 2013 00:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259978 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 00:20:56 -0000 Author: neel Date: Sat Dec 28 00:20:55 2013 New Revision: 259978 URL: http://svnweb.freebsd.org/changeset/base/259978 Log: Modify handling of writes to the vlapic LVT registers. The handler is now called after the register value is updated in the virtual APIC page. This will make it easier to handle APIC-write VM-exits with APIC register virtualization turned on. This also implies that we need to keep a snapshot of the last value written to a LVT register. We can no longer rely on the LVT registers in the APIC page to be "clean" because the guest can write anything to it before the hypervisor has had a chance to sanitize it. Modified: head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/io/vlapic_priv.h Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Sat Dec 28 00:16:58 2013 (r259977) +++ head/sys/amd64/vmm/io/vlapic.c Sat Dec 28 00:20:55 2013 (r259978) @@ -94,7 +94,6 @@ do { \ #define PRIO(x) ((x) >> 4) #define VLAPIC_VERSION (16) -#define VLAPIC_MAXLVT_ENTRIES (APIC_LVT_CMCI) #define x2apic(vlapic) (((vlapic)->msr_apicbase & APICBASE_X2APIC) ? 1 : 0) @@ -212,20 +211,6 @@ vlapic_timer_divisor(uint32_t dcr) } } -static void -vlapic_mask_lvts(struct vlapic *vlapic) -{ - struct LAPIC *lapic = vlapic->apic_page; - - lapic->lvt_cmci |= APIC_LVT_M; - lapic->lvt_timer |= APIC_LVT_M; - lapic->lvt_thermal |= APIC_LVT_M; - lapic->lvt_pcint |= APIC_LVT_M; - lapic->lvt_lint0 |= APIC_LVT_M; - lapic->lvt_lint1 |= APIC_LVT_M; - lapic->lvt_error |= APIC_LVT_M; -} - #if 0 static inline void vlapic_dump_lvt(uint32_t offset, uint32_t *lvt) @@ -304,32 +289,6 @@ vlapic_esr_write_handler(struct vlapic * vlapic->esr_pending = 0; } -static void -vlapic_reset(struct vlapic *vlapic) -{ - struct LAPIC *lapic; - - lapic = vlapic->apic_page; - bzero(lapic, sizeof(struct LAPIC)); - - lapic->id = vlapic_get_id(vlapic); - lapic->version = VLAPIC_VERSION; - lapic->version |= (VLAPIC_MAXLVT_ENTRIES << MAXLVTSHIFT); - lapic->dfr = 0xffffffff; - lapic->svr = APIC_SVR_VECTOR; - vlapic_mask_lvts(vlapic); - - lapic->dcr_timer = 0; - vlapic_dcr_write_handler(vlapic); - - if (vlapic->vcpuid == 0) - vlapic->boot_state = BS_RUNNING; /* BSP */ - else - vlapic->boot_state = BS_INIT; /* AP */ - - vlapic->svr_last = lapic->svr; -} - void vlapic_set_intr_ready(struct vlapic *vlapic, int vector, bool level) { @@ -388,24 +347,65 @@ vlapic_get_lvtptr(struct vlapic *vlapic, } } +static __inline int +lvt_off_to_idx(uint32_t offset) +{ + int index; + + switch (offset) { + case APIC_OFFSET_CMCI_LVT: + index = APIC_LVT_CMCI; + break; + case APIC_OFFSET_TIMER_LVT: + index = APIC_LVT_TIMER; + break; + case APIC_OFFSET_THERM_LVT: + index = APIC_LVT_THERMAL; + break; + case APIC_OFFSET_PERF_LVT: + index = APIC_LVT_PMC; + break; + case APIC_OFFSET_LINT0_LVT: + index = APIC_LVT_LINT0; + break; + case APIC_OFFSET_LINT1_LVT: + index = APIC_LVT_LINT1; + break; + case APIC_OFFSET_ERROR_LVT: + index = APIC_LVT_ERROR; + break; + default: + index = -1; + break; + } + KASSERT(index >= 0 && index <= VLAPIC_MAXLVT_INDEX, ("lvt_off_to_idx: " + "invalid lvt index %d for offset %#x", index, offset)); + + return (index); +} + static __inline uint32_t vlapic_get_lvt(struct vlapic *vlapic, uint32_t offset) { + int idx; + uint32_t val; - return (*vlapic_get_lvtptr(vlapic, offset)); + idx = lvt_off_to_idx(offset); + val = atomic_load_acq_32(&vlapic->lvt_last[idx]); + return (val); } -static void -vlapic_set_lvt(struct vlapic *vlapic, uint32_t offset, uint32_t val) +void +vlapic_lvt_write_handler(struct vlapic *vlapic, uint32_t offset) { - uint32_t *lvtptr, mask; + uint32_t *lvtptr, mask, val; struct LAPIC *lapic; + int idx; lapic = vlapic->apic_page; lvtptr = vlapic_get_lvtptr(vlapic, offset); - - if (offset == APIC_OFFSET_TIMER_LVT) - VLAPIC_TIMER_LOCK(vlapic); + val = *lvtptr; + idx = lvt_off_to_idx(offset); if (!(lapic->svr & APIC_SVR_ENABLE)) val |= APIC_LVT_M; @@ -424,10 +424,36 @@ vlapic_set_lvt(struct vlapic *vlapic, ui mask |= APIC_LVT_DM; break; } - *lvtptr = val & mask; + val &= mask; + *lvtptr = val; + atomic_store_rel_32(&vlapic->lvt_last[idx], val); +} + +static void +vlapic_mask_lvts(struct vlapic *vlapic) +{ + struct LAPIC *lapic = vlapic->apic_page; + + lapic->lvt_cmci |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_CMCI_LVT); + + lapic->lvt_timer |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_TIMER_LVT); + + lapic->lvt_thermal |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_THERM_LVT); + + lapic->lvt_pcint |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_PERF_LVT); + + lapic->lvt_lint0 |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_LINT0_LVT); + + lapic->lvt_lint1 |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_LINT1_LVT); - if (offset == APIC_OFFSET_TIMER_LVT) - VLAPIC_TIMER_UNLOCK(vlapic); + lapic->lvt_error |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_ERROR_LVT); } static int @@ -648,7 +674,7 @@ vlapic_fire_cmci(struct vlapic *vlapic) } } -static VMM_STAT_ARRAY(LVTS_TRIGGERRED, VLAPIC_MAXLVT_ENTRIES, +static VMM_STAT_ARRAY(LVTS_TRIGGERRED, VLAPIC_MAXLVT_INDEX + 1, "lvts triggered"); int @@ -1166,6 +1192,11 @@ vlapic_read(struct vlapic *vlapic, uint6 case APIC_OFFSET_CMCI_LVT: case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: *data = vlapic_get_lvt(vlapic, offset); +#ifdef INVARIANTS + reg = vlapic_get_lvtptr(vlapic, offset); + KASSERT(*data == *reg, ("inconsistent lvt value at " + "offset %#lx: %#lx/%#x", offset, *data, *reg)); +#endif break; case APIC_OFFSET_TIMER_ICR: *data = lapic->icr_timer; @@ -1190,6 +1221,7 @@ int vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data, bool *retu) { struct LAPIC *lapic = vlapic->apic_page; + uint32_t *regptr; int retval; KASSERT((offset & 0xf) == 0 && offset < PAGE_SIZE, @@ -1238,7 +1270,9 @@ vlapic_write(struct vlapic *vlapic, uint break; case APIC_OFFSET_CMCI_LVT: case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: - vlapic_set_lvt(vlapic, offset, data); + regptr = vlapic_get_lvtptr(vlapic, offset); + *regptr = data; + vlapic_lvt_write_handler(vlapic, offset); break; case APIC_OFFSET_TIMER_ICR: lapic->icr_timer = data; @@ -1269,6 +1303,32 @@ vlapic_write(struct vlapic *vlapic, uint return (retval); } +static void +vlapic_reset(struct vlapic *vlapic) +{ + struct LAPIC *lapic; + + lapic = vlapic->apic_page; + bzero(lapic, sizeof(struct LAPIC)); + + lapic->id = vlapic_get_id(vlapic); + lapic->version = VLAPIC_VERSION; + lapic->version |= (VLAPIC_MAXLVT_INDEX << MAXLVTSHIFT); + lapic->dfr = 0xffffffff; + lapic->svr = APIC_SVR_VECTOR; + vlapic_mask_lvts(vlapic); + + lapic->dcr_timer = 0; + vlapic_dcr_write_handler(vlapic); + + if (vlapic->vcpuid == 0) + vlapic->boot_state = BS_RUNNING; /* BSP */ + else + vlapic->boot_state = BS_INIT; /* AP */ + + vlapic->svr_last = lapic->svr; +} + void vlapic_init(struct vlapic *vlapic) { Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Sat Dec 28 00:16:58 2013 (r259977) +++ head/sys/amd64/vmm/io/vlapic.h Sat Dec 28 00:20:55 2013 (r259978) @@ -80,4 +80,5 @@ void vlapic_esr_write_handler(struct vla int vlapic_icrlo_write_handler(struct vlapic *vlapic, bool *retu); void vlapic_icrtmr_write_handler(struct vlapic *vlapic); void vlapic_dcr_write_handler(struct vlapic *vlapic); +void vlapic_lvt_write_handler(struct vlapic *vlapic, uint32_t offset); #endif /* _VLAPIC_H_ */ Modified: head/sys/amd64/vmm/io/vlapic_priv.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic_priv.h Sat Dec 28 00:16:58 2013 (r259977) +++ head/sys/amd64/vmm/io/vlapic_priv.h Sat Dec 28 00:20:55 2013 (r259978) @@ -29,6 +29,8 @@ #ifndef _VLAPIC_PRIV_H_ #define _VLAPIC_PRIV_H_ +#include + /* * APIC Register: Offset Description */ @@ -91,6 +93,8 @@ enum boot_state { */ #define ISRVEC_STK_SIZE (16 + 1) +#define VLAPIC_MAXLVT_INDEX APIC_LVT_CMCI + struct vlapic { struct vm *vm; int vcpuid; @@ -111,12 +115,20 @@ struct vlapic { * The vector on the top of the stack is used to compute the * Processor Priority in conjunction with the TPR. */ - uint8_t isrvec_stk[ISRVEC_STK_SIZE]; - int isrvec_stk_top; + uint8_t isrvec_stk[ISRVEC_STK_SIZE]; + int isrvec_stk_top; + + uint64_t msr_apicbase; + enum boot_state boot_state; - uint64_t msr_apicbase; - enum boot_state boot_state; - uint32_t svr_last; + /* + * Copies of some registers in the virtual APIC page. We do this for + * a couple of different reasons: + * - to be able to detect what changed (e.g. svr_last) + * - to maintain a coherent snapshot of the register (e.g. lvt_last) + */ + uint32_t svr_last; + uint32_t lvt_last[VLAPIC_MAXLVT_INDEX + 1]; }; void vlapic_init(struct vlapic *vlapic); From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 01:27:10 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B4603E6; Sat, 28 Dec 2013 01:27:10 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE9C116E; Sat, 28 Dec 2013 01:27:09 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [69.198.165.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id BF21F2615B; Fri, 27 Dec 2013 17:27:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1388194029; bh=lzTyQZrZMhf8K/mBFearVAUH4Grrr/0GjIpjk4aBW6Q=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=OEhtFu1Bo4YgPd6lWSskproSEBU1RY8X0DahFKAmMvAoO3Rf0P8GU/bzbiWrzBFbi /EgWNLzancQLMGHOQGvQ/u+3K6BPyLsF/R6eiPiIsTIPATPYRHcgC3RFnc/xFOqUXx gaKhkgtA663MNacJpMukLajGfgV6uZagHvzzNoU0= Message-ID: <52BE28ED.8080401@delphij.net> Date: Fri, 27 Dec 2013 17:27:09 -0800 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Ian Lepore , Xin LI Subject: Re: svn commit: r259973 - head/etc References: <201312272306.rBRN6GON067322@svn.freebsd.org> <1388186184.1158.156.camel@revolution.hippie.lan> In-Reply-To: <1388186184.1158.156.camel@revolution.hippie.lan> X-Enigmail-Version: 1.6 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 01:27:10 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 12/27/13 15:16, Ian Lepore wrote: > On Fri, 2013-12-27 at 23:06 +0000, Xin LI wrote: >> Author: delphij Date: Fri Dec 27 23:06:15 2013 New Revision: >> 259973 URL: http://svnweb.freebsd.org/changeset/base/259973 >> >> Log: Tighten default restrictions for ntpd(8) server and provide >> a link to NTP access restriction documentation. >> >> The new default restrictions would allow only time queries from >> a remote system and will KoD all other requests, but still allow >> localhost to do make all requests. >> >> These restrictions are also recommended for all Internet-facing >> public NTP servers. >> >> This changeset is intended for an instant MFC to stable/10 and >> releng/10.0. >> >> Modified: head/etc/ntp.conf >> >> Modified: head/etc/ntp.conf >> ============================================================================== >> >> - --- head/etc/ntp.conf Fri Dec 27 23:00:56 2013 (r259972) >> +++ head/etc/ntp.conf Fri Dec 27 23:06:15 2013 (r259973) @@ -17,7 >> +17,7 @@ # users with a static IP and good upstream NTP servers >> to add a server # to the pool. See >> http://www.pool.ntp.org/join.html if you are interested. # -# The >> option `iburst' is used for faster initial synchronisation. +# >> The option `iburst' is used for faster initial synchronization. >> # server 0.freebsd.pool.ntp.org iburst server >> 1.freebsd.pool.ntp.org iburst @@ -35,21 +35,37 @@ server >> 2.freebsd.pool.ntp.org iburst # server 2.CC.pool.ntp.org iburst >> >> # -# Security: Only accept NTP traffic from the following hosts. >> -# The following configuration example only accepts traffic from >> the -# above defined servers. +# Security: +# +# By default, only >> allow time queries and block all other requests +# from >> unauthenticated clients. +# +# See >> http://support.ntp.org/bin/view/Support/AccessRestrictions +# for >> more information. +# +restrict default kod nomodify notrap nopeer >> noquery +restrict -6 default kod nomodify notrap nopeer noquery >> +# +# Alternatively, the following rules would block all >> unauthorized access. +# +#restrict default ignore +#restrict -6 >> default ignore +# +# In this case, all remote NTP time servers >> also need to be explicitly +# allowed or they would not be able >> to exchange time information with +# this server. # > > This comment is incorrect. To quote the ntpd docs for nopeer: > > Deny packets that might mobilize an association unless > authenticated. This includes broadcast, symmetric-active and > manycast server packets when a configured association does not > exist. > > In other words, peer relationships which are explicitly configured > in the ntp.conf file(s) are not affected, the nopeer option only > prevents *packets* that would create a new peer association. > >> # Please note that this example doesn't work for the servers in # >> the pool.ntp.org domain since they return multiple A records. -# >> (This is the reason that by default they are commented out) # >> -#restrict default ignore #restrict 0.pool.ntp.org nomodify >> nopeer noquery notrap #restrict 1.pool.ntp.org nomodify nopeer >> noquery notrap #restrict 2.pool.ntp.org nomodify nopeer noquery >> notrap > > The foregoing implies that these lines aren't needed. I'm not sure if I get what you said. Did you mean these restrict lines are not needed when "restrict default ignore" is present? (My test suggests they are needed, this is also what the NTP documentation said: a 'server' line needs a 'restrict' line when the default is set to 'ignore'). Could you please use a patch to demonstrate how we can improve the comment? Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJSvijtAAoJEJW2GBstM+nsC/0QAJaylRKXg1qT/3hROFf6SDcV ENMV7Pl7UJMTP75K3zc+o4awoW7+NdXj8CYOSD0FczRdWahVxcw8p2d6gKAjX/R8 py2eqlRThfgrWViTEyTQk7Xv53OuY+7YKQI1qJb6T7U4VXAoGx1Jyp+02x5UDP4J UGWO20tRYuqsfZcUSfjRJZNRGn6OoxoHw+w+mLxlE7OA35XRNq/MwZnj7PEcuN3Q Gel56zzpsQ8aLuWCAbQxfBuhGaIng8RsYzo6jY+bVwsTqNNHAkv1v1de4PeeUkTh Gd+7Gsdq85EquaOyWfQg5HlQBVGDGVKop6kERrXdjzU1fk/iO+VfSyH6uX+VJFL5 Jc6ZQrVrhRDCcnsWodKqPfA0CvpxWwwkc0znBj0gGeEKv/KvzuLG8Djgyy8Do/s5 bUqC6JmWjiedXdtYR/q25pCQkbPQBWVjRpxlyOxAHaAfhYE2MysQh1aS3IN3keff AnWjvKKDmHw1DByEc7HoWdmT30xdURzHW6LqFiaGbNF+nukTYft+k+ttZIrcAcs1 Th5eZ5qrJOXgwHOV55ZDAGmmT6szwTecKy7Tmu/lK+4W/Nsah2YPdQhtm9VQAMqK Au/OiS1mHBhdioFVLPhAaVdG2MgqECmZs1mFk1rgf+pw1CCd2SIbEvV2KU+Wo5zZ lMkNRhirF24XYcPLJdS6 =FfpA -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 01:55:27 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BA7A2E2; Sat, 28 Dec 2013 01:55:27 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A1651319; Sat, 28 Dec 2013 01:55:27 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Vwj7d-000Mh0-UY; Sat, 28 Dec 2013 01:55:26 +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 rBS1tMFS009853; Fri, 27 Dec 2013 18:55:22 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18+E5N4i40p5y76OuY9jYNa Subject: Re: svn commit: r259973 - head/etc From: Ian Lepore To: d@delphij.net In-Reply-To: <52BE28ED.8080401@delphij.net> References: <201312272306.rBRN6GON067322@svn.freebsd.org> <1388186184.1158.156.camel@revolution.hippie.lan> <52BE28ED.8080401@delphij.net> Content-Type: text/plain; charset="us-ascii" Date: Fri, 27 Dec 2013 18:55:22 -0700 Message-ID: <1388195722.1158.173.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, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 01:55:27 -0000 On Fri, 2013-12-27 at 17:27 -0800, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 12/27/13 15:16, Ian Lepore wrote: > > On Fri, 2013-12-27 at 23:06 +0000, Xin LI wrote: > >> Author: delphij Date: Fri Dec 27 23:06:15 2013 New Revision: > >> 259973 URL: http://svnweb.freebsd.org/changeset/base/259973 > >> > >> Log: Tighten default restrictions for ntpd(8) server and provide > >> a link to NTP access restriction documentation. > >> > >> The new default restrictions would allow only time queries from > >> a remote system and will KoD all other requests, but still allow > >> localhost to do make all requests. > >> > >> These restrictions are also recommended for all Internet-facing > >> public NTP servers. > >> > >> This changeset is intended for an instant MFC to stable/10 and > >> releng/10.0. > >> > >> Modified: head/etc/ntp.conf > >> > >> Modified: head/etc/ntp.conf > >> ============================================================================== > >> > >> > - --- head/etc/ntp.conf Fri Dec 27 23:00:56 2013 (r259972) > >> +++ head/etc/ntp.conf Fri Dec 27 23:06:15 2013 (r259973) @@ -17,7 > >> +17,7 @@ # users with a static IP and good upstream NTP servers > >> to add a server # to the pool. See > >> http://www.pool.ntp.org/join.html if you are interested. # -# The > >> option `iburst' is used for faster initial synchronisation. +# > >> The option `iburst' is used for faster initial synchronization. > >> # server 0.freebsd.pool.ntp.org iburst server > >> 1.freebsd.pool.ntp.org iburst @@ -35,21 +35,37 @@ server > >> 2.freebsd.pool.ntp.org iburst # server 2.CC.pool.ntp.org iburst > >> > >> # -# Security: Only accept NTP traffic from the following hosts. > >> -# The following configuration example only accepts traffic from > >> the -# above defined servers. +# Security: +# +# By default, only > >> allow time queries and block all other requests +# from > >> unauthenticated clients. +# +# See > >> http://support.ntp.org/bin/view/Support/AccessRestrictions +# for > >> more information. +# +restrict default kod nomodify notrap nopeer > >> noquery +restrict -6 default kod nomodify notrap nopeer noquery > >> +# +# Alternatively, the following rules would block all > >> unauthorized access. +# +#restrict default ignore +#restrict -6 > >> default ignore +# +# In this case, all remote NTP time servers > >> also need to be explicitly +# allowed or they would not be able > >> to exchange time information with +# this server. # > > > > This comment is incorrect. To quote the ntpd docs for nopeer: > > > > Deny packets that might mobilize an association unless > > authenticated. This includes broadcast, symmetric-active and > > manycast server packets when a configured association does not > > exist. > > > > In other words, peer relationships which are explicitly configured > > in the ntp.conf file(s) are not affected, the nopeer option only > > prevents *packets* that would create a new peer association. > > > >> # Please note that this example doesn't work for the servers in # > >> the pool.ntp.org domain since they return multiple A records. -# > >> (This is the reason that by default they are commented out) # > >> -#restrict default ignore #restrict 0.pool.ntp.org nomodify > >> nopeer noquery notrap #restrict 1.pool.ntp.org nomodify nopeer > >> noquery notrap #restrict 2.pool.ntp.org nomodify nopeer noquery > >> notrap > > > > The foregoing implies that these lines aren't needed. > > I'm not sure if I get what you said. Did you mean these restrict > lines are not needed when "restrict default ignore" is present? (My > test suggests they are needed, this is also what the NTP documentation > said: a 'server' line needs a 'restrict' line when the default is set > to 'ignore'). Could you please use a patch to demonstrate how we can > improve the comment? Ooops, my bad, I misread the diff. I just saw the -default ignore line, not that it had moved up a few lines. My remark was in the context of not needing to "undo" the effect of the nopeer option. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 01:57:47 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECCD46A4; Sat, 28 Dec 2013 01:57:47 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C786B1323; Sat, 28 Dec 2013 01:57:47 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [69.198.165.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 6DB55263C1; Fri, 27 Dec 2013 17:57:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1388195867; bh=Egb/vHnm8n3ewli6OVt/xFGzO2teusNgbmhXgZxptjo=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=aX1KJ6XJzS+MBR5CFsGR4L+KzjBd75DYJBXS2iw3Ga4x3l8OYFPTfMMd9Ue7Up5WN 3stqKanCLRI08zuy6qoG0rlyHsvXqwnEFx6FC3rmSAirSvDuGVE5IAe+nwPZ2qdamE gv+mjOHOWo5plM6Go7rTHok4lHe0WLBidDefF+W4= Message-ID: <52BE301B.3030202@delphij.net> Date: Fri, 27 Dec 2013 17:57:47 -0800 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Ian Lepore , d@delphij.net Subject: Re: svn commit: r259973 - head/etc References: <201312272306.rBRN6GON067322@svn.freebsd.org> <1388186184.1158.156.camel@revolution.hippie.lan> <52BE28ED.8080401@delphij.net> <1388195722.1158.173.camel@revolution.hippie.lan> In-Reply-To: <1388195722.1158.173.camel@revolution.hippie.lan> X-Enigmail-Version: 1.6 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, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 01:57:48 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 12/27/13 17:55, Ian Lepore wrote: > On Fri, 2013-12-27 at 17:27 -0800, Xin Li wrote: >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 >> >> On 12/27/13 15:16, Ian Lepore wrote: >>> On Fri, 2013-12-27 at 23:06 +0000, Xin LI wrote: >>>> Author: delphij Date: Fri Dec 27 23:06:15 2013 New Revision: >>>> 259973 URL: http://svnweb.freebsd.org/changeset/base/259973 >>>> >>>> Log: Tighten default restrictions for ntpd(8) server and >>>> provide a link to NTP access restriction documentation. >>>> >>>> The new default restrictions would allow only time queries >>>> from a remote system and will KoD all other requests, but >>>> still allow localhost to do make all requests. >>>> >>>> These restrictions are also recommended for all >>>> Internet-facing public NTP servers. >>>> >>>> This changeset is intended for an instant MFC to stable/10 >>>> and releng/10.0. >>>> >>>> Modified: head/etc/ntp.conf >>>> >>>> Modified: head/etc/ntp.conf >>>> ============================================================================== >>>> >>>> >> >>>> - - --- head/etc/ntp.conf Fri Dec 27 23:00:56 2013 (r259972) >>>> +++ head/etc/ntp.conf Fri Dec 27 23:06:15 2013 (r259973) @@ >>>> -17,7 +17,7 @@ # users with a static IP and good upstream NTP >>>> servers to add a server # to the pool. See >>>> http://www.pool.ntp.org/join.html if you are interested. # -# >>>> The option `iburst' is used for faster initial >>>> synchronisation. +# The option `iburst' is used for faster >>>> initial synchronization. # server 0.freebsd.pool.ntp.org >>>> iburst server 1.freebsd.pool.ntp.org iburst @@ -35,21 +35,37 >>>> @@ server 2.freebsd.pool.ntp.org iburst # server >>>> 2.CC.pool.ntp.org iburst >>>> >>>> # -# Security: Only accept NTP traffic from the following >>>> hosts. -# The following configuration example only accepts >>>> traffic from the -# above defined servers. +# Security: +# +# >>>> By default, only allow time queries and block all other >>>> requests +# from unauthenticated clients. +# +# See >>>> http://support.ntp.org/bin/view/Support/AccessRestrictions +# >>>> for more information. +# +restrict default kod nomodify >>>> notrap nopeer noquery +restrict -6 default kod nomodify >>>> notrap nopeer noquery +# +# Alternatively, the following >>>> rules would block all unauthorized access. +# +#restrict >>>> default ignore +#restrict -6 default ignore +# +# In this >>>> case, all remote NTP time servers also need to be explicitly >>>> +# allowed or they would not be able to exchange time >>>> information with +# this server. # >>> >>> This comment is incorrect. To quote the ntpd docs for nopeer: >>> >>> Deny packets that might mobilize an association unless >>> authenticated. This includes broadcast, symmetric-active and >>> manycast server packets when a configured association does not >>> exist. >>> >>> In other words, peer relationships which are explicitly >>> configured in the ntp.conf file(s) are not affected, the nopeer >>> option only prevents *packets* that would create a new peer >>> association. >>> >>>> # Please note that this example doesn't work for the servers >>>> in # the pool.ntp.org domain since they return multiple A >>>> records. -# (This is the reason that by default they are >>>> commented out) # -#restrict default ignore #restrict >>>> 0.pool.ntp.org nomodify nopeer noquery notrap #restrict >>>> 1.pool.ntp.org nomodify nopeer noquery notrap #restrict >>>> 2.pool.ntp.org nomodify nopeer noquery notrap >>> >>> The foregoing implies that these lines aren't needed. >> >> I'm not sure if I get what you said. Did you mean these >> restrict lines are not needed when "restrict default ignore" is >> present? (My test suggests they are needed, this is also what >> the NTP documentation said: a 'server' line needs a 'restrict' >> line when the default is set to 'ignore'). Could you please use >> a patch to demonstrate how we can improve the comment? > > Ooops, my bad, I misread the diff. I just saw the -default ignore > line, not that it had moved up a few lines. My remark was in the > context of not needing to "undo" the effect of the nopeer option. > I see, that's okay. Is there any other problem in the comment, etc.? Another pair of eye would always be helpful to catch errors :) Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJSvjAbAAoJEJW2GBstM+nsm94QAJ3Q5LUzrAl84bBHIEUyDXRv Udk5w/ZS4hmzfsDHtDV3NCtDzSXuDXivAwmDfwguHjBALjuC3J/JkxU5SW6eFo0T DZpoyCd2bMYfc2juzmA+Uvn3oY5Pz6WsBTUuJlBDLSfLPpUOjoR/tCTfSlhKlkmG 4FdFVgJAE9ZGJWRH7BMZ71ZGklqbMCDAUv0UAC5iEcXMkO9djcgMH8eRCt7QVnuj j0tcqSLtrO07Nb5NoSBM8JI5A0quvjJTlv1EgmsrUG9rM5kzlw6Qf6tcZ/2l0ioF Fqwd8cEES8S3dAjrb0AW2CS3T4Dr4ku1lp2VjXTmKysiZPpu7jS1KbYYp8IAlOa/ Wj2WK7ajdupGiBwa1H7vP4cm5L3qnNDz7ydeNgjEgfGJtBcNBCphL8D50/9S8Wir iYC3G1zoUuVmIGsc7SxRZH86C80QDQe+9jqnasw43tc8HOcj4UKnkgkcuAoUNdQ5 o084D6uDJEG2gdh5Vlc4VApw1oBFzJT31nb5mUxsdws+8jmhGHlX72O/YCNYkM91 S0Z53syCjJC5L0UtWJT6AVWONpfM5zwBRGW8deU0UN1jwa3ZFH/QPIgR+rOAU3Cm mRaIDzYyje/Dqs9PVsdShEPzsXkDzymUYFvXH+xqXu/o8Eizl7Rxvu0chfMwU2NJ XMumWVC44tLEhOvC00wM =2vkt -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 03:04:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95EF0AED; Sat, 28 Dec 2013 03:04:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 82852185C; Sat, 28 Dec 2013 03:04:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBS346X5060658; Sat, 28 Dec 2013 03:04:06 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBS346SG060657; Sat, 28 Dec 2013 03:04:06 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201312280304.rBS346SG060657@svn.freebsd.org> From: Mark Johnston Date: Sat, 28 Dec 2013 03:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259995 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 03:04:06 -0000 Author: markj Date: Sat Dec 28 03:04:05 2013 New Revision: 259995 URL: http://svnweb.freebsd.org/changeset/base/259995 Log: Correct the description of the V state, which indicates that the process' parent is suspended, not the process itself. MFC after: 3 days Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Sat Dec 28 02:27:06 2013 (r259994) +++ head/bin/ps/ps.1 Sat Dec 28 03:04:05 2013 (r259995) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 15, 2013 +.Dd December 27, 2013 .Dt PS 1 .Os .Sh NAME @@ -416,8 +416,9 @@ The process has reduced CPU scheduling p .It Li s The process is a session leader. .It Li V -The process is suspended during a -.Xr vfork 2 . +The process' parent is suspended during a +.Xr vfork 2 , +waiting for the process to exec or exit. .It Li W The process is swapped out. .It Li X From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 03:21:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63078F1A; Sat, 28 Dec 2013 03:21:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4FC35198B; Sat, 28 Dec 2013 03:21:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBS3LGMW068155; Sat, 28 Dec 2013 03:21:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBS3LGBT068154; Sat, 28 Dec 2013 03:21:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312280321.rBS3LGBT068154@svn.freebsd.org> From: John Baldwin Date: Sat, 28 Dec 2013 03:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259997 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 03:21:16 -0000 Author: jhb Date: Sat Dec 28 03:21:15 2013 New Revision: 259997 URL: http://svnweb.freebsd.org/changeset/base/259997 Log: Use pthread_once() to replace a static integer initted flag. Reviewed by: neel Modified: head/usr.sbin/bhyve/pmtmr.c Modified: head/usr.sbin/bhyve/pmtmr.c ============================================================================== --- head/usr.sbin/bhyve/pmtmr.c Sat Dec 28 03:11:09 2013 (r259996) +++ head/usr.sbin/bhyve/pmtmr.c Sat Dec 28 03:21:15 2013 (r259997) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #define PMTMR_FREQ 3579545 /* 3.579545MHz */ static pthread_mutex_t pmtmr_mtx; +static pthread_once_t pmtmr_once = PTHREAD_ONCE_INIT; static uint64_t pmtmr_old; @@ -123,6 +124,7 @@ pmtmr_init(void) pmtmr_uptime_old = tsnew; pmtmr_old = timespec_to_pmtmr(&tsnew, &tsold); } + pthread_mutex_init(&pmtmr_mtx, NULL); } static uint32_t @@ -133,13 +135,7 @@ pmtmr_val(void) uint64_t pmtmr_new; int error; - static int inited = 0; - - if (!inited) { - pthread_mutex_init(&pmtmr_mtx, NULL); - pmtmr_init(); - inited = 1; - } + pthread_once(&pmtmr_once, pmtmr_init); pthread_mutex_lock(&pmtmr_mtx); From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 04:01:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C2B55B9; Sat, 28 Dec 2013 04:01:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 27CB01CCF; Sat, 28 Dec 2013 04:01:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBS417sS081113; Sat, 28 Dec 2013 04:01:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBS415Uu081102; Sat, 28 Dec 2013 04:01:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312280401.rBS415Uu081102@svn.freebsd.org> From: John Baldwin Date: Sat, 28 Dec 2013 04:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259998 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 04:01:07 -0000 Author: jhb Date: Sat Dec 28 04:01:05 2013 New Revision: 259998 URL: http://svnweb.freebsd.org/changeset/base/259998 Log: Extend the ACPI power management support to wire a virtual power button up to SIGTERM when ACPI is enabled. Sending SIGTERM to the hypervisor when an ACPI-aware OS is running will now trigger a soft-off allowing for a graceful shutdown of the guest. - Move constants for ACPI-related registers to acpi.h. - Implement an SMI_CMD register with commands to enable and disable ACPI. Currently the only change when ACPI is enabled is to enable the virtual power button via SIGTERM. - Implement a fixed-feature power button when ACPI is enabled by asserting PWRBTN_STS in PM1_EVT when SIGTERM is received. - Add support for EVFILT_SIGNAL events to mevent. - Implement support for the ACPI system command interrupt (SCI) and assert it when needed based on the values in PM1_EVT. Mark the SCI as active-low and level triggered in the MADT and MP Table. - Mark PCI interrupts in the MP Table as active-low in addition to level triggered. Reviewed by: neel Modified: head/usr.sbin/bhyve/acpi.c head/usr.sbin/bhyve/acpi.h head/usr.sbin/bhyve/mevent.c head/usr.sbin/bhyve/mevent.h head/usr.sbin/bhyve/mptbl.c head/usr.sbin/bhyve/pm.c head/usr.sbin/bhyve/pmtmr.c Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Sat Dec 28 03:21:15 2013 (r259997) +++ head/usr.sbin/bhyve/acpi.c Sat Dec 28 04:01:05 2013 (r259998) @@ -85,10 +85,6 @@ __FBSDID("$FreeBSD$"); #define BHYVE_ASL_SUFFIX ".aml" #define BHYVE_ASL_COMPILER "/usr/sbin/iasl" -#define BHYVE_PM1A_EVT_ADDR 0x400 -#define BHYVE_PM1A_CNT_ADDR 0x404 -#define BHYVE_PM_TIMER_ADDR 0x408 - static int basl_keep_temps; static int basl_verbose_iasl; static int basl_ncpu; @@ -285,11 +281,11 @@ basl_fwrite_madt(FILE *fp) EFPRINTF(fp, "[0001]\t\tSubtable Type : 02\n"); EFPRINTF(fp, "[0001]\t\tLength : 0A\n"); EFPRINTF(fp, "[0001]\t\tBus : 00\n"); - EFPRINTF(fp, "[0001]\t\tSource : 09\n"); - EFPRINTF(fp, "[0004]\t\tInterrupt : 00000009\n"); + EFPRINTF(fp, "[0001]\t\tSource : %02X\n", SCI_INT); + EFPRINTF(fp, "[0004]\t\tInterrupt : %08X\n", SCI_INT); EFPRINTF(fp, "[0002]\t\tFlags (decoded below) : 0000\n"); - EFPRINTF(fp, "\t\t\tPolarity : 0\n"); - EFPRINTF(fp, "\t\t\tTrigger Mode : 0\n"); + EFPRINTF(fp, "\t\t\tPolarity : 3\n"); + EFPRINTF(fp, "\t\t\tTrigger Mode : 3\n"); EFPRINTF(fp, "\n"); /* Local APIC NMI is connected to LINT 1 on all CPUs */ @@ -336,23 +332,27 @@ basl_fwrite_fadt(FILE *fp) basl_acpi_base + FACS_OFFSET); EFPRINTF(fp, "[0004]\t\tDSDT Address : %08X\n", basl_acpi_base + DSDT_OFFSET); - EFPRINTF(fp, "[0001]\t\tModel : 00\n"); + EFPRINTF(fp, "[0001]\t\tModel : 01\n"); EFPRINTF(fp, "[0001]\t\tPM Profile : 00 [Unspecified]\n"); - EFPRINTF(fp, "[0002]\t\tSCI Interrupt : 0009\n"); - EFPRINTF(fp, "[0004]\t\tSMI Command Port : 00000000\n"); - EFPRINTF(fp, "[0001]\t\tACPI Enable Value : 00\n"); - EFPRINTF(fp, "[0001]\t\tACPI Disable Value : 00\n"); + EFPRINTF(fp, "[0002]\t\tSCI Interrupt : %04X\n", + SCI_INT); + EFPRINTF(fp, "[0004]\t\tSMI Command Port : %08X\n", + SMI_CMD); + EFPRINTF(fp, "[0001]\t\tACPI Enable Value : %02X\n", + BHYVE_ACPI_ENABLE); + EFPRINTF(fp, "[0001]\t\tACPI Disable Value : %02X\n", + BHYVE_ACPI_DISABLE); EFPRINTF(fp, "[0001]\t\tS4BIOS Command : 00\n"); EFPRINTF(fp, "[0001]\t\tP-State Control : 00\n"); EFPRINTF(fp, "[0004]\t\tPM1A Event Block Address : %08X\n", - BHYVE_PM1A_EVT_ADDR); + PM1A_EVT_ADDR); EFPRINTF(fp, "[0004]\t\tPM1B Event Block Address : 00000000\n"); EFPRINTF(fp, "[0004]\t\tPM1A Control Block Address : %08X\n", - BHYVE_PM1A_CNT_ADDR); + PM1A_CNT_ADDR); EFPRINTF(fp, "[0004]\t\tPM1B Control Block Address : 00000000\n"); EFPRINTF(fp, "[0004]\t\tPM2 Control Block Address : 00000000\n"); EFPRINTF(fp, "[0004]\t\tPM Timer Block Address : %08X\n", - BHYVE_PM_TIMER_ADDR); + IO_PMTMR); EFPRINTF(fp, "[0004]\t\tGPE0 Block Address : 00000000\n"); EFPRINTF(fp, "[0004]\t\tGPE1 Block Address : 00000000\n"); EFPRINTF(fp, "[0001]\t\tPM1 Event Block Length : 04\n"); @@ -385,7 +385,7 @@ basl_fwrite_fadt(FILE *fp) EFPRINTF(fp, "\t\t\tWBINVD flushes all caches (V1) : 0\n"); EFPRINTF(fp, "\t\t\tAll CPUs support C1 (V1) : 1\n"); EFPRINTF(fp, "\t\t\tC2 works on MP system (V1) : 0\n"); - EFPRINTF(fp, "\t\t\tControl Method Power Button (V1) : 1\n"); + EFPRINTF(fp, "\t\t\tControl Method Power Button (V1) : 0\n"); EFPRINTF(fp, "\t\t\tControl Method Sleep Button (V1) : 1\n"); EFPRINTF(fp, "\t\t\tRTC wake not in fixed reg space (V1) : 0\n"); EFPRINTF(fp, "\t\t\tRTC can wake system from S4 (V1) : 0\n"); @@ -427,7 +427,7 @@ basl_fwrite_fadt(FILE *fp) EFPRINTF(fp, "[0001]\t\tBit Offset : 00\n"); EFPRINTF(fp, "[0001]\t\tEncoded Access Width : 02 [Word Access:16]\n"); EFPRINTF(fp, "[0008]\t\tAddress : 00000000%08X\n", - BHYVE_PM1A_EVT_ADDR); + PM1A_EVT_ADDR); EFPRINTF(fp, "\n"); EFPRINTF(fp, @@ -447,7 +447,7 @@ basl_fwrite_fadt(FILE *fp) EFPRINTF(fp, "[0001]\t\tBit Offset : 00\n"); EFPRINTF(fp, "[0001]\t\tEncoded Access Width : 02 [Word Access:16]\n"); EFPRINTF(fp, "[0008]\t\tAddress : 00000000%08X\n", - BHYVE_PM1A_CNT_ADDR); + PM1A_CNT_ADDR); EFPRINTF(fp, "\n"); EFPRINTF(fp, @@ -479,7 +479,7 @@ basl_fwrite_fadt(FILE *fp) EFPRINTF(fp, "[0001]\t\tEncoded Access Width : 03 [DWord Access:32]\n"); EFPRINTF(fp, "[0008]\t\tAddress : 00000000%08X\n", - BHYVE_PM_TIMER_ADDR); + IO_PMTMR); EFPRINTF(fp, "\n"); EFPRINTF(fp, "[0012]\t\tGPE0 Block : [Generic Address Structure]\n"); Modified: head/usr.sbin/bhyve/acpi.h ============================================================================== --- head/usr.sbin/bhyve/acpi.h Sat Dec 28 03:21:15 2013 (r259997) +++ head/usr.sbin/bhyve/acpi.h Sat Dec 28 04:01:05 2013 (r259998) @@ -29,6 +29,19 @@ #ifndef _ACPI_H_ #define _ACPI_H_ +#define SCI_INT 9 + +#define SMI_CMD 0xb2 +#define BHYVE_ACPI_ENABLE 0xa0 +#define BHYVE_ACPI_DISABLE 0xa1 + +#define PM1A_EVT_ADDR 0x400 +#define PM1A_CNT_ADDR 0x404 + +#define IO_PMTMR 0x408 /* 4-byte i/o port for the timer */ + +struct vmctx; + int acpi_build(struct vmctx *ctx, int ncpu); #endif /* _ACPI_H_ */ Modified: head/usr.sbin/bhyve/mevent.c ============================================================================== --- head/usr.sbin/bhyve/mevent.c Sat Dec 28 03:21:15 2013 (r259997) +++ head/usr.sbin/bhyve/mevent.c Sat Dec 28 04:01:05 2013 (r259998) @@ -135,6 +135,9 @@ mevent_kq_filter(struct mevent *mevp) if (mevp->me_type == EVF_TIMER) retval = EVFILT_TIMER; + if (mevp->me_type == EVF_SIGNAL) + retval = EVFILT_SIGNAL; + return (retval); } @@ -437,7 +440,7 @@ mevent_dispatch(void) * Block awaiting events */ ret = kevent(mfd, NULL, 0, eventlist, MEVENT_MAX, NULL); - if (ret == -1) { + if (ret == -1 && errno != EINTR) { perror("Error return from kevent monitor"); } Modified: head/usr.sbin/bhyve/mevent.h ============================================================================== --- head/usr.sbin/bhyve/mevent.h Sat Dec 28 03:21:15 2013 (r259997) +++ head/usr.sbin/bhyve/mevent.h Sat Dec 28 04:01:05 2013 (r259998) @@ -32,7 +32,8 @@ enum ev_type { EVF_READ, EVF_WRITE, - EVF_TIMER + EVF_TIMER, + EVF_SIGNAL }; struct mevent; Modified: head/usr.sbin/bhyve/mptbl.c ============================================================================== --- head/usr.sbin/bhyve/mptbl.c Sat Dec 28 03:21:15 2013 (r259997) +++ head/usr.sbin/bhyve/mptbl.c Sat Dec 28 04:01:05 2013 (r259998) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "acpi.h" #include "bhyverun.h" #include "mptbl.h" @@ -227,13 +228,21 @@ mpt_build_ioint_entries(int_entry_ptr mp mpie->int_type = INTENTRY_TYPE_INT; mpie->src_bus_irq = 0; break; + case SCI_INT: + /* ACPI SCI is level triggered and active-lo. */ + mpie->int_flags = INTENTRY_FLAGS_POLARITY_ACTIVELO | + INTENTRY_FLAGS_TRIGGER_LEVEL; + mpie->int_type = INTENTRY_TYPE_INT; + mpie->src_bus_irq = SCI_INT; + break; case 5: case 10: case 11: /* - * PCI Irqs set to level triggered. + * PCI Irqs set to level triggered and active-lo. */ - mpie->int_flags = INTENTRY_FLAGS_TRIGGER_LEVEL; + mpie->int_flags = INTENTRY_FLAGS_POLARITY_ACTIVELO | + INTENTRY_FLAGS_TRIGGER_LEVEL; mpie->src_bus_id = 0; /* fall through.. */ default: Modified: head/usr.sbin/bhyve/pm.c ============================================================================== --- head/usr.sbin/bhyve/pm.c Sat Dec 28 03:21:15 2013 (r259997) +++ head/usr.sbin/bhyve/pm.c Sat Dec 28 04:01:05 2013 (r259998) @@ -29,11 +29,20 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include +#include +#include + +#include "acpi.h" #include "inout.h" +#include "mevent.h" -#define PM1A_EVT_ADDR 0x400 -#define PM1A_CNT_ADDR 0x404 +static pthread_mutex_t pm_lock = PTHREAD_MUTEX_INITIALIZER; +static struct mevent *power_button; +static sig_t old_power_handler; /* * Reset Control register at I/O port 0xcf9. Bit 2 forces a system @@ -63,12 +72,75 @@ reset_handler(struct vmctx *ctx, int vcp INOUT_PORT(reset_reg, 0xCF9, IOPORT_F_INOUT, reset_handler); /* + * ACPI's SCI is a level-triggered interrupt. + */ +static int sci_active; + +static void +sci_assert(struct vmctx *ctx) +{ + + if (sci_active) + return; + vm_ioapic_assert_irq(ctx, SCI_INT); + sci_active = 1; +} + +static void +sci_deassert(struct vmctx *ctx) +{ + + if (!sci_active) + return; + vm_ioapic_deassert_irq(ctx, SCI_INT); + sci_active = 0; +} + +/* * Power Management 1 Event Registers * - * bhyve doesn't support any power management events currently, so the - * status register always returns zero. The enable register preserves - * its value but has no effect. + * The only power management event supported is a power button upon + * receiving SIGTERM. */ +static uint16_t pm1_enable, pm1_status; + +#define PM1_TMR_STS 0x0001 +#define PM1_BM_STS 0x0010 +#define PM1_GBL_STS 0x0020 +#define PM1_PWRBTN_STS 0x0100 +#define PM1_SLPBTN_STS 0x0200 +#define PM1_RTC_STS 0x0400 +#define PM1_WAK_STS 0x8000 + +#define PM1_TMR_EN 0x0001 +#define PM1_GBL_EN 0x0020 +#define PM1_PWRBTN_EN 0x0100 +#define PM1_SLPBTN_EN 0x0200 +#define PM1_RTC_EN 0x0400 + +static void +sci_update(struct vmctx *ctx) +{ + int need_sci; + + /* See if the SCI should be active or not. */ + need_sci = 0; + if ((pm1_enable & PM1_TMR_EN) && (pm1_status & PM1_TMR_STS)) + need_sci = 1; + if ((pm1_enable & PM1_GBL_EN) && (pm1_status & PM1_GBL_STS)) + need_sci = 1; + if ((pm1_enable & PM1_PWRBTN_EN) && (pm1_status & PM1_PWRBTN_STS)) + need_sci = 1; + if ((pm1_enable & PM1_SLPBTN_EN) && (pm1_status & PM1_SLPBTN_STS)) + need_sci = 1; + if ((pm1_enable & PM1_RTC_EN) && (pm1_status & PM1_RTC_STS)) + need_sci = 1; + if (need_sci) + sci_assert(ctx); + else + sci_deassert(ctx); +} + static int pm1_status_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) @@ -76,8 +148,20 @@ pm1_status_handler(struct vmctx *ctx, in if (bytes != 2) return (-1); + + pthread_mutex_lock(&pm_lock); if (in) - *eax = 0; + *eax = pm1_status; + else { + /* + * Writes are only permitted to clear certain bits by + * writing 1 to those flags. + */ + pm1_status &= ~(*eax & (PM1_WAK_STS | PM1_RTC_STS | + PM1_SLPBTN_STS | PM1_PWRBTN_STS | PM1_BM_STS)); + sci_update(ctx); + } + pthread_mutex_unlock(&pm_lock); return (0); } @@ -85,25 +169,51 @@ static int pm1_enable_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { - static uint16_t pm1_enable; if (bytes != 2) return (-1); + + pthread_mutex_lock(&pm_lock); if (in) *eax = pm1_enable; - else - pm1_enable = *eax; + else { + /* + * Only permit certain bits to be set. We never use + * the global lock, but ACPI-CA whines profusely if it + * can't set GBL_EN. + */ + pm1_enable = *eax & (PM1_PWRBTN_EN | PM1_GBL_EN); + sci_update(ctx); + } + pthread_mutex_unlock(&pm_lock); return (0); } INOUT_PORT(pm1_status, PM1A_EVT_ADDR, IOPORT_F_INOUT, pm1_status_handler); INOUT_PORT(pm1_enable, PM1A_EVT_ADDR + 2, IOPORT_F_INOUT, pm1_enable_handler); +static void +power_button_handler(int signal, enum ev_type type, void *arg) +{ + struct vmctx *ctx; + + ctx = arg; + pthread_mutex_lock(&pm_lock); + if (!(pm1_status & PM1_PWRBTN_STS)) { + pm1_status |= PM1_PWRBTN_STS; + sci_update(ctx); + } + pthread_mutex_unlock(&pm_lock); +} + /* * Power Management 1 Control Register * * This is mostly unimplemented except that we wish to handle writes that * set SPL_EN to handle S5 (soft power off). */ +static uint16_t pm1_control; + +#define PM1_SCI_EN 0x0001 #define PM1_SLP_TYP 0x1c00 #define PM1_SLP_EN 0x2000 #define PM1_ALWAYS_ZERO 0xc003 @@ -112,7 +222,6 @@ static int pm1_control_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { - static uint16_t pm1_control; if (bytes != 2) return (-1); @@ -121,9 +230,11 @@ pm1_control_handler(struct vmctx *ctx, i else { /* * Various bits are write-only or reserved, so force them - * to zero in pm1_control. + * to zero in pm1_control. Always preserve SCI_EN as OSPM + * can never change it. */ - pm1_control = *eax & ~(PM1_SLP_EN | PM1_ALWAYS_ZERO); + pm1_control = (pm1_control & PM1_SCI_EN) | + (*eax & ~(PM1_SLP_EN | PM1_ALWAYS_ZERO)); /* * If SLP_EN is set, check for S5. Bhyve's _S5_ method @@ -137,3 +248,41 @@ pm1_control_handler(struct vmctx *ctx, i return (0); } INOUT_PORT(pm1_control, PM1A_CNT_ADDR, IOPORT_F_INOUT, pm1_control_handler); + +/* + * ACPI SMI Command Register + * + * This write-only register is used to enable and disable ACPI. + */ +static int +smi_cmd_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, + uint32_t *eax, void *arg) +{ + + assert(!in); + if (bytes != 1) + return (-1); + + pthread_mutex_lock(&pm_lock); + switch (*eax) { + case BHYVE_ACPI_ENABLE: + pm1_control |= PM1_SCI_EN; + if (power_button == NULL) { + power_button = mevent_add(SIGTERM, EVF_SIGNAL, + power_button_handler, ctx); + old_power_handler = signal(SIGTERM, SIG_IGN); + } + break; + case BHYVE_ACPI_DISABLE: + pm1_control &= ~PM1_SCI_EN; + if (power_button != NULL) { + mevent_delete(power_button); + power_button = NULL; + signal(SIGTERM, old_power_handler); + } + break; + } + pthread_mutex_unlock(&pm_lock); + return (0); +} +INOUT_PORT(smi_cmd, SMI_CMD, IOPORT_F_OUT, smi_cmd_handler); Modified: head/usr.sbin/bhyve/pmtmr.c ============================================================================== --- head/usr.sbin/bhyve/pmtmr.c Sat Dec 28 03:21:15 2013 (r259997) +++ head/usr.sbin/bhyve/pmtmr.c Sat Dec 28 04:01:05 2013 (r259998) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "acpi.h" #include "inout.h" /* @@ -49,8 +50,6 @@ __FBSDID("$FreeBSD$"); * This implementation will be 32-bits */ -#define IO_PMTMR 0x408 /* 4-byte i/o port for the timer */ - #define PMTMR_FREQ 3579545 /* 3.579545MHz */ static pthread_mutex_t pmtmr_mtx; From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 04:28:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65547D35; Sat, 28 Dec 2013 04:28:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36F3B1F31; Sat, 28 Dec 2013 04:28:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBS4Sas4091547; Sat, 28 Dec 2013 04:28:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBS4Sa9l091546; Sat, 28 Dec 2013 04:28:36 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201312280428.rBS4Sa9l091546@svn.freebsd.org> From: Alan Cox Date: Sat, 28 Dec 2013 04:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259999 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 04:28:36 -0000 Author: alc Date: Sat Dec 28 04:28:35 2013 New Revision: 259999 URL: http://svnweb.freebsd.org/changeset/base/259999 Log: MFp4 alc_popmap Change the way that reservations keep track of which pages are in use. Instead of using the page's PG_CACHED and PG_FREE flags, maintain a bit vector within the reservation. This approach has a couple benefits. First, it makes breaking reservations much cheaper because there are fewer cache misses to identify the unused pages. Second, it is a pre- requisite for supporting two or more reservation sizes. Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Sat Dec 28 04:01:05 2013 (r259998) +++ head/sys/vm/vm_reserv.c Sat Dec 28 04:28:35 2013 (r259999) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2002-2006 Rice University - * Copyright (c) 2007-2008 Alan L. Cox + * Copyright (c) 2007-2011 Alan L. Cox * All rights reserved. * * This software was developed for the FreeBSD Project by Alan L. Cox, @@ -93,6 +93,21 @@ __FBSDID("$FreeBSD$"); (((object)->pg_color + (pindex)) & (VM_LEVEL_0_NPAGES - 1)) /* + * The size of a population map entry + */ +typedef u_long popmap_t; + +/* + * The number of bits in a population map entry + */ +#define NBPOPMAP (NBBY * sizeof(popmap_t)) + +/* + * The number of population map entries in a reservation + */ +#define NPOPMAP howmany(VM_LEVEL_0_NPAGES, NBPOPMAP) + +/* * The reservation structure * * A reservation structure is constructed whenever a large physical page is @@ -114,6 +129,7 @@ struct vm_reserv { vm_page_t pages; /* first page of a superpage */ int popcnt; /* # of pages in use */ char inpartpopq; + popmap_t popmap[NPOPMAP]; /* bit vector of used pages */ }; /* @@ -170,11 +186,12 @@ static long vm_reserv_reclaimed; SYSCTL_LONG(_vm_reserv, OID_AUTO, reclaimed, CTLFLAG_RD, &vm_reserv_reclaimed, 0, "Cumulative number of reclaimed reservations"); -static void vm_reserv_depopulate(vm_reserv_t rv); +static void vm_reserv_break(vm_reserv_t rv, vm_page_t m); +static void vm_reserv_depopulate(vm_reserv_t rv, int index); static vm_reserv_t vm_reserv_from_page(vm_page_t m); static boolean_t vm_reserv_has_pindex(vm_reserv_t rv, vm_pindex_t pindex); -static void vm_reserv_populate(vm_reserv_t rv); +static void vm_reserv_populate(vm_reserv_t rv, int index); static void vm_reserv_reclaim(vm_reserv_t rv); /* @@ -212,13 +229,13 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER /* * Reduces the given reservation's population count. If the population count * becomes zero, the reservation is destroyed. Additionally, moves the - * reservation to the tail of the partially-populated reservations queue if the + * reservation to the tail of the partially-populated reservation queue if the * population count is non-zero. * * The free page queue lock must be held. */ static void -vm_reserv_depopulate(vm_reserv_t rv) +vm_reserv_depopulate(vm_reserv_t rv, int index) { mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); @@ -230,6 +247,7 @@ vm_reserv_depopulate(vm_reserv_t rv) TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq); rv->inpartpopq = FALSE; } + clrbit(rv->popmap, index); rv->popcnt--; if (rv->popcnt == 0) { LIST_REMOVE(rv, objq); @@ -270,7 +288,7 @@ vm_reserv_has_pindex(vm_reserv_t rv, vm_ * The free page queue must be locked. */ static void -vm_reserv_populate(vm_reserv_t rv) +vm_reserv_populate(vm_reserv_t rv, int index) { mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); @@ -282,6 +300,7 @@ vm_reserv_populate(vm_reserv_t rv) TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq); rv->inpartpopq = FALSE; } + setbit(rv->popmap, index); rv->popcnt++; if (rv->popcnt < VM_LEVEL_0_NPAGES) { rv->inpartpopq = TRUE; @@ -437,9 +456,13 @@ vm_reserv_alloc_contig(vm_object_t objec KASSERT(!rv->inpartpopq, ("vm_reserv_alloc_contig: reserv %p's inpartpopq is TRUE", rv)); + for (i = 0; i < NPOPMAP; i++) + KASSERT(rv->popmap[i] == 0, + ("vm_reserv_alloc_contig: reserv %p's popmap is corrupted", + rv)); n = ulmin(VM_LEVEL_0_NPAGES - index, npages); for (i = 0; i < n; i++) - vm_reserv_populate(rv); + vm_reserv_populate(rv, index + i); npages -= n; if (m_ret == NULL) { m_ret = &rv->pages[index]; @@ -466,10 +489,10 @@ found: return (NULL); /* Handle vm_page_rename(m, new_object, ...). */ for (i = 0; i < npages; i++) - if ((rv->pages[index + i].flags & (PG_CACHED | PG_FREE)) == 0) + if (isset(rv->popmap, index + i)) return (NULL); for (i = 0; i < npages; i++) - vm_reserv_populate(rv); + vm_reserv_populate(rv, index + i); return (m); } @@ -487,6 +510,7 @@ vm_reserv_alloc_page(vm_object_t object, vm_page_t m, msucc; vm_pindex_t first, leftcap, rightcap; vm_reserv_t rv; + int i, index; mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); VM_OBJECT_ASSERT_WLOCKED(object); @@ -575,29 +599,111 @@ vm_reserv_alloc_page(vm_object_t object, ("vm_reserv_alloc_page: reserv %p's popcnt is corrupted", rv)); KASSERT(!rv->inpartpopq, ("vm_reserv_alloc_page: reserv %p's inpartpopq is TRUE", rv)); - vm_reserv_populate(rv); - return (&rv->pages[VM_RESERV_INDEX(object, pindex)]); + for (i = 0; i < NPOPMAP; i++) + KASSERT(rv->popmap[i] == 0, + ("vm_reserv_alloc_page: reserv %p's popmap is corrupted", + rv)); + index = VM_RESERV_INDEX(object, pindex); + vm_reserv_populate(rv, index); + return (&rv->pages[index]); /* * Found a matching reservation. */ found: - m = &rv->pages[VM_RESERV_INDEX(object, pindex)]; + index = VM_RESERV_INDEX(object, pindex); + m = &rv->pages[index]; /* Handle vm_page_rename(m, new_object, ...). */ - if ((m->flags & (PG_CACHED | PG_FREE)) == 0) + if (isset(rv->popmap, index)) return (NULL); - vm_reserv_populate(rv); + vm_reserv_populate(rv, index); return (m); } /* + * Breaks the given reservation. Except for the specified cached or free + * page, all cached and free pages in the reservation are returned to the + * physical memory allocator. The reservation's population count and map are + * reset to their initial state. + * + * The given reservation must not be in the partially-populated reservation + * queue. The free page queue lock must be held. + */ +static void +vm_reserv_break(vm_reserv_t rv, vm_page_t m) +{ + int begin_zeroes, hi, i, lo; + + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); + KASSERT(rv->object != NULL, + ("vm_reserv_break: reserv %p is free", rv)); + KASSERT(!rv->inpartpopq, + ("vm_reserv_break: reserv %p's inpartpopq is TRUE", rv)); + LIST_REMOVE(rv, objq); + rv->object = NULL; + if (m != NULL) { + /* + * Since the reservation is being broken, there is no harm in + * abusing the population map to stop "m" from being returned + * to the physical memory allocator. + */ + i = m - rv->pages; + KASSERT(isclr(rv->popmap, i), + ("vm_reserv_break: reserv %p's popmap is corrupted", rv)); + setbit(rv->popmap, i); + rv->popcnt++; + } + i = hi = 0; + do { + /* Find the next 0 bit. Any previous 0 bits are < "hi". */ + lo = ffsl(~(((1UL << hi) - 1) | rv->popmap[i])); + if (lo == 0) { + /* Redundantly clears bits < "hi". */ + rv->popmap[i] = 0; + rv->popcnt -= NBPOPMAP - hi; + while (++i < NPOPMAP) { + lo = ffsl(~rv->popmap[i]); + if (lo == 0) { + rv->popmap[i] = 0; + rv->popcnt -= NBPOPMAP; + } else + break; + } + if (i == NPOPMAP) + break; + hi = 0; + } + KASSERT(lo > 0, ("vm_reserv_break: lo is %d", lo)); + /* Convert from ffsl() to ordinary bit numbering. */ + lo--; + if (lo > 0) { + /* Redundantly clears bits < "hi". */ + rv->popmap[i] &= ~((1UL << lo) - 1); + rv->popcnt -= lo - hi; + } + begin_zeroes = NBPOPMAP * i + lo; + /* Find the next 1 bit. */ + do + hi = ffsl(rv->popmap[i]); + while (hi == 0 && ++i < NPOPMAP); + if (i != NPOPMAP) + /* Convert from ffsl() to ordinary bit numbering. */ + hi--; + vm_phys_free_contig(&rv->pages[begin_zeroes], NBPOPMAP * i + + hi - begin_zeroes); + } while (i < NPOPMAP); + KASSERT(rv->popcnt == 0, + ("vm_reserv_break: reserv %p's popcnt is corrupted", rv)); + vm_reserv_broken++; +} + +/* * Breaks all reservations belonging to the given object. */ void vm_reserv_break_all(vm_object_t object) { vm_reserv_t rv; - int i; mtx_lock(&vm_page_queue_free_mtx); while ((rv = LIST_FIRST(&object->rvq)) != NULL) { @@ -607,18 +713,7 @@ vm_reserv_break_all(vm_object_t object) TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq); rv->inpartpopq = FALSE; } - LIST_REMOVE(rv, objq); - rv->object = NULL; - for (i = 0; i < VM_LEVEL_0_NPAGES; i++) { - if ((rv->pages[i].flags & (PG_CACHED | PG_FREE)) != 0) - vm_phys_free_pages(&rv->pages[i], 0); - else - rv->popcnt--; - } - KASSERT(rv->popcnt == 0, - ("vm_reserv_break_all: reserv %p's popcnt is corrupted", - rv)); - vm_reserv_broken++; + vm_reserv_break(rv, NULL); } mtx_unlock(&vm_page_queue_free_mtx); } @@ -641,7 +736,7 @@ vm_reserv_free_page(vm_page_t m) if ((m->flags & PG_CACHED) != 0 && m->pool != VM_FREEPOOL_CACHE) vm_phys_set_pool(VM_FREEPOOL_CACHE, rv->pages, VM_LEVEL_0_ORDER); - vm_reserv_depopulate(rv); + vm_reserv_depopulate(rv, m - rv->pages); return (TRUE); } @@ -699,43 +794,26 @@ boolean_t vm_reserv_reactivate_page(vm_page_t m) { vm_reserv_t rv; - int i, m_index; + int index; mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); rv = vm_reserv_from_page(m); if (rv->object == NULL) return (FALSE); KASSERT((m->flags & PG_CACHED) != 0, - ("vm_reserv_uncache_page: page %p is not cached", m)); + ("vm_reserv_reactivate_page: page %p is not cached", m)); if (m->object == rv->object && - m->pindex - rv->pindex == VM_RESERV_INDEX(m->object, m->pindex)) - vm_reserv_populate(rv); + m->pindex - rv->pindex == (index = VM_RESERV_INDEX(m->object, + m->pindex))) + vm_reserv_populate(rv, index); else { KASSERT(rv->inpartpopq, - ("vm_reserv_uncache_page: reserv %p's inpartpopq is FALSE", + ("vm_reserv_reactivate_page: reserv %p's inpartpopq is FALSE", rv)); TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq); rv->inpartpopq = FALSE; - LIST_REMOVE(rv, objq); - rv->object = NULL; - /* Don't vm_phys_free_pages(m, 0). */ - m_index = m - rv->pages; - for (i = 0; i < m_index; i++) { - if ((rv->pages[i].flags & (PG_CACHED | PG_FREE)) != 0) - vm_phys_free_pages(&rv->pages[i], 0); - else - rv->popcnt--; - } - for (i++; i < VM_LEVEL_0_NPAGES; i++) { - if ((rv->pages[i].flags & (PG_CACHED | PG_FREE)) != 0) - vm_phys_free_pages(&rv->pages[i], 0); - else - rv->popcnt--; - } - KASSERT(rv->popcnt == 0, - ("vm_reserv_uncache_page: reserv %p's popcnt is corrupted", - rv)); - vm_reserv_broken++; + /* Don't release "m" to the physical memory allocator. */ + vm_reserv_break(rv, m); } return (TRUE); } @@ -749,25 +827,13 @@ vm_reserv_reactivate_page(vm_page_t m) static void vm_reserv_reclaim(vm_reserv_t rv) { - int i; mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); KASSERT(rv->inpartpopq, - ("vm_reserv_reclaim: reserv %p's inpartpopq is corrupted", rv)); + ("vm_reserv_reclaim: reserv %p's inpartpopq is FALSE", rv)); TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq); rv->inpartpopq = FALSE; - KASSERT(rv->object != NULL, - ("vm_reserv_reclaim: reserv %p is free", rv)); - LIST_REMOVE(rv, objq); - rv->object = NULL; - for (i = 0; i < VM_LEVEL_0_NPAGES; i++) { - if ((rv->pages[i].flags & (PG_CACHED | PG_FREE)) != 0) - vm_phys_free_pages(&rv->pages[i], 0); - else - rv->popcnt--; - } - KASSERT(rv->popcnt == 0, - ("vm_reserv_reclaim: reserv %p's popcnt is corrupted", rv)); + vm_reserv_break(rv, NULL); vm_reserv_reclaimed++; } @@ -804,9 +870,9 @@ boolean_t vm_reserv_reclaim_contig(u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary) { - vm_paddr_t pa, pa_length, size; + vm_paddr_t pa, size; vm_reserv_t rv; - int i; + int hi, i, lo, next_free; mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); if (npages > VM_LEVEL_0_NPAGES - 1) @@ -815,30 +881,61 @@ vm_reserv_reclaim_contig(u_long npages, TAILQ_FOREACH(rv, &vm_rvq_partpop, partpopq) { pa = VM_PAGE_TO_PHYS(&rv->pages[VM_LEVEL_0_NPAGES - 1]); if (pa + PAGE_SIZE - size < low) { - /* this entire reservation is too low; go to next */ + /* This entire reservation is too low; go to next. */ continue; } - pa_length = 0; - for (i = 0; i < VM_LEVEL_0_NPAGES; i++) - if ((rv->pages[i].flags & (PG_CACHED | PG_FREE)) != 0) { - pa_length += PAGE_SIZE; - if (pa_length == PAGE_SIZE) { - pa = VM_PAGE_TO_PHYS(&rv->pages[i]); - if (pa + size > high) { - /* skip to next reservation */ - break; - } else if (pa < low || - (pa & (alignment - 1)) != 0 || - ((pa ^ (pa + size - 1)) & - ~(boundary - 1)) != 0) - pa_length = 0; - } - if (pa_length >= size) { + pa = VM_PAGE_TO_PHYS(&rv->pages[0]); + if (pa + size > high) { + /* This entire reservation is too high; go to next. */ + continue; + } + if (pa < low) { + /* Start the search for free pages at "low". */ + i = (low - pa) / NBPOPMAP; + hi = (low - pa) % NBPOPMAP; + } else + i = hi = 0; + do { + /* Find the next free page. */ + lo = ffsl(~(((1UL << hi) - 1) | rv->popmap[i])); + while (lo == 0 && ++i < NPOPMAP) + lo = ffsl(~rv->popmap[i]); + if (i == NPOPMAP) + break; + /* Convert from ffsl() to ordinary bit numbering. */ + lo--; + next_free = NBPOPMAP * i + lo; + pa = VM_PAGE_TO_PHYS(&rv->pages[next_free]); + KASSERT(pa >= low, + ("vm_reserv_reclaim_contig: pa is too low")); + if (pa + size > high) { + /* The rest of this reservation is too high. */ + break; + } else if ((pa & (alignment - 1)) != 0 || + ((pa ^ (pa + size - 1)) & ~(boundary - 1)) != 0) { + /* Continue with this reservation. */ + hi = lo; + continue; + } + /* Find the next used page. */ + hi = ffsl(rv->popmap[i] & ~((1UL << lo) - 1)); + while (hi == 0 && ++i < NPOPMAP) { + if ((NBPOPMAP * i - next_free) * PAGE_SIZE >= + size) { vm_reserv_reclaim(rv); return (TRUE); } - } else - pa_length = 0; + hi = ffsl(rv->popmap[i]); + } + /* Convert from ffsl() to ordinary bit numbering. */ + if (i != NPOPMAP) + hi--; + if ((NBPOPMAP * i + hi - next_free) * PAGE_SIZE >= + size) { + vm_reserv_reclaim(rv); + return (TRUE); + } + } while (i < NPOPMAP); } return (FALSE); } From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 05:50:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8588E9D9; Sat, 28 Dec 2013 05:50:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7173F10A5; Sat, 28 Dec 2013 05:50:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBS5osT5056207; Sat, 28 Dec 2013 05:50:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBS5osfp056206; Sat, 28 Dec 2013 05:50:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312280550.rBS5osfp056206@svn.freebsd.org> From: Adrian Chadd Date: Sat, 28 Dec 2013 05:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260001 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 05:50:54 -0000 Author: adrian Date: Sat Dec 28 05:50:53 2013 New Revision: 260001 URL: http://svnweb.freebsd.org/changeset/base/260001 Log: Fix the Intel 6150 support. This chip doesn't require the temperature sensor offset, either v1 or v2. Doing so causes the initial calibration test to fail. Tested: * Intel Centrino 6150 Modified: head/sys/dev/iwn/if_iwn_chip_cfg.h Modified: head/sys/dev/iwn/if_iwn_chip_cfg.h ============================================================================== --- head/sys/dev/iwn/if_iwn_chip_cfg.h Sat Dec 28 04:46:03 2013 (r260000) +++ head/sys/dev/iwn/if_iwn_chip_cfg.h Sat Dec 28 05:50:53 2013 (r260001) @@ -307,8 +307,7 @@ static const struct iwn_base_params iwn_ .calib_need = (IWN_FLG_NEED_PHY_CALIB_LO | IWN_FLG_NEED_PHY_CALIB_TX_IQ - | IWN_FLG_NEED_PHY_CALIB_BASE_BAND - | IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET ), + | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), .support_hostap = false, .no_multi_vaps = true, .additional_gp_drv_bit = IWN_GP_DRIVER_NONE, From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 13:49:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C2EAFFF; Sat, 28 Dec 2013 13:49:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0B8EC1E5F; Sat, 28 Dec 2013 13:49:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSDnppC005451; Sat, 28 Dec 2013 13:49:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSDnna7005437; Sat, 28 Dec 2013 13:49:49 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312281349.rBSDnna7005437@svn.freebsd.org> From: Dimitry Andric Date: Sat, 28 Dec 2013 13:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260003 - in head/lib/libiconv_modules: BIG5 DECHanyu EUC EUCTW GBK2K HZ ISO2022 JOHAB MSKanji UES UTF7 UTF8 VIQR ZW X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 13:49:52 -0000 Author: dim Date: Sat Dec 28 13:49:48 2013 New Revision: 260003 URL: http://svnweb.freebsd.org/changeset/base/260003 Log: In libiconv_modules, surround unused static _citrus_XXX_pack_state() and _citrus_XXX_unpack_state() functions with #if 0, for now. MFC after: 3 days Modified: head/lib/libiconv_modules/BIG5/citrus_big5.c head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c head/lib/libiconv_modules/EUC/citrus_euc.c head/lib/libiconv_modules/EUCTW/citrus_euctw.c head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c head/lib/libiconv_modules/HZ/citrus_hz.c head/lib/libiconv_modules/ISO2022/citrus_iso2022.c head/lib/libiconv_modules/JOHAB/citrus_johab.c head/lib/libiconv_modules/MSKanji/citrus_mskanji.c head/lib/libiconv_modules/UES/citrus_ues.c head/lib/libiconv_modules/UTF7/citrus_utf7.c head/lib/libiconv_modules/UTF8/citrus_utf8.c head/lib/libiconv_modules/VIQR/citrus_viqr.c head/lib/libiconv_modules/ZW/citrus_zw.c Modified: head/lib/libiconv_modules/BIG5/citrus_big5.c ============================================================================== --- head/lib/libiconv_modules/BIG5/citrus_big5.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/BIG5/citrus_big5.c Sat Dec 28 13:49:48 2013 (r260003) @@ -123,6 +123,7 @@ _citrus_BIG5_init_state(_BIG5EncodingInf memset(s, 0, sizeof(*s)); } +#if 0 static __inline void /*ARGSUSED*/ _citrus_BIG5_pack_state(_BIG5EncodingInfo * __restrict ei __unused, @@ -142,6 +143,7 @@ _citrus_BIG5_unpack_state(_BIG5EncodingI memcpy((void *)s, pspriv, sizeof(*s)); } +#endif static __inline int _citrus_BIG5_check(_BIG5EncodingInfo *ei, unsigned int c) Modified: head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c ============================================================================== --- head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Sat Dec 28 13:49:48 2013 (r260003) @@ -78,6 +78,7 @@ _citrus_DECHanyu_init_state(_DECHanyuEnc psenc->chlen = 0; } +#if 0 static __inline void /*ARGSUSED*/ _citrus_DECHanyu_pack_state(_DECHanyuEncodingInfo * __restrict ei __unused, @@ -96,6 +97,7 @@ _citrus_DECHanyu_unpack_state(_DECHanyuE memcpy((void *)psenc, pspriv, sizeof(*psenc)); } +#endif static void /*ARGSUSED*/ Modified: head/lib/libiconv_modules/EUC/citrus_euc.c ============================================================================== --- head/lib/libiconv_modules/EUC/citrus_euc.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/EUC/citrus_euc.c Sat Dec 28 13:49:48 2013 (r260003) @@ -169,6 +169,7 @@ _citrus_EUC_init_state(_EUCEncodingInfo memset(s, 0, sizeof(*s)); } +#if 0 static __inline void /*ARGSUSED*/ _citrus_EUC_pack_state(_EUCEncodingInfo *ei __unused, void *pspriv, @@ -186,6 +187,7 @@ _citrus_EUC_unpack_state(_EUCEncodingInf memcpy((void *)s, pspriv, sizeof(*s)); } +#endif static int _citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, const char **s, Modified: head/lib/libiconv_modules/EUCTW/citrus_euctw.c ============================================================================== --- head/lib/libiconv_modules/EUCTW/citrus_euctw.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/EUCTW/citrus_euctw.c Sat Dec 28 13:49:48 2013 (r260003) @@ -136,6 +136,7 @@ _citrus_EUCTW_init_state(_EUCTWEncodingI memset(s, 0, sizeof(*s)); } +#if 0 static __inline void /*ARGSUSED*/ _citrus_EUCTW_pack_state(_EUCTWEncodingInfo * __restrict ei __unused, @@ -153,6 +154,7 @@ _citrus_EUCTW_unpack_state(_EUCTWEncodin memcpy((void *)s, pspriv, sizeof(*s)); } +#endif static int /*ARGSUSED*/ Modified: head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c ============================================================================== --- head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c Sat Dec 28 13:49:48 2013 (r260003) @@ -80,6 +80,7 @@ _citrus_GBK2K_init_state(_GBK2KEncodingI memset(s, 0, sizeof(*s)); } +#if 0 static __inline void /*ARGSUSED*/ _citrus_GBK2K_pack_state(_GBK2KEncodingInfo * __restrict ei __unused, @@ -97,6 +98,7 @@ _citrus_GBK2K_unpack_state(_GBK2KEncodin memcpy((void *)s, pspriv, sizeof(*s)); } +#endif static __inline bool _mb_singlebyte(int c) Modified: head/lib/libiconv_modules/HZ/citrus_hz.c ============================================================================== --- head/lib/libiconv_modules/HZ/citrus_hz.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/HZ/citrus_hz.c Sat Dec 28 13:49:48 2013 (r260003) @@ -153,6 +153,7 @@ _citrus_HZ_init_state(_HZEncodingInfo * psenc->inuse = INIT0(ei); } +#if 0 static __inline void /*ARGSUSED*/ _citrus_HZ_pack_state(_HZEncodingInfo * __restrict ei __unused, @@ -170,6 +171,7 @@ _citrus_HZ_unpack_state(_HZEncodingInfo memcpy((void *)psenc, pspriv, sizeof(*psenc)); } +#endif static int _citrus_HZ_mbrtowc_priv(_HZEncodingInfo * __restrict ei, Modified: head/lib/libiconv_modules/ISO2022/citrus_iso2022.c ============================================================================== --- head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Sat Dec 28 13:49:48 2013 (r260003) @@ -444,6 +444,7 @@ _citrus_ISO2022_init_state(_ISO2022Encod s->flags |= _ISO2022STATE_FLAG_INITIALIZED; } +#if 0 static __inline void /*ARGSUSED*/ _citrus_ISO2022_pack_state(_ISO2022EncodingInfo * __restrict ei __unused, @@ -461,6 +462,7 @@ _citrus_ISO2022_unpack_state(_ISO2022Enc memcpy((void *)s, pspriv, sizeof(*s)); } +#endif static int /*ARGSUSED*/ Modified: head/lib/libiconv_modules/JOHAB/citrus_johab.c ============================================================================== --- head/lib/libiconv_modules/JOHAB/citrus_johab.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/JOHAB/citrus_johab.c Sat Dec 28 13:49:48 2013 (r260003) @@ -80,6 +80,7 @@ _citrus_JOHAB_init_state(_JOHABEncodingI psenc->chlen = 0; } +#if 0 static __inline void /*ARGSUSED*/ _citrus_JOHAB_pack_state(_JOHABEncodingInfo * __restrict ei __unused, @@ -97,6 +98,7 @@ _citrus_JOHAB_unpack_state(_JOHABEncodin memcpy((void *)psenc, pspriv, sizeof(*psenc)); } +#endif static void /*ARGSUSED*/ Modified: head/lib/libiconv_modules/MSKanji/citrus_mskanji.c ============================================================================== --- head/lib/libiconv_modules/MSKanji/citrus_mskanji.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/MSKanji/citrus_mskanji.c Sat Dec 28 13:49:48 2013 (r260003) @@ -130,6 +130,7 @@ _citrus_MSKanji_init_state(_MSKanjiEncod s->chlen = 0; } +#if 0 static __inline void /*ARGSUSED*/ _citrus_MSKanji_pack_state(_MSKanjiEncodingInfo * __restrict ei __unused, @@ -147,6 +148,7 @@ _citrus_MSKanji_unpack_state(_MSKanjiEnc memcpy((void *)s, pspriv, sizeof(*s)); } +#endif static int /*ARGSUSED*/ Modified: head/lib/libiconv_modules/UES/citrus_ues.c ============================================================================== --- head/lib/libiconv_modules/UES/citrus_ues.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/UES/citrus_ues.c Sat Dec 28 13:49:48 2013 (r260003) @@ -75,6 +75,7 @@ _citrus_UES_init_state(_UESEncodingInfo psenc->chlen = 0; } +#if 0 static __inline void /*ARGSUSED*/ _citrus_UES_pack_state(_UESEncodingInfo * __restrict ei __unused, @@ -92,6 +93,7 @@ _citrus_UES_unpack_state(_UESEncodingInf memcpy((void *)psenc, pspriv, sizeof(*psenc)); } +#endif static __inline int to_int(int ch) Modified: head/lib/libiconv_modules/UTF7/citrus_utf7.c ============================================================================== --- head/lib/libiconv_modules/UTF7/citrus_utf7.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/UTF7/citrus_utf7.c Sat Dec 28 13:49:48 2013 (r260003) @@ -87,6 +87,7 @@ _citrus_UTF7_init_state(_UTF7EncodingInf memset((void *)s, 0, sizeof(*s)); } +#if 0 static __inline void /*ARGSUSED*/ _citrus_UTF7_pack_state(_UTF7EncodingInfo * __restrict ei __unused, @@ -104,6 +105,7 @@ _citrus_UTF7_unpack_state(_UTF7EncodingI memcpy((void *)s, pspriv, sizeof(*s)); } +#endif static const char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" Modified: head/lib/libiconv_modules/UTF8/citrus_utf8.c ============================================================================== --- head/lib/libiconv_modules/UTF8/citrus_utf8.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/UTF8/citrus_utf8.c Sat Dec 28 13:49:48 2013 (r260003) @@ -156,6 +156,7 @@ _citrus_UTF8_init_state(_UTF8EncodingInf s->chlen = 0; } +#if 0 static __inline void /*ARGSUSED*/ _citrus_UTF8_pack_state(_UTF8EncodingInfo *ei __unused, void *pspriv, @@ -173,6 +174,7 @@ _citrus_UTF8_unpack_state(_UTF8EncodingI memcpy((void *)s, pspriv, sizeof(*s)); } +#endif static int _citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, const char **s, Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- head/lib/libiconv_modules/VIQR/citrus_viqr.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/VIQR/citrus_viqr.c Sat Dec 28 13:49:48 2013 (r260003) @@ -230,6 +230,7 @@ _citrus_VIQR_init_state(_VIQREncodingInf psenc->chlen = 0; } +#if 0 static __inline void /*ARGSUSED*/ _citrus_VIQR_pack_state(_VIQREncodingInfo * __restrict ei __unused, @@ -247,6 +248,7 @@ _citrus_VIQR_unpack_state(_VIQREncodingI memcpy((void *)psenc, pspriv, sizeof(*psenc)); } +#endif static int _citrus_VIQR_mbrtowc_priv(_VIQREncodingInfo * __restrict ei, Modified: head/lib/libiconv_modules/ZW/citrus_zw.c ============================================================================== --- head/lib/libiconv_modules/ZW/citrus_zw.c Sat Dec 28 13:08:47 2013 (r260002) +++ head/lib/libiconv_modules/ZW/citrus_zw.c Sat Dec 28 13:49:48 2013 (r260003) @@ -85,6 +85,7 @@ _citrus_ZW_init_state(_ZWEncodingInfo * psenc->charset = NONE; } +#if 0 static __inline void /*ARGSUSED*/ _citrus_ZW_pack_state(_ZWEncodingInfo * __restrict ei __unused, @@ -102,6 +103,7 @@ _citrus_ZW_unpack_state(_ZWEncodingInfo memcpy((void *)psenc, pspriv, sizeof(*psenc)); } +#endif static int _citrus_ZW_mbrtowc_priv(_ZWEncodingInfo * __restrict ei, From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 19:54:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 361D8B14; Sat, 28 Dec 2013 19:54:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22076158B; Sat, 28 Dec 2013 19:54:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSJsJ3t029376; Sat, 28 Dec 2013 19:54:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSJsJgI029375; Sat, 28 Dec 2013 19:54:19 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312281954.rBSJsJgI029375@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 28 Dec 2013 19:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260009 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 19:54:20 -0000 Author: marcel Date: Sat Dec 28 19:54:19 2013 New Revision: 260009 URL: http://svnweb.freebsd.org/changeset/base/260009 Log: Add a virt_foreach() that does the same as what phys_foreach() does and change virt_size(), virt_dumphdrs() and virt_dumpdata() into its callback functions. In virt_foreach() we iterate over all the virtual memory regions that we want in the minidump. For now, just start with the PBVM (= kernel text and data plus preloaded modules). The core file this produces can already be used to work out the libkvm changes that need to be made to support it. In parallel, we can flesh out the in-kernel bits to dump more of what we need in a minidump without changing the core file structure. Modified: head/sys/ia64/ia64/dump_machdep.c Modified: head/sys/ia64/ia64/dump_machdep.c ============================================================================== --- head/sys/ia64/ia64/dump_machdep.c Sat Dec 28 19:23:16 2013 (r260008) +++ head/sys/ia64/ia64/dump_machdep.c Sat Dec 28 19:54:19 2013 (r260009) @@ -219,27 +219,113 @@ phys_foreach(phys_callback_t cb, void *a * Virtual dump (aka minidump) support */ +typedef int virt_callback_t(vm_offset_t, vm_size_t, int, void*); + static int -virt_size(uint64_t *dumpsize) +virt_cb_size(vm_offset_t va, vm_size_t sz, int seqnr, void *arg) { + uint64_t *dumpsize = (uint64_t *)arg; + *dumpsize += sz; return (0); } static int -virt_dumphdrs(struct dumperinfo *di) +virt_cb_dumphdr(vm_offset_t va, vm_size_t sz, int seqnr, void *arg) { - - return (-ENOSYS); + struct dumperinfo *di = (struct dumperinfo *)arg; + Elf64_Phdr phdr; + int error; + + bzero(&phdr, sizeof(phdr)); + phdr.p_type = PT_LOAD; + phdr.p_flags = PF_R; /* XXX */ + phdr.p_offset = fileofs; + phdr.p_vaddr = va; + phdr.p_paddr = ~0UL; + phdr.p_filesz = sz; + phdr.p_memsz = sz; + phdr.p_align = PAGE_SIZE; + + error = buf_write(di, (char*)&phdr, sizeof(phdr)); + fileofs += phdr.p_filesz; + return (error); } static int -virt_dumpdata(struct dumperinfo *di) +virt_cb_dumpdata(vm_offset_t va, vm_size_t sz, int seqnr, void *arg) { + struct dumperinfo *di = (struct dumperinfo *)arg; + size_t counter, iosz; + int c, error, twiddle; + + error = 0; /* catch case in which pgs is 0 */ + counter = 0; /* Update twiddle every 16MB */ + twiddle = 0; + + printf(" chunk %d: %ld pages ", seqnr, atop(sz)); + + while (sz) { + iosz = (sz > DFLTPHYS) ? DFLTPHYS : sz; + counter += iosz; + if (counter >> 24) { + printf("%c\b", "|/-\\"[twiddle++ & 3]); + counter &= (1<<24) - 1; + } +#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); +#endif + error = dump_write(di, (void*)va, 0, dumplo, iosz); + if (error) + break; + dumplo += iosz; + sz -= iosz; + va += iosz; + + /* Check for user abort. */ + c = cncheckc(); + if (c == 0x03) + return (ECANCELED); + if (c != -1) + printf("(CTRL-C to abort) "); + } + printf("... %s\n", (error) ? "fail" : "ok"); + return (error); +} - return (-ENOSYS); +static int +virt_foreach(virt_callback_t cb, void *arg) +{ + vm_offset_t va; + vm_size_t sz; + int error, seqnr; + + seqnr = 0; + while (1) { + switch (seqnr) { + case 0: + va = IA64_PBVM_BASE; + sz = round_page(bootinfo->bi_kernend) - va; + break; + default: + va = 0; + sz = 0; + break; + } + if (va == 0 && sz == 0) + break; + error = (*cb)(va, sz, seqnr, arg); + if (error) + return (-error); + seqnr++; + } + return (seqnr); } +/* + * main entry point. + */ + void dumpsys(struct dumperinfo *di) { @@ -274,7 +360,7 @@ dumpsys(struct dumperinfo *di) /* Calculate dump size. */ dumpsize = 0L; - status = (minidump) ? virt_size(&dumpsize) : + status = (minidump) ? virt_foreach(virt_cb_size, &dumpsize) : phys_foreach(phys_cb_size, &dumpsize); if (status < 0) { error = -status; @@ -311,7 +397,7 @@ dumpsys(struct dumperinfo *di) goto fail; /* Dump program headers */ - status = (minidump) ? virt_dumphdrs(di) : + status = (minidump) ? virt_foreach(virt_cb_dumphdr, di) : phys_foreach(phys_cb_dumphdr, di); if (status < 0) { error = -status; @@ -329,7 +415,7 @@ dumpsys(struct dumperinfo *di) dumplo += hdrgap; /* Dump memory chunks (updates dumplo) */ - status = (minidump) ? virt_dumpdata(di) : + status = (minidump) ? virt_foreach(virt_cb_dumpdata, di) : phys_foreach(phys_cb_dumpdata, di); if (status < 0) { error = -status; From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 20:00:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEE65CF3; Sat, 28 Dec 2013 20:00:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9BB5615BB; Sat, 28 Dec 2013 20:00:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSK0Y7U030419; Sat, 28 Dec 2013 20:00:34 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSK0YtN030418; Sat, 28 Dec 2013 20:00:34 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201312282000.rBSK0YtN030418@svn.freebsd.org> From: Peter Wemm Date: Sat, 28 Dec 2013 20:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260010 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 20:00:34 -0000 Author: peter Date: Sat Dec 28 20:00:34 2013 New Revision: 260010 URL: http://svnweb.freebsd.org/changeset/base/260010 Log: Bump __FreeBSD_version for r259951 - Don't coalesce entries in vm_map_stack(). Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Dec 28 19:54:19 2013 (r260009) +++ head/sys/sys/param.h Sat Dec 28 20:00:34 2013 (r260010) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100004 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100005 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 20:30:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00196C37; Sat, 28 Dec 2013 20:30:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF39D1823; Sat, 28 Dec 2013 20:30:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSKUZZE042730; Sat, 28 Dec 2013 20:30:35 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSKUWOx042708; Sat, 28 Dec 2013 20:30:32 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312282030.rBSKUWOx042708@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 28 Dec 2013 20:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260014 - in head/contrib/gcc: . cp doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 20:30:36 -0000 Author: pfg Date: Sat Dec 28 20:30:31 2013 New Revision: 260014 URL: http://svnweb.freebsd.org/changeset/base/260014 Log: gcc: Add support for label attributes and "unavailable" attribute. Apple GCC has extensions to support for both label attributes and an "unavailable" attribute. These are critical for objc but are also useful in regular C/C++. Apparently at least the label attributes might have found their way to upstream GCC but the code doesn't seem available on the GPLv2 tree so we are taking the code directly from Apple. To make this clearer we are preserving the annoying "APPLE LOCAL" tags and the ChangeLogs when they are available. Obtained from: Apple GCC 4.2 - 5531 MFC after: 3 weeks Added: head/contrib/gcc/ChangeLog.apple head/contrib/gcc/cp/ChangeLog.apple Modified: head/contrib/gcc/c-common.c head/contrib/gcc/c-decl.c head/contrib/gcc/c-parser.c head/contrib/gcc/c-tree.h head/contrib/gcc/c-typeck.c head/contrib/gcc/cp/cp-gimplify.c head/contrib/gcc/cp/cp-tree.def head/contrib/gcc/cp/cp-tree.h head/contrib/gcc/cp/decl.c head/contrib/gcc/cp/dump.c head/contrib/gcc/cp/init.c head/contrib/gcc/cp/parser.c head/contrib/gcc/cp/pt.c head/contrib/gcc/cp/semantics.c head/contrib/gcc/doc/extend.texi head/contrib/gcc/dwarf2out.c head/contrib/gcc/emit-rtl.c head/contrib/gcc/final.c head/contrib/gcc/print-rtl.c head/contrib/gcc/print-tree.c head/contrib/gcc/rtl.def head/contrib/gcc/rtl.h head/contrib/gcc/stmt.c head/contrib/gcc/toplev.c head/contrib/gcc/toplev.h head/contrib/gcc/tree-cfg.c head/contrib/gcc/tree.h Added: head/contrib/gcc/ChangeLog.apple ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcc/ChangeLog.apple Sat Dec 28 20:30:31 2013 (r260014) @@ -0,0 +1,51 @@ +006-02-15 Fariborz Jahanian + + Radar 4445586 + * c-common.def (DO_STMT): Takes an extra argument. + +/* APPLE LOCAL merge marger */ +/* Stuff under is in fsf mainline, but not in the 4.2 branch */ + +2007-08-02 Geoffrey Keating + + Radar 3274130, 5295549 + * c-parser.c (c_parser_while_statement): Handle attributes. + (c_parser_do_statement): Handle attributes. + (c_parser_for_statement): Handle attributes. + * c-common.c (handle_unused_attribute): Warn if a statement + is marked as unused. + * c-tree.h (c_finish_loop): Add extra parameter. + * c-typeck.c (c_finish_loop): Handle attributes. + * doc/extend.texi (Attribute Syntax): Document statement attributes. + (Label Attributes): Explain how they apply to statements. + * tree-cfg.c (cleanup_dead_labels): Preserve labels with + user-specified alignment or attributes. + * stmt.c (expand_label): Update and correct documentation. + + * c-common.c (handle_aligned_attribute): Handle LABEL_DECL. + * rtl.def (CODE_LABEL): Add 8th operand. + * rtl.h (LABEL_ALIGN_LOG): New. + (LABEL_MAX_SKIP): New. + (SET_LABEL_ALIGN): New. + * emit-rtl.c (gen_label_rtx): Adjust. + * print-rtl.c (print_rtx): Print LABEL_ALIGN_LOG. + * stmt.c (label_rtx): Set CODE_LABEL's alignment from DECL_ALIGN. + (expand_label): Update documentation. + * final.c (struct label_alignment): Delete. + (label_align): Delete. + (min_labelno): Delete. + (max_labelno): Delete. + (LABEL_TO_ALIGNMENT): Delete. + (LABEL_TO_MAX_SKIP): Delete. + (label_to_alignment): Adjust for LABEL_ALIGN_LOG. + (align_fuzz): Likewise. + (compute_alignments): Likewise. + (shorten_branches): Remove code to set up label_align. + Adjust for LABEL_ALIGN_LOG. + (final_scan_insn): Adjust for LABEL_ALIGN_LOG. + * doc/extend.texi (C Extensions): Add 'Label Attributes' to menu. + (Attribute Syntax): Move label content to Label Attributes. + (Function Attributes): Mention label attributes. + (Variable Attributes): Mention label attributes. + (Type Attributes): Mention label attributes. + (Label Attributes): New. Modified: head/contrib/gcc/c-common.c ============================================================================== --- head/contrib/gcc/c-common.c Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/c-common.c Sat Dec 28 20:30:31 2013 (r260014) @@ -541,6 +541,9 @@ static tree handle_pure_attribute (tree static tree handle_novops_attribute (tree *, tree, tree, int, bool *); static tree handle_deprecated_attribute (tree *, tree, tree, int, bool *); +/* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) --ilr */ +static tree handle_unavailable_attribute (tree *, tree, tree, int, bool *); +/* APPLE LOCAL end "unavailable" attribute --ilr */ static tree handle_vector_size_attribute (tree *, tree, tree, int, bool *); static tree handle_nonnull_attribute (tree *, tree, tree, int, bool *); @@ -626,6 +629,10 @@ const struct attribute_spec c_common_att handle_novops_attribute }, { "deprecated", 0, 0, false, false, false, handle_deprecated_attribute }, + /* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) --ilr */ + { "unavailable", 0, 0, false, false, false, + handle_unavailable_attribute }, + /* APPLE LOCAL end "unavailable" attribute --ilr */ { "vector_size", 1, 1, false, true, false, handle_vector_size_attribute }, { "visibility", 1, 1, false, false, false, @@ -4394,7 +4401,10 @@ handle_unused_attribute (tree *node, tre if (TREE_CODE (decl) == PARM_DECL || TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL - || TREE_CODE (decl) == LABEL_DECL +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + || (TREE_CODE (decl) == LABEL_DECL + && ! DECL_ARTIFICIAL (decl)) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ || TREE_CODE (decl) == TYPE_DECL) TREE_USED (decl) = 1; else @@ -4842,7 +4852,10 @@ handle_aligned_attribute (tree *node, tr TYPE_USER_ALIGN (*type) = 1; } else if (! VAR_OR_FUNCTION_DECL_P (decl) - && TREE_CODE (decl) != FIELD_DECL) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + && TREE_CODE (decl) != FIELD_DECL + && TREE_CODE (decl) != LABEL_DECL) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ { error ("alignment may not be specified for %q+D", decl); *no_add_attrs = true; @@ -5345,6 +5358,67 @@ handle_deprecated_attribute (tree *node, return NULL_TREE; } +/* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) --ilr */ +/* Handle a "unavailable" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_unavailable_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) +{ + tree type = NULL_TREE; + int warn = 0; + const char *what = NULL; + + if (DECL_P (*node)) + { + tree decl = *node; + type = TREE_TYPE (decl); + + if (TREE_CODE (decl) == TYPE_DECL + || TREE_CODE (decl) == PARM_DECL + || TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == FUNCTION_DECL) + { + TREE_UNAVAILABLE (decl) = 1; + } + else + warn = 1; + } + else if (TYPE_P (*node)) + { + if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) + *node = build_variant_type_copy (*node); + TREE_UNAVAILABLE (*node) = 1; + type = *node; + } + else + warn = 1; + + if (warn) + { + *no_add_attrs = true; + if (type && TYPE_NAME (type)) + { + if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) + what = IDENTIFIER_POINTER (TYPE_NAME (*node)); + else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL + && DECL_NAME (TYPE_NAME (type))) + what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); + } + if (what) + warning (0, "`%s' attribute ignored for `%s'", + IDENTIFIER_POINTER (name), what); + else + warning (0, "`%s' attribute ignored", IDENTIFIER_POINTER (name)); + } + + return NULL_TREE; +} +/* APPLE LOCAL end "unavailable" attribute --ilr */ + /* Handle a "vector_size" attribute; arguments as in struct attribute_spec.handler. */ Modified: head/contrib/gcc/c-decl.c ============================================================================== --- head/contrib/gcc/c-decl.c Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/c-decl.c Sat Dec 28 20:30:31 2013 (r260014) @@ -453,10 +453,17 @@ add_stmt (tree t) with __attribute__((deprecated)). An object declared as __attribute__((deprecated)) suppresses warnings of uses of other deprecated items. */ +/* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ +/* Also add an __attribute__((unavailable)). An object declared as + __attribute__((unavailable)) suppresses any reports of being + declared with unavailable or deprecated items. */ +/* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ enum deprecated_states { DEPRECATED_NORMAL, DEPRECATED_SUPPRESS + /* APPLE LOCAL "unavailable" attribute (radar 2809697) */ + , DEPRECATED_UNAVAILABLE_SUPPRESS }; static enum deprecated_states deprecated_state = DEPRECATED_NORMAL; @@ -1709,6 +1716,12 @@ merge_decls (tree newdecl, tree olddecl, if (TREE_DEPRECATED (newdecl)) TREE_DEPRECATED (olddecl) = 1; + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + /* Merge unavailableness. */ + if (TREE_UNAVAILABLE (newdecl)) + TREE_UNAVAILABLE (olddecl) = 1; + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ + /* Keep source location of definition rather than declaration and of prototype rather than non-prototype unless that prototype is built-in. */ @@ -3222,8 +3235,36 @@ start_decl (struct c_declarator *declara /* An object declared as __attribute__((deprecated)) suppresses warnings of uses of other deprecated items. */ + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + /* An object declared as __attribute__((unavailable)) suppresses + any reports of being declared with unavailable or deprecated + items. An object declared as __attribute__((deprecated)) + suppresses warnings of uses of other deprecated items. */ +#ifdef A_LESS_INEFFICENT_WAY /* which I really don't want to do! */ if (lookup_attribute ("deprecated", attributes)) deprecated_state = DEPRECATED_SUPPRESS; + else if (lookup_attribute ("unavailable", attributes)) + deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS; +#else /* a more efficient way doing what lookup_attribute would do */ + tree a; + + for (a = attributes; a; a = TREE_CHAIN (a)) + { + tree name = TREE_PURPOSE (a); + if (TREE_CODE (name) == IDENTIFIER_NODE) + if (is_attribute_p ("deprecated", name)) + { + deprecated_state = DEPRECATED_SUPPRESS; + break; + } + if (is_attribute_p ("unavailable", name)) + { + deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS; + break; + } + } +#endif + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ decl = grokdeclarator (declarator, declspecs, NORMAL, initialized, NULL); @@ -4087,6 +4128,11 @@ grokdeclarator (const struct c_declarato /* If this looks like a function definition, make it one, even if it occurs where parms are expected. Then store_parm_decls will reject it and not use it as a parm. */ + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + if (declspecs->unavailable_p) + error_unavailable_use (declspecs->type); + else + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ if (decl_context == NORMAL && !funcdef_flag && current_scope->parm_flag) decl_context = PARM; @@ -7267,6 +7313,8 @@ build_null_declspecs (void) ret->tag_defined_p = false; ret->explicit_signed_p = false; ret->deprecated_p = false; + /* APPLE LOCAL "unavailable" attribute (radar 2809697) */ + ret->unavailable_p = false; ret->default_int_p = false; ret->long_p = false; ret->long_long_p = false; @@ -7330,6 +7378,11 @@ declspecs_add_type (struct c_declspecs * if (TREE_DEPRECATED (type)) specs->deprecated_p = true; + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + if (TREE_UNAVAILABLE (type)) + specs->unavailable_p = true; + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ + /* Handle type specifier keywords. */ if (TREE_CODE (type) == IDENTIFIER_NODE && C_IS_RESERVED_WORD (type)) { Modified: head/contrib/gcc/c-parser.c ============================================================================== --- head/contrib/gcc/c-parser.c Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/c-parser.c Sat Dec 28 20:30:31 2013 (r260014) @@ -3940,16 +3940,25 @@ c_parser_switch_statement (c_parser *par /* Parse a while statement (C90 6.6.5, C99 6.8.5). while-statement: - while (expression) statement + APPLE LOCAL begin for-fsf-4_4 3274130 5295549 + while attributes (expression) statement + + The use of attributes is a GNU extension. + APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ static void c_parser_while_statement (c_parser *parser) { - tree block, cond, body, save_break, save_cont; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree block, cond, body, save_break, save_cont, attrs; +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ location_t loc; gcc_assert (c_parser_next_token_is_keyword (parser, RID_WHILE)); c_parser_consume_token (parser); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + attrs = c_parser_attributes (parser); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ block = c_begin_compound_stmt (flag_isoc99); loc = c_parser_peek_token (parser)->location; cond = c_parser_paren_condition (parser); @@ -3958,7 +3967,10 @@ c_parser_while_statement (c_parser *pars save_cont = c_cont_label; c_cont_label = NULL_TREE; body = c_parser_c99_block_statement (parser); - c_finish_loop (loc, cond, NULL, body, c_break_label, c_cont_label, true); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + c_finish_loop (loc, cond, NULL, body, c_break_label, c_cont_label, attrs, + true); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (c_end_compound_stmt (block, flag_isoc99)); c_break_label = save_break; c_cont_label = save_cont; @@ -3967,16 +3979,25 @@ c_parser_while_statement (c_parser *pars /* Parse a do statement (C90 6.6.5, C99 6.8.5). do-statement: - do statement while ( expression ) ; + APPLE LOCAL begin for-fsf-4_4 3274130 5295549 + do attributes statement while ( expression ) ; + + The use of attributes is a GNU extension. + APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ static void c_parser_do_statement (c_parser *parser) { - tree block, cond, body, save_break, save_cont, new_break, new_cont; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree block, cond, body, save_break, save_cont, new_break, new_cont, attrs; +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ location_t loc; gcc_assert (c_parser_next_token_is_keyword (parser, RID_DO)); c_parser_consume_token (parser); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + attrs = c_parser_attributes (parser); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ block = c_begin_compound_stmt (flag_isoc99); loc = c_parser_peek_token (parser)->location; save_break = c_break_label; @@ -3992,18 +4013,26 @@ c_parser_do_statement (c_parser *parser) cond = c_parser_paren_condition (parser); if (!c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>")) c_parser_skip_to_end_of_block_or_statement (parser); - c_finish_loop (loc, cond, NULL, body, new_break, new_cont, false); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + c_finish_loop (loc, cond, NULL, body, new_break, new_cont, attrs, false); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (c_end_compound_stmt (block, flag_isoc99)); } /* Parse a for statement (C90 6.6.5, C99 6.8.5). for-statement: - for ( expression[opt] ; expression[opt] ; expression[opt] ) statement - for ( nested-declaration expression[opt] ; expression[opt] ) statement + APPLE LOCAL begin for-fsf-4_4 3274130 5295549 + for attributes ( expression[opt] ; expression[opt] ; expression[opt] ) \ + statement + for attributes ( nested-declaration expression[opt] ; expression[opt] ) \ + statement The form with a declaration is new in C99. + The use of attributes is a GNU extension. + + APPLE LOCAL end for-fsf-4_4 3274130 5295549 ??? In accordance with the old parser, the declaration may be a nested function, which is then rejected in check_for_loop_decls, but does it make any sense for this to be included in the grammar? @@ -4015,11 +4044,16 @@ c_parser_do_statement (c_parser *parser) static void c_parser_for_statement (c_parser *parser) { - tree block, cond, incr, save_break, save_cont, body; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree block, cond, incr, save_break, save_cont, body, attrs; +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ location_t loc; gcc_assert (c_parser_next_token_is_keyword (parser, RID_FOR)); loc = c_parser_peek_token (parser)->location; c_parser_consume_token (parser); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + attrs = c_parser_attributes (parser); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ block = c_begin_compound_stmt (flag_isoc99); if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) { @@ -4094,7 +4128,10 @@ c_parser_for_statement (c_parser *parser save_cont = c_cont_label; c_cont_label = NULL_TREE; body = c_parser_c99_block_statement (parser); - c_finish_loop (loc, cond, incr, body, c_break_label, c_cont_label, true); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + c_finish_loop (loc, cond, incr, body, c_break_label, c_cont_label, attrs, + true); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (c_end_compound_stmt (block, flag_isoc99)); c_break_label = save_break; c_cont_label = save_cont; Modified: head/contrib/gcc/c-tree.h ============================================================================== --- head/contrib/gcc/c-tree.h Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/c-tree.h Sat Dec 28 20:30:31 2013 (r260014) @@ -257,6 +257,10 @@ struct c_declspecs { BOOL_BITFIELD explicit_signed_p : 1; /* Whether the specifiers include a deprecated typedef. */ BOOL_BITFIELD deprecated_p : 1; + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + /* Whether the specifiers include a unavailable typedef. */ + BOOL_BITFIELD unavailable_p : 1; + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ /* Whether the type defaulted to "int" because there were no type specifiers. */ BOOL_BITFIELD default_int_p; @@ -573,7 +577,10 @@ extern int c_types_compatible_p (tree, t extern tree c_begin_compound_stmt (bool); extern tree c_end_compound_stmt (tree, bool); extern void c_finish_if_stmt (location_t, tree, tree, tree, bool); -extern void c_finish_loop (location_t, tree, tree, tree, tree, tree, bool); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +extern void c_finish_loop (location_t, tree, tree, tree, tree, tree, tree, + bool); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ extern tree c_begin_stmt_expr (void); extern tree c_finish_stmt_expr (tree); extern tree c_process_expr_stmt (tree); Modified: head/contrib/gcc/c-typeck.c ============================================================================== --- head/contrib/gcc/c-typeck.c Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/c-typeck.c Sat Dec 28 20:30:31 2013 (r260014) @@ -1849,6 +1849,11 @@ build_component_ref (tree datum, tree co if (TREE_DEPRECATED (subdatum)) warn_deprecated_use (subdatum); + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + if (TREE_UNAVAILABLE (subdatum)) + error_unavailable_use (subdatum); + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ + datum = ref; field = TREE_CHAIN (field); @@ -2090,6 +2095,11 @@ build_external_ref (tree id, int fun, lo if (TREE_DEPRECATED (ref)) warn_deprecated_use (ref); + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + if (TREE_UNAVAILABLE (ref)) + error_unavailable_use (ref); + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ + if (!skip_evaluation) assemble_external (ref); TREE_USED (ref) = 1; @@ -7247,15 +7257,22 @@ c_finish_if_stmt (location_t if_locus, t add_stmt (stmt); } -/* Emit a general-purpose loop construct. START_LOCUS is the location of - the beginning of the loop. COND is the loop condition. COND_IS_FIRST - is false for DO loops. INCR is the FOR increment expression. BODY is - the statement controlled by the loop. BLAB is the break label. CLAB is - the continue label. Everything is allowed to be NULL. */ +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +/* Emit a general-purpose loop construct. START_LOCUS is the location + of the beginning of the loop. COND is the loop condition. + COND_IS_FIRST is false for DO loops. INCR is the FOR increment + expression. BODY is the statement controlled by the loop. BLAB is + the break label. CLAB is the continue label. ATTRS is the + attributes associated with the loop, which at present are + associated with the topmost label. Everything is allowed to be + NULL. */ +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ void c_finish_loop (location_t start_locus, tree cond, tree incr, tree body, - tree blab, tree clab, bool cond_is_first) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree blab, tree clab, tree attrs, bool cond_is_first) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ { tree entry = NULL, exit = NULL, t; Added: head/contrib/gcc/cp/ChangeLog.apple ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcc/cp/ChangeLog.apple Sat Dec 28 20:30:31 2013 (r260014) @@ -0,0 +1,31 @@ +2006-02-15 Fariborz Jahanian + + Radar 4445586 + * semantics.c (begin_do_stmt): DO_STMT nodes take an + extra argument to build. + + # APPLE LOCAL begin for-fsf-4_4 3274130 5295549 +2007-08-03 Geoffrey Keating + + Radar 5295549 + * parser.c (cp_parser_iteration_statement): Handle attributes. + * semantics.c (begin_for_stmt): Put attributes in built tree. + (begin_while_stmt): Put attributes in built tree. + (begin_do_stmt): Put attributes in built tree. + * pt.c (tsubst_expr): Handle attributes for FOR_STMT, WHILE_STMT, + DO_STMT. + * cp-gimplify.c (gimplify_cp_loop): Handle attributes. + (gimplify_for_stmt): Pass attributes to gimplify_cp_loop. + (gimplify_while_stmt): Pass attributes to gimplify_cp_loop. + (gimplify_do_stmt): Pass attributes to gimplify_cp_loop. + * dump.c (cp_dump_tree): Dump attributes for FOR_STMT, WHILE_STMT, + DO_STMT. + * cp-tree.h (begin_while_stmt): Update prototype. + (begin_do_stmt): Likewise. + (begin_for_stmt): Likewise. + * cp-tree.def (FOR_STMT): Add extra parameter. + (WHILE_STMT): Likewise. + (DO_STMT): Likewise. + * init.c (build_vec_init): Update for change to begin_for_stmt. + + # APPLE LOCAL end for-fsf-4_4 3274130 5295549 Modified: head/contrib/gcc/cp/cp-gimplify.c ============================================================================== --- head/contrib/gcc/cp/cp-gimplify.c Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/cp/cp-gimplify.c Sat Dec 28 20:30:31 2013 (r260014) @@ -188,7 +188,10 @@ gimplify_if_stmt (tree *stmt_p) loop body as in do-while loops. */ static tree -gimplify_cp_loop (tree cond, tree body, tree incr, bool cond_is_first) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +gimplify_cp_loop (tree cond, tree body, tree incr, tree attrs, + bool cond_is_first, tree inner_foreach) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ { tree top, entry, exit, cont_block, break_block, stmt_list, t; location_t stmt_locus; @@ -223,6 +226,12 @@ gimplify_cp_loop (tree cond, tree body, out of the loop, or to the top of it. If there's no exit condition, then we just build a jump back to the top. */ exit = build_and_jump (&LABEL_EXPR_LABEL (top)); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + + /* Add the attributes to the 'top' label. */ + decl_attributes (&LABEL_EXPR_LABEL (top), attrs, 0); + +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ if (cond && !integer_nonzerop (cond)) { t = build_bc_goto (bc_break); @@ -270,8 +279,11 @@ gimplify_for_stmt (tree *stmt_p, tree *p if (FOR_INIT_STMT (stmt)) gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ *stmt_p = gimplify_cp_loop (FOR_COND (stmt), FOR_BODY (stmt), - FOR_EXPR (stmt), 1); + FOR_EXPR (stmt), FOR_ATTRIBUTES (stmt), 1, + NULL_TREE); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ } /* Gimplify a WHILE_STMT node. */ @@ -280,8 +292,11 @@ static void gimplify_while_stmt (tree *stmt_p) { tree stmt = *stmt_p; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ *stmt_p = gimplify_cp_loop (WHILE_COND (stmt), WHILE_BODY (stmt), - NULL_TREE, 1); + NULL_TREE, WHILE_ATTRIBUTES (stmt), 1, + NULL_TREE); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ } /* Gimplify a DO_STMT node. */ @@ -290,8 +305,11 @@ static void gimplify_do_stmt (tree *stmt_p) { tree stmt = *stmt_p; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ *stmt_p = gimplify_cp_loop (DO_COND (stmt), DO_BODY (stmt), - NULL_TREE, 0); + NULL_TREE, DO_ATTRIBUTES (stmt), 0, + DO_FOREACH (stmt)); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ } /* Genericize a SWITCH_STMT by turning it into a SWITCH_EXPR. */ Modified: head/contrib/gcc/cp/cp-tree.def ============================================================================== --- head/contrib/gcc/cp/cp-tree.def Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/cp/cp-tree.def Sat Dec 28 20:30:31 2013 (r260014) @@ -281,18 +281,23 @@ DEFTREECODE (CLEANUP_STMT, "cleanup_stmt and COND_EXPR for the benefit of templates. */ DEFTREECODE (IF_STMT, "if_stmt", tcc_statement, 3) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ /* Used to represent a `for' statement. The operands are - FOR_INIT_STMT, FOR_COND, FOR_EXPR, and FOR_BODY, respectively. */ -DEFTREECODE (FOR_STMT, "for_stmt", tcc_statement, 4) + FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY and FOR_ATTRIBUTES + respectively. */ +DEFTREECODE (FOR_STMT, "for_stmt", tcc_statement, 5) /* Used to represent a 'while' statement. The operands are WHILE_COND - and WHILE_BODY, respectively. */ -DEFTREECODE (WHILE_STMT, "while_stmt", tcc_statement, 2) + WHILE_BODY, and WHILE_ATTRIBUTES respectively. */ +DEFTREECODE (WHILE_STMT, "while_stmt", tcc_statement, 3) -/* Used to represent a 'do' statement. The operands are DO_BODY and - DO_COND, respectively. */ -DEFTREECODE (DO_STMT, "do_stmt", tcc_statement, 2) +/* APPLE LOCAL begin radar 4445586 */ +/* Used to represent a 'do' statement. The operands are DO_BODY, + DO_COND, DO_ATTRIBUTES, and DO_FOREACH respectively. */ +DEFTREECODE (DO_STMT, "do_stmt", tcc_statement, 4) +/* APPLE LOCAL end radar 4445586 */ +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* Used to represent a 'break' statement. */ DEFTREECODE (BREAK_STMT, "break_stmt", tcc_statement, 0) Modified: head/contrib/gcc/cp/cp-tree.h ============================================================================== --- head/contrib/gcc/cp/cp-tree.h Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/cp/cp-tree.h Sat Dec 28 20:30:31 2013 (r260014) @@ -3080,12 +3080,24 @@ extern void decl_shadowed_for_var_insert while statement and the body of the while statement, respectively. */ #define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0) #define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +#define WHILE_ATTRIBUTES(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 2) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* DO_STMT accessors. These give access to the condition of the do statement and the body of the do statement, respectively. */ #define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0) #define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +#define DO_ATTRIBUTES(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 2) +/* APPLE LOCAL begin C* language */ +/* Used as a flag to indicate synthesized inner do-while loop of a + foreach statement. Used for generation of break/continue statement + of the loop. */ +#define DO_FOREACH(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 3) +/* APPLE LOCAL end C* language */ +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* FOR_STMT accessors. These give access to the init statement, condition, update expression, and body of the for statement, respectively. */ @@ -3093,7 +3105,10 @@ extern void decl_shadowed_for_var_insert #define FOR_COND(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 1) #define FOR_EXPR(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 2) #define FOR_BODY(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 3) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +#define FOR_ATTRIBUTES(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 4) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ #define SWITCH_STMT_COND(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0) #define SWITCH_STMT_BODY(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1) #define SWITCH_STMT_TYPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 2) @@ -4258,14 +4273,20 @@ extern tree finish_then_clause (tree); extern void begin_else_clause (tree); extern void finish_else_clause (tree); extern void finish_if_stmt (tree); -extern tree begin_while_stmt (void); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +extern tree begin_while_stmt (tree); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ extern void finish_while_stmt_cond (tree, tree); extern void finish_while_stmt (tree); -extern tree begin_do_stmt (void); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +extern tree begin_do_stmt (tree); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ extern void finish_do_body (tree); extern void finish_do_stmt (tree, tree); extern tree finish_return_stmt (tree); -extern tree begin_for_stmt (void); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +extern tree begin_for_stmt (tree); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ extern void finish_for_init_stmt (tree); extern void finish_for_cond (tree, tree); extern void finish_for_expr (tree, tree); Modified: head/contrib/gcc/cp/decl.c ============================================================================== --- head/contrib/gcc/cp/decl.c Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/cp/decl.c Sat Dec 28 20:30:31 2013 (r260014) @@ -232,10 +232,17 @@ int function_depth; with __attribute__((deprecated)). An object declared as __attribute__((deprecated)) suppresses warnings of uses of other deprecated items. */ +/* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ +/* An object declared as __attribute__((unavailable)) suppresses + any reports of being declared with unavailable or deprecated + items. */ +/* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ enum deprecated_states { DEPRECATED_NORMAL, DEPRECATED_SUPPRESS + /* APPLE LOCAL "unavailable" attribute (radar 2809697) */ + , DEPRECATED_UNAVAILABLE_SUPPRESS }; static enum deprecated_states deprecated_state = DEPRECATED_NORMAL; @@ -3836,14 +3843,40 @@ start_decl (const cp_declarator *declara tree decl; tree type, tem; tree context; + /* APPLE LOCAL "unavailable" attribute (radar 2809697) */ + tree a; bool was_public; *pushed_scope_p = NULL_TREE; - /* An object declared as __attribute__((deprecated)) suppresses - warnings of uses of other deprecated items. */ + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + /* An object declared as __attribute__((unavailable)) suppresses + any reports of being declared with unavailable or deprecated + items. An object declared as __attribute__((deprecated)) + suppresses warnings of uses of other deprecated items. */ +#ifdef A_LESS_INEFFICENT_WAY /* which I really don't want to do! */ if (lookup_attribute ("deprecated", attributes)) deprecated_state = DEPRECATED_SUPPRESS; + else if (lookup_attribute ("unavailable", attributes)) + deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS; +#else /* a more efficient way doing what lookup_attribute would do */ + for (a = attributes; a; a = TREE_CHAIN (a)) + { + tree name = TREE_PURPOSE (a); + if (TREE_CODE (name) == IDENTIFIER_NODE) + if (is_attribute_p ("deprecated", name)) + { + deprecated_state = DEPRECATED_SUPPRESS; + break; + } + if (is_attribute_p ("unavailable", name)) + { + deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS; + break; + } + } +#endif + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ attributes = chainon (attributes, prefix_attributes); @@ -7274,6 +7307,19 @@ grokdeclarator (const cp_declarator *dec type = NULL_TREE; type_was_error_mark_node = true; } + + /* APPLE LOCAL begin unavailable attribute (radar 2809697) --bowdidge */ + /* If the entire declaration is itself tagged as unavailable then + suppress reports of unavailable/deprecated items. If the + entire declaration is tagged as only deprecated we still + report unavailable uses. */ + if (type && TREE_DEPRECATED (type) && TREE_UNAVAILABLE (type)) + { + if (deprecated_state != DEPRECATED_UNAVAILABLE_SUPPRESS) + warn_deprecated_use (type); + } + else + /* APPLE LOCAL end unavailable attribute (radar 2809697) --bowdidge */ /* If the entire declaration is itself tagged as deprecated then suppress reports of deprecated items. */ if (type && TREE_DEPRECATED (type) Modified: head/contrib/gcc/cp/dump.c ============================================================================== --- head/contrib/gcc/cp/dump.c Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/cp/dump.c Sat Dec 28 20:30:31 2013 (r260014) @@ -433,6 +433,9 @@ cp_dump_tree (void* dump_info, tree t) dump_stmt (di, t); dump_child ("body", DO_BODY (t)); dump_child ("cond", DO_COND (t)); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + dump_child ("attrs", DO_ATTRIBUTES (t)); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ break; case FOR_STMT: @@ -441,6 +444,9 @@ cp_dump_tree (void* dump_info, tree t) dump_child ("cond", FOR_COND (t)); dump_child ("expr", FOR_EXPR (t)); dump_child ("body", FOR_BODY (t)); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + dump_child ("attrs", FOR_ATTRIBUTES (t)); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ break; case SWITCH_STMT: @@ -453,6 +459,9 @@ cp_dump_tree (void* dump_info, tree t) dump_stmt (di, t); dump_child ("cond", WHILE_COND (t)); dump_child ("body", WHILE_BODY (t)); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + dump_child ("attrs", WHILE_ATTRIBUTES (t)); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ break; case STMT_EXPR: Modified: head/contrib/gcc/cp/init.c ============================================================================== --- head/contrib/gcc/cp/init.c Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/cp/init.c Sat Dec 28 20:30:31 2013 (r260014) @@ -2563,7 +2563,9 @@ build_vec_init (tree base, tree maxindex tree elt_init; tree to; - for_stmt = begin_for_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + for_stmt = begin_for_stmt (NULL_TREE); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ finish_for_init_stmt (for_stmt); finish_for_cond (build2 (NE_EXPR, boolean_type_node, iterator, build_int_cst (TREE_TYPE (iterator), -1)), Modified: head/contrib/gcc/cp/parser.c ============================================================================== --- head/contrib/gcc/cp/parser.c Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/cp/parser.c Sat Dec 28 20:30:31 2013 (r260014) @@ -6787,6 +6787,16 @@ cp_parser_condition (cp_parser* parser) for ( for-init-statement condition [opt] ; expression [opt] ) statement + APPLE LOCAL begin for-fsf-4_4 3274130 5295549 + GNU extension: + + while attributes [opt] ( condition ) statement + do attributes [opt] statement while ( expression ) ; + for attributes [opt] + ( for-init-statement condition [opt] ; expression [opt] ) + statement + + APPLE LOCAL end for-fsf-4_4 3274130 5295549 Returns the new WHILE_STMT, DO_STMT, or FOR_STMT. */ static tree @@ -6794,10 +6804,14 @@ cp_parser_iteration_statement (cp_parser { cp_token *token; enum rid keyword; - tree statement; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree statement, attributes; +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ unsigned char in_statement; - /* Peek at the next token. */ +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + /* Get the keyword at the start of the loop. */ +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ token = cp_parser_require (parser, CPP_KEYWORD, "iteration-statement"); if (!token) return error_mark_node; @@ -6806,6 +6820,11 @@ cp_parser_iteration_statement (cp_parser statement. */ in_statement = parser->in_statement; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + /* Parse the attributes, if any. */ + attributes = cp_parser_attributes_opt (parser); + +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* See what kind of keyword it is. */ keyword = token->keyword; switch (keyword) @@ -6815,7 +6834,9 @@ cp_parser_iteration_statement (cp_parser tree condition; /* Begin the while-statement. */ - statement = begin_while_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + statement = begin_while_stmt (attributes); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* Look for the `('. */ cp_parser_require (parser, CPP_OPEN_PAREN, "`('"); /* Parse the condition. */ @@ -6837,7 +6858,9 @@ cp_parser_iteration_statement (cp_parser tree expression; /* Begin the do-statement. */ - statement = begin_do_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + statement = begin_do_stmt (attributes); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* Parse the body of the do-statement. */ parser->in_statement = IN_ITERATION_STMT; cp_parser_implicitly_scoped_statement (parser, NULL); @@ -6864,7 +6887,9 @@ cp_parser_iteration_statement (cp_parser tree expression = NULL_TREE; /* Begin the for-statement. */ - statement = begin_for_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + statement = begin_for_stmt (attributes); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* Look for the `('. */ cp_parser_require (parser, CPP_OPEN_PAREN, "`('"); /* Parse the initialization. */ Modified: head/contrib/gcc/cp/pt.c ============================================================================== --- head/contrib/gcc/cp/pt.c Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/cp/pt.c Sat Dec 28 20:30:31 2013 (r260014) @@ -8593,8 +8593,11 @@ tsubst_expr (tree t, tree args, tsubst_f } case FOR_STMT: - stmt = begin_for_stmt (); - RECUR (FOR_INIT_STMT (t)); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tmp = RECUR (FOR_ATTRIBUTES (t)); + stmt = begin_for_stmt (tmp); + RECUR (FOR_INIT_STMT (t)); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ finish_for_init_stmt (stmt); tmp = RECUR (FOR_COND (t)); finish_for_cond (tmp, stmt); @@ -8605,7 +8608,10 @@ tsubst_expr (tree t, tree args, tsubst_f break; case WHILE_STMT: - stmt = begin_while_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tmp = RECUR (WHILE_ATTRIBUTES (t)); + stmt = begin_while_stmt (tmp); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ tmp = RECUR (WHILE_COND (t)); finish_while_stmt_cond (tmp, stmt); RECUR (WHILE_BODY (t)); @@ -8613,7 +8619,10 @@ tsubst_expr (tree t, tree args, tsubst_f break; case DO_STMT: - stmt = begin_do_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tmp = RECUR (DO_ATTRIBUTES (t)); + stmt = begin_do_stmt (tmp); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ RECUR (DO_BODY (t)); finish_do_body (stmt); tmp = RECUR (DO_COND (t)); Modified: head/contrib/gcc/cp/semantics.c ============================================================================== --- head/contrib/gcc/cp/semantics.c Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/cp/semantics.c Sat Dec 28 20:30:31 2013 (r260014) @@ -704,10 +704,14 @@ finish_if_stmt (tree if_stmt) appropriate. */ tree -begin_while_stmt (void) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +begin_while_stmt (tree attribs) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ { tree r; - r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE, attribs); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (r); WHILE_BODY (r) = do_pushlevel (sk_block); begin_cond (&WHILE_COND (r)); @@ -737,9 +741,14 @@ finish_while_stmt (tree while_stmt) appropriate. */ tree -begin_do_stmt (void) -{ - tree r = build_stmt (DO_STMT, NULL_TREE, NULL_TREE); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +begin_do_stmt (tree attribs) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ +{ + /* APPLE LOCAL radar 4445586 */ +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree r = build_stmt (DO_STMT, NULL_TREE, NULL_TREE, attribs, NULL_TREE); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (r); DO_BODY (r) = push_stmt_list (); return r; @@ -803,12 +812,17 @@ finish_return_stmt (tree expr) /* Begin a for-statement. Returns a new FOR_STMT if appropriate. */ tree -begin_for_stmt (void) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +begin_for_stmt (tree attribs) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ { tree r; r = build_stmt (FOR_STMT, NULL_TREE, NULL_TREE, - NULL_TREE, NULL_TREE); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + NULL_TREE, NULL_TREE, attribs); + +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ if (flag_new_for_scope > 0) TREE_CHAIN (r) = do_pushlevel (sk_for); Modified: head/contrib/gcc/doc/extend.texi ============================================================================== --- head/contrib/gcc/doc/extend.texi Sat Dec 28 20:05:31 2013 (r260013) +++ head/contrib/gcc/doc/extend.texi Sat Dec 28 20:30:31 2013 (r260014) @@ -58,6 +58,9 @@ extensions, accepted by GCC in C89 mode * Character Escapes:: @samp{\e} stands for the character @key{ESC}. * Variable Attributes:: Specifying attributes of variables. * Type Attributes:: Specifying attributes of types. +@c APPLE LOCAL begin for-fsf-4_4 3274130 5295549 +* Label Attributes:: Specifying attributes of labels and statements. +@c APPLE LOCAL end for-fsf-4_4 3274130 5295549 * Alignment:: Inquiring about the alignment of a type or variable. * Inline:: Defining inline functions (as fast as macros). * Extended Asm:: Assembler instructions with C expressions as operands. @@ -1587,8 +1590,11 @@ attributes are currently defined for fun @code{gnu_inline} and @code{externally_visible}. Several other attributes are defined for functions on particular target systems. Other attributes, including @code{section} are supported for variables declarations -(@pxref{Variable Attributes}) and for types (@pxref{Type Attributes}). *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 20:54:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 305A3416; Sat, 28 Dec 2013 20:54:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C2F21957; Sat, 28 Dec 2013 20:54:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSKs83F053087; Sat, 28 Dec 2013 20:54:08 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSKs8se053086; Sat, 28 Dec 2013 20:54:08 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312282054.rBSKs8se053086@svn.freebsd.org> From: Dimitry Andric Date: Sat, 28 Dec 2013 20:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260015 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 20:54:09 -0000 Author: dim Date: Sat Dec 28 20:54:08 2013 New Revision: 260015 URL: http://svnweb.freebsd.org/changeset/base/260015 Log: In libc++'s type_traits header, avoid warnings (activated by our use of -Wsystem-headers) about potential keyword compatibility problems, by adding a __libcpp prefix to the applicable identifiers. Upstream is still debating about this, but we need it now, to be able to import clang 3.4. MFC after: 3 days Modified: head/contrib/libc++/include/type_traits Modified: head/contrib/libc++/include/type_traits ============================================================================== --- head/contrib/libc++/include/type_traits Sat Dec 28 20:30:31 2013 (r260014) +++ head/contrib/libc++/include/type_traits Sat Dec 28 20:54:08 2013 (r260015) @@ -280,53 +280,53 @@ template using remove_cv_t = // is_void -template struct __is_void : public false_type {}; -template <> struct __is_void : public true_type {}; +template struct __libcpp_is_void : public false_type {}; +template <> struct __libcpp_is_void : public true_type {}; template struct _LIBCPP_TYPE_VIS is_void - : public __is_void::type> {}; + : public __libcpp_is_void::type> {}; // __is_nullptr_t -template struct ____is_nullptr_t : public false_type {}; -template <> struct ____is_nullptr_t : public true_type {}; +template struct __libcpp___is_nullptr : public false_type {}; +template <> struct __libcpp___is_nullptr : public true_type {}; template struct _LIBCPP_TYPE_VIS __is_nullptr_t - : public ____is_nullptr_t::type> {}; + : public __libcpp___is_nullptr::type> {}; // is_integral -template struct __is_integral : public false_type {}; -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; +template struct __libcpp_is_integral : public false_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; #endif // _LIBCPP_HAS_NO_UNICODE_CHARS -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; -template <> struct __is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; +template <> struct __libcpp_is_integral : public true_type {}; template struct _LIBCPP_TYPE_VIS is_integral - : public __is_integral::type> {}; + : public __libcpp_is_integral::type> {}; // is_floating_point -template struct __is_floating_point : public false_type {}; -template <> struct __is_floating_point : public true_type {}; -template <> struct __is_floating_point : public true_type {}; -template <> struct __is_floating_point : public true_type {}; +template struct __libcpp_is_floating_point : public false_type {}; +template <> struct __libcpp_is_floating_point : public true_type {}; +template <> struct __libcpp_is_floating_point : public true_type {}; +template <> struct __libcpp_is_floating_point : public true_type {}; template struct _LIBCPP_TYPE_VIS is_floating_point - : public __is_floating_point::type> {}; + : public __libcpp_is_floating_point::type> {}; // is_array @@ -339,11 +339,11 @@ template struct // is_pointer -template struct __is_pointer : public false_type {}; -template struct __is_pointer<_Tp*> : public true_type {}; +template struct __libcpp_is_pointer : public false_type {}; +template struct __libcpp_is_pointer<_Tp*> : public true_type {}; template struct _LIBCPP_TYPE_VIS is_pointer - : public __is_pointer::type> {}; + : public __libcpp_is_pointer::type> {}; // is_reference @@ -419,29 +419,29 @@ template ::value || is_reference<_Tp>::value || is_same<_Tp, nullptr_t>::value > -struct __is_function +struct __libcpp_is_function : public integral_constant(__is_function_imp::__source<_Tp>())) == 1> {}; -template struct __is_function<_Tp, true> : public false_type {}; +template struct __libcpp_is_function<_Tp, true> : public false_type {}; template struct _LIBCPP_TYPE_VIS is_function - : public __is_function<_Tp> {}; + : public __libcpp_is_function<_Tp> {}; // is_member_function_pointer -template struct __is_member_function_pointer : public false_type {}; -template struct __is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; +template struct __libcpp_is_member_function_pointer : public false_type {}; +template struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; template struct _LIBCPP_TYPE_VIS is_member_function_pointer - : public __is_member_function_pointer::type> {}; + : public __libcpp_is_member_function_pointer::type> {}; // is_member_pointer -template struct __is_member_pointer : public false_type {}; -template struct __is_member_pointer<_Tp _Up::*> : public true_type {}; +template struct __libcpp_is_member_pointer : public false_type {}; +template struct __libcpp_is_member_pointer<_Tp _Up::*> : public true_type {}; template struct _LIBCPP_TYPE_VIS is_member_pointer - : public __is_member_pointer::type> {}; + : public __libcpp_is_member_pointer::type> {}; // is_member_object_pointer @@ -640,11 +640,11 @@ template struct ___is_signed<_Tp, false> : public true_type {}; // floating point template ::value> -struct __is_signed : public ___is_signed<_Tp> {}; +struct __libcpp_is_signed : public ___is_signed<_Tp> {}; -template struct __is_signed<_Tp, false> : public false_type {}; +template struct __libcpp_is_signed<_Tp, false> : public false_type {}; -template struct _LIBCPP_TYPE_VIS is_signed : public __is_signed<_Tp> {}; +template struct _LIBCPP_TYPE_VIS is_signed : public __libcpp_is_signed<_Tp> {}; // is_unsigned @@ -655,11 +655,11 @@ template struct ___is_unsigned<_Tp, false> : public false_type {}; // floating point template ::value> -struct __is_unsigned : public ___is_unsigned<_Tp> {}; +struct __libcpp_is_unsigned : public ___is_unsigned<_Tp> {}; -template struct __is_unsigned<_Tp, false> : public false_type {}; +template struct __libcpp_is_unsigned<_Tp, false> : public false_type {}; -template struct _LIBCPP_TYPE_VIS is_unsigned : public __is_unsigned<_Tp> {}; +template struct _LIBCPP_TYPE_VIS is_unsigned : public __libcpp_is_unsigned<_Tp> {}; // rank From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 21:04:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 138F8A35; Sat, 28 Dec 2013 21:04:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 002ED19F8; Sat, 28 Dec 2013 21:04:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSL4HrE057320; Sat, 28 Dec 2013 21:04:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSL4HJc057319; Sat, 28 Dec 2013 21:04:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312282104.rBSL4HJc057319@svn.freebsd.org> From: Dimitry Andric Date: Sat, 28 Dec 2013 21:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260016 - head/sys/dev/sk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 21:04:18 -0000 Author: dim Date: Sat Dec 28 21:04:17 2013 New Revision: 260016 URL: http://svnweb.freebsd.org/changeset/base/260016 Log: Remove superfluous old-style rcsid[] from if_sk.c. There is already an __FBSDID() at the top of the file. MFC after: 3 days Modified: head/sys/dev/sk/if_sk.c Modified: head/sys/dev/sk/if_sk.c ============================================================================== --- head/sys/dev/sk/if_sk.c Sat Dec 28 20:54:08 2013 (r260015) +++ head/sys/dev/sk/if_sk.c Sat Dec 28 21:04:17 2013 (r260016) @@ -139,11 +139,6 @@ MODULE_DEPEND(sk, miibus, 1, 1, 1); /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif - static const struct sk_type sk_devs[] = { { VENDORID_SK, From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 21:31:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 504A8FF2; Sat, 28 Dec 2013 21:31:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CC4A1C98; Sat, 28 Dec 2013 21:31:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSLVxl8068372; Sat, 28 Dec 2013 21:31:59 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSLVxel068371; Sat, 28 Dec 2013 21:31:59 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312282131.rBSLVxel068371@svn.freebsd.org> From: Dimitry Andric Date: Sat, 28 Dec 2013 21:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260017 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 21:31:59 -0000 Author: dim Date: Sat Dec 28 21:31:58 2013 New Revision: 260017 URL: http://svnweb.freebsd.org/changeset/base/260017 Log: Mark unused static inline functions defined by the PCTRIE_DEFINE() macro as __unused, so warnings about them are avoided. MFC after: 3 days Modified: head/sys/sys/pctrie.h Modified: head/sys/sys/pctrie.h ============================================================================== --- head/sys/sys/pctrie.h Sat Dec 28 21:04:17 2013 (r260016) +++ head/sys/sys/pctrie.h Sat Dec 28 21:31:58 2013 (r260017) @@ -83,14 +83,14 @@ name##_PCTRIE_LOOKUP_LE(struct pctrie *p return name##_PCTRIE_VAL2PTR(pctrie_lookup_le(ptree, key)); \ } \ \ -static __inline struct type * \ +static __inline __unused struct type * \ name##_PCTRIE_LOOKUP_GE(struct pctrie *ptree, uint64_t key) \ { \ \ return name##_PCTRIE_VAL2PTR(pctrie_lookup_ge(ptree, key)); \ } \ \ -static __inline void \ +static __inline __unused void \ name##_PCTRIE_RECLAIM(struct pctrie *ptree) \ { \ \ From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 22:35:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA7B61B7; Sat, 28 Dec 2013 22:35:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9659B1059; Sat, 28 Dec 2013 22:35:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSMZG6K091709; Sat, 28 Dec 2013 22:35:16 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSMZGrA091708; Sat, 28 Dec 2013 22:35:16 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312282235.rBSMZGrA091708@svn.freebsd.org> From: Dimitry Andric Date: Sat, 28 Dec 2013 22:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260019 - head/sys/modules/drm2/i915kms X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 22:35:16 -0000 Author: dim Date: Sat Dec 28 22:35:16 2013 New Revision: 260019 URL: http://svnweb.freebsd.org/changeset/base/260019 Log: For some files under sys/dev/drm2/i915, turn off warnings about unused functions and variables, since they are contributed code. MFC after: 3 days Modified: head/sys/modules/drm2/i915kms/Makefile Modified: head/sys/modules/drm2/i915kms/Makefile ============================================================================== --- head/sys/modules/drm2/i915kms/Makefile Sat Dec 28 22:26:57 2013 (r260018) +++ head/sys/modules/drm2/i915kms/Makefile Sat Dec 28 22:35:16 2013 (r260019) @@ -38,3 +38,8 @@ SRCS += device_if.h fb_if.h bus_if.h pci opt_drm.h opt_compat.h opt_syscons.h .include + +CWARNFLAGS.i915_debug.c= -Wno-unused-function +CWARNFLAGS.intel_lvds.c= -Wno-unused +CWARNFLAGS.intel_tv.c= -Wno-unused +CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 22:44:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF9F73AF; Sat, 28 Dec 2013 22:44:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BBF5210FC; Sat, 28 Dec 2013 22:44:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSMi24D095132; Sat, 28 Dec 2013 22:44:02 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSMi2D9095131; Sat, 28 Dec 2013 22:44:02 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312282244.rBSMi2D9095131@svn.freebsd.org> From: Dimitry Andric Date: Sat, 28 Dec 2013 22:44:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260020 - head/sys/modules/drm2/radeonkms X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 22:44:02 -0000 Author: dim Date: Sat Dec 28 22:44:02 2013 New Revision: 260020 URL: http://svnweb.freebsd.org/changeset/base/260020 Log: For sys/dev/drm2/radeon, only use -fms-extensions with gcc. This flag is only to stop gcc complaining about anonymous unions, which clang does not do. For clang 3.4 however, -fms-extensions enables the Microsoft __wchar_t type, which clashes with our own types.h. MFC after: 3 days Modified: head/sys/modules/drm2/radeonkms/Makefile Modified: head/sys/modules/drm2/radeonkms/Makefile ============================================================================== --- head/sys/modules/drm2/radeonkms/Makefile Sat Dec 28 22:35:16 2013 (r260019) +++ head/sys/modules/drm2/radeonkms/Makefile Sat Dec 28 22:44:02 2013 (r260020) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../../dev/drm2/radeon KMOD = radeonkms @@ -103,7 +105,9 @@ SRCS += \ iicbus_if.h \ pci_if.h -CFLAGS += -I${.CURDIR}/../../../dev/drm2/radeon \ - -fms-extensions +CFLAGS += -I${.CURDIR}/../../../dev/drm2/radeon +.if ${COMPILER_TYPE} == "gcc" +CFLAGS += -fms-extensions +.endif .include From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 22:52:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39065604; Sat, 28 Dec 2013 22:52:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1812E1183; Sat, 28 Dec 2013 22:52:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSMqk0t098517; Sat, 28 Dec 2013 22:52:46 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSMqknt098515; Sat, 28 Dec 2013 22:52:46 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312282252.rBSMqknt098515@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 28 Dec 2013 22:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260021 - in head/contrib/binutils: gas/config opcodes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 22:52:47 -0000 Author: marcel Date: Sat Dec 28 22:52:46 2013 New Revision: 260021 URL: http://svnweb.freebsd.org/changeset/base/260021 Log: Fix cross-compilation of ia64 target code with clang. Modified: head/contrib/binutils/gas/config/tc-ia64.c head/contrib/binutils/opcodes/ia64-asmtab.c Modified: head/contrib/binutils/gas/config/tc-ia64.c ============================================================================== --- head/contrib/binutils/gas/config/tc-ia64.c Sat Dec 28 22:44:02 2013 (r260020) +++ head/contrib/binutils/gas/config/tc-ia64.c Sat Dec 28 22:52:46 2013 (r260021) @@ -11567,7 +11567,7 @@ fix_insn (fix, odesc, value) err = (*odesc->insert) (odesc, value, insn + slot); if (err) - as_bad_where (fix->fx_file, fix->fx_line, err); + as_bad_where (fix->fx_file, fix->fx_line, "%s", err); t0 = control_bits | (insn[0] << 5) | (insn[1] << 46); t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23); Modified: head/contrib/binutils/opcodes/ia64-asmtab.c ============================================================================== --- head/contrib/binutils/opcodes/ia64-asmtab.c Sat Dec 28 22:44:02 2013 (r260020) +++ head/contrib/binutils/opcodes/ia64-asmtab.c Sat Dec 28 22:52:46 2013 (r260021) @@ -82,7 +82,7 @@ dependencies[] = { { "CPUID#", 7, 0, 5, -1, NULL, }, { "CR[CMCV]", 27, 0, 3, 74, NULL, }, { "CR[DCR]", 27, 0, 3, 0, NULL, }, - { "CR[EOI]", 27, 0, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI Ð CR67)\" on page 2:119", }, + { "CR[EOI]", 27, 0, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI - CR67)\" on page 2:119", }, { "CR[GPTA]", 27, 0, 3, 9, NULL, }, { "CR[IFA]", 27, 0, 1, 20, NULL, }, { "CR[IFA]", 27, 0, 3, 20, NULL, }, @@ -103,13 +103,13 @@ dependencies[] = { { "CR[ITM]", 27, 0, 3, 1, NULL, }, { "CR[ITV]", 27, 0, 3, 72, NULL, }, { "CR[IVA]", 27, 0, 4, 2, NULL, }, - { "CR[IVR]", 27, 0, 7, 65, "SC Section 5.8.3.2, \"External Interrupt Vector Register (IVR Ð CR65)\" on page 2:118", }, - { "CR[LID]", 27, 0, 7, 64, "SC Section 5.8.3.1, \"Local ID (LID Ð CR64)\" on page 2:117", }, + { "CR[IVR]", 27, 0, 7, 65, "SC Section 5.8.3.2, \"External Interrupt Vector Register (IVR - CR65)\" on page 2:118", }, + { "CR[LID]", 27, 0, 7, 64, "SC Section 5.8.3.1, \"Local ID (LID - CR64)\" on page 2:117", }, { "CR[LRR%], % in 0 - 1", 9, 0, 3, -1, NULL, }, { "CR[PMV]", 27, 0, 3, 73, NULL, }, { "CR[PTA]", 27, 0, 3, 8, NULL, }, { "CR[TPR]", 27, 0, 3, 66, NULL, }, - { "CR[TPR]", 27, 0, 7, 66, "SC Section 5.8.3.3, \"Task Priority Register (TPR Ð CR66)\" on page 2:119", }, + { "CR[TPR]", 27, 0, 7, 66, "SC Section 5.8.3.3, \"Task Priority Register (TPR - CR66)\" on page 2:119", }, { "CR[TPR]", 27, 0, 1, 66, NULL, }, { "CR%, % in 3-7, 10-15, 18, 26-63, 75-79, 82-127", 10, 0, 0, -1, NULL, }, { "DBR#", 11, 0, 2, -1, NULL, }, @@ -282,7 +282,7 @@ dependencies[] = { { "CPUID#", 7, 1, 0, -1, NULL, }, { "CR[CMCV]", 27, 1, 2, 74, NULL, }, { "CR[DCR]", 27, 1, 2, 0, NULL, }, - { "CR[EOI]", 27, 1, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI Ð CR67)\" on page 2:119", }, + { "CR[EOI]", 27, 1, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI - CR67)\" on page 2:119", }, { "CR[GPTA]", 27, 1, 2, 9, NULL, }, { "CR[IFA]", 27, 1, 2, 20, NULL, }, { "CR[IFS]", 27, 1, 2, 23, NULL, }, From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 23:01:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B51FF797; Sat, 28 Dec 2013 23:01:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A156611F9; Sat, 28 Dec 2013 23:01:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSN1wMC002328; Sat, 28 Dec 2013 23:01:58 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSN1wWP002326; Sat, 28 Dec 2013 23:01:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312282301.rBSN1wWP002326@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 28 Dec 2013 23:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260022 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 23:01:58 -0000 Author: marcel Date: Sat Dec 28 23:01:57 2013 New Revision: 260022 URL: http://svnweb.freebsd.org/changeset/base/260022 Log: Allow building a cross libkvm by setting TARGET_ARCH. The library so produced will be called libkvm-${ARCH} instead of libkvm. This allows installing it alongside the native version. For symbol lookups, use ps_pglobal_lookup() instead of __fdnlist() when building a cross libkvm. It is assumed that the cross tool that uses the cross libkvm also provides an implementation for this proc_services function. Note that this commit does not change any of the architecture-specific code for cross-compilation. Modified: head/lib/libkvm/Makefile head/lib/libkvm/kvm.c Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Sat Dec 28 22:52:46 2013 (r260021) +++ head/lib/libkvm/Makefile Sat Dec 28 23:01:57 2013 (r260022) @@ -1,23 +1,35 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ +.if defined(TARGET_ARCH) +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +.else +TARGET_ARCH=${MACHINE_ARCH} +TARGET_CPUARCH=${MACHINE_CPUARCH} +.endif + +.if ${TARGET_ARCH} != ${MACHINE_ARCH} +LIB= kvm-${TARGET_ARCH} +CFLAGS+=-DCROSS_LIBKVM +.else LIB= kvm +.endif + SHLIBDIR?= /lib SHLIB_MAJOR= 6 CFLAGS+=-DLIBC_SCCS -I${.CURDIR} -.if exists(${.CURDIR}/kvm_${MACHINE_ARCH}.c) -KVM_ARCH=${MACHINE_ARCH} +.if exists(${.CURDIR}/kvm_${TARGET_ARCH}.c) +KVM_ARCH=${TARGET_ARCH} .else -KVM_ARCH=${MACHINE_CPUARCH} +KVM_ARCH=${TARGET_CPUARCH} .endif WARNS?= 3 SRCS= kvm.c kvm_${KVM_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" +.if exists(${.CURDIR}/kvm_minidump_${KVM_ARCH}.c) SRCS+= kvm_minidump_${KVM_ARCH}.c .endif INCS= kvm.h Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Sat Dec 28 22:52:46 2013 (r260021) +++ head/lib/libkvm/kvm.c Sat Dec 28 23:01:57 2013 (r260022) @@ -73,9 +73,44 @@ static char sccsid[] = "@(#)kvm.c 8.2 (B #include "kvm_private.h" +#ifndef CROSS_LIBKVM + /* from src/lib/libc/gen/nlist.c */ int __fdnlist(int, struct nlist *); +#define kvm_fdnlist __fdnlist + +#else + +#include + +static int +kvm_fdnlist(int fd, struct nlist *list) +{ + psaddr_t addr; + ps_err_e pserr; + int nfail; + + nfail = 0; + while (list->n_name != NULL && list->n_name[0] != '\0') { + list->n_other = 0; + list->n_desc = 0; + pserr = ps_pglobal_lookup(NULL, NULL, list->n_name, &addr); + if (pserr != PS_OK) { + nfail++; + list->n_value = 0; + list->n_type = 0; + } else { + list->n_value = addr; + list->n_type = N_DATA | N_EXT; + } + list++; + } + return (nfail); +} + +#endif /* CROSS_LIBKVM */ + char * kvm_geterr(kvm_t *kd) { @@ -341,7 +376,7 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nli /* Do lookup on the reduced list. */ np = n; - unresolved = __fdnlist(kd->nlfd, np); + unresolved = kvm_fdnlist(kd->nlfd, np); /* Check if we could resolve further symbols and update the list. */ if (unresolved >= 0 && unresolved < missing) { @@ -398,7 +433,7 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, * slow library call. */ if (!ISALIVE(kd)) { - error = __fdnlist(kd->nlfd, nl); + error = kvm_fdnlist(kd->nlfd, nl); if (error <= 0) /* Hard error or success. */ return (error); From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 23:02:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 707638D6; Sat, 28 Dec 2013 23:02:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5CA9511FC; Sat, 28 Dec 2013 23:02:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSN2nfG002493; Sat, 28 Dec 2013 23:02:49 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSN2nfe002492; Sat, 28 Dec 2013 23:02:49 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312282302.rBSN2nfe002492@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 28 Dec 2013 23:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260023 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 23:02:49 -0000 Author: marcel Date: Sat Dec 28 23:02:48 2013 New Revision: 260023 URL: http://svnweb.freebsd.org/changeset/base/260023 Log: Allow building a cross libkvm for ia64. Modified: head/lib/libkvm/kvm_ia64.c Modified: head/lib/libkvm/kvm_ia64.c ============================================================================== --- head/lib/libkvm/kvm_ia64.c Sat Dec 28 23:01:57 2013 (r260022) +++ head/lib/libkvm/kvm_ia64.c Sat Dec 28 23:02:48 2013 (r260023) @@ -32,9 +32,15 @@ #include #include +#ifndef CROSS_LIBKVM #include #include #include +#else +#include "../../sys/ia64/include/atomic.h" +#include "../../sys/ia64/include/bootinfo.h" +#include "../../sys/ia64/include/pte.h" +#endif #include #include @@ -163,7 +169,11 @@ _kvm_initvtop(kvm_t *kd) return (-1); } +#ifndef CROSS_LIBKVM kd->vmst->pagesize = getpagesize(); +#else + kd->vmst->pagesize = 8192; +#endif if (_kvm_maphdrs(kd, sizeof(Elf64_Ehdr)) == -1) return (-1); From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 23:12:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BF2DB95; Sat, 28 Dec 2013 23:12:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0828F1279; Sat, 28 Dec 2013 23:12:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSNCWNC006518; Sat, 28 Dec 2013 23:12:32 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSNCWZ7006514; Sat, 28 Dec 2013 23:12:32 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312282312.rBSNCWZ7006514@svn.freebsd.org> From: Dimitry Andric Date: Sat, 28 Dec 2013 23:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260025 - in head/sys: conf modules/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 23:12:33 -0000 Author: dim Date: Sat Dec 28 23:12:32 2013 New Revision: 260025 URL: http://svnweb.freebsd.org/changeset/base/260025 Log: Disable warning about unused functions for ar9300_reset.c for now. MFC after: 3 days Modified: head/sys/conf/files head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Dec 28 23:08:58 2013 (r260024) +++ head/sys/conf/files Sat Dec 28 23:12:32 2013 (r260025) @@ -1042,7 +1042,7 @@ contrib/dev/ath/ath_hal/ar9300/ar9300_re contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c optional ath_hal | ath_ar9300 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c optional ath_hal | ath_ar9300 \ - compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal ${NO_WSOMETIMES_UNINITIALIZED}" + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal ${NO_WSOMETIMES_UNINITIALIZED} -Wno-unused-function" contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c optional ath_hal | ath_ar9300 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c optional ath_hal | ath_ar9300 \ Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Sat Dec 28 23:08:58 2013 (r260024) +++ head/sys/modules/ath/Makefile Sat Dec 28 23:12:32 2013 (r260025) @@ -166,4 +166,4 @@ CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T} # AR9300 HAL build overrides, as there's still some code to tidy up CWARNFLAGS.ar9300_eeprom.c= ${NO_WCONSTANT_CONVERSION} -CWARNFLAGS.ar9300_reset.c= ${NO_WSOMETIMES_UNINITIALIZED} +CWARNFLAGS.ar9300_reset.c= ${NO_WSOMETIMES_UNINITIALIZED} -Wno-unused-function From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 23:17:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE57FD00; Sat, 28 Dec 2013 23:17:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE3DB128D; Sat, 28 Dec 2013 23:17:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSNHPUN007212; Sat, 28 Dec 2013 23:17:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSNHPjT007210; Sat, 28 Dec 2013 23:17:25 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312282317.rBSNHPjT007210@svn.freebsd.org> From: Dimitry Andric Date: Sat, 28 Dec 2013 23:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260026 - in head/sys: conf modules/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 23:17:25 -0000 Author: dim Date: Sat Dec 28 23:17:24 2013 New Revision: 260026 URL: http://svnweb.freebsd.org/changeset/base/260026 Log: Disable warning about unused functions for ieee80211_crypto.c and ieee80211_mesh.c for now. MFC after: 3 days Modified: head/sys/conf/files head/sys/modules/wlan/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Dec 28 23:12:32 2013 (r260025) +++ head/sys/conf/files Sat Dec 28 23:17:24 2013 (r260026) @@ -3132,7 +3132,8 @@ net80211/ieee80211_ageq.c optional wlan net80211/ieee80211_adhoc.c optional wlan net80211/ieee80211_ageq.c optional wlan net80211/ieee80211_amrr.c optional wlan | wlan_amrr -net80211/ieee80211_crypto.c optional wlan +net80211/ieee80211_crypto.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_crypto_ccmp.c optional wlan wlan_ccmp net80211/ieee80211_crypto_none.c optional wlan net80211/ieee80211_crypto_tkip.c optional wlan wlan_tkip @@ -3145,7 +3146,8 @@ net80211/ieee80211_ht.c optional wlan net80211/ieee80211_hwmp.c optional wlan ieee80211_support_mesh net80211/ieee80211_input.c optional wlan net80211/ieee80211_ioctl.c optional wlan -net80211/ieee80211_mesh.c optional wlan ieee80211_support_mesh +net80211/ieee80211_mesh.c optional wlan ieee80211_support_mesh \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_monitor.c optional wlan net80211/ieee80211_node.c optional wlan net80211/ieee80211_output.c optional wlan Modified: head/sys/modules/wlan/Makefile ============================================================================== --- head/sys/modules/wlan/Makefile Sat Dec 28 23:12:32 2013 (r260025) +++ head/sys/modules/wlan/Makefile Sat Dec 28 23:17:24 2013 (r260026) @@ -31,3 +31,7 @@ opt_ddb.h: .endif .include + +CWARNFLAGS.ieee80211_crypto.c= -Wno-unused-function +CWARNFLAGS.ieee80211_mesh.c= -Wno-unused-function +CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-head@FreeBSD.ORG Sat Dec 28 23:31:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A90B31C; Sat, 28 Dec 2013 23:31:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3C9A31390; Sat, 28 Dec 2013 23:31:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSNVNCF013900; Sat, 28 Dec 2013 23:31:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSNVM3R013898; Sat, 28 Dec 2013 23:31:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312282331.rBSNVM3R013898@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 28 Dec 2013 23:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260027 - head/gnu/usr.bin/gdb/kgdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 23:31:23 -0000 Author: marcel Date: Sat Dec 28 23:31:22 2013 New Revision: 260027 URL: http://svnweb.freebsd.org/changeset/base/260027 Log: When building a cross kgdb, link against the appropriate cross libkvm. Provide an implementation of ps_pglobal_lookup() for use by the cross libkvm. Modified: head/gnu/usr.bin/gdb/kgdb/Makefile head/gnu/usr.bin/gdb/kgdb/main.c Modified: head/gnu/usr.bin/gdb/kgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/Makefile Sat Dec 28 23:17:24 2013 (r260026) +++ head/gnu/usr.bin/gdb/kgdb/Makefile Sat Dec 28 23:31:22 2013 (r260027) @@ -8,7 +8,13 @@ BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_ ${OBJ_BU}/libiberty/libiberty.a GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a -DPADD= ${GDBLIBS} ${BULIBS} ${LIBKVM} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} ${LIBGNUREGEX} -LDADD= ${GDBLIBS} ${BULIBS} -lkvm -lm -lreadline -ltermcap -lgnuregex +DPADD= ${GDBLIBS} ${BULIBS} ${LIBKVM} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} \ + ${LIBGNUREGEX} +LDADD= ${GDBLIBS} ${BULIBS} -lkvm${GDB_SUFFIX} -lm -lreadline -ltermcap \ + -lgnuregex + +.if defined(GDB_CROSS_DEBUGGER) +CFLAGS+= -Wl,-export-dynamic +.endif .include Modified: head/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/main.c Sat Dec 28 23:17:24 2013 (r260026) +++ head/gnu/usr.bin/gdb/kgdb/main.c Sat Dec 28 23:31:22 2013 (r260027) @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef CROSS_DEBUGGER +#include +#endif #include #include #include @@ -78,6 +81,24 @@ static struct ui_file *parse_gdberr; static void (*kgdb_new_objfile_chain)(struct objfile * objfile); +#ifdef CROSS_DEBUGGER +ps_err_e +ps_pglobal_lookup(struct ps_prochandle *ph, const char *obj, const char *name, + psaddr_t *sym_addr) +{ + struct minimal_symbol *ms; + CORE_ADDR addr; + + ms = lookup_minimal_symbol (name, NULL, NULL); + if (ms == NULL) + return PS_NOSYM; + + addr = SYMBOL_VALUE_ADDRESS (ms); + store_typed_address(sym_addr, builtin_type_void_data_ptr, addr); + return PS_OK; +} +#endif + static void usage(void) {