svn commit: r211059 - head/sys/netinet

2010-08-08 Thread Xin LI
Author: delphij
Date: Sun Aug  8 07:04:27 2010
New Revision: 211059
URL: http://svn.freebsd.org/changeset/base/211059

Log:
  Address an edge condition that we found at work, where the carp(4)
  interface goes to issue LINK_UP, then LINK_DOWN, then LINK_UP at
  cold boot.  This behavior is not observed when carp(4) interface
  is created slightly later, when the underlying interface is fully
  up.
  
  Before this change what happen at boot is roughly:
  
   - ifconfig creates em0 interface;
   - ifconfig clones a carp device using em0;
 (em0's link state is DOWN at this point)
   - carp state: INIT -> BACKUP [*]
   - carp state: BACKUP -> MASTER
   - [Some negotiate between em0 and switch]
   - em0 kicks up link state change event
 (em0's link state is now up DOWN at this point)
   - do_link_state_change() -> carp_carpdev_state()
   - carp state: MASTER -> INIT (via carp_set_state(sc, INIT)) [+]
   - carp state: INIT -> BACKUP
   - carp state: BACKUP -> MASTER
  
  At the [*] stage, em0 did not received any broadcast message from other
  node, and assume our node is the master, thus carp(4) sets the link
  state to "UP" after becoming a master.  At [+], the master status
  is forcely set to "INIT", then an election is casted, after which our
  node would actually become a master.
  
  We believe that at the [*] stage, the master status should remain as
  "INIT" since the underlying parent interface's link state is not up.
  
  Obtained from:iXsystems, Inc.
  Reported by:  jpaetzel
  MFC after:2 months

Modified:
  head/sys/netinet/ip_carp.c

Modified: head/sys/netinet/ip_carp.c
==
--- head/sys/netinet/ip_carp.c  Sun Aug  8 06:18:05 2010(r211058)
+++ head/sys/netinet/ip_carp.c  Sun Aug  8 07:04:27 2010(r211059)
@@ -1369,7 +1369,8 @@ carp_setrun(struct carp_softc *sc, sa_fa
CARP_SCLOCK_ASSERT(sc);
 
if (SC2IFP(sc)->if_flags & IFF_UP &&
-   sc->sc_vhid > 0 && (sc->sc_naddrs || sc->sc_naddrs6))
+   sc->sc_vhid > 0 && (sc->sc_naddrs || sc->sc_naddrs6) &&
+   sc->sc_carpdev->if_link_state == LINK_STATE_UP)
SC2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING;
else {
SC2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211060 - stable/8/contrib/nvi/vi

2010-08-08 Thread Jaakko Heinonen
Author: jh
Date: Sun Aug  8 07:34:37 2010
New Revision: 211060
URL: http://svn.freebsd.org/changeset/base/211060

Log:
  MFC r208612: Fixes from NetBSD for nvi visual mode
  
  PR:   bin/21089, bin/136393

Modified:
  stable/8/contrib/nvi/vi/v_ex.c
  stable/8/contrib/nvi/vi/v_txt.c
Directory Properties:
  stable/8/contrib/nvi/   (props changed)

Modified: stable/8/contrib/nvi/vi/v_ex.c
==
--- stable/8/contrib/nvi/vi/v_ex.c  Sun Aug  8 07:04:27 2010
(r211059)
+++ stable/8/contrib/nvi/vi/v_ex.c  Sun Aug  8 07:34:37 2010
(r211060)
@@ -428,6 +428,10 @@ v_ex(sp, vp)
if (tp->term == TERM_BS)
break;
 
+   /* If the user changed their mind, return. */
+   if (tp->term != TERM_OK)
+   break;
+
/* Log the command. */
if (O_STR(sp, O_CEDIT) != NULL && v_ecl_log(sp, tp))
return (1);

Modified: stable/8/contrib/nvi/vi/v_txt.c
==
--- stable/8/contrib/nvi/vi/v_txt.c Sun Aug  8 07:04:27 2010
(r211059)
+++ stable/8/contrib/nvi/vi/v_txt.c Sun Aug  8 07:34:37 2010
(r211060)
@@ -510,15 +510,6 @@ next:  if (v_event_get(sp, evp, 0, ec_fla
case E_EOF:
F_SET(sp, SC_EXIT_FORCE);
return (1);
-   case E_INTERRUPT:
-   /*
-* !!!
-* Historically,  exited the user from text input
-* mode or cancelled a colon command, and returned to command
-* mode.  It also beeped the terminal, but that seems a bit
-* excessive.
-*/
-   goto k_escape;
case E_REPAINT:
if (vs_repaint(sp, &ev))
return (1);
@@ -526,10 +517,37 @@ next: if (v_event_get(sp, evp, 0, ec_fla
case E_WRESIZE:
/*  interrupts the input mode. */
v_emsg(sp, NULL, VIM_WRESIZE);
-   goto k_escape;
+   /* FALLTHROUGH */
default:
-   v_event_err(sp, evp);
-   goto k_escape;
+   if (evp->e_event != E_INTERRUPT && evp->e_event != E_WRESIZE)
+   v_event_err(sp, evp);
+   /*
+* !!!
+* Historically,  exited the user from text input
+* mode or cancelled a colon command, and returned to command
+* mode.  It also beeped the terminal, but that seems a bit
+* excessive.
+*/
+   /*
+* If we are recording, morph into  key so that
+* we can repeat the command safely: there is no way to
+* invalidate the repetition of an instance of a command,
+* which would be the alternative possibility.
+* If we are not recording (most likely on the command line),
+* simply discard the input and return to command mode
+* so that an INTERRUPT doesn't become for example a file
+* completion request. -aymeric
+*/
+   if (LF_ISSET(TXT_RECORD)) {
+   evp->e_event = E_CHARACTER;
+   evp->e_c = 033;
+   evp->e_flags = 0;
+   evp->e_value = K_ESCAPE;
+   break;
+   } else {
+   tp->term = TERM_ESC;
+   goto k_escape;
+   }
}
 
/*
@@ -539,7 +557,7 @@ next:   if (v_event_get(sp, evp, 0, ec_fla
 * This was not documented as far as I know, and is a great test of vi
 * clones.
 */
-   if (rcol == 0 && !LF_ISSET(TXT_REPLAY) && evp->e_c == '\0') {
+   if (LF_ISSET(TXT_RECORD) && rcol == 0 && evp->e_c == '\0') {
if (vip->rep == NULL)
goto done;
 
@@ -1456,6 +1474,7 @@ done: /* Leave input mode. */
 
 err:
 alloc_err:
+   F_CLR(sp, SC_TINPUT);
txt_err(sp, &sp->tiq);
return (1);
 }
@@ -2216,8 +2235,8 @@ txt_fc_col(sp, argc, argv)
 
/* If the largest file name is too large, just print them. */
if (colwidth > sp->cols) {
-   p = msg_print(sp, av[0]->bp + prefix, &nf);
for (ac = argc, av = argv; ac > 0; --ac, ++av) {
+   p = msg_print(sp, av[0]->bp + prefix, &nf);
(void)ex_printf(sp, "%s\n", p);
if (F_ISSET(gp, G_INTERRUPTED))
break;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "

svn commit: r211061 - head/lib/libcompat/4.1

2010-08-08 Thread Ed Schouten
Author: ed
Date: Sun Aug  8 08:19:23 2010
New Revision: 211061
URL: http://svn.freebsd.org/changeset/base/211061

Log:
  Small style(9) fix: use tabs instead of spaces.

Modified:
  head/lib/libcompat/4.1/ftime.c

Modified: head/lib/libcompat/4.1/ftime.c
==
--- head/lib/libcompat/4.1/ftime.c  Sun Aug  8 07:34:37 2010
(r211060)
+++ head/lib/libcompat/4.1/ftime.c  Sun Aug  8 08:19:23 2010
(r211061)
@@ -39,15 +39,15 @@ static char rcsid[] = "$FreeBSD$";
 int
 ftime(struct timeb *tbp)
 {
-struct timezone tz;
-struct timeval t;
+   struct timezone tz;
+   struct timeval t;
 
-if (gettimeofday(&t, &tz) < 0)
-return (-1);
-tbp->millitm = t.tv_usec / 1000;
-tbp->time = t.tv_sec;
-tbp->timezone = tz.tz_minuteswest;
-tbp->dstflag = tz.tz_dsttime;
+   if (gettimeofday(&t, &tz) < 0)
+   return (-1);
+   tbp->millitm = t.tv_usec / 1000;
+   tbp->time = t.tv_sec;
+   tbp->timezone = tz.tz_minuteswest;
+   tbp->dstflag = tz.tz_dsttime;
 
return (0);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211062 - head/contrib/traceroute

2010-08-08 Thread Ed Schouten
Author: ed
Date: Sun Aug  8 08:22:53 2010
New Revision: 211062
URL: http://svn.freebsd.org/changeset/base/211062

Log:
  Remove unneeded struct timezone passed to gettimeofday().

Modified:
  head/contrib/traceroute/traceroute.c

Modified: head/contrib/traceroute/traceroute.c
==
--- head/contrib/traceroute/traceroute.cSun Aug  8 08:19:23 2010
(r211061)
+++ head/contrib/traceroute/traceroute.cSun Aug  8 08:22:53 2010
(r211062)
@@ -962,7 +962,6 @@ main(int argc, char **argv)
for (probe = 0, loss = 0; probe < nprobes; ++probe) {
register int cc;
struct timeval t1, t2;
-   struct timezone tz;
register struct ip *ip;
struct outdata outdata;
 
@@ -973,7 +972,7 @@ main(int argc, char **argv)
outdata.ttl = ttl;
 
/* Avoid alignment problems by copying bytewise: */
-   (void)gettimeofday(&t1, &tz);
+   (void)gettimeofday(&t1, NULL);
memcpy(&outdata.tv, &t1, sizeof(outdata.tv));
 
/* Finalize and send packet */
@@ -986,7 +985,7 @@ main(int argc, char **argv)
double T;
int precis;
 
-   (void)gettimeofday(&t2, &tz);
+   (void)gettimeofday(&t2, NULL);
i = packet_ok(packet, cc, from, seq);
/* Skip short packet */
if (i == 0)
@@ -1152,7 +1151,6 @@ wait_for_reply(register int sock, regist
fd_set *fdsp;
size_t nfds;
struct timeval now, wait;
-   struct timezone tz;
register int cc = 0;
register int error;
int fromlen = sizeof(*fromp);
@@ -1165,7 +1163,7 @@ wait_for_reply(register int sock, regist
 
wait.tv_sec = tp->tv_sec + waittime;
wait.tv_usec = tp->tv_usec;
-   (void)gettimeofday(&now, &tz);
+   (void)gettimeofday(&now, NULL);
tvsub(&wait, &now);
if (wait.tv_sec < 0) {
wait.tv_sec = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211063 - head/sys/conf

2010-08-08 Thread Bernhard Schmidt
Author: bschmidt
Date: Sun Aug  8 08:43:01 2010
New Revision: 211063
URL: http://svn.freebsd.org/changeset/base/211063

Log:
  License ACK is not required for the wpifw module nor when building
  it into the kernel.
  
  PR:   conf/148758
  Submitted by: Joe Talbott 
  MFC after:3 days

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sun Aug  8 08:22:53 2010(r211062)
+++ head/sys/conf/files Sun Aug  8 08:43:01 2010(r211063)
@@ -1859,7 +1859,7 @@ dev/wi/if_wi_pccard.c optional wi pccar
 dev/wi/if_wi_pci.c optional wi pci
 dev/wl/if_wl.c optional wl isa
 wpifw.coptional wpifw  
\
-   compile-with"${AWK} -f $S/tools/fw_stub.awk wpi.fw:wpifw:2144 
-lintel_wpi -mwpi -c${.TARGET}" \
+   compile-with"${AWK} -f $S/tools/fw_stub.awk wpi.fw:wpifw:2144 -mwpi 
-c${.TARGET}" \
no-implicit-rule before-depend local\
clean   "wpifw.c"
 wpifw.fwo  optional wpifw  \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211064 - stable/8/sys/geom/zero

2010-08-08 Thread Jaakko Heinonen
Author: jh
Date: Sun Aug  8 09:06:59 2010
New Revision: 211064
URL: http://svn.freebsd.org/changeset/base/211064

Log:
  MFC r207877:
  
  In g_zero_destroy_geom(), return 0 instead of EBUSY in the success case.
  EBUSY was probably used as a workaround for the deadlock fixed in r207671.

Modified:
  stable/8/sys/geom/zero/g_zero.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/geom/zero/g_zero.c
==
--- stable/8/sys/geom/zero/g_zero.c Sun Aug  8 08:43:01 2010
(r211063)
+++ stable/8/sys/geom/zero/g_zero.c Sun Aug  8 09:06:59 2010
(r211064)
@@ -104,7 +104,7 @@ g_zero_destroy_geom(struct gctl_req *req
if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)
return (EBUSY);
g_wither_geom(gp, ENXIO);
-   return (EBUSY);
+   return (0);
 }
 
 static struct g_class g_zero_class = {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211065 - stable/8/sys/geom/vinum

2010-08-08 Thread Jaakko Heinonen
Author: jh
Date: Sun Aug  8 09:12:30 2010
New Revision: 211065
URL: http://svn.freebsd.org/changeset/base/211065

Log:
  MFC r207878:
  
  - Don't return EAGAIN from gv_unload(). It was used to work around the
deadlock fixed in r207671.
  - Wait for worker process to exit at class unload. The worker process
was not guaranteed to exit before the linker unloaded the module.
  - Use 0 as the worker process exit status instead of ENXIO and style
the NOTREACHED comment.

Modified:
  stable/8/sys/geom/vinum/geom_vinum.c
  stable/8/sys/geom/vinum/geom_vinum.h
  stable/8/sys/geom/vinum/geom_vinum_events.c
  stable/8/sys/geom/vinum/geom_vinum_var.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/geom/vinum/geom_vinum.c
==
--- stable/8/sys/geom/vinum/geom_vinum.cSun Aug  8 09:06:59 2010
(r211064)
+++ stable/8/sys/geom/vinum/geom_vinum.cSun Aug  8 09:12:30 2010
(r211065)
@@ -187,7 +187,7 @@ gv_init(struct g_class *mp)
mtx_init(&sc->config_mtx, "gv_config", NULL, MTX_DEF);
mtx_init(&sc->equeue_mtx, "gv_equeue", NULL, MTX_DEF);
mtx_init(&sc->bqueue_mtx, "gv_bqueue", NULL, MTX_DEF);
-   kproc_create(gv_worker, sc, NULL, 0, 0, "gv_worker");
+   kproc_create(gv_worker, sc, &sc->worker, 0, 0, "gv_worker");
 }
 
 static int
@@ -201,10 +201,9 @@ gv_unload(struct gctl_req *req, struct g
sc = gp->softc;
 
if (sc != NULL) {
-   gv_post_event(sc, GV_EVENT_THREAD_EXIT, NULL, NULL, 0, 0);
+   gv_worker_exit(sc);
gp->softc = NULL;
g_wither_geom(gp, ENXIO);
-   return (EAGAIN);
}
 
return (0);
@@ -970,8 +969,8 @@ gv_worker(void *arg)
g_free(sc->bqueue_down);
g_free(sc->bqueue_up);
g_free(sc);
-   kproc_exit(ENXIO);
-   break;  /* not reached */
+   kproc_exit(0);
+   /* NOTREACHED */
 
default:
G_VINUM_DEBUG(1, "unknown event %d", ev->type);

Modified: stable/8/sys/geom/vinum/geom_vinum.h
==
--- stable/8/sys/geom/vinum/geom_vinum.hSun Aug  8 09:06:59 2010
(r211064)
+++ stable/8/sys/geom/vinum/geom_vinum.hSun Aug  8 09:12:30 2010
(r211065)
@@ -122,6 +122,7 @@ int  gv_detach_sd(struct gv_sd *, int)
 void   gv_worker(void *);
 void   gv_post_event(struct gv_softc *, int, void *, void *, intmax_t,
intmax_t);
+void   gv_worker_exit(struct gv_softc *);
 struct gv_event *gv_get_event(struct gv_softc *);
 void   gv_remove_event(struct gv_softc *, struct gv_event *);
 void   gv_drive_tasted(struct gv_softc *, struct g_provider *);

Modified: stable/8/sys/geom/vinum/geom_vinum_events.c
==
--- stable/8/sys/geom/vinum/geom_vinum_events.c Sun Aug  8 09:06:59 2010
(r211064)
+++ stable/8/sys/geom/vinum/geom_vinum_events.c Sun Aug  8 09:12:30 2010
(r211065)
@@ -58,6 +58,20 @@ gv_post_event(struct gv_softc *sc, int e
mtx_unlock(&sc->equeue_mtx);
 }
 
+void
+gv_worker_exit(struct gv_softc *sc)
+{
+   struct gv_event *ev;
+
+   ev = g_malloc(sizeof(*ev), M_WAITOK | M_ZERO);
+   ev->type = GV_EVENT_THREAD_EXIT;
+
+   mtx_lock(&sc->equeue_mtx);
+   TAILQ_INSERT_TAIL(&sc->equeue, ev, events);
+   wakeup(sc);
+   msleep(sc->worker, &sc->equeue_mtx, PDROP, "gv_wor", 0);
+}
+
 struct gv_event *
 gv_get_event(struct gv_softc *sc)
 {

Modified: stable/8/sys/geom/vinum/geom_vinum_var.h
==
--- stable/8/sys/geom/vinum/geom_vinum_var.hSun Aug  8 09:06:59 2010
(r211064)
+++ stable/8/sys/geom/vinum/geom_vinum_var.hSun Aug  8 09:12:30 2010
(r211065)
@@ -238,6 +238,7 @@ struct gv_softc {
struct bio_queue_head   *bqueue_up; /* BIO queue for completed
   requests. */
struct g_geom   *geom;  /* Pointer to our VINUM geom. */
+   struct proc *worker;/* Worker process. */
 };
 #endif
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all

svn commit: r211066 - head/share/termcap

2010-08-08 Thread Gavin Atkinson
Author: gavin
Date: Sun Aug  8 09:40:09 2010
New Revision: 211066
URL: http://svn.freebsd.org/changeset/base/211066

Log:
  Add a termcap entry for rxvt-256color.
  
  PR:   conf/147726
  Submitted by: Sterling (Chip) Camden 
  MFC after:2 weeks

Modified:
  head/share/termcap/termcap.src

Modified: head/share/termcap/termcap.src
==
--- head/share/termcap/termcap.src  Sun Aug  8 09:12:30 2010
(r211065)
+++ head/share/termcap/termcap.src  Sun Aug  8 09:40:09 2010
(r211066)
@@ -4631,6 +4631,9 @@ rxvt-unicode|rxvt-unicode terminal (X Wi
 rxvt|rxvt terminal emulator (X Window System):\
:pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono:
 
+rxvt-256color|rxvt terminal emulator with 256 colors:\
+   :Co#256:AF=\E[38;5;%dm:AB=\E[48;5;%dm:tc=rxvt-unicode:
+
 # Termcap entry for Eterm, taken from the sources of Eterm-0.9.2
 Eterm|Eterm Terminal Emulator (X11 Window System):\
:am:bw:eo:km:mi:ms:xn:xo:\
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211067 - stable/8/sys/fs/devfs

2010-08-08 Thread Jaakko Heinonen
Author: jh
Date: Sun Aug  8 12:19:49 2010
New Revision: 211067
URL: http://svn.freebsd.org/changeset/base/211067

Log:
  MFC r208717:
  
  Don't try to call cdevsw d_close() method when devfs_close() is called
  because of insmntque1() failure.

Modified:
  stable/8/sys/fs/devfs/devfs_vnops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/fs/devfs/devfs_vnops.c
==
--- stable/8/sys/fs/devfs/devfs_vnops.c Sun Aug  8 09:40:09 2010
(r211066)
+++ stable/8/sys/fs/devfs/devfs_vnops.c Sun Aug  8 12:19:49 2010
(r211067)
@@ -459,6 +459,13 @@ devfs_close(struct vop_close_args *ap)
int vp_locked, error;
 
/*
+* XXX: Don't call d_close() if we were called because of
+* XXX: insmntque1() failure.
+*/
+   if (vp->v_data == NULL)
+   return (0);
+
+   /*
 * Hack: a tty device that is a controlling terminal
 * has a reference from the session structure.
 * We cannot easily tell that a character device is
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211068 - head/sys/mips/mips

2010-08-08 Thread Jayachandran C.
Author: jchandra
Date: Sun Aug  8 12:23:02 2010
New Revision: 211068
URL: http://svn.freebsd.org/changeset/base/211068

Log:
  loadandclear() for PTEs are not needed on MIPS. The PTEs are software
  managed and we already take pmap lock for PTE operations(see r210922)
  
  Reviewed by:  alc

Modified:
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/mips/pmap.c
==
--- head/sys/mips/mips/pmap.c   Sun Aug  8 12:19:49 2010(r211067)
+++ head/sys/mips/mips/pmap.c   Sun Aug  8 12:23:02 2010(r211068)
@@ -1352,9 +1352,11 @@ retry:
pmap->pm_stats.resident_count--;
pte = pmap_pte(pmap, va);
KASSERT(pte != NULL, ("pte"));
-   oldpte = loadandclear((u_int *)pte);
+   oldpte = *pte;
if (is_kernel_pmap(pmap))
*pte = PTE_G;
+   else
+   *pte = 0;
KASSERT(!pte_test(&oldpte, PTE_W),
("wired pte for unwired page"));
if (m->md.pv_flags & PV_TABLE_REF)
@@ -1494,9 +1496,11 @@ pmap_remove_pte(struct pmap *pmap, pt_en
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
 
-   oldpte = loadandclear((u_int *)ptq);
+   oldpte = *ptq;
if (is_kernel_pmap(pmap))
*ptq = PTE_G;
+   else
+   *ptq = 0;
 
if (pte_test(&oldpte, PTE_W))
pmap->pm_stats.wired_count -= 1;
@@ -1657,9 +1661,11 @@ pmap_remove_all(vm_page_t m)
 
pte = pmap_pte(pv->pv_pmap, pv->pv_va);
 
-   tpte = loadandclear((u_int *)pte);
+   tpte = *pte;
if (is_kernel_pmap(pv->pv_pmap))
*pte = PTE_G;
+   else
+   *pte = 0;
 
if (pte_test(&tpte, PTE_W))
pv->pv_pmap->pm_stats.wired_count--;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211069 - stable/8/etc/rc.d

2010-08-08 Thread Jilles Tjoelker
Author: jilles
Date: Sun Aug  8 13:43:20 2010
New Revision: 211069
URL: http://svn.freebsd.org/changeset/base/211069

Log:
  MFC r210734: Allow starting ipmon if ipnat is enabled but ipfilter is not
  (in /etc/rc.conf).
  
  This fixes an apparent confusion between test(1) and sh(1) syntax for
  AND/OR.
  
  PR:   conf/149036
  Submitted by: pluknet

Modified:
  stable/8/etc/rc.d/ipmon
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/rc.d/ipmon
==
--- stable/8/etc/rc.d/ipmon Sun Aug  8 12:23:02 2010(r211068)
+++ stable/8/etc/rc.d/ipmon Sun Aug  8 13:43:20 2010(r211069)
@@ -20,7 +20,7 @@ ipmon_precmd()
# Continue only if ipfilter or ipnat is enabled and the
# ipfilter module is loaded.
#
-   if ! checkyesno ipfilter_enable -o ! checkyesno ipnat_enable ; then
+   if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then
err 1  "${name} requires either ipfilter or ipnat enabled"
fi
if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1; then
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211070 - stable/7/etc/rc.d

2010-08-08 Thread Jilles Tjoelker
Author: jilles
Date: Sun Aug  8 13:45:47 2010
New Revision: 211070
URL: http://svn.freebsd.org/changeset/base/211070

Log:
  MFC r210734: Allow starting ipmon if ipnat is enabled but ipfilter is not
  (in /etc/rc.conf).
  
  This fixes an apparent confusion between test(1) and sh(1) syntax for
  AND/OR.
  
  PR:   conf/149036
  Submitted by: pluknet

Modified:
  stable/7/etc/rc.d/ipmon
Directory Properties:
  stable/7/etc/   (props changed)

Modified: stable/7/etc/rc.d/ipmon
==
--- stable/7/etc/rc.d/ipmon Sun Aug  8 13:43:20 2010(r211069)
+++ stable/7/etc/rc.d/ipmon Sun Aug  8 13:45:47 2010(r211070)
@@ -20,7 +20,7 @@ ipmon_precmd()
# Continue only if ipfilter or ipnat is enabled and the
# ipfilter module is loaded.
#
-   if ! checkyesno ipfilter_enable -o ! checkyesno ipnat_enable ; then
+   if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then
err 1  "${name} requires either ipfilter or ipnat enabled"
fi
if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1; then
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211071 - in head/sys/sparc64: include sparc64

2010-08-08 Thread Marius Strobl
Author: marius
Date: Sun Aug  8 14:00:21 2010
New Revision: 211071
URL: http://svn.freebsd.org/changeset/base/211071

Log:
  - As it is not possible for sched_bind(9) to context switch with
td_critnest > 1 when not already running on the desired CPU read the
TICK counter of the BSP via a direct cross trap request in that case
instead.
  - Treat the STICK based timecounter the same way as the TICK based one
regarding its quality and obtaining the counter value from the BSP.
Like the TICK timers the STICK ones also are only synchronized during
their startup (which might not result in good synchronicity in the
first place) but not afterwards and might drift over time, causing
problems when the time is read from different CPUs (see r135972).

Modified:
  head/sys/sparc64/include/smp.h
  head/sys/sparc64/sparc64/genassym.c
  head/sys/sparc64/sparc64/mp_exception.S
  head/sys/sparc64/sparc64/mp_machdep.c
  head/sys/sparc64/sparc64/tick.c

Modified: head/sys/sparc64/include/smp.h
==
--- head/sys/sparc64/include/smp.h  Sun Aug  8 13:45:47 2010
(r211070)
+++ head/sys/sparc64/include/smp.h  Sun Aug  8 14:00:21 2010
(r211071)
@@ -81,6 +81,11 @@ struct ipi_cache_args {
vm_paddr_t ica_pa;
 };
 
+struct ipi_rd_args {
+   u_int   ira_mask;
+   register_t *ira_val;
+};
+
 struct ipi_tlb_args {
u_int   ita_mask;
struct  pmap *ita_pmap;
@@ -105,6 +110,7 @@ voidmp_init(u_int cpu_impl);
 
 extern struct mtx ipi_mtx;
 extern struct ipi_cache_args ipi_cache_args;
+extern struct ipi_rd_args ipi_rd_args;
 extern struct ipi_tlb_args ipi_tlb_args;
 
 extern char *mp_tramp_code;
@@ -119,6 +125,10 @@ extern char tl_ipi_spitfire_dcache_page_
 extern char tl_ipi_spitfire_icache_page_inval[];
 
 extern char tl_ipi_level[];
+
+extern char tl_ipi_stick_rd[];
+extern char tl_ipi_tick_rd[];
+
 extern char tl_ipi_tlb_context_demap[];
 extern char tl_ipi_tlb_page_demap[];
 extern char tl_ipi_tlb_range_demap[];
@@ -179,6 +189,22 @@ ipi_icache_page_inval(void *func, vm_pad
 }
 
 static __inline void *
+ipi_rd(u_int cpu, void *func, u_long *val)
+{
+   struct ipi_rd_args *ira;
+
+   if (smp_cpus == 1)
+   return (NULL);
+   sched_pin();
+   ira = &ipi_rd_args;
+   mtx_lock_spin(&ipi_mtx);
+   ira->ira_mask = 1 << cpu | PCPU_GET(cpumask);
+   ira->ira_val = val;
+   cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira);
+   return (&ira->ira_mask);
+}
+
+static __inline void *
 ipi_tlb_context_demap(struct pmap *pm)
 {
struct ipi_tlb_args *ita;
@@ -283,6 +309,13 @@ ipi_icache_page_inval(void *func __unuse
 }
 
 static __inline void *
+ipi_rd(u_int cpu __unused, void *func __unused, u_long *val __unused)
+{
+
+   return (NULL);
+}
+
+static __inline void *
 ipi_tlb_context_demap(struct pmap *pm __unused)
 {
 

Modified: head/sys/sparc64/sparc64/genassym.c
==
--- head/sys/sparc64/sparc64/genassym.c Sun Aug  8 13:45:47 2010
(r211070)
+++ head/sys/sparc64/sparc64/genassym.c Sun Aug  8 14:00:21 2010
(r211071)
@@ -216,6 +216,9 @@ ASSYM(IR_PRI, offsetof(struct intr_reque
 ASSYM(IR_VEC, offsetof(struct intr_request, ir_vec));
 
 #ifdef SMP
+ASSYM(IRA_MASK, offsetof(struct ipi_rd_args, ira_mask));
+ASSYM(IRA_VAL, offsetof(struct ipi_rd_args, ira_val));
+
 ASSYM(ITA_MASK, offsetof(struct ipi_tlb_args, ita_mask));
 ASSYM(ITA_PMAP, offsetof(struct ipi_tlb_args, ita_pmap));
 ASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start));

Modified: head/sys/sparc64/sparc64/mp_exception.S
==
--- head/sys/sparc64/sparc64/mp_exception.S Sun Aug  8 13:45:47 2010
(r211070)
+++ head/sys/sparc64/sparc64/mp_exception.S Sun Aug  8 14:00:21 2010
(r211071)
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
  */
 ENTRY(tl_ipi_spitfire_dcache_page_inval)
 #if KTR_COMPILE & KTR_SMP
-   CATR(KTR_SMP, "ipi_dcache_page_inval: pa=%#lx"
+   CATR(KTR_SMP, "tl_ipi_spitfire_dcache_page_inval: pa=%#lx"
, %g1, %g2, %g3, 7, 8, 9)
ldx [%g5 + ICA_PA], %g2
stx %g2, [%g1 + KTR_PARM1]
@@ -87,7 +87,7 @@ END(tl_ipi_spitfire_dcache_page_inval)
  */
 ENTRY(tl_ipi_spitfire_icache_page_inval)
 #if KTR_COMPILE & KTR_SMP
-   CATR(KTR_SMP, "ipi_icache_page_inval: pa=%#lx"
+   CATR(KTR_SMP, "tl_ipi_spitfire_icache_page_inval: pa=%#lx"
, %g1, %g2, %g3, 7, 8, 9)
ldx [%g5 + ICA_PA], %g2
stx %g2, [%g1 + KTR_PARM1]
@@ -126,7 +126,7 @@ END(tl_ipi_spitfire_icache_page_inval)
  */
 ENTRY(tl_ipi_cheetah_dcache_page_inval)
 #if KTR_COMPILE & KTR_SMP
-   CATR(KTR_SMP, "ipi_dcache_page_inval: pa=%#lx"
+   CATR(KTR_SMP, "tl_ipi_cheetah_dcache_page_inval: pa=%#lx"
, %g1, %g2, %g3, 7, 8, 9)
ldx   

svn commit: r211072 - stable/6/etc/rc.d

2010-08-08 Thread Jilles Tjoelker
Author: jilles
Date: Sun Aug  8 14:13:10 2010
New Revision: 211072
URL: http://svn.freebsd.org/changeset/base/211072

Log:
  MFC r210734: Allow starting ipmon if ipnat is enabled but ipfilter is not
  (in /etc/rc.conf).
  
  This fixes an apparent confusion between test(1) and sh(1) syntax for
  AND/OR.
  
  PR:   conf/149036
  Submitted by: pluknet

Modified:
  stable/6/etc/rc.d/ipmon
Directory Properties:
  stable/6/etc/   (props changed)

Modified: stable/6/etc/rc.d/ipmon
==
--- stable/6/etc/rc.d/ipmon Sun Aug  8 14:00:21 2010(r211071)
+++ stable/6/etc/rc.d/ipmon Sun Aug  8 14:13:10 2010(r211072)
@@ -20,7 +20,7 @@ ipmon_precmd()
# Continue only if ipfilter or ipnat is enabled and the
# ipfilter module is loaded.
#
-   if ! checkyesno ipfilter_enable -o ! checkyesno ipnat_enable ; then
+   if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then
err 1  "${name} requires either ipfilter or ipnat enabled"
fi
if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1; then
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211073 - head/sys/sparc64/sparc64

2010-08-08 Thread Marius Strobl
Author: marius
Date: Sun Aug  8 14:37:16 2010
New Revision: 211073
URL: http://svn.freebsd.org/changeset/base/211073

Log:
  Wrap some sun4u-only symbols.

Modified:
  head/sys/sparc64/sparc64/genassym.c

Modified: head/sys/sparc64/sparc64/genassym.c
==
--- head/sys/sparc64/sparc64/genassym.c Sun Aug  8 14:13:10 2010
(r211072)
+++ head/sys/sparc64/sparc64/genassym.c Sun Aug  8 14:37:16 2010
(r211073)
@@ -105,10 +105,6 @@ ASSYM(IC_SIZE, offsetof(struct cacheinfo
 ASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize));
 #endif
 
-#ifdef SMP
-ASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa));
-#endif
-
 ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry));
 ASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line));
 ASSYM(KTR_FILE, offsetof(struct ktr_entry, ktr_file));
@@ -215,7 +211,9 @@ ASSYM(IR_ARG, offsetof(struct intr_reque
 ASSYM(IR_PRI, offsetof(struct intr_request, ir_pri));
 ASSYM(IR_VEC, offsetof(struct intr_request, ir_vec));
 
-#ifdef SMP
+#if defined(SUN4U) && defined(SMP)
+ASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa));
+
 ASSYM(IRA_MASK, offsetof(struct ipi_rd_args, ira_mask));
 ASSYM(IRA_VAL, offsetof(struct ipi_rd_args, ira_val));
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211074 - stable/8/etc

2010-08-08 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Aug  8 15:29:27 2010
New Revision: 211074
URL: http://svn.freebsd.org/changeset/base/211074

Log:
  MFC r210861: /etc/rc.d/ip6fw was deprecated.

Modified:
  stable/8/etc/netstart

Modified: stable/8/etc/netstart
==
--- stable/8/etc/netstart   Sun Aug  8 14:37:16 2010(r211073)
+++ stable/8/etc/netstart   Sun Aug  8 15:29:27 2010(r211074)
@@ -55,7 +55,6 @@ _start=quietstart
 /etc/rc.d/dhclient ${_start}
 /etc/rc.d/ppp ${_start}
 /etc/rc.d/ipfw ${_start}
-/etc/rc.d/ip6fw ${_start}
 /etc/rc.d/network_ipv6 ${_start}
 /etc/rc.d/routing ${_start}
 /etc/rc.d/mroute6d ${_start}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211077 - head/release/picobsd/tinyware/login

2010-08-08 Thread Gavin Atkinson
Author: gavin
Date: Sun Aug  8 16:20:32 2010
New Revision: 211077
URL: http://svn.freebsd.org/changeset/base/211077

Log:
  Correct two error messages to match the failure they are reporting.
  
  MFC after:1 week

Modified:
  head/release/picobsd/tinyware/login/pico-login.c

Modified: head/release/picobsd/tinyware/login/pico-login.c
==
--- head/release/picobsd/tinyware/login/pico-login.cSun Aug  8 15:44:43 
2010(r211076)
+++ head/release/picobsd/tinyware/login/pico-login.cSun Aug  8 16:20:32 
2010(r211077)
@@ -538,10 +538,10 @@ main(argc, argv)
 * devices, we just clear them.
 */
if (chflags(ttyn, 0) && errno != EOPNOTSUPP)
-   syslog(LOG_ERR, "chmod(%s): %m", ttyn);
+   syslog(LOG_ERR, "chflags(%s): %m", ttyn);
if (chown(ttyn, pwd->pw_uid,
(gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid))
-   syslog(LOG_ERR, "chmod(%s): %m", ttyn);
+   syslog(LOG_ERR, "chown(%s): %m", ttyn);
 
 
/*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211079 - head/release/picobsd/tinyware/login

2010-08-08 Thread Gavin Atkinson
Author: gavin
Date: Sun Aug  8 16:55:27 2010
New Revision: 211079
URL: http://svn.freebsd.org/changeset/base/211079

Log:
  Merge r114010 of head/usr.bin/login/login.c into PicoBSD's login.c:
  
  Correct the login.conf variable name used for obtaining the login prompt.
  
  PR:   conf/44717 (indirectly)
  Spotted by:   gcooper
  MFC after:1 week

Modified:
  head/release/picobsd/tinyware/login/pico-login.c

Modified: head/release/picobsd/tinyware/login/pico-login.c
==
--- head/release/picobsd/tinyware/login/pico-login.cSun Aug  8 16:52:47 
2010(r211078)
+++ head/release/picobsd/tinyware/login/pico-login.cSun Aug  8 16:55:27 
2010(r211079)
@@ -279,7 +279,8 @@ main(argc, argv)
 * Get "login-retries" & "login-backoff" from default class
 */
lc = login_getclass(NULL);
-   prompt = login_getcapstr(lc, "prompt", DEFAULT_PROMPT, DEFAULT_PROMPT);
+   prompt = login_getcapstr(lc, "login_prompt",
+   DEFAULT_PROMPT, DEFAULT_PROMPT);
passwd_prompt = login_getcapstr(lc, "passwd_prompt",
DEFAULT_PASSWD_PROMPT, DEFAULT_PASSWD_PROMPT);
retries = login_getcapnum(lc, "login-retries", DEFAULT_RETRIES,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211080 - head/tools/regression/bin/sh/expansion

2010-08-08 Thread Jilles Tjoelker
Author: jilles
Date: Sun Aug  8 17:03:23 2010
New Revision: 211080
URL: http://svn.freebsd.org/changeset/base/211080

Log:
  sh: Add more testcases for ${var:-word}.
  
  Whether POSIX requires these is unclear.
  
  They pass with 8-stable sh as well.

Added:
  head/tools/regression/bin/sh/expansion/plus-minus4.0   (contents, props 
changed)

Added: head/tools/regression/bin/sh/expansion/plus-minus4.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/plus-minus4.0Sun Aug  8 
17:03:23 2010(r211080)
@@ -0,0 +1,38 @@
+# $FreeBSD$
+
+# These may be a bit unclear in the POSIX spec or the proposed revisions,
+# and conflict with bash's interpretation, but I think ksh93's interpretation
+# makes most sense. In particular, it makes no sense to me that single-quotes
+# must match but are not removed.
+
+e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}'
+h='##'
+failures=''
+ok=''
+
+testcase() {
+   code="$1"
+   expected="$2"
+   oIFS="$IFS"
+   eval "$code"
+   IFS='|'
+   result="$#|$*"
+   IFS="$oIFS"
+   if [ "x$result" = "x$expected" ]; then
+   ok=x$ok
+   else
+   failures=x$failures
+   echo "For $code, expected $expected actual $result"
+   fi
+}
+
+testcase 'set -- ${e:-'"'"'}'"'"'}''1|}'
+testcase "set -- \${e:-\\'}"   "1|'"
+testcase "set -- \${e:-\\'\\'}""1|''"
+testcase "set -- \"\${e:-'}\"" "1|'"
+testcase "set -- \"\${e:-'}'}\""   "1|''}"
+testcase "set -- \"\${e:-''}\"""1|''"
+testcase 'set -- ${e:-\a}' '1|a'
+testcase 'set -- "${e:-\a}"'   '1|\a'
+
+test "x$failures" = x
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211081 - stable/7/sys/dev/usb

2010-08-08 Thread Gavin Atkinson
Author: gavin
Date: Sun Aug  8 19:07:59 2010
New Revision: 211081
URL: http://svn.freebsd.org/changeset/base/211081

Log:
  Fix mismerge in r211035.
  
  Pointy hat:   me

Modified:
  stable/7/sys/dev/usb/u3g.c

Modified: stable/7/sys/dev/usb/u3g.c
==
--- stable/7/sys/dev/usb/u3g.c  Sun Aug  8 17:03:23 2010(r211080)
+++ stable/7/sys/dev/usb/u3g.c  Sun Aug  8 19:07:59 2010(r211081)
@@ -194,7 +194,7 @@ static const struct u3g_dev_type_s u3g_d
{{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CGU628 },
U3GSP_HSDPA,U3GINIT_CMOTECH },
{{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_DISK },  
U3GSP_HSDPA,U3GINIT_NONE },
/* OEM: Longcheer */
-   { USB_VENDOR_LONGCHEER, USB_PRODUCT_LONGCHEER_WM66 },   
U3GSP_HSDPA,U3GINIT_HUAWEI },
+   {{ USB_VENDOR_LONGCHEER, USB_PRODUCT_LONGCHEER_WM66 },  
U3GSP_HSDPA,U3GINIT_HUAWEI },
 };
 #define u3g_lookup(v, p) ((const struct u3g_dev_type_s *)usb_lookup(u3g_devs, 
v, p))
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211082 - in head/sys: amd64/amd64 i386/i386

2010-08-08 Thread David Malone
Author: dwmalone
Date: Sun Aug  8 20:34:53 2010
New Revision: 211082
URL: http://svn.freebsd.org/changeset/base/211082

Log:
  Don't pass sizeof(u_int) to an argument of SYSCLT_PROC that ends up not
  being used.

Modified:
  head/sys/amd64/amd64/tsc.c
  head/sys/i386/i386/tsc.c

Modified: head/sys/amd64/amd64/tsc.c
==
--- head/sys/amd64/amd64/tsc.c  Sun Aug  8 19:07:59 2010(r211081)
+++ head/sys/amd64/amd64/tsc.c  Sun Aug  8 20:34:53 2010(r211082)
@@ -222,7 +222,7 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_A
 }
 
 SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_QUAD | CTLFLAG_RW,
-0, sizeof(u_int), sysctl_machdep_tsc_freq, "QU", "");
+0, 0, sysctl_machdep_tsc_freq, "QU", "");
 
 static unsigned
 tsc_get_timecount(struct timecounter *tc)

Modified: head/sys/i386/i386/tsc.c
==
--- head/sys/i386/i386/tsc.cSun Aug  8 19:07:59 2010(r211081)
+++ head/sys/i386/i386/tsc.cSun Aug  8 20:34:53 2010(r211082)
@@ -250,7 +250,7 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_A
 }
 
 SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_QUAD | CTLFLAG_RW,
-0, sizeof(u_int), sysctl_machdep_tsc_freq, "QU", "");
+0, 0, sysctl_machdep_tsc_freq, "QU", "");
 
 static unsigned
 tsc_get_timecount(struct timecounter *tc)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211083 - head/sys/dev/usb/serial

2010-08-08 Thread Gavin Atkinson
Author: gavin
Date: Sun Aug  8 20:53:00 2010
New Revision: 211083
URL: http://svn.freebsd.org/changeset/base/211083

Log:
  The PL2302X can support any baud rate <= 6Mbps, allow any rate to be set.
  
  PR:   usb/128324
  Submitted by: Mike Durian  (original patch)
  MFC after:2 weeks

Modified:
  head/sys/dev/usb/serial/uplcom.c

Modified: head/sys/dev/usb/serial/uplcom.c
==
--- head/sys/dev/usb/serial/uplcom.cSun Aug  8 20:34:53 2010
(r211082)
+++ head/sys/dev/usb/serial/uplcom.cSun Aug  8 20:53:00 2010
(r211083)
@@ -599,25 +599,33 @@ static const int32_t uplcom_rates[] = {
 static int
 uplcom_pre_param(struct ucom_softc *ucom, struct termios *t)
 {
+   struct uplcom_softc *sc = ucom->sc_parent;
uint8_t i;
 
DPRINTF("\n");
 
-   /* check requested baud rate */
-
-   for (i = 0;; i++) {
-
-   if (i != N_UPLCOM_RATES) {
-   if (uplcom_rates[i] == t->c_ospeed) {
-   break;
-   }
-   } else {
-   DPRINTF("invalid baud rate (%d)\n", t->c_ospeed);
-   return (EIO);
+   /**
+* Check requested baud rate.
+*
+* The PL2303 can only set specific baud rates, up to 1228800 baud.
+* The PL2303X can set any baud rate up to 6Mb.
+* The PL2303HX rev. D can set any baud rate up to 12Mb.
+*
+* XXX: We currently cannot identify the PL2303HX rev. D, so treat
+*  it the same as the PL2303X.
+*/
+   if (sc->sc_chiptype == TYPE_PL2303) {
+   for (i = 0; i < N_UPLCOM_RATES; i++) {
+   if (uplcom_rates[i] == t->c_ospeed)
+   return (0);
}
+   } else {
+   if (t->c_ospeed <= 600)
+   return (0);
}
 
-   return (0);
+   DPRINTF("uplcom_param: bad baud rate (%d)\n", t->c_ospeed);
+   return (EIO);
 }
 
 static void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211084 - head/bin/sh

2010-08-08 Thread Jilles Tjoelker
Author: jilles
Date: Sun Aug  8 21:04:27 2010
New Revision: 211084
URL: http://svn.freebsd.org/changeset/base/211084

Log:
  Remove unnecessary duplicate letters in mksyntax.c,
  the table elements would just be overwritten twice.

Modified:
  head/bin/sh/mksyntax.c

Modified: head/bin/sh/mksyntax.c
==
--- head/bin/sh/mksyntax.c  Sun Aug  8 20:53:00 2010(r211083)
+++ head/bin/sh/mksyntax.c  Sun Aug  8 21:04:27 2010(r211084)
@@ -241,8 +241,8 @@ main(int argc __unused, char **argv __un
filltable("0");
fputs("\n/* character classification table */\n", cfile);
add("0123456789", "ISDIGIT");
-   add("abcdefghijklmnopqrstucvwxyz", "ISLOWER");
-   add("ABCDEFGHIJKLMNOPQRSTUCVWXYZ", "ISUPPER");
+   add("abcdefghijklmnopqrstuvwxyz", "ISLOWER");
+   add("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "ISUPPER");
add("_", "ISUNDER");
add("#?$!-*@", "ISSPECL");
print("is_type");
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-08 Thread Oliver Fromme

M. Warner Losh wrote:
 > In message: <201008071620.o77gkdbb091...@svn.freebsd.org>
 > Oliver Fromme  writes:
 > : Author: olli
 > : Date: Sat Aug  7 16:20:12 2010
 > : New Revision: 211023
 > : URL: http://svn.freebsd.org/changeset/base/211023
 > : Modified: head/usr.sbin/syslogd/Makefile
 > : 
 > ==
 > : --- head/usr.sbin/syslogd/Makefile Sat Aug  7 16:14:40 2010
 > (r211022)
 > : +++ head/usr.sbin/syslogd/Makefile Sat Aug  7 16:20:12 2010
 > (r211023)
 > : @@ -12,7 +12,7 @@ SRCS=syslogd.c ttymsg.c
 > :  DPADD=${LIBUTIL}
 > :  LDADD=-lutil
 > :  
 > : -WARNS?=   3
 > : +WARNS?=   6
 > :  
 > :  .if ${MK_INET6_SUPPORT} != "no"
 > :  CFLAGS+= -DINET6
 > 
 > This breaks MIPS, so I've reverted it.  Please make sure that all
 > architectures work when bumping up WARNS.

Thanks for fixing it for me.

I did make the universe check, but apparently I did something
wrong, so I didn't notice the problem.  I'm sorry for that.

Best regards
   Oliver

-- 
``We are all but compressed light'' (Albert Einstein)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r211084 - head/bin/sh

2010-08-08 Thread Colin Percival
On 08/08/10 14:04, Jilles Tjoelker wrote:
> Log:
>   Remove unnecessary duplicate letters in mksyntax.c,
>   the table elements would just be overwritten twice.
> - add("abcdefghijklmnopqrstucvwxyz", "ISLOWER");
> - add("ABCDEFGHIJKLMNOPQRSTUCVWXYZ", "ISUPPER");
> + add("abcdefghijklmnopqrstuvwxyz", "ISLOWER");
> + add("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "ISUPPER");

Ok, I have to wonder: Why was there ever the extra 'C' between 'U' and 'V'?
It seems that it has been there ever since 4.4-Lite, but I don't have access
to historical sources beyond that point.

-- 
Colin Percival
Security Officer, FreeBSD | freebsd.org | The power to serve
Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r211084 - head/bin/sh

2010-08-08 Thread Dimitry Andric
On 2010-08-08 23:19, Colin Percival wrote:
> On 08/08/10 14:04, Jilles Tjoelker wrote:
>> Log:
>>   Remove unnecessary duplicate letters in mksyntax.c,
>>   the table elements would just be overwritten twice.
>> -add("abcdefghijklmnopqrstucvwxyz", "ISLOWER");
>> -add("ABCDEFGHIJKLMNOPQRSTUCVWXYZ", "ISUPPER");
>> +add("abcdefghijklmnopqrstuvwxyz", "ISLOWER");
>> +add("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "ISUPPER");
> 
> Ok, I have to wonder: Why was there ever the extra 'C' between 'U' and 'V'?
> It seems that it has been there ever since 4.4-Lite, but I don't have access
> to historical sources beyond that point.

My first guess would be a typo, since C is next to V on most keyboard
layouts... :)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r211021 - head/sys/dev/usb

2010-08-08 Thread Gavin Atkinson
On Sat, 7 Aug 2010, M. Warner Losh wrote:
> In message: <201008071608.o77g8bnn088...@svn.freebsd.org>
> Gavin Atkinson  writes:
> : Author: gavin
> : Date: Sat Aug  7 16:08:37 2010
> : New Revision: 211021
> : URL: http://svn.freebsd.org/changeset/base/211021
> : 
> : Log:
> :   Sort this file a little better: the vendors are supposed to be sorted by
> :   vendor ID in the vendor section, and by symbolic name in the product
> :   section.  Products are sorted by product ID.  While here, get rid of a
> :   duplicate Microsoft Mouse entry, revealed by sorting.
> 
> I thought products were sorted by the ID number, not the ID name.

Yes, within a manufacturer, products should be sorted by ID.  Each 
manufacturer section is sorted by the symbolic manufacturer name, though.  

I'm not which one of us is misunderstanding the other - do you think my 
change is somehow wrong?

Thanks,

Gavin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r211084 - head/bin/sh

2010-08-08 Thread Doug Barton
On 08/08/2010 14:19, Colin Percival wrote:
> On 08/08/10 14:04, Jilles Tjoelker wrote:
>> Log:
>>   Remove unnecessary duplicate letters in mksyntax.c,

Boo!

>>   the table elements would just be overwritten twice.
>> -add("abcdefghijklmnopqrstucvwxyz", "ISLOWER");
>> -add("ABCDEFGHIJKLMNOPQRSTUCVWXYZ", "ISUPPER");
>> +add("abcdefghijklmnopqrstuvwxyz", "ISLOWER");
>> +add("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "ISUPPER");
> 
> Ok, I have to wonder: Why was there ever the extra 'C' between 'U' and 'V'?
> It seems that it has been there ever since 4.4-Lite, but I don't have access
> to historical sources beyond that point.

I think y'all are forgetting where the B in BSD comes from.


Doug

-- 

Improve the effectiveness of your Internet presence with
a domain name makeover!http://SupersetSolutions.com/

Computers are useless. They can only give you answers.
-- Pablo Picasso

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-08 Thread M. Warner Losh
In message: <201008082037.o78kbldt022...@haluter.fromme.com>
Oliver Fromme  writes:
: 
: M. Warner Losh wrote:
:  > In message: <201008071620.o77gkdbb091...@svn.freebsd.org>
:  > Oliver Fromme  writes:
:  > : Author: olli
:  > : Date: Sat Aug  7 16:20:12 2010
:  > : New Revision: 211023
:  > : URL: http://svn.freebsd.org/changeset/base/211023
:  > : Modified: head/usr.sbin/syslogd/Makefile
:  > : 
==
:  > : --- head/usr.sbin/syslogd/Makefile   Sat Aug  7 16:14:40 2010
(r211022)
:  > : +++ head/usr.sbin/syslogd/Makefile   Sat Aug  7 16:20:12 2010
(r211023)
:  > : @@ -12,7 +12,7 @@ SRCS=  syslogd.c ttymsg.c
:  > :  DPADD=  ${LIBUTIL}
:  > :  LDADD=  -lutil
:  > :  
:  > : -WARNS?= 3
:  > : +WARNS?= 6
:  > :  
:  > :  .if ${MK_INET6_SUPPORT} != "no"
:  > :  CFLAGS+= -DINET6
:  > 
:  > This breaks MIPS, so I've reverted it.  Please make sure that all
:  > architectures work when bumping up WARNS.
: 
: Thanks for fixing it for me.
: 
: I did make the universe check, but apparently I did something
: wrong, so I didn't notice the problem.  I'm sorry for that.

The casting that syslogd does with struct sockaddrFOO is what triggers
it.  I'm not sure how to fix it, so there's about 6 or 8 programs in
the tree that have WARNS lowered to 3 because of it.

Warner
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r211021 - head/sys/dev/usb

2010-08-08 Thread M. Warner Losh
In message: 
Gavin Atkinson  writes:
: On Sat, 7 Aug 2010, M. Warner Losh wrote:
: > In message: <201008071608.o77g8bnn088...@svn.freebsd.org>
: > Gavin Atkinson  writes:
: > : Author: gavin
: > : Date: Sat Aug  7 16:08:37 2010
: > : New Revision: 211021
: > : URL: http://svn.freebsd.org/changeset/base/211021
: > : 
: > : Log:
: > :   Sort this file a little better: the vendors are supposed to be sorted by
: > :   vendor ID in the vendor section, and by symbolic name in the product
: > :   section.  Products are sorted by product ID.  While here, get rid of a
: > :   duplicate Microsoft Mouse entry, revealed by sorting.
: > 
: > I thought products were sorted by the ID number, not the ID name.
: 
: Yes, within a manufacturer, products should be sorted by ID.  Each 
: manufacturer section is sorted by the symbolic manufacturer name, though.  

Within each product section, the products are sorted by numeric id,
not symbolic id.  That's how it was when I was maintaining this file,
and is how pccarddevs also works.

eg:

product ALCOR SDCR_6335 0x6335  SD/MMC Card Reader
product ALCOR SDCR_6362 0x6362  SD/MMC Card Reader
product ALCOR TRANSCEND 0x6387  Transcend JetFlash Drive
product ALCOR MA_KBD_HUB0x9213  MacAlly Kbd Hub
product ALCOR AU98140x9215  AU9814 Hub
product ALCOR UMCR_9361 0x9361  USB Multimedia Card Reader
product ALCOR SM_KBD0x9410  MicroConnectors/StrongMan Keyboard
product ALCOR NEC_KBD_HUB   0x9472  NEC Kbd Hub
product ALCOR AU63900x6390  AU6390 USB-IDE converter

has the last one out of order only (it should be sorted 4th in this
list).

: I'm not which one of us is misunderstanding the other - do you think my 
: change is somehow wrong?

I think your change misorders things, unless I'm misreading it.  It
sorts based on symbolic ID rather than numeric ID.

Warner
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-08 Thread Jilles Tjoelker
On Sun, Aug 08, 2010 at 03:36:08PM -0600, M. Warner Losh wrote:
> In message: <201008082037.o78kbldt022...@haluter.fromme.com>
> Oliver Fromme  writes:
> : M. Warner Losh wrote:
> :  > In message: <201008071620.o77gkdbb091...@svn.freebsd.org>
> :  > Oliver Fromme  writes:
> :  > : Author: olli
> :  > : Date: Sat Aug  7 16:20:12 2010
> :  > : New Revision: 211023
> :  > : URL: http://svn.freebsd.org/changeset/base/211023
> :  > : Modified: head/usr.sbin/syslogd/Makefile
> :  > : 
> ==
> :  > : --- head/usr.sbin/syslogd/Makefile Sat Aug  7 16:14:40 2010
> (r211022)
> :  > : +++ head/usr.sbin/syslogd/Makefile Sat Aug  7 16:20:12 2010
> (r211023)
> :  > : @@ -12,7 +12,7 @@ SRCS=syslogd.c ttymsg.c
> :  > :  DPADD=${LIBUTIL}
> :  > :  LDADD=-lutil

> :  > : -WARNS?=   3
> :  > : +WARNS?=   6

> :  > :  .if ${MK_INET6_SUPPORT} != "no"
> :  > :  CFLAGS+= -DINET6

> :  > This breaks MIPS, so I've reverted it.  Please make sure that all
> :  > architectures work when bumping up WARNS.

> : Thanks for fixing it for me.

> : I did make the universe check, but apparently I did something
> : wrong, so I didn't notice the problem.  I'm sorry for that.

> The casting that syslogd does with struct sockaddrFOO is what triggers
> it.  I'm not sure how to fix it, so there's about 6 or 8 programs in
> the tree that have WARNS lowered to 3 because of it.

This problem is common with programs that use getaddrinfo() and then
look into the address family specific parts of the address (it was
probably not the intention of the getaddrinfo() API to do this very
often). Obviously, when ai_family is the corresponding value, the
ai_addr really points to that particular kind of sockaddr, but gcc only
knows that struct sockaddr_in and struct sockaddr_in6 have a higher
alignment requirement than struct sockaddr.

In some cases, the address may already be copied, and making the
destination the family-based type or struct sockaddr_storage (which has
a high alignment requirement) will avoid problems.

In other cases, I propose adding a cast to void * in between, like
  (struct sockaddr_in *)(void *)ai->ai_addr

Note that this workaround must not be applied mindlessly to avoid
-Wcast-align, but only when it is known from other information that the
object really has that type.

If you don't like this workaround, perhaps copy the data to a variable
of the correct type. Addresses are not particularly big so the
performance hit should not be bad.

It is unfortunate to have to miss other warnings because of this.

-- 
Jilles Tjoelker
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r211084 - head/bin/sh

2010-08-08 Thread Rene Ladan

On 08-08-2010 23:36, Doug Barton wrote:

On 08/08/2010 14:19, Colin Percival wrote:

On 08/08/10 14:04, Jilles Tjoelker wrote:

Log:
   Remove unnecessary duplicate letters in mksyntax.c,


Boo!


   the table elements would just be overwritten twice.
-   add("abcdefghijklmnopqrstucvwxyz", "ISLOWER");
-   add("ABCDEFGHIJKLMNOPQRSTUCVWXYZ", "ISUPPER");
+   add("abcdefghijklmnopqrstuvwxyz", "ISLOWER");
+   add("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "ISUPPER");


Ok, I have to wonder: Why was there ever the extra 'C' between 'U' and 'V'?
It seems that it has been there ever since 4.4-Lite, but I don't have access
to historical sources beyond that point.


I think y'all are forgetting where the B in BSD comes from.


So the extra C was to form UC as in University of California. Otherwise
the extra C wouldn't be in there twice.

Rene
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211085 - head/sys/kern

2010-08-08 Thread Jamie Gritton
Author: jamie
Date: Sun Aug  8 23:22:55 2010
New Revision: 211085
URL: http://svn.freebsd.org/changeset/base/211085

Log:
  Back out r210974.  Any convenience of not typing "persist" is outweighed
  by the possibility of unintended partially-formed jails.

Modified:
  head/sys/kern/kern_jail.c

Modified: head/sys/kern/kern_jail.c
==
--- head/sys/kern/kern_jail.c   Sun Aug  8 21:04:27 2010(r211084)
+++ head/sys/kern/kern_jail.c   Sun Aug  8 23:22:55 2010(r211085)
@@ -599,8 +599,6 @@ kern_jail_set(struct thread *td, struct 
vfs_flagopt(opts, pr_flag_names[fi], &pr_flags, 1 << fi);
vfs_flagopt(opts, pr_flag_nonames[fi], &ch_flags, 1 << fi);
}
-   if ((flags & (JAIL_CREATE | JAIL_UPDATE | JAIL_ATTACH)) == JAIL_CREATE)
-   pr_flags |= PR_PERSIST;
ch_flags |= pr_flags;
for (fi = 0; fi < sizeof(pr_flag_jailsys) / sizeof(pr_flag_jailsys[0]);
fi++) {
@@ -630,6 +628,12 @@ kern_jail_set(struct thread *td, struct 
ch_flags |=
pr_flag_jailsys[fi].new | pr_flag_jailsys[fi].disable;
}
+   if ((flags & (JAIL_CREATE | JAIL_UPDATE | JAIL_ATTACH)) == JAIL_CREATE
+   && !(pr_flags & PR_PERSIST)) {
+   error = EINVAL;
+   vfs_opterror(opts, "new jail must persist or attach");
+   goto done_errmsg;
+   }
 #ifdef VIMAGE
if ((flags & JAIL_UPDATE) && (ch_flags & PR_VNET)) {
error = EINVAL;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211086 - head/usr.sbin/jail

2010-08-08 Thread Jamie Gritton
Author: jamie
Date: Sun Aug  8 23:24:23 2010
New Revision: 211086
URL: http://svn.freebsd.org/changeset/base/211086

Log:
  Back out r210975, which changed documentation to match the now backed-out
  r210974.

Modified:
  head/usr.sbin/jail/jail.8

Modified: head/usr.sbin/jail/jail.8
==
--- head/usr.sbin/jail/jail.8   Sun Aug  8 23:22:55 2010(r211085)
+++ head/usr.sbin/jail/jail.8   Sun Aug  8 23:24:23 2010(r211086)
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 6, 2010
+.Dd January 17, 2010
 .Dt JAIL 8
 .Os
 .Sh NAME
@@ -333,11 +333,11 @@ where the jail's chroot directory is loc
 Setting this boolean parameter allows a jail to exist without any
 processes.
 Normally, a jail is destroyed as its last process exits.
-A new jail created without processes (i.e. the
-.Va command
-pseudo-parameter) will automatically have
+A new jail must have either the
 .Va persist
-set.
+parameter or
+.Va command
+pseudo-parameter set.
 .It Va cpuset.id
 The ID of the cpuset associated with this jail (read-only).
 .It Va dying
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211087 - head/sys/kern

2010-08-08 Thread Attilio Rao
Author: attilio
Date: Mon Aug  9 00:23:57 2010
New Revision: 211087
URL: http://svn.freebsd.org/changeset/base/211087

Log:
  The r208165 fixed a bug related to unsigned integer overflowing for the
  number of CPUs detection.
  However, that was not mention at all, the problem was not reported, the
  patch has not been MFCed and the fix is mostly improper.
  
  Fix the original overflow (caused when 32 CPUs must be detected) by
  just using a different mathematical computation (it also makes more
  explicit the size of operands involved, which is good in the moment
  waiting for a more complete support for a large number of CPUs).
  
  PR:   kern/148698
  Submitted by: Joe Landers 
  Tested by:gianni
  MFC after:10 days

Modified:
  head/sys/kern/subr_smp.c

Modified: head/sys/kern/subr_smp.c
==
--- head/sys/kern/subr_smp.cSun Aug  8 23:24:23 2010(r211086)
+++ head/sys/kern/subr_smp.cMon Aug  9 00:23:57 2010(r211087)
@@ -504,10 +504,7 @@ smp_topo_none(void)
top = &group[0];
top->cg_parent = NULL;
top->cg_child = NULL;
-   if (mp_ncpus == sizeof(top->cg_mask) * 8)
-   top->cg_mask = -1;
-   else
-   top->cg_mask = (1 << mp_ncpus) - 1;
+   top->cg_mask = ~0U >> (32 - mp_ncpus);
top->cg_count = mp_ncpus;
top->cg_children = 0;
top->cg_level = CG_SHARE_NONE;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r208165 - in head/sys: kern mips/conf mips/include mips/mips mips/rmi mips/rmi/dev/xlr

2010-08-08 Thread Attilio Rao
2010/5/16 Randall Stewart :
> Author: rrs
> Date: Sun May 16 19:43:48 2010
> New Revision: 208165
> URL: http://svn.freebsd.org/changeset/base/208165
>
> Log:
>  This pushes all of JC's patches that I have in place. I
>  am now able to run 32 cores ok.. but I still will hang
>  on buildworld with a NFS problem. I suspect I am missing
>  a patch for the netlogic rge driver.
>
>  JC check and see if I am missing anything except your
>  core-mask changes


> Modified: head/sys/kern/subr_smp.c
> ==
> --- head/sys/kern/subr_smp.c    Sun May 16 19:25:56 2010        (r208164)
> +++ head/sys/kern/subr_smp.c    Sun May 16 19:43:48 2010        (r208165)
> @@ -503,7 +503,10 @@ smp_topo_none(void)
>        top = &group[0];
>        top->cg_parent = NULL;
>        top->cg_child = NULL;
> -       top->cg_mask = (1 << mp_ncpus) - 1;
> +       if (mp_ncpus == sizeof(top->cg_mask) * 8)
> +               top->cg_mask = -1;
> +       else
> +               top->cg_mask = (1 << mp_ncpus) - 1;
>        top->cg_count = mp_ncpus;
>        top->cg_children = 0;
>        top->cg_level = CG_SHARE_NONE;
>

... and this is why I particulary hate big commits with complete lack
of technical details.

This particulary chunk was supposed to fix a nasty and completely MI
bug that some users have already met (kern/148698). The complete lack
of details didn't help in identify the issue neither that it was a
valuable fix.

The fix is, however, improper (there is no clear relationship between
the multiplication and why that happens) thus I would rather use what
Joe has reported in the PR.

Thanks,
Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211088 - in head/tools/tools/vhba: . mptest

2010-08-08 Thread Matt Jacob
Author: mjacob
Date: Mon Aug  9 00:36:22 2010
New Revision: 211088
URL: http://svn.freebsd.org/changeset/base/211088

Log:
  Add a multipath oriented test.

Added:
  head/tools/tools/vhba/mptest/
  head/tools/tools/vhba/mptest/Makefile   (contents, props changed)
  head/tools/tools/vhba/mptest/vhba_mptest.c   (contents, props changed)
Modified:
  head/tools/tools/vhba/Makefile

Modified: head/tools/tools/vhba/Makefile
==
--- head/tools/tools/vhba/Makefile  Mon Aug  9 00:23:57 2010
(r211087)
+++ head/tools/tools/vhba/Makefile  Mon Aug  9 00:36:22 2010
(r211088)
@@ -24,6 +24,6 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 
-SUBDIR=simple medium lots faulty rptluns
+SUBDIR=simple medium lots faulty rptluns mptest
 
 .include 

Added: head/tools/tools/vhba/mptest/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/vhba/mptest/Makefile   Mon Aug  9 00:36:22 2010
(r211088)
@@ -0,0 +1,31 @@
+# $FreeBSD$
+#
+# Copyright (c) 2010 by Panasas Inc
+# 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 immediately at the beginning of the file, without modification,
+#this list of conditions, and the following disclaimer.
+# 2. The name of the author may not be used to endorse or promote products
+#derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+KMOD=  vmptest
+SRCS=  vhba_mptest.c vhba.c
+CFLAGS += -I${.CURDIR}/.. -DVHBA_MOD=\"vmptest\"
+VPATH= ${.CURDIR}/..
+
+.include 

Added: head/tools/tools/vhba/mptest/vhba_mptest.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/vhba/mptest/vhba_mptest.c  Mon Aug  9 00:36:22 2010
(r211088)
@@ -0,0 +1,404 @@
+/*-
+ * Copyright (c) 2010 by Panasas, Inc.
+ * 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 immediately at the beginning of the file, without modification,
+ *this list of conditions, and the following disclaimer.
+ * 2. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/* $FreeBSD$ */
+/*
+ * "Faulty" Multipath Device. Creates to devices to be set up as multipath,
+ * makes one or both of them non existent (or re existent) on demand.
+ */
+#include "vhba.h"
+#include 
+
+#defineMAX_TGT 1
+#defineMAX_LUN 2
+#defineVMP_TIMEhz
+
+#defineDISK_SIZE   32
+#defineDISK_SHIFT  9
+#defineDISK_NBLKS  ((DISK_SIZE << 20) >> DISK_SHIFT)
+#definePSEUDO_SPT  64
+#definePSEUDO_HDS  64
+#definePSEUDO_SPC  (PSEUDO_SPT * PSEUDO_HDS)
+
+typedef struct {
+   vhba_softc_t 

svn commit: r211089 - head/sys/dev/ste

2010-08-08 Thread Pyun YongHyeon
Author: yongari
Date: Mon Aug  9 01:47:09 2010
New Revision: 211089
URL: http://svn.freebsd.org/changeset/base/211089

Log:
  It seems some old Sundace(now IC Plus Corp.) controllers do not
  like memory mapped register access. Typical problem from the issue
  was MII access returned unreliable values. I'm not sure this comes
  from lack of register flushing in MII access after accessing
  STE_PHYCTL register though.
  To address the issue, read hints data that controls which type of
  memory mapping should be used in driver. ste(4) still prefers
  memory mapping to io mapping but honor hints entered by user except
  for controllers that have problems with memory mapping.
  The hint to use iomapping could be given by adding the following
  line to /boot/device.hints file.
  
  hint.ste.0.prefer_iomap="1"
  
  PR:   kern/149285
  MFC after:5 days

Modified:
  head/sys/dev/ste/if_ste.c

Modified: head/sys/dev/ste/if_ste.c
==
--- head/sys/dev/ste/if_ste.c   Mon Aug  9 00:36:22 2010(r211088)
+++ head/sys/dev/ste/if_ste.c   Mon Aug  9 01:47:09 2010(r211089)
@@ -1059,7 +1059,7 @@ ste_attach(device_t dev)
struct ste_softc *sc;
struct ifnet *ifp;
uint16_t eaddr[ETHER_ADDR_LEN / 2];
-   int error = 0, pmc, rid;
+   int error = 0, pmc, prefer_iomap, rid;
 
sc = device_get_softc(dev);
sc->ste_dev = dev;
@@ -1081,12 +1081,25 @@ ste_attach(device_t dev)
 */
pci_enable_busmaster(dev);
 
-   /* Prefer memory space register mapping over IO space. */
-   sc->ste_res_id = PCIR_BAR(1);
-   sc->ste_res_type = SYS_RES_MEMORY;
-   sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type,
-   &sc->ste_res_id, RF_ACTIVE);
-   if (sc->ste_res == NULL) {
+   /*
+* Prefer memory space register mapping over IO space but use
+* IO space for a device that is known to have issues on memory
+* mapping.
+*/
+   prefer_iomap = 0;
+   if (pci_get_device(dev) == ST_DEVICEID_ST201_1)
+   prefer_iomap = 1;
+   else
+   resource_int_value(device_get_name(sc->ste_dev),
+   device_get_unit(sc->ste_dev), "prefer_iomap",
+   &prefer_iomap);
+   if (prefer_iomap == 0) {
+   sc->ste_res_id = PCIR_BAR(1);
+   sc->ste_res_type = SYS_RES_MEMORY;
+   sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type,
+   &sc->ste_res_id, RF_ACTIVE);
+   }
+   if (prefer_iomap || sc->ste_res == NULL) {
sc->ste_res_id = PCIR_BAR(0);
sc->ste_res_type = SYS_RES_IOPORT;
sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r208165 - in head/sys: kern mips/conf mips/include mips/mips mips/rmi mips/rmi/dev/xlr

2010-08-08 Thread Jayachandran C.
On Mon, Aug 9, 2010 at 5:31 AM, Attilio Rao  wrote:
> 2010/5/16 Randall Stewart :
>> Author: rrs
>> Date: Sun May 16 19:43:48 2010
>> New Revision: 208165
>> URL: http://svn.freebsd.org/changeset/base/208165
>>
>> Log:
>>  This pushes all of JC's patches that I have in place. I
>>  am now able to run 32 cores ok.. but I still will hang
>>  on buildworld with a NFS problem. I suspect I am missing
>>  a patch for the netlogic rge driver.
>>
>>  JC check and see if I am missing anything except your
>>  core-mask changes
>
>
>> Modified: head/sys/kern/subr_smp.c
>> ==
>> --- head/sys/kern/subr_smp.c    Sun May 16 19:25:56 2010        (r208164)
>> +++ head/sys/kern/subr_smp.c    Sun May 16 19:43:48 2010        (r208165)
>> @@ -503,7 +503,10 @@ smp_topo_none(void)
>>        top = &group[0];
>>        top->cg_parent = NULL;
>>        top->cg_child = NULL;
>> -       top->cg_mask = (1 << mp_ncpus) - 1;
>> +       if (mp_ncpus == sizeof(top->cg_mask) * 8)
>> +               top->cg_mask = -1;
>> +       else
>> +               top->cg_mask = (1 << mp_ncpus) - 1;
>>        top->cg_count = mp_ncpus;
>>        top->cg_children = 0;
>>        top->cg_level = CG_SHARE_NONE;
>>
>
> ... and this is why I particulary hate big commits with complete lack
> of technical details.
>
> This particulary chunk was supposed to fix a nasty and completely MI
> bug that some users have already met (kern/148698). The complete lack
> of details didn't help in identify the issue neither that it was a
> valuable fix.
>
> The fix is, however, improper (there is no clear relationship between
> the multiplication and why that happens) thus I would rather use what
> Joe has reported in the PR.


I was not aware of the PR when I sent this changes to rrs@, and this
went as a part of MIPS SMP support for XLR which has 32 CPUs

But I'm not sure that the current change is correct, cg_mask is of
type cpumask_t and I don't think it is guaranteed to be 32 bit (as it
is a machine dependent type).

JC.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r208165 - in head/sys: kern mips/conf mips/include mips/mips mips/rmi mips/rmi/dev/xlr

2010-08-08 Thread Juli Mallett
On Sun, Aug 8, 2010 at 17:01, Attilio Rao  wrote:
>> Modified: head/sys/kern/subr_smp.c
>> ==
>> --- head/sys/kern/subr_smp.c    Sun May 16 19:25:56 2010        (r208164)
>> +++ head/sys/kern/subr_smp.c    Sun May 16 19:43:48 2010        (r208165)
>> @@ -503,7 +503,10 @@ smp_topo_none(void)
>>        top = &group[0];
>>        top->cg_parent = NULL;
>>        top->cg_child = NULL;
>> -       top->cg_mask = (1 << mp_ncpus) - 1;
>> +       if (mp_ncpus == sizeof(top->cg_mask) * 8)
>> +               top->cg_mask = -1;
>> +       else
>> +               top->cg_mask = (1 << mp_ncpus) - 1;
>>        top->cg_count = mp_ncpus;
>>        top->cg_children = 0;
>>        top->cg_level = CG_SHARE_NONE;
>>
>
> The fix is, however, improper (there is no clear relationship between
> the multiplication and why that happens) thus I would rather use what
> Joe has reported in the PR.

I don't understand how you can say there is no clear relationship
between the multiplication and the problem.  If you have the same
number of CPUs as there are bits in cg_mask, since 1 is an int the
result of the shift and the subtraction will be wrong unless int has
more bits than cg_mask.  Both fixes fail to handle the case of more
CPUs than there are bits in cg_mask, but that's expected.

I agree with you about the nature of the commit message and the
commit, but my complaints (and those of others) back in May went
unacknowledged and I don't expect comments about that this long after
the fact to make an impact.

Juli.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r211091 - head/sys/boot/zfs

2010-08-08 Thread Martin Matuska
Author: mm
Date: Mon Aug  9 06:36:11 2010
New Revision: 211091
URL: http://svn.freebsd.org/changeset/base/211091

Log:
  Return EIO if vdev->v_phys_read is NULL.
  
  This fixes booting from a ZFS mirror with a unavailable primary device.
  
  PR:   kern/148655
  Reviewed by:  avg
  Approved by:  delphij (mentor)
  MFC after:3 days

Modified:
  head/sys/boot/zfs/zfsimpl.c

Modified: head/sys/boot/zfs/zfsimpl.c
==
--- head/sys/boot/zfs/zfsimpl.c Mon Aug  9 06:02:23 2010(r211090)
+++ head/sys/boot/zfs/zfsimpl.c Mon Aug  9 06:36:11 2010(r211091)
@@ -328,6 +328,9 @@ vdev_read_phys(vdev_t *vdev, const blkpt
size_t psize;
int rc;
 
+   if (!vdev->v_phys_read)
+   return (EIO);
+
if (bp) {
psize = BP_GET_PSIZE(bp);
} else {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"