svn commit: r199787 - head/lib/libc/rpc
Author: wollman Date: Wed Nov 25 04:53:38 2009 New Revision: 199787 URL: http://svn.freebsd.org/changeset/base/199787 Log: Style: use structure assignment rather than memcpy() to copy a structure. Modified: head/lib/libc/rpc/getrpcent.c Modified: head/lib/libc/rpc/getrpcent.c == --- head/lib/libc/rpc/getrpcent.c Wed Nov 25 04:52:12 2009 (r199786) +++ head/lib/libc/rpc/getrpcent.c Wed Nov 25 04:53:38 2009 (r199787) @@ -698,7 +698,7 @@ rpc_marshal_func(char *buffer, size_t *b return (NS_RETURN); } - memcpy(&new_rpc, rpc, sizeof(struct rpcent)); + new_rpc = *rpc; *buffer_size = desired_size; memset(buffer, 0, desired_size); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199786 - head/lib/libc/rpc
Author: wollman Date: Wed Nov 25 04:52:12 2009 New Revision: 199786 URL: http://svn.freebsd.org/changeset/base/199786 Log: In clnt_raw_create(), avoid minor race condition initializing the file-scope variable clntraw_private. Found by: Clang static analyzer MFC after:7 days Modified: head/lib/libc/rpc/clnt_raw.c Modified: head/lib/libc/rpc/clnt_raw.c == --- head/lib/libc/rpc/clnt_raw.cWed Nov 25 04:49:41 2009 (r199785) +++ head/lib/libc/rpc/clnt_raw.cWed Nov 25 04:52:12 2009 (r199786) @@ -92,13 +92,13 @@ clnt_raw_create(prog, vers) rpcprog_t prog; rpcvers_t vers; { - struct clntraw_private *clp = clntraw_private; + struct clntraw_private *clp; struct rpc_msg call_msg; - XDR *xdrs = &clp->xdr_stream; - CLIENT *client = &clp->client_object; + XDR *xdrs; + CLIENT *client; mutex_lock(&clntraw_lock); - if (clp == NULL) { + if ((clp = clntraw_private) == NULL) { clp = (struct clntraw_private *)calloc(1, sizeof (*clp)); if (clp == NULL) { mutex_unlock(&clntraw_lock); @@ -110,6 +110,9 @@ clnt_raw_create(prog, vers) clp->_raw_buf = __rpc_rawcombuf; clntraw_private = clp; } + xdrs = &clp->xdr_stream; + client = &clp->client_object; + /* * pre-serialize the static part of the call msg and stash it away */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199785 - head/lib/libc/rpc
Author: wollman Date: Wed Nov 25 04:49:41 2009 New Revision: 199785 URL: http://svn.freebsd.org/changeset/base/199785 Log: In svc_raw_reply(), don't leave stat uninitialized if the MSG_ACCEPTED && SUCCESS case succeeds. The stack garbage might be zero. Found by: Clang static analyzer MFC after:7 days Modified: head/lib/libc/rpc/svc_raw.c Modified: head/lib/libc/rpc/svc_raw.c == --- head/lib/libc/rpc/svc_raw.c Wed Nov 25 04:45:45 2009(r199784) +++ head/lib/libc/rpc/svc_raw.c Wed Nov 25 04:49:41 2009(r199785) @@ -176,9 +176,8 @@ svc_raw_reply(xprt, msg) msg->acpted_rply.ar_results.proc = (xdrproc_t) xdr_void; msg->acpted_rply.ar_results.where = NULL; - if (!xdr_replymsg(xdrs, msg) || - !SVCAUTH_WRAP(&SVC_AUTH(xprt), xdrs, xdr_proc, xdr_where)) - stat = FALSE; + stat = xdr_replymsg(xdrs, msg) && + SVCAUTH_WRAP(&SVC_AUTH(xprt), xdrs, xdr_proc, xdr_where); } else { stat = xdr_replymsg(xdrs, msg); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199784 - in head/lib/libc: gen rpc stdio yp
Author: wollman Date: Wed Nov 25 04:45:45 2009 New Revision: 199784 URL: http://svn.freebsd.org/changeset/base/199784 Log: Eliminate more dead stores. Found by: Clang static analyzer MFC after:7 days Modified: head/lib/libc/gen/getcap.c head/lib/libc/gen/getusershell.c head/lib/libc/gen/wordexp.c head/lib/libc/rpc/getnetconfig.c head/lib/libc/rpc/key_call.c head/lib/libc/stdio/fgetws.c head/lib/libc/yp/yplib.c Modified: head/lib/libc/gen/getcap.c == --- head/lib/libc/gen/getcap.c Wed Nov 25 04:35:54 2009(r199783) +++ head/lib/libc/gen/getcap.c Wed Nov 25 04:45:45 2009(r199784) @@ -647,7 +647,7 @@ int cgetnext(char **bp, char **db_array) { size_t len; - int done, hadreaderr, i, savederrno, status; + int done, hadreaderr, savederrno, status; char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE]; u_int dummy; @@ -658,7 +658,7 @@ cgetnext(char **bp, char **db_array) (void)cgetclose(); return (-1); } - for(;;) { + for (;;) { if (toprec && !gottoprec) { gottoprec = 1; line = toprec; @@ -709,7 +709,6 @@ cgetnext(char **bp, char **db_array) /* * Line points to a name line. */ - i = 0; done = 0; np = nbuf; for (;;) { Modified: head/lib/libc/gen/getusershell.c == --- head/lib/libc/gen/getusershell.cWed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/gen/getusershell.cWed Nov 25 04:45:45 2009 (r199784) @@ -124,7 +124,7 @@ _local_initshells(rv, cb_data, ap) if ((fp = fopen(_PATH_SHELLS, "r")) == NULL) return NS_UNAVAIL; - sp = cp = line; + cp = line; while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { while (*cp != '#' && *cp != '/' && *cp != '\0') cp++; Modified: head/lib/libc/gen/wordexp.c == --- head/lib/libc/gen/wordexp.c Wed Nov 25 04:35:54 2009(r199783) +++ head/lib/libc/gen/wordexp.c Wed Nov 25 04:45:45 2009(r199784) @@ -320,7 +320,7 @@ we_check(const char *words, int flags) if (c == '\0' || level != 0) return (WRDE_SYNTAX); } else - c = *--words; + --words; break; default: break; Modified: head/lib/libc/rpc/getnetconfig.c == --- head/lib/libc/rpc/getnetconfig.cWed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/rpc/getnetconfig.cWed Nov 25 04:45:45 2009 (r199784) @@ -412,13 +412,13 @@ void *handlep; * Noone needs these entries anymore, then frees them. * Make sure all info in netconfig_info structure has been reinitialized. */ -q = p = ni.head; +q = ni.head; ni.eof = ni.ref = 0; ni.head = NULL; ni.tail = NULL; mutex_unlock(&ni_lock); -while (q) { +while (q != NULL) { p = q->next; if (q->ncp->nc_lookups != NULL) free(q->ncp->nc_lookups); free(q->ncp); Modified: head/lib/libc/rpc/key_call.c == --- head/lib/libc/rpc/key_call.cWed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/rpc/key_call.cWed Nov 25 04:45:45 2009 (r199784) @@ -302,7 +302,7 @@ int vers; void *localhandle; struct netconfig *nconf; struct netconfig *tpconf; - struct key_call_private *kcp = key_call_private_main; + struct key_call_private *kcp; struct timeval wait_time; struct utsname u; int main_thread; Modified: head/lib/libc/stdio/fgetws.c == --- head/lib/libc/stdio/fgetws.cWed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/stdio/fgetws.cWed Nov 25 04:45:45 2009 (r199784) @@ -89,7 +89,7 @@ fgetws(wchar_t * __restrict ws, int n, F if (!__mbsinit(&fp->_mbstate)) /* Incomplete character */ goto error; - *wsp++ = L'\0'; + *wsp = L'\0'; FUNLOCKFILE(fp); return (ws); Modified: head/lib/libc/yp/yplib.c == --- head/lib/libc/yp/yplib.cWed Nov 25 04:35:54 2009(r199783) +++ head/lib/libc/yp/yplib.cWed Nov 25 04:45:45 2009(r199784) @@ -241,7 +241,7 @@ static bool
svn commit: r199783 - head/lib/libc/stdio
Author: wollman Date: Wed Nov 25 04:35:54 2009 New Revision: 199783 URL: http://svn.freebsd.org/changeset/base/199783 Log: Make all three if conditions look similar by always initializing nsec and moving the default initialization of prec into the else clause. The clang static analyzer erroneously thought that nsec can be used uninitialized here; it was not actually possible, but better to make the code clearer. (Clang can't know that sprintf() won't modify *pi behind the scenes.) Modified: head/lib/libc/stdio/xprintf_time.c Modified: head/lib/libc/stdio/xprintf_time.c == --- head/lib/libc/stdio/xprintf_time.c Wed Nov 25 04:27:55 2009 (r199782) +++ head/lib/libc/stdio/xprintf_time.c Wed Nov 25 04:35:54 2009 (r199783) @@ -64,7 +64,6 @@ __printf_render_time(struct __printf_io intmax_t t, tx; int i, prec, nsec; - prec = 0; if (pi->is_long) { tv = *((struct timeval **)arg[0]); t = tv->tv_sec; @@ -78,6 +77,8 @@ __printf_render_time(struct __printf_io } else { tp = *((time_t **)arg[0]); t = *tp; + nsec = 0; + prec = 0; } p = buf; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199782 - head/lib/libc/stdio
Author: wollman Date: Wed Nov 25 04:27:55 2009 New Revision: 199782 URL: http://svn.freebsd.org/changeset/base/199782 Log: In __mbsconv(), if prec was zero, nconv could have been used uninitialized. Initialize it to a safe value so that there's no chance of returning an error if stack garbage happens to be equal to (size_t)-1 or (size_t)-2. Found by: Clang static analyzer MFC after:7 days Modified: head/lib/libc/stdio/vfwprintf.c Modified: head/lib/libc/stdio/vfwprintf.c == --- head/lib/libc/stdio/vfwprintf.c Wed Nov 25 04:21:42 2009 (r199781) +++ head/lib/libc/stdio/vfwprintf.c Wed Nov 25 04:27:55 2009 (r199782) @@ -293,7 +293,7 @@ __mbsconv(char *mbsarg, int prec) * number of characters to print. */ p = mbsarg; - insize = nchars = 0; + insize = nchars = nconv = 0; mbs = initial_mbs; while (nchars != (size_t)prec) { nconv = mbrlen(p, MB_CUR_MAX, &mbs); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199781 - head/lib/libc/stdio
Author: wollman Date: Wed Nov 25 04:21:42 2009 New Revision: 199781 URL: http://svn.freebsd.org/changeset/base/199781 Log: Eliminate dead store. Found by: Clang static analyzer MFC after:7 days Modified: head/lib/libc/stdio/fvwrite.c Modified: head/lib/libc/stdio/fvwrite.c == --- head/lib/libc/stdio/fvwrite.c Wed Nov 25 02:39:33 2009 (r199780) +++ head/lib/libc/stdio/fvwrite.c Wed Nov 25 04:21:42 2009 (r199781) @@ -60,7 +60,7 @@ __sfvwrite(fp, uio) char *nl; int nlknown, nldist; - if ((len = uio->uio_resid) == 0) + if (uio->uio_resid == 0) return (0); /* make sure we can write */ if (prepwrite(fp) != 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199774 - in stable/8/sys/i386: include/xen xen
Author: kmacy Date: Wed Nov 25 01:55:34 2009 New Revision: 199774 URL: http://svn.freebsd.org/changeset/base/199774 Log: fix UP compilation Modified: stable/8/sys/i386/include/xen/xen-os.h stable/8/sys/i386/xen/locore.s Modified: stable/8/sys/i386/include/xen/xen-os.h == --- stable/8/sys/i386/include/xen/xen-os.h Wed Nov 25 01:52:36 2009 (r199773) +++ stable/8/sys/i386/include/xen/xen-os.h Wed Nov 25 01:55:34 2009 (r199774) @@ -34,10 +34,10 @@ void force_evtchn_callback(void); #include #endif +extern int gdtset; #ifdef SMP #include /* XXX for pcpu.h */ #include /* XXX for PCPU_GET */ -extern int gdtset; static inline int smp_processor_id(void) { Modified: stable/8/sys/i386/xen/locore.s == --- stable/8/sys/i386/xen/locore.s Wed Nov 25 01:52:36 2009 (r199773) +++ stable/8/sys/i386/xen/locore.s Wed Nov 25 01:55:34 2009 (r199774) @@ -148,9 +148,7 @@ IdlePDPT: .long 0 /* phys addr of kerne .globl KPTphys #endif KPTphys: .long 0 /* phys addr of kernel page tables */ -#ifdef SMP .globl gdtset -#endif gdtset:.long 0 /* GDT is valid */ .globl proc0kstack ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199773 - in stable/8/sys/i386: i386 include xen
Author: kmacy Date: Wed Nov 25 01:52:36 2009 New Revision: 199773 URL: http://svn.freebsd.org/changeset/base/199773 Log: MFC xen pmap updates and eflags fixes Modified: stable/8/sys/i386/i386/vm_machdep.c stable/8/sys/i386/include/cpufunc.h stable/8/sys/i386/xen/pmap.c stable/8/sys/i386/xen/xen_machdep.c Modified: stable/8/sys/i386/i386/vm_machdep.c == --- stable/8/sys/i386/i386/vm_machdep.c Wed Nov 25 01:51:07 2009 (r199772) +++ stable/8/sys/i386/i386/vm_machdep.c Wed Nov 25 01:52:36 2009 (r199773) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -270,11 +271,7 @@ cpu_fork(td1, p2, td2, flags) /* * XXX XEN need to check on PSL_USER is handled */ -#ifdef XEN - td2->td_md.md_saved_flags = 0; -#else td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I; -#endif /* * Now, cpu_switch() can schedule the new process. * pcb_esp is loaded pointing to the cpu_switch() stack frame @@ -446,11 +443,7 @@ cpu_set_upcall(struct thread *td, struct /* Setup to release spin count in fork_exit(). */ td->td_md.md_spinlock_count = 1; -#ifdef XEN - td->td_md.md_saved_flags = 0; -#else td->td_md.md_saved_flags = PSL_KERNEL | PSL_I; -#endif } /* Modified: stable/8/sys/i386/include/cpufunc.h == --- stable/8/sys/i386/include/cpufunc.h Wed Nov 25 01:51:07 2009 (r199772) +++ stable/8/sys/i386/include/cpufunc.h Wed Nov 25 01:52:36 2009 (r199773) @@ -49,8 +49,8 @@ extern u_int xen_rcr2(void); extern void xen_load_cr3(u_int data); extern void xen_tlb_flush(void); extern void xen_invlpg(u_int addr); -extern int xen_save_and_cli(void); -extern void xen_restore_flags(u_int eflags); +extern void write_eflags(u_int eflags); +extern u_int read_eflags(void); #endif struct region_descriptor; @@ -293,7 +293,11 @@ ia32_pause(void) } static __inline u_int +#ifdef XEN +_read_eflags(void) +#else read_eflags(void) +#endif { u_int ef; @@ -335,7 +339,11 @@ wbinvd(void) } static __inline void +#ifdef XEN +_write_eflags(u_int ef) +#else write_eflags(u_int ef) +#endif { __asm __volatile("pushl %0; popfl" : : "r" (ef)); } @@ -653,23 +661,15 @@ intr_disable(void) { register_t eflags; -#ifdef XEN - eflags = xen_save_and_cli(); -#else eflags = read_eflags(); disable_intr(); -#endif return (eflags); } static __inline void intr_restore(register_t eflags) { -#ifdef XEN - xen_restore_flags(eflags); -#else write_eflags(eflags); -#endif } #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ Modified: stable/8/sys/i386/xen/pmap.c == --- stable/8/sys/i386/xen/pmap.cWed Nov 25 01:51:07 2009 (r199772) +++ stable/8/sys/i386/xen/pmap.cWed Nov 25 01:52:36 2009 (r199773) @@ -223,6 +223,8 @@ static uma_zone_t pdptzone; #endif #endif +static int pat_works; /* Is page attribute table sane? */ + /* * Data for the pv entry allocation mechanism */ @@ -277,7 +279,7 @@ static struct mtx PMAP2mutex; SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); static int pg_ps_enabled; -SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0, +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0, "Are large page mappings enabled?"); SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_max, CTLFLAG_RD, &pv_entry_max, 0, @@ -311,6 +313,7 @@ static vm_offset_t pmap_kmem_choose(vm_o static boolean_t pmap_is_prefaultable_locked(pmap_t pmap, vm_offset_t addr); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); +static __inline void pagezero(void *page); #if defined(PAE) && !defined(XEN) static void *pmap_pdpt_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); @@ -328,22 +331,6 @@ CTASSERT(KERNBASE % (1 << 24) == 0); -static __inline void -pagezero(void *page) -{ -#if defined(I686_CPU) - if (cpu_class == CPUCLASS_686) { -#if defined(CPU_ENABLE_SSE) - if (cpu_feature & CPUID_SSE2) - sse2_pagezero(page); - else -#endif - i686_pagezero(page); - } else -#endif - bzero(page, PAGE_SIZE); -} - void pd_set(struct pmap *pmap, int ptepindex, vm_paddr_t val, int type) { @@ -529,33 +516,36 @@ pmap_init_pat(void) if (!(cpu_feature & CPUID_PAT)) return; -#ifdef PAT_WORKS - /* -* Leave the indices 0-3 at the default of WB, WT, UC, and UC-. -* Program 4 and 5 as WP and WC. -* Leave 6 and 7 as UC and UC-. -*/ - pat_msr = rdmsr
svn commit: r199772 - stable/8/sys/dev/xen/console
Author: kmacy Date: Wed Nov 25 01:51:07 2009 New Revision: 199772 URL: http://svn.freebsd.org/changeset/base/199772 Log: remove gratuitous comment Modified: stable/8/sys/dev/xen/console/console.c Modified: stable/8/sys/dev/xen/console/console.c == --- stable/8/sys/dev/xen/console/console.c Wed Nov 25 01:50:17 2009 (r199771) +++ stable/8/sys/dev/xen/console/console.c Wed Nov 25 01:51:07 2009 (r199772) @@ -152,7 +152,6 @@ xccncheckc(struct consdev *dev) CN_LOCK(cn_mtx); if ((rp - rc)) { - /* if (kdb_active) printf("%s:%d\n", __func__, __LINE__); */ /* we need to return only one char */ ret = (int)rbuf[RBUF_MASK(rc)]; rc++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199771 - stable/8/sys/dev/xen/blkfront
Author: kmacy Date: Wed Nov 25 01:50:17 2009 New Revision: 199771 URL: http://svn.freebsd.org/changeset/base/199771 Log: MFC core dump support Modified: stable/8/sys/dev/xen/blkfront/blkfront.c Modified: stable/8/sys/dev/xen/blkfront/blkfront.c == --- stable/8/sys/dev/xen/blkfront/blkfront.cWed Nov 25 00:00:57 2009 (r199770) +++ stable/8/sys/dev/xen/blkfront/blkfront.cWed Nov 25 01:50:17 2009 (r199771) @@ -16,7 +16,9 @@ */ /* - * XenoBSD block device driver + * XenBSD block device driver + * + * Copyright (c) 2009 Frank Suchomel, Citrix */ #include @@ -122,6 +124,10 @@ static int blkif_ioctl(struct disk *dp, static int blkif_queue_request(struct bio *bp); static void xb_strategy(struct bio *bp); +// In order to quiesce the device during kernel dumps, outstanding requests to +// DOM0 for disk reads/writes need to be accounted for. +static int blkif_queued_requests; +static int xb_dump(void *, void *, vm_offset_t, off_t, size_t); /* XXX move to xb_vbd.c when VBD update support is added */ @@ -231,6 +237,7 @@ xlvbd_add(device_t dev, blkif_sector_t c sc->xb_disk->d_close = blkif_close; sc->xb_disk->d_ioctl = blkif_ioctl; sc->xb_disk->d_strategy = xb_strategy; + sc->xb_disk->d_dump = xb_dump; sc->xb_disk->d_name = name; sc->xb_disk->d_drv1 = sc; sc->xb_disk->d_sectorsize = sector_size; @@ -286,9 +293,10 @@ xb_strategy(struct bio *bp) * Place it in the queue of disk activities for this disk */ mtx_lock(&blkif_io_lock); - bioq_disksort(&sc->xb_bioq, bp); + bioq_disksort(&sc->xb_bioq, bp); xb_startio(sc); + mtx_unlock(&blkif_io_lock); return; @@ -301,6 +309,81 @@ xb_strategy(struct bio *bp) return; } +static void xb_quiesce(struct blkfront_info *info); +// Quiesce the disk writes for a dump file before allowing the next buffer. +static void +xb_quiesce(struct blkfront_info *info) +{ + int mtd; + + // While there are outstanding requests + while (blkif_queued_requests) { + RING_FINAL_CHECK_FOR_RESPONSES(&info->ring, mtd); + if (mtd) { + // Recieved request completions, update queue. + blkif_int(info); + } + if (blkif_queued_requests) { + // Still pending requests, wait for the disk i/o to complete + HYPERVISOR_yield(); + } + } +} + +// Some bio structures for dumping core +#define DUMP_BIO_NO 16 // 16 * 4KB = 64KB dump block +static struct bio xb_dump_bp[DUMP_BIO_NO]; + +// Kernel dump function for a paravirtualized disk device +static int +xb_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, +size_t length) +{ + int sbp; + int mbp; + size_t chunk; + struct disk*dp = arg; + struct xb_softc*sc = (struct xb_softc *) dp->d_drv1; + int rc = 0; + + xb_quiesce(sc->xb_info);// All quiet on the western front. + if (length > 0) { + // If this lock is held, then this module is failing, and a successful + // kernel dump is highly unlikely anyway. + mtx_lock(&blkif_io_lock); + // Split the 64KB block into 16 4KB blocks + for (sbp=0; length>0 && sbp PAGE_SIZE ? PAGE_SIZE : length; + xb_dump_bp[sbp].bio_disk = dp; + xb_dump_bp[sbp].bio_pblkno = offset / dp->d_sectorsize; + xb_dump_bp[sbp].bio_bcount = chunk; + xb_dump_bp[sbp].bio_resid = chunk; + xb_dump_bp[sbp].bio_data = virtual; + xb_dump_bp[sbp].bio_cmd= BIO_WRITE; + xb_dump_bp[sbp].bio_done = NULL; + + bioq_disksort(&sc->xb_bioq, &xb_dump_bp[sbp]); + + length -= chunk; + offset += chunk; + virtual = (char *) virtual + chunk; + } + // Tell DOM0 to do the I/O + xb_startio(sc); + mtx_unlock(&blkif_io_lock); + + // Must wait for the completion: the dump routine reuses the same + // 16 x 4KB buffer space. + xb_quiesce(sc->xb_info);// All quite on the eastern front + // If there were any errors, bail out... + for (mbp=0; mbp RING_SIZE", nfree)); info->shadow_free = info->shadow[nfree].req.id; info->shadow[nfree].req.id = 0
Re: svn commit: r199655 - head/usr.bin/w
I'm not sure this is right. While the manpage implies that doing no resolution means that it will show numeric addresses, since that is not correct, there are two ways to go. As you have done, you can choose to try to resolve hostnames to IP addresses. You could also do as the code before did and do no resolution. I frequently use 'w -n' on systems with slow nameservers to see who is logged in without triggering a bunch of DNS traffic that I then have to wait for. Trying to resolve the name to a numeric address presents that problem. Since it is not possible to always show a numeric address (if, for example, the hostname is no longer valid) I'm not sure that this is the right direction to try to go with 'w -n'. On Sun, Nov 22, 2009 at 08:51, Hajimu UMEMOTO wrote: > Author: ume > Date: Sun Nov 22 16:51:44 2009 > New Revision: 199655 > URL: http://svn.freebsd.org/changeset/base/199655 > > Log: > When -n is specified, attempt to turn hostnames found in utmp into IP > addresses, again. However, change a hostname into an IP address, only > when a host has just one A/ RR. > > Requested by: candy__at__kgc.co.jp > MFC after: 2 weeks > > Modified: > head/usr.bin/w/w.c > > Modified: head/usr.bin/w/w.c > == > --- head/usr.bin/w/w.c Sun Nov 22 16:13:16 2009 (r199654) > +++ head/usr.bin/w/w.c Sun Nov 22 16:51:44 2009 (r199655) > @@ -348,6 +348,7 @@ main(int argc, char *argv[]) > > for (ep = ehead; ep != NULL; ep = ep->next) { > char host_buf[UT_HOSTSIZE + 1]; > + struct addrinfo hints, *res; > struct sockaddr_storage ss; > struct sockaddr *sa = (struct sockaddr *)&ss; > struct sockaddr_in *lsin = (struct sockaddr_in *)&ss; > @@ -365,23 +366,42 @@ main(int argc, char *argv[]) > else > x_suffix = NULL; > } > + > + isaddr = 0; > + memset(&ss, '\0', sizeof(ss)); > + if (inet_pton(AF_INET6, p, &lsin6->sin6_addr) == 1) { > + lsin6->sin6_len = sizeof(*lsin6); > + lsin6->sin6_family = AF_INET6; > + isaddr = 1; > + } else if (inet_pton(AF_INET, p, &lsin->sin_addr) == 1) { > + lsin->sin_len = sizeof(*lsin); > + lsin->sin_family = AF_INET; > + isaddr = 1; > + } > if (!nflag) { > /* Attempt to change an IP address into a name */ > - isaddr = 0; > - memset(&ss, '\0', sizeof(ss)); > - if (inet_pton(AF_INET6, p, &lsin6->sin6_addr) == 1) { > - lsin6->sin6_len = sizeof(*lsin6); > - lsin6->sin6_family = AF_INET6; > - isaddr = 1; > - } else if (inet_pton(AF_INET, p, &lsin->sin_addr) == > 1) { > - lsin->sin_len = sizeof(*lsin); > - lsin->sin_family = AF_INET; > - isaddr = 1; > - } > if (isaddr && realhostname_sa(fn, sizeof(fn), sa, > sa->sa_len) == HOSTNAME_FOUND) > p = fn; > + } else if (!isaddr) { > + /* > + * If a host has only one A/ RR, change a > + * name into an IP address > + */ > + memset(&hints, 0, sizeof(hints)); > + hints.ai_flags = AI_PASSIVE; > + hints.ai_family = AF_UNSPEC; > + hints.ai_socktype = SOCK_STREAM; > + if (getaddrinfo(p, NULL, &hints, &res) == 0) { > + if (res->ai_next == NULL && > + getnameinfo(res->ai_addr, res->ai_addrlen, > + fn, sizeof(fn), NULL, 0, > + NI_NUMERICHOST) == 0) > + p = fn; > + freeaddrinfo(res); > + } > } > + > if (x_suffix) { > (void)snprintf(buf, sizeof(buf), "%s:%s", p, x_suffix); > p = buf; > ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199770 - head/sbin/ifconfig
Author: will Date: Wed Nov 25 00:00:57 2009 New Revision: 199770 URL: http://svn.freebsd.org/changeset/base/199770 Log: Make ``ifconfig -l ether'' only list interfaces that speak Ethernet. PR: 118987 Approved by: ken (mentor) Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c == --- head/sbin/ifconfig/ifconfig.c Tue Nov 24 22:37:04 2009 (r199769) +++ head/sbin/ifconfig/ifconfig.c Wed Nov 25 00:00:57 2009 (r199770) @@ -147,7 +147,7 @@ main(int argc, char *argv[]) struct ifaddrs *ifap, *ifa; struct ifreq paifr; const struct sockaddr_dl *sdl; - char options[1024], *cp; + char options[1024], *cp, *namecp = NULL; const char *ifname; struct option *p; size_t iflen; @@ -294,7 +294,7 @@ main(int argc, char *argv[]) sdl = (const struct sockaddr_dl *) ifa->ifa_addr; else sdl = NULL; - if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0) + if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0 && !namesonly) continue; iflen = strlcpy(name, ifa->ifa_name, sizeof(name)); if (iflen >= sizeof(name)) { @@ -308,16 +308,32 @@ main(int argc, char *argv[]) continue; if (uponly && (ifa->ifa_flags & IFF_UP) == 0) continue; - ifindex++; /* * Are we just listing the interfaces? */ if (namesonly) { + if (namecp == cp) + continue; + if (afp != NULL) { + /* special case for "ether" address family */ + if (!strcmp(afp->af_name, "ether")) { + if (sdl == NULL || + sdl->sdl_type != IFT_ETHER || + sdl->sdl_alen != ETHER_ADDR_LEN) + continue; + } else { + if (ifa->ifa_addr->sa_family != afp->af_af) + continue; + } + } + namecp = cp; + ifindex++; if (ifindex > 1) printf(" "); fputs(name, stdout); continue; } + ifindex++; if (argc > 0) ifconfig(argc, argv, 0, afp); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199768 - stable/7/sys/sparc64/sparc64
Author: marius Date: Tue Nov 24 22:13:06 2009 New Revision: 199768 URL: http://svn.freebsd.org/changeset/base/199768 Log: MFC: r199442 Unroll copying of the registers in {g,s}et_mcontext() and limit it to the set actually restored by tl0_ret() instead of using the whole trapframe. Additionally skip %g7 as that register is used as the userland TLS pointer. PR: 140523 Modified: stable/7/sys/sparc64/sparc64/machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/machdep.c == --- stable/7/sys/sparc64/sparc64/machdep.c Tue Nov 24 21:06:41 2009 (r199767) +++ stable/7/sys/sparc64/sparc64/machdep.c Tue Nov 24 22:13:06 2009 (r199768) @@ -695,12 +695,39 @@ get_mcontext(struct thread *td, mcontext tf = td->td_frame; pcb = td->td_pcb; - bcopy(tf, mc, sizeof(*tf)); + /* +* Copy the registers which will be restored by tl0_ret() from the +* trapframe. +* Note that we skip %g7 which is used as the userland TLS register +* and %wstate. +*/ + mc->mc_flags = _MC_VERSION; + mc->mc_global[1] = tf->tf_global[1]; + mc->mc_global[2] = tf->tf_global[2]; + mc->mc_global[3] = tf->tf_global[3]; + mc->mc_global[4] = tf->tf_global[4]; + mc->mc_global[5] = tf->tf_global[5]; + mc->mc_global[6] = tf->tf_global[6]; if (flags & GET_MC_CLEAR_RET) { mc->mc_out[0] = 0; mc->mc_out[1] = 0; + } else { + mc->mc_out[0] = tf->tf_out[0]; + mc->mc_out[1] = tf->tf_out[1]; } - mc->mc_flags = _MC_VERSION; + mc->mc_out[2] = tf->tf_out[2]; + mc->mc_out[3] = tf->tf_out[3]; + mc->mc_out[4] = tf->tf_out[4]; + mc->mc_out[5] = tf->tf_out[5]; + mc->mc_out[6] = tf->tf_out[6]; + mc->mc_out[7] = tf->tf_out[7]; + mc->mc_fprs = tf->tf_fprs; + mc->mc_fsr = tf->tf_fsr; + mc->mc_gsr = tf->tf_gsr; + mc->mc_tnpc = tf->tf_tnpc; + mc->mc_tpc = tf->tf_tpc; + mc->mc_tstate = tf->tf_tstate; + mc->mc_y = tf->tf_y; critical_enter(); if ((tf->tf_fprs & FPRS_FEF) != 0) { savefpctx(pcb->pcb_ufp); @@ -720,7 +747,6 @@ set_mcontext(struct thread *td, const mc { struct trapframe *tf; struct pcb *pcb; - uint64_t wstate; if (!TSTATE_SECURE(mc->mc_tstate) || (mc->mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION) @@ -729,9 +755,33 @@ set_mcontext(struct thread *td, const mc pcb = td->td_pcb; /* Make sure the windows are spilled first. */ flushw(); - wstate = tf->tf_wstate; - bcopy(mc, tf, sizeof(*tf)); - tf->tf_wstate = wstate; + /* +* Copy the registers which will be restored by tl0_ret() to the +* trapframe. +* Note that we skip %g7 which is used as the userland TLS register +* and %wstate. +*/ + tf->tf_global[1] = mc->mc_global[1]; + tf->tf_global[2] = mc->mc_global[2]; + tf->tf_global[3] = mc->mc_global[3]; + tf->tf_global[4] = mc->mc_global[4]; + tf->tf_global[5] = mc->mc_global[5]; + tf->tf_global[6] = mc->mc_global[6]; + tf->tf_out[0] = mc->mc_out[0]; + tf->tf_out[1] = mc->mc_out[1]; + tf->tf_out[2] = mc->mc_out[2]; + tf->tf_out[3] = mc->mc_out[3]; + tf->tf_out[4] = mc->mc_out[4]; + tf->tf_out[5] = mc->mc_out[5]; + tf->tf_out[6] = mc->mc_out[6]; + tf->tf_out[7] = mc->mc_out[7]; + tf->tf_fprs = mc->mc_fprs; + tf->tf_fsr = mc->mc_fsr; + tf->tf_gsr = mc->mc_gsr; + tf->tf_tnpc = mc->mc_tnpc; + tf->tf_tpc = mc->mc_tpc; + tf->tf_tstate = mc->mc_tstate; + tf->tf_y = mc->mc_y; if ((mc->mc_fprs & FPRS_FEF) != 0) { tf->tf_fprs = 0; bcopy(mc->mc_fp, pcb->pcb_ufp, sizeof(pcb->pcb_ufp)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r199729 - stable/8/sys/ia64/include
On Nov 24, 2009, at 12:10 PM, John Baldwin wrote: > On Tuesday 24 November 2009 2:55:53 pm Marcel Moolenaar wrote: >> *snip* >> >>> These MFCs seem to be missing mergeinfo for the contrib directories. >> >> I pruned them. We don't seem to get rid of merge into in the >> wrong directories even even people try to clean it up... > > That was the wrong thing to do. *sigh* I can't keep up with this... >>> >>> Generally you can just commit whatever svn merge gives you. Having a few >>> extra properties in the kernel tree is "normal" for stable/[678]. (I think >>> stable/6 only has one extra: contrib/pf). I do try to clean up merges into >>> the wrong directories, but in the case of vendor merges there isn't anything >>> to clean unless we reorganize the vendor-sys trees so that they always >>> merge >>> to sys. >> >> Do you want me to --record-only what I pruned or can we leave it >> as is with the note not to prune? > > You can just leave it as it is in this case I think. In the cases when I do > find > mergeinfo that I can prune I will generally find missing info like this and > fix it up > when doing the prune. Thanks, I appreciate it! -- Marcel Moolenaar xcl...@mac.com ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r199729 - stable/8/sys/ia64/include
On Tuesday 24 November 2009 2:55:53 pm Marcel Moolenaar wrote: > *snip* > > > These MFCs seem to be missing mergeinfo for the contrib directories. > > I pruned them. We don't seem to get rid of merge into in the > wrong directories even even people try to clean it up... > >>> > >>> That was the wrong thing to do. > >> > >> *sigh* > >> > >> I can't keep up with this... > > > > Generally you can just commit whatever svn merge gives you. Having a few > > extra properties in the kernel tree is "normal" for stable/[678]. (I think > > stable/6 only has one extra: contrib/pf). I do try to clean up merges into > > the wrong directories, but in the case of vendor merges there isn't anything > > to clean unless we reorganize the vendor-sys trees so that they always > > merge > > to sys. > > Do you want me to --record-only what I pruned or can we leave it > as is with the note not to prune? You can just leave it as it is in this case I think. In the cases when I do find mergeinfo that I can prune I will generally find missing info like this and fix it up when doing the prune. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199765 - stable/8/sys/sparc64/sparc64
Author: marius Date: Tue Nov 24 20:04:31 2009 New Revision: 199765 URL: http://svn.freebsd.org/changeset/base/199765 Log: MFC: r199442 Unroll copying of the registers in {g,s}et_mcontext() and limit it to the set actually restored by tl0_ret() instead of using the whole trapframe. Additionally skip %g7 as that register is used as the userland TLS pointer. PR: 140523 Modified: stable/8/sys/sparc64/sparc64/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/machdep.c == --- stable/8/sys/sparc64/sparc64/machdep.c Tue Nov 24 19:57:41 2009 (r199764) +++ stable/8/sys/sparc64/sparc64/machdep.c Tue Nov 24 20:04:31 2009 (r199765) @@ -696,12 +696,39 @@ get_mcontext(struct thread *td, mcontext tf = td->td_frame; pcb = td->td_pcb; - bcopy(tf, mc, sizeof(*tf)); + /* +* Copy the registers which will be restored by tl0_ret() from the +* trapframe. +* Note that we skip %g7 which is used as the userland TLS register +* and %wstate. +*/ + mc->mc_flags = _MC_VERSION; + mc->mc_global[1] = tf->tf_global[1]; + mc->mc_global[2] = tf->tf_global[2]; + mc->mc_global[3] = tf->tf_global[3]; + mc->mc_global[4] = tf->tf_global[4]; + mc->mc_global[5] = tf->tf_global[5]; + mc->mc_global[6] = tf->tf_global[6]; if (flags & GET_MC_CLEAR_RET) { mc->mc_out[0] = 0; mc->mc_out[1] = 0; + } else { + mc->mc_out[0] = tf->tf_out[0]; + mc->mc_out[1] = tf->tf_out[1]; } - mc->mc_flags = _MC_VERSION; + mc->mc_out[2] = tf->tf_out[2]; + mc->mc_out[3] = tf->tf_out[3]; + mc->mc_out[4] = tf->tf_out[4]; + mc->mc_out[5] = tf->tf_out[5]; + mc->mc_out[6] = tf->tf_out[6]; + mc->mc_out[7] = tf->tf_out[7]; + mc->mc_fprs = tf->tf_fprs; + mc->mc_fsr = tf->tf_fsr; + mc->mc_gsr = tf->tf_gsr; + mc->mc_tnpc = tf->tf_tnpc; + mc->mc_tpc = tf->tf_tpc; + mc->mc_tstate = tf->tf_tstate; + mc->mc_y = tf->tf_y; critical_enter(); if ((tf->tf_fprs & FPRS_FEF) != 0) { savefpctx(pcb->pcb_ufp); @@ -721,7 +748,6 @@ set_mcontext(struct thread *td, const mc { struct trapframe *tf; struct pcb *pcb; - uint64_t wstate; if (!TSTATE_SECURE(mc->mc_tstate) || (mc->mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION) @@ -730,9 +756,33 @@ set_mcontext(struct thread *td, const mc pcb = td->td_pcb; /* Make sure the windows are spilled first. */ flushw(); - wstate = tf->tf_wstate; - bcopy(mc, tf, sizeof(*tf)); - tf->tf_wstate = wstate; + /* +* Copy the registers which will be restored by tl0_ret() to the +* trapframe. +* Note that we skip %g7 which is used as the userland TLS register +* and %wstate. +*/ + tf->tf_global[1] = mc->mc_global[1]; + tf->tf_global[2] = mc->mc_global[2]; + tf->tf_global[3] = mc->mc_global[3]; + tf->tf_global[4] = mc->mc_global[4]; + tf->tf_global[5] = mc->mc_global[5]; + tf->tf_global[6] = mc->mc_global[6]; + tf->tf_out[0] = mc->mc_out[0]; + tf->tf_out[1] = mc->mc_out[1]; + tf->tf_out[2] = mc->mc_out[2]; + tf->tf_out[3] = mc->mc_out[3]; + tf->tf_out[4] = mc->mc_out[4]; + tf->tf_out[5] = mc->mc_out[5]; + tf->tf_out[6] = mc->mc_out[6]; + tf->tf_out[7] = mc->mc_out[7]; + tf->tf_fprs = mc->mc_fprs; + tf->tf_fsr = mc->mc_fsr; + tf->tf_gsr = mc->mc_gsr; + tf->tf_tnpc = mc->mc_tnpc; + tf->tf_tpc = mc->mc_tpc; + tf->tf_tstate = mc->mc_tstate; + tf->tf_y = mc->mc_y; if ((mc->mc_fprs & FPRS_FEF) != 0) { tf->tf_fprs = 0; bcopy(mc->mc_fp, pcb->pcb_ufp, sizeof(pcb->pcb_ufp)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199764 - head/sys/kern
Author: ivoras Date: Tue Nov 24 19:57:41 2009 New Revision: 199764 URL: http://svn.freebsd.org/changeset/base/199764 Log: Make ULE process usage (%CPU) accounting usable again by keeping track of the last tick we incremented on. Submitted by: matthew.fleming/at/isilon.com, is/at/rambler-co.ru Reviewed by: jeff (who thinks there should be a better way in the future) Approved by: gnn (mentor) MFC after:3 weeks Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c == --- head/sys/kern/sched_ule.c Tue Nov 24 19:26:53 2009(r199763) +++ head/sys/kern/sched_ule.c Tue Nov 24 19:57:41 2009(r199764) @@ -103,6 +103,7 @@ struct td_sched { u_int ts_slptime; /* Number of ticks we vol. slept */ u_int ts_runtime; /* Number of ticks we were running */ int ts_ltick; /* Last tick that we were running on */ + int ts_incrtick;/* Last tick that we incremented on */ int ts_ftick; /* First tick that we were running on */ int ts_ticks; /* Tick count */ #ifdef KTR @@ -1991,6 +1992,7 @@ sched_fork_thread(struct thread *td, str */ ts2->ts_ticks = ts->ts_ticks; ts2->ts_ltick = ts->ts_ltick; + ts2->ts_incrtick = ts->ts_incrtick; ts2->ts_ftick = ts->ts_ftick; child->td_user_pri = td->td_user_pri; child->td_base_user_pri = td->td_base_user_pri; @@ -2182,11 +2184,12 @@ sched_tick(void) * Ticks is updated asynchronously on a single cpu. Check here to * avoid incrementing ts_ticks multiple times in a single tick. */ - if (ts->ts_ltick == ticks) + if (ts->ts_incrtick == ticks) return; /* Adjust ticks for pctcpu */ ts->ts_ticks += 1 << SCHED_TICK_SHIFT; ts->ts_ltick = ticks; + ts->ts_incrtick = ticks; /* * Update if we've exceeded our desired tick threshhold by over one * second. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r199729 - stable/8/sys/ia64/include
*snip* > These MFCs seem to be missing mergeinfo for the contrib directories. I pruned them. We don't seem to get rid of merge into in the wrong directories even even people try to clean it up... >>> >>> That was the wrong thing to do. >> >> *sigh* >> >> I can't keep up with this... > > Generally you can just commit whatever svn merge gives you. Having a few > extra properties in the kernel tree is "normal" for stable/[678]. (I think > stable/6 only has one extra: contrib/pf). I do try to clean up merges into > the wrong directories, but in the case of vendor merges there isn't anything > to clean unless we reorganize the vendor-sys trees so that they always merge > to sys. Do you want me to --record-only what I pruned or can we leave it as is with the note not to prune? -- Marcel Moolenaar xcl...@mac.com ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r199729 - stable/8/sys/ia64/include
On Tuesday 24 November 2009 2:00:54 pm Marcel Moolenaar wrote: > > On Nov 24, 2009, at 8:24 AM, John Baldwin wrote: > > > On Monday 23 November 2009 11:17:00 pm Marcel Moolenaar wrote: > >> On Nov 23, 2009, at 7:51 PM, Max Laier wrote: > >> > Modified: > stable/8/sys/ia64/include/asm.h > Directory Properties: > stable/8/sys/ (props changed) > >>> > >>> These MFCs seem to be missing mergeinfo for the contrib directories. > >> > >> I pruned them. We don't seem to get rid of merge into in the > >> wrong directories even even people try to clean it up... > > > > That was the wrong thing to do. > > *sigh* > > I can't keep up with this... Generally you can just commit whatever svn merge gives you. Having a few extra properties in the kernel tree is "normal" for stable/[678]. (I think stable/6 only has one extra: contrib/pf). I do try to clean up merges into the wrong directories, but in the case of vendor merges there isn't anything to clean unless we reorganize the vendor-sys trees so that they always merge to sys. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199763 - head/sys/dev/hwpmc
Author: fabient Date: Tue Nov 24 19:26:53 2009 New Revision: 199763 URL: http://svn.freebsd.org/changeset/base/199763 Log: - fix a LOR between process lock and pmc thread mutex - fix a system deadlock on process exit when the sample buffer is full (pmclog_loop blocked in fo_write) and pmcstat exit. Reviewed by: jkoshy MFC after: 3 weeks Modified: head/sys/dev/hwpmc/hwpmc_logging.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c == --- head/sys/dev/hwpmc/hwpmc_logging.c Tue Nov 24 18:34:47 2009 (r199762) +++ head/sys/dev/hwpmc/hwpmc_logging.c Tue Nov 24 19:26:53 2009 (r199763) @@ -240,6 +240,7 @@ pmclog_loop(void *arg) int error; struct pmc_owner *po; struct pmclog_buffer *lb; + struct proc *p; struct ucred *ownercred; struct ucred *mycred; struct thread *td; @@ -248,12 +249,13 @@ pmclog_loop(void *arg) size_t nbytes; po = (struct pmc_owner *) arg; + p = po->po_owner; td = curthread; mycred = td->td_ucred; - PROC_LOCK(po->po_owner); - ownercred = crhold(po->po_owner->p_ucred); - PROC_UNLOCK(po->po_owner); + PROC_LOCK(p); + ownercred = crhold(p->p_ucred); + PROC_UNLOCK(p); PMCDBG(LOG,INI,1, "po=%p kt=%p", po, po->po_kthread); KASSERT(po->po_kthread == curthread->td_proc, @@ -324,16 +326,16 @@ pmclog_loop(void *arg) error = fo_write(po->po_file, &auio, ownercred, 0, td); td->td_ucred = mycred; - mtx_lock(&pmc_kthread_mtx); - if (error) { /* XXX some errors are recoverable */ /* XXX also check for SIGPIPE if a socket */ /* send a SIGIO to the owner and exit */ - PROC_LOCK(po->po_owner); - psignal(po->po_owner, SIGIO); - PROC_UNLOCK(po->po_owner); + PROC_LOCK(p); + psignal(p, SIGIO); + PROC_UNLOCK(p); + + mtx_lock(&pmc_kthread_mtx); po->po_error = error; /* save for flush log */ @@ -342,6 +344,8 @@ pmclog_loop(void *arg) break; } + mtx_lock(&pmc_kthread_mtx); + /* put the used buffer back into the global pool */ PMCLOG_INIT_BUFFER_DESCRIPTOR(lb); @@ -525,15 +529,20 @@ static void pmclog_stop_kthread(struct pmc_owner *po) { /* -* Unset flag, wakeup the helper thread, +* Close the file to force the thread out of fo_write, +* unset flag, wakeup the helper thread, * wait for it to exit */ - mtx_assert(&pmc_kthread_mtx, MA_OWNED); + if (po->po_file != NULL) + fo_close(po->po_file, curthread); + + mtx_lock(&pmc_kthread_mtx); po->po_flags &= ~PMC_PO_OWNS_LOGFILE; wakeup_one(po); if (po->po_kthread) msleep(po->po_kthread, &pmc_kthread_mtx, PPAUSE, "pmckstp", 0); + mtx_unlock(&pmc_kthread_mtx); } /* @@ -602,10 +611,8 @@ pmclog_configure_log(struct pmc_mdep *md error: /* shutdown the thread */ - mtx_lock(&pmc_kthread_mtx); if (po->po_kthread) pmclog_stop_kthread(po); - mtx_unlock(&pmc_kthread_mtx); KASSERT(po->po_kthread == NULL, ("[pmclog,%d] po=%p kthread not " "stopped", __LINE__, po)); @@ -641,10 +648,8 @@ pmclog_deconfigure_log(struct pmc_owner ("[pmclog,%d] po=%p no log file", __LINE__, po)); /* stop the kthread, this will reset the 'OWNS_LOGFILE' flag */ - mtx_lock(&pmc_kthread_mtx); if (po->po_kthread) pmclog_stop_kthread(po); - mtx_unlock(&pmc_kthread_mtx); KASSERT(po->po_kthread == NULL, ("[pmclog,%d] po=%p kthread not stopped", __LINE__, po)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r199729 - stable/8/sys/ia64/include
On Nov 24, 2009, at 8:24 AM, John Baldwin wrote: > On Monday 23 November 2009 11:17:00 pm Marcel Moolenaar wrote: >> On Nov 23, 2009, at 7:51 PM, Max Laier wrote: >> Modified: stable/8/sys/ia64/include/asm.h Directory Properties: stable/8/sys/ (props changed) >>> >>> These MFCs seem to be missing mergeinfo for the contrib directories. >> >> I pruned them. We don't seem to get rid of merge into in the >> wrong directories even even people try to clean it up... > > That was the wrong thing to do. *sigh* I can't keep up with this... -- Marcel Moolenaar xcl...@mac.com ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199762 - head/sys/mips/adm5120
Author: jhb Date: Tue Nov 24 18:34:47 2009 New Revision: 199762 URL: http://svn.freebsd.org/changeset/base/199762 Log: Use a single private timer to drive the transmit watchdog rather than using if_watchdog and if_timer from the first port. Reviewed by: gonzo Modified: head/sys/mips/adm5120/if_admsw.c head/sys/mips/adm5120/if_admswvar.h Modified: head/sys/mips/adm5120/if_admsw.c == --- head/sys/mips/adm5120/if_admsw.cTue Nov 24 17:46:58 2009 (r199761) +++ head/sys/mips/adm5120/if_admsw.cTue Nov 24 18:34:47 2009 (r199762) @@ -128,7 +128,7 @@ static uint8_t vlan_matrix[SW_DEVS] = { /* ifnet entry points */ static voidadmsw_start(struct ifnet *); -static voidadmsw_watchdog(struct ifnet *); +static voidadmsw_watchdog(void *); static int admsw_ioctl(struct ifnet *, u_long, caddr_t); static voidadmsw_init(void *); static voidadmsw_stop(struct ifnet *, int); @@ -398,6 +398,7 @@ admsw_attach(device_t dev) device_printf(sc->sc_dev, "base Ethernet address %s\n", ether_sprintf(enaddr)); + callout_init(&sc->sc_watchdog, 1); rid = 0; if ((sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -536,8 +537,6 @@ admsw_attach(device_t dev) ifp->if_ioctl = admsw_ioctl; ifp->if_output = ether_output; ifp->if_start = admsw_start; - ifp->if_watchdog = admsw_watchdog; - ifp->if_timer = 0; ifp->if_init = admsw_init; ifp->if_mtu = ETHERMTU; ifp->if_baudrate = IF_Mbps(100); @@ -733,7 +732,7 @@ admsw_start(struct ifnet *ifp) BPF_MTAP(ifp, m0); /* Set a watchdog timer in case the chip flakes out. */ - sc->sc_ifnet[0]->if_timer = 5; + sc->sc_timer = 5; } } @@ -743,25 +742,29 @@ admsw_start(struct ifnet *ifp) * Watchdog timer handler. */ static void -admsw_watchdog(struct ifnet *ifp) +admsw_watchdog(void *arg) { - struct admsw_softc *sc = ifp->if_softc; + struct admsw_softc *sc = arg; int vlan; + callout_reset(&sc->watchdog, hz, admsw_watchdog, sc); + if (sc->sc_timer == 0 || --sc->timer > 0) + return; + /* Check if an interrupt was lost. */ if (sc->sc_txfree == ADMSW_NTXLDESC) { device_printf(sc->sc_dev, "watchdog false alarm\n"); return; } - if (sc->sc_ifnet[0]->if_timer != 0) + if (sc->sc_timer != 0) device_printf(sc->sc_dev, "watchdog timer is %d!\n", - sc->sc_ifnet[0]->if_timer); + sc->sc_timer); admsw_txintr(sc, 0); if (sc->sc_txfree == ADMSW_NTXLDESC) { device_printf(sc->sc_dev, "tx IRQ lost (queue empty)\n"); return; } - if (sc->sc_ifnet[0]->if_timer != 0) { + if (sc->sc_timer != 0) { device_printf(sc->sc_dev, "tx IRQ lost (timer recharged)\n"); return; } @@ -938,7 +941,7 @@ admsw_txintr(struct admsw_softc *sc, int * cancel the watchdog timer. */ if (sc->sc_txfree == ADMSW_NTXLDESC) - ifp->if_timer = 0; + sc->sc_timer = 0; } @@ -1096,6 +1099,9 @@ admsw_init(void *xsc) ~(ADMSW_INTR_SHD | ADMSW_INTR_SLD | ADMSW_INTR_RHD | ADMSW_INTR_RLD | ADMSW_INTR_HDF | ADMSW_INTR_LDF)); + + callout_reset(&sc->sc_watchdog, hz, + admsw_watchdog, sc); } sc->ndevs++; } @@ -1137,11 +1143,14 @@ admsw_stop(struct ifnet *ifp, int disabl /* disable interrupts */ REG_WRITE(ADMSW_INT_MASK, INT_MASK); + + /* Cancel the watchdog timer. */ + sc->sc_timer = 0; + callout_stop(&sc->sc_watchdog); } - /* Mark the interface as down and cancel the watchdog timer. */ + /* Mark the interface as down. */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - ifp->if_timer = 0; return; } Modified: head/sys/mips/adm5120/if_admswvar.h == --- head/sys/mips/adm5120/if_admswvar.h Tue Nov 24 17:46:58 2009 (r199761) +++ head/sys/mips/adm5120/if_admswvar.h Tue Nov 24 18:34:47 2009 (r199762) @@ -132,7 +132,9 @@ struct admsw_softc { bus_dma_tag_tsc_bufs_dmat; /* bus DMA tag for buffers */ struct ifmedia sc_ifmedia[SW_DEVS]; int ndevs; /* number of IFF_RUNNING interfaces */ - str
Re: svn commit: r199729 - stable/8/sys/ia64/include
On Monday 23 November 2009 11:17:00 pm Marcel Moolenaar wrote: > On Nov 23, 2009, at 7:51 PM, Max Laier wrote: > > >> Modified: > >> stable/8/sys/ia64/include/asm.h > >> Directory Properties: > >> stable/8/sys/ (props changed) > > > > These MFCs seem to be missing mergeinfo for the contrib directories. > > I pruned them. We don't seem to get rid of merge into in the > wrong directories even even people try to clean it up... That was the wrong thing to do. The mergeinfo on the contrib directories is actually quite valid b/c they have metadata from multiple locations. These were not the results of merges into the wrong directories, but the results of merges from vendor trees into HEAD. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199761 - head/sys/dev/bge
Author: yongari Date: Tue Nov 24 17:46:58 2009 New Revision: 199761 URL: http://svn.freebsd.org/changeset/base/199761 Log: BGE_FLAG_40BIT_BUG should be set before creating DMA tags. Pointy hat to: yongari Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c == --- head/sys/dev/bge/if_bge.c Tue Nov 24 17:15:22 2009(r199760) +++ head/sys/dev/bge/if_bge.c Tue Nov 24 17:46:58 2009(r199761) @@ -2665,6 +2665,13 @@ bge_attach(device_t dev) } /* +* The 40bit DMA bug applies to the 5714/5715 controllers and is +* not actually a MAC controller bug but an issue with the embedded +* PCIe to PCI-X bridge in the device. Use 40bit DMA workaround. +*/ + if (BGE_IS_5714_FAMILY(sc) && (sc->bge_flags & BGE_FLAG_PCIX)) + sc->bge_flags |= BGE_FLAG_40BIT_BUG; + /* * Allocate the interrupt, using MSI if possible. These devices * support 8 MSI messages, but only the first one is used in * normal operation. @@ -2798,13 +2805,6 @@ bge_attach(device_t dev) #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; #endif - /* -* The 40bit DMA bug applies to the 5714/5715 controllers and is -* not actually a MAC controller bug but an issue with the embedded -* PCIe to PCI-X bridge in the device. Use 40bit DMA workaround. -*/ - if (BGE_IS_5714_FAMILY(sc) && (sc->bge_flags & BGE_FLAG_PCIX)) - sc->bge_flags |= BGE_FLAG_40BIT_BUG; /* * 5700 B0 chips do not support checksumming correctly due ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199757 - head/sys/dev/an
Author: jhb Date: Tue Nov 24 16:57:35 2009 New Revision: 199757 URL: http://svn.freebsd.org/changeset/base/199757 Log: - For 350 chips, don't set various INTR bits in TX control word; turning INTR bits on seems to confuse hardware TX engine. - For 350 chips, set TX desc's buffer physical address before turning on the TX desc valid bit. Submitted by: Jeremy O'Brien obrien654j | gmail, sephe Obtained from:DragonFly BSD Modified: head/sys/dev/an/if_an.c head/sys/dev/an/if_anreg.h Modified: head/sys/dev/an/if_an.c == --- head/sys/dev/an/if_an.c Tue Nov 24 16:54:54 2009(r199756) +++ head/sys/dev/an/if_an.c Tue Nov 24 16:57:35 2009(r199757) @@ -2800,7 +2800,7 @@ an_start_locked(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len, (caddr_t)&sc->an_txbuf); - txcontrol = AN_TXCTL_8023; + txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350); /* write the txcontrol only */ an_write_data(sc, id, 0x08, (caddr_t)&txcontrol, sizeof(txcontrol)); @@ -2863,7 +2863,7 @@ an_start_locked(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len, (caddr_t)&sc->an_txbuf); - txcontrol = AN_TXCTL_8023; + txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350); /* write the txcontrol only */ bcopy((caddr_t)&txcontrol, &buf[0x08], sizeof(txcontrol)); @@ -2885,7 +2885,7 @@ an_start_locked(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len; an_tx_desc.an_phys = sc->an_tx_buffer[idx].an_dma_paddr; - for (i = 0; i < sizeof(an_tx_desc) / 4 ; i++) { + for (i = sizeof(an_tx_desc) / 4 - 1; i >= 0; i--) { CSR_MEM_AUX_WRITE_4(sc, AN_TX_DESC_OFFSET /* zero for now */ + (0 * sizeof(an_tx_desc)) Modified: head/sys/dev/an/if_anreg.h == --- head/sys/dev/an/if_anreg.h Tue Nov 24 16:54:54 2009(r199756) +++ head/sys/dev/an/if_anreg.h Tue Nov 24 16:57:35 2009(r199757) @@ -386,13 +386,18 @@ struct an_txframe_802_3 { #define AN_PAYLOADTYPE_ETHER 0x #define AN_PAYLOADTYPE_LLC 0x0010 -#define AN_TXCTL_80211 \ - (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_80211|\ - AN_PAYLOADTYPE_LLC|AN_TXCTL_NORELEASE) - -#define AN_TXCTL_8023 \ - (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023| \ - AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE) +#define AN_TXCTL_80211 (AN_HEADERTYPE_80211|AN_PAYLOADTYPE_LLC) + +#define AN_TXCTL_8023 (AN_HEADERTYPE_8023|AN_PAYLOADTYPE_ETHER) + +/* + * Additions to transmit control bits for MPI350 + */ +#defineAN_TXCTL_HW(x) \ + ( x ? (AN_TXCTL_NORELEASE) \ + : \ + (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_TXCTL_NORELEASE) \ + ) #define AN_TXGAP_80211 0 #define AN_TXGAP_8023 0 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199756 - head/sys/dev/an
Author: jhb Date: Tue Nov 24 16:54:54 2009 New Revision: 199756 URL: http://svn.freebsd.org/changeset/base/199756 Log: Use bus_*() rather than bus_space_*(). Modified: head/sys/dev/an/if_an.c head/sys/dev/an/if_an_isa.c head/sys/dev/an/if_an_pccard.c head/sys/dev/an/if_an_pci.c head/sys/dev/an/if_anreg.h Modified: head/sys/dev/an/if_an.c == --- head/sys/dev/an/if_an.c Tue Nov 24 16:53:58 2009(r199755) +++ head/sys/dev/an/if_an.c Tue Nov 24 16:54:54 2009(r199756) @@ -349,9 +349,6 @@ an_probe(device_t dev) * to be able to issue commands and call some of the * other routines. */ - sc->an_bhandle = rman_get_bushandle(sc->port_res); - sc->an_btag = rman_get_bustag(sc->port_res); - ssid.an_len = sizeof(ssid); ssid.an_type = AN_RID_SSIDLIST; Modified: head/sys/dev/an/if_an_isa.c == --- head/sys/dev/an/if_an_isa.c Tue Nov 24 16:53:58 2009(r199755) +++ head/sys/dev/an/if_an_isa.c Tue Nov 24 16:54:54 2009(r199756) @@ -111,8 +111,6 @@ an_attach_isa(device_t dev) an_alloc_port(dev, sc->port_rid, 1); an_alloc_irq(dev, sc->irq_rid, 0); - sc->an_bhandle = rman_get_bushandle(sc->port_res); - sc->an_btag = rman_get_bustag(sc->port_res); sc->an_dev = dev; error = an_attach(sc, flags); Modified: head/sys/dev/an/if_an_pccard.c == --- head/sys/dev/an/if_an_pccard.c Tue Nov 24 16:53:58 2009 (r199755) +++ head/sys/dev/an/if_an_pccard.c Tue Nov 24 16:54:54 2009 (r199756) @@ -141,8 +141,6 @@ an_pccard_attach(device_t dev) an_alloc_irq(dev, sc->irq_rid, 0); - sc->an_bhandle = rman_get_bushandle(sc->port_res); - sc->an_btag = rman_get_bustag(sc->port_res); sc->an_dev = dev; error = an_attach(sc, flags); Modified: head/sys/dev/an/if_an_pci.c == --- head/sys/dev/an/if_an_pci.c Tue Nov 24 16:53:58 2009(r199755) +++ head/sys/dev/an/if_an_pci.c Tue Nov 24 16:54:54 2009(r199756) @@ -175,9 +175,6 @@ an_attach_pci(dev) goto fail; } - sc->an_btag = rman_get_bustag(sc->port_res); - sc->an_bhandle = rman_get_bushandle(sc->port_res); - /* Allocate memory for MPI350 */ if (sc->mpi350) { /* Allocate memory */ @@ -187,8 +184,6 @@ an_attach_pci(dev) device_printf(dev, "couldn't map memory\n"); goto fail; } - sc->an_mem_btag = rman_get_bustag(sc->mem_res); - sc->an_mem_bhandle = rman_get_bushandle(sc->mem_res); /* Allocate aux. memory */ sc->mem_aux_rid = PCIR_BAR(2); @@ -198,8 +193,6 @@ an_attach_pci(dev) device_printf(dev, "couldn't map aux memory\n"); goto fail; } - sc->an_mem_aux_btag = rman_get_bustag(sc->mem_aux_res); - sc->an_mem_aux_bhandle = rman_get_bushandle(sc->mem_aux_res); /* Allocate DMA region */ error = bus_dma_tag_create(NULL,/* parent */ Modified: head/sys/dev/an/if_anreg.h == --- head/sys/dev/an/if_anreg.h Tue Nov 24 16:53:58 2009(r199755) +++ head/sys/dev/an/if_anreg.h Tue Nov 24 16:54:54 2009(r199756) @@ -45,47 +45,39 @@ /* * register space access macros */ -#define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->an_btag, sc->an_bhandle, reg, val) +#define CSR_WRITE_2(sc, reg, val) bus_write_2(sc->port_res, reg, val) -#define CSR_READ_2(sc, reg)\ - bus_space_read_2(sc->an_btag, sc->an_bhandle, reg) +#define CSR_READ_2(sc, reg)bus_read_2(sc->port_res, reg) -#define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->an_btag, sc->an_bhandle, reg, val) +#define CSR_WRITE_1(sc, reg, val) bus_write_1(sc->port_res, reg, val) -#define CSR_READ_1(sc, reg)\ - bus_space_read_1(sc->an_btag, sc->an_bhandle, reg) +#define CSR_READ_1(sc, reg)bus_read_1(sc->port_res, reg) /* * memory space access macros */ -#define CSR_MEM_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->an_mem_btag, sc->an_mem_bhandle, reg, val) +#define CSR_MEM_WRITE_2(sc, reg, val) bus_write_2(sc->mem_res, reg, val) -#define CSR_MEM_READ_2(sc, reg)\ - bus_space_read_2(sc->an_mem_btag, sc->an_mem_bhandle, reg) +#define CSR_MEM_READ_2(sc, reg)bus_read_2(sc->mem_res, reg) -#define CSR_MEM_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->an_mem_btag, sc-
svn commit: r199750 - stable/6/sys/fs/fifofs
Author: attilio Date: Tue Nov 24 14:40:50 2009 New Revision: 199750 URL: http://svn.freebsd.org/changeset/base/199750 Log: MFC 199007: Fix a memory leak. Modified: stable/6/sys/fs/fifofs/fifo_vnops.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/fs/fifofs/fifo_vnops.c == --- stable/6/sys/fs/fifofs/fifo_vnops.c Tue Nov 24 14:06:15 2009 (r199749) +++ stable/6/sys/fs/fifofs/fifo_vnops.c Tue Nov 24 14:40:50 2009 (r199750) @@ -76,6 +76,9 @@ struct fileops fifo_ops_f = { /* * This structure is associated with the FIFO vnode and stores * the state associated with the FIFO. + * Notes about locking: + * - fi_readsock and fi_writesock are invariant since init time. + * - fi_readers and fi_writers are vnode lock protected. */ struct fifoinfo { struct socket *fi_readsock; @@ -212,14 +215,9 @@ fail1: } /* -* General access to fi_readers and fi_writers is protected using -* the vnode lock. -* -* Protect the increment of fi_readers and fi_writers and the -* associated calls to wakeup() with the fifo mutex in addition -* to the vnode lock. This allows the vnode lock to be dropped -* for the msleep() calls below, and using the fifo mutex with -* msleep() prevents the wakeup from being missed. +* Use the fifo_mtx lock here, in addition to the vnode lock, +* in order to allow vnode lock dropping before msleep() calls +* and still avoiding missed wakeups. */ mtx_lock(&fifo_mtx); if (ap->a_mode & FREAD) { @@ -237,6 +235,8 @@ fail1: if (ap->a_mode & FWRITE) { if ((ap->a_mode & O_NONBLOCK) && fip->fi_readers == 0) { mtx_unlock(&fifo_mtx); + if (fip->fi_writers == 0) + fifo_cleanup(vp); return (ENXIO); } fip->fi_writers++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199749 - head/sys/dev/ata
Author: mav Date: Tue Nov 24 14:06:15 2009 New Revision: 199749 URL: http://svn.freebsd.org/changeset/base/199749 Log: Use only lower byte of sectors_intr IDENTIFY word as sector count. This fixes SET_MULTI error during boot on devices supporting less then 16 sectors per interrupt. Modified: head/sys/dev/ata/ata-disk.c Modified: head/sys/dev/ata/ata-disk.c == --- head/sys/dev/ata/ata-disk.c Tue Nov 24 13:44:53 2009(r199748) +++ head/sys/dev/ata/ata-disk.c Tue Nov 24 14:06:15 2009(r199749) @@ -397,7 +397,7 @@ ad_init(device_t dev) /* use multiple sectors/interrupt if device supports it */ if (ad_version(atadev->param.version_major)) { - int secsperint = max(1, min(atadev->param.sectors_intr, 16)); + int secsperint = max(1, min(atadev->param.sectors_intr & 0xff, 16)); if (!ata_controlcmd(dev, ATA_SET_MULTI, 0, 0, secsperint)) atadev->max_iosize = secsperint * DEV_BSIZE; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199748 - head/share/man/man4
Author: brueffer Date: Tue Nov 24 13:44:53 2009 New Revision: 199748 URL: http://svn.freebsd.org/changeset/base/199748 Log: Grammar and mdoc improvements. MFC after:3 days Modified: head/share/man/man4/ada.4 Modified: head/share/man/man4/ada.4 == --- head/share/man/man4/ada.4 Tue Nov 24 12:47:58 2009(r199747) +++ head/share/man/man4/ada.4 Tue Nov 24 13:44:53 2009(r199748) @@ -36,12 +36,12 @@ .Sh DESCRIPTION The .Nm -driver provides support for direct access devices, implementing +driver provides support for direct access devices, implementing the .Tn ATA command protocol, that are attached to the system through a host adapter -supported by CAM subsystem. +supported by the CAM subsystem. .Pp -Host adapter must also be separately configured into the system before a +The host adapter must also be separately configured into the system before an .Tn ATA direct access device can be configured. .Sh COMMAND QUEUING @@ -52,12 +52,12 @@ seeks. defines two types of queueing: .Tn TCQ (Tagged Command Queueing, PATA legacy) and -.Tn NCQ (Native Command Queueing, SATA). +.Tn NCQ (Native Command Queueing, SATA) . The .Nm -device driver takes full advantage of the NCQ, when supported. -To ensure that transactions to distant portions of the media, -which may be deferred indefinitely by servicing requests nearer the current +device driver takes full advantage of NCQ, when supported. +To ensure that transactions to distant parts of the media, +which may be deferred indefinitely by servicing requests closer to the current head position, are completed in a timely fashion, an ordered transaction is sent every 7 seconds during continuous device operation. .Sh CACHE EFFECTS @@ -84,8 +84,8 @@ writes will be lost. The effect of a loss of write transactions on a file system is non-deterministic and can cause corruption. Most -devices age write transactions to limit vulnerability to a few transactions -recently reported as complete, but it is none-the-less recommended that +devices age write transactions to limit the vulnerability to a few transactions +recently reported as complete, but it is nonetheless recommended that systems with write cache enabled devices reside on an Uninterruptible Power Supply (UPS). The @@ -125,14 +125,14 @@ seconds. ATA device nodes .El .Sh SEE ALSO +.Xr ad 4 , .Xr ahci 4 , -.Xr siis 4 , -.Xr ad 4 -.Xr da 4 +.Xr da 4 , +.Xr siis 4 .Sh HISTORY The .Nm driver first appeared in .Fx 8.0 . .Sh AUTHORS -.An Alexander Motin Aq m...@freebsd.org . +.An Alexander Motin Aq m...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199747 - in head: sbin/camcontrol sys/cam sys/cam/ata sys/dev/ahci sys/dev/siis
Author: mav Date: Tue Nov 24 12:47:58 2009 New Revision: 199747 URL: http://svn.freebsd.org/changeset/base/199747 Log: MFp4: - Extend XPT-SIM transfer settings control API. Now it allows to report to SATA SIM number of tags supported by each device, implement ATA mode and SATA revision negotiation for both SATA and PATA SIMs. - Make ahci(4) and siis(4) to use submitted maximum tag number, when scheduling requests. It allows to support NCQ on devices with lower tags count then controller supports. - Make PMP driver to report attached devices connection speeds. - Implement ATA mode negotiation between user settings, device and controller capabilities. Modified: head/sbin/camcontrol/camcontrol.c head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_all.h head/sys/cam/ata/ata_pmp.c head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/dev/siis/siis.c head/sys/dev/siis/siis.h Modified: head/sbin/camcontrol/camcontrol.c == --- head/sbin/camcontrol/camcontrol.c Tue Nov 24 10:46:17 2009 (r199746) +++ head/sbin/camcontrol/camcontrol.c Tue Nov 24 12:47:58 2009 (r199747) @@ -226,6 +226,12 @@ static int scsireadcapacity(struct cam_d static int atapm(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); #endif /* MINIMALISTIC */ +#ifndef min +#define min(a,b) (((a)<(b))?(a):(b)) +#endif +#ifndef max +#define max(a,b) (((a)>(b))?(a):(b)) +#endif camcontrol_optret getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, @@ -950,21 +956,27 @@ camxferrate(struct cam_device *device) if (sas->valid & CTS_SAS_VALID_SPEED) speed = sas->bitrate; + } else if (ccb->cts.transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &ccb->cts.xport_specific.ata; + + if (ata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(ata->mode); } else if (ccb->cts.transport == XPORT_SATA) { - struct ccb_trans_settings_sata *sata = + struct ccb_trans_settings_sata *sata = &ccb->cts.xport_specific.sata; - if (sata->valid & CTS_SATA_VALID_SPEED) - speed = sata->bitrate; + if (sata->valid & CTS_SATA_VALID_REVISION) + speed = ata_revision2speed(sata->revision); } mb = speed / 1000; if (mb > 0) { - fprintf(stdout, "%s%d: %d.%03dMB/s transfers ", + fprintf(stdout, "%s%d: %d.%03dMB/s transfers", device->device_name, device->dev_unit_num, mb, speed % 1000); } else { - fprintf(stdout, "%s%d: %dKB/s transfers ", + fprintf(stdout, "%s%d: %dKB/s transfers", device->device_name, device->dev_unit_num, speed); } @@ -975,7 +987,7 @@ camxferrate(struct cam_device *device) if (((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0) && (spi->sync_offset != 0)) - fprintf(stdout, "(%d.%03dMHz, offset %d", freq / 1000, + fprintf(stdout, " (%d.%03dMHz, offset %d", freq / 1000, freq % 1000, spi->sync_offset); if (((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) @@ -995,18 +1007,24 @@ camxferrate(struct cam_device *device) struct ccb_trans_settings_ata *ata = &ccb->cts.xport_specific.ata; - if (ata->valid & CTS_ATA_VALID_BYTECOUNT) { - fprintf(stdout, "(PIO size %dbytes)", - ata->bytecount); - } + printf(" ("); + if (ata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(ata->mode)); + if (ata->valid & CTS_ATA_VALID_BYTECOUNT) + printf("PIO size %dbytes", ata->bytecount); + printf(")"); } else if (ccb->cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = &ccb->cts.xport_specific.sata; - if (sata->valid & CTS_SATA_VALID_BYTECOUNT) { - fprintf(stdout, "(PIO size %dbytes)", - sata->bytecount); - } + printf(" ("); + if (sata->valid & CTS_SATA_VALID_REVISION) + printf("SATA %d.x, ", sata->revision); + if (sata->valid & CTS_SATA_VALID_MODE) + printf("%s, ", ata_mode2string(sata->mode)); + if (sata->valid & CTS_SATA_VALID_BYTECOUNT) + printf("PIO
svn commit: r199746 - stable/8/bin/ps
Author: netchild Date: Tue Nov 24 10:46:17 2009 New Revision: 199746 URL: http://svn.freebsd.org/changeset/base/199746 Log: MFC r199351: Fix small resource leak (memory). Reviewed by:gad Modified: stable/8/bin/ps/keyword.c Directory Properties: stable/8/bin/ps/ (props changed) Modified: stable/8/bin/ps/keyword.c == --- stable/8/bin/ps/keyword.c Tue Nov 24 09:16:47 2009(r199745) +++ stable/8/bin/ps/keyword.c Tue Nov 24 10:46:17 2009(r199746) @@ -330,6 +330,7 @@ findvar(char *p, int user, char **header errx(1, "malloc failed"); snprintf(realfmt, rflen, "%s=%s", v->alias, hp); parsefmt(realfmt, user); + free(realfmt); } return ((VAR *)NULL); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199745 - stable/8/share/man/man4
Author: mav Date: Tue Nov 24 09:16:47 2009 New Revision: 199745 URL: http://svn.freebsd.org/changeset/base/199745 Log: MFC r199247: Remove part that HDMI is not implemented. It had different meaning and confuse users. Extend BUGS section. Add some supported chipsets. Modified: stable/8/share/man/man4/snd_hda.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/snd_hda.4 == --- stable/8/share/man/man4/snd_hda.4 Tue Nov 24 09:13:15 2009 (r199744) +++ stable/8/share/man/man4/snd_hda.4 Tue Nov 24 09:16:47 2009 (r199745) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2009 +.Dd November 13, 2009 .Dt SND_HDA 4 .Os .Sh NAME @@ -59,7 +59,7 @@ driver that allows the generic audio dri to be used with this hardware. Only audio functions are supported by .Nm . -Modem, HDMI and other possible functions are not implemented. +Modem and other possible functions are not implemented. .Pp The .Nm @@ -500,6 +500,14 @@ nVidia MCP68 .It nVidia MCP69 .It +nVidia MCP73 +.It +nVidia MCP78 +.It +nVidia MCP79 +.It +nVidia MCP89 +.It SiS 966 .It VIA VT8251/8237A @@ -626,5 +634,11 @@ trying to fix problem that way, make sur and the PCM audio device you are using really corresponds to expected audio connector. .Pp +Some vendors use non-standardized General Purpose I/O (GPIO) pins of codec +to control external amplifiers. In some cases setting proper combination of +GPIO bits may be needed to make sound work on specific device. +.Pp +HDMI and DisplayPort audio may also require support from video driver. +.Pp Due to OSS limitation multichannel (not multidevice) playback is not supported. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199744 - stable/8/share/man/man4
Author: mav Date: Tue Nov 24 09:13:15 2009 New Revision: 199744 URL: http://svn.freebsd.org/changeset/base/199744 Log: MFC r199532: Add ada(4) man page. Added: stable/8/share/man/man4/ada.4 - copied unchanged from r199532, head/share/man/man4/ada.4 Modified: stable/8/share/man/man4/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile == --- stable/8/share/man/man4/MakefileTue Nov 24 09:10:43 2009 (r199743) +++ stable/8/share/man/man4/MakefileTue Nov 24 09:13:15 2009 (r199744) @@ -15,6 +15,7 @@ MAN= aac.4 \ ${_acpi_toshiba.4} \ acpi_video.4 \ ${_acpi_wmi.4} \ + ada.4 \ adv.4 \ adw.4 \ ae.4 \ Copied: stable/8/share/man/man4/ada.4 (from r199532, head/share/man/man4/ada.4) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/ada.4 Tue Nov 24 09:13:15 2009 (r199744, copy of r199532, head/share/man/man4/ada.4) @@ -0,0 +1,138 @@ +.\" Copyright (c) 2009 Alexander Motin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 19, 2009 +.Dt ADA 4 +.Os +.Sh NAME +.Nm ada +.Nd ATA Direct Access device driver +.Sh SYNOPSIS +.Cd device ada +.Sh DESCRIPTION +The +.Nm +driver provides support for direct access devices, implementing +.Tn ATA +command protocol, that are attached to the system through a host adapter +supported by CAM subsystem. +.Pp +Host adapter must also be separately configured into the system before a +.Tn ATA +direct access device can be configured. +.Sh COMMAND QUEUING +Command queueing allows the device to process multiple transactions +concurrently, often re-ordering them to reduce the number and length of +seeks. +.Tn ATA +defines two types of queueing: +.Tn TCQ (Tagged Command Queueing, PATA legacy) +and +.Tn NCQ (Native Command Queueing, SATA). +The +.Nm +device driver takes full advantage of the NCQ, when supported. +To ensure that transactions to distant portions of the media, +which may be deferred indefinitely by servicing requests nearer the current +head position, are completed in a timely fashion, an ordered +transaction is sent every 7 seconds during continuous device operation. +.Sh CACHE EFFECTS +Many direct access devices are equipped with read and/or write caches. +Parameters affecting the device's cache are reported in device IDENTIFY data +and can be examined and modified via the +.Xr camcontrol 8 +utility. +.Pp +The read cache is used to store data from device-initiated read ahead +operations as well as frequently used data. +The read cache is transparent +to the user and can be enabled without any adverse effect. +Most devices +with a read cache come from the factory with it enabled. +.Pp +The write cache can greatly decrease the latency of write operations +and allows the device to reorganize writes to increase efficiency and +performance. +This performance gain comes at a price. +Should the device +lose power while its cache contains uncommitted write operations, these +writes will be lost. +The effect of a loss of write transactions on +a file system is non-deterministic and can cause corruption. +Most +devices age write transactions to limit vulnerability to a few transactions +recently reported as complete, but it is none-the-less recommended that +systems with write cache enabled devices reside on an Uninterruptible +Power Supply (UPS). +The +.Nm +device driver ensures that the cache and med
svn commit: r199743 - stable/8/sys/conf
Author: mav Date: Tue Nov 24 09:10:43 2009 New Revision: 199743 URL: http://svn.freebsd.org/changeset/base/199743 Log: MFC r199535: Tune CAM ATA kernel options a bit. Move PMP support from da to scbus and add ada device option, according to man page. Modified: stable/8/sys/conf/files Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files == --- stable/8/sys/conf/files Tue Nov 24 08:35:11 2009(r199742) +++ stable/8/sys/conf/files Tue Nov 24 09:10:43 2009(r199743) @@ -112,12 +112,12 @@ cam/cam_sim.c optional scbus cam/cam_xpt.c optional scbus cam/ata/ata_all.c optional scbus cam/ata/ata_xpt.c optional scbus +cam/ata/ata_pmp.c optional scbus cam/scsi/scsi_xpt.coptional scbus cam/scsi/scsi_all.coptional scbus cam/scsi/scsi_cd.c optional cd cam/scsi/scsi_ch.c optional ch -cam/ata/ata_da.c optional da -cam/ata/ata_pmp.c optional da +cam/ata/ata_da.c optional ada | da cam/scsi/scsi_da.c optional da cam/scsi/scsi_low.coptional ct | ncv | nsp | stg cam/scsi/scsi_low_pisa.c optional ct | ncv | nsp | stg ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199739 - head/share/man/man4
Author: brueffer Date: Tue Nov 24 08:14:22 2009 New Revision: 199739 URL: http://svn.freebsd.org/changeset/base/199739 Log: LSI MegaRAID 9260 works, sort the hardware list while here. Submitted by: Jason MFC after:3 days Modified: head/share/man/man4/mfi.4 Modified: head/share/man/man4/mfi.4 == --- head/share/man/man4/mfi.4 Tue Nov 24 07:50:19 2009(r199738) +++ head/share/man/man4/mfi.4 Tue Nov 24 08:14:22 2009(r199739) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2009 +.Dd November 24, 2009 .Dt MFI 4 .Os .Sh NAME @@ -79,11 +79,13 @@ driver supports the following hardware: .Pp .Bl -bullet -compact .It +LSI MegaRAID SAS 1078 +.It LSI MegaRAID SAS 8408E .It LSI MegaRAID SAS 8480E .It -LSI MegaRAID SAS 1078 +LSI MegaRAID SAS 9260 .It Dell PERC5 .It ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"