From owner-svn-src-stable-8@FreeBSD.ORG Sun Jun 2 17:03:12 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6EEE09C7; Sun, 2 Jun 2013 17:03:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 615DB102A; Sun, 2 Jun 2013 17:03:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r52H3Cgc059667; Sun, 2 Jun 2013 17:03:12 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r52H3COo059666; Sun, 2 Jun 2013 17:03:12 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201306021703.r52H3COo059666@svn.freebsd.org> From: Glen Barber Date: Sun, 2 Jun 2013 17:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251260 - stable/8/sys/conf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 02 Jun 2013 17:03:12 -0000 Author: gjb (doc,ports committer) Date: Sun Jun 2 17:03:11 2013 New Revision: 251260 URL: http://svnweb.freebsd.org/changeset/base/251260 Log: Since release/8.4.0 tag is created, make stable/8 -STABLE again. Approved by: re (implicit) Modified: stable/8/sys/conf/newvers.sh Modified: stable/8/sys/conf/newvers.sh ============================================================================== --- stable/8/sys/conf/newvers.sh Sun Jun 2 16:54:42 2013 (r251259) +++ stable/8/sys/conf/newvers.sh Sun Jun 2 17:03:11 2013 (r251260) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.4" -BRANCH="PRERELEASE" +BRANCH="STABLE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 3 16:10:31 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 506519C1; Mon, 3 Jun 2013 16:10:31 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4297C17C5; Mon, 3 Jun 2013 16:10:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r53GAVAK059506; Mon, 3 Jun 2013 16:10:31 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r53GAVNv059504; Mon, 3 Jun 2013 16:10:31 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201306031610.r53GAVNv059504@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 3 Jun 2013 16:10:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251304 - stable/8/sys/geom X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Jun 2013 16:10:31 -0000 Author: jh Date: Mon Jun 3 16:10:30 2013 New Revision: 251304 URL: http://svnweb.freebsd.org/changeset/base/251304 Log: MFC r250868: Remove an extra semicolon from the DOT language output. PR: kern/178540 Modified: stable/8/sys/geom/geom_dump.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/geom_dump.c ============================================================================== --- stable/8/sys/geom/geom_dump.c Mon Jun 3 16:09:23 2013 (r251303) +++ stable/8/sys/geom/geom_dump.c Mon Jun 3 16:10:30 2013 (r251304) @@ -104,7 +104,7 @@ g_confdot(void *p, int flag ) sbuf_printf(sb, "digraph geom {\n"); LIST_FOREACH(mp, &g_classes, class) g_confdot_class(sb, mp); - sbuf_printf(sb, "};\n"); + sbuf_printf(sb, "}\n"); sbuf_finish(sb); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 3 16:47:47 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 841D7943; Mon, 3 Jun 2013 16:47:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 74DA019CA; Mon, 3 Jun 2013 16:47:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r53GllRx074537; Mon, 3 Jun 2013 16:47:47 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r53GllMR074536; Mon, 3 Jun 2013 16:47:47 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201306031647.r53GllMR074536@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 3 Jun 2013 16:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251308 - stable/8/usr.sbin/acpi/acpidump X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Jun 2013 16:47:47 -0000 Author: jkim Date: Mon Jun 3 16:47:46 2013 New Revision: 251308 URL: http://svnweb.freebsd.org/changeset/base/251308 Log: MFC: r251186 Fix a long standing logic bug introduced in r167814. The code was added to get RSDP from loader(8) hint via kenv(2) but the bug nullified the new code and we always fell back to the previous method, i. e., sysctlbyname(3). Modified: stable/8/usr.sbin/acpi/acpidump/acpi_user.c Directory Properties: stable/8/usr.sbin/acpi/acpidump/ (props changed) Modified: stable/8/usr.sbin/acpi/acpidump/acpi_user.c ============================================================================== --- stable/8/usr.sbin/acpi/acpidump/acpi_user.c Mon Jun 3 16:46:37 2013 (r251307) +++ stable/8/usr.sbin/acpi/acpidump/acpi_user.c Mon Jun 3 16:47:46 2013 (r251308) @@ -172,7 +172,7 @@ acpi_find_rsd_ptr(void) addr = 0; /* Attempt to use kenv or sysctl to find RSD PTR record. */ - if (kenv(KENV_GET, hint_acpi_0_rsdp, buf, 20) == 0) + if (kenv(KENV_GET, hint_acpi_0_rsdp, buf, 20) > 0) addr = strtoul(buf, NULL, 0); if (addr == 0) { len = sizeof(addr); From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 3 17:07:58 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 075E468A; Mon, 3 Jun 2013 17:07:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EDF081AED; Mon, 3 Jun 2013 17:07:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r53H7vVG082275; Mon, 3 Jun 2013 17:07:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r53H7v7K082274; Mon, 3 Jun 2013 17:07:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201306031707.r53H7v7K082274@svn.freebsd.org> From: John Baldwin Date: Mon, 3 Jun 2013 17:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251312 - stable/8/usr.bin/top X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Jun 2013 17:07:58 -0000 Author: jhb Date: Mon Jun 3 17:07:57 2013 New Revision: 251312 URL: http://svnweb.freebsd.org/changeset/base/251312 Log: MFC 248167: Fix the 'C' field for a running thread to match the behavior described in the manpage by having it display the current CPU (ki_oncpu) rather than the previously used CPU (ki_lastcpu). ki_lastcpu is still used for all other thread states. Modified: stable/8/usr.bin/top/machine.c Directory Properties: stable/8/usr.bin/top/ (props changed) Modified: stable/8/usr.bin/top/machine.c ============================================================================== --- stable/8/usr.bin/top/machine.c Mon Jun 3 17:07:34 2013 (r251311) +++ stable/8/usr.bin/top/machine.c Mon Jun 3 17:07:57 2013 (r251312) @@ -796,7 +796,7 @@ format_next_process(caddr_t handle, char double pct; struct handle *hp; char status[16]; - int state; + int cpu, state; struct rusage ru, *rup; long p_tot, s_tot; char *proc_fmt, thr_buf[6], jid_buf[6]; @@ -995,6 +995,13 @@ format_next_process(caddr_t handle, char } /* format this entry */ + if (smpmode) { + if (state == SRUN && pp->ki_oncpu != 0xff) + cpu = pp->ki_oncpu; + else + cpu = pp->ki_lastcpu; + } else + cpu = 0; proc_fmt = smpmode ? smp_Proc_format : up_Proc_format; if (ps.thread != 0) thr_buf[0] = '\0'; @@ -1012,7 +1019,7 @@ format_next_process(caddr_t handle, char format_k2(PROCSIZE(pp)), format_k2(pagetok(pp->ki_rssize)), status, - smpmode ? pp->ki_lastcpu : 0, + cpu, format_time(cputime), ps.wcpu ? 100.0 * weighted_cpu(pct, pp) : 100.0 * pct, screen_width > cmdlengthdelta ? screen_width - cmdlengthdelta : 0, From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 3 17:13:38 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8FBEC973; Mon, 3 Jun 2013 17:13:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 680491B41; Mon, 3 Jun 2013 17:13:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r53HDcG0085290; Mon, 3 Jun 2013 17:13:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r53HDcTq085288; Mon, 3 Jun 2013 17:13:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201306031713.r53HDcTq085288@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 3 Jun 2013 17:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251313 - in stable/8/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Jun 2013 17:13:38 -0000 Author: kib Date: Mon Jun 3 17:13:37 2013 New Revision: 251313 URL: http://svnweb.freebsd.org/changeset/base/251313 Log: MFC r251033: When handling an exception from the attempt from loading the faulting context on return from the trap handler, re-enable the interrupts on i386 and amd64. Modified: stable/8/sys/amd64/amd64/exception.S stable/8/sys/i386/i386/exception.s Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/i386/ (props changed) Modified: stable/8/sys/amd64/amd64/exception.S ============================================================================== --- stable/8/sys/amd64/amd64/exception.S Mon Jun 3 17:07:57 2013 (r251312) +++ stable/8/sys/amd64/amd64/exception.S Mon Jun 3 17:13:37 2013 (r251313) @@ -818,6 +818,10 @@ doreti_iret_fault: .globl ds_load_fault ds_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movw $KUDSEL,TF_DS(%rsp) @@ -827,6 +831,10 @@ ds_load_fault: .globl es_load_fault es_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movw $KUDSEL,TF_ES(%rsp) @@ -835,6 +843,10 @@ es_load_fault: ALIGN_TEXT .globl fs_load_fault fs_load_fault: + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movl $T_PROTFLT,TF_TRAPNO(%rsp) movq %rsp,%rdi call trap @@ -846,6 +858,10 @@ fs_load_fault: gs_load_fault: popfq movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movw $KUG32SEL,TF_GS(%rsp) @@ -855,6 +871,10 @@ gs_load_fault: .globl fsbase_load_fault fsbase_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movq PCPU(CURTHREAD),%r8 @@ -866,6 +886,10 @@ fsbase_load_fault: .globl gsbase_load_fault gsbase_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movq PCPU(CURTHREAD),%r8 Modified: stable/8/sys/i386/i386/exception.s ============================================================================== --- stable/8/sys/i386/i386/exception.s Mon Jun 3 17:07:57 2013 (r251312) +++ stable/8/sys/i386/i386/exception.s Mon Jun 3 17:13:37 2013 (r251313) @@ -417,6 +417,7 @@ doreti_popl_es_fault: pushl %fs .globl doreti_popl_fs_fault doreti_popl_fs_fault: + sti movl $0,TF_ERR(%esp) /* XXX should be the error code */ movl $T_PROTFLT,TF_TRAPNO(%esp) jmp alltraps_with_regs_pushed From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 3 17:34:49 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5C6B9795; Mon, 3 Jun 2013 17:34:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4DF551C4F; Mon, 3 Jun 2013 17:34:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r53HYnMo092994; Mon, 3 Jun 2013 17:34:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r53HYnSK092993; Mon, 3 Jun 2013 17:34:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201306031734.r53HYnSK092993@svn.freebsd.org> From: John Baldwin Date: Mon, 3 Jun 2013 17:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251320 - stable/8/games/fortune/datfiles X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Jun 2013 17:34:49 -0000 Author: jhb Date: Mon Jun 3 17:34:48 2013 New Revision: 251320 URL: http://svnweb.freebsd.org/changeset/base/251320 Log: MFC 248200: Remove fortunes-o from the base system. Deleted: stable/8/games/fortune/datfiles/fortunes-o.fake stable/8/games/fortune/datfiles/fortunes-o.real stable/8/games/fortune/datfiles/fortunes-o.sp.ok Modified: stable/8/games/fortune/datfiles/Makefile Directory Properties: stable/8/games/fortune/ (props changed) Modified: stable/8/games/fortune/datfiles/Makefile ============================================================================== --- stable/8/games/fortune/datfiles/Makefile Mon Jun 3 17:33:12 2013 (r251319) +++ stable/8/games/fortune/datfiles/Makefile Mon Jun 3 17:34:48 2013 (r251320) @@ -1,37 +1,22 @@ # @(#)Makefile 8.2 (Berkeley) 4/19/94 # $FreeBSD$ -FILES= fortunes freebsd-tips murphy startrek zippy -BLDS= fortunes.dat murphy.dat startrek.dat zippy.dat \ - fortunes-o fortunes-o.dat freebsd-tips.dat +DB= fortunes freebsd-tips murphy startrek zippy # TO AVOID INSTALLING THE POTENTIALLY OFFENSIVE FORTUNES, COMMENT OUT THE -# THREE LINES AND UNCOMMENT THE FOURTH LINE. +# NEXT LINE. +DB+= limerick murphy-o gerrold.limerick -# THE THREE LINES: -FILES+= limerick murphy-o gerrold.limerick -BLDS+= limerick.dat murphy-o.dat gerrold.limerick.dat -TYPE= real - -# THE FOURTH LINE: -#TYPE= fake - -FILES+= ${BLDS} +BLDS= ${DB:S/$/.dat/} +FILES= ${DB} ${BLDS} CLEANFILES+=${BLDS} FILESDIR= ${SHAREDIR}/games/fortune -.for f in fortunes freebsd-tips gerrold.limerick limerick murphy murphy-o startrek zippy +.for f in ${DB} $f.dat: $f PATH=$$PATH:/usr/games:${.OBJDIR}/../strfile \ strfile -Cs ${.ALLSRC} ${.TARGET} .endfor -fortunes-o.dat: fortunes-o - PATH=$$PATH:/usr/games:${.OBJDIR}/../strfile \ - strfile -Csx ${.ALLSRC} ${.TARGET} - -fortunes-o: fortunes-o.${TYPE} - LC_ALL=C tr a-zA-Z n-za-mN-ZA-M < ${.ALLSRC} > ${.TARGET} - .include From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 3 18:13:26 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 71CE6E7C; Mon, 3 Jun 2013 18:13:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6362B1DE8; Mon, 3 Jun 2013 18:13:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r53IDQ6x008165; Mon, 3 Jun 2013 18:13:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r53IDQvc008164; Mon, 3 Jun 2013 18:13:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201306031813.r53IDQvc008164@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 3 Jun 2013 18:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251329 - stable/8/sys/amd64/ia32 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Jun 2013 18:13:26 -0000 Author: kib Date: Mon Jun 3 18:13:25 2013 New Revision: 251329 URL: http://svnweb.freebsd.org/changeset/base/251329 Log: MFC r251037: The ia32_get_mcontext() does not need to set PCB_FULL_IRET. Modified: stable/8/sys/amd64/ia32/ia32_signal.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) Modified: stable/8/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_signal.c Mon Jun 3 18:07:04 2013 (r251328) +++ stable/8/sys/amd64/ia32/ia32_signal.c Mon Jun 3 18:13:25 2013 (r251329) @@ -187,7 +187,6 @@ ia32_get_mcontext(struct thread *td, str mcp->mc_xfpustate = 0; mcp->mc_xfpustate_len = 0; bzero(mcp->mc_spare2, sizeof(mcp->mc_spare2)); - set_pcb_flags(pcb, PCB_FULL_IRET); return (0); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 3 18:15:48 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A8A06313; Mon, 3 Jun 2013 18:15:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9AE501E12; Mon, 3 Jun 2013 18:15:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r53IFmaX008760; Mon, 3 Jun 2013 18:15:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r53IFmlu008759; Mon, 3 Jun 2013 18:15:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201306031815.r53IFmlu008759@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 3 Jun 2013 18:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251331 - stable/8/sys/amd64/ia32 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Jun 2013 18:15:48 -0000 Author: kib Date: Mon Jun 3 18:15:48 2013 New Revision: 251331 URL: http://svnweb.freebsd.org/changeset/base/251331 Log: MFC r251038: Use _MC_IA32_HASFPXSTATE name instead of _MC_HASFPXSTATE. Modified: stable/8/sys/amd64/ia32/ia32_signal.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) Modified: stable/8/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_signal.c Mon Jun 3 18:14:18 2013 (r251330) +++ stable/8/sys/amd64/ia32/ia32_signal.c Mon Jun 3 18:15:48 2013 (r251331) @@ -112,7 +112,7 @@ ia32_get_fpcontext(struct thread *td, st len = max_len; bzero(xfpusave + max_len, len - max_len); } - mcp->mc_flags |= _MC_HASFPXSTATE; + mcp->mc_flags |= _MC_IA32_HASFPXSTATE; mcp->mc_xfpustate_len = len; bcopy(get_pcb_user_save_td(td) + 1, xfpusave, len); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 3 18:17:48 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BBCB9492; Mon, 3 Jun 2013 18:17:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 942D31E26; Mon, 3 Jun 2013 18:17:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r53IHmNr009182; Mon, 3 Jun 2013 18:17:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r53IHmMx009176; Mon, 3 Jun 2013 18:17:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201306031817.r53IHmMx009176@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 3 Jun 2013 18:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251332 - in stable/8/sys: amd64/amd64 amd64/ia32 i386/i386 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Jun 2013 18:17:48 -0000 Author: kib Date: Mon Jun 3 18:17:47 2013 New Revision: 251332 URL: http://svnweb.freebsd.org/changeset/base/251332 Log: MFC r251039: Use slightly more idiomatic expression to get the address of array. Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/ia32/ia32_signal.c stable/8/sys/i386/i386/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/i386/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Mon Jun 3 18:15:48 2013 (r251331) +++ stable/8/sys/amd64/amd64/machdep.c Mon Jun 3 18:17:47 2013 (r251332) @@ -2221,7 +2221,7 @@ get_fpcontext(struct thread *td, mcontex size_t max_len, len; mcp->mc_ownedfp = fpugetregs(td); - bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate, + bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = fpuformat(); if (!use_xsave || xfpusave_len == 0) Modified: stable/8/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_signal.c Mon Jun 3 18:15:48 2013 (r251331) +++ stable/8/sys/amd64/ia32/ia32_signal.c Mon Jun 3 18:17:47 2013 (r251332) @@ -101,7 +101,7 @@ ia32_get_fpcontext(struct thread *td, st * for now, it should be irrelevant for most applications. */ mcp->mc_ownedfp = fpugetregs(td); - bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate, + bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = fpuformat(); if (!use_xsave || xfpusave_len == 0) Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Mon Jun 3 18:15:48 2013 (r251331) +++ stable/8/sys/i386/i386/machdep.c Mon Jun 3 18:17:47 2013 (r251332) @@ -3385,7 +3385,7 @@ get_fpcontext(struct thread *td, mcontex bzero(mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); #else mcp->mc_ownedfp = npxgetregs(td); - bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate, + bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = npxformat(); #endif From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 5 10:19:21 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B8E504BC; Wed, 5 Jun 2013 10:19:21 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 928331FDD; Wed, 5 Jun 2013 10:19:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r55AJLwD036785; Wed, 5 Jun 2013 10:19:21 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r55AJLLV036784; Wed, 5 Jun 2013 10:19:21 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306051019.r55AJLLV036784@svn.freebsd.org> From: Steven Hartland Date: Wed, 5 Jun 2013 10:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251407 - stable/8/sys/dev/mfi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 05 Jun 2013 10:19:21 -0000 Author: smh Date: Wed Jun 5 10:19:21 2013 New Revision: 251407 URL: http://svnweb.freebsd.org/changeset/base/251407 Log: MFC r247426: Add hw.mfi.cmd_timeout loader / sysctl tuneable. Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mfi/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Wed Jun 5 09:48:12 2013 (r251406) +++ stable/8/sys/dev/mfi/mfi.c Wed Jun 5 10:19:21 2013 (r251407) @@ -157,6 +157,11 @@ SYSCTL_INT(_hw_mfi, OID_AUTO, polled_cmd &mfi_polled_cmd_timeout, 0, "Polled command timeout - used for firmware flash etc (in seconds)"); +static int mfi_cmd_timeout = MFI_CMD_TIMEOUT; +TUNABLE_INT("hw.mfi.cmd_timeout", &mfi_cmd_timeout); +SYSCTL_INT(_hw_mfi, OID_AUTO, cmd_timeout, CTLFLAG_RWTUN, &mfi_cmd_timeout, + 0, "Command timeout (in seconds)"); + /* Management interface */ static d_open_t mfi_open; static d_close_t mfi_close; @@ -782,7 +787,7 @@ mfi_attach(struct mfi_softc *sc) /* Start the timeout watchdog */ callout_init(&sc->mfi_watchdog_callout, CALLOUT_MPSAFE); - callout_reset(&sc->mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz, + callout_reset(&sc->mfi_watchdog_callout, mfi_cmd_timeout * hz, mfi_timeout, sc); if (sc->mfi_flags & MFI_FLAGS_TBOLT) { @@ -3703,7 +3708,7 @@ mfi_dump_all(void) break; device_printf(sc->mfi_dev, "Dumping\n\n"); timedout = 0; - deadline = time_uptime - MFI_CMD_TIMEOUT; + deadline = time_uptime - mfi_cmd_timeout; mtx_lock(&sc->mfi_io_lock); TAILQ_FOREACH(cm, &sc->mfi_busy, cm_link) { if (cm->cm_timestamp <= deadline) { @@ -3734,10 +3739,11 @@ mfi_timeout(void *data) time_t deadline; int timedout = 0; - deadline = time_uptime - MFI_CMD_TIMEOUT; + deadline = time_uptime - mfi_cmd_timeout; if (sc->adpreset == 0) { if (!mfi_tbolt_reset(sc)) { - callout_reset(&sc->mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz, mfi_timeout, sc); + callout_reset(&sc->mfi_watchdog_callout, + mfi_cmd_timeout * hz, mfi_timeout, sc); return; } } @@ -3774,7 +3780,7 @@ mfi_timeout(void *data) mtx_unlock(&sc->mfi_io_lock); - callout_reset(&sc->mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz, + callout_reset(&sc->mfi_watchdog_callout, mfi_cmd_timeout * hz, mfi_timeout, sc); if (0) From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 5 10:37:28 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 73482AA4; Wed, 5 Jun 2013 10:37:28 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64D641074; Wed, 5 Jun 2013 10:37:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r55AbSnZ043008; Wed, 5 Jun 2013 10:37:28 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r55AbSDJ043007; Wed, 5 Jun 2013 10:37:28 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306051037.r55AbSDJ043007@svn.freebsd.org> From: Steven Hartland Date: Wed, 5 Jun 2013 10:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251408 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 05 Jun 2013 10:37:28 -0000 Author: smh Date: Wed Jun 5 10:37:27 2013 New Revision: 251408 URL: http://svnweb.freebsd.org/changeset/base/251408 Log: MFC r248579: Add missing descriptions for ZFS sysctls Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed Jun 5 10:19:21 2013 (r251407) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed Jun 5 10:37:27 2013 (r251408) @@ -77,10 +77,11 @@ SYSCTL_QUAD(_vfs_zfs, OID_AUTO, write_li &zfs_write_limit_max, 0, "Maximum data payload per txg"); TUNABLE_QUAD("vfs.zfs.write_limit_inflated", &zfs_write_limit_inflated); SYSCTL_QUAD(_vfs_zfs, OID_AUTO, write_limit_inflated, CTLFLAG_RDTUN, - &zfs_write_limit_inflated, 0, ""); + &zfs_write_limit_inflated, 0, "Maximum size of the dynamic write limit"); TUNABLE_QUAD("vfs.zfs.write_limit_override", &zfs_write_limit_override); SYSCTL_QUAD(_vfs_zfs, OID_AUTO, write_limit_override, CTLFLAG_RDTUN, - &zfs_write_limit_override, 0, ""); + &zfs_write_limit_override, 0, + "Force a txg if dirty buffers exceed this value (bytes)"); int dsl_pool_open_special_dir(dsl_pool_t *dp, const char *name, dsl_dir_t **ddp) From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 5 10:53:28 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B34B2EFA; Wed, 5 Jun 2013 10:53:28 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A58D410F3; Wed, 5 Jun 2013 10:53:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r55ArRWx048675; Wed, 5 Jun 2013 10:53:27 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r55ArRdL048674; Wed, 5 Jun 2013 10:53:27 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306051053.r55ArRdL048674@svn.freebsd.org> From: Steven Hartland Date: Wed, 5 Jun 2013 10:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251409 - stable/8/sys/dev/mps X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 05 Jun 2013 10:53:28 -0000 Author: smh Date: Wed Jun 5 10:53:27 2013 New Revision: 251409 URL: http://svnweb.freebsd.org/changeset/base/251409 Log: MFC r250206: Fix uninitialized warning in mps Modified: stable/8/sys/dev/mps/mps_mapping.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mps/ (props changed) Modified: stable/8/sys/dev/mps/mps_mapping.c ============================================================================== --- stable/8/sys/dev/mps/mps_mapping.c Wed Jun 5 10:37:27 2013 (r251408) +++ stable/8/sys/dev/mps/mps_mapping.c Wed Jun 5 10:53:27 2013 (r251409) @@ -331,6 +331,8 @@ _mapping_get_high_missing_mt_idx(struct u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags); start_idx = 0; + start_idx_ir = 0; + end_idx_ir = 0; end_idx = sc->max_devices; if (ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_RESERVED_TARGETID_0) start_idx = 1; From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 5 11:16:18 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6CD0248C; Wed, 5 Jun 2013 11:16:18 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D5E211A2; Wed, 5 Jun 2013 11:16:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r55BGIiF055811; Wed, 5 Jun 2013 11:16:18 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r55BGIUX055810; Wed, 5 Jun 2013 11:16:18 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306051116.r55BGIUX055810@svn.freebsd.org> From: Steven Hartland Date: Wed, 5 Jun 2013 11:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251410 - stable/8/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 05 Jun 2013 11:16:18 -0000 Author: smh Date: Wed Jun 5 11:16:17 2013 New Revision: 251410 URL: http://svnweb.freebsd.org/changeset/base/251410 Log: MFC r245479: Report pools which have a removed l2cache disk under zpool status -x Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Wed Jun 5 10:53:27 2013 (r251409) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Wed Jun 5 11:16:17 2013 (r251410) @@ -150,6 +150,16 @@ find_vdev_problem(nvlist_t *vdev, int (* return (B_TRUE); } + /* + * Check any L2 cache devs + */ + if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_L2CACHE, &child, + &children) == 0) { + for (c = 0; c < children; c++) + if (find_vdev_problem(child[c], func)) + return (B_TRUE); + } + return (B_FALSE); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 5 11:23:11 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4FFC4AF3; Wed, 5 Jun 2013 11:23:11 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4178711FF; Wed, 5 Jun 2013 11:23:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r55BNBmV058907; Wed, 5 Jun 2013 11:23:11 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r55BNBNO058906; Wed, 5 Jun 2013 11:23:11 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306051123.r55BNBNO058906@svn.freebsd.org> From: Steven Hartland Date: Wed, 5 Jun 2013 11:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251411 - stable/8/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 05 Jun 2013 11:23:11 -0000 Author: smh Date: Wed Jun 5 11:23:10 2013 New Revision: 251411 URL: http://svnweb.freebsd.org/changeset/base/251411 Log: MFC r244194: Fixe zfs receive errors caused by snapshot replication being processed in random order. PR: kern/172259 Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Wed Jun 5 11:16:17 2013 (r251410) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Wed Jun 5 11:23:10 2013 (r251411) @@ -727,7 +727,7 @@ send_iterate_fs(zfs_handle_t *zhp, void sd->parent_fromsnap_guid = 0; VERIFY(0 == nvlist_alloc(&sd->parent_snaps, NV_UNIQUE_NAME, 0)); VERIFY(0 == nvlist_alloc(&sd->snapprops, NV_UNIQUE_NAME, 0)); - (void) zfs_iter_snapshots(zhp, B_FALSE, send_iterate_snap, sd); + (void) zfs_iter_snapshots_sorted(zhp, send_iterate_snap, sd); VERIFY(0 == nvlist_add_nvlist(nvfs, "snaps", sd->parent_snaps)); VERIFY(0 == nvlist_add_nvlist(nvfs, "snapprops", sd->snapprops)); nvlist_free(sd->parent_snaps); @@ -1945,11 +1945,12 @@ recv_incremental_replication(libzfs_hand recvflags_t *flags, nvlist_t *stream_nv, avl_tree_t *stream_avl, nvlist_t *renamed) { - nvlist_t *local_nv; + nvlist_t *local_nv, *deleted = NULL; avl_tree_t *local_avl; nvpair_t *fselem, *nextfselem; char *fromsnap; char newname[ZFS_MAXNAMELEN]; + char guidname[32]; int error; boolean_t needagain, progress, recursive; char *s1, *s2; @@ -1965,6 +1966,8 @@ recv_incremental_replication(libzfs_hand again: needagain = progress = B_FALSE; + VERIFY(0 == nvlist_alloc(&deleted, NV_UNIQUE_NAME, 0)); + if ((error = gather_nvlist(hdl, tofs, fromsnap, NULL, recursive, &local_nv, &local_avl)) != 0) return (error); @@ -2079,6 +2082,8 @@ again: needagain = B_TRUE; else progress = B_TRUE; + sprintf(guidname, "%lu", thisguid); + nvlist_add_boolean(deleted, guidname); continue; } @@ -2134,6 +2139,8 @@ again: needagain = B_TRUE; else progress = B_TRUE; + sprintf(guidname, "%lu", parent_fromsnap_guid); + nvlist_add_boolean(deleted, guidname); continue; } @@ -2156,6 +2163,24 @@ again: s2 = strrchr(stream_fsname, '/'); /* + * Check if we're going to rename based on parent guid change + * and the current parent guid was also deleted. If it was then + * rename will fail and is likely unneeded, so avoid this and + * force an early retry to determine the new + * parent_fromsnap_guid. + */ + if (stream_parent_fromsnap_guid != 0 && + parent_fromsnap_guid != 0 && + stream_parent_fromsnap_guid != parent_fromsnap_guid) { + sprintf(guidname, "%lu", parent_fromsnap_guid); + if (nvlist_exists(deleted, guidname)) { + progress = B_TRUE; + needagain = B_TRUE; + goto doagain; + } + } + + /* * Check for rename. If the exact receive path is specified, it * does not count as a rename, but we still need to check the * datasets beneath it. @@ -2209,8 +2234,10 @@ again: } } +doagain: fsavl_destroy(local_avl); nvlist_free(local_nv); + nvlist_free(deleted); if (needagain && progress) { /* do another pass to fix up temporary names */ From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 5 11:28:56 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5DD77CBE; Wed, 5 Jun 2013 11:28:56 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 503AF1230; Wed, 5 Jun 2013 11:28:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r55BSuut059727; Wed, 5 Jun 2013 11:28:56 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r55BStjP059723; Wed, 5 Jun 2013 11:28:55 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306051128.r55BStjP059723@svn.freebsd.org> From: Steven Hartland Date: Wed, 5 Jun 2013 11:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251412 - stable/8/lib/libc/gen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 05 Jun 2013 11:28:56 -0000 Author: smh Date: Wed Jun 5 11:28:55 2013 New Revision: 251412 URL: http://svnweb.freebsd.org/changeset/base/251412 Log: MFC r219696: Add ZFS to UFS-like file systems. Modified: stable/8/lib/libc/gen/fts-compat.c stable/8/lib/libc/gen/fts.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/fts-compat.c ============================================================================== --- stable/8/lib/libc/gen/fts-compat.c Wed Jun 5 11:23:10 2013 (r251411) +++ stable/8/lib/libc/gen/fts-compat.c Wed Jun 5 11:28:55 2013 (r251412) @@ -110,6 +110,7 @@ struct _fts_private { static const char *ufslike_filesystems[] = { "ufs", + "zfs", "nfs", "nfs4", "ext2fs", Modified: stable/8/lib/libc/gen/fts.c ============================================================================== --- stable/8/lib/libc/gen/fts.c Wed Jun 5 11:23:10 2013 (r251411) +++ stable/8/lib/libc/gen/fts.c Wed Jun 5 11:28:55 2013 (r251412) @@ -100,6 +100,7 @@ struct _fts_private { static const char *ufslike_filesystems[] = { "ufs", + "zfs", "nfs", "nfs4", "ext2fs", From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 5 11:37:01 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 35F3BE90; Wed, 5 Jun 2013 11:37:01 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 28B5E1268; Wed, 5 Jun 2013 11:37:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r55Bb1pu062532; Wed, 5 Jun 2013 11:37:01 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r55Bb16b062531; Wed, 5 Jun 2013 11:37:01 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306051137.r55Bb16b062531@svn.freebsd.org> From: Steven Hartland Date: Wed, 5 Jun 2013 11:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251413 - stable/8/etc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 05 Jun 2013 11:37:01 -0000 Author: smh Date: Wed Jun 5 11:37:00 2013 New Revision: 251413 URL: http://svnweb.freebsd.org/changeset/base/251413 Log: MFC r245250: Allow perl scripts to be used in rc.d scripts Modified: stable/8/etc/rc.subr Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.subr ============================================================================== --- stable/8/etc/rc.subr Wed Jun 5 11:28:55 2013 (r251412) +++ stable/8/etc/rc.subr Wed Jun 5 11:37:00 2013 (r251413) @@ -331,7 +331,7 @@ _find_processes() _interpbn=${1##*/} _fp_args='_argv' _fp_match='case "$_argv" in - ${_interp}|"${_interp} "*|"${_interpbn}: ${_procname}"*)' + ${_interp}|"${_interp} "*|"[${_interpbn}]"|"${_interpbn}: ${_procname}"*)' else # a normal daemon _procnamebn=${_procname##*/} _fp_args='_arg0 _argv' From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 5 18:49:29 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 407B160E; Wed, 5 Jun 2013 18:49:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 20FEF1A88; Wed, 5 Jun 2013 18:49:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r55InTsP099303; Wed, 5 Jun 2013 18:49:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r55InShK099300; Wed, 5 Jun 2013 18:49:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306051849.r55InShK099300@svn.freebsd.org> From: Alexander Motin Date: Wed, 5 Jun 2013 18:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251428 - stable/8/sys/dev/sound/pci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 05 Jun 2013 18:49:29 -0000 Author: mav Date: Wed Jun 5 18:49:28 2013 New Revision: 251428 URL: http://svnweb.freebsd.org/changeset/base/251428 Log: MFC r250286: Some fixes to snd_envy24ht(4) driver: - Allow DMA addresses anywhere in the lower 4GB; Envy24HT has a 32-bit DMA engine, not 28-bit like Envy24. - Mark interrupt handler as MPSAFE, seems to be correctly synchronized. PR: kern/152378 Submitted by: Jason Harmening Modified: stable/8/sys/dev/sound/pci/envy24ht.c stable/8/sys/dev/sound/pci/envy24ht.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/envy24ht.c ============================================================================== --- stable/8/sys/dev/sound/pci/envy24ht.c Wed Jun 5 18:42:44 2013 (r251427) +++ stable/8/sys/dev/sound/pci/envy24ht.c Wed Jun 5 18:49:28 2013 (r251428) @@ -2080,7 +2080,7 @@ envy24ht_pci_probe(device_t dev) static void envy24ht_dmapsetmap(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - /* struct sc_info *sc = (struct sc_info *)arg; */ + struct sc_info *sc = arg; #if(0) device_printf(sc->dev, "envy24ht_dmapsetmap()\n"); @@ -2088,15 +2088,16 @@ envy24ht_dmapsetmap(void *arg, bus_dma_s printf("envy24ht(play): setmap %lx, %lx; ", (unsigned long)segs->ds_addr, (unsigned long)segs->ds_len); - printf("%p -> %lx\n", sc->pmap, (unsigned long)vtophys(sc->pmap)); } #endif + envy24ht_wrmt(sc, ENVY24HT_MT_PADDR, (uint32_t)segs->ds_addr, 4); + envy24ht_wrmt(sc, ENVY24HT_MT_PCNT, (uint32_t)(segs->ds_len / 4 - 1), 2); } static void envy24ht_dmarsetmap(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - /* struct sc_info *sc = (struct sc_info *)arg; */ + struct sc_info *sc = arg; #if(0) device_printf(sc->dev, "envy24ht_dmarsetmap()\n"); @@ -2104,9 +2105,10 @@ envy24ht_dmarsetmap(void *arg, bus_dma_s printf("envy24ht(record): setmap %lx, %lx; ", (unsigned long)segs->ds_addr, (unsigned long)segs->ds_len); - printf("%p -> %lx\n", sc->rmap, (unsigned long)vtophys(sc->pmap)); } #endif + envy24ht_wrmt(sc, ENVY24HT_MT_RADDR, (uint32_t)segs->ds_addr, 4); + envy24ht_wrmt(sc, ENVY24HT_MT_RCNT, (uint32_t)(segs->ds_len / 4 - 1), 2); } static void @@ -2149,7 +2151,6 @@ envy24ht_dmafree(struct sc_info *sc) static int envy24ht_dmainit(struct sc_info *sc) { - u_int32_t addr; #if(0) device_printf(sc->dev, "envy24ht_dmainit()\n"); @@ -2176,34 +2177,16 @@ envy24ht_dmainit(struct sc_info *sc) #if(0) device_printf(sc->dev, "envy24ht_dmainit(): bus_dmamem_load(): sc->pmap\n"); #endif - if (bus_dmamap_load(sc->dmat, sc->pmap, sc->pbuf, sc->psize, envy24ht_dmapsetmap, sc, 0)) + if (bus_dmamap_load(sc->dmat, sc->pmap, sc->pbuf, sc->psize, envy24ht_dmapsetmap, sc, BUS_DMA_NOWAIT)) goto bad; #if(0) device_printf(sc->dev, "envy24ht_dmainit(): bus_dmamem_load(): sc->rmap\n"); #endif - if (bus_dmamap_load(sc->dmat, sc->rmap, sc->rbuf, sc->rsize, envy24ht_dmarsetmap, sc, 0)) + if (bus_dmamap_load(sc->dmat, sc->rmap, sc->rbuf, sc->rsize, envy24ht_dmarsetmap, sc, BUS_DMA_NOWAIT)) goto bad; bzero(sc->pbuf, sc->psize); bzero(sc->rbuf, sc->rsize); - /* set values to register */ - addr = vtophys(sc->pbuf); -#if(0) - device_printf(sc->dev, "pbuf(0x%08x)\n", addr); -#endif - envy24ht_wrmt(sc, ENVY24HT_MT_PADDR, addr, 4); -#if(0) - device_printf(sc->dev, "PADDR-->(0x%08x)\n", envy24ht_rdmt(sc, ENVY24HT_MT_PADDR, 4)); - device_printf(sc->dev, "psize(%ld)\n", sc->psize / 4 - 1); -#endif - envy24ht_wrmt(sc, ENVY24HT_MT_PCNT, sc->psize / 4 - 1, 2); -#if(0) - device_printf(sc->dev, "PCNT-->(%ld)\n", envy24ht_rdmt(sc, ENVY24HT_MT_PCNT, 2)); -#endif - addr = vtophys(sc->rbuf); - envy24ht_wrmt(sc, ENVY24HT_MT_RADDR, addr, 4); - envy24ht_wrmt(sc, ENVY24HT_MT_RCNT, sc->rsize / 4 - 1, 2); - return 0; bad: envy24ht_dmafree(sc); @@ -2440,7 +2423,7 @@ envy24ht_alloc_resource(struct sc_info * sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || - snd_setup_intr(sc->dev, sc->irq, 0, envy24ht_intr, sc, &sc->ih)) { + snd_setup_intr(sc->dev, sc->irq, INTR_MPSAFE, envy24ht_intr, sc, &sc->ih)) { device_printf(sc->dev, "unable to map interrupt\n"); return ENXIO; } @@ -2449,13 +2432,13 @@ envy24ht_alloc_resource(struct sc_info * if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(sc->dev), /*alignment*/4, /*boundary*/0, - /*lowaddr*/BUS_SPACE_MAXADDR_ENVY24, - /*highaddr*/BUS_SPACE_MAXADDR_ENVY24, + /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, + /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, /*maxsize*/BUS_SPACE_MAXSIZE_ENVY24, /*nsegments*/1, /*maxsegsz*/0x3ffff, - /*flags*/0, /*lockfunc*/busdma_lock_mutex, - /*lockarg*/&Giant, &sc->dmat) != 0) { + /*flags*/0, /*lockfunc*/NULL, + /*lockarg*/NULL, &sc->dmat) != 0) { device_printf(sc->dev, "unable to create dma tag\n"); return ENXIO; } Modified: stable/8/sys/dev/sound/pci/envy24ht.h ============================================================================== --- stable/8/sys/dev/sound/pci/envy24ht.h Wed Jun 5 18:42:44 2013 (r251427) +++ stable/8/sys/dev/sound/pci/envy24ht.h Wed Jun 5 18:49:28 2013 (r251428) @@ -176,8 +176,6 @@ #define ENVY24HT_VOL_MIN 96 /* -144db(negate) */ #define ENVY24HT_VOL_MUTE 127 /* mute */ -#define BUS_SPACE_MAXADDR_ENVY24 0x0fffffff /* Address space beyond 256MB is not - supported */ #define BUS_SPACE_MAXSIZE_ENVY24 0x3fffc /* 64k x 4byte(1dword) */ #define ENVY24HT_CCS_GPIO_HDATA 0x1E From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 05:17:58 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 681C9EA5; Thu, 6 Jun 2013 05:17:58 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 557CF17ED; Thu, 6 Jun 2013 05:17:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r565Hv4k098764; Thu, 6 Jun 2013 05:17:57 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r565Hq7n098728; Thu, 6 Jun 2013 05:17:52 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306060517.r565Hq7n098728@svn.freebsd.org> From: Hiroki Sato Date: Thu, 6 Jun 2013 05:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251448 - in stable/8/release/doc: de_DE.ISO8859-1/early-adopter de_DE.ISO8859-1/errata de_DE.ISO8859-1/hardware/alpha de_DE.ISO8859-1/hardware/common de_DE.ISO8859-1/hardware/i386 de_D... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 05:17:58 -0000 Author: hrs Date: Thu Jun 6 05:17:51 2013 New Revision: 251448 URL: http://svnweb.freebsd.org/changeset/base/251448 Log: MFC: r250746 and r250805. Fix build after DocBook 4.5 conversion. Added: stable/8/release/doc/ja_JP.eucJP/share/xml/catalog.xml (contents, props changed) - copied, changed from r250746, head/release/doc/ja_JP.eucJP/share/xml/catalog.xml stable/8/release/doc/ja_JP.eucJP/share/xml/dev-auto-ja.ent - copied unchanged from r250805, head/release/doc/ja_JP.eucJP/share/xml/dev-auto-ja.ent stable/8/release/doc/ru_RU.KOI8-R/share/xml/catalog.xml (contents, props changed) - copied, changed from r250746, head/release/doc/ru_RU.KOI8-R/share/xml/catalog.xml stable/8/release/doc/ru_RU.KOI8-R/share/xml/dev-auto-ru.ent - copied unchanged from r250805, head/release/doc/ru_RU.KOI8-R/share/xml/dev-auto-ru.ent - copied unchanged from r250746, head/release/doc/share/xml/catalog.xml Directory Properties: stable/8/release/doc/share/xml/catalog.xml (props changed) Deleted: stable/8/release/doc/ja_JP.eucJP/share/xml/dev-auto-ja.xml stable/8/release/doc/ru_RU.KOI8-R/share/xml/dev-auto-ru.xml Modified: stable/8/release/doc/de_DE.ISO8859-1/early-adopter/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/errata/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/alpha/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/alpha/proc-alpha.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/common/dev.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/i386/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/ia64/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/pc98/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/alpha/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/i386/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/ia64/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/pc98/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/sparc64/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/readme/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/relnotes/common/new.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/relnotes/i386/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.xml (contents, props changed) stable/8/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.xml (contents, props changed) stable/8/release/doc/en_US.ISO8859-1/Makefile stable/8/release/doc/en_US.ISO8859-1/errata/article.xml (contents, props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/Makefile stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml (contents, props changed) stable/8/release/doc/en_US.ISO8859-1/installation/article.xml (contents, props changed) stable/8/release/doc/en_US.ISO8859-1/readme/article.xml (contents, props changed) stable/8/release/doc/en_US.ISO8859-1/relnotes/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/early-adopter/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/errata/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/alpha/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/alpha/proc-alpha.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/common/dev.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/i386/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/i386/proc-i386.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/ia64/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/pc98/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/pc98/proc-pc98.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/sparc64/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/sparc64/proc-sparc64.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/installation/alpha/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/installation/common/install.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/installation/common/layout.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/installation/i386/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/installation/pc98/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/installation/sparc64/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/relnotes/alpha/article.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/relnotes/common/new.xml (contents, props changed) stable/8/release/doc/fr_FR.ISO8859-1/relnotes/i386/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/errata/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/alpha/Makefile stable/8/release/doc/ja_JP.eucJP/hardware/alpha/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/amd64/Makefile stable/8/release/doc/ja_JP.eucJP/hardware/amd64/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/amd64/proc-amd64.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/common/artheader.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/common/dev.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/common/intro.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/i386/Makefile stable/8/release/doc/ja_JP.eucJP/hardware/i386/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/i386/proc-i386.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/ia64/Makefile stable/8/release/doc/ja_JP.eucJP/hardware/ia64/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/ia64/proc-ia64.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/pc98/Makefile stable/8/release/doc/ja_JP.eucJP/hardware/pc98/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/pc98/proc-pc98.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/sparc64/Makefile stable/8/release/doc/ja_JP.eucJP/hardware/sparc64/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/hardware/sparc64/proc-sparc64.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/relnotes/alpha/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/relnotes/amd64/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/relnotes/common/new.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/relnotes/common/relnotes.ent stable/8/release/doc/ja_JP.eucJP/relnotes/i386/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/relnotes/ia64/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/relnotes/pc98/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/relnotes/sparc64/article.xml (contents, props changed) stable/8/release/doc/ja_JP.eucJP/share/xml/catalog stable/8/release/doc/ru_RU.KOI8-R/errata/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/alpha/Makefile stable/8/release/doc/ru_RU.KOI8-R/hardware/alpha/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/amd64/Makefile stable/8/release/doc/ru_RU.KOI8-R/hardware/amd64/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/amd64/proc-amd64.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/common/artheader.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/common/dev.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/common/intro.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/i386/Makefile stable/8/release/doc/ru_RU.KOI8-R/hardware/i386/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/i386/proc-i386.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/ia64/Makefile stable/8/release/doc/ru_RU.KOI8-R/hardware/ia64/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/ia64/proc-ia64.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/pc98/Makefile stable/8/release/doc/ru_RU.KOI8-R/hardware/pc98/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/pc98/proc-pc98.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/sparc64/Makefile stable/8/release/doc/ru_RU.KOI8-R/hardware/sparc64/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/hardware/sparc64/proc-sparc64.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/alpha/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/amd64/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/common/abstract.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/common/artheader.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/common/install.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/common/layout.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/common/trouble.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/common/upgrade.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/i386/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/ia64/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/pc98/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/installation/sparc64/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/readme/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/relnotes/alpha/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/relnotes/amd64/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/relnotes/common/new.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/relnotes/i386/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/relnotes/ia64/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/relnotes/pc98/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/relnotes/sparc64/article.xml (contents, props changed) stable/8/release/doc/ru_RU.KOI8-R/share/xml/catalog stable/8/release/doc/share/mk/doc.relnotes.mk stable/8/release/doc/share/xml/Makefile stable/8/release/doc/share/xml/release.ent stable/8/release/doc/zh_CN.GB2312/errata/article.xml (contents, props changed) stable/8/release/doc/zh_CN.GB2312/hardware/Makefile stable/8/release/doc/zh_CN.GB2312/hardware/article.xml (contents, props changed) stable/8/release/doc/zh_CN.GB2312/readme/article.xml (contents, props changed) stable/8/release/doc/zh_CN.GB2312/relnotes/article.xml (contents, props changed) Directory Properties: stable/8/release/doc/ (props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/common/artheader.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/common/intro.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/i386/proc-i386.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/ia64/proc-ia64.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/pc98/proc-pc98.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/sparc64/dev-sparc64.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/hardware/sparc64/proc-sparc64.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/common/abstract.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/common/artheader.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/common/install.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/common/layout.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/common/trouble.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/common/upgrade.xml (props changed) stable/8/release/doc/de_DE.ISO8859-1/installation/sparc64/install.xml (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/common/artheader.xml (props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/common/intro.xml (props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/ia64/proc-ia64.xml (props changed) stable/8/release/doc/fr_FR.ISO8859-1/hardware/sparc64/dev-sparc64.xml (props changed) stable/8/release/doc/fr_FR.ISO8859-1/installation/common/abstract.xml (props changed) stable/8/release/doc/fr_FR.ISO8859-1/installation/common/artheader.xml (props changed) stable/8/release/doc/fr_FR.ISO8859-1/installation/common/trouble.xml (props changed) stable/8/release/doc/fr_FR.ISO8859-1/installation/common/upgrade.xml (props changed) stable/8/release/doc/fr_FR.ISO8859-1/installation/sparc64/install.xml (props changed) Modified: stable/8/release/doc/de_DE.ISO8859-1/early-adopter/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/early-adopter/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/early-adopter/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,9 +1,8 @@ - - -%entities; - -%release; + + + %release; X"> X"> Modified: stable/8/release/doc/de_DE.ISO8859-1/errata/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/errata/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/errata/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,9 +1,8 @@ - - -%entities; - -%release; + + + %release; ]> Modified: stable/8/release/doc/de_DE.ISO8859-1/hardware/alpha/proc-alpha.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/hardware/alpha/proc-alpha.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/hardware/alpha/proc-alpha.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,3 +1,4 @@ + Modified: stable/8/release/doc/de_DE.ISO8859-1/hardware/ia64/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/hardware/ia64/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/hardware/ia64/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,10 +1,9 @@ - - -%entities; - -%release; - %sections + + + %release; + %sections; Modified: stable/8/release/doc/de_DE.ISO8859-1/hardware/pc98/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/hardware/pc98/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/hardware/pc98/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,10 +1,9 @@ - - -%entities; - -%release; - %sections + + + %release; + %sections; Modified: stable/8/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,10 +1,9 @@ - - -%entities; - -%release; - %sections + + + %release; + %sections; Modified: stable/8/release/doc/de_DE.ISO8859-1/installation/alpha/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/installation/alpha/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/installation/alpha/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,9 +1,8 @@ - - -%entities; - -%release; + + + %release; %sections; Modified: stable/8/release/doc/de_DE.ISO8859-1/installation/i386/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/installation/i386/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/installation/i386/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,9 +1,8 @@ - - -%entities; - -%release; + + + %release; %sections; Modified: stable/8/release/doc/de_DE.ISO8859-1/installation/ia64/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/installation/ia64/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/installation/ia64/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,9 +1,8 @@ - - -%entities; - -%release; + + + %release; %sections; Modified: stable/8/release/doc/de_DE.ISO8859-1/installation/pc98/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/installation/pc98/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/installation/pc98/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,9 +1,8 @@ - - -%entities; - -%release; + + + %release; %sections; Modified: stable/8/release/doc/de_DE.ISO8859-1/installation/sparc64/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/installation/sparc64/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/installation/sparc64/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,10 +1,8 @@ - - -%entities; - - -%release; + + + %release; %sections; Modified: stable/8/release/doc/de_DE.ISO8859-1/readme/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/readme/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/readme/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,9 +1,8 @@ - - -%entities; - -%release; + + + %release; ]> Modified: stable/8/release/doc/de_DE.ISO8859-1/relnotes/common/new.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/relnotes/common/new.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/relnotes/common/new.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -34,13 +34,8 @@ Die Release Notes für &os; &release.current; enthalten eine Übersicht über - - Dieses Dokument enthält die Liste aller Sicherheitshinweise, die seit der letzten Version herausgegeben wurden, sowie eine Übersicht über die wichtigsten Änderungen am @@ -59,9 +54,7 @@ Sie Hinweise für die Aktualisierung Ihres &os;-Systems. -Die &release.type; Distribution, für die diese Release + Die &release.type; Distribution, für die diese Release Notes gültig sind, markiert einen Punkt im Entwicklungszweig &release.branch; zwischen &release.prev; und der zukünftigen Version &release.next;. Sie können einige fertige @@ -69,11 +62,7 @@ entstanden sind, auf finden. -]]> - -Diese Distribution von &os; &release.current; ist eine + Diese Distribution von &os; &release.current; ist eine &release.type; Distribution. Sie können Sie von und allen seinen Mirrors erhalten. Weitere Informationen, wie Sie diese (oder andere) &release.type; @@ -84,8 +73,6 @@ url="http://www.FreeBSD.org/doc/de_DE.ISO8859-1/books/handbook/">FreeBSD Handbuchs. -]]> - Anwender, die noch keine Erfahrung mit einer &release.branch; Version eines &os; &release.type; haben, sollten auf jeden Fall die Hinweise für die ersten Anwender von &os; @@ -111,21 +98,12 @@ Neuerungen In diesem Artikel finden Sie - - Die Einträge umfassen alle Sicherheitshinweise, die nach Modified: stable/8/release/doc/de_DE.ISO8859-1/relnotes/i386/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/relnotes/i386/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/relnotes/i386/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,9 +1,8 @@ - - -%entities; - -%release; + + + %release; %sections; Modified: stable/8/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,9 +1,8 @@ - - -%entities; - -%release; + + + %release; %sections; Modified: stable/8/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,9 +1,8 @@ - - -%entities; - -%release; + + + %release; %sections; Modified: stable/8/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.xml ============================================================================== --- stable/8/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,9 +1,8 @@ - - -%entities; - -%release; + + + %release; %sections; Modified: stable/8/release/doc/en_US.ISO8859-1/Makefile ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/Makefile Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/en_US.ISO8859-1/Makefile Thu Jun 6 05:17:51 2013 (r251448) @@ -10,5 +10,8 @@ SUBDIR+= installation COMPAT_SYMLINK = en +LANGCODE=en_US.ISO8859-1 +_LANGCODE=en_US.ISO8859-1 + .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,21 +1,8 @@ - - -%entities; - - + + %release; - - -]]> - -]]> - - -]]> ]> + No advisories. + + No advisories. Open Issues - No open issue. + No open issues. + + No open issues. + + No open issues. Late-Breaking News and Corrections - A bug in OpenSSL that could cause - it to parse past the end of the message was found at the late - stage of &release.bugfix; release process. The &release.bugfix; - includes a fix for this issue by importing relevant parts from - the OpenSSL CVS. This could be triggered by an incorrectly - formatted ClientHello SSL/TLS handshake messages. The details - can be found at . + No news. + + No news. + + No news. Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/Makefile ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/hardware/Makefile Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/en_US.ISO8859-1/hardware/Makefile Thu Jun 6 05:17:51 2013 (r251448) @@ -18,7 +18,7 @@ JADEFLAGS+= -V %generate-article-toc% # SGML content SRCS+= article.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent CATALOGS+= -c ${DEV-AUTODIR}/catalog-auto Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,11 +1,9 @@ - - -%entities; - - + + %release; - + %devauto; ]> @@ -312,8 +310,63 @@ powerpc - The information for this paragraph has yet to be - compiled. + This section describes the systems currently known to be + supported by &os; on the PowerPC platform. This list is not + exhaustive. + + In general, all New World architecture Apple hardware + is supported, as well a limited selection of non-Apple + machines. + + All systems listed below are fully supported, with the + exception that software fan control is currently missing on + some Power Macintosh G5 models. SMP is supported on all systems + with more than 1 processor. + + + + Apple iMac G3 + + + Apple iMac G4 + + + Apple iMac G5 + + + Apple Power Macintosh G3 (Blue & White) + + + Apple Power Macintosh G4 + + + Apple Power Macintosh G5 + + + Apple iBook G3 + + + Apple iBook G4 + + + Apple PowerBook G3 (Lombard and Pismo) + + + Apple PowerBook G4 + + + Apple XServe G4 + + + Apple XServe G5 + + + Apple Mac Mini + + + Embedded boards based on MPC85XX + + @@ -482,7 +535,7 @@ The following systems are partially supported by &os;. In particular the fiber channel controllers in SBus-based systems are not supported. However, it is possible to use these with a SCSI controller - supported by the &man.esp.4 driver (Sun ESP SCSI, Sun FAS Fast-SCSI + supported by the &man.esp.4; driver (Sun ESP SCSI, Sun FAS Fast-SCSI and Sun FAS366 Fast-Wide SCSI controllers). Modified: stable/8/release/doc/en_US.ISO8859-1/installation/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/installation/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/en_US.ISO8859-1/installation/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,15 +1,8 @@ - - -%entities; - - + + %release; - - - - - ]>
Modified: stable/8/release/doc/en_US.ISO8859-1/readme/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/readme/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/en_US.ISO8859-1/readme/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,10 +1,8 @@ - - -%entities; - - -%release; + + + %release; ]>
@@ -92,59 +90,46 @@ Target Audience -This &release.type; is aimed primarily at early adopters + This &release.type; is aimed primarily at early adopters and various other users who want to get involved with the ongoing development of &os;. While the &os; development team tries its best to ensure that each &release.type; works as advertised, &release.branch; is very much a work-in-progress. - The basic requirements for using this &release.type; are + The basic requirements for using this &release.type; are technical proficiency with &os; and an understanding of the ongoing development process of &os; &release.branch; (as discussed on the &a.current;). - For those more interested in doing business with &os; than + For those more interested in doing business with &os; than in experimenting with new &os; technology, formal releases - (such as &release.prev.stable;) are frequently more appropriate. + (such as &release.prev;) are frequently more appropriate. Releases undergo a period of testing and quality assurance checking to ensure high reliability and dependability. -]]> - -This &release.type; is aimed primarily at early adopters + This &release.type; is aimed primarily at early adopters and various other users who want to get involved with the ongoing development of &os;. While the &os; development team tries its best to ensure that each &release.type; works as advertised, &release.branch; is very much a work-in-progress. - The basic requirements for using this &release.type; are + The basic requirements for using this &release.type; are technical proficiency with &os; and an understanding of the ongoing development process of &os; &release.branch; (as discussed on the &a.current;). - For those more interested in doing business with &os; than + For those more interested in doing business with &os; than in experimenting with new &os; technology, formal releases - (such as &release.prev.stable;) are frequently more appropriate. + (such as &release.prev;) are frequently more appropriate. Releases undergo a period of testing and quality assurance checking to ensure high reliability and dependability. -]]> - -This &release.type; of &os; is suitable for all users. It + This &release.type; of &os; is suitable for all users. It has undergone a period of testing and quality assurance checking to ensure the highest reliability and dependability. - -]]> - Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 6 03:18:07 2013 (r251447) +++ stable/8/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 6 05:17:51 2013 (r251448) @@ -1,10 +1,8 @@ - - -%entities; - - -%release; + + + %release; ]>
@@ -49,30 +47,20 @@ It also provides some notes on upgrading from previous versions of &os;. -The &release.type; distribution to which these release notes + The &release.type; distribution to which these release notes apply represents the latest point along the &release.branch; development branch since &release.branch; was created. Information regarding pre-built, binary &release.type; distributions along this branch *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 05:20:06 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2439FD7; Thu, 6 Jun 2013 05:20:06 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EF85517F9; Thu, 6 Jun 2013 05:20:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r565K5nC000640; Thu, 6 Jun 2013 05:20:05 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r565K5tI000639; Thu, 6 Jun 2013 05:20:05 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306060520.r565K5tI000639@svn.freebsd.org> From: Hiroki Sato Date: Thu, 6 Jun 2013 05:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251449 - in stable/8/release/doc: de_DE.ISO8859-1 fr_FR.ISO8859-1 ja_JP.eucJP ru_RU.KOI8-R zh_CN.GB2312 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 05:20:06 -0000 Author: hrs Date: Thu Jun 6 05:20:05 2013 New Revision: 251449 URL: http://svnweb.freebsd.org/changeset/base/251449 Log: Remove obsolete translations. Deleted: stable/8/release/doc/de_DE.ISO8859-1/ stable/8/release/doc/fr_FR.ISO8859-1/ stable/8/release/doc/ja_JP.eucJP/ stable/8/release/doc/ru_RU.KOI8-R/ stable/8/release/doc/zh_CN.GB2312/ From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 06:11:44 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5E51EC02; Thu, 6 Jun 2013 06:11:44 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 40F891990; Thu, 6 Jun 2013 06:11:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r566Bi6N016911; Thu, 6 Jun 2013 06:11:44 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r566Bi1S016910; Thu, 6 Jun 2013 06:11:44 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306060611.r566Bi1S016910@svn.freebsd.org> From: Hiroki Sato Date: Thu, 6 Jun 2013 06:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251451 - stable/8/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 06:11:44 -0000 Author: hrs Date: Thu Jun 6 06:11:43 2013 New Revision: 251451 URL: http://svnweb.freebsd.org/changeset/base/251451 Log: Update errata document for 8.4R: - dhclient does not work on fxp(4). - ZFS pool interoperability issue between 8.4 and 9.[01]. Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 6 05:28:28 2013 (r251450) +++ stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 6 06:11:43 2013 (r251451) @@ -5,18 +5,6 @@ %release; ]> - -
&os; &release; Errata @@ -28,7 +16,7 @@ $FreeBSD$ - 2011 + 2013 The &os; Documentation Project @@ -85,30 +73,178 @@ Security Advisories - No advisories. + The following security advisories pertain to &os; &release;. + For more information, consult the individual advisories available from + . + + + + + + + + + Advisory + Date + Topic + + + + + + SA-12:01.openssl + + 03 May 2012 + + OpenSSL multiple vulnerabilities + + + + SA-12:02.crypt + + 30 May 2012 + + Incorrect crypt() hashing + + + + SA-12:03.bind + + 12 June 2012 + + Incorrect handling of zero-length RDATA fields in named(8) + + + + SA-12:04.sysret + + 12 June 2012 + + Privilege escalation when returning from kernel + + + + SA-12:05.bind + + 06 August 2012 + + named(8) DNSSEC validation Denial of Service + + + + SA-12:06.bind - No advisories. + 22 November 2012 - No advisories. + Multiple Denial of Service vulnerabilities with named(8) + + + + SA-12:07.hostapd + + 22 November 2012 + + Insufficient message length validation for EAP-TLS messages + + + + SA-12:08.linux + + 22 November 2012 + + Linux compatibility layer input validation error + + + + SA-13:02.libc + + 19 February 2013 + + glob(3) related resource exhaustion + + + + SA-13:03.openssl + + 02 April 2013 + + OpenSSL multiple vulnerabilities + + + + SA-13:04.bind + + 02 April 2013 + + BIND remote denial of service + + + + SA-13:05.nfsserver + + 29 April 2013 + + Insufficient input validation in the NFS server + + + + Open Issues - No open issues. + [20130606] The &man.fxp.4; network interface driver may not + work well with the &man.dhclient.8; utility. More specifically, + if the /etc/rc.conf has the following + line: + + ifconfig_fxp0="DHCP" + + to activate a DHCP client to configure the network + interface, the following notification messages are displayed and + the &man.dhclient.8; utility keeps trying to initialize the + network interface forever. - No open issues. + kernel: fxp0: link state changed to UP +kernel: fxp0: link state changed to DOWN - No open issues. + A patch to fix this issue will be released as an Errata + Notice. Late-Breaking News and Corrections - No news. - - No news. - - No news. + [20130606] As described in &os; &release; Release Notes, + &os; ZFS subsystem has been updated to support feature flags for + ZFS pools. However, the default version number of a newly + created ZFS pool is still 28. + + This is because &os; 9.0 and 9.1 do not support the feature + flags. This means ZFS pools with feature flag support cannot be + used on &os; 9.0 and 9.1. An 8.X system with v28 ZFS pools can + be upgraded to 9.X with no problem. Note that &man.zfs.8; + send and receive commands + do not work between pools with different versions. Once a ZFS + pool is upgraded from v28, there is no way to upgrade the system + to &os; 9.0 and 9.1. &os; 9.2 and later will support ZFS pools + with feature flags. + + To create a ZFS pool with feature flag support, use the + &man.zpool.8; create command and then the + &man.zpool.8; upgrade command.
From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 08:48:03 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B5399C; Thu, 6 Jun 2013 08:48:03 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7303B10A1; Thu, 6 Jun 2013 08:48:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r568m3sQ064852; Thu, 6 Jun 2013 08:48:03 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r568m30c064850; Thu, 6 Jun 2013 08:48:03 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306060848.r568m30c064850@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 08:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251453 - stable/8/sys/dev/md X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 08:48:03 -0000 Author: smh Date: Thu Jun 6 08:48:02 2013 New Revision: 251453 URL: http://svnweb.freebsd.org/changeset/base/251453 Log: MFC r221229: Implement BIO_DELETE for vnode devices Modified: stable/8/sys/dev/md/md.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/md/ (props changed) Modified: stable/8/sys/dev/md/md.c ============================================================================== --- stable/8/sys/dev/md/md.c Thu Jun 6 06:17:20 2013 (r251452) +++ stable/8/sys/dev/md/md.c Thu Jun 6 08:48:02 2013 (r251453) @@ -205,6 +205,9 @@ struct md_s { vm_object_t object; }; +/* Used for BIO_DELETE on MD_VNODE */ +static u_char zero[PAGE_SIZE]; + static struct indir * new_indir(u_int shift) { @@ -514,10 +517,12 @@ mdstart_vnode(struct md_s *sc, struct bi struct mount *mp; struct vnode *vp; struct thread *td; + off_t end, zerosize; switch (bp->bio_cmd) { case BIO_READ: case BIO_WRITE: + case BIO_DELETE: case BIO_FLUSH: break; default: @@ -548,6 +553,43 @@ mdstart_vnode(struct md_s *sc, struct bi bzero(&auio, sizeof(auio)); + /* + * Special case for BIO_DELETE. On the surface, this is very + * similar to BIO_WRITE, except that we write from our own + * fixed-length buffer, so we have to loop. The net result is + * that the two cases end up having very little in common. + */ + if (bp->bio_cmd == BIO_DELETE) { + zerosize = sizeof(zero) - (sizeof(zero) % sc->sectorsize); + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = (vm_ooffset_t)bp->bio_offset; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_rw = UIO_WRITE; + auio.uio_td = td; + end = bp->bio_offset + bp->bio_length; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + (void) vn_start_write(vp, &mp, V_WAIT); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + error = 0; + while (auio.uio_offset < end) { + aiov.iov_base = zero; + aiov.iov_len = end - auio.uio_offset; + if (aiov.iov_len > zerosize) + aiov.iov_len = zerosize; + auio.uio_resid = aiov.iov_len; + error = VOP_WRITE(vp, &auio, + sc->flags & MD_ASYNC ? 0 : IO_SYNC, sc->cred); + if (error != 0) + break; + } + VOP_UNLOCK(vp, 0); + vn_finished_write(mp); + bp->bio_resid = end - auio.uio_offset; + VFS_UNLOCK_GIANT(vfslocked); + return (error); + } + aiov.iov_base = bp->bio_data; aiov.iov_len = bp->bio_length; auio.uio_iov = &aiov; From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 08:57:34 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1129B494; Thu, 6 Jun 2013 08:57:34 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E751E1141; Thu, 6 Jun 2013 08:57:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r568vXSe067859; Thu, 6 Jun 2013 08:57:33 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r568vXaR067853; Thu, 6 Jun 2013 08:57:33 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306060857.r568vXaR067853@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 08:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251454 - in stable/8/sys: dev/md dev/null sys vm X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 08:57:34 -0000 Author: smh Date: Thu Jun 6 08:57:32 2013 New Revision: 251454 URL: http://svnweb.freebsd.org/changeset/base/251454 Log: MFC r221853: Global zeros region Modified: stable/8/sys/dev/md/md.c stable/8/sys/dev/null/null.c stable/8/sys/sys/systm.h stable/8/sys/vm/vm_kern.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/md/ (props changed) stable/8/sys/dev/null/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/dev/md/md.c ============================================================================== --- stable/8/sys/dev/md/md.c Thu Jun 6 08:48:02 2013 (r251453) +++ stable/8/sys/dev/md/md.c Thu Jun 6 08:57:32 2013 (r251454) @@ -205,9 +205,6 @@ struct md_s { vm_object_t object; }; -/* Used for BIO_DELETE on MD_VNODE */ -static u_char zero[PAGE_SIZE]; - static struct indir * new_indir(u_int shift) { @@ -560,7 +557,8 @@ mdstart_vnode(struct md_s *sc, struct bi * that the two cases end up having very little in common. */ if (bp->bio_cmd == BIO_DELETE) { - zerosize = sizeof(zero) - (sizeof(zero) % sc->sectorsize); + zerosize = ZERO_REGION_SIZE - + (ZERO_REGION_SIZE % sc->sectorsize); auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_offset = (vm_ooffset_t)bp->bio_offset; @@ -573,7 +571,7 @@ mdstart_vnode(struct md_s *sc, struct bi vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = 0; while (auio.uio_offset < end) { - aiov.iov_base = zero; + aiov.iov_base = __DECONST(void *, zero_region); aiov.iov_len = end - auio.uio_offset; if (aiov.iov_len > zerosize) aiov.iov_len = zerosize; Modified: stable/8/sys/dev/null/null.c ============================================================================== --- stable/8/sys/dev/null/null.c Thu Jun 6 08:48:02 2013 (r251453) +++ stable/8/sys/dev/null/null.c Thu Jun 6 08:57:32 2013 (r251454) @@ -69,8 +69,6 @@ static struct cdevsw zero_cdevsw = { .d_flags = D_MMAP_ANON, }; -static void *zbuf; - /* ARGSUSED */ static int null_write(struct cdev *dev __unused, struct uio *uio, int flags __unused) @@ -132,10 +130,19 @@ zero_ioctl(struct cdev *dev __unused, u_ static int zero_read(struct cdev *dev __unused, struct uio *uio, int flags __unused) { + void *zbuf; + ssize_t len; int error = 0; - while (uio->uio_resid > 0 && error == 0) - error = uiomove(zbuf, MIN(uio->uio_resid, PAGE_SIZE), uio); + KASSERT(uio->uio_rw == UIO_READ, + ("Can't be in %s for write", __func__)); + zbuf = __DECONST(void *, zero_region); + while (uio->uio_resid > 0 && error == 0) { + len = uio->uio_resid; + if (len > ZERO_REGION_SIZE) + len = ZERO_REGION_SIZE; + error = uiomove(zbuf, len, uio); + } return (error); } @@ -148,7 +155,6 @@ null_modevent(module_t mod __unused, int case MOD_LOAD: if (bootverbose) printf("null: \n"); - zbuf = (void *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK | M_ZERO); null_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &null_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0666, "null"); zero_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &zero_cdevsw, 0, @@ -158,7 +164,6 @@ null_modevent(module_t mod __unused, int case MOD_UNLOAD: destroy_dev(null_dev); destroy_dev(zero_dev); - free(zbuf, M_TEMP); break; case MOD_SHUTDOWN: Modified: stable/8/sys/sys/systm.h ============================================================================== --- stable/8/sys/sys/systm.h Thu Jun 6 08:48:02 2013 (r251453) +++ stable/8/sys/sys/systm.h Thu Jun 6 08:57:32 2013 (r251454) @@ -136,6 +136,9 @@ extern char static_hints[]; /* by config extern char **kenvp; +extern const void *zero_region; /* address space maps to a zeroed page */ +#define ZERO_REGION_SIZE (2048 * 1024) + /* * General function declarations. */ Modified: stable/8/sys/vm/vm_kern.c ============================================================================== --- stable/8/sys/vm/vm_kern.c Thu Jun 6 08:48:02 2013 (r251453) +++ stable/8/sys/vm/vm_kern.c Thu Jun 6 08:57:32 2013 (r251454) @@ -91,6 +91,9 @@ vm_map_t exec_map=0; vm_map_t pipe_map; vm_map_t buffer_map=0; +const void *zero_region; +CTASSERT((ZERO_REGION_SIZE & PAGE_MASK) == 0); + /* * kmem_alloc_nofault: * @@ -519,6 +522,35 @@ kmem_free_wakeup(map, addr, size) vm_map_unlock(map); } +static void +kmem_init_zero_region(void) +{ + vm_offset_t addr; + vm_page_t m; + unsigned int i; + int error; + + /* Allocate virtual address space. */ + addr = kmem_alloc_nofault(kernel_map, ZERO_REGION_SIZE); + + /* Allocate a page and zero it. */ + m = vm_page_alloc(NULL, OFF_TO_IDX(addr - VM_MIN_KERNEL_ADDRESS), + VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO); + if ((m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + + /* Map the address space to the page. */ + for (i = 0; i < ZERO_REGION_SIZE; i += PAGE_SIZE) + pmap_qenter(addr + i, &m, 1); + + /* Protect it r/o. */ + error = vm_map_protect(kernel_map, addr, addr + ZERO_REGION_SIZE, + VM_PROT_READ, TRUE); + KASSERT(error == 0, ("error=%d", error)); + + zero_region = (const void *)addr; +} + /* * kmem_init: * @@ -547,6 +579,8 @@ kmem_init(start, end) start, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); /* ... and ending with the completion of the above `insert' */ vm_map_unlock(m); + + kmem_init_zero_region(); } #ifdef DIAGNOSTIC From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 09:13:10 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1EB1E9E6; Thu, 6 Jun 2013 09:13:10 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 00914121B; Thu, 6 Jun 2013 09:13:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r569D9QD073843; Thu, 6 Jun 2013 09:13:09 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r569D7NX073822; Thu, 6 Jun 2013 09:13:07 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306060913.r569D7NX073822@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 09:13:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251455 - in stable/8/sys: amd64/include arm/include dev/md dev/null i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include sys vm X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 09:13:10 -0000 Author: smh Date: Thu Jun 6 09:13:07 2013 New Revision: 251455 URL: http://svnweb.freebsd.org/changeset/base/251455 Log: MFC r221855: Move the ZERO_REGION_SIZE to a machine-dependent Modified: stable/8/sys/amd64/include/vmparam.h stable/8/sys/arm/include/vmparam.h stable/8/sys/dev/md/md.c stable/8/sys/dev/null/null.c stable/8/sys/i386/include/vmparam.h stable/8/sys/ia64/include/vmparam.h stable/8/sys/mips/include/vmparam.h stable/8/sys/powerpc/include/vmparam.h stable/8/sys/sparc64/include/vmparam.h stable/8/sys/sun4v/include/vmparam.h stable/8/sys/sys/systm.h stable/8/sys/vm/vm_kern.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/arm/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/md/ (props changed) stable/8/sys/dev/null/ (props changed) stable/8/sys/i386/ (props changed) stable/8/sys/ia64/ (props changed) stable/8/sys/mips/ (props changed) stable/8/sys/powerpc/ (props changed) stable/8/sys/sparc64/ (props changed) stable/8/sys/sun4v/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/amd64/include/vmparam.h ============================================================================== --- stable/8/sys/amd64/include/vmparam.h Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/amd64/include/vmparam.h Thu Jun 6 09:13:07 2013 (r251455) @@ -210,4 +210,6 @@ #define VM_INITIAL_PAGEIN 16 #endif +#define ZERO_REGION_SIZE (2 * 1024 * 1024) /* 2MB */ + #endif /* _MACHINE_VMPARAM_H_ */ Modified: stable/8/sys/arm/include/vmparam.h ============================================================================== --- stable/8/sys/arm/include/vmparam.h Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/arm/include/vmparam.h Thu Jun 6 09:13:07 2013 (r251455) @@ -144,4 +144,7 @@ #ifdef ARM_USE_SMALL_ALLOC #define UMA_MD_SMALL_ALLOC #endif /* ARM_USE_SMALL_ALLOC */ + +#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ + #endif /* _MACHINE_VMPARAM_H_ */ Modified: stable/8/sys/dev/md/md.c ============================================================================== --- stable/8/sys/dev/md/md.c Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/dev/md/md.c Thu Jun 6 09:13:07 2013 (r251455) @@ -89,6 +89,8 @@ #include #include +#include + #define MD_MODVER 1 #define MD_SHUTDOWN 0x10000 /* Tell worker thread to terminate. */ Modified: stable/8/sys/dev/null/null.c ============================================================================== --- stable/8/sys/dev/null/null.c Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/dev/null/null.c Thu Jun 6 09:13:07 2013 (r251455) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* For use with destroy_dev(9). */ static struct cdev *null_dev; Modified: stable/8/sys/i386/include/vmparam.h ============================================================================== --- stable/8/sys/i386/include/vmparam.h Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/i386/include/vmparam.h Thu Jun 6 09:13:07 2013 (r251455) @@ -202,4 +202,6 @@ #define VM_INITIAL_PAGEIN 16 #endif +#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ + #endif /* _MACHINE_VMPARAM_H_ */ Modified: stable/8/sys/ia64/include/vmparam.h ============================================================================== --- stable/8/sys/ia64/include/vmparam.h Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/ia64/include/vmparam.h Thu Jun 6 09:13:07 2013 (r251455) @@ -181,4 +181,6 @@ #define VM_INITIAL_PAGEIN 16 #endif +#define ZERO_REGION_SIZE (2 * 1024 * 1024) /* 2MB */ + #endif /* !_MACHINE_VMPARAM_H_ */ Modified: stable/8/sys/mips/include/vmparam.h ============================================================================== --- stable/8/sys/mips/include/vmparam.h Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/mips/include/vmparam.h Thu Jun 6 09:13:07 2013 (r251455) @@ -202,4 +202,6 @@ */ #define VM_NFREEORDER 9 +#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ + #endif /* !_MACHINE_VMPARAM_H_ */ Modified: stable/8/sys/powerpc/include/vmparam.h ============================================================================== --- stable/8/sys/powerpc/include/vmparam.h Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/powerpc/include/vmparam.h Thu Jun 6 09:13:07 2013 (r251455) @@ -182,4 +182,6 @@ struct pmap_physseg { #define VM_KMEM_SIZE (12 * 1024 * 1024) #endif +#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ + #endif /* _MACHINE_VMPARAM_H_ */ Modified: stable/8/sys/sparc64/include/vmparam.h ============================================================================== --- stable/8/sys/sparc64/include/vmparam.h Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/sparc64/include/vmparam.h Thu Jun 6 09:13:07 2013 (r251455) @@ -245,4 +245,11 @@ extern u_int tsb_kernel_ldd_phys; extern vm_offset_t vm_max_kernel_address; +/* + * Older sparc64 machines have a virtually indexed L1 data cache of 16KB. + * Consequently, mapping the same physical page multiple times may have + * caching disabled. + */ +#define ZERO_REGION_SIZE PAGE_SIZE + #endif /* !_MACHINE_VMPARAM_H_ */ Modified: stable/8/sys/sun4v/include/vmparam.h ============================================================================== --- stable/8/sys/sun4v/include/vmparam.h Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/sun4v/include/vmparam.h Thu Jun 6 09:13:07 2013 (r251455) @@ -227,4 +227,6 @@ #define UMA_MD_SMALL_ALLOC extern vm_offset_t vm_max_kernel_address; +#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ + #endif /* !_MACHINE_VMPARAM_H_ */ Modified: stable/8/sys/sys/systm.h ============================================================================== --- stable/8/sys/sys/systm.h Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/sys/systm.h Thu Jun 6 09:13:07 2013 (r251455) @@ -137,7 +137,6 @@ extern char static_hints[]; /* by config extern char **kenvp; extern const void *zero_region; /* address space maps to a zeroed page */ -#define ZERO_REGION_SIZE (2048 * 1024) /* * General function declarations. Modified: stable/8/sys/vm/vm_kern.c ============================================================================== --- stable/8/sys/vm/vm_kern.c Thu Jun 6 08:57:32 2013 (r251454) +++ stable/8/sys/vm/vm_kern.c Thu Jun 6 09:13:07 2013 (r251455) @@ -525,25 +525,22 @@ kmem_free_wakeup(map, addr, size) static void kmem_init_zero_region(void) { - vm_offset_t addr; + vm_offset_t addr, i; vm_page_t m; - unsigned int i; int error; - /* Allocate virtual address space. */ + /* + * Map a single physical page of zeros to a larger virtual range. + * This requires less looping in places that want large amounts of + * zeros, while not using much more physical resources. + */ addr = kmem_alloc_nofault(kernel_map, ZERO_REGION_SIZE); - - /* Allocate a page and zero it. */ m = vm_page_alloc(NULL, OFF_TO_IDX(addr - VM_MIN_KERNEL_ADDRESS), VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if ((m->flags & PG_ZERO) == 0) pmap_zero_page(m); - - /* Map the address space to the page. */ for (i = 0; i < ZERO_REGION_SIZE; i += PAGE_SIZE) pmap_qenter(addr + i, &m, 1); - - /* Protect it r/o. */ error = vm_map_protect(kernel_map, addr, addr + ZERO_REGION_SIZE, VM_PROT_READ, TRUE); KASSERT(error == 0, ("error=%d", error)); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 09:23:22 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 70A65E4A; Thu, 6 Jun 2013 09:23:22 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 61C2312BB; Thu, 6 Jun 2013 09:23:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r569NMOA077141; Thu, 6 Jun 2013 09:23:22 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r569NMgw077140; Thu, 6 Jun 2013 09:23:22 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306060923.r569NMgw077140@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 09:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251456 - stable/8/sys/geom X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 09:23:22 -0000 Author: smh Date: Thu Jun 6 09:23:21 2013 New Revision: 251456 URL: http://svnweb.freebsd.org/changeset/base/251456 Log: MFC r226737: Allow upper layers to discover that BIO_DELETE / BIO_FLUSH is not supported. Modified: stable/8/sys/geom/geom_disk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/geom_disk.c ============================================================================== --- stable/8/sys/geom/geom_disk.c Thu Jun 6 09:13:07 2013 (r251455) +++ stable/8/sys/geom/geom_disk.c Thu Jun 6 09:23:21 2013 (r251456) @@ -302,7 +302,7 @@ g_disk_start(struct bio *bp) switch(bp->bio_cmd) { case BIO_DELETE: if (!(dp->d_flags & DISKFLAG_CANDELETE)) { - error = 0; + error = EOPNOTSUPP; break; } /* fall-through */ @@ -370,8 +370,8 @@ g_disk_start(struct bio *bp) g_trace(G_T_BIO, "g_disk_flushcache(%s)", bp->bio_to->name); if (!(dp->d_flags & DISKFLAG_CANFLUSHCACHE)) { - g_io_deliver(bp, ENODEV); - return; + error = EOPNOTSUPP; + break; } bp2 = g_clone_bio(bp); if (bp2 == NULL) { From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 09:45:23 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B64624C6; Thu, 6 Jun 2013 09:45:23 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9800D13B8; Thu, 6 Jun 2013 09:45:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r569jNSk083808; Thu, 6 Jun 2013 09:45:23 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r569jNO1083802; Thu, 6 Jun 2013 09:45:23 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306060945.r569jNO1083802@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 09:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251457 - stable/8/sys/cam/scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 09:45:23 -0000 Author: smh Date: Thu Jun 6 09:45:22 2013 New Revision: 251457 URL: http://svnweb.freebsd.org/changeset/base/251457 Log: MFC r230053: BIO_DELETE for SCSI da devices MFC r239655: Fix scsi_da's BIO_DELETE->SCSI_UNMAP translation Modified: stable/8/sys/cam/scsi/scsi_all.c stable/8/sys/cam/scsi/scsi_all.h stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.c Thu Jun 6 09:23:21 2013 (r251456) +++ stable/8/sys/cam/scsi/scsi_all.c Thu Jun 6 09:45:22 2013 (r251457) @@ -361,6 +361,8 @@ static struct op_table_entry scsi_op_cod { 0x40, D | T | L | P | W | R | O | M | S | C, "CHANGE DEFINITION" }, /* 41 O WRITE SAME(10) */ { 0x41, D, "WRITE SAME(10)" }, + /* 42 O UNMAP */ + { 0x42, D, "UNMAP" }, /* 42 O READ SUB-CHANNEL */ { 0x42, R, "READ SUB-CHANNEL" }, /* 43 O READ TOC/PMA/ATIP */ @@ -4318,6 +4320,104 @@ scsi_read_write(struct ccb_scsiio *csio, timeout); } +void +scsi_write_same(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + int minimum_cmd_size, u_int64_t lba, u_int32_t block_count, + u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout) +{ + u_int8_t cdb_len; + if ((minimum_cmd_size < 16) && + ((block_count & 0xffff) == block_count) && + ((lba & 0xffffffff) == lba)) { + /* + * Need a 10 byte cdb. + */ + struct scsi_write_same_10 *scsi_cmd; + + scsi_cmd = (struct scsi_write_same_10 *)&csio->cdb_io.cdb_bytes; + scsi_cmd->opcode = WRITE_SAME_10; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(lba, scsi_cmd->addr); + scsi_cmd->group = 0; + scsi_ulto2b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + + CAM_DEBUG(csio->ccb_h.path, CAM_DEBUG_SUBTRACE, + ("10byte: %x%x%x%x:%x%x: %d\n", scsi_cmd->addr[0], + scsi_cmd->addr[1], scsi_cmd->addr[2], + scsi_cmd->addr[3], scsi_cmd->length[0], + scsi_cmd->length[1], dxfer_len)); + } else { + /* + * 16 byte CDB. We'll only get here if the LBA is larger + * than 2^32, or if the user asks for a 16 byte command. + */ + struct scsi_write_same_16 *scsi_cmd; + + scsi_cmd = (struct scsi_write_same_16 *)&csio->cdb_io.cdb_bytes; + scsi_cmd->opcode = WRITE_SAME_16; + scsi_cmd->byte2 = byte2; + scsi_u64to8b(lba, scsi_cmd->addr); + scsi_ulto4b(block_count, scsi_cmd->length); + scsi_cmd->group = 0; + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + + CAM_DEBUG(csio->ccb_h.path, CAM_DEBUG_SUBTRACE, + ("16byte: %x%x%x%x%x%x%x%x:%x%x%x%x: %d\n", + scsi_cmd->addr[0], scsi_cmd->addr[1], + scsi_cmd->addr[2], scsi_cmd->addr[3], + scsi_cmd->addr[4], scsi_cmd->addr[5], + scsi_cmd->addr[6], scsi_cmd->addr[7], + scsi_cmd->length[0], scsi_cmd->length[1], + scsi_cmd->length[2], scsi_cmd->length[3], + dxfer_len)); + } + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + data_ptr, + dxfer_len, + sense_len, + cdb_len, + timeout); +} + +void +scsi_unmap(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + u_int8_t *data_ptr, u_int16_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout) +{ + struct scsi_unmap *scsi_cmd; + + scsi_cmd = (struct scsi_unmap *)&csio->cdb_io.cdb_bytes; + scsi_cmd->opcode = UNMAP; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(0, scsi_cmd->reserved); + scsi_cmd->group = 0; + scsi_ulto2b(dxfer_len, scsi_cmd->length); + scsi_cmd->control = 0; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + data_ptr, + dxfer_len, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + void scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Thu Jun 6 09:23:21 2013 (r251456) +++ stable/8/sys/cam/scsi/scsi_all.h Thu Jun 6 09:45:22 2013 (r251457) @@ -512,6 +512,41 @@ struct scsi_rw_16 u_int8_t control; }; +struct scsi_write_same_10 +{ + uint8_t opcode; + uint8_t byte2; +#define SWS_LBDATA 0x02 +#define SWS_PBDATA 0x04 +#define SWS_UNMAP 0x08 +#define SWS_ANCHOR 0x10 + uint8_t addr[4]; + uint8_t group; + uint8_t length[2]; + uint8_t control; +}; + +struct scsi_write_same_16 +{ + uint8_t opcode; + uint8_t byte2; + uint8_t addr[8]; + uint8_t length[4]; + uint8_t group; + uint8_t control; +}; + +struct scsi_unmap +{ + uint8_t opcode; + uint8_t byte2; +#define SU_ANCHOR 0x01 + uint8_t reserved[4]; + uint8_t group; + uint8_t length[2]; + uint8_t control; +}; + struct scsi_start_stop_unit { u_int8_t opcode; @@ -595,6 +630,8 @@ struct ata_pass_16 { #define WRITE_BUFFER 0x3B #define READ_BUFFER 0x3C #define CHANGE_DEFINITION 0x40 +#define WRITE_SAME_10 0x41 +#define UNMAP 0x42 #define LOG_SELECT 0x4C #define LOG_SENSE 0x4D #define MODE_SELECT_10 0x55 @@ -602,6 +639,7 @@ struct ata_pass_16 { #define ATA_PASS_16 0x85 #define READ_16 0x88 #define WRITE_16 0x8A +#define WRITE_SAME_16 0x93 #define SERVICE_ACTION_IN 0x9E #define REPORT_LUNS 0xA0 #define ATA_PASS_12 0xA1 @@ -1287,6 +1325,20 @@ void scsi_read_write(struct ccb_scsiio * u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_write_same(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + int minimum_cmd_size, u_int64_t lba, + u_int32_t block_count, u_int8_t *data_ptr, + u_int32_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout); + +void scsi_unmap(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + u_int8_t *data_ptr, u_int16_t dxfer_len, + u_int8_t sense_len, u_int32_t timeout); + void scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int start, int load_eject, Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Thu Jun 6 09:23:21 2013 (r251456) +++ stable/8/sys/cam/scsi/scsi_da.c Thu Jun 6 09:45:22 2013 (r251457) @@ -81,8 +81,7 @@ typedef enum { DA_FLAG_RETRY_UA = 0x080, DA_FLAG_OPEN = 0x100, DA_FLAG_SCTX_INIT = 0x200, - DA_FLAG_CAN_RC16 = 0x400, - DA_FLAG_CAN_LBPME = 0x800 + DA_FLAG_CAN_RC16 = 0x400 } da_flags; typedef enum { @@ -99,10 +98,24 @@ typedef enum { DA_CCB_BUFFER_IO = 0x03, DA_CCB_WAITING = 0x04, DA_CCB_DUMP = 0x05, + DA_CCB_DELETE = 0x06, DA_CCB_TYPE_MASK = 0x0F, DA_CCB_RETRY_UA = 0x10 } da_ccb_state; +typedef enum { + DA_DELETE_NONE, + DA_DELETE_DISABLE, + DA_DELETE_ZERO, + DA_DELETE_WS10, + DA_DELETE_WS16, + DA_DELETE_UNMAP, + DA_DELETE_MAX = DA_DELETE_UNMAP +} da_delete_methods; + +static const char *da_delete_method_names[] = + { "NONE", "DISABLE", "ZERO", "WS10", "WS16", "UNMAP" }; + /* Offsets into our private area for storing information */ #define ccb_state ppriv_field0 #define ccb_bp ppriv_ptr1 @@ -117,8 +130,12 @@ struct disk_params { u_int stripeoffset; }; +#define UNMAP_MAX_RANGES 512 + struct da_softc { struct bio_queue_head bio_queue; + struct bio_queue_head delete_queue; + struct bio_queue_head delete_run_queue; SLIST_ENTRY(da_softc) links; LIST_HEAD(, ccb_hdr) pending_ccbs; da_state state; @@ -128,6 +145,10 @@ struct da_softc { int error_inject; int ordered_tag_count; int outstanding_cmds; + int unmap_max_ranges; + int unmap_max_lba; + int delete_running; + da_delete_methods delete_method; struct disk_params params; struct disk *disk; union ccb saved_ccb; @@ -136,6 +157,7 @@ struct da_softc { struct sysctl_oid *sysctl_tree; struct callout sendordered_c; uint64_t wwpn; + uint8_t unmap_buf[UNMAP_MAX_RANGES * 16 + 8]; }; struct da_quirk_entry { @@ -833,6 +855,7 @@ static void daasync(void *callback_arg, struct cam_path *path, void *arg); static void dasysctlinit(void *context, int pending); static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS); +static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); static periph_ctor_t daregister; static periph_dtor_t dacleanup; static periph_start_t dastart; @@ -952,6 +975,10 @@ daopen(struct disk *dp) softc->disk->d_fwheads = softc->params.heads; softc->disk->d_devstat->block_size = softc->params.secsize; softc->disk->d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE; + if (softc->delete_method > DA_DELETE_DISABLE) + softc->disk->d_flags |= DISKFLAG_CANDELETE; + else + softc->disk->d_flags &= ~DISKFLAG_CANDELETE; if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 && (softc->quirks & DA_Q_NO_PREVENT) == 0) @@ -1051,6 +1078,26 @@ daclose(struct disk *dp) return (0); } +static void +daschedule(struct cam_periph *periph) +{ + struct da_softc *softc = (struct da_softc *)periph->softc; + uint32_t prio; + + /* Check if cam_periph_getccb() was called. */ + prio = periph->immediate_priority; + + /* Check if we have more work to do. */ + if (bioq_first(&softc->bio_queue) || + (!softc->delete_running && bioq_first(&softc->delete_queue))) { + prio = CAM_PRIORITY_NORMAL; + } + + /* Schedule CCB if any of above is true. */ + if (prio != CAM_PRIORITY_NONE) + xpt_schedule(periph, prio); +} + /* * Actually translate the requested transfer into one the physical driver * can understand. The transfer is described by a buf and will include @@ -1085,12 +1132,18 @@ dastrategy(struct bio *bp) /* * Place it in the queue of disk activities for this disk */ - bioq_disksort(&softc->bio_queue, bp); + if (bp->bio_cmd == BIO_DELETE) { + if (bp->bio_bcount == 0) + biodone(bp); + else + bioq_disksort(&softc->delete_queue, bp); + } else + bioq_disksort(&softc->bio_queue, bp); /* * Schedule ourselves for performing the work. */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + daschedule(periph); cam_periph_unlock(periph); return; @@ -1234,6 +1287,7 @@ daoninvalidate(struct cam_periph *periph * with XPT_ABORT_CCB. */ bioq_flush(&softc->bio_queue, NULL, ENXIO); + bioq_flush(&softc->delete_queue, NULL, ENXIO); disk_gone(softc->disk); xpt_print(periph->path, "lost device - %d outstanding, %d refs\n", @@ -1365,6 +1419,10 @@ dasysctlinit(void *context, int pending) * the fly. */ SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "delete_method", CTLTYPE_STRING | CTLFLAG_RW, + &softc->delete_method, 0, dadeletemethodsysctl, "A", + "BIO_DELETE execution method"); + SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); @@ -1428,6 +1486,32 @@ dacmdsizesysctl(SYSCTL_HANDLER_ARGS) return (0); } +static int +dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) +{ + char buf[16]; + int error; + const char *p; + int i, value; + + value = *(int *)arg1; + if (value < 0 || value > DA_DELETE_MAX) + p = "UNKNOWN"; + else + p = da_delete_method_names[value]; + strncpy(buf, p, sizeof(buf)); + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + for (i = 0; i <= DA_DELETE_MAX; i++) { + if (strcmp(buf, da_delete_method_names[i]) != 0) + continue; + *(int *)arg1 = i; + return (0); + } + return (EINVAL); +} + static cam_status daregister(struct cam_periph *periph, void *arg) { @@ -1460,8 +1544,12 @@ daregister(struct cam_periph *periph, vo LIST_INIT(&softc->pending_ccbs); softc->state = DA_STATE_PROBE; bioq_init(&softc->bio_queue); + bioq_init(&softc->delete_queue); + bioq_init(&softc->delete_run_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= DA_FLAG_PACK_REMOVABLE; + softc->unmap_max_ranges = UNMAP_MAX_RANGES; + softc->unmap_max_lba = 1024*1024*2; periph->softc = softc; @@ -1599,13 +1687,10 @@ dastart(struct cam_periph *periph, union switch (softc->state) { case DA_STATE_NORMAL: { - /* Pull a buffer from the queue and get going on it */ - struct bio *bp; + struct bio *bp, *bp1; + uint8_t tag_code; - /* - * See if there is a buf with work for us to do.. - */ - bp = bioq_first(&softc->bio_queue); + /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); @@ -1614,84 +1699,186 @@ dastart(struct cam_periph *periph, union periph_links.sle); periph->immediate_priority = CAM_PRIORITY_NONE; wakeup(&periph->ccb_list); - } else if (bp == NULL) { - xpt_release_ccb(start_ccb); - } else { - u_int8_t tag_code; + /* May have more work to do, so ensure we stay scheduled */ + daschedule(periph); + break; + } - bioq_remove(&softc->bio_queue, bp); + /* Run BIO_DELETE if not running yet. */ + if (!softc->delete_running && + (bp = bioq_first(&softc->delete_queue)) != NULL) { + uint64_t lba; + u_int count; + + if (softc->delete_method == DA_DELETE_UNMAP) { + uint8_t *buf = softc->unmap_buf; + uint64_t lastlba = (uint64_t)-1; + uint32_t lastcount = 0; + int blocks = 0, off, ranges = 0; + + softc->delete_running = 1; + bzero(softc->unmap_buf, sizeof(softc->unmap_buf)); + bp1 = bp; + do { + bioq_remove(&softc->delete_queue, bp1); + if (bp1 != bp) + bioq_insert_tail(&softc->delete_run_queue, bp1); + lba = bp1->bio_pblkno; + count = bp1->bio_bcount / softc->params.secsize; + + /* Try to extend the previous range. */ + if (lba == lastlba) { + lastcount += count; + off = (ranges - 1) * 16 + 8; + scsi_ulto4b(lastcount, &buf[off + 8]); + } else if (count > 0) { + off = ranges * 16 + 8; + scsi_u64to8b(lba, &buf[off + 0]); + scsi_ulto4b(count, &buf[off + 8]); + lastcount = count; + ranges++; + } + blocks += count; + lastlba = lba + count; + bp1 = bioq_first(&softc->delete_queue); + if (bp1 == NULL || + ranges >= softc->unmap_max_ranges || + blocks + bp1->bio_bcount / + softc->params.secsize > softc->unmap_max_lba) + break; + } while (1); + scsi_ulto2b(ranges * 16 + 6, &buf[0]); + scsi_ulto2b(ranges * 16, &buf[2]); + + scsi_unmap(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*byte2*/0, + /*data_ptr*/ buf, + /*dxfer_len*/ ranges * 16 + 8, + /*sense_len*/SSD_FULL_SIZE, + da_default_timeout * 1000); + start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; + goto out; + } else if (softc->delete_method == DA_DELETE_ZERO || + softc->delete_method == DA_DELETE_WS10 || + softc->delete_method == DA_DELETE_WS16) { + softc->delete_running = 1; + lba = bp->bio_pblkno; + count = 0; + bp1 = bp; + do { + bioq_remove(&softc->delete_queue, bp1); + if (bp1 != bp) + bioq_insert_tail(&softc->delete_run_queue, bp1); + count += bp1->bio_bcount / softc->params.secsize; + bp1 = bioq_first(&softc->delete_queue); + if (bp1 == NULL || + lba + count != bp1->bio_pblkno || + count + bp1->bio_bcount / + softc->params.secsize > 0xffff) + break; + } while (1); + + scsi_write_same(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*byte2*/softc->delete_method == + DA_DELETE_ZERO ? 0 : SWS_UNMAP, + softc->delete_method == + DA_DELETE_WS16 ? 16 : 10, + /*lba*/lba, + /*block_count*/count, + /*data_ptr*/ __DECONST(void *, + zero_region), + /*dxfer_len*/ softc->params.secsize, + /*sense_len*/SSD_FULL_SIZE, + da_default_timeout * 1000); + start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; + goto out; + } else { + bioq_flush(&softc->delete_queue, NULL, 0); + /* FALLTHROUGH */ + } + } - if ((bp->bio_flags & BIO_ORDERED) != 0 - || (softc->flags & DA_FLAG_NEED_OTAG) != 0) { - softc->flags &= ~DA_FLAG_NEED_OTAG; - softc->ordered_tag_count++; - tag_code = MSG_ORDERED_Q_TAG; - } else { - tag_code = MSG_SIMPLE_Q_TAG; - } - switch (bp->bio_cmd) { - case BIO_READ: - case BIO_WRITE: - scsi_read_write(&start_ccb->csio, - /*retries*/da_retry_count, - /*cbfcnp*/dadone, - /*tag_action*/tag_code, - /*read_op*/bp->bio_cmd - == BIO_READ, - /*byte2*/0, - softc->minimum_cmd_size, - /*lba*/bp->bio_pblkno, - /*block_count*/bp->bio_bcount / - softc->params.secsize, - /*data_ptr*/ bp->bio_data, - /*dxfer_len*/ bp->bio_bcount, - /*sense_len*/SSD_FULL_SIZE, - da_default_timeout * 1000); - break; - case BIO_FLUSH: - /* - * BIO_FLUSH doesn't currently communicate - * range data, so we synchronize the cache - * over the whole disk. We also force - * ordered tag semantics the flush applies - * to all previously queued I/O. - */ - scsi_synchronize_cache(&start_ccb->csio, - /*retries*/1, - /*cbfcnp*/dadone, - MSG_ORDERED_Q_TAG, - /*begin_lba*/0, - /*lb_count*/0, - SSD_FULL_SIZE, - da_default_timeout*1000); - break; - } - start_ccb->ccb_h.ccb_state = DA_CCB_BUFFER_IO; + /* Run regular command. */ + bp = bioq_takefirst(&softc->bio_queue); + if (bp == NULL) { + xpt_release_ccb(start_ccb); + break; + } + + if ((bp->bio_flags & BIO_ORDERED) != 0 || + (softc->flags & DA_FLAG_NEED_OTAG) != 0) { + softc->flags &= ~DA_FLAG_NEED_OTAG; + softc->ordered_tag_count++; + tag_code = MSG_ORDERED_Q_TAG; + } else { + tag_code = MSG_SIMPLE_Q_TAG; + } + switch (bp->bio_cmd) { + case BIO_READ: + case BIO_WRITE: + scsi_read_write(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/tag_code, + /*read_op*/bp->bio_cmd + == BIO_READ, + /*byte2*/0, + softc->minimum_cmd_size, + /*lba*/bp->bio_pblkno, + /*block_count*/bp->bio_bcount / + softc->params.secsize, + /*data_ptr*/ bp->bio_data, + /*dxfer_len*/ bp->bio_bcount, + /*sense_len*/SSD_FULL_SIZE, + da_default_timeout * 1000); + break; + case BIO_FLUSH: /* - * Block out any asyncronous callbacks - * while we touch the pending ccb list. + * BIO_FLUSH doesn't currently communicate + * range data, so we synchronize the cache + * over the whole disk. We also force + * ordered tag semantics the flush applies + * to all previously queued I/O. */ - LIST_INSERT_HEAD(&softc->pending_ccbs, - &start_ccb->ccb_h, periph_links.le); - softc->outstanding_cmds++; - - /* We expect a unit attention from this device */ - if ((softc->flags & DA_FLAG_RETRY_UA) != 0) { - start_ccb->ccb_h.ccb_state |= DA_CCB_RETRY_UA; - softc->flags &= ~DA_FLAG_RETRY_UA; - } - - start_ccb->ccb_h.ccb_bp = bp; - bp = bioq_first(&softc->bio_queue); - - xpt_action(start_ccb); + scsi_synchronize_cache(&start_ccb->csio, + /*retries*/1, + /*cbfcnp*/dadone, + MSG_ORDERED_Q_TAG, + /*begin_lba*/0, + /*lb_count*/0, + SSD_FULL_SIZE, + da_default_timeout*1000); + break; } - - if (bp != NULL) { - /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + start_ccb->ccb_h.ccb_state = DA_CCB_BUFFER_IO; + +out: + /* + * Block out any asyncronous callbacks + * while we touch the pending ccb list. + */ + LIST_INSERT_HEAD(&softc->pending_ccbs, + &start_ccb->ccb_h, periph_links.le); + softc->outstanding_cmds++; + + /* We expect a unit attention from this device */ + if ((softc->flags & DA_FLAG_RETRY_UA) != 0) { + start_ccb->ccb_h.ccb_state |= DA_CCB_RETRY_UA; + softc->flags &= ~DA_FLAG_RETRY_UA; } + + start_ccb->ccb_h.ccb_bp = bp; + xpt_action(start_ccb); + + /* May have more work to do, so ensure we stay scheduled */ + daschedule(periph); break; } case DA_STATE_PROBE: @@ -1757,9 +1944,42 @@ cmd6workaround(union ccb *ccb) struct scsi_rw_10 *cmd10; struct da_softc *softc; u_int8_t *cdb; + struct bio *bp; int frozen; cdb = ccb->csio.cdb_io.cdb_bytes; + softc = (struct da_softc *)xpt_path_periph(ccb->ccb_h.path)->softc; + + if (ccb->ccb_h.ccb_state == DA_CCB_DELETE) { + if (softc->delete_method == DA_DELETE_UNMAP) { + xpt_print(ccb->ccb_h.path, "UNMAP is not supported, " + "switching to WRITE SAME(16) with UNMAP.\n"); + softc->delete_method = DA_DELETE_WS16; + } else if (softc->delete_method == DA_DELETE_WS16) { + xpt_print(ccb->ccb_h.path, + "WRITE SAME(16) with UNMAP is not supported, " + "disabling BIO_DELETE.\n"); + softc->delete_method = DA_DELETE_DISABLE; + } else if (softc->delete_method == DA_DELETE_WS10) { + xpt_print(ccb->ccb_h.path, + "WRITE SAME(10) with UNMAP is not supported, " + "disabling BIO_DELETE.\n"); + softc->delete_method = DA_DELETE_DISABLE; + } else if (softc->delete_method == DA_DELETE_ZERO) { + xpt_print(ccb->ccb_h.path, + "WRITE SAME(10) is not supported, " + "disabling BIO_DELETE.\n"); + softc->delete_method = DA_DELETE_DISABLE; + } else + softc->delete_method = DA_DELETE_DISABLE; + while ((bp = bioq_takefirst(&softc->delete_run_queue)) + != NULL) + bioq_disksort(&softc->delete_queue, bp); + bioq_insert_tail(&softc->delete_queue, + (struct bio *)ccb->ccb_h.ccb_bp); + ccb->ccb_h.ccb_bp = NULL; + return (0); + } /* Translation only possible if CDB is an array and cmd is R/W6 */ if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0 || @@ -1768,8 +1988,7 @@ cmd6workaround(union ccb *ccb) xpt_print(ccb->ccb_h.path, "READ(6)/WRITE(6) not supported, " "increasing minimum_cmd_size to 10.\n"); - softc = (struct da_softc *)xpt_path_periph(ccb->ccb_h.path)->softc; - softc->minimum_cmd_size = 10; + softc->minimum_cmd_size = 10; bcopy(cdb, &cmd6, sizeof(struct scsi_rw_6)); cmd10 = (struct scsi_rw_10 *)cdb; @@ -1810,8 +2029,9 @@ dadone(struct cam_periph *periph, union csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) { case DA_CCB_BUFFER_IO: + case DA_CCB_DELETE: { - struct bio *bp; + struct bio *bp, *bp1; bp = (struct bio *)done_ccb->ccb_h.ccb_bp; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -1831,6 +2051,7 @@ dadone(struct cam_periph *periph, union */ return; } + bp = (struct bio *)done_ccb->ccb_h.ccb_bp; if (error != 0) { int queued_error; @@ -1858,10 +2079,12 @@ dadone(struct cam_periph *periph, union } bioq_flush(&softc->bio_queue, NULL, queued_error); - bp->bio_error = error; - bp->bio_resid = bp->bio_bcount; - bp->bio_flags |= BIO_ERROR; - } else { + if (bp != NULL) { + bp->bio_error = error; + bp->bio_resid = bp->bio_bcount; + bp->bio_flags |= BIO_ERROR; + } + } else if (bp != NULL) { bp->bio_resid = csio->resid; bp->bio_error = 0; if (bp->bio_resid != 0) @@ -1873,7 +2096,7 @@ dadone(struct cam_periph *periph, union /*reduction*/0, /*timeout*/0, /*getcount_only*/0); - } else { + } else if (bp != NULL) { if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) panic("REQ_CMP with QFRZN"); bp->bio_resid = csio->resid; @@ -1902,7 +2125,22 @@ dadone(struct cam_periph *periph, union softc->outstanding_cmds); } - biodone(bp); + if ((csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) == + DA_CCB_DELETE) { + while ((bp1 = bioq_takefirst(&softc->delete_run_queue)) + != NULL) { + bp1->bio_resid = bp->bio_resid; + bp1->bio_error = bp->bio_error; + if (bp->bio_flags & BIO_ERROR) + bp1->bio_flags |= BIO_ERROR; + biodone(bp1); + } + softc->delete_running = 0; + if (bp != NULL) + biodone(bp); + daschedule(periph); + } else if (bp != NULL) + biodone(bp); break; } case DA_CCB_PROBE: @@ -1972,10 +2210,9 @@ dadone(struct cam_periph *periph, union } else { dasetgeom(periph, block_size, maxsector, lbppbe, lalba & SRC16_LALBA); - if (lalba & SRC16_LBPME) - softc->flags |= DA_FLAG_CAN_LBPME; - else - softc->flags &= ~DA_FLAG_CAN_LBPME; + if ((lalba & SRC16_LBPME) && + softc->delete_method == DA_DELETE_NONE) + softc->delete_method = DA_DELETE_UNMAP; dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " @@ -2362,10 +2599,9 @@ done: } else { dasetgeom(periph, block_len, maxsector, lbppbe, lalba & SRC16_LALBA); - if (lalba & SRC16_LBPME) - softc->flags |= DA_FLAG_CAN_LBPME; - else - softc->flags &= ~DA_FLAG_CAN_LBPME; + if ((lalba & SRC16_LBPME) && + softc->delete_method == DA_DELETE_NONE) + softc->delete_method = DA_DELETE_UNMAP; } } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 09:50:42 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E11B0878; Thu, 6 Jun 2013 09:50:42 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D204E1479; Thu, 6 Jun 2013 09:50:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r569ogdM086238; Thu, 6 Jun 2013 09:50:42 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r569og78086237; Thu, 6 Jun 2013 09:50:42 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306060950.r569og78086237@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 09:50:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251458 - stable/8/sys/cam/scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 09:50:43 -0000 Author: smh Date: Thu Jun 6 09:50:42 2013 New Revision: 251458 URL: http://svnweb.freebsd.org/changeset/base/251458 Log: MFC r245251: Remove essentially unused variables from scsi_da probe setups Modified: stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Thu Jun 6 09:45:22 2013 (r251457) +++ stable/8/sys/cam/scsi/scsi_da.c Thu Jun 6 09:50:42 2013 (r251458) @@ -1883,7 +1883,6 @@ out: } case DA_STATE_PROBE: { - struct ccb_scsiio *csio; struct scsi_read_capacity_data *rcap; rcap = (struct scsi_read_capacity_data *) @@ -1893,8 +1892,7 @@ out: /* da_free_periph??? */ break; } - csio = &start_ccb->csio; - scsi_read_capacity(csio, + scsi_read_capacity(&start_ccb->csio, /*retries*/4, dadone, MSG_SIMPLE_Q_TAG, @@ -1908,7 +1906,6 @@ out: } case DA_STATE_PROBE2: { - struct ccb_scsiio *csio; struct scsi_read_capacity_data_long *rcaplong; rcaplong = (struct scsi_read_capacity_data_long *) @@ -1918,8 +1915,7 @@ out: /* da_free_periph??? */ break; } - csio = &start_ccb->csio; - scsi_read_capacity_16(csio, + scsi_read_capacity_16(&start_ccb->csio, /*retries*/ 4, /*cbfcnp*/ dadone, /*tag_action*/ MSG_SIMPLE_Q_TAG, From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 09:55:01 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 182E6A16; Thu, 6 Jun 2013 09:55:01 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A09915C2; Thu, 6 Jun 2013 09:55:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r569t03o086914; Thu, 6 Jun 2013 09:55:00 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r569t0Nq086913; Thu, 6 Jun 2013 09:55:00 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306060955.r569t0Nq086913@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 09:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251459 - stable/8/sys/cam/scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 09:55:01 -0000 Author: smh Date: Thu Jun 6 09:55:00 2013 New Revision: 251459 URL: http://svnweb.freebsd.org/changeset/base/251459 Log: MFC r245252: Always maintain disk d_flags MFC r249929: Removed unneeded tests in dadeletemethodset Modified: stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Thu Jun 6 09:50:42 2013 (r251458) +++ stable/8/sys/cam/scsi/scsi_da.c Thu Jun 6 09:55:00 2013 (r251459) @@ -856,6 +856,8 @@ static void daasync(void *callback_arg, static void dasysctlinit(void *context, int pending); static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS); static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); +static void dadeletemethodset(struct da_softc *softc, + da_delete_methods delete_method); static periph_ctor_t daregister; static periph_dtor_t dacleanup; static periph_start_t dastart; @@ -1420,7 +1422,7 @@ dasysctlinit(void *context, int pending) */ SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "delete_method", CTLTYPE_STRING | CTLFLAG_RW, - &softc->delete_method, 0, dadeletemethodsysctl, "A", + softc, 0, dadeletemethodsysctl, "A", "BIO_DELETE execution method"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, @@ -1486,15 +1488,30 @@ dacmdsizesysctl(SYSCTL_HANDLER_ARGS) return (0); } +static void +dadeletemethodset(struct da_softc *softc, da_delete_methods delete_method) +{ + + + softc->delete_method = delete_method; + + if (softc->delete_method > DA_DELETE_DISABLE) + softc->disk->d_flags |= DISKFLAG_CANDELETE; + else + softc->disk->d_flags &= ~DISKFLAG_CANDELETE; +} + static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) { char buf[16]; - int error; const char *p; - int i, value; + struct da_softc *softc; + int i, error, value; - value = *(int *)arg1; + softc = (struct da_softc *)arg1; + + value = softc->delete_method; if (value < 0 || value > DA_DELETE_MAX) p = "UNKNOWN"; else @@ -1506,7 +1523,7 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS for (i = 0; i <= DA_DELETE_MAX; i++) { if (strcmp(buf, da_delete_method_names[i]) != 0) continue; - *(int *)arg1 = i; + dadeletemethodset(softc, i); return (0); } return (EINVAL); @@ -1950,24 +1967,24 @@ cmd6workaround(union ccb *ccb) if (softc->delete_method == DA_DELETE_UNMAP) { xpt_print(ccb->ccb_h.path, "UNMAP is not supported, " "switching to WRITE SAME(16) with UNMAP.\n"); - softc->delete_method = DA_DELETE_WS16; + dadeletemethodset(softc, DA_DELETE_WS16); } else if (softc->delete_method == DA_DELETE_WS16) { xpt_print(ccb->ccb_h.path, "WRITE SAME(16) with UNMAP is not supported, " "disabling BIO_DELETE.\n"); - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); } else if (softc->delete_method == DA_DELETE_WS10) { xpt_print(ccb->ccb_h.path, "WRITE SAME(10) with UNMAP is not supported, " "disabling BIO_DELETE.\n"); - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); } else if (softc->delete_method == DA_DELETE_ZERO) { xpt_print(ccb->ccb_h.path, "WRITE SAME(10) is not supported, " "disabling BIO_DELETE.\n"); - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); } else - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); while ((bp = bioq_takefirst(&softc->delete_run_queue)) != NULL) bioq_disksort(&softc->delete_queue, bp); @@ -2208,7 +2225,7 @@ dadone(struct cam_periph *periph, union lbppbe, lalba & SRC16_LALBA); if ((lalba & SRC16_LBPME) && softc->delete_method == DA_DELETE_NONE) - softc->delete_method = DA_DELETE_UNMAP; + dadeletemethodset(softc, DA_DELETE_UNMAP); dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 09:58:24 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 448B9D7F; Thu, 6 Jun 2013 09:58:24 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 368971617; Thu, 6 Jun 2013 09:58:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r569wOak087564; Thu, 6 Jun 2013 09:58:24 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r569wOUr087563; Thu, 6 Jun 2013 09:58:24 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306060958.r569wOUr087563@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 09:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251460 - stable/8/sys/cam/scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 09:58:24 -0000 Author: smh Date: Thu Jun 6 09:58:23 2013 New Revision: 251460 URL: http://svnweb.freebsd.org/changeset/base/251460 Log: MFC r245253: Use sysctl tuneable values for scsi_da and retry_count Modified: stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Thu Jun 6 09:55:00 2013 (r251459) +++ stable/8/sys/cam/scsi/scsi_da.c Thu Jun 6 09:58:23 2013 (r251460) @@ -1910,7 +1910,7 @@ out: break; } scsi_read_capacity(&start_ccb->csio, - /*retries*/4, + /*retries*/da_retry_count, dadone, MSG_SIMPLE_Q_TAG, rcap, @@ -1933,7 +1933,7 @@ out: break; } scsi_read_capacity_16(&start_ccb->csio, - /*retries*/ 4, + /*retries*/ da_retry_count, /*cbfcnp*/ dadone, /*tag_action*/ MSG_SIMPLE_Q_TAG, /*lba*/ 0, @@ -1941,7 +1941,7 @@ out: /*pmi*/ 0, rcaplong, /*sense_len*/ SSD_FULL_SIZE, - /*timeout*/ 60000); + /*timeout*/ da_default_timeout * 1000); start_ccb->ccb_h.ccb_bp = NULL; start_ccb->ccb_h.ccb_state = DA_CCB_PROBE2; xpt_action(start_ccb); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 10:00:23 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6F56625B; Thu, 6 Jun 2013 10:00:23 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 610191657; Thu, 6 Jun 2013 10:00:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r56A0NT1088228; Thu, 6 Jun 2013 10:00:23 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r56A0Neq088227; Thu, 6 Jun 2013 10:00:23 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306061000.r56A0Neq088227@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 10:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251461 - stable/8/sys/cam/scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 10:00:23 -0000 Author: smh Date: Thu Jun 6 10:00:22 2013 New Revision: 251461 URL: http://svnweb.freebsd.org/changeset/base/251461 Log: MFC r246146: Format CDB output as 2 digit hex correcting the length Modified: stable/8/sys/cam/scsi/scsi_all.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.c Thu Jun 6 09:58:23 2013 (r251460) +++ stable/8/sys/cam/scsi/scsi_all.c Thu Jun 6 10:00:22 2013 (r251461) @@ -3112,7 +3112,7 @@ scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string = '\0'; for (i = 0; i < cdb_len; i++) snprintf(cdb_string + strlen(cdb_string), - len - strlen(cdb_string), "%x ", cdb_ptr[i]); + len - strlen(cdb_string), "%02hhx ", cdb_ptr[i]); return(cdb_string); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 10:06:33 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8230A4EA; Thu, 6 Jun 2013 10:06:33 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7217516A8; Thu, 6 Jun 2013 10:06:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r56A6X8V090904; Thu, 6 Jun 2013 10:06:33 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r56A6WcB090896; Thu, 6 Jun 2013 10:06:32 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306061006.r56A6WcB090896@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 10:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251462 - in stable/8/sys/cam: . ata scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 10:06:33 -0000 Author: smh Date: Thu Jun 6 10:06:32 2013 New Revision: 251462 URL: http://svnweb.freebsd.org/changeset/base/251462 Log: MFC r248922: Adds the ability to enable / disable sorting of BIO requests Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/cam.c stable/8/sys/cam/cam.h stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Thu Jun 6 10:00:22 2013 (r251461) +++ stable/8/sys/cam/ata/ata_da.c Thu Jun 6 10:06:32 2013 (r251462) @@ -130,6 +130,7 @@ struct ada_softc { ada_state state; ada_flags flags; ada_quirks quirks; + int sort_io_queue; int ordered_tag_count; int outstanding_cmds; int trim_max_ranges; @@ -443,6 +444,8 @@ static void adashutdown(void *arg, int softc->read_ahead : ada_read_ahead) #define ADA_WC (softc->write_cache >= 0 ? \ softc->write_cache : ada_write_cache) +#define ADA_SIO (softc->sort_io_queue >= 0 ? \ + softc->sort_io_queue : cam_sort_io_queues) /* * Most platforms map firmware geometry to actual, but some don't. If @@ -660,10 +663,17 @@ adastrategy(struct bio *bp) * Place it in the queue of disk activities for this disk */ if (bp->bio_cmd == BIO_DELETE && - (softc->flags & ADA_FLAG_CAN_TRIM)) - bioq_disksort(&softc->trim_queue, bp); - else - bioq_disksort(&softc->bio_queue, bp); + (softc->flags & ADA_FLAG_CAN_TRIM)) { + if (ADA_SIO) + bioq_disksort(&softc->trim_queue, bp); + else + bioq_insert_tail(&softc->trim_queue, bp); + } else { + if (ADA_SIO) + bioq_disksort(&softc->bio_queue, bp); + else + bioq_insert_tail(&softc->bio_queue, bp); + } /* * Schedule ourselves for performing the work. @@ -967,6 +977,10 @@ adasysctlinit(void *context, int pending SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "write_cache", CTLFLAG_RW | CTLFLAG_MPSAFE, &softc->write_cache, 0, "Enable disk write cache."); + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "sort_io_queue", CTLFLAG_RW | CTLFLAG_MPSAFE, + &softc->sort_io_queue, 0, + "Sort IO queue to try and optimise disk access patterns"); #ifdef ADA_TEST_FAILURE /* * Add a 'door bell' sysctl which allows one to set it from userland @@ -1088,6 +1102,7 @@ adaregister(struct cam_periph *periph, v snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.write_cache", periph->unit_number); TUNABLE_INT_FETCH(announce_buf, &softc->write_cache); + softc->sort_io_queue = -1; adagetparams(periph, cgd); softc->disk = disk_alloc(); softc->disk->d_devstat = devstat_new_entry(periph->periph_name, Modified: stable/8/sys/cam/cam.c ============================================================================== --- stable/8/sys/cam/cam.c Thu Jun 6 10:00:22 2013 (r251461) +++ stable/8/sys/cam/cam.c Thu Jun 6 10:06:32 2013 (r251462) @@ -103,6 +103,15 @@ const int num_cam_status_entries = #ifdef _KERNEL SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLAG_RD, 0, "CAM Subsystem"); + +#ifndef CAM_DEFAULT_SORT_IO_QUEUES +#define CAM_DEFAULT_SORT_IO_QUEUES 1 +#endif + +int cam_sort_io_queues = CAM_DEFAULT_SORT_IO_QUEUES; +TUNABLE_INT("kern.cam.sort_io_queues", &cam_sort_io_queues); +SYSCTL_INT(_kern_cam, OID_AUTO, sort_io_queues, CTLFLAG_RWTUN, + &cam_sort_io_queues, 0, "Sort IO queues to try and optimise disk access patterns"); #endif void Modified: stable/8/sys/cam/cam.h ============================================================================== --- stable/8/sys/cam/cam.h Thu Jun 6 10:00:22 2013 (r251461) +++ stable/8/sys/cam/cam.h Thu Jun 6 10:06:32 2013 (r251462) @@ -212,6 +212,9 @@ struct cam_status_entry extern const struct cam_status_entry cam_status_table[]; extern const int num_cam_status_entries; +#ifdef _KERNEL +extern int cam_sort_io_queues; +#endif union ccb; #ifdef SYSCTL_DECL /* from sysctl.h */ Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Thu Jun 6 10:00:22 2013 (r251461) +++ stable/8/sys/cam/scsi/scsi_da.c Thu Jun 6 10:06:32 2013 (r251462) @@ -141,6 +141,7 @@ struct da_softc { da_state state; da_flags flags; da_quirks quirks; + int sort_io_queue; int minimum_cmd_size; int error_inject; int ordered_tag_count; @@ -885,6 +886,8 @@ static void dashutdown(void *arg, int h #define DA_DEFAULT_SEND_ORDERED 1 #endif +#define DA_SIO (softc->sort_io_queue >= 0 ? \ + softc->sort_io_queue : cam_sort_io_queues) static int da_retry_count = DA_DEFAULT_RETRY; static int da_default_timeout = DA_DEFAULT_TIMEOUT; @@ -1137,10 +1140,15 @@ dastrategy(struct bio *bp) if (bp->bio_cmd == BIO_DELETE) { if (bp->bio_bcount == 0) biodone(bp); - else + else if (DA_SIO) bioq_disksort(&softc->delete_queue, bp); - } else + else + bioq_insert_tail(&softc->delete_queue, bp); + } else if (DA_SIO) { bioq_disksort(&softc->bio_queue, bp); + } else { + bioq_insert_tail(&softc->bio_queue, bp); + } /* * Schedule ourselves for performing the work. @@ -1428,6 +1436,9 @@ dasysctlinit(void *context, int pending) OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "sort_io_queue", CTLFLAG_RW, &softc->sort_io_queue, 0, + "Sort IO queue to try and optimise disk access patterns"); /* * Add some addressing info. @@ -1567,6 +1578,7 @@ daregister(struct cam_periph *periph, vo softc->flags |= DA_FLAG_PACK_REMOVABLE; softc->unmap_max_ranges = UNMAP_MAX_RANGES; softc->unmap_max_lba = 1024*1024*2; + softc->sort_io_queue = -1; periph->softc = softc; @@ -1985,9 +1997,16 @@ cmd6workaround(union ccb *ccb) dadeletemethodset(softc, DA_DELETE_DISABLE); } else dadeletemethodset(softc, DA_DELETE_DISABLE); - while ((bp = bioq_takefirst(&softc->delete_run_queue)) - != NULL) - bioq_disksort(&softc->delete_queue, bp); + + if (DA_SIO) { + while ((bp = bioq_takefirst(&softc->delete_run_queue)) + != NULL) + bioq_disksort(&softc->delete_queue, bp); + } else { + while ((bp = bioq_takefirst(&softc->delete_run_queue)) + != NULL) + bioq_insert_tail(&softc->delete_queue, bp); + } bioq_insert_tail(&softc->delete_queue, (struct bio *)ccb->ccb_h.ccb_bp); ccb->ccb_h.ccb_bp = NULL; From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 10:09:21 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3457777C; Thu, 6 Jun 2013 10:09:21 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1640816D0; Thu, 6 Jun 2013 10:09:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r56A9KKu091497; Thu, 6 Jun 2013 10:09:20 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r56A9KqQ091495; Thu, 6 Jun 2013 10:09:20 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306061009.r56A9KqQ091495@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 10:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251463 - stable/8/sys/cam/scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 10:09:21 -0000 Author: smh Date: Thu Jun 6 10:09:20 2013 New Revision: 251463 URL: http://svnweb.freebsd.org/changeset/base/251463 Log: MFC r248992: Added ATA Pass-Through support to CAM Modified: stable/8/sys/cam/scsi/scsi_all.c stable/8/sys/cam/scsi/scsi_all.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.c Thu Jun 6 10:06:32 2013 (r251462) +++ stable/8/sys/cam/scsi/scsi_all.c Thu Jun 6 10:09:20 2013 (r251463) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifndef _KERNEL #include @@ -4390,6 +4391,50 @@ scsi_write_same(struct ccb_scsiio *csio, } void +scsi_ata_pass_16(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int32_t flags, u_int8_t tag_action, + u_int8_t protocol, u_int8_t ata_flags, u_int16_t features, + u_int16_t sector_count, uint64_t lba, u_int8_t command, + u_int8_t control, u_int8_t *data_ptr, u_int16_t dxfer_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct ata_pass_16 *ata_cmd; + + ata_cmd = (struct ata_pass_16 *)&csio->cdb_io.cdb_bytes; + ata_cmd->opcode = ATA_PASS_16; + ata_cmd->protocol = protocol; + ata_cmd->flags = ata_flags; + ata_cmd->features_ext = features >> 8; + ata_cmd->features = features; + ata_cmd->sector_count_ext = sector_count >> 8; + ata_cmd->sector_count = sector_count; + ata_cmd->lba_low = lba; + ata_cmd->lba_mid = lba >> 8; + ata_cmd->lba_high = lba >> 16; + ata_cmd->device = ATA_DEV_LBA; + if (protocol & AP_EXTEND) { + ata_cmd->lba_low_ext = lba >> 24; + ata_cmd->lba_mid_ext = lba >> 32; + ata_cmd->lba_high_ext = lba >> 40; + } else + ata_cmd->device |= (lba >> 24) & 0x0f; + ata_cmd->command = command; + ata_cmd->control = control; + + cam_fill_csio(csio, + retries, + cbfcnp, + flags, + tag_action, + data_ptr, + dxfer_len, + sense_len, + sizeof(*ata_cmd), + timeout); +} + +void scsi_unmap(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t byte2, Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Thu Jun 6 10:06:32 2013 (r251462) +++ stable/8/sys/cam/scsi/scsi_all.h Thu Jun 6 10:09:20 2013 (r251463) @@ -562,6 +562,19 @@ struct scsi_start_stop_unit struct ata_pass_12 { u_int8_t opcode; u_int8_t protocol; +#define AP_PROTO_HARD_RESET (0x00 << 1) +#define AP_PROTO_SRST (0x01 << 1) +#define AP_PROTO_NON_DATA (0x03 << 1) +#define AP_PROTO_PIO_IN (0x04 << 1) +#define AP_PROTO_PIO_OUT (0x05 << 1) +#define AP_PROTO_DMA (0x06 << 1) +#define AP_PROTO_DMA_QUEUED (0x07 << 1) +#define AP_PROTO_DEVICE_DIAG (0x08 << 1) +#define AP_PROTO_DEVICE_RESET (0x09 << 1) +#define AP_PROTO_UDMA_IN (0x10 << 1) +#define AP_PROTO_UDMA_OUT (0x11 << 1) +#define AP_PROTO_FPDMA (0x12 << 1) +#define AP_PROTO_RESP_INFO (0x15 << 1) #define AP_MULTI 0xe0 u_int8_t flags; #define AP_T_LEN 0x03 @@ -585,6 +598,15 @@ struct ata_pass_16 { u_int8_t protocol; #define AP_EXTEND 0x01 u_int8_t flags; +#define AP_FLAG_TLEN_NO_DATA (0 << 0) +#define AP_FLAG_TLEN_FEAT (1 << 0) +#define AP_FLAG_TLEN_SECT_CNT (2 << 0) +#define AP_FLAG_TLEN_STPSIU (3 << 0) +#define AP_FLAG_BYT_BLOK_BYTES (0 << 2) +#define AP_FLAG_BYT_BLOK_BLOCKS (1 << 2) +#define AP_FLAG_TDIR_TO_DEV (0 << 3) +#define AP_FLAG_TDIR_FROM_DEV (1 << 3) +#define AP_FLAG_CHK_COND (1 << 5) u_int8_t features_ext; u_int8_t features; u_int8_t sector_count_ext; @@ -697,7 +719,7 @@ struct ata_pass_16 { /* * This length is the initial inquiry length used by the probe code, as - * well as the legnth necessary for scsi_print_inquiry() to function + * well as the length necessary for scsi_print_inquiry() to function * correctly. If either use requires a different length in the future, * the two values should be de-coupled. */ @@ -1333,6 +1355,14 @@ void scsi_write_same(struct ccb_scsiio * u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_ata_pass_16(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int32_t flags, u_int8_t tag_action, + u_int8_t protocol, u_int8_t ata_flags, u_int16_t features, + u_int16_t sector_count, uint64_t lba, u_int8_t command, + u_int8_t control, u_int8_t *data_ptr, u_int16_t dxfer_len, + u_int8_t sense_len, u_int32_t timeout); + void scsi_unmap(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t byte2, From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 10:25:58 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DEA18C8; Thu, 6 Jun 2013 10:25:58 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B66701793; Thu, 6 Jun 2013 10:25:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r56APwUp097886; Thu, 6 Jun 2013 10:25:58 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r56APwA6097885; Thu, 6 Jun 2013 10:25:58 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306061025.r56APwA6097885@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 10:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251464 - stable/8/sys/geom X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 10:25:59 -0000 Author: smh Date: Thu Jun 6 10:25:58 2013 New Revision: 251464 URL: http://svnweb.freebsd.org/changeset/base/251464 Log: MFC r249930: Added a sysctl to control the maximum size of a delete request Modified: stable/8/sys/geom/geom_dev.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/geom_dev.c ============================================================================== --- stable/8/sys/geom/geom_dev.c Thu Jun 6 10:09:20 2013 (r251463) +++ stable/8/sys/geom/geom_dev.c Thu Jun 6 10:25:58 2013 (r251464) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -80,6 +81,19 @@ static struct g_class g_dev_class = { .orphan = g_dev_orphan, }; +/* + * We target 262144 (8 x 32768) sectors by default as this significantly + * increases the throughput on commonly used SSD's with a marginal + * increase in non-interruptible request latency. + */ +static uint64_t g_dev_del_max_sectors = 262144; +SYSCTL_DECL(_kern_geom); +SYSCTL_NODE(_kern_geom, OID_AUTO, dev, CTLFLAG_RW, 0, "GEOM_DEV stuff"); +SYSCTL_QUAD(_kern_geom_dev, OID_AUTO, delete_max_sectors, CTLFLAG_RW, + &g_dev_del_max_sectors, 0, "Maximum number of sectors in a single " + "delete request sent to the provider. Larger requests are chunked " + "so they can be interrupted. (0 = disable chunking)"); + void g_dev_print(void) { @@ -326,17 +340,20 @@ g_dev_ioctl(struct cdev *dev, u_long cmd } while (length > 0) { chunk = length; - if (chunk > 65536 * cp->provider->sectorsize) - chunk = 65536 * cp->provider->sectorsize; + if (g_dev_del_max_sectors != 0 && chunk > + g_dev_del_max_sectors * cp->provider->sectorsize) { + chunk = g_dev_del_max_sectors * + cp->provider->sectorsize; + } error = g_delete_data(cp, offset, chunk); length -= chunk; offset += chunk; if (error) break; /* - * Since the request size is unbounded, the service - * time is likewise. We make this ioctl interruptible - * by checking for signals for each bio. + * Since the request size can be large, the service + * time can be is likewise. We make this ioctl + * interruptible by checking for signals for each bio. */ if (SIGPENDING(td)) break; From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 10:27:34 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EB24B354; Thu, 6 Jun 2013 10:27:34 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD5F917A9; Thu, 6 Jun 2013 10:27:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r56ARY3A098236; Thu, 6 Jun 2013 10:27:34 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r56ARYrd098235; Thu, 6 Jun 2013 10:27:34 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306061027.r56ARYrd098235@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 10:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251465 - stable/8/sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 10:27:35 -0000 Author: smh Date: Thu Jun 6 10:27:34 2013 New Revision: 251465 URL: http://svnweb.freebsd.org/changeset/base/251465 Log: MFC r249931: Added Dataset Management defines to be used by TRIM Modified: stable/8/sys/sys/ata.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/sys/ata.h ============================================================================== --- stable/8/sys/sys/ata.h Thu Jun 6 10:25:58 2013 (r251464) +++ stable/8/sys/sys/ata.h Thu Jun 6 10:27:34 2013 (r251465) @@ -261,6 +261,12 @@ struct ata_params { /*255*/ u_int16_t integrity; } __packed; +/* ATA Dataset Management */ +#define ATA_DSM_BLK_SIZE 512 +#define ATA_DSM_BLK_RANGES 64 +#define ATA_DSM_RANGE_SIZE 8 +#define ATA_DSM_RANGE_MAX 65535 + /* * ATA Device Register * From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 11:41:23 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F009EA5D; Thu, 6 Jun 2013 11:41:22 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D226B1B15; Thu, 6 Jun 2013 11:41:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r56BfMUC022596; Thu, 6 Jun 2013 11:41:22 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r56BfMAO022593; Thu, 6 Jun 2013 11:41:22 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306061141.r56BfMAO022593@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 11:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251466 - stable/8/sys/cam/scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 11:41:23 -0000 Author: smh Date: Thu Jun 6 11:41:22 2013 New Revision: 251466 URL: http://svnweb.freebsd.org/changeset/base/251466 Log: MFC r249933: Added the ability to send ATA identify and TRIM commands via SCSI Modified: stable/8/sys/cam/scsi/scsi_all.c stable/8/sys/cam/scsi/scsi_all.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.c Thu Jun 6 10:27:34 2013 (r251465) +++ stable/8/sys/cam/scsi/scsi_all.c Thu Jun 6 11:41:22 2013 (r251466) @@ -4391,6 +4391,57 @@ scsi_write_same(struct ccb_scsiio *csio, } void +scsi_ata_identify(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t *data_ptr, + u_int16_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout) +{ + scsi_ata_pass_16(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + /*protocol*/AP_PROTO_PIO_IN, + /*ata_flags*/AP_FLAG_TDIR_FROM_DEV| + AP_FLAG_BYT_BLOK_BYTES|AP_FLAG_TLEN_SECT_CNT, + /*features*/0, + /*sector_count*/dxfer_len, + /*lba*/0, + /*command*/ATA_ATA_IDENTIFY, + /*control*/0, + data_ptr, + dxfer_len, + sense_len, + timeout); +} + +void +scsi_ata_trim(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int16_t block_count, + u_int8_t *data_ptr, u_int16_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout) +{ + scsi_ata_pass_16(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + /*protocol*/AP_EXTEND|AP_PROTO_DMA, + /*ata_flags*/AP_FLAG_TLEN_SECT_CNT|AP_FLAG_BYT_BLOK_BLOCKS, + /*features*/ATA_DSM_TRIM, + /*sector_count*/block_count, + /*lba*/0, + /*command*/ATA_DATA_SET_MANAGEMENT, + /*control*/0, + data_ptr, + dxfer_len, + sense_len, + timeout); +} + +void scsi_ata_pass_16(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int32_t flags, u_int8_t tag_action, Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Thu Jun 6 10:27:34 2013 (r251465) +++ stable/8/sys/cam/scsi/scsi_all.h Thu Jun 6 11:41:22 2013 (r251466) @@ -875,6 +875,61 @@ struct scsi_vpd_unit_serial_number u_int8_t serial_num[SVPD_SERIAL_NUM_SIZE]; }; +/* + * Logical Block Provisioning VPD Page based on + * T10/1799-D Revision 31 + */ +struct scsi_vpd_logical_block_prov +{ + u_int8_t device; + u_int8_t page_code; +#define SVPD_LBP 0xB2 + u_int8_t page_length[2]; +#define SVPD_LBP_PL_BASIC 0x04 + u_int8_t threshold_exponent; + u_int8_t flags; +#define SVPD_LBP_UNMAP 0x80 +#define SVPD_LBP_WS16 0x40 +#define SVPD_LBP_WS10 0x20 +#define SVPD_LBP_RZ 0x04 +#define SVPD_LBP_ANC_SUP 0x02 +#define SVPD_LBP_DP 0x01 + u_int8_t prov_type; +#define SVPD_LBP_RESOURCE 0x01 +#define SVPD_LBP_THIN 0x02 + u_int8_t reserved; + /* + * Provisioning Group Descriptor can be here if SVPD_LBP_DP is set + * Its size can be determined from page_length - 4 + */ +}; + +/* + * Block Limits VDP Page based on + * T10/1799-D Revision 31 + */ +struct scsi_vpd_block_limits +{ + u_int8_t device; + u_int8_t page_code; +#define SVPD_BLOCK_LIMITS 0xB0 + u_int8_t page_length[2]; +#define SVPD_BL_PL_BASIC 0x10 +#define SVPD_BL_PL_TP 0x3C + u_int8_t reserved1; + u_int8_t max_cmp_write_len; + u_int8_t opt_txfer_len_grain[2]; + u_int8_t max_txfer_len[4]; + u_int8_t opt_txfer_len[4]; + u_int8_t max_prefetch[4]; + u_int8_t max_unmap_lba_cnt[4]; + u_int8_t max_unmap_blk_cnt[4]; + u_int8_t opt_unmap_grain[4]; + u_int8_t unmap_grain_align[4]; + u_int8_t max_write_same_length[8]; + u_int8_t reserved2[20]; +}; + struct scsi_read_capacity { u_int8_t opcode; @@ -1355,6 +1410,18 @@ void scsi_write_same(struct ccb_scsiio * u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_ata_identify(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t *data_ptr, + u_int16_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout); + +void scsi_ata_trim(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int16_t block_count, + u_int8_t *data_ptr, u_int16_t dxfer_len, + u_int8_t sense_len, u_int32_t timeout); + void scsi_ata_pass_16(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int32_t flags, u_int8_t tag_action, From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 11:47:55 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 311DFE2B; Thu, 6 Jun 2013 11:47:55 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 22F941B4F; Thu, 6 Jun 2013 11:47:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r56Bltu1023570; Thu, 6 Jun 2013 11:47:55 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r56BlshS023569; Thu, 6 Jun 2013 11:47:55 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306061147.r56BlshS023569@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 11:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251467 - stable/8/sys/cam/ata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 11:47:55 -0000 Author: smh Date: Thu Jun 6 11:47:54 2013 New Revision: 251467 URL: http://svnweb.freebsd.org/changeset/base/251467 Log: MFC r249934: Updated TRIM calculations in cam/ata to be based off ATA_DSM_* defines Modified: stable/8/sys/cam/ata/ata_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Thu Jun 6 11:41:22 2013 (r251466) +++ stable/8/sys/cam/ata/ata_da.c Thu Jun 6 11:47:54 2013 (r251467) @@ -117,10 +117,10 @@ struct disk_params { }; #define TRIM_MAX_BLOCKS 8 -#define TRIM_MAX_RANGES (TRIM_MAX_BLOCKS * 64) +#define TRIM_MAX_RANGES (TRIM_MAX_BLOCKS * ATA_DSM_BLK_RANGES) #define TRIM_MAX_BIOS (TRIM_MAX_RANGES * 4) struct trim_request { - uint8_t data[TRIM_MAX_RANGES * 8]; + uint8_t data[TRIM_MAX_RANGES * ATA_DSM_RANGE_SIZE]; struct bio *bps[TRIM_MAX_BIOS]; }; @@ -1056,8 +1056,8 @@ adaregister(struct cam_periph *periph, v softc->trim_max_ranges = TRIM_MAX_RANGES; if (cgd->ident_data.max_dsm_blocks != 0) { softc->trim_max_ranges = - min(cgd->ident_data.max_dsm_blocks * 64, - softc->trim_max_ranges); + min(cgd->ident_data.max_dsm_blocks * + ATA_DSM_BLK_RANGES, softc->trim_max_ranges); } } if (cgd->ident_data.support.command2 & ATA_SUPPORT_CFA) @@ -1131,10 +1131,12 @@ adaregister(struct cam_periph *periph, v softc->disk->d_flags = 0; if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; - if ((softc->flags & ADA_FLAG_CAN_TRIM) || - ((softc->flags & ADA_FLAG_CAN_CFA) && - !(softc->flags & ADA_FLAG_CAN_48BIT))) + if (softc->flags & ADA_FLAG_CAN_TRIM) { softc->disk->d_flags |= DISKFLAG_CANDELETE; + } else if ((softc->flags & ADA_FLAG_CAN_CFA) && + !(softc->flags & ADA_FLAG_CAN_48BIT)) { + softc->disk->d_flags |= DISKFLAG_CANDELETE; + } strlcpy(softc->disk->d_ident, cgd->serial_num, MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1)); @@ -1284,9 +1286,9 @@ adastart(struct cam_periph *periph, unio /* Try to extend the previous range. */ if (lba == lastlba) { - c = min(count, 0xffff - lastcount); + c = min(count, ATA_DSM_RANGE_MAX - lastcount); lastcount += c; - off = (ranges - 1) * 8; + off = (ranges - 1) * ATA_DSM_RANGE_SIZE; req->data[off + 6] = lastcount & 0xff; req->data[off + 7] = (lastcount >> 8) & 0xff; @@ -1295,8 +1297,8 @@ adastart(struct cam_periph *periph, unio } while (count > 0) { - c = min(count, 0xffff); - off = ranges * 8; + c = min(count, ATA_DSM_RANGE_MAX); + off = ranges * ATA_DSM_RANGE_SIZE; req->data[off + 0] = lba & 0xff; req->data[off + 1] = (lba >> 8) & 0xff; req->data[off + 2] = (lba >> 16) & 0xff; @@ -1309,6 +1311,11 @@ adastart(struct cam_periph *periph, unio count -= c; lastcount = c; ranges++; + /* + * Its the caller's responsibility to ensure the + * request will fit so we don't need to check for + * overrun here + */ } lastlba = lba; req->bps[bps++] = bp1; @@ -1316,7 +1323,8 @@ adastart(struct cam_periph *periph, unio if (bps >= TRIM_MAX_BIOS || bp1 == NULL || bp1->bio_bcount / softc->params.secsize > - (softc->trim_max_ranges - ranges) * 0xffff) + (softc->trim_max_ranges - ranges) * + ATA_DSM_RANGE_MAX) break; } while (1); cam_fill_ataio(ataio, @@ -1325,10 +1333,12 @@ adastart(struct cam_periph *periph, unio CAM_DIR_OUT, 0, req->data, - ((ranges + 63) / 64) * 512, + ((ranges + ATA_DSM_BLK_RANGES - 1) / + ATA_DSM_BLK_RANGES) * ATA_DSM_BLK_SIZE, ada_default_timeout * 1000); ata_48bit_cmd(ataio, ATA_DATA_SET_MANAGEMENT, - ATA_DSM_TRIM, 0, (ranges + 63) / 64); + ATA_DSM_TRIM, 0, (ranges + ATA_DSM_BLK_RANGES - + 1) / ATA_DSM_BLK_RANGES); start_ccb->ccb_h.ccb_state = ADA_CCB_TRIM; goto out; } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 6 22:31:54 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0F34E83F; Thu, 6 Jun 2013 22:31:54 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E4F6A1927; Thu, 6 Jun 2013 22:31:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r56MVrkR030605; Thu, 6 Jun 2013 22:31:53 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r56MVqrn030598; Thu, 6 Jun 2013 22:31:52 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306062231.r56MVqrn030598@svn.freebsd.org> From: Steven Hartland Date: Thu, 6 Jun 2013 22:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251477 - in stable/8/sys/cam: . scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jun 2013 22:31:54 -0000 Author: smh Date: Thu Jun 6 22:31:52 2013 New Revision: 251477 URL: http://svnweb.freebsd.org/changeset/base/251477 Log: MFC r216088: Manual partial MFC of only basic VPD support for scsi_xpt MFC r249937: Refactored scsi_xpt use of device_has_vpd Modified: stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/cam_xpt_internal.h stable/8/sys/cam/scsi/scsi_all.c stable/8/sys/cam/scsi/scsi_all.h stable/8/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Thu Jun 6 22:02:03 2013 (r251476) +++ stable/8/sys/cam/cam_xpt.c Thu Jun 6 22:31:52 2013 (r251477) @@ -4497,7 +4497,7 @@ xpt_alloc_device(struct cam_eb *bus, str device = NULL; } else { device = (struct cam_ed *)malloc(sizeof(*device), - M_CAMXPT, M_NOWAIT); + M_CAMXPT, M_NOWAIT|M_ZERO); } if (device != NULL) { @@ -4568,6 +4568,14 @@ xpt_release_device(struct cam_ed *device cam_devq_resize(devq, devq->alloc_queue.array_size - 1); camq_fini(&device->drvq); cam_ccbq_fini(&device->ccbq); + /* + * Free allocated memory. free(9) does nothing if the + * supplied pointer is NULL, so it is safe to call without + * checking. + */ + free(device->supported_vpds, M_CAMXPT); + free(device->serial_num, M_CAMXPT); + xpt_release_target(device->target); free(device, M_CAMXPT); } else Modified: stable/8/sys/cam/cam_xpt_internal.h ============================================================================== --- stable/8/sys/cam/cam_xpt_internal.h Thu Jun 6 22:02:03 2013 (r251476) +++ stable/8/sys/cam/cam_xpt_internal.h Thu Jun 6 22:31:52 2013 (r251477) @@ -93,6 +93,8 @@ struct cam_ed { cam_xport transport; u_int transport_version; struct scsi_inquiry_data inq_data; + uint8_t *supported_vpds; + uint8_t supported_vpds_len; struct ata_params ident_data; u_int8_t inq_flags; /* * Current settings for inquiry flags. Modified: stable/8/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.c Thu Jun 6 22:02:03 2013 (r251476) +++ stable/8/sys/cam/scsi/scsi_all.c Thu Jun 6 22:31:52 2013 (r251477) @@ -38,6 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #else #include @@ -53,7 +56,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifndef _KERNEL + +#ifdef _KERNEL +#include +#include +#include +#include +#else #include #ifndef FALSE @@ -4605,6 +4614,28 @@ scsi_static_inquiry_match(caddr_t inqbuf } #ifdef _KERNEL +int +scsi_vpd_supported_page(struct cam_periph *periph, uint8_t page_id) +{ + struct cam_ed *device; + struct scsi_vpd_supported_pages *vpds; + int i, num_pages; + + device = periph->path->device; + vpds = (struct scsi_vpd_supported_pages *)device->supported_vpds; + + if (vpds != NULL) { + num_pages = device->supported_vpds_len - + SVPD_SUPPORTED_PAGES_HDR_LEN; + for (i = 0; i < num_pages; i++) { + if (vpds->page_list[i] == page_id) + return (1); + } + } + + return (0); +} + static void init_scsi_delay(void) { Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Thu Jun 6 22:02:03 2013 (r251476) +++ stable/8/sys/cam/scsi/scsi_all.h Thu Jun 6 22:31:52 2013 (r251477) @@ -857,13 +857,28 @@ 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 +#define SVPD_SUPPORTED_PAGES_HDR_LEN 4 u_int8_t reserved; u_int8_t length; /* number of VPD entries */ #define SVPD_SUPPORTED_PAGES_SIZE 251 u_int8_t list[SVPD_SUPPORTED_PAGES_SIZE]; }; +/* + * This structure is more suited to target operation, because the + * number of supported pages is left to the user to allocate. + */ +struct scsi_vpd_supported_pages +{ + u_int8_t device; + u_int8_t page_code; + u_int8_t reserved; +#define SVPD_SUPPORTED_PAGES 0x00 + u_int8_t length; + u_int8_t page_list[0]; +}; + struct scsi_vpd_unit_serial_number { u_int8_t device; @@ -1250,6 +1265,8 @@ int scsi_sense_sbuf(struct ccb_scsiio * char * scsi_sense_string(struct ccb_scsiio *csio, char *str, int str_len); void scsi_sense_print(struct ccb_scsiio *csio); +int scsi_vpd_supported_page(struct cam_periph *periph, + uint8_t page_id); #else /* _KERNEL */ int scsi_command_string(struct cam_device *device, struct ccb_scsiio *csio, struct sbuf *sb); Modified: stable/8/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_xpt.c Thu Jun 6 22:02:03 2013 (r251476) +++ stable/8/sys/cam/scsi/scsi_xpt.c Thu Jun 6 22:31:52 2013 (r251477) @@ -134,8 +134,8 @@ typedef enum { PROBE_FULL_INQUIRY, PROBE_REPORT_LUNS, PROBE_MODE_SENSE, - PROBE_SERIAL_NUM_0, - PROBE_SERIAL_NUM_1, + PROBE_SUPPORTED_VPD_LIST, + PROBE_SERIAL_NUM, PROBE_TUR_FOR_NEGOTIATION, PROBE_INQUIRY_BASIC_DV1, PROBE_INQUIRY_BASIC_DV2, @@ -150,8 +150,8 @@ static char *probe_action_text[] = { "PROBE_FULL_INQUIRY", "PROBE_REPORT_LUNS", "PROBE_MODE_SENSE", - "PROBE_SERIAL_NUM_0", - "PROBE_SERIAL_NUM_1", + "PROBE_SUPPORTED_VPD_LIST", + "PROBE_SERIAL_NUM", "PROBE_TUR_FOR_NEGOTIATION", "PROBE_INQUIRY_BASIC_DV1", "PROBE_INQUIRY_BASIC_DV2", @@ -824,7 +824,8 @@ again: if (INQ_DATA_TQ_ENABLED(inq_buf)) PROBE_SET_ACTION(softc, PROBE_MODE_SENSE); else - PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); + PROBE_SET_ACTION(softc, + PROBE_SUPPORTED_VPD_LIST); goto again; } scsi_report_luns(csio, 5, probedone, MSG_SIMPLE_Q_TAG, @@ -857,10 +858,10 @@ again: } xpt_print(periph->path, "Unable to mode sense control page - " "malloc failure\n"); - PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); + PROBE_SET_ACTION(softc, PROBE_SUPPORTED_VPD_LIST); } /* FALLTHROUGH */ - case PROBE_SERIAL_NUM_0: + case PROBE_SUPPORTED_VPD_LIST: { struct scsi_vpd_supported_page_list *vpd_list = NULL; struct cam_ed *device; @@ -892,7 +893,7 @@ again: probedone(periph, start_ccb); return; } - case PROBE_SERIAL_NUM_1: + case PROBE_SERIAL_NUM: { struct scsi_vpd_unit_serial_number *serial_buf; struct cam_ed* device; @@ -905,8 +906,10 @@ again: device->serial_num_len = 0; } - serial_buf = (struct scsi_vpd_unit_serial_number *) - malloc(sizeof(*serial_buf), M_CAMXPT, M_NOWAIT|M_ZERO); + if (scsi_vpd_supported_page(periph, SVPD_UNIT_SERIAL_NUMBER)) + serial_buf = (struct scsi_vpd_unit_serial_number *) + malloc(sizeof(*serial_buf), M_CAMXPT, + M_NOWAIT|M_ZERO); if (serial_buf != NULL) { scsi_inquiry(csio, @@ -1144,7 +1147,7 @@ probedone(struct cam_periph *periph, uni PROBE_MODE_SENSE); else PROBE_SET_ACTION(softc, - PROBE_SERIAL_NUM_0); + PROBE_SUPPORTED_VPD_LIST); if (path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; @@ -1303,7 +1306,8 @@ probedone(struct cam_periph *periph, uni if (INQ_DATA_TQ_ENABLED(inq_buf)) PROBE_SET_ACTION(softc, PROBE_MODE_SENSE); else - PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); + PROBE_SET_ACTION(softc, + PROBE_SUPPORTED_VPD_LIST); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; @@ -1339,36 +1343,40 @@ probedone(struct cam_periph *periph, uni } xpt_release_ccb(done_ccb); free(mode_hdr, M_CAMXPT); - PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); + PROBE_SET_ACTION(softc, PROBE_SUPPORTED_VPD_LIST); xpt_schedule(periph, priority); return; } - case PROBE_SERIAL_NUM_0: + case PROBE_SUPPORTED_VPD_LIST: { struct ccb_scsiio *csio; struct scsi_vpd_supported_page_list *page_list; - int length, serialnum_supported, i; - serialnum_supported = 0; csio = &done_ccb->csio; page_list = (struct scsi_vpd_supported_page_list *)csio->data_ptr; + if (path->device->supported_vpds != NULL) { + free(path->device->supported_vpds, M_CAMXPT); + path->device->supported_vpds = NULL; + path->device->supported_vpds_len = 0; + } + if (page_list == NULL) { /* * Don't process the command as it was never sent */ - } else if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP - && (page_list->length > 0)) { - length = min(page_list->length, - SVPD_SUPPORTED_PAGES_SIZE); - for (i = 0; i < length; i++) { - if (page_list->list[i] == - SVPD_UNIT_SERIAL_NUMBER) { - serialnum_supported = 1; - break; - } - } + } else if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + /* Got vpd list */ + path->device->supported_vpds_len = page_list->length + + SVPD_SUPPORTED_PAGES_HDR_LEN; + path->device->supported_vpds = (uint8_t *)page_list; + + xpt_release_ccb(done_ccb); + PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM); + xpt_schedule(periph, priority); + return; + } else if (cam_periph_error(done_ccb, 0, SF_RETRY_UA|SF_NO_PRINT, &softc->saved_ccb) == ERESTART) { @@ -1382,18 +1390,12 @@ probedone(struct cam_periph *periph, uni if (page_list != NULL) free(page_list, M_CAMXPT); - if (serialnum_supported) { - xpt_release_ccb(done_ccb); - PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_1); - xpt_schedule(periph, priority); - return; - } - + /* No VPDs available, skip to device check. */ csio->data_ptr = NULL; /* FALLTHROUGH */ } - case PROBE_SERIAL_NUM_1: + case PROBE_SERIAL_NUM: { struct ccb_scsiio *csio; struct scsi_vpd_unit_serial_number *serial_buf; @@ -2245,6 +2247,8 @@ scsi_alloc_device(struct cam_eb *bus, st device->queue_flags = 0; device->serial_num = NULL; device->serial_num_len = 0; + device->supported_vpds = NULL; + device->supported_vpds_len = 0; /* * XXX should be limited by number of CCBs this bus can From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 7 09:06:50 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9D094245; Fri, 7 Jun 2013 09:06:50 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F1F8122B; Fri, 7 Jun 2013 09:06:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5796owh031505; Fri, 7 Jun 2013 09:06:50 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5796oAp031504; Fri, 7 Jun 2013 09:06:50 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306070906.r5796oAp031504@svn.freebsd.org> From: Hiroki Sato Date: Fri, 7 Jun 2013 09:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251489 - stable/8/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 07 Jun 2013 09:06:50 -0000 Author: hrs Date: Fri Jun 7 09:06:50 2013 New Revision: 251489 URL: http://svnweb.freebsd.org/changeset/base/251489 Log: Document a bge(4) issue. Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jun 7 09:03:56 2013 (r251488) +++ stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jun 7 09:06:50 2013 (r251489) @@ -206,6 +206,23 @@ Open Issues + [20130607] The &man.bge.4; network interface driver has an + issue when TSO (TCP Segmentation Offload) is enabled. It causes + intermittent reset and re-initialization. + + A workaround is disabling the TSO feature. One can disable + it by adding the following line into the &man.rc.conf.5; + file: + + ifconfig_bge0="-tso" + + or by using the &man.ifconfig.8; utility manually: + + &prompt.root; ifconfig bge0 -tso + + A patch to fix this issue will be released as an Errata + Notice. + [20130606] The &man.fxp.4; network interface driver may not work well with the &man.dhclient.8; utility. More specifically, if the /etc/rc.conf has the following From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 7 12:24:16 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0FB93ADD; Fri, 7 Jun 2013 12:24:16 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F3F781C14; Fri, 7 Jun 2013 12:24:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r57COFKI094035; Fri, 7 Jun 2013 12:24:15 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r57COFb4094032; Fri, 7 Jun 2013 12:24:15 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306071224.r57COFb4094032@svn.freebsd.org> From: Steven Hartland Date: Fri, 7 Jun 2013 12:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251491 - in stable/8/sys/cam: ata scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 07 Jun 2013 12:24:16 -0000 Author: smh Date: Fri Jun 7 12:24:15 2013 New Revision: 251491 URL: http://svnweb.freebsd.org/changeset/base/251491 Log: Enhanced BIO_DELETE support for CAM SCSI to add ATA_TRIM support. Disable CAM BIO queue sorting for non-rotating media by default. MFC r245253 Use sysctl tunable values for scsi_da & retry_count (stable/8 only) MFC r249939 Added available delete methods discovery during device probe MFC r249941 Automatically disable BIO queue sorting for non-rotating media MFC r250033 Correct comment typo's MFC r250179 Update probe flow so that devices with lbp can also disable disksort MFC r250181 Check for ATA Information VPD before querying for ATA MFC r250183 Enable CAM SCSI to choice ATA TRIM during autodetection MFC r250967 Enforce validation on the selected delete method via sysctl Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/scsi/scsi_all.h stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Fri Jun 7 10:27:50 2013 (r251490) +++ stable/8/sys/cam/ata/ata_da.c Fri Jun 7 12:24:15 2013 (r251491) @@ -1102,7 +1102,11 @@ adaregister(struct cam_periph *periph, v snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.write_cache", periph->unit_number); TUNABLE_INT_FETCH(announce_buf, &softc->write_cache); - softc->sort_io_queue = -1; + /* Disable queue sorting for non-rotational media by default. */ + if (cgd->ident_data.media_rotation_rate == 1) + softc->sort_io_queue = 0; + else + softc->sort_io_queue = -1; adagetparams(periph, cgd); softc->disk = disk_alloc(); softc->disk->d_devstat = devstat_new_entry(periph->periph_name, Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Fri Jun 7 10:27:50 2013 (r251490) +++ stable/8/sys/cam/scsi/scsi_all.h Fri Jun 7 12:24:15 2013 (r251491) @@ -891,6 +891,36 @@ struct scsi_vpd_unit_serial_number }; /* + * ATA Information VPD Page based on + * T10/2126-D Revision 04 + */ +#define SVPD_ATA_INFORMATION 0x89 + +/* + * Block Device Characteristics VPD Page based on + * T10/1799-D Revision 31 + */ +struct scsi_vpd_block_characteristics +{ + u_int8_t device; + u_int8_t page_code; +#define SVPD_BDC 0xB1 + u_int8_t page_length[2]; + u_int8_t medium_rotation_rate[2]; +#define SVPD_BDC_RATE_NOT_REPORTED 0x00 +#define SVPD_BDC_RATE_NONE_ROTATING 0x01 + u_int8_t reserved1; + u_int8_t nominal_form_factor; +#define SVPD_BDC_FORM_NOT_REPORTED 0x00 +#define SVPD_BDC_FORM_5_25INCH 0x01 +#define SVPD_BDC_FORM_3_5INCH 0x02 +#define SVPD_BDC_FORM_2_5INCH 0x03 +#define SVPD_BDC_FORM_1_5INCH 0x04 +#define SVPD_BDC_FORM_LESSTHAN_1_5INCH 0x05 + u_int8_t reserved2[56]; +}; + +/* * Logical Block Provisioning VPD Page based on * T10/1799-D Revision 31 */ Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Fri Jun 7 10:27:50 2013 (r251490) +++ stable/8/sys/cam/scsi/scsi_da.c Fri Jun 7 12:24:15 2013 (r251491) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #endif /* _KERNEL */ @@ -66,8 +67,12 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL typedef enum { - DA_STATE_PROBE, - DA_STATE_PROBE2, + DA_STATE_PROBE_RC, + DA_STATE_PROBE_RC16, + DA_STATE_PROBE_LBP, + DA_STATE_PROBE_BLK_LIMITS, + DA_STATE_PROBE_BDC, + DA_STATE_PROBE_ATA, DA_STATE_NORMAL } da_state; @@ -93,28 +98,46 @@ typedef enum { } da_quirks; typedef enum { - DA_CCB_PROBE = 0x01, - DA_CCB_PROBE2 = 0x02, - DA_CCB_BUFFER_IO = 0x03, - DA_CCB_WAITING = 0x04, - DA_CCB_DUMP = 0x05, - DA_CCB_DELETE = 0x06, + DA_CCB_PROBE_RC = 0x01, + DA_CCB_PROBE_RC16 = 0x02, + DA_CCB_PROBE_LBP = 0x03, + DA_CCB_PROBE_BLK_LIMITS = 0x04, + DA_CCB_PROBE_BDC = 0x05, + DA_CCB_PROBE_ATA = 0x06, + DA_CCB_BUFFER_IO = 0x07, + DA_CCB_WAITING = 0x08, + DA_CCB_DUMP = 0x0A, + DA_CCB_DELETE = 0x0B, DA_CCB_TYPE_MASK = 0x0F, DA_CCB_RETRY_UA = 0x10 } da_ccb_state; +/* + * Order here is important for method choice + * + * We prefer ATA_TRIM as tests run against a Sandforce 2281 SSD attached to + * LSI 2008 (mps) controller (FW: v12, Drv: v14) resulted 20% quicker deletes + * using ATA_TRIM than the corresponding UNMAP results for a real world mysql + * import taking 5mins. + * + */ typedef enum { DA_DELETE_NONE, DA_DELETE_DISABLE, - DA_DELETE_ZERO, - DA_DELETE_WS10, - DA_DELETE_WS16, + DA_DELETE_ATA_TRIM, DA_DELETE_UNMAP, - DA_DELETE_MAX = DA_DELETE_UNMAP + DA_DELETE_WS16, + DA_DELETE_WS10, + DA_DELETE_ZERO, + DA_DELETE_MIN = DA_DELETE_ATA_TRIM, + DA_DELETE_MAX = DA_DELETE_ZERO } da_delete_methods; static const char *da_delete_method_names[] = - { "NONE", "DISABLE", "ZERO", "WS10", "WS16", "UNMAP" }; + { "NONE", "DISABLE", "ATA_TRIM", "UNMAP", "WS16", "WS10", "ZERO" }; +static const char *da_delete_method_desc[] = + { "NONE", "DISABLED", "ATA TRIM", "UNMAP", "WRITE SAME(16) with UNMAP", + "WRITE SAME(10) with UNMAP", "ZERO" }; /* Offsets into our private area for storing information */ #define ccb_state ppriv_field0 @@ -130,7 +153,17 @@ struct disk_params { u_int stripeoffset; }; -#define UNMAP_MAX_RANGES 512 +#define UNMAP_RANGE_MAX 0xffffffff +#define UNMAP_HEAD_SIZE 8 +#define UNMAP_RANGE_SIZE 16 +#define UNMAP_MAX_RANGES 2048 /* Protocol Max is 4095 */ +#define UNMAP_BUF_SIZE ((UNMAP_MAX_RANGES * UNMAP_RANGE_SIZE) + \ + UNMAP_HEAD_SIZE) + +#define WS10_MAX_BLKS 0xffff +#define WS16_MAX_BLKS 0xffffffff +#define ATA_TRIM_MAX_RANGES ((UNMAP_BUF_SIZE / \ + (ATA_DSM_RANGE_SIZE * ATA_DSM_BLK_SIZE)) * ATA_DSM_BLK_SIZE) struct da_softc { struct bio_queue_head bio_queue; @@ -146,10 +179,13 @@ struct da_softc { int error_inject; int ordered_tag_count; int outstanding_cmds; - int unmap_max_ranges; - int unmap_max_lba; + int trim_max_ranges; int delete_running; - da_delete_methods delete_method; + int delete_available; /* Delete methods possibly available */ + uint32_t unmap_max_ranges; + uint32_t unmap_max_lba; + uint64_t ws_max_blks; + da_delete_methods delete_method; struct disk_params params; struct disk *disk; union ccb saved_ccb; @@ -158,9 +194,16 @@ struct da_softc { struct sysctl_oid *sysctl_tree; struct callout sendordered_c; uint64_t wwpn; - uint8_t unmap_buf[UNMAP_MAX_RANGES * 16 + 8]; + uint8_t unmap_buf[UNMAP_BUF_SIZE]; }; +#define dadeleteflag(softc, delete_method, enable) \ + if (enable) { \ + softc->delete_available |= (1 << delete_method); \ + } else { \ + softc->delete_available &= ~(1 << delete_method); \ + } + struct da_quirk_entry { struct scsi_inquiry_pattern inq_pat; da_quirks quirks; @@ -859,6 +902,10 @@ static int dacmdsizesysctl(SYSCTL_HANDL static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); static void dadeletemethodset(struct da_softc *softc, da_delete_methods delete_method); +static void dadeletemethodchoose(struct da_softc *softc, + da_delete_methods default_method); +static void daprobedone(struct cam_periph *periph, union ccb *ccb); + static periph_ctor_t daregister; static periph_dtor_t dacleanup; static periph_start_t dastart; @@ -980,10 +1027,6 @@ daopen(struct disk *dp) softc->disk->d_fwheads = softc->params.heads; softc->disk->d_devstat->block_size = softc->params.secsize; softc->disk->d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE; - if (softc->delete_method > DA_DELETE_DISABLE) - softc->disk->d_flags |= DISKFLAG_CANDELETE; - else - softc->disk->d_flags &= ~DISKFLAG_CANDELETE; if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 && (softc->quirks & DA_Q_NO_PREVENT) == 0) @@ -1512,6 +1555,82 @@ dadeletemethodset(struct da_softc *softc softc->disk->d_flags &= ~DISKFLAG_CANDELETE; } +static void +daprobedone(struct cam_periph *periph, union ccb *ccb) +{ + struct da_softc *softc; + + softc = (struct da_softc *)periph->softc; + + dadeletemethodchoose(softc, DA_DELETE_NONE); + + if (bootverbose) { + char buf[80]; + int i, sep; + + snprintf(buf, sizeof(buf), "Delete methods: <"); + sep = 0; + for (i = DA_DELETE_MIN; i <= DA_DELETE_MAX; i++) { + if (softc->delete_available & (1 << i)) { + if (sep) { + strlcat(buf, ",", sizeof(buf)); + } else { + sep = 1; + } + strlcat(buf, da_delete_method_names[i], + sizeof(buf)); + if (i == softc->delete_method) { + strlcat(buf, "(*)", sizeof(buf)); + } + } + } + if (sep == 0) { + if (softc->delete_method == DA_DELETE_NONE) + strlcat(buf, "NONE(*)", sizeof(buf)); + else + strlcat(buf, "DISABLED(*)", sizeof(buf)); + } + strlcat(buf, ">", sizeof(buf)); + printf("%s%d: %s\n", periph->periph_name, + periph->unit_number, buf); + } + + /* + * Since our peripheral may be invalidated by an error + * above or an external event, we must release our CCB + * before releasing the probe lock on the peripheral. + * The peripheral will only go away once the last lock + * is removed, and we need it around for the CCB release + * operation. + */ + xpt_release_ccb(ccb); + softc->state = DA_STATE_NORMAL; + cam_periph_unhold(periph); + + /* May have more work to do, so ensure we stay scheduled. */ + daschedule(periph); +} + +static void +dadeletemethodchoose(struct da_softc *softc, da_delete_methods default_method) +{ + int i, delete_method; + + delete_method = default_method; + + /* + * Use the pre-defined order to choose the best + * performing delete. + */ + for (i = DA_DELETE_MIN; i <= DA_DELETE_MAX; i++) { + if (softc->delete_available & (1 << i)) { + dadeletemethodset(softc, i); + return; + } + } + dadeletemethodset(softc, delete_method); +} + static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) { @@ -1532,7 +1651,8 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS if (error != 0 || req->newptr == NULL) return (error); for (i = 0; i <= DA_DELETE_MAX; i++) { - if (strcmp(buf, da_delete_method_names[i]) != 0) + if (!(softc->delete_available & (1 << i)) || + strcmp(buf, da_delete_method_names[i]) != 0) continue; dadeletemethodset(softc, i); return (0); @@ -1570,14 +1690,16 @@ daregister(struct cam_periph *periph, vo } LIST_INIT(&softc->pending_ccbs); - softc->state = DA_STATE_PROBE; + softc->state = DA_STATE_PROBE_RC; bioq_init(&softc->bio_queue); bioq_init(&softc->delete_queue); bioq_init(&softc->delete_run_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= DA_FLAG_PACK_REMOVABLE; softc->unmap_max_ranges = UNMAP_MAX_RANGES; - softc->unmap_max_lba = 1024*1024*2; + softc->unmap_max_lba = UNMAP_RANGE_MAX; + softc->ws_max_blks = WS16_MAX_BLKS; + softc->trim_max_ranges = ATA_TRIM_MAX_RANGES; softc->sort_io_queue = -1; periph->softc = softc; @@ -1665,7 +1787,7 @@ daregister(struct cam_periph *periph, vo /* Predict whether device may support READ CAPACITY(16). */ if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3) { softc->flags |= DA_FLAG_CAN_RC16; - softc->state = DA_STATE_PROBE2; + softc->state = DA_STATE_PROBE_RC16; } /* @@ -1713,6 +1835,7 @@ dastart(struct cam_periph *periph, union CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastart\n")); +skipstate: switch (softc->state) { case DA_STATE_NORMAL: { @@ -1737,13 +1860,36 @@ dastart(struct cam_periph *periph, union if (!softc->delete_running && (bp = bioq_first(&softc->delete_queue)) != NULL) { uint64_t lba; - u_int count; + uint64_t count; /* forward compat with WS32 */ + + /* + * In each of the methods below, while its the caller's + * responsibility to ensure the request will fit into a + * single device request, we might have changed the delete + * method due to the device incorrectly advertising either + * its supported methods or limits. + * + * To prevent this causing further issues we validate the + * against the methods limits, and warn which would + * otherwise be unnecessary. + */ if (softc->delete_method == DA_DELETE_UNMAP) { uint8_t *buf = softc->unmap_buf; uint64_t lastlba = (uint64_t)-1; - uint32_t lastcount = 0; - int blocks = 0, off, ranges = 0; + uint32_t lastcount = 0, c; + uint64_t totalcount = 0; + uint32_t off, ranges = 0; + + /* + * Currently this doesn't take the UNMAP + * Granularity and Granularity Alignment + * fields into account. + * + * This could result in both unoptimal unmap + * requests as as well as UNMAP calls unmapping + * fewer LBA's than requested. + */ softc->delete_running = 1; bzero(softc->unmap_buf, sizeof(softc->unmap_buf)); @@ -1757,22 +1903,44 @@ dastart(struct cam_periph *periph, union /* Try to extend the previous range. */ if (lba == lastlba) { - lastcount += count; - off = (ranges - 1) * 16 + 8; + c = min(count, softc->unmap_max_lba - + lastcount); + lastcount += c; + off = ((ranges - 1) * UNMAP_RANGE_SIZE) + + UNMAP_HEAD_SIZE; scsi_ulto4b(lastcount, &buf[off + 8]); - } else if (count > 0) { - off = ranges * 16 + 8; + count -= c; + lba +=c; + totalcount += c; + } + + while (count > 0) { + c = min(count, softc->unmap_max_lba); + if (totalcount + c > softc->unmap_max_lba || + ranges >= softc->unmap_max_ranges) { + xpt_print(periph->path, + "%s issuing short delete %ld > %ld" + "|| %d >= %d", + da_delete_method_desc[softc->delete_method], + totalcount + c, softc->unmap_max_lba, + ranges, softc->unmap_max_ranges); + break; + } + off = (ranges * UNMAP_RANGE_SIZE) + + UNMAP_HEAD_SIZE; scsi_u64to8b(lba, &buf[off + 0]); - scsi_ulto4b(count, &buf[off + 8]); - lastcount = count; + scsi_ulto4b(c, &buf[off + 8]); + lba += c; + totalcount += c; ranges++; + count -= c; + lastcount = c; } - blocks += count; - lastlba = lba + count; + lastlba = lba; bp1 = bioq_first(&softc->delete_queue); if (bp1 == NULL || ranges >= softc->unmap_max_ranges || - blocks + bp1->bio_bcount / + totalcount + bp1->bio_bcount / softc->params.secsize > softc->unmap_max_lba) break; } while (1); @@ -1790,9 +1958,87 @@ dastart(struct cam_periph *periph, union da_default_timeout * 1000); start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; goto out; + } else if (softc->delete_method == DA_DELETE_ATA_TRIM) { + uint8_t *buf = softc->unmap_buf; + uint64_t lastlba = (uint64_t)-1; + uint32_t lastcount = 0, c, requestcount; + int ranges = 0, off, block_count; + + softc->delete_running = 1; + bzero(softc->unmap_buf, sizeof(softc->unmap_buf)); + bp1 = bp; + do { + bioq_remove(&softc->delete_queue, bp1); + if (bp1 != bp) + bioq_insert_tail(&softc->delete_run_queue, bp1); + lba = bp1->bio_pblkno; + count = bp1->bio_bcount / softc->params.secsize; + requestcount = count; + + /* Try to extend the previous range. */ + if (lba == lastlba) { + c = min(count, ATA_DSM_RANGE_MAX - lastcount); + lastcount += c; + off = (ranges - 1) * 8; + buf[off + 6] = lastcount & 0xff; + buf[off + 7] = (lastcount >> 8) & 0xff; + count -= c; + lba += c; + } + + while (count > 0) { + c = min(count, ATA_DSM_RANGE_MAX); + off = ranges * 8; + + buf[off + 0] = lba & 0xff; + buf[off + 1] = (lba >> 8) & 0xff; + buf[off + 2] = (lba >> 16) & 0xff; + buf[off + 3] = (lba >> 24) & 0xff; + buf[off + 4] = (lba >> 32) & 0xff; + buf[off + 5] = (lba >> 40) & 0xff; + buf[off + 6] = c & 0xff; + buf[off + 7] = (c >> 8) & 0xff; + lba += c; + ranges++; + count -= c; + lastcount = c; + if (count != 0 && ranges == softc->trim_max_ranges) { + xpt_print(periph->path, + "%s issuing short delete %ld > %ld", + da_delete_method_desc[softc->delete_method], + requestcount, + (softc->trim_max_ranges - ranges) * + ATA_DSM_RANGE_MAX); + break; + } + } + lastlba = lba; + bp1 = bioq_first(&softc->delete_queue); + if (bp1 == NULL || + bp1->bio_bcount / softc->params.secsize > + (softc->trim_max_ranges - ranges) * + ATA_DSM_RANGE_MAX) + break; + } while (1); + + block_count = (ranges + ATA_DSM_BLK_RANGES - 1) / + ATA_DSM_BLK_RANGES; + scsi_ata_trim(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + block_count, + /*data_ptr*/buf, + /*dxfer_len*/block_count * ATA_DSM_BLK_SIZE, + /*sense_len*/SSD_FULL_SIZE, + da_default_timeout * 1000); + start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; + goto out; } else if (softc->delete_method == DA_DELETE_ZERO || softc->delete_method == DA_DELETE_WS10 || softc->delete_method == DA_DELETE_WS16) { + uint64_t ws_max_blks; + ws_max_blks = softc->ws_max_blks / softc->params.secsize; softc->delete_running = 1; lba = bp->bio_pblkno; count = 0; @@ -1802,11 +2048,19 @@ dastart(struct cam_periph *periph, union if (bp1 != bp) bioq_insert_tail(&softc->delete_run_queue, bp1); count += bp1->bio_bcount / softc->params.secsize; + if (count > ws_max_blks) { + count = min(count, ws_max_blks); + xpt_print(periph->path, + "%s issuing short delete %ld > %ld", + da_delete_method_desc[softc->delete_method], + count, ws_max_blks); + break; + } bp1 = bioq_first(&softc->delete_queue); if (bp1 == NULL || lba + count != bp1->bio_pblkno || count + bp1->bio_bcount / - softc->params.secsize > 0xffff) + softc->params.secsize > ws_max_blks) break; } while (1); @@ -1910,7 +2164,7 @@ out: daschedule(periph); break; } - case DA_STATE_PROBE: + case DA_STATE_PROBE_RC: { struct scsi_read_capacity_data *rcap; @@ -1929,11 +2183,11 @@ out: SSD_FULL_SIZE, /*timeout*/5000); start_ccb->ccb_h.ccb_bp = NULL; - start_ccb->ccb_h.ccb_state = DA_CCB_PROBE; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_RC; xpt_action(start_ccb); break; } - case DA_STATE_PROBE2: + case DA_STATE_PROBE_RC16: { struct scsi_read_capacity_data_long *rcaplong; @@ -1955,8 +2209,148 @@ out: /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ da_default_timeout * 1000); start_ccb->ccb_h.ccb_bp = NULL; - start_ccb->ccb_h.ccb_state = DA_CCB_PROBE2; - xpt_action(start_ccb); + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_RC16; + xpt_action(start_ccb); + break; + } + case DA_STATE_PROBE_LBP: + { + struct scsi_vpd_logical_block_prov *lbp; + + if (!scsi_vpd_supported_page(periph, SVPD_LBP)) { + /* + * If we get here we don't support any SBC-3 delete + * methods with UNMAP as the Logical Block Provisioning + * VPD page support is required for devices which + * support it according to T10/1799-D Revision 31 + * however older revisions of the spec don't mandate + * this so we currently don't remove these methods + * from the available set. + */ + softc->state = DA_STATE_PROBE_BLK_LIMITS; + goto skipstate; + } + + lbp = (struct scsi_vpd_logical_block_prov *) + malloc(sizeof(*lbp), M_SCSIDA, M_NOWAIT|M_ZERO); + + if (lbp == NULL) { + printf("dastart: Couldn't malloc lbp data\n"); + /* da_free_periph??? */ + break; + } + + scsi_inquiry(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*inq_buf*/(u_int8_t *)lbp, + /*inq_len*/sizeof(*lbp), + /*evpd*/TRUE, + /*page_code*/SVPD_LBP, + /*sense_len*/SSD_MIN_SIZE, + /*timeout*/da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_LBP; + xpt_action(start_ccb); + break; + } + case DA_STATE_PROBE_BLK_LIMITS: + { + struct scsi_vpd_block_limits *block_limits; + + if (!scsi_vpd_supported_page(periph, SVPD_BLOCK_LIMITS)) { + /* Not supported skip to next probe */ + softc->state = DA_STATE_PROBE_BDC; + goto skipstate; + } + + block_limits = (struct scsi_vpd_block_limits *) + malloc(sizeof(*block_limits), M_SCSIDA, M_NOWAIT|M_ZERO); + + if (block_limits == NULL) { + printf("dastart: Couldn't malloc block_limits data\n"); + /* da_free_periph??? */ + break; + } + + scsi_inquiry(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*inq_buf*/(u_int8_t *)block_limits, + /*inq_len*/sizeof(*block_limits), + /*evpd*/TRUE, + /*page_code*/SVPD_BLOCK_LIMITS, + /*sense_len*/SSD_MIN_SIZE, + /*timeout*/da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_BLK_LIMITS; + xpt_action(start_ccb); + break; + } + case DA_STATE_PROBE_BDC: + { + struct scsi_vpd_block_characteristics *bdc; + + if (!scsi_vpd_supported_page(periph, SVPD_BDC)) { + softc->state = DA_STATE_PROBE_ATA; + goto skipstate; + } + + bdc = (struct scsi_vpd_block_characteristics *) + malloc(sizeof(*bdc), M_SCSIDA, M_NOWAIT|M_ZERO); + + if (bdc == NULL) { + printf("dastart: Couldn't malloc bdc data\n"); + /* da_free_periph??? */ + break; + } + + scsi_inquiry(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*inq_buf*/(u_int8_t *)bdc, + /*inq_len*/sizeof(*bdc), + /*evpd*/TRUE, + /*page_code*/SVPD_BDC, + /*sense_len*/SSD_MIN_SIZE, + /*timeout*/da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_BDC; + xpt_action(start_ccb); + break; + } + case DA_STATE_PROBE_ATA: + { + struct ata_params *ata_params; + + if (!scsi_vpd_supported_page(periph, SVPD_ATA_INFORMATION)) { + daprobedone(periph, start_ccb); + break; + } + + ata_params = (struct ata_params*) + malloc(sizeof(*ata_params), M_SCSIDA, M_NOWAIT|M_ZERO); + + if (ata_params == NULL) { + printf("dastart: Couldn't malloc ata_params data\n"); + /* da_free_periph??? */ + break; + } + + scsi_ata_identify(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*data_ptr*/(u_int8_t *)ata_params, + /*dxfer_len*/sizeof(*ata_params), + /*sense_len*/SSD_FULL_SIZE, + /*timeout*/da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_ATA; + xpt_action(start_ccb); break; } } @@ -1976,27 +2370,31 @@ cmd6workaround(union ccb *ccb) softc = (struct da_softc *)xpt_path_periph(ccb->ccb_h.path)->softc; if (ccb->ccb_h.ccb_state == DA_CCB_DELETE) { - if (softc->delete_method == DA_DELETE_UNMAP) { - xpt_print(ccb->ccb_h.path, "UNMAP is not supported, " - "switching to WRITE SAME(16) with UNMAP.\n"); - dadeletemethodset(softc, DA_DELETE_WS16); - } else if (softc->delete_method == DA_DELETE_WS16) { - xpt_print(ccb->ccb_h.path, - "WRITE SAME(16) with UNMAP is not supported, " - "disabling BIO_DELETE.\n"); - dadeletemethodset(softc, DA_DELETE_DISABLE); - } else if (softc->delete_method == DA_DELETE_WS10) { + da_delete_methods old_method = softc->delete_method; + + /* + * Typically there are two reasons for failure here + * 1. Delete method was detected as supported but isn't + * 2. Delete failed due to invalid params e.g. too big + * + * While we will attempt to choose an alternative delete method + * this may result in short deletes if the existing delete + * requests from geom are big for the new method choosen. + * + * This method assumes that the error which triggered this + * will not retry the io otherwise a panic will occur + */ + dadeleteflag(softc, old_method, 0); + dadeletemethodchoose(softc, DA_DELETE_DISABLE); + if (softc->delete_method == DA_DELETE_DISABLE) xpt_print(ccb->ccb_h.path, - "WRITE SAME(10) with UNMAP is not supported, " - "disabling BIO_DELETE.\n"); - dadeletemethodset(softc, DA_DELETE_DISABLE); - } else if (softc->delete_method == DA_DELETE_ZERO) { + "%s failed, disabling BIO_DELETE\n", + da_delete_method_desc[old_method]); + else xpt_print(ccb->ccb_h.path, - "WRITE SAME(10) is not supported, " - "disabling BIO_DELETE.\n"); - dadeletemethodset(softc, DA_DELETE_DISABLE); - } else - dadeletemethodset(softc, DA_DELETE_DISABLE); + "%s failed, switching to %s BIO_DELETE\n", + da_delete_method_desc[old_method], + da_delete_method_desc[softc->delete_method]); if (DA_SIO) { while ((bp = bioq_takefirst(&softc->delete_run_queue)) @@ -2078,7 +2476,7 @@ dadone(struct cam_periph *periph, union error = daerror(done_ccb, CAM_RETRY_SELTO, sf); if (error == ERESTART) { /* - * A retry was scheuled, so + * A retry was scheduled, so * just return. */ return; @@ -2175,16 +2573,18 @@ dadone(struct cam_periph *periph, union biodone(bp); break; } - case DA_CCB_PROBE: - case DA_CCB_PROBE2: + case DA_CCB_PROBE_RC: + case DA_CCB_PROBE_RC16: { struct scsi_read_capacity_data *rdcap; struct scsi_read_capacity_data_long *rcaplong; char announce_buf[80]; + int lbp; + lbp = 0; rdcap = NULL; rcaplong = NULL; - if (softc->state == DA_STATE_PROBE) + if (softc->state == DA_STATE_PROBE_RC) rdcap =(struct scsi_read_capacity_data *)csio->data_ptr; else rcaplong = (struct scsi_read_capacity_data_long *) @@ -2197,7 +2597,7 @@ dadone(struct cam_periph *periph, union u_int lbppbe; /* LB per physical block exponent. */ u_int lalba; /* Lowest aligned LBA. */ - if (softc->state == DA_STATE_PROBE) { + if (softc->state == DA_STATE_PROBE_RC) { block_size = scsi_4btoul(rdcap->length); maxsector = scsi_4btoul(rdcap->addr); lbppbe = 0; @@ -2212,9 +2612,9 @@ dadone(struct cam_periph *periph, union * with the short version of the command. */ if (maxsector == 0xffffffff) { - softc->state = DA_STATE_PROBE2; free(rdcap, M_SCSIDA); xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_RC16; xpt_schedule(periph, priority); return; } @@ -2242,9 +2642,7 @@ dadone(struct cam_periph *periph, union } else { dasetgeom(periph, block_size, maxsector, lbppbe, lalba & SRC16_LALBA); - if ((lalba & SRC16_LBPME) && - softc->delete_method == DA_DELETE_NONE) - dadeletemethodset(softc, DA_DELETE_UNMAP); + lbp = (lalba & SRC16_LBPME); dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " @@ -2314,7 +2712,7 @@ dadone(struct cam_periph *periph, union * If we tried READ CAPACITY(16) and failed, * fallback to READ CAPACITY(10). */ - if ((softc->state == DA_STATE_PROBE2) && + if ((softc->state == DA_STATE_PROBE_RC16) && (softc->flags & DA_FLAG_CAN_RC16) && (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) || @@ -2322,9 +2720,9 @@ dadone(struct cam_periph *periph, union (error_code == SSD_CURRENT_ERROR) && (sense_key == SSD_KEY_ILLEGAL_REQUEST)))) { softc->flags &= ~DA_FLAG_CAN_RC16; - softc->state = DA_STATE_PROBE; free(rdcap, M_SCSIDA); xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_RC; xpt_schedule(periph, priority); return; } else @@ -2386,17 +2784,242 @@ dadone(struct cam_periph *periph, union } } - softc->state = DA_STATE_NORMAL; - /* - * Since our peripheral may be invalidated by an error - * above or an external event, we must release our CCB - * before releasing the probe lock on the peripheral. - * The peripheral will only go away once the last lock - * is removed, and we need it around for the CCB release - * operation. - */ + + /* Ensure re-probe doesn't see old delete. */ + softc->delete_available = 0; + if (lbp) { + /* + * Based on older SBC-3 spec revisions + * any of the UNMAP methods "may" be + * available via LBP given this flag so + * we flag all of them as availble and + * then remove those which further + * probes confirm aren't available + * later. + * + * We could also check readcap(16) p_type + * flag to exclude one or more invalid + * write same (X) types here + */ + dadeleteflag(softc, DA_DELETE_WS16, 1); + dadeleteflag(softc, DA_DELETE_WS10, 1); + dadeleteflag(softc, DA_DELETE_ZERO, 1); + dadeleteflag(softc, DA_DELETE_UNMAP, 1); + + xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_LBP; + xpt_schedule(periph, priority); + return; + } + + xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_BDC; + xpt_schedule(periph, priority); + return; + } + case DA_CCB_PROBE_LBP: + { + struct scsi_vpd_logical_block_prov *lbp; + + lbp = (struct scsi_vpd_logical_block_prov *)csio->data_ptr; + + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + /* + * T10/1799-D Revision 31 states at least one of these + * must be supported but we don't currently enforce this. + */ + dadeleteflag(softc, DA_DELETE_WS16, + (lbp->flags & SVPD_LBP_WS16)); + dadeleteflag(softc, DA_DELETE_WS10, + (lbp->flags & SVPD_LBP_WS10)); + dadeleteflag(softc, DA_DELETE_ZERO, + (lbp->flags & SVPD_LBP_WS10)); + dadeleteflag(softc, DA_DELETE_UNMAP, + (lbp->flags & SVPD_LBP_UNMAP)); + + if (lbp->flags & SVPD_LBP_UNMAP) { + free(lbp, M_SCSIDA); + xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_BLK_LIMITS; + xpt_schedule(periph, priority); + return; + } + } else { + int error; + error = daerror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA|SF_NO_PRINT); + if (error == ERESTART) + return; + else if (error != 0) { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge this device's queue */ + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + + /* + * Failure indicates we don't support any SBC-3 + * delete methods with UNMAP + */ + } + } + + free(lbp, M_SCSIDA); + xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_BDC; + xpt_schedule(periph, priority); + return; + } + case DA_CCB_PROBE_BLK_LIMITS: + { + struct scsi_vpd_block_limits *block_limits; + + block_limits = (struct scsi_vpd_block_limits *)csio->data_ptr; + + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + uint32_t max_unmap_lba_cnt = scsi_4btoul( + block_limits->max_unmap_lba_cnt); + uint32_t max_unmap_blk_cnt = scsi_4btoul( + block_limits->max_unmap_blk_cnt); + uint64_t ws_max_blks = scsi_8btou64( + block_limits->max_write_same_length); + /* + * We should already support UNMAP but we check lba + * and block count to be sure + */ + if (max_unmap_lba_cnt != 0x00L && + max_unmap_blk_cnt != 0x00L) { + softc->unmap_max_lba = max_unmap_lba_cnt; + softc->unmap_max_ranges = min(max_unmap_blk_cnt, + UNMAP_MAX_RANGES); + } else { + /* + * Unexpected UNMAP limits which means the + * device doesn't actually support UNMAP + */ + dadeleteflag(softc, DA_DELETE_UNMAP, 0); + } + + if (ws_max_blks != 0x00L) + softc->ws_max_blks = ws_max_blks; + } else { + int error; + error = daerror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA|SF_NO_PRINT); + if (error == ERESTART) + return; + else if (error != 0) { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge this device's queue */ + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 7 12:33:42 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 40836DB1; Fri, 7 Jun 2013 12:33:42 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 326251CA2; Fri, 7 Jun 2013 12:33:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r57CXgXq097046; Fri, 7 Jun 2013 12:33:42 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r57CXeeg097034; Fri, 7 Jun 2013 12:33:40 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306071233.r57CXeeg097034@svn.freebsd.org> From: Steven Hartland Date: Fri, 7 Jun 2013 12:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251492 - in stable/8/sys: cam cam/ata cam/scsi dev/ahci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 07 Jun 2013 12:33:42 -0000 Author: smh Date: Fri Jun 7 12:33:40 2013 New Revision: 251492 URL: http://svnweb.freebsd.org/changeset/base/251492 Log: MFC r250792: Added output of device QUIRKS for CAM and AHCI devices during boot. Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/cam_xpt_periph.h stable/8/sys/cam/scsi/scsi_cd.c stable/8/sys/cam/scsi/scsi_ch.c stable/8/sys/cam/scsi/scsi_da.c stable/8/sys/cam/scsi/scsi_sa.c stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ahci/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/ata/ata_da.c Fri Jun 7 12:33:40 2013 (r251492) @@ -94,6 +94,10 @@ typedef enum { ADA_Q_4K = 0x01, } ada_quirks; +#define ADA_Q_BIT_STRING \ + "\020" \ + "\0014K" + typedef enum { ADA_CCB_RAHEAD = 0x01, ADA_CCB_WCACHE = 0x02, @@ -1191,6 +1195,7 @@ adaregister(struct cam_periph *periph, v dp->secsize, dp->heads, dp->secs_per_track, dp->cylinders); xpt_announce_periph(periph, announce_buf); + xpt_announce_quirks(periph, softc->quirks, ADA_Q_BIT_STRING); if (legacy_id >= 0) printf("%s%d: Previously was known as ad%d\n", periph->periph_name, periph->unit_number, legacy_id); Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/cam_xpt.c Fri Jun 7 12:33:40 2013 (r251492) @@ -1099,6 +1099,15 @@ xpt_announce_periph(struct cam_periph *p periph->unit_number, announce_string); } +void +xpt_announce_quirks(struct cam_periph *periph, int quirks, char *bit_string) +{ + if (quirks != 0) { + printf("%s%d: quirks=0x%b\n", periph->periph_name, + periph->unit_number, quirks, bit_string); + } +} + static dev_match_ret xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns, struct cam_eb *bus) Modified: stable/8/sys/cam/cam_xpt_periph.h ============================================================================== --- stable/8/sys/cam/cam_xpt_periph.h Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/cam_xpt_periph.h Fri Jun 7 12:33:40 2013 (r251492) @@ -45,6 +45,8 @@ int32_t xpt_add_periph(struct cam_perip void xpt_remove_periph(struct cam_periph *periph); void xpt_announce_periph(struct cam_periph *periph, char *announce_string); +void xpt_announce_quirks(struct cam_periph *periph, + int quirks, char *bit_string); #endif #endif /* _CAM_CAM_XPT_PERIPH_H */ Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/scsi/scsi_cd.c Fri Jun 7 12:33:40 2013 (r251492) @@ -92,6 +92,14 @@ typedef enum { CD_Q_10_BYTE_ONLY = 0x10 } cd_quirks; +#define CD_Q_BIT_STRING \ + "\020" \ + "\001NO_TOUCH" \ + "\002BCD_TRACKS" \ + "\003NO_CHANGER" \ + "\004CHANGER" \ + "\00510_BYTE_ONLY" + typedef enum { CD_FLAG_INVALID = 0x0001, CD_FLAG_NEW_DISC = 0x0002, @@ -1782,6 +1790,8 @@ cddone(struct cam_periph *periph, union free(rdcap, M_SCSICD); if (announce_buf[0] != '\0') { xpt_announce_periph(periph, announce_buf); + xpt_announce_quirks(periph, softc->quirks, + CD_Q_BIT_STRING); if (softc->flags & CD_FLAG_CHANGER) cdchangerschedule(softc); /* Modified: stable/8/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_ch.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/scsi/scsi_ch.c Fri Jun 7 12:33:40 2013 (r251492) @@ -126,6 +126,10 @@ typedef enum { CH_Q_NO_DBD = 0x01 } ch_quirks; +#define CH_Q_BIT_STRING \ + "\020" \ + "\001NO_DBD" + #define ccb_state ppriv_field0 #define ccb_bp ppriv_ptr1 @@ -639,8 +643,11 @@ chdone(struct cam_periph *periph, union announce_buf[0] = '\0'; } } - if (announce_buf[0] != '\0') + if (announce_buf[0] != '\0') { xpt_announce_periph(periph, announce_buf); + xpt_announce_quirks(periph, softc->quirks, + CH_Q_BIT_STRING); + } softc->state = CH_STATE_NORMAL; free(mode_header, M_SCSICH); /* Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/scsi/scsi_da.c Fri Jun 7 12:33:40 2013 (r251492) @@ -97,6 +97,13 @@ typedef enum { DA_Q_4K = 0x08 } da_quirks; +#define DA_Q_BIT_STRING \ + "\020" \ + "\001NO_SYNC_CACHE" \ + "\002NO_6_BYTE" \ + "\003NO_PREVENT" \ + "\0044K" + typedef enum { DA_CCB_PROBE_RC = 0x01, DA_CCB_PROBE_RC16 = 0x02, @@ -2778,6 +2785,8 @@ dadone(struct cam_periph *periph, union taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); xpt_announce_periph(periph, announce_buf); + xpt_announce_quirks(periph, softc->quirks, + DA_Q_BIT_STRING); } else { xpt_print(periph->path, "fatal error, " "could not acquire reference count\n"); Modified: stable/8/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_sa.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/scsi/scsi_sa.c Fri Jun 7 12:33:40 2013 (r251492) @@ -173,6 +173,17 @@ typedef enum { SA_QUIRK_NO_CPAGE = 0x80 /* Don't use DEVICE COMPRESSION page */ } sa_quirks; +#define SA_QUIRK_BIT_STRING \ + "\020" \ + "\001NOCOMP" \ + "\002FIXED" \ + "\003VARIABLE" \ + "\0042FM" \ + "\0051FM" \ + "\006NODREAD" \ + "\007NO_MODESEL" \ + "\010NO_CPAGE" + #define SAMODE(z) (dev2unit(z) & 0x3) #define SADENSITY(z) ((dev2unit(z) >> 2) & 0x3) #define SA_IS_CTRL(z) (dev2unit(z) & (1 << 4)) @@ -1546,6 +1557,7 @@ saregister(struct cam_periph *periph, vo xpt_register_async(AC_LOST_DEVICE, saasync, periph, periph->path); xpt_announce_periph(periph, NULL); + xpt_announce_quirks(periph, softc->quirks, SA_QUIRK_BIT_STRING); return (CAM_REQ_CMP); } Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/dev/ahci/ahci.c Fri Jun 7 12:33:40 2013 (r251492) @@ -121,6 +121,22 @@ static struct { #define AHCI_Q_NOCOUNT 1024 #define AHCI_Q_ALTSIG 2048 #define AHCI_Q_NOMSI 4096 + +#define AHCI_Q_BIT_STRING \ + "\020" \ + "\001NOFORCE" \ + "\002NOPMP" \ + "\003NONCQ" \ + "\0041CH" \ + "\0052CH" \ + "\0064CH" \ + "\007EDGEIS" \ + "\010SATA2" \ + "\011NOBSYRES" \ + "\012NOAA" \ + "\013NOCOUNT" \ + "\014ALTSIG" \ + "\015NOMSI" } ahci_ids[] = { {0x43801002, 0x00, "ATI IXP600", AHCI_Q_NOMSI}, {0x43901002, 0x00, "ATI IXP700", 0}, @@ -482,6 +498,10 @@ ahci_attach(device_t dev) "supported" : "not supported", (ctlr->caps & AHCI_CAP_FBSS) ? " with FBS" : ""); + if (ctlr->quirks != 0) { + device_printf(dev, "quirks=0x%b\n", ctlr->quirks, + AHCI_Q_BIT_STRING); + } if (bootverbose) { device_printf(dev, "Caps:%s%s%s%s%s%s%s%s %sGbps", (ctlr->caps & AHCI_CAP_64BIT) ? " 64bit":"", From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 7 12:42:49 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DAFCF31C; Fri, 7 Jun 2013 12:42:49 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC0711D18; Fri, 7 Jun 2013 12:42:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r57CgnAR000233; Fri, 7 Jun 2013 12:42:49 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r57CgnOg000231; Fri, 7 Jun 2013 12:42:49 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306071242.r57CgnOg000231@svn.freebsd.org> From: Steven Hartland Date: Fri, 7 Jun 2013 12:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251493 - in stable/8/sys/cam: ata scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 07 Jun 2013 12:42:49 -0000 Author: smh Date: Fri Jun 7 12:42:49 2013 New Revision: 251493 URL: http://svnweb.freebsd.org/changeset/base/251493 Log: MFC r251061: More 4k quirks for SSD's Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Fri Jun 7 12:33:40 2013 (r251492) +++ stable/8/sys/cam/ata/ata_da.c Fri Jun 7 12:42:49 2013 (r251493) @@ -273,12 +273,11 @@ static struct ada_quirk_entry ada_quirk_ { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD?????PVT*", "*" }, /*quirks*/ADA_Q_4K }, + /* SSDs */ { /* * Corsair Force 2 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair CSSD-F*", "*" }, /*quirks*/ADA_Q_4K @@ -287,100 +286,136 @@ static struct ada_quirk_entry ada_quirk_ /* * Corsair Force 3 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair Force 3*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * OCZ Agility 3 SSDs + * Corsair Force GT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-AGILITY3*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair Force GT*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * OCZ Vertex 2 SSDs (inc pro series) + * Crucial M4 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ?VERTEX2*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "M4-CT???M4SSD2*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * OCZ Vertex 3 SSDs + * Crucial RealSSD C300 SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "C300-CTFDDAC???MAG*", + "*" }, /*quirks*/ADA_Q_4K + }, + { + /* + * Intel 320 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX3*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSA2CW*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * SuperTalent TeraDrive CT SSDs + * Intel 330 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "FTM??CT25H*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2CT*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Crucial RealSSD C300 SSDs - * 4k optimised - * Submitted by: Steven Hartland - * PR: 169974 + * Intel 510 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "C300-CTFDDAC???MAG*", - "*" }, /*quirks*/ADA_Q_4K + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2MH*", "*" }, + /*quirks*/ADA_Q_4K }, { /* - * XceedIOPS SATA SSDs - * 4k optimised - * Submitted by: Steven Hartland - * PR: 169974 + * Intel 520 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "SG9XCS2D*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2BW*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Intel 330 Series SSDs + * Kingston E100 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "KINGSTON SE100S3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Kingston HyperX 3k SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "KINGSTON SH103S3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Agility 3 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2ct*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-AGILITY3*", "*" }, /*quirks*/ADA_Q_4K }, { /* * OCZ Deneva R Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ { T_DIRECT, SIP_MEDIA_FIXED, "*", "DENRSTE251M45*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Kingston HyperX 3k SSDs + * OCZ Vertex 2 SSDs (inc pro series) * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "KINGSTON SH103S3*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ?VERTEX2*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Vertex 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Samsung 830 Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG SSD 830 Series*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * SuperTalent TeraDrive CT SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "FTM??CT25H*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * XceedIOPS SATA SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SG9XCS2D*", "*" }, /*quirks*/ADA_Q_4K }, { Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Fri Jun 7 12:33:40 2013 (r251492) +++ stable/8/sys/cam/scsi/scsi_da.c Fri Jun 7 12:42:49 2013 (r251493) @@ -897,6 +897,151 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "HM250JI", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, + /* SATA SSDs */ + { + /* + * Corsair Force 2 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Corsair CSSD-F*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Corsair Force 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Corsair Force 3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Corsair Force GT SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Corsair Force GT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Crucial M4 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "M4-CT???M4SSD2*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Crucial RealSSD C300 SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "C300-CTFDDAC???MAG*", + "*" }, /*quirks*/DA_Q_4K + }, + { + /* + * Intel 320 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSA2CW*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Intel 330 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2CT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Intel 510 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2MH*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Intel 520 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2BW*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Kingston E100 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "KINGSTON SE100S3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Kingston HyperX 3k SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "KINGSTON SH103S3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Agility 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ-AGILITY3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Deneva R Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "DENRSTE251M45*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Vertex 2 SSDs (inc pro series) + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ?VERTEX2*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Vertex 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ-VERTEX3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Samsung 830 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG SSD 830 Series*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * SuperTalent TeraDrive CT SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "FTM??CT25H*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * XceedIOPS SATA SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SG9XCS2D*", "*" }, + /*quirks*/DA_Q_4K + }, }; static disk_strategy_t dastrategy; From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 7 13:31:00 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0021CD5F; Fri, 7 Jun 2013 13:30:59 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D7E001F2D; Fri, 7 Jun 2013 13:30:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r57DUxhF015860; Fri, 7 Jun 2013 13:30:59 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r57DUxsQ015855; Fri, 7 Jun 2013 13:30:59 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306071330.r57DUxsQ015855@svn.freebsd.org> From: Steven Hartland Date: Fri, 7 Jun 2013 13:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251494 - in stable/8: sbin/camcontrol sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 07 Jun 2013 13:31:00 -0000 Author: smh Date: Fri Jun 7 13:30:59 2013 New Revision: 251494 URL: http://svnweb.freebsd.org/changeset/base/251494 Log: MFC r249115: Adds security command to camcontrol which provides the ability to secure erase SSD's Modified: stable/8/sbin/camcontrol/camcontrol.8 stable/8/sbin/camcontrol/camcontrol.c stable/8/sys/sys/ata.h Directory Properties: stable/8/sbin/camcontrol/ (props changed) stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.8 Fri Jun 7 12:42:49 2013 (r251493) +++ stable/8/sbin/camcontrol/camcontrol.8 Fri Jun 7 13:30:59 2013 (r251494) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2012 +.Dd June 7, 2013 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -184,6 +184,21 @@ .Op device id .Op generic args .Nm +.Ic security +.Op device id +.Op generic args +.Op Fl d Ar pwd +.Op Fl e Ar pwd +.Op Fl f +.Op Fl h Ar pwd +.Op Fl k Ar pwd +.Op Fl l Ar high|maximum +.Op Fl q +.Op Fl s Ar pwd +.Op Fl T Ar timeout +.Op Fl U Ar user|master +.Op Fl y +.Nm .Ic help .Sh DESCRIPTION The @@ -856,6 +871,123 @@ specifies automatic standby timer value .It Ic sleep Put ATA device into SLEEP state. Note that the only way get device out of this state may be reset. +.It Ic security +Update or report security settings, using an ATA identify command (0xec). +By default, +.Nm +will print out the security support and associated settings of the device. +The +.Ic security +command takes several arguments: +.Bl -tag -width 0n +.It Fl d Ar pwd +.Pp +Disable device security using the given password for the selected user according +to the devices configured security level. +.It Fl e Ar pwd +.Pp +Erase the device using the given password for the selected user. +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +Issuing a secure erase will +.Em ERASE ALL +user data on the device and may take several hours to complete. +.Pp +When this command is used against an SSD drive all its cells will be marked as +empty, restoring it to factory default write performance. For SSD's this action +usually takes just a few seconds. +.It Fl f +.Pp +Freeze the security configuration of the specified device. +.Pp +After command completion any other commands that update the device lock mode +shall be command aborted. Frozen mode is disabled by power-off or hardware reset. +.It Fl h Ar pwd +.Pp +Enhanced erase the device using the given password for the selected user. +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +Issuing an enhanced secure erase will +.Em ERASE ALL +user data on the device and may take several hours to complete. +.Pp +An enhanced erase writes predetermined data patterns to all user data areas, +all previously written user data shall be overwritten, including sectors that +are no longer in use due to reallocation. +.It Fl k Ar pwd +.Pp +Unlock the device using the given password for the selected user according to +the devices configured security level. +.It Fl l Ar high|maximum +.Pp +Specifies which security level to set when issuing a +.Fl s Ar pwd +command. The security level determines device behavior when the master +password is used to unlock the device. When the security level is set to high +the device requires the unlock command and the master password to unlock. +When the security level is set to maximum the device requires a secure erase +with the master password to unlock. +.Pp +This option must be used in conjunction with one of the security action commands. +.Pp +Defaults to +.Em high +.It Fl q +.Pp +Be quiet, do not print any status messages. +This option will not disable the questions, however. +To disable questions, use the +.Fl y +argument, below. +.It Fl s Ar pwd +.Pp +Password the device (enable security) using the given password for the selected +user. This option can be combined with other options such as +.Fl e Em pwd +.Pp +A master password may be set in a addition to the user password. The purpose of +the master password is to allow an administrator to establish a password that +is kept secret from the user, and which may be used to unlock the device if the +user password is lost. +.Pp +.Em Note: +Setting the master password does not enable device security. +.Pp +If the master password is set and the drive supports a Master Revision Code +feature the Master Password Revision Code will be decremented. +.It Fl T Ar timeout +.Pp +Overrides the default timeout, specified in seconds, used for both +.Fl e +and +.Fl h +this is useful if your system has problems processing long timeouts correctly. +.Pp +Usually the timeout is calculated from the information stored on the drive if +present, otherwise it defaults to 2 hours. +.It Fl U Ar user|master +.Pp +Specifies which user to set / use for the running action command, valid values +are user or master and defaults to master if not set. +.Pp +This option must be used in conjunction with one of the security action commands. +.Pp +Defaults to +.Em master +.It Fl y +.Pp +Confirm yes to dangerous options such as +.Fl e +without prompting for confirmation. +.Pp +.El +If the password specified for any action commands doesn't match the configured +password for the specified user the command will fail. +.Pp +The password in all cases is limited to 32 characters, longer passwords will +fail. .It Ic help Print out verbose usage information. .El @@ -974,6 +1106,30 @@ camcontrol negotiate -n da -u 3 -R 20.00 Negotiate a sync rate of 20MHz and an offset of 15 with da3. Then send a Test Unit Ready command to make the settings take effect. +.Bd -literal -offset indent +camcontrol security ada0 +.Ed +.Pp +Report security support and settings for ada0 +.Bd -literal -offset indent +camcontrol security ada0 -u user -s MyPass +.Ed +.Pp +Enable security on device ada0 with the password MyPass +.Bd -literal -offset indent +camcontrol security ada0 -u user -e MyPass +.Ed +.Pp +Secure erase ada0 which has had security enabled with user password MyPass +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +This will +.Em ERASE ALL +data from the device, so backup your data before using! +.Pp +This command can be used used against an SSD drive to restoring it to +factory default write performance. .Sh SEE ALSO .Xr cam 3 , .Xr cam_cdbparse 3 , Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Fri Jun 7 12:42:49 2013 (r251493) +++ stable/8/sbin/camcontrol/camcontrol.c Fri Jun 7 13:30:59 2013 (r251494) @@ -77,7 +77,8 @@ typedef enum { CAM_CMD_IDENTIFY = 0x00000013, CAM_CMD_IDLE = 0x00000014, CAM_CMD_STANDBY = 0x00000015, - CAM_CMD_SLEEP = 0x00000016 + CAM_CMD_SLEEP = 0x00000016, + CAM_CMD_SECURITY = 0x00000017 } cam_cmdmask; typedef enum { @@ -127,6 +128,7 @@ struct camcontrol_opts { static const char scsicmd_opts[] = "a:c:dfi:o:r"; static const char readdefect_opts[] = "f:GP"; static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; +static char pwd_opt; #endif struct camcontrol_opts option_table[] = { @@ -161,6 +163,7 @@ struct camcontrol_opts option_table[] = {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, + {"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -225,7 +228,10 @@ static int scsireportluns(struct cam_dev static int scsireadcapacity(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); static int atapm(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int retry_count, int timeout); +static int atasecurity(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt); + #endif /* MINIMALISTIC */ #ifndef min #define min(a,b) (((a)<(b))?(a):(b)) @@ -1260,55 +1266,93 @@ atacapprint(struct ata_params *parm) printf("free-fall %s %s\n", parm->support2 & ATA_SUPPORT_FREEFALL ? "yes" : "no", parm->enabled2 & ATA_SUPPORT_FREEFALL ? "yes" : "no"); - printf("data set management (TRIM) %s\n", - parm->support_dsm & ATA_SUPPORT_DSM_TRIM ? "yes" : "no"); + printf("Data Set Management (DSM/TRIM) "); + if (parm->support_dsm & ATA_SUPPORT_DSM_TRIM) { + printf("yes\n"); + printf("DSM - max 512byte blocks "); + if (parm->max_dsm_blocks == 0x00) + printf("yes not specified\n"); + else + printf("yes %d\n", + parm->max_dsm_blocks); + + printf("DSM - deterministic read "); + if (parm->support3 & ATA_SUPPORT_DRAT) { + if (parm->support3 & ATA_SUPPORT_RZAT) + printf("yes zeroed\n"); + else + printf("yes any value\n"); + } else { + printf("no\n"); + } + } else { + printf("no\n"); + } } static int -ataidentify(struct cam_device *device, int retry_count, int timeout) +scsi_cam_pass_16_send(struct cam_device *device, union ccb *ccb, int quiet) { - union ccb *ccb; - struct ata_params *ident_buf; - struct ccb_getdev cgd; - u_int i, error = 0; - int16_t *ptr; + struct ata_pass_16 *ata_pass_16; + struct ata_cmd ata_cmd; - if (get_cgd(device, &cgd) != 0) { - warnx("couldn't get CGD"); - return(1); - } - ccb = cam_getccb(device); + ata_pass_16 = (struct ata_pass_16 *)ccb->csio.cdb_io.cdb_bytes; + ata_cmd.command = ata_pass_16->command; + ata_cmd.control = ata_pass_16->control; + ata_cmd.features = ata_pass_16->features; - if (ccb == NULL) { - warnx("couldn't allocate CCB"); - return(1); + if (arglist & CAM_ARG_VERBOSE) { + warnx("sending ATA %s via pass_16 with timeout of %u msecs", + ata_op_string(&ata_cmd), + ccb->csio.ccb_h.timeout); } - /* cam_getccb cleans up the header, caller has to zero the payload */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_ataio) - sizeof(struct ccb_hdr)); + /* Disable freezing the device queue */ + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; - ptr = (uint16_t *)malloc(sizeof(struct ata_params)); + if (arglist & CAM_ARG_ERR_RECOVER) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; - if (ptr == NULL) { - cam_freeccb(ccb); - warnx("can't malloc memory for identify\n"); - return(1); + if (cam_send_ccb(device, ccb) < 0) { + if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { + warn("error sending ATA %s via pass_16", + ata_op_string(&ata_cmd)); + } + + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + + return (1); } - bzero(ptr, sizeof(struct ata_params)); - cam_fill_ataio(&ccb->ataio, - retry_count, - NULL, - /*flags*/CAM_DIR_IN, - MSG_SIMPLE_Q_TAG, - /*data_ptr*/(u_int8_t *)ptr, - /*dxfer_len*/sizeof(struct ata_params), - timeout ? timeout : 30 * 1000); - if (cgd.protocol == PROTO_ATA) - ata_28bit_cmd(&ccb->ataio, ATA_ATA_IDENTIFY, 0, 0, 0); - else - ata_28bit_cmd(&ccb->ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0); + if (!(ata_pass_16->flags & AP_FLAG_CHK_COND) && + (ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { + warnx("ATA %s via pass_16 failed", + ata_op_string(&ata_cmd)); + } + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + + return (1); + } + + return (0); +} + + +static int +ata_cam_send(struct cam_device *device, union ccb *ccb, int quiet) +{ + if (arglist & CAM_ARG_VERBOSE) { + warnx("sending ATA %s with timeout of %u msecs", + ata_op_string(&(ccb->ataio.cmd)), + ccb->ataio.ccb_h.timeout); + } /* Disable freezing the device queue */ ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; @@ -1317,47 +1361,247 @@ ataidentify(struct cam_device *device, i ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending ATA identify"); + if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { + warn("error sending ATA %s", + ata_op_string(&(ccb->ataio.cmd))); + } if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); } - free(ptr); - cam_freeccb(ccb); - return(1); + return (1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - error = 1; + if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { + warnx("ATA %s failed: %d", + ata_op_string(&(ccb->ataio.cmd)), quiet); + } if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); } + + return (1); } - cam_freeccb(ccb); + return (0); +} + +static int +ata_do_pass_16(struct cam_device *device, union ccb *ccb, int retries, + u_int32_t flags, u_int8_t protocol, u_int8_t ata_flags, + u_int8_t tag_action, u_int8_t command, u_int8_t features, + u_int64_t lba, u_int8_t sector_count, u_int8_t *data_ptr, + u_int16_t dxfer_len, int timeout, int quiet) +{ + if (data_ptr != NULL) { + ata_flags |= AP_FLAG_BYT_BLOK_BYTES | + AP_FLAG_TLEN_SECT_CNT; + if (flags & CAM_DIR_OUT) + ata_flags |= AP_FLAG_TDIR_TO_DEV; + else + ata_flags |= AP_FLAG_TDIR_FROM_DEV; + } else { + ata_flags |= AP_FLAG_TLEN_NO_DATA; + } + + bzero(&(&ccb->ccb_h)[1], + sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + + scsi_ata_pass_16(&ccb->csio, + retries, + NULL, + flags, + tag_action, + protocol, + ata_flags, + features, + sector_count, + lba, + command, + /*control*/0, + data_ptr, + dxfer_len, + /*sense_len*/SSD_FULL_SIZE, + timeout); + + return scsi_cam_pass_16_send(device, ccb, quiet); +} + +static int +ata_try_pass_16(struct cam_device *device) +{ + struct ccb_pathinq cpi; + + if (get_cpi(device, &cpi) != 0) { + warnx("couldn't get CPI"); + return (-1); + } + + if (cpi.protocol == PROTO_SCSI) { + /* possibly compatible with pass_16 */ + return (1); + } + + /* likely not compatible with pass_16 */ + return (0); +} + +static int +ata_do_28bit_cmd(struct cam_device *device, union ccb *ccb, int retries, + u_int32_t flags, u_int8_t protocol, u_int8_t tag_action, + u_int8_t command, u_int8_t features, u_int32_t lba, + u_int8_t sector_count, u_int8_t *data_ptr, u_int16_t dxfer_len, + int timeout, int quiet) +{ + + + switch (ata_try_pass_16(device)) { + case -1: + return (1); + case 1: + /* Try using SCSI Passthrough */ + return ata_do_pass_16(device, ccb, retries, flags, protocol, + 0, tag_action, command, features, lba, + sector_count, data_ptr, dxfer_len, + timeout, quiet); + } + + bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_ataio) - + sizeof(struct ccb_hdr)); + cam_fill_ataio(&ccb->ataio, + retries, + NULL, + flags, + tag_action, + data_ptr, + dxfer_len, + timeout); + + ata_28bit_cmd(&ccb->ataio, command, features, lba, sector_count); + return ata_cam_send(device, ccb, quiet); +} + +static void +dump_data(uint16_t *ptr, uint32_t len) +{ + u_int i; + + for (i = 0; i < len / 2; i++) { + if ((i % 8) == 0) + printf(" %3d: ", i); + printf("%04hx ", ptr[i]); + if ((i % 8) == 7) + printf("\n"); + } + if ((i % 8) != 7) + printf("\n"); +} + +static int +ata_do_identify(struct cam_device *device, int retry_count, int timeout, + union ccb *ccb, struct ata_params** ident_bufp) +{ + struct ata_params *ident_buf; + struct ccb_pathinq cpi; + struct ccb_getdev cgd; + u_int i, error; + int16_t *ptr; + u_int8_t command, retry_command; + + if (get_cpi(device, &cpi) != 0) { + warnx("couldn't get CPI"); + return (-1); + } + + /* Neither PROTO_ATAPI or PROTO_SATAPM are used in cpi.protocol */ + if (cpi.protocol == PROTO_ATA) { + if (get_cgd(device, &cgd) != 0) { + warnx("couldn't get CGD"); + return (-1); + } + + command = (cgd.protocol == PROTO_ATA) ? + ATA_ATA_IDENTIFY : ATA_ATAPI_IDENTIFY; + retry_command = 0; + } else { + /* We don't know which for sure so try both */ + command = ATA_ATA_IDENTIFY; + retry_command = ATA_ATAPI_IDENTIFY; + } + + ptr = (uint16_t *)calloc(1, sizeof(struct ata_params)); + if (ptr == NULL) { + warnx("can't calloc memory for identify\n"); + return (1); + } + + error = ata_do_28bit_cmd(device, + ccb, + /*retries*/retry_count, + /*flags*/CAM_DIR_IN, + /*protocol*/AP_PROTO_PIO_IN, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/command, + /*features*/0, + /*lba*/0, + /*sector_count*/(u_int8_t)sizeof(struct ata_params), + /*data_ptr*/(u_int8_t *)ptr, + /*dxfer_len*/sizeof(struct ata_params), + /*timeout*/timeout ? timeout : 30 * 1000, + /*quiet*/1); if (error != 0) { - free(ptr); - return(error); + if (retry_command == 0) { + free(ptr); + return (1); + } + error = ata_do_28bit_cmd(device, + ccb, + /*retries*/retry_count, + /*flags*/CAM_DIR_IN, + /*protocol*/AP_PROTO_PIO_IN, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/retry_command, + /*features*/0, + /*lba*/0, + /*sector_count*/(u_int8_t) + sizeof(struct ata_params), + /*data_ptr*/(u_int8_t *)ptr, + /*dxfer_len*/sizeof(struct ata_params), + /*timeout*/timeout ? timeout : 30 * 1000, + /*quiet*/0); + + if (error != 0) { + free(ptr); + return (1); + } } - for (i = 0; i < sizeof(struct ata_params) / 2; i++) + error = 1; + for (i = 0; i < sizeof(struct ata_params) / 2; i++) { ptr[i] = le16toh(ptr[i]); + if (ptr[i] != 0) + error = 0; + } + if (arglist & CAM_ARG_VERBOSE) { fprintf(stdout, "%s%d: Raw identify data:\n", device->device_name, device->dev_unit_num); - for (i = 0; i < sizeof(struct ata_params) / 2; i++) { - if ((i % 8) == 0) - fprintf(stdout, " %3d: ", i); - fprintf(stdout, "%04x ", (uint16_t)ptr[i]); - if ((i % 8) == 7) - fprintf(stdout, "\n"); - } + dump_data(ptr, sizeof(struct ata_params)); + } + + /* check for invalid (all zero) response */ + if (error != 0) { + warnx("Invalid identify response detected"); + free(ptr); + return (error); } + ident_buf = (struct ata_params *)ptr; if (strncmp(ident_buf->model, "FX", 2) && strncmp(ident_buf->model, "NEC", 3) && @@ -1378,15 +1622,636 @@ ataidentify(struct cam_device *device, i ata_bpack(ident_buf->media_serial, ident_buf->media_serial, sizeof(ident_buf->media_serial)); - fprintf(stdout, "%s%d: ", device->device_name, - device->dev_unit_num); + *ident_bufp = ident_buf; + + return (0); +} + + +static int +ataidentify(struct cam_device *device, int retry_count, int timeout) +{ + union ccb *ccb; + struct ata_params *ident_buf; + + if ((ccb = cam_getccb(device)) == NULL) { + warnx("couldn't allocate CCB"); + return (1); + } + + if (ata_do_identify(device, retry_count, timeout, ccb, &ident_buf) != 0) { + cam_freeccb(ccb); + return (1); + } + + printf("%s%d: ", device->device_name, device->dev_unit_num); ata_print_ident(ident_buf); camxferrate(device); atacapprint(ident_buf); free(ident_buf); + cam_freeccb(ccb); - return(0); + return (0); +} +#endif /* MINIMALISTIC */ + + +#ifndef MINIMALISTIC +enum { + ATA_SECURITY_ACTION_PRINT, + ATA_SECURITY_ACTION_FREEZE, + ATA_SECURITY_ACTION_UNLOCK, + ATA_SECURITY_ACTION_DISABLE, + ATA_SECURITY_ACTION_ERASE, + ATA_SECURITY_ACTION_ERASE_ENHANCED, + ATA_SECURITY_ACTION_SET_PASSWORD +} atasecurity_action; + +static void +atasecurity_print_time(u_int16_t tw) +{ + + if (tw == 0) + printf("unspecified"); + else if (tw >= 255) + printf("> 508 min"); + else + printf("%i min", 2 * tw); +} + +static u_int32_t +atasecurity_erase_timeout_msecs(u_int16_t timeout) +{ + + if (timeout == 0) + return 2 * 3600 * 1000; /* default: two hours */ + else if (timeout > 255) + return (508 + 60) * 60 * 1000; /* spec says > 508 minutes */ + + return ((2 * timeout) + 5) * 60 * 1000; /* add a 5min margin */ +} + + +static void +atasecurity_notify(u_int8_t command, struct ata_security_password *pwd) +{ + struct ata_cmd cmd; + + bzero(&cmd, sizeof(cmd)); + cmd.command = command; + printf("Issuing %s", ata_op_string(&cmd)); + + if (pwd != NULL) { + char pass[sizeof(pwd->password)+1]; + + /* pwd->password may not be null terminated */ + pass[sizeof(pwd->password)] = '\0'; + strncpy(pass, pwd->password, sizeof(pwd->password)); + printf(" password='%s', user='%s'", + pass, + (pwd->ctrl & ATA_SECURITY_PASSWORD_MASTER) ? + "master" : "user"); + + if (command == ATA_SECURITY_SET_PASSWORD) { + printf(", mode='%s'", + (pwd->ctrl & ATA_SECURITY_LEVEL_MAXIMUM) ? + "maximum" : "high"); + } + } + + printf("\n"); +} + +static int +atasecurity_freeze(struct cam_device *device, union ccb *ccb, + int retry_count, u_int32_t timeout, int quiet) +{ + + if (quiet == 0) + atasecurity_notify(ATA_SECURITY_FREEZE_LOCK, NULL); + + return ata_do_28bit_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_FREEZE_LOCK, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/timeout, + /*quiet*/0); +} + +static int +atasecurity_unlock(struct cam_device *device, union ccb *ccb, + int retry_count, u_int32_t timeout, + struct ata_security_password *pwd, int quiet) +{ + + if (quiet == 0) + atasecurity_notify(ATA_SECURITY_UNLOCK, pwd); + + return ata_do_28bit_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_UNLOCK, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/timeout, + /*quiet*/0); +} + +static int +atasecurity_disable(struct cam_device *device, union ccb *ccb, + int retry_count, u_int32_t timeout, + struct ata_security_password *pwd, int quiet) +{ + + if (quiet == 0) + atasecurity_notify(ATA_SECURITY_DISABLE_PASSWORD, pwd); + return ata_do_28bit_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_DISABLE_PASSWORD, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/timeout, + /*quiet*/0); +} + + +static int +atasecurity_erase_confirm(struct cam_device *device, + struct ata_params* ident_buf) +{ + + printf("\nYou are about to ERASE ALL DATA from the following" + " device:\n%s%d,%s%d: ", device->device_name, + device->dev_unit_num, device->given_dev_name, + device->given_unit_number); + ata_print_ident(ident_buf); + + for(;;) { + char str[50]; + printf("\nAre you SURE you want to ERASE ALL DATA? (yes/no) "); + + if (fgets(str, sizeof(str), stdin) != NULL) { + if (strncasecmp(str, "yes", 3) == 0) { + return (1); + } else if (strncasecmp(str, "no", 2) == 0) { + return (0); + } else { + printf("Please answer \"yes\" or " + "\"no\"\n"); + } + } + } + + /* NOTREACHED */ + return (0); +} + +static int +atasecurity_erase(struct cam_device *device, union ccb *ccb, + int retry_count, u_int32_t timeout, + u_int32_t erase_timeout, + struct ata_security_password *pwd, int quiet) +{ + int error; + + if (quiet == 0) + atasecurity_notify(ATA_SECURITY_ERASE_PREPARE, NULL); + + error = ata_do_28bit_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_ERASE_PREPARE, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/timeout, + /*quiet*/0); + + if (error != 0) + return error; + + if (quiet == 0) + atasecurity_notify(ATA_SECURITY_ERASE_UNIT, pwd); + + error = ata_do_28bit_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_ERASE_UNIT, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/erase_timeout, + /*quiet*/0); + + if (error == 0 && quiet == 0) + printf("\nErase Complete\n"); + + return error; +} + +static int +atasecurity_set_password(struct cam_device *device, union ccb *ccb, + int retry_count, u_int32_t timeout, + struct ata_security_password *pwd, int quiet) +{ + + if (quiet == 0) + atasecurity_notify(ATA_SECURITY_SET_PASSWORD, pwd); + + return ata_do_28bit_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_SET_PASSWORD, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/timeout, + /*quiet*/0); +} + +static void +atasecurity_print(struct ata_params *parm) +{ + + printf("\nSecurity Option Value\n"); + if (arglist & CAM_ARG_VERBOSE) { + printf("status %04x\n", + parm->security_status); + } + printf("supported %s\n", + parm->security_status & ATA_SECURITY_SUPPORTED ? "yes" : "no"); + if (!(parm->security_status & ATA_SECURITY_SUPPORTED)) + return; + printf("enabled %s\n", + parm->security_status & ATA_SECURITY_ENABLED ? "yes" : "no"); + printf("drive locked %s\n", + parm->security_status & ATA_SECURITY_LOCKED ? "yes" : "no"); + printf("security config frozen %s\n", + parm->security_status & ATA_SECURITY_FROZEN ? "yes" : "no"); + printf("count expired %s\n", + parm->security_status & ATA_SECURITY_COUNT_EXP ? "yes" : "no"); + printf("security level %s\n", + parm->security_status & ATA_SECURITY_LEVEL ? "maximum" : "high"); + printf("enhanced erase supported %s\n", + parm->security_status & ATA_SECURITY_ENH_SUPP ? "yes" : "no"); + printf("erase time "); + atasecurity_print_time(parm->erase_time); + printf("\n"); + printf("enhanced erase time "); + atasecurity_print_time(parm->enhanced_erase_time); + printf("\n"); + printf("master password rev %04x%s\n", + parm->master_passwd_revision, + parm->master_passwd_revision == 0x0000 || + parm->master_passwd_revision == 0xFFFF ? " (unsupported)" : ""); +} + +/* + * Validates and copies the password in optarg to the passed buffer. + * If the password in optarg is the same length as the buffer then + * the data will still be copied but no null termination will occur. + */ +static int +ata_getpwd(u_int8_t *passwd, int max, char opt) +{ + int len; + + len = strlen(optarg); + if (len > max) { + warnx("-%c password is too long", opt); + return (1); + } else if (len == 0) { + warnx("-%c password is missing", opt); + return (1); + } else if (optarg[0] == '-'){ + warnx("-%c password starts with '-' (generic arg?)", opt); + return (1); + } else if (strlen(passwd) != 0 && strcmp(passwd, optarg) != 0) { + warnx("-%c password conflicts with existing password from -%c", + opt, pwd_opt); + return (1); + } + + /* Callers pass in a buffer which does NOT need to be terminated */ + strncpy(passwd, optarg, max); + pwd_opt = opt; + + return (0); +} + +static int +atasecurity(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt) +{ + union ccb *ccb; + struct ata_params *ident_buf; + int error, confirm, quiet, c, action, actions, setpwd; + int security_enabled, erase_timeout, pwdsize; + struct ata_security_password pwd; + + actions = 0; + setpwd = 0; + erase_timeout = 0; + confirm = 0; + quiet = 0; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 7 13:59:42 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7EF907C3; Fri, 7 Jun 2013 13:59:42 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 61D4510C3; Fri, 7 Jun 2013 13:59:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r57DxgRg023366; Fri, 7 Jun 2013 13:59:42 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r57Dxfgd023363; Fri, 7 Jun 2013 13:59:41 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306071359.r57Dxfgd023363@svn.freebsd.org> From: Steven Hartland Date: Fri, 7 Jun 2013 13:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251496 - in stable/8: sbin/camcontrol sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 07 Jun 2013 13:59:42 -0000 Author: smh Date: Fri Jun 7 13:59:41 2013 New Revision: 251496 URL: http://svnweb.freebsd.org/changeset/base/251496 Log: MFC r249895: Add Host Protected Area (HPA) support to camcontrol MFC r249904: mdoc: remove superfluous paragraph macro. MFC r249153: (included in r251494) mdoc: remove superfluous paragraph macro. Modified: stable/8/sbin/camcontrol/camcontrol.8 stable/8/sbin/camcontrol/camcontrol.c stable/8/sys/sys/ata.h Directory Properties: stable/8/sbin/camcontrol/ (props changed) stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.8 Fri Jun 7 13:45:58 2013 (r251495) +++ stable/8/sbin/camcontrol/camcontrol.8 Fri Jun 7 13:59:41 2013 (r251496) @@ -199,6 +199,18 @@ .Op Fl U Ar user|master .Op Fl y .Nm +.Ic hpa +.Op device id +.Op generic args +.Op Fl f +.Op Fl l +.Op Fl P +.Op Fl p Ar pwd +.Op Fl q +.Op Fl s Ar max_sectors +.Op Fl U Ar pwd +.Op Fl y +.Nm .Ic help .Sh DESCRIPTION The @@ -988,6 +1000,73 @@ password for the specified user the comm .Pp The password in all cases is limited to 32 characters, longer passwords will fail. +.It Ic hpa +Update or report Host Protected Area details. +By default +.Nm +will print out the HPA support and associated settings of the device. +The +.Ic hpa +command takes several optional arguments: +.Bl -tag -width 0n +.It Fl f +.Pp +Freeze the HPA configuration of the specified device. +.Pp +After command completion any other commands that update the HPA configuration +shall be command aborted. +Frozen mode is disabled by power-off or hardware reset. +.It Fl l +.Pp +Lock the HPA configuration of the device until a successful call to unlock or +the next power-on reset occurs. +.It Fl P +.Pp +Make the HPA max sectors persist across power-on reset or a hardware reset. +This must be used in combination with +.Fl s Ar max_sectors +. +.It Fl p Ar pwd +.Pp +Set the HPA configuration password required for unlock calls. +.It Fl q +.Pp +Be quiet, do not print any status messages. +This option will not disable the questions. +To disable questions, use the +.Fl y +argument, below. +.It Fl s Ar max_sectors +.Pp +Configures the maximum user accessible sectors of the device. +This will change the number of sectors the device reports. +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +Changing the max sectors of a device using this option will make the data on +the device beyond the specified value inaccessible. +.Pp +Only one successful +.Fl s Ar max_sectors +call can be made without a power-on reset or a hardware reset of the device. +.It Fl U Ar pwd +.Pp +Unlock the HPA configuration of the specified device using the given password. +If the password specified doesn't match the password configured via +.Fl p Ar pwd +the command will fail. +.Pp +After 5 failed unlock calls, due to password miss-match, the device will refuse +additional unlock calls until after a power-on reset. +.It Fl y +.Pp +Confirm yes to dangerous options such as +.Fl e +without prompting for confirmation +.Pp +.El +The password for all HPA commands is limited to 32 characters, longer passwords +will fail. .It Ic help Print out verbose usage information. .El @@ -1130,6 +1209,28 @@ data from the device, so backup your dat .Pp This command can be used used against an SSD drive to restoring it to factory default write performance. +.Bd -literal -offset indent +camcontrol hpa ada0 +.Ed +.Pp +Report HPA support and settings for ada0 (also reported via +identify). +.Bd -literal -offset indent +camcontrol hpa ada0 -s 10240 +.Ed +.Pp +Enables HPA on ada0 setting the maximum reported sectors to 10240. +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +This will +.Em PREVENT ACCESS +to all data on the device beyond this limit until HPA is disabled by setting +HPA to native max sectors of the device, which can only be done after a +power-on or hardware reset! +.Pp +.Em DO NOT +use this on a device which has an active filesystem! .Sh SEE ALSO .Xr cam 3 , .Xr cam_cdbparse 3 , Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Fri Jun 7 13:45:58 2013 (r251495) +++ stable/8/sbin/camcontrol/camcontrol.c Fri Jun 7 13:59:41 2013 (r251496) @@ -42,6 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifndef MINIMALISTIC +#include +#include +#endif #include #include @@ -78,7 +82,8 @@ typedef enum { CAM_CMD_IDLE = 0x00000014, CAM_CMD_STANDBY = 0x00000015, CAM_CMD_SLEEP = 0x00000016, - CAM_CMD_SECURITY = 0x00000017 + CAM_CMD_SECURITY = 0x00000017, + CAM_CMD_HPA = 0x00000018 } cam_cmdmask; typedef enum { @@ -125,6 +130,29 @@ struct camcontrol_opts { }; #ifndef MINIMALISTIC +struct ata_res_pass16 { + u_int16_t reserved[5]; + u_int8_t flags; + u_int8_t error; + u_int8_t sector_count_exp; + u_int8_t sector_count; + u_int8_t lba_low_exp; + u_int8_t lba_low; + u_int8_t lba_mid_exp; + u_int8_t lba_mid; + u_int8_t lba_high_exp; + u_int8_t lba_high; + u_int8_t device; + u_int8_t status; +}; + +struct ata_set_max_pwd +{ + u_int16_t reserved1; + u_int8_t password[32]; + u_int16_t reserved2[239]; +}; + static const char scsicmd_opts[] = "a:c:dfi:o:r"; static const char readdefect_opts[] = "f:GP"; static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; @@ -164,6 +192,7 @@ struct camcontrol_opts option_table[] = {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, {"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"}, + {"hpa", CAM_CMD_HPA, CAM_ARG_NONE, "Pflp:qs:U:y"}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -231,6 +260,8 @@ static int atapm(struct cam_device *devi char *combinedopt, int retry_count, int timeout); static int atasecurity(struct cam_device *device, int retry_count, int timeout, int argc, char **argv, char *combinedopt); +static int atahpa(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt); #endif /* MINIMALISTIC */ #ifndef min @@ -1060,6 +1091,38 @@ xferrate_bailout: } static void +atahpa_print(struct ata_params *parm, u_int64_t hpasize, int header) +{ + u_int32_t lbasize = (u_int32_t)parm->lba_size_1 | + ((u_int32_t)parm->lba_size_2 << 16); + + u_int64_t lbasize48 = ((u_int64_t)parm->lba_size48_1) | + ((u_int64_t)parm->lba_size48_2 << 16) | + ((u_int64_t)parm->lba_size48_3 << 32) | + ((u_int64_t)parm->lba_size48_4 << 48); + + if (header) { + printf("\nFeature " + "Support Enabled Value\n"); + } + + printf("Host Protected Area (HPA) "); + if (parm->support.command1 & ATA_SUPPORT_PROTECTED) { + u_int64_t lba = lbasize48 ? lbasize48 : lbasize; + printf("yes %s %ju/%ju\n", (hpasize > lba) ? "yes" : "no ", + lba, hpasize); + + printf("HPA - Security "); + if (parm->support.command1 & ATA_SUPPORT_MAXSECURITY) + printf("yes\n"); + else + printf("no\n"); + } else { + printf("no\n"); + } +} + +static void atacapprint(struct ata_params *parm) { u_int32_t lbasize = (u_int32_t)parm->lba_size_1 | @@ -1486,6 +1549,83 @@ ata_do_28bit_cmd(struct cam_device *devi return ata_cam_send(device, ccb, quiet); } +static int +ata_do_cmd(struct cam_device *device, union ccb *ccb, int retries, + u_int32_t flags, u_int8_t protocol, u_int8_t ata_flags, + u_int8_t tag_action, u_int8_t command, u_int8_t features, + u_int64_t lba, u_int8_t sector_count, u_int8_t *data_ptr, + u_int16_t dxfer_len, int timeout, int force48bit) +{ + int retval; + + retval = ata_try_pass_16(device); + if (retval == -1) + return (1); + + if (retval == 1) { + int error; + + /* Try using SCSI Passthrough */ + error = ata_do_pass_16(device, ccb, retries, flags, protocol, + ata_flags, tag_action, command, features, + lba, sector_count, data_ptr, dxfer_len, + timeout, 0); + + if (ata_flags & AP_FLAG_CHK_COND) { + /* Decode ata_res from sense data */ + struct ata_res_pass16 *res_pass16; + struct ata_res *res; + u_int i; + u_int16_t *ptr; + + /* sense_data is 4 byte aligned */ + ptr = (uint16_t*)(uintptr_t)&ccb->csio.sense_data; + for (i = 0; i < sizeof(*res_pass16) / 2; i++) + ptr[i] = le16toh(ptr[i]); + + /* sense_data is 4 byte aligned */ + res_pass16 = (struct ata_res_pass16 *)(uintptr_t) + &ccb->csio.sense_data; + res = &ccb->ataio.res; + res->flags = res_pass16->flags; + res->status = res_pass16->status; + res->error = res_pass16->error; + res->lba_low = res_pass16->lba_low; + res->lba_mid = res_pass16->lba_mid; + res->lba_high = res_pass16->lba_high; + res->device = res_pass16->device; + res->lba_low_exp = res_pass16->lba_low_exp; + res->lba_mid_exp = res_pass16->lba_mid_exp; + res->lba_high_exp = res_pass16->lba_high_exp; + res->sector_count = res_pass16->sector_count; + res->sector_count_exp = res_pass16->sector_count_exp; + } + + return (error); + } + + bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_ataio) - + sizeof(struct ccb_hdr)); + cam_fill_ataio(&ccb->ataio, + retries, + NULL, + flags, + tag_action, + data_ptr, + dxfer_len, + timeout); + + if (force48bit || lba > ATA_MAX_28BIT_LBA) + ata_48bit_cmd(&ccb->ataio, command, features, lba, sector_count); + else + ata_28bit_cmd(&ccb->ataio, command, features, lba, sector_count); + + if (ata_flags & AP_FLAG_CHK_COND) + ccb->ataio.cmd.flags |= CAM_ATAIO_NEEDRESULT; + + return ata_cam_send(device, ccb, 0); +} + static void dump_data(uint16_t *ptr, uint32_t len) { @@ -1503,6 +1643,278 @@ dump_data(uint16_t *ptr, uint32_t len) } static int +atahpa_proc_resp(struct cam_device *device, union ccb *ccb, + int is48bit, u_int64_t *hpasize) +{ + struct ata_res *res; + + res = &ccb->ataio.res; + if (res->status & ATA_STATUS_ERROR) { + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + printf("error = 0x%02x, sector_count = 0x%04x, " + "device = 0x%02x, status = 0x%02x\n", + res->error, res->sector_count, + res->device, res->status); + } + + if (res->error & ATA_ERROR_ID_NOT_FOUND) { + warnx("Max address has already been set since " + "last power-on or hardware reset"); + } + + return (1); + } + + if (arglist & CAM_ARG_VERBOSE) { + fprintf(stdout, "%s%d: Raw native max data:\n", + device->device_name, device->dev_unit_num); + /* res is 4 byte aligned */ + dump_data((uint16_t*)(uintptr_t)res, sizeof(struct ata_res)); + + printf("error = 0x%02x, sector_count = 0x%04x, device = 0x%02x, " + "status = 0x%02x\n", res->error, res->sector_count, + res->device, res->status); + } + + if (hpasize != NULL) { + if (is48bit) { + *hpasize = (((u_int64_t)((res->lba_high_exp << 16) | + (res->lba_mid_exp << 8) | res->lba_low_exp) << 24) | + ((res->lba_high << 16) | (res->lba_mid << 8) | + res->lba_low)) + 1; + } else { + *hpasize = (((res->device & 0x0f) << 24) | + (res->lba_high << 16) | (res->lba_mid << 8) | + res->lba_low) + 1; + } + } + + return (0); +} + +static int +ata_read_native_max(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, + struct ata_params *parm, u_int64_t *hpasize) +{ + int error; + u_int cmd, is48bit; + u_int8_t protocol; + + is48bit = parm->support.command2 & ATA_SUPPORT_ADDRESS48; + protocol = AP_PROTO_NON_DATA; + + if (is48bit) { + cmd = ATA_READ_NATIVE_MAX_ADDRESS48; + protocol |= AP_EXTEND; + } else { + cmd = ATA_READ_NATIVE_MAX_ADDRESS; + } + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_IN, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, hpasize); +} + +static int +atahpa_set_max(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, + int is48bit, u_int64_t maxsize, int persist) +{ + int error; + u_int cmd; + u_int8_t protocol; + + protocol = AP_PROTO_NON_DATA; + + if (is48bit) { + cmd = ATA_SET_MAX_ADDRESS48; + protocol |= AP_EXTEND; + } else { + cmd = ATA_SET_MAX_ADDRESS; + } + + /* lba's are zero indexed so the max lba is requested max - 1 */ + if (maxsize) + maxsize--; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/ATA_HPA_FEAT_MAX_ADDR, + /*lba*/maxsize, + /*sector_count*/persist, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, NULL); +} + +static int +atahpa_password(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, + int is48bit, struct ata_set_max_pwd *pwd) +{ + int error; + u_int cmd; + u_int8_t protocol; + + protocol = AP_PROTO_PIO_OUT; + cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/ATA_HPA_FEAT_SET_PWD, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/(u_int8_t*)pwd, + /*dxfer_len*/sizeof(struct ata_set_max_pwd), + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, NULL); +} + +static int +atahpa_lock(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, int is48bit) +{ + int error; + u_int cmd; + u_int8_t protocol; + + protocol = AP_PROTO_NON_DATA; + cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/ATA_HPA_FEAT_LOCK, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, NULL); +} + +static int +atahpa_unlock(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, + int is48bit, struct ata_set_max_pwd *pwd) +{ + int error; + u_int cmd; + u_int8_t protocol; + + protocol = AP_PROTO_PIO_OUT; + cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/ATA_HPA_FEAT_UNLOCK, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/(u_int8_t*)pwd, + /*dxfer_len*/sizeof(struct ata_set_max_pwd), + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, NULL); +} + +static int +atahpa_freeze_lock(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, int is48bit) +{ + int error; + u_int cmd; + u_int8_t protocol; + + protocol = AP_PROTO_NON_DATA; + cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/ATA_HPA_FEAT_FREEZE, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, NULL); +} + + +static int ata_do_identify(struct cam_device *device, int retry_count, int timeout, union ccb *ccb, struct ata_params** ident_bufp) { @@ -1633,6 +2045,7 @@ ataidentify(struct cam_device *device, i { union ccb *ccb; struct ata_params *ident_buf; + u_int64_t hpasize; if ((ccb = cam_getccb(device)) == NULL) { warnx("couldn't allocate CCB"); @@ -1644,10 +2057,21 @@ ataidentify(struct cam_device *device, i return (1); } + if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) { + if (ata_read_native_max(device, retry_count, timeout, ccb, + ident_buf, &hpasize) != 0) { + cam_freeccb(ccb); + return (1); + } + } else { + hpasize = 0; + } + printf("%s%d: ", device->device_name, device->dev_unit_num); ata_print_ident(ident_buf); camxferrate(device); atacapprint(ident_buf); + atahpa_print(ident_buf, hpasize, 0); free(ident_buf); cam_freeccb(ccb); @@ -1976,6 +2400,245 @@ ata_getpwd(u_int8_t *passwd, int max, ch return (0); } +enum { + ATA_HPA_ACTION_PRINT, + ATA_HPA_ACTION_SET_MAX, + ATA_HPA_ACTION_SET_PWD, + ATA_HPA_ACTION_LOCK, + ATA_HPA_ACTION_UNLOCK, + ATA_HPA_ACTION_FREEZE_LOCK +}; + +static int +atahpa_set_confirm(struct cam_device *device, struct ata_params* ident_buf, + u_int64_t maxsize, int persist) +{ + printf("\nYou are about to configure HPA to limit the user accessible\n" + "sectors to %ju %s on the device:\n%s%d,%s%d: ", maxsize, + persist ? "persistently" : "temporarily", + device->device_name, device->dev_unit_num, + device->given_dev_name, device->given_unit_number); + ata_print_ident(ident_buf); + + for(;;) { + char str[50]; + printf("\nAre you SURE you want to configure HPA? (yes/no) "); + + if (NULL != fgets(str, sizeof(str), stdin)) { + if (0 == strncasecmp(str, "yes", 3)) { + return (1); + } else if (0 == strncasecmp(str, "no", 2)) { + return (0); + } else { + printf("Please answer \"yes\" or " + "\"no\"\n"); + } + } + } + + /* NOTREACHED */ + return (0); +} + +static int +atahpa(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt) +{ + union ccb *ccb; + struct ata_params *ident_buf; + struct ccb_getdev cgd; + struct ata_set_max_pwd pwd; + int error, confirm, quiet, c, action, actions, setpwd, persist; + int security, is48bit, pwdsize; + u_int64_t hpasize, maxsize; + + actions = 0; + setpwd = 0; + confirm = 0; + quiet = 0; + maxsize = 0; + persist = 0; + security = 0; + + memset(&pwd, 0, sizeof(pwd)); + + /* default action is to print hpa information */ + action = ATA_HPA_ACTION_PRINT; + pwdsize = sizeof(pwd.password); + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch(c){ + case 's': + action = ATA_HPA_ACTION_SET_MAX; + maxsize = strtoumax(optarg, NULL, 0); + actions++; + break; + + case 'p': + if (ata_getpwd(pwd.password, pwdsize, c) != 0) + return (1); + action = ATA_HPA_ACTION_SET_PWD; + security = 1; + actions++; + break; + + case 'l': + action = ATA_HPA_ACTION_LOCK; + security = 1; + actions++; + break; + + case 'U': + if (ata_getpwd(pwd.password, pwdsize, c) != 0) + return (1); + action = ATA_HPA_ACTION_UNLOCK; + security = 1; + actions++; + break; + + case 'f': + action = ATA_HPA_ACTION_FREEZE_LOCK; + security = 1; + actions++; + break; + + case 'P': + persist = 1; + break; + + case 'y': + confirm++; + break; + + case 'q': + quiet++; + break; + } + } + + if (actions > 1) { + warnx("too many hpa actions specified"); + return (1); + } + + if (get_cgd(device, &cgd) != 0) { + warnx("couldn't get CGD"); + return (1); + } + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("couldn't allocate CCB"); + return (1); + } + + error = ata_do_identify(device, retry_count, timeout, ccb, &ident_buf); + if (error != 0) { + cam_freeccb(ccb); + return (1); + } + + if (quiet == 0) { + printf("%s%d: ", device->device_name, device->dev_unit_num); + ata_print_ident(ident_buf); + camxferrate(device); + } + + if (action == ATA_HPA_ACTION_PRINT) { + error = ata_read_native_max(device, retry_count, timeout, ccb, + ident_buf, &hpasize); + if (error == 0) + atahpa_print(ident_buf, hpasize, 1); + + cam_freeccb(ccb); + free(ident_buf); + return (error); + } + + if (!(ident_buf->support.command1 & ATA_SUPPORT_PROTECTED)) { + warnx("HPA is not supported by this device"); + cam_freeccb(ccb); + free(ident_buf); + return (1); + } + + if (security && !(ident_buf->support.command1 & ATA_SUPPORT_MAXSECURITY)) { + warnx("HPA Security is not supported by this device"); + cam_freeccb(ccb); + free(ident_buf); + return (1); + } + + is48bit = ident_buf->support.command2 & ATA_SUPPORT_ADDRESS48; + + /* + * The ATA spec requires: + * 1. Read native max addr is called directly before set max addr + * 2. Read native max addr is NOT called before any other set max call + */ + switch(action) { + case ATA_HPA_ACTION_SET_MAX: + if (confirm == 0 && + atahpa_set_confirm(device, ident_buf, maxsize, + persist) == 0) { + cam_freeccb(ccb); + free(ident_buf); + return (1); + } + + error = ata_read_native_max(device, retry_count, timeout, + ccb, ident_buf, &hpasize); + if (error == 0) { + error = atahpa_set_max(device, retry_count, timeout, + ccb, is48bit, maxsize, persist); + if (error == 0) { + /* redo identify to get new lba values */ + error = ata_do_identify(device, retry_count, + timeout, ccb, + &ident_buf); + atahpa_print(ident_buf, hpasize, 1); + } + } + break; + + case ATA_HPA_ACTION_SET_PWD: + error = atahpa_password(device, retry_count, timeout, + ccb, is48bit, &pwd); + if (error == 0) + printf("HPA password has been set\n"); + break; + + case ATA_HPA_ACTION_LOCK: + error = atahpa_lock(device, retry_count, timeout, + ccb, is48bit); + if (error == 0) + printf("HPA has been locked\n"); + break; + + case ATA_HPA_ACTION_UNLOCK: + error = atahpa_unlock(device, retry_count, timeout, + ccb, is48bit, &pwd); + if (error == 0) + printf("HPA has been unlocked\n"); + break; + + case ATA_HPA_ACTION_FREEZE_LOCK: + error = atahpa_freeze_lock(device, retry_count, timeout, + ccb, is48bit); + if (error == 0) + printf("HPA has been frozen\n"); + break; + + default: + errx(1, "Option currently not supported"); + } + + cam_freeccb(ccb); + free(ident_buf); + + return (error); +} + static int atasecurity(struct cam_device *device, int retry_count, int timeout, int argc, char **argv, char *combinedopt) @@ -5319,6 +5982,8 @@ usage(int verbose) " <-d pwd | -e pwd | -f | -h pwd | -k pwd>\n" " [-l ] [-q] [-s pwd] [-T timeout]\n" " [-U ] [-y]\n" +" camcontrol hpa [dev_id][generic args] [-f] [-l] [-P] [-p pwd]\n" +" [-q] [-s max_sectors] [-U pwd] [-y]\n" #endif /* MINIMALISTIC */ " camcontrol help\n"); if (!verbose) @@ -5436,6 +6101,17 @@ usage(int verbose) "-T timeout overrides the timeout (seconds) used for erase operation\n" "-U specifies which user to set: user or master\n" "-y don't ask any questions\n" +"hpa arguments:\n" +"-f freeze the HPA configuration of the device\n" +"-l lock the HPA configuration of the device\n" +"-P make the HPA max sectors persist\n" +"-p pwd Set the HPA configuration password required for unlock\n" +" calls\n" +"-q be quiet, do not print any status messages\n" +"-s sectors configures the maximum user accessible sectors of the\n" +" device\n" +"-U pwd unlock the HPA configuration of the device\n" +"-y don't ask any questions\n" ); #endif /* MINIMALISTIC */ } @@ -5660,6 +6336,10 @@ main(int argc, char **argv) case CAM_CMD_DEVLIST: error = getdevlist(cam_dev); break; + case CAM_CMD_HPA: + error = atahpa(cam_dev, retry_count, timeout, + argc, argv, combinedopt); + break; #endif /* MINIMALISTIC */ case CAM_CMD_DEVTREE: error = getdevtree(); Modified: stable/8/sys/sys/ata.h ============================================================================== --- stable/8/sys/sys/ata.h Fri Jun 7 13:45:58 2013 (r251495) +++ stable/8/sys/sys/ata.h Fri Jun 7 13:59:41 2013 (r251496) @@ -289,6 +289,23 @@ struct ata_params { #define ATA_DEV_SLAVE 0x10 #define ATA_DEV_LBA 0x40 +/* ATA limits */ +#define ATA_MAX_28BIT_LBA 268435455UL + +/* ATA Status Register */ +#define ATA_STATUS_ERROR 0x01 +#define ATA_STATUS_DEVICE_FAULT 0x20 + +/* ATA Error Register */ +#define ATA_ERROR_ABORT 0x04 +#define ATA_ERROR_ID_NOT_FOUND 0x10 + +/* ATA HPA Features */ +#define ATA_HPA_FEAT_MAX_ADDR 0x00 +#define ATA_HPA_FEAT_SET_PWD 0x01 +#define ATA_HPA_FEAT_LOCK 0x02 +#define ATA_HPA_FEAT_UNLOCK 0x03 +#define ATA_HPA_FEAT_FREEZE 0x04 /* ATA transfer modes */ #define ATA_MODE_MASK 0x0f From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 7 15:52:33 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8C681EE; Fri, 7 Jun 2013 15:52:33 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7EAAB17AF; Fri, 7 Jun 2013 15:52:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r57FqXSs061898; Fri, 7 Jun 2013 15:52:33 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r57FqXvO061897; Fri, 7 Jun 2013 15:52:33 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201306071552.r57FqXvO061897@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 7 Jun 2013 15:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251500 - stable/8 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 07 Jun 2013 15:52:33 -0000 Author: pluknet Date: Fri Jun 7 15:52:33 2013 New Revision: 251500 URL: http://svnweb.freebsd.org/changeset/base/251500 Log: Add the entry for 8.4-RELEASE. Modified: stable/8/UPDATING Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Fri Jun 7 14:30:06 2013 (r251499) +++ stable/8/UPDATING Fri Jun 7 15:52:33 2013 (r251500) @@ -15,6 +15,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20130607: + 8.4-RELEASE. + 20130524: `list' command has been added to hastctl(8). For now, it is full equivalent of `status' command. From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 7 21:39:49 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01A6873C; Fri, 7 Jun 2013 21:39:48 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E535D16E1; Fri, 7 Jun 2013 21:39:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r57LdmWx069109; Fri, 7 Jun 2013 21:39:48 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r57LdlEl069096; Fri, 7 Jun 2013 21:39:47 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201306072139.r57LdlEl069096@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 7 Jun 2013 21:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251511 - in stable/8: etc/mtree include sys/dev/filemon sys/modules/filemon tools/regression/filemon X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 07 Jun 2013 21:39:49 -0000 Author: obrien Date: Fri Jun 7 21:39:46 2013 New Revision: 251511 URL: http://svnweb.freebsd.org/changeset/base/251511 Log: MF9: r237968, r251504: MFC: r251368, r251382: Match the options of the kernel. MFC: r237279: install filemon.h into /usr/include for userland consumption. Modified: stable/8/etc/mtree/BSD.include.dist stable/8/include/Makefile stable/8/sys/dev/filemon/filemon.c stable/8/sys/dev/filemon/filemon_wrapper.c stable/8/sys/modules/filemon/Makefile stable/8/tools/regression/filemon/Makefile stable/8/tools/regression/filemon/filemontest.c stable/8/tools/regression/filemon/test_script.sh Directory Properties: stable/8/ (props changed) stable/8/etc/ (props changed) stable/8/include/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/modules/ (props changed) stable/8/tools/ (props changed) Modified: stable/8/etc/mtree/BSD.include.dist ============================================================================== --- stable/8/etc/mtree/BSD.include.dist Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/etc/mtree/BSD.include.dist Fri Jun 7 21:39:46 2013 (r251511) @@ -96,6 +96,8 @@ .. ciss .. + filemon + .. firewire .. hwpmc Modified: stable/8/include/Makefile ============================================================================== --- stable/8/include/Makefile Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/include/Makefile Fri Jun 7 21:39:46 2013 (r251511) @@ -39,7 +39,8 @@ LDIRS= bsm cam geom net net80211 netatal sys vm LSUBDIRS= cam/ata cam/scsi \ - dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/firewire dev/hwpmc \ + dev/acpica dev/agp dev/an dev/bktr dev/ciss \ + dev/filemon dev/firewire dev/hwpmc \ dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \ dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ Modified: stable/8/sys/dev/filemon/filemon.c ============================================================================== --- stable/8/sys/dev/filemon/filemon.c Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/sys/dev/filemon/filemon.c Fri Jun 7 21:39:46 2013 (r251511) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include Modified: stable/8/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- stable/8/sys/dev/filemon/filemon_wrapper.c Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/sys/dev/filemon/filemon_wrapper.c Fri Jun 7 21:39:46 2013 (r251511) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #if __FreeBSD_version > 800032 #define FILEMON_HAS_LINKAT #endif Modified: stable/8/sys/modules/filemon/Makefile ============================================================================== --- stable/8/sys/modules/filemon/Makefile Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/sys/modules/filemon/Makefile Fri Jun 7 21:39:46 2013 (r251511) @@ -4,6 +4,6 @@ KMOD= filemon SRCS= ${KMOD}.c -SRCS+= vnode_if.h opt_compat.h opt_capsicum.h +SRCS+= opt_compat.h .include Modified: stable/8/tools/regression/filemon/Makefile ============================================================================== --- stable/8/tools/regression/filemon/Makefile Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/tools/regression/filemon/Makefile Fri Jun 7 21:39:46 2013 (r251511) @@ -1,10 +1,20 @@ # $FreeBSD$ -BINS= \ +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" +BI_BITS= +.endif + +_BINS= \ filemontest \ - timed-forkb + timed-forkb \ + sizeof_long + +BINS= ${_BINS} +.if defined(BI_BITS) +BINS+= ${_BINS:C/$/32/g} +.endif -bins: filemontest timed-forkb +bins: ${BINS} all: bins NO_MAN= @@ -18,16 +28,25 @@ WITHOUT_CDDL= CLEANFILES+= ${BINS} -tests: bins + +.for f32 in ${BINS} +${f32}32: ${f32}.c + ${CC} -m32 -DBIT=\"32\" -o ${.TARGET} ${CFLAGS} ${.ALLSRC} +.endfor + +tests: kldstat | grep filemon - ${MAKE} test - ./timed-forkb + @echo "" + ${MAKE} test01 + ${MAKE} test02 +.if defined(BI_BITS) + ${MAKE} test32 +.endif @echo "filemon(4) tests passed." # Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in . -#FILEMONTEST32= filemontest32 -test: filemontest clean-test -.for BIN in filemontest ${FILEMONTEST32} +test01: ${BINS:Mfilemontest*} ${BINS:Msizeof_long*} clean-test +.for BIN in ${BINS:Mfilemontest} cd ${.CURDIR} ; \ for A in 1 2 3 4 5 6 7 8 9 0; do \ for B in 1 2 3 4 5 6 7 8 9 0; do \ @@ -37,10 +56,31 @@ test: filemontest clean-test done ;\ done @cd ${.CURDIR} ; set +e ; egrep '(Start|Stop) .*\.' filemon_log.* | \ - grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || echo "Time stamp format OK" + grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || printf "Time stamp format OK\n\n" .endfor + @cd ${.CURDIR} ; set +e ; for F in filemon_log.* ; do \ + tail -1 $$F | grep -q '# Bye bye' || echo "$$F missing filemon bye-bye" ; \ + NL=`wc -l $$F | awk '{print $$1}'` ; \ + if [ "$${NL}" != 97 ]; then echo "$$F BAD, contains $${NL} lines" ; exit 1 ; fi ; done + +test02: ${BINS:Mtimed-forkb*} + @echo "Without filemon(4) active:" + ./timed-forkb + @echo "With filemon(4) active:" + script -f typescript-timed-forkb ./timed-forkb + ls -l typescript-timed-forkb.filemon + +test32: ${BINS:M*32*} + script -f typescript.${.TARGET} ./sizeof_long32 >/dev/null + @tail -1 typescript.test32.filemon | grep -q '# Bye bye' || (echo '32-bit comapt filemon Missing "bye-bye"' ; exit 1) + @egrep -q '^X [0-9]+ 0$$' typescript.test32.filemon || (echo "32-bit binary exit ERROR" ; exit 1) + @printf "filemon(4) 32bit FreeBSD support passed.\n\n" + +CLEANFILES+= typescript-timed-forkb typescript-timed-forkb.filemon clean-test: - cd ${.CURDIR} ; rm -f filemon_log.* + cd ${.CURDIR} ; rm -f filemon_log*.* + +clean-tests: clean-test .include Modified: stable/8/tools/regression/filemon/filemontest.c ============================================================================== --- stable/8/tools/regression/filemon/filemontest.c Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/tools/regression/filemon/filemontest.c Fri Jun 7 21:39:46 2013 (r251511) @@ -43,9 +43,13 @@ __FBSDID("$FreeBSD$"); * "test_script.sh" in the cwd. */ +#ifndef BIT +#define BIT "" +#endif + int main(void) { - char log_name[] = "filemon_log.XXXXXX"; + char log_name[] = "filemon_log" BIT ".XXXXXX"; pid_t child; int fm_fd, fm_log; @@ -66,7 +70,7 @@ main(void) { child = getpid(); if (ioctl(fm_fd, FILEMON_SET_PID, &child) == -1) err(1, "Cannot set filemon PID to %d", child); - system("./test_script.sh"); + system("env BIT=" BIT " ./test_script.sh"); break; case -1: err(1, "Cannot fork"); Modified: stable/8/tools/regression/filemon/test_script.sh ============================================================================== --- stable/8/tools/regression/filemon/test_script.sh Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/tools/regression/filemon/test_script.sh Fri Jun 7 21:39:46 2013 (r251511) @@ -41,3 +41,4 @@ ed -s $f1 < $f2 #w" | ed -s $f1 #rm $f1 $f2 uptime > /dev/null +sizeof_long${BIT} > /dev/null From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 8 12:10:53 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 890B3686; Sat, 8 Jun 2013 12:10:53 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7ADC91161; Sat, 8 Jun 2013 12:10:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r58CAr6i040628; Sat, 8 Jun 2013 12:10:53 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r58CArET040626; Sat, 8 Jun 2013 12:10:53 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306081210.r58CArET040626@svn.freebsd.org> From: Hiroki Sato Date: Sat, 8 Jun 2013 12:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251521 - stable/8/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 08 Jun 2013 12:10:53 -0000 Author: hrs Date: Sat Jun 8 12:10:52 2013 New Revision: 251521 URL: http://svnweb.freebsd.org/changeset/base/251521 Log: Document that CVS repository is no longer supported. Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Sat Jun 8 09:11:20 2013 (r251520) +++ stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Sat Jun 8 12:10:52 2013 (r251521) @@ -206,6 +206,20 @@ Open Issues + [20130608] &os; &release; no longer supports &os; CVS + repository. Some documents mistakenly refer to + RELEASE_8_4_0 as CVS tag for the release and + RELENG_8_4 as CVS branch tag for the + &release; security branch. However, &os; Project no longer + supports &os; CVS repository and &release; has been released by + using &os; subversion repository instead. + RELENG_8_4 corresponds to + svn://svn.FreeBSD.org/base/releng/8.4, and + RELEASE_8_4_0 corresponds to + svn://svn.FreeBSD.org/base/release/8.4.0. + Please note that &os; source tree for &release; and its security + branch cannot be updated by using official CVSup servers. + [20130607] The &man.bge.4; network interface driver has an issue when TSO (TCP Segmentation Offload) is enabled. It causes intermittent reset and re-initialization. From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 8 13:40:37 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F3B8A404; Sat, 8 Jun 2013 13:40:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E44BB1673; Sat, 8 Jun 2013 13:40:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r58DeaUQ068043; Sat, 8 Jun 2013 13:40:36 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r58Deane068042; Sat, 8 Jun 2013 13:40:36 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306081340.r58Deane068042@svn.freebsd.org> From: Hiroki Sato Date: Sat, 8 Jun 2013 13:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251528 - stable/8/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 08 Jun 2013 13:40:37 -0000 Author: hrs Date: Sat Jun 8 13:40:36 2013 New Revision: 251528 URL: http://svnweb.freebsd.org/changeset/base/251528 Log: s/RELEASE_8_4_0/RELENG_8_4_0_RELEASE/ Spotted by: nyan Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Sat Jun 8 13:30:13 2013 (r251527) +++ stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Sat Jun 8 13:40:36 2013 (r251528) @@ -215,7 +215,7 @@ using &os; subversion repository instead. RELENG_8_4 corresponds to svn://svn.FreeBSD.org/base/releng/8.4, and - RELEASE_8_4_0 corresponds to + RELENG_8_4_0_RELEASE corresponds to svn://svn.FreeBSD.org/base/release/8.4.0. Please note that &os; source tree for &release; and its security branch cannot be updated by using official CVSup servers. From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 8 13:45:44 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 103A164C; Sat, 8 Jun 2013 13:45:44 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 02ADE16BB; Sat, 8 Jun 2013 13:45:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r58Djhld070263; Sat, 8 Jun 2013 13:45:43 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r58DjhT0070262; Sat, 8 Jun 2013 13:45:43 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306081345.r58DjhT0070262@svn.freebsd.org> From: Hiroki Sato Date: Sat, 8 Jun 2013 13:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251530 - stable/8/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 08 Jun 2013 13:45:44 -0000 Author: hrs Date: Sat Jun 8 13:45:43 2013 New Revision: 251530 URL: http://svnweb.freebsd.org/changeset/base/251530 Log: One more s/RELEASE_8_4_0/RELENG_8_4_0_RELEASE/ Spotted by: nyan Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Sat Jun 8 13:45:43 2013 (r251529) +++ stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Sat Jun 8 13:45:43 2013 (r251530) @@ -209,7 +209,7 @@ [20130608] &os; &release; no longer supports &os; CVS repository. Some documents mistakenly refer to RELEASE_8_4_0 as CVS tag for the release and - RELENG_8_4 as CVS branch tag for the + RELENG_8_4_0_RELEASE as CVS branch tag for the &release; security branch. However, &os; Project no longer supports &os; CVS repository and &release; has been released by using &os; subversion repository instead. From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 8 13:48:27 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 910FD972; Sat, 8 Jun 2013 13:48:27 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 833BF16EF; Sat, 8 Jun 2013 13:48:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r58DmR7T070669; Sat, 8 Jun 2013 13:48:27 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r58DmRq1070668; Sat, 8 Jun 2013 13:48:27 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306081348.r58DmRq1070668@svn.freebsd.org> From: Hiroki Sato Date: Sat, 8 Jun 2013 13:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251531 - stable/8/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 08 Jun 2013 13:48:27 -0000 Author: hrs Date: Sat Jun 8 13:48:27 2013 New Revision: 251531 URL: http://svnweb.freebsd.org/changeset/base/251531 Log: Revert the previous change and fix the tag name. Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Sat Jun 8 13:45:43 2013 (r251530) +++ stable/8/release/doc/en_US.ISO8859-1/errata/article.xml Sat Jun 8 13:48:27 2013 (r251531) @@ -208,8 +208,8 @@ [20130608] &os; &release; no longer supports &os; CVS repository. Some documents mistakenly refer to - RELEASE_8_4_0 as CVS tag for the release and - RELENG_8_4_0_RELEASE as CVS branch tag for the + RELENG_8_4_0_RELEASE as CVS tag for the release and + RELENG_8_4 as CVS branch tag for the &release; security branch. However, &os; Project no longer supports &os; CVS repository and &release; has been released by using &os; subversion repository instead. From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 8 15:46:09 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 93A668BA; Sat, 8 Jun 2013 15:46:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 855221217; Sat, 8 Jun 2013 15:46:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r58Fk9Vg008291; Sat, 8 Jun 2013 15:46:09 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r58Fk97u008290; Sat, 8 Jun 2013 15:46:09 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201306081546.r58Fk97u008290@svn.freebsd.org> From: Mark Johnston Date: Sat, 8 Jun 2013 15:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251533 - stable/8/usr.sbin/newsyslog X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 08 Jun 2013 15:46:09 -0000 Author: markj Date: Sat Jun 8 15:46:09 2013 New Revision: 251533 URL: http://svnweb.freebsd.org/changeset/base/251533 Log: MFC r235647 for newsyslog (by gleb): Hide DIR definition by making it an opaque struct typedef. Introduce dirfd() libc exported symbol replacing macro with same name, preserve _dirfd() macro for internal use. Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable name to prevent shadowing global symbol. MFC r250545: Some filesystems (NFS in particular) do not fill out the d_type field when returning directory entries through readdir(3). In this case we need to obtain the file type ourselves; otherwise newsyslog -t will not be able to find archived log files and will fail to both delete old log files and to do interval-based rotations properly. MFC r251240: We want to stat the archived log file rather than the logfile itself. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Sat Jun 8 15:45:01 2013 (r251532) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Sat Jun 8 15:46:09 2013 (r251533) @@ -1447,16 +1447,27 @@ oldlog_entry_compare(const void *a, cons * tm if this is the case; otherwise return false. */ static int -validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) +validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, + struct tm *tm) { + struct stat sb; size_t logfname_len; char *s; int c; logfname_len = strlen(logfname); - if (dp->d_type != DT_REG) - return (0); + if (dp->d_type != DT_REG) { + /* + * Some filesystems (e.g. NFS) don't fill out the d_type field + * and leave it set to DT_UNKNOWN; in this case we must obtain + * the file type ourselves. + */ + if (dp->d_type != DT_UNKNOWN || + fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || + !S_ISREG(sb.st_mode)) + return (0); + } /* Ignore everything but files with our logfile prefix. */ if (strncmp(dp->d_name, logfname, logfname_len) != 0) return (0); @@ -1508,7 +1519,7 @@ static void delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir) { char *logfname, *s, *dir, errbuf[80]; - int dirfd, i, logcnt, max_logcnt; + int dir_fd, i, logcnt, max_logcnt; struct oldlog_entry *oldlogs; struct dirent *dp; const char *cdir; @@ -1540,9 +1551,9 @@ delete_oldest_timelog(const struct conf_ /* First we create a 'list' of all archived logfiles */ if ((dirp = opendir(dir)) == NULL) err(1, "Cannot open log directory '%s'", dir); - dirfd = dirfd(dirp); + dir_fd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; /* @@ -1590,7 +1601,7 @@ delete_oldest_timelog(const struct conf_ if (noaction) printf("\trm -f %s/%s\n", dir, oldlogs[i].fname); - else if (unlinkat(dirfd, oldlogs[i].fname, 0) != 0) { + else if (unlinkat(dir_fd, oldlogs[i].fname, 0) != 0) { snprintf(errbuf, sizeof(errbuf), "Could not delete old logfile '%s'", oldlogs[i].fname); @@ -2276,10 +2287,10 @@ mtime_old_timelog(const char *file) dir_fd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; - if (fstatat(dir_fd, logfname, &sb, 0) == -1) { + if (fstatat(dir_fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) == -1) { warn("Cannot stat '%s'", file); continue; } From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 8 15:47:19 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6DABEC91; Sat, 8 Jun 2013 15:47:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 60032122D; Sat, 8 Jun 2013 15:47:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r58FlJM4008545; Sat, 8 Jun 2013 15:47:19 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r58FlJCb008544; Sat, 8 Jun 2013 15:47:19 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201306081547.r58FlJCb008544@svn.freebsd.org> From: Mark Johnston Date: Sat, 8 Jun 2013 15:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251535 - stable/8/usr.sbin/ndp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 08 Jun 2013 15:47:19 -0000 Author: markj Date: Sat Jun 8 15:47:18 2013 New Revision: 251535 URL: http://svnweb.freebsd.org/changeset/base/251535 Log: MFC r250941: Include descriptions of the flags and fields printed when dumping the IPv6 prefix list. Modified: stable/8/usr.sbin/ndp/ndp.8 Directory Properties: stable/8/usr.sbin/ndp/ (props changed) Modified: stable/8/usr.sbin/ndp/ndp.8 ============================================================================== --- stable/8/usr.sbin/ndp/ndp.8 Sat Jun 8 15:46:42 2013 (r251534) +++ stable/8/usr.sbin/ndp/ndp.8 Sat Jun 8 15:47:18 2013 (r251535) @@ -218,6 +218,36 @@ Specify the Cur Hop Limit on the interfa Do not try to resolve numeric addresses to hostnames. .It Fl p Show prefix list. +The following information will be printed: +.Bl -tag -width indent +.It Cm if +The network interface associated with this prefix. +.It Cm flags +The status of the prefix, expressed by a combination of the following +letters: +.Pp +.Bl -tag -width indent -compact +.It Cm A +This prefix can be used for stateless address autoconfiguration. +.It Cm L, Cm O +This prefix can be used for on-link determination; that is, it can be +used to determine whether a given destination address is on-link. +.It Cm D +There are no reachable routers advertising this prefix. +.El +.It Cm vltime +Valid lifetime; the length of time for which the prefix and a stateless +autoconfigured address generated from this prefix can be used for the +source or destination address of a packet. +.It Cm pltime +Preferred lifetime; the length of time for which the prefix and a stateless +autoconfigured address generated from this prefix can be used by upper-layer +protocols unrestrictedly. +.It Cm expire +This is the remaining time that the prefix is in the valid state. +.It Cm ref +The number of kernel references held for this prefix. +.El .It Fl P Flush all the entries in the prefix list. .It Fl r From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 8 15:48:29 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE9B0B8; Sat, 8 Jun 2013 15:48:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A0FCB124F; Sat, 8 Jun 2013 15:48:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r58FmTYs008861; Sat, 8 Jun 2013 15:48:29 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r58FmTSV008860; Sat, 8 Jun 2013 15:48:29 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201306081548.r58FmTSV008860@svn.freebsd.org> From: Mark Johnston Date: Sat, 8 Jun 2013 15:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251537 - stable/8/usr.sbin/rtsold X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 08 Jun 2013 15:48:29 -0000 Author: markj Date: Sat Jun 8 15:48:29 2013 New Revision: 251537 URL: http://svnweb.freebsd.org/changeset/base/251537 Log: MFC r250939: Correct the description of the -a option: rtsol(d) -a will in fact send out router solicitations on multiple interfaces. MFC r251059: - Fix wording. - Improve the descriptions in the FILES section. Modified: stable/8/usr.sbin/rtsold/rtsold.8 Directory Properties: stable/8/usr.sbin/rtsold/ (props changed) Modified: stable/8/usr.sbin/rtsold/rtsold.8 ============================================================================== --- stable/8/usr.sbin/rtsold/rtsold.8 Sat Jun 8 15:48:01 2013 (r251536) +++ stable/8/usr.sbin/rtsold/rtsold.8 Sat Jun 8 15:48:29 2013 (r251537) @@ -155,15 +155,10 @@ will dump the current internal state int The options are as follows: .Bl -tag -width indent .It Fl a -Autoprobe outgoing interface. +Autoprobe outgoing interfaces. .Nm -will try to find a non-loopback, non-point-to-point, IPv6-capable interface. -If -.Nm -finds multiple interfaces, -.Nm -will exit with error. -.\" +will try to find any non-loopback, non-point-to-point, IPv6-capable interfaces +and send router solicitation messages on all of them. .It Fl d Enable debugging. .It Fl D @@ -226,10 +221,10 @@ file, and be created by the same owner w .Sh FILES .Bl -tag -width /var/run/rtsold.dump -compact .It Pa /var/run/rtsold.pid -the pid of the currently running +The PID of the currently running .Nm . .It Pa /var/run/rtsold.dump -dumps internal state on. +Internal state dump file. .El .\" .Sh SEE ALSO