svn commit: r206546 - head/sys/kern
Author: kib Date: Tue Apr 13 08:45:55 2010 New Revision: 206546 URL: http://svn.freebsd.org/changeset/base/206546 Log: Remove XXX comment. Add another comment, describing why f_vnode assignment is useful. MFC after:3 days Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c == --- head/sys/kern/vfs_syscalls.cTue Apr 13 06:48:37 2010 (r206545) +++ head/sys/kern/vfs_syscalls.cTue Apr 13 08:45:55 2010 (r206546) @@ -1124,7 +1124,12 @@ kern_openat(struct thread *td, int fd, c NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; - fp->f_vnode = vp; /* XXX Does devfs need this? */ + /* +* Store the vnode, for any f_type. Typically, the vnode use +* count is decremented by direct call to vn_closefile() for +* files that switched type in the cdevsw fdopen() method. +*/ + fp->f_vnode = vp; /* * If the file wasn't claimed by devfs bind it to the normal * vnode operations here. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206547 - head/sys/kern
Author: kib Date: Tue Apr 13 08:52:20 2010 New Revision: 206547 URL: http://svn.freebsd.org/changeset/base/206547 Log: Handle a case in kern_openat() when vn_open() change file type from DTYPE_VNODE. Only acquire locks for O_EXLOCK/O_SHLOCK if file type is still vnode, since we allow for fcntl(2) to process with advisory locks for DTYPE_VNODE only. Another reason is that all fo_close() routines need to check and release locks otherwise. For O_TRUNC, call fo_truncate() instead of truncating the vnode. Discussed with: rwatson MFC after:2 week Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c == --- head/sys/kern/vfs_syscalls.cTue Apr 13 08:45:55 2010 (r206546) +++ head/sys/kern/vfs_syscalls.cTue Apr 13 08:52:20 2010 (r206547) @@ -1047,8 +1047,6 @@ kern_openat(struct thread *td, int fd, c struct filedesc *fdp = p->p_fd; struct file *fp; struct vnode *vp; - struct vattr vat; - struct mount *mp; int cmode; struct file *nfp; int type, indx, error; @@ -1141,7 +1139,7 @@ kern_openat(struct thread *td, int fd, c } VOP_UNLOCK(vp, 0); - if (flags & (O_EXLOCK | O_SHLOCK)) { + if (fp->f_type == DTYPE_VNODE && (flags & (O_EXLOCK | O_SHLOCK)) != 0) { lf.l_whence = SEEK_SET; lf.l_start = 0; lf.l_len = 0; @@ -1158,18 +1156,7 @@ kern_openat(struct thread *td, int fd, c atomic_set_int(&fp->f_flag, FHASLOCK); } if (flags & O_TRUNC) { - if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) - goto bad; - VATTR_NULL(&vat); - vat.va_size = 0; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); -#ifdef MAC - error = mac_vnode_check_write(td->td_ucred, fp->f_cred, vp); - if (error == 0) -#endif - error = VOP_SETATTR(vp, &vat, td->td_ucred); - VOP_UNLOCK(vp, 0); - vn_finished_write(mp); + error = fo_truncate(fp, 0, td->td_ucred, td); if (error) goto bad; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206548 - head/bin/ps
Author: kib Date: Tue Apr 13 08:54:53 2010 New Revision: 206548 URL: http://svn.freebsd.org/changeset/base/206548 Log: Update the list of the process flags for P_WKILLED. MFC after:4 weeks Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 == --- head/bin/ps/ps.1Tue Apr 13 08:52:20 2010(r206547) +++ head/bin/ps/ps.1Tue Apr 13 08:54:53 2010(r206548) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 17, 2010 +.Dd April 13, 2010 .Dt PS 1 .Os .Sh NAME @@ -298,6 +298,7 @@ the include file .It Dv "P_WAITED" Ta No "0x01000 Someone is waiting for us" .It Dv "P_WEXIT" Ta No "0x02000Working on exiting" .It Dv "P_EXEC" Ta No "0x04000 Process called exec" +.It Dv "P_WKILLED" Ta No "0x08000 Killed, shall go to kernel/user boundary ASAP" .It Dv "P_CONTINUED" Ta No "0x1Proc has continued from a stopped state" .It Dv "P_STOPPED_SIG" Ta No "0x2 Stopped due to SIGSTOP/SIGTSTP" .It Dv "P_STOPPED_TRACE" Ta No "0x4Stopped because of tracing" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206549 - head/lib/libc/sys
Author: kib Date: Tue Apr 13 08:56:03 2010 New Revision: 206549 URL: http://svn.freebsd.org/changeset/base/206549 Log: Align the declaration for sa_sigaction with POSIX. MFC after:3 days Modified: head/lib/libc/sys/sigaction.2 Modified: head/lib/libc/sys/sigaction.2 == --- head/lib/libc/sys/sigaction.2 Tue Apr 13 08:54:53 2010 (r206548) +++ head/lib/libc/sys/sigaction.2 Tue Apr 13 08:56:03 2010 (r206549) @@ -28,7 +28,7 @@ .\"From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94 .\" $FreeBSD$ .\" -.Dd June 7, 2004 +.Dd April 13, 2010 .Dt SIGACTION 2 .Os .Sh NAME @@ -42,7 +42,7 @@ struct sigaction { union { void(*__sa_handler)(int); -void(*__sa_sigaction)(int, struct __siginfo *, void *); +void(*__sa_sigaction)(int, siginfo_t *, void *); } __sigaction_u;/* signal handler */ int sa_flags; /* see signal options below */ sigset_t sa_mask; /* signal mask to apply */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gs
On 12 Apr 2010, at 22:05, Luigi Rizzo wrote: > On Mon, Apr 12, 2010 at 10:49:26PM +0200, Pawel Jakub Dawidek wrote: > ... >>> @@ -0,0 +1,19 @@ >>> +# GEOM_LIBRARY_PATH >>> +# $FreeBSD$ >>> + >>> +.PATH: /usr/src/sbin/geom/misc >>> + >>> +CFLAGS += -I/usr/src/sbin/geom >> >> This doesn't look right. > > probably a leftover from older versions of this code for 6.x . > I will do more tests tomorrow (for 7.x at this point, there is > no point in trying to support 6.x I believe) and try to remove > it if not necessary. Even if you need geom/misc, this is not the correct way to include it. M= ${.CURDIR}/../../misc .PATH: ${M} CFLAGS+=-I${M} is probably what you want. There are many people out there (me included) that don't use /usr/src. Regards, -- Rui Paulo ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206550 - head/sbin/geom/class/sched
Author: luigi Date: Tue Apr 13 09:52:42 2010 New Revision: 206550 URL: http://svn.freebsd.org/changeset/base/206550 Log: use correct .PATH, remove unused CFLAGS Modified: head/sbin/geom/class/sched/Makefile Modified: head/sbin/geom/class/sched/Makefile == --- head/sbin/geom/class/sched/Makefile Tue Apr 13 08:56:03 2010 (r206549) +++ head/sbin/geom/class/sched/Makefile Tue Apr 13 09:52:42 2010 (r206550) @@ -1,9 +1,8 @@ # GEOM_LIBRARY_PATH # $FreeBSD$ -.PATH: /usr/src/sbin/geom/misc - -CFLAGS += -I/usr/src/sbin/geom +.PATH: ${.CURDIR}/../../misc +#CFLAGS += -I/usr/src/sbin/geom CLASS=sched ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206551 - head/sys/geom/sched
Author: luigi Date: Tue Apr 13 09:53:08 2010 New Revision: 206551 URL: http://svn.freebsd.org/changeset/base/206551 Log: make code compile with KTR Modified: head/sys/geom/sched/g_sched.c Modified: head/sys/geom/sched/g_sched.c == --- head/sys/geom/sched/g_sched.c Tue Apr 13 09:52:42 2010 (r206550) +++ head/sys/geom/sched/g_sched.c Tue Apr 13 09:53:08 2010 (r206551) @@ -753,13 +753,6 @@ g_gsched_modevent(module_t mod, int cmd, #ifdef KTR #defineTRC_BIO_EVENT(e, bp)g_sched_trace_bio_ ## e (bp) -static inline int -g_sched_issuer_pid(struct bio *bp) -{ - struct thread *thread = g_sched_issuer(bp); - - return (thread->td_tid); -} static inline char g_sched_type(struct bio *bp) @@ -776,7 +769,7 @@ static inline void g_sched_trace_bio_START(struct bio *bp) { - CTR5(KTR_GSCHED, "S %d %c %lu/%lu %lu", g_sched_issuer_pid(bp), + CTR5(KTR_GSCHED, "S %lu %c %lu/%lu %lu", g_sched_classify(bp), g_sched_type(bp), bp->bio_offset / ULONG_MAX, bp->bio_offset, bp->bio_length); } @@ -785,13 +778,13 @@ static inline void g_sched_trace_bio_DONE(struct bio *bp) { - CTR5(KTR_GSCHED, "D %d %c %lu/%lu %lu", g_sched_issuer_pid(bp), + CTR5(KTR_GSCHED, "D %lu %c %lu/%lu %lu", g_sched_classify(bp), g_sched_type(bp), bp->bio_offset / ULONG_MAX, bp->bio_offset, bp->bio_length); } -#else +#else /* !KTR */ #defineTRC_BIO_EVENT(e, bp) -#endif +#endif /* !KTR */ /* * g_sched_done() and g_sched_start() dispatch the geom requests to ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206552 - in head: sbin/geom/class/sched sys/geom/sched
Author: luigi Date: Tue Apr 13 09:56:17 2010 New Revision: 206552 URL: http://svn.freebsd.org/changeset/base/206552 Log: fix copyright format, as requested by Joel Dahl Modified: head/sbin/geom/class/sched/geom_sched.c head/sbin/geom/class/sched/gsched.8 head/sys/geom/sched/g_sched.c head/sys/geom/sched/g_sched.h head/sys/geom/sched/gs_rr.c head/sys/geom/sched/gs_scheduler.h Modified: head/sbin/geom/class/sched/geom_sched.c == --- head/sbin/geom/class/sched/geom_sched.c Tue Apr 13 09:53:08 2010 (r206551) +++ head/sbin/geom/class/sched/geom_sched.c Tue Apr 13 09:56:17 2010 (r206552) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2009 Fabio Checconi, Luigi Rizzo + * Copyright (c) 2009 Fabio Checconi + * Copyright (c) 2010 Luigi Rizzo, Universita` di Pisa * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sbin/geom/class/sched/gsched.8 == --- head/sbin/geom/class/sched/gsched.8 Tue Apr 13 09:53:08 2010 (r206551) +++ head/sbin/geom/class/sched/gsched.8 Tue Apr 13 09:56:17 2010 (r206552) @@ -1,6 +1,6 @@ -.\" Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo +.\" Copyright (c) 2009-2010 Fabio Checconi +.\" Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa .\" All rights reserved. -.\" $FreeBSD$ .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,6 +23,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" +.\" $FreeBSD$ +.\" .Dd April 12, 2010 .Dt GSCHED 8 .Os Modified: head/sys/geom/sched/g_sched.c == --- head/sys/geom/sched/g_sched.c Tue Apr 13 09:53:08 2010 (r206551) +++ head/sys/geom/sched/g_sched.c Tue Apr 13 09:56:17 2010 (r206552) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo + * Copyright (c) 2009-2010 Fabio Checconi + * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/sched/g_sched.h == --- head/sys/geom/sched/g_sched.h Tue Apr 13 09:53:08 2010 (r206551) +++ head/sys/geom/sched/g_sched.h Tue Apr 13 09:56:17 2010 (r206552) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo + * Copyright (c) 2009-2010 Fabio Checconi + * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/sched/gs_rr.c == --- head/sys/geom/sched/gs_rr.c Tue Apr 13 09:53:08 2010(r206551) +++ head/sys/geom/sched/gs_rr.c Tue Apr 13 09:56:17 2010(r206552) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo + * Copyright (c) 2009-2010 Fabio Checconi + * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/sched/gs_scheduler.h == --- head/sys/geom/sched/gs_scheduler.h Tue Apr 13 09:53:08 2010 (r206551) +++ head/sys/geom/sched/gs_scheduler.h Tue Apr 13 09:56:17 2010 (r206552) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo + * Copyright (c) 2009-2010 Fabio Checconi + * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa * All rights reserved. * * Redistribution and use in source and binary forms, with or without ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206553 - in head/sys: amd64/amd64 amd64/ia32 i386/i386
Author: kib Date: Tue Apr 13 10:12:58 2010 New Revision: 206553 URL: http://svn.freebsd.org/changeset/base/206553 Log: Change printf() calls to uprintf() for sigreturn() and trap() complaints about inacessible or wrong mcontext, and for dreaded "kernel trap with interrupts disabled" situation. The later is changed when trap is generated from user mode (shall never be ?). Normalize the messages to include both pid and thread name. MFC after:1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/ia32/ia32_signal.c head/sys/i386/i386/machdep.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/machdep.c == --- head/sys/amd64/amd64/machdep.c Tue Apr 13 09:56:17 2010 (r206552) +++ head/sys/amd64/amd64/machdep.c Tue Apr 13 10:12:58 2010 (r206553) @@ -424,13 +424,14 @@ sigreturn(td, uap) error = copyin(uap->sigcntxp, &uc, sizeof(uc)); if (error != 0) { - printf("sigreturn (pid %d): copyin failed\n", p->p_pid); + uprintf("pid %d (%s): sigreturn copyin failed\n", + p->p_pid, td->td_name); return (error); } ucp = &uc; if ((ucp->uc_mcontext.mc_flags & ~_MC_FLAG_MASK) != 0) { - printf("sigreturn (pid %d): mc_flags %x\n", p->p_pid, - ucp->uc_mcontext.mc_flags); + uprintf("pid %d (%s): sigreturn mc_flags %x\n", p->p_pid, + td->td_name, ucp->uc_mcontext.mc_flags); return (EINVAL); } regs = td->td_frame; @@ -449,8 +450,8 @@ sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(rflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) { - printf("sigreturn (pid %d): rflags = 0x%lx\n", p->p_pid, - rflags); + uprintf("pid %d (%s): sigreturn rflags = 0x%lx\n", p->p_pid, + td->td_name, rflags); return (EINVAL); } @@ -461,7 +462,8 @@ sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("sigreturn (pid %d): cs = 0x%x\n", p->p_pid, cs); + uprintf("pid %d (%s): sigreturn cs = 0x%x\n", p->p_pid, + td->td_name, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; @@ -473,7 +475,8 @@ sigreturn(td, uap) ret = set_fpcontext(td, &ucp->uc_mcontext); if (ret != 0) { - printf("sigreturn (pid %d): set_fpcontext\n", p->p_pid); + uprintf("pid %d (%s): sigreturn set_fpcontext err %d\n", + p->p_pid, td->td_name, ret); return (ret); } bcopy(&ucp->uc_mcontext.mc_rdi, regs, sizeof(*regs)); Modified: head/sys/amd64/amd64/trap.c == --- head/sys/amd64/amd64/trap.c Tue Apr 13 09:56:17 2010(r206552) +++ head/sys/amd64/amd64/trap.c Tue Apr 13 10:12:58 2010(r206553) @@ -303,7 +303,7 @@ trap(struct trapframe *frame) * enabled later. */ if (ISPL(frame->tf_cs) == SEL_UPL) - printf( + uprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curthread->td_name, type); else if (type != T_NMI && type != T_BPTFLT && Modified: head/sys/amd64/ia32/ia32_signal.c == --- head/sys/amd64/ia32/ia32_signal.c Tue Apr 13 09:56:17 2010 (r206552) +++ head/sys/amd64/ia32/ia32_signal.c Tue Apr 13 10:12:58 2010 (r206553) @@ -565,7 +565,8 @@ freebsd4_freebsd32_sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) { - printf("freebsd4_freebsd32_sigreturn: eflags = 0x%x\n", eflags); + uprintf("pid %d (%s): freebsd4_freebsd32_sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); return (EINVAL); } @@ -576,7 +577,8 @@ freebsd4_freebsd32_sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("freebsd4_sigreturn: cs = 0x%x\n", cs); + uprintf("pid %d (%s): freebsd4_sigreturn cs = 0x%x\n", + td->td_proc->p_pid, td->td_name, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; @@ -647,7 +649,8 @@ freebsd32_sigreturn(td, uap) * one less debugge
Re: svn commit: r206553 - in head/sys: amd64/amd64 amd64/ia32 i386/i386
On Tue, Apr 13, 2010 at 10:12:58AM +, Konstantin Belousov wrote: > Author: kib > Date: Tue Apr 13 10:12:58 2010 > New Revision: 206553 > URL: http://svn.freebsd.org/changeset/base/206553 > > Log: > Change printf() calls to uprintf() for sigreturn() and trap() complaints > about inacessible or wrong mcontext, and for dreaded "kernel trap with > interrupts disabled" situation. The later is changed when trap is > generated from user mode (shall never be ?). > > Normalize the messages to include both pid and thread name. > > MFC after: 1 week I think that printfs from sigreturn should be changed to signal delivery or even a call to trap_fatal(), but this is for other commit. Anyway, the current situation where messages could be found in daily periodic run (sigreturn pid 23334: cs=0x, so what ? pid is long time gone) is not very useful for noting the issue. pgpriHZZQhAIc.pgp Description: PGP signature
svn commit: r206555 - head/sys/dev/aac
Author: emaste Date: Tue Apr 13 12:10:55 2010 New Revision: 206555 URL: http://svn.freebsd.org/changeset/base/206555 Log: Use enums in the aac_command_status_table rather than duplicating the same values in two places. Suggested by: Garrett Cooper Modified: head/sys/dev/aac/aac_tables.h Modified: head/sys/dev/aac/aac_tables.h == --- head/sys/dev/aac/aac_tables.h Tue Apr 13 10:23:03 2010 (r206554) +++ head/sys/dev/aac/aac_tables.h Tue Apr 13 12:10:55 2010 (r206555) @@ -34,42 +34,42 @@ * relevant only to FSA operations. */ static struct aac_code_lookup aac_command_status_table[] = { - {"OK", 0}, - {"operation not permitted", 1}, - {"not found", 2}, - {"I/O error", 5}, - {"device not configured", 6}, - {"too big", 7}, - {"permission denied", 13}, - {"file exists", 17}, - {"cross-device link", 18}, - {"operation not supported by device", 19}, - {"not a directory", 20}, - {"is a directory", 21}, - {"invalid argument",22}, - {"file too large", 27}, - {"no space on device", 28}, - {"readonly filesystem", 30}, - {"too many links", 31}, - {"operation would block", 35}, - {"file name too long", 63}, - {"directory not empty", 66}, - {"quota exceeded", 69}, - {"stale file handle", 70}, - {"too many levels of remote in path", 71}, - {"device busy (spinning up)", 72}, - {"bad file handle", 10001}, - {"not sync",10002}, - {"bad cookie", 10003}, - {"operation not supported", 10004}, - {"too small", 10005}, - {"server fault",10006}, - {"bad type",10007}, - {"jukebox", 10008}, - {"not mounted", 10009}, - {"in maintenance mode", 10010}, - {"stale ACL", 10011}, - {"bus reset - command aborted", 20001}, + {"OK", ST_OK}, + {"operation not permitted", ST_PERM}, + {"not found", ST_NOENT}, + {"I/O error", ST_IO}, + {"device not configured", ST_NXIO}, + {"too big", ST_E2BIG}, + {"permission denied", ST_ACCES}, + {"file exists", ST_EXIST}, + {"cross-device link", ST_XDEV}, + {"operation not supported by device", ST_NODEV}, + {"not a directory", ST_NOTDIR}, + {"is a directory", ST_ISDIR}, + {"invalid argument",ST_INVAL}, + {"file too large", ST_FBIG}, + {"no space on device", ST_NOSPC}, + {"readonly filesystem", ST_ROFS}, + {"too many links", ST_MLINK}, + {"operation would block", ST_WOULDBLOCK}, + {"file name too long", ST_NAMETOOLONG}, + {"directory not empty", ST_NOTEMPTY}, + {"quota exceeded", ST_DQUOT}, + {"stale file handle", ST_STALE}, + {"too many levels of remote in path", ST_REMOTE}, + {"device busy (spinning up)", ST_NOT_READY}, + {"bad file handle", ST_BADHANDLE}, + {"not sync",ST_NOT_SYNC}, + {"bad cookie", ST_BAD_COOKIE}, + {"operation not supported", ST_NOTSUPP}, + {"too small", ST_TOOSMALL}, + {"server fault",ST_SERVERFAULT}, + {"bad type",ST_BADTYPE}, + {"jukebox", ST_JUKEBOX}, + {"not mounted", ST_NOTMOUNTED}, + {"in maintenance mode", ST_MAINTMODE}, + {"stale ACL", ST_STALEACL}, + {"bus reset - command aborted", ST_BUS_RESET}, {NULL, 0}, {"unknown command status", 0} }; ___ svn-src-head@freebs
svn commit: r206556 - head/sys/ia64/include
Author: marcel Date: Tue Apr 13 15:51:25 2010 New Revision: 206556 URL: http://svn.freebsd.org/changeset/base/206556 Log: o s/u_int64_t/uint64_t/g o style(9) fixes. Modified: head/sys/ia64/include/pal.h Modified: head/sys/ia64/include/pal.h == --- head/sys/ia64/include/pal.h Tue Apr 13 12:10:55 2010(r206555) +++ head/sys/ia64/include/pal.h Tue Apr 13 15:51:25 2010(r206556) @@ -108,20 +108,19 @@ struct ia64_pal_result { int64_t pal_status; - u_int64_t pal_result[3]; + uint64_tpal_result[3]; }; -extern struct ia64_pal_result - ia64_call_pal_static(u_int64_t proc, u_int64_t arg1, -u_int64_t arg2, u_int64_t arg3); -extern struct ia64_pal_result - ia64_call_pal_static_physical(u_int64_t proc, u_int64_t arg1, - u_int64_t arg2, u_int64_t arg3); -extern struct ia64_pal_result - ia64_call_pal_stacked(u_int64_t proc, u_int64_t arg1, - u_int64_t arg2, u_int64_t arg3); -extern struct ia64_pal_result - ia64_call_pal_stacked_physical(u_int64_t proc, u_int64_t arg1, - u_int64_t arg2, u_int64_t arg3); +struct ia64_pal_result ia64_call_pal_static(uint64_t proc, uint64_t arg1, +uint64_t arg2, uint64_t arg3); + +struct ia64_pal_result ia64_call_pal_static_physical(uint64_t proc, +uint64_t arg1, uint64_t arg2, uint64_t arg3); + +struct ia64_pal_result ia64_call_pal_stacked(uint64_t proc, uint64_t arg1, +uint64_t arg2, uint64_t arg3); + +struct ia64_pal_result ia64_call_pal_stacked_physical(uint64_t proc, +uint64_t arg1, uint64_t arg2, uint64_t arg3); #endif /* _MACHINE_PAL_H_ */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206557 - head/share/man/man5
Author: ume Date: Tue Apr 13 15:53:04 2010 New Revision: 206557 URL: http://svn.freebsd.org/changeset/base/206557 Log: Nuke the descriptions about ipv6_firewall_* as they were unified into firewall_*. MFC after:3 days Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 == --- head/share/man/man5/rc.conf.5 Tue Apr 13 15:51:25 2010 (r206556) +++ head/share/man/man5/rc.conf.5 Tue Apr 13 15:53:04 2010 (r206557) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 09, 2010 +.Dd April 14, 2010 .Dt RC.CONF 5 .Os .Sh NAME @@ -427,27 +427,11 @@ the kernel module will be loaded. See also .Va ipfilter_enable . -.It Va ipv6_firewall_enable -.Pq Vt bool -The IPv6 equivalent of -.Va firewall_enable . -Set to -.Dq Li YES -to load IPv6 firewall rules at startup. -If the kernel was not built with -.Cd "options IPV6FIREWALL" , -the -.Pa ipfw.ko -kernel module will be loaded. .It Va firewall_script .Pq Vt str This variable specifies the full path to the firewall script to run. The default is .Pa /etc/rc.firewall . -.It Va ipv6_firewall_script -.Pq Vt str -The IPv6 equivalent of -.Va firewall_script . .It Va firewall_type .Pq Vt str Names the firewall type from the selection in @@ -471,19 +455,11 @@ basic protection for a LAN. .Pp If a filename is specified, the full path must be given. -.It Va ipv6_firewall_type -.Pq Vt str -The IPv6 equivalent of -.Va firewall_type . .It Va firewall_quiet .Pq Vt bool Set to .Dq Li YES to disable the display of firewall rules on the console during boot. -.It Va ipv6_firewall_quiet -.Pq Vt bool -The IPv6 equivalent of -.Va firewall_quiet . .It Va firewall_logging .Pq Vt bool Set to @@ -492,10 +468,6 @@ to enable firewall event logging. This is equivalent to the .Dv IPFIREWALL_VERBOSE kernel option. -.It Va ipv6_firewall_logging -.Pq Vt bool -The IPv6 equivalent of -.Va firewall_logging . .It Va firewall_flags .Pq Vt str Flags passed to @@ -503,10 +475,6 @@ Flags passed to if .Va firewall_type specifies a filename. -.It Va ipv6_firewall_flags -.Pq Vt str -The IPv6 equivalent of -.Va firewall_flags . .It Va firewall_coscripts .Pq Vt str List of executables and/or rc scripts to run after firewall starts/stops. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206558 - head/sys/ia64/ia64
Author: marcel Date: Tue Apr 13 15:55:18 2010 New Revision: 206558 URL: http://svn.freebsd.org/changeset/base/206558 Log: Change the (generic) argument to ia64_store_mca_state() from the cpuid to the struct pcpu of the CPU. We casting between pointer types only then. Modified: head/sys/ia64/ia64/mp_machdep.c Modified: head/sys/ia64/ia64/mp_machdep.c == --- head/sys/ia64/ia64/mp_machdep.c Tue Apr 13 15:53:04 2010 (r206557) +++ head/sys/ia64/ia64/mp_machdep.c Tue Apr 13 15:55:18 2010 (r206558) @@ -152,13 +152,15 @@ cpu_topo(void) static void ia64_store_mca_state(void* arg) { - unsigned int ncpu = (unsigned int)(uintptr_t)arg; - struct thread* td; + struct pcpu *pc = arg; + struct thread *td = curthread; - /* ia64_mca_save_state() is CPU-sensitive, so bind ourself to our target CPU */ - td = curthread; + /* +* ia64_mca_save_state() is CPU-sensitive, so bind ourself to our +* target CPU. +*/ thread_lock(td); - sched_bind(td, ncpu); + sched_bind(td, pc->pc_cpuid); thread_unlock(td); /* @@ -362,8 +364,7 @@ cpu_mp_unleash(void *dummy) SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { cpus++; if (pc->pc_md.awake) { - kproc_create(ia64_store_mca_state, - (void*)((uintptr_t)pc->pc_cpuid), NULL, 0, 0, + kproc_create(ia64_store_mca_state, pc, NULL, 0, 0, "mca %u", pc->pc_cpuid); smp_cpus++; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206560 - head/sys/fs/devfs
Author: jh Date: Tue Apr 13 18:53:39 2010 New Revision: 206560 URL: http://svn.freebsd.org/changeset/base/206560 Log: - Ignore and report duplicate and empty device names in devfs_populate_loop() instead of causing erratic behavior. Currently make_dev(9) can't fail, so there is no way to report an error to make_dev(9) callers. - Disallow using "." and ".." in device path names. It didn't work previously but now it is reported rather than panicing. - Treat multiple sequential slashes as single in device path names. Discussed with: pjd Modified: head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_int.h Modified: head/sys/fs/devfs/devfs_devs.c == --- head/sys/fs/devfs/devfs_devs.c Tue Apr 13 18:46:18 2010 (r206559) +++ head/sys/fs/devfs/devfs_devs.c Tue Apr 13 18:53:39 2010 (r206560) @@ -408,6 +408,9 @@ devfs_populate_loop(struct devfs_mount * continue; KASSERT((cdp->cdp_flags & CDP_ACTIVE), ("Bogons, I tell ya'!")); + if (cdp->cdp_flags & CDP_INVALID) + continue; + if (dm->dm_idx <= cdp->cdp_maxdirent && cdp->cdp_dirents[dm->dm_idx] != NULL) { de = cdp->cdp_dirents[dm->dm_idx]; @@ -425,6 +428,8 @@ devfs_populate_loop(struct devfs_mount * dd = dm->dm_rootdir; s = cdp->cdp_c.si_name; for (;;) { + while (*s == '/') + s++; for (q = s; *q != '/' && *q != '\0'; q++) continue; if (*q != '/') @@ -434,6 +439,24 @@ devfs_populate_loop(struct devfs_mount * de = devfs_vmkdir(dm, s, q - s, dd, 0); s = q + 1; dd = de; + if (dd->de_flags & (DE_DOT | DE_DOTDOT)) + break; + } + + /* +* XXX: Ignore duplicate and empty device names. +* XXX: Currently there is no way to report the error to +* XXX: the make_dev(9) caller. +*/ + if (dd->de_dirent->d_type != DT_DIR || + dd->de_flags & (DE_DOT | DE_DOTDOT) || q - s < 1 || + devfs_find(dd, s, q - s) != NULL) { + dev_lock(); + cdp->cdp_flags |= CDP_INVALID; + dev_unlock(); + printf("%s: %s: invalid or duplicate device name\n", + __func__, cdp->cdp_c.si_name); + return (1); } de = devfs_newdirent(s, q - s); Modified: head/sys/fs/devfs/devfs_int.h == --- head/sys/fs/devfs/devfs_int.h Tue Apr 13 18:46:18 2010 (r206559) +++ head/sys/fs/devfs/devfs_int.h Tue Apr 13 18:53:39 2010 (r206560) @@ -55,6 +55,7 @@ struct cdev_priv { u_int cdp_flags; #define CDP_ACTIVE (1 << 0) #define CDP_SCHED_DTR (1 << 1) +#define CDP_INVALID(1 << 2) u_int cdp_inuse; u_int cdp_maxdirent; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gs
you dont seem to have commited the anticipatory scheduler gsched_as. why? On Mon, Apr 12, 2010 at 04:37:45PM +, Luigi Rizzo wrote: > Author: luigi > Date: Mon Apr 12 16:37:45 2010 > New Revision: 206497 > URL: http://svn.freebsd.org/changeset/base/206497 > > Log: > Bring in geom_sched, support for scheduling disk I/O requests > in a device independent manner. Also include an example anticipatory > scheduler, gsched_rr, which gives very nice performance improvements > in presence of competing random access patterns. > > This is joint work with Fabio Checconi, developed last year > and presented at BSDCan 2009. You can find details in the > README file or at > > http://info.iet.unipi.it/~luigi/geom_sched/ > > Added: > head/sbin/geom/class/sched/ > head/sbin/geom/class/sched/Makefile (contents, props changed) > head/sbin/geom/class/sched/geom_sched.c (contents, props changed) > head/sbin/geom/class/sched/gsched.8 (contents, props changed) > head/sys/geom/sched/ > head/sys/geom/sched/README (contents, props changed) > head/sys/geom/sched/g_sched.c (contents, props changed) > head/sys/geom/sched/g_sched.h (contents, props changed) > head/sys/geom/sched/gs_rr.c (contents, props changed) > head/sys/geom/sched/gs_scheduler.h (contents, props changed) > head/sys/geom/sched/subr_disk.c (contents, props changed) > head/sys/modules/geom/geom_sched/ > head/sys/modules/geom/geom_sched/Makefile (contents, props changed) > head/sys/modules/geom/geom_sched/Makefile.inc (contents, props changed) > head/sys/modules/geom/geom_sched/gs_sched/ > head/sys/modules/geom/geom_sched/gs_sched/Makefile (contents, props > changed) > head/sys/modules/geom/geom_sched/gsched_rr/ > head/sys/modules/geom/geom_sched/gsched_rr/Makefile (contents, props > changed) > Modified: > head/sbin/geom/class/Makefile > head/sys/modules/geom/Makefile > > Modified: head/sbin/geom/class/Makefile > == > --- head/sbin/geom/class/Makefile Mon Apr 12 13:46:20 2010 > (r206496) > +++ head/sbin/geom/class/Makefile Mon Apr 12 16:37:45 2010 > (r206497) > @@ -15,6 +15,7 @@ SUBDIR+=multipath > SUBDIR+=nop > SUBDIR+=part > SUBDIR+=raid3 > +SUBDIR+=sched > SUBDIR+=shsec > SUBDIR+=stripe > SUBDIR+=virstor > > Added: head/sbin/geom/class/sched/Makefile > == > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/geom/class/sched/Makefile Mon Apr 12 16:37:45 2010 > (r206497) > @@ -0,0 +1,19 @@ > +# GEOM_LIBRARY_PATH > +# $FreeBSD$ > + > +.PATH: /usr/src/sbin/geom/misc > + > +CFLAGS += -I/usr/src/sbin/geom > + > +CLASS=sched > + > +WARNS?= 6 > +CLASS_DIR?=/lib/geom > + > +SHLIBDIR?=${CLASS_DIR} > +SHLIB_NAME?=geom_${CLASS}.so > +LINKS= ${BINDIR}/geom ${BINDIR}/g${CLASS} > +MAN=g${CLASS}.8 > +SRCS+= geom_${CLASS}.c subr.c > + > +.include > > Added: head/sbin/geom/class/sched/geom_sched.c > == > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/geom/class/sched/geom_sched.c Mon Apr 12 16:37:45 2010 > (r206497) > @@ -0,0 +1,123 @@ > +/*- > + * Copyright (c) 2009 Fabio Checconi, Luigi Rizzo > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + *notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + *notice, this list of conditions and the following disclaimer in the > + *documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +/* > + * $Id$ > + * $FreeBSD$ > + * > + * This file implements the userspace library used by the 'geom' > + * command to load and manipulate disk schedulers. > + */ > + > +#inclu
Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gs
On Tue, Apr 13, 2010 at 09:35:00PM +0200, Roman Divacky wrote: > you dont seem to have commited the anticipatory scheduler gsched_as. > > why? gsched_rr has anticipation too, and is the "production quality" one, so i only included that one in the svn repository. You can find other schedulers in the tarball on the web page, but gsched_as is only a proof of concept, and others need more debugging and cleanup before being imported. cheers luigi ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206563 - head/sys/dev/mii
Author: yongari Date: Tue Apr 13 20:07:52 2010 New Revision: 206563 URL: http://svn.freebsd.org/changeset/base/206563 Log: Add Agere ET1011 PHY which is found on Belkin F5D5055 USB controller. Unlike Agere ET1011C, Agere ET1011 does not seem to need special DSP programming to workaround silicon bug. Modified: head/sys/dev/mii/miidevs head/sys/dev/mii/truephy.c Modified: head/sys/dev/mii/miidevs == --- head/sys/dev/mii/miidevsTue Apr 13 19:58:32 2010(r206562) +++ head/sys/dev/mii/miidevsTue Apr 13 20:07:52 2010(r206563) @@ -102,6 +102,7 @@ oui xxREALTEK 0x000732 */ /* Agere Systems PHYs */ +model AGERE ET1011 0x0001 ET1011 10/100/1000baseT PHY model AGERE ET1011C0x0004 ET1011C 10/100/1000baseT PHY /* Altima Communications PHYs */ Modified: head/sys/dev/mii/truephy.c == --- head/sys/dev/mii/truephy.c Tue Apr 13 19:58:32 2010(r206562) +++ head/sys/dev/mii/truephy.c Tue Apr 13 20:07:52 2010(r206563) @@ -76,6 +76,7 @@ static device_method_t truephy_methods[] }; static const struct mii_phydesc truephys[] = { + MII_PHY_DESC(AGERE, ET1011), MII_PHY_DESC(AGERE, ET1011C), MII_PHY_END }; @@ -161,7 +162,10 @@ truephy_attach(device_t dev) mii->mii_instance++; - truephy_reset(sc); + if (MII_MODEL(ma->mii_id2) == MII_MODEL_AGERE_ET1011) + mii_phy_reset(sc); + else + truephy_reset(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206568 - head/usr.bin/calendar/calendars
Author: edwin Date: Tue Apr 13 20:50:59 2010 New Revision: 206568 URL: http://svn.freebsd.org/changeset/base/206568 Log: Allerheilingen -> Allerheiligen Submitted by: Ronald Klop Modified: head/usr.bin/calendar/calendars/calendar.dutch Modified: head/usr.bin/calendar/calendars/calendar.dutch == --- head/usr.bin/calendar/calendars/calendar.dutch Tue Apr 13 20:47:11 2010(r206567) +++ head/usr.bin/calendar/calendars/calendar.dutch Tue Apr 13 20:50:59 2010(r206568) @@ -18,7 +18,7 @@ mei/01Dag van de Arbeid mei/04 Dodenherdenking mei/05 Bevrijdingsdag okt/04 Dierendag -nov/01 Allerheilingen +nov/01 Allerheiligen nov/02 Allerzielen nov/11 Sint Maarten nov/11 Elfde-van-de-elfde ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206569 - in head/sys/modules: . uart
Author: imp Date: Tue Apr 13 21:32:06 2010 New Revision: 206569 URL: http://svn.freebsd.org/changeset/base/206569 Log: Only compile in uart_cpu_$MACHINE.c if it exists. I'm not sure how useful it will be, but we really need to be keying off something other than MACHINE for this anyway since on arm and mips we have lots of these running around (one for each SoC family)... Modified: head/sys/modules/Makefile head/sys/modules/uart/Makefile Modified: head/sys/modules/Makefile == --- head/sys/modules/Makefile Tue Apr 13 20:50:59 2010(r206568) +++ head/sys/modules/Makefile Tue Apr 13 21:32:06 2010(r206569) @@ -280,7 +280,7 @@ SUBDIR= ${_3dfx} \ twe \ tx \ txp \ - ${_uart} \ + uart \ ubsec \ udf \ udf_iconv \ @@ -323,8 +323,6 @@ _vpo= vpo # no BUS_SPACE_UNSPECIFIED # No barrier instruction support (specific to this driver) _sym= sym -# no uart_cpu_$MACHINE_ARCH -_uart= uart # intr_disable() is a macro, causes problems _cxgb= cxgb .endif Modified: head/sys/modules/uart/Makefile == --- head/sys/modules/uart/Makefile Tue Apr 13 20:50:59 2010 (r206568) +++ head/sys/modules/uart/Makefile Tue Apr 13 21:32:06 2010 (r206569) @@ -16,7 +16,7 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} u uart_if.c uart_if.h uart_subr.c uart_tty.c .if ${MACHINE} == "sun4v" SRCS+= uart_cpu_sparc64.c -.else +.elif exists(${CURDIR}/uart_cpu_${MACHINE}.c) SRCS+= uart_cpu_${MACHINE}.c .endif SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206570 - in head/sys/ia64: ia64 include
Author: marcel Date: Tue Apr 13 22:20:12 2010 New Revision: 206570 URL: http://svn.freebsd.org/changeset/base/206570 Log: Populate the sysctl tree with any MCA records we collected. The sequence number is used as the name of a sysctl node, under which we add the MCA records using the CPU id as the leaf name. Add the hw.mca.inject sysctl to provide a way to inject MC errors and trigger machine checks. PR: ia64/113102 Modified: head/sys/ia64/ia64/mca.c head/sys/ia64/include/mca.h Modified: head/sys/ia64/ia64/mca.c == --- head/sys/ia64/ia64/mca.cTue Apr 13 21:32:06 2010(r206569) +++ head/sys/ia64/ia64/mca.cTue Apr 13 22:20:12 2010(r206570) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 Marcel Moolenaar + * Copyright (c) 2002-2010 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -44,19 +45,19 @@ MALLOC_DEFINE(M_MCA, "MCA", "Machine Che struct mca_info { STAILQ_ENTRY(mca_info) mi_link; - charmi_name[32]; + u_long mi_seqnr; + u_int mi_cpuid; size_t mi_recsz; charmi_record[0]; }; -static STAILQ_HEAD(, mca_info) mca_records = -STAILQ_HEAD_INITIALIZER(mca_records); +STAILQ_HEAD(mca_info_list, mca_info); -int64_tmca_info_size[SAL_INFO_TYPES]; -vm_offset_tmca_info_block; -struct mtx mca_info_block_lock; +static int64_t mca_info_size[SAL_INFO_TYPES]; +static vm_offset_t mca_info_block; +static struct mtx mca_info_block_lock; -SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RW, 0, "MCA container"); +SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RW, NULL, "MCA container"); static int mca_count; /* Number of records stored. */ static int mca_first; /* First (lowest) record ID. */ @@ -69,6 +70,32 @@ SYSCTL_INT(_hw_mca, OID_AUTO, first, CTL SYSCTL_INT(_hw_mca, OID_AUTO, last, CTLFLAG_RD, &mca_last, 0, "Last record id"); +static struct mtx mca_sysctl_lock; + +static int +mca_sysctl_inject(SYSCTL_HANDLER_ARGS) +{ + struct ia64_pal_result res; + u_int val; + int error; + + val = 0; + error = sysctl_wire_old_buffer(req, sizeof(u_int)); + if (!error) + error = sysctl_handle_int(oidp, &val, 0, req); + + if (error != 0 || req->newptr == NULL) + return (error); + + /* For example: val=137 causes a fatal CPU error. */ + res = ia64_call_pal_stacked(PAL_MC_ERROR_INJECT, val, 0, 0); + printf("%s: %#lx, %#lx, %#lx, %#lx\n", __func__, res.pal_status, + res.pal_result[0], res.pal_result[1], res.pal_result[2]); + return (0); +} +SYSCTL_PROC(_hw_mca, OID_AUTO, inject, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, +mca_sysctl_inject, "I", "set to trigger a MCA"); + static int mca_sysctl_handler(SYSCTL_HANDLER_ARGS) { @@ -85,27 +112,8 @@ mca_sysctl_handler(SYSCTL_HANDLER_ARGS) return (error); } -void -ia64_mca_populate(void) -{ - struct mca_info *rec; - - mtx_lock_spin(&mca_info_block_lock); - while (!STAILQ_EMPTY(&mca_records)) { - rec = STAILQ_FIRST(&mca_records); - STAILQ_REMOVE_HEAD(&mca_records, mi_link); - mtx_unlock_spin(&mca_info_block_lock); - (void)SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), - OID_AUTO, rec->mi_name, CTLTYPE_OPAQUE | CTLFLAG_RD, - rec->mi_record, rec->mi_recsz, mca_sysctl_handler, "S,MCA", - "Error record"); - mtx_lock_spin(&mca_info_block_lock); - } - mtx_unlock_spin(&mca_info_block_lock); -} - -void -ia64_mca_save_state(int type) +static void +ia64_mca_collect_state(int type, struct mca_info_list *reclst) { struct ia64_sal_result result; struct mca_record_header *hdr; @@ -123,13 +131,13 @@ ia64_mca_save_state(int type) if (mca_info_block == 0) return; - mtx_lock_spin(&mca_info_block_lock); while (1) { + mtx_lock_spin(&mca_info_block_lock); result = ia64_sal_entry(SAL_GET_STATE_INFO, type, 0, mca_info_block, 0, 0, 0, 0); if (result.sal_status < 0) { mtx_unlock_spin(&mca_info_block_lock); - return; + break; } hdr = (struct mca_record_header *)mca_info_block; @@ -142,9 +150,10 @@ ia64_mca_save_state(int type) M_NOWAIT | M_ZERO); if (rec == NULL) /* XXX: Not sure what to do. */ - return; + break; - sprintf(rec->mi_name, "%lld", (long long)seqnr); + rec->mi_seqnr = seqnr; +
svn commit: r206571 - head/sbin/mca
Author: marcel Date: Tue Apr 13 22:27:39 2010 New Revision: 206571 URL: http://svn.freebsd.org/changeset/base/206571 Log: The sequence number is now a node under which the MCA records are hung by CPU id. When showing the MCA record, print the MIB as a comment. PR: ia64/113102 Modified: head/sbin/mca/mca.c Modified: head/sbin/mca/mca.c == --- head/sbin/mca/mca.c Tue Apr 13 22:20:12 2010(r206570) +++ head/sbin/mca/mca.c Tue Apr 13 22:27:39 2010(r206571) @@ -53,10 +53,12 @@ __FBSDID("$FreeBSD$"); #defineBCD(x) ((x >> 4) * 10 + (x & 15)) +#defineHW_MCA_MAX_CPUID255 + static char hw_mca_count[] = "hw.mca.count"; static char hw_mca_first[] = "hw.mca.first"; static char hw_mca_last[] = "hw.mca.last"; -static char hw_mca_recid[] = "hw.mca.%d"; +static char hw_mca_recid[] = "hw.mca.%lu.%u"; static char default_dumpfile[] = "/var/log/mca.log"; @@ -372,10 +374,13 @@ show_section(struct mca_section_header * } static void -show(char *data) +show(char *data, const char *mib) { size_t reclen, seclen; + if (mib != NULL) + printf("\n", mib); + printf("\n"); reclen = show_header((void*)data) - sizeof(struct mca_record_header); data += sizeof(struct mca_record_header); @@ -402,7 +407,7 @@ showall(char *buf, size_t buflen) if (buflen < reclen) return; - show(buf); + show(buf, NULL); buf += reclen; buflen -= reclen; @@ -442,7 +447,7 @@ main(int argc, char **argv) char *buf; size_t len; int ch, error, fd; - int count, first, last; + int count, first, last, cpuid; while ((ch = getopt(argc, argv, "df:")) != -1) { switch(ch) { @@ -481,12 +486,19 @@ main(int argc, char **argv) if (error) err(1, hw_mca_last); + cpuid = 0; while (count && first <= last) { - sprintf(mib, hw_mca_recid, first); - len = 0; - error = sysctlbyname(mib, NULL, &len, NULL, 0); - if (error == ENOENT) { + do { + sprintf(mib, hw_mca_recid, first, cpuid); + len = 0; + error = sysctlbyname(mib, NULL, &len, NULL, 0); + if (error != ENOENT) + break; + cpuid++; + } while (cpuid <= HW_MCA_MAX_CPUID); + if (error == ENOENT && cpuid > HW_MCA_MAX_CPUID) { first++; + cpuid = 0; continue; } if (error) @@ -503,11 +515,15 @@ main(int argc, char **argv) if (fl_dump) dump(buf); else - show(buf); + show(buf, mib); free(buf); - first++; count--; + if (cpuid == HW_MCA_MAX_CPUID) { + first++; + cpuid = 0; + } else + cpuid++; } } else { fd = open(file, O_RDONLY); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206582 - head/sys/mips/mips
Author: neel Date: Wed Apr 14 01:29:31 2010 New Revision: 206582 URL: http://svn.freebsd.org/changeset/base/206582 Log: Revert the vm_machdep.c part of r205072. This causes a panic in vm_thread_dispose() when it tries to add this kstack to the kstack cache. This happens only when 'td_kstack' is not (PAGE_SIZE * 2) bytes aligned and we have unmapped the page at that address in cpu_thread_alloc. Pointed out by: nwhitehorn@ Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c == --- head/sys/mips/mips/vm_machdep.c Wed Apr 14 01:24:09 2010 (r206581) +++ head/sys/mips/mips/vm_machdep.c Wed Apr 14 01:29:31 2010 (r206582) @@ -214,16 +214,6 @@ cpu_thread_swapin(struct thread *td) { pt_entry_t *pte; int i; - vm_offset_t unused_kstack_page; - - /* -* Unmap the unused kstack page. -*/ - unused_kstack_page = td->td_kstack; - if (td->td_md.md_realstack == td->td_kstack) - unused_kstack_page += (KSTACK_PAGES - 1) * PAGE_SIZE; - - pmap_kremove(unused_kstack_page); /* * The kstack may be at a different physical address now. @@ -249,19 +239,13 @@ cpu_thread_swapout(struct thread *td) void cpu_thread_alloc(struct thread *td) { - vm_offset_t unused_kstack_page; pt_entry_t *pte; int i; - if (td->td_kstack & (1 << PAGE_SHIFT)) { + if (td->td_kstack & (1 << PAGE_SHIFT)) td->td_md.md_realstack = td->td_kstack + PAGE_SIZE; - unused_kstack_page = td->td_kstack; - } else { + else td->td_md.md_realstack = td->td_kstack; - unused_kstack_page = td->td_kstack + - (KSTACK_PAGES - 1) * PAGE_SIZE; - } - pmap_kremove(unused_kstack_page); td->td_pcb = (struct pcb *)(td->td_md.md_realstack + (td->td_kstack_pages - 1) * PAGE_SIZE) - 1; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r206584 - head/sys/mips/mips
Author: neel Date: Wed Apr 14 01:57:53 2010 New Revision: 206584 URL: http://svn.freebsd.org/changeset/base/206584 Log: Destroy the pmap 'pm_mutex' in pmap_release() otherwise we will panic subsequently in pmap_pinit() with the following signature: panic: lock "pmap" 0xc7878bc8 already initialized This bug was uncovered by the changes made to vm_map.c in r206140. Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c == --- head/sys/mips/mips/pmap.c Wed Apr 14 01:43:25 2010(r206583) +++ head/sys/mips/mips/pmap.c Wed Apr 14 01:57:53 2010(r206584) @@ -1263,6 +1263,7 @@ pmap_release(pmap_t pmap) ptdpg->wire_count--; atomic_subtract_int(&cnt.v_wire_count, 1); vm_page_free_zero(ptdpg); + PMAP_LOCK_DESTROY(pmap); } /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"