From owner-svn-src-stable-8@FreeBSD.ORG Sun Jun 20 10:23:47 2010 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 717461065670; Sun, 20 Jun 2010 10:23:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 462828FC0A; Sun, 20 Jun 2010 10:23: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 o5KANkSh073299; Sun, 20 Jun 2010 10:23:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5KANk5a073296; Sun, 20 Jun 2010 10:23:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006201023.o5KANk5a073296@svn.freebsd.org> From: Alexander Motin Date: Sun, 20 Jun 2010 10:23: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: r209365 - in stable/8/sys: amd64/amd64 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: Sun, 20 Jun 2010 10:23:47 -0000 Author: mav Date: Sun Jun 20 10:23:46 2010 New Revision: 209365 URL: http://svn.freebsd.org/changeset/base/209365 Log: MFC r209155: Fix bug introduced in SVN rev 194985. When calling pic_assign_cpu() for pre-bound IRQs during boot, submit there LAPIC ID, same as in other places, not CPU ID. Modified: stable/8/sys/amd64/amd64/intr_machdep.c stable/8/sys/i386/i386/intr_machdep.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/amd64/amd64/intr_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/intr_machdep.c Sun Jun 20 09:40:54 2010 (r209364) +++ stable/8/sys/amd64/amd64/intr_machdep.c Sun Jun 20 10:23:46 2010 (r209365) @@ -529,7 +529,7 @@ intr_shuffle_irqs(void *arg __unused) */ if (isrc->is_event->ie_cpu != NOCPU) (void)isrc->is_pic->pic_assign_cpu(isrc, - isrc->is_event->ie_cpu); + cpu_apic_ids[isrc->is_event->ie_cpu]); else if (isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[current_cpu]) == 0) (void)intr_next_cpu(); Modified: stable/8/sys/i386/i386/intr_machdep.c ============================================================================== --- stable/8/sys/i386/i386/intr_machdep.c Sun Jun 20 09:40:54 2010 (r209364) +++ stable/8/sys/i386/i386/intr_machdep.c Sun Jun 20 10:23:46 2010 (r209365) @@ -502,7 +502,7 @@ intr_shuffle_irqs(void *arg __unused) */ if (isrc->is_event->ie_cpu != NOCPU) (void)isrc->is_pic->pic_assign_cpu(isrc, - isrc->is_event->ie_cpu); + cpu_apic_ids[isrc->is_event->ie_cpu]); else if (isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[current_cpu]) == 0) (void)intr_next_cpu(); From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 21 04:37:39 2010 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 A283A106564A; Mon, 21 Jun 2010 04:37:39 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90C778FC18; Mon, 21 Jun 2010 04:37:39 +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 o5L4bdEk017064; Mon, 21 Jun 2010 04:37:39 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5L4bdps017062; Mon, 21 Jun 2010 04:37:39 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006210437.o5L4bdps017062@svn.freebsd.org> From: Matt Jacob Date: Mon, 21 Jun 2010 04:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209383 - stable/8/sys/dev/isp 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, 21 Jun 2010 04:37:39 -0000 Author: mjacob Date: Mon Jun 21 04:37:39 2010 New Revision: 209383 URL: http://svn.freebsd.org/changeset/base/209383 Log: This is an MFC of 208895. Fix XPT_GET_TRAN_SETTING for FC which has been broken for while so that it will figure out the correct target to handle index and be able to find things like WWPN, etc. Modified: stable/8/sys/dev/isp/isp_freebsd.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Mon Jun 21 04:06:01 2010 (r209382) +++ stable/8/sys/dev/isp/isp_freebsd.c Mon Jun 21 04:37:39 2010 (r209383) @@ -4499,6 +4499,7 @@ isp_action(struct cam_sim *sim, union cc fcparam *fcp = FCPARAM(isp, bus); struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; struct ccb_trans_settings_fc *fc = &cts->xport_specific.fc; + unsigned int hdlidx; cts->protocol = PROTO_SCSI; cts->protocol_version = SCSI_REV_2; @@ -4510,8 +4511,9 @@ isp_action(struct cam_sim *sim, union cc fc->valid = CTS_FC_VALID_SPEED; fc->bitrate = 100000; fc->bitrate *= fcp->isp_gbspeed; - if (tgt > 0 && tgt < MAX_FC_TARG) { - fcportdb_t *lp = &fcp->portdb[tgt]; + hdlidx = fcp->isp_dev_map[tgt] - 1; + if (hdlidx < MAX_FC_TARG) { + fcportdb_t *lp = &fcp->portdb[hdlidx]; fc->wwnn = lp->node_wwn; fc->wwpn = lp->port_wwn; fc->port = lp->portid; From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 21 05:42:36 2010 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 6D3D0106564A; Mon, 21 Jun 2010 05:42:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BB728FC08; Mon, 21 Jun 2010 05:42: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 o5L5gacd031444; Mon, 21 Jun 2010 05:42:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5L5gabi031442; Mon, 21 Jun 2010 05:42:36 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006210542.o5L5gabi031442@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 21 Jun 2010 05:42: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: r209385 - stable/8/sbin/geom/misc 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, 21 Jun 2010 05:42:36 -0000 Author: ae Date: Mon Jun 21 05:42:36 2010 New Revision: 209385 URL: http://svn.freebsd.org/changeset/base/209385 Log: MFC r208886: libgeom(3) does strdup of param name. Don't leak memory when deleting param from gctl_req. Approved by: mav (mentor) Modified: stable/8/sbin/geom/misc/subr.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/misc/subr.c ============================================================================== --- stable/8/sbin/geom/misc/subr.c Mon Jun 21 05:42:21 2010 (r209384) +++ stable/8/sbin/geom/misc/subr.c Mon Jun 21 05:42:36 2010 (r209385) @@ -436,6 +436,7 @@ gctl_delete_param(struct gctl_req *req, if (i == req->narg) return (ENOENT); + free(ap->name); req->narg--; while (i < req->narg) { req->arg[i] = req->arg[i + 1]; From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 21 13:47:29 2010 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 BC3081065674; Mon, 21 Jun 2010 13:47:29 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA92B8FC1A; Mon, 21 Jun 2010 13:47: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 o5LDlTSV039637; Mon, 21 Jun 2010 13:47:29 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LDlTg2039634; Mon, 21 Jun 2010 13:47:29 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201006211347.o5LDlTg2039634@svn.freebsd.org> From: Kai Wang Date: Mon, 21 Jun 2010 13:47: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: r209393 - stable/8/lib/libelf 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, 21 Jun 2010 13:47:29 -0000 Author: kaiw Date: Mon Jun 21 13:47:29 2010 New Revision: 209393 URL: http://svn.freebsd.org/changeset/base/209393 Log: MFC r209122: * Improve compatibility with existing application code by permitting the use of `elf_getbase()` on non-archive members. This change is needed for gcc LTO (-flto) to work properly. * Style fix: paranthesize returned values. * Document the current behaviour of `elf_getbase()`. Modified: stable/8/lib/libelf/elf_getbase.3 stable/8/lib/libelf/elf_getbase.c Directory Properties: stable/8/lib/libelf/ (props changed) Modified: stable/8/lib/libelf/elf_getbase.3 ============================================================================== --- stable/8/lib/libelf/elf_getbase.3 Mon Jun 21 12:50:54 2010 (r209392) +++ stable/8/lib/libelf/elf_getbase.3 Mon Jun 21 13:47:29 2010 (r209393) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006,2008,2010 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 11, 2006 +.Dd June 6, 2010 .Os .Dt ELF_GETBASE 3 .Sh NAME @@ -38,17 +38,21 @@ .Sh DESCRIPTION Function .Fn elf_getbase -returns the file offset in the containing archive of the first byte of -the file referenced by ELF descriptor +returns the file offset to the first byte of the object referenced by ELF +descriptor .Ar elf . +.Pp +For descriptors referencing members of archives, the returned offset is +the file offset of the member in its containing archive. +For descriptors to regular objects, the returned offset is (vacuously) +zero. .Sh RETURN VALUES Function .Fn elf_getbase -returns a valid file offset into the containing archive if successful. -It returns -1 if argument -.Ar elf -is NULL or is not a member of an -archive. +returns a valid file offset if successful, or +.Pq Vt off_t +.Li -1 +in case of an error. .Sh ERRORS Function .Fn elf_getbase @@ -57,7 +61,7 @@ may fail with the following errors: .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -is not an ELF descriptor for an archive member. +was NULL. .El .Sh SEE ALSO .Xr elf 3 , Modified: stable/8/lib/libelf/elf_getbase.c ============================================================================== --- stable/8/lib/libelf/elf_getbase.c Mon Jun 21 12:50:54 2010 (r209392) +++ stable/8/lib/libelf/elf_getbase.c Mon Jun 21 13:47:29 2010 (r209393) @@ -34,12 +34,14 @@ __FBSDID("$FreeBSD$"); off_t elf_getbase(Elf *e) { - if (e == NULL || - e->e_parent == NULL) { + if (e == NULL) { LIBELF_SET_ERROR(ARGUMENT, 0); - return (off_t) -1; + return ((off_t) -1); } + if (e->e_parent == NULL) + return ((off_t) 0); + return ((off_t) ((uintptr_t) e->e_rawfile - (uintptr_t) e->e_parent->e_rawfile)); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 21 22:00:57 2010 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 BA70A1065781; Mon, 21 Jun 2010 22:00:57 +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 A7C288FC08; Mon, 21 Jun 2010 22:00:57 +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 o5LM0vC1049125; Mon, 21 Jun 2010 22:00:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LM0vjn049114; Mon, 21 Jun 2010 22:00:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006212200.o5LM0vjn049114@svn.freebsd.org> From: Xin LI Date: Mon, 21 Jun 2010 22:00:57 +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: r209404 - stable/8/sys/dev/twa 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, 21 Jun 2010 22:00:57 -0000 Author: delphij Date: Mon Jun 21 22:00:57 2010 New Revision: 209404 URL: http://svn.freebsd.org/changeset/base/209404 Log: MFC r208969,209268: Driver update of twa(4) from LSI. Many thanks to LSI for continuing to support FreeBSD. 1) Timeout ioctl command timeouts. Do not reset the controller if ioctl command completed successfully. 2) Remove G66_WORKAROUND code (this bug never shipped). 3) Remove unnecessary interrupt lock (intr_lock). 4) Timeout firmware handshake for PChip reset (don't wait forever). 5) Handle interrupts inline. 6) Unmask command interrupt ONLY when adding a command to the pending queue. 7) Mask command interrupt ONLY after removing the last command from the pending queue. 8) Remove TW_OSLI_DEFERRED_INTR_USED code. 9) Replace controller "state" with separate data fields to avoid races: TW_CLI_CTLR_STATE_ACTIVE ctlr->active TW_CLI_CTLR_STATE_INTR_ENABLED ctlr->interrupts_enabled TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY ctlr->internal_req_busy TW_CLI_CTLR_STATE_GET_MORE_AENS ctlr->get_more_aens TW_CLI_CTLR_STATE_RESET_IN_PROGRESS ctlr->reset_in_progress TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS ctlr->reset_phase1_in_progress 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT null. 11) Replace softc "state" with separate data fields to avoid races: TW_OSLI_CTLR_STATE_OPEN sc->open TW_OSLI_CTLR_STATE_SIMQ_FROZEN sc->simq_frozen 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in tw_osl_complete_passthru() 13) Use correct CAM status values. Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID. Remove use of CAM_RELEASE_SIMQ for physical data addresses. 14) Do not freeze/ release the simq with non I/O commands. When it is appropriate to temporarily freeze the simq with an I/O command use: xpt_freeze_simq(sim, 1); ccb->ccb_h.status |= CAM_RELEASE_SIMQ; otherwise use: xpt_freeze_simq(sim, 1); xpt_release_simq(sim, 1); Submitted by: Tom Couch PR: kern/147695 Modified: stable/8/sys/dev/twa/tw_cl.h stable/8/sys/dev/twa/tw_cl_fwif.h stable/8/sys/dev/twa/tw_cl_init.c stable/8/sys/dev/twa/tw_cl_intr.c stable/8/sys/dev/twa/tw_cl_io.c stable/8/sys/dev/twa/tw_cl_misc.c stable/8/sys/dev/twa/tw_cl_share.h stable/8/sys/dev/twa/tw_osl.h stable/8/sys/dev/twa/tw_osl_cam.c stable/8/sys/dev/twa/tw_osl_externs.h stable/8/sys/dev/twa/tw_osl_freebsd.c stable/8/sys/dev/twa/tw_osl_inline.h stable/8/sys/dev/twa/tw_osl_share.h Directory Properties: 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/geom/sched/ (props changed) Modified: stable/8/sys/dev/twa/tw_cl.h ============================================================================== --- stable/8/sys/dev/twa/tw_cl.h Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl.h Mon Jun 21 22:00:57 2010 (r209404) @@ -51,22 +51,6 @@ #define TW_CLI_RESET_TIMEOUT_PERIOD 60 /* seconds */ #define TW_CLI_MAX_RESET_ATTEMPTS 2 -/* Possible values of ctlr->state. */ -/* Initialization done, and controller is active. */ -#define TW_CLI_CTLR_STATE_ACTIVE (1<<0) -/* Interrupts on controller enabled. */ -#define TW_CLI_CTLR_STATE_INTR_ENABLED (1<<1) -/* Data buffer for internal requests in use. */ -#define TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY (1<<2) -/* More AEN's need to be retrieved. */ -#define TW_CLI_CTLR_STATE_GET_MORE_AENS (1<<3) -/* Controller is being reset. */ -#define TW_CLI_CTLR_STATE_RESET_IN_PROGRESS (1<<4) -/* G133 controller is in 'phase 1' of being reset. */ -#define TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS (1<<5) -/* G66 register write access bug needs to be worked around. */ -#define TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED (1<<6) - /* Possible values of ctlr->ioctl_lock.lock. */ #define TW_CLI_LOCK_FREE 0x0 /* lock is free */ #define TW_CLI_LOCK_HELD 0x1 /* lock is held */ @@ -146,7 +130,12 @@ struct tw_cli_ctlr_context { TW_UINT32 device_id; /* controller device id */ TW_UINT32 arch_id; /* controller architecture id */ - TW_UINT32 state; /* controller state */ + TW_UINT8 active; /* Initialization done, and controller is active. */ + TW_UINT8 interrupts_enabled; /* Interrupts on controller enabled. */ + TW_UINT8 internal_req_busy; /* Data buffer for internal requests in use. */ + TW_UINT8 get_more_aens; /* More AEN's need to be retrieved. */ + TW_UINT8 reset_in_progress; /* Controller is being reset. */ + TW_UINT8 reset_phase1_in_progress; /* In 'phase 1' of reset. */ TW_UINT32 flags; /* controller settings */ TW_UINT32 sg_size_factor; /* SG element size should be a multiple of this */ @@ -199,10 +188,6 @@ struct tw_cli_ctlr_context { submission */ TW_LOCK_HANDLE *io_lock;/* ptr to lock held during cmd submission */ - TW_LOCK_HANDLE intr_lock_handle;/* lock held during - ISR/response intr processing */ - TW_LOCK_HANDLE *intr_lock;/* ptr to lock held during ISR/ - response intr processing */ #ifdef TW_OSL_CAN_SLEEP TW_SLEEP_HANDLE sleep_handle; /* handle to co-ordinate sleeps Modified: stable/8/sys/dev/twa/tw_cl_fwif.h ============================================================================== --- stable/8/sys/dev/twa/tw_cl_fwif.h Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_fwif.h Mon Jun 21 22:00:57 2010 (r209404) @@ -89,7 +89,6 @@ #define TWA_STATUS_MINOR_VERSION_MASK 0x0F000000 #define TWA_STATUS_MAJOR_VERSION_MASK 0xF0000000 -#define TWA_STATUS_EXPECTED_BITS 0x00002000 #define TWA_STATUS_UNEXPECTED_BITS 0x00F00000 @@ -142,7 +141,7 @@ #define TWA_BASE_FW_SRL 24 #define TWA_BASE_FW_BRANCH 0 #define TWA_BASE_FW_BUILD 1 -#define TWA_CURRENT_FW_SRL 30 +#define TWA_CURRENT_FW_SRL 41 #define TWA_CURRENT_FW_BRANCH_9K 4 #define TWA_CURRENT_FW_BUILD_9K 8 #define TWA_CURRENT_FW_BRANCH_9K_X 8 Modified: stable/8/sys/dev/twa/tw_cl_init.c ============================================================================== --- stable/8/sys/dev/twa/tw_cl_init.c Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_init.c Mon Jun 21 22:00:57 2010 (r209404) @@ -208,7 +208,7 @@ tw_cl_get_mem_requirements(struct tw_cl_ */ *non_dma_mem_size = sizeof(struct tw_cli_ctlr_context) + - (sizeof(struct tw_cli_req_context) * (max_simult_reqs + 1)) + + (sizeof(struct tw_cli_req_context) * max_simult_reqs) + (sizeof(struct tw_cl_event_packet) * max_aens); @@ -220,7 +220,7 @@ tw_cl_get_mem_requirements(struct tw_cl_ */ *dma_mem_size = (sizeof(struct tw_cl_command_packet) * - (max_simult_reqs + 1)) + (TW_CLI_SECTOR_SIZE); + (max_simult_reqs)) + (TW_CLI_SECTOR_SIZE); return(0); } @@ -287,12 +287,12 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle } tw_osl_memzero(non_dma_mem, sizeof(struct tw_cli_ctlr_context) + - (sizeof(struct tw_cli_req_context) * (max_simult_reqs + 1)) + + (sizeof(struct tw_cli_req_context) * max_simult_reqs) + (sizeof(struct tw_cl_event_packet) * max_aens)); tw_osl_memzero(dma_mem, (sizeof(struct tw_cl_command_packet) * - (max_simult_reqs + 1)) + + max_simult_reqs) + TW_CLI_SECTOR_SIZE); free_non_dma_mem = (TW_UINT8 *)non_dma_mem; @@ -307,7 +307,7 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle ctlr->arch_id = TWA_ARCH_ID(device_id); ctlr->flags = flags; ctlr->sg_size_factor = TWA_SG_ELEMENT_SIZE_FACTOR(device_id); - ctlr->max_simult_reqs = max_simult_reqs + 1; + ctlr->max_simult_reqs = max_simult_reqs; ctlr->max_aens_supported = max_aens; /* Initialize queues of CL internal request context packets. */ @@ -321,55 +321,23 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle tw_osl_init_lock(ctlr_handle, "tw_cl_gen_lock", ctlr->gen_lock); ctlr->io_lock = &(ctlr->io_lock_handle); tw_osl_init_lock(ctlr_handle, "tw_cl_io_lock", ctlr->io_lock); - /* - * If 64 bit cmd pkt addresses are used, we will need to serialize - * writes to the hardware (across registers), since existing (G66) - * hardware will get confused if, for example, we wrote the low 32 bits - * of the cmd pkt address, followed by a response interrupt mask to the - * control register, followed by the high 32 bits of the cmd pkt - * address. It will then interpret the value written to the control - * register as the low cmd pkt address. So, for this case, we will - * make a note that we will need to synchronize control register writes - * with command register writes. - */ - if ((ctlr->flags & TW_CL_64BIT_ADDRESSES) && - ((ctlr->device_id == TW_CL_DEVICE_ID_9K) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_X) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_E) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_SA))) { - ctlr->state |= TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED; - ctlr->intr_lock = ctlr->io_lock; - } else { - ctlr->intr_lock = &(ctlr->intr_lock_handle); - tw_osl_init_lock(ctlr_handle, "tw_cl_intr_lock", - ctlr->intr_lock); - } /* Initialize CL internal request context packets. */ ctlr->req_ctxt_buf = (struct tw_cli_req_context *)free_non_dma_mem; free_non_dma_mem += (sizeof(struct tw_cli_req_context) * - ( - max_simult_reqs + - 1)); + max_simult_reqs); ctlr->cmd_pkt_buf = (struct tw_cl_command_packet *)dma_mem; ctlr->cmd_pkt_phys = dma_mem_phys; ctlr->internal_req_data = (TW_UINT8 *) (ctlr->cmd_pkt_buf + - ( - max_simult_reqs + - 1)); + max_simult_reqs); ctlr->internal_req_data_phys = ctlr->cmd_pkt_phys + (sizeof(struct tw_cl_command_packet) * - ( - max_simult_reqs + - 1)); - - for (i = 0; - i < ( - max_simult_reqs + - 1); i++) { + max_simult_reqs); + + for (i = 0; i < max_simult_reqs; i++) { req = &(ctlr->req_ctxt_buf[i]); req->cmd_pkt = &(ctlr->cmd_pkt_buf[i]); @@ -421,8 +389,8 @@ start_ctlr: /* Notify some info about the controller to the OSL. */ tw_cli_notify_ctlr_info(ctlr); - /* Mark the controller as active. */ - ctlr->state |= TW_CLI_CTLR_STATE_ACTIVE; + /* Mark the controller active. */ + ctlr->active = TW_CL_TRUE; return(error); } @@ -597,7 +565,7 @@ tw_cl_shutdown_ctlr(struct tw_cl_ctlr_ha * Mark the controller as inactive, disable any further interrupts, * and notify the controller that we are going down. */ - ctlr->state &= ~TW_CLI_CTLR_STATE_ACTIVE; + ctlr->active = TW_CL_FALSE; tw_cli_disable_interrupts(ctlr); @@ -617,8 +585,6 @@ tw_cl_shutdown_ctlr(struct tw_cl_ctlr_ha /* Destroy all locks used by CL. */ tw_osl_destroy_lock(ctlr_handle, ctlr->gen_lock); tw_osl_destroy_lock(ctlr_handle, ctlr->io_lock); - if (!(ctlr->flags & TW_CL_64BIT_ADDRESSES)) - tw_osl_destroy_lock(ctlr_handle, ctlr->intr_lock); ret: return(error); Modified: stable/8/sys/dev/twa/tw_cl_intr.c ============================================================================== --- stable/8/sys/dev/twa/tw_cl_intr.c Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_intr.c Mon Jun 21 22:00:57 2010 (r209404) @@ -75,22 +75,16 @@ tw_cl_interrupt(struct tw_cl_ctlr_handle if (ctlr == NULL) goto out; - /* If we get an interrupt while resetting, it is a shared - one for another device, so just bail */ - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) - goto out; - /* - * Synchronize access between writes to command and control registers - * in 64-bit environments, on G66. + * Bail If we get an interrupt while resetting, or shutting down. */ - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_get_lock(ctlr_handle, ctlr->io_lock); + if (ctlr->reset_in_progress || !(ctlr->active)) + goto out; /* Read the status register to determine the type of interrupt. */ status_reg = TW_CLI_READ_STATUS_REGISTER(ctlr_handle); if (tw_cli_check_ctlr_state(ctlr, status_reg)) - goto out_unlock; + goto out; /* Clear the interrupt. */ if (status_reg & TWA_STATUS_HOST_INTERRUPT) { @@ -98,36 +92,30 @@ tw_cl_interrupt(struct tw_cl_ctlr_handle "Host interrupt"); TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, TWA_CONTROL_CLEAR_HOST_INTERRUPT); - ctlr->host_intr_pending = 0; /* we don't use this */ - rc |= TW_CL_FALSE; /* don't request for a deferred isr call */ } if (status_reg & TWA_STATUS_ATTENTION_INTERRUPT) { tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), "Attention interrupt"); + rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_attn_intr(ctlr); TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT); - ctlr->attn_intr_pending = 1; - rc |= TW_CL_TRUE; /* request for a deferred isr call */ } if (status_reg & TWA_STATUS_COMMAND_INTERRUPT) { tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), "Command interrupt"); - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_MASK_COMMAND_INTERRUPT); - ctlr->cmd_intr_pending = 1; rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_cmd_intr(ctlr); + if ((TW_CL_Q_FIRST_ITEM(&(ctlr->req_q_head[TW_CLI_PENDING_Q]))) == TW_CL_NULL) + TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, + TWA_CONTROL_MASK_COMMAND_INTERRUPT); } if (status_reg & TWA_STATUS_RESPONSE_INTERRUPT) { tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "Response interrupt"); - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_MASK_RESPONSE_INTERRUPT); - ctlr->resp_intr_pending = 1; rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_resp_intr(ctlr); } -out_unlock: - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_free_lock(ctlr_handle, ctlr->io_lock); out: return(rc); } @@ -135,52 +123,6 @@ out: /* - * Function name: tw_cl_deferred_interrupt - * Description: Deferred interrupt handler. Does most of the processing - * related to an interrupt. - * - * Input: ctlr_handle -- controller handle - * Output: None - * Return value: None - */ -TW_VOID -tw_cl_deferred_interrupt(struct tw_cl_ctlr_handle *ctlr_handle) -{ - struct tw_cli_ctlr_context *ctlr = - (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - - tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "entered"); - - /* Dispatch based on the kind of interrupt. */ - if (ctlr->host_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Host interrupt"); - ctlr->host_intr_pending = 0; - tw_cli_process_host_intr(ctlr); - } - if (ctlr->attn_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Attention interrupt"); - ctlr->attn_intr_pending = 0; - tw_cli_process_attn_intr(ctlr); - } - if (ctlr->cmd_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Command interrupt"); - ctlr->cmd_intr_pending = 0; - tw_cli_process_cmd_intr(ctlr); - } - if (ctlr->resp_intr_pending) { - tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), - "Processing Response interrupt"); - ctlr->resp_intr_pending = 0; - tw_cli_process_resp_intr(ctlr); - } -} - - - -/* * Function name: tw_cli_process_host_intr * Description: This function gets called if we triggered an interrupt. * We don't use it as of now. @@ -248,12 +190,6 @@ tw_cli_process_cmd_intr(struct tw_cli_ct { tw_cli_dbg_printf(6, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - /* - * Let the OS Layer submit any requests in its pending queue, - * if it has one. - */ - tw_osl_ctlr_ready(ctlr->ctlr_handle); - /* Start any requests that might be in the pending queue. */ tw_cli_submit_pending_queue(ctlr); @@ -286,9 +222,6 @@ tw_cli_process_resp_intr(struct tw_cli_c tw_cli_dbg_printf(10, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - /* Serialize access to the controller response queue. */ - tw_osl_get_lock(ctlr->ctlr_handle, ctlr->intr_lock); - for (;;) { status_reg = TW_CLI_READ_STATUS_REGISTER(ctlr->ctlr_handle); if ((error = tw_cli_check_ctlr_state(ctlr, status_reg))) @@ -315,7 +248,6 @@ tw_cli_process_resp_intr(struct tw_cli_c #ifdef TW_OSL_DEBUG tw_cl_print_ctlr_stats(ctlr->ctlr_handle); #endif /* TW_OSL_DEBUG */ - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->intr_lock); tw_cl_reset_ctlr(ctlr->ctlr_handle); return(TW_OSL_EIO); } @@ -330,12 +262,6 @@ tw_cli_process_resp_intr(struct tw_cli_c } - /* Unmask the response interrupt. */ - TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, - TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT); - - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->intr_lock); - /* Complete this, and other requests in the complete queue. */ tw_cli_process_complete_queue(ctlr); @@ -614,12 +540,11 @@ tw_cli_param_callback(struct tw_cli_req_ "status = %d", cmd->param.status); } - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); - if ((ctlr->state & TW_CLI_CTLR_STATE_GET_MORE_AENS) && - (!(ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS))) { - ctlr->state &= ~TW_CLI_CTLR_STATE_GET_MORE_AENS; + if ((ctlr->get_more_aens) && (!(ctlr->reset_in_progress))) { + ctlr->get_more_aens = TW_CL_FALSE; tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "Fetching more AEN's"); if ((error = tw_cli_get_aen(ctlr))) @@ -677,7 +602,7 @@ tw_cli_aen_callback(struct tw_cli_req_co } if (error) { - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return; } @@ -688,7 +613,7 @@ tw_cli_aen_callback(struct tw_cli_req_co aen_code = tw_cli_manage_aen(ctlr, req); if (aen_code != TWA_AEN_SYNC_TIME_WITH_HOST) { - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); if (aen_code != TWA_AEN_QUEUE_EMPTY) if ((error = tw_cli_get_aen(ctlr))) @@ -736,25 +661,25 @@ tw_cli_manage_aen(struct tw_cli_ctlr_con * Free the internal req pkt right here, since * tw_cli_set_param will need it. */ - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); /* * We will use a callback in tw_cli_set_param only when * interrupts are enabled and we can expect our callback - * to get called. Setting the TW_CLI_CTLR_STATE_GET_MORE_AENS + * to get called. Setting the get_more_aens * flag will make the callback continue to try to retrieve * more AEN's. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTR_ENABLED) - ctlr->state |= TW_CLI_CTLR_STATE_GET_MORE_AENS; + if (ctlr->interrupts_enabled) + ctlr->get_more_aens = TW_CL_TRUE; /* Calculate time (in seconds) since last Sunday 12.00 AM. */ local_time = tw_osl_get_local_time(); sync_time = (local_time - (3 * 86400)) % 604800; if ((error = tw_cli_set_param(ctlr, TWA_PARAM_TIME_TABLE, TWA_PARAM_TIME_SCHED_TIME, 4, &sync_time, - (ctlr->state & TW_CLI_CTLR_STATE_INTR_ENABLED) + (ctlr->interrupts_enabled) ? tw_cli_param_callback : TW_CL_NULL))) tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, @@ -799,7 +724,7 @@ tw_cli_enable_interrupts(struct tw_cli_c { tw_cli_dbg_printf(3, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - ctlr->state |= TW_CLI_CTLR_STATE_INTR_ENABLED; + ctlr->interrupts_enabled = TW_CL_TRUE; TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT | TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT | @@ -823,6 +748,6 @@ tw_cli_disable_interrupts(struct tw_cli_ TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, TWA_CONTROL_DISABLE_INTERRUPTS); - ctlr->state &= ~TW_CLI_CTLR_STATE_INTR_ENABLED; + ctlr->interrupts_enabled = TW_CL_FALSE; } Modified: stable/8/sys/dev/twa/tw_cl_io.c ============================================================================== --- stable/8/sys/dev/twa/tw_cl_io.c Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_io.c Mon Jun 21 22:00:57 2010 (r209404) @@ -49,6 +49,10 @@ #include "tw_cl_externs.h" #include "tw_osl_ioctl.h" +#include +#include +#include + /* @@ -76,11 +80,9 @@ tw_cl_start_io(struct tw_cl_ctlr_handle ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) { + if (ctlr->reset_in_progress) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), - "I/O during reset: returning busy. Ctlr state = 0x%x", - ctlr->state); - tw_osl_ctlr_busy(ctlr_handle, req_handle); + "I/O during reset: returning busy."); return(TW_OSL_EBUSY); } @@ -101,7 +103,6 @@ tw_cl_start_io(struct tw_cl_ctlr_handle )) == TW_CL_NULL) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "Out of request context packets: returning busy"); - tw_osl_ctlr_busy(ctlr_handle, req_handle); return(TW_OSL_EBUSY); } @@ -171,7 +172,6 @@ tw_cli_submit_cmd(struct tw_cli_req_cont struct tw_cl_ctlr_handle *ctlr_handle = ctlr->ctlr_handle; TW_UINT32 status_reg; TW_INT32 error; - TW_UINT8 notify_osl_of_ctlr_busy = TW_CL_FALSE; tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "entered"); @@ -208,10 +208,13 @@ tw_cli_submit_cmd(struct tw_cli_req_cont req->state = TW_CLI_REQ_STATE_PENDING; tw_cli_req_q_insert_tail(req, TW_CLI_PENDING_Q); error = 0; + /* Unmask command interrupt. */ + TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, + TWA_CONTROL_UNMASK_COMMAND_INTERRUPT); } else error = TW_OSL_EBUSY; } else { - notify_osl_of_ctlr_busy = TW_CL_TRUE; + tw_osl_ctlr_busy(ctlr_handle, req->req_handle); error = TW_OSL_EBUSY; } } else { @@ -246,25 +249,6 @@ tw_cli_submit_cmd(struct tw_cli_req_cont out: tw_osl_free_lock(ctlr_handle, ctlr->io_lock); - if (status_reg & TWA_STATUS_COMMAND_QUEUE_FULL) { - if (notify_osl_of_ctlr_busy) - tw_osl_ctlr_busy(ctlr_handle, req->req_handle); - - /* - * Synchronize access between writes to command and control - * registers in 64-bit environments, on G66. - */ - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_get_lock(ctlr_handle, ctlr->io_lock); - - /* Unmask command interrupt. */ - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_UNMASK_COMMAND_INTERRUPT); - - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_free_lock(ctlr_handle, ctlr->io_lock); - } - return(error); } @@ -299,12 +283,9 @@ tw_cl_fw_passthru(struct tw_cl_ctlr_hand ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) { + if (ctlr->reset_in_progress) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), - "Passthru request during reset: returning busy. " - "Ctlr state = 0x%x", - ctlr->state); - tw_osl_ctlr_busy(ctlr_handle, req_handle); + "Passthru request during reset: returning busy."); return(TW_OSL_EBUSY); } @@ -312,7 +293,6 @@ tw_cl_fw_passthru(struct tw_cl_ctlr_hand )) == TW_CL_NULL) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "Out of request context packets: returning busy"); - tw_osl_ctlr_busy(ctlr_handle, req_handle); return(TW_OSL_EBUSY); } @@ -759,11 +739,11 @@ tw_cli_get_param(struct tw_cli_ctlr_cont goto out; /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) { + if (ctlr->internal_req_busy) { error = TW_OSL_EBUSY; goto out; } - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; req->length = TW_CLI_SECTOR_SIZE; @@ -821,7 +801,7 @@ tw_cli_get_param(struct tw_cli_ctlr_cont goto out; } tw_osl_memcpy(param_data, param->data, param_size); - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } else { /* There's a call back. Simply submit the command. */ @@ -838,7 +818,7 @@ out: "get_param failed", "error = %d", error); if (param) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; if (req) tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return(1); @@ -878,11 +858,11 @@ tw_cli_set_param(struct tw_cli_ctlr_cont goto out; /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) { + if (ctlr->internal_req_busy) { error = TW_OSL_EBUSY; goto out; } - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; req->length = TW_CLI_SECTOR_SIZE; @@ -939,7 +919,7 @@ tw_cli_set_param(struct tw_cli_ctlr_cont &(req->cmd_pkt->cmd_hdr)); goto out; } - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } else { /* There's a call back. Simply submit the command. */ @@ -956,7 +936,7 @@ out: "set_param failed", "error = %d", error); if (param) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; if (req) tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return(error); @@ -1054,8 +1034,11 @@ tw_cli_submit_and_poll_request(struct tw * taking care of it). */ tw_cli_req_q_remove_item(req, TW_CLI_PENDING_Q); + if ((TW_CL_Q_FIRST_ITEM(&(ctlr->req_q_head[TW_CLI_PENDING_Q]))) == TW_CL_NULL) + TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, + TWA_CONTROL_MASK_COMMAND_INTERRUPT); if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } @@ -1079,12 +1062,16 @@ tw_cl_reset_ctlr(struct tw_cl_ctlr_handl { struct tw_cli_ctlr_context *ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); + struct twa_softc *sc = ctlr_handle->osl_ctlr_ctxt; TW_INT32 reset_attempt = 1; TW_INT32 error; tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "entered"); - ctlr->state |= TW_CLI_CTLR_STATE_RESET_IN_PROGRESS; + ctlr->reset_in_progress = TW_CL_TRUE; + xpt_freeze_simq(sc->sim, 1); + + tw_cli_disable_interrupts(ctlr); /* * Error back all requests in the complete, busy, and pending queues. @@ -1098,8 +1085,8 @@ tw_cl_reset_ctlr(struct tw_cl_ctlr_handl tw_cli_drain_complete_queue(ctlr); tw_cli_drain_busy_queue(ctlr); tw_cli_drain_pending_queue(ctlr); - - tw_cli_disable_interrupts(ctlr); + ctlr->internal_req_busy = TW_CL_FALSE; + ctlr->get_more_aens = TW_CL_FALSE; /* Soft reset the controller. */ try_reset: @@ -1135,7 +1122,9 @@ try_reset: " "); out: - ctlr->state &= ~TW_CLI_CTLR_STATE_RESET_IN_PROGRESS; + ctlr->reset_in_progress = TW_CL_FALSE; + xpt_release_simq(sc->sim, 1); + /* * Enable interrupts, and also clear attention and response interrupts. */ @@ -1163,6 +1152,8 @@ tw_cli_soft_reset(struct tw_cli_ctlr_con { struct tw_cl_ctlr_handle *ctlr_handle = ctlr->ctlr_handle; TW_UINT32 status_reg; + int found; + int loop_count; TW_UINT32 error; tw_cli_dbg_printf(1, ctlr_handle, tw_osl_cur_func(), "entered"); @@ -1192,12 +1183,27 @@ tw_cli_soft_reset(struct tw_cli_ctlr_con * make sure we don't access any hardware registers (for * polling) during that window. */ - ctlr->state |= TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS; - while (tw_cli_find_response(ctlr, - TWA_RESET_PHASE1_NOTIFICATION_RESPONSE) != TW_OSL_ESUCCESS) + ctlr->reset_phase1_in_progress = TW_CL_TRUE; + loop_count = 0; + do { + found = (tw_cli_find_response(ctlr, TWA_RESET_PHASE1_NOTIFICATION_RESPONSE) == TW_OSL_ESUCCESS); tw_osl_delay(10); + loop_count++; + error = 0x7888; + } while (!found && (loop_count < 6000000)); /* Loop for no more than 60 seconds */ + + if (!found) { + tw_cl_create_event(ctlr_handle, TW_CL_TRUE, + TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, + 0x1109, 0x1, TW_CL_SEVERITY_ERROR_STRING, + "Missed firmware handshake after soft-reset", + "error = %d", error); + tw_osl_free_lock(ctlr_handle, ctlr->io_lock); + return(error); + } + tw_osl_delay(TWA_RESET_PHASE1_WAIT_TIME_MS * 1000); - ctlr->state &= ~TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS; + ctlr->reset_phase1_in_progress = TW_CL_FALSE; } if ((error = tw_cli_poll_status(ctlr, @@ -1285,9 +1291,9 @@ tw_cli_send_scsi_cmd(struct tw_cli_req_c tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) + if (ctlr->internal_req_busy) return(TW_OSL_EBUSY); - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; tw_osl_memzero(req->data, TW_CLI_SECTOR_SIZE); @@ -1365,7 +1371,7 @@ tw_cli_get_aen(struct tw_cli_ctlr_contex "Could not send SCSI command", "request = %p, error = %d", req, error); if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } return(error); Modified: stable/8/sys/dev/twa/tw_cl_misc.c ============================================================================== --- stable/8/sys/dev/twa/tw_cl_misc.c Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_misc.c Mon Jun 21 22:00:57 2010 (r209404) @@ -368,14 +368,14 @@ tw_cli_drain_aen_queue(struct tw_cli_ctl if (aen_code == TWA_AEN_SYNC_TIME_WITH_HOST) continue; - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } out: if (req) { if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } return(error); @@ -447,34 +447,7 @@ tw_cli_poll_status(struct tw_cli_ctlr_co /* got the required bit(s) */ return(TW_OSL_ESUCCESS); - /* - * The OSL should not define TW_OSL_CAN_SLEEP if it calls - * tw_cl_deferred_interrupt from within the ISR and not a - * lower interrupt level, since, in that case, we might end - * up here, and try to sleep (within an ISR). - */ -#ifndef TW_OSL_CAN_SLEEP - /* OSL doesn't support sleeping; will spin. */ - tw_osl_delay(1000); -#else /* TW_OSL_CAN_SLEEP */ -#if 0 - /* Will spin if initializing, sleep otherwise. */ - if (!(ctlr->state & TW_CLI_CTLR_STATE_ACTIVE)) - tw_osl_delay(1000); - else - tw_osl_sleep(ctlr->ctlr_handle, - &(ctlr->sleep_handle), 1 /* ms */); -#else /* #if 0 */ - /* - * Will always spin for now (since reset holds a spin lock). - * We could free io_lock after the call to TW_CLI_SOFT_RESET, - * so we could sleep here. To block new requests (since - * the lock will have been released) we could use the - * ...RESET_IN_PROGRESS flag. Need to revisit. - */ tw_osl_delay(1000); -#endif /* #if 0 */ -#endif /* TW_OSL_CAN_SLEEP */ } while (tw_osl_get_local_time() <= end_time); return(TW_OSL_ETIMEDOUT); @@ -736,22 +709,20 @@ tw_cli_check_ctlr_state(struct tw_cli_ct tw_cli_dbg_printf(8, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); /* Check if the 'micro-controller ready' bit is not set. */ - if ((status_reg & TWA_STATUS_EXPECTED_BITS) != - TWA_STATUS_EXPECTED_BITS) { + if (!(status_reg & TWA_STATUS_MICROCONTROLLER_READY)) { TW_INT8 desc[200]; tw_osl_memzero(desc, 200); - if ((status_reg & TWA_STATUS_MICROCONTROLLER_READY) || - (!(ctlr->state & - TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS))) { + if (!(ctlr->reset_phase1_in_progress)) { tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, 0x1301, 0x1, TW_CL_SEVERITY_ERROR_STRING, "Missing expected status bit(s)", "status reg = 0x%x; Missing bits: %s", status_reg, - tw_cli_describe_bits (~status_reg & - TWA_STATUS_EXPECTED_BITS, desc)); + tw_cli_describe_bits( + TWA_STATUS_MICROCONTROLLER_READY, + desc)); error = TW_OSL_EGENFAILURE; } } @@ -765,7 +736,7 @@ tw_cli_check_ctlr_state(struct tw_cli_ct /* Skip queue error msgs during 9650SE/9690SA reset */ if (((ctlr->device_id != TW_CL_DEVICE_ID_9K_E) && (ctlr->device_id != TW_CL_DEVICE_ID_9K_SA)) || - ((ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) == 0) || + (!(ctlr->reset_in_progress)) || ((status_reg & TWA_STATUS_QUEUE_ERROR_INTERRUPT) == 0)) tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, @@ -819,7 +790,7 @@ tw_cli_check_ctlr_state(struct tw_cli_ct /* Skip queue error msgs during 9650SE/9690SA reset */ if (((ctlr->device_id != TW_CL_DEVICE_ID_9K_E) && (ctlr->device_id != TW_CL_DEVICE_ID_9K_SA)) || - ((ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) == 0)) + (!(ctlr->reset_in_progress))) tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, 0x1305, 0x1, TW_CL_SEVERITY_ERROR_STRING, Modified: stable/8/sys/dev/twa/tw_cl_share.h ============================================================================== --- stable/8/sys/dev/twa/tw_cl_share.h Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_share.h Mon Jun 21 22:00:57 2010 (r209404) @@ -76,7 +76,7 @@ * of supporting only 255, since we want to keep one CL internal request * context packet always available for internal requests. */ -#define TW_CL_MAX_SIMULTANEOUS_REQUESTS 0xFF /* max simult reqs supported */ +#define TW_CL_MAX_SIMULTANEOUS_REQUESTS 256 /* max simult reqs supported */ #define TW_CL_MAX_32BIT_SG_ELEMENTS 109 /* max 32-bit sg elements */ #define TW_CL_MAX_64BIT_SG_ELEMENTS 72 /* max 64-bit sg elements */ @@ -144,6 +144,7 @@ struct tw_cl_ctlr_handle { struct tw_cl_req_handle { TW_VOID *osl_req_ctxt; /* OSL's request context */ TW_VOID *cl_req_ctxt; /* CL's request context */ + TW_UINT8 is_io; /* Only freeze/release simq for IOs */ }; @@ -353,12 +354,6 @@ extern TW_VOID tw_osl_ctlr_busy(struct t #endif -#ifndef tw_osl_ctlr_ready -/* Called on cmd interrupt. Allows re-submission of any pending requests. */ -extern TW_VOID tw_osl_ctlr_ready(struct tw_cl_ctlr_handle *ctlr_handle); -#endif - - #ifndef tw_osl_cur_func /* Text name of current function. */ extern TW_INT8 *tw_osl_cur_func(TW_VOID); @@ -528,10 +523,6 @@ extern TW_VOID tw_cl_create_event(struct extern TW_INT32 tw_cl_ctlr_supported(TW_INT32 vendor_id, TW_INT32 device_id); -/* Deferred interrupt handler. */ -extern TW_VOID tw_cl_deferred_interrupt(struct tw_cl_ctlr_handle *ctlr_handle); - - /* Submit a firmware cmd packet. */ extern TW_INT32 tw_cl_fw_passthru(struct tw_cl_ctlr_handle *ctlr_handle, struct tw_cl_req_packet *req_pkt, struct tw_cl_req_handle *req_handle); Modified: stable/8/sys/dev/twa/tw_osl.h ============================================================================== --- stable/8/sys/dev/twa/tw_osl.h Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_osl.h Mon Jun 21 22:00:57 2010 (r209404) @@ -50,13 +50,11 @@ #define TW_OSLI_DEVICE_NAME "3ware 9000 series Storage Controller" #define TW_OSLI_MALLOC_CLASS M_TWA -#define TW_OSLI_MAX_NUM_IOS TW_CL_MAX_SIMULTANEOUS_REQUESTS +#define TW_OSLI_MAX_NUM_REQUESTS TW_CL_MAX_SIMULTANEOUS_REQUESTS +/* Reserve two command packets. One for ioctls and one for AENs */ +#define TW_OSLI_MAX_NUM_IOS (TW_OSLI_MAX_NUM_REQUESTS - 2) #define TW_OSLI_MAX_NUM_AENS 0x100 -/* Disabled, doesn't work yet. -#define TW_OSLI_DEFERRED_INTR_USED -*/ - #ifdef PAE #define TW_OSLI_DMA_BOUNDARY (1u << 31) #else @@ -80,10 +78,6 @@ #define TW_OSLI_REQ_FLAGS_PASSTHRU (1<<5) /* pass through request */ #define TW_OSLI_REQ_FLAGS_SLEEPING (1<<6) /* owner sleeping on this cmd */ -/* Possible values of sc->state. */ -#define TW_OSLI_CTLR_STATE_OPEN (1<<0) /* control device is open */ -#define TW_OSLI_CTLR_STATE_SIMQ_FROZEN (1<<1) /* simq frozen */ - #ifdef TW_OSL_DEBUG struct tw_osli_q_stats { @@ -101,6 +95,8 @@ struct tw_osli_q_stats { /* Driver's request packet. */ struct tw_osli_req_context { struct tw_cl_req_handle req_handle;/* tag to track req b/w OSL & CL */ + struct mtx ioctl_wake_timeout_lock_handle;/* non-spin lock used to detect ioctl timeout */ + struct mtx *ioctl_wake_timeout_lock;/* ptr to above lock */ struct twa_softc *ctlr; /* ptr to OSL's controller context */ TW_VOID *data; /* ptr to data being passed to CL */ TW_UINT32 length; /* length of buf being passed to CL */ @@ -130,10 +126,10 @@ struct tw_osli_req_context { /* Per-controller structure. */ struct twa_softc { struct tw_cl_ctlr_handle ctlr_handle; - struct tw_osli_req_context *req_ctxt_buf; + struct tw_osli_req_context *req_ctx_buf; /* Controller state. */ - TW_UINT32 state; + TW_UINT8 open; TW_UINT32 flags; TW_INT32 device_id; Modified: stable/8/sys/dev/twa/tw_osl_cam.c ============================================================================== --- stable/8/sys/dev/twa/tw_osl_cam.c Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_osl_cam.c Mon Jun 21 22:00:57 2010 (r209404) @@ -81,7 +81,7 @@ tw_osli_cam_attach(struct twa_softc *sc) /* * Create the device queue for our SIM. */ - if ((devq = cam_simq_alloc(TW_OSLI_MAX_NUM_IOS)) == NULL) { + if ((devq = cam_simq_alloc(TW_OSLI_MAX_NUM_REQUESTS)) == NULL) { tw_osli_printf(sc, "error = %d", TW_CL_SEVERITY_ERROR_STRING, TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, @@ -92,15 +92,15 @@ tw_osli_cam_attach(struct twa_softc *sc) } /* - * Create a SIM entry. Though we can support TW_OSLI_MAX_NUM_IOS + * Create a SIM entry. Though we can support TW_OSLI_MAX_NUM_REQUESTS * simultaneous requests, we claim to be able to handle only - * (TW_OSLI_MAX_NUM_IOS - 1), so that we always have a request - * packet available to service ioctls. + * TW_OSLI_MAX_NUM_IOS (two less), so that we always have a request + * packet available to service ioctls and AENs. */ tw_osli_dbg_dprintf(3, sc, "Calling cam_sim_alloc"); sc->sim = cam_sim_alloc(twa_action, twa_poll, "twa", sc, device_get_unit(sc->bus_dev), sc->sim_lock, - TW_OSLI_MAX_NUM_IOS - 1, 1, devq); + TW_OSLI_MAX_NUM_IOS, 1, devq); if (sc->sim == NULL) { cam_simq_free(devq); tw_osli_printf(sc, "error = %d", @@ -168,14 +168,6 @@ tw_osli_cam_detach(struct twa_softc *sc) { tw_osli_dbg_dprintf(3, sc, "entered"); -#ifdef TW_OSLI_DEFERRED_INTR_USED - /* - drain the taskqueue - Ctrl is already went down so, no more enqueuetask will - happen . Don't hold any locks, that task might need. - */ - - taskqueue_drain(taskqueue_fast, &(sc->deferred_intr_callback)); -#endif mtx_lock(sc->sim_lock); if (sc->path) @@ -236,7 +228,7 @@ tw_osli_execute_scsi(struct tw_osli_req_ TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, 0x2105, "Physical CDB address!"); - ccb_h->status = CAM_REQ_CMP_ERR; + ccb_h->status = CAM_REQ_INVALID; xpt_done(ccb); return(1); } @@ -297,7 +289,7 @@ tw_osli_execute_scsi(struct tw_osli_req_ TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, 0x2107, "XPT_SCSI_IO: Got SGList"); - ccb_h->status = CAM_REQ_CMP_ERR; + ccb_h->status = CAM_REQ_INVALID; xpt_done(ccb); return(1); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 01:30:47 2010 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 6C4E8106564A; Tue, 22 Jun 2010 01:30:47 +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 415958FC13; Tue, 22 Jun 2010 01:30: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 o5M1Ul5W095468; Tue, 22 Jun 2010 01:30:47 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M1UlYb095465; Tue, 22 Jun 2010 01:30:47 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201006220130.o5M1UlYb095465@svn.freebsd.org> From: Rick Macklem Date: Tue, 22 Jun 2010 01:30: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: r209409 - in stable/8/sys/fs: nfsclient nfsserver 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, 22 Jun 2010 01:30:47 -0000 Author: rmacklem Date: Tue Jun 22 01:30:46 2010 New Revision: 209409 URL: http://svn.freebsd.org/changeset/base/209409 Log: MFC: r209191 Add MODULE_DEPEND() macros to the experimental NFS client and server so that the modules will load when kernels are built with none of the NFS* configuration options specified. I believe this resolves the problems reported by PR kern/144458 and the email on freebsd-stable@ posted by Dmitry Pryanishnikov on June 13. Modified: stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Tue Jun 22 00:26:07 2010 (r209408) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Tue Jun 22 01:30:46 2010 (r209409) @@ -1275,4 +1275,6 @@ DECLARE_MODULE(nfscl, nfscl_mod, SI_SUB_ /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfscl, 1); MODULE_DEPEND(nfscl, nfscommon, 1, 1, 1); +MODULE_DEPEND(nfscl, krpc, 1, 1, 1); +MODULE_DEPEND(nfscl, nfssvc, 1, 1, 1); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Jun 22 00:26:07 2010 (r209408) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Jun 22 01:30:46 2010 (r209409) @@ -3147,4 +3147,6 @@ DECLARE_MODULE(nfsd, nfsd_mod, SI_SUB_VF MODULE_VERSION(nfsd, 1); MODULE_DEPEND(nfsd, nfscommon, 1, 1, 1); MODULE_DEPEND(nfsd, nfslockd, 1, 1, 1); +MODULE_DEPEND(nfsd, krpc, 1, 1, 1); +MODULE_DEPEND(nfsd, nfssvc, 1, 1, 1); From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 04:37:06 2010 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 1D52C106566B; Tue, 22 Jun 2010 04:37:06 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B0518FC0C; Tue, 22 Jun 2010 04:37: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 o5M4b5R6036673; Tue, 22 Jun 2010 04:37:05 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M4b5P7036669; Tue, 22 Jun 2010 04:37:05 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006220437.o5M4b5P7036669@svn.freebsd.org> From: Matt Jacob Date: Tue, 22 Jun 2010 04:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209410 - stable/8/sys/cam/scsi 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, 22 Jun 2010 04:37:06 -0000 Author: mjacob Date: Tue Jun 22 04:37:05 2010 New Revision: 209410 URL: http://svn.freebsd.org/changeset/base/209410 Log: This is an MFC of 208905 Make additional definitions up to and including SPC-4. Add in definitions for REPORT and SET TARGET PORT GROUP commands (foundations for future work). Regularize opcodes to be upper case hex. Pick *one* of tab or space after #define (tab) and stick with that. Modified: stable/8/sys/cam/scsi/scsi_all.c stable/8/sys/cam/scsi/scsi_all.h stable/8/sys/cam/scsi/scsi_ch.h Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.c Tue Jun 22 01:30:46 2010 (r209409) +++ stable/8/sys/cam/scsi/scsi_all.c Tue Jun 22 04:37:05 2010 (r209410) @@ -3954,6 +3954,57 @@ scsi_report_luns(struct ccb_scsiio *csio scsi_ulto4b(alloc_len, scsi_cmd->length); } +void +scsi_report_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t pdf, + void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_target_group *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + /*data_ptr*/(u_int8_t *)buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_target_group *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_IN; + scsi_cmd->service_action = REPORT_TARGET_PORT_GROUPS | pdf; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + +void +scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_target_group *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + /*data_ptr*/(u_int8_t *)buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_target_group *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_OUT; + scsi_cmd->service_action = SET_TARGET_PORT_GROUPS; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + /* * Syncronize the media to the contents of the cache for * the given lba/count pair. Specifying 0/0 means sync Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 01:30:46 2010 (r209409) +++ stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 04:37:05 2010 (r209410) @@ -22,7 +22,7 @@ */ #ifndef _SCSI_SCSI_ALL_H -#define _SCSI_SCSI_ALL_H 1 +#define _SCSI_SCSI_ALL_H 1 #include @@ -41,13 +41,13 @@ extern int scsi_delay; /* * Define dome bits that are in ALL (or a lot of) scsi commands */ -#define SCSI_CTL_LINK 0x01 -#define SCSI_CTL_FLAG 0x02 -#define SCSI_CTL_VENDOR 0xC0 +#define SCSI_CTL_LINK 0x01 +#define SCSI_CTL_FLAG 0x02 +#define SCSI_CTL_VENDOR 0xC0 #define SCSI_CMD_LUN 0xA0 /* these two should not be needed */ #define SCSI_CMD_LUN_SHIFT 5 /* LUN in the cmd is no longer SCSI */ -#define SCSI_MAX_CDBLEN 16 /* +#define SCSI_MAX_CDBLEN 16 /* * 16 byte commands are in the * SCSI-3 spec */ @@ -56,7 +56,7 @@ extern int scsi_delay; #endif /* 6byte CDBs special case 0 length to be 256 */ -#define SCSI_CDB6_LEN(len) ((len) == 0 ? 256 : len) +#define SCSI_CDB6_LEN(len) ((len) == 0 ? 256 : len) /* * This type defines actions to be taken when a particular sense code is @@ -94,16 +94,16 @@ typedef enum { } scsi_sense_action_qualifier; /* Mask for error status values */ -#define SS_ERRMASK 0xff +#define SS_ERRMASK 0xff /* The default, retyable, error action */ -#define SS_RDEF SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE|EIO +#define SS_RDEF SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE|EIO /* The retyable, error action, with table specified error code */ -#define SS_RET SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE +#define SS_RET SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE /* Fatal error action, with table specified error code */ -#define SS_FATAL SS_FAIL|SSQ_PRINT_SENSE +#define SS_FATAL SS_FAIL|SSQ_PRINT_SENSE struct scsi_generic { @@ -168,16 +168,16 @@ struct scsi_mode_sense_6 #define SMS_DBD 0x08 u_int8_t page; #define SMS_PAGE_CODE 0x3F -#define SMS_VENDOR_SPECIFIC_PAGE 0x00 -#define SMS_DISCONNECT_RECONNECT_PAGE 0x02 -#define SMS_FORMAT_DEVICE_PAGE 0x03 -#define SMS_GEOMETRY_PAGE 0x04 -#define SMS_CACHE_PAGE 0x08 -#define SMS_PERIPHERAL_DEVICE_PAGE 0x09 -#define SMS_CONTROL_MODE_PAGE 0x0A -#define SMS_PROTO_SPECIFIC_PAGE 0x19 -#define SMS_INFO_EXCEPTIONS_PAGE 0x1C -#define SMS_ALL_PAGES_PAGE 0x3F +#define SMS_VENDOR_SPECIFIC_PAGE 0x00 +#define SMS_DISCONNECT_RECONNECT_PAGE 0x02 +#define SMS_FORMAT_DEVICE_PAGE 0x03 +#define SMS_GEOMETRY_PAGE 0x04 +#define SMS_CACHE_PAGE 0x08 +#define SMS_PERIPHERAL_DEVICE_PAGE 0x09 +#define SMS_CONTROL_MODE_PAGE 0x0A +#define SMS_PROTO_SPECIFIC_PAGE 0x19 +#define SMS_INFO_EXCEPTIONS_PAGE 0x1C +#define SMS_ALL_PAGES_PAGE 0x3F #define SMS_PAGE_CTRL_MASK 0xC0 #define SMS_PAGE_CTRL_CURRENT 0x00 #define SMS_PAGE_CTRL_CHANGEABLE 0x40 @@ -262,8 +262,8 @@ struct scsi_log_sense #define SLS_ERROR_VERIFY_PAGE 0x05 #define SLS_ERROR_NONMEDIUM_PAGE 0x06 #define SLS_ERROR_LASTN_PAGE 0x07 -#define SLS_SELF_TEST_PAGE 0x10 -#define SLS_IE_PAGE 0x2f +#define SLS_SELF_TEST_PAGE 0x10 +#define SLS_IE_PAGE 0x2f #define SLS_PAGE_CTRL_MASK 0xC0 #define SLS_PAGE_CTRL_THRESHOLD 0x00 #define SLS_PAGE_CTRL_CUMULATIVE 0x40 @@ -320,30 +320,30 @@ struct scsi_control_page { u_int8_t page_code; u_int8_t page_length; u_int8_t rlec; -#define SCB_RLEC 0x01 /*Report Log Exception Cond*/ +#define SCB_RLEC 0x01 /*Report Log Exception Cond*/ u_int8_t queue_flags; -#define SCP_QUEUE_ALG_MASK 0xF0 -#define SCP_QUEUE_ALG_RESTRICTED 0x00 -#define SCP_QUEUE_ALG_UNRESTRICTED 0x10 -#define SCP_QUEUE_ERR 0x02 /*Queued I/O aborted for CACs*/ -#define SCP_QUEUE_DQUE 0x01 /*Queued I/O disabled*/ +#define SCP_QUEUE_ALG_MASK 0xF0 +#define SCP_QUEUE_ALG_RESTRICTED 0x00 +#define SCP_QUEUE_ALG_UNRESTRICTED 0x10 +#define SCP_QUEUE_ERR 0x02 /*Queued I/O aborted for CACs*/ +#define SCP_QUEUE_DQUE 0x01 /*Queued I/O disabled*/ u_int8_t eca_and_aen; -#define SCP_EECA 0x80 /*Enable Extended CA*/ -#define SCP_RAENP 0x04 /*Ready AEN Permission*/ -#define SCP_UAAENP 0x02 /*UA AEN Permission*/ -#define SCP_EAENP 0x01 /*Error AEN Permission*/ +#define SCP_EECA 0x80 /*Enable Extended CA*/ +#define SCP_RAENP 0x04 /*Ready AEN Permission*/ +#define SCP_UAAENP 0x02 /*UA AEN Permission*/ +#define SCP_EAENP 0x01 /*Error AEN Permission*/ u_int8_t reserved; u_int8_t aen_holdoff_period[2]; }; struct scsi_cache_page { u_int8_t page_code; -#define SCHP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SCHP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t cache_flags; -#define SCHP_FLAGS_WCE 0x04 /* Write Cache Enable */ -#define SCHP_FLAGS_MF 0x02 /* Multiplication factor */ -#define SCHP_FLAGS_RCD 0x01 /* Read Cache Disable */ +#define SCHP_FLAGS_WCE 0x04 /* Write Cache Enable */ +#define SCHP_FLAGS_MF 0x02 /* Multiplication factor */ +#define SCHP_FLAGS_RCD 0x01 /* Read Cache Disable */ u_int8_t rw_cache_policy; u_int8_t dis_prefetch[2]; u_int8_t min_prefetch[2]; @@ -353,16 +353,16 @@ struct scsi_cache_page { struct scsi_info_exceptions_page { u_int8_t page_code; -#define SIEP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SIEP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t info_flags; -#define SIEP_FLAGS_PERF 0x80 -#define SIEP_FLAGS_EBF 0x20 -#define SIEP_FLAGS_EWASC 0x10 -#define SIEP_FLAGS_DEXCPT 0x08 -#define SIEP_FLAGS_TEST 0x04 -#define SIEP_FLAGS_EBACKERR 0x02 -#define SIEP_FLAGS_LOGERR 0x01 +#define SIEP_FLAGS_PERF 0x80 +#define SIEP_FLAGS_EBF 0x20 +#define SIEP_FLAGS_EWASC 0x10 +#define SIEP_FLAGS_DEXCPT 0x08 +#define SIEP_FLAGS_TEST 0x04 +#define SIEP_FLAGS_EBACKERR 0x02 +#define SIEP_FLAGS_LOGERR 0x01 u_int8_t mrie; u_int8_t interval_timer[4]; u_int8_t report_count[4]; @@ -370,19 +370,19 @@ struct scsi_info_exceptions_page { struct scsi_proto_specific_page { u_int8_t page_code; -#define SPSP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SPSP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t protocol; -#define SPSP_PROTO_FC 0x00 -#define SPSP_PROTO_SPI 0x01 -#define SPSP_PROTO_SSA 0x02 -#define SPSP_PROTO_1394 0x03 -#define SPSP_PROTO_RDMA 0x04 -#define SPSP_PROTO_ISCSI 0x05 -#define SPSP_PROTO_SAS 0x06 -#define SPSP_PROTO_ADT 0x07 -#define SPSP_PROTO_ATA 0x08 -#define SPSP_PROTO_NONE 0x0f +#define SPSP_PROTO_FC 0x00 +#define SPSP_PROTO_SPI 0x01 +#define SPSP_PROTO_SSA 0x02 +#define SPSP_PROTO_1394 0x03 +#define SPSP_PROTO_RDMA 0x04 +#define SPSP_PROTO_ISCSI 0x05 +#define SPSP_PROTO_SAS 0x06 +#define SPSP_PROTO_ADT 0x07 +#define SPSP_PROTO_ATA 0x08 +#define SPSP_PROTO_NONE 0x0f }; struct scsi_reserve @@ -412,7 +412,7 @@ struct scsi_prevent u_int8_t control; }; #define PR_PREVENT 0x01 -#define PR_ALLOW 0x00 +#define PR_ALLOW 0x00 struct scsi_sync_cache { @@ -490,7 +490,7 @@ struct scsi_rw_12 { u_int8_t opcode; #define SRW12_RELADDR 0x01 -#define SRW12_FUA 0x08 +#define SRW12_FUA 0x08 #define SRW12_DPO 0x10 u_int8_t byte2; u_int8_t addr[4]; @@ -527,13 +527,13 @@ struct scsi_start_stop_unit struct ata_pass_12 { u_int8_t opcode; u_int8_t protocol; -#define AP_MULTI 0xe0 +#define AP_MULTI 0xe0 u_int8_t flags; -#define AP_T_LEN 0x03 -#define AP_BB 0x04 -#define AP_T_DIR 0x08 -#define AP_CK_COND 0x20 -#define AP_OFFLINE 0x60 +#define AP_T_LEN 0x03 +#define AP_BB 0x04 +#define AP_T_DIR 0x08 +#define AP_CK_COND 0x20 +#define AP_OFFLINE 0x60 u_int8_t features; u_int8_t sector_count; u_int8_t lba_low; @@ -548,7 +548,7 @@ struct ata_pass_12 { struct ata_pass_16 { u_int8_t opcode; u_int8_t protocol; -#define AP_EXTEND 0x01 +#define AP_EXTEND 0x01 u_int8_t flags; u_int8_t features_ext; u_int8_t features; @@ -565,51 +565,69 @@ struct ata_pass_16 { u_int8_t control; }; -#define SC_SCSI_1 0x01 -#define SC_SCSI_2 0x03 +#define SC_SCSI_1 0x01 +#define SC_SCSI_2 0x03 /* * Opcodes */ #define TEST_UNIT_READY 0x00 -#define REQUEST_SENSE 0x03 +#define REQUEST_SENSE 0x03 #define READ_6 0x08 -#define WRITE_6 0x0a -#define INQUIRY 0x12 -#define MODE_SELECT_6 0x15 -#define MODE_SENSE_6 0x1a -#define START_STOP_UNIT 0x1b -#define START_STOP 0x1b -#define RESERVE 0x16 -#define RELEASE 0x17 -#define RECEIVE_DIAGNOSTIC 0x1c -#define SEND_DIAGNOSTIC 0x1d -#define PREVENT_ALLOW 0x1e +#define WRITE_6 0x0A +#define INQUIRY 0x12 +#define MODE_SELECT_6 0x15 +#define MODE_SENSE_6 0x1A +#define START_STOP_UNIT 0x1B +#define START_STOP 0x1B +#define RESERVE 0x16 +#define RELEASE 0x17 +#define RECEIVE_DIAGNOSTIC 0x1C +#define SEND_DIAGNOSTIC 0x1D +#define PREVENT_ALLOW 0x1E #define READ_CAPACITY 0x25 #define READ_10 0x28 -#define WRITE_10 0x2a -#define POSITION_TO_ELEMENT 0x2b +#define WRITE_10 0x2A +#define POSITION_TO_ELEMENT 0x2B #define SYNCHRONIZE_CACHE 0x35 #define READ_DEFECT_DATA_10 0x37 -#define WRITE_BUFFER 0x3b -#define READ_BUFFER 0x3c +#define WRITE_BUFFER 0x3B +#define READ_BUFFER 0x3C #define CHANGE_DEFINITION 0x40 -#define LOG_SELECT 0x4c -#define LOG_SENSE 0x4d +#define LOG_SELECT 0x4C +#define LOG_SENSE 0x4D #define MODE_SELECT_10 0x55 #define MODE_SENSE_10 0x5A #define ATA_PASS_16 0x85 #define READ_16 0x88 -#define WRITE_16 0x8a -#define SERVICE_ACTION_IN 0x9e +#define WRITE_16 0x8A +#define SERVICE_ACTION_IN 0x9E #define REPORT_LUNS 0xA0 -#define ATA_PASS_12 0xa1 -#define MOVE_MEDIUM 0xa5 -#define READ_12 0xa8 -#define WRITE_12 0xaa -#define READ_ELEMENT_STATUS 0xb8 - +#define ATA_PASS_12 0xA1 +#define MAINTENANCE_IN 0xA3 +#define MAINTENANCE_OUT 0xA4 +#define MOVE_MEDIUM 0xA5 +#define READ_12 0xA8 +#define WRITE_12 0xAA +#define READ_ELEMENT_STATUS 0xB8 + +/* Maintenance In Service Action Codes */ +#define REPORT_IDENTIFYING_INFRMATION 0x05 +#define REPORT_TARGET_PORT_GROUPS 0x0A +#define REPORT_ALIASES 0x0B +#define REPORT_SUPPORTED_OPERATION_CODES 0x0C +#define REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS 0x0D +#define REPORT_PRIORITY 0x0E +#define REPORT_TIMESTAMP 0x0F +#define MANAGEMENT_PROTOCOL_IN 0x10 +/* Maintenance Out Service Action Codes */ +#define SET_IDENTIFY_INFORMATION 0x06 +#define SET_TARGET_PORT_GROUPS 0x0A +#define CHANGE_ALIASES 0x0B +#define SET_PRIORITY 0x0E +#define SET_TIMESTAMP 0x0F +#define MANGAEMENT_PROTOCOL_OUT 0x10 /* * Device Types @@ -635,7 +653,7 @@ struct ata_pass_16 { #define T_NODEVICE 0x1f #define T_ANY 0xff /* Used in Quirk table matches */ -#define T_REMOV 1 +#define T_REMOV 1 #define T_FIXED 0 /* @@ -670,7 +688,7 @@ struct scsi_inquiry_data * physical device is not currently * connected to this logical unit. */ -#define SID_QUAL_RSVD 0x02 +#define SID_QUAL_RSVD 0x02 #define SID_QUAL_BAD_LU 0x03 /* * The target is not capable of * supporting a physical device on @@ -688,30 +706,39 @@ struct scsi_inquiry_data #define SID_QUAL2 0x7F #define SID_IS_REMOVABLE(inq_data) (((inq_data)->dev_qual2 & 0x80) != 0) u_int8_t version; -#define SID_ANSI_REV(inq_data) ((inq_data)->version & 0x07) +#define SID_ANSI_REV(inq_data) ((inq_data)->version & 0x07) #define SCSI_REV_0 0 #define SCSI_REV_CCS 1 #define SCSI_REV_2 2 #define SCSI_REV_SPC 3 #define SCSI_REV_SPC2 4 +#define SCSI_REV_SPC3 5 +#define SCSI_REV_SPC4 6 -#define SID_ECMA 0x38 -#define SID_ISO 0xC0 +#define SID_ECMA 0x38 +#define SID_ISO 0xC0 u_int8_t response_format; -#define SID_AENC 0x80 -#define SID_TrmIOP 0x40 +#define SID_AENC 0x80 +#define SID_TrmIOP 0x40 u_int8_t additional_length; #define SID_ADDITIONAL_LENGTH(iqd) \ ((iqd)->additional_length + \ offsetof(struct scsi_inquiry_data, additional_length) + 1) - u_int8_t reserved; + u_int8_t spc3_flags; +#define SPC3_SID_PROTECT 0x01 +#define SPC3_SID_3PC 0x08 +#define SPC3_SID_TPGS_MASK 0x30 +#define SPC3_SID_TPGS_IMPLICIT 0x10 +#define SPC3_SID_TPGS_EXPLICIT 0x20 +#define SPC3_SID_ACC 0x40 +#define SPC3_SID_SCCS 0x80 u_int8_t spc2_flags; -#define SPC2_SID_MChngr 0x08 -#define SPC2_SID_MultiP 0x10 -#define SPC2_SID_EncServ 0x40 -#define SPC2_SID_BQueue 0x80 +#define SPC2_SID_MChngr 0x08 +#define SPC2_SID_MultiP 0x10 +#define SPC2_SID_EncServ 0x40 +#define SPC2_SID_BQueue 0x80 -#define INQ_DATA_TQ_ENABLED(iqd) \ +#define INQ_DATA_TQ_ENABLED(iqd) \ ((SID_ANSI_REV(iqd) < SCSI_REV_SPC2)? ((iqd)->flags & SID_CmdQue) : \ (((iqd)->flags & SID_CmdQue) && !((iqd)->spc2_flags & SPC2_SID_BQueue)) || \ (!((iqd)->flags & SID_CmdQue) && ((iqd)->spc2_flags & SPC2_SID_BQueue))) @@ -724,11 +751,11 @@ struct scsi_inquiry_data #define SID_WBus16 0x20 #define SID_WBus32 0x40 #define SID_RelAdr 0x80 -#define SID_VENDOR_SIZE 8 +#define SID_VENDOR_SIZE 8 char vendor[SID_VENDOR_SIZE]; -#define SID_PRODUCT_SIZE 16 +#define SID_PRODUCT_SIZE 16 char product[SID_PRODUCT_SIZE]; -#define SID_REVISION_SIZE 4 +#define SID_REVISION_SIZE 4 char revision[SID_REVISION_SIZE]; /* * The following fields were taken from SCSI Primary Commands - 2 @@ -769,10 +796,10 @@ struct scsi_vpd_supported_page_list { u_int8_t device; u_int8_t page_code; -#define SVPD_SUPPORTED_PAGE_LIST 0x00 +#define SVPD_SUPPORTED_PAGE_LIST 0x00 u_int8_t reserved; u_int8_t length; /* number of VPD entries */ -#define SVPD_SUPPORTED_PAGES_SIZE 251 +#define SVPD_SUPPORTED_PAGES_SIZE 251 u_int8_t list[SVPD_SUPPORTED_PAGES_SIZE]; }; @@ -780,10 +807,10 @@ struct scsi_vpd_unit_serial_number { u_int8_t device; u_int8_t page_code; -#define SVPD_UNIT_SERIAL_NUMBER 0x80 +#define SVPD_UNIT_SERIAL_NUMBER 0x80 u_int8_t reserved; u_int8_t length; /* serial number length */ -#define SVPD_SERIAL_NUM_SIZE 251 +#define SVPD_SERIAL_NUM_SIZE 251 u_int8_t serial_num[SVPD_SERIAL_NUM_SIZE]; }; @@ -860,6 +887,63 @@ struct scsi_report_luns_data { #define RPL_LUNDATA_ATYP_LUN 0x80 #define RPL_LUNDATA_ATYP_EXTLUN 0xc0 +struct scsi_target_group +{ + uint8_t opcode; + uint8_t service_action; +#define STG_PDF_LENGTH 0x00 +#define RPL_PDF_EXTENDED 0x20 + uint8_t reserved1[3]; + uint8_t length[4]; + uint8_t reserved2; + uint8_t control; +}; + +struct scsi_target_port_descriptor { + uint8_t reserved[2]; + uint8_t relative_target_port_identifier[2]; +}; + +struct scsi_target_port_group_descriptor { + uint8_t pref_state; +#define TPG_PRIMARY 0x80 +#define TPG_ASYMMETRIC_ACCESS_STATE_MASK 0xf +#define TPG_ASYMMETRIC_ACCESS_OPTIMIZED 0x0 +#define TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED 0x1 +#define TPG_ASYMMETRIC_ACCESS_STANDBY 0x2 +#define TPG_ASYMMETRIC_ACCESS_UNAVAILABLE 0x3 +#define TPG_ASYMMETRIC_ACCESS_LBA_DEPENDENT 0x4 +#define TPG_ASYMMETRIC_ACCESS_OFFLINE 0xE +#define TPG_ASYMMETRIC_ACCESS_TRANSITIONING 0xF + uint8_t support; +#define TPG_AO_SUP 0x01 +#define TPG_AN_SUP 0x02 +#define TPG_S_SUP 0x04 +#define TPG_U_SUP 0x08 +#define TPG_LBD_SUP 0x10 +#define TPG_O_SUP 0x40 +#define TPG_T_SUP 0x80 + uint8_t target_port_group[2]; + uint8_t reserved; + uint8_t status; + uint8_t vendor_specific; + uint8_t target_port_count; + struct scsi_target_port_descriptor descriptors[1]; +}; + +struct scsi_target_group_data { + uint8_t length[4]; /* length of returned data, in bytes */ + struct scsi_target_port_group_descriptor groups[1]; +}; + +struct scsi_target_group_data_extended { + uint8_t length[4]; /* length of returned data, in bytes */ + uint8_t format_type; /* STG_PDF_LENGTH or RPL_PDF_EXTENDED */ + uint8_t implicit_transition_time; + uint8_t reserved[2]; + struct scsi_target_port_group_descriptor groups[1]; +}; + struct scsi_sense_data { @@ -898,12 +982,12 @@ struct scsi_sense_data u_int8_t fru; u_int8_t sense_key_spec[3]; #define SSD_SCS_VALID 0x80 -#define SSD_FIELDPTR_CMD 0x40 -#define SSD_BITPTR_VALID 0x08 -#define SSD_BITPTR_VALUE 0x07 -#define SSD_MIN_SIZE 18 +#define SSD_FIELDPTR_CMD 0x40 +#define SSD_BITPTR_VALID 0x08 +#define SSD_BITPTR_VALUE 0x07 +#define SSD_MIN_SIZE 18 u_int8_t extra_bytes[14]; -#define SSD_FULL_SIZE sizeof(struct scsi_sense_data) +#define SSD_FULL_SIZE sizeof(struct scsi_sense_data) }; struct scsi_mode_header_6 @@ -948,13 +1032,13 @@ struct scsi_mode_blk_desc #define SCSI_STATUS_CHECK_COND 0x02 #define SCSI_STATUS_COND_MET 0x04 #define SCSI_STATUS_BUSY 0x08 -#define SCSI_STATUS_INTERMED 0x10 -#define SCSI_STATUS_INTERMED_COND_MET 0x14 -#define SCSI_STATUS_RESERV_CONFLICT 0x18 -#define SCSI_STATUS_CMD_TERMINATED 0x22 /* Obsolete in SAM-2 */ -#define SCSI_STATUS_QUEUE_FULL 0x28 -#define SCSI_STATUS_ACA_ACTIVE 0x30 -#define SCSI_STATUS_TASK_ABORTED 0x40 +#define SCSI_STATUS_INTERMED 0x10 +#define SCSI_STATUS_INTERMED_COND_MET 0x14 +#define SCSI_STATUS_RESERV_CONFLICT 0x18 +#define SCSI_STATUS_CMD_TERMINATED 0x22 /* Obsolete in SAM-2 */ +#define SCSI_STATUS_QUEUE_FULL 0x28 +#define SCSI_STATUS_ACA_ACTIVE 0x30 +#define SCSI_STATUS_TASK_ABORTED 0x40 struct scsi_inquiry_pattern { u_int8_t type; @@ -1065,9 +1149,9 @@ int scsi_interpret_sense(struct cam_dev #endif /* _KERNEL */ #define SF_RETRY_UA 0x01 -#define SF_NO_PRINT 0x02 -#define SF_QUIET_IR 0x04 /* Be quiet about Illegal Request reponses */ -#define SF_PRINT_ALWAYS 0x08 +#define SF_NO_PRINT 0x02 +#define SF_QUIET_IR 0x04 /* Be quiet about Illegal Request reponses */ +#define SF_PRINT_ALWAYS 0x08 const char * scsi_op_desc(u_int16_t opcode, @@ -1174,6 +1258,20 @@ void scsi_report_luns(struct ccb_scsiio u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_report_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb *), u_int8_t tag_action, + u_int8_t pdf, + void *buf, + u_int32_t alloc_len, u_int8_t sense_len, + u_int32_t timeout); + +void scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb *), u_int8_t tag_action, void *buf, + u_int32_t alloc_len, u_int8_t sense_len, + u_int32_t timeout); + void scsi_synchronize_cache(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, Modified: stable/8/sys/cam/scsi/scsi_ch.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_ch.h Tue Jun 22 01:30:46 2010 (r209409) +++ stable/8/sys/cam/scsi/scsi_ch.h Tue Jun 22 04:37:05 2010 (r209410) @@ -105,7 +105,6 @@ struct scsi_initialize_element_status { */ struct scsi_move_medium { u_int8_t opcode; -#define MOVE_MEDIUM 0xa5 u_int8_t byte2; u_int8_t tea[2]; /* transport element address */ u_int8_t src[2]; /* source element address */ @@ -122,7 +121,6 @@ struct scsi_move_medium { */ struct scsi_position_to_element { u_int8_t opcode; -#define POSITION_TO_ELEMENT 0x2b u_int8_t byte2; u_int8_t tea[2]; /* transport element address */ u_int8_t dst[2]; /* destination element address */ @@ -137,7 +135,6 @@ struct scsi_position_to_element { */ struct scsi_read_element_status { u_int8_t opcode; -#define READ_ELEMENT_STATUS 0xb8 u_int8_t byte2; #define READ_ELEMENT_STATUS_VOLTAG 0x10 /* report volume tag info */ /* ...next 4 bits are an element type code... */ @@ -151,7 +148,6 @@ struct scsi_read_element_status { struct scsi_request_volume_element_address { u_int8_t opcode; -#define REQUEST_VOLUME_ELEMENT_ADDRESS 0xb5 u_int8_t byte2; #define REQUEST_VOLUME_ELEMENT_ADDRESS_VOLTAG 0x10 /* ...next 4 bits are an element type code... */ From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 04:38:41 2010 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 BF12A106566B; Tue, 22 Jun 2010 04:38:41 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE0118FC13; Tue, 22 Jun 2010 04:38: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 o5M4cfx7037077; Tue, 22 Jun 2010 04:38:41 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M4cfsS037075; Tue, 22 Jun 2010 04:38:41 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006220438.o5M4cfsS037075@svn.freebsd.org> From: Matt Jacob Date: Tue, 22 Jun 2010 04:38: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: r209411 - stable/8/sys/cam/scsi 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, 22 Jun 2010 04:38:41 -0000 Author: mjacob Date: Tue Jun 22 04:38:41 2010 New Revision: 209411 URL: http://svn.freebsd.org/changeset/base/209411 Log: This is an MFC of 208918 One byte off for scsi_target_group cdb. Modified: stable/8/sys/cam/scsi/scsi_all.h Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 04:37:05 2010 (r209410) +++ stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 04:38:41 2010 (r209411) @@ -893,7 +893,7 @@ struct scsi_target_group uint8_t service_action; #define STG_PDF_LENGTH 0x00 #define RPL_PDF_EXTENDED 0x20 - uint8_t reserved1[3]; + uint8_t reserved1[4]; uint8_t length[4]; uint8_t reserved2; uint8_t control; From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 04:40:51 2010 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 144431065670; Tue, 22 Jun 2010 04:40:51 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE0808FC19; Tue, 22 Jun 2010 04:40:50 +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 o5M4eoVT037591; Tue, 22 Jun 2010 04:40:50 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M4eoN2037589; Tue, 22 Jun 2010 04:40:50 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006220440.o5M4eoN2037589@svn.freebsd.org> From: Matt Jacob Date: Tue, 22 Jun 2010 04:40: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: r209412 - stable/8/sys/cam/scsi 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, 22 Jun 2010 04:40:51 -0000 Author: mjacob Date: Tue Jun 22 04:40:50 2010 New Revision: 209412 URL: http://svn.freebsd.org/changeset/base/209412 Log: This is an MFC of 209188 For the target port groups structures, don't allocate the initial element. This makes things easier for target implementations to calculate how many elements they need to allocate. Modified: stable/8/sys/cam/scsi/scsi_all.h Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 04:38:41 2010 (r209411) +++ stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 04:40:50 2010 (r209412) @@ -902,6 +902,7 @@ struct scsi_target_group struct scsi_target_port_descriptor { uint8_t reserved[2]; uint8_t relative_target_port_identifier[2]; + uint8_t desc_list[]; }; struct scsi_target_port_group_descriptor { @@ -928,12 +929,12 @@ struct scsi_target_port_group_descriptor uint8_t status; uint8_t vendor_specific; uint8_t target_port_count; - struct scsi_target_port_descriptor descriptors[1]; + struct scsi_target_port_descriptor descriptors[]; }; struct scsi_target_group_data { uint8_t length[4]; /* length of returned data, in bytes */ - struct scsi_target_port_group_descriptor groups[1]; + struct scsi_target_port_group_descriptor groups[]; }; struct scsi_target_group_data_extended { @@ -941,7 +942,7 @@ struct scsi_target_group_data_extended { uint8_t format_type; /* STG_PDF_LENGTH or RPL_PDF_EXTENDED */ uint8_t implicit_transition_time; uint8_t reserved[2]; - struct scsi_target_port_group_descriptor groups[1]; + struct scsi_target_port_group_descriptor groups[]; }; From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 07:38:30 2010 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 814DA106564A; Tue, 22 Jun 2010 07:38:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 567C18FC19; Tue, 22 Jun 2010 07:38:30 +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 o5M7cU4R076707; Tue, 22 Jun 2010 07:38:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M7cUVM076705; Tue, 22 Jun 2010 07:38:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006220738.o5M7cUVM076705@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 22 Jun 2010 07:38:30 +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: r209414 - stable/8/sys/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: Tue, 22 Jun 2010 07:38:30 -0000 Author: ae Date: Tue Jun 22 07:38:30 2010 New Revision: 209414 URL: http://svn.freebsd.org/changeset/base/209414 Log: MFC r207178: Fix undo for schemes that have internal partitions. Internal partitions do not constitute user-visible or active partitions and as such should not prevent undoing pending operations. While here, initialize the last usable sector for the placeholder geom based on the null scheme, created to allow undoing the destruction of a scheme. This gives consistent output with "gpart show". Approved by: mav (mentor) Modified: stable/8/sys/geom/part/g_part.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Tue Jun 22 07:31:05 2010 (r209413) +++ stable/8/sys/geom/part/g_part.c Tue Jun 22 07:38:30 2010 (r209414) @@ -845,7 +845,9 @@ g_part_ctl_delete(struct gctl_req *req, static int g_part_ctl_destroy(struct gctl_req *req, struct g_part_parms *gpp) { + struct g_consumer *cp; struct g_geom *gp; + struct g_provider *pp; struct g_part_entry *entry; struct g_part_table *null, *table; struct sbuf *sb; @@ -875,6 +877,11 @@ g_part_ctl_destroy(struct gctl_req *req, null->gpt_gp = gp; null->gpt_scheme = &g_part_null_scheme; LIST_INIT(&null->gpt_entry); + + cp = LIST_FIRST(&gp->consumer); + pp = cp->provider; + null->gpt_last = pp->mediasize / pp->sectorsize - 1; + null->gpt_depth = table->gpt_depth; null->gpt_opened = table->gpt_opened; null->gpt_smhead = table->gpt_smhead; @@ -1055,10 +1062,16 @@ g_part_ctl_undo(struct gctl_req *req, st table->gpt_created) ? 1 : 0; if (reprobe) { - if (!LIST_EMPTY(&table->gpt_entry)) { + LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { + if (entry->gpe_internal) + continue; error = EBUSY; goto fail; } + while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) { + LIST_REMOVE(entry, gpe_entry); + g_free(entry); + } error = g_part_probe(gp, cp, table->gpt_depth); if (error) { g_topology_lock(); From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 07:54:20 2010 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 2CDC91065673; Tue, 22 Jun 2010 07:54:20 +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 1BADE8FC1B; Tue, 22 Jun 2010 07:54: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 o5M7sKZg080458; Tue, 22 Jun 2010 07:54:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M7sJmt080456; Tue, 22 Jun 2010 07:54:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006220754.o5M7sJmt080456@svn.freebsd.org> From: Andriy Gapon Date: Tue, 22 Jun 2010 07:54: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: r209417 - stable/8/sys/boot/zfs 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, 22 Jun 2010 07:54:20 -0000 Author: avg Date: Tue Jun 22 07:54:19 2010 New Revision: 209417 URL: http://svn.freebsd.org/changeset/base/209417 Log: MFC r208669: zfs boot: fix error handling in zfs_readdir Modified: stable/8/sys/boot/zfs/zfs.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Tue Jun 22 07:52:58 2010 (r209416) +++ stable/8/sys/boot/zfs/zfs.c Tue Jun 22 07:54:19 2010 (r209417) @@ -265,6 +265,8 @@ zfs_readdir(struct open_file *f, struct rc = dnode_read(spa, &fp->f_dnode, fp->f_seekp, &mze, sizeof(mze)); + if (rc) + return (rc); fp->f_seekp += sizeof(mze); if (!mze.mze_name[0]) From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 07:55:30 2010 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 654D9106566B; Tue, 22 Jun 2010 07:55:30 +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 5423A8FC0C; Tue, 22 Jun 2010 07:55:30 +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 o5M7tUp8080758; Tue, 22 Jun 2010 07:55:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M7tUAX080756; Tue, 22 Jun 2010 07:55:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006220755.o5M7tUAX080756@svn.freebsd.org> From: Andriy Gapon Date: Tue, 22 Jun 2010 07:55:30 +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: r209418 - stable/8/sys/dev/amdsbwd 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, 22 Jun 2010 07:55:30 -0000 Author: avg Date: Tue Jun 22 07:55:30 2010 New Revision: 209418 URL: http://svn.freebsd.org/changeset/base/209418 Log: MFC r208670: amdsbwd: fix nonsensical timeout calculations Modified: stable/8/sys/dev/amdsbwd/amdsbwd.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/8/sys/dev/amdsbwd/amdsbwd.c Tue Jun 22 07:54:19 2010 (r209417) +++ stable/8/sys/dev/amdsbwd/amdsbwd.c Tue Jun 22 07:55:30 2010 (r209418) @@ -230,10 +230,10 @@ amdsbwd_event(void *arg, unsigned int cm cmd &= WD_INTERVAL; if (cmd < WD_TO_1SEC) cmd = 0; - timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick; - if (timeout > sc->max_ticks) - timeout = sc->max_ticks; if (cmd) { + timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick; + if (timeout > sc->max_ticks) + timeout = sc->max_ticks; if (timeout != sc->timeout) { amdsbwd_tmr_set(sc, timeout); if (!sc->active) From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 08:14:10 2010 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 8D81E1065672; Tue, 22 Jun 2010 08:14:10 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id F17188FC23; Tue, 22 Jun 2010 08:14:08 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA15216; Tue, 22 Jun 2010 11:14:06 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OQycQ-000PYE-Fj; Tue, 22 Jun 2010 11:14:06 +0300 Message-ID: <4C2070CC.6090005@freebsd.org> Date: Tue, 22 Jun 2010 11:14:04 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Jack F Vogel References: <201006181636.o5IGavsD011902@svn.freebsd.org> In-Reply-To: <201006181636.o5IGavsD011902@svn.freebsd.org> X-Enigmail-Version: 0.96.0 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: r209308 - stable/8/sys/dev/ixgbe 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, 22 Jun 2010 08:14:10 -0000 on 18/06/2010 19:36 Jack F Vogel said the following: > Author: jfv > Date: Fri Jun 18 16:36:57 2010 > New Revision: 209308 > URL: http://svn.freebsd.org/changeset/base/209308 > > Log: > MFC of ixgbe driver version 2.2.1 > -mostly stability fixes > > MFC to RELENG 8.1 asap > > Modified: > stable/8/sys/dev/ixgbe/ixgbe.c > stable/8/sys/dev/ixgbe/ixgbe.h > Directory Properties: > stable/8/sys/dev/ixgbe/ (props changed) Looks like this svn merge was done on sys/dev/ixgbe directory. It should have been done on sys/. This pollutes repository, You also haven't mentioned head revisions being MFC-ed. This makes life harder for others. Just in case: http://wiki.freebsd.org/SubversionPrimer/Merging -- Andriy Gapon From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 08:17:20 2010 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 65869106564A; Tue, 22 Jun 2010 08:17:20 +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 5428C8FC1B; Tue, 22 Jun 2010 08:17: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 o5M8HKgL085862; Tue, 22 Jun 2010 08:17:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M8HKP4085860; Tue, 22 Jun 2010 08:17:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006220817.o5M8HKP4085860@svn.freebsd.org> From: Andriy Gapon Date: Tue, 22 Jun 2010 08:17:20 +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: r209423 - stable/8/sys/geom/label 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, 22 Jun 2010 08:17:20 -0000 Author: avg Date: Tue Jun 22 08:17:20 2010 New Revision: 209423 URL: http://svn.freebsd.org/changeset/base/209423 Log: MFC r208672: g_label: fix possible NULL pointer dereference Modified: stable/8/sys/geom/label/g_label.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/geom/label/g_label.c ============================================================================== --- stable/8/sys/geom/label/g_label.c Tue Jun 22 08:05:54 2010 (r209422) +++ stable/8/sys/geom/label/g_label.c Tue Jun 22 08:17:20 2010 (r209423) @@ -203,10 +203,8 @@ g_label_destroy(struct g_geom *gp, boole pp->acr, pp->acw, pp->ace); return (EBUSY); } - } else { - G_LABEL_DEBUG(1, "Label %s removed.", - LIST_FIRST(&gp->provider)->name); - } + } else if (pp != NULL) + G_LABEL_DEBUG(1, "Label %s removed.", pp->name); g_slice_spoiled(LIST_FIRST(&gp->consumer)); return (0); } From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 08:58:13 2010 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 884DF106566B; Tue, 22 Jun 2010 08:58:13 +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 76BB88FC19; Tue, 22 Jun 2010 08:58: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 o5M8wDPi094992; Tue, 22 Jun 2010 08:58:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M8wDkA094991; Tue, 22 Jun 2010 08:58:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006220858.o5M8wDkA094991@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 Jun 2010 08:58: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: r209426 - stable/8/share/examples/kld/syscall/test 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, 22 Jun 2010 08:58:13 -0000 Author: kib Date: Tue Jun 22 08:58:13 2010 New Revision: 209426 URL: http://svn.freebsd.org/changeset/base/209426 Log: MFC r209199: Fix the syscall module name after r205320. Modified: stable/8/share/examples/kld/syscall/test/call.c Directory Properties: stable/8/share/examples/kld/syscall/ (props changed) Modified: stable/8/share/examples/kld/syscall/test/call.c ============================================================================== --- stable/8/share/examples/kld/syscall/test/call.c Tue Jun 22 08:22:25 2010 (r209425) +++ stable/8/share/examples/kld/syscall/test/call.c Tue Jun 22 08:58:13 2010 (r209426) @@ -48,7 +48,7 @@ main(int argc, char **argv) struct module_stat stat; stat.version = sizeof(stat); - modstat(modfind("syscall"), &stat); + modstat(modfind("sys/syscall"), &stat); syscall_num = stat.data.intval; return syscall (syscall_num); } From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 09:45:20 2010 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 A85B4106566C; Tue, 22 Jun 2010 09:45:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95D288FC14; Tue, 22 Jun 2010 09:45: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 o5M9jKDa005554; Tue, 22 Jun 2010 09:45:20 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M9jKos005552; Tue, 22 Jun 2010 09:45:20 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006220945.o5M9jKos005552@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 22 Jun 2010 09:45:20 +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: r209427 - 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: Tue, 22 Jun 2010 09:45:20 -0000 Author: ae Date: Tue Jun 22 09:45:20 2010 New Revision: 209427 URL: http://svn.freebsd.org/changeset/base/209427 Log: MFC r198235: Clean up markup (mainly). Approved by: kib (mentor) Modified: stable/8/sbin/geom/class/part/gpart.8 Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Tue Jun 22 08:58:13 2010 (r209426) +++ stable/8/sbin/geom/class/part/gpart.8 Tue Jun 22 09:45:20 2010 (r209427) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 3, 2010 +.Dd June 22, 2010 .Dt GPART 8 .Os .Sh NAME @@ -43,23 +43,37 @@ lines in your kernel configuration file: .Cd "options GEOM_PART_VTOC8" .Ed .Pp -The GEOM_PART_APM option adds support for the Apple Partition Map (APM) +The +.Dv GEOM_PART_APM +option adds support for the Apple Partition Map (APM) found on Apple Macintosh computers. -The GEOM_PART_BSD option adds support for the traditional BSD disklabel. -The GEOM_PART_GPT option adds support for the GUID Partition Table (GPT) +The +.Dv GEOM_PART_BSD +option adds support for the traditional +.Bx +disklabel. +The +.Dv GEOM_PART_GPT +option adds support for the GUID Partition Table (GPT) found on Intel Itanium computers and Intel-based Macintosh computers. -The GEOM_PART_MBR option adds support for the Master Boot Record (MBR) +The +.Dv GEOM_PART_MBR +option adds support for the Master Boot Record (MBR) found on PCs and used on many removable media. -The GEOM_PART_PC98 option adds support for the MBR variant as used on +The +.Dv GEOM_PART_PC98 +option adds support for the MBR variant as used on NEC PC-98 computers. -The GEOM_PART_VTOC8 option adds support for Sun's SMI VTOC8 label as +The +.Dv GEOM_PART_VTOC8 +option adds support for Sun's SMI VTOC8 label as found on computers based on .Tn SPARC64 and .Tn UltraSPARC. .Pp Usage of the -.Xr gpart 8 +.Ns Nm utility: .Pp .\" ==== ADD ==== @@ -126,7 +140,7 @@ utility: .Ar geom .\" ==== UNSET ==== .Nm -.Cm unset +.Cm unset .Fl a Ar attrib .Fl i Ar index .Op Fl f Ar flags @@ -137,7 +151,7 @@ The .Nm utility is used to partition GEOM providers, normally disks. The first argument of which is the action to be taken: -.Bl -tag -width ".Cm wwwwwww" +.Bl -tag -width ".Cm bootcode" .\" ==== ADD ==== .It Cm add Add a new partition to the partitioning scheme given by @@ -151,13 +165,15 @@ option. The type of the partition is given by the .Fl t Ar type option. -Partition types are discussed in the section entitled "Partition Types". +Partition types are discussed below in the section entitled +.Sx "PARTITION TYPES" . .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl i Ar index The index in the partition table at which the new partition is to be -placed. The index determines the name of the device special file used +placed. +The index determines the name of the device special file used to represent the partition. .It Fl l Ar label The label attached to the partition. @@ -165,7 +181,9 @@ This option is only valid when used on p partition labels. .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== BOOTCODE ==== @@ -188,7 +206,7 @@ The option specifies a file that contains the bootstrap code. The contents and size of the file are determined by the partitioning scheme. -For the MBR scheme, it's a 512 byte file of which the first 446 bytes +For the MBR scheme, it is a 512 byte file of which the first 446 bytes are installed as bootstrap code. The .Fl p Ar partcode @@ -205,11 +223,13 @@ option is omitted, the bootstrap code is partitions. The size of the file must be smaller than the size of the partition. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== COMMIT ==== @@ -238,8 +258,8 @@ option determines the scheme to use. The kernel needs to have support for a particular scheme before that scheme can be used to partition a disk. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl n Ar entries The number of entries in the partition table. Every partitioning scheme has a minimum and a maximum number of entries @@ -251,7 +271,9 @@ By default, partition tables are created entries. .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== DELETE ==== @@ -263,11 +285,13 @@ and further identified by the option. The partition cannot be actively used by the kernel. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== DESTROY ==== @@ -275,11 +299,13 @@ about its use. Destroy the partitioning scheme as implemented by geom .Ar geom . .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== MODIFY ==== @@ -299,22 +325,26 @@ option. Not all partitioning schemes support labels and it is invalid to try to change a partition label in such cases. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== SET ==== .It Cm set Set the named attribute on the partition entry. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== SHOW ==== @@ -323,7 +353,8 @@ Show the current partition information o or all geoms if none are specified. .\" ==== UNDO ==== .It Cm undo -Revert any pending changes. +Revert any pending changes for geom +.Ar geom . This action is the opposite of the .Cm commit action and can be used to undo any changes that have not been committed. @@ -331,11 +362,13 @@ action and can be used to undo any chang .It Cm unset Clear the named attribute on the partition entry. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .El @@ -347,47 +380,82 @@ utility uses symbolic names for common p user needs to know what the partitioning scheme in question is and what the actual number or identification needs to be used for a particular type. -the +The .Nm utility also allows the user to specify scheme-specific partition types -for partition types that don't have symbol names. +for partition types that do not have symbol names. The symbolic names currently understood are: -.Bl -tag -width "wwwwwwwwwwwww" -.It efi +.Bl -tag -width ".Cm freebsd-vinum" +.It Cm efi The system partition for computers that use the Extensible Firmware Interface (EFI). In such cases, the GPT partitioning scheme is being used and the actual partition type for the system partition can also be specified as -"!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab". -.It freebsd -A FreeBSD partition that uses the BSD disklabel to sub-divide the +.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" . +.It Cm freebsd +A +.Fx +partition that uses the +.Bx +disklabel to sub-divide the partition into file systems. This is a legacy partition type and should not be used for the APM or GPT schemes. -The scheme-specific types are "!165" for MBR, "!FreeBSD" for APM, and -"!516e7cb4-6ecf-11d6-8ff8-00022d09712b" for GPT. -.It freebsd-boot -A FreeBSD partition dedicated to bootstrap code. -The scheme-specific type is "!83bd6b9d-7f41-11dc-be0b-001560b84f0f" for GPT. -.It freebsd-swap -A FreeBSD partition dedicated to swap space. -The scheme-specific types are "!FreeBSD-swap" for APM, -"!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0901 for VTOC8. -.It freebsd-ufs -A FreeBSD partition that contains a UFS or UFS2 file system. -the scheme-specific types are "!FreeBSD-UFS" for APM, -"!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0902 for VTOC8. -.It freebsd-vinum -A FreeBSD partition that contains a Vinum volume. -The scheme-specific types are "!FreeBSD-Vinum" for APM, -"!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0903 for VTOC8. -.It freebsd-zfs -A FreeBSD partition that contains a ZFS volume. -The scheme-specific types are "!FreeBSD-ZFS" for APM, -"!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT, and 0x0904 for VTOC8. -.It mbr +The scheme-specific types are +.Qq Li "!165" +for MBR, +.Qq Li "!FreeBSD" +for APM, and +.Qq Li "!516e7cb4-6ecf-11d6-8ff8-00022d09712b" +for GPT. +.It Cm freebsd-boot +A +.Fx +partition dedicated to bootstrap code. +The scheme-specific type is +.Qq Li "!83bd6b9d-7f41-11dc-be0b-001560b84f0f" +for GPT. +.It Cm freebsd-swap +A +.Fx +partition dedicated to swap space. +The scheme-specific types are +.Qq Li "!FreeBSD-swap" +for APM, +.Qq Li "!516e7cb5-6ecf-11d6-8ff8-00022d09712b" +for GPT, and tag 0x0901 for VTOC8. +.It Cm freebsd-ufs +A +.Fx +partition that contains a UFS or UFS2 file system. +The scheme-specific types are +.Qq Li "!FreeBSD-UFS" +for APM, +.Qq Li "!516e7cb6-6ecf-11d6-8ff8-00022d09712b" +for GPT, and tag 0x0902 for VTOC8. +.It Cm freebsd-vinum +A +.Fx +partition that contains a Vinum volume. +The scheme-specific types are +.Qq Li "!FreeBSD-Vinum" +for APM, +.Qq Li "!516e7cb8-6ecf-11d6-8ff8-00022d09712b" +for GPT, and tag 0x0903 for VTOC8. +.It Cm freebsd-zfs +A +.Fx +partition that contains a ZFS volume. +The scheme-specific types are +.Qq Li "!FreeBSD-ZFS" +for APM, +.Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b" + for GPT, and 0x0904 for VTOC8. +.It Cm mbr A partition that is sub-partitioned by a master boot record (MBR). -This type is known as "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. +This type is known as +.Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f" +by GPT. .El .Sh OPERATIONAL FLAGS Actions other than the @@ -400,10 +468,12 @@ option. This option is used to specify action-specific operational flags. By default, the .Nm -utility defines the 'C' flag so that the action is immediately +utility defines the +.Ql C +flag so that the action is immediately committed. The user can specify -.Fl f Ar x +.Dq Fl f Cm x to have the action result in a pending change that can later, with other pending changes, be committed as a single compound change with the @@ -426,24 +496,26 @@ Embed GPT bootstrap code into protective .Ed .Pp Create a dedicated -.Pa freebsd-boot -partition that can boot FreeBSD from a -.Pa freebsd-ufs +.Cm freebsd-boot +partition that can boot +.Fx +from a +.Cm freebsd-ufs partition, and install bootstrap code into it. This partition must be larger than .Pa /boot/gptboot , or the GPT boot you are planning to write. A size of 15 blocks (7680 bytes) would be sufficient for -booting from UFS but lets use 128 blocks (64 KB) here in +booting from UFS but let's use 128 blocks (64 KB) here in this example, in order to reserve some space for potential -future need (e.g. from a ZFS partition). +future need (e.g.\& from a ZFS partition). .Bd -literal -offset indent /sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 .Ed .Pp Create a 512MB-sized -.Pa freebsd-ufs +.Cm freebsd-ufs partition that would contain UFS where the system boots from. .Bd -literal -offset indent /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 @@ -468,7 +540,7 @@ After having created all required partit .Ed .Sh SEE ALSO .Xr geom 4 , -.Xr geom 8 , +.Xr geom 8 .Sh HISTORY The .Nm From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 15:01:23 2010 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 D0EE01065672; Tue, 22 Jun 2010 15:01:23 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF7198FC12; Tue, 22 Jun 2010 15:01: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 o5MF1Nx4076824; Tue, 22 Jun 2010 15:01:23 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MF1NMM076822; Tue, 22 Jun 2010 15:01:23 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201006221501.o5MF1NMM076822@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 22 Jun 2010 15:01: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: r209430 - stable/8/lib/libpam/modules/pam_lastlog 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, 22 Jun 2010 15:01:23 -0000 Author: des Date: Tue Jun 22 15:01:23 2010 New Revision: 209430 URL: http://svn.freebsd.org/changeset/base/209430 Log: merge r196650 (check that tty != NULL, prevents segfault on session close) Modified: stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c Directory Properties: stable/8/lib/libpam/ (props changed) Modified: stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c ============================================================================== --- stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c Tue Jun 22 10:46:57 2010 (r209429) +++ stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c Tue Jun 22 15:01:23 2010 (r209430) @@ -183,6 +183,11 @@ pam_sm_close_session(pam_handle_t *pamh pam_err = pam_get_item(pamh, PAM_TTY, (const void **)&tty); if (pam_err != PAM_SUCCESS) goto err; + if (tty == NULL) { + PAM_LOG("No PAM_TTY"); + pam_err = PAM_SERVICE_ERR; + goto err; + } if (strncmp(tty, _PATH_DEV, strlen(_PATH_DEV)) == 0) tty = (const char *)tty + strlen(_PATH_DEV); if (*(const char *)tty == '\0') From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 18:24:27 2010 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 057191065670; Tue, 22 Jun 2010 18:24:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7E938FC0A; Tue, 22 Jun 2010 18:24: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 o5MIOQs9022024; Tue, 22 Jun 2010 18:24:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MIOQCi022023; Tue, 22 Jun 2010 18:24:26 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006221824.o5MIOQCi022023@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 22 Jun 2010 18:24:26 +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: r209434 - 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: Tue, 22 Jun 2010 18:24:27 -0000 Author: ae Date: Tue Jun 22 18:24:26 2010 New Revision: 209434 URL: http://svn.freebsd.org/changeset/base/209434 Log: MFC r198478 (by lulf): - Initialize variable in order to avoid GCC warning and enable WARNS=6. PR: bin/139970 Submitted by: Ulrich Spörlein Approved by: kib (mentor) Modified: stable/8/sbin/geom/class/part/Makefile stable/8/sbin/geom/class/part/geom_part.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/class/part/Makefile ============================================================================== --- stable/8/sbin/geom/class/part/Makefile Tue Jun 22 17:45:21 2010 (r209433) +++ stable/8/sbin/geom/class/part/Makefile Tue Jun 22 18:24:26 2010 (r209434) @@ -6,6 +6,4 @@ CLASS= part LDADD= -lutil -WARNS?= 4 - .include Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Tue Jun 22 17:45:21 2010 (r209433) +++ stable/8/sbin/geom/class/part/geom_part.c Tue Jun 22 18:24:26 2010 (r209434) @@ -206,6 +206,7 @@ find_provider(struct ggeom *gp, unsigned unsigned long long sector, bestsector; bestpp = NULL; + bestsector = 0; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "start"); if (s == NULL) { From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 19:22:34 2010 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 93B851065673; Tue, 22 Jun 2010 19:22:34 +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 821908FC15; Tue, 22 Jun 2010 19:22: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 o5MJMYwD035006; Tue, 22 Jun 2010 19:22:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MJMY0c035004; Tue, 22 Jun 2010 19:22:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006221922.o5MJMY0c035004@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Jun 2010 19:22: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: r209438 - stable/8/sys/dev/hptiop 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, 22 Jun 2010 19:22:34 -0000 Author: mav Date: Tue Jun 22 19:22:34 2010 New Revision: 209438 URL: http://svn.freebsd.org/changeset/base/209438 Log: MFC r209340: Report transport type in XPT_PATH_INQ. PR: i386/147929 Modified: stable/8/sys/dev/hptiop/hptiop.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/8/sys/dev/hptiop/hptiop.c Tue Jun 22 19:17:57 2010 (r209437) +++ stable/8/sys/dev/hptiop/hptiop.c Tue Jun 22 19:22:34 2010 (r209438) @@ -1823,6 +1823,10 @@ scsi_done: 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 Tue Jun 22 19:24:08 2010 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 6822E106564A; Tue, 22 Jun 2010 19:24:08 +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 56DE88FC1D; Tue, 22 Jun 2010 19:24:08 +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 o5MJO8hM035429; Tue, 22 Jun 2010 19:24:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MJO8Bd035396; Tue, 22 Jun 2010 19:24:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006221924.o5MJO8Bd035396@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Jun 2010 19:24:07 +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: r209439 - stable/8/sys/dev/hptmv 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, 22 Jun 2010 19:24:08 -0000 Author: mav Date: Tue Jun 22 19:24:07 2010 New Revision: 209439 URL: http://svn.freebsd.org/changeset/base/209439 Log: MFC r209341: Report transport type in XPT_PATH_INQ. Modified: stable/8/sys/dev/hptmv/entry.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/hptmv/entry.c ============================================================================== --- stable/8/sys/dev/hptmv/entry.c Tue Jun 22 19:22:34 2010 (r209438) +++ stable/8/sys/dev/hptmv/entry.c Tue Jun 22 19:24:07 2010 (r209439) @@ -2414,6 +2414,10 @@ hpt_action(struct cam_sim *sim, union cc strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); + 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; xpt_done(ccb); break; From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 22 21:12:44 2010 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 CA0A8106564A; Tue, 22 Jun 2010 21:12:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8C638FC0C; Tue, 22 Jun 2010 21:12: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 o5MLCig4059685; Tue, 22 Jun 2010 21:12:44 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MLCiwb059683; Tue, 22 Jun 2010 21:12:44 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201006222112.o5MLCiwb059683@svn.freebsd.org> From: Doug Barton Date: Tue, 22 Jun 2010 21:12: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: r209448 - stable/8/etc/namedb 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, 22 Jun 2010 21:12:44 -0000 Author: dougb Date: Tue Jun 22 21:12:44 2010 New Revision: 209448 URL: http://svn.freebsd.org/changeset/base/209448 Log: MFC 209286: Add the AAAA address for i.root-servers.net Modified: stable/8/etc/namedb/named.root Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/namedb/named.root ============================================================================== --- stable/8/etc/namedb/named.root Tue Jun 22 21:08:45 2010 (r209447) +++ stable/8/etc/namedb/named.root Tue Jun 22 21:12:44 2010 (r209448) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Dec 12, 2008 -; related version of root zone: 2008121200 +; last update: Jun 17, 2010 +; related version of root zone: 2010061700 ; ; formerly NS.INTERNIC.NET ; @@ -63,6 +63,7 @@ H.ROOT-SERVERS.NET. 3600000 AA ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 +I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FE::53 ; ; OPERATED BY VERISIGN, INC. ; From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 23 10:06:57 2010 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 E9C6F1065676; Wed, 23 Jun 2010 10:06:57 +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 CE2A48FC12; Wed, 23 Jun 2010 10:06:57 +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 o5NA6vNk031920; Wed, 23 Jun 2010 10:06:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NA6vbe031918; Wed, 23 Jun 2010 10:06:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006231006.o5NA6vbe031918@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Jun 2010 10:06:57 +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: r209459 - stable/8/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: Wed, 23 Jun 2010 10:06:58 -0000 Author: kib Date: Wed Jun 23 10:06:57 2010 New Revision: 209459 URL: http://svn.freebsd.org/changeset/base/209459 Log: MFC r208920: Reorganize the code in bdwrite() which handles move of dirtiness from the buffer pages to buffer. Drain the VPO_BUSY bit of the buffer pages before setting valid and clean bits. Stable/8 version of vfs_page_set_validclean() requires page queue lock. Tested by: pho Modified: stable/8/sys/kern/vfs_bio.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/vfs_bio.c ============================================================================== --- stable/8/sys/kern/vfs_bio.c Wed Jun 23 10:06:31 2010 (r209458) +++ stable/8/sys/kern/vfs_bio.c Wed Jun 23 10:06:57 2010 (r209459) @@ -102,8 +102,8 @@ static void vm_hold_load_pages(struct bu static void vfs_page_set_valid(struct buf *bp, vm_ooffset_t off, vm_page_t m); static void vfs_page_set_validclean(struct buf *bp, vm_ooffset_t off, vm_page_t m); -static void vfs_clean_pages(struct buf *bp); -static void vfs_setdirty(struct buf *bp); +static void vfs_drain_busy_pages(struct buf *bp); +static void vfs_clean_pages_dirty_buf(struct buf *bp); static void vfs_setdirty_locked_object(struct buf *bp); static void vfs_vmio_release(struct buf *bp); static int vfs_bio_clcheck(struct vnode *vp, int size, @@ -1009,18 +1009,17 @@ bdwrite(struct buf *bp) } /* - * Set the *dirty* buffer range based upon the VM system dirty pages. - */ - vfs_setdirty(bp); - - /* - * We need to do this here to satisfy the vnode_pager and the - * pageout daemon, so that it thinks that the pages have been - * "cleaned". Note that since the pages are in a delayed write - * buffer -- the VFS layer "will" see that the pages get written - * out on the next sync, or perhaps the cluster will be completed. + * Set the *dirty* buffer range based upon the VM system dirty + * pages. + * + * Mark the buffer pages as clean. We need to do this here to + * satisfy the vnode_pager and the pageout daemon, so that it + * thinks that the pages have been "cleaned". Note that since + * the pages are in a delayed write buffer -- the VFS layer + * "will" see that the pages get written out on the next sync, + * or perhaps the cluster will be completed. */ - vfs_clean_pages(bp); + vfs_clean_pages_dirty_buf(bp); bqrelse(bp); /* @@ -2380,31 +2379,46 @@ notinmem: } /* - * vfs_setdirty: - * - * Sets the dirty range for a buffer based on the status of the dirty - * bits in the pages comprising the buffer. + * Set the dirty range for a buffer based on the status of the dirty + * bits in the pages comprising the buffer. The range is limited + * to the size of the buffer. * - * The range is limited to the size of the buffer. + * Tell the VM system that the pages associated with this buffer + * are clean. This is used for delayed writes where the data is + * going to go to disk eventually without additional VM intevention. * - * This routine is primarily used by NFS, but is generalized for the - * B_VMIO case. + * Note that while we only really need to clean through to b_bcount, we + * just go ahead and clean through to b_bufsize. */ static void -vfs_setdirty(struct buf *bp) +vfs_clean_pages_dirty_buf(struct buf *bp) { + vm_ooffset_t foff, noff, eoff; + vm_page_t m; + int i; - /* - * Degenerate case - empty buffer - */ - if (bp->b_bufsize == 0) + if ((bp->b_flags & B_VMIO) == 0 || bp->b_bufsize == 0) return; - if ((bp->b_flags & B_VMIO) == 0) - return; + foff = bp->b_offset; + KASSERT(bp->b_offset != NOOFFSET, + ("vfs_clean_pages_dirty_buf: no buffer offset")); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); + vfs_drain_busy_pages(bp); vfs_setdirty_locked_object(bp); + vm_page_lock_queues(); + for (i = 0; i < bp->b_npages; i++) { + noff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; + eoff = noff; + if (eoff > bp->b_offset + bp->b_bufsize) + eoff = bp->b_offset + bp->b_bufsize; + m = bp->b_pages[i]; + vfs_page_set_validclean(bp, foff, m); + /* vm_page_clear_dirty(m, foff & PAGE_MASK, eoff - foff); */ + foff = noff; + } + vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); } @@ -3508,6 +3522,31 @@ vfs_page_set_validclean(struct buf *bp, } /* + * Ensure that all buffer pages are not busied by VPO_BUSY flag. If + * any page is busy, drain the flag. + */ +static void +vfs_drain_busy_pages(struct buf *bp) +{ + vm_page_t m; + int i, last_busied; + + VM_OBJECT_LOCK_ASSERT(bp->b_bufobj->bo_object, MA_OWNED); + last_busied = 0; + for (i = 0; i < bp->b_npages; i++) { + m = bp->b_pages[i]; + if ((m->oflags & VPO_BUSY) != 0) { + for (; last_busied < i; last_busied++) + vm_page_busy(bp->b_pages[last_busied]); + while ((m->oflags & VPO_BUSY) != 0) + vm_page_sleep(m, "vbpage"); + } + } + for (i = 0; i < last_busied; i++) + vm_page_wakeup(bp->b_pages[i]); +} + +/* * This routine is called before a device strategy routine. * It is used to tell the VM system that paging I/O is in * progress, and treat the pages associated with the buffer @@ -3535,15 +3574,9 @@ vfs_busy_pages(struct buf *bp, int clear KASSERT(bp->b_offset != NOOFFSET, ("vfs_busy_pages: no buffer offset")); VM_OBJECT_LOCK(obj); + vfs_drain_busy_pages(bp); if (bp->b_bufsize != 0) vfs_setdirty_locked_object(bp); -retry: - for (i = 0; i < bp->b_npages; i++) { - m = bp->b_pages[i]; - - if (vm_page_sleep_if_busy(m, FALSE, "vbpage")) - goto retry; - } bogus = 0; if (clear_modify) vm_page_lock_queues(); @@ -3588,44 +3621,6 @@ retry: } /* - * Tell the VM system that the pages associated with this buffer - * are clean. This is used for delayed writes where the data is - * going to go to disk eventually without additional VM intevention. - * - * Note that while we only really need to clean through to b_bcount, we - * just go ahead and clean through to b_bufsize. - */ -static void -vfs_clean_pages(struct buf *bp) -{ - int i; - vm_ooffset_t foff, noff, eoff; - vm_page_t m; - - if (!(bp->b_flags & B_VMIO)) - return; - - foff = bp->b_offset; - KASSERT(bp->b_offset != NOOFFSET, - ("vfs_clean_pages: no buffer offset")); - VM_OBJECT_LOCK(bp->b_bufobj->bo_object); - vm_page_lock_queues(); - for (i = 0; i < bp->b_npages; i++) { - m = bp->b_pages[i]; - noff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; - eoff = noff; - - if (eoff > bp->b_offset + bp->b_bufsize) - eoff = bp->b_offset + bp->b_bufsize; - vfs_page_set_validclean(bp, foff, m); - /* vm_page_clear_dirty(m, foff & PAGE_MASK, eoff - foff); */ - foff = noff; - } - vm_page_unlock_queues(); - VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); -} - -/* * vfs_bio_set_valid: * * Set the range within the buffer to valid. The range is From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 23 13:13:15 2010 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 1257D1065672; Wed, 23 Jun 2010 13:13:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 007C48FC19; Wed, 23 Jun 2010 13:13:15 +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 o5NDDEou074830; Wed, 23 Jun 2010 13:13:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NDDEbU074827; Wed, 23 Jun 2010 13:13:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006231313.o5NDDEbU074827@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Jun 2010 13:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209464 - stable/8/sys/powerpc/aim 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, 23 Jun 2010 13:13:15 -0000 Author: nwhitehorn Date: Wed Jun 23 13:13:14 2010 New Revision: 209464 URL: http://svn.freebsd.org/changeset/base/209464 Log: MFC r209369: Temporarily disable instruction relocation while setting up the kernel's IBAT entry in early boot in order to prevent possible faults from races between the instruction cache and the MMU. PR: powerpc/148003 Modified: stable/8/sys/powerpc/aim/mmu_oea.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/powerpc/aim/mmu_oea.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea.c Wed Jun 23 12:17:13 2010 (r209463) +++ stable/8/sys/powerpc/aim/mmu_oea.c Wed Jun 23 13:13:14 2010 (r209464) @@ -670,6 +670,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k vm_size_t size, physsz, hwphyssz; vm_offset_t pa, va, off; void *dpcpu; + register_t msr; /* * Set up BAT0 to map the lowest 256 MB area @@ -700,12 +701,16 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k /* * Use an IBAT and a DBAT to map the bottom segment of memory - * where we are. + * where we are. Turn off instruction relocation temporarily + * to prevent faults while reprogramming the IBAT. */ + msr = mfmsr(); + mtmsr(msr & ~PSL_IR); __asm (".balign 32; \n" "mtibatu 0,%0; mtibatl 0,%1; isync; \n" "mtdbatu 0,%0; mtdbatl 0,%1; isync" :: "r"(battable[0].batu), "r"(battable[0].batl)); + mtmsr(msr); /* map pci space */ __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 23 17:04:42 2010 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 73DE8106564A; Wed, 23 Jun 2010 17:04:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 629A48FC1D; Wed, 23 Jun 2010 17:04: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 o5NH4g4W026600; Wed, 23 Jun 2010 17:04:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NH4gdt026598; Wed, 23 Jun 2010 17:04:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231704.o5NH4gdt026598@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 17:04: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: r209471 - stable/8/sys/dev/acpica 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, 23 Jun 2010 17:04:42 -0000 Author: jhb Date: Wed Jun 23 17:04:42 2010 New Revision: 209471 URL: http://svn.freebsd.org/changeset/base/209471 Log: MFC 209213: When updating individual CPU's lowest Cx state to use, never set it to a state lower than the lowest one supported by the current CPU. This closes some races with changes to the hw.acpi.cpu_cx_lowest sysctl while Cx states for individual CPUs were changing (e.g. unplugging the AC adapter of a laptop) that could result in panics. Modified: stable/8/sys/dev/acpica/acpi_cpu.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Wed Jun 23 15:19:07 2010 (r209470) +++ stable/8/sys/dev/acpica/acpi_cpu.c Wed Jun 23 17:04:42 2010 (r209471) @@ -1009,6 +1009,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no if (isc->cpu_cx_count > cpu_cx_count) cpu_cx_count = isc->cpu_cx_count; } + if (sc->cpu_cx_lowest < cpu_cx_lowest) + acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1)); ACPI_SERIAL_END(cpu); } @@ -1204,7 +1206,7 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_ ACPI_SERIAL_BEGIN(cpu); for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); - acpi_cpu_set_cx_lowest(sc, val); + acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1)); } ACPI_SERIAL_END(cpu); From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 23 17:56:20 2010 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 748DE106566B; Wed, 23 Jun 2010 17:56:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49A0A8FC08; Wed, 23 Jun 2010 17:56: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 o5NHuKMY038241; Wed, 23 Jun 2010 17:56:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NHuKo9038239; Wed, 23 Jun 2010 17:56:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231756.o5NHuKo9038239@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 17:56:20 +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: r209474 - stable/8/sys/boot/i386/zfsboot 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, 23 Jun 2010 17:56:20 -0000 Author: jhb Date: Wed Jun 23 17:56:20 2010 New Revision: 209474 URL: http://svn.freebsd.org/changeset/base/209474 Log: MFC 208388: - Set 'dmadat' earlier so that we properly setup the heap if we fail to locate a high memory area for the heap using the SMAP. - Read the number of hard drive devices from the BIOS instead of hardcoding a limit of 128. Some BIOSes duplicate disk devices once you get beyond the maximum drive number. Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Wed Jun 23 17:51:11 2010 (r209473) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Wed Jun 23 17:56:20 2010 (r209474) @@ -94,6 +94,7 @@ __FBSDID("$FreeBSD$"); #define V86_CY(x) ((x) & 1) #define V86_ZR(x) ((x) & 0x40) +#define BIOS_NUMDRIVES 0x475 #define DRV_HARD 0x80 #define DRV_MASK 0x7f @@ -467,6 +468,7 @@ getstr(void) static inline void putc(int c) { + v86.ctl = 0; v86.addr = 0x10; v86.eax = 0xe00 | (c & 0xff); v86.ebx = 0x7; @@ -617,6 +619,8 @@ main(void) off_t off; struct dsk *dsk; + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + bios_getmem(); if (high_heap_size > 0) { @@ -627,9 +631,6 @@ main(void) heap_end = (char *) PTOV(bios_basemem); } - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - v86.ctl = V86_FLAGS; - dsk = malloc(sizeof(struct dsk)); dsk->drive = *(uint8_t *)PTOV(ARGS); dsk->type = dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD; @@ -666,7 +667,7 @@ main(void) * will find any other available pools and it may fill in missing * vdevs for the boot pool. */ - for (i = 0; i < 128; i++) { + for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) { if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) continue; @@ -1157,6 +1158,7 @@ getc(int fn) * when no such key is pressed in reality. As far as I can tell, * this only happens shortly after a reboot. */ + v86.ctl = V86_FLAGS; v86.addr = 0x16; v86.eax = fn << 8; v86int(); From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 23 18:00:20 2010 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 4CE281065678; Wed, 23 Jun 2010 18:00:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B41C8FC19; Wed, 23 Jun 2010 18:00: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 o5NI0Kdk039239; Wed, 23 Jun 2010 18:00:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NI0KjP039236; Wed, 23 Jun 2010 18:00:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231800.o5NI0KjP039236@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 18:00:20 +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: r209476 - in stable/8/sys: 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: Wed, 23 Jun 2010 18:00:20 -0000 Author: jhb Date: Wed Jun 23 18:00:19 2010 New Revision: 209476 URL: http://svn.freebsd.org/changeset/base/209476 Log: MFC 208390: Allow a const char * to be passed as the process name to kproc_kthread_add() without generating a warning. Modified: stable/8/sys/kern/kern_kthread.c stable/8/sys/sys/kthread.h Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/kern_kthread.c ============================================================================== --- stable/8/sys/kern/kern_kthread.c Wed Jun 23 17:56:51 2010 (r209475) +++ stable/8/sys/kern/kern_kthread.c Wed Jun 23 18:00:19 2010 (r209476) @@ -386,7 +386,7 @@ kthread_suspend_check(struct thread *td) int kproc_kthread_add(void (*func)(void *), void *arg, struct proc **procptr, struct thread **tdptr, - int flags, int pages, char * procname, const char *fmt, ...) + int flags, int pages, const char *procname, const char *fmt, ...) { int error; va_list ap; Modified: stable/8/sys/sys/kthread.h ============================================================================== --- stable/8/sys/sys/kthread.h Wed Jun 23 17:56:51 2010 (r209475) +++ stable/8/sys/sys/kthread.h Wed Jun 23 18:00:19 2010 (r209476) @@ -63,7 +63,7 @@ int kproc_kthread_add(void (*)(void struct proc **, struct thread **, int flags, int pages, - char * procname, const char *, ...) __printflike(8, 9); + const char *procname, const char *, ...) __printflike(8, 9); int kthread_add(void (*)(void *), void *, struct proc *, struct thread **, From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 23 18:46:11 2010 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 645D5106564A; Wed, 23 Jun 2010 18:46:11 +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 4F94A8FC13; Wed, 23 Jun 2010 18:46: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 o5NIkBiZ049391; Wed, 23 Jun 2010 18:46:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NIkARx049377; Wed, 23 Jun 2010 18:46:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231846.o5NIkARx049377@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 18:46: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: r209477 - in stable/8/sys: dev/ath dev/cxgb dev/hatm dev/nfe dev/patm dev/sk dev/stge net net80211 netgraph 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, 23 Jun 2010 18:46:11 -0000 Author: jhb Date: Wed Jun 23 18:46:10 2010 New Revision: 209477 URL: http://svn.freebsd.org/changeset/base/209477 Log: MFC 198988: Take a step towards removing if_watchdog/if_timer. Don't explicitly set if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already. Modified: stable/8/sys/dev/ath/if_ath.c stable/8/sys/dev/cxgb/cxgb_main.c stable/8/sys/dev/hatm/if_hatm.c stable/8/sys/dev/nfe/if_nfe.c stable/8/sys/dev/patm/if_patm_attach.c stable/8/sys/dev/sk/if_sk.c stable/8/sys/dev/stge/if_stge.c stable/8/sys/net/if_ef.c stable/8/sys/net80211/ieee80211.c stable/8/sys/netgraph/ng_eiface.c stable/8/sys/netgraph/ng_fec.c stable/8/sys/netgraph/ng_iface.c stable/8/sys/netgraph/ng_sppp.c Directory Properties: 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/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/if_ath.c ============================================================================== --- stable/8/sys/dev/ath/if_ath.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/ath/if_ath.c Wed Jun 23 18:46:10 2010 (r209477) @@ -560,7 +560,6 @@ ath_attach(u_int16_t devid, struct ath_s ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; ifp->if_start = ath_start; - ifp->if_watchdog = NULL; ifp->if_ioctl = ath_ioctl; ifp->if_init = ath_init; IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); Modified: stable/8/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_main.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/cxgb/cxgb_main.c Wed Jun 23 18:46:10 2010 (r209477) @@ -1019,10 +1019,6 @@ cxgb_port_attach(device_t dev) ifp->if_ioctl = cxgb_ioctl; ifp->if_start = cxgb_start; - - ifp->if_timer = 0; /* Disable ifnet watchdog */ - ifp->if_watchdog = NULL; - ifp->if_snd.ifq_drv_maxlen = cxgb_snd_queue_len; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); Modified: stable/8/sys/dev/hatm/if_hatm.c ============================================================================== --- stable/8/sys/dev/hatm/if_hatm.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/hatm/if_hatm.c Wed Jun 23 18:46:10 2010 (r209477) @@ -1928,7 +1928,6 @@ hatm_attach(device_t dev) ifp->if_flags = IFF_SIMPLEX; ifp->if_ioctl = hatm_ioctl; ifp->if_start = hatm_start; - ifp->if_watchdog = NULL; ifp->if_init = hatm_init; utopia_attach(&sc->utopia, IFP2IFATM(sc->ifp), &sc->media, &sc->mtx, Modified: stable/8/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/8/sys/dev/nfe/if_nfe.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/nfe/if_nfe.c Wed Jun 23 18:46:10 2010 (r209477) @@ -567,7 +567,6 @@ nfe_attach(device_t dev) ifp->if_start = nfe_start; ifp->if_hwassist = 0; ifp->if_capabilities = 0; - ifp->if_watchdog = NULL; ifp->if_init = nfe_init; IFQ_SET_MAXLEN(&ifp->if_snd, NFE_TX_RING_COUNT - 1); ifp->if_snd.ifq_drv_maxlen = NFE_TX_RING_COUNT - 1; Modified: stable/8/sys/dev/patm/if_patm_attach.c ============================================================================== --- stable/8/sys/dev/patm/if_patm_attach.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/patm/if_patm_attach.c Wed Jun 23 18:46:10 2010 (r209477) @@ -197,11 +197,9 @@ patm_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_SIMPLEX; - ifp->if_watchdog = NULL; ifp->if_init = patm_init; ifp->if_ioctl = patm_ioctl; ifp->if_start = patm_start; - ifp->if_watchdog = NULL; /* do this early so we can destroy unconditionally */ mtx_init(&sc->mtx, device_get_nameunit(dev), Modified: stable/8/sys/dev/sk/if_sk.c ============================================================================== --- stable/8/sys/dev/sk/if_sk.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/sk/if_sk.c Wed Jun 23 18:46:10 2010 (r209477) @@ -1372,8 +1372,6 @@ sk_attach(dev) ifp->if_capenable = ifp->if_capabilities; ifp->if_ioctl = sk_ioctl; ifp->if_start = sk_start; - ifp->if_timer = 0; - ifp->if_watchdog = NULL; ifp->if_init = sk_init; IFQ_SET_MAXLEN(&ifp->if_snd, SK_TX_RING_CNT - 1); ifp->if_snd.ifq_drv_maxlen = SK_TX_RING_CNT - 1; Modified: stable/8/sys/dev/stge/if_stge.c ============================================================================== --- stable/8/sys/dev/stge/if_stge.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/stge/if_stge.c Wed Jun 23 18:46:10 2010 (r209477) @@ -722,8 +722,6 @@ stge_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = stge_ioctl; ifp->if_start = stge_start; - ifp->if_timer = 0; - ifp->if_watchdog = NULL; ifp->if_init = stge_init; ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_drv_maxlen = STGE_TX_RING_CNT - 1; Modified: stable/8/sys/net/if_ef.c ============================================================================== --- stable/8/sys/net/if_ef.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/net/if_ef.c Wed Jun 23 18:46:10 2010 (r209477) @@ -128,7 +128,6 @@ ef_attach(struct efnet *sc) struct ifnet *ifp = sc->ef_ifp; ifp->if_start = ef_start; - ifp->if_watchdog = NULL; ifp->if_init = ef_init; ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); Modified: stable/8/sys/net80211/ieee80211.c ============================================================================== --- stable/8/sys/net80211/ieee80211.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/net80211/ieee80211.c Wed Jun 23 18:46:10 2010 (r209477) @@ -392,7 +392,6 @@ ieee80211_vap_setup(struct ieee80211com ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; ifp->if_start = ieee80211_start; ifp->if_ioctl = ieee80211_ioctl; - ifp->if_watchdog = NULL; /* NB: no watchdog routine */ ifp->if_init = ieee80211_init; /* NB: input+output filled in by ether_ifattach */ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); Modified: stable/8/sys/netgraph/ng_eiface.c ============================================================================== --- stable/8/sys/netgraph/ng_eiface.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/netgraph/ng_eiface.c Wed Jun 23 18:46:10 2010 (r209477) @@ -369,7 +369,6 @@ ng_eiface_constructor(node_p node) ifp->if_output = ether_output; ifp->if_start = ng_eiface_start; ifp->if_ioctl = ng_eiface_ioctl; - ifp->if_watchdog = NULL; ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; ifp->if_flags = (IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST); Modified: stable/8/sys/netgraph/ng_fec.c ============================================================================== --- stable/8/sys/netgraph/ng_fec.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/netgraph/ng_fec.c Wed Jun 23 18:46:10 2010 (r209477) @@ -1227,7 +1227,6 @@ ng_fec_constructor(node_p node) ifp->if_start = ng_fec_start; ifp->if_ioctl = ng_fec_ioctl; ifp->if_init = ng_fec_init; - ifp->if_watchdog = NULL; ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; ifp->if_mtu = NG_FEC_MTU_DEFAULT; ifp->if_flags = (IFF_SIMPLEX|IFF_BROADCAST|IFF_MULTICAST); Modified: stable/8/sys/netgraph/ng_iface.c ============================================================================== --- stable/8/sys/netgraph/ng_iface.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/netgraph/ng_iface.c Wed Jun 23 18:46:10 2010 (r209477) @@ -558,7 +558,6 @@ ng_iface_constructor(node_p node) ifp->if_output = ng_iface_output; ifp->if_start = ng_iface_start; ifp->if_ioctl = ng_iface_ioctl; - ifp->if_watchdog = NULL; ifp->if_mtu = NG_IFACE_MTU_DEFAULT; ifp->if_flags = (IFF_SIMPLEX|IFF_POINTOPOINT|IFF_NOARP|IFF_MULTICAST); ifp->if_type = IFT_PROPVIRTUAL; /* XXX */ Modified: stable/8/sys/netgraph/ng_sppp.c ============================================================================== --- stable/8/sys/netgraph/ng_sppp.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/netgraph/ng_sppp.c Wed Jun 23 18:46:10 2010 (r209477) @@ -279,7 +279,6 @@ ng_sppp_constructor (node_p node) if_initname (SP2IFP(pp), NG_SPPP_IFACE_NAME, priv->unit); ifp->if_start = ng_sppp_start; ifp->if_ioctl = ng_sppp_ioctl; - ifp->if_watchdog = NULL; ifp->if_flags = (IFF_POINTOPOINT|IFF_MULTICAST); /* Give this node the same name as the interface (if possible) */ From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 23 19:22:38 2010 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 DF6BD106567B; Wed, 23 Jun 2010 19:22:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC1C48FC13; Wed, 23 Jun 2010 19:22:38 +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 o5NJMcEN057548; Wed, 23 Jun 2010 19:22:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NJMcVC057547; Wed, 23 Jun 2010 19:22:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231922.o5NJMcVC057547@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 19:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209479 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ixgbe dev/xen/xenpci geom/sched 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, 23 Jun 2010 19:22:39 -0000 Author: jhb Date: Wed Jun 23 19:22:38 2010 New Revision: 209479 URL: http://svn.freebsd.org/changeset/base/209479 Log: Hoist mergeinfo for sys/dev/ixgbe up to sys. Modified: Directory Properties: 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/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 23 19:28:36 2010 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 5BFCA10656CA; Wed, 23 Jun 2010 19:28:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4904F8FC1B; Wed, 23 Jun 2010 19:28: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 o5NJSad7058917; Wed, 23 Jun 2010 19:28:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NJSaU9058916; Wed, 23 Jun 2010 19:28:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231928.o5NJSaU9058916@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 19:28: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: r209480 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci geom/sched 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, 23 Jun 2010 19:28:36 -0000 Author: jhb Date: Wed Jun 23 19:28:36 2010 New Revision: 209480 URL: http://svn.freebsd.org/changeset/base/209480 Log: Hoist mergeinfo for sys/geom/sched up to sys. Modified: Directory Properties: 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/geom/sched/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 23 20:59:00 2010 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 D3EF7106564A; Wed, 23 Jun 2010 20:59:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C18B58FC12; Wed, 23 Jun 2010 20:59: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 o5NKx0vw079037; Wed, 23 Jun 2010 20:59:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NKx09k079034; Wed, 23 Jun 2010 20:59:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201006232059.o5NKx09k079034@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 23 Jun 2010 20:59: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: r209484 - in stable/8: sbin/mount share/man/man5 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, 23 Jun 2010 20:59:01 -0000 Author: jilles Date: Wed Jun 23 20:59:00 2010 New Revision: 209484 URL: http://svn.freebsd.org/changeset/base/209484 Log: MFC r208647,r208654: Clarify devfs manpages slightly. mount(8): add xref to devfs(5) devfs(5): change example to something more likely to be useful (it is not necessary to mount a devfs on /dev manually, but for chroots/jails it is often needed), mention since when devfs is preferred to device nodes on ufs and when device nodes on ufs stopped working PR: 146600 Modified: stable/8/sbin/mount/mount.8 stable/8/share/man/man5/devfs.5 Directory Properties: stable/8/sbin/mount/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/8/sbin/mount/mount.8 ============================================================================== --- stable/8/sbin/mount/mount.8 Wed Jun 23 20:44:07 2010 (r209483) +++ stable/8/sbin/mount/mount.8 Wed Jun 23 20:59:00 2010 (r209484) @@ -525,6 +525,7 @@ support for a particular file system mig .Xr nmount 2 , .Xr acl 3 , .Xr mac 4 , +.Xr devfs 5 , .Xr ext2fs 5 , .Xr fstab 5 , .Xr procfs 5 , Modified: stable/8/share/man/man5/devfs.5 ============================================================================== --- stable/8/share/man/man5/devfs.5 Wed Jun 23 20:44:07 2010 (r209483) +++ stable/8/share/man/man5/devfs.5 Wed Jun 23 20:59:00 2010 (r209484) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 1996 +.Dd May 30, 2010 .Dt DEVFS 5 .Os .Sh NAME @@ -80,9 +80,9 @@ mount point. To mount a .Nm volume located on -.Pa /dev : +.Pa /mychroot/dev : .Pp -.Dl "mount -t devfs devfs /dev" +.Dl "mount -t devfs devfs /mychroot/dev" .Sh SEE ALSO .Xr devfs 8 , .Xr mount 8 @@ -91,6 +91,10 @@ The .Nm file system first appeared in .Fx 2.0 . +It became the preferred method for accessing devices in +.Fx 5.0 +and the only method in +.Fx 6.0 . The .Nm manual page first appeared in From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 24 05:52:45 2010 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 4D158106564A; Thu, 24 Jun 2010 05:52:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3967C8FC1E; Thu, 24 Jun 2010 05:52: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 o5O5qjKH097020; Thu, 24 Jun 2010 05:52:45 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5O5qiia097011; Thu, 24 Jun 2010 05:52:44 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006240552.o5O5qiia097011@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 24 Jun 2010 05:52: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: r209497 - in stable/8: sbin/geom/class/part sys/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: Thu, 24 Jun 2010 05:52:45 -0000 Author: ae Date: Thu Jun 24 05:52:44 2010 New Revision: 209497 URL: http://svn.freebsd.org/changeset/base/209497 Log: MFC r207094 (by marcel): Implement the resize verb and add support for resizing partitions for all schemes but EBR. MFC r207095 (by marcel): Implement the resize command for resizing partitions. Without new size, the partition in question is resized to fill all available space. Approved by: kib (mentor) Modified: stable/8/sbin/geom/class/part/geom_part.c stable/8/sbin/geom/class/part/gpart.8 stable/8/sys/geom/part/g_part.c stable/8/sys/geom/part/g_part_apm.c stable/8/sys/geom/part/g_part_bsd.c stable/8/sys/geom/part/g_part_gpt.c stable/8/sys/geom/part/g_part_if.m stable/8/sys/geom/part/g_part_mbr.c stable/8/sys/geom/part/g_part_pc98.c stable/8/sys/geom/part/g_part_vtoc8.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) 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) Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sbin/geom/class/part/geom_part.c Thu Jun 24 05:52:44 2010 (r209497) @@ -147,6 +147,13 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "geom", NULL }, + { "resize", 0, gpart_issue, { + { 's', "size", autofill, G_TYPE_ASCLBA }, + { 'i', index_param, NULL, G_TYPE_ASCNUM }, + { 'f', "flags", flags, G_TYPE_STRING }, + G_OPT_SENTINEL }, + "geom", NULL + }, G_CMD_SENTINEL }; @@ -257,6 +264,99 @@ fmtattrib(struct gprovider *pp) } static int +gpart_autofill_resize(struct gctl_req *req) +{ + struct gmesh mesh; + struct gclass *cp; + struct ggeom *gp; + struct gprovider *pp; + unsigned long long last, size, start, new_size; + unsigned long long lba, new_lba; + const char *s; + char *val; + int error, idx; + + s = gctl_get_ascii(req, "size"); + if (*s == '*') + new_size = (unsigned long long)atoll(s); + else + return (0); + + s = gctl_get_ascii(req, index_param); + idx = strtol(s, &val, 10); + if (idx < 1 || *s == '\0' || *val != '\0') + errx(EXIT_FAILURE, "invalid partition index"); + + error = geom_gettree(&mesh); + if (error) + return (error); + 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); + last = atoll(find_geomcfg(gp, "last")); + + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { + s = find_provcfg(pp, "index"); + if (s == NULL) + continue; + if (atoi(s) == idx) + break; + } + if (pp == NULL) + errx(EXIT_FAILURE, "invalid partition index"); + + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + start = atoll(s) / pp->lg_sectorsize; + } else + start = atoll(s); + s = find_provcfg(pp, "end"); + if (s == NULL) { + s = find_provcfg(pp, "length"); + lba = start + atoll(s) / pp->lg_sectorsize; + } else + lba = atoll(s) + 1; + + if (lba > last) + return (ENOSPC); + size = lba - start; + pp = find_provider(gp, lba); + if (pp == NULL) + new_size = last - start + 1; + else { + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + new_lba = atoll(s) / pp->lg_sectorsize; + } else + new_lba = atoll(s); + /* Is there any free space between current and + * next providers? + */ + if (new_lba > lba) + new_size = new_lba - start; + else + return (ENOSPC); + } + asprintf(&val, "%llu", new_size); + if (val == NULL) + return (ENOMEM); + gctl_change_param(req, "size", -1, val); + + return (0); +} + +static int gpart_autofill(struct gctl_req *req) { struct gmesh mesh; @@ -271,6 +371,8 @@ gpart_autofill(struct gctl_req *req) int error, has_size, has_start; s = gctl_get_ascii(req, "verb"); + if (strcmp(s, "resize") == 0) + return gpart_autofill_resize(req); if (strcmp(s, "add") != 0) return (0); Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sbin/geom/class/part/gpart.8 Thu Jun 24 05:52:44 2010 (r209497) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 2010 +.Dd June 24, 2010 .Dt GPART 8 .Os .Sh NAME @@ -123,6 +123,13 @@ utility: .Op Fl t Ar type .Op Fl f Ar flags .Ar geom +.\" ==== RESIZE ==== +.Nm +.Cm resize +.Fl i Ar index +.Op Fl s Ar size +.Op Fl f Ar flags +.Ar geom .\" ==== SET ==== .Nm .Cm set @@ -334,6 +341,32 @@ See the section entitled below for a discussion about its use. .El +.\" ==== RESIZE ==== +.It Cm resize +Resize a partition from geom +.Ar geom +and further identified by the +.Fl i Ar index +option. +New partition size is expressed in logical block +numbers and can be given by the +.Fl s Ar size +option. +If +.Fl s +option is ommited then new size is automatically calculated +to maximum available from given geom +.Ar geom . +.Pp +Additional options include: +.Bl -tag -width 10n +.It Fl f Ar flags +Additional operational flags. +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion +about its use. +.El .\" ==== SET ==== .It Cm set Set the named attribute on the partition entry. @@ -450,7 +483,7 @@ The scheme-specific types are .Qq Li "!FreeBSD-ZFS" for APM, .Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b" - for GPT, and 0x0904 for VTOC8. +for GPT, and 0x0904 for VTOC8. .It Cm mbr A partition that is sub-partitioned by a master boot record (MBR). This type is known as Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part.c Thu Jun 24 05:52:44 2010 (r209497) @@ -968,9 +968,85 @@ g_part_ctl_recover(struct gctl_req *req, static int g_part_ctl_resize(struct gctl_req *req, struct g_part_parms *gpp) { - gctl_error(req, "%d verb 'resize'", ENOSYS); - return (ENOSYS); -} + struct g_geom *gp; + struct g_provider *pp; + struct g_part_entry *pe, *entry; + struct g_part_table *table; + struct sbuf *sb; + quad_t end; + int error; + + gp = gpp->gpp_geom; + G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, gp->name)); + g_topology_assert(); + table = gp->softc; + + /* check gpp_index */ + LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { + if (entry->gpe_deleted || entry->gpe_internal) + continue; + if (entry->gpe_index == gpp->gpp_index) + break; + } + if (entry == NULL) { + gctl_error(req, "%d index '%d'", ENOENT, gpp->gpp_index); + return (ENOENT); + } + + /* check gpp_size */ + end = entry->gpe_start + gpp->gpp_size - 1; + if (gpp->gpp_size < 1 || end > table->gpt_last) { + gctl_error(req, "%d size '%jd'", EINVAL, + (intmax_t)gpp->gpp_size); + return (EINVAL); + } + + LIST_FOREACH(pe, &table->gpt_entry, gpe_entry) { + if (pe->gpe_deleted || pe->gpe_internal || pe == entry) + continue; + if (end >= pe->gpe_start && end <= pe->gpe_end) { + gctl_error(req, "%d end '%jd'", ENOSPC, + (intmax_t)end); + return (ENOSPC); + } + if (entry->gpe_start < pe->gpe_start && end > pe->gpe_end) { + gctl_error(req, "%d size '%jd'", ENOSPC, + (intmax_t)gpp->gpp_size); + return (ENOSPC); + } + } + + pp = entry->gpe_pp; + if ((g_debugflags & 16) == 0 && + (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)) { + gctl_error(req, "%d", EBUSY); + return (EBUSY); + } + + error = G_PART_RESIZE(table, entry, gpp); + if (error) { + gctl_error(req, "%d", error); + return (error); + } + + if (!entry->gpe_created) + entry->gpe_modified = 1; + + /* update mediasize of changed provider */ + pp->mediasize = (entry->gpe_end - entry->gpe_start + 1) * + pp->sectorsize; + + /* Provide feedback if so requested. */ + if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { + sb = sbuf_new_auto(); + G_PART_FULLNAME(table, entry, sb, gp->name); + sbuf_cat(sb, " resized\n"); + sbuf_finish(sb); + gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); + sbuf_delete(sb); + } + return (0); +} static int g_part_ctl_setunset(struct gctl_req *req, struct g_part_parms *gpp, @@ -1206,7 +1282,8 @@ g_part_ctlreq(struct gctl_req *req, stru mparms |= G_PART_PARM_GEOM; } else if (!strcmp(verb, "resize")) { ctlreq = G_PART_CTL_RESIZE; - mparms |= G_PART_PARM_GEOM | G_PART_PARM_INDEX; + mparms |= G_PART_PARM_GEOM | G_PART_PARM_INDEX | + G_PART_PARM_SIZE; } break; case 's': Modified: stable/8/sys/geom/part/g_part_apm.c ============================================================================== --- stable/8/sys/geom/part/g_part_apm.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_apm.c Thu Jun 24 05:52:44 2010 (r209497) @@ -74,6 +74,8 @@ static int g_part_apm_read(struct g_part static const char *g_part_apm_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_apm_write(struct g_part_table *, struct g_consumer *); +static int g_part_apm_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_apm_methods[] = { KOBJMETHOD(g_part_add, g_part_apm_add), @@ -82,6 +84,7 @@ static kobj_method_t g_part_apm_methods[ KOBJMETHOD(g_part_dumpconf, g_part_apm_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_apm_dumpto), KOBJMETHOD(g_part_modify, g_part_apm_modify), + KOBJMETHOD(g_part_resize, g_part_apm_resize), KOBJMETHOD(g_part_name, g_part_apm_name), KOBJMETHOD(g_part_probe, g_part_apm_probe), KOBJMETHOD(g_part_read, g_part_apm_read), @@ -338,6 +341,19 @@ g_part_apm_modify(struct g_part_table *b return (0); } +static int +g_part_apm_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_apm_entry *entry; + + entry = (struct g_part_apm_entry *)baseentry; + baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; + entry->ent.ent_size = gpp->gpp_size; + + return (0); +} + static const char * g_part_apm_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) Modified: stable/8/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/8/sys/geom/part/g_part_bsd.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_bsd.c Thu Jun 24 05:52:44 2010 (r209497) @@ -73,6 +73,8 @@ static int g_part_bsd_read(struct g_part static const char *g_part_bsd_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_bsd_write(struct g_part_table *, struct g_consumer *); +static int g_part_bsd_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_bsd_methods[] = { KOBJMETHOD(g_part_add, g_part_bsd_add), @@ -82,6 +84,7 @@ static kobj_method_t g_part_bsd_methods[ KOBJMETHOD(g_part_dumpconf, g_part_bsd_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_bsd_dumpto), KOBJMETHOD(g_part_modify, g_part_bsd_modify), + KOBJMETHOD(g_part_resize, g_part_bsd_resize), KOBJMETHOD(g_part_name, g_part_bsd_name), KOBJMETHOD(g_part_probe, g_part_bsd_probe), KOBJMETHOD(g_part_read, g_part_bsd_read), @@ -296,6 +299,19 @@ g_part_bsd_modify(struct g_part_table *b return (0); } +static int +g_part_bsd_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_bsd_entry *entry; + + entry = (struct g_part_bsd_entry *)baseentry; + baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; + entry->part.p_size = gpp->gpp_size; + + return (0); +} + static const char * g_part_bsd_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) Modified: stable/8/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/8/sys/geom/part/g_part_gpt.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_gpt.c Thu Jun 24 05:52:44 2010 (r209497) @@ -103,6 +103,8 @@ static int g_part_gpt_read(struct g_part static const char *g_part_gpt_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_gpt_write(struct g_part_table *, struct g_consumer *); +static int g_part_gpt_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_gpt_methods[] = { KOBJMETHOD(g_part_add, g_part_gpt_add), @@ -112,6 +114,7 @@ static kobj_method_t g_part_gpt_methods[ KOBJMETHOD(g_part_dumpconf, g_part_gpt_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_gpt_dumpto), KOBJMETHOD(g_part_modify, g_part_gpt_modify), + KOBJMETHOD(g_part_resize, g_part_gpt_resize), KOBJMETHOD(g_part_name, g_part_gpt_name), KOBJMETHOD(g_part_probe, g_part_gpt_probe), KOBJMETHOD(g_part_read, g_part_gpt_read), @@ -532,6 +535,19 @@ g_part_gpt_modify(struct g_part_table *b return (0); } +static int +g_part_gpt_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_gpt_entry *entry; + entry = (struct g_part_gpt_entry *)baseentry; + + baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; + entry->ent.ent_lba_end = baseentry->gpe_end; + + return (0); +} + static const char * g_part_gpt_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) Modified: stable/8/sys/geom/part/g_part_if.m ============================================================================== --- stable/8/sys/geom/part/g_part_if.m Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_if.m Thu Jun 24 05:52:44 2010 (r209497) @@ -58,6 +58,13 @@ CODE { { return (0); } + + static int + default_resize(struct g_part_table *t __unused, + struct g_part_entry *e __unused, struct g_part_parms *p __unused) + { + return (ENOSYS); + } }; # add() - scheme specific processing for the add verb. @@ -114,6 +121,13 @@ METHOD int modify { struct g_part_parms *gpp; }; +# resize() - scheme specific processing for the resize verb. +METHOD int resize { + struct g_part_table *table; + struct g_part_entry *entry; + struct g_part_parms *gpp; +} DEFAULT default_resize; + # name() - return the name of the given partition entry. # Typical names are "p1", "s0" or "c". METHOD const char * name { Modified: stable/8/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/8/sys/geom/part/g_part_mbr.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_mbr.c Thu Jun 24 05:52:44 2010 (r209497) @@ -76,6 +76,8 @@ static int g_part_mbr_setunset(struct g_ static const char *g_part_mbr_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_mbr_write(struct g_part_table *, struct g_consumer *); +static int g_part_mbr_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_mbr_methods[] = { KOBJMETHOD(g_part_add, g_part_mbr_add), @@ -85,6 +87,7 @@ static kobj_method_t g_part_mbr_methods[ KOBJMETHOD(g_part_dumpconf, g_part_mbr_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_mbr_dumpto), KOBJMETHOD(g_part_modify, g_part_mbr_modify), + KOBJMETHOD(g_part_resize, g_part_mbr_resize), KOBJMETHOD(g_part_name, g_part_mbr_name), KOBJMETHOD(g_part_probe, g_part_mbr_probe), KOBJMETHOD(g_part_read, g_part_mbr_read), @@ -302,6 +305,31 @@ g_part_mbr_modify(struct g_part_table *b return (0); } +static int +g_part_mbr_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_mbr_entry *entry; + uint32_t size, sectors; + + sectors = basetable->gpt_sectors; + size = gpp->gpp_size; + + if (size < sectors) + return (EINVAL); + if (size % sectors) + size = size - (size % sectors); + if (size < sectors) + return (EINVAL); + + entry = (struct g_part_mbr_entry *)baseentry; + baseentry->gpe_end = baseentry->gpe_start + size - 1; + entry->ent.dp_size = size; + mbr_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl, + &entry->ent.dp_ehd, &entry->ent.dp_esect); + return (0); +} + static const char * g_part_mbr_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) Modified: stable/8/sys/geom/part/g_part_pc98.c ============================================================================== --- stable/8/sys/geom/part/g_part_pc98.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_pc98.c Thu Jun 24 05:52:44 2010 (r209497) @@ -77,6 +77,8 @@ static int g_part_pc98_setunset(struct g static const char *g_part_pc98_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_pc98_write(struct g_part_table *, struct g_consumer *); +static int g_part_pc98_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_pc98_methods[] = { KOBJMETHOD(g_part_add, g_part_pc98_add), @@ -86,6 +88,7 @@ static kobj_method_t g_part_pc98_methods KOBJMETHOD(g_part_dumpconf, g_part_pc98_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_pc98_dumpto), KOBJMETHOD(g_part_modify, g_part_pc98_modify), + KOBJMETHOD(g_part_resize, g_part_pc98_resize), KOBJMETHOD(g_part_name, g_part_pc98_name), KOBJMETHOD(g_part_probe, g_part_pc98_probe), KOBJMETHOD(g_part_read, g_part_pc98_read), @@ -308,6 +311,31 @@ g_part_pc98_modify(struct g_part_table * return (0); } +static int +g_part_pc98_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_pc98_entry *entry; + uint32_t size, cyl; + + cyl = basetable->gpt_heads * basetable->gpt_sectors; + size = gpp->gpp_size; + + if (size < cyl) + return (EINVAL); + if (size % cyl) + size = size - (size % cyl); + if (size < cyl) + return (EINVAL); + + entry = (struct g_part_pc98_entry *)baseentry; + baseentry->gpe_end = baseentry->gpe_start + size - 1; + pc98_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl, + &entry->ent.dp_ehd, &entry->ent.dp_esect); + + return (0); +} + static const char * g_part_pc98_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) Modified: stable/8/sys/geom/part/g_part_vtoc8.c ============================================================================== --- stable/8/sys/geom/part/g_part_vtoc8.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_vtoc8.c Thu Jun 24 05:52:44 2010 (r209497) @@ -67,6 +67,8 @@ static int g_part_vtoc8_read(struct g_pa static const char *g_part_vtoc8_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_vtoc8_write(struct g_part_table *, struct g_consumer *); +static int g_part_vtoc8_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_vtoc8_methods[] = { KOBJMETHOD(g_part_add, g_part_vtoc8_add), @@ -75,6 +77,7 @@ static kobj_method_t g_part_vtoc8_method KOBJMETHOD(g_part_dumpconf, g_part_vtoc8_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_vtoc8_dumpto), KOBJMETHOD(g_part_modify, g_part_vtoc8_modify), + KOBJMETHOD(g_part_resize, g_part_vtoc8_resize), KOBJMETHOD(g_part_name, g_part_vtoc8_name), KOBJMETHOD(g_part_probe, g_part_vtoc8_probe), KOBJMETHOD(g_part_read, g_part_vtoc8_read), @@ -296,6 +299,26 @@ g_part_vtoc8_modify(struct g_part_table return (0); } +static int +g_part_vtoc8_resize(struct g_part_table *basetable, + struct g_part_entry *entry, struct g_part_parms *gpp) +{ + struct g_part_vtoc8_table *table; + uint64_t size; + + table = (struct g_part_vtoc8_table *)basetable; + size = gpp->gpp_size; + if (size % table->secpercyl) + size = size - (size % table->secpercyl); + if (size < table->secpercyl) + return (EINVAL); + + entry->gpe_end = entry->gpe_start + size - 1; + be32enc(&table->vtoc.map[entry->gpe_index - 1].nblks, size); + + return (0); +} + static const char * g_part_vtoc8_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 24 06:31:23 2010 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 7D5C8106566B; Thu, 24 Jun 2010 06:31:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B46E8FC25; Thu, 24 Jun 2010 06:31: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 o5O6VNuI005599; Thu, 24 Jun 2010 06:31:23 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5O6VNBr005597; Thu, 24 Jun 2010 06:31:23 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006240631.o5O6VNBr005597@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 24 Jun 2010 06:31: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: r209498 - 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: Thu, 24 Jun 2010 06:31:23 -0000 Author: ae Date: Thu Jun 24 06:31:23 2010 New Revision: 209498 URL: http://svn.freebsd.org/changeset/base/209498 Log: MFC r207096 (by marcel): Add and describe GEOM_PART_EBR. Approved by: mav (mentor) Modified: stable/8/sbin/geom/class/part/gpart.8 Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Thu Jun 24 05:52:44 2010 (r209497) +++ stable/8/sbin/geom/class/part/gpart.8 Thu Jun 24 06:31:23 2010 (r209498) @@ -37,6 +37,7 @@ lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "options GEOM_PART_APM" .Cd "options GEOM_PART_BSD" +.Cd "options GEOM_PART_EBR" .Cd "options GEOM_PART_GPT" .Cd "options GEOM_PART_MBR" .Cd "options GEOM_PART_PC98" @@ -53,6 +54,10 @@ option adds support for the traditional .Bx disklabel. The +.Dv GEOM_PART_EBR +option adds support for the Extended Boot Record (EBR), +which is used to define a logical partition. +The .Dv GEOM_PART_GPT option adds support for the GUID Partition Table (GPT) found on Intel Itanium computers and Intel-based Macintosh computers. From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 24 12:08:51 2010 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 29909106564A; Thu, 24 Jun 2010 12:08:51 +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 F398B8FC18; Thu, 24 Jun 2010 12:08:50 +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 o5OC8oNb082421; Thu, 24 Jun 2010 12:08:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OC8om3082418; Thu, 24 Jun 2010 12:08:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006241208.o5OC8om3082418@svn.freebsd.org> From: John Baldwin Date: Thu, 24 Jun 2010 12:08: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: r209503 - stable/8/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, 24 Jun 2010 12:08:51 -0000 Author: jhb Date: Thu Jun 24 12:08:50 2010 New Revision: 209503 URL: http://svn.freebsd.org/changeset/base/209503 Log: MFC 208391: Assert that the thread passed to sched_bind() and sched_unbind() is curthread as those routines are only supported for curthread currently. Modified: stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c Directory Properties: 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) Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Thu Jun 24 10:14:31 2010 (r209502) +++ stable/8/sys/kern/sched_4bsd.c Thu Jun 24 12:08:50 2010 (r209503) @@ -1462,9 +1462,8 @@ sched_bind(struct thread *td, int cpu) { struct td_sched *ts; - THREAD_LOCK_ASSERT(td, MA_OWNED); - KASSERT(TD_IS_RUNNING(td), - ("sched_bind: cannot bind non-running thread")); + THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED); + KASSERT(td == curthread, ("sched_bind: can only bind curthread")); ts = td->td_sched; @@ -1482,6 +1481,7 @@ void sched_unbind(struct thread* td) { THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(td == curthread, ("sched_unbind: can only bind curthread")); td->td_flags &= ~TDF_BOUND; } Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Thu Jun 24 10:14:31 2010 (r209502) +++ stable/8/sys/kern/sched_ule.c Thu Jun 24 12:08:50 2010 (r209503) @@ -2427,6 +2427,7 @@ sched_bind(struct thread *td, int cpu) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED); + KASSERT(td == curthread, ("sched_bind: can only bind curthread")); ts = td->td_sched; if (ts->ts_flags & TSF_BOUND) sched_unbind(td); @@ -2448,6 +2449,7 @@ sched_unbind(struct thread *td) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(td == curthread, ("sched_unbind: can only bind curthread")); ts = td->td_sched; if ((ts->ts_flags & TSF_BOUND) == 0) return; From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 24 12:30:30 2010 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 599B71065673; Thu, 24 Jun 2010 12:30:30 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id AA48C8FC16; Thu, 24 Jun 2010 12:30:29 +0000 (UTC) Received: by qwg5 with SMTP id 5so194596qwg.13 for ; Thu, 24 Jun 2010 05:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=/wkHzTURgx+VR4MB/KFQK1Xtqv1Q5/NJRlsBNXS7n3I=; b=SotEQXHaB/DaRKlyZ9cO4z2FpNQdlaPXiE1MZEtwcGx/AZh8PWPYwlvkGquEfYQUmU PmJW9VYyLkbAylFVWblwSDNsGaZ/SWwH5ZgO9PN+jVyHR/BDxF6eNOHjd/jI4Wpe2L7k pItwOGX19uYPiQO8Gd4bWJ6de4JxOrAGAOqEE= 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=XNayCCIwxkABkbGR4PlhjnpkYoT1gBb4xIeFrtMCPWExgl4cu5lTuA3zVvKYLVszQk TChhjtKNEi+cWxJX0mFgmIH18PDr2soQRpRIpH1MAmsxpalHX/bxEKVX3kMNvnMy5DIc cFMUN2XVyXky15PVmS7jEz4p37b5VREvmZV0k= MIME-Version: 1.0 Received: by 10.224.52.8 with SMTP id f8mr6133837qag.122.1277382628817; Thu, 24 Jun 2010 05:30:28 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.229.235.206 with HTTP; Thu, 24 Jun 2010 05:30:28 -0700 (PDT) In-Reply-To: <201006241208.o5OC8om3082418@svn.freebsd.org> References: <201006241208.o5OC8om3082418@svn.freebsd.org> Date: Thu, 24 Jun 2010 14:30:28 +0200 X-Google-Sender-Auth: r_jTmiyozP_dhJ8QguwcE3bpfTs Message-ID: From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r209503 - stable/8/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, 24 Jun 2010 12:30:30 -0000 2010/6/24 John Baldwin : > Author: jhb > Date: Thu Jun 24 12:08:50 2010 > New Revision: 209503 > URL: http://svn.freebsd.org/changeset/base/209503 > > Log: > =C2=A0MFC 208391: > =C2=A0Assert that the thread passed to sched_bind() and sched_unbind() is > =C2=A0curthread as those routines are only supported for curthread curren= tly. In general, I think that possibly sched_bind() and sched_unbind() may loose their argument in the future. Of course, that is a KPI breakage (which may be unconfortable to work with)= . Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 24 13:11:12 2010 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 BFC7B10656C4; Thu, 24 Jun 2010 13:11:12 +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 AE0418FC1F; Thu, 24 Jun 2010 13:11: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 o5ODBCHp096201; Thu, 24 Jun 2010 13:11:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ODBCPH096196; Thu, 24 Jun 2010 13:11:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006241311.o5ODBCPH096196@svn.freebsd.org> From: John Baldwin Date: Thu, 24 Jun 2010 13:11: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: r209505 - in stable/8/sys: amd64/amd64 ia64/ia64 kern mips/mips 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, 24 Jun 2010 13:11:12 -0000 Author: jhb Date: Thu Jun 24 13:11:12 2010 New Revision: 209505 URL: http://svn.freebsd.org/changeset/base/209505 Log: MFC 208392: - Adjust the whitespace for the lines that output fields in 'show pcpu' in DDB so that all the fields line up. - Print out the tid of the per-CPU idlethread instead of the pid since the idle process is now shared across all idle threads. Modified: stable/8/sys/amd64/amd64/db_interface.c stable/8/sys/ia64/ia64/db_machdep.c stable/8/sys/kern/subr_pcpu.c stable/8/sys/mips/mips/db_trace.c Directory Properties: 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) Modified: stable/8/sys/amd64/amd64/db_interface.c ============================================================================== --- stable/8/sys/amd64/amd64/db_interface.c Thu Jun 24 12:09:12 2010 (r209504) +++ stable/8/sys/amd64/amd64/db_interface.c Thu Jun 24 13:11:12 2010 (r209505) @@ -139,11 +139,11 @@ void db_show_mdpcpu(struct pcpu *pc) { - db_printf("curpmap = %p\n", pc->pc_curpmap); - db_printf("tssp = %p\n", pc->pc_tssp); - db_printf("commontssp = %p\n", pc->pc_commontssp); - db_printf("rsp0 = 0x%lx\n", pc->pc_rsp0); - db_printf("gs32p = %p\n", pc->pc_gs32p); - db_printf("ldt = %p\n", pc->pc_ldt); - db_printf("tss = %p\n", pc->pc_tss); + db_printf("curpmap = %p\n", pc->pc_curpmap); + db_printf("tssp = %p\n", pc->pc_tssp); + db_printf("commontssp = %p\n", pc->pc_commontssp); + db_printf("rsp0 = 0x%lx\n", pc->pc_rsp0); + db_printf("gs32p = %p\n", pc->pc_gs32p); + db_printf("ldt = %p\n", pc->pc_ldt); + db_printf("tss = %p\n", pc->pc_tss); } Modified: stable/8/sys/ia64/ia64/db_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/db_machdep.c Thu Jun 24 12:09:12 2010 (r209504) +++ stable/8/sys/ia64/ia64/db_machdep.c Thu Jun 24 13:11:12 2010 (r209505) @@ -579,11 +579,11 @@ db_show_mdpcpu(struct pcpu *pc) { struct pcpu_md *md = &pc->pc_md; - db_printf("MD: vhpt = %#lx\n", md->vhpt); - db_printf("MD: lid = %#lx\n", md->lid); - db_printf("MD: clock = %#lx/%#lx\n", md->clock, md->clockadj); - db_printf("MD: stats = %p\n", &md->stats); - db_printf("MD: pmap = %p\n", md->current_pmap); + db_printf("MD: vhpt = %#lx\n", md->vhpt); + db_printf("MD: lid = %#lx\n", md->lid); + db_printf("MD: clock = %#lx/%#lx\n", md->clock, md->clockadj); + db_printf("MD: stats = %p\n", &md->stats); + db_printf("MD: pmap = %p\n", md->current_pmap); } void Modified: stable/8/sys/kern/subr_pcpu.c ============================================================================== --- stable/8/sys/kern/subr_pcpu.c Thu Jun 24 12:09:12 2010 (r209504) +++ stable/8/sys/kern/subr_pcpu.c Thu Jun 24 13:11:12 2010 (r209505) @@ -332,7 +332,7 @@ show_pcpu(struct pcpu *pc) struct thread *td; db_printf("cpuid = %d\n", pc->pc_cpuid); - db_printf("dynamic pcpu = %p\n", (void *)pc->pc_dynamic); + db_printf("dynamic pcpu = %p\n", (void *)pc->pc_dynamic); db_printf("curthread = "); td = pc->pc_curthread; if (td != NULL) @@ -351,12 +351,11 @@ show_pcpu(struct pcpu *pc) db_printf("idlethread = "); td = pc->pc_idlethread; if (td != NULL) - db_printf("%p: pid %d \"%s\"\n", td, td->td_proc->p_pid, - td->td_name); + db_printf("%p: tid %d \"%s\"\n", td, td->td_tid, td->td_name); else db_printf("none\n"); db_show_mdpcpu(pc); - + #ifdef VIMAGE db_printf("curvnet = %p\n", pc->pc_curthread->td_vnet); #endif Modified: stable/8/sys/mips/mips/db_trace.c ============================================================================== --- stable/8/sys/mips/mips/db_trace.c Thu Jun 24 12:09:12 2010 (r209504) +++ stable/8/sys/mips/mips/db_trace.c Thu Jun 24 13:11:12 2010 (r209505) @@ -70,8 +70,8 @@ void db_show_mdpcpu(struct pcpu *pc) { - db_printf("ipis = 0x%x\n", pc->pc_pending_ipis); + db_printf("ipis = 0x%x\n", pc->pc_pending_ipis); db_printf("next ASID = %d\n", pc->pc_next_asid); - db_printf("GENID = %d\n", pc->pc_asid_generation); + db_printf("GENID = %d\n", pc->pc_asid_generation); return; } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 24 13:17:45 2010 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 CD3C01065674; Thu, 24 Jun 2010 13:17:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB94C8FC0A; Thu, 24 Jun 2010 13:17: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 o5ODHjH9097728; Thu, 24 Jun 2010 13:17:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ODHjJl097725; Thu, 24 Jun 2010 13:17:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006241317.o5ODHjJl097725@svn.freebsd.org> From: John Baldwin Date: Thu, 24 Jun 2010 13:17: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: r209506 - in stable/8/sys: amd64/amd64 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, 24 Jun 2010 13:17:46 -0000 Author: jhb Date: Thu Jun 24 13:17:45 2010 New Revision: 209506 URL: http://svn.freebsd.org/changeset/base/209506 Log: MFC 208915,208991: - Use a bit more care when moving I/O APIC interrupts between CPUs. Mask the interrupt followed by a brief delay if it is not currently masked before moving the interrupt. - Move the icu_lock out of ioapic_program_intpin() and into callers. This closes a race where ioapic_program_intpin() could use a stale value of the masked state to compute the masked bit in the register. Modified: stable/8/sys/amd64/amd64/io_apic.c stable/8/sys/i386/i386/io_apic.c Directory Properties: 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) Modified: stable/8/sys/amd64/amd64/io_apic.c ============================================================================== --- stable/8/sys/amd64/amd64/io_apic.c Thu Jun 24 13:11:12 2010 (r209505) +++ stable/8/sys/amd64/amd64/io_apic.c Thu Jun 24 13:17:45 2010 (r209506) @@ -261,16 +261,15 @@ ioapic_program_intpin(struct ioapic_ints * If a pin is completely invalid or if it is valid but hasn't * been enabled yet, just ensure that the pin is masked. */ + mtx_assert(&icu_lock, MA_OWNED); if (intpin->io_irq == IRQ_DISABLED || (intpin->io_irq < NUM_IO_INTS && intpin->io_vector == 0)) { - mtx_lock_spin(&icu_lock); low = ioapic_read(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin)); if ((low & IOART_INTMASK) == IOART_INTMCLR) ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low | IOART_INTMSET); - mtx_unlock_spin(&icu_lock); return; } @@ -312,14 +311,12 @@ ioapic_program_intpin(struct ioapic_ints } /* Write the values to the APIC. */ - mtx_lock_spin(&icu_lock); intpin->io_lowreg = low; ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low); value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin)); value &= ~IOART_DEST; value |= high; ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value); - mtx_unlock_spin(&icu_lock); } static int @@ -352,6 +349,19 @@ ioapic_assign_cpu(struct intsrc *isrc, u if (new_vector == 0) return (ENOSPC); + /* + * Mask the old intpin if it is enabled while it is migrated. + * + * At least some level-triggered interrupts seem to need the + * extra DELAY() to avoid being stuck in a non-EOI'd state. + */ + mtx_lock_spin(&icu_lock); + if (!intpin->io_masked && !intpin->io_edgetrigger) { + ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), + intpin->io_lowreg | IOART_INTMSET); + DELAY(100); + } + intpin->io_cpu = apic_id; intpin->io_vector = new_vector; if (isrc->is_handlers > 0) @@ -364,6 +374,8 @@ ioapic_assign_cpu(struct intsrc *isrc, u intpin->io_vector); } ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); + /* * Free the old vector after the new one is established. This is done * to prevent races where we could miss an interrupt. @@ -399,9 +411,11 @@ ioapic_disable_intr(struct intsrc *isrc) /* Mask this interrupt pin and free its APIC vector. */ vector = intpin->io_vector; apic_disable_vector(intpin->io_cpu, vector); + mtx_lock_spin(&icu_lock); intpin->io_masked = 1; intpin->io_vector = 0; ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); apic_free_vector(intpin->io_cpu, vector, intpin->io_irq); } } @@ -443,6 +457,7 @@ ioapic_config_intr(struct intsrc *isrc, * XXX: Should we write to the ELCR if the trigger mode changes for * an EISA IRQ or an ISA IRQ with the ELCR present? */ + mtx_lock_spin(&icu_lock); if (intpin->io_bus == APIC_BUS_EISA) pol = INTR_POLARITY_HIGH; changed = 0; @@ -464,6 +479,7 @@ ioapic_config_intr(struct intsrc *isrc, } if (changed) ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); return (0); } @@ -473,8 +489,10 @@ ioapic_resume(struct pic *pic) struct ioapic *io = (struct ioapic *)pic; int i; + mtx_lock_spin(&icu_lock); for (i = 0; i < io->io_numintr; i++) ioapic_program_intpin(&io->io_pins[i]); + mtx_unlock_spin(&icu_lock); } /* Modified: stable/8/sys/i386/i386/io_apic.c ============================================================================== --- stable/8/sys/i386/i386/io_apic.c Thu Jun 24 13:11:12 2010 (r209505) +++ stable/8/sys/i386/i386/io_apic.c Thu Jun 24 13:17:45 2010 (r209506) @@ -261,16 +261,15 @@ ioapic_program_intpin(struct ioapic_ints * If a pin is completely invalid or if it is valid but hasn't * been enabled yet, just ensure that the pin is masked. */ + mtx_assert(&icu_lock, MA_OWNED); if (intpin->io_irq == IRQ_DISABLED || (intpin->io_irq < NUM_IO_INTS && intpin->io_vector == 0)) { - mtx_lock_spin(&icu_lock); low = ioapic_read(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin)); if ((low & IOART_INTMASK) == IOART_INTMCLR) ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low | IOART_INTMSET); - mtx_unlock_spin(&icu_lock); return; } @@ -312,14 +311,12 @@ ioapic_program_intpin(struct ioapic_ints } /* Write the values to the APIC. */ - mtx_lock_spin(&icu_lock); intpin->io_lowreg = low; ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low); value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin)); value &= ~IOART_DEST; value |= high; ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value); - mtx_unlock_spin(&icu_lock); } static int @@ -352,6 +349,19 @@ ioapic_assign_cpu(struct intsrc *isrc, u if (new_vector == 0) return (ENOSPC); + /* + * Mask the old intpin if it is enabled while it is migrated. + * + * At least some level-triggered interrupts seem to need the + * extra DELAY() to avoid being stuck in a non-EOI'd state. + */ + mtx_lock_spin(&icu_lock); + if (!intpin->io_masked && !intpin->io_edgetrigger) { + ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), + intpin->io_lowreg | IOART_INTMSET); + DELAY(100); + } + intpin->io_cpu = apic_id; intpin->io_vector = new_vector; if (isrc->is_handlers > 0) @@ -364,6 +374,8 @@ ioapic_assign_cpu(struct intsrc *isrc, u intpin->io_vector); } ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); + /* * Free the old vector after the new one is established. This is done * to prevent races where we could miss an interrupt. @@ -399,9 +411,11 @@ ioapic_disable_intr(struct intsrc *isrc) /* Mask this interrupt pin and free its APIC vector. */ vector = intpin->io_vector; apic_disable_vector(intpin->io_cpu, vector); + mtx_lock_spin(&icu_lock); intpin->io_masked = 1; intpin->io_vector = 0; ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); apic_free_vector(intpin->io_cpu, vector, intpin->io_irq); } } @@ -443,6 +457,7 @@ ioapic_config_intr(struct intsrc *isrc, * XXX: Should we write to the ELCR if the trigger mode changes for * an EISA IRQ or an ISA IRQ with the ELCR present? */ + mtx_lock_spin(&icu_lock); if (intpin->io_bus == APIC_BUS_EISA) pol = INTR_POLARITY_HIGH; changed = 0; @@ -464,6 +479,7 @@ ioapic_config_intr(struct intsrc *isrc, } if (changed) ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); return (0); } @@ -473,8 +489,10 @@ ioapic_resume(struct pic *pic) struct ioapic *io = (struct ioapic *)pic; int i; + mtx_lock_spin(&icu_lock); for (i = 0; i < io->io_numintr; i++) ioapic_program_intpin(&io->io_pins[i]); + mtx_unlock_spin(&icu_lock); } /* From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 25 08:53:52 2010 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 4DAFF1065678; Fri, 25 Jun 2010 08:53:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BCB18FC15; Fri, 25 Jun 2010 08:53: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 o5P8rpPs056435; Fri, 25 Jun 2010 08:53:51 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5P8rptS056432; Fri, 25 Jun 2010 08:53:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006250853.o5P8rptS056432@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 25 Jun 2010 08:53: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: r209522 - stable/8/sys/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: Fri, 25 Jun 2010 08:53:52 -0000 Author: ae Date: Fri Jun 25 08:53:51 2010 New Revision: 209522 URL: http://svn.freebsd.org/changeset/base/209522 Log: MFC r200539 (by rpaulo): Add Microsoft and NetBSD partition types handling. Approved by: kib (mentor) Modified: stable/8/sys/geom/part/g_part.c stable/8/sys/geom/part/g_part.h stable/8/sys/geom/part/g_part_gpt.c Directory Properties: 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) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Fri Jun 25 05:36:36 2010 (r209521) +++ stable/8/sys/geom/part/g_part.c Fri Jun 25 08:53:51 2010 (r209522) @@ -87,6 +87,16 @@ struct g_part_alias_list { { "linux-lvm", G_PART_ALIAS_LINUX_LVM }, { "linux-raid", G_PART_ALIAS_LINUX_RAID }, { "linux-swap", G_PART_ALIAS_LINUX_SWAP }, + { "ms-basic-data", G_PART_ALIAS_MS_BASIC_DATA }, + { "ms-ldm-data", G_PART_ALIAS_MS_LDM_DATA }, + { "ms-ldm-metadata", G_PART_ALIAS_MS_LDM_METADATA }, + { "ms-reserved", G_PART_ALIAS_MS_RESERVED }, + { "netbsd-ccd", G_PART_ALIAS_NETBSD_CCD }, + { "netbsd-cgd", G_PART_ALIAS_NETBSD_CGD }, + { "netbsd-ffs", G_PART_ALIAS_NETBSD_FFS }, + { "netbsd-lfs", G_PART_ALIAS_NETBSD_LFS }, + { "netbsd-raid", G_PART_ALIAS_NETBSD_RAID }, + { "netbsd-swap", G_PART_ALIAS_NETBSD_SWAP }, { "mbr", G_PART_ALIAS_MBR } }; Modified: stable/8/sys/geom/part/g_part.h ============================================================================== --- stable/8/sys/geom/part/g_part.h Fri Jun 25 05:36:36 2010 (r209521) +++ stable/8/sys/geom/part/g_part.h Fri Jun 25 08:53:51 2010 (r209522) @@ -55,6 +55,16 @@ enum g_part_alias { G_PART_ALIAS_LINUX_LVM, /* A Linux LVM partition entry. */ G_PART_ALIAS_LINUX_RAID, /* A Linux RAID partition entry. */ G_PART_ALIAS_LINUX_SWAP, /* A Linux swap partition entry. */ + G_PART_ALIAS_MS_BASIC_DATA, /* A Microsoft Data part. entry. */ + G_PART_ALIAS_MS_LDM_DATA, /* A Microsoft LDM Data part. entry. */ + G_PART_ALIAS_MS_LDM_METADATA, /* A Microsoft LDM Metadata entry. */ + G_PART_ALIAS_MS_RESERVED, /* A Microsoft Reserved part. entry. */ + G_PART_ALIAS_NETBSD_CCD, /* A NetBSD CCD partition entry. */ + G_PART_ALIAS_NETBSD_CGD, /* A NetBSD CGD partition entry. */ + G_PART_ALIAS_NETBSD_FFS, /* A NetBSD FFS partition entry. */ + G_PART_ALIAS_NETBSD_RAID, /* A NetBSD RAID partition entry. */ + G_PART_ALIAS_NETBSD_SWAP, /* A NetBSD swap partition entry. */ + G_PART_ALIAS_NETBSD_LFS, /* A NetBSD LFS partition entry. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: stable/8/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/8/sys/geom/part/g_part_gpt.c Fri Jun 25 05:36:36 2010 (r209521) +++ stable/8/sys/geom/part/g_part_gpt.c Fri Jun 25 08:53:51 2010 (r209522) @@ -152,6 +152,16 @@ static struct uuid gpt_uuid_linux_data = static struct uuid gpt_uuid_linux_lvm = GPT_ENT_TYPE_LINUX_LVM; static struct uuid gpt_uuid_linux_raid = GPT_ENT_TYPE_LINUX_RAID; static struct uuid gpt_uuid_linux_swap = GPT_ENT_TYPE_LINUX_SWAP; +static struct uuid gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; +static struct uuid gpt_uuid_ms_reserved = GPT_ENT_TYPE_MS_RESERVED; +static struct uuid gpt_uuid_ms_ldm_data = GPT_ENT_TYPE_MS_LDM_DATA; +static struct uuid gpt_uuid_ms_ldm_metadata = GPT_ENT_TYPE_MS_LDM_METADATA; +static struct uuid gpt_uuid_netbsd_ccd = GPT_ENT_TYPE_NETBSD_CCD; +static struct uuid gpt_uuid_netbsd_cgd = GPT_ENT_TYPE_NETBSD_CGD; +static struct uuid gpt_uuid_netbsd_ffs = GPT_ENT_TYPE_NETBSD_FFS; +static struct uuid gpt_uuid_netbsd_lfs = GPT_ENT_TYPE_NETBSD_LFS; +static struct uuid gpt_uuid_netbsd_raid = GPT_ENT_TYPE_NETBSD_RAID; +static struct uuid gpt_uuid_netbsd_swap = GPT_ENT_TYPE_NETBSD_SWAP; static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; @@ -178,6 +188,17 @@ static struct g_part_uuid_alias { { &gpt_uuid_linux_raid, G_PART_ALIAS_LINUX_RAID }, { &gpt_uuid_linux_swap, G_PART_ALIAS_LINUX_SWAP }, { &gpt_uuid_mbr, G_PART_ALIAS_MBR }, + { &gpt_uuid_ms_basic_data, G_PART_ALIAS_MS_BASIC_DATA }, + { &gpt_uuid_ms_ldm_data, G_PART_ALIAS_MS_LDM_DATA }, + { &gpt_uuid_ms_ldm_metadata, G_PART_ALIAS_MS_LDM_METADATA }, + { &gpt_uuid_ms_reserved, G_PART_ALIAS_MS_RESERVED }, + { &gpt_uuid_netbsd_ccd, G_PART_ALIAS_NETBSD_CCD }, + { &gpt_uuid_netbsd_cgd, G_PART_ALIAS_NETBSD_CGD }, + { &gpt_uuid_netbsd_ffs, G_PART_ALIAS_NETBSD_FFS }, + { &gpt_uuid_netbsd_lfs, G_PART_ALIAS_NETBSD_LFS }, + { &gpt_uuid_netbsd_raid, G_PART_ALIAS_NETBSD_RAID }, + { &gpt_uuid_netbsd_swap, G_PART_ALIAS_NETBSD_SWAP }, + { NULL, 0 } };