svn commit: r242511 - head/sbin/fsck_msdosfs
Author: jh Date: Sat Nov 3 09:18:37 2012 New Revision: 242511 URL: http://svn.freebsd.org/changeset/base/242511 Log: Print a newline after the error message. PR: bin/168447 Submitted by: Boris Kochergin Modified: head/sbin/fsck_msdosfs/check.c Modified: head/sbin/fsck_msdosfs/check.c == --- head/sbin/fsck_msdosfs/check.c Sat Nov 3 04:56:08 2012 (r242510) +++ head/sbin/fsck_msdosfs/check.c Sat Nov 3 09:18:37 2012 (r242511) @@ -68,6 +68,7 @@ checkfilesys(const char *fname) if (dosfs < 0) { perr("Can't open `%s'", fname); + printf("\n"); return 8; } ___ 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: r242512 - head/lib/libc/net
Author: tuexen Date: Sat Nov 3 13:22:25 2012 New Revision: 242512 URL: http://svn.freebsd.org/changeset/base/242512 Log: Fix errno in a couple of error cases. MFC after: 3 days Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c == --- head/lib/libc/net/sctp_sys_calls.c Sat Nov 3 09:18:37 2012 (r242511) +++ head/lib/libc/net/sctp_sys_calls.c Sat Nov 3 13:22:25 2012 (r242512) @@ -449,6 +449,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, opt_len = (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { + errno = ENOMEM; return (-1); } addrs->sget_assoc_id = id; @@ -777,6 +778,7 @@ sctp_sendx(int sd, const void *msg, size } buf = malloc(len); if (buf == NULL) { + errno = ENOMEM; return (-1); } aa = (int *)buf; @@ -1052,7 +1054,7 @@ sctp_sendv(int sd, CMSG_SPACE(sizeof(struct sctp_authinfo)) + (size_t)addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); if (cmsgbuf == NULL) { - errno = ENOBUFS; + errno = ENOMEM; return (-1); } msg.msg_control = cmsgbuf; ___ 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: r242514 - in head: etc/root share/skel
Author: eadler Date: Sat Nov 3 14:46:15 2012 New Revision: 242514 URL: http://svn.freebsd.org/changeset/base/242514 Log: Revert the change that makes less default. Since I've committed this I've receieved roughly an equal amount of email thanking me for making this change and asking me to revert it. I've resisted making this change because new users tend to prefer less over more and these users are the least likely to know how to change the PAGER on their own. Requested by: many Objected to: just as many Decision made by: core Approved by: cperciva MFC after:3 days Modified: head/etc/root/dot.cshrc head/share/skel/dot.cshrc Modified: head/etc/root/dot.cshrc == --- head/etc/root/dot.cshrc Sat Nov 3 13:29:18 2012(r242513) +++ head/etc/root/dot.cshrc Sat Nov 3 14:46:15 2012(r242514) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then Modified: head/share/skel/dot.cshrc == --- head/share/skel/dot.cshrc Sat Nov 3 13:29:18 2012(r242513) +++ head/share/skel/dot.cshrc Sat Nov 3 14:46:15 2012(r242514) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then ___ 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: r242515 - in head/sys: kern sys
Author: attilio Date: Sat Nov 3 15:57:37 2012 New Revision: 242515 URL: http://svn.freebsd.org/changeset/base/242515 Log: Merge r242395,242483 from mutex implementation: give rwlock(9) the ability to crunch different type of structures, with the only constraint that they have a lock cookie named rw_lock. This name, then, becames reserved from the struct that wants to use the rwlock(9) KPI and other locking primitives cannot reuse it for their members. Namely such structs are the current struct rwlock and the new struct rwlock_padalign. The new structure will define an object which has the same layout of a struct rwlock but will be allocated in areas aligned to the cache line size and will be as big as a cache line. For further details check comments on above mentioned revisions. Reviewed by: jimharris, jeff Modified: head/sys/kern/kern_rwlock.c head/sys/sys/_rwlock.h head/sys/sys/rwlock.h Modified: head/sys/kern/kern_rwlock.c == --- head/sys/kern/kern_rwlock.c Sat Nov 3 14:46:15 2012(r242514) +++ head/sys/kern/kern_rwlock.c Sat Nov 3 15:57:37 2012(r242515) @@ -61,6 +61,12 @@ __FBSDID("$FreeBSD$"); PMC_SOFT_DECLARE( , , lock, failed); #endif +/* + * Return the rwlock address when the lock cookie address is provided. + * This functionality assumes that struct rwlock* have a member named rw_lock. + */ +#definerwlock2rw(c)(__containerof(c, struct rwlock, rw_lock)) + #ifdef ADAPTIVE_RWLOCKS static int rowner_retries = 10; static int rowner_loops = 1; @@ -123,7 +129,7 @@ struct lock_class lock_class_rw = { #definerw_owner(rw)rw_wowner(rw) #ifndef INVARIANTS -#define_rw_assert(rw, what, file, line) +#define__rw_assert(c, what, file, line) #endif void @@ -175,10 +181,13 @@ owner_rw(const struct lock_object *lock, #endif void -rw_init_flags(struct rwlock *rw, const char *name, int opts) +_rw_init_flags(volatile uintptr_t *c, const char *name, int opts) { + struct rwlock *rw; int flags; + rw = rwlock2rw(c); + MPASS((opts & ~(RW_DUPOK | RW_NOPROFILE | RW_NOWITNESS | RW_QUIET | RW_RECURSE)) == 0); ASSERT_ATOMIC_LOAD_PTR(rw->rw_lock, @@ -203,8 +212,11 @@ rw_init_flags(struct rwlock *rw, const c } void -rw_destroy(struct rwlock *rw) +_rw_destroy(volatile uintptr_t *c) { + struct rwlock *rw; + + rw = rwlock2rw(c); KASSERT(rw->rw_lock == RW_UNLOCKED, ("rw lock %p not unlocked", rw)); KASSERT(rw->rw_recurse == 0, ("rw lock %p still recursed", rw)); @@ -217,7 +229,7 @@ rw_sysinit(void *arg) { struct rw_args *args = arg; - rw_init(args->ra_rw, args->ra_desc); + rw_init((struct rwlock *)args->ra_rw, args->ra_desc); } void @@ -225,22 +237,27 @@ rw_sysinit_flags(void *arg) { struct rw_args_flags *args = arg; - rw_init_flags(args->ra_rw, args->ra_desc, args->ra_flags); + rw_init_flags((struct rwlock *)args->ra_rw, args->ra_desc, + args->ra_flags); } int -rw_wowned(const struct rwlock *rw) +_rw_wowned(const volatile uintptr_t *c) { - return (rw_wowner(rw) == curthread); + return (rw_wowner(rwlock2rw(c)) == curthread); } void -_rw_wlock(struct rwlock *rw, const char *file, int line) +_rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line) { + struct rwlock *rw; if (SCHEDULER_STOPPED()) return; + + rw = rwlock2rw(c); + KASSERT(!TD_IS_IDLETHREAD(curthread), ("rw_wlock() by idle thread %p on rwlock %s @ %s:%d", curthread, rw->lock_object.lo_name, file, line)); @@ -255,13 +272,16 @@ _rw_wlock(struct rwlock *rw, const char } int -_rw_try_wlock(struct rwlock *rw, const char *file, int line) +__rw_try_wlock(volatile uintptr_t *c, const char *file, int line) { + struct rwlock *rw; int rval; if (SCHEDULER_STOPPED()) return (1); + rw = rwlock2rw(c); + KASSERT(!TD_IS_IDLETHREAD(curthread), ("rw_try_wlock() by idle thread %p on rwlock %s @ %s:%d", curthread, rw->lock_object.lo_name, file, line)); @@ -286,14 +306,18 @@ _rw_try_wlock(struct rwlock *rw, const c } void -_rw_wunlock(struct rwlock *rw, const char *file, int line) +_rw_wunlock_cookie(volatile uintptr_t *c, const char *file, int line) { + struct rwlock *rw; if (SCHEDULER_STOPPED()) return; + + rw = rwlock2rw(c); + KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_wunlock() of destroyed rwlock @ %s:%d", file, line)); - _rw_assert(rw, RA_WLOCKED, file, line); + __rw_assert(c, RA_WLOCKED, file, line); curthread->td_locks--; WITNESS_UNLOCK(&rw->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("WUNLOCK", &rw->lock_object, 0, rw->rw_recurse, file, @@ -315,8
Re: svn commit: r242497 - head/sys/dev/mfi
FWIW, I also have a fix for this and use the same function for mfi_tbolt.c. It also has a bunch of other fixes. However, I need to merge up to this code. It could use some testing on various cards etc. Thanks, Doug A. On Fri, Nov 02, 2012 at 10:07:45PM +, Xin LI wrote: | Author: delphij | Date: Fri Nov 2 22:07:45 2012 | New Revision: 242497 | URL: http://svn.freebsd.org/changeset/base/242497 | | Log: | Copy code from scsi_read_write() as mfi_build_syspd_cdb() to build SCSI | command properly. Without this change, mfi(4) always sends 10 byte READ | and WRITE commands, which will cause data corruption when device is | larger than 2^32 sectors. | | PR: kern/173291 | Submitted by: Steven Hartland | Reviewed by:mav | MFC after: 2 weeks | | Modified: | head/sys/dev/mfi/mfi.c | | Modified: head/sys/dev/mfi/mfi.c | == | --- head/sys/dev/mfi/mfi.cFri Nov 2 22:03:39 2012(r242496) | +++ head/sys/dev/mfi/mfi.cFri Nov 2 22:07:45 2012(r242497) | @@ -106,6 +106,8 @@ static void mfi_add_sys_pd_complete(stru | static struct mfi_command * mfi_bio_command(struct mfi_softc *); | static void mfi_bio_complete(struct mfi_command *); | static struct mfi_command *mfi_build_ldio(struct mfi_softc *,struct bio*); | +static int mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, | +uint64_t lba, uint8_t byte2, int readop); | static struct mfi_command *mfi_build_syspdio(struct mfi_softc *,struct bio*); | static int mfi_send_frame(struct mfi_softc *, struct mfi_command *); | static int mfi_abort(struct mfi_softc *, struct mfi_command *); | @@ -1982,13 +1984,78 @@ mfi_bio_command(struct mfi_softc *sc) | mfi_enqueue_bio(sc, bio); | return cm; | } | + | +static int | +mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, | +uint64_t lba, uint8_t byte2, int readop) | +{ | + int cdb_len; | + | + if (((lba & 0x1f) == lba) | + && ((block_count & 0xff) == block_count) | + && (byte2 == 0)) { | + /* We can fit in a 6 byte cdb */ | + struct scsi_rw_6 *scsi_cmd; | + | + scsi_cmd = (struct scsi_rw_6 *)&pass->cdb; | + scsi_cmd->opcode = readop ? READ_6 : WRITE_6; | + scsi_ulto3b(lba, scsi_cmd->addr); | + scsi_cmd->length = block_count & 0xff; | + scsi_cmd->control = 0; | + cdb_len = sizeof(*scsi_cmd); | + } else if (((block_count & 0x) == block_count) && ((lba & 0x) == lba)) { | + /* Need a 10 byte CDB */ | + struct scsi_rw_10 *scsi_cmd; | + | + scsi_cmd = (struct scsi_rw_10 *)&pass->cdb; | + scsi_cmd->opcode = readop ? READ_10 : WRITE_10; | + scsi_cmd->byte2 = byte2; | + scsi_ulto4b(lba, scsi_cmd->addr); | + scsi_cmd->reserved = 0; | + scsi_ulto2b(block_count, scsi_cmd->length); | + scsi_cmd->control = 0; | + cdb_len = sizeof(*scsi_cmd); | + } else if (((block_count & 0x) == block_count) && | + ((lba & 0x) == lba)) { | + /* Block count is too big for 10 byte CDB use a 12 byte CDB */ | + struct scsi_rw_12 *scsi_cmd; | + | + scsi_cmd = (struct scsi_rw_12 *)&pass->cdb; | + scsi_cmd->opcode = readop ? READ_12 : WRITE_12; | + scsi_cmd->byte2 = byte2; | + scsi_ulto4b(lba, scsi_cmd->addr); | + scsi_cmd->reserved = 0; | + scsi_ulto4b(block_count, scsi_cmd->length); | + scsi_cmd->control = 0; | + cdb_len = sizeof(*scsi_cmd); | + } else { | + /* | + * 16 byte CDB. We'll only get here if the LBA is larger | + * than 2^32 | + */ | + struct scsi_rw_16 *scsi_cmd; | + | + scsi_cmd = (struct scsi_rw_16 *)&pass->cdb; | + scsi_cmd->opcode = readop ? READ_16 : WRITE_16; | + scsi_cmd->byte2 = byte2; | + scsi_u64to8b(lba, scsi_cmd->addr); | + scsi_cmd->reserved = 0; | + scsi_ulto4b(block_count, scsi_cmd->length); | + scsi_cmd->control = 0; | + cdb_len = sizeof(*scsi_cmd); | + } | + | + return cdb_len; | +} | + | static struct mfi_command * | mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) | { | struct mfi_command *cm; | struct mfi_pass_frame *pass; | - int flags = 0, blkcount = 0; | - uint32_t context = 0; | + int flags = 0; | + uint8_t cdb_len; | + uint32_t block_count, context = 0; | | if ((cm = mfi_dequeue_free(sc)) == NULL) | return (NULL); | @@ -2002,35 +2069,29 @@ mfi_build_syspdio(struct mfi_softc *sc, | pass->header.cmd = MFI_CMD_PD_SCSI_IO; | switch (bio->bio_cmd & 0x03
Re: svn commit: r242497 - head/sys/dev/mfi
Does this apply to only to JBOD, or are RAID arrays > 2TB also affected? On Fri, Nov 2, 2012 at 6:07 PM, Xin LI wrote: > Author: delphij > Date: Fri Nov 2 22:07:45 2012 > New Revision: 242497 > URL: http://svn.freebsd.org/changeset/base/242497 > > Log: > Copy code from scsi_read_write() as mfi_build_syspd_cdb() to build SCSI > command properly. Without this change, mfi(4) always sends 10 byte READ > and WRITE commands, which will cause data corruption when device is > larger than 2^32 sectors. > > PR: kern/173291 > Submitted by: Steven Hartland > Reviewed by: mav > MFC after:2 weeks > > Modified: > head/sys/dev/mfi/mfi.c > > Modified: head/sys/dev/mfi/mfi.c > > == > --- head/sys/dev/mfi/mfi.c Fri Nov 2 22:03:39 2012(r242496) > +++ head/sys/dev/mfi/mfi.c Fri Nov 2 22:07:45 2012(r242497) > @@ -106,6 +106,8 @@ static void mfi_add_sys_pd_complete(stru > static struct mfi_command * mfi_bio_command(struct mfi_softc *); > static voidmfi_bio_complete(struct mfi_command *); > static struct mfi_command *mfi_build_ldio(struct mfi_softc *,struct bio*); > +static int mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t > block_count, > + uint64_t lba, uint8_t byte2, int readop); > static struct mfi_command *mfi_build_syspdio(struct mfi_softc *,struct > bio*); > static int mfi_send_frame(struct mfi_softc *, struct mfi_command *); > static int mfi_abort(struct mfi_softc *, struct mfi_command *); > @@ -1982,13 +1984,78 @@ mfi_bio_command(struct mfi_softc *sc) > mfi_enqueue_bio(sc, bio); > return cm; > } > + > +static int > +mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, > +uint64_t lba, uint8_t byte2, int readop) > +{ > + int cdb_len; > + > + if (((lba & 0x1f) == lba) > + && ((block_count & 0xff) == block_count) > + && (byte2 == 0)) { > + /* We can fit in a 6 byte cdb */ > + struct scsi_rw_6 *scsi_cmd; > + > + scsi_cmd = (struct scsi_rw_6 *)&pass->cdb; > + scsi_cmd->opcode = readop ? READ_6 : WRITE_6; > + scsi_ulto3b(lba, scsi_cmd->addr); > + scsi_cmd->length = block_count & 0xff; > + scsi_cmd->control = 0; > + cdb_len = sizeof(*scsi_cmd); > + } else if (((block_count & 0x) == block_count) && ((lba & > 0x) == lba)) { > + /* Need a 10 byte CDB */ > + struct scsi_rw_10 *scsi_cmd; > + > + scsi_cmd = (struct scsi_rw_10 *)&pass->cdb; > + scsi_cmd->opcode = readop ? READ_10 : WRITE_10; > + scsi_cmd->byte2 = byte2; > + scsi_ulto4b(lba, scsi_cmd->addr); > + scsi_cmd->reserved = 0; > + scsi_ulto2b(block_count, scsi_cmd->length); > + scsi_cmd->control = 0; > + cdb_len = sizeof(*scsi_cmd); > + } else if (((block_count & 0x) == block_count) && > + ((lba & 0x) == lba)) { > + /* Block count is too big for 10 byte CDB use a 12 byte > CDB */ > + struct scsi_rw_12 *scsi_cmd; > + > + scsi_cmd = (struct scsi_rw_12 *)&pass->cdb; > + scsi_cmd->opcode = readop ? READ_12 : WRITE_12; > + scsi_cmd->byte2 = byte2; > + scsi_ulto4b(lba, scsi_cmd->addr); > + scsi_cmd->reserved = 0; > + scsi_ulto4b(block_count, scsi_cmd->length); > + scsi_cmd->control = 0; > + cdb_len = sizeof(*scsi_cmd); > + } else { > + /* > +* 16 byte CDB. We'll only get here if the LBA is larger > +* than 2^32 > +*/ > + struct scsi_rw_16 *scsi_cmd; > + > + scsi_cmd = (struct scsi_rw_16 *)&pass->cdb; > + scsi_cmd->opcode = readop ? READ_16 : WRITE_16; > + scsi_cmd->byte2 = byte2; > + scsi_u64to8b(lba, scsi_cmd->addr); > + scsi_cmd->reserved = 0; > + scsi_ulto4b(block_count, scsi_cmd->length); > + scsi_cmd->control = 0; > + cdb_len = sizeof(*scsi_cmd); > + } > + > + return cdb_len; > +} > + > static struct mfi_command * > mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) > { > struct mfi_command *cm; > struct mfi_pass_frame *pass; > - int flags = 0, blkcount = 0; > - uint32_t context = 0; > + int flags = 0; > + uint8_t cdb_len; > + uint32_t block_count, context = 0; > > if ((cm = mfi_dequeue_free(sc)) == NULL) > return (NULL); > @@ -2002,35 +2069,29 @@ mfi_build_syspdio(struct mfi_softc *sc, > pass->header.cmd = MFI_CMD_PD_SCSI_IO; > switch (bio->bio_cmd & 0x03) { > case BIO_READ: > -#def
Re: svn commit: r242497 - head/sys/dev/mfi
On Sat, Nov 3, 2012 at 11:23 AM, Ryan Stone wrote: > Does this apply to only to JBOD, or are RAID arrays > 2TB also affected? The commit message didn't spell it out, but the PR is titled: ">Synopsis: mfi corrupts JBOD disks >2TB due to LBA overflow" -- Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell ___ 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: r242519 - head/usr.sbin/watchdogd
Author: delphij Date: Sat Nov 3 18:38:28 2012 New Revision: 242519 URL: http://svn.freebsd.org/changeset/base/242519 Log: Replace log(3) with flsll(3) for watchdogd(8) and drop libm dependency. MFC after:2 weeks Modified: head/usr.sbin/watchdogd/Makefile head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/Makefile == --- head/usr.sbin/watchdogd/MakefileSat Nov 3 18:21:32 2012 (r242518) +++ head/usr.sbin/watchdogd/MakefileSat Nov 3 18:38:28 2012 (r242519) @@ -4,8 +4,8 @@ PROG= watchdogd LINKS= ${BINDIR}/watchdogd ${BINDIR}/watchdog MAN= watchdogd.8 watchdog.8 -LDADD= -lm -lutil -DPADD= ${LIBM} ${LIBUTIL} +LDADD= -lutil +DPADD= ${LIBUTIL} .include Modified: head/usr.sbin/watchdogd/watchdogd.c == --- head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:21:32 2012 (r242518) +++ head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:38:28 2012 (r242519) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -280,7 +281,7 @@ parseargs(int argc, char *argv[]) if (a == 0) timeout = WD_TO_NEVER; else - timeout = 1.0 + log(a * 1e9) / log(2.0); + timeout = flsll(a * 1e9); if (debugging) printf("Timeout is 2^%d nanoseconds\n", timeout); ___ 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: r242519 - head/usr.sbin/watchdogd
On Sat, 2012-11-03 at 18:38 +, Xin LI wrote: > Author: delphij > Date: Sat Nov 3 18:38:28 2012 > New Revision: 242519 > URL: http://svn.freebsd.org/changeset/base/242519 > > Log: > Replace log(3) with flsll(3) for watchdogd(8) and drop libm dependency. > > MFC after: 2 weeks > > Modified: > head/usr.sbin/watchdogd/Makefile > head/usr.sbin/watchdogd/watchdogd.c > > Modified: head/usr.sbin/watchdogd/Makefile > == > --- head/usr.sbin/watchdogd/Makefile Sat Nov 3 18:21:32 2012 > (r242518) > +++ head/usr.sbin/watchdogd/Makefile Sat Nov 3 18:38:28 2012 > (r242519) > @@ -4,8 +4,8 @@ PROG= watchdogd > LINKS= ${BINDIR}/watchdogd ${BINDIR}/watchdog > MAN= watchdogd.8 watchdog.8 > > -LDADD= -lm -lutil > -DPADD= ${LIBM} ${LIBUTIL} > +LDADD= -lutil > +DPADD= ${LIBUTIL} > > .include > > > Modified: head/usr.sbin/watchdogd/watchdogd.c > == > --- head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:21:32 2012 > (r242518) > +++ head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:38:28 2012 > (r242519) > @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > > @@ -280,7 +281,7 @@ parseargs(int argc, char *argv[]) > if (a == 0) > timeout = WD_TO_NEVER; > else > - timeout = 1.0 + log(a * 1e9) / log(2.0); > + timeout = flsll(a * 1e9); > if (debugging) > printf("Timeout is 2^%d nanoseconds\n", > timeout); Shouldn't we also change the type of the variable 'a' from double to int64 (and the strtod() and the 1e9 constant), thus removing all dregs of floating point where it isn't really needed? (Sorry, but 20 years of working on wimpy embedded systems without FP hardware just make me blurt out these things automatically). -- Ian ___ 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: r242520 - head/sys/ufs/ffs
Author: mckusick Date: Sat Nov 3 18:55:55 2012 New Revision: 242520 URL: http://svn.freebsd.org/changeset/base/242520 Log: When a file is first being written, the dynamic block reallocation (implemented by ffs_reallocblks_ufs[12]) relocates the file's blocks so as to cluster them together into a contiguous set of blocks on the disk. When the cluster crosses the boundary into the first indirect block, the first indirect block is initially allocated in a position immediately following the last direct block. Block reallocation would usually destroy locality by moving the indirect block out of the way to keep the data blocks contiguous. This change compensates for this problem by noting that the first indirect block should be left immediately following the last direct block. It then tries to start a new cluster of contiguous blocks (referenced by the indirect block) immediately following the indirect block. We should also do this for other indirect block boundaries, but it is only important for the first one. Suggested by: Bruce Evans MFC: 2 weeks Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c == --- head/sys/ufs/ffs/ffs_alloc.cSat Nov 3 18:38:28 2012 (r242519) +++ head/sys/ufs/ffs/ffs_alloc.cSat Nov 3 18:55:55 2012 (r242520) @@ -535,6 +535,18 @@ ffs_reallocblks_ufs1(ap) panic("ffs_reallocblks: non-physical cluster %d", i); #endif /* +* If the cluster crosses the boundary for the first indirect +* block, leave space for the indirect block. Indirect blocks +* are initially laid out in a position after the last direct +* block. Block reallocation would usually destroy locality by +* moving the indirect block out of the way to make room for +* data blocks if we didn't compensate here. We should also do +* this for other indirect block boundaries, but it is only +* important for the first one. +*/ + if (start_lbn < NDADDR && end_lbn >= NDADDR) + return (ENOSPC); + /* * If the latest allocation is in a new cylinder group, assume that * the filesystem has decided to move and do not force it back to * the previous cylinder group. @@ -744,6 +756,18 @@ ffs_reallocblks_ufs2(ap) panic("ffs_reallocblks: non-physical cluster %d", i); #endif /* +* If the cluster crosses the boundary for the first indirect +* block, do not move anything in it. Indirect blocks are +* usually initially laid out in a position between the data +* blocks. Block reallocation would usually destroy locality by +* moving the indirect block out of the way to make room for +* data blocks if we didn't compensate here. We should also do +* this for other indirect block boundaries, but it is only +* important for the first one. +*/ + if (start_lbn < NDADDR && end_lbn >= NDADDR) + return (ENOSPC); + /* * If the latest allocation is in a new cylinder group, assume that * the filesystem has decided to move and do not force it back to * the previous cylinder group. @@ -791,6 +815,15 @@ ffs_reallocblks_ufs2(ap) UFS_LOCK(ump); pref = ffs_blkpref_ufs2(ip, start_lbn, soff, sbap); /* +* Skip a block for the first indirect block. Indirect blocks are +* usually initially laid out in a good position between the data +* blocks, but block reallocation would usually destroy locality by +* moving them out of the way to make room for data blocks if we +* didn't compensate here. +*/ + if (start_lbn == NDADDR) + pref += fs->fs_frag; + /* * Search the block map looking for an allocation of the desired size. */ if ((newblk = ffs_hashalloc(ip, dtog(fs, pref), pref, @@ -1185,9 +1218,25 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap) struct fs *fs; u_int cg; u_int avgbfree, startcg; + ufs2_daddr_t pref; mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); fs = ip->i_fs; + /* +* If we are allocating the first indirect block, try to place it +* immediately following the last direct block. +* +* If we are allocating the first data block in the first indirect +* block, try to place it immediately following the indirect block. +*/ + if (lbn == NDADDR) { + pref = ip->i_din1->di_db[NDADDR - 1]; + if (bap == NULL && pref != 0) + return (pref + fs->fs_frag); + pref = ip->i_din1->di_ib[0]; + if (pref != 0) + return (pref + fs->fs_frag); +
Re: svn commit: r242497 - head/sys/dev/mfi
I saw the thread that lead to the PR(hence my asking the question), but it wasn't clear to me whether the submitter had tried any RAID configurations. In any case, I have access to a box in my test lab with a multi-TB RAID array on an mfi controller, and I've confirmed that the bug does not exhibit itself there. Thank goodness. That would have ruined my whole month. Thanks everybody. On Sat, Nov 3, 2012 at 2:36 PM, Peter Wemm wrote: > On Sat, Nov 3, 2012 at 11:23 AM, Ryan Stone wrote: > > Does this apply to only to JBOD, or are RAID arrays > 2TB also affected? > > The commit message didn't spell it out, but the PR is titled: > ">Synopsis: mfi corrupts JBOD disks >2TB due to LBA overflow" > > > -- > Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; > KI6FJV > "All of this is for nothing if we don't go to the stars" - JMS/B5 > "If Java had true garbage collection, most programs would delete > themselves upon execution." -- Robert Sewell > ___ 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: r242521 - head/share/misc
Author: maxim Date: Sat Nov 3 19:26:08 2012 New Revision: 242521 URL: http://svn.freebsd.org/changeset/base/242521 Log: o DragonFly 2.3.1 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree == --- head/share/misc/bsd-family-tree Sat Nov 3 18:55:55 2012 (r242520) +++ head/share/misc/bsd-family-tree Sat Nov 3 19:26:08 2012 (r242521) @@ -257,7 +257,7 @@ FreeBSD 5.2 | | | Mac OS X | | | | 10.8| | | || NetBSD 6.0 | | - || | OpenBSD 5.2 | + || | OpenBSD 5.2 DragonFly 3.2.1 || | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | || | | | @@ -554,6 +554,7 @@ OpenBSD 5.1 2012-05-01 [OBD] Mac OS X 10.8 2012-07-25 [APL] NetBSD 6.0 2012-10-17 [NBD] OpenBSD 5.22012-11-01 [OBD] +DragonFly 3.2.12012-11-02 [DFB] Bibliography ___ 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: r242519 - head/usr.sbin/watchdogd
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 11/3/12 11:45 AM, Ian Lepore wrote: > On Sat, 2012-11-03 at 18:38 +, Xin LI wrote: >> Author: delphij Date: Sat Nov 3 18:38:28 2012 New Revision: >> 242519 URL: http://svn.freebsd.org/changeset/base/242519 >> >> Log: Replace log(3) with flsll(3) for watchdogd(8) and drop libm >> dependency. >> >> MFC after: 2 weeks >> >> Modified: head/usr.sbin/watchdogd/Makefile >> head/usr.sbin/watchdogd/watchdogd.c >> >> Modified: head/usr.sbin/watchdogd/Makefile >> == >> >> - --- head/usr.sbin/watchdogd/Makefile Sat Nov 3 18:21:32 2012 (r242518) >> +++ head/usr.sbin/watchdogd/Makefile Sat Nov 3 18:38:28 2012 >> (r242519) @@ -4,8 +4,8 @@ PROG= watchdogd LINKS= >> ${BINDIR}/watchdogd ${BINDIR}/watchdog MAN= watchdogd.8 >> watchdog.8 >> >> -LDADD= -lm -lutil -DPADD= ${LIBM} ${LIBUTIL} +LDADD= -lutil >> +DPADD= ${LIBUTIL} >> >> .include >> >> >> Modified: head/usr.sbin/watchdogd/watchdogd.c >> == >> >> - --- head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:21:32 2012 (r242518) >> +++ head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:38:28 2012 >> (r242519) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include >> #include #include +#include >> #include #include >> >> @@ -280,7 +281,7 @@ parseargs(int argc, char *argv[]) if (a == >> 0) timeout = WD_TO_NEVER; else - timeout = 1.0 + >> log(a * 1e9) >> / log(2.0); +timeout = flsll(a * 1e9); if >> (debugging) >> printf("Timeout is 2^%d nanoseconds\n", timeout); > > Shouldn't we also change the type of the variable 'a' from double > to int64 (and the strtod() and the 1e9 constant), thus removing all > dregs of floating point where it isn't really needed? (Sorry, but > 20 years of working on wimpy embedded systems without FP hardware > just make me blurt out these things automatically). While it do make sense in practical (in my opinion), I think that would lose functionality because the watchdog can be programmed in a manner that timeout is set to smaller than 1 second (not for the demonized case). Maybe we can make it an build option? Index: Makefile === - --- Makefile(revision 242519) +++ Makefile(working copy) @@ -7,7 +7,15 @@ MAN= watchdogd.8 watchdog.8 LDADD= -lutil DPADD= ${LIBUTIL} +.if defined(SMALL) +CFLAGS+= -DSMALL +.endif + .include test: ${PROG} +.if defined(SMALL) + ./${PROG} -t 1 +.else ./${PROG} -t 1.0 +.endif Index: watchdogd.c === - --- watchdogd.c (revision 242519) +++ watchdogd.c (working copy) @@ -241,7 +241,11 @@ parseargs(int argc, char *argv[]) { int c; char *p; +#if defined(SMALL) + long a; +#else double a; +#endif c = strlen(argv[0]); if (argv[0][c - 1] == 'd') @@ -273,7 +277,11 @@ parseargs(int argc, char *argv[]) case 't': p = NULL; errno = 0; +#if defined(SMALL) + a = strtol(optarg, &p, 0); +#else a = strtod(optarg, &p); +#endif if ((p != NULL && *p != '\0') || errno != 0) errx(EX_USAGE, "-t argument is not a number"); if (a < 0) Cheers, -BEGIN PGP SIGNATURE- iQEcBAEBCAAGBQJQlXWIAAoJEG80Jeu8UPuzKiwIAMGknRDKiXIWLBL86ABfOZVU EkuT7u4S90hAlAyWdropISadgReRF3yenYPGM9oCHtoLLS5Ma2iLd8tMFqv76uxo 0nyqY7HpKRBcYfurYcVTcckrphQdD4DbviRPgBPsZ6/ClHN8Bkjc2Am6zSbzwM5C XZTNicX5/M4IqArYg5L8j3Z4WLo3HIG/oo1OMU+hP+vJT9vBIWK8ap9n3ajNz15p OjKNZXs88X0OaeqhO0Ayn2lGIxkDQ6OszYHi6UUQ7p1m3Op4ewx/SlrgEhDpzBY2 l643UHj/6IUfLUvahp1m82FEKelFYleoZ02scpgu951+che3+t03z9NFUFjl/OA= =UN3H -END PGP SIGNATURE- ___ 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: r242519 - head/usr.sbin/watchdogd
On Sat, 2012-11-03 at 12:50 -0700, Xin Li wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > On 11/3/12 11:45 AM, Ian Lepore wrote: > > On Sat, 2012-11-03 at 18:38 +, Xin LI wrote: > >> Author: delphij Date: Sat Nov 3 18:38:28 2012 New Revision: > >> 242519 URL: http://svn.freebsd.org/changeset/base/242519 > > [...] > > Shouldn't we also change the type of the variable 'a' from double > > to int64 (and the strtod() and the 1e9 constant), thus removing all > > dregs of floating point where it isn't really needed? (Sorry, but > > 20 years of working on wimpy embedded systems without FP hardware > > just make me blurt out these things automatically). > > While it do make sense in practical (in my opinion), I think that > would lose functionality because the watchdog can be programmed in a > manner that timeout is set to smaller than 1 second (not for the > demonized case). Maybe we can make it an build option? > > Index: Makefile > === > - --- Makefile(revision 242519) > +++ Makefile(working copy) > @@ -7,7 +7,15 @@ MAN= watchdogd.8 watchdog.8 > LDADD= -lutil > DPADD= ${LIBUTIL} > > +.if defined(SMALL) > +CFLAGS+= -DSMALL > +.endif > + > .include > > test: ${PROG} > +.if defined(SMALL) > + ./${PROG} -t 1 > +.else > ./${PROG} -t 1.0 > +.endif > Index: watchdogd.c > === > - --- watchdogd.c (revision 242519) > +++ watchdogd.c (working copy) > @@ -241,7 +241,11 @@ parseargs(int argc, char *argv[]) > { > int c; > char *p; > +#if defined(SMALL) > + long a; > +#else > double a; > +#endif > > c = strlen(argv[0]); > if (argv[0][c - 1] == 'd') > @@ -273,7 +277,11 @@ parseargs(int argc, char *argv[]) > case 't': > p = NULL; > errno = 0; > +#if defined(SMALL) > + a = strtol(optarg, &p, 0); > +#else > a = strtod(optarg, &p); > +#endif > if ((p != NULL && *p != '\0') || errno != 0) > errx(EX_USAGE, "-t argument is not a > number"); > if (a < 0) > Oh. I remembered that < WD_TO_1SEC check and somehow completely forgot the is_daemon part and its implication; I just thought timeouts of less than 1 second weren't allowed. It's hard for me to imagine someone setting the timeout to less than 1 second, but if that's been a supported feature all along then we should probably just leave things as-is. Getting libm out of the picture was the big win, the remaining FP code is a pretty small thing. -- Ian ___ 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: r242522 - head
Author: marcel Date: Sat Nov 3 20:43:12 2012 New Revision: 242522 URL: http://svn.freebsd.org/changeset/base/242522 Log: Add the buildLINT convenience target, handy for build automation. The automation can set TARGET_ARCH and TARGET and then make various top-level targets, including buildLINT and buildkernel (with KERNCONF=LINT). Previously there was no way to generate the LINT kernel configuration without having to do something exceptionally painful. Modified: head/Makefile Modified: head/Makefile == --- head/Makefile Sat Nov 3 19:26:08 2012(r242521) +++ head/Makefile Sat Nov 3 20:43:12 2012(r242522) @@ -443,3 +443,6 @@ universe_epilogue: fi .endif .endif + +buildLINT: + ${MAKE} -C ${.CURDIR}/sys/${_TARGET}/conf LINT ___ 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: r242520 - head/sys/kern
On Sat, Nov 3, 2012 at 1:35 PM, Alfred Perlstein wrote: > Author: alfred > Date: Sat Nov 3 18:21:40 2012 > New Revision: 242520 > URL: http://svn.freebsd.org/changeset/base/242520 > > Log: > Retire MAXUSERS. > > Approved by: peter, meetBSD > s/maxusers/maxbikesheds/g 0-o..? ___ 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: r242523 - head/sys/dev/usb/controller
Author: marcel Date: Sat Nov 3 21:05:32 2012 New Revision: 242523 URL: http://svn.freebsd.org/changeset/base/242523 Log: Allow using the embedded EHCI host controller in Freescale SoCs by adding the missing bits. See ehci_fsl.c for their use. Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehci.h Modified: head/sys/dev/usb/controller/ehci.c == --- head/sys/dev/usb/controller/ehci.c Sat Nov 3 20:43:12 2012 (r242522) +++ head/sys/dev/usb/controller/ehci.c Sat Nov 3 21:05:32 2012 (r242523) @@ -332,14 +332,18 @@ ehci_init(ehci_softc_t *sc) sc->sc_noport = EHCI_HCS_N_PORTS(sparams); sc->sc_bus.usbrev = USB_REV_2_0; - /* Reset the controller */ - DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev)); - - err = ehci_hcreset(sc); - if (err) { - device_printf(sc->sc_bus.bdev, "reset timeout\n"); - return (err); + if (!(sc->sc_flags & EHCI_SCFLG_DONTRESET)) { + /* Reset the controller */ + DPRINTF("%s: resetting\n", + device_get_nameunit(sc->sc_bus.bdev)); + + err = ehci_hcreset(sc); + if (err) { + device_printf(sc->sc_bus.bdev, "reset timeout\n"); + return (err); + } } + /* * use current frame-list-size selection 0: 1024*4 bytes 1: 512*4 * bytes 2: 256*4 bytes 3: unknown Modified: head/sys/dev/usb/controller/ehci.h == --- head/sys/dev/usb/controller/ehci.h Sat Nov 3 20:43:12 2012 (r242522) +++ head/sys/dev/usb/controller/ehci.h Sat Nov 3 21:05:32 2012 (r242523) @@ -345,6 +345,8 @@ typedef struct ehci_softc { #defineEHCI_SCFLG_TT 0x0020 /* transaction translator present */ #defineEHCI_SCFLG_LOSTINTRBUG 0x0040 /* workaround for VIA / ATI chipsets */ #defineEHCI_SCFLG_IAADBUG 0x0080 /* workaround for nVidia chipsets */ +#defineEHCI_SCFLG_DONTRESET0x0100 /* don't reset ctrl. in ehci_init() */ +#defineEHCI_SCFLG_DONEINIT 0x1000 /* ehci_init() has been called. */ uint8_t sc_offs;/* offset to operational registers */ uint8_t sc_doorbell_disable;/* set on doorbell failure */ ___ 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: r242520 - head/sys/kern
On Sat, Nov 03, 2012 at 01:35:20PM -0700, Alfred Perlstein wrote: A> Author: alfred A> Date: Sat Nov 3 18:21:40 2012 A> New Revision: 242520 A> URL: http://svn.freebsd.org/changeset/base/242520 A> A> Log: A> Retire MAXUSERS. A> A> Approved by: peter, meetBSD This mechanical rename to meaningless (from viewpoint of average operating system user) name is not a retirement. It is just a stupid rename. FreeBSD source tree isn't a place for stupid jokes. Please back this out. -- Totus tuus, Glebius. ___ 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: r242524 - head/sys/conf
Author: marcel Date: Sat Nov 3 21:08:27 2012 New Revision: 242524 URL: http://svn.freebsd.org/changeset/base/242524 Log: Add the bus attachment for the embedded EHCI HC. Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc == --- head/sys/conf/files.powerpc Sat Nov 3 21:05:32 2012(r242523) +++ head/sys/conf/files.powerpc Sat Nov 3 21:08:27 2012(r242524) @@ -63,6 +63,7 @@ dev/syscons/scvtb.c optionalsc dev/tsec/if_tsec.c optionaltsec dev/tsec/if_tsec_fdt.c optionaltsec fdt dev/uart/uart_cpu_powerpc.coptionaluart aim +dev/usb/controller/ehci_fsl.c optionalehci mpc85xx kern/kern_clocksource.cstandard kern/subr_dummy_vdso_tc.c standard kern/syscalls.coptionalktr ___ 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: r242520 - head/sys/kern
On Sun, Nov 04, 2012 at 01:08:18AM +0400, Gleb Smirnoff wrote: > On Sat, Nov 03, 2012 at 01:35:20PM -0700, Alfred Perlstein wrote: > A> Author: alfred > A> Date: Sat Nov 3 18:21:40 2012 > A> New Revision: 242520 > A> URL: http://svn.freebsd.org/changeset/base/242520 > A> > A> Log: > A> Retire MAXUSERS. > A> > A> Approved by: peter, meetBSD > > This mechanical rename to meaningless (from viewpoint of average > operating system user) name is not a retirement. It is just a stupid > rename. > > FreeBSD source tree isn't a place for stupid jokes. Please back this > out. Seconded. Unfortunately, this cannot be reverted. At least r242520 shall stay as is in repo. pgpEfXRQZghXz.pgp Description: PGP signature
svn commit: r242525 - in head/sys: conf dev/md
Author: marcel Date: Sat Nov 3 21:20:55 2012 New Revision: 242525 URL: http://svn.freebsd.org/changeset/base/242525 Log: Add a MD_ROOT_FSTYPE kernel option. The option specifies the file system part for the MD_ROOT mount string. Hardcoding the the file system type as "ufs" is too restrictive. Modified: head/sys/conf/options head/sys/dev/md/md.c Modified: head/sys/conf/options == --- head/sys/conf/options Sat Nov 3 21:08:27 2012(r242524) +++ head/sys/conf/options Sat Nov 3 21:20:55 2012(r242525) @@ -139,6 +139,7 @@ MAC_STATIC opt_mac.h MAC_STUB opt_dontuse.h MAC_TEST opt_dontuse.h MD_ROOTopt_md.h +MD_ROOT_FSTYPE opt_md.h MD_ROOT_SIZE opt_md.h MFI_DEBUG opt_mfi.h MFI_DECODE_LOG opt_mfi.h Modified: head/sys/dev/md/md.c == --- head/sys/dev/md/md.cSat Nov 3 21:08:27 2012(r242524) +++ head/sys/dev/md/md.cSat Nov 3 21:20:55 2012(r242525) @@ -110,6 +110,10 @@ static int md_malloc_wait; SYSCTL_INT(_vm, OID_AUTO, md_malloc_wait, CTLFLAG_RW, &md_malloc_wait, 0, "Allow malloc to wait for memory allocations"); +#if defined(MD_ROOT) && !defined(MD_ROOT_FSTYPE) +#defineMD_ROOT_FSTYPE "ufs" +#endif + #if defined(MD_ROOT) && defined(MD_ROOT_SIZE) /* * Preloaded image gets put here. @@ -1328,7 +1332,7 @@ md_preloaded(u_char *image, size_t lengt sc->start = mdstart_preload; #ifdef MD_ROOT if (sc->unit == 0) - rootdevnames[0] = "ufs:/dev/md0"; + rootdevnames[0] = MD_ROOT_FSTYPE ":/dev/md0"; #endif mdinit(sc); } ___ 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: r242520 - head/sys/kern
Konstantin Belousov wrote in <20121103211518.gh73...@kib.kiev.ua>: ko> On Sun, Nov 04, 2012 at 01:08:18AM +0400, Gleb Smirnoff wrote: ko> > On Sat, Nov 03, 2012 at 01:35:20PM -0700, Alfred Perlstein wrote: ko> > A> Author: alfred ko> > A> Date: Sat Nov 3 18:21:40 2012 ko> > A> New Revision: 242520 ko> > A> URL: http://svn.freebsd.org/changeset/base/242520 ko> > A> ko> > A> Log: ko> > A> Retire MAXUSERS. ko> > A> ko> > A> Approved by: peter, meetBSD ko> > ko> > This mechanical rename to meaningless (from viewpoint of average ko> > operating system user) name is not a retirement. It is just a stupid ko> > rename. ko> > ko> > FreeBSD source tree isn't a place for stupid jokes. Please back this ko> > out. ko> ko> Seconded. Unfortunately, this cannot be reverted. At least r242520 shall ko> stay as is in repo. I guess he was just joking outside of the source tree. -- Hiroki pgpGdASCAabkO.pgp Description: PGP signature
svn commit: r242526 - head/sys/powerpc/booke
Author: marcel Date: Sat Nov 3 22:02:12 2012 New Revision: 242526 URL: http://svn.freebsd.org/changeset/base/242526 Log: 1. Have the APs initialize the TLB1 entries from what has been programmed on the BSP during (early) boot. This makes sure that the APs get configured the same as the BSP, irrspective of how FreeBSD was loaded. 2. Make sure to flush the dcache after writing the TLB1 entries to the boot page. The APs aren't part of the coherency domain just yet. 3. Set pmap_bootstrapped after calling pmap_bootstrap(). The FDT code now maps the devices (like OF), and this resulted in a panic. 4. Since we pre-wire the CCSR, make sure not to map chunks of it in pmap_mapdev(). Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/platform_bare.c head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/locore.S == --- head/sys/powerpc/booke/locore.S Sat Nov 3 21:20:55 2012 (r242525) +++ head/sys/powerpc/booke/locore.S Sat Nov 3 22:02:12 2012 (r242526) @@ -126,9 +126,11 @@ __start: bl tlb1_find_current /* the entry found is returned in r29 */ bl tlb1_inval_all_but_current + /* * Create temporary mapping in AS=1 and switch to it */ + addi%r3, %r29, 1 bl tlb1_temp_mapping_as1 mfmsr %r3 @@ -242,19 +244,21 @@ done_mapping: __boot_page: bl 1f - .globl bp_trace -bp_trace: + .globl bp_ntlb1s +bp_ntlb1s: .long 0 - .globl bp_kernload -bp_kernload: - .long 0 + .globl bp_tlb1 +bp_tlb1: + .space 4 * 3 * 16 + + .globl bp_tlb1_end +bp_tlb1_end: /* * Initial configuration */ -1: - mflr%r31/* r31 hold the address of bp_trace */ +1: mflr%r31/* r31 hold the address of bp_ntlb1s */ /* Set HIDs */ lis %r3, HID0_E500_DEFAULT_SET@h @@ -283,9 +287,11 @@ bp_kernload: bl tlb1_find_current /* the entry number found is in r29 */ bl tlb1_inval_all_but_current + /* * Create temporary translation in AS=1 and switch to it */ + lwz %r3, 0(%r31) bl tlb1_temp_mapping_as1 mfmsr %r3 @@ -306,44 +312,34 @@ bp_kernload: /* * Setup final mapping in TLB1[1] and switch to it */ - /* Final kernel mapping, map in 16 MB of RAM */ - lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ - li %r4, 0 /* Entry 0 */ - rlwimi %r3, %r4, 16, 4, 15 + lwz %r6, 0(%r31) + addi%r5, %r31, 4 + li %r4, 0 + +4: lis %r3, MAS0_TLBSEL1@h + rlwimi %r3, %r4, 16, 12, 15 mtspr SPR_MAS0, %r3 isync - - li %r3, (TLB_SIZE_16M << MAS1_TSIZE_SHIFT)@l - oris%r3, %r3, (MAS1_VALID | MAS1_IPROT)@h - mtspr SPR_MAS1, %r3 /* note TS was not filled, so it's TS=0 */ + lwz %r3, 0(%r5) + mtspr SPR_MAS1, %r3 isync - - lis %r3, KERNBASE@h - ori %r3, %r3, KERNBASE@l/* EPN = KERNBASE */ - ori %r3, %r3, MAS2_M@l /* WIMGE = 0b00100 */ + lwz %r3, 4(%r5) mtspr SPR_MAS2, %r3 isync - - /* Retrieve kernel load [physical] address from bp_kernload */ - bl 4f -4: mflr%r3 - rlwinm %r3, %r3, 0, 0, 19 - lis %r4, bp_kernload@h - ori %r4, %r4, bp_kernload@l - lis %r5, __boot_page@h - ori %r5, %r5, __boot_page@l - sub %r4, %r4, %r5 /* offset of bp_kernload within __boot_page */ - lwzx%r3, %r4, %r3 - - /* Set RPN and protection */ - ori %r3, %r3, (MAS3_SX | MAS3_SW | MAS3_SR)@l + lwz %r3, 8(%r5) mtspr SPR_MAS3, %r3 isync tlbwe isync msync + addi%r5, %r5, 12 + addi%r4, %r4, 1 + cmpw%r4, %r6 + blt 4b /* Switch to the final mapping */ + lis %r5, __boot_page@ha + ori %r5, %r5, __boot_page@l bl 5f 5: mflr%r3 rlwinm %r3, %r3, 0, 0xfff /* Offset from boot page start */ @@ -460,11 +456,14 @@ tlb1_inval_entry: blr /* - * r29 current entry number - * r28 returned temp entry - * r3-r5 scratched + * r3 entry of temp translation + * r29 entry of current translation + * r28 returns temp entry passed in r3 + * r4-r5 scratched */ tlb1_temp_mapping_as1: + mr %r28, %r3 + /* Read our current translation */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ rlwimi %r3, %r29, 16, 12, 15 /* Select our current entry */ @@ -472,14 +471,8 @@ tlb1_temp_mapping_as1: isync tlbre - /* -* Prepare and
svn commit: r242527 - head/sys/dev/ath
Author: adrian Date: Sat Nov 3 22:12:35 2012 New Revision: 242527 URL: http://svn.freebsd.org/changeset/base/242527 Log: Add a new HAL call to extract out the HAL enterprise bits from the AR9300 HAL. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c == --- head/sys/dev/ath/if_ath.c Sat Nov 3 22:02:12 2012(r242526) +++ head/sys/dev/ath/if_ath.c Sat Nov 3 22:12:35 2012(r242527) @@ -701,6 +701,13 @@ ath_attach(u_int16_t devid, struct ath_s */ sc->sc_mrrprot = 0; /* XXX should be a capability */ + /* +* Query the enterprise mode information the HAL. +*/ + if (ath_hal_getcapability(ah, HAL_CAP_ENTERPRISE_MODE, 0, + &sc->sc_ent_cfg) == HAL_OK) + sc->sc_use_ent = 1; + #ifdef ATH_ENABLE_11N /* * Query HT capabilities Modified: head/sys/dev/ath/if_athvar.h == --- head/sys/dev/ath/if_athvar.hSat Nov 3 22:02:12 2012 (r242526) +++ head/sys/dev/ath/if_athvar.hSat Nov 3 22:12:35 2012 (r242527) @@ -538,7 +538,11 @@ struct ath_softc { struct ath_ratectrl *sc_rc; /* tx rate control support */ struct ath_tx99 *sc_tx99; /* tx99 adjunct state */ void(*sc_setdefantenna)(struct ath_softc *, u_int); - unsigned intsc_invalid : 1,/* disable hardware accesses */ + + /* +* First set of flags. +*/ + uint32_tsc_invalid : 1,/* disable hardware accesses */ sc_mrretry : 1,/* multi-rate retry support */ sc_mrrprot : 1,/* MRR + protection support */ sc_softled : 1,/* enable LED gpio status */ @@ -570,6 +574,17 @@ struct ath_softc { sc_rxslink : 1,/* do self-linked final descriptor */ sc_rxtsf32 : 1,/* RX dec TSF is 32 bits */ sc_isedma : 1;/* supports EDMA */ + + /* +* Second set of flags. +*/ + u_int32_t sc_use_ent : 1; + + /* +* Enterprise mode configuration for AR9380 and later chipsets. +*/ + uint32_tsc_ent_cfg; + uint32_tsc_eerd;/* regdomain from EEPROM */ uint32_tsc_eecc;/* country code from EEPROM */ /* rate tables */ ___ 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: r242528 - head/sys/dev/ath
Author: adrian Date: Sat Nov 3 22:13:42 2012 New Revision: 242528 URL: http://svn.freebsd.org/changeset/base/242528 Log: For AR9380 NICs - the non-enterprise versions don't support RTS protection of small (< 256 byte) aggregate frames. This needs to be done or 11n aggregation TX just simply doesn't work on these NICs. Whilst here, extend some debug printing; I was using this whilst debugging the TX power setup in the TX descriptor(s) on the AR9380. Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c == --- head/sys/dev/ath/if_ath_tx_ht.c Sat Nov 3 22:12:35 2012 (r242527) +++ head/sys/dev/ath/if_ath_tx_ht.c Sat Nov 3 22:13:42 2012 (r242528) @@ -349,6 +349,14 @@ ath_compute_num_delims(struct ath_softc */ ndelim += ATH_AGGR_ENCRYPTDELIM; + /* +* For AR9380, there's a minimum number of delimeters +* required when doing RTS. +*/ + if (sc->sc_use_ent && (sc->sc_ent_cfg & AH_ENT_RTSCTS_DELIM_WAR) + && ndelim < AH_FIRST_DESC_NDELIMS) + ndelim = AH_FIRST_DESC_NDELIMS; + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: pktlen=%d, ndelim=%d, mpdudensity=%d\n", __func__, pktlen, ndelim, mpdudensity); @@ -542,12 +550,13 @@ ath_rateseries_print(struct ath_softc *s int i; for (i = 0; i < ATH_RC_NUM; i++) { device_printf(sc->sc_dev ,"series %d: rate %x; tries %d; " - "pktDuration %d; chSel %d; rateFlags %x\n", + "pktDuration %d; chSel %d; txpowcap %d, rateFlags %x\n", i, series[i].Rate, series[i].Tries, series[i].PktDuration, series[i].ChSel, + series[i].tx_power_cap, series[i].RateFlags); } } @@ -577,7 +586,6 @@ ath_buf_set_rate(struct ath_softc *sc, s ath_rateseries_setup(sc, ni, bf, series); #if 0 - printf("pktlen: %d; flags 0x%x\n", pktlen, flags); ath_rateseries_print(sc, series); #endif ___ 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: r242529 - in head/sys: dev/syscons kern sys
Author: ed Date: Sat Nov 3 22:21:37 2012 New Revision: 242529 URL: http://svn.freebsd.org/changeset/base/242529 Log: Add tty_set_winsize(). This removes some of the signalling magic from the Syscons driver and puts it in the TTY layer, where it belongs. Modified: head/sys/dev/syscons/scvidctl.c head/sys/kern/tty.c head/sys/sys/tty.h Modified: head/sys/dev/syscons/scvidctl.c == --- head/sys/dev/syscons/scvidctl.c Sat Nov 3 22:13:42 2012 (r242528) +++ head/sys/dev/syscons/scvidctl.c Sat Nov 3 22:21:37 2012 (r242529) @@ -137,6 +137,7 @@ sc_set_text_mode(scr_stat *scp, struct t int fontsize, int fontwidth) { video_info_t info; +struct winsize wsz; u_char *font; int prev_ysize; int error; @@ -234,16 +235,9 @@ sc_set_text_mode(scr_stat *scp, struct t if (tp == NULL) return 0; -DPRINTF(5, ("ws_*size (%d,%d), size (%d,%d)\n", - tp->t_winsize.ws_col, tp->t_winsize.ws_row, scp->xsize, scp->ysize)); -if (tp->t_winsize.ws_col != scp->xsize - || tp->t_winsize.ws_row != scp->ysize) { - tp->t_winsize.ws_col = scp->xsize; - tp->t_winsize.ws_row = scp->ysize; - - tty_signal_pgrp(tp, SIGWINCH); -} - +wsz.ws_col = scp->xsize; +wsz.ws_row = scp->ysize; +tty_set_winsize(tp, &wsz); return 0; } @@ -254,6 +248,7 @@ sc_set_graphics_mode(scr_stat *scp, stru return ENODEV; #else video_info_t info; +struct winsize wsz; int error; int s; @@ -300,14 +295,9 @@ sc_set_graphics_mode(scr_stat *scp, stru if (tp == NULL) return 0; -if (tp->t_winsize.ws_xpixel != scp->xpixel - || tp->t_winsize.ws_ypixel != scp->ypixel) { - tp->t_winsize.ws_xpixel = scp->xpixel; - tp->t_winsize.ws_ypixel = scp->ypixel; - - tty_signal_pgrp(tp, SIGWINCH); -} - +wsz.ws_col = scp->xsize; +wsz.ws_row = scp->ysize; +tty_set_winsize(tp, &wsz); return 0; #endif /* SC_NO_MODE_CHANGE */ } @@ -320,7 +310,7 @@ sc_set_pixel_mode(scr_stat *scp, struct return ENODEV; #else video_info_t info; -ksiginfo_t ksi; +struct winsize wsz; u_char *font; int prev_ysize; int error; @@ -425,20 +415,9 @@ sc_set_pixel_mode(scr_stat *scp, struct if (tp == NULL) return 0; -if (tp->t_winsize.ws_col != scp->xsize - || tp->t_winsize.ws_row != scp->ysize) { - tp->t_winsize.ws_col = scp->xsize; - tp->t_winsize.ws_row = scp->ysize; - if (tp->t_pgrp != NULL) { - ksiginfo_init(&ksi); - ksi.ksi_signo = SIGWINCH; - ksi.ksi_code = SI_KERNEL; - PGRP_LOCK(tp->t_pgrp); - pgsignal(tp->t_pgrp, SIGWINCH, 1, &ksi); - PGRP_UNLOCK(tp->t_pgrp); - } -} - +wsz.ws_col = scp->xsize; +wsz.ws_row = scp->ysize; +tty_set_winsize(tp, &wsz); return 0; #endif /* SC_PIXEL_MODE */ } Modified: head/sys/kern/tty.c == --- head/sys/kern/tty.c Sat Nov 3 22:13:42 2012(r242528) +++ head/sys/kern/tty.c Sat Nov 3 22:21:37 2012(r242529) @@ -1381,6 +1381,16 @@ tty_flush(struct tty *tp, int flags) } } +void +tty_set_winsize(struct tty *tp, const struct winsize *wsz) +{ + + if (memcmp(&tp->t_winsize, wsz, sizeof(*wsz)) == 0) + return; + tp->t_winsize = *wsz; + tty_signal_pgrp(tp, SIGWINCH); +} + static int tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, struct thread *td) @@ -1689,10 +1699,7 @@ tty_generic_ioctl(struct tty *tp, u_long return (0); case TIOCSWINSZ: /* Set window size. */ - if (bcmp(&tp->t_winsize, data, sizeof(struct winsize)) == 0) - return (0); - tp->t_winsize = *(struct winsize*)data; - tty_signal_pgrp(tp, SIGWINCH); + tty_set_winsize(tp, data); return (0); case TIOCEXCL: tp->t_flags |= TF_EXCLUDE; Modified: head/sys/sys/tty.h == --- head/sys/sys/tty.h Sat Nov 3 22:13:42 2012(r242528) +++ head/sys/sys/tty.h Sat Nov 3 22:21:37 2012(r242529) @@ -192,6 +192,7 @@ int tty_ioctl(struct tty *tp, u_long cmd struct thread *td); inttty_ioctl_compat(struct tty *tp, u_long cmd, caddr_t data, int fflag, struct thread *td); +void tty_set_winsize(struct tty *tp, const struct winsize *wsz); void tty_init_console(struct tty *tp, speed_t speed); void tty_flush(struct tty *tp, int flags); void tty_hiwat_in_block(struct tty *tp); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-h
svn commit: r242530 - head/bin/sh
Author: jilles Date: Sat Nov 3 22:23:08 2012 New Revision: 242530 URL: http://svn.freebsd.org/changeset/base/242530 Log: sh: Use C99 flexible array instead of accessing array beyond bounds. Although sufficient memory is available for a longer string in cmdname, this is undefined behaviour anyway. Side effect: for alignment reasons, an additional byte of memory is allocated per hashed command. Modified: head/bin/sh/exec.c Modified: head/bin/sh/exec.c == --- head/bin/sh/exec.c Sat Nov 3 22:21:37 2012(r242529) +++ head/bin/sh/exec.c Sat Nov 3 22:23:08 2012(r242530) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); #define CMDTABLESIZE 31/* should be prime */ -#define ARB 1 /* actual size determined at run time */ @@ -88,7 +87,7 @@ struct tblentry { int special;/* flag for special builtin commands */ short cmdtype; /* index identifying command */ char rehash;/* if set, cd done since entry created */ - char cmdname[ARB]; /* name of command */ + char cmdname[]; /* name of command */ }; @@ -563,7 +562,7 @@ cmdlookup(const char *name, int add) } if (add && cmdp == NULL) { INTOFF; - cmdp = *pp = ckmalloc(sizeof (struct tblentry) - ARB + cmdp = *pp = ckmalloc(sizeof (struct tblentry) + strlen(name) + 1); cmdp->next = NULL; cmdp->cmdtype = CMDUNKNOWN; ___ 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: r242531 - in head/sys/arm: arm broadcom/bcm2835 include lpc mv tegra ti
Author: andrew Date: Sat Nov 3 22:39:07 2012 New Revision: 242531 URL: http://svn.freebsd.org/changeset/base/242531 Log: Merge the FDT versions of initarm. The copies of initarm used on platforms with FDT support were almost identical. The differences were pulled out into separate functions that were called by initarm. This change merges the, now identical, copies of initarm and a few of it's support functions. This is a step towards a common kernel on ARMv6. Modified: head/sys/arm/arm/machdep.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/include/machdep.h head/sys/arm/lpc/lpc_machdep.c head/sys/arm/mv/mv_machdep.c head/sys/arm/tegra/tegra2_machdep.c head/sys/arm/ti/ti_machdep.c Modified: head/sys/arm/arm/machdep.c == --- head/sys/arm/arm/machdep.c Sat Nov 3 22:23:08 2012(r242530) +++ head/sys/arm/arm/machdep.c Sat Nov 3 22:39:07 2012(r242531) @@ -44,6 +44,7 @@ #include "opt_compat.h" #include "opt_ddb.h" +#include "opt_platform.h" #include "opt_timer.h" #include @@ -59,11 +60,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -94,6 +97,17 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#endif + +#ifdef DEBUG +#definedebugf(fmt, args...) printf(fmt, ##args) +#else +#definedebugf(fmt, args...) +#endif + struct pcpu __pcpu[MAXCPU]; struct pcpu *pcpup = &__pcpu[0]; @@ -114,6 +128,35 @@ extern int *end; extern vm_offset_t ksym_start, ksym_end; #endif +#ifdef FDT +/* + * This is the number of L2 page tables required for covering max + * (hypothetical) memsize of 4GB and all kernel mappings (vectors, msgbuf, + * stacks etc.), uprounded to be divisible by 4. + */ +#define KERNEL_PT_MAX 78 + +static struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; + +vm_paddr_t phys_avail[10]; +vm_paddr_t dump_avail[4]; + +extern u_int data_abort_handler_address; +extern u_int prefetch_abort_handler_address; +extern u_int undefined_handler_address; + +vm_paddr_t pmap_pa; + +struct pv_addr systempage; +static struct pv_addr msgbufpv; +struct pv_addr irqstack; +struct pv_addr undstack; +struct pv_addr abtstack; +static struct pv_addr kernelstack; + +const struct pmap_devmap *pmap_devmap_bootstrap_table; +#endif + #if defined(LINUX_BOOT_ABI) #define LBABI_MAX_BANKS10 @@ -961,3 +1004,411 @@ set_stackptrs(int cpu) undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); } +#ifdef FDT +static char * +kenv_next(char *cp) +{ + + if (cp != NULL) { + while (*cp != 0) + cp++; + cp++; + if (*cp == 0) + cp = NULL; + } + return (cp); +} + +static void +print_kenv(void) +{ + int len; + char *cp; + + debugf("loader passed (static) kenv:\n"); + if (kern_envp == NULL) { + debugf(" no env, null ptr\n"); + return; + } + debugf(" kern_envp = 0x%08x\n", (uint32_t)kern_envp); + + len = 0; + for (cp = kern_envp; cp != NULL; cp = kenv_next(cp)) + debugf(" %x %s\n", (uint32_t)cp, cp); +} + +static void +print_kernel_section_addr(void) +{ + + debugf("kernel image addresses:\n"); + debugf(" kernbase = 0x%08x\n", (uint32_t)kernbase); + debugf(" _etext (sdata) = 0x%08x\n", (uint32_t)_etext); + debugf(" _edata = 0x%08x\n", (uint32_t)_edata); + debugf(" __bss_start= 0x%08x\n", (uint32_t)__bss_start); + debugf(" _end = 0x%08x\n", (uint32_t)_end); +} + +static void +physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz) +{ + int i, j, cnt; + vm_offset_t phys_kernelend, kernload; + uint32_t s, e, sz; + struct mem_region *mp, *mp1; + + phys_kernelend = KERNPHYSADDR + (virtual_avail - KERNVIRTADDR); + kernload = KERNPHYSADDR; + + /* +* Remove kernel physical address range from avail +* regions list. Page align all regions. +* Non-page aligned memory isn't very interesting to us. +* Also, sort the entries for ascending addresses. +*/ + sz = 0; + cnt = availmem_regions_sz; + debugf("processing avail regions:\n"); + for (mp = availmem_regions; mp->mr_size; mp++) { + s = mp->mr_start; + e = mp->mr_start + mp->mr_size; + debugf(" %08x-%08x -> ", s, e); + /* Check whether this region holds all of the kernel. */ + if (s < kernload && e > phys_kernelend) { + availmem_regions[cnt].mr_start = phys_kernelend; + availmem_regions[cnt++].mr_size = e - phys_kernelend; + e = kernload; + } +
svn commit: r242532 - head/sys/dev/ath
Author: adrian Date: Sat Nov 3 22:54:42 2012 New Revision: 242532 URL: http://svn.freebsd.org/changeset/base/242532 Log: EDMA TX tweaks: * don't poke ath_hal_txstart() if nothing was pushed into the FIFO during the refill process; * shuffle around the TX debugging output a little so it's logged at TX hardware enqueue; * Add logging of the TX status processing. Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c == --- head/sys/dev/ath/if_ath_tx_edma.c Sat Nov 3 22:39:07 2012 (r242531) +++ head/sys/dev/ath/if_ath_tx_edma.c Sat Nov 3 22:54:42 2012 (r242532) @@ -134,6 +134,7 @@ static void ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) { struct ath_buf *bf; + int i = 0; ATH_TXQ_LOCK_ASSERT(txq); @@ -143,9 +144,15 @@ ath_edma_tx_fifo_fill(struct ath_softc * if (txq->axq_fifo_depth >= HAL_TXFIFO_DEPTH) break; ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, bf->bf_daddr); +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) + ath_printtxbuf(sc, bf, txq->axq_qnum, i, 0); +#endif txq->axq_fifo_depth++; + i++; } - ath_hal_txstart(sc->sc_ah, txq->axq_qnum); + if (i > 0) + ath_hal_txstart(sc->sc_ah, txq->axq_qnum); } /* @@ -208,13 +215,12 @@ ath_edma_xmit_handoff_hw(struct ath_soft /* Push and update frame stats */ ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); -#ifdef ATH_DEBUG - if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) - ath_printtxbuf(sc, bf, txq->axq_qnum, 0, 0); -#endif /* ATH_DEBUG */ - /* Only schedule to the FIFO if there's space */ if (txq->axq_fifo_depth < HAL_TXFIFO_DEPTH) { +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) + ath_printtxbuf(sc, bf, txq->axq_qnum, 0, 0); +#endif /* ATH_DEBUG */ ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); txq->axq_fifo_depth++; ath_hal_txstart(ah, txq->axq_qnum); @@ -428,17 +434,30 @@ ath_edma_tx_proc(void *arg, int npending struct ath_buf *bf; struct ieee80211_node *ni; int nacked = 0; + int idx; + +#ifdef ATH_DEBUG + /* XXX */ + uint32_t txstatus[32]; +#endif DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called, npending=%d\n", __func__, npending); - for (;;) { + for (idx = 0; ; idx++) { bzero(&ts, sizeof(ts)); ATH_TXSTATUS_LOCK(sc); status = ath_hal_txprocdesc(ah, NULL, (void *) &ts); + ath_hal_gettxrawtxdesc(ah, txstatus); ATH_TXSTATUS_UNLOCK(sc); +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_TX_PROC) + ath_printtxstatbuf(sc, NULL, txstatus, ts.ts_queue_id, + idx, (status == HAL_OK)); +#endif + if (status == HAL_EINPROGRESS) break; @@ -482,6 +501,8 @@ ath_edma_tx_proc(void *arg, int npending __func__, ts.ts_queue_id, bf); + /* XXX TODO: actually output debugging info about this */ + #if 0 /* XXX assert the buffer/descriptor matches the status descid */ if (ts.ts_desc_id != bf->bf_descid) { ___ 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: r242534 - in head/sys: amd64/amd64 i386/i386 ia64/ia64 mips/mips powerpc/aim sparc64/include sparc64/sparc64
Author: attilio Date: Sat Nov 3 23:03:14 2012 New Revision: 242534 URL: http://svn.freebsd.org/changeset/base/242534 Log: Rework the known rwlock to benefit about staying on their own cache line in order to avoid manual frobbing but using struct rwlock_padalign. Reviewed by: alc, jimharris Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/ia64/ia64/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/sparc64/include/pmap.h head/sys/sparc64/sparc64/pmap.c Modified: head/sys/amd64/amd64/pmap.c == --- head/sys/amd64/amd64/pmap.c Sat Nov 3 23:00:05 2012(r242533) +++ head/sys/amd64/amd64/pmap.c Sat Nov 3 23:03:14 2012(r242534) @@ -225,16 +225,7 @@ u_int64_t KPML4phys; /* phys addr of ke static u_int64_t DMPDphys; /* phys addr of direct mapped level 2 */ static u_int64_t DMPDPphys; /* phys addr of direct mapped level 3 */ -/* - * Isolate the global pv list lock from data and other locks to prevent false - * sharing within the cache. - */ -static struct { - struct rwlock lock; - charpadding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; -} pvh_global __aligned(CACHE_LINE_SIZE); - -#definepvh_global_lock pvh_global.lock +static struct rwlock_padalign pvh_global_lock; /* * Data for the pv entry allocation mechanism Modified: head/sys/i386/i386/pmap.c == --- head/sys/i386/i386/pmap.c Sat Nov 3 23:00:05 2012(r242533) +++ head/sys/i386/i386/pmap.c Sat Nov 3 23:03:14 2012(r242534) @@ -224,16 +224,7 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_ena #definePAT_INDEX_SIZE 8 static int pat_index[PAT_INDEX_SIZE]; /* cache mode to PAT index conversion */ -/* - * Isolate the global pv list lock from data and other locks to prevent false - * sharing within the cache. - */ -static struct { - struct rwlock lock; - charpadding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; -} pvh_global __aligned(CACHE_LINE_SIZE); - -#definepvh_global_lock pvh_global.lock +static struct rwlock_padalign pvh_global_lock; /* * Data for the pv entry allocation mechanism Modified: head/sys/ia64/ia64/pmap.c == --- head/sys/ia64/ia64/pmap.c Sat Nov 3 23:00:05 2012(r242533) +++ head/sys/ia64/ia64/pmap.c Sat Nov 3 23:03:14 2012(r242534) @@ -214,16 +214,7 @@ static int pmap_ridmax; static uint64_t *pmap_ridmap; struct mtx pmap_ridmutex; -/* - * Isolate the global pv list lock from data and other locks to prevent false - * sharing within the cache. - */ -static struct { - struct rwlock lock; - charpadding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; -} pvh_global __aligned(CACHE_LINE_SIZE); - -#definepvh_global_lock pvh_global.lock +static struct rwlock_padalign pvh_global_lock; /* * Data for the pv entry allocation mechanism Modified: head/sys/mips/mips/pmap.c == --- head/sys/mips/mips/pmap.c Sat Nov 3 23:00:05 2012(r242533) +++ head/sys/mips/mips/pmap.c Sat Nov 3 23:03:14 2012(r242534) @@ -148,16 +148,7 @@ vm_offset_t kernel_vm_end = VM_MIN_KERNE static void pmap_asid_alloc(pmap_t pmap); -/* - * Isolate the global pv list lock from data and other locks to prevent false - * sharing within the cache. - */ -static struct { - struct rwlock lock; - charpadding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; -} pvh_global __aligned(CACHE_LINE_SIZE); - -#definepvh_global_lock pvh_global.lock +static struct rwlock_padalign pvh_global_lock; /* * Data for the pv entry allocation mechanism Modified: head/sys/powerpc/aim/mmu_oea.c == --- head/sys/powerpc/aim/mmu_oea.c Sat Nov 3 23:00:05 2012 (r242533) +++ head/sys/powerpc/aim/mmu_oea.c Sat Nov 3 23:03:14 2012 (r242534) @@ -200,16 +200,7 @@ struct pvo_head *moea_pvo_table; /* pvo struct pvo_head moea_pvo_kunmanaged = LIST_HEAD_INITIALIZER(moea_pvo_kunmanaged);/* list of unmanaged pages */ -/* - * Isolate the global pv list lock from data and other locks to prevent false - * sharing within the cache. - */ -static struct { - struct rwlock lock; - charpadding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; -} pvh_global __aligned(CACHE_LINE_SIZE); - -#definepvh_global_lock pvh_global.lock +static struct rwlock_padalign pvh_global_lock; uma_zone_t moea_upvo_zone; /* zone for pvo entries for unmanaged pages */ uma_zone_t moea_mpvo_zone; /* zone for pvo entries for managed pages */ Modified: head/sys
svn commit: r242535 - head/sys/powerpc/booke
Author: alc Date: Sat Nov 3 23:22:49 2012 New Revision: 242535 URL: http://svn.freebsd.org/changeset/base/242535 Log: Replace all uses of the page queues lock by a R/W lock that is private to this pmap. Eliminate two redundant #include's. Tested by:marcel Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c == --- head/sys/powerpc/booke/pmap.c Sat Nov 3 23:03:14 2012 (r242534) +++ head/sys/powerpc/booke/pmap.c Sat Nov 3 23:22:49 2012 (r242535) @@ -51,7 +51,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -64,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -85,7 +85,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -214,6 +213,8 @@ static inline unsigned int tlb0_tableidx /* Page table management */ /**/ +static struct rwlock_padalign pvh_global_lock; + /* Data for the pv entry allocation mechanism */ static uma_zone_t pvzone; static struct vm_object pvzone_obj; @@ -551,9 +552,9 @@ ptbl_alloc(mmu_t mmu, pmap_t pmap, unsig VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); VM_WAIT; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); } mtbl[i] = m; @@ -743,7 +744,7 @@ pv_insert(pmap_t pmap, vm_offset_t va, v /* add to pv_list */ PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); TAILQ_INSERT_TAIL(&m->md.pv_list, pve, pv_link); @@ -760,7 +761,7 @@ pv_remove(pmap_t pmap, vm_offset_t va, v //debugf("pv_remove: s (su = %d pmap = 0x%08x va = 0x%08x)\n", su, (u_int32_t)pmap, va); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); /* find pv entry */ TAILQ_FOREACH(pve, &m->md.pv_list, pv_link) { @@ -1239,6 +1240,11 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset /* Mark kernel_pmap active on all CPUs */ CPU_FILL(&kernel_pmap->pm_active); + /* +* Initialize the global pv list lock. +*/ + rw_init(&pvh_global_lock, "pmap pv global"); + /***/ /* Final setup */ /***/ @@ -1522,10 +1528,10 @@ mmu_booke_enter(mmu_t mmu, pmap_t pmap, vm_prot_t prot, boolean_t wired) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); mmu_booke_enter_locked(mmu, pmap, va, m, prot, wired); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -1711,14 +1717,14 @@ mmu_booke_enter_object(mmu_t mmu, pmap_t psize = atop(end - start); m = m_start; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { mmu_booke_enter_locked(mmu, pmap, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -1727,11 +1733,11 @@ mmu_booke_enter_quick(mmu_t mmu, pmap_t vm_prot_t prot) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); mmu_booke_enter_locked(mmu, pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -1768,7 +1774,7 @@ mmu_booke_remove(mmu_t mmu, pmap_t pmap, hold_flag = PTBL_HOLD_FLAG(pmap); //debugf("mmu_booke_remove: hold_flag = %d\n", hold_flag); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); for (; va < endva; va += PAGE_SIZE) { pte = pte_find(mmu, pmap, va); @@ -1776,7 +1782,7 @@ mmu_booke_remove(mmu_t mmu, pmap_t pmap, pte_remove(mmu, pmap, va, hold_flag); } PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); //debugf("mmu_booke_remove: e\n"); } @@ -1790,7 +1796,7 @@ mmu_booke_remove_all(mmu_t mmu, vm_page_ pv_entry_t pv, pvn; uint8_t hold_flag; -
svn commit: r242536 - head/sys/fs/fuse
Author: attilio Date: Sat Nov 3 23:32:32 2012 New Revision: 242536 URL: http://svn.freebsd.org/changeset/base/242536 Log: Fix a bug where operations was carried on even if not implemented, leading to handling of an invalid fdip object. Reported and tested by: flo MFC after:2 months X-MFC:241519 Modified: head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_vnops.c == --- head/sys/fs/fuse/fuse_vnops.c Sat Nov 3 23:22:49 2012 (r242535) +++ head/sys/fs/fuse/fuse_vnops.c Sat Nov 3 23:32:32 2012 (r242536) @@ -358,12 +358,10 @@ fuse_vnop_create(struct vop_create_args err = fdisp_wait_answ(fdip); - if (err == ENOSYS) { - debug_printf("create: got ENOSYS from daemon\n"); - fsess_set_notimpl(mp, FUSE_CREATE); - fdisp_destroy(fdip); - } else if (err) { - debug_printf("create: darn, got err=%d from daemon\n", err); + if (err) { + if (err == ENOSYS) + fsess_set_notimpl(mp, FUSE_CREATE); + debug_printf("create: got err=%d from daemon\n", err); goto out; } bringup: ___ 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: r242540 - head/sys/dev/ath
Author: adrian Date: Sun Nov 4 00:46:01 2012 New Revision: 242540 URL: http://svn.freebsd.org/changeset/base/242540 Log: Oops - conditionalise that. Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c == --- head/sys/dev/ath/if_ath_tx_edma.c Sun Nov 4 00:30:42 2012 (r242539) +++ head/sys/dev/ath/if_ath_tx_edma.c Sun Nov 4 00:46:01 2012 (r242540) @@ -449,7 +449,9 @@ ath_edma_tx_proc(void *arg, int npending ATH_TXSTATUS_LOCK(sc); status = ath_hal_txprocdesc(ah, NULL, (void *) &ts); +#ifdef ATH_DEBUG ath_hal_gettxrawtxdesc(ah, txstatus); +#endif ATH_TXSTATUS_UNLOCK(sc); #ifdef ATH_DEBUG ___ 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: r242541 - in head: etc/root share/skel
Author: bapt Date: Sun Nov 4 01:00:35 2012 New Revision: 242541 URL: http://svn.freebsd.org/changeset/base/242541 Log: Change default prompt to show ~ again for the home directory Submitted by: flo Approved by: eadler Modified: head/etc/root/dot.cshrc head/share/skel/dot.cshrc Modified: head/etc/root/dot.cshrc == --- head/etc/root/dot.cshrc Sun Nov 4 00:46:01 2012(r242540) +++ head/etc/root/dot.cshrc Sun Nov 4 01:00:35 2012(r242541) @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec Modified: head/share/skel/dot.cshrc == --- head/share/skel/dot.cshrc Sun Nov 4 00:46:01 2012(r242540) +++ head/share/skel/dot.cshrc Sun Nov 4 01:00:35 2012(r242541) @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec ___ 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: r242546 - head/sbin/mdconfig
Author: wblock (doc committer) Date: Sun Nov 4 03:19:07 2012 New Revision: 242546 URL: http://svn.freebsd.org/changeset/base/242546 Log: Add an example showing the use of gnop(8) to skip over header data. PR: kern/145999 Reviewed by: mjg MFC after:1 week Modified: head/sbin/mdconfig/mdconfig.8 Modified: head/sbin/mdconfig/mdconfig.8 == --- head/sbin/mdconfig/mdconfig.8 Sun Nov 4 02:52:03 2012 (r242545) +++ head/sbin/mdconfig/mdconfig.8 Sun Nov 4 03:19:07 2012 (r242546) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2012 +.Dd November 3, 2012 .Dt MDCONFIG 8 .Os .Sh NAME @@ -267,6 +267,18 @@ are implied device, and then mount the new memory disk: .Bd -literal -offset indent mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt +.Pp +.Ed +Create a file-backed device from a hard disk image that begins +with 512K of raw header information. +.Xr gnop 8 +is used to skip over the header information, positioning +.Pa md1.nop +to the start of the filesystem in the image. +.Bd -literal -offset indent +mdconfig -f diskimage.img -u 1 +gnop create -o 512K md1 +mount /dev/md1.nop /mnt .Ed .Sh SEE ALSO .Xr md 4 , ___ 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"