Re: svn commit: r235129 - head/tools/tools/zfsboottest

2012-05-07 Thread Andriy Gapon
on 08/05/2012 05:01 Pawel Jakub Dawidek said the following:
> On Mon, May 07, 2012 at 03:03:42PM +, Andriy Gapon wrote:
>> Author: avg
>> Date: Mon May  7 15:03:42 2012
>> New Revision: 235129
>> URL: http://svn.freebsd.org/changeset/base/235129
>>
>> Log:
>>   zfsboottest.sh: gracefully handle default value of bootfs property
> 
> I'd prefer if people avoid having their root file system at the pool
> level, so maybe we could leave it as a warning?

I see reasons to have this preference, I am just not sure that _this_ tool
should be used to annoy people by telling them that their preference is 
inferior.
I think that the various ZFS setup guides and howtos (including those by you)
should already provide good examples.  So if somebody doesn't follow them to the
letter, then he is probably confident of his ZFS mastery.

>>   Reported by:   theraven
>>   MFC after: 10 days
>>
>> Modified:
>>   head/tools/tools/zfsboottest/zfsboottest.sh
>>
>> Modified: head/tools/tools/zfsboottest/zfsboottest.sh
>> ==
>> --- head/tools/tools/zfsboottest/zfsboottest.sh  Mon May  7 14:07:13 
>> 2012(r235128)
>> +++ head/tools/tools/zfsboottest/zfsboottest.sh  Mon May  7 15:03:42 
>> 2012(r235129)
>> @@ -52,8 +52,7 @@ if [ $? -ne 0 ]; then
>>  fi
>>  bootfs=`zpool get bootfs "${pool}" | tail -1 | awk '{print $3}'`
>>  if [ "${bootfs}" = "-" ]; then
>> -echo "The \"bootfs\" property is not configured for pool \"${pool}\"." 
>> >&2
>> -exit 1
>> +bootfs="${pool}"
>>  fi
>>  # Dataset's mountpoint property should be set to 'legacy'.
>>  if [ "`zfs get -H -o value mountpoint ${bootfs}`" != "legacy" ]; then
> 


-- 
Andriy Gapon
___
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: r235136 - head/sys/fs/nfsserver

2012-05-07 Thread John W. De Boskey
Author: jwd
Date: Tue May  8 03:39:44 2012
New Revision: 235136
URL: http://svn.freebsd.org/changeset/base/235136

Log:
  Use the common api helper routine instead of freeing the namei
  buffer directly.
  
  Approved by:  rmacklem (mentor)
  MFC after:1 month

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cMon May  7 19:17:09 2012
(r235135)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cTue May  8 03:39:44 2012
(r235136)
@@ -505,11 +505,10 @@ nfsvno_namei(struct nfsrv_descript *nd, 
 
 out:
if (error) {
-   uma_zfree(namei_zone, cnp->cn_pnbuf);
+   nfsvno_relpathbuf(ndp);
ndp->ni_vp = NULL;
ndp->ni_dvp = NULL;
ndp->ni_startdir = NULL;
-   cnp->cn_flags &= ~HASBUF;
} else if ((ndp->ni_cnd.cn_flags & (WANTPARENT|LOCKPARENT)) == 0) {
ndp->ni_dvp = NULL;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r235129 - head/tools/tools/zfsboottest

2012-05-07 Thread Pawel Jakub Dawidek
On Mon, May 07, 2012 at 03:03:42PM +, Andriy Gapon wrote:
> Author: avg
> Date: Mon May  7 15:03:42 2012
> New Revision: 235129
> URL: http://svn.freebsd.org/changeset/base/235129
> 
> Log:
>   zfsboottest.sh: gracefully handle default value of bootfs property

I'd prefer if people avoid having their root file system at the pool
level, so maybe we could leave it as a warning?

>   Reported by:theraven
>   MFC after:  10 days
> 
> Modified:
>   head/tools/tools/zfsboottest/zfsboottest.sh
> 
> Modified: head/tools/tools/zfsboottest/zfsboottest.sh
> ==
> --- head/tools/tools/zfsboottest/zfsboottest.sh   Mon May  7 14:07:13 
> 2012(r235128)
> +++ head/tools/tools/zfsboottest/zfsboottest.sh   Mon May  7 15:03:42 
> 2012(r235129)
> @@ -52,8 +52,7 @@ if [ $? -ne 0 ]; then
>  fi
>  bootfs=`zpool get bootfs "${pool}" | tail -1 | awk '{print $3}'`
>  if [ "${bootfs}" = "-" ]; then
> - echo "The \"bootfs\" property is not configured for pool \"${pool}\"." 
> >&2
> - exit 1
> + bootfs="${pool}"
>  fi
>  # Dataset's mountpoint property should be set to 'legacy'.
>  if [ "`zfs get -H -o value mountpoint ${bootfs}`" != "legacy" ]; then

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl


pgpqPCkz07GN5.pgp
Description: PGP signature


Re: svn commit: r235007 - stable/9/sys/dev/pci

2012-05-07 Thread Warner Losh

On May 7, 2012, at 9:27 AM, John Baldwin wrote:

> On Friday, May 04, 2012 5:25:32 pm Warner Losh wrote:
>> 
>> On May 4, 2012, at 1:41 PM, Hans Petter Selasky wrote:
>> 
>>> On Friday 04 May 2012 19:18:56 Warner Losh wrote:
 On May 4, 2012, at 10:26 AM, Hans Petter Selasky wrote:
> On Friday 04 May 2012 18:14:16 John Baldwin wrote:
>> On Friday, May 04, 2012 11:38:47 am Hans Petter Selasky wrote:
>>> Author: hselasky
>>> Date: Fri May  4 15:38:47 2012
>>> New Revision: 235007
>>> URL: http://svn.freebsd.org/changeset/base/235007
>>> 
>>> Log:
>>> MFC r233662, r233677 and r233678:
>>> 
>>> Writing zero to BAR actually does not disable it and
>>> it is even harmful as hselasky found out.  Historically,
>>> this code was originated from (OLDCARD) CardBus driver and later
>>> leaked into PCI driver when CardBus was newbus'ified and refactored
>>> with PCI driver. However, it is not really necessary even for
>>> CardBus.
>> 
>> FYI, I've got one bug report on HEAD where these changes broke a
>> machine's ATA controller.
> 
> Have you considered adding code to disable the I/O or memory range
> instead of writing 0 to the bar in this case?
 
 I tried that once upon a time, but was problematical with some bridges 
> that
 had BARs at non-standard locations that needed the I/O or MEM bit set in
 order to work...
 
 Warner
>>> 
>>> If the size of the bar is a few megabytes, then moving it to location 0 is 
>>> definitely wrong. Else it might work!
>> 
>> Only if the bridge passes the transactions for that memory to the PCI bus 
> for decoding.  The reason it worked for as long as it did was that we had 
> bridges that passed the memory cycles to DRAM for addresses near 0 and they 
> didn't make it onto the PCI bus.  Except in embedded systems, I fail to see 
> how that could have changed in the interim.  The physical layout of x86 has 
> actual memory at location 0 and it would be a big performance hit to push 
> those transactions onto the pci bus, so nobody in their right mind would do 
> that.
> 
> Not true.  During NEW_PCIB testing I at one point fat-fingered something such
> that I had an memory window on a PCI-PCI bridge claim address 0 and the boot
> promptly hung as soon as that register was written.

I'll grant that for bridges...  The code in question just does devices 
though...  Still, something we should avoid...

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: r234504 - in head/sys: amd64/conf i386/conf

2012-05-07 Thread Bjoern A. Zeeb

On 7. May 2012, at 21:35 , Brooks Davis wrote:

> On Mon, May 07, 2012 at 03:05:55PM +, Bjoern A. Zeeb wrote:
>> On 7. May 2012, at 13:53 , Ryan Stone wrote:
>> 
>>> A libthr fix went in on the 5th in r235068.  I think that it was
>> 
>> root@noinet:/usr/src # ident lib/libthr/thread/thr_sleepq.c
>> lib/libthr/thread/thr_sleepq.c:
>> $FreeBSD: head/lib/libthr/thread/thr_sleepq.c 235068 2012-05-05 
>> 23:51:24Z davidxu $
>> 
>> yes I do.  
>> 
>>> pthreads locking related.  Do you have that revision?  If you do, does
>>> backing up r234947 fix your problems?
>> 
>> I doubt that as I have seen it on machines running installs from
>> January/Feburary-ish when doing their update builds.
>> 
>> I fear I'll eventually have to start a binary search unless someone
>> has more data points.  But it seems I am not alone, so..
> 
> Does it make sense to just comment out the WITH_CTF=1 make option or
> should I back the whole commit out?

I'd currently wait with the backout for another few days.  It seems we have
a couple of people looking to figure it out.  If we can't find it by the
end of the week I'd comment out the WITH_CTF= for now.

/bz

-- 
Bjoern A. Zeeb You have to have visions!
   It does not matter how good you are. It matters what good you do!

___
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: r234504 - in head/sys: amd64/conf i386/conf

2012-05-07 Thread Brooks Davis
On Mon, May 07, 2012 at 03:05:55PM +, Bjoern A. Zeeb wrote:
> On 7. May 2012, at 13:53 , Ryan Stone wrote:
> 
> > A libthr fix went in on the 5th in r235068.  I think that it was
> 
> root@noinet:/usr/src # ident lib/libthr/thread/thr_sleepq.c
> lib/libthr/thread/thr_sleepq.c:
>  $FreeBSD: head/lib/libthr/thread/thr_sleepq.c 235068 2012-05-05 
> 23:51:24Z davidxu $
> 
> yes I do.  
> 
> > pthreads locking related.  Do you have that revision?  If you do, does
> > backing up r234947 fix your problems?
> 
> I doubt that as I have seen it on machines running installs from
> January/Feburary-ish when doing their update builds.
> 
> I fear I'll eventually have to start a binary search unless someone
> has more data points.  But it seems I am not alone, so..

Does it make sense to just comment out the WITH_CTF=1 make option or
should I back the whole commit out?

-- Brooks


pgpSO0jwvBd0g.pgp
Description: PGP signature


svn commit: r235135 - stable/9/sys/dev/mfi

2012-05-07 Thread Doug Ambrisko
Author: ambrisko
Date: Mon May  7 19:17:09 2012
New Revision: 235135
URL: http://svn.freebsd.org/changeset/base/235135

Log:
  MFC r235014:  Rebuild fix and LBA calculation fix for ThunderBolt
based cards.
  
  MFC r235016:  Some style improvements.
  
  MFC r235040:  Fix the returns in mfi_tbolt_sync_map_info that I added.
  
  PR:   167226

Modified:
  stable/9/sys/dev/mfi/mfi.c
  stable/9/sys/dev/mfi/mfi_debug.c
  stable/9/sys/dev/mfi/mfi_disk.c
  stable/9/sys/dev/mfi/mfi_tbolt.c
  stable/9/sys/dev/mfi/mfireg.h
  stable/9/sys/dev/mfi/mfivar.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/mfi/mfi.c
==
--- stable/9/sys/dev/mfi/mfi.c  Mon May  7 18:30:22 2012(r235134)
+++ stable/9/sys/dev/mfi/mfi.c  Mon May  7 19:17:09 2012(r235135)
@@ -90,8 +90,6 @@ static intmfi_get_controller_info(struc
 static int mfi_get_log_state(struct mfi_softc *,
struct mfi_evt_log_state **);
 static int mfi_parse_entries(struct mfi_softc *, int, int);
-static int mfi_dcmd_command(struct mfi_softc *, struct mfi_command **,
-   uint32_t, void **, size_t);
 static voidmfi_data_cb(void *, bus_dma_segment_t *, int, int);
 static voidmfi_startup(void *arg);
 static voidmfi_intr(void *arg);
@@ -377,6 +375,7 @@ mfi_attach(struct mfi_softc *sc)
TAILQ_INIT(&sc->mfi_syspd_tqh);
TAILQ_INIT(&sc->mfi_evt_queue);
TASK_INIT(&sc->mfi_evt_task, 0, mfi_handle_evt, sc);
+   TASK_INIT(&sc->mfi_map_sync_task, 0, mfi_handle_map_sync, sc);
TAILQ_INIT(&sc->mfi_aen_pids);
TAILQ_INIT(&sc->mfi_cam_ccbq);
 
@@ -696,7 +695,6 @@ mfi_attach(struct mfi_softc *sc)
return (EINVAL);
}
sc->mfi_enable_intr(sc);
-   sc->map_id = 0;
} else {
if ((error = mfi_comms_init(sc)) != 0)
return (error);
@@ -762,6 +760,10 @@ mfi_attach(struct mfi_softc *sc)
callout_reset(&sc->mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz,
mfi_timeout, sc);
 
+   if (sc->mfi_flags & MFI_FLAGS_TBOLT) {
+   mfi_tbolt_sync_map_info(sc);
+   }
+
return (0);
 }
 
@@ -845,7 +847,7 @@ mfi_release_command(struct mfi_command *
mfi_enqueue_free(cm);
 }
 
-static int
+int
 mfi_dcmd_command(struct mfi_softc *sc, struct mfi_command **cmp,
 uint32_t opcode, void **bufp, size_t bufsize)
 {
@@ -1286,8 +1288,8 @@ mfi_shutdown(struct mfi_softc *sc)
if (sc->mfi_aen_cm != NULL)
mfi_abort(sc, sc->mfi_aen_cm);
 
-   if (sc->map_update_cmd != NULL)
-   mfi_abort(sc, sc->map_update_cmd);
+   if (sc->mfi_map_sync_cm != NULL)
+   mfi_abort(sc, sc->mfi_map_sync_cm);
 
dcmd = &cm->cm_frame->dcmd;
dcmd->header.flags = MFI_FRAME_DIR_NONE;
@@ -1317,7 +1319,7 @@ mfi_syspdprobe(struct mfi_softc *sc)
/* Add SYSTEM PD's */
error = mfi_dcmd_command(sc, &cm, MFI_DCMD_PD_LIST_QUERY,
(void **)&pdlist, sizeof(*pdlist));
-   if (error){
+   if (error) {
device_printf(sc->mfi_dev,
"Error while forming SYSTEM PD list\n");
goto out;
@@ -1664,9 +1666,9 @@ mfi_aen_complete(struct mfi_command *cm)
if (sc->mfi_aen_cm == NULL)
return;
 
-   if (sc->mfi_aen_cm->cm_aen_abort ||
+   if (sc->cm_aen_abort ||
hdr->cmd_status == MFI_STAT_INVALID_STATUS) {
-   sc->mfi_aen_cm->cm_aen_abort = 0;
+   sc->cm_aen_abort = 0;
aborted = 1;
} else {
sc->mfi_aen_triggered = 1;
@@ -1956,6 +1958,7 @@ mfi_add_sys_pd_complete(struct mfi_comma
mtx_unlock(&Giant);
mtx_lock(&sc->mfi_io_lock);
 }
+
 static struct mfi_command *
 mfi_bio_command(struct mfi_softc *sc)
 {
@@ -1963,7 +1966,7 @@ mfi_bio_command(struct mfi_softc *sc)
struct mfi_command *cm = NULL;
 
/*reserving two commands to avoid starvation for IOCTL*/
-   if (sc->mfi_qstat[MFIQ_FREE].q_length < 2){
+   if (sc->mfi_qstat[MFIQ_FREE].q_length < 2) {
return (NULL);
}
if ((bio = mfi_dequeue_bio(sc)) == NULL) {
@@ -2385,7 +2388,9 @@ mfi_abort(struct mfi_softc *sc, struct m
cm->cm_flags = MFI_CMD_POLLED;
 
if (sc->mfi_aen_cm)
-   sc->mfi_aen_cm->cm_aen_abort = 1;
+   sc->cm_aen_abort = 1;
+   if (sc->mfi_map_sync_cm)
+   sc->cm_map_abort = 1;
mfi_mapcmd(sc, cm);
mfi_release_command(cm);
 
@@ -2394,6 +2399,11 @@ mfi_abort(struct mfi_softc *sc, struct m
5 * hz);
i++;
}
+   while (i < 5 && sc->mfi_map_sync_cm != NULL) {
+   msleep(&sc->mfi_map_sync_cm, &sc->mfi_io_lock, 0, "mfiabort",
+   5 * hz);
+   

svn commit: r235134 - head/sys/dev/ath

2012-05-07 Thread Adrian Chadd
Author: adrian
Date: Mon May  7 18:30:22 2012
New Revision: 235134
URL: http://svn.freebsd.org/changeset/base/235134

Log:
  Re-enable this particular DELAY() for now, at least until the
  TX and RX PCU stop/drain routines have been thoroughly debugged.
  
  It's also very likely that I should add hooks back up to the
  interface glue (if_ath_pci / if_ath_ahb) to do any relevant
  bus flushes that are required.  A WMAC DDR flush may be required
  for the AR9130 SoC.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Mon May  7 17:13:36 2012(r235133)
+++ head/sys/dev/ath/if_ath.c   Mon May  7 18:30:22 2012(r235134)
@@ -5421,7 +5421,9 @@ ath_stoprecv(struct ath_softc *sc, int d
 * TODO: see if this particular DELAY() is required; it may be
 * masking some missing FIFO flush or DMA sync.
 */
+#if 0
if (dodelay)
+#endif
DELAY(3000);/* 3ms is long enough for 1 frame */
 #ifdef ATH_DEBUG
if (sc->sc_debug & (ATH_DEBUG_RESET | ATH_DEBUG_FATAL)) {
___
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: r235107 - in head/etc: defaults rc.d

2012-05-07 Thread Doug Barton
On 05/06/2012 01:46 PM, Stanislav Sedov wrote:
> Author: stas
> Date: Sun May  6 20:46:04 2012
> New Revision: 235107
> URL: http://svn.freebsd.org/changeset/base/235107
> 
> Log:
>   - Change kfd rc script to be more conformant with rcNG conventions:
> o change rcname to kfd;
> o move mandatory options to command_args;
> o add missing "shutdown" keyword;
> o fix require line.  Kfd doesn't really need to be started before
>   daemons.
>   
>   Suggested by:   dougb
> 
> Modified:
>   head/etc/defaults/rc.conf
>   head/etc/rc.d/kfd

Thanks! :)

___
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: r235133 - in head: contrib/binutils/ld/emultempl share/mk

2012-05-07 Thread Dimitry Andric
Author: dim
Date: Mon May  7 17:13:36 2012
New Revision: 235133
URL: http://svn.freebsd.org/changeset/base/235133

Log:
  Revert r234656, and apply a proper fix for binutils PR 10474, which
  caused linking clang on 32-bit PowerPC to fail with "relocation
  truncated to fit: R_PPC_REL24" errors.
  
  Original diffs (relicensed under GPLv2 with permission from author):
  
http://sourceware.org/git/?p=binutils.git;a=commit;h=1fd262ff7d7ea5adf4894c6b960e092e7e43e3cd
  
http://sourceware.org/git/?p=binutils.git;a=commit;h=053c49fbff58bd33bd0d12200ea61302f92caceb
  
  Tested by:andreast
  MFC after:1 week

Modified:
  head/contrib/binutils/ld/emultempl/ppc32elf.em
  head/share/mk/bsd.own.mk

Modified: head/contrib/binutils/ld/emultempl/ppc32elf.em
==
--- head/contrib/binutils/ld/emultempl/ppc32elf.em  Mon May  7 15:41:31 
2012(r235132)
+++ head/contrib/binutils/ld/emultempl/ppc32elf.em  Mon May  7 17:13:36 
2012(r235133)
@@ -119,7 +119,40 @@ ppc_before_allocation (void)
}
}
 }
+
   gld${EMULATION_NAME}_before_allocation ();
+
+  /* Turn on relaxation if executable sections have addresses that
+ might make branches overflow.  */
+  if (!command_line.relax)
+{
+  bfd_vma low = (bfd_vma) -1;
+  bfd_vma high = 0;
+  asection *o;
+
+  /* Run lang_size_sections (if not already done).  */
+  if (expld.phase != lang_mark_phase_enum)
+   {
+ expld.phase = lang_mark_phase_enum;
+ expld.dataseg.phase = exp_dataseg_none;
+ one_lang_size_sections_pass (NULL, FALSE);
+ lang_reset_memory_regions ();
+   }
+
+  for (o = output_bfd->sections; o != NULL; o = o->next)
+   {
+ if ((o->flags & (SEC_ALLOC | SEC_CODE)) != (SEC_ALLOC | SEC_CODE))
+   continue;
+ if (o->rawsize == 0)
+   continue;
+ if (low > o->vma)
+   low = o->vma;
+ if (high < o->vma + o->rawsize - 1)
+   high = o->vma + o->rawsize - 1;
+   }
+  if (high > low && high - low > (1 << 25) - 1)
+   command_line.relax = TRUE;
+}
 }
 
 EOF

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkMon May  7 15:41:31 2012(r235132)
+++ head/share/mk/bsd.own.mkMon May  7 17:13:36 2012(r235133)
@@ -442,8 +442,7 @@ __T=${TARGET_ARCH}
 __T=${MACHINE_ARCH}
 .endif
 # Clang is only for x86 and powerpc right now, by default.
-# XXX: Temporarily disabled for 32-bit powerpc, due to a binutils bug.
-.if ${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64"
+.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
 __DEFAULT_YES_OPTIONS+=CLANG
 .else
 __DEFAULT_NO_OPTIONS+=CLANG
___
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: r235132 - head/etc/periodic/daily

2012-05-07 Thread John Baldwin
Author: jhb
Date: Mon May  7 15:41:31 2012
New Revision: 235132
URL: http://svn.freebsd.org/changeset/base/235132

Log:
  Display dropped transmit packets in the daily network interface output.
  
  PR:   conf/165956
  Submitted by: Jeremy Chadwick
  MFC after:1 week

Modified:
  head/etc/periodic/daily/420.status-network

Modified: head/etc/periodic/daily/420.status-network
==
--- head/etc/periodic/daily/420.status-network  Mon May  7 15:30:53 2012
(r235131)
+++ head/etc/periodic/daily/420.status-network  Mon May  7 15:41:31 2012
(r235132)
@@ -18,9 +18,9 @@ case "$daily_status_network_enable" in
 
case "$daily_status_network_usedns" in
[Yy][Ee][Ss])
-   netstat -i && rc=0 || rc=3;;
+   netstat -id && rc=0 || rc=3;;
*)
-   netstat -in && rc=0 || rc=3;;
+   netstat -idn && rc=0 || rc=3;;
esac;;
 
 *)  rc=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: r235131 - in stable/9/sys: fs/ext2fs i386/conf kern

2012-05-07 Thread Jaakko Heinonen
Author: jh
Date: Mon May  7 15:30:53 2012
New Revision: 235131
URL: http://svn.freebsd.org/changeset/base/235131

Log:
  MFC r234104:
  
  Apply changes from r233787 to ext2fs:
  
  - Use more natural ip->i_flags instead of vap->va_flags in the final
flags check.
  - Style improvements.
  
  No functional change intended.
  
  MFC r234139:
  
  Restore the blank line incorrectly removed in r234104.

Modified:
  stable/9/sys/fs/ext2fs/ext2_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)
  stable/9/sys/kern/subr_witness.c   (props changed)

Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c
==
--- stable/9/sys/fs/ext2fs/ext2_vnops.c Mon May  7 15:06:07 2012
(r235130)
+++ stable/9/sys/fs/ext2fs/ext2_vnops.c Mon May  7 15:30:53 2012
(r235131)
@@ -426,23 +426,23 @@ ext2_setattr(ap)
 * if securelevel > 0 and any existing system flags are set.
 */
if (!priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0)) {
-   if (ip->i_flags
-   & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) {
+   if (ip->i_flags &
+   (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) {
error = securelevel_gt(cred, 0);
if (error)
return (error);
}
ip->i_flags = vap->va_flags;
} else {
-   if (ip->i_flags
-   & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) ||
+   if (ip->i_flags &
+   (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) ||
(vap->va_flags & UF_SETTABLE) != vap->va_flags)
return (EPERM);
ip->i_flags &= SF_SETTABLE;
ip->i_flags |= (vap->va_flags & UF_SETTABLE);
}
ip->i_flag |= IN_CHANGE;
-   if (vap->va_flags & (IMMUTABLE | APPEND))
+   if (ip->i_flags & (IMMUTABLE | APPEND))
return (0);
}
if (ip->i_flags & (IMMUTABLE | APPEND))
___
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: r235130 - head/tools/tools/zfsboottest

2012-05-07 Thread Andriy Gapon
Author: avg
Date: Mon May  7 15:06:07 2012
New Revision: 235130
URL: http://svn.freebsd.org/changeset/base/235130

Log:
  zfsboottest.sh: correctly check and suggest value of vfs.root.mountfrom
  
  ... it was missing "zfs:" prefix.
  
  Reported by:  theraven
  MFC after:10 days

Modified:
  head/tools/tools/zfsboottest/zfsboottest.sh

Modified: head/tools/tools/zfsboottest/zfsboottest.sh
==
--- head/tools/tools/zfsboottest/zfsboottest.sh Mon May  7 15:03:42 2012
(r235129)
+++ head/tools/tools/zfsboottest/zfsboottest.sh Mon May  7 15:06:07 2012
(r235130)
@@ -72,11 +72,11 @@ fi
 # or vfs.root.mountfrom variable set in /boot/loader.conf.
 egrep -q '^'"${bootfs}"'[[:space:]]+/[[:space:]]+zfs[[:space:]]+' 
"${mountpoint}/etc/fstab" 2>/dev/null
 if [ $? -ne 0 ]; then
-   egrep -q 'vfs.root.mountfrom="?'"${bootfs}"'"?[[:space:]]*$' 
"${mountpoint}/boot/loader.conf" 2>/dev/null
+   egrep -q 'vfs.root.mountfrom="?'"zfs:${bootfs}"'"?[[:space:]]*$' 
"${mountpoint}/boot/loader.conf" 2>/dev/null
if [ $? -ne 0 ]; then
echo "To be able to boot from \"${bootfs}\", you need to 
declare" >&2
echo "\"${bootfs}\" as being root file system in 
${mountpoint}/etc/fstab" >&2
-   echo "or add \"vfs.root.mountfrom\" variable set to 
\"${bootfs}\" to" >&2
+   echo "or add \"vfs.root.mountfrom\" variable set to 
\"zfs:${bootfs}\" to" >&2
echo "${mountpoint}/boot/loader.conf." >&2
exit 1
fi
___
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: r234504 - in head/sys: amd64/conf i386/conf

2012-05-07 Thread Bjoern A. Zeeb
On 7. May 2012, at 13:53 , Ryan Stone wrote:

> A libthr fix went in on the 5th in r235068.  I think that it was

root@noinet:/usr/src # ident lib/libthr/thread/thr_sleepq.c
lib/libthr/thread/thr_sleepq.c:
 $FreeBSD: head/lib/libthr/thread/thr_sleepq.c 235068 2012-05-05 23:51:24Z 
davidxu $

yes I do.  

> pthreads locking related.  Do you have that revision?  If you do, does
> backing up r234947 fix your problems?

I doubt that as I have seen it on machines running installs from
January/Feburary-ish when doing their update builds.

I fear I'll eventually have to start a binary search unless someone
has more data points.  But it seems I am not alone, so..


/bz

-- 
Bjoern A. Zeeb You have to have visions!
   It does not matter how good you are. It matters what good you do!

___
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: r235129 - head/tools/tools/zfsboottest

2012-05-07 Thread Andriy Gapon
Author: avg
Date: Mon May  7 15:03:42 2012
New Revision: 235129
URL: http://svn.freebsd.org/changeset/base/235129

Log:
  zfsboottest.sh: gracefully handle default value of bootfs property
  
  Reported by:  theraven
  MFC after:10 days

Modified:
  head/tools/tools/zfsboottest/zfsboottest.sh

Modified: head/tools/tools/zfsboottest/zfsboottest.sh
==
--- head/tools/tools/zfsboottest/zfsboottest.sh Mon May  7 14:07:13 2012
(r235128)
+++ head/tools/tools/zfsboottest/zfsboottest.sh Mon May  7 15:03:42 2012
(r235129)
@@ -52,8 +52,7 @@ if [ $? -ne 0 ]; then
 fi
 bootfs=`zpool get bootfs "${pool}" | tail -1 | awk '{print $3}'`
 if [ "${bootfs}" = "-" ]; then
-   echo "The \"bootfs\" property is not configured for pool \"${pool}\"." 
>&2
-   exit 1
+   bootfs="${pool}"
 fi
 # Dataset's mountpoint property should be set to 'legacy'.
 if [ "`zfs get -H -o value mountpoint ${bootfs}`" != "legacy" ]; 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"


Re: svn commit: r234504 - in head/sys: amd64/conf i386/conf

2012-05-07 Thread Alexander Leidinger
Hi,

I had this once. I took the time to kill the ctf process which hangs. Well, not 
only once, but multiple times during the kernel build. The resulting kernel 
booted. After that I did a complete 
buildword/installworld/reboot/buildkernel/installkernel/reboot without any 
problems.

I didn't try a kernel without ctf afterwards.

Maybe this serves as a data point.

Bye,
Alexander.

-- 
Send via an Android device, please forgive brevity and typographic and spelling 
errors. 

"Bjoern A. Zeeb"  hat geschrieben:
On 21. Apr 2012, at 17:11 , Brooks Davis wrote:

> On Sat, Apr 21, 2012 at 09:45:57AM -0400, Ryan Stone wrote:
>> On Fri, Apr 20, 2012 at 5:37 PM, Brooks Davis  wrote:
>>> Author: brooks
>>> Date: Fri Apr 20 21:37:42 2012
>>> New Revision: 234504
>>> URL: http://svn.freebsd.org/changeset/base/234504
>>> 
>>> Log:
>>> ?Enable DTrace hooks in GENERIC.
>>> 
>>> ?Reviewed by: ?gnn
>>> ?Approved by: ?core (jhb, imp)
>>> ?Requested by: a cast of thousands
>>> ?MFC after: ? ?3 days
>> 
>> Excellent!  Thanks to everybody who helped make this happen, starting
>> with the participants at dtrace.conf who gave us the requisite whacks
>> with the clue-by-four.
>> 
>> However, what is our policy for enabling features in -STABLE that are
>> known to be unstable?  If we MFC this I don't have the slightest worry
>> that somebody might see instability in their system just because the
>> hooks are all of a sudden there, but I would worry that somebody make
>> take DTrace hooks being enabled in GENERIC on -STABLE to imply that
>> DTrace is stable, start using it and being upset when they trip over a
>> DTrace bug.
> 
> I think we should note that it remains experimental and somewhat buggy
> in the release notes and probably in the MFC message.  Otherwise, it's
> like any new feature.  If you start using a feature in production
> without extensive testing you may be surprised.

I am sorry but I am close to requesting a backout now but I hope someone
else might be able to debug it further, so I'll wait for another couple
of days.

I have heard this from multiple people and I am now at the point where
I wasted almost a day or work on this over the course of two weeks.

I am not able to finish HEAD snapshot release builds even after updating
the underlying kernel and world to a today's HEAD  (I had to disable the
WITH_CTF= to get the kernel now booted to build).

I have seen this on multiple setups for about two weeks.
The common factor is always that ctfmerge is hanging forever.  I have seen
this on both i386 and amd64.  I have seen it with modules and with
kernels built with NO_MODULES.  I have seen it on NFS and on local disks.

As son as I add the
# Temprary as ctfmerge hangs.
nomakeoptions   WITH_CTF
things are fine again.

At the moment it looks like this:

root 34611   0.0  0.1 35908  8736  -  I 4:19PM   0:00.07 ctfmerge -L 
VERSION -g -o if_ath.ko.debug if_ath.o if_ath_debug.o if_ath_keycache.o 
if_ath_sysctl.o if_ath_tx.o if_ath_tx_ht.o if_ath_led.o ah_osdep.o ah.o 
ah_regdom
root 39282   0.0  0.2 44104 14516  -  I 4:20PM   0:00.06 ctfmerge -L 
VERSION -g -o kernel.debug locore.o aic7xxx_reg_print.o aic79xx_reg_print.o 
cam.o cam_periph.o cam_queue.o cam_sim.o cam_xpt.o ata_all.o ata_xpt.o ata_pm


root@bz1:/home/bz # procstat -k 34611
  PID    TID COMM TDNAME   KSTACK   
34611 100228 ctfmerge -    mi_switch sleepq_catch_signals 
sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
amd64_syscall Xfast_syscall 
34611 100452 ctfmerge -    mi_switch sleepq_catch_signals 
sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
amd64_syscall Xfast_syscall 
34611 100453 ctfmerge -    mi_switch sleepq_catch_signals 
sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
amd64_syscall Xfast_syscall 
34611 100454 ctfmerge -    mi_switch sleepq_catch_signals 
sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
amd64_syscall Xfast_syscall 
34611 100455 ctfmerge -    mi_switch sleepq_catch_signals 
sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
amd64_syscall Xfast_syscall 
34611 100456 ctfmerge -    mi_switch sleepq_catch_signals 
sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
amd64_syscall Xfast_syscall 
root@bz1:/home/bz # procstat -k 39282
  PID    TID COMM TDNAME   KSTACK   
39282 100348 ctfmerge -    mi_switch sleepq_catch_signals 
sleepq_wait_sig _sleep do_wait __umtx_op_wait_uint_private amd64_syscall 
Xfast_syscall 
39282 100457 ctfmerge -    mi_switch sleepq_catch_signals 
sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
amd64_syscall Xfast_syscall 
39282 100458 ctfmerge -    m

svn commit: r235128 - head/lib/libusb

2012-05-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon May  7 14:07:13 2012
New Revision: 235128
URL: http://svn.freebsd.org/changeset/base/235128

Log:
  Add missing LibUSB 1.0 API function: libusb_get_string_descriptor().
  
  Reported by:  Xiaofan Chen

Modified:
  head/lib/libusb/Makefile
  head/lib/libusb/libusb.3
  head/lib/libusb/libusb.h
  head/lib/libusb/libusb10_desc.c

Modified: head/lib/libusb/Makefile
==
--- head/lib/libusb/MakefileMon May  7 12:33:17 2012(r235127)
+++ head/lib/libusb/MakefileMon May  7 14:07:13 2012(r235128)
@@ -74,6 +74,7 @@ MLINKS += libusb.3 libusb_get_active_con
 MLINKS += libusb.3 libusb_get_config_descriptor.3
 MLINKS += libusb.3 libusb_get_config_descriptor_by_value.3
 MLINKS += libusb.3 libusb_free_config_descriptor.3
+MLINKS += libusb.3 libusb_get_string_descriptor.3
 MLINKS += libusb.3 libusb_get_string_descriptor_ascii.3
 MLINKS += libusb.3 libusb_parse_ss_endpoint_comp.3
 MLINKS += libusb.3 libusb_free_ss_endpoint_comp.3

Modified: head/lib/libusb/libusb.3
==
--- head/lib/libusb/libusb.3Mon May  7 12:33:17 2012(r235127)
+++ head/lib/libusb/libusb.3Mon May  7 14:07:13 2012(r235128)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 12, 2012
+.Dd May 7, 2012
 .Dt LIBUSB 3
 .Os
 .Sh NAME
@@ -314,6 +314,12 @@ LIBUSB_ERROR code on failure.
 Free a configuration descriptor.
 .Pp
 .Ft int
+.Fn libusb_get_string_descriptor "libusb_device_handle *devh" "uint8_t 
desc_idx" "uint16_t langid" "unsigned char *data" "int length"
+Retrieve a string descriptor in raw format.
+Returns the number of bytes actually transferred on success
+or a negative LIBUSB_ERROR code on failure.
+.Pp
+.Ft int
 .Fn libusb_get_string_descriptor_ascii "libusb_device_handle *devh" "uint8_t 
desc_idx" "unsigned char *data" "int length"
 Retrieve a string descriptor in C style ASCII.
 Returns the positive number of bytes in the resulting ASCII string

Modified: head/lib/libusb/libusb.h
==
--- head/lib/libusb/libusb.hMon May  7 12:33:17 2012(r235127)
+++ head/lib/libusb/libusb.hMon May  7 14:07:13 2012(r235128)
@@ -398,6 +398,7 @@ int libusb_get_active_config_descriptor(
 intlibusb_get_config_descriptor(libusb_device * dev, uint8_t config_index, 
struct libusb_config_descriptor **config);
 intlibusb_get_config_descriptor_by_value(libusb_device * dev, uint8_t 
bConfigurationValue, struct libusb_config_descriptor **config);
 void   libusb_free_config_descriptor(struct libusb_config_descriptor *config);
+intlibusb_get_string_descriptor(libusb_device_handle * devh, uint8_t 
desc_index, uint16_t langid, unsigned char *data, int length);
 intlibusb_get_string_descriptor_ascii(libusb_device_handle * devh, uint8_t 
desc_index, uint8_t *data, int length);
 intlibusb_get_descriptor(libusb_device_handle * devh, uint8_t desc_type, 
uint8_t desc_index, uint8_t *data, int length);
 intlibusb_parse_ss_endpoint_comp(const void *buf, int len, struct 
libusb_ss_endpoint_companion_descriptor **ep_comp);

Modified: head/lib/libusb/libusb10_desc.c
==
--- head/lib/libusb/libusb10_desc.c Mon May  7 12:33:17 2012
(r235127)
+++ head/lib/libusb/libusb10_desc.c Mon May  7 14:07:13 2012
(r235128)
@@ -294,6 +294,25 @@ libusb_free_config_descriptor(struct lib
 }
 
 int
+libusb_get_string_descriptor(libusb_device_handle *pdev,
+uint8_t desc_index, uint16_t langid, unsigned char *data,
+int length)
+{
+   if (pdev == NULL || data == NULL || length < 1)
+   return (LIBUSB_ERROR_INVALID_PARAM);
+
+   if (length > 65535)
+   length = 65535;
+
+   /* put some default data into the destination buffer */
+   data[0] = 0;
+
+   return (libusb_control_transfer(pdev, LIBUSB_ENDPOINT_IN,
+   LIBUSB_REQUEST_GET_DESCRIPTOR, (LIBUSB_DT_STRING << 8) | desc_index,
+   langid, data, length, 1000));
+}
+
+int
 libusb_get_string_descriptor_ascii(libusb_device_handle *pdev,
 uint8_t desc_index, unsigned char *data, int length)
 {
___
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: r235007 - stable/9/sys/dev/pci

2012-05-07 Thread John Baldwin
On Friday, May 04, 2012 5:25:32 pm Warner Losh wrote:
> 
> On May 4, 2012, at 1:41 PM, Hans Petter Selasky wrote:
> 
> > On Friday 04 May 2012 19:18:56 Warner Losh wrote:
> >> On May 4, 2012, at 10:26 AM, Hans Petter Selasky wrote:
> >>> On Friday 04 May 2012 18:14:16 John Baldwin wrote:
>  On Friday, May 04, 2012 11:38:47 am Hans Petter Selasky wrote:
> > Author: hselasky
> > Date: Fri May  4 15:38:47 2012
> > New Revision: 235007
> > URL: http://svn.freebsd.org/changeset/base/235007
> > 
> > Log:
> > MFC r233662, r233677 and r233678:
> > 
> > Writing zero to BAR actually does not disable it and
> > it is even harmful as hselasky found out.  Historically,
> > this code was originated from (OLDCARD) CardBus driver and later
> > leaked into PCI driver when CardBus was newbus'ified and refactored
> > with PCI driver. However, it is not really necessary even for
> > CardBus.
>  
>  FYI, I've got one bug report on HEAD where these changes broke a
>  machine's ATA controller.
> >>> 
> >>> Have you considered adding code to disable the I/O or memory range
> >>> instead of writing 0 to the bar in this case?
> >> 
> >> I tried that once upon a time, but was problematical with some bridges 
that
> >> had BARs at non-standard locations that needed the I/O or MEM bit set in
> >> order to work...
> >> 
> >> Warner
> > 
> > If the size of the bar is a few megabytes, then moving it to location 0 is 
> > definitely wrong. Else it might work!
> 
> Only if the bridge passes the transactions for that memory to the PCI bus 
for decoding.  The reason it worked for as long as it did was that we had 
bridges that passed the memory cycles to DRAM for addresses near 0 and they 
didn't make it onto the PCI bus.  Except in embedded systems, I fail to see 
how that could have changed in the interim.  The physical layout of x86 has 
actual memory at location 0 and it would be a big performance hit to push 
those transactions onto the pci bus, so nobody in their right mind would do 
that.

Not true.  During NEW_PCIB testing I at one point fat-fingered something such
that I had an memory window on a PCI-PCI bridge claim address 0 and the boot
promptly hung as soon as that register was written.

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


Re: svn commit: r234504 - in head/sys: amd64/conf i386/conf

2012-05-07 Thread Ryan Stone
On Sun, May 6, 2012 at 2:03 PM, Bjoern A. Zeeb  wrote:
> root@bz1:/home/bz # procstat -k 34611
>  PID    TID COMM             TDNAME           KSTACK
> 34611 100228 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
> amd64_syscall Xfast_syscall
> 34611 100452 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
> amd64_syscall Xfast_syscall
> 34611 100453 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
> amd64_syscall Xfast_syscall
> 34611 100454 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
> amd64_syscall Xfast_syscall
> 34611 100455 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
> amd64_syscall Xfast_syscall
> 34611 100456 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
> amd64_syscall Xfast_syscall
> root@bz1:/home/bz # procstat -k 39282
>  PID    TID COMM             TDNAME           KSTACK
> 39282 100348 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep do_wait __umtx_op_wait_uint_private amd64_syscall 
> Xfast_syscall
> 39282 100457 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
> amd64_syscall Xfast_syscall
> 39282 100458 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
> amd64_syscall Xfast_syscall
> 39282 100459 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
> amd64_syscall Xfast_syscall
> 39282 100460 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
> amd64_syscall Xfast_syscall
> 39282 100461 ctfmerge         -                mi_switch sleepq_catch_signals 
> sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex 
> amd64_syscall Xfast_syscall
>
>
> root@bz1:/home/bz # procstat -t 34611
>  PID    TID COMM             TDNAME           CPU  PRI STATE   WCHAN
> 34611 100228 ctfmerge         -                  7  152 sleep   umtxn
> 34611 100452 ctfmerge         -                  1  152 sleep   umtxn
> 34611 100453 ctfmerge         -                  1  152 sleep   umtxn
> 34611 100454 ctfmerge         -                  4  152 sleep   umtxn
> 34611 100455 ctfmerge         -                  0  152 sleep   umtxn
> 34611 100456 ctfmerge         -                  5  152 sleep   umtxn
> root@bz1:/home/bz # procstat -t 39282
>  PID    TID COMM             TDNAME           CPU  PRI STATE   WCHAN
> 39282 100348 ctfmerge         -                  7  152 sleep   uwait
> 39282 100457 ctfmerge         -                  2  152 sleep   umtxn
> 39282 100458 ctfmerge         -                  4  152 sleep   umtxn
> 39282 100459 ctfmerge         -                  1  152 sleep   umtxn
> 39282 100460 ctfmerge         -                  5  152 sleep   umtxn
> 39282 100461 ctfmerge         -                  0  152 sleep   umtxn
>
>
> root@bz1:/home/bz # procstat -i 34611 | grep -v -- '---$'
>  PID COMM             SIG     FLAGS
> 34611 ctfmerge         INT      --C
> 34611 ctfmerge         QUIT     --C
> 34611 ctfmerge         TERM     --C
> 34611 ctfmerge         URG      -I-
> 34611 ctfmerge         TSTP     -I-
> 34611 ctfmerge         CHLD     -I-
> 34611 ctfmerge         TTIN     -I-
> 34611 ctfmerge         TTOU     -I-
> 34611 ctfmerge         IO       -I-
> 34611 ctfmerge         WINCH    -I-
> 34611 ctfmerge         INFO     -I-
> 34611 ctfmerge         32       --C
> root@bz1:/home/bz # procstat -i 39282 | grep -v -- '---$'
>  PID COMM             SIG     FLAGS
> 39282 ctfmerge         INT      --C
> 39282 ctfmerge         QUIT     --C
> 39282 ctfmerge         TERM     --C
> 39282 ctfmerge         URG      -I-
> 39282 ctfmerge         TSTP     -I-
> 39282 ctfmerge         CHLD     -I-
> 39282 ctfmerge         TTIN     -I-
> 39282 ctfmerge         TTOU     -I-
> 39282 ctfmerge         IO       -I-
> 39282 ctfmerge         WINCH    -I-
> 39282 ctfmerge         INFO     -I-
> 39282 ctfmerge         32       --C
>
>
>
> root@bz1:/home/bz # procstat -j 34611 | grep -v -- '--$'
>  PID    TID COMM             SIG     FLAGS
> 34611 100452 ctfmerge         INT      -B
> 34611 100452 ctfmerge         QUIT     -B
> 34611 100452 ctfmerge         TERM     -B
> 34611 100453 ctfmerge         INT      -B
> 3

svn commit: r235127 - stable/7/lib/libc/sys

2012-05-07 Thread Eitan Adler
Author: eadler
Date: Mon May  7 12:33:17 2012
New Revision: 235127
URL: http://svn.freebsd.org/changeset/base/235127

Log:
  Undo MFC r234131:
The kernel change can't be MFCed so undo the documentation MFC.
  
  PR:   kern/164970
  Approved by:  cperciva (implicit)

Modified:
  stable/7/lib/libc/sys/dup.2
  stable/7/lib/libc/sys/fcntl.2
Directory Properties:
  stable/7/lib/libc/   (props changed)

Modified: stable/7/lib/libc/sys/dup.2
==
--- stable/7/lib/libc/sys/dup.2 Mon May  7 12:20:26 2012(r235126)
+++ stable/7/lib/libc/sys/dup.2 Mon May  7 12:33:17 2012(r235127)
@@ -123,27 +123,20 @@ indicates the cause of the error.
 .Sh ERRORS
 The
 .Fn dup
-system call fails if:
+and
+.Fn dup2
+system calls fail if:
 .Bl -tag -width Er
 .It Bq Er EBADF
 The
 .Fa oldd
+or
+.Fa newd
 argument
 is not a valid active descriptor
 .It Bq Er EMFILE
 Too many descriptors are active.
 .El
-The
-.Fn dup2
-system call fails if:
-.Bl -tag -width Er
-.It Bq Er EBADF
-The
-.Fa oldd
-argument is not a valid active descriptor or the
-.Fa newd
-argument is negative or exceeds the maximum allowable descriptor number
-.El
 .Sh SEE ALSO
 .Xr accept 2 ,
 .Xr close 2 ,

Modified: stable/7/lib/libc/sys/fcntl.2
==
--- stable/7/lib/libc/sys/fcntl.2   Mon May  7 12:20:26 2012
(r235126)
+++ stable/7/lib/libc/sys/fcntl.2   Mon May  7 12:33:17 2012
(r235127)
@@ -523,6 +523,8 @@ The argument
 .Fa cmd
 is
 .Dv F_DUPFD
+or
+.Dv F_DUP2FD
 and the maximum number of file descriptors permitted for the
 process are already in use,
 or no file descriptors greater than or equal to
___
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: r235126 - stable/8/sys/kern

2012-05-07 Thread Eitan Adler
Author: eadler
Date: Mon May  7 12:20:26 2012
New Revision: 235126
URL: http://svn.freebsd.org/changeset/base/235126

Log:
  MFC r234131:
Return EBADF instead of EMFILE from dup2 when the second argument is
outside the range of valid file descriptors
  
  PR:   kern/164970
  Approved by:  cperciva (implicit)

Modified:
  stable/8/sys/kern/kern_descrip.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/kern/kern_descrip.c
==
--- stable/8/sys/kern/kern_descrip.cMon May  7 12:19:49 2012
(r235125)
+++ stable/8/sys/kern/kern_descrip.cMon May  7 12:20:26 2012
(r235126)
@@ -772,7 +772,7 @@ do_dup(struct thread *td, int flags, int
maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc);
PROC_UNLOCK(p);
if (new >= maxfd)
-   return (flags & DUP_FCNTL ? EINVAL : EMFILE);
+   return (flags & DUP_FCNTL ? EINVAL : EBADF);
 
FILEDESC_XLOCK(fdp);
if (old >= fdp->fd_nfiles || fdp->fd_ofiles[old] == NULL) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r235125 - stable/9/sys/kern

2012-05-07 Thread Eitan Adler
Author: eadler
Date: Mon May  7 12:19:49 2012
New Revision: 235125
URL: http://svn.freebsd.org/changeset/base/235125

Log:
  MFC r234131:
Return EBADF instead of EMFILE from dup2 when the second argument is
outside the range of valid file descriptors
  
  PR:   kern/164970
  Approved by:  cperciva (implicit)

Modified:
  stable/9/sys/kern/kern_descrip.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_descrip.c
==
--- stable/9/sys/kern/kern_descrip.cMon May  7 10:50:26 2012
(r235124)
+++ stable/9/sys/kern/kern_descrip.cMon May  7 12:19:49 2012
(r235125)
@@ -815,7 +815,7 @@ do_dup(struct thread *td, int flags, int
maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc);
PROC_UNLOCK(p);
if (new >= maxfd)
-   return (flags & DUP_FCNTL ? EINVAL : EMFILE);
+   return (flags & DUP_FCNTL ? EINVAL : EBADF);
 
FILEDESC_XLOCK(fdp);
if (old >= fdp->fd_nfiles || fdp->fd_ofiles[old] == NULL) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r235124 - stable/9/sys/netinet

2012-05-07 Thread Michael Tuexen
Author: tuexen
Date: Mon May  7 10:50:26 2012
New Revision: 235124
URL: http://svn.freebsd.org/changeset/base/235124

Log:
  MFC r234951:
  
  Fix another RFC 6458 issue. Spotted by Irene Ruengeler.

Modified:
  stable/9/sys/netinet/sctp_output.c
  stable/9/sys/netinet/sctp_uio.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/sctp_output.c
==
--- stable/9/sys/netinet/sctp_output.c  Mon May  7 10:46:26 2012
(r235123)
+++ stable/9/sys/netinet/sctp_output.c  Mon May  7 10:50:26 2012
(r235124)
@@ -3430,7 +3430,7 @@ sctp_find_cmsg(int c_type, void *data, s
}
m_copydata(control, at + 
CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_authinfo), 
(caddr_t)&authinfo);
sndrcvinfo->sinfo_keynumber_valid = 1;
-   sndrcvinfo->sinfo_keynumber = 
authinfo.auth_keyid;
+   sndrcvinfo->sinfo_keynumber = 
authinfo.auth_keynumber;
break;
default:
return (found);

Modified: stable/9/sys/netinet/sctp_uio.h
==
--- stable/9/sys/netinet/sctp_uio.h Mon May  7 10:46:26 2012
(r235123)
+++ stable/9/sys/netinet/sctp_uio.h Mon May  7 10:50:26 2012
(r235124)
@@ -169,7 +169,7 @@ struct sctp_default_prinfo {
 };
 
 struct sctp_authinfo {
-   uint16_t auth_keyid;
+   uint16_t auth_keynumber;
 };
 
 struct sctp_rcvinfo {
___
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: r235123 - stable/9/sys/netinet

2012-05-07 Thread Michael Tuexen
Author: tuexen
Date: Mon May  7 10:46:26 2012
New Revision: 235123
URL: http://svn.freebsd.org/changeset/base/235123

Log:
  MFC r234832:
  Add support for missing gauth_number_of_chunks field. This Bug was
  found by Irene Ruengeler.

Modified:
  stable/9/sys/netinet/sctp_uio.h
  stable/9/sys/netinet/sctp_usrreq.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/sctp_uio.h
==
--- stable/9/sys/netinet/sctp_uio.h Mon May  7 09:00:30 2012
(r235122)
+++ stable/9/sys/netinet/sctp_uio.h Mon May  7 10:46:26 2012
(r235123)
@@ -660,6 +660,7 @@ struct sctp_authkeyid {
 /* SCTP_PEER_AUTH_CHUNKS / SCTP_LOCAL_AUTH_CHUNKS */
 struct sctp_authchunks {
sctp_assoc_t gauth_assoc_id;
+   uint32_t gauth_number_of_chunks;
uint8_t gauth_chunks[];
 };
 

Modified: stable/9/sys/netinet/sctp_usrreq.c
==
--- stable/9/sys/netinet/sctp_usrreq.c  Mon May  7 09:00:30 2012
(r235122)
+++ stable/9/sys/netinet/sctp_usrreq.c  Mon May  7 10:46:26 2012
(r235123)
@@ -2879,6 +2879,7 @@ flags_out:
} else {
/* copy in the chunks */

(void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks);
+   sac->gauth_number_of_chunks = 
(uint32_t) size;
*optsize = sizeof(struct 
sctp_authchunks) + size;
}
SCTP_TCB_UNLOCK(stcb);
@@ -2897,6 +2898,7 @@ flags_out:
} else {
/* copy in the chunks */

(void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks);
+   sac->gauth_number_of_chunks = 
(uint32_t) size;
*optsize = sizeof(struct 
sctp_authchunks) + size;
}
SCTP_INP_RUNLOCK(inp);
@@ -2927,6 +2929,7 @@ flags_out:
} else {
/* copy in the chunks */

(void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks);
+   sac->gauth_number_of_chunks = 
(uint32_t) size;
*optsize = sizeof(struct 
sctp_authchunks) + size;
}
SCTP_TCB_UNLOCK(stcb);
___
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: r235122 - in head: . share/mk

2012-05-07 Thread Jeremie Le Hen
Author: jlh
Date: Mon May  7 09:00:30 2012
New Revision: 235122
URL: http://svn.freebsd.org/changeset/base/235122

Log:
  Introduce the ${SHLIB_LDSCRIPT} variable to have an ld(1) script
  instead of a symlink for .so files.
  
  Reviewed by:kib, kan (previous version), dim
  Approved by:kib (mentor)
  Silence from:   -hackers@
  MFC after:1 week

Modified:
  head/Makefile.inc1
  head/share/mk/bsd.README
  head/share/mk/bsd.lib.mk

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon May  7 07:04:41 2012(r235121)
+++ head/Makefile.inc1  Mon May  7 09:00:30 2012(r235122)
@@ -265,6 +265,7 @@ XMAKE=  TOOLS_PREFIX=${WORLDTMP} ${BMAKE
 # world stage
 WMAKEENV=  ${CROSSENV} \
_SHLIBDIRPREFIX=${WORLDTMP} \
+   _LDSCRIPTROOT= \
VERSION="${VERSION}" \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
PATH=${TMPPATH}
@@ -307,6 +308,7 @@ LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -DCOMP
 # Yes, the flags are redundant.
 LIB32WMAKEENV+=MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
_SHLIBDIRPREFIX=${LIB32TMP} \
+   _LDSCRIPTROOT=${LIB32TMP} \
VERSION="${VERSION}" \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
PATH=${TMPPATH} \
@@ -319,11 +321,11 @@ LIB32WMAKE=   ${LIB32WMAKEENV} ${MAKE} -DN
-DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \
-DWITHOUT_HTML -DNO_CTF -DNO_LINT -ECC -ECXX -EAS -ELD \
DESTDIR=${LIB32TMP}
-LIB32IMAKE=${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS
+LIB32IMAKE=${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS
 .endif
 
 # install stage
-IMAKEENV=  ${CROSSENV}
+IMAKEENV=  ${CROSSENV:N_LDSCRIPTROOT=*}
 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
 .if empty(.MAKEFLAGS:M-n)
 IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEMon May  7 07:04:41 2012(r235121)
+++ head/share/mk/bsd.READMEMon May  7 09:00:30 2012(r235122)
@@ -352,6 +352,10 @@ SRCS   List of source files to build the 
to .c files of the same name.  (This is not the default for
versions of make.)
 
+SHLIB_LDSCRIPT Template file to generate shared library linker script.
+   Unless used, a simple symlink is created to the real
+   shared object.
+
 The include file  includes the file named "../Makefile.inc"
 if it exists, as well as the include file .
 

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkMon May  7 07:04:41 2012(r235121)
+++ head/share/mk/bsd.lib.mkMon May  7 09:00:30 2012(r235122)
@@ -271,6 +271,25 @@ _libinstall:
${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \
${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}
 .if defined(SHLIB_LINK)
+# ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building
+# and when building 32 bits library shims.  ${_SHLIBDIRPREFIX} is the directory
+# prefix where shared objects will be installed.  ${_LDSCRIPTROOT} is the
+# directory prefix that will be used in generated ld(1) scripts.  They cannot
+# be coalesced because of the way ld(1) handles the sysroot prefix (used in the
+# cross-toolchain):
+# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty.
+# - 32 bits shims are not, so ${_LDSCRIPTROOT} is used to specify their full
+#   path.  Note that ld(1) scripts are generated both during buildworld and
+#   installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty.
+# On the other hand, the use of ${_SHLIBDIRPREFIX} is more consistent since it
+# does not involve the logic of a tool we do not own.
+.if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && 
exists(${.CURDIR}/${SHLIB_LDSCRIPT})
+   sed -e 's,@@SHLIB@@,${_LDSCRIPTROOT}${SHLIBDIR}/${SHLIB_NAME},g' \
+   -e 's,@@LIBDIR@@,${_LDSCRIPTROOT}${LIBDIR},g' \
+   ${.CURDIR}/${SHLIB_LDSCRIPT} > lib${LIB}.ld
+   ${INSTALL} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+   ${_INSTALLFLAGS} lib${LIB}.ld ${DESTDIR}${LIBDIR}/${SHLIB_LINK}
+.else
 .if ${SHLIBDIR} == ${LIBDIR}
ln -fs ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK}
 .else
@@ -281,8 +300,9 @@ _libinstall:
rm -f ${DESTDIR}${LIBDIR}/${SHLIB_NAME}
 .endif
 .endif
-.endif
-.endif
+.endif # SHLIB_LDSCRIPT
+.endif # SHLIB_LINK
+.endif # SHIB_NAME
 .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && 
${MK_TOOLCHAIN} != "no"
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${LIBDIR}
@@ -350,6 +370,9 @@ clean:
 .endif
 .if

svn commit: r235121 - in stable/8/sys: arm/at91 conf ddb dev/cfe dev/dcons dev/ofw dev/sio dev/syscons dev/uart i386/conf kern modules/dcons modules/sio pc98/cbus sys

2012-05-07 Thread Marius Strobl
Author: marius
Date: Mon May  7 07:04:41 2012
New Revision: 235121
URL: http://svn.freebsd.org/changeset/base/235121

Log:
  MFC: r225203 (partial)
  
  Attempt to make break-to-debugger and alternative break-to-debugger more
  accessible:
  
  (1) Always compile in support for breaking into the debugger if options
  KDB is present in the kernel.
  
  (2) Disable both by default, but allow them to be enabled via tunables
  and sysctls debug.kdb.break_to_debugger and
  debug.kdb.alt_break_to_debugger.
  
  (3) options BREAK_TO_DEBUGGER and options ALT_BREAK_TO_DEBUGGER continue
  to behave as before -- only now instead of compiling in
  break-to-debugger support, they change the default values of the
  above sysctls to enable those features by default.  Current kernel
  configurations should, therefore, continue to behave as expected.
  
  (4) Migrate alternative break-to-debugger state machine logic out of
  individual device drivers into centralised KDB code.  This has a
  number of upsides, but also one downside: it's now tricky to release
  sio spin locks when entering the debugger, so we don't.  However,
  similar logic does not exist in other device drivers, including uart.
  
  (5) dcons requires some special handling; unlike other console types, it
  allows overriding KDB's own debugger selection, so we need a new
  interface to KDB to allow that to work.
  
  GENERIC kernels will now support break-to-debugger as long as appropriate
  boot/run-time options are set, which should improve the debuggability of
  kernels significantly.
  
  MFC: r225214 (partial)
  
  Follow up to r225203 refining break-to-debugger run-time configuration
  improvements:
  
  (1) Implement new model in previously missed at91 UART driver
  (2) Move BREAK_TO_DEBUGGER and ALT_BREAK_TO_DEBUGGER from opt_comconsole.h
  to opt_kdb.h (spotted by np)
  (3) Garbage collect now-unused opt_comconsole.h

Modified:
  stable/8/sys/arm/at91/uart_dev_at91usart.c
  stable/8/sys/conf/options
  stable/8/sys/ddb/db_break.c
  stable/8/sys/dev/cfe/cfe_console.c
  stable/8/sys/dev/dcons/dcons_os.c
  stable/8/sys/dev/ofw/ofw_console.c
  stable/8/sys/dev/sio/sio.c
  stable/8/sys/dev/syscons/syscons.c
  stable/8/sys/dev/uart/uart_core.c
  stable/8/sys/kern/subr_kdb.c
  stable/8/sys/modules/dcons/Makefile
  stable/8/sys/modules/sio/Makefile
  stable/8/sys/pc98/cbus/sio.c
  stable/8/sys/sys/kdb.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (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/e1000/   (props changed)
  stable/8/sys/i386/conf/XENHVM   (props changed)

Modified: stable/8/sys/arm/at91/uart_dev_at91usart.c
==
--- stable/8/sys/arm/at91/uart_dev_at91usart.c  Mon May  7 05:28:49 2012
(r235120)
+++ stable/8/sys/arm/at91/uart_dev_at91usart.c  Mon May  7 07:04:41 2012
(r235121)
@@ -29,8 +29,6 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "opt_comconsole.h"
-
 #include 
 #include 
 #include 
@@ -508,25 +506,10 @@ at91_usart_bus_param(struct uart_softc *
 static __inline void
 at91_rx_put(struct uart_softc *sc, int key)
 {
-#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER)
-   int kdb_brk;
 
-   if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) {
-   if ((kdb_brk = kdb_alt_break(key, &sc->sc_altbrk)) != 0) {
-   switch (kdb_brk) {
-   case KDB_REQ_DEBUGGER:
-   kdb_enter(KDB_WHY_BREAK,
-   "Break sequence on console");
-   break;
-   case KDB_REQ_PANIC:
-   kdb_panic("Panic sequence on console");
-   break;
-   case KDB_REQ_REBOOT:
-   kdb_reboot();
-   break;
-   }
-   }
-   }
+#if defined(KDB)
+   if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE)
+   kdb_alt_break(key, &sc->sc_altbrk);
 #endif
uart_rx_put(sc, key);   
 }

Modified: stable/8/sys/conf/options
==
--- stable/8/sys/conf/options   Mon May  7 05:28:49 2012(r235120)
+++ stable/8/sys/conf/options   Mon May  7 07:04:41 2012(r235121)
@@ -47,6 +47,8 @@ TWA_DEBUG opt_twa.h
 TWA_FLASH_FIRMWARE opt_twa.h
 
 # Debugging options.
+ALT_BREAK_TO_DEBUGGER  opt_kdb.h
+BREAK_TO_DEBUGGER  opt_kdb.h
 DDB
 DDB_BUFR_SIZE  opt_ddb.h
 DDB_CAPTURE_DEFAULTBUFSIZE opt_ddb.h
@@ -631,9 +633,6 @@ BKTR_SIS_VIA_MODE   opt_bktr