From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 14 15:10:02 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B6B6106564A; Mon, 14 Nov 2011 15:10:02 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E91258FC14; Mon, 14 Nov 2011 15:10:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEFA19R054425; Mon, 14 Nov 2011 15:10:01 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEFA1O7054423; Mon, 14 Nov 2011 15:10:01 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201111141510.pAEFA1O7054423@svn.freebsd.org> From: Peter Holm Date: Mon, 14 Nov 2011 15:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227498 - stable/8/sys/fs/tmpfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 15:10:02 -0000 Author: pho Date: Mon Nov 14 15:10:01 2011 New Revision: 227498 URL: http://svn.freebsd.org/changeset/base/227498 Log: MFC: r226987 Added missing cache purge of from argument for rename(). Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_vnops.c Mon Nov 14 08:29:49 2011 (r227497) +++ stable/8/sys/fs/tmpfs/tmpfs_vnops.c Mon Nov 14 15:10:01 2011 (r227498) @@ -1080,6 +1080,7 @@ tmpfs_rename(struct vop_rename_args *v) * really reclaimed. */ tmpfs_free_dirent(VFS_TO_TMPFS(tvp->v_mount), de, TRUE); } + cache_purge(fvp); error = 0; From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 15 23:46:26 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A7FB106564A; Tue, 15 Nov 2011 23:46:26 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39D9D8FC08; Tue, 15 Nov 2011 23:46:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFNkQkA022083; Tue, 15 Nov 2011 23:46:26 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFNkQp2022081; Tue, 15 Nov 2011 23:46:26 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201111152346.pAFNkQp2022081@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 15 Nov 2011 23:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227545 - stable/8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 23:46:26 -0000 Author: obrien Date: Tue Nov 15 23:46:25 2011 New Revision: 227545 URL: http://svn.freebsd.org/changeset/base/227545 Log: MFC: r220954 & r221469: Note which of the built kernels is being installed. PR: 156579 Modified: stable/8/Makefile.inc1 (contents, props changed) Directory Properties: stable/8/ (props changed) Modified: stable/8/Makefile.inc1 ============================================================================== --- stable/8/Makefile.inc1 Tue Nov 15 23:37:15 2011 (r227544) +++ stable/8/Makefile.inc1 Tue Nov 15 23:46:25 2011 (r227545) @@ -813,7 +813,7 @@ reinstallkernel reinstallkernel.debug: i false .endif @echo "--------------------------------------------------------------" - @echo ">>> Installing kernel" + @echo ">>> Installing kernel ${INSTALLKERNEL}" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ From owner-svn-src-stable-8@FreeBSD.ORG Wed Nov 16 14:33:30 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B07E106566C; Wed, 16 Nov 2011 14:33:30 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69B7C8FC14; Wed, 16 Nov 2011 14:33:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGEXU0H052663; Wed, 16 Nov 2011 14:33:30 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGEXUZd052661; Wed, 16 Nov 2011 14:33:30 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201111161433.pAGEXUZd052661@svn.freebsd.org> From: Fabien Thomas Date: Wed, 16 Nov 2011 14:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227551 - stable/8/contrib/gcc/config/arm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 14:33:30 -0000 Author: fabient Date: Wed Nov 16 14:33:30 2011 New Revision: 227551 URL: http://svn.freebsd.org/changeset/base/227551 Log: MFC r227391: Import gcc fix for -fstack-protector that produces segfaulting binaries on arm/armel. Related gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35965 Author kindly accepted that all of his patches can be use as GPLv2. PR: 161128 Modified: stable/8/contrib/gcc/config/arm/arm.c Directory Properties: stable/8/contrib/gcc/ (props changed) Modified: stable/8/contrib/gcc/config/arm/arm.c ============================================================================== --- stable/8/contrib/gcc/config/arm/arm.c Wed Nov 16 10:11:55 2011 (r227550) +++ stable/8/contrib/gcc/config/arm/arm.c Wed Nov 16 14:33:30 2011 (r227551) @@ -3217,7 +3217,8 @@ legitimize_pic_address (rtx orig, enum m gcc_assert (!no_new_pseudos); if (arm_pic_register != INVALID_REGNUM) { - cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation @@ -3229,7 +3230,8 @@ legitimize_pic_address (rtx orig, enum m { rtx seq; - cfun->machine->pic_reg = gen_reg_rtx (Pmode); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_reg_rtx (Pmode); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation From owner-svn-src-stable-8@FreeBSD.ORG Wed Nov 16 15:25:13 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93D8B106564A; Wed, 16 Nov 2011 15:25:13 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80F328FC1F; Wed, 16 Nov 2011 15:25:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGFPDrq054544; Wed, 16 Nov 2011 15:25:13 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFPDQ6054533; Wed, 16 Nov 2011 15:25:13 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201111161525.pAGFPDQ6054533@svn.freebsd.org> From: Fabien Thomas Date: Wed, 16 Nov 2011 15:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227555 - in stable/8: lib/libpmc sys/dev/hwpmc sys/sys usr.sbin/pmcstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:25:13 -0000 Author: fabient Date: Wed Nov 16 15:25:12 2011 New Revision: 227555 URL: http://svn.freebsd.org/changeset/base/227555 Log: MFC r226514,r226526,r226986: Add a flush of the current PMC log buffer before displaying the next top. As the underlying block is 4KB if the PMC throughput is low the measurement will be reported on the next tick. pmcstat(8) use the modified flush API to reclaim current buffer before displaying next top. Modified: stable/8/lib/libpmc/libpmc.c stable/8/lib/libpmc/pmc.3 stable/8/lib/libpmc/pmc.h stable/8/lib/libpmc/pmc_configure_logfile.3 stable/8/sys/dev/hwpmc/hwpmc_logging.c stable/8/sys/dev/hwpmc/hwpmc_mod.c stable/8/sys/sys/pmc.h stable/8/sys/sys/pmclog.h stable/8/usr.sbin/pmcstat/pmcstat.c stable/8/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/8/lib/libpmc/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/lib/libpmc/libpmc.c ============================================================================== --- stable/8/lib/libpmc/libpmc.c Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/lib/libpmc/libpmc.c Wed Nov 16 15:25:12 2011 (r227555) @@ -2560,6 +2560,12 @@ pmc_flush_logfile(void) } int +pmc_close_logfile(void) +{ + return (PMC_CALL(CLOSELOG,0)); +} + +int pmc_get_driver_stats(struct pmc_driverstats *ds) { struct pmc_op_getdriverstats gms; Modified: stable/8/lib/libpmc/pmc.3 ============================================================================== --- stable/8/lib/libpmc/pmc.3 Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/lib/libpmc/pmc.3 Wed Nov 16 15:25:12 2011 (r227555) @@ -322,6 +322,10 @@ to write logged events to. Flush all pending log data in .Xr hwpmc 4 Ns Ap s buffers. +.It Fn pmc_close_logfile +Flush all pending log data and close +.Xr hwpmc 4 Ns Ap s +side of the stream. .It Fn pmc_writelog Append arbitrary user data to the current log file. .El Modified: stable/8/lib/libpmc/pmc.h ============================================================================== --- stable/8/lib/libpmc/pmc.h Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/lib/libpmc/pmc.h Wed Nov 16 15:25:12 2011 (r227555) @@ -76,6 +76,7 @@ int pmc_attach(pmc_id_t _pmcid, pid_t _p int pmc_capabilities(pmc_id_t _pmc, uint32_t *_caps); int pmc_configure_logfile(int _fd); int pmc_flush_logfile(void); +int pmc_close_logfile(void); int pmc_detach(pmc_id_t _pmcid, pid_t _pid); int pmc_disable(int _cpu, int _pmc); int pmc_enable(int _cpu, int _pmc); Modified: stable/8/lib/libpmc/pmc_configure_logfile.3 ============================================================================== --- stable/8/lib/libpmc/pmc_configure_logfile.3 Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/lib/libpmc/pmc_configure_logfile.3 Wed Nov 16 15:25:12 2011 (r227555) @@ -29,7 +29,8 @@ .Sh NAME .Nm pmc_configure_logfile , .Nm pmc_flush_logfile , -.Nm pmc_writelog +.Nm pmc_writelog , +.Nm pmc_close_logfile .Nd log file management .Sh LIBRARY .Lb libpmc @@ -41,6 +42,8 @@ .Fn pmc_flush_logfile void .Ft int .Fn pmc_writelog "uint32_t userdata" +.Ft int +.Fn pmc_close_logfile void .Sh DESCRIPTION The functions manage logging of .Xr hwpmc 4 @@ -72,6 +75,12 @@ Function will append a log entry containing the value of argument .Fa userdata to the log file. +.Pp +Function +.Fn pmc_close_logfile +will flush all pending log data and close +.Xr hwpmc 4 Ns Ap s +side of the stream. .Sh RETURN VALUES .Rv -std .Sh ERRORS Modified: stable/8/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 16 15:25:12 2011 (r227555) @@ -237,7 +237,7 @@ pmclog_get_buffer(struct pmc_owner *po) static void pmclog_loop(void *arg) { - int error, last_buffer; + int error; struct pmc_owner *po; struct pmclog_buffer *lb; struct proc *p; @@ -252,7 +252,6 @@ pmclog_loop(void *arg) p = po->po_owner; td = curthread; mycred = td->td_ucred; - last_buffer = 0; PROC_LOCK(p); ownercred = crhold(p->p_ucred); @@ -285,14 +284,22 @@ pmclog_loop(void *arg) if ((lb = TAILQ_FIRST(&po->po_logbuffers)) == NULL) { mtx_unlock_spin(&po->po_mtx); + if (po->po_flags & PMC_PO_SHUTDOWN) { + mtx_unlock(&pmc_kthread_mtx); + /* + * Close the file to get PMCLOG_EOF + * error in pmclog(3). + */ + fo_close(po->po_file, curthread); + mtx_lock(&pmc_kthread_mtx); + } + (void) msleep(po, &pmc_kthread_mtx, PWAIT, "pmcloop", 0); continue; } TAILQ_REMOVE(&po->po_logbuffers, lb, plb_next); - if (po->po_flags & PMC_PO_SHUTDOWN) - last_buffer = TAILQ_EMPTY(&po->po_logbuffers); mtx_unlock_spin(&po->po_mtx); } @@ -335,14 +342,6 @@ pmclog_loop(void *arg) break; } - if (last_buffer) { - /* - * Close the file to get PMCLOG_EOF error - * in pmclog(3). - */ - fo_close(po->po_file, curthread); - } - mtx_lock(&pmc_kthread_mtx); /* put the used buffer back into the global pool */ @@ -692,6 +691,7 @@ int pmclog_flush(struct pmc_owner *po) { int error; + struct pmclog_buffer *lb; PMCDBG(LOG,FLS,1, "po=%p", po); @@ -714,11 +714,38 @@ pmclog_flush(struct pmc_owner *po) } /* - * Schedule the current buffer if any. + * Schedule the current buffer if any and not empty. + */ + mtx_lock_spin(&po->po_mtx); + lb = po->po_curbuf; + if (lb && lb->plb_ptr != lb->plb_base) { + pmclog_schedule_io(po); + } else + error = ENOBUFS; + mtx_unlock_spin(&po->po_mtx); + + error: + mtx_unlock(&pmc_kthread_mtx); + + return (error); +} + +int +pmclog_close(struct pmc_owner *po) +{ + + PMCDBG(LOG,CLO,1, "po=%p", po); + + mtx_lock(&pmc_kthread_mtx); + + /* + * Schedule the current buffer. */ mtx_lock_spin(&po->po_mtx); if (po->po_curbuf) pmclog_schedule_io(po); + else + wakeup_one(po); mtx_unlock_spin(&po->po_mtx); /* @@ -727,13 +754,11 @@ pmclog_flush(struct pmc_owner *po) */ po->po_flags |= PMC_PO_SHUTDOWN; - error: mtx_unlock(&pmc_kthread_mtx); - return (error); + return (0); } - void pmclog_process_callchain(struct pmc *pm, struct pmc_sample *ps) { Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 16 15:25:12 2011 (r227555) @@ -2891,7 +2891,7 @@ pmc_syscall_handler(struct thread *td, v error = pmclog_configure_log(md, po, cl.pm_logfd); } else if (po->po_flags & PMC_PO_OWNS_LOGFILE) { pmclog_process_closelog(po); - error = pmclog_flush(po); + error = pmclog_close(po); if (error == 0) { LIST_FOREACH(pm, &po->po_pmcs, pm_next) if (pm->pm_flags & PMC_F_NEEDS_LOGFILE && @@ -2907,7 +2907,6 @@ pmc_syscall_handler(struct thread *td, v } break; - /* * Flush a log file. */ @@ -2928,6 +2927,25 @@ pmc_syscall_handler(struct thread *td, v break; /* + * Close a log file. + */ + + case PMC_OP_CLOSELOG: + { + struct pmc_owner *po; + + sx_assert(&pmc_sx, SX_XLOCKED); + + if ((po = pmc_find_owner_descriptor(td->td_proc)) == NULL) { + error = EINVAL; + break; + } + + error = pmclog_close(po); + } + break; + + /* * Retrieve hardware configuration. */ Modified: stable/8/sys/sys/pmc.h ============================================================================== --- stable/8/sys/sys/pmc.h Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/sys/sys/pmc.h Wed Nov 16 15:25:12 2011 (r227555) @@ -300,7 +300,8 @@ enum pmc_event { __PMC_OP(PMCSETCOUNT, "Set initial count/sampling rate") \ __PMC_OP(PMCSTART, "Start a PMC") \ __PMC_OP(PMCSTOP, "Start a PMC") \ - __PMC_OP(WRITELOG, "Write a cookie to the log file") + __PMC_OP(WRITELOG, "Write a cookie to the log file") \ + __PMC_OP(CLOSELOG, "Close log file") enum pmc_ops { @@ -1037,6 +1038,7 @@ extern struct pmc_debugflags pmc_debugfl #define PMC_DEBUG_MIN_SIO 9 /* schedule i/o */ #define PMC_DEBUG_MIN_FLS 10 /* flush */ #define PMC_DEBUG_MIN_SAM 11 /* sample */ +#define PMC_DEBUG_MIN_CLO 12 /* close */ #else #define PMCDBG(M,N,L,F,...) /* nothing */ Modified: stable/8/sys/sys/pmclog.h ============================================================================== --- stable/8/sys/sys/pmclog.h Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/sys/sys/pmclog.h Wed Nov 16 15:25:12 2011 (r227555) @@ -243,6 +243,7 @@ int pmclog_configure_log(struct pmc_mdep int _logfd); int pmclog_deconfigure_log(struct pmc_owner *_po); int pmclog_flush(struct pmc_owner *_po); +int pmclog_close(struct pmc_owner *_po); void pmclog_initialize(void); void pmclog_process_callchain(struct pmc *_pm, struct pmc_sample *_ps); void pmclog_process_closelog(struct pmc_owner *po); Modified: stable/8/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat.c Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/usr.sbin/pmcstat/pmcstat.c Wed Nov 16 15:25:12 2011 (r227555) @@ -555,7 +555,7 @@ main(int argc, char **argv) int option, npmc, ncpu, haltedcpus; int c, check_driver_stats, current_cpu, current_sampling_count; int do_callchain, do_descendants, do_logproccsw, do_logprocexit; - int do_print; + int do_print, do_read; size_t dummy; int graphdepth; int pipefd[2], rfd; @@ -797,7 +797,9 @@ main(int argc, char **argv) break; case 'o': /* outputfile */ - if (args.pa_printfile != NULL) + if (args.pa_printfile != NULL && + args.pa_printfile != stdout && + args.pa_printfile != stderr) (void) fclose(args.pa_printfile); if ((args.pa_printfile = fopen(optarg, "w")) == NULL) errx(EX_OSERR, "ERROR: cannot open \"%s\" for " @@ -1329,7 +1331,7 @@ main(int argc, char **argv) * are killed by a SIGINT. */ runstate = PMCSTAT_RUNNING; - do_print = 0; + do_print = do_read = 0; do { if ((c = kevent(pmcstat_kq, NULL, 0, &kev, 1, NULL)) <= 0) { if (errno != EINTR) @@ -1352,8 +1354,10 @@ main(int argc, char **argv) (args.pa_flags & FLAG_DO_TOP)) { if (pmcstat_keypress_log()) runstate = pmcstat_close_log(); - } else + } else { + do_read = 0; runstate = pmcstat_process_log(); + } break; case EVFILT_SIGNAL: @@ -1378,9 +1382,6 @@ main(int argc, char **argv) /* Kill the child process if we started it */ if (args.pa_flags & FLAG_HAS_COMMANDLINE) pmcstat_kill_process(); - /* Close the pipe to self, if present. */ - if (args.pa_flags & FLAG_HAS_PIPE) - (void) close(pipefd[READPIPEFD]); runstate = pmcstat_close_log(); } else if (kev.ident == SIGWINCH) { if (ioctl(fileno(args.pa_printfile), @@ -1395,12 +1396,15 @@ main(int argc, char **argv) break; case EVFILT_TIMER: /* print out counting PMCs */ + if ((args.pa_flags & FLAG_DO_TOP) && + pmc_flush_logfile() == 0) + do_read = 1; do_print = 1; break; } - if (do_print) { + if (do_print && !do_read) { if ((args.pa_required & FLAG_HAS_OUTPUT_LOGFILE) == 0) { pmcstat_print_pmcs(); if (runstate == PMCSTAT_FINISHED && /* final newline */ @@ -1421,7 +1425,7 @@ main(int argc, char **argv) /* flush any pending log entries */ if (args.pa_flags & (FLAG_HAS_OUTPUT_LOGFILE | FLAG_HAS_PIPE)) - pmc_flush_logfile(); + pmc_close_logfile(); pmcstat_cleanup(); Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat_log.c Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/usr.sbin/pmcstat/pmcstat_log.c Wed Nov 16 15:25:12 2011 (r227555) @@ -1703,7 +1703,7 @@ pmcstat_close_log(void) * so keep the status to EXITING. */ if (args.pa_logfd != -1) { - if (pmc_flush_logfile() < 0) + if (pmc_close_logfile() < 0) err(EX_OSERR, "ERROR: logging failed"); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Nov 16 16:24:36 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD9961065670; Wed, 16 Nov 2011 16:24:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC9A78FC17; Wed, 16 Nov 2011 16:24:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGGOavm056898; Wed, 16 Nov 2011 16:24:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGGOa0n056896; Wed, 16 Nov 2011 16:24:36 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161624.pAGGOa0n056896@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 16:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227564 - stable/8/sbin/bsdlabel X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 16:24:37 -0000 Author: ae Date: Wed Nov 16 16:24:36 2011 New Revision: 227564 URL: http://svn.freebsd.org/changeset/base/227564 Log: MFC r227231: To be in sync with GEOM_PART_BSD limit the maximum number of supported partitions to 20. MFC r227248: bsdlabel(8) could automatically fill many of disklabel's deprecated fields, but user could specify some of those fields when edits disklabel with `bsdlabel -e`. But without -A flag these fields might be overwritten with default values from the virgin disklabel. So, don't overwrite such fields if they are not zero. Also add checks to prevent creating disklabel with less than DEFPARTITIONS and more than MAXPARTITIONS partitions. PR: bin/162332 Tested by: Eugene Grosbein MFC r227262: Remove unneeded checks. MFC r227270: Add recommendation to use gpart(8) when user tries write disklabel or bootcode to already opened provider. M2C r227296: Fix multi-line comment formatting. Modified: stable/8/sbin/bsdlabel/bsdlabel.c Directory Properties: stable/8/sbin/bsdlabel/ (props changed) Modified: stable/8/sbin/bsdlabel/bsdlabel.c ============================================================================== --- stable/8/sbin/bsdlabel/bsdlabel.c Wed Nov 16 16:15:31 2011 (r227563) +++ stable/8/sbin/bsdlabel/bsdlabel.c Wed Nov 16 16:24:36 2011 (r227564) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #define DKTYPENAMES #define FSTYPENAMES -#define MAXPARTITIONS 26 +#define MAXPARTITIONS 20 #include #include @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #include "pathnames.h" static void makelabel(const char *, struct disklabel *); -static int geom_bsd_available(void); +static int geom_class_available(const char *); static int writelabel(void); static int readlabel(int flag); static void display(FILE *, const struct disklabel *); @@ -354,7 +354,7 @@ readboot(void) } static int -geom_bsd_available(void) +geom_class_available(const char *name) { struct gclass *class; struct gmesh mesh; @@ -365,7 +365,7 @@ geom_bsd_available(void) errc(1, error, "Cannot get GEOM tree"); LIST_FOREACH(class, &mesh.lg_class, lg_class) { - if (strcmp(class->lg_name, "BSD") == 0) { + if (strcmp(class->lg_name, name) == 0) { geom_deletetree(&mesh); return (1); } @@ -410,8 +410,20 @@ writelabel(void) } else serrno = errno; + if (geom_class_available("PART") != 0) { + /* + * Since we weren't able open provider for + * writing, then recommend user to use gpart(8). + */ + warnc(serrno, + "cannot open provider %s for writing label", + specname); + warnx("Try to use gpart(8)."); + return (1); + } + /* Give up if GEOM_BSD is not available. */ - if (geom_bsd_available() == 0) { + if (geom_class_available("BSD") == 0) { warnc(serrno, "%s", specname); return (1); } @@ -824,11 +836,16 @@ getasciilabel(FILE *f, struct disklabel continue; } if (sscanf(cp, "%lu partitions", &v) == 1) { - if (v == 0 || v > MAXPARTITIONS) { + if (v > MAXPARTITIONS) { fprintf(stderr, "line %d: bad # of partitions\n", lineno); lp->d_npartitions = MAXPARTITIONS; errors++; + } else if (v < DEFPARTITIONS) { + fprintf(stderr, + "line %d: bad # of partitions\n", lineno); + lp->d_npartitions = DEFPARTITIONS; + errors++; } else lp->d_npartitions = v; continue; @@ -1142,23 +1159,41 @@ checklabel(struct disklabel *lp) errors++; } else if (lp->d_bbsize % lp->d_secsize) warnx("boot block size %% sector-size != 0"); - if (lp->d_npartitions > MAXPARTITIONS) + if (lp->d_npartitions > MAXPARTITIONS) { warnx("number of partitions (%lu) > MAXPARTITIONS (%d)", (u_long)lp->d_npartitions, MAXPARTITIONS); + errors++; + } + if (lp->d_npartitions < DEFPARTITIONS) { + warnx("number of partitions (%lu) < DEFPARTITIONS (%d)", + (u_long)lp->d_npartitions, DEFPARTITIONS); + errors++; + } } else { struct disklabel *vl; vl = getvirginlabel(); - lp->d_secsize = vl->d_secsize; - lp->d_nsectors = vl->d_nsectors; - lp->d_ntracks = vl->d_ntracks; - lp->d_ncylinders = vl->d_ncylinders; - lp->d_rpm = vl->d_rpm; - lp->d_interleave = vl->d_interleave; - lp->d_secpercyl = vl->d_secpercyl; - lp->d_secperunit = vl->d_secperunit; - lp->d_bbsize = vl->d_bbsize; - lp->d_npartitions = vl->d_npartitions; + if (lp->d_secsize == 0) + lp->d_secsize = vl->d_secsize; + if (lp->d_nsectors == 0) + lp->d_nsectors = vl->d_nsectors; + if (lp->d_ntracks == 0) + lp->d_ntracks = vl->d_ntracks; + if (lp->d_ncylinders == 0) + lp->d_ncylinders = vl->d_ncylinders; + if (lp->d_rpm == 0) + lp->d_rpm = vl->d_rpm; + if (lp->d_interleave == 0) + lp->d_interleave = vl->d_interleave; + if (lp->d_secpercyl == 0) + lp->d_secpercyl = vl->d_secpercyl; + if (lp->d_secperunit == 0) + lp->d_secperunit = vl->d_secperunit; + if (lp->d_bbsize == 0) + lp->d_bbsize = vl->d_bbsize; + if (lp->d_npartitions < DEFPARTITIONS || + lp->d_npartitions > MAXPARTITIONS) + lp->d_npartitions = vl->d_npartitions; } From owner-svn-src-stable-8@FreeBSD.ORG Wed Nov 16 16:42:24 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03557106564A; Wed, 16 Nov 2011 16:42:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD6D78FC1A; Wed, 16 Nov 2011 16:42:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGGgNfE057629; Wed, 16 Nov 2011 16:42:23 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGGgN4W057626; Wed, 16 Nov 2011 16:42:23 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161642.pAGGgN4W057626@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 16:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227567 - stable/8/sbin/fdisk X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 16:42:24 -0000 Author: ae Date: Wed Nov 16 16:42:23 2011 New Revision: 227567 URL: http://svn.freebsd.org/changeset/base/227567 Log: MFC r227272: Add reference to gpart(8). MFC r227292: Improve error reporting when MBR can not be written. Remove obsolete code which uses DIOCSMBR ioctl. When writing MBR first check that GEOM_MBR is available, if it is not available, then try write MBR directly to provider. If both are failed, then recommend to use gpart(8). MFC r227295: Fix multi-line comment formatting. Pointed by: jh Modified: stable/8/sbin/fdisk/fdisk.8 stable/8/sbin/fdisk/fdisk.c Directory Properties: stable/8/sbin/fdisk/ (props changed) Modified: stable/8/sbin/fdisk/fdisk.8 ============================================================================== --- stable/8/sbin/fdisk/fdisk.8 Wed Nov 16 16:29:05 2011 (r227566) +++ stable/8/sbin/fdisk/fdisk.8 Wed Nov 16 16:42:23 2011 (r227567) @@ -476,6 +476,7 @@ The default boot code. .Sh SEE ALSO .Xr boot0cfg 8 , .Xr bsdlabel 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh BUGS The default boot code will not necessarily handle all slice types Modified: stable/8/sbin/fdisk/fdisk.c ============================================================================== --- stable/8/sbin/fdisk/fdisk.c Wed Nov 16 16:29:05 2011 (r227566) +++ stable/8/sbin/fdisk/fdisk.c Wed Nov 16 16:42:23 2011 (r227567) @@ -229,6 +229,7 @@ get_type(int t) } +static int geom_class_available(const char *); static void print_s0(void); static void print_part(const struct dos_partition *); static void init_sector0(unsigned long start); @@ -764,49 +765,76 @@ read_disk(off_t sector, void *buf) } static int -write_disk(off_t sector, void *buf) +geom_class_available(const char *name) { + struct gclass *class; + struct gmesh mesh; int error; + + error = geom_gettree(&mesh); + if (error != 0) + errc(1, error, "Cannot get GEOM tree"); + + LIST_FOREACH(class, &mesh.lg_class, lg_class) { + if (strcmp(class->lg_name, name) == 0) { + geom_deletetree(&mesh); + return (1); + } + } + + geom_deletetree(&mesh); + + return (0); +} + +static int +write_disk(off_t sector, void *buf) +{ struct gctl_req *grq; const char *errmsg; - char fbuf[BUFSIZ], *pname; - int i, fdw; + char *pname; + int error; - grq = gctl_get_handle(); - gctl_ro_param(grq, "verb", -1, "write MBR"); - gctl_ro_param(grq, "class", -1, "MBR"); - pname = g_providername(fd); - if (pname == NULL) { - warn("Error getting providername for %s", disk); - return (-1); - } - gctl_ro_param(grq, "geom", -1, pname); - gctl_ro_param(grq, "data", secsize, buf); - errmsg = gctl_issue(grq); - free(pname); - if (errmsg == NULL) { + /* Check that GEOM_MBR is available */ + if (geom_class_available("MBR") != 0) { + grq = gctl_get_handle(); + gctl_ro_param(grq, "verb", -1, "write MBR"); + gctl_ro_param(grq, "class", -1, "MBR"); + pname = g_providername(fd); + if (pname == NULL) { + warn("Error getting providername for %s", disk); + return (-1); + } + gctl_ro_param(grq, "geom", -1, pname); + gctl_ro_param(grq, "data", secsize, buf); + errmsg = gctl_issue(grq); + free(pname); + if (errmsg == NULL) { + gctl_free(grq); + return(0); + } + if (!q_flag) + warnx("GEOM_MBR: %s", errmsg); gctl_free(grq); - return(0); - } - if (!q_flag) /* GEOM errors are benign, not all devices supported */ - warnx("%s", errmsg); - gctl_free(grq); - - error = pwrite(fd, buf, secsize, (sector * 512)); - if (error == secsize) - return (0); - - for (i = 1; i < 5; i++) { - sprintf(fbuf, "%ss%d", disk, i); - fdw = open(fbuf, O_RDWR, 0); - if (fdw < 0) - continue; - error = ioctl(fdw, DIOCSMBR, buf); - close(fdw); - if (error == 0) + } else { + /* + * Try to write MBR directly. This may help when disk + * is not in use. + * XXX: hardcoded sectorsize + */ + error = pwrite(fd, buf, secsize, (sector * 512)); + if (error == secsize) return (0); } - warnx("Failed to write sector zero"); + + /* + * GEOM_MBR is not available or failed to write MBR. + * Now check that we have GEOM_PART and recommend to use gpart (8). + */ + if (geom_class_available("PART") != 0) + warnx("Failed to write MBR. Try to use gpart(8)."); + else + warnx("Failed to write sector zero"); return(EINVAL); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Nov 16 17:48:05 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B54FC106564A; Wed, 16 Nov 2011 17:48:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B6E38FC14; Wed, 16 Nov 2011 17:48:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGHm5Y5059858; Wed, 16 Nov 2011 17:48:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGHm5u8059853; Wed, 16 Nov 2011 17:48:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111161748.pAGHm5u8059853@svn.freebsd.org> From: John Baldwin Date: Wed, 16 Nov 2011 17:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227572 - in stable/8/sys: kern sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 17:48:05 -0000 Author: jhb Date: Wed Nov 16 17:48:05 2011 New Revision: 227572 URL: http://svn.freebsd.org/changeset/base/227572 Log: Partially MFC 218195, 218424, and 221829: - Put the general logic for being a CPU hog into a new function should_yield(). - Encapsulate the common case of check-and-yield into a new function maybe_yield(). - Add kern_yield() as a more generic version of uio_yield() and reimplement uio_yield() in terms of kern_yield(). To preserve the ABI of struct thread, should_yield() in 8 continues to use PCPU_GET(switchticks) rather than the td_swvolticks added in 9. Also, existing users of uio_yield() are left unchanged. Instead, the routines are merely added for use by new code. Reviewed by: mdf Modified: stable/8/sys/kern/kern_subr.c stable/8/sys/kern/kern_synch.c stable/8/sys/sys/priority.h stable/8/sys/sys/proc.h Modified: stable/8/sys/kern/kern_subr.c ============================================================================== --- stable/8/sys/kern/kern_subr.c Wed Nov 16 17:41:31 2011 (r227571) +++ stable/8/sys/kern/kern_subr.c Wed Nov 16 17:48:05 2011 (r227572) @@ -455,15 +455,8 @@ phashinit(int elements, struct malloc_ty void uio_yield(void) { - struct thread *td; - td = curthread; - DROP_GIANT(); - thread_lock(td); - sched_prio(td, td->td_user_pri); - mi_switch(SW_INVOL | SWT_RELINQUISH, NULL); - thread_unlock(td); - PICKUP_GIANT(); + kern_yield(PRI_USER); } int Modified: stable/8/sys/kern/kern_synch.c ============================================================================== --- stable/8/sys/kern/kern_synch.c Wed Nov 16 17:41:31 2011 (r227571) +++ stable/8/sys/kern/kern_synch.c Wed Nov 16 17:48:05 2011 (r227572) @@ -536,6 +536,38 @@ synch_setup(void *dummy) loadav(NULL); } +int +should_yield(void) +{ + + return (ticks - PCPU_GET(switchticks) >= hogticks); +} + +void +maybe_yield(void) +{ + + if (should_yield()) + kern_yield(PRI_USER); +} + +void +kern_yield(int prio) +{ + struct thread *td; + + td = curthread; + DROP_GIANT(); + thread_lock(td); + if (prio == PRI_USER) + prio = td->td_user_pri; + if (prio >= 0) + sched_prio(td, prio); + mi_switch(SW_VOL | SWT_RELINQUISH, NULL); + thread_unlock(td); + PICKUP_GIANT(); +} + /* * General purpose yield system call. */ Modified: stable/8/sys/sys/priority.h ============================================================================== --- stable/8/sys/sys/priority.h Wed Nov 16 17:41:31 2011 (r227571) +++ stable/8/sys/sys/priority.h Wed Nov 16 17:48:05 2011 (r227572) @@ -117,6 +117,12 @@ #define PRI_MIN_IDLE (224) #define PRI_MAX_IDLE (PRI_MAX) +#ifdef _KERNEL +/* Other arguments for kern_yield(9). */ +#define PRI_USER -2 /* Change to current user priority. */ +#define PRI_UNCHANGED -1 /* Do not change priority. */ +#endif + struct priority { u_char pri_class; /* Scheduling class. */ u_char pri_level; /* Normal priority level. */ Modified: stable/8/sys/sys/proc.h ============================================================================== --- stable/8/sys/sys/proc.h Wed Nov 16 17:41:31 2011 (r227571) +++ stable/8/sys/sys/proc.h Wed Nov 16 17:48:05 2011 (r227572) @@ -817,9 +817,11 @@ void fork_exit(void (*)(void *, struct t struct trapframe *); void fork_return(struct thread *, struct trapframe *); int inferior(struct proc *p); +void kern_yield(int); void kick_proc0(void); int leavepgrp(struct proc *p); int maybe_preempt(struct thread *td); +void maybe_yield(void); void mi_switch(int flags, struct thread *newtd); int p_candebug(struct thread *td, struct proc *p); int p_cansee(struct thread *td, struct proc *p); @@ -842,6 +844,7 @@ void sess_hold(struct session *); void sess_release(struct session *); int setrunnable(struct thread *); void setsugid(struct proc *p); +int should_yield(void); int sigonstack(size_t sp); void sleepinit(void); void stopevent(struct proc *, u_int, u_int); From owner-svn-src-stable-8@FreeBSD.ORG Wed Nov 16 18:33:18 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64CD41065672; Wed, 16 Nov 2011 18:33:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51BC48FC13; Wed, 16 Nov 2011 18:33:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGIXI0N061315; Wed, 16 Nov 2011 18:33:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGIXHsG061302; Wed, 16 Nov 2011 18:33:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111161833.pAGIXHsG061302@svn.freebsd.org> From: John Baldwin Date: Wed, 16 Nov 2011 18:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227573 - in stable/8: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 18:33:18 -0000 Author: jhb Date: Wed Nov 16 18:33:17 2011 New Revision: 227573 URL: http://svn.freebsd.org/changeset/base/227573 Log: MFC 220791,220793,220846,221836,226364: Add the posix_fallocate(2) syscall. The default implementation in vop_stdallocate() is filesystem agnostic and will run as slow as a read/write loop in userspace; however, it serves to correctly implement the functionality for filesystems that do not implement a VOP_ALLOCATE. Allow VOP_ALLOCATE to be iterative, and have kern_posix_fallocate(9) drive looping and potentially yielding. Reviewed by: mdf Added: stable/8/lib/libc/sys/posix_fallocate.2 - copied unchanged from r220791, head/lib/libc/sys/posix_fallocate.2 Modified: stable/8/lib/libc/sys/Makefile.inc stable/8/lib/libc/sys/Symbol.map stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/compat/freebsd32/syscalls.master stable/8/sys/kern/syscalls.master stable/8/sys/kern/vfs_default.c stable/8/sys/kern/vfs_syscalls.c stable/8/sys/kern/vnode_if.src stable/8/sys/sys/fcntl.h stable/8/sys/sys/param.h stable/8/sys/sys/vnode.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/lib/libc/sys/Makefile.inc ============================================================================== --- stable/8/lib/libc/sys/Makefile.inc Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/lib/libc/sys/Makefile.inc Wed Nov 16 18:33:17 2011 (r227573) @@ -86,7 +86,7 @@ MAN+= abort2.2 accept.2 access.2 acct.2 mq_setattr.2 \ msgctl.2 msgget.2 msgrcv.2 msgsnd.2 \ msync.2 munmap.2 nanosleep.2 nfssvc.2 ntp_adjtime.2 open.2 \ - pathconf.2 pipe.2 poll.2 posix_openpt.2 profil.2 \ + pathconf.2 pipe.2 poll.2 posix_fallocate.2 posix_openpt.2 profil.2 \ pselect.2 ptrace.2 quotactl.2 \ read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \ rtprio.2 Modified: stable/8/lib/libc/sys/Symbol.map ============================================================================== --- stable/8/lib/libc/sys/Symbol.map Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/lib/libc/sys/Symbol.map Wed Nov 16 18:33:17 2011 (r227573) @@ -360,6 +360,10 @@ FBSD_1.1 { unlinkat; }; +FBSD_1.2 { + posix_fallocate; +}; + FBSDprivate_1.0 { ___acl_aclcheck_fd; __sys___acl_aclcheck_fd; Copied: stable/8/lib/libc/sys/posix_fallocate.2 (from r220791, head/lib/libc/sys/posix_fallocate.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libc/sys/posix_fallocate.2 Wed Nov 16 18:33:17 2011 (r227573, copy of r220791, head/lib/libc/sys/posix_fallocate.2) @@ -0,0 +1,146 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)open.2 8.2 (Berkeley) 11/16/93 +.\" $FreeBSD$ +.\" +.Dd April 13, 2011 +.Dt POSIX_FALLOCATE 2 +.Os +.Sh NAME +.Nm posix_fallocate +.Nd pre-allocate storage for a range in a file +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In fcntl.h +.Ft int +.Fn posix_fallocate "int fd" "off_t offset" "off_t len" +.Sh DESCRIPTION +Required storage for the range +.Fa offset +to +.Fa offset + +.Fa len +in the file referenced by +.Fa fd +is guarateed to be allocated upon successful return. +That is, if +.Fn posix_fallocate +returns successfully, subsequent writes to the specified file data +will not fail due to lack of free space on the file system storage +media. +Any existing file data in the specified range is unmodified. +If +.Fa offset + +.Fa len +is beyond the current file size, then +.Fn posix_fallocate +will adjust the file size to +.Fa offset + +.Fa len . +Otherwise, the file size will not be changed. +.Pp +Space allocated by +.Fn posix_fallocate +will be freed by a successful call to +.Xr creat 2 +or +.Xr open 2 +that truncates the size of the file. +Space allocated via +.Fn posix_fallocate +may be freed by a successful call to +.Xr ftruncate 2 +that reduces the file size to a size smaller than +.Fa offset + +.Fa len . +.Pp +.Sh RETURN VALUES +If successful, +.Fn posix_fallocate +returns zero. +It returns -1 on failure, and sets +.Va errno +to indicate the error. +.Sh ERRORS +Possible failure conditions: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument is not a valid file descriptor. +.It Bq Er EBADF +The +.Fa fd +argument references a file that was opened without write permission. +.It Bq Er EFBIG +The value of +.Fa offset + +.Fa len +is greater than the maximum file size. +.It Bq Er EINTR +A signal was caught during execution. +.It Bq Er EINVAL +The +.Fa len +argument was zero or the +.Fa offset +argument was less than zero. +.It Bq Er EIO +An I/O error occurred while reading from or writing to a file system. +.It Bq Er ENODEV +The +.Fa fd +argument does not refer to a regular file. +.It Bq Er ENOSPC +There is insufficient free space remaining on the file system storage +media. +.It Bq Er ESPIPE +The +.Fa fd +argument is associated with a pipe or FIFO. +.El +.Sh SEE ALSO +.Xr creat 2 , +.Xr ftruncate 2 , +.Xr open 2 , +.Xr unlink 2 +.Sh STANDARDS +The +.Fn posix_fallocate +system call conforms to +.St -p1003.1-2004 . +.Sh HISTORY +The +.Fn posix_fallocate +function appeared in +.Fx 9.0 . +.Sh AUTHORS +.Fn posix_fallocate +and this manual page were initially written by +.An Matthew Fleming Aq mdf@FreeBSD.org . Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 16 18:33:17 2011 (r227573) @@ -2672,3 +2672,15 @@ freebsd32_kldstat(struct thread *td, str bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname)); return (copyout(&stat32, uap->stat, version)); } + +int +freebsd32_posix_fallocate(struct thread *td, + struct freebsd32_posix_fallocate_args *uap) +{ + struct posix_fallocate_args ap; + + ap.fd = uap->fd; + ap.offset = PAIR32TO64(off_t, uap->offset); + ap.len = PAIR32TO64(off_t, uap->len); + return (posix_fallocate(td, &ap)); +} Modified: stable/8/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/8/sys/compat/freebsd32/syscalls.master Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/compat/freebsd32/syscalls.master Wed Nov 16 18:33:17 2011 (r227573) @@ -963,3 +963,14 @@ fd_set *ou, fd_set *ex, \ const struct timespec32 *ts, \ const sigset_t *sm); } +523 AUE_NULL UNIMPL getloginclass +524 AUE_NULL UNIMPL setloginclass +525 AUE_NULL UNIMPL rctl_get_racct +526 AUE_NULL UNIMPL rctl_get_rules +527 AUE_NULL UNIMPL rctl_get_limits +528 AUE_NULL UNIMPL rctl_add_rule +529 AUE_NULL UNIMPL rctl_remove_rule +530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd,\ + uint32_t offset1, uint32_t offset2,\ + uint32_t len1, uint32_t len2); } +531 AUE_NULL UNIMPL posix_fadvise Modified: stable/8/sys/kern/syscalls.master ============================================================================== --- stable/8/sys/kern/syscalls.master Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/kern/syscalls.master Wed Nov 16 18:33:17 2011 (r227573) @@ -927,5 +927,15 @@ fd_set *ou, fd_set *ex, \ const struct timespec *ts, \ const sigset_t *sm); } +523 AUE_NULL UNIMPL getloginclass +524 AUE_NULL UNIMPL setloginclass +525 AUE_NULL UNIMPL rctl_get_racct +526 AUE_NULL UNIMPL rctl_get_rules +527 AUE_NULL UNIMPL rctl_get_limits +528 AUE_NULL UNIMPL rctl_add_rule +529 AUE_NULL UNIMPL rctl_remove_rule +530 AUE_NULL STD { int posix_fallocate(int fd, \ + off_t offset, off_t len); } +531 AUE_NULL UNIMPL posix_fadvise ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: stable/8/sys/kern/vfs_default.c ============================================================================== --- stable/8/sys/kern/vfs_default.c Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/kern/vfs_default.c Wed Nov 16 18:33:17 2011 (r227573) @@ -98,6 +98,7 @@ struct vop_vector default_vnodeops = { .vop_accessx = vop_stdaccessx, .vop_advlock = vop_stdadvlock, .vop_advlockasync = vop_stdadvlockasync, + .vop_allocate = vop_stdallocate, .vop_bmap = vop_stdbmap, .vop_close = VOP_NULL, .vop_fsync = VOP_NULL, @@ -844,6 +845,134 @@ out: return (error); } +int +vop_stdallocate(struct vop_allocate_args *ap) +{ +#ifdef __notyet__ + struct statfs sfs; +#endif + struct iovec aiov; + struct vattr vattr, *vap; + struct uio auio; + off_t fsize, len, cur, offset; + uint8_t *buf; + struct thread *td; + struct vnode *vp; + size_t iosize; + int error; + + buf = NULL; + error = 0; + td = curthread; + vap = &vattr; + vp = ap->a_vp; + len = *ap->a_len; + offset = *ap->a_offset; + + error = VOP_GETATTR(vp, vap, td->td_ucred); + if (error != 0) + goto out; + fsize = vap->va_size; + iosize = vap->va_blocksize; + if (iosize == 0) + iosize = BLKDEV_IOSIZE; + if (iosize > MAXPHYS) + iosize = MAXPHYS; + buf = malloc(iosize, M_TEMP, M_WAITOK); + +#ifdef __notyet__ + /* + * Check if the filesystem sets f_maxfilesize; if not use + * VOP_SETATTR to perform the check. + */ + error = VFS_STATFS(vp->v_mount, &sfs, td); + if (error != 0) + goto out; + if (sfs.f_maxfilesize) { + if (offset > sfs.f_maxfilesize || len > sfs.f_maxfilesize || + offset + len > sfs.f_maxfilesize) { + error = EFBIG; + goto out; + } + } else +#endif + if (offset + len > vap->va_size) { + /* + * Test offset + len against the filesystem's maxfilesize. + */ + VATTR_NULL(vap); + vap->va_size = offset + len; + error = VOP_SETATTR(vp, vap, td->td_ucred); + if (error != 0) + goto out; + VATTR_NULL(vap); + vap->va_size = fsize; + error = VOP_SETATTR(vp, vap, td->td_ucred); + if (error != 0) + goto out; + } + + for (;;) { + /* + * Read and write back anything below the nominal file + * size. There's currently no way outside the filesystem + * to know whether this area is sparse or not. + */ + cur = iosize; + if ((offset % iosize) != 0) + cur -= (offset % iosize); + if (cur > len) + cur = len; + if (offset < fsize) { + aiov.iov_base = buf; + aiov.iov_len = cur; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = offset; + auio.uio_resid = cur; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_rw = UIO_READ; + auio.uio_td = td; + error = VOP_READ(vp, &auio, 0, td->td_ucred); + if (error != 0) + break; + if (auio.uio_resid > 0) { + bzero(buf + cur - auio.uio_resid, + auio.uio_resid); + } + } else { + bzero(buf, cur); + } + + aiov.iov_base = buf; + aiov.iov_len = cur; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = offset; + auio.uio_resid = cur; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_rw = UIO_WRITE; + auio.uio_td = td; + + error = VOP_WRITE(vp, &auio, 0, td->td_ucred); + if (error != 0) + break; + + len -= cur; + offset += cur; + if (len == 0) + break; + if (should_yield()) + break; + } + + out: + *ap->a_len = len; + *ap->a_offset = offset; + free(buf, M_TEMP); + return (error); +} + /* * vfs default ops * used to fill the vfs function table to get reasonable default return values. Modified: stable/8/sys/kern/vfs_syscalls.c ============================================================================== --- stable/8/sys/kern/vfs_syscalls.c Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/kern/vfs_syscalls.c Wed Nov 16 18:33:17 2011 (r227573) @@ -4654,3 +4654,98 @@ out: VFS_UNLOCK_GIANT(vfslocked); return (error); } + +static int +kern_posix_fallocate(struct thread *td, int fd, off_t offset, off_t len) +{ + struct file *fp; + struct mount *mp; + struct vnode *vp; + off_t olen, ooffset; + int error, vfslocked; + + fp = NULL; + vfslocked = 0; + error = fget(td, fd, &fp); + if (error != 0) + goto out; + + switch (fp->f_type) { + case DTYPE_VNODE: + break; + case DTYPE_PIPE: + case DTYPE_FIFO: + error = ESPIPE; + goto out; + default: + error = ENODEV; + goto out; + } + if ((fp->f_flag & FWRITE) == 0) { + error = EBADF; + goto out; + } + vp = fp->f_vnode; + if (vp->v_type != VREG) { + error = ENODEV; + goto out; + } + if (offset < 0 || len <= 0) { + error = EINVAL; + goto out; + } + /* Check for wrap. */ + if (offset > OFF_MAX - len) { + error = EFBIG; + goto out; + } + + /* Allocating blocks may take a long time, so iterate. */ + for (;;) { + olen = len; + ooffset = offset; + + bwillwrite(); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + mp = NULL; + error = vn_start_write(vp, &mp, V_WAIT | PCATCH); + if (error != 0) { + VFS_UNLOCK_GIANT(vfslocked); + break; + } + error = vn_lock(vp, LK_EXCLUSIVE); + if (error != 0) { + vn_finished_write(mp); + VFS_UNLOCK_GIANT(vfslocked); + break; + } +#ifdef MAC + error = mac_vnode_check_write(td->td_ucred, fp->f_cred, vp); + if (error == 0) +#endif + error = VOP_ALLOCATE(vp, &offset, &len); + VOP_UNLOCK(vp, 0); + vn_finished_write(mp); + VFS_UNLOCK_GIANT(vfslocked); + + if (olen + ooffset != offset + len) { + panic("offset + len changed from %jx/%jx to %jx/%jx", + ooffset, olen, offset, len); + } + if (error != 0 || len == 0) + break; + KASSERT(olen > len, ("Iteration did not make progress?")); + maybe_yield(); + } + out: + if (fp != NULL) + fdrop(fp, td); + return (error); +} + +int +posix_fallocate(struct thread *td, struct posix_fallocate_args *uap) +{ + + return (kern_posix_fallocate(td, uap->fd, uap->offset, uap->len)); +} Modified: stable/8/sys/kern/vnode_if.src ============================================================================== --- stable/8/sys/kern/vnode_if.src Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/kern/vnode_if.src Wed Nov 16 18:33:17 2011 (r227573) @@ -601,6 +601,7 @@ vop_vptofh { IN struct fid *fhp; }; + %% vptocnp vp L L L %% vptocnp vpp - U - @@ -611,3 +612,12 @@ vop_vptocnp { INOUT char *buf; INOUT int *buflen; }; + + +%% allocate vp E E E + +vop_allocate { + IN struct vnode *vp; + INOUT off_t *offset; + INOUT off_t *len; +}; Modified: stable/8/sys/sys/fcntl.h ============================================================================== --- stable/8/sys/sys/fcntl.h Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/sys/fcntl.h Wed Nov 16 18:33:17 2011 (r227573) @@ -278,7 +278,7 @@ struct oflock { #endif /* - * XXX missing posix_fadvise() and posix_fallocate(), and POSIX_FADV_* macros. + * XXX missing posix_fadvise() and POSIX_FADV_* macros. */ #ifndef _KERNEL @@ -289,6 +289,9 @@ int fcntl(int, int, ...); #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 int openat(int, const char *, int, ...); #endif +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 +int posix_fallocate(int, off_t, off_t); +#endif #if __BSD_VISIBLE int flock(int, int); #endif Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/sys/param.h Wed Nov 16 18:33:17 2011 (r227573) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 802513 /* Master, propagated to newvers */ +#define __FreeBSD_version 802514 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGWAIT 700000 Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/sys/vnode.h Wed Nov 16 18:33:17 2011 (r227573) @@ -688,6 +688,7 @@ int vop_stdaccess(struct vop_access_args int vop_stdaccessx(struct vop_accessx_args *ap); int vop_stdadvlock(struct vop_advlock_args *ap); int vop_stdadvlockasync(struct vop_advlockasync_args *ap); +int vop_stdallocate(struct vop_allocate_args *ap); int vop_stdpathconf(struct vop_pathconf_args *); int vop_stdpoll(struct vop_poll_args *); int vop_stdvptocnp(struct vop_vptocnp_args *ap); From owner-svn-src-stable-8@FreeBSD.ORG Wed Nov 16 18:36:28 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E5AF106564A; Wed, 16 Nov 2011 18:36:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C0B68FC08; Wed, 16 Nov 2011 18:36:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGIaSxp061495; Wed, 16 Nov 2011 18:36:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGIaSY6061483; Wed, 16 Nov 2011 18:36:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111161836.pAGIaSY6061483@svn.freebsd.org> From: John Baldwin Date: Wed, 16 Nov 2011 18:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227575 - in stable/8/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 18:36:28 -0000 Author: jhb Date: Wed Nov 16 18:36:27 2011 New Revision: 227575 URL: http://svn.freebsd.org/changeset/base/227575 Log: Regen. Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h stable/8/sys/compat/freebsd32/freebsd32_syscall.h stable/8/sys/compat/freebsd32/freebsd32_syscalls.c stable/8/sys/compat/freebsd32/freebsd32_sysent.c stable/8/sys/compat/freebsd32/freebsd32_systrace_args.c stable/8/sys/kern/init_sysent.c stable/8/sys/kern/syscalls.c stable/8/sys/kern/systrace_args.c stable/8/sys/sys/syscall.h stable/8/sys/sys/syscall.mk stable/8/sys/sys/sysproto.h Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_proto.h Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/compat/freebsd32/freebsd32_proto.h Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -568,6 +568,13 @@ struct freebsd32_pselect_args { char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)]; char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; }; +struct freebsd32_posix_fallocate_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; +}; #if !defined(PAD64_REQUIRED) && defined(__powerpc__) #define PAD64_REQUIRED #endif @@ -676,6 +683,7 @@ int freebsd32_semctl(struct thread *, st int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *); int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); int freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); +int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); #ifdef COMPAT_43 @@ -1006,6 +1014,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_msgctl AUE_MSGCTL #define FREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL #define FREEBSD32_SYS_AUE_freebsd32_pselect AUE_SELECT +#define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/8/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscall.h Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/compat/freebsd32/freebsd32_syscall.h Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #define FREEBSD32_SYS_syscall 0 @@ -410,4 +410,5 @@ #define FREEBSD32_SYS_freebsd32_shmctl 512 #define FREEBSD32_SYS_lpathconf 513 #define FREEBSD32_SYS_freebsd32_pselect 522 -#define FREEBSD32_SYS_MAXSYSCALL 523 +#define FREEBSD32_SYS_freebsd32_posix_fallocate 530 +#define FREEBSD32_SYS_MAXSYSCALL 532 Modified: stable/8/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ const char *freebsd32_syscallnames[] = { @@ -546,4 +546,13 @@ const char *freebsd32_syscallnames[] = { "#520", /* 520 = pdgetpid */ "#521", /* 521 = pdwait */ "freebsd32_pselect", /* 522 = freebsd32_pselect */ + "#523", /* 523 = getloginclass */ + "#524", /* 524 = setloginclass */ + "#525", /* 525 = rctl_get_racct */ + "#526", /* 526 = rctl_get_rules */ + "#527", /* 527 = rctl_get_limits */ + "#528", /* 528 = rctl_add_rule */ + "#529", /* 529 = rctl_remove_rule */ + "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ + "#531", /* 531 = posix_fadvise */ }; Modified: stable/8/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_sysent.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/compat/freebsd32/freebsd32_sysent.c Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #include "opt_compat.h" @@ -583,4 +583,13 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ { AS(freebsd32_pselect_args), (sy_call_t *)freebsd32_pselect, AUE_SELECT, NULL, 0, 0, 0 }, /* 522 = freebsd32_pselect */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 523 = getloginclass */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 524 = setloginclass */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 525 = rctl_get_racct */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 526 = rctl_get_rules */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 527 = rctl_get_limits */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 528 = rctl_add_rule */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 529 = rctl_remove_rule */ + { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0 }, /* 530 = freebsd32_posix_fallocate */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 531 = posix_fadvise */ }; Modified: stable/8/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Nov 16 18:36:27 2011 (r227575) @@ -2930,6 +2930,17 @@ systrace_args(int sysnum, void *params, *n_args = 6; break; } + /* freebsd32_posix_fallocate */ + case 530: { + struct freebsd32_posix_fallocate_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = p->offset1; /* uint32_t */ + uarg[2] = p->offset2; /* uint32_t */ + uarg[3] = p->len1; /* uint32_t */ + uarg[4] = p->len2; /* uint32_t */ + *n_args = 5; + break; + } default: *n_args = 0; break; @@ -7810,6 +7821,28 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* freebsd32_posix_fallocate */ + case 530: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "uint32_t"; + break; + case 4: + p = "uint32_t"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/8/sys/kern/init_sysent.c ============================================================================== --- stable/8/sys/kern/init_sysent.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/kern/init_sysent.c Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 212545 2010-09-13 08:49:08Z kib + * created from FreeBSD: stable/8/sys/kern/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #include "opt_compat.h" @@ -557,4 +557,13 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ { AS(pselect_args), (sy_call_t *)pselect, AUE_SELECT, NULL, 0, 0, 0 }, /* 522 = pselect */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 523 = getloginclass */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 524 = setloginclass */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 525 = rctl_get_racct */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 526 = rctl_get_rules */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 527 = rctl_get_limits */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 528 = rctl_add_rule */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 529 = rctl_remove_rule */ + { AS(posix_fallocate_args), (sy_call_t *)posix_fallocate, AUE_NULL, NULL, 0, 0, 0 }, /* 530 = posix_fallocate */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 531 = posix_fadvise */ }; Modified: stable/8/sys/kern/syscalls.c ============================================================================== --- stable/8/sys/kern/syscalls.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/kern/syscalls.c Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 212545 2010-09-13 08:49:08Z kib + * created from FreeBSD: stable/8/sys/kern/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ const char *syscallnames[] = { @@ -530,4 +530,13 @@ const char *syscallnames[] = { "#520", /* 520 = pdgetpid */ "#521", /* 521 = pdwait */ "pselect", /* 522 = pselect */ + "#523", /* 523 = getloginclass */ + "#524", /* 524 = setloginclass */ + "#525", /* 525 = rctl_get_racct */ + "#526", /* 526 = rctl_get_rules */ + "#527", /* 527 = rctl_get_limits */ + "#528", /* 528 = rctl_add_rule */ + "#529", /* 529 = rctl_remove_rule */ + "posix_fallocate", /* 530 = posix_fallocate */ + "#531", /* 531 = posix_fadvise */ }; Modified: stable/8/sys/kern/systrace_args.c ============================================================================== --- stable/8/sys/kern/systrace_args.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/kern/systrace_args.c Wed Nov 16 18:36:27 2011 (r227575) @@ -3108,6 +3108,15 @@ systrace_args(int sysnum, void *params, *n_args = 6; break; } + /* posix_fallocate */ + case 530: { + struct posix_fallocate_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* off_t */ + iarg[2] = p->len; /* off_t */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -8265,6 +8274,22 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* posix_fallocate */ + case 530: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "off_t"; + break; + case 2: + p = "off_t"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/8/sys/sys/syscall.h ============================================================================== --- stable/8/sys/sys/syscall.h Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/sys/syscall.h Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 212545 2010-09-13 08:49:08Z kib + * created from FreeBSD: stable/8/sys/kern/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #define SYS_syscall 0 @@ -431,4 +431,5 @@ #define SYS_shmctl 512 #define SYS_lpathconf 513 #define SYS_pselect 522 -#define SYS_MAXSYSCALL 523 +#define SYS_posix_fallocate 530 +#define SYS_MAXSYSCALL 532 Modified: stable/8/sys/sys/syscall.mk ============================================================================== --- stable/8/sys/sys/syscall.mk Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/sys/syscall.mk Wed Nov 16 18:36:27 2011 (r227575) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/8/sys/kern/syscalls.master 212545 2010-09-13 08:49:08Z kib +# created from FreeBSD: stable/8/sys/kern/syscalls.master 227573 2011-11-16 18:33:17Z jhb MIASM = \ syscall.o \ exit.o \ @@ -379,4 +379,5 @@ MIASM = \ msgctl.o \ shmctl.o \ lpathconf.o \ - pselect.o + pselect.o \ + posix_fallocate.o Modified: stable/8/sys/sys/sysproto.h ============================================================================== --- stable/8/sys/sys/sysproto.h Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/sys/sysproto.h Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 212545 2010-09-13 08:49:08Z kib + * created from FreeBSD: stable/8/sys/kern/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #ifndef _SYS_SYSPROTO_H_ @@ -1665,6 +1665,11 @@ struct pselect_args { char ts_l_[PADL_(const struct timespec *)]; const struct timespec * ts; char ts_r_[PADR_(const struct timespec *)]; char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; }; +struct posix_fallocate_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; + char len_l_[PADL_(off_t)]; off_t len; char len_r_[PADR_(off_t)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_exit(struct thread *, struct sys_exit_args *); int fork(struct thread *, struct fork_args *); @@ -2026,6 +2031,7 @@ int msgctl(struct thread *, struct msgct int shmctl(struct thread *, struct shmctl_args *); int lpathconf(struct thread *, struct lpathconf_args *); int pselect(struct thread *, struct pselect_args *); +int posix_fallocate(struct thread *, struct posix_fallocate_args *); #ifdef COMPAT_43 @@ -2701,6 +2707,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_shmctl AUE_SHMCTL #define SYS_AUE_lpathconf AUE_LPATHCONF #define SYS_AUE_pselect AUE_SELECT +#define SYS_AUE_posix_fallocate AUE_NULL #undef PAD_ #undef PADL_ From owner-svn-src-stable-8@FreeBSD.ORG Thu Nov 17 00:36:11 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F371106564A; Thu, 17 Nov 2011 00:36:11 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D94F8FC16; Thu, 17 Nov 2011 00:36:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH0aBGS073840; Thu, 17 Nov 2011 00:36:11 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH0aBRi073835; Thu, 17 Nov 2011 00:36:11 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111170036.pAH0aBRi073835@svn.freebsd.org> From: Doug Barton Date: Thu, 17 Nov 2011 00:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227599 - in stable/8/contrib/bind9: . bin/named lib/dns X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 00:36:11 -0000 Author: dougb Date: Thu Nov 17 00:36:10 2011 New Revision: 227599 URL: http://svn.freebsd.org/changeset/base/227599 Log: Upgrade to BIND 9.6-ESV-R5-P1 to address the following DDOS bug: Recursive name servers are failing with an assertion: INSIST(! dns_rdataset_isassociated(sigrdataset)) At this time it is not thought that authoritative-only servers are affected, but information about this bug is evolving rapidly. Because it may be possible to trigger this bug even on networks that do not allow untrusted users to access the recursive name servers (perhaps via specially crafted e-mail messages, and/or malicious web sites) it is recommended that ALL operators of recursive name servers upgrade immediately. For more information see: https://www.isc.org/software/bind/advisories/cve-2011-tbd which will be updated as more information becomes available. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4313 Modified: stable/8/contrib/bind9/CHANGES stable/8/contrib/bind9/bin/named/query.c stable/8/contrib/bind9/lib/dns/rbtdb.c stable/8/contrib/bind9/version Directory Properties: stable/8/contrib/bind9/ (props changed) Modified: stable/8/contrib/bind9/CHANGES ============================================================================== --- stable/8/contrib/bind9/CHANGES Thu Nov 17 00:34:31 2011 (r227598) +++ stable/8/contrib/bind9/CHANGES Thu Nov 17 00:36:10 2011 (r227599) @@ -1,3 +1,9 @@ + --- 9.6-ESV-R5-P1 released --- + +3218. [security] Cache lookup could return RRSIG data associated with + nonexistent records, leading to an assertion + failure. [RT #26590] + --- 9.6-ESV-R5 released --- 3135. [port] FreeBSD: workaround broken IPV6_USE_MIN_MTU processing. Modified: stable/8/contrib/bind9/bin/named/query.c ============================================================================== --- stable/8/contrib/bind9/bin/named/query.c Thu Nov 17 00:34:31 2011 (r227598) +++ stable/8/contrib/bind9/bin/named/query.c Thu Nov 17 00:36:10 2011 (r227599) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.313.20.27 2011-03-19 09:47:54 marka Exp $ */ +/* $Id: query.c,v 1.313.20.27.8.1 2011-11-16 09:11:42 marka Exp $ */ /*! \file */ @@ -1280,11 +1280,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1325,8 +1323,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1776,10 +1775,8 @@ query_addadditional2(void *arg, dns_name goto setcache; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(! dns_rdataset_isassociated(sigrdataset)); + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { /* Remember the result as a cache */ Modified: stable/8/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/rbtdb.c Thu Nov 17 00:34:31 2011 (r227598) +++ stable/8/contrib/bind9/lib/dns/rbtdb.c Thu Nov 17 00:36:10 2011 (r227599) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.270.12.32 2011-06-09 00:16:35 each Exp $ */ +/* $Id: rbtdb.c,v 1.270.12.32.8.1 2011-11-16 09:11:42 marka Exp $ */ /*! \file */ @@ -4681,7 +4681,7 @@ cache_find(dns_db_t *db, dns_name_t *nam rdataset); if (need_headerupdate(found, search.now)) update = found; - if (foundsig != NULL) { + if (!NEGATIVE(found) && foundsig != NULL) { bind_rdataset(search.rbtdb, node, foundsig, search.now, sigrdataset); if (need_headerupdate(foundsig, search.now)) @@ -5313,7 +5313,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn } if (found != NULL) { bind_rdataset(rbtdb, rbtnode, found, now, rdataset); - if (foundsig != NULL) + if (!NEGATIVE(found) && foundsig != NULL) bind_rdataset(rbtdb, rbtnode, foundsig, now, sigrdataset); } Modified: stable/8/contrib/bind9/version ============================================================================== --- stable/8/contrib/bind9/version Thu Nov 17 00:34:31 2011 (r227598) +++ stable/8/contrib/bind9/version Thu Nov 17 00:36:10 2011 (r227599) @@ -1,4 +1,4 @@ -# $Id: version,v 1.43.12.14 2011-07-21 02:48:13 marka Exp $ +# $Id: version,v 1.43.12.14.10.1 2011-11-16 09:18:28 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R5 +RELEASEVER=-R5-P1 From owner-svn-src-stable-8@FreeBSD.ORG Thu Nov 17 01:02:46 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 467D710657B5; Thu, 17 Nov 2011 01:02:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BA978FC17; Thu, 17 Nov 2011 01:02:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH12jFV074754; Thu, 17 Nov 2011 01:02:45 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH12j3l074752; Thu, 17 Nov 2011 01:02:45 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111170102.pAH12j3l074752@svn.freebsd.org> From: Rick Macklem Date: Thu, 17 Nov 2011 01:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227601 - stable/8/sys/rpc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 01:02:46 -0000 Author: rmacklem Date: Thu Nov 17 01:02:45 2011 New Revision: 227601 URL: http://svn.freebsd.org/changeset/base/227601 Log: MFC: r227059 Both a crash reported on freebsd-current on Oct. 18 under the subject heading "mtx_lock() of destroyed mutex on NFS" and PR# 156168 appear to be caused by clnt_dg_destroy() closing down the socket prematurely. When to close down the socket is controlled by a reference count (cs_refs), but clnt_dg_create() checks for sb_upcall being non-NULL to decide if a new socket is needed. I believe the crashes were caused by the following race: clnt_dg_destroy() finds cs_refs == 0 and decides to delete socket clnt_dg_destroy() then loses race with clnt_dg_create() for acquisition of the SOCKBUF_LOCK() clnt_dg_create() finds sb_upcall != NULL and increments cs_refs to 1 clnt_dg_destroy() then acquires SOCKBUF_LOCK(), sets sb_upcall to NULL and destroys socket This patch fixes the above race by changing clnt_dg_destroy() so that it acquires SOCKBUF_LOCK() before testing cs_refs. Tested by: bz Reviewed by: dfr Modified: stable/8/sys/rpc/clnt_dg.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/rpc/clnt_dg.c ============================================================================== --- stable/8/sys/rpc/clnt_dg.c Thu Nov 17 01:02:33 2011 (r227600) +++ stable/8/sys/rpc/clnt_dg.c Thu Nov 17 01:02:45 2011 (r227601) @@ -1001,12 +1001,12 @@ clnt_dg_destroy(CLIENT *cl) cs = cu->cu_socket->so_rcv.sb_upcallarg; clnt_dg_close(cl); + SOCKBUF_LOCK(&cu->cu_socket->so_rcv); mtx_lock(&cs->cs_lock); cs->cs_refs--; if (cs->cs_refs == 0) { mtx_unlock(&cs->cs_lock); - SOCKBUF_LOCK(&cu->cu_socket->so_rcv); soupcall_clear(cu->cu_socket, SO_RCV); clnt_dg_upcallsdone(cu->cu_socket, cs); SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); @@ -1015,6 +1015,7 @@ clnt_dg_destroy(CLIENT *cl) lastsocketref = TRUE; } else { mtx_unlock(&cs->cs_lock); + SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); lastsocketref = FALSE; } From owner-svn-src-stable-8@FreeBSD.ORG Thu Nov 17 11:16:57 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A02B7106566C; Thu, 17 Nov 2011 11:16:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F0938FC13; Thu, 17 Nov 2011 11:16:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHBGvgg001847; Thu, 17 Nov 2011 11:16:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHBGvMs001844; Thu, 17 Nov 2011 11:16:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111171116.pAHBGvMs001844@svn.freebsd.org> From: Xin LI Date: Thu, 17 Nov 2011 11:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227611 - in stable: 7/sys/dev/mfi 8/sys/dev/mfi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 11:16:57 -0000 Author: delphij Date: Thu Nov 17 11:16:56 2011 New Revision: 227611 URL: http://svn.freebsd.org/changeset/base/227611 Log: MFC r227409: Do a dummy read to flush the interrupt ACK that we just performed, ensuring that everything is really, truly consistent. This fixes certain cases where one will see various: mfi0: COMMAND 0xffffffXXXXXXXXXX TIMEOUT AFTER XX SECONDS Requested by: Vincent Hoffman Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/7/sys/dev/mfi/mfi.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Thu Nov 17 10:46:51 2011 (r227610) +++ stable/8/sys/dev/mfi/mfi.c Thu Nov 17 11:16:56 2011 (r227611) @@ -932,6 +932,12 @@ mfi_intr(void *arg) if (sc->mfi_check_clear_intr(sc)) return; + /* + * Do a dummy read to flush the interrupt ACK that we just performed, + * ensuring that everything is really, truly consistent. + */ + (void)sc->mfi_read_fw_status(sc); + pi = sc->mfi_comms->hw_pi; ci = sc->mfi_comms->hw_ci; mtx_lock(&sc->mfi_io_lock); From owner-svn-src-stable-8@FreeBSD.ORG Thu Nov 17 12:37:51 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D0D11065672; Thu, 17 Nov 2011 12:37:51 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C20D8FC15; Thu, 17 Nov 2011 12:37:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHCbpXc007155; Thu, 17 Nov 2011 12:37:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCbom9007153; Thu, 17 Nov 2011 12:37:50 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171237.pAHCbom9007153@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 12:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227621 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:37:51 -0000 Author: brueffer Date: Thu Nov 17 12:37:50 2011 New Revision: 227621 URL: http://svn.freebsd.org/changeset/base/227621 Log: MFC: r227448 Reword a sentence in the HARDWARE section a little to make it more suitable for automatic hardware notes generation. Modified: stable/8/share/man/man4/mps.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/mps.4 ============================================================================== --- stable/8/share/man/man4/mps.4 Thu Nov 17 12:28:00 2011 (r227620) +++ stable/8/share/man/man4/mps.4 Thu Nov 17 12:37:50 2011 (r227621) @@ -60,9 +60,9 @@ driver provides support for LSI Logic Fu .Tn SAS controllers. .Sh HARDWARE -The following controllers are supported by the +The .Nm -driver +driver supports the following controllers: .Pp .Bl -bullet -compact .It From owner-svn-src-stable-8@FreeBSD.ORG Fri Nov 18 21:05:00 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09B05106567B; Fri, 18 Nov 2011 21:05:00 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC6DC8FC0C; Fri, 18 Nov 2011 21:04:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIL4xo6098448; Fri, 18 Nov 2011 21:04:59 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIL4xXY098446; Fri, 18 Nov 2011 21:04:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182104.pAIL4xXY098446@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 21:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227679 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 21:05:00 -0000 Author: dougb Date: Fri Nov 18 21:04:59 2011 New Revision: 227679 URL: http://svn.freebsd.org/changeset/base/227679 Log: MFC r213077: Simplify how we find the kernel source. MFC r222218: expr -> sh arithmetic expansion MFC r226863: Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR} (since it no longer exists). Instead, run svnversion if we can find the binary and test that the output looks like a version string. Modified: stable/8/sys/conf/newvers.sh Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/conf/newvers.sh ============================================================================== --- stable/8/sys/conf/newvers.sh Fri Nov 18 20:51:31 2011 (r227678) +++ stable/8/sys/conf/newvers.sh Fri Nov 18 21:04:59 2011 (r227679) @@ -38,16 +38,16 @@ if [ "X${BRANCH_OVERRIDE}" != "X" ]; the fi RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" +SYSDIR=$(dirname $0)/.. if [ "X${PARAMFILE}" != "X" ]; then RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ ${PARAMFILE}) else RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ - $(dirname $0)/../sys/param.h) + ${SYSDIR}/sys/param.h) fi - b=share/examples/etc/bsd-style-copyright year=`date '+%Y'` # look for copyright template @@ -87,51 +87,47 @@ touch version v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` i=`${MAKE:-make} -V KERN_IDENT` -case "$d" in -*/sys/*) - SRCDIR=${d##*obj} - if [ -n "$MACHINE" ]; then - SRCDIR=${SRCDIR##/$MACHINE} +for dir in /bin /usr/bin /usr/local/bin; do + if [ -x "${dir}/svnversion" ] ; then + svnversion=${dir}/svnversion + break + fi + if [ -d "${SYSDIR}/../.git" -a -x "${dir}/git" ] ; then + git_cmd="${dir}/git --git-dir=${SYSDIR}/../.git" + break fi - SRCDIR=${SRCDIR%%/sys/*} +done - for dir in /bin /usr/bin /usr/local/bin; do - if [ -d "${SRCDIR}/sys/.svn" -a -x "${dir}/svnversion" ] ; then - svnversion=${dir}/svnversion - break - fi - if [ -d "${SRCDIR}/.git" -a -x "${dir}/git" ] ; then - git_cmd="${dir}/git --git-dir=${SRCDIR}/.git" - break - fi - done +if [ -n "$svnversion" ] ; then + echo "$svnversion" + svn=`cd ${SYSDIR} && $svnversion` + case "$svn" in + [0-9]*) svn=" r${svn}" ;; + *) unset svn ;; + esac +fi - if [ -n "$svnversion" ] ; then - svn=" r`cd ${SRCDIR}/sys && $svnversion`" - fi - if [ -n "$git_cmd" ] ; then - git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` - svn=`$git_cmd svn find-rev $git 2>/dev/null` - if [ -n "$svn" ] ; then +if [ -n "$git_cmd" ] ; then + git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` + svn=`$git_cmd svn find-rev $git 2>/dev/null` + if [ -n "$svn" ] ; then + svn=" r${svn}" + git="=${git}" + else + svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ + sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` + if [ -n $svn ] ; then svn=" r${svn}" - git="=${git}" + git="+${git}" else - svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ - sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -n $svn ] ; then - svn=" r${svn}" - git="+${git}" - else - git=" ${git}" - fi - fi - if $git_cmd --work-tree=${SRCDIR} diff-index \ - --name-only HEAD | read dummy; then - git="${git}-dirty" + git=" ${git}" fi fi - ;; -esac + if $git_cmd --work-tree=${SYSDIR}/.. diff-index \ + --name-only HEAD | read dummy; then + git="${git}-dirty" + fi +fi cat << EOF > vers.c $COPYRIGHT @@ -147,4 +143,4 @@ int osreldate = ${RELDATE}; char kern_ident[] = "${i}"; EOF -echo `expr ${v} + 1` > version +echo $((v + 1)) > version From owner-svn-src-stable-8@FreeBSD.ORG Fri Nov 18 21:12:59 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E74D1065675; Fri, 18 Nov 2011 21:12:59 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5808FC0A; Fri, 18 Nov 2011 21:12:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAILCxcr099049; Fri, 18 Nov 2011 21:12:59 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAILCxGl099047; Fri, 18 Nov 2011 21:12:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182112.pAILCxGl099047@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 21:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227683 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 21:12:59 -0000 Author: dougb Date: Fri Nov 18 21:12:58 2011 New Revision: 227683 URL: http://svn.freebsd.org/changeset/base/227683 Log: MFC r227416: Document that flock can return ENOLCK Modified: stable/8/lib/libc/sys/flock.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/flock.2 ============================================================================== --- stable/8/lib/libc/sys/flock.2 Fri Nov 18 21:12:05 2011 (r227682) +++ stable/8/lib/libc/sys/flock.2 Fri Nov 18 21:12:58 2011 (r227683) @@ -28,7 +28,7 @@ .\" @(#)flock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 22, 2008 +.Dd November 9, 2011 .Dt FLOCK 2 .Os .Sh NAME @@ -154,6 +154,8 @@ refers to an object other than a file. The argument .Fa fd refers to an object that does not support file locking. +.It Bq Er ENOLCK +A lock was requested, but no locks are available. .El .Sh SEE ALSO .Xr close 2 , From owner-svn-src-stable-8@FreeBSD.ORG Sat Nov 19 13:03:15 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3C2E1065747; Sat, 19 Nov 2011 13:03:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 992D18FC1B; Sat, 19 Nov 2011 13:03:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJD3F05044084; Sat, 19 Nov 2011 13:03:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJD3FZZ044075; Sat, 19 Nov 2011 13:03:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191303.pAJD3FZZ044075@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227713 - in stable/8: share/man/man9 sys/dev/ofw sys/kern sys/powerpc/powerpc sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:03:15 -0000 Author: marius Date: Sat Nov 19 13:03:14 2011 New Revision: 227713 URL: http://svn.freebsd.org/changeset/base/227713 Log: MFC: r227537 As it turns out, r186347 actually is insufficient to avoid the use of the curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style curthread implementation on sparc64, crashing the kernel in its early cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the things we need for that, which leads to a chicken-and-egg problem). What happens is that due to the fact that the idea of r210623 actually is to allow the compiler to cache invocations of curthread, it factors out obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to before the branch based on kobj_mutex_inited when compiling the kernel without the debugging options. So change kobj_class_compile_static(9) to just never acquire kobj_mtx, effectively restricting it to its documented use, and add a kobj_init_static(9) for initializing objects using a class compiled with the former and that also avoids using mutex(9) (and malloc(9)). Also assert in both of these functions that they are used in their intended way only. While at it, inline kobj_register_method() and kobj_unregister_method() as there wasn't much point for factoring them out in the first place and so that a reader of the code has to figure out the locking for fewer functions missing a KOBJ_ASSERT. Tested on powerpc{,64} by andreast. Reviewed by: nwhitehorn (earlier version), jhb Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/kobj.9 stable/8/sys/dev/ofw/openfirm.c stable/8/sys/kern/subr_kobj.c stable/8/sys/powerpc/powerpc/platform.c stable/8/sys/powerpc/powerpc/pmap_dispatch.c stable/8/sys/sys/kobj.h Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/share/man/man9/Makefile Sat Nov 19 13:03:14 2011 (r227713) @@ -724,7 +724,8 @@ MLINKS+=kobj.9 DEFINE_CLASS.9 \ kobj.9 kobj_class_free.9 \ kobj.9 kobj_create.9 \ kobj.9 kobj_delete.9 \ - kobj.9 kobj_init.9 + kobj.9 kobj_init.9 \ + kobj.9 kobj_init_static.9 MLINKS+=kproc.9 kproc_create.9 \ kproc.9 kthread_create.9 \ kproc.9 kproc_exit.9 \ Modified: stable/8/share/man/man9/kobj.9 ============================================================================== --- stable/8/share/man/man9/kobj.9 Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/share/man/man9/kobj.9 Sat Nov 19 13:03:14 2011 (r227713) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2000 +.Dd November 14, 2011 .Dt KOBJ 9 .Os .Sh NAME @@ -48,6 +48,8 @@ .Ft void .Fn kobj_init "kobj_t obj" "kobj_class_t cls" .Ft void +.Fn kobj_init_static "kobj_t obj" "kobj_class_t cls" +.Ft void .Fn kobj_delete "kobj_t obj" "struct malloc_type *mtype" .Fn DEFINE_CLASS name "kobj_method_t *methods" "size_t size" .Sh DESCRIPTION @@ -88,10 +90,14 @@ Objects created in this way should be fr Clients which would like to manage the allocation of memory themselves should call .Fn kobj_init +or +.Fn kobj_init_static with a pointer to the memory for the object and the class which implements it. It is also possible to use .Fn kobj_init +and +.Fn kobj_init_static to change the class for an object. This should be done with care as the classes must agree on the layout of the object. @@ -109,13 +115,19 @@ A client should not normally need to cal will automatically be compiled the first time it is used. If a class is to be used before .Xr malloc 9 -is initialised, +and +.Xr mutex 9 +are initialised, then .Fn kobj_class_compile_static should be called with the class and a pointer to a statically allocated .Vt kobj_ops structure before the class is used to initialise any objects. +In that case, also +.Fn kobj_init_static +should be used instead of +.Fn kobj_init . .Pp To define a class, first define a simple array of .Vt kobj_method_t . Modified: stable/8/sys/dev/ofw/openfirm.c ============================================================================== --- stable/8/sys/dev/ofw/openfirm.c Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/sys/dev/ofw/openfirm.c Sat Nov 19 13:03:14 2011 (r227713) @@ -121,7 +121,7 @@ OF_init(void *cookie) * then statically initialize the OFW object. */ kobj_class_compile_static(ofw_def_impl, &ofw_kernel_kops); - kobj_init((kobj_t)ofw_obj, ofw_def_impl); + kobj_init_static((kobj_t)ofw_obj, ofw_def_impl); OFW_INIT(ofw_obj, cookie); Modified: stable/8/sys/kern/subr_kobj.c ============================================================================== --- stable/8/sys/kern/subr_kobj.c Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/sys/kern/subr_kobj.c Sat Nov 19 13:03:14 2011 (r227713) @@ -60,18 +60,9 @@ static struct mtx kobj_mtx; static int kobj_mutex_inited; static int kobj_next_id = 1; -/* - * In the event that kobj_mtx has not been initialized yet, - * we will ignore it, and run without locks in order to support - * use of KOBJ before mutexes are available. This early in the boot - * process, everything is single threaded and so races should not - * happen. This is used to provide the PMAP layer on PowerPC, as well - * as board support. - */ - -#define KOBJ_LOCK() if (kobj_mutex_inited) mtx_lock(&kobj_mtx); -#define KOBJ_UNLOCK() if (kobj_mutex_inited) mtx_unlock(&kobj_mtx); -#define KOBJ_ASSERT(what) if (kobj_mutex_inited) mtx_assert(&kobj_mtx,what); +#define KOBJ_LOCK() mtx_lock(&kobj_mtx) +#define KOBJ_UNLOCK() mtx_unlock(&kobj_mtx) +#define KOBJ_ASSERT(what) mtx_assert(&kobj_mtx, what); SYSCTL_UINT(_kern, OID_AUTO, kobj_methodcount, CTLFLAG_RD, &kobj_next_id, 0, ""); @@ -104,28 +95,11 @@ kobj_error_method(void) } static void -kobj_register_method(struct kobjop_desc *desc) -{ - KOBJ_ASSERT(MA_OWNED); - - if (desc->id == 0) { - desc->id = kobj_next_id++; - } -} - -static void -kobj_unregister_method(struct kobjop_desc *desc) -{ -} - -static void kobj_class_compile_common(kobj_class_t cls, kobj_ops_t ops) { kobj_method_t *m; int i; - KOBJ_ASSERT(MA_OWNED); - /* * Don't do anything if we are already compiled. */ @@ -135,8 +109,10 @@ kobj_class_compile_common(kobj_class_t c /* * First register any methods which need it. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_register_method(m->desc); + for (i = 0, m = cls->methods; m->desc; i++, m++) { + if (m->desc->id == 0) + m->desc->id = kobj_next_id++; + } /* * Then initialise the ops table. @@ -159,7 +135,7 @@ kobj_class_compile(kobj_class_t cls) */ ops = malloc(sizeof(struct kobj_ops), M_KOBJ, M_NOWAIT); if (!ops) - panic("kobj_compile_methods: out of memory"); + panic("%s: out of memory", __func__); KOBJ_LOCK(); @@ -182,17 +158,14 @@ void kobj_class_compile_static(kobj_class_t cls, kobj_ops_t ops) { - KOBJ_ASSERT(MA_NOTOWNED); + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); /* * Increment refs to make sure that the ops table is not freed. */ - KOBJ_LOCK(); - cls->refs++; kobj_class_compile_common(cls, ops); - - KOBJ_UNLOCK(); } static kobj_method_t* @@ -259,8 +232,6 @@ kobj_lookup_method(kobj_class_t cls, void kobj_class_free(kobj_class_t cls) { - int i; - kobj_method_t *m; void* ops = NULL; KOBJ_ASSERT(MA_NOTOWNED); @@ -272,10 +243,9 @@ kobj_class_free(kobj_class_t cls) */ if (cls->refs == 0) { /* - * Unregister any methods which are no longer used. + * For now we don't do anything to unregister any methods + * which are no longer used. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_unregister_method(m->desc); /* * Free memory and clean up. @@ -308,6 +278,14 @@ kobj_create(kobj_class_t cls, return obj; } +static void +kobj_init_common(kobj_t obj, kobj_class_t cls) +{ + + obj->ops = cls->ops; + cls->refs++; +} + void kobj_init(kobj_t obj, kobj_class_t cls) { @@ -329,13 +307,22 @@ kobj_init(kobj_t obj, kobj_class_t cls) goto retry; } - obj->ops = cls->ops; - cls->refs++; + kobj_init_common(obj, cls); KOBJ_UNLOCK(); } void +kobj_init_static(kobj_t obj, kobj_class_t cls) +{ + + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); + + kobj_init_common(obj, cls); +} + +void kobj_delete(kobj_t obj, struct malloc_type *mtype) { kobj_class_t cls = obj->ops->cls; Modified: stable/8/sys/powerpc/powerpc/platform.c ============================================================================== --- stable/8/sys/powerpc/powerpc/platform.c Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/sys/powerpc/powerpc/platform.c Sat Nov 19 13:03:14 2011 (r227713) @@ -140,7 +140,7 @@ platform_probe_and_attach() * then statically initialise the MMU object */ kobj_class_compile_static(platp, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, platp); + kobj_init_static((kobj_t)plat_obj, platp); prio = PLATFORM_PROBE(plat_obj); @@ -178,7 +178,7 @@ platform_probe_and_attach() */ kobj_class_compile_static(plat_def_impl, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, plat_def_impl); + kobj_init_static((kobj_t)plat_obj, plat_def_impl); strlcpy(plat_name,plat_def_impl->name,sizeof(plat_name)); Modified: stable/8/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- stable/8/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 19 13:03:14 2011 (r227713) @@ -402,7 +402,7 @@ pmap_bootstrap(vm_offset_t start, vm_off * then statically initialise the MMU object */ kobj_class_compile_static(mmu_def_impl, &mmu_kernel_kops); - kobj_init((kobj_t)mmu_obj, mmu_def_impl); + kobj_init_static((kobj_t)mmu_obj, mmu_def_impl); MMU_BOOTSTRAP(mmu_obj, start, end); } Modified: stable/8/sys/sys/kobj.h ============================================================================== --- stable/8/sys/sys/kobj.h Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/sys/sys/kobj.h Sat Nov 19 13:03:14 2011 (r227713) @@ -201,6 +201,7 @@ kobj_t kobj_create(kobj_class_t cls, * Initialise a pre-allocated object. */ void kobj_init(kobj_t obj, kobj_class_t cls); +void kobj_init_static(kobj_t obj, kobj_class_t cls); /* * Delete an object. If mtype is non-zero, free the memory. From owner-svn-src-stable-8@FreeBSD.ORG Sat Nov 19 13:29:55 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 928EC106566B; Sat, 19 Nov 2011 13:29:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 818728FC08; Sat, 19 Nov 2011 13:29:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJDTtRH045023; Sat, 19 Nov 2011 13:29:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJDTtj0045021; Sat, 19 Nov 2011 13:29:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191329.pAJDTtj0045021@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227716 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:29:55 -0000 Author: marius Date: Sat Nov 19 13:29:55 2011 New Revision: 227716 URL: http://svn.freebsd.org/changeset/base/227716 Log: MFC: r227539 Define curthread as an inline function that loads the thread pointer directly from g7, the pcpu pointer. This guarantees correct behavior when the thread migrates to a different CPU. Commit message stolen from r205431. Additional testing by Peter Jeremy. Modified: stable/8/sys/sparc64/include/pcpu.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/include/pcpu.h ============================================================================== --- stable/8/sys/sparc64/include/pcpu.h Sat Nov 19 13:04:17 2011 (r227715) +++ stable/8/sys/sparc64/include/pcpu.h Sat Nov 19 13:29:55 2011 (r227716) @@ -73,6 +73,16 @@ register struct pcpu *pcpup __asm__(__XS #define PCPU_GET(member) (pcpup->pc_ ## member) +static __inline __pure2 struct thread * +__curthread(void) +{ + struct thread *td; + + __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (td)); + return (td); +} +#define curthread (__curthread()) + /* * XXX The implementation of this operation should be made atomic * with respect to preemption. From owner-svn-src-stable-8@FreeBSD.ORG Sat Nov 19 13:33:25 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A716106564A; Sat, 19 Nov 2011 13:33:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 094D88FC0C; Sat, 19 Nov 2011 13:33:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJDXOJT045350; Sat, 19 Nov 2011 13:33:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJDXODg045348; Sat, 19 Nov 2011 13:33:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191333.pAJDXODg045348@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227720 - stable/8/sys/sparc64/sbus X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:33:25 -0000 Author: marius Date: Sat Nov 19 13:33:24 2011 New Revision: 227720 URL: http://svn.freebsd.org/changeset/base/227720 Log: MFC: r227578 Fix compilation with DEBUG defined. Modified: stable/8/sys/sparc64/sbus/lsi64854.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sbus/lsi64854.c ============================================================================== --- stable/8/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:33:22 2011 (r227719) +++ stable/8/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:33:24 2011 (r227720) @@ -561,7 +561,7 @@ lsi64854_scsi_intr(void *arg) DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM), - (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ? + (nsc->sc_features & NCR_F_LARGEXFER) != 0 ? NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid)); if (dmasize != 0) { From owner-svn-src-stable-8@FreeBSD.ORG Sat Nov 19 17:01:12 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DAB5106568B; Sat, 19 Nov 2011 17:01:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41F0C8FC18; Sat, 19 Nov 2011 17:01:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJH1CS2052443; Sat, 19 Nov 2011 17:01:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJH1Cek052441; Sat, 19 Nov 2011 17:01:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111191701.pAJH1Cek052441@svn.freebsd.org> From: Christian Brueffer Date: Sat, 19 Nov 2011 17:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227734 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 17:01:12 -0000 Author: brueffer Date: Sat Nov 19 17:01:11 2011 New Revision: 227734 URL: http://svn.freebsd.org/changeset/base/227734 Log: MFC: r227465, r227515 - Grammar and mdoc cleanup. - Remove list nesting in the hardware notes section, thus making it compatible with the hardware notes generation script. Modified: stable/8/share/man/man4/mvs.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/mvs.4 ============================================================================== --- stable/8/share/man/man4/mvs.4 Sat Nov 19 16:59:23 2011 (r227733) +++ stable/8/share/man/man4/mvs.4 Sat Nov 19 17:01:11 2011 (r227734) @@ -110,7 +110,8 @@ hardware command queues (up to 31 comman Native Command Queuing, SATA interface Power Management, device hot-plug and Message Signaled Interrupts. .Pp -Same hardware is also supported by atamarvell and ataadaptec drivers from +The same hardware is also supported by the atamarvell and ataadaptec +drivers from the .Xr ata 4 subsystem. If both drivers are loaded at the same time, this one will be @@ -119,9 +120,9 @@ given precedence as the more functional The .Nm driver supports the following controllers: -.Bl -tag -compact -.It Gen-I (SATA 1.5Gbps): -.Bl -bullet -compact +.Pp +Gen-I (SATA 1.5Gbps): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX5040 .It @@ -131,8 +132,9 @@ driver supports the following controller .It 88SX5081 .El -.It Gen-II (SATA 3Gbps, NCQ, PMP): -.Bl -bullet -compact +.Pp +Gen-II (SATA 3Gbps, NCQ, PMP): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6040 .It @@ -142,8 +144,9 @@ driver supports the following controller .It 88SX6081 .El -.It Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): -.Bl -bullet -compact +.Pp +Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6042 .It @@ -155,11 +158,10 @@ driver supports the following controller .It MV78100 SoC .El -.El -Note, that this hardware supports command queueing and FIS-based switching -only for ATA DMA commands. ATAPI and non-DMA ATA commands executed one by one -for each port. .Pp +Note, that this hardware supports command queueing and FIS-based switching +only for ATA DMA commands. +ATAPI and non-DMA ATA commands executed one by one for each port. .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , @@ -173,4 +175,4 @@ The driver first appeared in .Fx 8.1 . .Sh AUTHORS -.An Alexander Motin Aq mav@FreeBSD.org . +.An Alexander Motin Aq mav@FreeBSD.org