From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 02:12:14 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3682A106568E; Sun, 16 Aug 2009 02:12:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21D138FC68; Sun, 16 Aug 2009 02:12:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7G2CE4g097283; Sun, 16 Aug 2009 02:12:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7G2CDUn097279; Sun, 16 Aug 2009 02:12:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200908160212.n7G2CDUn097279@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Aug 2009 02:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196270 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xenpci ia64/ia64 modules/dtrace/dtnfsclie... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 02:12:14 -0000 Author: marcel Date: Sun Aug 16 02:12:13 2009 New Revision: 196270 URL: http://svn.freebsd.org/changeset/base/196270 Log: MFC rev 196268: Decouple ACPI CPU Ids from FreeBSD's cpuid. The ACPI Ids can be sparse, which causes a kernel assert. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/ia64/ia64/genassym.c stable/8/sys/ia64/ia64/machdep.c stable/8/sys/ia64/ia64/mp_machdep.c stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/ia64/ia64/genassym.c ============================================================================== --- stable/8/sys/ia64/ia64/genassym.c Sun Aug 16 01:48:46 2009 (r196269) +++ stable/8/sys/ia64/ia64/genassym.c Sun Aug 16 02:12:13 2009 (r196270) @@ -91,7 +91,6 @@ ASSYM(MC_SPECIAL_RNAT, offsetof(mcontext ASSYM(PAGE_SHIFT, PAGE_SHIFT); ASSYM(PAGE_SIZE, PAGE_SIZE); -ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); ASSYM(PC_CURRENT_PMAP, offsetof(struct pcpu, pc_current_pmap)); ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); ASSYM(PC_IDLETHREAD, offsetof(struct pcpu, pc_idlethread)); Modified: stable/8/sys/ia64/ia64/machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/machdep.c Sun Aug 16 01:48:46 2009 (r196269) +++ stable/8/sys/ia64/ia64/machdep.c Sun Aug 16 02:12:13 2009 (r196270) @@ -424,7 +424,11 @@ void cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size) { - pcpu->pc_acpi_id = cpuid; + /* + * Set pc_acpi_id to "uninitialized". + * See sys/dev/acpica/acpi_cpu.c + */ + pcpu->pc_acpi_id = 0xffffffff; } void Modified: stable/8/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/mp_machdep.c Sun Aug 16 01:48:46 2009 (r196269) +++ stable/8/sys/ia64/ia64/mp_machdep.c Sun Aug 16 02:12:13 2009 (r196270) @@ -208,31 +208,25 @@ cpu_mp_add(u_int acpiid, u_int apicid, u struct pcpu *pc; u_int64_t lid; void *dpcpu; - - /* Ignore any processor numbers outside our range */ - if (acpiid > mp_maxid) - return; - - KASSERT((all_cpus & (1UL << acpiid)) == 0, - ("%s: cpu%d already in CPU map", __func__, acpiid)); + u_int cpuid; lid = LID_SAPIC_SET(apicid, apiceid); + cpuid = ((ia64_get_lid() & LID_SAPIC_MASK) == lid) ? 0 : smp_cpus++; - if ((ia64_get_lid() & LID_SAPIC_MASK) == lid) { - KASSERT(acpiid == 0, - ("%s: the BSP must be cpu0", __func__)); - } + KASSERT((all_cpus & (1UL << cpuid)) == 0, + ("%s: cpu%d already in CPU map", __func__, acpiid)); - if (acpiid != 0) { + if (cpuid != 0) { pc = (struct pcpu *)malloc(sizeof(*pc), M_SMP, M_WAITOK); + pcpu_init(pc, cpuid, sizeof(*pc)); dpcpu = (void *)kmem_alloc(kernel_map, DPCPU_SIZE); - pcpu_init(pc, acpiid, sizeof(*pc)); - dpcpu_init(dpcpu, acpiid); + dpcpu_init(dpcpu, cpuid); } else pc = pcpup; + pc->pc_acpi_id = acpiid; pc->pc_lid = lid; - all_cpus |= (1UL << acpiid); + all_cpus |= (1UL << cpuid); } void @@ -244,8 +238,8 @@ cpu_mp_announce() for (i = 0; i <= mp_maxid; i++) { pc = pcpu_find(i); if (pc != NULL) { - printf("cpu%d: SAPIC Id=%x, SAPIC Eid=%x", i, - LID_SAPIC_ID(pc->pc_lid), + printf("cpu%d: ACPI Id=%x, SAPIC Id=%x, SAPIC Eid=%x", + i, pc->pc_acpi_id, LID_SAPIC_ID(pc->pc_lid), LID_SAPIC_EID(pc->pc_lid)); if (i == 0) printf(" (BSP)\n"); @@ -305,7 +299,9 @@ cpu_mp_unleash(void *dummy) SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { cpus++; if (pc->pc_awake) { - kproc_create(ia64_store_mca_state, (void*)((uintptr_t)pc->pc_cpuid), NULL, 0, 0, "mca %u", pc->pc_cpuid); + kproc_create(ia64_store_mca_state, + (void*)((uintptr_t)pc->pc_cpuid), NULL, 0, 0, + "mca %u", pc->pc_cpuid); smp_cpus++; } } From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 02:21:24 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1CEF106568C; Sun, 16 Aug 2009 02:21:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C05F38FC41; Sun, 16 Aug 2009 02:21:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7G2LOlX097587; Sun, 16 Aug 2009 02:21:24 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7G2LOE2097585; Sun, 16 Aug 2009 02:21:24 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200908160221.n7G2LOE2097585@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Aug 2009 02:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196271 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/common/nvpair contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xe... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 02:21:25 -0000 Author: marcel Date: Sun Aug 16 02:21:24 2009 New Revision: 196271 URL: http://svn.freebsd.org/changeset/base/196271 Log: MFC revision 196269: Fix misalignment in nvpair_native_embedded() caused by the compiler replacing the bzero(). Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c Sun Aug 16 02:12:13 2009 (r196270) +++ stable/8/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c Sun Aug 16 02:21:24 2009 (r196271) @@ -2523,14 +2523,15 @@ nvpair_native_embedded(nvstream_t *nvs, { if (nvs->nvs_op == NVS_OP_ENCODE) { nvs_native_t *native = (nvs_native_t *)nvs->nvs_private; - nvlist_t *packed = (void *) + char *packed = (void *) (native->n_curr - nvp->nvp_size + NVP_VALOFF(nvp)); /* * Null out the pointer that is meaningless in the packed * structure. The address may not be aligned, so we have * to use bzero. */ - bzero(&packed->nvl_priv, sizeof (packed->nvl_priv)); + bzero(packed + offsetof(nvlist_t, nvl_priv), + sizeof(((nvlist_t *)NULL)->nvl_priv)); } return (nvs_embedded(nvs, EMBEDDED_NVL(nvp))); From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 02:50:34 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1E2D106568B; Sun, 16 Aug 2009 02:50:34 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f205.google.com (mail-fx0-f205.google.com [209.85.220.205]) by mx1.freebsd.org (Postfix) with ESMTP id 160C28FC57; Sun, 16 Aug 2009 02:50:33 +0000 (UTC) Received: by fxm1 with SMTP id 1so1722595fxm.7 for ; Sat, 15 Aug 2009 19:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=IEzwM9Es4Q14+gPS2GYjGaOAtnvCIphyP5mMuTGCBw4=; b=VXWyGmgL516B6ko7y1q+NUVSdJAFLsQHRsOhE2ZzYVFIBBtqZFj4ksr49rxNRUVFYx lPbQpVcuiBMTpwg08YXxIM5lgTSA9952HpFYRxYiQHWYVSWvrghfN2h8etrAXCqht4Lo 08EWH12qjFmqnGWvnDkaCiJkKrLfrsCaPPcPQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Ze21RsCy77rfrI8fRmUzE3TUihYcX8Z2NSog3Gx0Z4986uVcVim/NREtlFhPkKEtjK pYPGx0XK/zlUZc2LJ1AVKZ72qy1svABZQCrP9iOerMXD3M6OY850/nkVXLEl5G3SWSg9 EIEiAJ9CR90ZZFc7+G7OmdXQ2bNJmYtoUpGjo= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.105.9 with SMTP id r9mr698006fao.66.1250389155982; Sat, 15 Aug 2009 19:19:15 -0700 (PDT) In-Reply-To: <200908160212.n7G2CDUn097279@svn.freebsd.org> References: <200908160212.n7G2CDUn097279@svn.freebsd.org> Date: Sun, 16 Aug 2009 04:19:15 +0200 X-Google-Sender-Auth: a00a604c471cfe58 Message-ID: <3bbf2fe10908151919s17752057y53dd32fb02a857bb@mail.gmail.com> From: Attilio Rao To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r196270 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xenpci ia64/ia64 modules/dtrace/dtnfsclie... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 02:50:35 -0000 2009/8/16 Marcel Moolenaar : > Author: marcel > Date: Sun Aug 16 02:12:13 2009 > New Revision: 196270 > URL: http://svn.freebsd.org/changeset/base/196270 > > Log: > MFC rev 196268: > Decouple ACPI CPU Ids from FreeBSD's cpuid. The ACPI Ids can be > sparse, which causes a kernel assert. Can you be a bit more precise? What kernel assert? Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 03:43:42 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FCE5106568B; Sun, 16 Aug 2009 03:43:42 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout027.mac.com (asmtpout027.mac.com [17.148.16.102]) by mx1.freebsd.org (Postfix) with ESMTP id 166CC8FC51; Sun, 16 Aug 2009 03:43:42 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed Received: from macbook-pro.lan.xcllnt.net ([75.101.29.67]) by asmtp027.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KOG005EK7KTSPB0@asmtp027.mac.com>; Sat, 15 Aug 2009 19:43:42 -0700 (PDT) From: Marcel Moolenaar In-reply-to: <3bbf2fe10908151919s17752057y53dd32fb02a857bb@mail.gmail.com> Date: Sat, 15 Aug 2009 19:42:26 -0700 Message-id: References: <200908160212.n7G2CDUn097279@svn.freebsd.org> <3bbf2fe10908151919s17752057y53dd32fb02a857bb@mail.gmail.com> To: Attilio Rao X-Mailer: Apple Mail (2.1074) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r196270 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xenpci ia64/ia64 modules/dtrace/dtnfsclie... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 03:43:42 -0000 On Aug 15, 2009, at 7:19 PM, Attilio Rao wrote: > 2009/8/16 Marcel Moolenaar : >> Author: marcel >> Date: Sun Aug 16 02:12:13 2009 >> New Revision: 196270 >> URL: http://svn.freebsd.org/changeset/base/196270 >> >> Log: >> MFC rev 196268: >> Decouple ACPI CPU Ids from FreeBSD's cpuid. The ACPI Ids can be >> sparse, which causes a kernel assert. > > Can you be a bit more precise? > What kernel assert? In subr_smp.c, function smp_topo(): panic("Built bad topology at %p. CPU mask 0x%X != 0x%X", top, top->cg_mask, all_cpus); See also: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=506001+0+archive/2009/freebsd-current/20090719.freebsd-current http://docs.freebsd.org/cgi/getmsg.cgi?fetch=626164+0+archive/2009/freebsd-current/20090719.freebsd-current FYI, -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 09:41:26 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3898B106568E; Sun, 16 Aug 2009 09:41:26 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by mx1.freebsd.org (Postfix) with ESMTP id E2A1C8FC55; Sun, 16 Aug 2009 09:41:24 +0000 (UTC) Received: by bwz19 with SMTP id 19so2510895bwz.37 for ; Sun, 16 Aug 2009 02:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=6WhWCXC8T+KoFsQQ+coev4ivW4Akb/wqV2Sack4I72I=; b=Q5fH5+mgOXEKAUfhkeT4nEeW3onGuAPjhr/OUUiqbEsbry02in+Aa++c1MwrFOT8QK yF1rEdNJMyr5EyRbHGzauxd0A8KEEVRirtUqF2tigtCO0EFXF5pPOBi7ZHA6PeGWEfLF /WyH7g3lUhr7KhKSXWLKe8oS8b8Srjliv8ky4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=AZfnfyS4TWGgM/fVMgSQeDVfhDqf9kKTK8JnyHRX10pWSyvXMKauhcxMSyCM5MRr3e msuDas7kA1HzlsqS9w65jnwl1dvqMvEnDNIV+iLsUq2lwbWNUA9SXIMSvZoNspTSDLAf VX6tWX7kifbUkszcDmihcjf2ExYcU03kL36xw= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.105.16 with SMTP id r16mr740804fao.30.1250415683736; Sun, 16 Aug 2009 02:41:23 -0700 (PDT) In-Reply-To: References: <200908160212.n7G2CDUn097279@svn.freebsd.org> <3bbf2fe10908151919s17752057y53dd32fb02a857bb@mail.gmail.com> Date: Sun, 16 Aug 2009 11:41:23 +0200 X-Google-Sender-Auth: 754e99a3b99db538 Message-ID: <3bbf2fe10908160241x64555c15oe185d429908f7131@mail.gmail.com> From: Attilio Rao To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r196270 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xenpci ia64/ia64 modules/dtrace/dtnfsclie... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 09:41:26 -0000 2009/8/16 Marcel Moolenaar : > > On Aug 15, 2009, at 7:19 PM, Attilio Rao wrote: > >> 2009/8/16 Marcel Moolenaar : >>> >>> Author: marcel >>> Date: Sun Aug 16 02:12:13 2009 >>> New Revision: 196270 >>> URL: http://svn.freebsd.org/changeset/base/196270 >>> >>> Log: >>> MFC rev 196268: >>> Decouple ACPI CPU Ids from FreeBSD's cpuid. The ACPI Ids can be >>> sparse, which causes a kernel assert. >> >> Can you be a bit more precise? >> What kernel assert? > > In subr_smp.c, function smp_topo(): > panic("Built bad topology at %p. CPU mask 0x%X != 0x%X", > top, top->cg_mask, all_cpus); > > See also: > http://docs.freebsd.org/cgi/getmsg.cgi?fetch=506001+0+archive/2009/freebsd-current/20090719.freebsd-current > http://docs.freebsd.org/cgi/getmsg.cgi?fetch=626164+0+archive/2009/freebsd-current/20090719.freebsd-current lThat's very interesting. That probabilly means we will end without any sparse CPUs IDs on all architectures? That would be very important because we could cut things like CPU_ABSENT() and rearrange things in a very different way. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 10:25:58 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D855B106568B; Sun, 16 Aug 2009 10:25:58 +0000 (UTC) (envelope-from rink@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6B2E8FC43; Sun, 16 Aug 2009 10:25:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7GAPwtH013234; Sun, 16 Aug 2009 10:25:58 GMT (envelope-from rink@svn.freebsd.org) Received: (from rink@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7GAPwMY013232; Sun, 16 Aug 2009 10:25:58 GMT (envelope-from rink@svn.freebsd.org) Message-Id: <200908161025.n7GAPwMY013232@svn.freebsd.org> From: Rink Springer Date: Sun, 16 Aug 2009 10:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196273 - stable/8/usr.sbin/sysinstall X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 10:25:59 -0000 Author: rink Date: Sun Aug 16 10:25:58 2009 New Revision: 196273 URL: http://svn.freebsd.org/changeset/base/196273 Log: MFC r196272 Prevent sysinstall from needlessly waiting for confirmation when using an USB device in non-interactive mode. If there are no USB devices, sysinstall gives an error messages, and if there is >1, it'll ask which one is to be used. This change allows a non-interactive install from USB media to succeed without any user interaction if there is exactly one USB disk device in the system it can use. Submitted by: Daniel O'Connor < doconnorat gsoft dot com dot au > Reviewed by: randi Approved by: re (rwatson) Modified: stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/sysinstall/media.c Modified: stable/8/usr.sbin/sysinstall/media.c ============================================================================== --- stable/8/usr.sbin/sysinstall/media.c Sun Aug 16 10:11:33 2009 (r196272) +++ stable/8/usr.sbin/sysinstall/media.c Sun Aug 16 10:25:58 2009 (r196273) @@ -262,7 +262,8 @@ mediaSetUSB(dialogMenuItem *self) mediaDevice = devs[0]; if (mediaDevice) mediaDevice->private = NULL; - msgConfirm("Using USB device: %s", mediaDevice->name); + if (!variable_get(VAR_NONINTERACTIVE)) + msgConfirm("Using USB device: %s", mediaDevice->name); return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 14:17:47 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E6C1106568B; Sun, 16 Aug 2009 14:17:47 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8347C8FC15; Sun, 16 Aug 2009 14:17:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7GEHljw019090; Sun, 16 Aug 2009 14:17:47 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7GEHl7W019087; Sun, 16 Aug 2009 14:17:47 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200908161417.n7GEHl7W019087@svn.freebsd.org> From: Andrew Thompson Date: Sun, 16 Aug 2009 14:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196275 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/usb dev/xen/netfront dev/xen/xenpci modules/dtrace/dtnfsclient... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 14:17:47 -0000 Author: thompsa Date: Sun Aug 16 14:17:47 2009 New Revision: 196275 URL: http://svn.freebsd.org/changeset/base/196275 Log: MFC r196274 Change the usb workers from kernel processes to threads, this is mostly a cosmetic change to reduce cruft in the proc table. Also change the idle wait message to `-` like how taskqueues are. Reviewed by: julian Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/usb/usb_process.c stable/8/sys/dev/usb/usb_process.h stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/dev/usb/usb_process.c ============================================================================== --- stable/8/sys/dev/usb/usb_process.c Sun Aug 16 14:13:55 2009 (r196274) +++ stable/8/sys/dev/usb/usb_process.c Sun Aug 16 14:17:47 2009 (r196275) @@ -63,10 +63,12 @@ #endif #if (__FreeBSD_version >= 800000) +static struct proc *usbproc; #define USB_THREAD_CREATE(f, s, p, ...) \ - kproc_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__) -#define USB_THREAD_SUSPEND(p) kproc_suspend(p,0) -#define USB_THREAD_EXIT(err) kproc_exit(err) + kproc_kthread_add((f), (s), &usbproc, (p), RFHIGHPID, \ + 0, "usb", __VA_ARGS__) +#define USB_THREAD_SUSPEND(p) kthread_suspend(p,0) +#define USB_THREAD_EXIT(err) kthread_exit() #else #define USB_THREAD_CREATE(f, s, p, ...) \ kthread_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__) @@ -207,8 +209,8 @@ usb_proc_create(struct usb_process *up, TAILQ_INIT(&up->up_qhead); - cv_init(&up->up_cv, "wmsg"); - cv_init(&up->up_drain, "dmsg"); + cv_init(&up->up_cv, "-"); + cv_init(&up->up_drain, "usbdrain"); if (USB_THREAD_CREATE(&usb_process, up, &up->up_ptr, pmesg)) { Modified: stable/8/sys/dev/usb/usb_process.h ============================================================================== --- stable/8/sys/dev/usb/usb_process.h Sun Aug 16 14:13:55 2009 (r196274) +++ stable/8/sys/dev/usb/usb_process.h Sun Aug 16 14:17:47 2009 (r196275) @@ -49,7 +49,11 @@ struct usb_process { struct cv up_cv; struct cv up_drain; +#if (__FreeBSD_version >= 800000) + struct thread *up_ptr; +#else struct proc *up_ptr; +#endif struct thread *up_curtd; struct mtx *up_mtx; From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 14:24:33 2009 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10DA0106564A; Sun, 16 Aug 2009 14:24:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id 7F4DA8FC3F; Sun, 16 Aug 2009 14:24:32 +0000 (UTC) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n7GCYHWe000466; Sun, 16 Aug 2009 22:34:17 +1000 Received: from c122-107-127-137.carlnfd1.nsw.optusnet.com.au (c122-107-127-137.carlnfd1.nsw.optusnet.com.au [122.107.127.137]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n7GCYDJi005427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Aug 2009 22:34:14 +1000 Date: Sun, 16 Aug 2009 22:34:13 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Marcel Moolenaar In-Reply-To: <200908160221.n7G2LOE2097585@svn.freebsd.org> Message-ID: <20090816220319.W32412@delplex.bde.org> References: <200908160221.n7G2LOE2097585@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r196271 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/common/nvpair contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xe... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 14:24:33 -0000 On Sun, 16 Aug 2009, Marcel Moolenaar wrote: > MFC revision 196269: > Fix misalignment in nvpair_native_embedded() caused by the compiler > replacing the bzero(). How can it replace bzero() with -ffreestanding, which implies -fbuiltin and guarantees that should be stronger not to use library functions? (gcc.info is poorly worded, so the stronger guarantees are actually weaker.) > Modified: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > ... Still has too many props. Bruce From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 15:20:35 2009 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28C6E106568D; Sun, 16 Aug 2009 15:20:35 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id 0C5CC8FC4D; Sun, 16 Aug 2009 15:20:34 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed; delsp=yes Received: from macbook-pro.lan.xcllnt.net ([75.101.29.67]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KOH0091R6M9IJ90@asmtp029.mac.com>; Sun, 16 Aug 2009 08:20:34 -0700 (PDT) From: Marcel Moolenaar In-reply-to: <20090816220319.W32412@delplex.bde.org> Date: Sun, 16 Aug 2009 08:20:33 -0700 Message-id: <0997BA81-4982-467A-AB0B-7A1233B82665@mac.com> References: <200908160221.n7G2LOE2097585@svn.freebsd.org> <20090816220319.W32412@delplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1074) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, Marcel Moolenaar , svn-src-stable-8@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r196271 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/common/nvpair contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xe... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 15:20:35 -0000 On Aug 16, 2009, at 5:34 AM, Bruce Evans wrote: > On Sun, 16 Aug 2009, Marcel Moolenaar wrote: > >> MFC revision 196269: >> Fix misalignment in nvpair_native_embedded() caused by the compiler >> replacing the bzero(). > > How can it replace bzero() with -ffreestanding, which implies - > fbuiltin > and guarantees that should be stronger not to use library functions? > (gcc.info is poorly worded, so the stronger guarantees are actually > weaker.) -ffreestanding applies to the kernel only. This code is shared between kernel and userspace and the misalignment is in userspace. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 15:32:15 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 929B2106568B; Sun, 16 Aug 2009 15:32:15 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout025.mac.com (asmtpout025.mac.com [17.148.16.100]) by mx1.freebsd.org (Postfix) with ESMTP id 745518FC4D; Sun, 16 Aug 2009 15:32:15 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed Received: from macbook-pro.lan.xcllnt.net ([75.101.29.67]) by asmtp025.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KOH00KFB75P4N10@asmtp025.mac.com>; Sun, 16 Aug 2009 08:32:15 -0700 (PDT) From: Marcel Moolenaar In-reply-to: <3bbf2fe10908160241x64555c15oe185d429908f7131@mail.gmail.com> Date: Sun, 16 Aug 2009 08:32:12 -0700 Message-id: <90894806-263A-4BB5-AA5E-704EB24A6A0B@mac.com> References: <200908160212.n7G2CDUn097279@svn.freebsd.org> <3bbf2fe10908151919s17752057y53dd32fb02a857bb@mail.gmail.com> <3bbf2fe10908160241x64555c15oe185d429908f7131@mail.gmail.com> To: Attilio Rao X-Mailer: Apple Mail (2.1074) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r196270 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xenpci ia64/ia64 modules/dtrace/dtnfsclie... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 15:32:15 -0000 On Aug 16, 2009, at 2:41 AM, Attilio Rao wrote: > 2009/8/16 Marcel Moolenaar : >> >> On Aug 15, 2009, at 7:19 PM, Attilio Rao wrote: >> >>> 2009/8/16 Marcel Moolenaar : >>>> >>>> Author: marcel >>>> Date: Sun Aug 16 02:12:13 2009 >>>> New Revision: 196270 >>>> URL: http://svn.freebsd.org/changeset/base/196270 >>>> >>>> Log: >>>> MFC rev 196268: >>>> Decouple ACPI CPU Ids from FreeBSD's cpuid. The ACPI Ids can be >>>> sparse, which causes a kernel assert. >>> >>> Can you be a bit more precise? >>> What kernel assert? >> >> In subr_smp.c, function smp_topo(): >> panic("Built bad topology at %p. CPU mask 0x%X != 0x%X", >> top, top->cg_mask, all_cpus); >> >> See also: >> http://docs.freebsd.org/cgi/getmsg.cgi?fetch=506001+0+archive/2009/freebsd-current/20090719.freebsd-current >> http://docs.freebsd.org/cgi/getmsg.cgi?fetch=626164+0+archive/2009/freebsd-current/20090719.freebsd-current > > lThat's very interesting. That probabilly means we will end without > any sparse CPUs IDs on all architectures? Yes. It also means that hot-swap CPUs are impossible to support for reasons that are unrelated to the technical problems of managing the appearance and disappearance of CPUs. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 20:33:17 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0286A106568B; Sun, 16 Aug 2009 20:33:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2DC28FC15; Sun, 16 Aug 2009 20:33:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7GKXGrF031002; Sun, 16 Aug 2009 20:33:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7GKXGQU031000; Sun, 16 Aug 2009 20:33:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200908162033.n7GKXGQU031000@svn.freebsd.org> From: Ed Schouten Date: Sun, 16 Aug 2009 20:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196277 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xenpci kern modules/dtrace/dtnfsclient mo... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 20:33:17 -0000 Author: ed Date: Sun Aug 16 20:33:16 2009 New Revision: 196277 URL: http://svn.freebsd.org/changeset/base/196277 Log: MFC r196276: Fix small style regression introduced by the MPSAFE newbus code. Approved by: re (rwatson) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/subr_bus.c stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Sun Aug 16 19:55:53 2009 (r196276) +++ stable/8/sys/kern/subr_bus.c Sun Aug 16 20:33:16 2009 (r196277) @@ -4131,7 +4131,7 @@ driver_module_handler(module_t mod, int return (ENOMEM); } - switch (what) { + switch (what) { case MOD_LOAD: if (dmd->dmd_chainevh) error = dmd->dmd_chainevh(mod,what,dmd->dmd_chainarg); From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 16 21:32:12 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 726EB106564A; Sun, 16 Aug 2009 21:32:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60A3A8FC67; Sun, 16 Aug 2009 21:32:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7GLWCbV032671; Sun, 16 Aug 2009 21:32:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7GLWCGm032669; Sun, 16 Aug 2009 21:32:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200908162132.n7GLWCGm032669@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Aug 2009 21:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196279 - in stable/8/sbin/geom: . class/part X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 21:32:12 -0000 Author: marcel Date: Sun Aug 16 21:32:12 2009 New Revision: 196279 URL: http://svn.freebsd.org/changeset/base/196279 Log: MFC change 196278: Emit a proper error message instead of dumping core when 1) GEOM_PART does not exist in the kernel, and 2) the GEOM in question does not exist. Additionally abort in case of programming errors that result in neither the class nor geom not being present in the gctl request. Approved by: re (kib) Modified: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/geom_part.c Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Sun Aug 16 21:27:35 2009 (r196278) +++ stable/8/sbin/geom/class/part/geom_part.c Sun Aug 16 21:32:12 2009 (r196279) @@ -274,8 +274,18 @@ gpart_autofill(struct gctl_req *req) error = geom_gettree(&mesh); if (error) return (error); - cp = find_class(&mesh, gctl_get_ascii(req, "class")); - gp = find_geom(cp, gctl_get_ascii(req, "geom")); + s = gctl_get_ascii(req, "class"); + if (s == NULL) + abort(); + cp = find_class(&mesh, s); + if (cp == NULL) + errx(EXIT_FAILURE, "Class %s not found.", s); + s = gctl_get_ascii(req, "geom"); + if (s == NULL) + abort(); + gp = find_geom(cp, s); + if (gp == NULL) + errx(EXIT_FAILURE, "No such geom: %s.", s); first = atoll(find_geomcfg(gp, "first")); last = atoll(find_geomcfg(gp, "last")); grade = ~0ULL; @@ -536,6 +546,8 @@ gpart_write_partcode(struct gctl_req *re errx(EXIT_FAILURE, "Class %s not found.", s); } s = gctl_get_ascii(req, "geom"); + if (s == NULL) + abort(); gp = find_geom(classp, s); if (gp == NULL) errx(EXIT_FAILURE, "No such geom: %s.", s); From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 06:21:23 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 144E0106564A; Mon, 17 Aug 2009 06:21:23 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 030258FC16; Mon, 17 Aug 2009 06:21:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H6LMaF049678; Mon, 17 Aug 2009 06:21:22 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H6LMB5049675; Mon, 17 Aug 2009 06:21:22 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200908170621.n7H6LMB5049675@svn.freebsd.org> From: Scott Long Date: Mon, 17 Aug 2009 06:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196284 - stable/8/sys/dev/mfi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 06:21:23 -0000 Author: scottl Date: Mon Aug 17 06:21:22 2009 New Revision: 196284 URL: http://svn.freebsd.org/changeset/base/196284 Log: Merge r196200. Add firmware definitions needed by mfiutil Approved by: re Modified: stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/mfi/mfi_ioctl.h stable/8/sys/dev/mfi/mfireg.h Modified: stable/8/sys/dev/mfi/mfi_ioctl.h ============================================================================== --- stable/8/sys/dev/mfi/mfi_ioctl.h Mon Aug 17 06:15:44 2009 (r196283) +++ stable/8/sys/dev/mfi/mfi_ioctl.h Mon Aug 17 06:21:22 2009 (r196284) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #if defined(__amd64__) /* Assume amd64 wants 32 bit Linux */ struct iovec32 { u_int32_t iov_base; Modified: stable/8/sys/dev/mfi/mfireg.h ============================================================================== --- stable/8/sys/dev/mfi/mfireg.h Mon Aug 17 06:15:44 2009 (r196283) +++ stable/8/sys/dev/mfi/mfireg.h Mon Aug 17 06:21:22 2009 (r196284) @@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$"); #define MFI_ODCR0 0xa0 /* outbound doorbell clear register0 */ #define MFI_OSP0 0xb0 /* outbound scratch pad0 */ #define MFI_1078_EIM 0x80000004 /* 1078 enable intrrupt mask */ -#define MFI_RMI 0x2 /* reply message interrupt */ +#define MFI_RMI 0x2 /* reply message interrupt */ #define MFI_1078_RM 0x80000000 /* reply 1078 message interrupt */ #define MFI_ODC 0x4 /* outbound doorbell change interrupt */ @@ -151,15 +151,41 @@ typedef enum { MFI_DCMD_CTRL_EVENT_GETINFO = 0x01040100, MFI_DCMD_CTRL_EVENT_GET = 0x01040300, MFI_DCMD_CTRL_EVENT_WAIT = 0x01040500, + MFI_DCMD_PR_GET_STATUS = 0x01070100, + MFI_DCMD_PR_GET_PROPERTIES = 0x01070200, + MFI_DCMD_PR_SET_PROPERTIES = 0x01070300, + MFI_DCMD_PR_START = 0x01070400, + MFI_DCMD_PR_STOP = 0x01070500, + MFI_DCMD_TIME_SECS_GET = 0x01080201, + MFI_DCMD_FLASH_FW_OPEN = 0x010f0100, + MFI_DCMD_FLASH_FW_DOWNLOAD = 0x010f0200, + MFI_DCMD_FLASH_FW_FLASH = 0x010f0300, + MFI_DCMD_FLASH_FW_CLOSE = 0x010f0400, + MFI_DCMD_PD_GET_LIST = 0x02010000, + MFI_DCMD_PD_GET_INFO = 0x02020000, + MFI_DCMD_PD_STATE_SET = 0x02030100, + MFI_DCMD_PD_REBUILD_START = 0x02040100, + MFI_DCMD_PD_REBUILD_ABORT = 0x02040200, + MFI_DCMD_PD_CLEAR_START = 0x02050100, + MFI_DCMD_PD_CLEAR_ABORT = 0x02050200, + MFI_DCMD_PD_GET_PROGRESS = 0x02060000, + MFI_DCMD_PD_LOCATE_START = 0x02070100, + MFI_DCMD_PD_LOCATE_STOP = 0x02070200, MFI_DCMD_LD_GET_LIST = 0x03010000, MFI_DCMD_LD_GET_INFO = 0x03020000, MFI_DCMD_LD_GET_PROP = 0x03030000, MFI_DCMD_LD_SET_PROP = 0x03040000, + MFI_DCMD_LD_INIT_START = 0x03060100, MFI_DCMD_LD_DELETE = 0x03090000, MFI_DCMD_CFG_READ = 0x04010000, MFI_DCMD_CFG_ADD = 0x04020000, MFI_DCMD_CFG_CLEAR = 0x04030000, + MFI_DCMD_CFG_MAKE_SPARE = 0x04040000, + MFI_DCMD_CFG_REMOVE_SPARE = 0x04050000, MFI_DCMD_CFG_FOREIGN_IMPORT = 0x04060400, + MFI_DCMD_BBU_GET_STATUS = 0x05010000, + MFI_DCMD_BBU_GET_CAPACITY_INFO =0x05020000, + MFI_DCMD_BBU_GET_DESIGN_INFO = 0x05030000, MFI_DCMD_CLUSTER = 0x08000000, MFI_DCMD_CLUSTER_RESET_ALL = 0x08010100, MFI_DCMD_CLUSTER_RESET_LD = 0x08010200 @@ -245,6 +271,9 @@ typedef enum { MFI_STAT_RESERVATION_IN_PROGRESS, MFI_STAT_I2C_ERRORS_DETECTED, MFI_STAT_PCI_ERRORS_DETECTED, + MFI_STAT_DIAG_FAILED, + MFI_STAT_BOOT_MSG_PENDING, + MFI_STAT_FOREIGN_CONFIG_INCOMPLETE, MFI_STAT_INVALID_STATUS = 0xFF } mfi_status_t; @@ -303,6 +332,17 @@ typedef enum { MR_LD_CACHE_ALLOW_WRITE_CACHE = 0x20, MR_LD_CACHE_ALLOW_READ_CACHE = 0x40 } mfi_ld_cache; +#define MR_LD_CACHE_MASK 0x7f + +#define MR_LD_CACHE_POLICY_READ_AHEAD_NONE 0 +#define MR_LD_CACHE_POLICY_READ_AHEAD_ALWAYS MR_LD_CACHE_READ_AHEAD +#define MR_LD_CACHE_POLICY_READ_AHEAD_ADAPTIVE \ + (MR_LD_CACHE_READ_AHEAD | MR_LD_CACHE_READ_ADAPTIVE) +#define MR_LD_CACHE_POLICY_WRITE_THROUGH 0 +#define MR_LD_CACHE_POLICY_WRITE_BACK MR_LD_CACHE_WRITE_BACK +#define MR_LD_CACHE_POLICY_IO_CACHED \ + (MR_LD_CACHE_ALLOW_WRITE_CACHE | MR_LD_CACHE_ALLOW_READ_CACHE) +#define MR_LD_CACHE_POLICY_IO_DIRECT 0 typedef enum { MR_PD_CACHE_UNCHANGED = 0, @@ -320,6 +360,7 @@ typedef enum { #define MFI_DEFAULT_ID -1 #define MFI_MAX_LUN 8 #define MFI_MAX_LD 64 +#define MFI_MAX_PD 256 #define MFI_FRAME_SIZE 64 #define MFI_MBOX_SIZE 12 @@ -866,12 +907,10 @@ union mfi_pd_ddf_type { } __packed; struct mfi_pd_progress { - struct { - uint32_t rbld : 1; - uint32_t patrol : 1; - uint32_t clear : 1; - uint32_t reserved: 29; - } active; + uint32_t active; +#define MFI_PD_PROGRESS_REBUILD (1<<0) +#define MFI_PD_PROGRESS_PATROL (1<<1) +#define MFI_PD_PROGRESS_CLEAR (1<<2) struct mfi_progress rbld; struct mfi_progress patrol; struct mfi_progress clear; @@ -890,8 +929,8 @@ struct mfi_pd_info { uint32_t other_err_count; uint32_t pred_fail_count; uint32_t last_pred_fail_event_seq_num; - uint16_t fw_state; - uint8_t disable_for_removal; + uint16_t fw_state; /* MFI_PD_STATE_* */ + uint8_t disabled_for_removal; uint8_t link_speed; union mfi_pd_ddf_type state; struct { @@ -918,7 +957,7 @@ struct mfi_pd_address { uint16_t encl_device_id; uint8_t encl_index; uint8_t slot_number; - uint8_t scsi_dev_type; + uint8_t scsi_dev_type; /* 0 = disk */ uint8_t connect_port_bitmap; uint64_t sas_addr[2]; } __packed; @@ -926,12 +965,19 @@ struct mfi_pd_address { struct mfi_pd_list { uint32_t size; uint32_t count; - uint8_t data; - /* - struct mfi_pd_address addr[]; - */ + struct mfi_pd_address addr[0]; } __packed; +enum mfi_pd_state { + MFI_PD_STATE_UNCONFIGURED_GOOD = 0x00, + MFI_PD_STATE_UNCONFIGURED_BAD = 0x01, + MFI_PD_STATE_HOT_SPARE = 0x02, + MFI_PD_STATE_OFFLINE = 0x10, + MFI_PD_STATE_FAILED = 0x11, + MFI_PD_STATE_REBUILD = 0x14, + MFI_PD_STATE_ONLINE = 0x18 +}; + union mfi_ld_ref { struct { uint8_t target_id; @@ -986,6 +1032,9 @@ struct mfi_ld_params { uint8_t span_depth; uint8_t state; uint8_t init_state; +#define MFI_LD_PARAMS_INIT_NO 0 +#define MFI_LD_PARAMS_INIT_QUICK 1 +#define MFI_LD_PARAMS_INIT_FULL 2 uint8_t is_consistent; uint8_t reserved[23]; } __packed; @@ -995,7 +1044,7 @@ struct mfi_ld_progress { #define MFI_LD_PROGRESS_CC (1<<0) #define MFI_LD_PROGRESS_BGI (1<<1) #define MFI_LD_PROGRESS_FGI (1<<2) -#define MFI_LD_PORGRESS_RECON (1<<3) +#define MFI_LD_PROGRESS_RECON (1<<3) struct mfi_progress cc; struct mfi_progress bgi; struct mfi_progress fgi; @@ -1028,26 +1077,18 @@ struct mfi_ld_info { uint8_t reserved2[16]; } __packed; -union mfi_spare_type { - struct { - uint8_t is_dedicate :1; - uint8_t is_revertable :1; - uint8_t is_encl_affinity :1; - uint8_t reserved :5; - } v; - uint8_t type; -} __packed; - #define MAX_ARRAYS 16 struct mfi_spare { union mfi_pd_ref ref; - union mfi_spare_type spare_type; + uint8_t spare_type; +#define MFI_SPARE_DEDICATED (1 << 0) +#define MFI_SPARE_REVERTIBLE (1 << 1) +#define MFI_SPARE_ENCL_AFFINITY (1 << 2) uint8_t reserved[2]; uint8_t array_count; - uint16_t array_refd[MAX_ARRAYS]; + uint16_t array_ref[MAX_ARRAYS]; } __packed; -#define MAX_ROW_SIZE 32 struct mfi_array { uint64_t size; uint8_t num_drives; @@ -1055,13 +1096,13 @@ struct mfi_array { uint16_t array_ref; uint8_t pad[20]; struct { - union mfi_pd_ref ref; - uint16_t fw_state; + union mfi_pd_ref ref; /* 0xffff == missing drive */ + uint16_t fw_state; /* MFI_PD_STATE_* */ struct { uint8_t pd; uint8_t slot; } encl; - } pd[MAX_ROW_SIZE]; + } pd[0]; } __packed; struct mfi_config_data { @@ -1073,13 +1114,117 @@ struct mfi_config_data { uint16_t spares_count; uint16_t spares_size; uint8_t reserved[16]; - uint8_t data; - /* - struct mfi_array array[]; - struct mfi_ld_config ld[]; - struct mfi_spare spare[]; - */ -} __packed; + struct mfi_array array[0]; + struct mfi_ld_config ld[0]; + struct mfi_spare spare[0]; +} __packed; + +struct mfi_bbu_capacity_info { + uint16_t relative_charge; + uint16_t absolute_charge; + uint16_t remaining_capacity; + uint16_t full_charge_capacity; + uint16_t run_time_to_empty; + uint16_t average_time_to_empty; + uint16_t average_time_to_full; + uint16_t cycle_count; + uint16_t max_error; + uint16_t remaining_capacity_alarm; + uint16_t remaining_time_alarm; + uint8_t reserved[26]; +} __packed; + +struct mfi_bbu_design_info { + uint32_t mfg_date; + uint16_t design_capacity; + uint16_t design_voltage; + uint16_t spec_info; + uint16_t serial_number; + uint16_t pack_stat_config; + uint8_t mfg_name[12]; + uint8_t device_name[8]; + uint8_t device_chemistry[8]; + uint8_t mfg_data[8]; + uint8_t reserved[17]; +} __packed; + +struct mfi_ibbu_state { + uint16_t gas_guage_status; + uint16_t relative_charge; + uint16_t charger_system_state; + uint16_t charger_system_ctrl; + uint16_t charging_current; + uint16_t absolute_charge; + uint16_t max_error; + uint8_t reserved[18]; +} __packed; + +struct mfi_bbu_state { + uint16_t gas_guage_status; + uint16_t relative_charge; + uint16_t charger_status; + uint16_t remaining_capacity; + uint16_t full_charge_capacity; + uint8_t is_SOH_good; + uint8_t reserved[21]; +} __packed; + +union mfi_bbu_status_detail { + struct mfi_ibbu_state ibbu; + struct mfi_bbu_state bbu; +}; + +struct mfi_bbu_status { + uint8_t battery_type; +#define MFI_BBU_TYPE_NONE 0 +#define MFI_BBU_TYPE_IBBU 1 +#define MFI_BBU_TYPE_BBU 2 + uint8_t reserved; + uint16_t voltage; + int16_t current; + uint16_t temperature; + uint32_t fw_status; +#define MFI_BBU_STATE_PACK_MISSING (1 << 0) +#define MFI_BBU_STATE_VOLTAGE_LOW (1 << 1) +#define MFI_BBU_STATE_TEMPERATURE_HIGH (1 << 2) +#define MFI_BBU_STATE_CHARGE_ACTIVE (1 << 0) +#define MFI_BBU_STATE_DISCHARGE_ACTIVE (1 << 0) + uint8_t pad[20]; + union mfi_bbu_status_detail detail; +} __packed; + +enum mfi_pr_state { + MFI_PR_STATE_STOPPED = 0, + MFI_PR_STATE_READY = 1, + MFI_PR_STATE_ACTIVE = 2, + MFI_PR_STATE_ABORTED = 0xff +}; + +struct mfi_pr_status { + uint32_t num_iteration; + uint8_t state; + uint8_t num_pd_done; + uint8_t reserved[10]; +}; + +enum mfi_pr_opmode { + MFI_PR_OPMODE_AUTO = 0, + MFI_PR_OPMODE_MANUAL = 1, + MFI_PR_OPMODE_DISABLED = 2 +}; + +struct mfi_pr_properties { + uint8_t op_mode; + uint8_t max_pd; + uint8_t reserved; + uint8_t exclude_ld_count; + uint16_t excluded_ld[MFI_MAX_LD]; + uint8_t cur_pd_map[MFI_MAX_PD / 8]; + uint8_t last_pd_map[MFI_MAX_PD / 8]; + uint32_t next_exec; + uint32_t exec_freq; + uint32_t clear_freq; +}; #define MFI_SCSI_MAX_TARGETS 128 #define MFI_SCSI_MAX_LUNS 8 From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 07:25:13 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40F3D106568C; Mon, 17 Aug 2009 07:25:13 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E5F68FC3F; Mon, 17 Aug 2009 07:25:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H7PDMJ052047; Mon, 17 Aug 2009 07:25:13 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H7PDgP052042; Mon, 17 Aug 2009 07:25:13 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200908170725.n7H7PDgP052042@svn.freebsd.org> From: Scott Long Date: Mon, 17 Aug 2009 07:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196285 - in stable/8/usr.sbin: . arp dumpcis iostat jls makefs makefs/ffs mfiutil ntp pstat sysinstall zic X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 07:25:13 -0000 Author: scottl Date: Mon Aug 17 07:25:12 2009 New Revision: 196285 URL: http://svn.freebsd.org/changeset/base/196285 Log: Merge mfiutil Approved by: re Added: stable/8/usr.sbin/mfiutil/ - copied from r196200, head/usr.sbin/mfiutil/ stable/8/usr.sbin/mfiutil/mfiutil.8 (contents, props changed) - copied, changed from r196280, head/usr.sbin/mfiutil/mfiutil.8 Modified: stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mfiutil/Makefile stable/8/usr.sbin/mfiutil/README (props changed) stable/8/usr.sbin/mfiutil/mfi_drive.c stable/8/usr.sbin/mfiutil/mfiutil.1 (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/usr.sbin/Makefile ============================================================================== --- stable/8/usr.sbin/Makefile Mon Aug 17 06:21:22 2009 (r196284) +++ stable/8/usr.sbin/Makefile Mon Aug 17 07:25:12 2009 (r196285) @@ -94,6 +94,7 @@ SUBDIR= ${_ac} \ manctl \ memcontrol \ mergemaster \ + mfiutil \ mixer \ ${_mld6query} \ mlxcontrol \ Modified: stable/8/usr.sbin/mfiutil/Makefile ============================================================================== --- head/usr.sbin/mfiutil/Makefile Thu Aug 13 23:18:45 2009 (r196200) +++ stable/8/usr.sbin/mfiutil/Makefile Mon Aug 17 07:25:12 2009 (r196285) @@ -3,6 +3,7 @@ PROG= mfiutil SRCS= mfiutil.c mfi_cmd.c mfi_config.c mfi_drive.c mfi_evt.c mfi_flash.c \ mfi_patrol.c mfi_show.c mfi_volume.c +MAN8= mfiutil.8 CFLAGS+= -fno-builtin-strftime WARNS?=3 Modified: stable/8/usr.sbin/mfiutil/mfi_drive.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_drive.c Thu Aug 13 23:18:45 2009 (r196200) +++ stable/8/usr.sbin/mfiutil/mfi_drive.c Mon Aug 17 07:25:12 2009 (r196285) @@ -75,8 +75,9 @@ int mfi_lookup_drive(int fd, char *drive, uint16_t *device_id) { struct mfi_pd_list *list; - long val; uint8_t encl, slot; + long val; + u_int i; char *cp; /* Look for a raw device id first. */ @@ -117,15 +118,15 @@ mfi_lookup_drive(int fd, char *drive, ui return (errno); } - for (val = 0; val < list->count; val++) { - if (list->addr[val].scsi_dev_type != 0) + for (i = 0; i < list->count; i++) { + if (list->addr[i].scsi_dev_type != 0) continue; if (((encl == 0xff && - list->addr[val].encl_device_id == 0xffff) || - list->addr[val].encl_index == encl) && - list->addr[val].slot_number == slot) { - *device_id = list->addr[val].device_id; + list->addr[i].encl_device_id == 0xffff) || + list->addr[i].encl_index == encl) && + list->addr[i].slot_number == slot) { + *device_id = list->addr[i].device_id; free(list); return (0); } Copied and modified: stable/8/usr.sbin/mfiutil/mfiutil.8 (from r196280, head/usr.sbin/mfiutil/mfiutil.8) ============================================================================== --- head/usr.sbin/mfiutil/mfiutil.8 Mon Aug 17 06:05:55 2009 (r196280, copy source) +++ stable/8/usr.sbin/mfiutil/mfiutil.8 Mon Aug 17 07:25:12 2009 (r196285) @@ -27,8 +27,8 @@ .\" .\" $FreeBSD$ .\" -.Dd June 17, 2008 -.Dt MFIUTIL 1 +.Dd August 16, 2009 +.Dt MFIUTIL 8 .Os .Sh NAME .Nm mfiutil @@ -161,9 +161,6 @@ on the volume may be specified by the co device, such as .Em mfid0 . -Note that this second method only works on OS versions -.Dv 6.2-YAHOO-20070510 -and later. .Pp Drives may be specified in two forms. First, @@ -562,13 +559,8 @@ patrol read starting in 5 minutes: .Pp .Sh SEE ALSO .Xr mfi 4 -.Sh BUGS -On 64-bit OS versions -.Dv 6.2-YAHOO-20070514 -and earlier, -the -.Xr mfi 4 -driver does not properly report firmware errors to 32-bit versions of -.Nm . -As a result, -some commands may fail even though they do not report any errors. +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 8.0 . From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 07:30:09 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F520106568B; Mon, 17 Aug 2009 07:30:09 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33A948FC69; Mon, 17 Aug 2009 07:30:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H7U9YT052380; Mon, 17 Aug 2009 07:30:09 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H7U9BQ052377; Mon, 17 Aug 2009 07:30:09 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200908170730.n7H7U9BQ052377@svn.freebsd.org> From: Scott Long Date: Mon, 17 Aug 2009 07:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196286 - in stable/8/usr.sbin: . arp dumpcis iostat jls makefs makefs/ffs mfiutil mptutil ntp pstat sysinstall zic X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 07:30:09 -0000 Author: scottl Date: Mon Aug 17 07:30:08 2009 New Revision: 196286 URL: http://svn.freebsd.org/changeset/base/196286 Log: Merge mptutil Approved by: re Added: stable/8/usr.sbin/mptutil/ - copied from r196212, head/usr.sbin/mptutil/ Modified: stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mfiutil/README (props changed) stable/8/usr.sbin/mfiutil/mfiutil.1 (props changed) stable/8/usr.sbin/mfiutil/mfiutil.8 (props changed) stable/8/usr.sbin/mptutil/mptutil.8 stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/usr.sbin/Makefile ============================================================================== --- stable/8/usr.sbin/Makefile Mon Aug 17 07:25:12 2009 (r196285) +++ stable/8/usr.sbin/Makefile Mon Aug 17 07:30:08 2009 (r196286) @@ -104,6 +104,7 @@ SUBDIR= ${_ac} \ ${_mount_smbfs} \ ${_moused} \ ${_mptable} \ + mptutil \ mtest \ mtree \ ${_named} \ Modified: stable/8/usr.sbin/mptutil/mptutil.8 ============================================================================== --- head/usr.sbin/mptutil/mptutil.8 Fri Aug 14 13:13:12 2009 (r196212) +++ stable/8/usr.sbin/mptutil/mptutil.8 Mon Aug 17 07:30:08 2009 (r196286) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2008 +.Dd August 16, 2009 .Dt MPTUTIL 8 .Os .Sh NAME @@ -349,8 +349,6 @@ as a global hot spare: .Sh SEE ALSO .Xr mpt 4 .Sh BUGS -Deleting volumes usually provokes a kernel crash in OS versions older than -.Dv 6.3-YAHOO-20080722 . .Pp The handling of spare drives appears to be unreliable. The @@ -381,3 +379,8 @@ configurations may not work reliably. .Pp Drive configuration commands result in an excessive flood of messages on the console. +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 8.0 . From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 07:46:56 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DCAF106568E; Mon, 17 Aug 2009 07:46:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1408FC62; Mon, 17 Aug 2009 07:46:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H7kubn052941; Mon, 17 Aug 2009 07:46:56 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H7kuCd052939; Mon, 17 Aug 2009 07:46:56 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170746.n7H7kuCd052939@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 07:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196288 - stable/8/sbin/umount X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 07:46:56 -0000 Author: pjd Date: Mon Aug 17 07:46:55 2009 New Revision: 196288 URL: http://svn.freebsd.org/changeset/base/196288 Log: MFC r196287: Be more precise how to get fsids - 'mount -v' doesn't show fsids unless is run by root. Approved by: re (kib) Modified: stable/8/sbin/umount/ (props changed) stable/8/sbin/umount/umount.8 Modified: stable/8/sbin/umount/umount.8 ============================================================================== --- stable/8/sbin/umount/umount.8 Mon Aug 17 07:38:47 2009 (r196287) +++ stable/8/sbin/umount/umount.8 Mon Aug 17 07:46:55 2009 (r196288) @@ -57,7 +57,8 @@ device or remote node (rhost:path), the or by the file system ID .Ar fsid as reported by -.Dq mount -v . +.Dq mount -v +when run by root. .Pp The options are as follows: .Bl -tag -width indent From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 08:09:46 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1D4E1065695; Mon, 17 Aug 2009 08:09:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A54568FC59; Mon, 17 Aug 2009 08:09:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H89kB4053946; Mon, 17 Aug 2009 08:09:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H89kHl053944; Mon, 17 Aug 2009 08:09:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170809.n7H89kHl053944@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 08:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196290 - in stable/8: cddl/lib/libnvpair sys sys/amd64/include/xen sys/cddl/compat/opensolaris/rpc sys/cddl/contrib/opensolaris sys/cddl/contrib/opensolaris/uts/common/rpc sys/contrib/... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 08:09:46 -0000 Author: pjd Date: Mon Aug 17 08:09:46 2009 New Revision: 196290 URL: http://svn.freebsd.org/changeset/base/196290 Log: MFC r196289: Remove files that are no longer used. Discussed with: kmacy Approved by: re (kib) Deleted: stable/8/sys/cddl/compat/opensolaris/rpc/xdr.h stable/8/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr.c stable/8/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_array.c stable/8/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_mem.c stable/8/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.h Modified: stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libnvpair/Makefile stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/cddl/lib/libnvpair/Makefile ============================================================================== --- stable/8/cddl/lib/libnvpair/Makefile Mon Aug 17 08:03:02 2009 (r196289) +++ stable/8/cddl/lib/libnvpair/Makefile Mon Aug 17 08:09:46 2009 (r196290) @@ -13,5 +13,6 @@ SRCS= libnvpair.c \ CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${.CURDIR}/../../../sys .include From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 08:38:42 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46B12106568F; Mon, 17 Aug 2009 08:38:42 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32F168FC45; Mon, 17 Aug 2009 08:38:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H8cgeV054664; Mon, 17 Aug 2009 08:38:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H8cgF1054662; Mon, 17 Aug 2009 08:38:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170838.n7H8cgF1054662@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 08:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196292 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 08:38:42 -0000 Author: pjd Date: Mon Aug 17 08:38:41 2009 New Revision: 196292 URL: http://svn.freebsd.org/changeset/base/196292 Log: MFC r196291: - Fix a race where /dev/zfs control device is created before ZFS is fully initialized. Also destroy /dev/zfs before doing other deinitializations. - Initialization through taskq is no longer needed and there is a race where one of the zpool/zfs command loads zfs.ko and tries to do some work immediately, but /dev/zfs is not there yet. Reported by: pav Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Aug 17 08:36:41 2009 (r196291) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Aug 17 08:38:41 2009 (r196292) @@ -3056,44 +3056,35 @@ zfsdev_fini(void) destroy_dev(zfsdev); } -static struct task zfs_start_task; static struct root_hold_token *zfs_root_token; - uint_t zfs_fsyncer_key; extern uint_t rrw_tsd_key; -static void -zfs_start(void *context __unused, int pending __unused) -{ - - zfsdev_init(); - spa_init(FREAD | FWRITE); - zfs_init(); - zvol_init(); - - tsd_create(&zfs_fsyncer_key, NULL); - tsd_create(&rrw_tsd_key, NULL); - - printf("ZFS storage pool version " SPA_VERSION_STRING "\n"); - root_mount_rel(zfs_root_token); -} - static int zfs_modevent(module_t mod, int type, void *unused __unused) { - int error; + int error = 0; - error = EOPNOTSUPP; switch (type) { case MOD_LOAD: zfs_root_token = root_mount_hold("ZFS"); printf("WARNING: ZFS is considered to be an experimental " "feature in FreeBSD.\n"); - TASK_INIT(&zfs_start_task, 0, zfs_start, NULL); - taskqueue_enqueue(taskqueue_thread, &zfs_start_task); + mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); - error = 0; + + spa_init(FREAD | FWRITE); + zfs_init(); + zvol_init(); + + tsd_create(&zfs_fsyncer_key, NULL); + tsd_create(&rrw_tsd_key, NULL); + + printf("ZFS storage pool version " SPA_VERSION_STRING "\n"); + root_mount_rel(zfs_root_token); + + zfsdev_init(); break; case MOD_UNLOAD: if (spa_busy() || zfs_busy() || zvol_busy() || @@ -3101,14 +3092,19 @@ zfs_modevent(module_t mod, int type, voi error = EBUSY; break; } + + zfsdev_fini(); zvol_fini(); zfs_fini(); spa_fini(); - zfsdev_fini(); + tsd_destroy(&zfs_fsyncer_key); tsd_destroy(&rrw_tsd_key); + mutex_destroy(&zfs_share_lock); - error = 0; + break; + default: + error = EOPNOTSUPP; break; } return (error); From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 08:46:47 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA589106568D; Mon, 17 Aug 2009 08:46:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D90C8FC45; Mon, 17 Aug 2009 08:46:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H8klYq055030; Mon, 17 Aug 2009 08:46:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H8kliY055028; Mon, 17 Aug 2009 08:46:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170846.n7H8kliY055028@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 08:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196294 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfront dev/xen/xenpci kern modules/dtrace/dtnfsc... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 08:46:47 -0000 Author: pjd Date: Mon Aug 17 08:46:47 2009 New Revision: 196294 URL: http://svn.freebsd.org/changeset/base/196294 Log: MFC r196293: Because taskqueue_run() can drop tq_mutex, we need to check if the TQ_FLAGS_ACTIVE flag wasn't removed in the meantime, which means we missed a wakeup. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/subr_taskqueue.c stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/kern/subr_taskqueue.c ============================================================================== --- stable/8/sys/kern/subr_taskqueue.c Mon Aug 17 08:42:34 2009 (r196293) +++ stable/8/sys/kern/subr_taskqueue.c Mon Aug 17 08:46:47 2009 (r196294) @@ -401,6 +401,13 @@ taskqueue_thread_loop(void *arg) TQ_LOCK(tq); while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { taskqueue_run(tq); + /* + * Because taskqueue_run() can drop tq_mutex, we need to + * check if the TQ_FLAGS_ACTIVE flag wasn't removed in the + * meantime, which means we missed a wakeup. + */ + if ((tq->tq_flags & TQ_FLAGS_ACTIVE) == 0) + break; TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 09:03:48 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07FF2106568B; Mon, 17 Aug 2009 09:03:48 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6E368FC55; Mon, 17 Aug 2009 09:03:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H93lkK055855; Mon, 17 Aug 2009 09:03:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H93lEp055847; Mon, 17 Aug 2009 09:03:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170903.n7H93lEp055847@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 09:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196296 - in stable/8: share/man/man9 sys sys/amd64/include/xen sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris sys/cddl/contrib/opensolari... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 09:03:48 -0000 Author: pjd Date: Mon Aug 17 09:03:47 2009 New Revision: 196296 URL: http://svn.freebsd.org/changeset/base/196296 Log: MFC r196295: Remove OpenSolaris taskq port (it performs very poorly in our kernel) and replace it with wrappers around our taskqueue(9). To make it possible implement taskqueue_member() function which returns 1 if the given thread was created by the given taskqueue. Approved by: re (kib) Added: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c - copied unchanged from r196295, head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h - copied unchanged from r196295, head/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h Deleted: stable/8/sys/cddl/compat/opensolaris/sys/taskq.h stable/8/sys/cddl/compat/opensolaris/sys/taskq_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/os/taskq.c Modified: stable/8/share/man/man9/ (props changed) stable/8/share/man/man9/taskqueue.9 stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/subr_taskqueue.c stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/modules/zfs/Makefile stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/sys/taskqueue.h stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/share/man/man9/taskqueue.9 ============================================================================== --- stable/8/share/man/man9/taskqueue.9 Mon Aug 17 09:01:20 2009 (r196295) +++ stable/8/share/man/man9/taskqueue.9 Mon Aug 17 09:03:47 2009 (r196296) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 13, 2008 +.Dd August 17, 2009 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -71,6 +71,8 @@ struct task { .Fn taskqueue_run_fast "struct taskqueue *queue" .Ft void .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" +.Ft int +.Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" .Fn TASK_INIT "struct task *task" "int priority" "task_fn_t *func" "void *context" .Fn TASKQUEUE_DECLARE "name" .Fn TASKQUEUE_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" @@ -182,6 +184,18 @@ There is no guarantee that the task will enqueued after call to .Fn taskqueue_drain . .Pp +The +.Fn taskqueue_member +function returns +.No 1 +is the given thread +.Fa td +is part of the given taskqeueue +.Fa queue +and +.No 0 +otherwise. +.Pp A convenience macro, .Fn TASK_INIT "task" "priority" "func" "context" is provided to initialise a Copied: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c (from r196295, head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Aug 17 09:03:47 2009 (r196296, copy of r196295, head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c) @@ -0,0 +1,135 @@ +/*- + * Copyright (c) 2009 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static uma_zone_t taskq_zone; + +struct ostask { + struct task ost_task; + task_func_t *ost_func; + void *ost_arg; +}; + +taskq_t *system_taskq = NULL; + +static void +system_taskq_init(void *arg) +{ + + system_taskq = (taskq_t *)taskqueue_thread; + taskq_zone = uma_zcreate("taskq_zone", sizeof(struct ostask), + NULL, NULL, NULL, NULL, 0, 0); +} +SYSINIT(system_taskq_init, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_init, NULL); + +static void +system_taskq_fini(void *arg) +{ + + uma_zdestroy(taskq_zone); +} +SYSUNINIT(system_taskq_fini, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_fini, NULL); + +taskq_t * +taskq_create(const char *name, int nthreads, pri_t pri, int minalloc __unused, + int maxalloc __unused, uint_t flags) +{ + taskq_t *tq; + + if ((flags & TASKQ_THREADS_CPU_PCT) != 0) { + /* TODO: Calculate number od threads. */ + printf("%s: TASKQ_THREADS_CPU_PCT\n", __func__); + } + + tq = kmem_alloc(sizeof(*tq), KM_SLEEP); + tq->tq_queue = taskqueue_create(name, M_WAITOK, taskqueue_thread_enqueue, + &tq->tq_queue); + (void) taskqueue_start_threads(&tq->tq_queue, nthreads, pri, name); + + return ((taskq_t *)tq); +} + +void +taskq_destroy(taskq_t *tq) +{ + + taskqueue_free(tq->tq_queue); + kmem_free(tq, sizeof(*tq)); +} + +int +taskq_member(taskq_t *tq, kthread_t *thread) +{ + + return (taskqueue_member(tq->tq_queue, thread)); +} + +static void +taskq_run(void *arg, int pending __unused) +{ + struct ostask *task = arg; + + task->ost_func(task->ost_arg); + + uma_zfree(taskq_zone, task); +} + +taskqid_t +taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags) +{ + struct ostask *task; + int mflag; + + if ((flags & (TQ_SLEEP | TQ_NOQUEUE)) == TQ_SLEEP) + mflag = M_WAITOK; + else + mflag = M_NOWAIT; + + task = uma_zalloc(taskq_zone, mflag); + if (task == NULL) + return (0); + + task->ost_func = func; + task->ost_arg = arg; + + TASK_INIT(&task->ost_task, 0, taskq_run, task); + taskqueue_enqueue(tq->tq_queue, &task->ost_task); + + return ((taskqid_t)(void *)task); +} Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Mon Aug 17 09:01:20 2009 (r196295) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Mon Aug 17 09:03:47 2009 (r196296) @@ -49,6 +49,7 @@ extern "C" { #include #include #include +#include #include #include #include Copied: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h (from r196295, head/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h Mon Aug 17 09:03:47 2009 (r196296, copy of r196295, head/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h) @@ -0,0 +1,90 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_TASKQ_H +#define _SYS_TASKQ_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define TASKQ_NAMELEN 31 + +struct taskqueue; +struct taskq { + struct taskqueue *tq_queue; +}; + +typedef struct taskq taskq_t; +typedef uintptr_t taskqid_t; +typedef void (task_func_t)(void *); + +/* + * Public flags for taskq_create(): bit range 0-15 + */ +#define TASKQ_PREPOPULATE 0x0001 /* Prepopulate with threads and data */ +#define TASKQ_CPR_SAFE 0x0002 /* Use CPR safe protocol */ +#define TASKQ_DYNAMIC 0x0004 /* Use dynamic thread scheduling */ +#define TASKQ_THREADS_CPU_PCT 0x0008 /* number of threads as % of ncpu */ + +/* + * Flags for taskq_dispatch. TQ_SLEEP/TQ_NOSLEEP should be same as + * KM_SLEEP/KM_NOSLEEP. + */ +#define TQ_SLEEP 0x00 /* Can block for memory */ +#define TQ_NOSLEEP 0x01 /* cannot block for memory; may fail */ +#define TQ_NOQUEUE 0x02 /* Do not enqueue if can't dispatch */ +#define TQ_NOALLOC 0x04 /* cannot allocate memory; may fail */ + +#ifdef _KERNEL + +extern taskq_t *system_taskq; + +extern void taskq_init(void); +extern void taskq_mp_init(void); + +extern taskq_t *taskq_create(const char *, int, pri_t, int, int, uint_t); +extern taskq_t *taskq_create_instance(const char *, int, int, pri_t, int, + int, uint_t); +extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t); +extern void nulltask(void *); +extern void taskq_destroy(taskq_t *); +extern void taskq_wait(taskq_t *); +extern void taskq_suspend(taskq_t *); +extern int taskq_suspended(taskq_t *); +extern void taskq_resume(taskq_t *); +extern int taskq_member(taskq_t *, kthread_t *); + +#endif /* _KERNEL */ + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_TASKQ_H */ Modified: stable/8/sys/kern/subr_taskqueue.c ============================================================================== --- stable/8/sys/kern/subr_taskqueue.c Mon Aug 17 09:01:20 2009 (r196295) +++ stable/8/sys/kern/subr_taskqueue.c Mon Aug 17 09:03:47 2009 (r196296) @@ -472,3 +472,23 @@ taskqueue_fast_run(void *dummy) TASKQUEUE_FAST_DEFINE(fast, taskqueue_fast_enqueue, NULL, swi_add(NULL, "Fast task queue", taskqueue_fast_run, NULL, SWI_TQ_FAST, INTR_MPSAFE, &taskqueue_fast_ih)); + +int +taskqueue_member(struct taskqueue *queue, struct thread *td) +{ + int i, j, ret = 0; + + TQ_LOCK(queue); + for (i = 0, j = 0; ; i++) { + if (queue->tq_threads[i] == NULL) + continue; + if (queue->tq_threads[i] == td) { + ret = 1; + break; + } + if (++j >= queue->tq_tcount) + break; + } + TQ_UNLOCK(queue); + return (ret); +} Modified: stable/8/sys/modules/zfs/Makefile ============================================================================== --- stable/8/sys/modules/zfs/Makefile Mon Aug 17 09:01:20 2009 (r196295) +++ stable/8/sys/modules/zfs/Makefile Mon Aug 17 09:03:47 2009 (r196296) @@ -23,6 +23,7 @@ SRCS+= opensolaris_kstat.c SRCS+= opensolaris_lookup.c SRCS+= opensolaris_policy.c SRCS+= opensolaris_string.c +SRCS+= opensolaris_taskq.c SRCS+= opensolaris_vfs.c SRCS+= opensolaris_zone.c @@ -42,7 +43,6 @@ SRCS+= vnode.c SRCS+= callb.c SRCS+= list.c SRCS+= nvpair_alloc_system.c -SRCS+= taskq.c .PATH: ${SUNW}/uts/common/zmod SRCS+= adler32.c Modified: stable/8/sys/sys/taskqueue.h ============================================================================== --- stable/8/sys/sys/taskqueue.h Mon Aug 17 09:01:20 2009 (r196295) +++ stable/8/sys/sys/taskqueue.h Mon Aug 17 09:03:47 2009 (r196296) @@ -37,6 +37,7 @@ #include struct taskqueue; +struct thread; /* * A notification callback function which is called from @@ -60,6 +61,7 @@ void taskqueue_free(struct taskqueue *qu void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); void taskqueue_unblock(struct taskqueue *queue); +int taskqueue_member(struct taskqueue *queue, struct thread *td); /* * Functions for dedicated thread taskqueues From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 09:14:58 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FE3F106568E; Mon, 17 Aug 2009 09:14:58 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C3928FC3F; Mon, 17 Aug 2009 09:14:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H9Ewnd056501; Mon, 17 Aug 2009 09:14:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H9Ewo8056499; Mon, 17 Aug 2009 09:14:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170914.n7H9Ewo8056499@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 09:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196298 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 09:14:58 -0000 Author: pjd Date: Mon Aug 17 09:14:58 2009 New Revision: 196298 URL: http://svn.freebsd.org/changeset/base/196298 Log: MFC r196297: Fix panic in zfs recv code. The last vnode (mountpoint's vnode) can have 0 usecount. Reported by: Thomas Backman Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Aug 17 09:13:22 2009 (r196297) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Aug 17 09:14:58 2009 (r196298) @@ -917,7 +917,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea for (zp = list_head(&zfsvfs->z_all_znodes); zp != NULL; zp = list_next(&zfsvfs->z_all_znodes, zp)) if (zp->z_dbuf) { - ASSERT(ZTOV(zp)->v_count > 0); + ASSERT(ZTOV(zp)->v_count >= 0); zfs_znode_dmu_fini(zp); } mutex_exit(&zfsvfs->z_znodes_lock); From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 09:23:28 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33D131065692; Mon, 17 Aug 2009 09:23:28 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 072BD8FC6B; Mon, 17 Aug 2009 09:23:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H9NR63056906; Mon, 17 Aug 2009 09:23:27 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H9NR7t056904; Mon, 17 Aug 2009 09:23:27 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170923.n7H9NR7t056904@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 09:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196300 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 09:23:28 -0000 Author: pjd Date: Mon Aug 17 09:23:27 2009 New Revision: 196300 URL: http://svn.freebsd.org/changeset/base/196300 Log: MFC r196299: - We need to recycle vnode instead of freeing znode. Submitted by: avg - Add missing vnode interlock unlock. - Remove redundant znode locking. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 17 09:21:39 2009 (r196299) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 17 09:23:27 2009 (r196300) @@ -3709,12 +3709,11 @@ zfs_inactive(vnode_t *vp, cred_t *cr, ca * The fs has been unmounted, or we did a * suspend/resume and this file no longer exists. */ - mutex_enter(&zp->z_lock); VI_LOCK(vp); vp->v_count = 0; /* count arrives as 1 */ - mutex_exit(&zp->z_lock); + VI_UNLOCK(vp); + vrecycle(vp, curthread); rw_exit(&zfsvfs->z_teardown_inactive_lock); - zfs_znode_free(zp); return; } From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 09:27:11 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DFEF106568E; Mon, 17 Aug 2009 09:27:11 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 009E68FC51; Mon, 17 Aug 2009 09:27:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H9RAIJ057067; Mon, 17 Aug 2009 09:27:10 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H9RAlx057065; Mon, 17 Aug 2009 09:27:10 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170927.n7H9RAlx057065@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 09:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196302 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 09:27:11 -0000 Author: pjd Date: Mon Aug 17 09:27:10 2009 New Revision: 196302 URL: http://svn.freebsd.org/changeset/base/196302 Log: MFC r196301: If z_buf is NULL, we should free znode immediately. Noticed by: avg Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 17 09:25:37 2009 (r196301) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 17 09:27:10 2009 (r196302) @@ -4350,7 +4350,6 @@ zfs_freebsd_reclaim(ap) { vnode_t *vp = ap->a_vp; znode_t *zp = VTOZ(vp); - zfsvfs_t *zfsvfs; ASSERT(zp != NULL); @@ -4360,13 +4359,18 @@ zfs_freebsd_reclaim(ap) vnode_destroy_vobject(vp); mutex_enter(&zp->z_lock); - ASSERT(zp->z_phys); + ASSERT(zp->z_phys != NULL); ZTOV(zp) = NULL; - if (!zp->z_unlinked) { + mutex_exit(&zp->z_lock); + + if (zp->z_unlinked) + ; /* Do nothing. */ + else if (zp->z_dbuf == NULL) + zfs_znode_free(zp); + else /* if (!zp->z_unlinked && zp->z_dbuf != NULL) */ { + zfsvfs_t *zfsvfs = zp->z_zfsvfs; int locked; - zfsvfs = zp->z_zfsvfs; - mutex_exit(&zp->z_lock); locked = MUTEX_HELD(ZFS_OBJ_MUTEX(zfsvfs, zp->z_id)) ? 2 : ZFS_OBJ_HOLD_TRYENTER(zfsvfs, zp->z_id); if (locked == 0) { @@ -4382,8 +4386,6 @@ zfs_freebsd_reclaim(ap) ZFS_OBJ_HOLD_EXIT(zfsvfs, zp->z_id); zfs_znode_free(zp); } - } else { - mutex_exit(&zp->z_lock); } VI_LOCK(vp); vp->v_data = NULL; From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 09:30:31 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7EF1106568E; Mon, 17 Aug 2009 09:30:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3E358FC64; Mon, 17 Aug 2009 09:30:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H9UVBx057218; Mon, 17 Aug 2009 09:30:31 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H9UVZB057216; Mon, 17 Aug 2009 09:30:31 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170930.n7H9UVZB057216@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 09:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196304 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 09:30:32 -0000 Author: pjd Date: Mon Aug 17 09:30:31 2009 New Revision: 196304 URL: http://svn.freebsd.org/changeset/base/196304 Log: MFC r196303: - Reduce z_teardown_lock lock scope a bit. - The error variable is int, not bool. - Convert spaces to tabs where needed. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 17 09:28:15 2009 (r196303) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 17 09:30:31 2009 (r196304) @@ -4529,9 +4529,9 @@ vop_getextattr { vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { + ZFS_EXIT(zfsvfs); if (error == ENOENT) error = ENOATTR; - ZFS_EXIT(zfsvfs); return (error); } @@ -4597,9 +4597,9 @@ vop_deleteextattr { vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { + ZFS_EXIT(zfsvfs); if (error == ENOENT) error = ENOATTR; - ZFS_EXIT(zfsvfs); return (error); } error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); @@ -4712,7 +4712,7 @@ vop_listextattr { error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VREAD); - if (error) + if (error != 0) return (error); error = zfs_create_attrname(ap->a_attrnamespace, "", attrprefix, @@ -4729,13 +4729,13 @@ vop_listextattr { error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, LOOKUP_XATTR); if (error != 0) { + ZFS_EXIT(zfsvfs); /* * ENOATTR means that the EA directory does not yet exist, * i.e. there are no extended attributes there. */ if (error == ENOATTR) error = 0; - ZFS_EXIT(zfsvfs); return (error); } @@ -4825,10 +4825,10 @@ zfs_freebsd_getacl(ap) return (error); error = acl_from_aces(ap->a_aclp, vsecattr.vsa_aclentp, vsecattr.vsa_aclcnt); - if (vsecattr.vsa_aclentp != NULL) - kmem_free(vsecattr.vsa_aclentp, vsecattr.vsa_aclentsz); + if (vsecattr.vsa_aclentp != NULL) + kmem_free(vsecattr.vsa_aclentp, vsecattr.vsa_aclentsz); - return (error); + return (error); } int From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 09:42:34 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99511106568C; Mon, 17 Aug 2009 09:42:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52D478FC15; Mon, 17 Aug 2009 09:42:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H9gYVE057525; Mon, 17 Aug 2009 09:42:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H9gYPN057523; Mon, 17 Aug 2009 09:42:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170942.n7H9gYPN057523@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 09:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196306 - in stable/8/cddl/contrib/opensolaris: . lib/libzfs/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 09:42:34 -0000 Author: pjd Date: Mon Aug 17 09:42:34 2009 New Revision: 196306 URL: http://svn.freebsd.org/changeset/base/196306 Log: MFC r196305: Fix receive when dataset has no / in its name. Submitted by: James R. Van Artsdalen Approved by: re (kib) Modified: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Aug 17 09:34:00 2009 (r196305) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Aug 17 09:42:34 2009 (r196306) @@ -1126,7 +1126,7 @@ again: uint64_t originguid = 0; uint64_t stream_originguid = 0; uint64_t parent_fromsnap_guid, stream_parent_fromsnap_guid; - char *fsname, *stream_fsname; + char *fsname, *stream_fsname, *p1, *p2; nextfselem = nvlist_next_nvpair(local_nv, fselem); @@ -1295,10 +1295,11 @@ again: "parentfromsnap", &stream_parent_fromsnap_guid)); /* check for rename */ + p1 = strrchr(fsname, '/'); + p2 = strrchr(stream_fsname, '/'); if ((stream_parent_fromsnap_guid != 0 && stream_parent_fromsnap_guid != parent_fromsnap_guid) || - strcmp(strrchr(fsname, '/'), - strrchr(stream_fsname, '/')) != 0) { + (p1 != NULL && p2 != NULL && strcmp (p1, p2) != 0)) { nvlist_t *parent; char tryname[ZFS_MAXNAMELEN]; @@ -1317,7 +1318,7 @@ again: VERIFY(0 == nvlist_lookup_string(parent, "name", &pname)); (void) snprintf(tryname, sizeof (tryname), - "%s%s", pname, strrchr(stream_fsname, '/')); + "%s%s", pname, p2 != NULL ? p2 : ""); } else { tryname[0] = '\0'; if (flags.verbose) { From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 09:55:59 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 191F01065672; Mon, 17 Aug 2009 09:55:59 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 040958FC64; Mon, 17 Aug 2009 09:55:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H9tw6n057983; Mon, 17 Aug 2009 09:55:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H9twFY057975; Mon, 17 Aug 2009 09:55:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170955.n7H9twFY057975@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 09:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196308 - in stable/8/sys: . amd64/include/xen cddl/compat/opensolaris/sys cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs cddl/contrib/opensolaris/uts/common/fs/zfs cdd... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 09:55:59 -0000 Author: pjd Date: Mon Aug 17 09:55:58 2009 New Revision: 196308 URL: http://svn.freebsd.org/changeset/base/196308 Log: MFC r196307: Manage asynchronous vnode release just like Solaris. Discussed with: kmacy Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/compat/opensolaris/sys/vnode.h stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/vnode.h Mon Aug 17 09:48:34 2009 (r196307) +++ stable/8/sys/cddl/compat/opensolaris/sys/vnode.h Mon Aug 17 09:55:58 2009 (r196308) @@ -75,7 +75,6 @@ vn_is_readonly(vnode_t *vp) #define VN_HOLD(v) vref(v) #define VN_RELE(v) vrele(v) #define VN_URELE(v) vput(v) -#define VN_RELE_ASYNC(v, tq) vn_rele_async(v, tq); #define VOP_REALVP(vp, vpp, ct) (*(vpp) = (vp), 0) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c Mon Aug 17 09:48:34 2009 (r196307) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c Mon Aug 17 09:55:58 2009 (r196308) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -36,12 +36,10 @@ * contributors. */ - -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include +#include #include /* Extensible attribute (xva) routines. */ @@ -74,15 +72,12 @@ xva_getxoptattr(xvattr_t *xvap) return (xoap); } -static STAILQ_HEAD(, vnode) vn_rele_async_list; -static struct mtx vn_rele_async_lock; -static struct cv vn_rele_async_cv; -static int vn_rele_list_length; -static int vn_rele_async_thread_exit; - -typedef struct { - struct vnode *stqe_next; -} vnode_link_t; +static void +vn_rele_inactive(vnode_t *vp) +{ + + vrele(vp); +} /* * Like vn_rele() except if we are going to call VOP_INACTIVE() then do it @@ -95,117 +90,16 @@ typedef struct { * This is because taskqs throttle back allocation if too many are created. */ void -vn_rele_async(vnode_t *vp, taskq_t *taskq /* unused */) +vn_rele_async(vnode_t *vp, taskq_t *taskq) { - - KASSERT(vp != NULL, ("vrele: null vp")); - VFS_ASSERT_GIANT(vp->v_mount); + VERIFY(vp->v_count > 0); VI_LOCK(vp); - - if (vp->v_usecount > 1 || ((vp->v_iflag & VI_DOINGINACT) && - vp->v_usecount == 1)) { - vp->v_usecount--; - vdropl(vp); - return; - } - if (vp->v_usecount != 1) { -#ifdef DIAGNOSTIC - vprint("vrele: negative ref count", vp); -#endif + if (vp->v_count == 1 && !(vp->v_iflag & VI_DOINGINACT)) { VI_UNLOCK(vp); - panic("vrele: negative ref cnt"); - } - /* - * We are exiting - */ - if (vn_rele_async_thread_exit != 0) { - vrele(vp); + VERIFY(taskq_dispatch((taskq_t *)taskq, + (task_func_t *)vn_rele_inactive, vp, TQ_SLEEP) != 0); return; } - - mtx_lock(&vn_rele_async_lock); - - /* STAILQ_INSERT_TAIL */ - (*(vnode_link_t *)&vp->v_cstart).stqe_next = NULL; - *vn_rele_async_list.stqh_last = vp; - vn_rele_async_list.stqh_last = - &((vnode_link_t *)&vp->v_cstart)->stqe_next; - - /****************************************/ - vn_rele_list_length++; - if ((vn_rele_list_length % 100) == 0) - cv_signal(&vn_rele_async_cv); - mtx_unlock(&vn_rele_async_lock); - VI_UNLOCK(vp); -} - -static void -vn_rele_async_init(void *arg) -{ - - mtx_init(&vn_rele_async_lock, "valock", NULL, MTX_DEF); - STAILQ_INIT(&vn_rele_async_list); - - /* cv_init(&vn_rele_async_cv, "vacv"); */ - vn_rele_async_cv.cv_description = "vacv"; - vn_rele_async_cv.cv_waiters = 0; -} - -void -vn_rele_async_fini(void) -{ - - mtx_lock(&vn_rele_async_lock); - vn_rele_async_thread_exit = 1; - cv_signal(&vn_rele_async_cv); - while (vn_rele_async_thread_exit != 0) - cv_wait(&vn_rele_async_cv, &vn_rele_async_lock); - mtx_unlock(&vn_rele_async_lock); - mtx_destroy(&vn_rele_async_lock); -} - - -static void -vn_rele_async_cleaner(void) -{ - STAILQ_HEAD(, vnode) vn_tmp_list; - struct vnode *curvnode; - - STAILQ_INIT(&vn_tmp_list); - mtx_lock(&vn_rele_async_lock); - while (vn_rele_async_thread_exit == 0) { - STAILQ_CONCAT(&vn_tmp_list, &vn_rele_async_list); - vn_rele_list_length = 0; - mtx_unlock(&vn_rele_async_lock); - - while (!STAILQ_EMPTY(&vn_tmp_list)) { - curvnode = STAILQ_FIRST(&vn_tmp_list); - - /* STAILQ_REMOVE_HEAD */ - STAILQ_FIRST(&vn_tmp_list) = - ((vnode_link_t *)&curvnode->v_cstart)->stqe_next; - if (STAILQ_FIRST(&vn_tmp_list) == NULL) - vn_tmp_list.stqh_last = &STAILQ_FIRST(&vn_tmp_list); - /***********************/ - vrele(curvnode); - } - mtx_lock(&vn_rele_async_lock); - if (vn_rele_list_length == 0) - cv_timedwait(&vn_rele_async_cv, &vn_rele_async_lock, - hz/10); - } - - vn_rele_async_thread_exit = 0; - cv_broadcast(&vn_rele_async_cv); - mtx_unlock(&vn_rele_async_lock); - thread_exit(); + vp->v_usecount--; + vdropl(vp); } - -static struct proc *vn_rele_async_proc; -static struct kproc_desc up_kp = { - "vaclean", - vn_rele_async_cleaner, - &vn_rele_async_proc -}; -SYSINIT(vaclean, SI_SUB_KTHREAD_UPDATE, SI_ORDER_FIRST, kproc_start, &up_kp); -SYSINIT(vn_rele_async_setup, SI_SUB_VFS, SI_ORDER_FIRST, vn_rele_async_init, NULL); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Aug 17 09:48:34 2009 (r196307) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Aug 17 09:55:58 2009 (r196308) @@ -1199,9 +1199,6 @@ dmu_init(void) void dmu_fini(void) { -#ifdef _KERNEL - vn_rele_async_fini(); -#endif arc_fini(); dnode_fini(); dbuf_fini(); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Aug 17 09:48:34 2009 (r196307) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Aug 17 09:55:58 2009 (r196308) @@ -91,6 +91,9 @@ dsl_pool_open_impl(spa_t *spa, uint64_t mutex_init(&dp->dp_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&dp->dp_scrub_cancel_lock, NULL, MUTEX_DEFAULT, NULL); + dp->dp_vnrele_taskq = taskq_create("zfs_vn_rele_taskq", 1, minclsyspri, + 1, 4, 0); + return (dp); } @@ -228,6 +231,7 @@ dsl_pool_close(dsl_pool_t *dp) rw_destroy(&dp->dp_config_rwlock); mutex_destroy(&dp->dp_lock); mutex_destroy(&dp->dp_scrub_cancel_lock); + taskq_destroy(dp->dp_vnrele_taskq); kmem_free(dp, sizeof (dsl_pool_t)); } @@ -611,3 +615,9 @@ dsl_pool_create_origin(dsl_pool_t *dp, d dsl_dataset_rele(ds, FTAG); rw_exit(&dp->dp_config_rwlock); } + +taskq_t * +dsl_pool_vnrele_taskq(dsl_pool_t *dp) +{ + return (dp->dp_vnrele_taskq); +} Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Mon Aug 17 09:48:34 2009 (r196307) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Mon Aug 17 09:55:58 2009 (r196308) @@ -57,6 +57,7 @@ typedef struct dsl_pool { struct dsl_dir *dp_mos_dir; struct dsl_dataset *dp_origin_snap; uint64_t dp_root_dir_obj; + struct taskq *dp_vnrele_taskq; /* No lock needed - sync context only */ blkptr_t dp_meta_rootbp; @@ -119,6 +120,8 @@ int dsl_pool_scrub_clean(dsl_pool_t *dp) void dsl_pool_scrub_sync(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_scrub_restart(dsl_pool_t *dp); +taskq_t *dsl_pool_vnrele_taskq(dsl_pool_t *dp); + #ifdef __cplusplus } #endif Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 17 09:48:34 2009 (r196307) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 17 09:55:58 2009 (r196308) @@ -924,6 +924,7 @@ zfs_get_done(dmu_buf_t *db, void *vzgd) zgd_t *zgd = (zgd_t *)vzgd; rl_t *rl = zgd->zgd_rl; vnode_t *vp = ZTOV(rl->r_zp); + objset_t *os = rl->r_zp->z_zfsvfs->z_os; int vfslocked; vfslocked = VFS_LOCK_GIANT(vp->v_vfsp); @@ -933,7 +934,7 @@ zfs_get_done(dmu_buf_t *db, void *vzgd) * Release the vnode asynchronously as we currently have the * txg stopped from syncing. */ - VN_RELE_ASYNC(vp, NULL); + VN_RELE_ASYNC(vp, dsl_pool_vnrele_taskq(dmu_objset_pool(os))); zil_add_block(zgd->zgd_zilog, zgd->zgd_bp); kmem_free(zgd, sizeof (zgd_t)); VFS_UNLOCK_GIANT(vfslocked); @@ -968,8 +969,8 @@ zfs_get_data(void *arg, lr_write_t *lr, * Release the vnode asynchronously as we currently have the * txg stopped from syncing. */ - VN_RELE_ASYNC(ZTOV(zp), NULL); - + VN_RELE_ASYNC(ZTOV(zp), + dsl_pool_vnrele_taskq(dmu_objset_pool(os))); return (ENOENT); } @@ -1045,7 +1046,7 @@ out: * Release the vnode asynchronously as we currently have the * txg stopped from syncing. */ - VN_RELE_ASYNC(ZTOV(zp), NULL); + VN_RELE_ASYNC(ZTOV(zp), dsl_pool_vnrele_taskq(dmu_objset_pool(os))); return (error); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h Mon Aug 17 09:48:34 2009 (r196307) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h Mon Aug 17 09:55:58 2009 (r196308) @@ -354,6 +354,11 @@ typedef struct caller_context { } caller_context_t; /* + * Structure tags for function prototypes, defined elsewhere. + */ +struct taskq; + +/* * Flags for VOP_LOOKUP * * Defined in file.h, but also possible, FIGNORECASE @@ -370,6 +375,13 @@ typedef struct caller_context { #define V_RDDIR_ENTFLAGS 0x01 /* request dirent flags */ /* + * Public vnode manipulation functions. + */ +#ifdef _KERNEL + +void vn_rele_async(struct vnode *vp, struct taskq *taskq); + +/* * Extensible vnode attribute (xva) routines: * xva_init() initializes an xvattr_t (zero struct, init mapsize, set AT_XATTR) * xva_getxoptattr() returns a ponter to the xoptattr_t section of xvattr_t @@ -377,10 +389,12 @@ typedef struct caller_context { void xva_init(xvattr_t *); xoptattr_t *xva_getxoptattr(xvattr_t *); /* Get ptr to xoptattr_t */ -struct taskq; -void vn_rele_async(struct vnode *vp, struct taskq *taskq); -void vn_rele_async_fini(void); - +#define VN_RELE_ASYNC(vp, taskq) { \ + vn_rele_async(vp, taskq); \ +} + +#endif /* _KERNEL */ + /* * Flags to VOP_SETATTR/VOP_GETATTR. */ From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 10:02:32 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26E74106568C; Mon, 17 Aug 2009 10:02:32 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 127028FC55; Mon, 17 Aug 2009 10:02:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HA2Ve6058243; Mon, 17 Aug 2009 10:02:31 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HA2VPr058241; Mon, 17 Aug 2009 10:02:31 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908171002.n7HA2VPr058241@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 10:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196310 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 10:02:32 -0000 Author: pjd Date: Mon Aug 17 10:02:31 2009 New Revision: 196310 URL: http://svn.freebsd.org/changeset/base/196310 Log: MFC r196309: getcwd() (when __getcwd() fails) works by stating current directory, going up (..), calling readdir and looking for previous directory inode. In case of .zfs/ directory this doesn't work, because .zfs/ is hidden by default, so it won't be visible in readdir output. Fix this by implementing VPTOCNP for snapshot directories, so __getcwd() doesn't fail and getcwd() doesn't have to use readdir method. This fixes /bin/pwd from within .zfs/snapshot//. Suggested by: kib Approved by: re (rwatson) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon Aug 17 10:00:18 2009 (r196309) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon Aug 17 10:02:31 2009 (r196310) @@ -1195,6 +1195,48 @@ zfsctl_snapshot_lookup(ap) return (error); } +static int +zfsctl_snapshot_vptocnp(struct vop_vptocnp_args *ap) +{ + zfsvfs_t *zfsvfs = ap->a_vp->v_vfsp->vfs_data; + vnode_t *dvp, *vp; + zfsctl_snapdir_t *sdp; + zfs_snapentry_t *sep; + int error; + + ASSERT(zfsvfs->z_ctldir != NULL); + error = zfsctl_root_lookup(zfsvfs->z_ctldir, "snapshot", &dvp, + NULL, 0, NULL, kcred, NULL, NULL, NULL); + if (error != 0) + return (error); + sdp = dvp->v_data; + + mutex_enter(&sdp->sd_lock); + sep = avl_first(&sdp->sd_snaps); + while (sep != NULL) { + vp = sep->se_root; + if (vp == ap->a_vp) + break; + sep = AVL_NEXT(&sdp->sd_snaps, sep); + } + if (sep == NULL) { + mutex_exit(&sdp->sd_lock); + error = ENOENT; + } else { + size_t len; + + len = strlen(sep->se_name); + *ap->a_buflen -= len; + bcopy(sep->se_name, ap->a_buf + *ap->a_buflen, len); + mutex_exit(&sdp->sd_lock); + vhold(dvp); + *ap->a_vpp = dvp; + } + VN_RELE(dvp); + + return (error); +} + /* * These VP's should never see the light of day. They should always * be covered. @@ -1206,6 +1248,7 @@ static struct vop_vector zfsctl_ops_snap .vop_reclaim = zfsctl_common_reclaim, .vop_getattr = zfsctl_snapshot_getattr, .vop_fid = zfsctl_snapshot_fid, + .vop_vptocnp = zfsctl_snapshot_vptocnp, }; int From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 10:21:38 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69DBA106568E; Mon, 17 Aug 2009 10:21:37 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 585E78FC52; Mon, 17 Aug 2009 10:21:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HALbqJ058687; Mon, 17 Aug 2009 10:21:37 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HALb89058685; Mon, 17 Aug 2009 10:21:37 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908171021.n7HALb89058685@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 10:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196312 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 10:21:38 -0000 Author: pjd Date: Mon Aug 17 10:21:37 2009 New Revision: 196312 URL: http://svn.freebsd.org/changeset/base/196312 Log: MFC r196311: Correct typo in the previous commit. Noticed by: pluknet Approved by: re (kib, implicit) Modified: stable/8/share/man/man9/ (props changed) stable/8/share/man/man9/taskqueue.9 Modified: stable/8/share/man/man9/taskqueue.9 ============================================================================== --- stable/8/share/man/man9/taskqueue.9 Mon Aug 17 10:20:22 2009 (r196311) +++ stable/8/share/man/man9/taskqueue.9 Mon Aug 17 10:21:37 2009 (r196312) @@ -188,7 +188,7 @@ The .Fn taskqueue_member function returns .No 1 -is the given thread +if the given thread .Fa td is part of the given taskqeueue .Fa queue From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 13:00:32 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F9AB10656C0; Mon, 17 Aug 2009 13:00:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 622258FC6D; Mon, 17 Aug 2009 13:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HD0WGH078295; Mon, 17 Aug 2009 13:00:32 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HD0WGe078293; Mon, 17 Aug 2009 13:00:32 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200908171300.n7HD0WGe078293@svn.freebsd.org> From: Rui Paulo Date: Mon, 17 Aug 2009 13:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196317 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfront dev/xen/xenpci modules/dtrace/dtnfsclient... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 13:00:32 -0000 Author: rpaulo Date: Mon Aug 17 13:00:32 2009 New Revision: 196317 URL: http://svn.freebsd.org/changeset/base/196317 Log: MFC r196316: Fix a typo in ifdef mesh support. This would make mesh unworkable if TDMA support was compiled out. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/net80211/ieee80211_input.c stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/net80211/ieee80211_input.c ============================================================================== --- stable/8/sys/net80211/ieee80211_input.c Mon Aug 17 12:57:57 2009 (r196316) +++ stable/8/sys/net80211/ieee80211_input.c Mon Aug 17 13:00:32 2009 (r196317) @@ -524,7 +524,7 @@ ieee80211_parse_beacon(struct ieee80211_ case IEEE80211_ELEMID_HTINFO: scan->htinfo = frm; break; -#ifdef IEEE80211_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_MESH case IEEE80211_ELEMID_MESHID: scan->meshid = frm; break; From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 13:32:56 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3850106568E; Mon, 17 Aug 2009 13:32:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8655B8FC61; Mon, 17 Aug 2009 13:32:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HDWuIB079049; Mon, 17 Aug 2009 13:32:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HDWueA079047; Mon, 17 Aug 2009 13:32:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200908171332.n7HDWueA079047@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 17 Aug 2009 13:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196319 - in stable/8/sys: . amd64/amd64 amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfront dev/xen/xenpci modules/dtrace... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 13:32:56 -0000 Author: kib Date: Mon Aug 17 13:32:56 2009 New Revision: 196319 URL: http://svn.freebsd.org/changeset/base/196319 Log: MFC r196318: Correct accounting error when allocating a a page table page to implement a user-space demotion. Approved by: re (rwatson) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/amd64/pmap.c stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) Modified: stable/8/sys/amd64/amd64/pmap.c ============================================================================== --- stable/8/sys/amd64/amd64/pmap.c Mon Aug 17 13:27:55 2009 (r196318) +++ stable/8/sys/amd64/amd64/pmap.c Mon Aug 17 13:32:56 2009 (r196319) @@ -2261,6 +2261,8 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t " in pmap %p", va, pmap); return (FALSE); } + if (va < VM_MAXUSER_ADDRESS) + pmap->pm_stats.resident_count++; } mptepa = VM_PAGE_TO_PHYS(mpte); firstpte = (pt_entry_t *)PHYS_TO_DMAP(mptepa); From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 13:51:04 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38DC9106568B; Mon, 17 Aug 2009 13:51:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2528B8FC67; Mon, 17 Aug 2009 13:51:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HDp4RL079478; Mon, 17 Aug 2009 13:51:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HDp46a079477; Mon, 17 Aug 2009 13:51:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908171351.n7HDp46a079477@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Aug 2009 13:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196320 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xenpci modules/dtrace/dtnfsclient modules... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 13:51:04 -0000 Author: jhb Date: Mon Aug 17 13:51:03 2009 New Revision: 196320 URL: http://svn.freebsd.org/changeset/base/196320 Log: Stow my time machine and note that r196223 is an MFC of r196224. Pointy hat to: jhb Approved by: re (rwatson) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/netipx/spx_reass.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 13:51:20 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32858106568C; Mon, 17 Aug 2009 13:51:20 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 212DE8FC3F; Mon, 17 Aug 2009 13:51:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HDpK4K079518; Mon, 17 Aug 2009 13:51:20 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HDpKk4079515; Mon, 17 Aug 2009 13:51:20 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200908171351.n7HDpKk4079515@svn.freebsd.org> From: Scott Long Date: Mon, 17 Aug 2009 13:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196321 - in stable/8: etc etc/mtree include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 13:51:20 -0000 Author: scottl Date: Mon Aug 17 13:51:19 2009 New Revision: 196321 URL: http://svn.freebsd.org/changeset/base/196321 Log: Merge files missed in r196285. SVN is simply horrible. Sorry for the tree breakage. Approved by: re Modified: stable/8/etc/ (props changed) stable/8/etc/mtree/BSD.include.dist stable/8/include/ (props changed) stable/8/include/Makefile Modified: stable/8/etc/mtree/BSD.include.dist ============================================================================== --- stable/8/etc/mtree/BSD.include.dist Mon Aug 17 13:51:03 2009 (r196320) +++ stable/8/etc/mtree/BSD.include.dist Mon Aug 17 13:51:19 2009 (r196321) @@ -104,6 +104,8 @@ .. lmc .. + mfi + .. mpt mpilib .. Modified: stable/8/include/Makefile ============================================================================== --- stable/8/include/Makefile Mon Aug 17 13:51:03 2009 (r196320) +++ stable/8/include/Makefile Mon Aug 17 13:51:19 2009 (r196321) @@ -40,7 +40,7 @@ LDIRS= bsm cam geom net net80211 netatal LSUBDIRS= cam/ata cam/scsi \ dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \ - dev/ic dev/iicbus ${_dev_ieee488} dev/lmc dev/ofw \ + dev/ic dev/iicbus ${_dev_ieee488} dev/lmc dev/mfi dev/ofw \ dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \ From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 14:11:49 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68AAA106568E; Mon, 17 Aug 2009 14:11:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 34CFE8FC15; Mon, 17 Aug 2009 14:11:49 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D9F1A46B29; Mon, 17 Aug 2009 10:11:48 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 1DBCF8A01B; Mon, 17 Aug 2009 10:11:48 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Date: Mon, 17 Aug 2009 08:10:30 -0400 User-Agent: KMail/1.9.7 References: <200908160212.n7G2CDUn097279@svn.freebsd.org> <3bbf2fe10908151919s17752057y53dd32fb02a857bb@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908170810.31444.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 17 Aug 2009 10:11:48 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Marcel Moolenaar , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Attilio Rao , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r196270 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xenpci ia64/ia64 modules/dtrace/dtnfsclie... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 14:11:49 -0000 On Saturday 15 August 2009 10:42:26 pm Marcel Moolenaar wrote: > > On Aug 15, 2009, at 7:19 PM, Attilio Rao wrote: > > > 2009/8/16 Marcel Moolenaar : > >> Author: marcel > >> Date: Sun Aug 16 02:12:13 2009 > >> New Revision: 196270 > >> URL: http://svn.freebsd.org/changeset/base/196270 > >> > >> Log: > >> MFC rev 196268: > >> Decouple ACPI CPU Ids from FreeBSD's cpuid. The ACPI Ids can be > >> sparse, which causes a kernel assert. > > > > Can you be a bit more precise? > > What kernel assert? > > In subr_smp.c, function smp_topo(): > panic("Built bad topology at %p. CPU mask 0x%X != 0x%X", > top, top->cg_mask, all_cpus); > > See also: > http://docs.freebsd.org/cgi/getmsg.cgi?fetch=506001+0+archive/2009/freebsd-current/20090719.freebsd-current > http://docs.freebsd.org/cgi/getmsg.cgi?fetch=626164+0+archive/2009/freebsd-current/20090719.freebsd-current Gah, I'd rather fix the topology code to work properly in that case. :-/ -- John Baldwin From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 14:42:41 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2973106568D; Mon, 17 Aug 2009 14:42:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B01C78FC43; Mon, 17 Aug 2009 14:42:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HEgf8x080721; Mon, 17 Aug 2009 14:42:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HEgf32080720; Mon, 17 Aug 2009 14:42:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908171442.n7HEgf32080720@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Aug 2009 14:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196323 - in stable/8/sys: dev/cxgb modules/dtrace/dtnfsclient modules/ip6_mroute_mod modules/ipmi/ipmi_linux netinet/ipfw xen X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 14:42:41 -0000 Author: jhb Date: Mon Aug 17 14:42:41 2009 New Revision: 196323 URL: http://svn.freebsd.org/changeset/base/196323 Log: MFC: Purge mergeinfo in sys/ that is either empty or a subset of the parent mergeinfo on sys/ itself. Approved by: re (mergeinfo blanket) Modified: stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/modules/dtrace/dtnfsclient/ (props changed) stable/8/sys/modules/ip6_mroute_mod/ (props changed) stable/8/sys/modules/ipmi/ipmi_linux/ (props changed) stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed) stable/8/sys/netinet/ipfw/ip_fw2.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed) stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed) stable/8/sys/xen/evtchn.h (props changed) stable/8/sys/xen/hypervisor.h (props changed) stable/8/sys/xen/xen_intr.h (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 14:53:59 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A251D10656A4; Mon, 17 Aug 2009 14:53:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 777868FC67; Mon, 17 Aug 2009 14:53:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HErx2O081104; Mon, 17 Aug 2009 14:53:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HErxd6081103; Mon, 17 Aug 2009 14:53:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908171453.n7HErxd6081103@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Aug 2009 14:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196325 - stable/8/sys/dev/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 14:53:59 -0000 Author: jhb Date: Mon Aug 17 14:53:59 2009 New Revision: 196325 URL: http://svn.freebsd.org/changeset/base/196325 Log: MFC: Remove bogus mergeinfo claiming that change 185357 from head/sys was merged into head/sys/dev/ata. Approved by: re (mergeinfo blanket) Modified: stable/8/sys/dev/ata/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 15:39:48 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27155106568E; Mon, 17 Aug 2009 15:39:48 +0000 (UTC) (envelope-from jhay@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13B958FC55; Mon, 17 Aug 2009 15:39:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HFdlbu082232; Mon, 17 Aug 2009 15:39:47 GMT (envelope-from jhay@svn.freebsd.org) Received: (from jhay@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HFdlW1082230; Mon, 17 Aug 2009 15:39:47 GMT (envelope-from jhay@svn.freebsd.org) Message-Id: <200908171539.n7HFdlW1082230@svn.freebsd.org> From: John Hay Date: Mon, 17 Aug 2009 15:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196328 - in stable/8/sys: . amd64/include/xen boot/i386/gptboot cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/mfi dev/xen/netfront dev/xen/xenpci netipx X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 15:39:48 -0000 Author: jhay Date: Mon Aug 17 15:39:47 2009 New Revision: 196328 URL: http://svn.freebsd.org/changeset/base/196328 Log: MFC: 196326 Fix parse() so that the partition to boot (load /boot/loader) from can be set. The syntax as printed in main() is used: 0:ad(0p3)/boot/loader Reviewed by: jhb Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/i386/gptboot/gptboot.c stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netipx/spx_reass.c (props changed) Modified: stable/8/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/8/sys/boot/i386/gptboot/gptboot.c Mon Aug 17 15:39:45 2009 (r196327) +++ stable/8/sys/boot/i386/gptboot/gptboot.c Mon Aug 17 15:39:47 2009 (r196328) @@ -466,16 +466,13 @@ parse(void) dsk.type = i; arg += 3; dsk.unit = *arg - '0'; - if (arg[1] != ',' || dsk.unit > 9) + if (arg[1] != 'p' || dsk.unit > 9) return -1; arg += 2; - dsk.part = -1; - if (arg[1] == ',') { - dsk.part = *arg - '0'; - if (dsk.part < 1 || dsk.part > 9) - return -1; - arg += 2; - } + dsk.part = *arg - '0'; + if (dsk.part < 1 || dsk.part > 9) + return -1; + arg++; if (arg[0] != ')') return -1; arg++; From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 15:42:56 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34B94106568B; Mon, 17 Aug 2009 15:42:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8FC78FC41; Mon, 17 Aug 2009 15:42:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HFgtIL082343; Mon, 17 Aug 2009 15:42:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HFgtXQ082342; Mon, 17 Aug 2009 15:42:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908171542.n7HFgtXQ082342@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Aug 2009 15:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196329 - in stable/8/sys/dev/xen: netfront xenpci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 15:42:56 -0000 Author: jhb Date: Mon Aug 17 15:42:55 2009 New Revision: 196329 URL: http://svn.freebsd.org/changeset/base/196329 Log: - Remove self-referential mergeinfo from xen/netfront and xen/xenpci that claims those directories were merged into themselves. - Remove mergeinfo on xen/xenpci that claims the stable/7 xenpci was merged into head. Approved by: re (mergeinfo blanket) Modified: stable/8/sys/dev/xen/netfront/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 15:51:31 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 779481065690; Mon, 17 Aug 2009 15:51:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CC038FC5B; Mon, 17 Aug 2009 15:51:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HFpV3v082643; Mon, 17 Aug 2009 15:51:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HFpVqK082642; Mon, 17 Aug 2009 15:51:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908171551.n7HFpVqK082642@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Aug 2009 15:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196331 - stable/8/sys/netipx X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 15:51:31 -0000 Author: jhb Date: Mon Aug 17 15:51:31 2009 New Revision: 196331 URL: http://svn.freebsd.org/changeset/base/196331 Log: Remove the spx_usrreq.c mergeinfo from spx_reass.c. Future changes to spx_usrreq.c won't be merged to spx_reass.c which is what this would help with. Approved by: re (mergeinfo blanket), rwatson Modified: stable/8/sys/netipx/spx_reass.c (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 16:24:51 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D7E0106568B; Mon, 17 Aug 2009 16:24:51 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 775698FC3D; Mon, 17 Aug 2009 16:24:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HGOppp083682; Mon, 17 Aug 2009 16:24:51 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HGOpmQ083680; Mon, 17 Aug 2009 16:24:51 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200908171624.n7HGOpmQ083680@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 17 Aug 2009 16:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196335 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/mfi dev/xen/xenpci geom/part X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 16:24:51 -0000 Author: marcel Date: Mon Aug 17 16:24:50 2009 New Revision: 196335 URL: http://svn.freebsd.org/changeset/base/196335 Log: MFC rev 196333: The start of the EFI GPT partition in the PMBR can always be represented by CHS addressing. Don't define these fields as 0xff, but rather define them correctly. This prevents boot problems on PCs where GPT is being used. PR: 115406 Submitted by: Kent Hauser Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/part/g_part_gpt.c Modified: stable/8/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/8/sys/geom/part/g_part_gpt.c Mon Aug 17 16:17:21 2009 (r196334) +++ stable/8/sys/geom/part/g_part_gpt.c Mon Aug 17 16:24:50 2009 (r196335) @@ -409,9 +409,9 @@ g_part_gpt_create(struct g_part_table *b last = (pp->mediasize / pp->sectorsize) - 1; le16enc(table->mbr + DOSMAGICOFFSET, DOSMAGIC); - table->mbr[DOSPARTOFF + 1] = 0xff; /* shd */ - table->mbr[DOSPARTOFF + 2] = 0xff; /* ssect */ - table->mbr[DOSPARTOFF + 3] = 0xff; /* scyl */ + table->mbr[DOSPARTOFF + 1] = 0x01; /* shd */ + table->mbr[DOSPARTOFF + 2] = 0x01; /* ssect */ + table->mbr[DOSPARTOFF + 3] = 0x00; /* scyl */ table->mbr[DOSPARTOFF + 4] = 0xee; /* typ */ table->mbr[DOSPARTOFF + 5] = 0xff; /* ehd */ table->mbr[DOSPARTOFF + 6] = 0xff; /* esect */ From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 16:33:53 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9D91106564A; Mon, 17 Aug 2009 16:33:53 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5DBB8FC16; Mon, 17 Aug 2009 16:33:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HGXrKL083935; Mon, 17 Aug 2009 16:33:53 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HGXrAK083929; Mon, 17 Aug 2009 16:33:53 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200908171633.n7HGXrAK083929@svn.freebsd.org> From: Attilio Rao Date: Mon, 17 Aug 2009 16:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196336 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/mfi dev/xen/xenpci kern sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 16:33:53 -0000 Author: attilio Date: Mon Aug 17 16:33:53 2009 New Revision: 196336 URL: http://svn.freebsd.org/changeset/base/196336 Log: MFC r196334: * Change the scope of the ASSERT_ATOMIC_LOAD() from a generic check to a pointer-fetching specific operation check. Consequently, rename the operation ASSERT_ATOMIC_LOAD_PTR(). * Fix the implementation of ASSERT_ATOMIC_LOAD_PTR() by checking directly alignment on the word boundry, for all the given specific architectures. That's a bit too strict for some common case, but it assures safety. * Add a comment explaining the scope of the macro * Add a new stub in the lockmgr specific implementation Tested by: marcel (initial version), marius Reviewed by: rwatson, jhb (comment specific review) Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/kern_lock.c stable/8/sys/kern/kern_mutex.c stable/8/sys/kern/kern_rwlock.c stable/8/sys/kern/kern_sx.c stable/8/sys/sys/systm.h Modified: stable/8/sys/kern/kern_lock.c ============================================================================== --- stable/8/sys/kern/kern_lock.c Mon Aug 17 16:24:50 2009 (r196335) +++ stable/8/sys/kern/kern_lock.c Mon Aug 17 16:33:53 2009 (r196336) @@ -334,6 +334,9 @@ lockinit(struct lock *lk, int pri, const int iflags; MPASS((flags & ~LK_INIT_MASK) == 0); + ASSERT_ATOMIC_LOAD_PTR(lk->lk_lock, + ("%s: lockmgr not aligned for %s: %p", __func__, wmesg, + &lk->lk_lock)); iflags = LO_SLEEPABLE | LO_UPGRADABLE; if (flags & LK_CANRECURSE) Modified: stable/8/sys/kern/kern_mutex.c ============================================================================== --- stable/8/sys/kern/kern_mutex.c Mon Aug 17 16:24:50 2009 (r196335) +++ stable/8/sys/kern/kern_mutex.c Mon Aug 17 16:33:53 2009 (r196336) @@ -783,8 +783,9 @@ mtx_init(struct mtx *m, const char *name MPASS((opts & ~(MTX_SPIN | MTX_QUIET | MTX_RECURSE | MTX_NOWITNESS | MTX_DUPOK | MTX_NOPROFILE)) == 0); - ASSERT_ATOMIC_LOAD(m->mtx_lock, ("%s: mtx_lock not aligned for %s: %p", - __func__, name, &m->mtx_lock)); + ASSERT_ATOMIC_LOAD_PTR(m->mtx_lock, + ("%s: mtx_lock not aligned for %s: %p", __func__, name, + &m->mtx_lock)); #ifdef MUTEX_DEBUG /* Diagnostic and error correction */ Modified: stable/8/sys/kern/kern_rwlock.c ============================================================================== --- stable/8/sys/kern/kern_rwlock.c Mon Aug 17 16:24:50 2009 (r196335) +++ stable/8/sys/kern/kern_rwlock.c Mon Aug 17 16:33:53 2009 (r196336) @@ -174,8 +174,9 @@ rw_init_flags(struct rwlock *rw, const c MPASS((opts & ~(RW_DUPOK | RW_NOPROFILE | RW_NOWITNESS | RW_QUIET | RW_RECURSE)) == 0); - ASSERT_ATOMIC_LOAD(rw->rw_lock, ("%s: rw_lock not aligned for %s: %p", - __func__, name, &rw->rw_lock)); + ASSERT_ATOMIC_LOAD_PTR(rw->rw_lock, + ("%s: rw_lock not aligned for %s: %p", __func__, name, + &rw->rw_lock)); flags = LO_UPGRADABLE; if (opts & RW_DUPOK) Modified: stable/8/sys/kern/kern_sx.c ============================================================================== --- stable/8/sys/kern/kern_sx.c Mon Aug 17 16:24:50 2009 (r196335) +++ stable/8/sys/kern/kern_sx.c Mon Aug 17 16:33:53 2009 (r196336) @@ -205,8 +205,9 @@ sx_init_flags(struct sx *sx, const char MPASS((opts & ~(SX_QUIET | SX_RECURSE | SX_NOWITNESS | SX_DUPOK | SX_NOPROFILE | SX_NOADAPTIVE)) == 0); - ASSERT_ATOMIC_LOAD(sx->sx_lock, ("%s: sx_lock not aligned for %s: %p", - __func__, description, &sx->sx_lock)); + ASSERT_ATOMIC_LOAD_PTR(sx->sx_lock, + ("%s: sx_lock not aligned for %s: %p", __func__, description, + &sx->sx_lock)); flags = LO_SLEEPABLE | LO_UPGRADABLE; if (opts & SX_DUPOK) Modified: stable/8/sys/sys/systm.h ============================================================================== --- stable/8/sys/sys/systm.h Mon Aug 17 16:24:50 2009 (r196335) +++ stable/8/sys/sys/systm.h Mon Aug 17 16:33:53 2009 (r196336) @@ -89,9 +89,16 @@ extern int maxusers; /* system tune hin #define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] #endif -#define ASSERT_ATOMIC_LOAD(var,msg) \ - KASSERT(sizeof(var) <= sizeof(uintptr_t) && \ - ALIGN(&(var)) == (uintptr_t)&(var), msg) +/* + * Assert that a pointer can be loaded from memory atomically. + * + * This assertion enforces stronger alignment than necessary. For example, + * on some architectures, atomicity for unaligned loads will depend on + * whether or not the load spans multiple cache lines. + */ +#define ASSERT_ATOMIC_LOAD_PTR(var, msg) \ + KASSERT(sizeof(var) == sizeof(void *) && \ + ((uintptr_t)&(var) & (sizeof(void *) - 1)) == 0, msg) /* * XXX the hints declarations are even more misplaced than most declarations From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 17:13:17 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C24E106568D; Mon, 17 Aug 2009 17:13:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A50C8FC61; Mon, 17 Aug 2009 17:13:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HHDHiW084873; Mon, 17 Aug 2009 17:13:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HHDHMZ084871; Mon, 17 Aug 2009 17:13:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908171713.n7HHDHMZ084871@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Aug 2009 17:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196338 - stable/8/share/man/man7 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 17:13:17 -0000 Author: jhb Date: Mon Aug 17 17:13:17 2009 New Revision: 196338 URL: http://svn.freebsd.org/changeset/base/196338 Log: MFC 196337: Document the newly added SVNCMDARGS, SVNROOT, and SVNBRANCH variables. Approved by: re (kib) Modified: stable/8/share/man/man7/ (props changed) stable/8/share/man/man7/release.7 Modified: stable/8/share/man/man7/release.7 ============================================================================== --- stable/8/share/man/man7/release.7 Mon Aug 17 17:09:14 2009 (r196337) +++ stable/8/share/man/man7/release.7 Mon Aug 17 17:13:17 2009 (r196338) @@ -390,6 +390,35 @@ of the CVS tree .It Va SEPARATE_LIVEFS Store the live file system on its own CD-ROM image rather than placing it on the first disc. +.It Va SVNCMDARGS +Additional arguments for svn +.Ic checkout +and +.Ic switch +commands. +.It Va SVNROOT +The location of the FreeBSD SVN source repository. +If this variable is set, +then the source tree will be extracted using Subversion rather than +CVS. +.It Va SVNBRANCH +The branch to check out from a SVN source repository. +It is specified as a path such as +.Pa head +or +.Pa stable/7 . +If this variable is not set, +then the branch that corresponds to the current value of +.Va RELEASETAG +will be used. +If neither +.Va SVNBRANCH +nor +.Va RELEASETAG +are set, +then the +.Pa head +branch will be used. .It Va TARGET_ARCH The target machine processor architecture. This is analogous to the From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 17:14:50 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED6E610656CD; Mon, 17 Aug 2009 17:14:50 +0000 (UTC) (envelope-from rink@rink.nu) Received: from mx1.rink.nu (gloom.rink.nu [213.34.49.2]) by mx1.freebsd.org (Postfix) with ESMTP id A05D98FC55; Mon, 17 Aug 2009 17:14:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx1.rink.nu (Postfix) with ESMTP id 4DD7B6D423; Mon, 17 Aug 2009 18:58:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at rink.nu Received: from mx1.rink.nu ([213.34.49.2]) by localhost (gloom.rink.nu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T+bgdGQEIi2r; Mon, 17 Aug 2009 18:58:24 +0200 (CEST) Received: by mx1.rink.nu (Postfix, from userid 1000) id 8A7AF6D41E; Mon, 17 Aug 2009 18:58:24 +0200 (CEST) Date: Mon, 17 Aug 2009 18:58:24 +0200 From: Rink Springer To: Marcel Moolenaar Message-ID: <20090817165824.GA91509@rink.nu> References: <200908171624.n7HGOpmQ083680@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200908171624.n7HGOpmQ083680@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r196335 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/mfi dev/xen/xenpci geom/part X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 17:14:51 -0000 On Mon, Aug 17, 2009 at 04:24:51PM +0000, Marcel Moolenaar wrote: > Log: > MFC rev 196333: > The start of the EFI GPT partition in the PMBR can always be represented > by CHS addressing. Don't define these fields as 0xff, but rather define > them correctly. This prevents boot problems on PCs where GPT is being > used. Thanks! I had this on my todo (got bitten by it some time ago) but forgot all about it; thanks for fixing it. -- Rink P.W. Springer - http://rink.nu "Beauty often seduces us on the road to truth." - Dr. Wilson From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 18:11:51 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53DBE106568B; Mon, 17 Aug 2009 18:11:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2667E8FC59; Mon, 17 Aug 2009 18:11:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HIBooY086374; Mon, 17 Aug 2009 18:11:50 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HIBoOI086372; Mon, 17 Aug 2009 18:11:50 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200908171811.n7HIBoOI086372@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Aug 2009 18:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196341 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/mfi dev/xen/xenpci fs/nfsclient X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 18:11:51 -0000 Author: rmacklem Date: Mon Aug 17 18:11:50 2009 New Revision: 196341 URL: http://svn.freebsd.org/changeset/base/196341 Log: MFC r196332: Apply the same patch as r196205 for nfs_upgrade_lock() and nfs_downgrade_lock() to the experimental nfs client. Approved by: re (kensmith), kib (mentor) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/fs/nfsclient/nfs_clsubs.c Modified: stable/8/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clsubs.c Mon Aug 17 18:02:46 2009 (r196340) +++ stable/8/sys/fs/nfsclient/nfs_clsubs.c Mon Aug 17 18:11:50 2009 (r196341) @@ -129,28 +129,25 @@ int ncl_upgrade_vnlock(struct vnode *vp) { int old_lock; - - if ((old_lock = VOP_ISLOCKED(vp)) != LK_EXCLUSIVE) { - if (old_lock == LK_SHARED) { - /* Upgrade to exclusive lock, this might block */ - vn_lock(vp, LK_UPGRADE | LK_RETRY); - } else { - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - } + + ASSERT_VOP_LOCKED(vp, "ncl_upgrade_vnlock"); + old_lock = VOP_ISLOCKED(vp); + if (old_lock != LK_EXCLUSIVE) { + KASSERT(old_lock == LK_SHARED, + ("ncl_upgrade_vnlock: wrong old_lock %d", old_lock)); + /* Upgrade to exclusive lock, this might block */ + vn_lock(vp, LK_UPGRADE | LK_RETRY); } - return old_lock; + return (old_lock); } void ncl_downgrade_vnlock(struct vnode *vp, int old_lock) { if (old_lock != LK_EXCLUSIVE) { - if (old_lock == LK_SHARED) { - /* Downgrade from exclusive lock, this might block */ - vn_lock(vp, LK_DOWNGRADE); - } else { - VOP_UNLOCK(vp, 0); - } + KASSERT(old_lock == LK_SHARED, ("wrong old_lock %d", old_lock)); + /* Downgrade from exclusive lock. */ + vn_lock(vp, LK_DOWNGRADE | LK_RETRY); } } From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 19:10:23 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58174106568C; Mon, 17 Aug 2009 19:10:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 452F78FC62; Mon, 17 Aug 2009 19:10:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HJANWB087709; Mon, 17 Aug 2009 19:10:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HJANpD087708; Mon, 17 Aug 2009 19:10:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908171910.n7HJANpD087708@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Aug 2009 19:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196343 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/mfi dev/xen/xenpci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 19:10:23 -0000 Author: jhb Date: Mon Aug 17 19:10:23 2009 New Revision: 196343 URL: http://svn.freebsd.org/changeset/base/196343 Log: Propogate the mergeinfo for 196200 up to sys/. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 17 20:06:02 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6A57106568E; Mon, 17 Aug 2009 20:06:00 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3C298FC3F; Mon, 17 Aug 2009 20:06:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7HK60Je089039; Mon, 17 Aug 2009 20:06:00 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7HK60WZ089037; Mon, 17 Aug 2009 20:06:00 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200908172006.n7HK60WZ089037@svn.freebsd.org> From: Kip Macy Date: Mon, 17 Aug 2009 20:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196344 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 20:06:02 -0000 Author: kmacy Date: Mon Aug 17 20:06:00 2009 New Revision: 196344 URL: http://svn.freebsd.org/changeset/base/196344 Log: fix netboot issue by disabling flowtable lookups until initialization has been run + mergeinfo garbage Reviewed by: rwatson@ Approved by: re@ Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/flowtable.c Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Mon Aug 17 19:10:23 2009 (r196343) +++ stable/8/sys/net/flowtable.c Mon Aug 17 20:06:00 2009 (r196344) @@ -203,6 +203,7 @@ static VNET_DEFINE(int, flowtable_udp_ex static VNET_DEFINE(int, flowtable_fin_wait_expire) = FIN_WAIT_IDLE; static VNET_DEFINE(int, flowtable_tcp_expire) = TCP_IDLE; static VNET_DEFINE(int, flowtable_nmbflows) = 4096; +static VNET_DEFINE(int, flowtable_ready) = 0; #define V_flowtable_enable VNET(flowtable_enable) #define V_flowtable_hits VNET(flowtable_hits) @@ -217,6 +218,7 @@ static VNET_DEFINE(int, flowtable_nmbflo #define V_flowtable_fin_wait_expire VNET(flowtable_fin_wait_expire) #define V_flowtable_tcp_expire VNET(flowtable_tcp_expire) #define V_flowtable_nmbflows VNET(flowtable_nmbflows) +#define V_flowtable_ready VNET(flowtable_ready) SYSCTL_NODE(_net_inet, OID_AUTO, flowtable, CTLFLAG_RD, NULL, "flowtable"); SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, enable, CTLFLAG_RW, @@ -345,7 +347,7 @@ ipv4_flow_lookup_hash_internal(struct mb struct udphdr *uh; struct sctphdr *sh; - if (V_flowtable_enable == 0) + if ((V_flowtable_enable == 0) || (V_flowtable_ready == 0)) return (0); key[1] = key[0] = 0; @@ -799,6 +801,7 @@ flowtable_init(const void *unused __unus NULL, NULL, NULL, NULL, 64, UMA_ZONE_MAXBUCKET); uma_zone_set_max(V_flow_ipv4_zone, V_flowtable_nmbflows); uma_zone_set_max(V_flow_ipv6_zone, V_flowtable_nmbflows); + V_flowtable_ready = 1; } VNET_SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 18 09:31:01 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D1C7106568B; Tue, 18 Aug 2009 09:31:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 082C58FC43; Tue, 18 Aug 2009 09:31:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7I9V0EH010415; Tue, 18 Aug 2009 09:31:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7I9V0JN010410; Tue, 18 Aug 2009 09:31:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200908180931.n7I9V0JN010410@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Aug 2009 09:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196354 - in stable/8/sys: . amd64/include/xen cam cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/iscsi/initiator dev/ppbus dev/xen/xenpci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2009 09:31:01 -0000 Author: mav Date: Tue Aug 18 09:31:00 2009 New Revision: 196354 URL: http://svn.freebsd.org/changeset/base/196354 Log: MFC r196352: Fix iSCSI initiator and vpo driver operation, broken by CAM changes. Reviewed by: scottl, Danny Braniss Approved by: re (rwatson) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/cam_ccb.h stable/8/sys/cam/cam_xpt.c stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/iscsi/initiator/isc_cam.c stable/8/sys/dev/ppbus/vpo.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/cam_ccb.h ============================================================================== --- stable/8/sys/cam/cam_ccb.h Tue Aug 18 09:27:17 2009 (r196353) +++ stable/8/sys/cam/cam_ccb.h Tue Aug 18 09:31:00 2009 (r196354) @@ -243,6 +243,7 @@ typedef enum { XPORT_ATA, /* AT Attachment */ XPORT_SAS, /* Serial Attached SCSI */ XPORT_SATA, /* Serial AT Attachment */ + XPORT_ISCSI, /* iSCSI */ } cam_xport; #define PROTO_VERSION_UNKNOWN (UINT_MAX - 1) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Tue Aug 18 09:27:17 2009 (r196353) +++ stable/8/sys/cam/cam_xpt.c Tue Aug 18 09:31:00 2009 (r196354) @@ -3803,6 +3803,8 @@ xpt_bus_register(struct cam_sim *sim, de case XPORT_SAS: case XPORT_FC: case XPORT_USB: + case XPORT_ISCSI: + case XPORT_PPB: new_bus->xport = scsi_get_xport(); break; case XPORT_ATA: Modified: stable/8/sys/dev/iscsi/initiator/isc_cam.c ============================================================================== --- stable/8/sys/dev/iscsi/initiator/isc_cam.c Tue Aug 18 09:27:17 2009 (r196353) +++ stable/8/sys/dev/iscsi/initiator/isc_cam.c Tue Aug 18 09:31:00 2009 (r196354) @@ -190,6 +190,8 @@ _inq(struct cam_sim *sim, union ccb *ccb strncpy(cpi->hba_vid, "iSCSI", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); + cpi->transport = XPORT_ISCSI; + cpi->transport_version = 0; cpi->ccb_h.status = CAM_REQ_CMP; } Modified: stable/8/sys/dev/ppbus/vpo.c ============================================================================== --- stable/8/sys/dev/ppbus/vpo.c Tue Aug 18 09:27:17 2009 (r196353) +++ stable/8/sys/dev/ppbus/vpo.c Tue Aug 18 09:31:00 2009 (r196354) @@ -427,6 +427,8 @@ vpo_action(struct cam_sim *sim, union cc strncpy(cpi->hba_vid, "Iomega", HBA_IDLEN); strncpy(cpi->dev_name, sim->sim_name, DEV_IDLEN); cpi->unit_number = sim->unit_number; + cpi->transport = XPORT_PPB; + cpi->transport_version = 0; cpi->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 18 09:36:25 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BE99106568E; Tue, 18 Aug 2009 09:36:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57B448FC45; Tue, 18 Aug 2009 09:36:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7I9aPtD010602; Tue, 18 Aug 2009 09:36:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7I9aPcA010600; Tue, 18 Aug 2009 09:36:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200908180936.n7I9aPcA010600@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Aug 2009 09:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196355 - in stable/8/sys: . amd64/include/xen cam/ata cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2009 09:36:25 -0000 Author: mav Date: Tue Aug 18 09:36:25 2009 New Revision: 196355 URL: http://svn.freebsd.org/changeset/base/196355 Log: Fix copy/paste bug, that requests data read during ATA device probe sequence for ATA_SETFEATURES/ATA_SF_SETXFER command which by definition transfers no data. Most of controllers are irrelevant to this bug, but some nVidia's doesn't. Tested on: current@ Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Tue Aug 18 09:31:00 2009 (r196354) +++ stable/8/sys/cam/ata/ata_xpt.c Tue Aug 18 09:36:25 2009 (r196355) @@ -370,10 +370,10 @@ probestart(struct cam_periph *periph, un cam_fill_ataio(ataio, 1, probedone, - /*flags*/CAM_DIR_IN, - MSG_SIMPLE_Q_TAG, - /*data_ptr*/(u_int8_t *)ident_buf, - /*dxfer_len*/sizeof(struct ata_params), + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, 30 * 1000); ata_36bit_cmd(ataio, ATA_SETFEATURES, ATA_SF_SETXFER, 0, ata_max_mode(ident_buf, ATA_UDMA6, ATA_UDMA6)); From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 18 13:51:52 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 020D0106568B; Tue, 18 Aug 2009 13:51:52 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5F3C8FC43; Tue, 18 Aug 2009 13:51:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7IDppxQ019048; Tue, 18 Aug 2009 13:51:51 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7IDppQX019046; Tue, 18 Aug 2009 13:51:51 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200908181351.n7IDppQX019046@svn.freebsd.org> From: Tom Rhodes Date: Tue, 18 Aug 2009 13:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196357 - stable/8/share/man/man7 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2009 13:51:52 -0000 Author: trhodes Date: Tue Aug 18 13:51:51 2009 New Revision: 196357 URL: http://svn.freebsd.org/changeset/base/196357 Log: MFC rev 196356: Document MAKE_DVD and xref svn in ports. Approved by: re@ (kib) Modified: stable/8/share/man/man7/ (props changed) stable/8/share/man/man7/release.7 Modified: stable/8/share/man/man7/release.7 ============================================================================== --- stable/8/share/man/man7/release.7 Tue Aug 18 12:24:27 2009 (r196356) +++ stable/8/share/man/man7/release.7 Tue Aug 18 13:51:51 2009 (r196357) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2006 +.Dd August 17, 2009 .Dt RELEASE 7 .Os .Sh NAME @@ -332,6 +332,10 @@ patch file. A script that will be run in the .Xr chroot 8 environment immediately after any local patches are applied. +.It Va MAKE_DVD +If defined, build a bootable ISO DVD image in the CD-ROM +stage directory. +This option may not be available for all architectures. .It Va MAKE_ISOS If defined, bootable ISO CD-ROM images will be created from the contents of the CD-ROM stage directory. @@ -503,6 +507,7 @@ make release CHROOTDIR=/local3/release B .Xr install 1 , .Xr make 1 , .Xr patch 1 , +.Xr svn 1 Pq Pa ports/devel/subversion-freebsd , .Xr uname 1 , .Xr md 4 , .Xr make.conf 5 , @@ -540,7 +545,7 @@ effort was spent getting into a shape where it could at least automate most of the tediousness of building a release in a sterile environment. .Pp -With its almost 1000 revisions spread over multiple branches, the +At near 1000 revisions spread over multiple branches, the .Xr cvs 1 log of .Pa src/release/Makefile From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 18 14:00:26 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 365F5106568C; Tue, 18 Aug 2009 14:00:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 239648FC57; Tue, 18 Aug 2009 14:00:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7IE0Qg2019371; Tue, 18 Aug 2009 14:00:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7IE0Qlj019367; Tue, 18 Aug 2009 14:00:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908181400.n7IE0Qlj019367@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 18 Aug 2009 14:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196359 - in stable/8: share/man/man9 sys sys/amd64/include/xen sys/cddl/contrib/opensolaris sys/contrib/dev/acpica sys/contrib/pf sys/dev/xen/xenpci sys/kern sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2009 14:00:26 -0000 Author: pjd Date: Tue Aug 18 14:00:25 2009 New Revision: 196359 URL: http://svn.freebsd.org/changeset/base/196359 Log: MFC r196358: Remove unused taskqueue_find() function. Reviewed by: dfr Approved by: re (kib) Modified: stable/8/share/man/man9/ (props changed) stable/8/share/man/man9/taskqueue.9 stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/subr_taskqueue.c stable/8/sys/sys/taskqueue.h Modified: stable/8/share/man/man9/taskqueue.9 ============================================================================== --- stable/8/share/man/man9/taskqueue.9 Tue Aug 18 13:55:48 2009 (r196358) +++ stable/8/share/man/man9/taskqueue.9 Tue Aug 18 14:00:25 2009 (r196359) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2009 +.Dd August 18, 2009 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -59,8 +59,6 @@ struct task { .Fn taskqueue_create_fast "const char *name" "int mflags" "taskqueue_enqueue_fn enqueue" "void *context" .Ft void .Fn taskqueue_free "struct taskqueue *queue" -.Ft struct taskqueue * -.Fn taskqueue_find "const char *name" .Ft int .Fn taskqueue_enqueue "struct taskqueue *queue" "struct task *task" .Ft int @@ -115,16 +113,10 @@ should be used in place of .Pp The function .Fn taskqueue_free -should be used to remove the queue from the global list of queues -and free the memory used by the queue. +should be used to free the memory used by the queue. Any tasks that are on the queue will be executed at this time after which the thread servicing the queue will be signaled that it should exit. .Pp -The system maintains a list of all queues which can be searched using -.Fn taskqueue_find . -The first queue whose name matches is returned, otherwise -.Dv NULL . -.Pp To add a task to the list of tasks queued on a taskqueue, call .Fn taskqueue_enqueue with pointers to the queue and task. Modified: stable/8/sys/kern/subr_taskqueue.c ============================================================================== --- stable/8/sys/kern/subr_taskqueue.c Tue Aug 18 13:55:48 2009 (r196358) +++ stable/8/sys/kern/subr_taskqueue.c Tue Aug 18 14:00:25 2009 (r196359) @@ -45,11 +45,8 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_TASKQUEUE, "taskqueue", "Task Queues"); static void *taskqueue_giant_ih; static void *taskqueue_ih; -static STAILQ_HEAD(taskqueue_list, taskqueue) taskqueue_queues; -static struct mtx taskqueue_queues_mutex; struct taskqueue { - STAILQ_ENTRY(taskqueue) tq_link; STAILQ_HEAD(, task) tq_queue; const char *tq_name; taskqueue_enqueue_fn tq_enqueue; @@ -84,8 +81,6 @@ TQ_UNLOCK(struct taskqueue *tq) mtx_unlock(&tq->tq_mutex); } -static void init_taskqueue_list(void *data); - static __inline int TQ_SLEEP(struct taskqueue *tq, void *p, struct mtx *m, int pri, const char *wm, int t) @@ -95,16 +90,6 @@ TQ_SLEEP(struct taskqueue *tq, void *p, return (msleep(p, m, pri, wm, t)); } -static void -init_taskqueue_list(void *data __unused) -{ - - mtx_init(&taskqueue_queues_mutex, "taskqueue list", NULL, MTX_DEF); - STAILQ_INIT(&taskqueue_queues); -} -SYSINIT(taskqueue_list, SI_SUB_INTRINSIC, SI_ORDER_ANY, init_taskqueue_list, - NULL); - static struct taskqueue * _taskqueue_create(const char *name, int mflags, taskqueue_enqueue_fn enqueue, void *context, @@ -124,10 +109,6 @@ _taskqueue_create(const char *name, int queue->tq_flags |= TQ_FLAGS_ACTIVE; mtx_init(&queue->tq_mutex, mtxname, NULL, mtxflags); - mtx_lock(&taskqueue_queues_mutex); - STAILQ_INSERT_TAIL(&taskqueue_queues, queue, tq_link); - mtx_unlock(&taskqueue_queues_mutex); - return queue; } @@ -156,10 +137,6 @@ void taskqueue_free(struct taskqueue *queue) { - mtx_lock(&taskqueue_queues_mutex); - STAILQ_REMOVE(&taskqueue_queues, queue, taskqueue, tq_link); - mtx_unlock(&taskqueue_queues_mutex); - TQ_LOCK(queue); queue->tq_flags &= ~TQ_FLAGS_ACTIVE; taskqueue_run(queue); @@ -169,26 +146,6 @@ taskqueue_free(struct taskqueue *queue) free(queue, M_TASKQUEUE); } -/* - * Returns with the taskqueue locked. - */ -struct taskqueue * -taskqueue_find(const char *name) -{ - struct taskqueue *queue; - - mtx_lock(&taskqueue_queues_mutex); - STAILQ_FOREACH(queue, &taskqueue_queues, tq_link) { - if (strcmp(queue->tq_name, name) == 0) { - TQ_LOCK(queue); - mtx_unlock(&taskqueue_queues_mutex); - return queue; - } - } - mtx_unlock(&taskqueue_queues_mutex); - return NULL; -} - int taskqueue_enqueue(struct taskqueue *queue, struct task *task) { Modified: stable/8/sys/sys/taskqueue.h ============================================================================== --- stable/8/sys/sys/taskqueue.h Tue Aug 18 13:55:48 2009 (r196358) +++ stable/8/sys/sys/taskqueue.h Tue Aug 18 14:00:25 2009 (r196359) @@ -48,7 +48,6 @@ struct thread; */ typedef void (*taskqueue_enqueue_fn)(void *context); -struct proc; struct taskqueue *taskqueue_create(const char *name, int mflags, taskqueue_enqueue_fn enqueue, void *context); @@ -56,7 +55,6 @@ int taskqueue_start_threads(struct taskq const char *name, ...) __printflike(4, 5); int taskqueue_enqueue(struct taskqueue *queue, struct task *task); void taskqueue_drain(struct taskqueue *queue, struct task *task); -struct taskqueue *taskqueue_find(const char *name); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 18 20:06:01 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 401C3106568D; Tue, 18 Aug 2009 20:06:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE508FC68; Tue, 18 Aug 2009 20:06:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7IK602E026956; Tue, 18 Aug 2009 20:06:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7IK605I026954; Tue, 18 Aug 2009 20:06:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200908182006.n7IK605I026954@svn.freebsd.org> From: Michael Tuexen Date: Tue, 18 Aug 2009 20:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196365 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2009 20:06:01 -0000 Author: tuexen Date: Tue Aug 18 20:06:00 2009 New Revision: 196365 URL: http://svn.freebsd.org/changeset/base/196365 Log: Fix a panic when using one-to-one style sockets in non-blocking mode and there is no listening server. PR: 137795 Approved by: re, rrs (mentor) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/sctp_output.c Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Tue Aug 18 19:58:49 2009 (r196364) +++ stable/8/sys/netinet/sctp_output.c Tue Aug 18 20:06:00 2009 (r196365) @@ -12464,7 +12464,8 @@ sctp_lower_sosend(struct socket *so, error = ENOTCONN; goto out_unlocked; } - hold_tcblock = 0; + SCTP_TCB_LOCK(stcb); + hold_tcblock = 1; SCTP_INP_RUNLOCK(inp); if (addr) { /* Must locate the net structure if addr given */ From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 18 20:25:02 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D12B0106568D; Tue, 18 Aug 2009 20:25:02 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A34908FC3F; Tue, 18 Aug 2009 20:25:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7IKP2mu027504; Tue, 18 Aug 2009 20:25:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7IKP2Ep027502; Tue, 18 Aug 2009 20:25:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200908182025.n7IKP2Ep027502@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 18 Aug 2009 20:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196367 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/mii dev/xen/xenpci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2009 20:25:02 -0000 Author: yongari Date: Tue Aug 18 20:25:02 2009 New Revision: 196367 URL: http://svn.freebsd.org/changeset/base/196367 Log: MFC r196366: Backout r193289. r193289 restored page select bits to previous value instead of blindly resetting it to 0. However, it seems page select bits of some 88E1116 PHY is initialized to invalid one such that restoring page select bits after programming broke MII register access. The correct solution would be reset page select bits to 0 in PHY attach stage but it would require more testing. Since we're in BETA stage such a change would be dangerous so just back it out. This change should fix nfe(4) breakage on NVIDIA MCP55. Reported by: Ryan Rogers < webmaster <> doghouserepair dot com > Sam Fourman Jr. < sfourman <> gmail dot com > Tested by: Ryan Rogers < webmaster <> doghouserepair dot com > Sam Fourman Jr. < sfourman <> gmail dot com > Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/mii/e1000phy.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Tue Aug 18 20:20:15 2009 (r196366) +++ stable/8/sys/dev/mii/e1000phy.c Tue Aug 18 20:25:02 2009 (r196367) @@ -240,13 +240,11 @@ e1000phy_reset(struct mii_softc *sc) if (esc->mii_model == MII_MODEL_MARVELL_E1116 || esc->mii_model == MII_MODEL_MARVELL_E1149) { - page = PHY_READ(sc, E1000_EADR); - /* Select page 2, MAC specific control register. */ PHY_WRITE(sc, E1000_EADR, 2); reg = PHY_READ(sc, E1000_SCR); reg |= E1000_SCR_RGMII_POWER_UP; PHY_WRITE(sc, E1000_SCR, reg); - PHY_WRITE(sc, E1000_EADR, page); + PHY_WRITE(sc, E1000_EADR, 0); } } From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 18 20:39:36 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F9B0106568B; Tue, 18 Aug 2009 20:39:36 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B9078FC59; Tue, 18 Aug 2009 20:39:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7IKdaSK027863; Tue, 18 Aug 2009 20:39:36 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7IKdZIN027859; Tue, 18 Aug 2009 20:39:35 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200908182039.n7IKdZIN027859@svn.freebsd.org> From: Kip Macy Date: Tue, 18 Aug 2009 20:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196369 - in stable/8/sys: net netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2009 20:39:36 -0000 Author: kmacy Date: Tue Aug 18 20:39:35 2009 New Revision: 196369 URL: http://svn.freebsd.org/changeset/base/196369 Log: MFC 196368 - change the interface to flowtable_lookup so that we don't rely on the mbuf for obtaining the fib index - check that a cached flow corresponds to the same fib index as the packet for which we are doing the lookup - at interface detach time flush any flows referencing stale rtentrys associated with the interface that is going away (fixes reported panics) - reduce the time between cleans in case the cleaner is running at the time the eventhandler is called and the wakeup is missed less time will elapse before the eventhandler returns - separate per-vnet initialization from global initialization (pointed out by jeli@) Reviewed by: sam@ Approved by: re@ Modified: stable/8/sys/net/flowtable.c stable/8/sys/net/flowtable.h stable/8/sys/netinet/ip_output.c Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Tue Aug 18 20:28:58 2009 (r196368) +++ stable/8/sys/net/flowtable.c Tue Aug 18 20:39:35 2009 (r196369) @@ -29,6 +29,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "opt_route.h" #include "opt_mpath.h" +#include "opt_ddb.h" #include __FBSDID("$FreeBSD$"); @@ -36,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -66,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include struct ipv4_tuple { uint16_t ip_sport; /* source port */ @@ -94,8 +97,9 @@ union ipv6_flow { struct flentry { volatile uint32_t f_fhash; /* hash flowing forward */ uint16_t f_flags; /* flow flags */ - uint8_t f_pad; /* alignment */ + uint8_t f_pad; uint8_t f_proto; /* protocol */ + uint32_t f_fibnum; /* fib index */ uint32_t f_uptime; /* uptime at last access */ struct flentry *f_next; /* pointer to collision entry */ volatile struct rtentry *f_rt; /* rtentry for flow */ @@ -173,6 +177,10 @@ static VNET_DEFINE(uma_zone_t, flow_ipv6 #define V_flow_ipv4_zone VNET(flow_ipv4_zone) #define V_flow_ipv6_zone VNET(flow_ipv6_zone) +static struct cv flowclean_cv; +static struct mtx flowclean_lock; +static uint32_t flowclean_cycles; + /* * TODO: * - Make flowtable stats per-cpu, aggregated at sysctl call time, @@ -288,10 +296,10 @@ SYSCTL_VNET_PROC(_net_inet_flowtable, OI #ifndef RADIX_MPATH static void -in_rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fib) +in_rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum) { - rtalloc_ign_fib(ro, 0, fib); + rtalloc_ign_fib(ro, 0, fibnum); } #endif @@ -425,7 +433,7 @@ static bitstr_t * flowtable_mask(struct flowtable *ft) { bitstr_t *mask; - + if (ft->ft_flags & FL_PCPU) mask = ft->ft_masks[curcpu]; else @@ -501,7 +509,7 @@ flowtable_set_hashkey(struct flentry *fl static int flowtable_insert(struct flowtable *ft, uint32_t hash, uint32_t *key, - uint8_t proto, struct route *ro, uint16_t flags) + uint8_t proto, uint32_t fibnum, struct route *ro, uint16_t flags) { struct flentry *fle, *fletail, *newfle, **flep; int depth; @@ -564,6 +572,7 @@ skip: fle->f_rt = ro->ro_rt; fle->f_lle = ro->ro_lle; fle->f_fhash = hash; + fle->f_fibnum = fibnum; fle->f_uptime = time_uptime; FL_ENTRY_UNLOCK(ft, hash); return (0); @@ -591,13 +600,13 @@ flowtable_key_equal(struct flentry *fle, } int -flowtable_lookup(struct flowtable *ft, struct mbuf *m, struct route *ro) +flowtable_lookup(struct flowtable *ft, struct mbuf *m, struct route *ro, uint32_t fibnum) { uint32_t key[9], hash; struct flentry *fle; uint16_t flags; uint8_t proto = 0; - int error = 0, fib = 0; + int error = 0; struct rtentry *rt; struct llentry *lle; @@ -640,6 +649,7 @@ keycheck: && fle->f_fhash == hash && flowtable_key_equal(fle, key) && (proto == fle->f_proto) + && (fibnum == fle->f_fibnum) && (rt->rt_flags & RTF_UP) && (rt->rt_ifp != NULL)) { V_flowtable_hits++; @@ -668,10 +678,8 @@ uncached: * of arpresolve with an rt_check variant that expected to * receive the route locked */ - if (m != NULL) - fib = M_GETFIB(m); - ft->ft_rtalloc(ro, hash, fib); + ft->ft_rtalloc(ro, hash, fibnum); if (ro->ro_rt == NULL) error = ENETUNREACH; else { @@ -692,7 +700,7 @@ uncached: ro->ro_rt = NULL; return (ENOENT); } - error = flowtable_insert(ft, hash, key, proto, + error = flowtable_insert(ft, hash, key, proto, fibnum, ro, flags); if (error) { @@ -791,35 +799,6 @@ flowtable_alloc(int nentry, int flags) return (ft); } -static void -flowtable_init(const void *unused __unused) -{ - - V_flow_ipv4_zone = uma_zcreate("ip4flow", sizeof(struct flentry_v4), - NULL, NULL, NULL, NULL, 64, UMA_ZONE_MAXBUCKET); - V_flow_ipv6_zone = uma_zcreate("ip6flow", sizeof(struct flentry_v6), - NULL, NULL, NULL, NULL, 64, UMA_ZONE_MAXBUCKET); - uma_zone_set_max(V_flow_ipv4_zone, V_flowtable_nmbflows); - uma_zone_set_max(V_flow_ipv6_zone, V_flowtable_nmbflows); - V_flowtable_ready = 1; -} - -VNET_SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, - flowtable_init, NULL); - -#ifdef VIMAGE -static void -flowtable_uninit(const void *unused __unused) -{ - - uma_zdestroy(V_flow_ipv4_zone); - uma_zdestroy(V_flow_ipv6_zone); -} - -VNET_SYSUNINIT(flowtable_uninit, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, - flowtable_uninit, NULL); -#endif - /* * The rest of the code is devoted to garbage collection of expired entries. * It is a new additon made necessary by the switch to dynamically allocating @@ -973,12 +952,30 @@ flowtable_cleaner(void) } VNET_LIST_RUNLOCK(); + flowclean_cycles++; /* * The 20 second interval between cleaning checks * is arbitrary */ - pause("flowcleanwait", 20*hz); + mtx_lock(&flowclean_lock); + cv_broadcast(&flowclean_cv); + cv_timedwait(&flowclean_cv, &flowclean_lock, 10*hz); + mtx_unlock(&flowclean_lock); + } +} + +static void +flowtable_flush(void *unused __unused) +{ + uint64_t start; + + mtx_lock(&flowclean_lock); + start = flowclean_cycles; + while (start == flowclean_cycles) { + cv_broadcast(&flowclean_cv); + cv_wait(&flowclean_cv, &flowclean_lock); } + mtx_unlock(&flowclean_lock); } static struct kproc_desc flow_kp = { @@ -988,3 +985,159 @@ static struct kproc_desc flow_kp = { }; SYSINIT(flowcleaner, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, kproc_start, &flow_kp); +static void +flowtable_init_vnet(const void *unused __unused) +{ + + V_flow_ipv4_zone = uma_zcreate("ip4flow", sizeof(struct flentry_v4), + NULL, NULL, NULL, NULL, 64, UMA_ZONE_MAXBUCKET); + V_flow_ipv6_zone = uma_zcreate("ip6flow", sizeof(struct flentry_v6), + NULL, NULL, NULL, NULL, 64, UMA_ZONE_MAXBUCKET); + uma_zone_set_max(V_flow_ipv4_zone, V_flowtable_nmbflows); + uma_zone_set_max(V_flow_ipv6_zone, V_flowtable_nmbflows); +} +VNET_SYSINIT(flowtable_init_vnet, SI_SUB_KTHREAD_INIT, SI_ORDER_MIDDLE, + flowtable_init_vnet, NULL); + +static void +flowtable_init(const void *unused __unused) +{ + + cv_init(&flowclean_cv, "flowcleanwait"); + mtx_init(&flowclean_lock, "flowclean lock", NULL, MTX_DEF); + EVENTHANDLER_REGISTER(ifnet_departure_event, flowtable_flush, NULL, + EVENTHANDLER_PRI_ANY); + V_flowtable_ready = 1; +} +SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, + flowtable_init, NULL); + + +#ifdef VIMAGE +static void +flowtable_uninit(const void *unused __unused) +{ + + uma_zdestroy(V_flow_ipv4_zone); + uma_zdestroy(V_flow_ipv6_zone); +} + +VNET_SYSUNINIT(flowtable_uninit, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, + flowtable_uninit, NULL); +#endif + +#ifdef DDB +static bitstr_t * +flowtable_mask_pcpu(struct flowtable *ft, int cpuid) +{ + bitstr_t *mask; + + if (ft->ft_flags & FL_PCPU) + mask = ft->ft_masks[cpuid]; + else + mask = ft->ft_masks[0]; + + return (mask); +} + +static struct flentry ** +flowtable_entry_pcpu(struct flowtable *ft, uint32_t hash, int cpuid) +{ + struct flentry **fle; + int index = (hash % ft->ft_size); + + if (ft->ft_flags & FL_PCPU) { + fle = &ft->ft_table.pcpu[cpuid][index]; + } else { + fle = &ft->ft_table.global[index]; + } + + return (fle); +} + +static void +flow_show(struct flowtable *ft, struct flentry *fle) +{ + int idle_time; + int rt_valid; + + idle_time = (int)(time_uptime - fle->f_uptime); + rt_valid = fle->f_rt != NULL; + db_printf("hash=0x%08x idle_time=%03d rt=%p ifp=%p", + fle->f_fhash, idle_time, + fle->f_rt, rt_valid ? fle->f_rt->rt_ifp : NULL); + if (rt_valid && (fle->f_rt->rt_flags & RTF_UP)) + db_printf(" RTF_UP "); + if (fle->f_flags & FL_STALE) + db_printf(" FL_STALE "); + db_printf("\n"); +} + +static void +flowtable_show(struct flowtable *ft, int cpuid) +{ + int curbit = 0; + struct flentry *fle, **flehead; + bitstr_t *mask, *tmpmask; + + db_printf("cpu: %d\n", cpuid); + mask = flowtable_mask_pcpu(ft, cpuid); + tmpmask = ft->ft_tmpmask; + memcpy(tmpmask, mask, ft->ft_size/8); + /* + * XXX Note to self, bit_ffs operates at the byte level + * and thus adds gratuitous overhead + */ + bit_ffs(tmpmask, ft->ft_size, &curbit); + while (curbit != -1) { + if (curbit >= ft->ft_size || curbit < -1) { + db_printf("warning: bad curbit value %d \n", + curbit); + break; + } + + flehead = flowtable_entry_pcpu(ft, curbit, cpuid); + fle = *flehead; + + while (fle != NULL) { + flow_show(ft, fle); + fle = fle->f_next; + continue; + } + bit_clear(tmpmask, curbit); + bit_ffs(tmpmask, ft->ft_size, &curbit); + } +} + +static void +flowtable_show_vnet(void) +{ + struct flowtable *ft; + int i; + + ft = V_flow_list_head; + while (ft != NULL) { + if (ft->ft_flags & FL_PCPU) { + for (i = 0; i <= mp_maxid; i++) { + if (CPU_ABSENT(i)) + continue; + flowtable_show(ft, i); + } + } else { + flowtable_show(ft, 0); + } + ft = ft->ft_next; + } +} + +DB_SHOW_COMMAND(flowtables, db_show_flowtables) +{ + VNET_ITERATOR_DECL(vnet_iter); + + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + flowtable_show_vnet(); + CURVNET_RESTORE(); + } +} +#endif Modified: stable/8/sys/net/flowtable.h ============================================================================== --- stable/8/sys/net/flowtable.h Tue Aug 18 20:28:58 2009 (r196368) +++ stable/8/sys/net/flowtable.h Tue Aug 18 20:39:35 2009 (r196369) @@ -49,7 +49,7 @@ struct flowtable *flowtable_alloc(int ne * */ int flowtable_lookup(struct flowtable *ft, struct mbuf *m, - struct route *ro); + struct route *ro, uint32_t fibnum); #endif /* _KERNEL */ #endif Modified: stable/8/sys/netinet/ip_output.c ============================================================================== --- stable/8/sys/netinet/ip_output.c Tue Aug 18 20:28:58 2009 (r196368) +++ stable/8/sys/netinet/ip_output.c Tue Aug 18 20:39:35 2009 (r196369) @@ -157,7 +157,7 @@ ip_output(struct mbuf *m, struct mbuf *o * longer than that long for the stability of ro_rt. The * flow ID assignment must have happened before this point. */ - if (flowtable_lookup(V_ip_ft, m, ro) == 0) + if (flowtable_lookup(V_ip_ft, m, ro, M_GETFIB(m)) == 0) nortfree = 1; #endif } From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 18 21:13:01 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00AC5106564A; Tue, 18 Aug 2009 21:13:01 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C74168FC61; Tue, 18 Aug 2009 21:13:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7ILD0Ua028631; Tue, 18 Aug 2009 21:13:00 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7ILD00Z028629; Tue, 18 Aug 2009 21:13:00 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200908182113.n7ILD00Z028629@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 18 Aug 2009 21:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196371 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/bge dev/xen/xenpci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2009 21:13:01 -0000 Author: stas Date: Tue Aug 18 21:13:00 2009 New Revision: 196371 URL: http://svn.freebsd.org/changeset/base/196371 Log: - MFC r196370. Do not try to reevaluate current RX production index on each loop iteration as it can be updated by the card while we process the RX ring forcing us to process RX descriptors for which DMA synchronisation operation has not been performed. This fixes the bug when bge(4) drops packets under high load. Discussed with: yongari, marius Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Tue Aug 18 21:07:39 2009 (r196370) +++ stable/8/sys/dev/bge/if_bge.c Tue Aug 18 21:13:00 2009 (r196371) @@ -3055,12 +3055,14 @@ bge_rxeof(struct bge_softc *sc) { struct ifnet *ifp; int rx_npkts = 0, stdcnt = 0, jumbocnt = 0; + uint16_t rx_prod, rx_cons; BGE_LOCK_ASSERT(sc); + rx_cons = sc->bge_rx_saved_considx; + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; /* Nothing to do. */ - if (sc->bge_rx_saved_considx == - sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx) + if (rx_cons == rx_prod) return (rx_npkts); ifp = sc->bge_ifp; @@ -3073,8 +3075,7 @@ bge_rxeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTREAD); - while (sc->bge_rx_saved_considx != - sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx) { + while (rx_cons != rx_prod) { struct bge_rx_bd *cur_rx; uint32_t rxidx; struct mbuf *m = NULL; @@ -3089,11 +3090,10 @@ bge_rxeof(struct bge_softc *sc) } #endif - cur_rx = - &sc->bge_ldata.bge_rx_return_ring[sc->bge_rx_saved_considx]; + cur_rx = &sc->bge_ldata.bge_rx_return_ring[rx_cons]; rxidx = cur_rx->bge_idx; - BGE_INC(sc->bge_rx_saved_considx, sc->bge_return_ring_cnt); + BGE_INC(rx_cons, sc->bge_return_ring_cnt); if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING && cur_rx->bge_flags & BGE_RXBDFLAG_VLAN_TAG) { @@ -3207,6 +3207,7 @@ bge_rxeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); + sc->bge_rx_saved_considx = rx_cons; bge_writembx(sc, BGE_MBX_RX_CONS0_LO, sc->bge_rx_saved_considx); if (stdcnt) bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 00:17:00 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F21A6106568B; Wed, 19 Aug 2009 00:17:00 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF0828FC52; Wed, 19 Aug 2009 00:17:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7J0H03a032373; Wed, 19 Aug 2009 00:17:00 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7J0H0iw032370; Wed, 19 Aug 2009 00:17:00 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200908190017.n7J0H0iw032370@svn.freebsd.org> From: Max Laier Date: Wed, 19 Aug 2009 00:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196373 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf contrib/pf/net dev/xen/xenpci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 00:17:01 -0000 Author: mlaier Date: Wed Aug 19 00:17:00 2009 New Revision: 196373 URL: http://svn.freebsd.org/changeset/base/196373 Log: MFC r196372: If we cannot immediately get the pf_consistency_lock in the purge thread, restart the scan after acquiring the lock the hard way. Otherwise we might end up with a dead reference. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/contrib/pf/net/pf.c stable/8/sys/contrib/pf/net/pfvar.h stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/contrib/pf/net/pf.c ============================================================================== --- stable/8/sys/contrib/pf/net/pf.c Wed Aug 19 00:10:10 2009 (r196372) +++ stable/8/sys/contrib/pf/net/pf.c Wed Aug 19 00:17:00 2009 (r196373) @@ -971,6 +971,9 @@ void pf_purge_thread(void *v) { int nloops = 0, s; +#ifdef __FreeBSD__ + int locked; +#endif for (;;) { tsleep(pf_purge_thread, PWAIT, "pftm", 1 * hz); @@ -978,14 +981,19 @@ pf_purge_thread(void *v) #ifdef __FreeBSD__ sx_slock(&pf_consistency_lock); PF_LOCK(); + locked = 0; if (pf_end_threads) { - pf_purge_expired_states(pf_status.states); + PF_UNLOCK(); + sx_sunlock(&pf_consistency_lock); + sx_xlock(&pf_consistency_lock); + PF_LOCK(); + pf_purge_expired_states(pf_status.states, 1); pf_purge_expired_fragments(); - pf_purge_expired_src_nodes(0); + pf_purge_expired_src_nodes(1); pf_end_threads++; - sx_sunlock(&pf_consistency_lock); + sx_xunlock(&pf_consistency_lock); PF_UNLOCK(); wakeup(pf_purge_thread); kproc_exit(0); @@ -994,20 +1002,44 @@ pf_purge_thread(void *v) s = splsoftnet(); /* process a fraction of the state table every second */ +#ifdef __FreeBSD__ + if(!pf_purge_expired_states(1 + (pf_status.states + / pf_default_rule.timeout[PFTM_INTERVAL]), 0)) { + PF_UNLOCK(); + sx_sunlock(&pf_consistency_lock); + sx_xlock(&pf_consistency_lock); + PF_LOCK(); + locked = 1; + + pf_purge_expired_states(1 + (pf_status.states + / pf_default_rule.timeout[PFTM_INTERVAL]), 1); + } +#else pf_purge_expired_states(1 + (pf_status.states / pf_default_rule.timeout[PFTM_INTERVAL])); +#endif /* purge other expired types every PFTM_INTERVAL seconds */ if (++nloops >= pf_default_rule.timeout[PFTM_INTERVAL]) { pf_purge_expired_fragments(); - pf_purge_expired_src_nodes(0); + if (!pf_purge_expired_src_nodes(locked)) { + PF_UNLOCK(); + sx_sunlock(&pf_consistency_lock); + sx_xlock(&pf_consistency_lock); + PF_LOCK(); + locked = 1; + pf_purge_expired_src_nodes(1); + } nloops = 0; } splx(s); #ifdef __FreeBSD__ PF_UNLOCK(); - sx_sunlock(&pf_consistency_lock); + if (locked) + sx_xunlock(&pf_consistency_lock); + else + sx_sunlock(&pf_consistency_lock); #endif } } @@ -1056,8 +1088,13 @@ pf_state_expires(const struct pf_state * return (state->expire + timeout); } +#ifdef __FreeBSD__ +int +pf_purge_expired_src_nodes(int waslocked) +#else void pf_purge_expired_src_nodes(int waslocked) +#endif { struct pf_src_node *cur, *next; int locked = waslocked; @@ -1068,12 +1105,8 @@ pf_purge_expired_src_nodes(int waslocked if (cur->states <= 0 && cur->expire <= time_second) { if (! locked) { #ifdef __FreeBSD__ - if (!sx_try_upgrade(&pf_consistency_lock)) { - PF_UNLOCK(); - sx_sunlock(&pf_consistency_lock); - sx_xlock(&pf_consistency_lock); - PF_LOCK(); - } + if (!sx_try_upgrade(&pf_consistency_lock)) + return (0); #else rw_enter_write(&pf_consistency_lock); #endif @@ -1100,6 +1133,10 @@ pf_purge_expired_src_nodes(int waslocked #else rw_exit_write(&pf_consistency_lock); #endif + +#ifdef __FreeBSD__ + return (1); +#endif } void @@ -1202,12 +1239,21 @@ pf_free_state(struct pf_state *cur) pf_status.states--; } +#ifdef __FreeBSD__ +int +pf_purge_expired_states(u_int32_t maxcheck, int waslocked) +#else void pf_purge_expired_states(u_int32_t maxcheck) +#endif { static struct pf_state *cur = NULL; struct pf_state *next; +#ifdef __FreeBSD__ + int locked = waslocked; +#else int locked = 0; +#endif while (maxcheck--) { /* wrap to start of list when we hit the end */ @@ -1224,12 +1270,8 @@ pf_purge_expired_states(u_int32_t maxche /* free unlinked state */ if (! locked) { #ifdef __FreeBSD__ - if (!sx_try_upgrade(&pf_consistency_lock)) { - PF_UNLOCK(); - sx_sunlock(&pf_consistency_lock); - sx_xlock(&pf_consistency_lock); - PF_LOCK(); - } + if (!sx_try_upgrade(&pf_consistency_lock)) + return (0); #else rw_enter_write(&pf_consistency_lock); #endif @@ -1241,12 +1283,8 @@ pf_purge_expired_states(u_int32_t maxche pf_unlink_state(cur); if (! locked) { #ifdef __FreeBSD__ - if (!sx_try_upgrade(&pf_consistency_lock)) { - PF_UNLOCK(); - sx_sunlock(&pf_consistency_lock); - sx_xlock(&pf_consistency_lock); - PF_LOCK(); - } + if (!sx_try_upgrade(&pf_consistency_lock)) + return (0); #else rw_enter_write(&pf_consistency_lock); #endif @@ -1257,10 +1295,13 @@ pf_purge_expired_states(u_int32_t maxche cur = next; } - if (locked) #ifdef __FreeBSD__ + if (!waslocked && locked) sx_downgrade(&pf_consistency_lock); + + return (1); #else + if (locked) rw_exit_write(&pf_consistency_lock); #endif } Modified: stable/8/sys/contrib/pf/net/pfvar.h ============================================================================== --- stable/8/sys/contrib/pf/net/pfvar.h Wed Aug 19 00:10:10 2009 (r196372) +++ stable/8/sys/contrib/pf/net/pfvar.h Wed Aug 19 00:17:00 2009 (r196373) @@ -1593,8 +1593,13 @@ extern struct pool pf_state_pl, pf_alt extern struct pool pf_state_scrub_pl; #endif extern void pf_purge_thread(void *); +#ifdef __FreeBSD__ +extern int pf_purge_expired_src_nodes(int); +extern int pf_purge_expired_states(u_int32_t, int); +#else extern void pf_purge_expired_src_nodes(int); extern void pf_purge_expired_states(u_int32_t); +#endif extern void pf_unlink_state(struct pf_state *); extern void pf_free_state(struct pf_state *); extern int pf_insert_state(struct pfi_kif *, From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 03:58:12 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F075106568D; Wed, 19 Aug 2009 03:58:12 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64B888FC43; Wed, 19 Aug 2009 03:58:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7J3wCDK041178; Wed, 19 Aug 2009 03:58:12 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7J3wCff041176; Wed, 19 Aug 2009 03:58:12 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200908190358.n7J3wCff041176@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 19 Aug 2009 03:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196375 - in stable/8/release/doc: . en_US.ISO8859-1/relnotes X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 03:58:12 -0000 Author: edwin Date: Wed Aug 19 03:58:12 2009 New Revision: 196375 URL: http://svn.freebsd.org/changeset/base/196375 Log: - Make note of the update of tzdata from 2008h to 2009j - Make note of the update of tzcode from 2004a to 2009h Add an extra alert that people who update via source or via freebsd-update will have to run the tzsetup(8) utility. Approved by: re (Kostik) Modified: stable/8/release/doc/ (props changed) stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Wed Aug 19 03:52:15 2009 (r196374) +++ stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Wed Aug 19 03:58:12 2009 (r196375) @@ -411,6 +411,9 @@ &man.top.1; now supports a flag to provide per-CPU usage statistics. + &man.zdump.8; is now working properly on 64 bit architectures. + + &man.traceroute.8; now has the ability to print the AS number for each hop with the new switch; a new option allows selecting a particular @@ -468,8 +471,15 @@ 8.14.1 to 8.14.3. The timezone database has been updated from - the tzdata2008b release to - the tzdata2008h release. + the tzdata2008h release to + the tzdata2009j release. + + The stdtime part of libc, &man.zdump.8 and &man.zic.8 + have been updated from the tzcode2004a + release to the tzcode2009h release. + If you have upgraded from source or via the &man.freebsd-update.8, + 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. From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 12:12:52 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09E54106568B; Wed, 19 Aug 2009 12:12:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D50F28FC45; Wed, 19 Aug 2009 12:12:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7JCCpDE053891; Wed, 19 Aug 2009 12:12:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7JCCpXN053889; Wed, 19 Aug 2009 12:12:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200908191212.n7JCCpXN053889@svn.freebsd.org> From: Michael Tuexen Date: Wed, 19 Aug 2009 12:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196377 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 12:12:52 -0000 Author: tuexen Date: Wed Aug 19 12:12:51 2009 New Revision: 196377 URL: http://svn.freebsd.org/changeset/base/196377 Log: Fix a bug in the handling of unreliable messages which results in stalled associations. Approved by: re, rrs (mentor) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/sctputil.c Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Wed Aug 19 12:02:28 2009 (r196376) +++ stable/8/sys/netinet/sctputil.c Wed Aug 19 12:12:51 2009 (r196377) @@ -4667,8 +4667,10 @@ sctp_release_pr_sctp_chunk(struct sctp_t stcb->asoc.peers_rwnd += tp1->send_size; stcb->asoc.peers_rwnd += SCTP_BASE_SYSCTL(sctp_peer_chunk_oh); sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, reason, tp1, so_locked); - sctp_m_freem(tp1->data); - tp1->data = NULL; + if (tp1->data) { + sctp_m_freem(tp1->data); + tp1->data = NULL; + } do_wakeup_routine = 1; if (PR_SCTP_BUF_ENABLED(tp1->flags)) { stcb->asoc.sent_queue_cnt_removeable--; @@ -4715,12 +4717,14 @@ next_on_sent: */ chk = tp1; ret_sz += tp1->book_size; - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, reason, tp1, so_locked); sctp_free_bufspace(stcb, &stcb->asoc, tp1, 1); - sctp_m_freem(tp1->data); + sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, reason, tp1, so_locked); + if (tp1->data) { + sctp_m_freem(tp1->data); + tp1->data = NULL; + } /* No flight involved here book the size to 0 */ tp1->book_size = 0; - tp1->data = NULL; if (tp1->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG) { foundeom = 1; } From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 14:38:44 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51A5D1065690; Wed, 19 Aug 2009 14:38:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2716E8FC77; Wed, 19 Aug 2009 14:38:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7JEcigv056992; Wed, 19 Aug 2009 14:38:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7JEcigk056990; Wed, 19 Aug 2009 14:38:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200908191438.n7JEcigk056990@svn.freebsd.org> From: Ed Schouten Date: Wed, 19 Aug 2009 14:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196379 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 14:38:44 -0000 Author: ed Date: Wed Aug 19 14:38:43 2009 New Revision: 196379 URL: http://svn.freebsd.org/changeset/base/196379 Log: MFC r196378: Small changes to the warning message generated by pty(4): - Only print the warning once, instead of filling up the screen. - Use the word "legacy" for the pty_warningcnt description, to prevent confusion. - Use log() instead of printf(). Discussed with: rwatson, jhb Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/tty_pty.c Modified: stable/8/sys/kern/tty_pty.c ============================================================================== --- stable/8/sys/kern/tty_pty.c Wed Aug 19 14:30:46 2009 (r196378) +++ stable/8/sys/kern/tty_pty.c Wed Aug 19 14:38:43 2009 (r196379) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -47,10 +48,10 @@ __FBSDID("$FreeBSD$"); * si_drv1 inside the cdev to mark whether the PTY is in use. */ -static unsigned int pty_warningcnt = 10; +static unsigned int pty_warningcnt = 1; SYSCTL_UINT(_kern, OID_AUTO, tty_pty_warningcnt, CTLFLAG_RW, &pty_warningcnt, 0, - "Warnings that will be triggered upon PTY allocation"); + "Warnings that will be triggered upon legacy PTY allocation"); static int ptydev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp) @@ -74,7 +75,7 @@ ptydev_fdopen(struct cdev *dev, int ffla /* Raise a warning when a legacy PTY has been allocated. */ if (pty_warningcnt > 0) { pty_warningcnt--; - printf("pid %d (%s) is using legacy pty devices%s\n", + log(LOG_INFO, "pid %d (%s) is using legacy pty devices%s\n", td->td_proc->p_pid, td->td_name, pty_warningcnt ? "" : " - not logging anymore"); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 14:48:59 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5412106568D; Wed, 19 Aug 2009 14:48:59 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A399E8FC62; Wed, 19 Aug 2009 14:48:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7JEmxQQ057294; Wed, 19 Aug 2009 14:48:59 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7JEmxMN057292; Wed, 19 Aug 2009 14:48:59 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200908191448.n7JEmxMN057292@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 19 Aug 2009 14:48:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196381 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/usb dev/xen/xenpci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 14:48:59 -0000 Author: raj Date: Wed Aug 19 14:48:59 2009 New Revision: 196381 URL: http://svn.freebsd.org/changeset/base/196381 Log: MFC r196380 Fix USB cache sync operations for platforms with non-coherent DMA. - usb_pc_cpu_invalidate() is called between [consecutive] reads from a device, so a sequence of BUS_DMASYNC_POSTREAD and _PREREAD should be used. Note we cannot use or'ed shorthand ( _POSTREAD | _PREREAD) for BUS_DMASYNC flags, as the low level bus dma sync operation is implementation dependent and we cannot assume the required order of operations to be guaranteed. - usb_pc_cpu_flush() is called before writing to a device, so BUS_DMASYNC_PREWRITE should be used. Submitted by: Grzegorz Bernacki Reviewed by: HPS, arm@, usb@ ML Tested by: HPS, Mike Tancsa Approved by: re (kib) Obtained from: Semihalf Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/usb/usb_busdma.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/usb_busdma.c ============================================================================== --- stable/8/sys/dev/usb/usb_busdma.c Wed Aug 19 14:39:08 2009 (r196380) +++ stable/8/sys/dev/usb/usb_busdma.c Wed Aug 19 14:48:59 2009 (r196381) @@ -679,8 +679,8 @@ usb_pc_cpu_invalidate(struct usb_page_ca /* nothing has been loaded into this page cache! */ return; } - bus_dmamap_sync(pc->tag, pc->map, - BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(pc->tag, pc->map, BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(pc->tag, pc->map, BUS_DMASYNC_PREREAD); } /*------------------------------------------------------------------------* @@ -693,8 +693,7 @@ usb_pc_cpu_flush(struct usb_page_cache * /* nothing has been loaded into this page cache! */ return; } - bus_dmamap_sync(pc->tag, pc->map, - BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + bus_dmamap_sync(pc->tag, pc->map, BUS_DMASYNC_PREWRITE); } /*------------------------------------------------------------------------* From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 16:40:46 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25612106568B; Wed, 19 Aug 2009 16:40:46 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAF938FC57; Wed, 19 Aug 2009 16:40:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7JGej4X059696; Wed, 19 Aug 2009 16:40:45 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7JGej95059694; Wed, 19 Aug 2009 16:40:45 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200908191640.n7JGej95059694@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 19 Aug 2009 16:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196384 - stable/8/sbin/bsdlabel X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 16:40:46 -0000 Author: marcel Date: Wed Aug 19 16:40:45 2009 New Revision: 196384 URL: http://svn.freebsd.org/changeset/base/196384 Log: MFC change 196383: Remove the dependency on the kernel -- in particular the gctl request to the GEOM_BSD class -- to translate the absolute offsets in the label to relative ones. This makes bslabel(8) work correctly with GEOM_PART and also when the BSD label is nested under arbitrary partitioning schemes. Inspired by: Eygene Ryabinkin Approved by: re (kib) Modified: stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/bsdlabel/bsdlabel.c Modified: stable/8/sbin/bsdlabel/bsdlabel.c ============================================================================== --- stable/8/sbin/bsdlabel/bsdlabel.c Wed Aug 19 16:29:20 2009 (r196383) +++ stable/8/sbin/bsdlabel/bsdlabel.c Wed Aug 19 16:40:45 2009 (r196384) @@ -118,7 +118,7 @@ static int installboot; /* non-zero if w static int allfields; /* present all fields in edit */ static char const *xxboot; /* primary boot */ -static off_t mbroffset; +static uint32_t lba_offset; #ifndef LABELSECTOR #define LABELSECTOR -1 #endif @@ -403,7 +403,7 @@ writelabel(void) readboot(); for (i = 0; i < lab.d_npartitions; i++) if (lab.d_partitions[i].p_size) - lab.d_partitions[i].p_offset += mbroffset; + lab.d_partitions[i].p_offset += lba_offset; bsd_disklabel_le_enc(bootarea + labeloffset + labelsoffset * secsize, lp); if (alphacksum) { @@ -479,10 +479,9 @@ get_file_parms(int f) static int readlabel(int flag) { + uint32_t lba; int f, i; int error; - struct gctl_req *grq; - char const *errstr; f = open(specname, O_RDONLY); if (f < 0) @@ -510,22 +509,28 @@ readlabel(int flag) if (is_file) return(0); - grq = gctl_get_handle(); - gctl_ro_param(grq, "verb", -1, "read mbroffset"); - gctl_ro_param(grq, "class", -1, "BSD"); - gctl_ro_param(grq, "geom", -1, pname); - gctl_rw_param(grq, "mbroffset", sizeof(mbroffset), &mbroffset); - errstr = gctl_issue(grq); - if (errstr != NULL) { - mbroffset = 0; - gctl_free(grq); - return (error); + + /* + * Compensate for absolute block addressing by finding the + * smallest partition offset and if the offset of the 'c' + * partition is equal to that, subtract it from all offsets. + */ + lba = ~0; + for (i = 0; i < lab.d_npartitions; i++) { + if (lab.d_partitions[i].p_size) + lba = MIN(lba, lab.d_partitions[i].p_offset); } - mbroffset /= lab.d_secsize; - if (lab.d_partitions[RAW_PART].p_offset == mbroffset) - for (i = 0; i < lab.d_npartitions; i++) + if (lba != 0 && lab.d_partitions[RAW_PART].p_offset == lba) { + for (i = 0; i < lab.d_npartitions; i++) { if (lab.d_partitions[i].p_size) - lab.d_partitions[i].p_offset -= mbroffset; + lab.d_partitions[i].p_offset -= lba; + } + /* + * Save the offset so that we can write the label + * back with absolute block addresses. + */ + lba_offset = lba; + } return (error); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 17:45:59 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6775106568F; Wed, 19 Aug 2009 17:45:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90F9B8FC60; Wed, 19 Aug 2009 17:45:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7JHjxmv061006; Wed, 19 Aug 2009 17:45:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7JHjxKU061005; Wed, 19 Aug 2009 17:45:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908191745.n7JHjxKU061005@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Aug 2009 17:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196385 - stable/8/contrib/top X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 17:45:59 -0000 Author: jhb Date: Wed Aug 19 17:45:58 2009 New Revision: 196385 URL: http://svn.freebsd.org/changeset/base/196385 Log: MFC 196382: Explicitly line up the CPU state labels with the calculated starting column that takes into account the width of the largest CPU ID. On systems with > 10 CPUs the labels for the first 10 CPUs were not lined up properly otherwise. Approved by: re (kib) Modified: stable/8/contrib/top/ (props changed) stable/8/contrib/top/display.c stable/8/contrib/top/install-sh (props changed) Modified: stable/8/contrib/top/display.c ============================================================================== --- stable/8/contrib/top/display.c Wed Aug 19 16:40:45 2009 (r196384) +++ stable/8/contrib/top/display.c Wed Aug 19 17:45:58 2009 (r196385) @@ -452,6 +452,7 @@ for (cpu = 0; cpu < num_cpus; cpu++) { lastline++; /* now walk thru the names and print the line */ + Move_to(cpustates_column, y_cpustates + cpu); while ((thisname = *names++) != NULL) { if (*thisname != '\0') @@ -543,6 +544,7 @@ for (cpu = 0; cpu < num_cpus; cpu++) { printf("\nCPU %d: ", cpu); lastline++; + Move_to(cpustates_column, y_cpustates + cpu); while ((thisname = *names++) != NULL) { if (*thisname != '\0') From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 18:08:52 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DCDC106568D; Wed, 19 Aug 2009 18:08:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17F918FC72; Wed, 19 Aug 2009 18:08:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7JI8pVm061611; Wed, 19 Aug 2009 18:08:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7JI8pNM061610; Wed, 19 Aug 2009 18:08:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200908191808.n7JI8pNM061610@svn.freebsd.org> From: Xin LI Date: Wed, 19 Aug 2009 18:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196387 - in stable/8/sys: . dev/e1000 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 18:08:52 -0000 Author: delphij Date: Wed Aug 19 18:08:50 2009 New Revision: 196387 URL: http://svn.freebsd.org/changeset/base/196387 Log: MFC r196386: Temporarily enhance em(4) and igb(4) hack to take account for IFF_NOARP. Without this changeset there will be no way to prevent these NICs from sending ARP, which is harmful in server farms that is configured as "Direct Server Return" behind a load balancer. A better fix would remove the whole hack completely but it would be later than 8.0-RELEASE. Reviewed by: jfv, yongari Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/dev/e1000/if_em.c stable/8/sys/dev/e1000/if_igb.c Modified: stable/8/sys/dev/e1000/if_em.c ============================================================================== --- stable/8/sys/dev/e1000/if_em.c Wed Aug 19 17:59:41 2009 (r196386) +++ stable/8/sys/dev/e1000/if_em.c Wed Aug 19 18:08:50 2009 (r196387) @@ -1204,7 +1204,8 @@ em_ioctl(struct ifnet *ifp, u_long comma em_init_locked(adapter); EM_CORE_UNLOCK(adapter); } - arp_ifinit(ifp, ifa); + if (!(ifp->if_flags & IFF_NOARP)) + arp_ifinit(ifp, ifa); } else #endif error = ether_ioctl(ifp, command, data); Modified: stable/8/sys/dev/e1000/if_igb.c ============================================================================== --- stable/8/sys/dev/e1000/if_igb.c Wed Aug 19 17:59:41 2009 (r196386) +++ stable/8/sys/dev/e1000/if_igb.c Wed Aug 19 18:08:50 2009 (r196387) @@ -952,7 +952,8 @@ igb_ioctl(struct ifnet *ifp, u_long comm igb_init_locked(adapter); IGB_CORE_UNLOCK(adapter); } - arp_ifinit(ifp, ifa); + if (!(ifp->if_flags & IFF_NOARP)) + arp_ifinit(ifp, ifa); } else #endif error = ether_ioctl(ifp, command, data); From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 19:07:08 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ED6F106568F; Wed, 19 Aug 2009 19:07:08 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.240]) by mx1.freebsd.org (Postfix) with ESMTP id D1C2A8FC43; Wed, 19 Aug 2009 19:07:07 +0000 (UTC) Received: by an-out-0708.google.com with SMTP id d14so1708421and.13 for ; Wed, 19 Aug 2009 12:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=lSvS1UtKvd4kdsuqWMfsB1FSND4djbuDIeLR3Mk4pA0=; b=Udw843J8599KG+A2kYkfvLAU8JinsMPyDLFRWLbHmUgC5Qf1TLTWAzXKjQzJf/qlYP bRBNB7LdjoTZccdTx1MJxOZg1UjbmbdZeTBY7AVIR8tQ9ASvr85nP8Vu5cofpykJVCWv uLYhnLPjpb4sQSq8fQVvPsPCOL/oY73dfZvTU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=V9UQjmjpgoatKhE03ylABpNbuSn719+1mttvLSfIFOnGqg7M1aXMuslAkJpP64Xyyq wd4V4v0n2uxB8EuYmSbwxFG/+0eMupz93LYRllaLAGMFGRSel8tDUEHFJZINfKOxgyD0 jvW8scc+BNh77cZW3xx5IM1QfCB68hFOdvj7w= MIME-Version: 1.0 Received: by 10.101.90.3 with SMTP id s3mr7547748anl.23.1250707214359; Wed, 19 Aug 2009 11:40:14 -0700 (PDT) In-Reply-To: <200908191808.n7JI8pNM061610@svn.freebsd.org> References: <200908191808.n7JI8pNM061610@svn.freebsd.org> Date: Wed, 19 Aug 2009 11:40:14 -0700 Message-ID: <2a41acea0908191140n7ac726b6x46ae428e3490e0de@mail.gmail.com> From: Jack Vogel To: Xin LI Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r196387 - in stable/8/sys: . dev/e1000 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 19:07:08 -0000 Thanks for doing this for me Xin. Jack On Wed, Aug 19, 2009 at 11:08 AM, Xin LI wrote: > Author: delphij > Date: Wed Aug 19 18:08:50 2009 > New Revision: 196387 > URL: http://svn.freebsd.org/changeset/base/196387 > > Log: > MFC r196386: > > Temporarily enhance em(4) and igb(4) hack to take account for IFF_NOARP. > Without this changeset there will be no way to prevent these NICs from > sending ARP, which is harmful in server farms that is configured as > "Direct Server Return" behind a load balancer. > > A better fix would remove the whole hack completely but it would be > later than 8.0-RELEASE. > > Reviewed by: jfv, yongari > Approved by: re (kib) > > Modified: > stable/8/sys/ (props changed) > stable/8/sys/dev/e1000/if_em.c > stable/8/sys/dev/e1000/if_igb.c > > Modified: stable/8/sys/dev/e1000/if_em.c > > ============================================================================== > --- stable/8/sys/dev/e1000/if_em.c Wed Aug 19 17:59:41 2009 > (r196386) > +++ stable/8/sys/dev/e1000/if_em.c Wed Aug 19 18:08:50 2009 > (r196387) > @@ -1204,7 +1204,8 @@ em_ioctl(struct ifnet *ifp, u_long comma > em_init_locked(adapter); > EM_CORE_UNLOCK(adapter); > } > - arp_ifinit(ifp, ifa); > + if (!(ifp->if_flags & IFF_NOARP)) > + arp_ifinit(ifp, ifa); > } else > #endif > error = ether_ioctl(ifp, command, data); > > Modified: stable/8/sys/dev/e1000/if_igb.c > > ============================================================================== > --- stable/8/sys/dev/e1000/if_igb.c Wed Aug 19 17:59:41 2009 > (r196386) > +++ stable/8/sys/dev/e1000/if_igb.c Wed Aug 19 18:08:50 2009 > (r196387) > @@ -952,7 +952,8 @@ igb_ioctl(struct ifnet *ifp, u_long comm > igb_init_locked(adapter); > IGB_CORE_UNLOCK(adapter); > } > - arp_ifinit(ifp, ifa); > + if (!(ifp->if_flags & IFF_NOARP)) > + arp_ifinit(ifp, ifa); > } else > #endif > error = ether_ioctl(ifp, command, data); > From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 20:17:37 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 257CA1065672; Wed, 19 Aug 2009 20:17:37 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED8418FC59; Wed, 19 Aug 2009 20:17:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7JKHaTZ064341; Wed, 19 Aug 2009 20:17:36 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7JKHaKL064339; Wed, 19 Aug 2009 20:17:36 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200908192017.n7JKHaKL064339@svn.freebsd.org> From: Kip Macy Date: Wed, 19 Aug 2009 20:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196389 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 20:17:37 -0000 Author: kmacy Date: Wed Aug 19 20:17:36 2009 New Revision: 196389 URL: http://svn.freebsd.org/changeset/base/196389 Log: This change fixes a comment and addresses a complaint by kib@ by moving a frequently executed flowtable syslog statement from being conditional on bootverbose to conditional on a per-vnet flowtable sysctl. Approved by: re@ Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/flowtable.c Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Wed Aug 19 20:13:09 2009 (r196388) +++ stable/8/sys/net/flowtable.c Wed Aug 19 20:17:36 2009 (r196389) @@ -199,6 +199,7 @@ static uint32_t flowclean_cycles; * - idetach() cleanup for options VIMAGE builds. */ VNET_DEFINE(int, flowtable_enable) = 1; +static VNET_DEFINE(int, flowtable_debug); static VNET_DEFINE(int, flowtable_hits); static VNET_DEFINE(int, flowtable_lookups); static VNET_DEFINE(int, flowtable_misses); @@ -214,6 +215,7 @@ static VNET_DEFINE(int, flowtable_nmbflo static VNET_DEFINE(int, flowtable_ready) = 0; #define V_flowtable_enable VNET(flowtable_enable) +#define V_flowtable_debug VNET(flowtable_debug) #define V_flowtable_hits VNET(flowtable_hits) #define V_flowtable_lookups VNET(flowtable_lookups) #define V_flowtable_misses VNET(flowtable_misses) @@ -229,6 +231,8 @@ static VNET_DEFINE(int, flowtable_ready) #define V_flowtable_ready VNET(flowtable_ready) SYSCTL_NODE(_net_inet, OID_AUTO, flowtable, CTLFLAG_RD, NULL, "flowtable"); +SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, debug, CTLFLAG_RW, + &VNET_NAME(flowtable_debug), 0, "print debug info."); SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, enable, CTLFLAG_RW, &VNET_NAME(flowtable_enable), 0, "enable flowtable caching."); SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, hits, CTLFLAG_RD, @@ -902,7 +906,7 @@ flowtable_free_stale(struct flowtable *f V_flowtable_frees++; fle_free(fle); } - if (bootverbose && count) + if (V_flowtable_debug && count) log(LOG_DEBUG, "freed %d flow entries\n", count); } @@ -954,7 +958,7 @@ flowtable_cleaner(void) flowclean_cycles++; /* - * The 20 second interval between cleaning checks + * The 10 second interval between cleaning checks * is arbitrary */ mtx_lock(&flowclean_lock); From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 20:44:22 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60A0B106568D; Wed, 19 Aug 2009 20:44:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F0D68FC43; Wed, 19 Aug 2009 20:44:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7JKiM4T064924; Wed, 19 Aug 2009 20:44:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7JKiMdd064921; Wed, 19 Aug 2009 20:44:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200908192044.n7JKiMdd064921@svn.freebsd.org> From: Ed Schouten Date: Wed, 19 Aug 2009 20:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196391 - in stable/8/sys: . amd64/amd64 amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci i386/i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 20:44:22 -0000 Author: ed Date: Wed Aug 19 20:44:22 2009 New Revision: 196391 URL: http://svn.freebsd.org/changeset/base/196391 Log: MFC r196390: Make the MacBookPro3,1 hardware boot again. Tested by: Patrick Lamaiziere Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/i386/i386/machdep.c Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Wed Aug 19 20:39:33 2009 (r196390) +++ stable/8/sys/amd64/amd64/machdep.c Wed Aug 19 20:44:22 2009 (r196391) @@ -217,6 +217,7 @@ cpu_startup(dummy) strncmp(sysenv, "MacBook3,1", 10) == 0 || strncmp(sysenv, "MacBookPro1,1", 13) == 0 || strncmp(sysenv, "MacBookPro1,2", 13) == 0 || + strncmp(sysenv, "MacBookPro3,1", 13) == 0 || strncmp(sysenv, "Macmini1,1", 10) == 0) { if (bootverbose) printf("Disabling LEGACY_USB_EN bit on " Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Wed Aug 19 20:39:33 2009 (r196390) +++ stable/8/sys/i386/i386/machdep.c Wed Aug 19 20:44:22 2009 (r196391) @@ -261,6 +261,7 @@ cpu_startup(dummy) strncmp(sysenv, "MacBook3,1", 10) == 0 || strncmp(sysenv, "MacBookPro1,1", 13) == 0 || strncmp(sysenv, "MacBookPro1,2", 13) == 0 || + strncmp(sysenv, "MacBookPro3,1", 13) == 0 || strncmp(sysenv, "Macmini1,1", 10) == 0) { if (bootverbose) printf("Disabling LEGACY_USB_EN bit on " From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 19 21:01:33 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8607F106568C; Wed, 19 Aug 2009 21:01:33 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4040E8FC43; Wed, 19 Aug 2009 21:01:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7JL1X7T065382; Wed, 19 Aug 2009 21:01:33 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7JL1Xwe065378; Wed, 19 Aug 2009 21:01:33 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200908192101.n7JL1Xwe065378@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 19 Aug 2009 21:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196393 - in stable/8: etc share/man/man5 usr.sbin/freebsd-update X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 21:01:33 -0000 Author: simon Date: Wed Aug 19 21:01:32 2009 New Revision: 196393 URL: http://svn.freebsd.org/changeset/base/196393 Log: MFC 196392: Add support for backing up the old kernel when installing a new kernel using freebsd-update. This applies to using freebsd-update in "upgrade mode" and normal freebsd-update on a security branch. The backup kernel will be written to /boot/kernel.old, if the directory does not exist, or the directory was created by freebsd-update in a previous backup. Otherwise freebsd-update will generate a new directory name for use by the backup. By default symbol files are not backed up to save diskspace and avoid filling up the root partition. This feature is fully configurable in the freebsd-update config file, but defaults to enabled. Reviewed by: cperciva Approved by: re (kib) Modified: stable/8/etc/ (props changed) stable/8/etc/freebsd-update.conf stable/8/share/man/man5/ (props changed) stable/8/share/man/man5/freebsd-update.conf.5 stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/freebsd-update/freebsd-update.sh Modified: stable/8/etc/freebsd-update.conf ============================================================================== --- stable/8/etc/freebsd-update.conf Wed Aug 19 20:47:31 2009 (r196392) +++ stable/8/etc/freebsd-update.conf Wed Aug 19 21:01:32 2009 (r196393) @@ -63,3 +63,14 @@ MergeChanges /etc/ /var/named/etc/ /boot # which *might* be installed of which FreeBSD Update should figure out # which actually are installed and upgrade those (StrictComponents no)? # StrictComponents no + +# When installing a new kernel perform a backup of the old one first +# so it is possible to boot the old kernel in case of problems. +# BackupKernel yes + +# If BackupKernel is enabled, the backup kernel is saved to this +# directory. +# BackupKernelDir /boot/kernel.old + +# When backing up a kernel also back up debug symbol files? +# BackupKernelSymbolFiles no Modified: stable/8/share/man/man5/freebsd-update.conf.5 ============================================================================== --- stable/8/share/man/man5/freebsd-update.conf.5 Wed Aug 19 20:47:31 2009 (r196392) +++ stable/8/share/man/man5/freebsd-update.conf.5 Wed Aug 19 21:01:32 2009 (r196393) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2006 +.Dd August 19, 2009 .Dt FREEBSD-UPDATE.CONF 5 .Os FreeBSD .Sh NAME @@ -48,7 +48,7 @@ error. .Pp The possible options and their meanings are as follows: .Pp -.Bl -tag -width "KeepModifiedMetadata" +.Bl -tag -width ".Cm BackupKernelSymbolFiles" .It Cm KeyPrint The single parameter following this keyword is the SHA256 hash of the RSA key which will be trusted to sign updates. @@ -171,6 +171,54 @@ command is used ("yes"), or merely as a which might be installed, of which .Cm freebsd-update should identify which in fact are present ("no"). +.It Cm BackupKernel +The single parameter following this keyword must be +.Dq yes +or +.Dq no +and specifies whether +.Cm freebsd-update +will create a backup of the old kernel before installing a new kernel. +This backup kernel can be used to recover a system where the newly +installed kernel somehow did not work. +Note that the backup kernel is not reverted to its original state by +the +.Cm freebsd-update +rollback command. +.It Cm BackupKernelDir +This keyword sets the directory which is used to store a backup +kernel, if the BackupKernel feature is enabled. +If the directory already exist, and it was not created by +.Cm freebsd-update , +the directory is skipped. +In the case of the primary directory name not being usable, a number +starting with +.Sq 1 +is appended to the directory name. +Like with the primary directory name, the constructed directory name is +only used if the path name does not exist, or if the directory was +previously created by +.Cm freebsd-update . +If the constructed directory still exist the appended number is +incremented with 1 and the directory search process restarted. +Should the number increment go above 9, +.Cm freebsd-update +will abort. +.It Cm BackupKernelSymbolFiles +The single parameter following this keyword must be +.Dq yes +or +.Dq no +and specifies whether +.Cm freebsd-update +will also backup kernel symbol files, if they exist. +The kernel symbol files takes up a lot of disk space and are not +needed for recovery purposes. +If the symbol files are needed, after recovering a system using the +backup kernel, the +.Cm freebsd-update +rollback command will recreate the symbol files along with the old +kernel. .El .Sh FILES .Bl -tag -width "/etc/freebsd-update.conf" Modified: stable/8/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/8/usr.sbin/freebsd-update/freebsd-update.sh Wed Aug 19 20:47:31 2009 (r196392) +++ stable/8/usr.sbin/freebsd-update/freebsd-update.sh Wed Aug 19 21:01:32 2009 (r196393) @@ -88,7 +88,7 @@ EOF CONFIGOPTIONS="KEYPRINT WORKDIR SERVERNAME MAILTO ALLOWADD ALLOWDELETE KEEPMODIFIEDMETADATA COMPONENTS IGNOREPATHS UPDATEIFUNMODIFIED BASEDIR VERBOSELEVEL TARGETRELEASE STRICTCOMPONENTS MERGECHANGES - IDSIGNOREPATHS" + IDSIGNOREPATHS BACKUPKERNEL BACKUPKERNELDIR BACKUPKERNELSYMBOLFILES" # Set all the configuration options to "". nullconfig () { @@ -308,6 +308,70 @@ config_VerboseLevel () { fi } +config_BackupKernel () { + if [ -z ${BACKUPKERNEL} ]; then + case $1 in + [Yy][Ee][Ss]) + BACKUPKERNEL=yes + ;; + [Nn][Oo]) + BACKUPKERNEL=no + ;; + *) + return 1 + ;; + esac + else + return 1 + fi +} + +config_BackupKernelDir () { + if [ -z ${BACKUPKERNELDIR} ]; then + if [ -z "$1" ]; then + echo "BackupKernelDir set to empty dir" + return 1 + fi + + # We check for some paths which would be extremely odd + # to use, but which could cause a lot of problems if + # used. + case $1 in + /|/bin|/boot|/etc|/lib|/libexec|/sbin|/usr|/var) + echo "BackupKernelDir set to invalid path $1" + return 1 + ;; + /*) + BACKUPKERNELDIR=$1 + ;; + *) + echo "BackupKernelDir ($1) is not an absolute path" + return 1 + ;; + esac + else + return 1 + fi +} + +config_BackupKernelSymbolFiles () { + if [ -z ${BACKUPKERNELSYMBOLFILES} ]; then + case $1 in + [Yy][Ee][Ss]) + BACKUPKERNELSYMBOLFILES=yes + ;; + [Nn][Oo]) + BACKUPKERNELSYMBOLFILES=no + ;; + *) + return 1 + ;; + esac + else + return 1 + fi +} + # Handle one line of configuration configline () { if [ $# -eq 0 ]; then @@ -461,6 +525,9 @@ default_params () { config_BaseDir / config_VerboseLevel stats config_StrictComponents no + config_BackupKernel yes + config_BackupKernelDir /boot/kernel.old + config_BackupKernelSymbolFiles no # Merge these defaults into the earlier-configured settings mergeconfig @@ -665,6 +732,14 @@ install_check_params () { echo "Re-run '$0 fetch'." exit 1 fi + + # Figure out what directory contains the running kernel + BOOTFILE=`sysctl -n kern.bootfile` + KERNELDIR=${BOOTFILE%/kernel} + if ! [ -d ${KERNELDIR} ]; then + echo "Cannot identify running kernel" + exit 1 + fi } # Perform sanity checks and set some final parameters in @@ -2494,6 +2569,88 @@ install_unschg () { rm filelist } +# Decide which directory name to use for kernel backups. +backup_kernel_finddir () { + CNT=0 + while true ; do + # Pathname does not exist, so it is OK use that name + # for backup directory. + if [ ! -e $BACKUPKERNELDIR ]; then + return 0 + fi + + # If directory do exist, we only use if it has our + # marker file. + if [ -d $BACKUPKERNELDIR -a \ + -e $BACKUPKERNELDIR/.freebsd-update ]; then + return 0 + fi + + # We could not use current directory name, so add counter to + # the end and try again. + CNT=$((CNT + 1)) + if [ $CNT -gt 9 ]; then + echo "Could not find valid backup dir ($BACKUPKERNELDIR)" + exit 1 + fi + BACKUPKERNELDIR="`echo $BACKUPKERNELDIR | sed -Ee 's/[0-9]\$//'`" + BACKUPKERNELDIR="${BACKUPKERNELDIR}${CNT}" + done +} + +# Backup the current kernel using hardlinks, if not disabled by user. +# Since we delete all files in the directory used for previous backups +# we create a marker file called ".freebsd-update" in the directory so +# we can determine on the next run that the directory was created by +# freebsd-update and we then do not accidentally remove user files in +# the unlikely case that the user has created a directory with a +# conflicting name. +backup_kernel () { + # Only make kernel backup is so configured. + if [ $BACKUPKERNEL != yes ]; then + return 0 + fi + + # Decide which directory name to use for kernel backups. + backup_kernel_finddir + + # Remove old kernel backup files. If $BACKUPKERNELDIR was + # "not ours", backup_kernel_finddir would have exited, so + # deleting the directory content is as safe as we can make it. + if [ -d $BACKUPKERNELDIR ]; then + rm -f $BACKUPKERNELDIR/* + fi + + # Create directory for backup if it doesn't exist. + mkdir -p $BACKUPKERNELDIR + + # Mark the directory as having been created by freebsd-update. + touch $BACKUPKERNELDIR/.freebsd-update + if [ $? -ne 0 ]; then + echo "Could not create kernel backup directory" + exit 1 + fi + + # Disable pathname expansion to be sure *.symbols is not + # expanded. + set -f + + # Use find to ignore symbol files, unless disabled by user. + if [ $BACKUPKERNELSYMBOLFILES = yes ]; then + FINDFILTER="" + else + FINDFILTER=-"a ! -name *.symbols" + fi + + # Backup all the kernel files using hardlinks. + find $KERNELDIR -type f $FINDFILTER | \ + sed -Ee "s,($KERNELDIR)/?(.*),\1/\2 ${BACKUPKERNELDIR}/\2," | \ + xargs -n 2 cp -pl + + # Re-enable patchname expansion. + set +f +} + # Install new files install_from_index () { # First pass: Do everything apart from setting file flags. We @@ -2575,6 +2732,9 @@ install_files () { grep -E '^/boot/' $1/INDEX-OLD > INDEX-OLD grep -E '^/boot/' $1/INDEX-NEW > INDEX-NEW + # Backup current kernel before installing a new one + backup_kernel || return 1 + # Install new files install_from_index INDEX-NEW || return 1 From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 20 00:08:58 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62B2B106568D; Thu, 20 Aug 2009 00:08:58 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51A178FC61; Thu, 20 Aug 2009 00:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7K08w2X069055; Thu, 20 Aug 2009 00:08:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7K08w9N069054; Thu, 20 Aug 2009 00:08:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908200008.n7K08w9N069054@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 20 Aug 2009 00:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196396 - in stable/8/sys: . amd64/include/xen cddl/compat/opensolaris/rpc cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2009 00:08:58 -0000 Author: pjd Date: Thu Aug 20 00:08:58 2009 New Revision: 196396 URL: http://svn.freebsd.org/changeset/base/196396 Log: MFC r196395: Our libc doesn't implement control method for XDR (only kernel does) and it will always return failure. Fix this by bringing userland implementation of xdrmem_control() back. This allow 'zpool import' to work again. Reported by: Thomas Backman Reviewed by: kmacy Approved by: re (kib) Added: stable/8/sys/cddl/compat/opensolaris/rpc/xdr.h - copied unchanged from r196395, head/sys/cddl/compat/opensolaris/rpc/xdr.h Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Copied: stable/8/sys/cddl/compat/opensolaris/rpc/xdr.h (from r196395, head/sys/cddl/compat/opensolaris/rpc/xdr.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/cddl/compat/opensolaris/rpc/xdr.h Thu Aug 20 00:08:58 2009 (r196396, copy of r196395, head/sys/cddl/compat/opensolaris/rpc/xdr.h) @@ -0,0 +1,70 @@ +/* + * Sun RPC is a product of Sun Microsystems, Inc. and is provided for + * unrestricted use provided that this legend is included on all tape + * media and as a part of the software program in whole or part. Users + * may copy or modify Sun RPC without charge, but are not authorized + * to license or distribute it to anyone else except as part of a product or + * program developed by the user. + * + * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE + * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * + * Sun RPC is provided with no support and without any obligation on the + * part of Sun Microsystems, Inc. to assist in its use, correction, + * modification or enhancement. + * + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC + * OR ANY PART THEREOF. + * + * In no event will Sun Microsystems, Inc. be liable for any lost revenue + * or profits or other special, indirect and consequential damages, even if + * Sun has been advised of the possibility of such damages. + * + * Sun Microsystems, Inc. + * 2550 Garcia Avenue + * Mountain View, California 94043 + */ + +#ifndef _OPENSOLARIS_RPC_XDR_H_ +#define _OPENSOLARIS_RPC_XDR_H_ + +#include_next + +#ifndef _KERNEL + +#include + +/* + * Taken from sys/xdr/xdr_mem.c. + * + * FreeBSD's userland XDR doesn't implement control method (only the kernel), + * but OpenSolaris nvpair still depend on it, so we have to implement it here. + */ +static __inline bool_t +xdrmem_control(XDR *xdrs, int request, void *info) +{ + xdr_bytesrec *xptr; + + switch (request) { + case XDR_GET_BYTES_AVAIL: + xptr = (xdr_bytesrec *)info; + xptr->xc_is_last_record = TRUE; + xptr->xc_num_avail = xdrs->x_handy; + return (TRUE); + default: + assert(!"unexpected request"); + } + return (FALSE); +} + +#undef XDR_CONTROL +#define XDR_CONTROL(xdrs, req, op) \ + (((xdrs)->x_ops->x_control == NULL) ? \ + xdrmem_control((xdrs), (req), (op)) : \ + (*(xdrs)->x_ops->x_control)(xdrs, req, op)) + +#endif /* !_KERNEL */ + +#endif /* !_OPENSOLARIS_RPC_XDR_H_ */ From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 20 02:49:43 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0E2E106568B; Thu, 20 Aug 2009 02:49:43 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F6468FC45; Thu, 20 Aug 2009 02:49:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7K2nhh7072202; Thu, 20 Aug 2009 02:49:43 GMT (envelope-from will@svn.freebsd.org) Received: (from will@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7K2nh4E072200; Thu, 20 Aug 2009 02:49:43 GMT (envelope-from will@svn.freebsd.org) Message-Id: <200908200249.n7K2nh4E072200@svn.freebsd.org> From: Will Andrews Date: Thu, 20 Aug 2009 02:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196398 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2009 02:49:43 -0000 Author: will Date: Thu Aug 20 02:49:43 2009 New Revision: 196398 URL: http://svn.freebsd.org/changeset/base/196398 Log: MFC r196397 from head: Fix CARP memory leaks on carp_if's malloc'd using M_CARP. This occurs when CARP tries to free them using M_IFADDR after the last address for a virtual host is removed and when detaching from the parent interface. Approved by: re (kib), ken (mentor) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ip_carp.c Modified: stable/8/sys/netinet/ip_carp.c ============================================================================== --- stable/8/sys/netinet/ip_carp.c Thu Aug 20 02:33:12 2009 (r196397) +++ stable/8/sys/netinet/ip_carp.c Thu Aug 20 02:49:43 2009 (r196398) @@ -501,7 +501,7 @@ carpdetach(struct carp_softc *sc, int un ifpromisc(sc->sc_carpdev, 0); sc->sc_carpdev->if_carp = NULL; CARP_LOCK_DESTROY(cif); - free(cif, M_IFADDR); + free(cif, M_CARP); } else if (unlock) CARP_UNLOCK(cif); sc->sc_carpdev = NULL; @@ -1639,7 +1639,7 @@ carp_del_addr(struct carp_softc *sc, str if (!--cif->vhif_nvrs) { sc->sc_carpdev->if_carp = NULL; CARP_LOCK_DESTROY(cif); - free(cif, M_IFADDR); + free(cif, M_CARP); } else { CARP_UNLOCK(cif); } @@ -1843,7 +1843,7 @@ carp_del_addr6(struct carp_softc *sc, st if (!--cif->vhif_nvrs) { CARP_LOCK_DESTROY(cif); sc->sc_carpdev->if_carp = NULL; - free(cif, M_IFADDR); + free(cif, M_CARP); } else CARP_UNLOCK(cif); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 20 11:04:32 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CBAD106568E; Thu, 20 Aug 2009 11:04:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 325FB8FC16; Thu, 20 Aug 2009 11:04:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7KB4WMd084367; Thu, 20 Aug 2009 11:04:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7KB4WkZ084364; Thu, 20 Aug 2009 11:04:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200908201104.n7KB4WkZ084364@svn.freebsd.org> From: Andriy Gapon Date: Thu, 20 Aug 2009 11:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196400 - stable/8/usr.bin/fstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2009 11:04:32 -0000 Author: avg Date: Thu Aug 20 11:04:31 2009 New Revision: 196400 URL: http://svn.freebsd.org/changeset/base/196400 Log: MFC 196399: fstat: fix fsid comparison when executed on systems with 64-bit long This affects only fstat on zfs and devfs, only on 64-bit systems and only when fsid is greater than 2^31 - 1. When fstat examines a file via stat(2) it takes uint32_t st_dev and assigns to (signed) (64-bit) long fsid, this results in a positive value. When fstat examines opened files it takes int32_t f_fsid.val[0] and assigns to (signed) (64-bit) long fsid, this results in a negative value. So, while initially st_dev and f_fsid.val[0] have the same bit values they get promoted to different 64-bit values because of the signed-vs-unsigned difference. A fix is to use "more natural" positive numbers by introducing intermediate unsigned cast for f_fsid.val[0]. Reviewed by: jhb, lulf Approved by: re (kib) MFC after: 1 week (to stable/7) Modified: stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/fstat/fstat.c stable/8/usr.bin/fstat/zfs.c Modified: stable/8/usr.bin/fstat/fstat.c ============================================================================== --- stable/8/usr.bin/fstat/fstat.c Thu Aug 20 10:57:14 2009 (r196399) +++ stable/8/usr.bin/fstat/fstat.c Thu Aug 20 11:04:31 2009 (r196400) @@ -658,7 +658,7 @@ devfs_filestat(struct vnode *vp, struct (void *)devfs_dirent.de_vnode, Pid); return 0; } - fsp->fsid = (long)mount.mnt_stat.f_fsid.val[0]; + fsp->fsid = (long)(uint32_t)mount.mnt_stat.f_fsid.val[0]; fsp->fileid = devfs_dirent.de_inode; fsp->mode = (devfs_dirent.de_mode & ~S_IFMT) | S_IFCHR; fsp->size = 0; Modified: stable/8/usr.bin/fstat/zfs.c ============================================================================== --- stable/8/usr.bin/fstat/zfs.c Thu Aug 20 10:57:14 2009 (r196399) +++ stable/8/usr.bin/fstat/zfs.c Thu Aug 20 11:04:31 2009 (r196400) @@ -117,7 +117,7 @@ zfs_filestat(struct vnode *vp, struct fi goto bad; } - fsp->fsid = (long)mount.mnt_stat.f_fsid.val[0]; + fsp->fsid = (long)(uint32_t)mount.mnt_stat.f_fsid.val[0]; fsp->fileid = *zid; /* * XXX: Shows up wrong in output, but UFS has this error too. Could From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 20 20:23:29 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50149106568B; Thu, 20 Aug 2009 20:23:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A91A8FC52; Thu, 20 Aug 2009 20:23:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7KKNTrs098433; Thu, 20 Aug 2009 20:23:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7KKNSxU098405; Thu, 20 Aug 2009 20:23:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908202023.n7KKNSxU098405@svn.freebsd.org> From: John Baldwin Date: Thu, 20 Aug 2009 20:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196405 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/aac dev/acpica dev/adb dev/amdtemp dev/amr dev/ata dev/atkbdc dev/bktr dev/drm ... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2009 20:23:29 -0000 Author: jhb Date: Thu Aug 20 20:23:28 2009 New Revision: 196405 URL: http://svn.freebsd.org/changeset/base/196405 Log: MFC 196403: Temporarily revert the new-bus locking for 8.0 release. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/aac/aac.c stable/8/sys/dev/acpica/acpi.c stable/8/sys/dev/acpica/acpi_battery.c stable/8/sys/dev/acpica/acpi_cpu.c stable/8/sys/dev/acpica/acpi_dock.c stable/8/sys/dev/acpica/acpi_thermal.c stable/8/sys/dev/adb/adb_bus.c stable/8/sys/dev/amdtemp/amdtemp.c stable/8/sys/dev/amr/amr.c stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/atkbdc/psm.c stable/8/sys/dev/bktr/bktr_os.c stable/8/sys/dev/drm/drm_drv.c stable/8/sys/dev/ips/ips_pci.c stable/8/sys/dev/mfi/mfi.c stable/8/sys/dev/mlx/mlx.c stable/8/sys/dev/mmc/mmc.c stable/8/sys/dev/pccbb/pccbb.c stable/8/sys/dev/pst/pst-iop.c stable/8/sys/dev/rp/rp.c stable/8/sys/dev/sound/pci/hda/hdac.c stable/8/sys/dev/twe/twe.c stable/8/sys/dev/usb/controller/usb_controller.c stable/8/sys/dev/usb/input/ukbd.c stable/8/sys/dev/usb/net/usb_ethernet.c stable/8/sys/dev/usb/usb_compat_linux.c stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_handle_request.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/wlan/if_upgt.c stable/8/sys/dev/xen/blkback/blkback.c stable/8/sys/dev/xen/netback/netback.c stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/i386/acpica/acpi_machdep.c stable/8/sys/i386/bios/smapi.c stable/8/sys/i386/bios/smbios.c stable/8/sys/i386/bios/vpd.c stable/8/sys/kern/subr_bus.c stable/8/sys/pc98/cbus/fdc.c stable/8/sys/sys/bus.h stable/8/sys/xen/xenbus/xenbus_probe.c Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/aac/aac.c Thu Aug 20 20:23:28 2009 (r196405) @@ -3270,10 +3270,10 @@ aac_handle_aif(struct aac_softc *sc, str while (co != NULL) { if (co->co_found == 0) { mtx_unlock(&sc->aac_io_lock); - newbus_xlock(); + mtx_lock(&Giant); device_delete_child(sc->aac_dev, co->co_disk); - newbus_xunlock(); + mtx_unlock(&Giant); mtx_lock(&sc->aac_io_lock); co_next = TAILQ_NEXT(co, co_link); mtx_lock(&sc->aac_container_lock); @@ -3291,9 +3291,9 @@ aac_handle_aif(struct aac_softc *sc, str /* Attach the newly created containers */ if (added) { mtx_unlock(&sc->aac_io_lock); - newbus_xlock(); + mtx_lock(&Giant); bus_generic_attach(sc->aac_dev); - newbus_xunlock(); + mtx_unlock(&Giant); mtx_lock(&sc->aac_io_lock); } Modified: stable/8/sys/dev/acpica/acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/acpica/acpi.c Thu Aug 20 20:23:28 2009 (r196405) @@ -675,6 +675,8 @@ acpi_suspend(device_t dev) device_t child, *devlist; int error, i, numdevs, pstate; + GIANT_REQUIRED; + /* First give child devices a chance to suspend. */ error = bus_generic_suspend(dev); if (error) @@ -717,6 +719,8 @@ acpi_resume(device_t dev) int i, numdevs, error; device_t child, *devlist; + GIANT_REQUIRED; + /* * Put all devices in D0 before resuming them. Call _S0D on each one * since some systems expect this. @@ -741,6 +745,8 @@ static int acpi_shutdown(device_t dev) { + GIANT_REQUIRED; + /* Allow children to shutdown first. */ bus_generic_shutdown(dev); @@ -2528,7 +2534,11 @@ acpi_EnterSleepState(struct acpi_softc * thread_unlock(curthread); #endif - newbus_xlock(); + /* + * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE + * drivers need this. + */ + mtx_lock(&Giant); slp_state = ACPI_SS_NONE; @@ -2601,7 +2611,7 @@ backout: if (slp_state >= ACPI_SS_SLEPT) acpi_enable_fixed_events(sc); - newbus_xunlock(); + mtx_unlock(&Giant); #ifdef SMP thread_lock(curthread); Modified: stable/8/sys/dev/acpica/acpi_battery.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_battery.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/acpica/acpi_battery.c Thu Aug 20 20:23:28 2009 (r196405) @@ -329,7 +329,6 @@ acpi_battery_find_dev(u_int logical_unit dev = NULL; found_unit = 0; - newbus_slock(); batt_dc = devclass_find("battery"); maxunit = devclass_get_maxunit(batt_dc); for (i = 0; i < maxunit; i++) { @@ -341,7 +340,6 @@ acpi_battery_find_dev(u_int logical_unit found_unit++; dev = NULL; } - newbus_sunlock(); return (dev); } @@ -371,17 +369,13 @@ acpi_battery_ioctl(u_long cmd, caddr_t a */ switch (cmd) { case ACPIIO_BATT_GET_UNITS: - newbus_slock(); *(int *)addr = acpi_battery_get_units(); - newbus_sunlock(); error = 0; break; case ACPIIO_BATT_GET_BATTINFO: if (dev != NULL || unit == ACPI_BATTERY_ALL_UNITS) { bzero(&ioctl_arg->battinfo, sizeof(ioctl_arg->battinfo)); - newbus_slock(); error = acpi_battery_get_battinfo(dev, &ioctl_arg->battinfo); - newbus_sunlock(); } break; case ACPIIO_BATT_GET_BIF: @@ -422,11 +416,6 @@ acpi_battery_sysctl(SYSCTL_HANDLER_ARGS) { int val, error; - /* - * Tolerate a race here because newbus lock can't be acquired before - * acpi_battery_get_battinfo() as it can create a LOR with the sysctl - * lock. - */ acpi_battery_get_battinfo(NULL, &acpi_battery_battinfo); val = *(u_int *)oidp->oid_arg1; error = sysctl_handle_int(oidp, &val, 0, req); @@ -438,10 +427,6 @@ acpi_battery_units_sysctl(SYSCTL_HANDLER { int count, error; - /* - * Tolerate a race here in order to avoid a LOR between sysctl lock - * and newbus lock. - */ count = acpi_battery_get_units(); error = sysctl_handle_int(oidp, &count, 0, req); return (error); Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/acpica/acpi_cpu.c Thu Aug 20 20:23:28 2009 (r196405) @@ -732,9 +732,7 @@ acpi_cpu_startup(void *arg) int i; /* Get set of CPU devices */ - newbus_slock(); devclass_get_devices(acpi_cpu_devclass, &cpu_devices, &cpu_ndevices); - newbus_sunlock(); /* * Setup any quirks that might necessary now that we have probed Modified: stable/8/sys/dev/acpica/acpi_dock.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_dock.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/acpica/acpi_dock.c Thu Aug 20 20:23:28 2009 (r196405) @@ -188,12 +188,12 @@ acpi_dock_attach_later(void *context) dev = (device_t)context; - newbus_xlock(); if (!device_is_enabled(dev)) device_enable(dev); + mtx_lock(&Giant); device_probe_and_attach(dev); - newbus_xunlock(); + mtx_unlock(&Giant); } static ACPI_STATUS @@ -299,11 +299,11 @@ acpi_dock_eject_child(ACPI_HANDLE handle "ejecting device for %s\n", acpi_name(handle)); dev = acpi_get_device(handle); - newbus_xlock(); if (dev != NULL && device_is_attached(dev)) { + mtx_lock(&Giant); device_detach(dev); + mtx_unlock(&Giant); } - newbus_xunlock(); acpi_SetInteger(handle, "_EJ0", 0); out: Modified: stable/8/sys/dev/acpica/acpi_thermal.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_thermal.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/acpica/acpi_thermal.c Thu Aug 20 20:23:28 2009 (r196405) @@ -936,8 +936,6 @@ acpi_tz_thread(void *arg) sc = NULL; for (;;) { - newbus_slock(); - /* If the number of devices has changed, re-evaluate. */ if (devclass_get_count(acpi_tz_devclass) != devcount) { if (devs != NULL) { @@ -950,7 +948,6 @@ acpi_tz_thread(void *arg) for (i = 0; i < devcount; i++) sc[i] = device_get_softc(devs[i]); } - newbus_sunlock(); /* Check for temperature events and act on them. */ for (i = 0; i < devcount; i++) { Modified: stable/8/sys/dev/adb/adb_bus.c ============================================================================== --- stable/8/sys/dev/adb/adb_bus.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/adb/adb_bus.c Thu Aug 20 20:23:28 2009 (r196405) @@ -113,7 +113,6 @@ adb_bus_enumerate(void *xdev) uint8_t i, next_free; uint16_t r3; - newbus_xlock(); sc->sc_dev = dev; sc->parent = device_get_parent(dev); @@ -188,7 +187,6 @@ adb_bus_enumerate(void *xdev) } bus_generic_attach(dev); - newbus_xunlock(); config_intrhook_disestablish(&sc->enum_hook); } Modified: stable/8/sys/dev/amdtemp/amdtemp.c ============================================================================== --- stable/8/sys/dev/amdtemp/amdtemp.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/amdtemp/amdtemp.c Thu Aug 20 20:23:28 2009 (r196405) @@ -269,7 +269,6 @@ amdtemp_intrhook(void *arg) /* * dev.cpu.N.temperature. */ - newbus_xlock(); nexus = device_find_child(root_bus, "nexus", 0); acpi = device_find_child(nexus, "acpi", 0); @@ -286,7 +285,6 @@ amdtemp_intrhook(void *arg) "Max of sensor 0 / 1"); } } - newbus_xunlock(); config_intrhook_disestablish(&sc->sc_ich); } Modified: stable/8/sys/dev/amr/amr.c ============================================================================== --- stable/8/sys/dev/amr/amr.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/amr/amr.c Thu Aug 20 20:23:28 2009 (r196405) @@ -90,10 +90,6 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(_hw, OID_AUTO, amr, CTLFLAG_RD, 0, "AMR driver parameters"); -/* - * In order to get rid of Giant, amr_state should be protected by - * a proper softc lock for the cdev operations. - */ static d_open_t amr_open; static d_close_t amr_close; static d_ioctl_t amr_ioctl; @@ -316,11 +312,9 @@ amr_startup(void *arg) config_intrhook_disestablish(&sc->amr_ich); sc->amr_ich.ich_func = NULL; - newbus_xlock(); /* get up-to-date drive information */ if (amr_query_controller(sc)) { device_printf(sc->amr_dev, "can't scan controller for drives\n"); - newbus_xunlock(); return; } @@ -353,7 +347,6 @@ amr_startup(void *arg) /* interrupts will be enabled before we do anything more */ sc->amr_state |= AMR_STATE_INTEN; - newbus_xunlock(); /* * Start the timeout routine. @@ -441,11 +434,7 @@ static int amr_open(struct cdev *dev, int flags, int fmt, struct thread *td) { int unit = dev2unit(dev); - struct amr_softc *sc; - - newbus_slock(); - sc = devclass_get_softc(devclass_find("amr"), unit); - newbus_sunlock(); + struct amr_softc *sc = devclass_get_softc(devclass_find("amr"), unit); debug_called(1); @@ -501,11 +490,7 @@ static int amr_close(struct cdev *dev, int flags, int fmt, struct thread *td) { int unit = dev2unit(dev); - struct amr_softc *sc; - - newbus_slock(); - sc = devclass_get_softc(devclass_find("amr"), unit); - newbus_sunlock(); + struct amr_softc *sc = devclass_get_softc(devclass_find("amr"), unit); debug_called(1); @@ -522,7 +507,6 @@ amr_rescan_drives(struct cdev *dev) struct amr_softc *sc = (struct amr_softc *)dev->si_drv1; int i, error = 0; - newbus_xlock(); sc->amr_state |= AMR_STATE_REMAP_LD; while (sc->amr_busyslots) { device_printf(sc->amr_dev, "idle controller\n"); @@ -546,7 +530,6 @@ amr_rescan_drives(struct cdev *dev) sc->amr_drive[i].al_disk = 0; } } - newbus_xunlock(); shutdown_out: amr_startup(sc); @@ -822,9 +805,7 @@ amr_ioctl(struct cdev *dev, u_long cmd, struct amr_linux_ioctl ali; int adapter, error; - newbus_slock(); devclass = devclass_find("amr"); - newbus_sunlock(); if (devclass == NULL) return (ENOENT); Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/ata/ata-all.c Thu Aug 20 20:23:28 2009 (r196405) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); static d_ioctl_t ata_ioctl; static struct cdevsw ata_cdevsw = { .d_version = D_VERSION, + .d_flags = D_NEEDGIANT, /* we need this as newbus isn't mpsafe */ .d_ioctl = ata_ioctl, .d_name = "ata", }; @@ -203,9 +204,7 @@ ata_conn_event(void *context, int dummy) { device_t dev = (device_t)context; - newbus_xlock(); ata_reinit(dev); - newbus_xunlock(); } int @@ -247,6 +246,7 @@ ata_reinit(device_t dev) /* reinit the children and delete any that fails */ if (!device_get_children(dev, &children, &nchildren)) { + mtx_lock(&Giant); /* newbus suckage it needs Giant */ for (i = 0; i < nchildren; i++) { /* did any children go missing ? */ if (children[i] && device_is_attached(children[i]) && @@ -269,6 +269,7 @@ ata_reinit(device_t dev) } } free(children, M_TEMP); + mtx_unlock(&Giant); /* newbus suckage dealt with, release Giant */ } /* if we still have a good request put it on the queue again */ @@ -394,7 +395,6 @@ ata_ioctl(struct cdev *dev, u_long cmd, int *value = (int *)data; int i, nchildren, error = ENOTTY; - newbus_xlock(); switch (cmd) { case IOCATAGMAXCHANNEL: /* In case we have channel 0..n this will return n+1. */ @@ -405,40 +405,32 @@ ata_ioctl(struct cdev *dev, u_long cmd, case IOCATAREINIT: if (*value >= devclass_get_maxunit(ata_devclass) || !(device = devclass_get_device(ata_devclass, *value)) || - !device_is_attached(device)) { - newbus_xunlock(); + !device_is_attached(device)) return ENXIO; - } error = ata_reinit(device); break; case IOCATAATTACH: if (*value >= devclass_get_maxunit(ata_devclass) || !(device = devclass_get_device(ata_devclass, *value)) || - !device_is_attached(device)) { - newbus_xunlock(); + !device_is_attached(device)) return ENXIO; - } error = DEVICE_ATTACH(device); break; case IOCATADETACH: if (*value >= devclass_get_maxunit(ata_devclass) || !(device = devclass_get_device(ata_devclass, *value)) || - !device_is_attached(device)) { - newbus_xunlock(); + !device_is_attached(device)) return ENXIO; - } error = DEVICE_DETACH(device); break; case IOCATADEVICES: if (devices->channel >= devclass_get_maxunit(ata_devclass) || !(device = devclass_get_device(ata_devclass, devices->channel)) || - !device_is_attached(device)) { - newbus_xunlock(); + !device_is_attached(device)) return ENXIO; - } bzero(devices->name[0], 32); bzero(&devices->params[0], sizeof(struct ata_params)); bzero(devices->name[1], 32); @@ -473,7 +465,6 @@ ata_ioctl(struct cdev *dev, u_long cmd, if (ata_raid_ioctl_func) error = ata_raid_ioctl_func(cmd, data); } - newbus_xunlock(); return error; } @@ -581,7 +572,7 @@ ata_boot_attach(void) struct ata_channel *ch; int ctlr; - newbus_xlock(); + mtx_lock(&Giant); /* newbus suckage it needs Giant */ /* kick of probe and attach on all channels */ for (ctlr = 0; ctlr < devclass_get_maxunit(ata_devclass); ctlr++) { @@ -596,7 +587,8 @@ ata_boot_attach(void) free(ata_delayed_attach, M_TEMP); ata_delayed_attach = NULL; } - newbus_xunlock(); + + mtx_unlock(&Giant); /* newbus suckage dealt with, release Giant */ } @@ -725,6 +717,7 @@ ata_identify(device_t dev) if (bootverbose) device_printf(dev, "Identifying devices: %08x\n", ch->devices); + mtx_lock(&Giant); /* Skip existing devices. */ if (!device_get_children(dev, &children, &nchildren)) { for (i = 0; i < nchildren; i++) { @@ -736,8 +729,10 @@ ata_identify(device_t dev) /* Create new devices. */ if (bootverbose) device_printf(dev, "New devices: %08x\n", n); - if (n == 0) + if (n == 0) { + mtx_unlock(&Giant); return (0); + } for (i = 0; i < ATA_PM; ++i) { if (n & (((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << i))) { int unit = -1; @@ -780,6 +775,7 @@ ata_identify(device_t dev) } bus_generic_probe(dev); bus_generic_attach(dev); + mtx_unlock(&Giant); return 0; } Modified: stable/8/sys/dev/atkbdc/psm.c ============================================================================== --- stable/8/sys/dev/atkbdc/psm.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/atkbdc/psm.c Thu Aug 20 20:23:28 2009 (r196405) @@ -1488,9 +1488,7 @@ psmopen(struct cdev *dev, int flag, int if (sc->state & PSM_OPEN) return (EBUSY); - newbus_xlock(); device_busy(devclass_get_device(psm_devclass, unit)); - newbus_xunlock(); /* Initialize state */ sc->mode.level = sc->dflt_mode.level; @@ -1645,9 +1643,7 @@ psmclose(struct cdev *dev, int flag, int /* close is almost always successful */ sc->state &= ~PSM_OPEN; kbdc_lock(sc->kbdc, FALSE); - newbus_xlock(); device_unbusy(devclass_get_device(psm_devclass, unit)); - newbus_xunlock(); return (0); } Modified: stable/8/sys/dev/bktr/bktr_os.c ============================================================================== --- stable/8/sys/dev/bktr/bktr_os.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/bktr/bktr_os.c Thu Aug 20 20:23:28 2009 (r196405) @@ -597,9 +597,7 @@ bktr_open( struct cdev *dev, int flags, return( ENXIO ); /* Record that the device is now busy */ - newbus_xlock(); device_busy(devclass_get_device(bktr_devclass, unit)); - newbus_xunlock(); if (bt848_card != -1) { @@ -670,11 +668,8 @@ bktr_open( struct cdev *dev, int flags, } /* If there was an error opening the device, undo the busy status */ - if (result != 0) { - newbus_xlock(); + if (result != 0) device_unbusy(devclass_get_device(bktr_devclass, unit)); - newbus_xunlock(); - } return( result ); } @@ -694,7 +689,6 @@ bktr_close( struct cdev *dev, int flags, /* Get the device data */ bktr = (struct bktr_softc*)devclass_get_softc(bktr_devclass, unit); if (bktr == NULL) { - /* the device is no longer valid/functioning */ return (ENXIO); } @@ -711,11 +705,10 @@ bktr_close( struct cdev *dev, int flags, break; default: return (ENXIO); + break; } - newbus_xlock(); device_unbusy(devclass_get_device(bktr_devclass, unit)); - newbus_xunlock(); return( result ); } Modified: stable/8/sys/dev/drm/drm_drv.c ============================================================================== --- stable/8/sys/dev/drm/drm_drv.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/drm/drm_drv.c Thu Aug 20 20:23:28 2009 (r196405) @@ -614,13 +614,11 @@ int drm_open(struct cdev *kdev, int flag if (!retcode) { atomic_inc(&dev->counts[_DRM_STAT_OPENS]); - newbus_xlock(); DRM_LOCK(); device_busy(dev->device); if (!dev->open_count++) retcode = drm_firstopen(dev); DRM_UNLOCK(); - newbus_xunlock(); } return retcode; @@ -634,11 +632,6 @@ void drm_close(void *data) DRM_DEBUG("open_count = %d\n", dev->open_count); - /* - * We require to lock newbus here for handling device_unbusy() and - * avoid a LOR with DRM_LOCK. - */ - newbus_xlock(); DRM_LOCK(); if (dev->driver->preclose != NULL) @@ -715,7 +708,6 @@ void drm_close(void *data) } DRM_UNLOCK(); - newbus_xunlock(); } /* drm_ioctl is called whenever a process performs an ioctl on /dev/drm. Modified: stable/8/sys/dev/ips/ips_pci.c ============================================================================== --- stable/8/sys/dev/ips/ips_pci.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/ips/ips_pci.c Thu Aug 20 20:23:28 2009 (r196405) @@ -173,12 +173,10 @@ ips_intrhook(void *arg) struct ips_softc *sc = (struct ips_softc *)arg; config_intrhook_disestablish(&sc->ips_ich); - newbus_xlock(); if (ips_adapter_init(sc)) ips_pci_free(sc); else sc->configured = 1; - newbus_xunlock(); } static int ips_pci_free(ips_softc_t *sc) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/mfi/mfi.c Thu Aug 20 20:23:28 2009 (r196405) @@ -1327,11 +1327,11 @@ mfi_add_ld_complete(struct mfi_command * mfi_release_command(cm); mtx_unlock(&sc->mfi_io_lock); - newbus_xlock(); + mtx_lock(&Giant); if ((child = device_add_child(sc->mfi_dev, "mfid", -1)) == NULL) { device_printf(sc->mfi_dev, "Failed to add logical disk\n"); free(ld_info, M_MFIBUF); - newbus_xunlock(); + mtx_unlock(&Giant); mtx_lock(&sc->mfi_io_lock); return; } @@ -1339,7 +1339,7 @@ mfi_add_ld_complete(struct mfi_command * device_set_ivars(child, ld_info); device_set_desc(child, "MFI Logical Disk"); bus_generic_attach(sc->mfi_dev); - newbus_xunlock(); + mtx_unlock(&Giant); mtx_lock(&sc->mfi_io_lock); } @@ -1805,9 +1805,9 @@ mfi_check_command_post(struct mfi_softc KASSERT(ld != NULL, ("volume dissappeared")); if (cm->cm_frame->header.cmd_status == MFI_STAT_OK) { mtx_unlock(&sc->mfi_io_lock); - newbus_xlock(); + mtx_lock(&Giant); device_delete_child(sc->mfi_dev, ld->ld_dev); - newbus_xunlock(); + mtx_unlock(&Giant); mtx_lock(&sc->mfi_io_lock); } else mfi_disk_enable(ld); @@ -1815,11 +1815,11 @@ mfi_check_command_post(struct mfi_softc case MFI_DCMD_CFG_CLEAR: if (cm->cm_frame->header.cmd_status == MFI_STAT_OK) { mtx_unlock(&sc->mfi_io_lock); - newbus_xlock(); + mtx_lock(&Giant); TAILQ_FOREACH_SAFE(ld, &sc->mfi_ld_tqh, ld_link, ldn) { device_delete_child(sc->mfi_dev, ld->ld_dev); } - newbus_xunlock(); + mtx_unlock(&Giant); mtx_lock(&sc->mfi_io_lock); } else { TAILQ_FOREACH(ld, &sc->mfi_ld_tqh, ld_link) @@ -1985,9 +1985,7 @@ mfi_ioctl(struct cdev *dev, u_long cmd, adapter = ioc->mfi_adapter_no; if (device_get_unit(sc->mfi_dev) == 0 && adapter != 0) { - newbus_slock(); devclass = devclass_find("mfi"); - newbus_sunlock(); sc = devclass_get_softc(devclass, adapter); } mtx_lock(&sc->mfi_io_lock); @@ -2175,9 +2173,7 @@ out: struct mfi_linux_ioc_packet l_ioc; int adapter; - newbus_slock(); devclass = devclass_find("mfi"); - newbus_sunlock(); if (devclass == NULL) return (ENOENT); @@ -2198,9 +2194,7 @@ out: struct mfi_linux_ioc_aen l_aen; int adapter; - newbus_slock(); devclass = devclass_find("mfi"); - newbus_sunlock(); if (devclass == NULL) return (ENOENT); Modified: stable/8/sys/dev/mlx/mlx.c ============================================================================== --- stable/8/sys/dev/mlx/mlx.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/mlx/mlx.c Thu Aug 20 20:23:28 2009 (r196405) @@ -772,9 +772,7 @@ mlx_ioctl(struct cdev *dev, u_long cmd, * Scan the controller to see whether new drives have appeared. */ case MLX_RESCAN_DRIVES: - newbus_xlock(); mlx_startup(sc); - newbus_xunlock(); return(0); /* Modified: stable/8/sys/dev/mmc/mmc.c ============================================================================== --- stable/8/sys/dev/mmc/mmc.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/mmc/mmc.c Thu Aug 20 20:23:28 2009 (r196405) @@ -1496,9 +1496,7 @@ mmc_delayed_attach(void *xsc) { struct mmc_softc *sc = xsc; - newbus_xlock(); mmc_scan(sc); - newbus_xunlock(); config_intrhook_disestablish(&sc->config_intrhook); } Modified: stable/8/sys/dev/pccbb/pccbb.c ============================================================================== --- stable/8/sys/dev/pccbb/pccbb.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/pccbb/pccbb.c Thu Aug 20 20:23:28 2009 (r196405) @@ -464,7 +464,14 @@ cbb_event_thread(void *arg) sc->flags |= CBB_KTHREAD_RUNNING; while ((sc->flags & CBB_KTHREAD_DONE) == 0) { mtx_unlock(&sc->mtx); - newbus_xlock(); + /* + * We take out Giant here because we need it deep, + * down in the bowels of the vm system for mapping the + * memory we need to read the CIS. In addition, since + * we are adding/deleting devices from the dev tree, + * and that code isn't MP safe, we have to hold Giant. + */ + mtx_lock(&Giant); status = cbb_get(sc, CBB_SOCKET_STATE); DPRINTF(("Status is 0x%x\n", status)); if (!CBB_CARD_PRESENT(status)) { @@ -490,7 +497,7 @@ cbb_event_thread(void *arg) not_a_card = 0; /* We know card type */ cbb_insert(sc); } - newbus_xunlock(); + mtx_unlock(&Giant); /* * First time through we need to tell mountroot that we're Modified: stable/8/sys/dev/pst/pst-iop.c ============================================================================== --- stable/8/sys/dev/pst/pst-iop.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/pst/pst-iop.c Thu Aug 20 20:23:28 2009 (r196405) @@ -152,9 +152,7 @@ iop_attach(void *arg) break; case I2O_CLASS_RANDOM_BLOCK_STORAGE: - newbus_xlock(); pst_add_raid(sc, &sc->lct[i]); - newbus_xunlock(); break; } } Modified: stable/8/sys/dev/rp/rp.c ============================================================================== --- stable/8/sys/dev/rp/rp.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/rp/rp.c Thu Aug 20 20:23:28 2009 (r196405) @@ -903,9 +903,7 @@ rpopen(struct tty *tp) rp_callout_handle = timeout(rp_do_poll, (void *)NULL, POLL_INTERVAL); - newbus_xlock(); device_busy(rp->rp_ctlp->dev); - newbus_xunlock(); return(0); } @@ -916,9 +914,7 @@ rpclose(struct tty *tp) rp = tty_softc(tp); rphardclose(tp); - newbus_xlock(); device_unbusy(rp->rp_ctlp->dev); - newbus_xunlock(); } static void Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Thu Aug 20 20:23:28 2009 (r196405) @@ -7435,7 +7435,6 @@ hdac_attach2(void *arg) quirks_on, quirks_off); ); - newbus_xlock(); hdac_lock(sc); /* Remove ourselves from the config hooks */ @@ -7675,7 +7674,6 @@ hdac_attach2(void *arg) SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, "pindump", CTLTYPE_INT | CTLFLAG_RW, sc->dev, sizeof(sc->dev), sysctl_hdac_pindump, "I", "Dump pin states/data"); - newbus_xunlock(); } /**************************************************************************** Modified: stable/8/sys/dev/twe/twe.c ============================================================================== --- stable/8/sys/dev/twe/twe.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/twe/twe.c Thu Aug 20 20:23:28 2009 (r196405) @@ -294,10 +294,8 @@ twe_init(struct twe_softc *sc) /* * Scan for drives */ - newbus_xlock(); for (i = 0; i < TWE_MAX_UNITS; i++) twe_add_unit(sc, i); - newbus_xunlock(); /* * Initialise connection with controller. @@ -623,15 +621,11 @@ twe_ioctl(struct twe_softc *sc, int ioct break; case TWEIO_ADD_UNIT: - newbus_xlock(); error = twe_add_unit(sc, td->td_unit); - newbus_xunlock(); break; case TWEIO_DEL_UNIT: - newbus_xlock(); error = twe_del_unit(sc, td->td_unit); - newbus_xunlock(); break; /* XXX implement ATA PASSTHROUGH */ Modified: stable/8/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/8/sys/dev/usb/controller/usb_controller.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/usb/controller/usb_controller.c Thu Aug 20 20:23:28 2009 (r196405) @@ -143,7 +143,9 @@ usb_attach(device_t dev) } if (usb_post_init_called) { + mtx_lock(&Giant); usb_attach_sub(dev, bus); + mtx_unlock(&Giant); usb_needs_explore(bus, 1); } return (0); /* return success */ @@ -226,13 +228,20 @@ usb_bus_explore(struct usb_proc_msg *pm) } USB_BUS_UNLOCK(bus); + mtx_lock(&Giant); + /* * First update the USB power state! */ usb_bus_powerd(bus); - - /* Explore the Root USB HUB. */ + /* + * Explore the Root USB HUB. This call can sleep, + * exiting Giant, which is actually Giant. + */ (udev->hub->explore) (udev); + + mtx_unlock(&Giant); + USB_BUS_LOCK(bus); } if (bus->bus_roothold != NULL) { @@ -260,7 +269,7 @@ usb_bus_detach(struct usb_proc_msg *pm) device_set_softc(dev, NULL); USB_BUS_UNLOCK(bus); - newbus_xlock(); + mtx_lock(&Giant); /* detach children first */ bus_generic_detach(dev); @@ -272,7 +281,7 @@ usb_bus_detach(struct usb_proc_msg *pm) usb_free_device(udev, USB_UNCFG_FLAG_FREE_EP0); - newbus_xunlock(); + mtx_unlock(&Giant); USB_BUS_LOCK(bus); /* clear bdev variable last */ bus->bdev = NULL; @@ -341,7 +350,7 @@ usb_bus_attach(struct usb_proc_msg *pm) } USB_BUS_UNLOCK(bus); - newbus_xlock(); + mtx_lock(&Giant); /* XXX not required by USB */ /* default power_mask value */ bus->hw_power_state = @@ -374,7 +383,7 @@ usb_bus_attach(struct usb_proc_msg *pm) err = USB_ERR_NOMEM; } - newbus_xunlock(); + mtx_unlock(&Giant); USB_BUS_LOCK(bus); if (err) { @@ -463,7 +472,7 @@ usb_post_init(void *arg) int max; int n; - newbus_xlock(); + mtx_lock(&Giant); usb_devclass_ptr = devclass_find("usbus"); @@ -474,8 +483,11 @@ usb_post_init(void *arg) dev = devclass_get_device(dc, n); if (dev && device_is_attached(dev)) { bus = device_get_ivars(dev); - if (bus) + if (bus) { + mtx_lock(&Giant); usb_attach_sub(dev, bus); + mtx_unlock(&Giant); + } } } } else { @@ -487,7 +499,7 @@ usb_post_init(void *arg) usb_needs_explore_all(); - newbus_xunlock(); + mtx_unlock(&Giant); } SYSINIT(usb_post_init, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, usb_post_init, NULL); Modified: stable/8/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/8/sys/dev/usb/input/ukbd.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/usb/input/ukbd.c Thu Aug 20 20:23:28 2009 (r196405) @@ -745,7 +745,7 @@ ukbd_attach(device_t dev) uint16_t n; uint16_t hid_len; - mtx_lock(&Giant); + mtx_assert(&Giant, MA_OWNED); kbd_init_struct(kbd, UKBD_DRIVER_NAME, KB_OTHER, unit, 0, 0, 0); @@ -854,6 +854,9 @@ ukbd_attach(device_t dev) if (bootverbose) { genkbd_diag(kbd, bootverbose); } + /* lock keyboard mutex */ + + mtx_lock(&Giant); /* start the keyboard */ @@ -876,7 +879,7 @@ ukbd_detach(device_t dev) struct ukbd_softc *sc = device_get_softc(dev); int error; - mtx_lock(&Giant); + mtx_assert(&Giant, MA_OWNED); DPRINTF("\n"); @@ -913,8 +916,6 @@ ukbd_detach(device_t dev) usb_callout_drain(&sc->sc_callout); - mtx_unlock(&Giant); - DPRINTF("%s: disconnected\n", device_get_nameunit(dev)); @@ -926,9 +927,9 @@ ukbd_resume(device_t dev) { struct ukbd_softc *sc = device_get_softc(dev); - mtx_lock(&Giant); + mtx_assert(&Giant, MA_OWNED); + ukbd_clear_state(&sc->sc_kbd); - mtx_unlock(&Giant); return (0); } Modified: stable/8/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- stable/8/sys/dev/usb/net/usb_ethernet.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/usb/net/usb_ethernet.c Thu Aug 20 20:23:28 2009 (r196405) @@ -221,10 +221,10 @@ ue_attach_post_task(struct usb_proc_msg if (ue->ue_methods->ue_mii_upd != NULL && ue->ue_methods->ue_mii_sts != NULL) { - newbus_xlock(); + mtx_lock(&Giant); /* device_xxx() depends on this */ error = mii_phy_probe(ue->ue_dev, &ue->ue_miibus, ue_ifmedia_upd, ue->ue_methods->ue_mii_sts); - newbus_xunlock(); + mtx_unlock(&Giant); if (error) { device_printf(ue->ue_dev, "MII without any PHY\n"); goto error; @@ -279,12 +279,9 @@ uether_ifdetach(struct usb_ether *ue) /* detach miibus */ if (ue->ue_miibus != NULL) { - - /* - * It is up to the callers to provide the correct - * newbus locking. - */ + mtx_lock(&Giant); /* device_xxx() depends on this */ device_delete_child(ue->ue_dev, ue->ue_miibus); + mtx_unlock(&Giant); } /* detach ethernet */ Modified: stable/8/sys/dev/usb/usb_compat_linux.c ============================================================================== --- stable/8/sys/dev/usb/usb_compat_linux.c Thu Aug 20 19:23:58 2009 (r196404) +++ stable/8/sys/dev/usb/usb_compat_linux.c Thu Aug 20 20:23:28 2009 (r196405) @@ -215,12 +215,14 @@ usb_linux_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) { return (ENXIO); } + mtx_lock(&Giant); LIST_FOREACH(udrv, &usb_linux_driver_list, linux_driver_list) { if (usb_linux_lookup_id(udrv->id_table, uaa)) { err = 0; break; } } + mtx_unlock(&Giant); return (err); } @@ -237,7 +239,9 @@ usb_linux_get_usb_driver(struct usb_linu { struct usb_driver *udrv; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 20 20:53:37 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 197B8106568C; Thu, 20 Aug 2009 20:53:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E01BB8FC16; Thu, 20 Aug 2009 20:53:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7KKraRr099110; Thu, 20 Aug 2009 20:53:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7KKraKs099106; Thu, 20 Aug 2009 20:53:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908202053.n7KKraKs099106@svn.freebsd.org> From: John Baldwin Date: Thu, 20 Aug 2009 20:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196406 - in stable/8: share/man/man9 sys sys/amd64/include/xen sys/cddl/contrib/opensolaris sys/contrib/dev/acpica sys/contrib/pf sys/dev/xen/xenpci sys/kern sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2009 20:53:37 -0000 Author: jhb Date: Thu Aug 20 20:53:36 2009 New Revision: 196406 URL: http://svn.freebsd.org/changeset/base/196406 Log: MFC 196404: Change the 'resid' parameter to sglist_consume_uio() from an int to a size_t to match the recent type change of the uio_resid member of struct uio. Approved by: re (kib) Modified: stable/8/share/man/man9/ (props changed) stable/8/share/man/man9/sglist.9 stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/subr_sglist.c stable/8/sys/sys/sglist.h Modified: stable/8/share/man/man9/sglist.9 ============================================================================== --- stable/8/share/man/man9/sglist.9 Thu Aug 20 20:23:28 2009 (r196405) +++ stable/8/share/man/man9/sglist.9 Thu Aug 20 20:53:36 2009 (r196406) @@ -70,7 +70,7 @@ .Ft struct sglist * .Fn sglist_clone "struct sglist *sg" "int mflags" .Ft int -.Fn sglist_consume_uio "struct sglist *sg" "struct uio *uio" "int resid" +.Fn sglist_consume_uio "struct sglist *sg" "struct uio *uio" "size_t resid" .Ft int .Fn sglist_count "void *buf" "size_t len" .Ft void Modified: stable/8/sys/kern/subr_sglist.c ============================================================================== --- stable/8/sys/kern/subr_sglist.c Thu Aug 20 20:23:28 2009 (r196405) +++ stable/8/sys/kern/subr_sglist.c Thu Aug 20 20:53:36 2009 (r196406) @@ -315,7 +315,7 @@ sglist_append_uio(struct sglist *sg, str * segments, then only the amount that fits is appended. */ int -sglist_consume_uio(struct sglist *sg, struct uio *uio, int resid) +sglist_consume_uio(struct sglist *sg, struct uio *uio, size_t resid) { struct iovec *iov; size_t done; Modified: stable/8/sys/sys/sglist.h ============================================================================== --- stable/8/sys/sys/sglist.h Thu Aug 20 20:23:28 2009 (r196405) +++ stable/8/sys/sys/sglist.h Thu Aug 20 20:53:36 2009 (r196406) @@ -91,7 +91,7 @@ int sglist_append_user(struct sglist *sg struct thread *td); struct sglist *sglist_build(void *buf, size_t len, int mflags); struct sglist *sglist_clone(struct sglist *sg, int mflags); -int sglist_consume_uio(struct sglist *sg, struct uio *uio, int resid); +int sglist_consume_uio(struct sglist *sg, struct uio *uio, size_t resid); int sglist_count(void *buf, size_t len); void sglist_free(struct sglist *sg); int sglist_join(struct sglist *first, struct sglist *second); From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 20 21:14:53 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21CB61065690; Thu, 20 Aug 2009 21:14:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EB6E8FC3D; Thu, 20 Aug 2009 21:14:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7KLEqF6099613; Thu, 20 Aug 2009 21:14:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7KLEqVU099611; Thu, 20 Aug 2009 21:14:52 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908202114.n7KLEqVU099611@svn.freebsd.org> From: Robert Watson Date: Thu, 20 Aug 2009 21:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196407 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2009 21:14:53 -0000 Author: rwatson Date: Thu Aug 20 21:14:52 2009 New Revision: 196407 URL: http://svn.freebsd.org/changeset/base/196407 Log: Merge r196263 from head to stable/8: Remove unused if_rawoutput() macro; it has been unused since at least FreeBSD 2. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/if_var.h Modified: stable/8/sys/net/if_var.h ============================================================================== --- stable/8/sys/net/if_var.h Thu Aug 20 20:53:36 2009 (r196406) +++ stable/8/sys/net/if_var.h Thu Aug 20 21:14:52 2009 (r196407) @@ -235,7 +235,6 @@ typedef void if_init_f_t(void *); #define if_iqdrops if_data.ifi_iqdrops #define if_noproto if_data.ifi_noproto #define if_lastchange if_data.ifi_lastchange -#define if_rawoutput(if, m, sa) if_output(if, m, sa, (struct rtentry *)NULL) /* for compatibility with other BSDs */ #define if_addrlist if_addrhead From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 20 21:29:49 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 990E8106568E; Thu, 20 Aug 2009 21:29:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84F908FC57; Thu, 20 Aug 2009 21:29:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7KLTnmD099973; Thu, 20 Aug 2009 21:29:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7KLTnCi099970; Thu, 20 Aug 2009 21:29:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908202129.n7KLTnCi099970@svn.freebsd.org> From: Robert Watson Date: Thu, 20 Aug 2009 21:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196408 - in stable/8: share/man/man4 sys sys/amd64/include/xen sys/cddl/contrib/opensolaris sys/contrib/dev/acpica sys/contrib/pf sys/dev/xen/xenpci sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2009 21:29:49 -0000 Author: rwatson Date: Thu Aug 20 21:29:49 2009 New Revision: 196408 URL: http://svn.freebsd.org/changeset/base/196408 Log: Merge r196267 from head to stable/8: Rather than fix questionable ifnet list locking in the implementation of the kern.polling.enable sysctl, remove the sysctl. It has been deprecated since FreeBSD 6 in favour of per-ifnet polling flags. Reviewed by: luigi Approved by: re (kib) Modified: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/polling.4 stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/kern_poll.c Modified: stable/8/share/man/man4/polling.4 ============================================================================== --- stable/8/share/man/man4/polling.4 Thu Aug 20 21:14:52 2009 (r196407) +++ stable/8/share/man/man4/polling.4 Thu Aug 20 21:29:49 2009 (r196408) @@ -87,6 +87,16 @@ feature. It is turned on and off with help of .Xr ifconfig 8 command. +.Pp +The historic +.Va kern.polling.enable , +which enabled polling for all interfaces, can be replaced with the following +code: +.Bd -literal +for i in `ifconfig -l` ; + do ifconfig $i polling; # use -polling to disable +done +.Ed .Ss MIB Variables The operation of .Nm @@ -156,15 +166,6 @@ Default is 20. How many active devices have registered for .Nm . .Pp -.It Va kern.polling.enable -Legacy MIB, that was used to enable or disable polling globally. -Currently if set to 1, -.Nm -is enabled on all capable interfaces. -If set to 0, -.Nm -is disabled on all interfaces. -.Pp .It Va kern.polling.short_ticks .It Va kern.polling.lost_polls .It Va kern.polling.pending_polls Modified: stable/8/sys/kern/kern_poll.c ============================================================================== --- stable/8/sys/kern/kern_poll.c Thu Aug 20 21:14:52 2009 (r196407) +++ stable/8/sys/kern/kern_poll.c Thu Aug 20 21:29:49 2009 (r196408) @@ -46,8 +46,6 @@ __FBSDID("$FreeBSD$"); #include /* for NETISR_POLL */ #include -static int poll_switch(SYSCTL_HANDLER_ARGS); - void hardclock_device_poll(void); /* hook from hardclock */ static struct mtx poll_mtx; @@ -230,10 +228,6 @@ static uint32_t poll_handlers; /* next f SYSCTL_UINT(_kern_polling, OID_AUTO, handlers, CTLFLAG_RD, &poll_handlers, 0, "Number of registered poll handlers"); -static int polling = 0; -SYSCTL_PROC(_kern_polling, OID_AUTO, enable, CTLTYPE_UINT | CTLFLAG_RW, - 0, sizeof(int), poll_switch, "I", "Switch polling for all interfaces"); - static uint32_t phase; SYSCTL_UINT(_kern_polling, OID_AUTO, phase, CTLFLAG_RD, &phase, 0, "Polling phase"); @@ -538,49 +532,6 @@ ether_poll_deregister(struct ifnet *ifp) return (0); } -/* - * Legacy interface for turning polling on all interfaces at one time. - */ -static int -poll_switch(SYSCTL_HANDLER_ARGS) -{ - struct ifnet *ifp; - int error; - int val = polling; - - error = sysctl_handle_int(oidp, &val, 0, req); - if (error || !req->newptr ) - return (error); - - if (val == polling) - return (0); - - if (val < 0 || val > 1) - return (EINVAL); - - polling = val; - - IFNET_RLOCK(); - TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (ifp->if_capabilities & IFCAP_POLLING) { - struct ifreq ifr; - - if (val == 1) - ifr.ifr_reqcap = - ifp->if_capenable | IFCAP_POLLING; - else - ifr.ifr_reqcap = - ifp->if_capenable & ~IFCAP_POLLING; - (void) (*ifp->if_ioctl)(ifp, SIOCSIFCAP, (caddr_t)&ifr); - } - } - IFNET_RUNLOCK(); - - log(LOG_ERR, "kern.polling.enable is deprecated. Use ifconfig(8)"); - - return (0); -} - static void poll_idle(void) { From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 20 22:56:29 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D65F106568B; Thu, 20 Aug 2009 22:56:29 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A09D8FC3D; Thu, 20 Aug 2009 22:56:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7KMuTfx002232; Thu, 20 Aug 2009 22:56:29 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7KMuTQR002228; Thu, 20 Aug 2009 22:56:29 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200908202256.n7KMuTQR002228@svn.freebsd.org> From: Marko Zec Date: Thu, 20 Aug 2009 22:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196411 - stable/8/tools/tools/vimage X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2009 22:56:29 -0000 Author: zec Date: Thu Aug 20 22:56:29 2009 New Revision: 196411 URL: http://svn.freebsd.org/changeset/base/196411 Log: MFC r196409: vimage(8) is a legacy CLI interface for managing jails associated with network stack instances, which is provided for compatibility with older applications. This change brings it back to life in a followup to the initial conversion of vimage to use the new jail(4) userland-kernel API: - when creating vimages via "vimage -c", by default turn on a few options expected by legacy applications, such as allow operations on raw sockets, FS mounts etc, and allow jail-related parameters to be optionally configured. - introduce the "-m" modifier which allows for configuring jail parameters of existing vimages / vnet-jails. - make "vimage name command ..." actually work. - when reassigning ifnets to vnets using "vimage -i", attempt to rename the ifnet as "ethXXX" on arrival in the target vnet. Several legacy applications are known to depend heavily on such behavior. - vimage -l lists only jails associated with vnets. The output is sorted using vimage / jail names as keys. - vimage -l by default searches only the current level in the jail hierarchy. Recursive listing can be requested via -r switch. - vimage -l by default prints only jail names on each line, making such output suitable for pipelining to other commands. More verbose output can be obtained via -v switch, and even more jail specific information will be displayed if -j switch is turned on. - there's no need to build vimage as statically linked, so update the Makefile accordingly. - update the vimage.8 man page. Approved by: re (rwatson), julian (mentor) Approved by: re (rwatson) Modified: stable/8/tools/tools/vimage/ (props changed) stable/8/tools/tools/vimage/Makefile stable/8/tools/tools/vimage/vimage.8 stable/8/tools/tools/vimage/vimage.c Modified: stable/8/tools/tools/vimage/Makefile ============================================================================== --- stable/8/tools/tools/vimage/Makefile Thu Aug 20 22:53:28 2009 (r196410) +++ stable/8/tools/tools/vimage/Makefile Thu Aug 20 22:56:29 2009 (r196411) @@ -10,6 +10,5 @@ CFLAGS+= -I../../../sys MAN= vimage.8 BINDIR?= /usr/sbin -NO_SHARED?= YES .include Modified: stable/8/tools/tools/vimage/vimage.8 ============================================================================== --- stable/8/tools/tools/vimage/vimage.8 Thu Aug 20 22:53:28 2009 (r196410) +++ stable/8/tools/tools/vimage/vimage.8 Thu Aug 20 22:56:29 2009 (r196411) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2002, 2003 Marko Zec +.\" Copyright (c) 2002, 2003 Marko Zec .\" Copyright (c) 2009 University of Zagreb .\" Copyright (c) 2009 FreeBSD Foundation .\" @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2009 +.Dd August 25, 2009 .Dt VIMAGE 8 .Os .Sh NAME @@ -35,35 +35,46 @@ .Nd manage virtual network stacks .Sh SYNOPSIS .Nm -.Ar vi_name -.Op command -.Nm -.Fl c -.Ar vi_name +.Op Fl c | m +.Ar vname +.Op Ar param=value ... .Nm .Fl d -.Ar vi_name +.Ar vname .Nm .Fl l -.Op Ar vi_name +.Op Fl rvj +.Op Ar vname .Nm .Fl i -.Ar vi_name interface +.Ar vname ifname +.Op Ar newifname +.Nm +.Ar vi_name +.Op command ... .Sh DESCRIPTION +The .Nm -command is an interm user interface for controlling the virtual network -stacks in FreeBSD. +utility is an alternative user interface for controlling virtual network +stacks in FreeBSD, aimed primarily at supporting legacy applications +which are not yet converted to using +.Xr jail 8 , +.Xr jexec 8 , +and +.Xr jls 8 . +. .Ss Overview -A virtual image reprepresents an isolated operating environment with its -own independent network stack instance. Every process, socket and network -interface present in the system is always attached to one, and only one, -virtual image i.e. virtual network stack instance. -During the system bootup sequence default virtual image is created to -which all the configured interfaces and user processes are initially -assigned. -Assuming that enough system resources and per virtual image privileges -are provided, the super-user can create and manage a hierarchy of -subordinated virtual images. The +A virtual image or vimage is a jail with its own independent network +stack instance. Every process, socket and network interface present +in the system is always attached to one, and only one, virtual network +stack instance (vnet). +During system bootup sequence a default vnet +is created to which all the configured interfaces and user processes +are initially attached. +Assuming that enough system resources are +are available, a user with sufficient privileges can create and manage +a hierarchy of subordinated virtual images. +The .Nm command allows for creation, deletion and monitoring of virtual images, as well as for execution of arbitrary processes in a targeted virtual @@ -71,59 +82,72 @@ image. .Ss Invocation If invoked with no modifiers, the .Nm -command spawns a new shell process in virtual image -.Ar vi_name . -If provided, the optional arguments following the virtual image name -.Ar vi_name -are interpreted as a standard command line issued at a shell, -otherwise an interactive shell is started in the target virtual image. +command spawns a new interactive shell in virtual image +.Ar vname . +If optional additional arguments following +.Ar vname +are provided, the first of those will be executed in place of the +interactive shell, and the rest of the arguments will be passed as +arguments to the executed command. .Pp -The following parameters are available: +The following modifiers are available: .Bl -tag -width indent .It Fl c Create a new virtual image named -.So -.Ar vi_name -.Sc . +.Ar vname . +Additional arguments, if provided, may be used to specify operating +parameters different from defaults, in format +.Ar param=value . +See +.Xr jail 8 +for an extensive list of available parameters. +.It Fl m +Modify the parameters of a virtual image named +.Ar vname , +using the same syntax as with the -c form of the command. .It Fl d Delete the virtual image -.Ar vi_name . +.Ar vname . No processes and/or sockets should exist in the target virtual image -in order for the delete request to succeed. Non-loopback interfaces +in order for the delete request to succeed. Non-loopback interfaces residing in the target virtual image will be reassigned to the virtual image's parent. .It Fl l List the properties and statistics for virtual images one level below the current one in the hierarchy. If an optional argument -.Ar vi_name +.Ar vname is provided, only the information regarding the target virtual image -.Ar vi_name +.Ar vname is displayed. -.It Fl lr -List the properties and statistics for all virtual images in -the hierarchy of subordinated vimages. If an optional argument -.Ar vi_name -is provided, the hierarchy will be traversed at and below the -.Ar vi_name -level. +With the optional +.Op Ar -r +switch enabled the list will include all virtual images below the +current level in the vimage hierarchy. +Enabling the optional +.Op Ar -v +or +.Op Ar -j +switches results in a more detailed output. .It Fl i -Move the interface -.Ar interface +Move interface +.Ar ifname to the target virtual image -.Ar vi_name . -If the value of -.Ar vi_name -argument is -.So .. +.Ar vname . +Interfaces will be automatically renamed to +.So +ethXX .Sc , -the interface is returned to the parent of the current virtual image. +unless an optional argument specifying the desired interface name +.Op Ar newifname +is provided. .El .Sh EXAMPLES Create a new virtual image named .So v1 -.Sc : +.Sc , +which is allowed to create and manage an own subhierarchy of vimages: .Pp -.Dl vimage -c v1 +.Dl vimage -c v1 children.max=100 .Pp Execute the .So ifconfig @@ -137,28 +161,35 @@ Move the interface .So vlan0 .Sc to the virtual image .So v1 +.Sc while renaming the interface as +.So +ve0 .Sc : .Pp -.Dl vimage -i v1 vlan0 +.Dl vimage -i v1 vlan0 ve0 .Pp Show the status information for virtual image .So v1 .Sc : .Pp -.Dl vimage -l v1 +.Dl vimage -lv v1 .Sh DIAGNOSTICS The .Nm command exits 0 on success, and >0 if an error occurs. .Sh SEE ALSO .Xr jail 8 +.Xr jexec 8 +.Xr jls 8 .Sh BUGS -If memory allocation failure occurs during the vimage creation, it will remain -undetected/ignored in the current implementation, thus latently scheduling -an almost imminent system crash in the future. +Deletion of vimages / vnets is known to leak kernel memory and fail at +stopping various timers, hence may lead to system crashes. .Sh AUTHOR .An "Marko Zec" Aq zec@fer.hr .Sh HISTORY -The -.Nm -facility first appeared as a patch against FreeBSD 4.7-RELEASE in 2002. +Network stack virtualization framework first appeared as a patchset +against the FreeBSD 4.7 kernel in 2002, and was maintained outside +of the main FreeBSD tree. +As a result of a project sponsored by the FreeBSD Foundation and +Stiching NLNet, integrated virtualized network stack first appeared +in FreeBSD 8.0. Modified: stable/8/tools/tools/vimage/vimage.c ============================================================================== --- stable/8/tools/tools/vimage/vimage.c Thu Aug 20 22:53:28 2009 (r196410) +++ stable/8/tools/tools/vimage/vimage.c Thu Aug 20 22:56:29 2009 (r196411) @@ -28,142 +28,294 @@ */ #include -#include #include #include #include #include -#include +#include #include #include #include #include #include -#define VI_CREATE 0x00000001 -#define VI_DESTROY 0x00000002 -#define VI_SWITCHTO 0x00000008 -#define VI_IFACE 0x00000010 -#define VI_GET 0x00000100 -#define VI_GETNEXT 0x00000200 +typedef enum { + VI_SWITCHTO, + VI_CREATE, + VI_MODIFY, + VI_DESTROY, + VI_IFMOVE, + VI_GET +} vi_cmd_t; + +typedef struct vimage_status { + char name[MAXPATHLEN]; /* Must be first field for strcmp(). */ + char path[MAXPATHLEN]; + char hostname[MAXPATHLEN]; + char domainname[MAXPATHLEN]; + int jid; + int parentjid; + int vnet; + int childcnt; + int childmax; + int cpuset; + int rawsock; + int socket_af; + int mount; +} vstat_t; + +#define VST_SIZE_STEP 1024 +#define MAXPARAMS 32 + +static int getjail(vstat_t *, int, int); + +static char *invocname; + +static void +usage(void) +{ -static int getjail(char *name, int lastjid, int *vnet); + fprintf(stderr, + "usage: %s [-c | -m] vname [param=value ...]\n" + " %s -d vname\n" + " %s -l[rvj] [vname]\n" + " %s -i vname ifname [newifname]\n" + " %s vname [command ...]\n", + invocname, invocname, invocname, invocname, invocname); + exit(1); +} int main(int argc, char **argv) { - int s; - char *shell; - int cmd; - int jid, vnet; + struct jailparam params[MAXPARAMS]; + char ifname[IFNAMSIZ]; struct ifreq ifreq; - char name[MAXHOSTNAMELEN]; - - switch (argc) { - - case 1: - cmd = 0; - break; - - case 2: - if (strcmp(argv[1], "-l") == 0) - cmd = VI_GETNEXT; - else if (strcmp(argv[1], "-lr") == 0) - cmd = VI_GETNEXT; - else { - strcpy(name, argv[1]); - cmd = VI_SWITCHTO; + vi_cmd_t newcmd, cmd; + int recurse = 0; + int verbose = 0; + int jid, i, s, namelen; + int vst_size, vst_last; + vstat_t *vst; + char *str; + char ch; + + invocname = argv[0]; + + newcmd = cmd = VI_SWITCHTO; /* Default if no modifiers specified. */ + while ((ch = getopt(argc, argv, "cdijlmrv")) != -1) { + switch (ch) { + case 'c': + newcmd = VI_CREATE; + break; + case 'm': + newcmd = VI_MODIFY; + break; + case 'd': + newcmd = VI_DESTROY; + break; + case 'l': + newcmd = VI_GET; + break; + case 'i': + newcmd = VI_IFMOVE; + break; + case 'r': + recurse = 1; + break; + case 'v': + verbose++; + break; + case 'j': + verbose = 2; + break; + default: + usage(); } - break; - - case 3: - strcpy(name, argv[2]); - if (strcmp(argv[1], "-l") == 0) - cmd = VI_GET; - if (strcmp(argv[1], "-c") == 0) - cmd = VI_CREATE; - if (strcmp(argv[1], "-d") == 0) - cmd = VI_DESTROY; - break; - - default: - strcpy(name, argv[2]); - if (strcmp(argv[1], "-c") == 0) - cmd = VI_CREATE; - if (strcmp(argv[1], "-i") == 0) - cmd = VI_IFACE; + if (cmd == VI_SWITCHTO || cmd == newcmd) + cmd = newcmd; + else + usage(); } + argc -= optind; + argv += optind; - switch (cmd) { + if ((cmd != VI_GET && (argc == 0 || recurse != 0 || verbose != 0)) || + (cmd == VI_IFMOVE && (argc < 2 || argc > 3)) || + (cmd == VI_MODIFY && argc < 2) || argc >= MAXPARAMS) + usage(); + switch (cmd) { case VI_GET: - jid = getjail(name, -1, &vnet); - if (jid < 0) - goto abort; - printf("%d: %s%s\n", jid, name, vnet ? "" : " (no vnet)"); - exit(0); - - case VI_GETNEXT: + vst_last = 0; + vst_size = VST_SIZE_STEP; + if ((vst = malloc(vst_size * sizeof(*vst))) == NULL) + break; + if (argc == 1) + namelen = strlen(argv[0]); + else + namelen = 0; jid = 0; - while ((jid = getjail(name, jid, &vnet)) > 0) - printf("%d: %s%s\n", jid, name, - vnet ? "" : " (no vnet)"); + while ((jid = getjail(&vst[vst_last], jid, verbose)) > 0) { + /* Skip jails which do not own vnets. */ + if (vst[vst_last].vnet != 1) + continue; + /* Skip non-matching vnames / hierarchies. */ + if (namelen && + ((strlen(vst[vst_last].name) < namelen || + strncmp(vst[vst_last].name, argv[0], namelen) != 0) + || (strlen(vst[vst_last].name) > namelen && + vst[vst_last].name[namelen] != '.'))) + continue; + /* Skip any sub-trees if -r not requested. */ + if (!recurse && + (strlen(vst[vst_last].name) < namelen || + strchr(&vst[vst_last].name[namelen], '.') != NULL)) + continue; + /* Grow vst table if necessary. */ + if (++vst_last == vst_size) { + vst_size += VST_SIZE_STEP; + vst = realloc(vst, vst_size * sizeof(*vst)); + if (vst == NULL) + break; + } + } + if (vst == NULL) + break; + /* Sort: the key is the 1st field in *vst, i.e. vimage name. */ + qsort(vst, vst_last, sizeof(*vst), (void *) strcmp); + for (i = 0; i < vst_last; i++) { + if (!verbose) { + printf("%s\n", vst[i].name); + continue; + } + + printf("%s:\n", vst[i].name); + printf(" Path: %s\n", vst[i].path); + printf(" Hostname: %s\n", vst[i].hostname); + printf(" Domainname: %s\n", vst[i].domainname); + printf(" Children: %d\n", vst[i].childcnt); + + if (verbose < 2) + continue; + + printf(" Children limit: %d\n", vst[i].childmax); + printf(" CPUsetID: %d\n", vst[i].cpuset); + printf(" JID: %d\n", vst[i].jid); + printf(" PJID: %d\n", vst[i].parentjid); + printf(" Raw sockets allowed: %d\n", vst[i].rawsock); + printf(" All AF allowed: %d\n", vst[i].socket_af); + printf(" Mount allowed: %d\n", vst[i].mount); + } + free(vst); exit(0); - case VI_IFACE: - s = socket(AF_INET, SOCK_DGRAM, 0); - if (s == -1) - goto abort; - jid = jail_getid(name); - if (jid < 0) - goto abort; + case VI_IFMOVE: + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) + break; + if ((jid = jail_getid(argv[0])) < 0) + break; ifreq.ifr_jid = jid; - strncpy(ifreq.ifr_name, argv[3], sizeof(ifreq.ifr_name)); + strncpy(ifreq.ifr_name, argv[1], sizeof(ifreq.ifr_name)); if (ioctl(s, SIOCSIFVNET, (caddr_t)&ifreq) < 0) - goto abort; - printf("%s@%s\n", ifreq.ifr_name, name); + break; + close(s); + if (argc == 3) + snprintf(ifname, sizeof(ifname), "%s", argv[2]); + else + snprintf(ifname, sizeof(ifname), "eth0"); + ifreq.ifr_data = ifname; + /* Do we need to rename the ifnet? */ + if (strcmp(ifreq.ifr_name, ifname) != 0) { + /* Switch to the context of the target vimage. */ + if (jail_attach(jid) < 0) + break; + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) + break; + for (namelen = 0; isalpha(ifname[namelen]); namelen++); + i = 0; + /* Search for a free ifunit in target vnet. Unsafe. */ + while (ioctl(s, SIOCSIFNAME, (caddr_t)&ifreq) < 0) { + snprintf(&ifname[namelen], + sizeof(ifname) - namelen, "%d", i); + /* Emergency brake. */ + if (i++ == IF_MAXUNIT) + break; + } + } + if (i < IF_MAXUNIT) + printf("%s@%s\n", ifname, argv[0]); + else + printf("%s@%s\n", ifreq.ifr_name, argv[0]); exit(0); case VI_CREATE: - if (jail_setv(JAIL_CREATE, "name", name, "vnet", NULL, - "host", NULL, "persist", NULL, NULL) < 0) - goto abort; + if ((jid = jail_setv(JAIL_CREATE, + "name", argv[0], + "vnet", NULL, + "host", NULL, + "persist", NULL, + "allow.raw_sockets", "true", + "allow.socket_af", "true", + "allow.mount", "true", + NULL)) >= 0) + break; + if (jid < 0) + break; + if (argc == 1) + exit(0); + /* Not done yet, proceed to apply non-default parameters. */ + + case VI_MODIFY: + jailparam_init(¶ms[0], "name"); + jailparam_import(¶ms[0], argv[0]); + for (i = 1; i < argc; i++) { + for (str = argv[i]; *str != '=' && *str != 0; str++) { + /* Do nothing - search for '=' delimeter. */ + } + if (*str == 0) + break; + *str++ = 0; + if (*str == 0) + break; + jailparam_init(¶ms[i], argv[i]); + jailparam_import(¶ms[i], str); + } + if (i != argc) + break; + if (jailparam_set(params, i, JAIL_UPDATE) < 0) + break; + exit(0); + + case VI_DESTROY: + if ((jid = jail_getid(argv[0])) < 0) + break; + if (jail_remove(jid) < 0) + break; exit(0); case VI_SWITCHTO: - jid = jail_getid(name); - if (jid < 0) - goto abort; + if ((jid = jail_getid(argv[0])) < 0) + break; if (jail_attach(jid) < 0) - goto abort; - - if (argc == 2) { - printf("Switched to jail %s\n", argv[1]); - if ((shell = getenv("SHELL")) == NULL) - execlp("/bin/sh", argv[0], NULL); + break; + if (argc == 1) { + printf("Switched to vimage %s\n", argv[0]); + if ((str = getenv("SHELL")) == NULL) + execlp("/bin/sh", invocname, NULL); else - execlp(shell, argv[0], NULL); + execlp(str, invocname, NULL); } else - execvp(argv[2], &argv[2]); + execvp(argv[1], &argv[1]); break; - case VI_DESTROY: - jid = jail_getid(name); - if (jid < 0) - goto abort; - if (jail_remove(jid) < 0) - goto abort; - exit(0); - default: - fprintf(stderr, "usage: %s [-cdilr] vi_name [args]\n", - argv[0]); - exit(1); + /* Should be unreachable. */ + break; } -abort: if (jail_errmsg[0]) fprintf(stderr, "Error: %s\n", jail_errmsg); else @@ -172,27 +324,69 @@ abort: } static int -getjail(char *name, int lastjid, int *vnet) +getjail(vstat_t *vs, int lastjid, int verbose) { - struct jailparam params[3]; - int jid; + struct jailparam params[32]; /* Must be > max(psize). */ + int psize = 0; - if (lastjid < 0) { - jid = jail_getid(name); - if (jid < 0) - return (jid); - jailparam_init(¶ms[0], "jid"); - jailparam_import_raw(¶ms[0], &jid, sizeof jid); - } else { - jailparam_init(¶ms[0], "lastjid"); - jailparam_import_raw(¶ms[0], &lastjid, sizeof lastjid); - } - jailparam_init(¶ms[1], "name"); - jailparam_import_raw(¶ms[1], name, MAXHOSTNAMELEN); - name[0] = 0; - jailparam_init(¶ms[2], "vnet"); - jailparam_import_raw(¶ms[2], vnet, sizeof(*vnet)); - jid = jailparam_get(params, 3, 0); - jailparam_free(params, 3); - return (jid); + bzero(params, sizeof(params)); + bzero(vs, sizeof(*vs)); + + jailparam_init(¶ms[psize], "lastjid"); + jailparam_import_raw(¶ms[psize++], &lastjid, sizeof lastjid); + + jailparam_init(¶ms[psize], "vnet"); + jailparam_import_raw(¶ms[psize++], &vs->vnet, sizeof(vs->vnet)); + + jailparam_init(¶ms[psize], "name"); + jailparam_import_raw(¶ms[psize++], &vs->name, sizeof(vs->name)); + + if (verbose == 0) + goto done; + + jailparam_init(¶ms[psize], "path"); + jailparam_import_raw(¶ms[psize++], &vs->path, sizeof(vs->path)); + + jailparam_init(¶ms[psize], "host.hostname"); + jailparam_import_raw(¶ms[psize++], &vs->hostname, + sizeof(vs->hostname)); + + jailparam_init(¶ms[psize], "host.domainname"); + jailparam_import_raw(¶ms[psize++], &vs->domainname, + sizeof(vs->domainname)); + + jailparam_init(¶ms[psize], "children.cur"); + jailparam_import_raw(¶ms[psize++], &vs->childcnt, + sizeof(vs->childcnt)); + + if (verbose == 1) + goto done; + + jailparam_init(¶ms[psize], "children.max"); + jailparam_import_raw(¶ms[psize++], &vs->childmax, + sizeof(vs->childmax)); + + jailparam_init(¶ms[psize], "cpuset.id"); + jailparam_import_raw(¶ms[psize++], &vs->cpuset, + sizeof(vs->cpuset)); + + jailparam_init(¶ms[psize], "parent"); + jailparam_import_raw(¶ms[psize++], &vs->parentjid, + sizeof(vs->parentjid)); + + jailparam_init(¶ms[psize], "allow.raw_sockets"); + jailparam_import_raw(¶ms[psize++], &vs->rawsock, + sizeof(vs->rawsock)); + + jailparam_init(¶ms[psize], "allow.socket_af"); + jailparam_import_raw(¶ms[psize++], &vs->socket_af, + sizeof(vs->socket_af)); + + jailparam_init(¶ms[psize], "allow.mount"); + jailparam_import_raw(¶ms[psize++], &vs->mount, sizeof(vs->mount)); + +done: + vs->jid = jailparam_get(params, psize, 0); + jailparam_free(params, psize); + return (vs->jid); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 20 23:04:21 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE3FC1065690; Thu, 20 Aug 2009 23:04:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A26068FC55; Thu, 20 Aug 2009 23:04:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7KN4LP5002520; Thu, 20 Aug 2009 23:04:21 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7KN4Lck002517; Thu, 20 Aug 2009 23:04:21 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200908202304.n7KN4Lck002517@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 20 Aug 2009 23:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196413 - in stable/8/sys: . amd64/amd64 amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci i386/i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2009 23:04:22 -0000 Author: jkim Date: Thu Aug 20 23:04:21 2009 New Revision: 196413 URL: http://svn.freebsd.org/changeset/base/196413 Log: MFC: r196412 Check whether the SMBIOS reports reasonable amount of memory. If it is less than "avail memory", fall back to Maxmem to avoid user confusion. We use SMBIOS information to display "real memory" since r190599 but some broken SMBIOS implementation reported only half of actual memory. Tested by: bz Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/i386/i386/machdep.c Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Thu Aug 20 22:58:05 2009 (r196412) +++ stable/8/sys/amd64/amd64/machdep.c Thu Aug 20 23:04:21 2009 (r196413) @@ -236,19 +236,21 @@ cpu_startup(dummy) #ifdef PERFMON perfmon_init(); #endif + realmem = Maxmem; + + /* + * Display physical memory if SMBIOS reports reasonable amount. + */ + memsize = 0; sysenv = getenv("smbios.memory.enabled"); if (sysenv != NULL) { - memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10); + memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << 10; freeenv(sysenv); - } else - memsize = 0; - if (memsize > 0) - printf("real memory = %ju (%ju MB)\n", memsize << 10, - memsize >> 10); - else - printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), - ptoa((uintmax_t)Maxmem) / 1048576); - realmem = Maxmem; + } + if (memsize < ptoa((uintmax_t)cnt.v_free_count)) + memsize = ptoa((uintmax_t)Maxmem); + printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); + /* * Display any holes after the first chunk of extended memory. */ Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Thu Aug 20 22:58:05 2009 (r196412) +++ stable/8/sys/i386/i386/machdep.c Thu Aug 20 23:04:21 2009 (r196413) @@ -280,19 +280,21 @@ cpu_startup(dummy) #ifdef PERFMON perfmon_init(); #endif + realmem = Maxmem; + + /* + * Display physical memory if SMBIOS reports reasonable amount. + */ + memsize = 0; sysenv = getenv("smbios.memory.enabled"); if (sysenv != NULL) { - memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10); + memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << 10; freeenv(sysenv); - } else - memsize = 0; - if (memsize > 0) - printf("real memory = %ju (%ju MB)\n", memsize << 10, - memsize >> 10); - else - printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), - ptoa((uintmax_t)Maxmem) / 1048576); - realmem = Maxmem; + } + if (memsize < ptoa((uintmax_t)cnt.v_free_count)) + memsize = ptoa((uintmax_t)Maxmem); + printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); + /* * Display any holes after the first chunk of extended memory. */ From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 20 23:07:54 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E9EB1065691; Thu, 20 Aug 2009 23:07:54 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BB3E8FC62; Thu, 20 Aug 2009 23:07:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7KN7svi002653; Thu, 20 Aug 2009 23:07:54 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7KN7rPC002652; Thu, 20 Aug 2009 23:07:54 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200908202307.n7KN7rPC002652@svn.freebsd.org> From: Peter Wemm Date: Thu, 20 Aug 2009 23:07:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196414 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2009 23:07:54 -0000 Author: peter Date: Thu Aug 20 23:07:53 2009 New Revision: 196414 URL: http://svn.freebsd.org/changeset/base/196414 Log: MFC rev 196410 - deal with 'ticks' going negative after 24 days of uptime with the default 1000hz clock in the timewait expiration code. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/tcp_timewait.c Modified: stable/8/sys/netinet/tcp_timewait.c ============================================================================== --- stable/8/sys/netinet/tcp_timewait.c Thu Aug 20 23:04:21 2009 (r196413) +++ stable/8/sys/netinet/tcp_timewait.c Thu Aug 20 23:07:53 2009 (r196414) @@ -603,7 +603,7 @@ tcp_tw_2msl_scan(int reuse) INP_INFO_WLOCK_ASSERT(&V_tcbinfo); for (;;) { tw = TAILQ_FIRST(&V_twq_2msl); - if (tw == NULL || (!reuse && tw->tw_time > ticks)) + if (tw == NULL || (!reuse && (tw->tw_time - ticks) > 0)) break; INP_WLOCK(tw->tw_inpcb); tcp_twclose(tw, reuse); From owner-svn-src-stable-8@FreeBSD.ORG Fri Aug 21 01:12:06 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7016E106568B; Fri, 21 Aug 2009 01:12:06 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CFD18FC3D; Fri, 21 Aug 2009 01:12:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7L1C6Tb006872; Fri, 21 Aug 2009 01:12:06 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7L1C6tJ006870; Fri, 21 Aug 2009 01:12:06 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200908210112.n7L1C6tJ006870@svn.freebsd.org> From: Ken Smith Date: Fri, 21 Aug 2009 01:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196416 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/hptrr dev/xen/xenpci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2009 01:12:06 -0000 Author: kensmith Date: Fri Aug 21 01:12:06 2009 New Revision: 196416 URL: http://svn.freebsd.org/changeset/base/196416 Log: MFC r196415: Fix a boot hang for hptrr(4) caused by changes introduced in r195534. It is necessary to make sure cpi->transport is set for xpt_scan_bus() to work properly. Submitted by: Bernhard Schmidt (scb+freebsd-current techwires net) Reviewed by: scottl Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/hptrr/hptrr_osm_bsd.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- stable/8/sys/dev/hptrr/hptrr_osm_bsd.c Fri Aug 21 01:00:15 2009 (r196415) +++ stable/8/sys/dev/hptrr/hptrr_osm_bsd.c Fri Aug 21 01:12:06 2009 (r196416) @@ -814,6 +814,10 @@ static void hpt_action(struct cam_sim *s strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->protocol = PROTO_SCSI; + cpi->protocol_version = SCSI_REV_2; cpi->ccb_h.status = CAM_REQ_CMP; break; } From owner-svn-src-stable-8@FreeBSD.ORG Fri Aug 21 03:14:40 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38A8B106568E; Fri, 21 Aug 2009 03:14:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24DA58FC75; Fri, 21 Aug 2009 03:14:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7L3Eef9009629; Fri, 21 Aug 2009 03:14:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7L3EeTW009626; Fri, 21 Aug 2009 03:14:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908210314.n7L3EeTW009626@svn.freebsd.org> From: John Baldwin Date: Fri, 21 Aug 2009 03:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196418 - in stable/8: share/man/man9 sys sys/amd64/include/xen sys/cddl/contrib/opensolaris sys/contrib/dev/acpica sys/contrib/pf sys/dev/xen/xenpci sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2009 03:14:40 -0000 Author: jhb Date: Fri Aug 21 03:14:39 2009 New Revision: 196418 URL: http://svn.freebsd.org/changeset/base/196418 Log: MFC 196417: This patch fixes two bugs in sglist(9) and improves robustness of the API via better semantics if a request to append an address range to an existing list fails. - When cloning an sglist, properly set the length in the new sglist instead of leaving the new list empty. - Properly compute the amount of data added to an sglist via _sglist_append_buf(). This allows sglist_consume_uio() to properly update uio_resid. - When a request to append an address range to a scatter/gather list fails, restore the sglist to the state it had at the start of the function call instead of resetting it to an empty list. Approved by: re (kib) Modified: stable/8/share/man/man9/ (props changed) stable/8/share/man/man9/sglist.9 stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/subr_sglist.c Modified: stable/8/share/man/man9/sglist.9 ============================================================================== --- stable/8/share/man/man9/sglist.9 Fri Aug 21 02:59:07 2009 (r196417) +++ stable/8/share/man/man9/sglist.9 Fri Aug 21 03:14:39 2009 (r196418) @@ -191,6 +191,8 @@ Specifically, the family of routines can be used to append the physical address ranges described by an object to the end of a scatter/gather list. All of these routines return 0 on success or an error on failure. +If a request to append an address range to a scatter/gather list fails, +the scatter/gather list will remain unchanged. .Pp The .Nm sglist_append @@ -445,6 +447,7 @@ There are not enough available segments to append the physical address ranges from .Fa second . .El +.Pp The .Nm sglist_slice function returns the following errors on failure: @@ -470,6 +473,7 @@ list in .Fa *slice to describe the requested physical address ranges. .El +.Pp The .Nm sglist_split function returns the following errors on failure: Modified: stable/8/sys/kern/subr_sglist.c ============================================================================== --- stable/8/sys/kern/subr_sglist.c Fri Aug 21 02:59:07 2009 (r196417) +++ stable/8/sys/kern/subr_sglist.c Fri Aug 21 03:14:39 2009 (r196418) @@ -48,6 +48,32 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_SGLIST, "sglist", "scatter/gather lists"); /* + * Convenience macros to save the state of an sglist so it can be restored + * if an append attempt fails. Since sglist's only grow we only need to + * save the current count of segments and the length of the ending segment. + * Earlier segments will not be changed by an append, and the only change + * that can occur to the ending segment is that it can be extended. + */ +struct sgsave { + u_short sg_nseg; + size_t ss_len; +}; + +#define SGLIST_SAVE(sg, sgsave) do { \ + (sgsave).sg_nseg = (sg)->sg_nseg; \ + if ((sgsave).sg_nseg > 0) \ + (sgsave).ss_len = (sg)->sg_segs[(sgsave).sg_nseg - 1].ss_len; \ + else \ + (sgsave).ss_len = 0; \ +} while (0) + +#define SGLIST_RESTORE(sg, sgsave) do { \ + (sg)->sg_nseg = (sgsave).sg_nseg; \ + if ((sgsave).sg_nseg > 0) \ + (sg)->sg_segs[(sgsave).sg_nseg - 1].ss_len = (sgsave).ss_len; \ +} while (0) + +/* * Append a single (paddr, len) to a sglist. sg is the list and ss is * the current segment in the list. If we run out of segments then * EFBIG will be returned. @@ -62,10 +88,8 @@ _sglist_append_range(struct sglist *sg, if (ss->ss_paddr + ss->ss_len == paddr) ss->ss_len += len; else { - if (sg->sg_nseg == sg->sg_maxseg) { - sg->sg_nseg = 0; + if (sg->sg_nseg == sg->sg_maxseg) return (EFBIG); - } ss++; ss->ss_paddr = paddr; ss->ss_len = len; @@ -107,26 +131,33 @@ _sglist_append_buf(struct sglist *sg, vo ss->ss_paddr = paddr; ss->ss_len = seglen; sg->sg_nseg = 1; - error = 0; } else { ss = &sg->sg_segs[sg->sg_nseg - 1]; error = _sglist_append_range(sg, &ss, paddr, seglen); + if (error) + return (error); } + vaddr += seglen; + len -= seglen; + if (donep) + *donep += seglen; - while (error == 0 && len > seglen) { - vaddr += seglen; - len -= seglen; - if (donep) - *donep += seglen; + while (len > 0) { seglen = MIN(len, PAGE_SIZE); if (pmap != NULL) paddr = pmap_extract(pmap, vaddr); else paddr = pmap_kextract(vaddr); error = _sglist_append_range(sg, &ss, paddr, seglen); + if (error) + return (error); + vaddr += seglen; + len -= seglen; + if (donep) + *donep += seglen; } - return (error); + return (0); } /* @@ -195,10 +226,16 @@ sglist_free(struct sglist *sg) int sglist_append(struct sglist *sg, void *buf, size_t len) { + struct sgsave save; + int error; if (sg->sg_maxseg == 0) return (EINVAL); - return (_sglist_append_buf(sg, buf, len, NULL, NULL)); + SGLIST_SAVE(sg, save); + error = _sglist_append_buf(sg, buf, len, NULL, NULL); + if (error) + SGLIST_RESTORE(sg, save); + return (error); } /* @@ -209,6 +246,8 @@ int sglist_append_phys(struct sglist *sg, vm_paddr_t paddr, size_t len) { struct sglist_seg *ss; + struct sgsave save; + int error; if (sg->sg_maxseg == 0) return (EINVAL); @@ -222,7 +261,11 @@ sglist_append_phys(struct sglist *sg, vm return (0); } ss = &sg->sg_segs[sg->sg_nseg - 1]; - return (_sglist_append_range(sg, &ss, paddr, len)); + SGLIST_SAVE(sg, save); + error = _sglist_append_range(sg, &ss, paddr, len); + if (error) + SGLIST_RESTORE(sg, save); + return (error); } /* @@ -233,6 +276,7 @@ sglist_append_phys(struct sglist *sg, vm int sglist_append_mbuf(struct sglist *sg, struct mbuf *m0) { + struct sgsave save; struct mbuf *m; int error; @@ -240,11 +284,14 @@ sglist_append_mbuf(struct sglist *sg, st return (EINVAL); error = 0; + SGLIST_SAVE(sg, save); for (m = m0; m != NULL; m = m->m_next) { if (m->m_len > 0) { error = sglist_append(sg, m->m_data, m->m_len); - if (error) + if (error) { + SGLIST_RESTORE(sg, save); return (error); + } } } return (0); @@ -258,11 +305,17 @@ sglist_append_mbuf(struct sglist *sg, st int sglist_append_user(struct sglist *sg, void *buf, size_t len, struct thread *td) { + struct sgsave save; + int error; if (sg->sg_maxseg == 0) return (EINVAL); - return (_sglist_append_buf(sg, buf, len, - vmspace_pmap(td->td_proc->p_vmspace), NULL)); + SGLIST_SAVE(sg, save); + error = _sglist_append_buf(sg, buf, len, + vmspace_pmap(td->td_proc->p_vmspace), NULL); + if (error) + SGLIST_RESTORE(sg, save); + return (error); } /* @@ -274,6 +327,7 @@ int sglist_append_uio(struct sglist *sg, struct uio *uio) { struct iovec *iov; + struct sgsave save; size_t resid, minlen; pmap_t pmap; int error, i; @@ -292,6 +346,7 @@ sglist_append_uio(struct sglist *sg, str pmap = NULL; error = 0; + SGLIST_SAVE(sg, save); for (i = 0; i < uio->uio_iovcnt && resid != 0; i++) { /* * Now at the first iovec to load. Load each iovec @@ -301,8 +356,10 @@ sglist_append_uio(struct sglist *sg, str if (minlen > 0) { error = _sglist_append_buf(sg, iov[i].iov_base, minlen, pmap, NULL); - if (error) + if (error) { + SGLIST_RESTORE(sg, save); return (error); + } resid -= minlen; } } @@ -397,6 +454,7 @@ sglist_clone(struct sglist *sg, int mfla new = sglist_alloc(sg->sg_maxseg, mflags); if (new == NULL) return (NULL); + new->sg_nseg = sg->sg_nseg; bcopy(sg->sg_segs, new->sg_segs, sizeof(struct sglist_seg) * sg->sg_nseg); return (new); From owner-svn-src-stable-8@FreeBSD.ORG Fri Aug 21 10:05:27 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CC2B106568C; Fri, 21 Aug 2009 10:05:27 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AB748FC66; Fri, 21 Aug 2009 10:05:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7LA5RKa018023; Fri, 21 Aug 2009 10:05:27 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7LA5RUu018021; Fri, 21 Aug 2009 10:05:27 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <200908211005.n7LA5RUu018021@svn.freebsd.org> From: Julian Elischer Date: Fri, 21 Aug 2009 10:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196420 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2009 10:05:27 -0000 Author: julian Date: Fri Aug 21 10:05:26 2009 New Revision: 196420 URL: http://svn.freebsd.org/changeset/base/196420 Log: MFC r196419: Don't allow access to the internals until it has all been set up. Specifically, not until the per-vnet parts have been set up. Submitted by: kmacy@ Reviewed by: julian@, zec@ Approved by: re(rwatson) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/flowtable.c Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Fri Aug 21 09:22:32 2009 (r196419) +++ stable/8/sys/net/flowtable.c Fri Aug 21 10:05:26 2009 (r196420) @@ -999,6 +999,7 @@ flowtable_init_vnet(const void *unused _ NULL, NULL, NULL, NULL, 64, UMA_ZONE_MAXBUCKET); uma_zone_set_max(V_flow_ipv4_zone, V_flowtable_nmbflows); uma_zone_set_max(V_flow_ipv6_zone, V_flowtable_nmbflows); + V_flowtable_ready = 1; } VNET_SYSINIT(flowtable_init_vnet, SI_SUB_KTHREAD_INIT, SI_ORDER_MIDDLE, flowtable_init_vnet, NULL); @@ -1011,7 +1012,6 @@ flowtable_init(const void *unused __unus mtx_init(&flowclean_lock, "flowclean lock", NULL, MTX_DEF); EVENTHANDLER_REGISTER(ifnet_departure_event, flowtable_flush, NULL, EVENTHANDLER_PRI_ANY); - V_flowtable_ready = 1; } SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, flowtable_init, NULL); @@ -1022,6 +1022,7 @@ static void flowtable_uninit(const void *unused __unused) { + V_flowtable_ready = 0; uma_zdestroy(V_flow_ipv4_zone); uma_zdestroy(V_flow_ipv6_zone); } From owner-svn-src-stable-8@FreeBSD.ORG Fri Aug 21 11:17:25 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4905106568D; Fri, 21 Aug 2009 11:17:25 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C48CA8FC51; Fri, 21 Aug 2009 11:17:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7LBHPLJ021024; Fri, 21 Aug 2009 11:17:25 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7LBHPMV021022; Fri, 21 Aug 2009 11:17:25 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200908211117.n7LBHPMV021022@svn.freebsd.org> From: Marko Zec Date: Fri, 21 Aug 2009 11:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196422 - stable/8/tools/tools/vimage X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2009 11:17:25 -0000 Author: zec Date: Fri Aug 21 11:17:25 2009 New Revision: 196422 URL: http://svn.freebsd.org/changeset/base/196422 Log: MFC r196421: Bugfix: all requests for creating vnets via vimage -c were always reported as failures, even if the actual library / system call would succeed, because error message would be reported if the return value from jail_setv() call was >= 0, and if not, then if that same value was < 0, i.e. always. The correct behavior is to abort (only) if jail_setv() returns < 0. Approved by: re (rwatson), julian (mentor) Approved by: re (rwatson) Modified: stable/8/tools/tools/vimage/ (props changed) stable/8/tools/tools/vimage/vimage.c Modified: stable/8/tools/tools/vimage/vimage.c ============================================================================== --- stable/8/tools/tools/vimage/vimage.c Fri Aug 21 11:13:56 2009 (r196421) +++ stable/8/tools/tools/vimage/vimage.c Fri Aug 21 11:17:25 2009 (r196422) @@ -252,7 +252,7 @@ main(int argc, char **argv) exit(0); case VI_CREATE: - if ((jid = jail_setv(JAIL_CREATE, + if (jail_setv(JAIL_CREATE, "name", argv[0], "vnet", NULL, "host", NULL, @@ -260,9 +260,7 @@ main(int argc, char **argv) "allow.raw_sockets", "true", "allow.socket_af", "true", "allow.mount", "true", - NULL)) >= 0) - break; - if (jid < 0) + NULL) < 0) break; if (argc == 1) exit(0); From owner-svn-src-stable-8@FreeBSD.ORG Fri Aug 21 11:23:29 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83EA7106568E; Fri, 21 Aug 2009 11:23:29 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 714A78FC64; Fri, 21 Aug 2009 11:23:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7LBNTMb021285; Fri, 21 Aug 2009 11:23:29 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7LBNTkK021281; Fri, 21 Aug 2009 11:23:29 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <200908211123.n7LBNTkK021281@svn.freebsd.org> From: Julian Elischer Date: Fri, 21 Aug 2009 11:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196424 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2009 11:23:29 -0000 Author: julian Date: Fri Aug 21 11:23:29 2009 New Revision: 196424 URL: http://svn.freebsd.org/changeset/base/196424 Log: MFC r196423 Fix ipfw's initialization functions to get the correct order of evaluation to allow vnet and non vnet operation. Move some functions from ip_fw_pfil.c to ip_fw2.c and mode to mostly using the SYSINIT and VNET_SYSINIT handlers instead of the modevent handler. Correct some spelling errors in comments in the affected code. Note this bug fixes a crash in NON VIMAGE kernels when ipfw is unloaded. This patch is a minimal patch for 8.0 I have a much larger patch that actually fixes the underlying problems that will be applied after 8.0 Reviewed by: zec@, rwatson@, bz@(earlier version) Approved by: re (rwatson) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ip_fw.h stable/8/sys/netinet/ipfw/ip_fw2.c stable/8/sys/netinet/ipfw/ip_fw_pfil.c Modified: stable/8/sys/netinet/ip_fw.h ============================================================================== --- stable/8/sys/netinet/ip_fw.h Fri Aug 21 11:20:10 2009 (r196423) +++ stable/8/sys/netinet/ip_fw.h Fri Aug 21 11:23:29 2009 (r196424) @@ -645,8 +645,10 @@ int ipfw_check_out(void *, struct mbuf * int ipfw_chk(struct ip_fw_args *); -int ipfw_init(void); -void ipfw_destroy(void); +int ipfw_hook(void); +int ipfw6_hook(void); +int ipfw_unhook(void); +int ipfw6_unhook(void); #ifdef NOTYET void ipfw_nat_destroy(void); #endif Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Fri Aug 21 11:20:10 2009 (r196423) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Fri Aug 21 11:23:29 2009 (r196424) @@ -102,6 +102,8 @@ __FBSDID("$FreeBSD$"); #include #endif +static VNET_DEFINE(int, ipfw_vnet_ready) = 0; +#define V_ipfw_vnet_ready VNET(ipfw_vnet_ready) /* * set_disable contains one bit per set value (0..31). * If the bit is set, all rules with the corresponding set @@ -2237,7 +2239,7 @@ ipfw_chk(struct ip_fw_args *args) /* end of ipv6 variables */ int is_ipv4 = 0; - if (m->m_flags & M_SKIP_FIREWALL) + if (m->m_flags & M_SKIP_FIREWALL || (! V_ipfw_vnet_ready)) return (IP_FW_PASS); /* accept */ dst_ip.s_addr = 0; /* make sure it is initialized */ @@ -4579,12 +4581,10 @@ done: CURVNET_RESTORE(); } - - /**************** * Stuff that must be initialised only on boot or module load */ -int +static int ipfw_init(void) { int error = 0; @@ -4623,9 +4623,11 @@ ipfw_init(void) default_to_accept ? "accept" : "deny"); /* - * Note: V_xxx variables can be accessed here but the iattach() - * may not have been called yet for the VIMGE case. - * Tuneables will have been processed. + * Note: V_xxx variables can be accessed here but the vnet specific + * initializer may not have been called yet for the VIMAGE case. + * Tuneables will have been processed. We will print out values for + * the default vnet. + * XXX This should all be rationalized AFTER 8.0 */ if (V_fw_verbose == 0) printf("disabled\n"); @@ -4636,6 +4638,20 @@ ipfw_init(void) V_verbose_limit); /* + * Hook us up to pfil. + * Eventually pfil will be per vnet. + */ + if ((error = ipfw_hook()) != 0) { + printf("ipfw_hook() error\n"); + return (error); + } +#ifdef INET6 + if ((error = ipfw6_hook()) != 0) { + printf("ipfw6_hook() error\n"); + return (error); + } +#endif + /* * Other things that are only done the first time. * (now that we a re cuaranteed of success). */ @@ -4645,8 +4661,8 @@ ipfw_init(void) } /**************** - * Stuff that must be initialised for every instance - * (including the forst of course). + * Stuff that must be initialized for every instance + * (including the first of course). */ static int vnet_ipfw_init(const void *unused) @@ -4726,17 +4742,17 @@ vnet_ipfw_init(const void *unused) #endif /* First set up some values that are compile time options */ + V_ipfw_vnet_ready = 1; /* Open for business */ return (0); } /********************** * Called for the removal of the last instance only on module unload. */ -void +static void ipfw_destroy(void) { - ip_fw_chk_ptr = NULL; - ip_fw_ctl_ptr = NULL; + uma_zdestroy(ipfw_dyn_rule_zone); IPFW_DYN_LOCK_DESTROY(); printf("IP firewall unloaded\n"); @@ -4750,7 +4766,9 @@ vnet_ipfw_uninit(const void *unused) { struct ip_fw *reap; + V_ipfw_vnet_ready = 0; /* tell new callers to go away */ callout_drain(&V_ipfw_timeout); + /* We wait on the wlock here until the last user leaves */ IPFW_WLOCK(&V_layer3_chain); flush_tables(&V_layer3_chain); V_layer3_chain.reap = NULL; @@ -4766,10 +4784,86 @@ vnet_ipfw_uninit(const void *unused) return 0; } -VNET_SYSINIT(vnet_ipfw_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 255, - vnet_ipfw_init, NULL); +/* + * Module event handler. + * In general we have the choice of handling most of these events by the + * event handler or by the (VNET_)SYS(UN)INIT handlers. I have chosen to + * use the SYSINIT handlers as they are more capable of expressing the + * flow of control during module and vnet operations, so this is just + * a skeleton. Note there is no SYSINIT equivalent of the module + * SHUTDOWN handler, but we don't have anything to do in that case anyhow. + */ +static int +ipfw_modevent(module_t mod, int type, void *unused) +{ + int err = 0; + + switch (type) { + case MOD_LOAD: + /* Called once at module load or + * system boot if compiled in. */ + break; + case MOD_UNLOAD: + break; + case MOD_QUIESCE: + /* Yes, the unhooks can return errors, we can safely ignore + * them. Eventually these will be done per jail as they + * shut down. We will wait on each vnet's l3 lock as existing + * callers go away. + */ + ipfw_unhook(); +#ifdef INET6 + ipfw6_unhook(); +#endif + /* layer2 and other entrypoints still come in this way. */ + ip_fw_chk_ptr = NULL; + ip_fw_ctl_ptr = NULL; + /* Called during unload. */ + break; + case MOD_SHUTDOWN: + /* Called during system shutdown. */ + break; + default: + err = EOPNOTSUPP; + break; + } + return err; +} + +static moduledata_t ipfwmod = { + "ipfw", + ipfw_modevent, + 0 +}; -VNET_SYSUNINIT(vnet_ipfw_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 255, - vnet_ipfw_uninit, NULL); +/* Define startup order. */ +#define IPFW_SI_SUB_FIREWALL SI_SUB_PROTO_IFATTACHDOMAIN +#define IPFW_MODEVENT_ORDER (SI_ORDER_ANY - 255) /* On boot slot in here. */ +#define IPFW_MODULE_ORDER (IPFW_MODEVENT_ORDER + 1) /* A little later. */ +#define IPFW_VNET_ORDER (IPFW_MODEVENT_ORDER + 2) /* Later still. */ + +DECLARE_MODULE(ipfw, ipfwmod, IPFW_SI_SUB_FIREWALL, IPFW_MODEVENT_ORDER); +MODULE_VERSION(ipfw, 2); +/* should declare some dependencies here */ + +/* + * Starting up. Done in order after ipfwmod() has been called. + * VNET_SYSINIT is also called for each existing vnet and each new vnet. + */ +SYSINIT(ipfw_init, IPFW_SI_SUB_FIREWALL, IPFW_MODULE_ORDER, + ipfw_init, NULL); +VNET_SYSINIT(vnet_ipfw_init, IPFW_SI_SUB_FIREWALL, IPFW_VNET_ORDER, + vnet_ipfw_init, NULL); + +/* + * Closing up shop. These are done in REVERSE ORDER, but still + * after ipfwmod() has been called. Not called on reboot. + * VNET_SYSUNINIT is also called for each exiting vnet as it exits. + * or when the module is unloaded. + */ +SYSUNINIT(ipfw_destroy, IPFW_SI_SUB_FIREWALL, IPFW_MODULE_ORDER, + ipfw_destroy, NULL); +VNET_SYSUNINIT(vnet_ipfw_uninit, IPFW_SI_SUB_FIREWALL, IPFW_VNET_ORDER, + vnet_ipfw_uninit, NULL); Modified: stable/8/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_pfil.c Fri Aug 21 11:20:10 2009 (r196423) +++ stable/8/sys/netinet/ipfw/ip_fw_pfil.c Fri Aug 21 11:23:29 2009 (r196424) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -441,7 +442,7 @@ nodivert: return 1; } -static int +int ipfw_hook(void) { struct pfil_head *pfh_inet; @@ -458,7 +459,7 @@ ipfw_hook(void) return 0; } -static int +int ipfw_unhook(void) { struct pfil_head *pfh_inet; @@ -476,7 +477,7 @@ ipfw_unhook(void) } #ifdef INET6 -static int +int ipfw6_hook(void) { struct pfil_head *pfh_inet6; @@ -493,7 +494,7 @@ ipfw6_hook(void) return 0; } -static int +int ipfw6_unhook(void) { struct pfil_head *pfh_inet6; @@ -517,6 +518,10 @@ ipfw_chg_hook(SYSCTL_HANDLER_ARGS) int enable = *(int *)arg1; int error; +#ifdef VIMAGE /* Since enabling is global, only let base do it. */ + if (! IS_DEFAULT_VNET(curvnet)) + return (EPERM); +#endif error = sysctl_handle_int(oidp, &enable, 0, req); if (error) return (error); @@ -549,50 +554,3 @@ ipfw_chg_hook(SYSCTL_HANDLER_ARGS) return (0); } -static int -ipfw_modevent(module_t mod, int type, void *unused) -{ - int err = 0; - - switch (type) { - case MOD_LOAD: - if ((err = ipfw_init()) != 0) { - printf("ipfw_init() error\n"); - break; - } - if ((err = ipfw_hook()) != 0) { - printf("ipfw_hook() error\n"); - break; - } -#ifdef INET6 - if ((err = ipfw6_hook()) != 0) { - printf("ipfw_hook() error\n"); - break; - } -#endif - break; - - case MOD_UNLOAD: - if ((err = ipfw_unhook()) > 0) - break; -#ifdef INET6 - if ((err = ipfw6_unhook()) > 0) - break; -#endif - ipfw_destroy(); - break; - - default: - return EOPNOTSUPP; - break; - } - return err; -} - -static moduledata_t ipfwmod = { - "ipfw", - ipfw_modevent, - 0 -}; -DECLARE_MODULE(ipfw, ipfwmod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 256); -MODULE_VERSION(ipfw, 2); From owner-svn-src-stable-8@FreeBSD.ORG Fri Aug 21 17:40:25 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D31B1065672; Fri, 21 Aug 2009 17:40:25 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B19E8FC1F; Fri, 21 Aug 2009 17:40:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7LHePjU030886; Fri, 21 Aug 2009 17:40:25 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7LHePjf030885; Fri, 21 Aug 2009 17:40:25 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200908211740.n7LHePjf030885@svn.freebsd.org> From: Ken Smith Date: Fri, 21 Aug 2009 17:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196426 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2009 17:40:25 -0000 Author: kensmith Date: Fri Aug 21 17:40:24 2009 New Revision: 196426 URL: http://svn.freebsd.org/changeset/base/196426 Log: Ready for 8.0-BETA3 builds. Approved by: re (implicit) Modified: stable/8/sys/conf/newvers.sh Modified: stable/8/sys/conf/newvers.sh ============================================================================== --- stable/8/sys/conf/newvers.sh Fri Aug 21 11:34:01 2009 (r196425) +++ stable/8/sys/conf/newvers.sh Fri Aug 21 17:40:24 2009 (r196426) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.0" -BRANCH="BETA2" +BRANCH="BETA3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi