svn commit: r236138 - head/sys/cam/scsi

2012-05-27 Thread Kenneth D. Merry
Author: ken
Date: Sun May 27 06:11:09 2012
New Revision: 236138
URL: http://svn.freebsd.org/changeset/base/236138

Log:
  Work around a race condition in devfs by changing the way closes
  are handled in most CAM peripheral drivers that are not handled by
  GEOM's disk class.
  
  The usual character driver open and close semantics are that the
  driver gets N open calls, but only one close, when the last caller
  closes the device.
  
  CAM peripheral drivers expect that behavior to be honored to the
  letter, and the CAM peripheral driver code (specifically
  cam_periph_release_locked_busses()) panics if it is done incorrectly.
  
  Since devfs has to drop its locks while it calls a driver's close
  routine, and it does not have a way to delay or prevent open calls
  while it is calling the close routine, there is a race.
  
  The sequence of events, simplified a bit, is:
  
  - devfs acquires a lock
  - devfs checks the reference count, and if it is 1, continues to close.
  - devfs releases the lock
  
  - 2nd process open call on the device happens here
  
  - devfs calls the driver's close routine
  
  - devfs acquires a lock
  - devfs decrements the reference count
  - devfs releases the lock
  
  - 2nd process close call on the device happens here
  
  At the second close, we get a panic in
  cam_periph_release_locked_busses(), complaining that peripheral
  has been released when the reference count is already 0.  This is
  because we have gotten two closes in a row, which should not
  happen.
  
  The fix is to add the D_TRACKCLOSE flag to the driver's cdevsw, so
  that we get a close() call for each open().  That does happen
  reliably, so we can make sure that our reference counts are
  correct.
  
  Note that the sa(4) and pt(4) drivers only allow one context
  through the open routine.  So these drivers aren't exposed to the
  same race condition.
  
  scsi_ch.c,
  scsi_enc.c,
  scsi_enc_internal.h,
  scsi_pass.c,
  scsi_sg.c:
For these drivers, change the open() routine to
increment the reference count for every open, and
just decrement the reference count in the close.
  
Call cam_periph_release_locked() in some scenarios
to avoid additional lock and unlock calls.
  
  scsi_pt.c:Call cam_periph_release_locked() in some scenarios
to avoid additional lock and unlock calls.
  
  MFC after:3 days

Modified:
  head/sys/cam/scsi/scsi_ch.c
  head/sys/cam/scsi/scsi_enc.c
  head/sys/cam/scsi/scsi_pass.c
  head/sys/cam/scsi/scsi_pt.c
  head/sys/cam/scsi/scsi_sg.c

Modified: head/sys/cam/scsi/scsi_ch.c
==
--- head/sys/cam/scsi/scsi_ch.c Sun May 27 05:27:47 2012(r236137)
+++ head/sys/cam/scsi/scsi_ch.c Sun May 27 06:11:09 2012(r236138)
@@ -107,8 +107,7 @@ static const u_int32_t  CH_TIMEOUT_SEND_V
 static const u_int32_t CH_TIMEOUT_INITIALIZE_ELEMENT_STATUS = 50;
 
 typedef enum {
-   CH_FLAG_INVALID = 0x001,
-   CH_FLAG_OPEN= 0x002
+   CH_FLAG_INVALID = 0x001
 } ch_flags;
 
 typedef enum {
@@ -211,7 +210,7 @@ PERIPHDRIVER_DECLARE(ch, chdriver);
 
 static struct cdevsw ch_cdevsw = {
.d_version =D_VERSION,
-   .d_flags =  0,
+   .d_flags =  D_TRACKCLOSE,
.d_open =   chopen,
.d_close =  chclose,
.d_ioctl =  chioctl,
@@ -404,16 +403,11 @@ chopen(struct cdev *dev, int flags, int 
cam_periph_lock(periph);

if (softc-flags  CH_FLAG_INVALID) {
+   cam_periph_release_locked(periph);
cam_periph_unlock(periph);
-   cam_periph_release(periph);
return(ENXIO);
}
 
-   if ((softc-flags  CH_FLAG_OPEN) == 0)
-   softc-flags |= CH_FLAG_OPEN;
-   else
-   cam_periph_release(periph);
-
if ((error = cam_periph_hold(periph, PRIBIO | PCATCH)) != 0) {
cam_periph_unlock(periph);
cam_periph_release(periph);
@@ -424,9 +418,8 @@ chopen(struct cdev *dev, int flags, int 
 * Load information about this changer device into the softc.
 */
if ((error = chgetparams(periph)) != 0) {
-   softc-flags = ~CH_FLAG_OPEN;
+   cam_periph_release_locked(periph);
cam_periph_unlock(periph);
-   cam_periph_release(periph);
return(error);
}
 
@@ -451,11 +444,6 @@ chclose(struct cdev *dev, int flag, int 
 
softc = (struct ch_softc *)periph-softc;
 
-   cam_periph_lock(periph);
-
-   softc-flags = ~CH_FLAG_OPEN;
-
-   cam_periph_unlock(periph);
cam_periph_release(periph);
 
return(0);

Modified: head/sys/cam/scsi/scsi_enc.c
==
--- head/sys/cam/scsi/scsi_enc.cSun May 27 05:27:47 

svn commit: r236139 - head/crypto/openssh

2012-05-27 Thread Eygene Ryabinkin
Author: rea (ports committer)
Date: Sun May 27 06:53:35 2012
New Revision: 236139
URL: http://svn.freebsd.org/changeset/base/236139

Log:
  OpenSSH: allow VersionAddendum to be used again
  
  Prior to this, setting VersionAddendum will be a no-op: one will
  always have BASE_VERSION +   + VERSION_HPN for VersionAddendum
  set in the config and a bare BASE_VERSION + VERSION_HPN when there
  is no VersionAddendum is set.
  
  HPN patch requires both parties to have the hpn inside their
  advertized versions, so we add VERSION_HPN to the VERSION_BASE
  if HPN is enabled and omitting it if HPN is disabled.
  
  VersionAddendum now uses the following logics:
   * unset (default value): append   and VERSION_ADDENDUM;
   * VersionAddendum is set and isn't empty: append  
 and VersionAddendum;
   * VersionAddendum is set and empty: don't append anything.
  
  Approved by: des
  Reviewed by: bz
  MFC after: 3 days

Modified:
  head/crypto/openssh/ssh.c
  head/crypto/openssh/sshconnect.c
  head/crypto/openssh/sshd.c
  head/crypto/openssh/version.c
  head/crypto/openssh/version.h

Modified: head/crypto/openssh/ssh.c
==
--- head/crypto/openssh/ssh.c   Sun May 27 06:11:09 2012(r236138)
+++ head/crypto/openssh/ssh.c   Sun May 27 06:53:35 2012(r236139)
@@ -437,7 +437,8 @@ main(int ac, char **av)
/* FALLTHROUGH */
case 'V':
fprintf(stderr, %s, %s\n,
-   SSH_RELEASE, SSLeay_version(SSLEAY_VERSION));
+   ssh_version_get(options.hpn_disabled),
+   SSLeay_version(SSLEAY_VERSION));
if (opt == 'V')
exit(0);
break;

Modified: head/crypto/openssh/sshconnect.c
==
--- head/crypto/openssh/sshconnect.cSun May 27 06:11:09 2012
(r236138)
+++ head/crypto/openssh/sshconnect.cSun May 27 06:53:35 2012
(r236139)
@@ -585,7 +585,7 @@ ssh_exchange_identification(int timeout_
snprintf(buf, sizeof buf, SSH-%d.%d-%.100s%s,
compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
compat20 ? PROTOCOL_MINOR_2 : minor1,
-   SSH_RELEASE, compat20 ? \r\n : \n);
+   ssh_version_get(options.hpn_disabled), compat20 ? \r\n : \n);
if (roaming_atomicio(vwrite, connection_out, buf, strlen(buf))
!= strlen(buf))
fatal(write: %.100s, strerror(errno));

Modified: head/crypto/openssh/sshd.c
==
--- head/crypto/openssh/sshd.c  Sun May 27 06:11:09 2012(r236138)
+++ head/crypto/openssh/sshd.c  Sun May 27 06:53:35 2012(r236139)
@@ -431,7 +431,7 @@ sshd_exchange_identification(int sock_in
minor = PROTOCOL_MINOR_1;
}
snprintf(buf, sizeof buf, SSH-%d.%d-%.100s%s, major, minor,
-   SSH_RELEASE, newline);
+   ssh_version_get(options.hpn_disabled), newline);
server_version_string = xstrdup(buf);
 
/* Send our protocol version identification. */
@@ -894,7 +894,7 @@ static void
 usage(void)
 {
fprintf(stderr, %s, %s\n,
-   SSH_RELEASE, SSLeay_version(SSLEAY_VERSION));
+   ssh_version_get(0), SSLeay_version(SSLEAY_VERSION));
fprintf(stderr,
 usage: sshd [-46DdeiqTt] [-b bits] [-C connection_spec] [-c host_cert_file]\n
 [-f config_file] [-g login_grace_time] [-h host_key_file]\n
@@ -1583,7 +1583,7 @@ main(int ac, char **av)
exit(1);
}
 
-   debug(sshd version %.100s, SSH_RELEASE);
+   debug(sshd version %.100s, ssh_version_get(options.hpn_disabled));
 
/* Store privilege separation user for later use if required. */
if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) {

Modified: head/crypto/openssh/version.c
==
--- head/crypto/openssh/version.c   Sun May 27 06:11:09 2012
(r236138)
+++ head/crypto/openssh/version.c   Sun May 27 06:53:35 2012
(r236139)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2001 Brian Fundakowski Feldman
+ * Copyright (c) 2012 Eygene Ryabinkin r...@freebsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,30 +36,60 @@ __RCSID($FreeBSD$);
 
 
 static char *version = NULL;
+/* NULL means use default value, empty string means unset */
+static const char *addendum = NULL;
+static unsigned char update_version = 1;
 
+/*
+ * Constructs the version string if it is empty or needs updating.
+ *
+ * HPN patch we're running requires both parties
+ * to have the hpn string inside the advertized version
+ * (see compat.c::compat_datafellows), so we should
+ * include it to the generated 

Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern

2012-05-27 Thread Bruce Evans

On Sun, 27 May 2012, Bruce Evans wrote:


On Sat, 26 May 2012, Konstantin Belousov wrote:


On Sat, May 26, 2012 at 10:21:25PM +1000, Bruce Evans wrote:

...
All the non-indirect char *s for pathnames and other things seem to be
completely wrong on amd64 too.  These pointers start as 32 bits, and it
takes more than a bad type pun to turn then into kernel 64-bit pointers.
The magic for this seems to be:
- all args are converted to 64 bits (by zero-extension?) at a low level
...

The 'low level' AKA magic happens in several *_fetch_syscall_args()
functions. For both linux32 and freebsd32, the magic code automatically
zero-extends the arguments into 64bit entities. Linux passes args in
registers, while FreeBSD uses words on stack.


Actually, the amd64 linux_fetch32_fetch_syscall_args() just copies from
64-bit registers frame-tf_r* to 64-bit sa-args[*].  I can't see how
this gives anything except garbage in the top bits.  Is there magic in
the switch to 64-bit mode that sets the top bits?  Anyway, sign extension
would give garbage for unsigned args, and zero-extension would give
garbage for negative signed args.


I checked what actually happens.  There is no magic.  The registers
just have garbage in the top bits.  Mostly this is 0.  Sometimes it
is all top bits 1.  Sometimes it is some top bits 1 (starting at the
top).  I traced a bit of the execution of ld-linux.so...  The first
syscall was an linux_mmap.  It had all top bits 1 in tf_rbx, then some
top bits 1 in a later register, and all top bits 0 in 4 registers.
Then there were several syscalls with all top bits in all 6 syscall
arg registers 0.  Then there was a linux_write syscall with 1's back
in some top bits.  Then there were many syscalls with all top bits in
all arg registers 0.

This behaviour is probably due to the initial state being more random
(but why doesn't exec clear all top bits?).  Then normal activity
like xorl %ebx,%ebx tends to clear top bits (does this xorl clear top
bits even in 32-bit mode?).  Then something occasionally sets top bits
to 1.


The amd64 ia32_fetch_syscall_args() is quite different.  Now the args
...


Bruce
___
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: r236140 - head/sys/fs/ntfs

2012-05-27 Thread Ed Schouten
Author: ed
Date: Sun May 27 09:34:47 2012
New Revision: 236140
URL: http://svn.freebsd.org/changeset/base/236140

Log:
  Fix style and consistency:
  
  - Use tabs, not spaces.
  - Add tab after #define.
  - Don't mix the use of BSD and ISO C unsigned integer types. Prefer the
ISO C ones.

Modified:
  head/sys/fs/ntfs/ntfs.h

Modified: head/sys/fs/ntfs/ntfs.h
==
--- head/sys/fs/ntfs/ntfs.h Sun May 27 06:53:35 2012(r236139)
+++ head/sys/fs/ntfs/ntfs.h Sun May 27 09:34:47 2012(r236140)
@@ -30,11 +30,11 @@
 
 /*#define NTFS_DEBUG 1*/
 
-typedef u_int64_t cn_t;
-typedef u_int16_t wchar;
+typedef uint64_t cn_t;
+typedef uint16_t wchar;
 
 #pragma pack(1)
-#define BBSIZE 1024
+#defineBBSIZE  1024
 #defineBBOFF   ((off_t)(0))
 #defineBBLOCK  0
 #defineNTFS_MFTINO 0
@@ -45,157 +45,157 @@ typedef u_int16_t wchar;
 #defineNTFS_BOOTINO7
 #defineNTFS_BADCLUSINO 8
 #defineNTFS_UPCASEINO  10
-#define NTFS_MAXFILENAME   255
+#defineNTFS_MAXFILENAME255
 
 struct fixuphdr {
-   u_int32_t   fh_magic;
-   u_int16_t   fh_foff;
-   u_int16_t   fh_fnum;
+   uint32_tfh_magic;
+   uint16_tfh_foff;
+   uint16_tfh_fnum;
 };
 
-#define NTFS_AF_INRUN  0x0001
+#defineNTFS_AF_INRUN   0x0001
 struct attrhdr {
-   u_int32_t   a_type;
-   u_int32_t   reclen;
-   u_int8_ta_flag;
-   u_int8_ta_namelen;
-   u_int8_ta_nameoff;
-   u_int8_treserved1;
-   u_int8_ta_compression;
-   u_int8_treserved2;
-   u_int16_t   a_index;
-};
-#define NTFS_A_STD 0x10
-#define NTFS_A_ATTRLIST0x20
-#define NTFS_A_NAME0x30
-#define NTFS_A_VOLUMENAME  0x60
-#define NTFS_A_DATA0x80
+   uint32_ta_type;
+   uint32_treclen;
+   uint8_t a_flag;
+   uint8_t a_namelen;
+   uint8_t a_nameoff;
+   uint8_t reserved1;
+   uint8_t a_compression;
+   uint8_t reserved2;
+   uint16_ta_index;
+};
+#defineNTFS_A_STD  0x10
+#defineNTFS_A_ATTRLIST 0x20
+#defineNTFS_A_NAME 0x30
+#defineNTFS_A_VOLUMENAME   0x60
+#defineNTFS_A_DATA 0x80
 #defineNTFS_A_INDXROOT 0x90
 #defineNTFS_A_INDX 0xA0
-#define NTFS_A_INDXBITMAP 0xB0
+#defineNTFS_A_INDXBITMAP 0xB0
 
-#define NTFS_MAXATTRNAME   255
+#defineNTFS_MAXATTRNAME255
 struct attr {
-   struct attrhdr  a_hdr;
+   struct attrhdr  a_hdr;
union {
struct {
-   u_int16_t   a_datalen;
-   u_int16_t   reserved1;
-   u_int16_t   a_dataoff;
-   u_int16_t   a_indexed;
-   }   a_S_r;
+   uint16_ta_datalen;
+   uint16_treserved1;
+   uint16_ta_dataoff;
+   uint16_ta_indexed;
+   } a_S_r;
struct {
-   cn_ta_vcnstart;
-   cn_ta_vcnend;
-   u_int16_t   a_dataoff;
-   u_int16_t   a_compressalg;
-   u_int32_t   reserved1;
-   u_int64_t   a_allocated;
-   u_int64_t   a_datalen;
-   u_int64_t   a_initialized;
-   }   a_S_nr;
-   }   a_S;
+   cn_ta_vcnstart;
+   cn_ta_vcnend;
+   uint16_ta_dataoff;
+   uint16_ta_compressalg;
+   uint32_treserved1;
+   uint64_ta_allocated;
+   uint64_ta_datalen;
+   uint64_ta_initialized;
+   } a_S_nr;
+   } a_S;
 };
-#define a_ra_S.a_S_r
-#define a_nr   a_S.a_S_nr
+#definea_r a_S.a_S_r
+#definea_nra_S.a_S_nr
 
 typedef struct {
-   u_int64_t   t_create;
-   u_int64_t   t_write;
-   u_int64_t   t_mftwrite;
-   u_int64_t   t_access;
-}   ntfs_times_t;
-
-#define NTFS_FFLAG_RDONLY  0x01LL
-#define NTFS_FFLAG_HIDDEN  0x02LL
-#define NTFS_FFLAG_SYSTEM  0x04LL
-#define NTFS_FFLAG_ARCHIVE 0x20LL
-#define NTFS_FFLAG_COMPRESSED  0x0800LL
-#define NTFS_FFLAG_DIR 0x1000LL
+   uint64_tt_create;
+   uint64_tt_write;
+   uint64_tt_mftwrite;
+   

svn commit: r236141 - in head/sys: conf kern powerpc/booke powerpc/conf powerpc/include powerpc/powerpc

2012-05-27 Thread Rafal Jaworowski
Author: raj
Date: Sun May 27 10:25:20 2012
New Revision: 236141
URL: http://svn.freebsd.org/changeset/base/236141

Log:
  Let us manage differences of Book-E PowerPC variations i.e. vendor /
  implementation specific vs. the common architecture definition.
  
  Bring PPC4XX defines (PSL, SPR, TLB). Note the new definitions under
  BOOKE_PPC4XX are not used in the code yet.
  
  This change set is not supposed to affect existing E500 support, it's just
  another reorg step before bringing support for E500mc, E5500 and PPC465.
  
  Obtained from:AppliedMicro, Freescale, Semihalf

Modified:
  head/sys/conf/files.powerpc
  head/sys/conf/options.powerpc
  head/sys/kern/sched_ule.c
  head/sys/powerpc/booke/locore.S
  head/sys/powerpc/booke/machdep.c
  head/sys/powerpc/conf/MPC85XX
  head/sys/powerpc/conf/NOTES
  head/sys/powerpc/include/pcpu.h
  head/sys/powerpc/include/profile.h
  head/sys/powerpc/include/psl.h
  head/sys/powerpc/include/pte.h
  head/sys/powerpc/include/spr.h
  head/sys/powerpc/include/tlb.h
  head/sys/powerpc/include/trap.h
  head/sys/powerpc/include/vmparam.h
  head/sys/powerpc/powerpc/cpu.c
  head/sys/powerpc/powerpc/db_trace.c
  head/sys/powerpc/powerpc/gdb_machdep.c
  head/sys/powerpc/powerpc/genassym.c

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Sun May 27 09:34:47 2012(r236140)
+++ head/sys/conf/files.powerpc Sun May 27 10:25:20 2012(r236141)
@@ -97,17 +97,17 @@ powerpc/aim/swtch64.S   optionalaim powe
 powerpc/aim/trap.c optionalaim
 powerpc/aim/uma_machdep.c  optionalaim
 powerpc/aim/vm_machdep.c   optionalaim
-powerpc/booke/clock.c  optionale500
-powerpc/booke/copyinout.c  optionale500
-powerpc/booke/interrupt.c  optionale500
-powerpc/booke/locore.S optionale500 no-obj
-powerpc/booke/machdep.coptionale500
-powerpc/booke/mp_cpudep.c  optionale500 smp
+powerpc/booke/clock.c  optionalbooke
+powerpc/booke/copyinout.c  optionalbooke
+powerpc/booke/interrupt.c  optionalbooke
+powerpc/booke/locore.S optionalbooke no-obj
+powerpc/booke/machdep.coptionalbooke
+powerpc/booke/mp_cpudep.c  optionalbooke smp
 powerpc/booke/platform_bare.c  optionalmpc85xx
-powerpc/booke/pmap.c   optionale500
-powerpc/booke/swtch.S  optionale500
-powerpc/booke/trap.c   optionale500
-powerpc/booke/vm_machdep.c optionale500
+powerpc/booke/pmap.c   optionalbooke
+powerpc/booke/swtch.S  optionalbooke
+powerpc/booke/trap.c   optionalbooke
+powerpc/booke/vm_machdep.c optionalbooke
 powerpc/cpufreq/dfs.c  optionalcpufreq
 powerpc/cpufreq/pcr.c  optionalcpufreq aim
 powerpc/fpu/fpu_add.c  optionalfpu_emu powerpc

Modified: head/sys/conf/options.powerpc
==
--- head/sys/conf/options.powerpc   Sun May 27 09:34:47 2012
(r236140)
+++ head/sys/conf/options.powerpc   Sun May 27 10:25:20 2012
(r236141)
@@ -2,7 +2,9 @@
 # Options specific to the powerpc platform kernels
 
 AIMopt_global.h
-E500   opt_global.h
+BOOKE  opt_global.h
+BOOKE_E500 opt_global.h
+BOOKE_PPC4XX   opt_global.h
 CELL
 
 POWERPC

Modified: head/sys/kern/sched_ule.c
==
--- head/sys/kern/sched_ule.c   Sun May 27 09:34:47 2012(r236140)
+++ head/sys/kern/sched_ule.c   Sun May 27 10:25:20 2012(r236141)
@@ -77,7 +77,7 @@ dtrace_vtime_switch_func_tdtrace_vtime_
 #include machine/cpu.h
 #include machine/smp.h
 
-#if defined(__powerpc__)  defined(E500)
+#if defined(__powerpc__)  defined(BOOKE_E500)
 #error This architecture is not currently compatible with ULE
 #endif
 

Modified: head/sys/powerpc/booke/locore.S
==
--- head/sys/powerpc/booke/locore.S Sun May 27 09:34:47 2012
(r236140)
+++ head/sys/powerpc/booke/locore.S Sun May 27 10:25:20 2012
(r236141)
@@ -218,7 +218,7 @@ done_mapping:
mr  %r3, %r30
mr  %r4, %r31
 
-   /* Prepare e500 core */
+   /* Prepare core */
bl  booke_init
 
/* Switch to thread0.td_kstack now */

Modified: head/sys/powerpc/booke/machdep.c
==
--- head/sys/powerpc/booke/machdep.cSun May 27 09:34:47 2012
(r236140)
+++ head/sys/powerpc/booke/machdep.cSun May 27 10:25:20 2012
(r236141)
@@ -392,6 

svn commit: r236142 - head/sys/powerpc/booke

2012-05-27 Thread Rafal Jaworowski
Author: raj
Date: Sun May 27 10:32:10 2012
New Revision: 236142
URL: http://svn.freebsd.org/changeset/base/236142

Log:
  Remove redundant check, we catch ULE platform support in common
  sys/kern/sched_ule.c

Modified:
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/pmap.c
==
--- head/sys/powerpc/booke/pmap.c   Sun May 27 10:25:20 2012
(r236141)
+++ head/sys/powerpc/booke/pmap.c   Sun May 27 10:32:10 2012
(r236142)
@@ -101,10 +101,6 @@ __FBSDID($FreeBSD$);
 
 #define TODO   panic(%s: not implemented, __func__);
 
-#include opt_sched.h
-#ifndef SCHED_4BSD
-#error e500 only works with SCHED_4BSD which uses a global scheduler lock.
-#endif
 extern struct mtx sched_lock;
 
 extern int dumpsys_minidump;
___
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: r236143 - head/cddl/contrib/opensolaris/cmd/ztest

2012-05-27 Thread Martin Matuska
Author: mm
Date: Sun May 27 11:37:24 2012
New Revision: 236143
URL: http://svn.freebsd.org/changeset/base/236143

Log:
  Import illumos changeset 13571:a5771a96228c
  1950 ztest backwards compatibility testing option
  
  References:
  https://www.illumos.org/issues/1950
  
  Obtained from:illumos (issue #1950)
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c

Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==
--- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sun May 27 10:32:10 
2012(r236142)
+++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sun May 27 11:37:24 
2012(r236143)
@@ -20,8 +20,9 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright (c) 2012 Martin Matuska m...@freebsd.org.  All rights reserved.
  */
 
 /*
@@ -51,7 +52,9 @@
  * At random times, the child self-immolates with a SIGKILL.
  * This is the software equivalent of pulling the power cord.
  * The parent then runs the test again, using the existing
- * storage pool, as many times as desired.
+ * storage pool, as many times as desired. If backwards compatability
+ * testing is enabled ztest will sometimes run the older version
+ * of ztest after a SIGKILL.
  *
  * (6) To verify that we don't have future leaks or temporal incursions,
  * many of the functional tests record the transaction group number
@@ -68,9 +71,15 @@
  * You can ask more more vdevs [-v], datasets [-d], or threads [-t]
  * to increase the pool capacity, fanout, and overall stress level.
  *
- * The -N(okill) option will suppress kills, so each child runs to completion.
- * This can be useful when you're trying to distinguish temporal incursions
- * from plain old race conditions.
+ * Use the -k option to set the desired frequency of kills.
+ *
+ * When ztest invokes itself it passes all relevant information through a
+ * temporary file which is mmap-ed in the child process. This allows shared
+ * memory to survive the exec syscall. The ztest_shared_hdr_t struct is always
+ * stored at offset 0 of this file and contains information on the size and
+ * number of shared structures in the file. The information stored in this file
+ * must remain backwards compatible with older versions of ztest so that
+ * ztest can invoke them during backwards compatibility testing (-B).
  */
 
 #include sys/zfs_context.h
@@ -111,29 +120,82 @@
 #include sys/fs/zfs.h
 #include libnvpair.h
 
-static char cmdname[] = ztest;
-static char *zopt_pool = cmdname;
-static char *progname;
-
-static uint64_t zopt_vdevs = 5;
-static uint64_t zopt_vdevtime;
-static int zopt_ashift = SPA_MINBLOCKSHIFT;
-static int zopt_mirrors = 2;
-static int zopt_raidz = 4;
-static int zopt_raidz_parity = 1;
-static size_t zopt_vdev_size = SPA_MINDEVSIZE;
-static int zopt_datasets = 7;
-static int zopt_threads = 23;
-static uint64_t zopt_passtime = 60;/* 60 seconds */
-static uint64_t zopt_killrate = 70;/* 70% kill rate */
-static int zopt_verbose = 0;
-static int zopt_init = 1;
-static char *zopt_dir = /tmp;
-static uint64_t zopt_time = 300;   /* 5 minutes */
-static uint64_t zopt_maxloops = 50;/* max loops during spa_freeze() */
+#defineZTEST_FD_DATA 3
+#defineZTEST_FD_RAND 4
+
+typedef struct ztest_shared_hdr {
+   uint64_tzh_hdr_size;
+   uint64_tzh_opts_size;
+   uint64_tzh_size;
+   uint64_tzh_stats_size;
+   uint64_tzh_stats_count;
+   uint64_tzh_ds_size;
+   uint64_tzh_ds_count;
+} ztest_shared_hdr_t;
+
+static ztest_shared_hdr_t *ztest_shared_hdr;
+
+typedef struct ztest_shared_opts {
+   char zo_pool[MAXNAMELEN];
+   char zo_dir[MAXNAMELEN];
+   char zo_alt_ztest[MAXNAMELEN];
+   char zo_alt_libpath[MAXNAMELEN];
+   uint64_t zo_vdevs;
+   uint64_t zo_vdevtime;
+   size_t zo_vdev_size;
+   int zo_ashift;
+   int zo_mirrors;
+   int zo_raidz;
+   int zo_raidz_parity;
+   int zo_datasets;
+   int zo_threads;
+   uint64_t zo_passtime;
+   uint64_t zo_killrate;
+   int zo_verbose;
+   int zo_init;
+   uint64_t zo_time;
+   uint64_t zo_maxloops;
+   uint64_t zo_metaslab_gang_bang;
+} ztest_shared_opts_t;
+
+static const ztest_shared_opts_t ztest_opts_defaults = {
+   .zo_pool = { 'z', 't', 'e', 's', 't', '\0' },
+   .zo_dir = { '/', 't', 'm', 'p', '\0' },
+   .zo_alt_ztest = { '\0' },
+   .zo_alt_libpath = { '\0' },
+   .zo_vdevs = 5,
+   .zo_ashift = SPA_MINBLOCKSHIFT,
+   .zo_mirrors = 2,
+   .zo_raidz = 4,
+   .zo_raidz_parity = 1,
+   .zo_vdev_size = SPA_MINDEVSIZE,
+  

svn commit: r236144 - in stable/9: contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/tools/clang/include/clang/AST contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/include/cla...

2012-05-27 Thread Dimitry Andric
Author: dim
Date: Sun May 27 12:01:04 2012
New Revision: 236144
URL: http://svn.freebsd.org/changeset/base/236144

Log:
  MFC r235864:
  
  Upgrade our copy of llvm/clang to 3.1 release.  Release notes can be
  found at: http://llvm.org/releases/3.1/docs/ReleaseNotes.html

Modified:
  stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
  stable/9/contrib/llvm/tools/clang/include/clang/AST/Decl.h
  stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td
  stable/9/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def
  stable/9/contrib/llvm/tools/clang/include/clang/Parse/Parser.h
  stable/9/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h
  stable/9/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h
  stable/9/contrib/llvm/tools/clang/include/clang/Sema/Sema.h
  stable/9/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp
  stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
  stable/9/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp
  stable/9/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp
  stable/9/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp
  stable/9/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp
  stable/9/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp
  stable/9/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp
  stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp
  stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp
  stable/9/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp
  stable/9/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp
  stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp
  stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp
  stable/9/lib/clang/include/clang/Basic/Version.inc
  stable/9/lib/clang/include/llvm/Config/config.h
Directory Properties:
  stable/9/contrib/llvm/   (props changed)
  stable/9/contrib/llvm/tools/clang/   (props changed)
  stable/9/lib/clang/   (props changed)

Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
==
--- stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp   
Sun May 27 11:37:24 2012(r236143)
+++ stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp   
Sun May 27 12:01:04 2012(r236144)
@@ -131,30 +131,16 @@ static void CheckForPhysRegDependency(SD
   }
 }
 
-static void AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG) {
-  SmallVectorEVT, 4 VTs;
-  SDNode *GlueDestNode = Glue.getNode();
-
-  // Don't add glue from a node to itself.
-  if (GlueDestNode == N) return;
-
-  // Don't add glue to something that already has it, either as a use or value.
-  if (N-getOperand(N-getNumOperands()-1).getValueType() == MVT::Glue ||
-  N-getValueType(N-getNumValues() - 1) == MVT::Glue) {
-return;
-  }
-  for (unsigned I = 0, E = N-getNumValues(); I != E; ++I)
-VTs.push_back(N-getValueType(I));
-
-  if (AddGlue)
-VTs.push_back(MVT::Glue);
-
+// Helper for AddGlue to clone node operands.
+static void CloneNodeWithValues(SDNode *N, SelectionDAG *DAG,
+SmallVectorImplEVT VTs,
+SDValue ExtraOper = SDValue()) {
   SmallVectorSDValue, 4 Ops;
   for (unsigned I = 0, E = N-getNumOperands(); I != E; ++I)
 Ops.push_back(N-getOperand(I));
 
-  if (GlueDestNode)
-Ops.push_back(Glue);
+  if (ExtraOper.getNode())
+Ops.push_back(ExtraOper);
 
   SDVTList VTList = DAG-getVTList(VTs[0], VTs.size());
   MachineSDNode::mmo_iterator Begin = 0, End = 0;
@@ -173,6 +159,46 @@ static void AddGlue(SDNode *N, SDValue G
 MN-setMemRefs(Begin, End);
 }
 
+static bool AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG) {
+  SmallVectorEVT, 4 VTs;
+  SDNode *GlueDestNode = Glue.getNode();
+
+  // Don't add glue from a node to itself.
+  if (GlueDestNode == N) return false;
+
+  // Don't add a glue operand to something that already uses glue.
+  if (GlueDestNode 
+  N-getOperand(N-getNumOperands()-1).getValueType() == MVT::Glue) {
+return false;
+  }
+  // Don't add glue to something that already has a glue value.
+  if (N-getValueType(N-getNumValues() - 1) == MVT::Glue) return false;
+
+  for (unsigned I = 0, E = N-getNumValues(); I != E; ++I)
+VTs.push_back(N-getValueType(I));
+
+  if (AddGlue)
+VTs.push_back(MVT::Glue);
+
+  CloneNodeWithValues(N, DAG, VTs, Glue);
+
+  return true;
+}
+
+// Cleanup after unsuccessful AddGlue. Use the standard method of morphing the
+// node even though simply shrinking the value list is sufficient.
+static void RemoveUnusedGlue(SDNode *N, SelectionDAG *DAG) {
+  assert((N-getValueType(N-getNumValues() - 1) == MVT::Glue 
+  !N-hasAnyUseOfValue(N-getNumValues() - 1)) 
+ expected an unused glue value);
+
+  SmallVectorEVT, 4 VTs;
+  for (unsigned I = 0, E = N-getNumValues()-1; I != E; ++I)
+

svn commit: r236145 - head/cddl/contrib/opensolaris/cmd/zpool

2012-05-27 Thread Martin Matuska
Author: mm
Date: Sun May 27 12:22:15 2012
New Revision: 236145
URL: http://svn.freebsd.org/changeset/base/236145

Log:
  Import illumos changeset 13564:cf89c0c60496
  1946 incorrect formatting when listing output of multiple pools with
  zpool iostat -v
  
  References:
  https://www.illumos.org/issues/1946
  
  Obtained from:illumos (issue #1946)
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cSun May 27 
12:01:04 2012(r236144)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cSun May 27 
12:22:15 2012(r236145)
@@ -23,6 +23,7 @@
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2011 by Delphix. All rights reserved.
+ * Copyright (c) 2012 by Frederik Wessels. All rights reserved.
  * Copyright (c) 2011 Martin Matuska m...@freebsd.org. All rights reserved.
  */
 
@@ -2351,7 +2352,8 @@ get_namewidth(zpool_handle_t *zhp, void 
if (!cb-cb_verbose)
cb-cb_namewidth = strlen(zpool_get_name(zhp));
else
-   cb-cb_namewidth = max_width(zhp, nvroot, 0, 0);
+   cb-cb_namewidth = max_width(zhp, nvroot, 0,
+   cb-cb_namewidth);
}
 
/*
___
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: r236138 - head/sys/cam/scsi

2012-05-27 Thread Bruce Evans

On Sun, 27 May 2012, Kenneth D. Merry wrote:


Log:
 Work around a race condition in devfs by changing the way closes
 are handled in most CAM peripheral drivers that are not handled by
 GEOM's disk class.


Sigh.  I was trying to get kib to fix last close properly and remove
a previous D_TRACKCLOSE fix.  The geom case is quite broken too.


 The usual character driver open and close semantics are that the
 driver gets N open calls, but only one close, when the last caller
 closes the device.


vfs+devfs doesn't understand its own state well enough to get this
right.  It's impossible for individual drivers to fix this (except
in a few simple cases where access is basically exclusive), since to
do so they would have to understand vfs+devfs better than vfs+devfs
understands itself, and inspect and maybe modify its entrails...


 CAM peripheral drivers expect that behavior to be honored to the
 letter, and the CAM peripheral driver code (specifically
 cam_periph_release_locked_busses()) panics if it is done incorrectly.


The old way to determine whether the device is already open and whether
it should actually be closed in last-close is to use count_dev().  This
almost worked.  It is still used in the ata tape driver, and I used
it in a couple of other pre-geom and de-geomed ata drivers (mainly to
fix eject in acd).  It is more broken than originally mainly in the
case of multiple devfs mounts, due to lossage in aliasing code.  Its
locking is inadequate, especially when it is called from drivers.  But
devfs has no better way to determine the lastness of a close.  Devfs
close uses count_dev(), and just has better locking for its call.  Even
driver close calls for D_TRACKCLOSE can go missing when count_dev()
is lower than it should be.  But most problems occur when count_dev()
is higher than it should be when devfs close calls it.  Last-close
calls go missing in this case.  Drivers can trust it even less.  For
example, if the driver attempts to track last closes using D_TRACKCLOSE,
then the driver close should do less when this is not the last close.
But if count_dev() is higher than it should be (now at the time of the
finalization of the driver close instead of earlier in devfs close)
then a driver that trusts count_dev() will do less than it should.
OTOH, counting things in drivers takes a lot of work and still cannot
work, since wrong vfs+devfs counts result in closes not matching opens
even with D_TRACKCLOSE.  All a driver can do is:
- count things well enough not to panic went vfs+devfs messes up its
  counts
- use D_TRACKCLOSE to handle missing last closes if necessary.  Most
  drivers don't want the complexity of handling all closes, but some
  are more broken than others by missing last closes, and it may be
  necessary to count all closes to avoid the panics.


 Since devfs has to drop its locks while it calls a driver's close
 routine, and it does not have a way to delay or prevent open calls
 while it is calling the close routine, there is a race.


Indeed.  Note that the race window is unbounded and any number of {
open, i/o, close } sequences may occur (and work!) while the original
last-close is running.  This cannot be fixed in general by holding a
lock throughout the original last-close, since that may want to take
aritrarily long and the lock would deadlock it.  You need to be able
to do { open, ioctl, close } sequences to tell the device not to block.

Dropping the locks is also what makes count_dev() more broken in drivers
than in devfs close:
- originally, count_dev() was spelled vcount() and all vnodes for a device
  were aliased to a single vnode.  This vnode was locked by the kernel
  not being preemptive and/or by SMP not existing and/or by Giant
  locking, even after the vnode exlusive lock was dropped in
  specfs/devfs, unless the driver operation sleeps.  Sleeping gives
  normal races, so for example after a driver close sleeps it should
  have called vcount() to detect state changes while sleeping.  This
  was done by few or no drivers.  But vcount was reliable() after
  waking up, even without the vnode exclusive lock, due to the Giant/etc
  locking.
- the aliasing code regressed to allowing multiple vnodes active on a
  device (with devfs, this takes multiple mounts).  The count is still
  per-device.  There is dev locking to protect the count, but no interlocking
  of this with the vnodes.  This would mostly still work without SMP.  But
  with SMP, you can have 2 active vnodes for a device, and 1 process
  holding the vnode (now non-exclusive) lock for stat() and incrementing
  the device count, while another process tries to last-close the device;
  then in devfs close, although both vnodes are locked the count is 1 too
  high due to the stat() and the last close goes missing; worse, if you
  use D_TRACKCLOSE to try to fix this, you may or may not see the count as
  1 too high and have no way to tell if it is, and no way to fix the locking
  (count_dev() will acquire a dev 

svn commit: r236146 - in head: cddl/contrib/opensolaris/cmd/zpool sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2012-05-27 Thread Martin Matuska
Author: mm
Date: Sun May 27 12:31:57 2012
New Revision: 236146
URL: http://svn.freebsd.org/changeset/base/236146

Log:
  Import illumos changeset 13605:b5c2b5db80d6 (partial)
  763 FMD msg URLs should refer to something visible
  
  Replace sun.com URL's with illumos.org
  
  References:
  https://www.illumos.org/issues/763
  
  Obtained from:illumos (issue #763)
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cSun May 27 
12:22:15 2012(r236145)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cSun May 27 
12:31:57 2012(r236146)
@@ -1617,7 +1617,7 @@ show_import(nvlist_t *config)
}
 
if (msgid != NULL)
-   (void) printf(gettext(   see: http://www.sun.com/msg/%s\n;),
+   (void) printf(gettext(   see: http://illumos.org/msg/%s\n;),
msgid);
 
(void) printf(gettext( config:\n\n));
@@ -3685,7 +3685,7 @@ print_dedup_stats(nvlist_t *config)
  *pool: tank
  * status: DEGRADED
  * reason: One or more devices ...
- * see: http://www.sun.com/msg/ZFS--01
+ * see: http://illumos.org/msg/ZFS--01
  * config:
  * mirror  DEGRADED
  *c1t0d0   OK
@@ -3893,7 +3893,7 @@ status_callback(zpool_handle_t *zhp, voi
}
 
if (msgid != NULL)
-   (void) printf(gettext(   see: http://www.sun.com/msg/%s\n;),
+   (void) printf(gettext(   see: http://illumos.org/msg/%s\n;),
msgid);
 
if (config != NULL) {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Sun May 27 
12:22:15 2012(r236145)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Sun May 27 
12:31:57 2012(r236146)
@@ -2050,7 +2050,7 @@ spa_load_impl(spa_t *spa, uint64_t pool_
cmn_err(CE_WARN, pool '%s' could not be 
loaded as it was last accessed by 
another system (host: %s hostid: 0x%lx). 
-   See: http://www.sun.com/msg/ZFS-8000-EY;,
+   See: http://illumos.org/msg/ZFS-8000-EY;,
spa_name(spa), hostname,
(unsigned long)hostid);
return (EBADF);
___
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: r236147 - stable/8/sys/fs/nfsserver

2012-05-27 Thread Rick Macklem
Author: rmacklem
Date: Sun May 27 12:47:35 2012
New Revision: 236147
URL: http://svn.freebsd.org/changeset/base/236147

Log:
  MFC: r234740
  Fix a leak of namei lookup path buffers that occurs when a
  ZFS volume is exported via the new NFS server. The leak occurred
  because the new NFS server code didn't handle the case where
  a file system sets the SAVENAME flag in its VOP_LOOKUP() and
  ZFS does this for the DELETE case.

Modified:
  stable/8/sys/fs/nfsserver/nfs_nfsdport.c
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)

Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c
==
--- stable/8/sys/fs/nfsserver/nfs_nfsdport.cSun May 27 12:31:57 2012
(r236146)
+++ stable/8/sys/fs/nfsserver/nfs_nfsdport.cSun May 27 12:47:35 2012
(r236147)
@@ -1042,6 +1042,8 @@ nfsvno_removesub(struct nameidata *ndp, 
else
vput(ndp-ni_dvp);
vput(vp);
+   if ((ndp-ni_cnd.cn_flags  SAVENAME) != 0)
+   nfsvno_relpathbuf(ndp);
NFSEXITCODE(error);
return (error);
 }
@@ -1081,6 +1083,8 @@ out:
else
vput(ndp-ni_dvp);
vput(vp);
+   if ((ndp-ni_cnd.cn_flags  SAVENAME) != 0)
+   nfsvno_relpathbuf(ndp);
NFSEXITCODE(error);
return (error);
 }
___
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: r236148 - head/lib/msun/src

2012-05-27 Thread David Chisnall
Author: theraven
Date: Sun May 27 12:54:41 2012
New Revision: 236148
URL: http://svn.freebsd.org/changeset/base/236148

Log:
  Allow inclusion of libc++ cmath to work after including math.h
  
  Submitted by: Yamaya Takashi
  Reviewed by:  das
  MFC after:1 week

Modified:
  head/lib/msun/src/math.h

Modified: head/lib/msun/src/math.h
==
--- head/lib/msun/src/math.hSun May 27 12:47:35 2012(r236147)
+++ head/lib/msun/src/math.hSun May 27 12:54:41 2012(r236148)
@@ -395,35 +395,15 @@ float significandf(float);
  * long double versions of ISO/POSIX math functions
  */
 #if __ISO_C_VISIBLE = 1999
-#if _DECLARE_C99_LDBL_MATH
-long doubleacoshl(long double);
-#endif
 long doubleacosl(long double);
-#if _DECLARE_C99_LDBL_MATH
-long doubleasinhl(long double);
-#endif
 long doubleasinl(long double);
 long doubleatan2l(long double, long double);
-#if _DECLARE_C99_LDBL_MATH
-long doubleatanhl(long double);
-#endif
 long doubleatanl(long double);
 long doublecbrtl(long double);
 long doubleceill(long double);
 long doublecopysignl(long double, long double) __pure2;
-#if _DECLARE_C99_LDBL_MATH
-long doublecoshl(long double);
-#endif
 long doublecosl(long double);
-#if _DECLARE_C99_LDBL_MATH
-long doubleerfcl(long double);
-long doubleerfl(long double);
-#endif
 long doubleexp2l(long double);
-#if _DECLARE_C99_LDBL_MATH
-long doubleexpl(long double);
-long doubleexpm1l(long double);
-#endif
 long doublefabsl(long double) __pure2;
 long doublefdiml(long double, long double);
 long doublefloorl(long double);
@@ -435,20 +415,9 @@ long doublefrexpl(long double value, in
 long doublehypotl(long double, long double);
 intilogbl(long double) __pure2;
 long doubleldexpl(long double, int);
-#if _DECLARE_C99_LDBL_MATH
-long doublelgammal(long double);
-#endif
 long long  llrintl(long double);
 long long  llroundl(long double);
-#if _DECLARE_C99_LDBL_MATH
-long doublelog10l(long double);
-long doublelog1pl(long double);
-long doublelog2l(long double);
-#endif
 long doublelogbl(long double);
-#if _DECLARE_C99_LDBL_MATH
-long doublelogl(long double);
-#endif
 long   lrintl(long double);
 long   lroundl(long double);
 long doublemodfl(long double, long double *); /* fundamentally !__pure2 */
@@ -458,30 +427,54 @@ long double   nextafterl(long double, long
 double nexttoward(double, long double);
 float  nexttowardf(float, long double);
 long doublenexttowardl(long double, long double);
-#if _DECLARE_C99_LDBL_MATH
-long doublepowl(long double, long double);
-#endif
 long doubleremainderl(long double, long double);
 long doubleremquol(long double, long double, int *);
 long doublerintl(long double);
 long doubleroundl(long double);
 long doublescalblnl(long double, long);
 long doublescalbnl(long double, int);
-#if _DECLARE_C99_LDBL_MATH
-long doublesinhl(long double);
-#endif
 long doublesinl(long double);
 long doublesqrtl(long double);
-#if _DECLARE_C99_LDBL_MATH
-long doubletanhl(long double);
-#endif
 long doubletanl(long double);
-#if _DECLARE_C99_LDBL_MATH
-long doubletgammal(long double);
-#endif
 long doubletruncl(long double);
 
 #endif /* __ISO_C_VISIBLE = 1999 */
 __END_DECLS
 
 #endif /* !_MATH_H_ */
+
+/* separate header for cmath */
+#ifndef _MATH_EXTRA_H_
+#if __ISO_C_VISIBLE = 1999
+#if _DECLARE_C99_LDBL_MATH
+
+#define _MATH_EXTRA_H_
+
+/*
+ * extra long double versions of math functions for C99 and cmath
+ */
+__BEGIN_DECLS
+
+long doubleacoshl(long double);
+long doubleasinhl(long double);
+long doubleatanhl(long double);
+long doublecoshl(long double);
+long doubleerfcl(long double);
+long doubleerfl(long double);
+long doubleexpl(long double);
+long doubleexpm1l(long double);
+long doublelgammal(long double);
+long doublelog10l(long double);
+long doublelog1pl(long double);
+long doublelog2l(long double);
+long doublelogl(long double);
+long doublepowl(long double, long double);
+long doublesinhl(long double);
+long doubletanhl(long double);
+long doubletgammal(long double);
+
+__END_DECLS
+
+#endif /* !_DECLARE_C99_LDBL_MATH */
+#endif /* __ISO_C_VISIBLE = 1999 */
+#endif /* !_MATH_EXTRA_H_ */
___
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: r236149 - head/contrib/llvm/tools/clang/lib/CodeGen

2012-05-27 Thread Dimitry Andric
Author: dim
Date: Sun May 27 13:33:54 2012
New Revision: 236149
URL: http://svn.freebsd.org/changeset/base/236149

Log:
  Pull in r157212 from upstream clang trunk:
  
Revert r115805. An array type is required to have a range type,
however, the range can be unknown for the upper bound.
  
Testcase to follow.
  
Part of rdar://11457152
  
  This should fix ctfconvert producing error messages during kernel
  builds, similar to:
  
ERROR: scsi_all.c: die 24561: failed to retrieve array bounds
  
  These were caused by incorrect debug information for flexible array
  members of structs.
  
  MFC after:3 days

Modified:
  head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp

Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
==
--- head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp   Sun May 27 
12:54:41 2012(r236148)
+++ head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp   Sun May 27 
13:33:54 2012(r236149)
@@ -1479,25 +1479,21 @@ llvm::DIType CGDebugInfo::CreateType(con
   // obvious/recursive way?
   SmallVectorllvm::Value *, 8 Subscripts;
   QualType EltTy(Ty, 0);
-  if (Ty-isIncompleteArrayType())
+  while ((Ty = dyn_castArrayType(EltTy))) {
+int64_t UpperBound = 0;
+int64_t LowerBound = 0;
+if (const ConstantArrayType *CAT = dyn_castConstantArrayType(Ty)) {
+  if (CAT-getSize().getZExtValue())
+UpperBound = CAT-getSize().getZExtValue() - 1;
+} else
+  // This is an unbounded array. Use Low = 1, Hi = 0 to express such 
+  // arrays.
+  LowerBound = 1;
+
+// FIXME: Verify this is right for VLAs.
+Subscripts.push_back(DBuilder.getOrCreateSubrange(LowerBound,
+  UpperBound));
 EltTy = Ty-getElementType();
-  else {
-while ((Ty = dyn_castArrayType(EltTy))) {
-  int64_t UpperBound = 0;
-  int64_t LowerBound = 0;
-  if (const ConstantArrayType *CAT = dyn_castConstantArrayType(Ty)) {
-if (CAT-getSize().getZExtValue())
-  UpperBound = CAT-getSize().getZExtValue() - 1;
-  } else
-// This is an unbounded array. Use Low = 1, Hi = 0 to express such 
-// arrays.
-LowerBound = 1;
-
-  // FIXME: Verify this is right for VLAs.
-  Subscripts.push_back(DBuilder.getOrCreateSubrange(LowerBound,
-UpperBound));
-  EltTy = Ty-getElementType();
-}
   }
 
   llvm::DIArray SubscriptArray = DBuilder.getOrCreateArray(Subscripts);
___
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: r236150 - in stable/8/sys: fs/nfsclient nfsclient

2012-05-27 Thread Rick Macklem
Author: rmacklem
Date: Sun May 27 14:20:46 2012
New Revision: 236150
URL: http://svn.freebsd.org/changeset/base/236150

Log:
  MFC: r235332
  PR# 165923 reported intermittent write failures for dirty
  memory mapped pages being written back on an NFS mount.
  Since any thread can call VOP_PUTPAGES() to write back a
  dirty page, the credentials of that thread may not have
  write access to the file on an NFS server. (Often the uid
  is 0, which may be mapped to nobody in the NFS server.)
  Although there is no completely correct fix for this
  (NFS servers check access on every write RPC instead of at
  open/mmap time), this patch avoids the common cases by
  holding onto a credential that recently opened the file
  for writing and uses that credential for the write RPCs
  being done by VOP_PUTPAGES() for both NFS clients.

Modified:
  stable/8/sys/fs/nfsclient/nfs_clbio.c
  stable/8/sys/fs/nfsclient/nfs_clnode.c
  stable/8/sys/fs/nfsclient/nfs_clvnops.c
  stable/8/sys/fs/nfsclient/nfsnode.h
  stable/8/sys/nfsclient/nfs_bio.c
  stable/8/sys/nfsclient/nfs_node.c
  stable/8/sys/nfsclient/nfs_vnops.c
  stable/8/sys/nfsclient/nfsnode.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)

Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c
==
--- stable/8/sys/fs/nfsclient/nfs_clbio.c   Sun May 27 13:33:54 2012
(r236149)
+++ stable/8/sys/fs/nfsclient/nfs_clbio.c   Sun May 27 14:20:46 2012
(r236150)
@@ -271,7 +271,11 @@ ncl_putpages(struct vop_putpages_args *a
vp = ap-a_vp;
np = VTONFS(vp);
td = curthread; /* XXX */
-   cred = curthread-td_ucred; /* XXX */
+   /* Set the cred to n_writecred for the write rpcs. */
+   if (np-n_writecred != NULL)
+   cred = crhold(np-n_writecred);
+   else
+   cred = crhold(curthread-td_ucred); /* XXX */
nmp = VFSTONFS(vp-v_mount);
pages = ap-a_m;
count = ap-a_count;
@@ -335,6 +339,7 @@ ncl_putpages(struct vop_putpages_args *a
iomode = NFSWRITE_FILESYNC;
 
error = ncl_writerpc(vp, uio, cred, iomode, must_commit, 0);
+   crfree(cred);
 
pmap_qremove(kva, npages);
relpbuf(bp, ncl_pbuf_freecnt);

Modified: stable/8/sys/fs/nfsclient/nfs_clnode.c
==
--- stable/8/sys/fs/nfsclient/nfs_clnode.c  Sun May 27 13:33:54 2012
(r236149)
+++ stable/8/sys/fs/nfsclient/nfs_clnode.c  Sun May 27 14:20:46 2012
(r236150)
@@ -297,6 +297,8 @@ ncl_reclaim(struct vop_reclaim_args *ap)
FREE((caddr_t)dp2, M_NFSDIROFF);
}
}
+   if (np-n_writecred != NULL)
+   crfree(np-n_writecred);
FREE((caddr_t)np-n_fhp, M_NFSFH);
if (np-n_v4 != NULL)
FREE((caddr_t)np-n_v4, M_NFSV4NODE);

Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c
==
--- stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun May 27 13:33:54 2012
(r236149)
+++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun May 27 14:20:46 2012
(r236150)
@@ -480,6 +480,7 @@ nfs_open(struct vop_open_args *ap)
struct vattr vattr;
int error;
int fmode = ap-a_mode;
+   struct ucred *cred;
 
if (vp-v_type != VREG  vp-v_type != VDIR  vp-v_type != VLNK)
return (EOPNOTSUPP);
@@ -570,7 +571,22 @@ nfs_open(struct vop_open_args *ap)
}
np-n_directio_opens++;
}
+
+   /*
+* If this is an open for writing, capture a reference to the
+* credentials, so they can be used by ncl_putpages(). Using
+* these write credentials is preferable to the credentials of
+* whatever thread happens to be doing the VOP_PUTPAGES() since
+* the write RPCs are less likely to fail with EACCES.
+*/
+   if ((fmode  FWRITE) != 0) {
+   cred = np-n_writecred;
+   np-n_writecred = crhold(ap-a_cred);
+   } else
+   cred = NULL;
mtx_unlock(np-n_mtx);
+   if (cred != NULL)
+   crfree(cred);
vnode_create_vobject(vp, vattr.va_size, ap-a_td);
return (0);
 }

Modified: stable/8/sys/fs/nfsclient/nfsnode.h
==
--- stable/8/sys/fs/nfsclient/nfsnode.h Sun May 27 13:33:54 2012
(r236149)
+++ stable/8/sys/fs/nfsclient/nfsnode.h Sun May 27 14:20:46 2012
(r236150)
@@ -136,6 +136,7 @@ 

svn commit: r236151 - in stable/8/sys: amd64/linux32 cddl/dev/systrace compat/freebsd32 i386/linux kern

2012-05-27 Thread Ryan Stone
Author: rstone
Date: Sun May 27 14:25:16 2012
New Revision: 236151
URL: http://svn.freebsd.org/changeset/base/236151

Log:
  MFC r227441
  
   Correct the types of the arguments to return probes of the syscall
   provider.  Previously we were erroneously supplying the argument types of
   the corresponding entry probe.

Modified:
  stable/8/sys/amd64/linux32/linux32_systrace_args.c
  stable/8/sys/cddl/dev/systrace/systrace.c
  stable/8/sys/compat/freebsd32/freebsd32_systrace_args.c
  stable/8/sys/i386/linux/linux_systrace_args.c
  stable/8/sys/kern/makesyscalls.sh
  stable/8/sys/kern/systrace_args.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_systrace_args.c
==
--- stable/8/sys/amd64/linux32/linux32_systrace_args.c  Sun May 27 14:20:46 
2012(r236150)
+++ stable/8/sys/amd64/linux32/linux32_systrace_args.c  Sun May 27 14:25:16 
2012(r236151)
@@ -2265,7 +2265,7 @@ systrace_args(int sysnum, void *params, 
};
 }
 static void
-systrace_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
+systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 {
const char *p = NULL;
switch (sysnum) {
@@ -5422,3 +5422,1238 @@ systrace_setargdesc(int sysnum, int ndx,
if (p != NULL)
strlcpy(desc, p, descsz);
 }
+static void
+systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
+{
+   const char *p = NULL;
+   switch (sysnum) {
+#definenosys   linux_nosys
+   /* sys_exit */
+   case 1:
+   if (ndx == 0 || ndx == 1)
+   p = void;
+   break;
+   /* linux_fork */
+   case 2:
+   /* read */
+   case 3:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* write */
+   case 4:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_open */
+   case 5:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* close */
+   case 6:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_waitpid */
+   case 7:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_creat */
+   case 8:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_link */
+   case 9:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_unlink */
+   case 10:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_execve */
+   case 11:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_chdir */
+   case 12:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_time */
+   case 13:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_mknod */
+   case 14:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_chmod */
+   case 15:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_lchown16 */
+   case 16:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_stat */
+   case 18:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_lseek */
+   case 19:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_getpid */
+   case 20:
+   /* linux_mount */
+   case 21:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_oldumount */
+   case 22:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_setuid16 */
+   case 23:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_getuid16 */
+   case 24:
+   /* linux_stime */
+   case 25:
+   /* linux_ptrace */
+   case 26:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_alarm */
+   case 27:
+   if (ndx == 0 || ndx == 1)
+   p = int;
+   break;
+   /* linux_pause */
+   case 29:
+   /* linux_utime */
+   case 30:
+   if (ndx == 0 || ndx == 1)

svn commit: r236152 - in stable/9/sys: cddl/dev/sdt kern sys

2012-05-27 Thread Ryan Stone
Author: rstone
Date: Sun May 27 14:48:14 2012
New Revision: 236152
URL: http://svn.freebsd.org/changeset/base/236152

Log:
  MFC r233552
  
   Instead of only iterating over the set of known SDT probes when sdt.ko is
   loaded and unloaded, also have sdt.ko register callbacks with kern_sdt.c
   that will be called when a newly loaded KLD module adds more probes or
   a module with probes is unloaded.
  
   This fixes two issues: first, if a module with SDT probes was loaded after
   sdt.ko was loaded, those new probes would not be available in DTrace.
   Second, if a module with SDT probes was unloaded while sdt.ko was loaded,
   the kernel would panic the next time DTrace had cause to try and do
   anything with the no-longer-existent probes.
  
   This makes it possible to create SDT probes in KLD modules, although there
   are still two caveats: first, any SDT probes in a KLD module must be part
   of a DTrace provider that is defined in that module.  At present DTrace
   only destroys probes when the provider is destroyed, so you can still
   panic the system if a KLD module creates new probes in a provider from a
   different module(including the kernel) and then unload the the first module.
  
   Second, the system will panic if you unload a module containing SDT probes
   while there is an active D script that has enabled those probes.

Modified:
  stable/9/sys/cddl/dev/sdt/sdt.c
  stable/9/sys/kern/kern_sdt.c
  stable/9/sys/sys/sdt.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cddl/dev/sdt/sdt.c
==
--- stable/9/sys/cddl/dev/sdt/sdt.c Sun May 27 14:25:16 2012
(r236151)
+++ stable/9/sys/cddl/dev/sdt/sdt.c Sun May 27 14:48:14 2012
(r236152)
@@ -52,6 +52,8 @@ static void   sdt_destroy(void *, dtrace_i
 static voidsdt_enable(void *, dtrace_id_t, void *);
 static voidsdt_disable(void *, dtrace_id_t, void *);
 static voidsdt_load(void *);
+static int sdt_provider_unreg_callback(struct sdt_provider *prov, 
+   void *arg);
 
 static struct cdevsw sdt_cdevsw = {
.d_version  = D_VERSION,
@@ -190,7 +192,8 @@ sdt_load(void *dummy)
 
sdt_probe_func = dtrace_probe;
 
-   (void) sdt_provider_listall(sdt_provider_reg_callback, NULL);
+   sdt_register_callbacks(sdt_provider_reg_callback, NULL,
+   sdt_provider_unreg_callback, NULL, sdt_probe_callback, NULL);
 }
 
 static int
@@ -206,7 +209,7 @@ sdt_unload()
 
sdt_probe_func = sdt_probe_stub;
 
-   (void) sdt_provider_listall(sdt_provider_unreg_callback, NULL);
+   sdt_deregister_callbacks();

destroy_dev(sdt_cdev);
 

Modified: stable/9/sys/kern/kern_sdt.c
==
--- stable/9/sys/kern/kern_sdt.cSun May 27 14:25:16 2012
(r236151)
+++ stable/9/sys/kern/kern_sdt.cSun May 27 14:48:14 2012
(r236152)
@@ -59,6 +59,16 @@ static struct sx sdt_sx;
  */
 sdt_probe_func_t sdt_probe_func = sdt_probe_stub;
 
+static sdt_provider_listall_func_t sdt_provider_register_func = NULL;
+static sdt_provider_listall_func_t sdt_provider_deregister_func = NULL;
+static sdt_probe_listall_func_t sdt_probe_register_func = NULL;
+
+static void *sdt_provider_register_arg;
+static void *sdt_provider_deregister_arg;
+static void *sdt_probe_register_arg;
+
+static int sdt_provider_listall_locked(sdt_provider_listall_func_t, void *);
+
 /*
  * This is a stub for probe calls in case kernel DTrace support isn't
  * compiled in. It should never get called because there is no DTrace
@@ -85,6 +95,9 @@ sdt_provider_register(void *arg)
 
TAILQ_INIT(prov-probe_list);
 
+   if (sdt_provider_register_func != NULL)
+   sdt_provider_register_func(prov, sdt_provider_register_arg);
+
sx_xunlock(sdt_sx);
 }
 
@@ -100,6 +113,9 @@ sdt_provider_deregister(void *arg)
 
TAILQ_REMOVE(sdt_provider_list, prov, prov_entry);
 
+   if (sdt_provider_deregister_func != NULL)
+   sdt_provider_deregister_func(prov, sdt_provider_deregister_arg);
+
sx_xunlock(sdt_sx);
 }
 
@@ -128,6 +144,9 @@ sdt_probe_register(void *arg)
 
probe-state = SDT_INIT;
 
+   if (sdt_probe_register_func != NULL)
+   sdt_probe_register_func(probe, sdt_provider_register_arg);
+
sx_xunlock(sdt_sx);
 }
 
@@ -203,20 +222,31 @@ SYSUNINIT(sdt, SI_SUB_KDTRACE, SI_ORDER_
  * List statically defined tracing providers.
  */
 int
-sdt_provider_listall(sdt_provider_listall_func_t callback_func,void *arg)
+sdt_provider_listall(sdt_provider_listall_func_t callback_func, void *arg)
+{
+   int error;
+
+   sx_xlock(sdt_sx);
+   error = sdt_provider_listall_locked(callback_func, arg);
+   sx_xunlock(sdt_sx);
+
+   return (error);
+}
+
+static int
+sdt_provider_listall_locked(sdt_provider_listall_func_t callback_func,
+

svn commit: r236153 - in stable/8/sys: cddl/dev/sdt kern sys

2012-05-27 Thread Ryan Stone
Author: rstone
Date: Sun May 27 14:52:31 2012
New Revision: 236153
URL: http://svn.freebsd.org/changeset/base/236153

Log:
  MFC r233552
  
   Instead of only iterating over the set of known SDT probes when sdt.ko is
   loaded and unloaded, also have sdt.ko register callbacks with kern_sdt.c
   that will be called when a newly loaded KLD module adds more probes or
   a module with probes is unloaded.
  
   This fixes two issues: first, if a module with SDT probes was loaded after
   sdt.ko was loaded, those new probes would not be available in DTrace.
   Second, if a module with SDT probes was unloaded while sdt.ko was loaded,
   the kernel would panic the next time DTrace had cause to try and do
   anything with the no-longer-existent probes.
  
   This makes it possible to create SDT probes in KLD modules, although there
   are still two caveats: first, any SDT probes in a KLD module must be part
   of a DTrace provider that is defined in that module.  At present DTrace
   only destroys probes when the provider is destroyed, so you can still
   panic the system if a KLD module creates new probes in a provider from a
   different module(including the kernel) and then unload the the first module.
  
   Second, the system will panic if you unload a module containing SDT probes
   while there is an active D script that has enabled those probes.

Modified:
  stable/8/sys/cddl/dev/sdt/sdt.c
  stable/8/sys/kern/kern_sdt.c
  stable/8/sys/sys/sdt.h
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/cddl/dev/sdt/sdt.c
==
--- stable/8/sys/cddl/dev/sdt/sdt.c Sun May 27 14:48:14 2012
(r236152)
+++ stable/8/sys/cddl/dev/sdt/sdt.c Sun May 27 14:52:31 2012
(r236153)
@@ -52,6 +52,8 @@ static void   sdt_destroy(void *, dtrace_i
 static voidsdt_enable(void *, dtrace_id_t, void *);
 static voidsdt_disable(void *, dtrace_id_t, void *);
 static voidsdt_load(void *);
+static int sdt_provider_unreg_callback(struct sdt_provider *prov, 
+   void *arg);
 
 static struct cdevsw sdt_cdevsw = {
.d_version  = D_VERSION,
@@ -190,7 +192,8 @@ sdt_load(void *dummy)
 
sdt_probe_func = dtrace_probe;
 
-   (void) sdt_provider_listall(sdt_provider_reg_callback, NULL);
+   sdt_register_callbacks(sdt_provider_reg_callback, NULL,
+   sdt_provider_unreg_callback, NULL, sdt_probe_callback, NULL);
 }
 
 static int
@@ -206,7 +209,7 @@ sdt_unload()
 
sdt_probe_func = sdt_probe_stub;
 
-   (void) sdt_provider_listall(sdt_provider_unreg_callback, NULL);
+   sdt_deregister_callbacks();

destroy_dev(sdt_cdev);
 

Modified: stable/8/sys/kern/kern_sdt.c
==
--- stable/8/sys/kern/kern_sdt.cSun May 27 14:48:14 2012
(r236152)
+++ stable/8/sys/kern/kern_sdt.cSun May 27 14:52:31 2012
(r236153)
@@ -59,6 +59,16 @@ static struct sx sdt_sx;
  */
 sdt_probe_func_t sdt_probe_func = sdt_probe_stub;
 
+static sdt_provider_listall_func_t sdt_provider_register_func = NULL;
+static sdt_provider_listall_func_t sdt_provider_deregister_func = NULL;
+static sdt_probe_listall_func_t sdt_probe_register_func = NULL;
+
+static void *sdt_provider_register_arg;
+static void *sdt_provider_deregister_arg;
+static void *sdt_probe_register_arg;
+
+static int sdt_provider_listall_locked(sdt_provider_listall_func_t, void *);
+
 /*
  * This is a stub for probe calls in case kernel DTrace support isn't
  * compiled in. It should never get called because there is no DTrace
@@ -85,6 +95,9 @@ sdt_provider_register(void *arg)
 
TAILQ_INIT(prov-probe_list);
 
+   if (sdt_provider_register_func != NULL)
+   sdt_provider_register_func(prov, sdt_provider_register_arg);
+
sx_xunlock(sdt_sx);
 }
 
@@ -100,6 +113,9 @@ sdt_provider_deregister(void *arg)
 
TAILQ_REMOVE(sdt_provider_list, prov, prov_entry);
 
+   if (sdt_provider_deregister_func != NULL)
+   sdt_provider_deregister_func(prov, sdt_provider_deregister_arg);
+
sx_xunlock(sdt_sx);
 }
 
@@ -128,6 +144,9 @@ sdt_probe_register(void *arg)
 
probe-state = SDT_INIT;
 
+   if (sdt_probe_register_func != NULL)
+   sdt_probe_register_func(probe, sdt_provider_register_arg);
+
sx_xunlock(sdt_sx);
 }
 
@@ -203,20 +222,31 @@ SYSUNINIT(sdt, SI_SUB_KDTRACE, SI_ORDER_
  * List statically defined tracing providers.
  */
 int
-sdt_provider_listall(sdt_provider_listall_func_t callback_func,void *arg)
+sdt_provider_listall(sdt_provider_listall_func_t callback_func, void *arg)
+{
+   int error;
+
+   sx_xlock(sdt_sx);
+   error = sdt_provider_listall_locked(callback_func, arg);
+   sx_xunlock(sdt_sx);
+
+   return (error);
+}
+
+static int
+sdt_provider_listall_locked(sdt_provider_listall_func_t callback_func,
+

svn commit: r236154 - stable/8/sys/dev/dc

2012-05-27 Thread Marius Strobl
Author: marius
Date: Sun May 27 15:48:25 2012
New Revision: 236154
URL: http://svn.freebsd.org/changeset/base/236154

Log:
  MFC: r235255 (partial)
  
  Change the module order of this MAC driver to be last so its is
  deterministically handled after the corresponding PHY drivers when
  loaded as module. Otherwise, when this MAC/PHY driver combination
  is compiled into a single module, probing the PHY drivers may fail.
  This makes r151438 actually work.
  Reported and tested by: yongari (for fxp(4))
  
  Given that r226154 isn't part of stable/8, the other drivers fixed
  as part of the original r235255 aren't affected here.
  
  Submitted by: jhb

Modified:
  stable/8/sys/dev/dc/if_dc.c
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)

Modified: stable/8/sys/dev/dc/if_dc.c
==
--- stable/8/sys/dev/dc/if_dc.c Sun May 27 14:52:31 2012(r236153)
+++ stable/8/sys/dev/dc/if_dc.c Sun May 27 15:48:25 2012(r236154)
@@ -354,8 +354,9 @@ static driver_t dc_driver = {
 
 static devclass_t dc_devclass;
 
-DRIVER_MODULE(dc, pci, dc_driver, dc_devclass, 0, 0);
-DRIVER_MODULE(miibus, dc, miibus_driver, miibus_devclass, 0, 0);
+DRIVER_MODULE_ORDERED(dc, pci, dc_driver, dc_devclass, NULL, NULL,
+SI_ORDER_ANY);
+DRIVER_MODULE(miibus, dc, miibus_driver, miibus_devclass, NULL, NULL);
 
 #defineDC_SETBIT(sc, reg, x)   \
CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) | (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: r236155 - in head: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs s...

2012-05-27 Thread Martin Matuska
Author: mm
Date: Sun May 27 16:00:00 2012
New Revision: 236155
URL: http://svn.freebsd.org/changeset/base/236155

Log:
  Import illumos changeset 13570:3411fd5f1589
  1948 zpool list should show more detailed pool information
  
  Display per-vdev information with zpool list -v.
  The added expandsize property has currently no value on FreeBSD.
  This changeset allows adding expansion support to individual vdevs
  in the future.
  
  References:
  https://www.illumos.org/issues/1948
  
  Obtained from:illumos (issue #1948)
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun May 27 15:48:25 
2012(r236154)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun May 27 16:00:00 
2012(r236155)
@@ -537,6 +537,8 @@ value of 1.76 indicates that 1.76 units 
 for a description of the deduplication feature.
 .It Sy free
 Number of blocks within the pool that are not allocated.
+.It Sy expandsize
+This property has currently no value on FreeBSD.
 .It Sy guid
 A unique identifier for the pool.
 .It Sy health
@@ -1275,7 +1277,7 @@ Treat exported or foreign devices as ina
 .It Xo
 .Nm
 .Cm list
-.Op Fl H
+.Op Fl Hv
 .Op Fl o Ar property Ns Op , Ns Ar ...
 .Op Fl T Cm d Ns | Ns Cm u
 .Op Ar pool

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cSun May 27 
15:48:25 2012(r236154)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cSun May 27 
16:00:00 2012(r236155)
@@ -22,9 +22,9 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
  * Copyright (c) 2012 by Frederik Wessels. All rights reserved.
- * Copyright (c) 2011 Martin Matuska m...@freebsd.org. All rights reserved.
+ * Copyright (c) 2012 Martin Matuska m...@freebsd.org. All rights reserved.
  */
 
 #include solaris.h
@@ -46,6 +46,7 @@
 #include pwd.h
 #include zone.h
 #include sys/time.h
+#include zfs_prop.h
 #include sys/fs/zfs.h
 #include sys/stat.h
 
@@ -70,6 +71,7 @@ static int zpool_do_status(int, char **)
 static int zpool_do_online(int, char **);
 static int zpool_do_offline(int, char **);
 static int zpool_do_clear(int, char **);
+static int zpool_do_reopen(int, char **);
 
 static int zpool_do_reguid(int, char **);
 
@@ -132,7 +134,8 @@ typedef enum {
HELP_GET,
HELP_SET,
HELP_SPLIT,
-   HELP_REGUID
+   HELP_REGUID,
+   HELP_REOPEN
 } zpool_help_t;
 
 
@@ -167,6 +170,7 @@ static zpool_command_t command_table[] =
{ online, zpool_do_online,HELP_ONLINE },
{ offline,zpool_do_offline,   HELP_OFFLINE},
{ clear,  zpool_do_clear, HELP_CLEAR  },
+   { reopen, zpool_do_reopen,HELP_REOPEN },
{ NULL },
{ attach, zpool_do_attach,HELP_ATTACH },
{ detach, zpool_do_detach,HELP_DETACH },
@@ -241,6 +245,8 @@ get_usage(zpool_help_t idx) {
[new-device]\n));
case HELP_REMOVE:
return (gettext(\tremove pool device ...\n));
+   case HELP_REOPEN:
+   return (); /* Undocumented command */
case HELP_SCRUB:
return (gettext(\tscrub [-s] pool ...\n));
case HELP_STATUS:
@@ -2109,10 +2115,10 @@ error:
 }
 
 typedef struct iostat_cbdata {
-   zpool_list_t *cb_list;
-   int cb_verbose;
-   int cb_iteration;
+   

svn commit: r236156 - head/sys/dev/mmc

2012-05-27 Thread Marius Strobl
Author: marius
Date: Sun May 27 16:08:58 2012
New Revision: 236156
URL: http://svn.freebsd.org/changeset/base/236156

Log:
  - Fix some typos in mmc_acquire_bus() and mmc_send_csd().
  - Fix some math errors in mmc_decode_csd_sd().
  - Fix incorrect arguments to mmc_send_app_op_cond() in mmc_go_discovery().
  - Add reporting of CSD for debug purposes.
  - Add detection (and skipping) of password-locked cards.
  - Add setting of block length on card if necessary.
  
  Submitted by: Patrick Kelsey
  MFC after:3 days

Modified:
  head/sys/dev/mmc/mmc.c

Modified: head/sys/dev/mmc/mmc.c
==
--- head/sys/dev/mmc/mmc.c  Sun May 27 16:00:00 2012(r236155)
+++ head/sys/dev/mmc/mmc.c  Sun May 27 16:08:58 2012(r236156)
@@ -224,7 +224,7 @@ mmc_acquire_bus(device_t busdev, device_
sc = device_get_softc(busdev);
MMC_LOCK(sc);
if (sc-owner)
-   panic(mmc: host bridge didn't seralize us.);
+   panic(mmc: host bridge didn't serialize us.);
sc-owner = dev;
MMC_UNLOCK(sc);
 
@@ -859,7 +859,7 @@ mmc_decode_csd_sd(uint32_t *raw_csd, str
if (v == 0) {
m = mmc_get_bits(raw_csd, 128, 115, 4);
e = mmc_get_bits(raw_csd, 128, 112, 3);
-   csd-tacc = exp[e] * mant[m] + 9 / 10;
+   csd-tacc = (exp[e] * mant[m] + 9) / 10;
csd-nsac = mmc_get_bits(raw_csd, 128, 104, 8) * 100;
m = mmc_get_bits(raw_csd, 128, 99, 4);
e = mmc_get_bits(raw_csd, 128, 96, 3);
@@ -887,7 +887,7 @@ mmc_decode_csd_sd(uint32_t *raw_csd, str
} else if (v == 1) {
m = mmc_get_bits(raw_csd, 128, 115, 4);
e = mmc_get_bits(raw_csd, 128, 112, 3);
-   csd-tacc = exp[e] * mant[m] + 9 / 10;
+   csd-tacc = (exp[e] * mant[m] + 9) / 10;
csd-nsac = mmc_get_bits(raw_csd, 128, 104, 8) * 100;
m = mmc_get_bits(raw_csd, 128, 99, 4);
e = mmc_get_bits(raw_csd, 128, 96, 3);
@@ -1002,7 +1002,7 @@ mmc_all_send_cid(struct mmc_softc *sc, u
 }
 
 static int
-mmc_send_csd(struct mmc_softc *sc, uint16_t rca, uint32_t *rawcid)
+mmc_send_csd(struct mmc_softc *sc, uint16_t rca, uint32_t *rawcsd)
 {
struct mmc_command cmd;
int err;
@@ -1012,7 +1012,7 @@ mmc_send_csd(struct mmc_softc *sc, uint1
cmd.flags = MMC_RSP_R2 | MMC_CMD_BCR;
cmd.data = NULL;
err = mmc_wait_for_cmd(sc, cmd, 0);
-   memcpy(rawcid, cmd.resp, 4 * sizeof(uint32_t));
+   memcpy(rawcsd, cmd.resp, 4 * sizeof(uint32_t));
return (err);
 }
 
@@ -1121,6 +1121,35 @@ mmc_send_relative_addr(struct mmc_softc 
return (err);
 }
 
+static int
+mmc_send_status(struct mmc_softc *sc, uint16_t rca, uint32_t *status)
+{
+   struct mmc_command cmd;
+   int err;
+
+   cmd.opcode = MMC_SEND_STATUS;
+   cmd.arg = rca  16;
+   cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
+   cmd.data = NULL;
+   err = mmc_wait_for_cmd(sc, cmd, 0);
+   *status = cmd.resp[0];
+   return (err);
+}
+
+static int
+mmc_set_blocklen(struct mmc_softc *sc, uint32_t len)
+{
+   struct mmc_command cmd;
+   int err;
+
+   cmd.opcode = MMC_SET_BLOCKLEN;
+   cmd.arg = len;
+   cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
+   cmd.data = NULL;
+   err = mmc_wait_for_cmd(sc, cmd, 0);
+   return (err);
+}
+
 static void
 mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard)
 {
@@ -1144,8 +1173,7 @@ mmc_discover_cards(struct mmc_softc *sc)
struct mmc_ivars *ivar = NULL;
device_t *devlist;
int err, i, devcount, newcard;
-   uint32_t raw_cid[4];
-   uint32_t resp, sec_count;
+   uint32_t raw_cid[4], resp, sec_count, status;
device_t child;
uint16_t rca = 2;
u_char switch_res[64];
@@ -1194,6 +1222,12 @@ mmc_discover_cards(struct mmc_softc *sc)
ivar-rca = resp  16;
/* Get card CSD. */
mmc_send_csd(sc, ivar-rca, ivar-raw_csd);
+   if (bootverbose || mmc_debug)
+   device_printf(sc-dev,
+   %sard detected (CSD %08x%08x%08x%08x)\n,
+   newcard ? New c : C, ivar-raw_csd[0],
+   ivar-raw_csd[1], ivar-raw_csd[2],
+   ivar-raw_csd[3]);
mmc_decode_csd_sd(ivar-raw_csd, ivar-csd);
ivar-sec_count = ivar-csd.capacity / MMC_SECTOR_SIZE;
if (ivar-csd.csd_structure  0)
@@ -1201,6 +1235,19 @@ mmc_discover_cards(struct mmc_softc *sc)
ivar-tran_speed = ivar-csd.tran_speed;
ivar-erase_sector = ivar-csd.erase_sector * 
ivar-csd.write_bl_len / 

svn commit: r236157 - head/sys/netinet

2012-05-27 Thread Ed Maste
Author: emaste
Date: Sun May 27 16:16:28 2012
New Revision: 236157
URL: http://svn.freebsd.org/changeset/base/236157

Log:
  Add IPPROTO_MPLS (rfc4023) IP protocol definition
  
  There are currently no in-tree consumers; I'm adding it now for use by
  vendor code.  This matches the change OpenBSD made while implementing
  MPLS in gif(4).

Modified:
  head/sys/netinet/in.h

Modified: head/sys/netinet/in.h
==
--- head/sys/netinet/in.h   Sun May 27 16:08:58 2012(r236156)
+++ head/sys/netinet/in.h   Sun May 27 16:16:28 2012(r236157)
@@ -241,6 +241,7 @@ __END_DECLS
 #defineIPPROTO_PIM 103 /* Protocol Independent 
Mcast */
 #defineIPPROTO_CARP112 /* CARP */
 #defineIPPROTO_PGM 113 /* PGM */
+#defineIPPROTO_MPLS137 /* MPLS-in-IP */
 #defineIPPROTO_PFSYNC  240 /* PFSYNC */
 /* 255: Reserved */
 /* BSD Private, local use, namespace incursion, no longer used */
___
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: r236158 - head/sys/i386/i386

2012-05-27 Thread Alan Cox
Author: alc
Date: Sun May 27 16:24:00 2012
New Revision: 236158
URL: http://svn.freebsd.org/changeset/base/236158

Log:
  Replace all uses of the vm page queues lock by a r/w lock that is private
  to this pmap.c.  This new r/w lock is used primarily to synchronize access
  to the PV lists.  However, it will be used in a somewhat unconventional
  way.  As finer-grained PV list locking is added to each of the pmap
  functions that acquire this r/w lock, its acquisition will be changed from
  write to read, enabling concurrent execution of the pmap functions with
  finer-grained locking.
  
  X-MFC after:  r236045

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

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Sun May 27 16:16:28 2012(r236157)
+++ head/sys/i386/i386/pmap.c   Sun May 27 16:24:00 2012(r236158)
@@ -118,6 +118,7 @@ __FBSDID($FreeBSD$);
 #include sys/msgbuf.h
 #include sys/mutex.h
 #include sys/proc.h
+#include sys/rwlock.h
 #include sys/sf_buf.h
 #include sys/sx.h
 #include sys/vmmeter.h
@@ -236,6 +237,7 @@ static int pat_index[PAT_INDEX_SIZE];   /*
 static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks);
 static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0;
 static struct md_page *pv_table;
+static struct rwlock pvh_global_lock;
 static int shpgperproc = PMAP_SHPGPERPROC;
 
 struct pv_chunk *pv_chunkbase; /* KVA block for pv_chunks */
@@ -392,6 +394,12 @@ pmap_bootstrap(vm_paddr_t firstaddr)
kernel_pmap-pm_root = NULL;
CPU_FILL(kernel_pmap-pm_active);  /* don't allow deactivation */
TAILQ_INIT(kernel_pmap-pm_pvchunk);
+
+   /*
+* Initialize the global pv list lock.
+*/
+   rw_init(pvh_global_lock, pvh global);
+
LIST_INIT(allpmaps);
 
/*
@@ -1276,7 +1284,7 @@ invlcaddr(void *caddr)
  * scans are across different pmaps.  It is very wasteful
  * to do an entire invltlb for checking a single mapping.
  *
- * If the given pmap is not the current pmap, vm_page_queue_mtx
+ * If the given pmap is not the current pmap, pvh_global_lock
  * must be held and curthread pinned to a CPU.
  */
 static pt_entry_t *
@@ -1292,7 +1300,7 @@ pmap_pte_quick(pmap_t pmap, vm_offset_t 
/* are we current address space or kernel? */
if (pmap_is_current(pmap))
return (vtopte(va));
-   mtx_assert(vm_page_queue_mtx, MA_OWNED);
+   rw_assert(pvh_global_lock, RA_WLOCKED);
KASSERT(curthread-td_pinned  0, (curthread not pinned));
newpf = *pde  PG_FRAME;
if ((*PMAP1  PG_FRAME) != newpf) {
@@ -1841,9 +1849,9 @@ _pmap_allocpte(pmap_t pmap, u_int ptepin
VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) {
if (flags  M_WAITOK) {
PMAP_UNLOCK(pmap);
-   vm_page_unlock_queues();
+   rw_wunlock(pvh_global_lock);
VM_WAIT;
-   vm_page_lock_queues();
+   rw_wlock(pvh_global_lock);
PMAP_LOCK(pmap);
}
 
@@ -2339,7 +2347,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv
struct pv_chunk *pc;
int idx, field, bit;
 
-   mtx_assert(vm_page_queue_mtx, MA_OWNED);
+   rw_assert(pvh_global_lock, RA_WLOCKED);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
PV_STAT(pv_entry_frees++);
PV_STAT(pv_entry_spare++);
@@ -2382,8 +2390,8 @@ get_pv_entry(pmap_t pmap, int try)
struct pv_chunk *pc;
vm_page_t m;
 
+   rw_assert(pvh_global_lock, RA_WLOCKED);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
-   mtx_assert(vm_page_queue_mtx, MA_OWNED);
PV_STAT(pv_entry_allocs++);
pv_entry_count++;
if (pv_entry_count  pv_entry_high_water)
@@ -2455,7 +2463,7 @@ pmap_pvh_remove(struct md_page *pvh, pma
 {
pv_entry_t pv;
 
-   mtx_assert(vm_page_queue_mtx, MA_OWNED);
+   rw_assert(pvh_global_lock, RA_WLOCKED);
TAILQ_FOREACH(pv, pvh-pv_list, pv_list) {
if (pmap == PV_PMAP(pv)  va == pv-pv_va) {
TAILQ_REMOVE(pvh-pv_list, pv, pv_list);
@@ -2473,7 +2481,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse
vm_offset_t va_last;
vm_page_t m;
 
-   mtx_assert(vm_page_queue_mtx, MA_OWNED);
+   rw_assert(pvh_global_lock, RA_WLOCKED);
KASSERT((pa  PDRMASK) == 0,
(pmap_pv_demote_pde: pa is not 4mpage aligned));
 
@@ -2506,7 +2514,7 @@ pmap_pv_promote_pde(pmap_t pmap, vm_offs
vm_offset_t va_last;
vm_page_t m;
 
-   mtx_assert(vm_page_queue_mtx, MA_OWNED);
+   rw_assert(pvh_global_lock, RA_WLOCKED);
KASSERT((pa  PDRMASK) == 0,
(pmap_pv_promote_pde: pa is not 4mpage aligned));
 
@@ -2547,7 +2555,7 @@ pmap_remove_entry(pmap_t pmap, 

svn commit: r236159 - head/sys/boot/arm/uboot

2012-05-27 Thread Tim Kientzle
Author: kientzle
Date: Sun May 27 16:27:04 2012
New Revision: 236159
URL: http://svn.freebsd.org/changeset/base/236159

Log:
  Allow the load address used by ARM ubldr to be set via Make argument.
  
  In particular, this simplifies scripts that build system
  images.

Modified:
  head/sys/boot/arm/uboot/Makefile
  head/sys/boot/arm/uboot/ldscript.arm

Modified: head/sys/boot/arm/uboot/Makefile
==
--- head/sys/boot/arm/uboot/MakefileSun May 27 16:24:00 2012
(r236158)
+++ head/sys/boot/arm/uboot/MakefileSun May 27 16:27:04 2012
(r236159)
@@ -7,6 +7,9 @@ NEWVERSWHAT=U-Boot loader ${MACHINE_A
 BINDIR?=   /boot
 INSTALLFLAGS=  -b
 WARNS?=1
+# Address at which ubldr will be loaded.
+# This varies for different boards and SOCs.
+UBLDR_LOADADDR?=   0x100
 
 # Architecture-specific loader code
 SRCS=  start.S conf.c vers.c
@@ -85,7 +88,9 @@ CLEANFILES+=  vers.c loader.help
 
 CFLAGS+=   -ffreestanding
 
-LDFLAGS=   -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
+LDFLAGS=   -nostdlib -static
+LDFLAGS+=  -T ldscript.generated
+LDFLAGS+=  -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
 
 # Pull in common loader code
 .PATH: ${.CURDIR}/../../uboot/common
@@ -110,6 +115,18 @@ loader.help: help.common help.uboot
cat ${.ALLSRC} | \
awk -f ${.CURDIR}/../../common/merge_help.awk  ${.TARGET}
 
+${PROG}: ldscript.generated ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
+
+ldscript.generated::
+   rm -f ldscript.generated.tmp
+   echo UBLDR_LOADADDR = ${UBLDR_LOADADDR}; ldscript.generated.tmp
+   if diff ldscript.generated ldscript.generated.tmp  /dev/null; then \
+   true; \
+   else \
+   rm -f ldscript.generated; \
+   mv ldscript.generated.tmp ldscript.generated; \
+   fi
+
 .PATH: ${.CURDIR}/../../forth
 FILES= loader.help
 

Modified: head/sys/boot/arm/uboot/ldscript.arm
==
--- head/sys/boot/arm/uboot/ldscript.armSun May 27 16:24:00 2012
(r236158)
+++ head/sys/boot/arm/uboot/ldscript.armSun May 27 16:27:04 2012
(r236159)
@@ -5,7 +5,7 @@ ENTRY(_start)
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
-  . = 0x100 + SIZEOF_HEADERS;
+  . = UBLDR_LOADADDR + SIZEOF_HEADERS;
   .interp : { *(.interp)   }
   .hash  : { *(.hash)  }
   .dynsym: { *(.dynsym)}
___
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: r236160 - in stable/9: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys

2012-05-27 Thread Ryan Stone
Author: rstone
Date: Sun May 27 18:55:23 2012
New Revision: 236160
URL: http://svn.freebsd.org/changeset/base/236160

Log:
  MFC r234691
  
   Implement the D cpu variable, which returns curcpu.  I have chosen not
   to follow the example of OpenSolaris and its descendants, which implemented
   cpu as an inline that took a value out of curthread.  At certain points in
   the FreeBSD scheduler curthread-td_oncpu will no longer be valid (in
   particular, just before the thread gets descheduled) so instead I have
   implemented this as its own built-in variable.
  
   Sponsored by: Sandvine Inc.

Modified:
  stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==
--- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cSun May 
27 16:27:04 2012(r236159)
+++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cSun May 
27 18:55:23 2012(r236160)
@@ -497,6 +497,12 @@ static const dt_ident_t _dtrace_globals[
 { zonename, DT_IDENT_SCALAR, 0, DIF_VAR_ZONENAME,
DT_ATTR_STABCMN, DT_VERS_1_0, dt_idops_type, string },
 #endif
+
+#if !defined(sun)
+{ cpu, DT_IDENT_SCALAR, 0, DIF_VAR_CPU,
+   DT_ATTR_STABCMN, DT_VERS_1_6_3, dt_idops_type, int },
+#endif
+
 { NULL, 0, 0, 0, { 0, 0, 0 }, 0, NULL, NULL }
 };
 

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cSun May 
27 16:27:04 2012(r236159)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cSun May 
27 18:55:23 2012(r236160)
@@ -3143,6 +3143,11 @@ dtrace_dif_variable(dtrace_mstate_t *mst
return (curthread-td_errno);
 #endif
}
+#if !defined(sun)
+   case DIF_VAR_CPU: {
+   return curcpu;
+   }
+#endif
default:
DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP);
return (0);

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Sun May 
27 16:27:04 2012(r236159)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Sun May 
27 18:55:23 2012(r236160)
@@ -251,6 +251,10 @@ typedef enum dtrace_probespec {
 #defineDIF_VAR_ERRNO   0x0120  /* thread errno */
 #defineDIF_VAR_EXECARGS0x0121  /* process arguments */
 
+#if !defined(sun)
+#defineDIF_VAR_CPU 0x0200
+#endif
+
 #defineDIF_SUBR_RAND   0
 #defineDIF_SUBR_MUTEX_OWNED1
 #defineDIF_SUBR_MUTEX_OWNER2
___
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: r236161 - in stable/8: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys

2012-05-27 Thread Ryan Stone
Author: rstone
Date: Sun May 27 18:57:20 2012
New Revision: 236161
URL: http://svn.freebsd.org/changeset/base/236161

Log:
  MFC r234691
  
   Implement the D cpu variable, which returns curcpu.  I have chosen not
   to follow the example of OpenSolaris and its descendants, which implemented
   cpu as an inline that took a value out of curthread.  At certain points in
   the FreeBSD scheduler curthread-td_oncpu will no longer be valid (in
   particukar, just before the thread gets descheduled) so instead I have
   implemented this as its own built-in variable.
  
   Sponsored by: Sandvine Inc.

Modified:
  stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==
--- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cSun May 
27 18:55:23 2012(r236160)
+++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cSun May 
27 18:57:20 2012(r236161)
@@ -497,6 +497,12 @@ static const dt_ident_t _dtrace_globals[
 { zonename, DT_IDENT_SCALAR, 0, DIF_VAR_ZONENAME,
DT_ATTR_STABCMN, DT_VERS_1_0, dt_idops_type, string },
 #endif
+
+#if !defined(sun)
+{ cpu, DT_IDENT_SCALAR, 0, DIF_VAR_CPU,
+   DT_ATTR_STABCMN, DT_VERS_1_6_3, dt_idops_type, int },
+#endif
+
 { NULL, 0, 0, 0, { 0, 0, 0 }, 0, NULL, NULL }
 };
 

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cSun May 
27 18:55:23 2012(r236160)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cSun May 
27 18:57:20 2012(r236161)
@@ -3143,6 +3143,11 @@ dtrace_dif_variable(dtrace_mstate_t *mst
return (curthread-td_errno);
 #endif
}
+#if !defined(sun)
+   case DIF_VAR_CPU: {
+   return curcpu;
+   }
+#endif
default:
DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP);
return (0);

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Sun May 
27 18:55:23 2012(r236160)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Sun May 
27 18:57:20 2012(r236161)
@@ -251,6 +251,10 @@ typedef enum dtrace_probespec {
 #defineDIF_VAR_ERRNO   0x0120  /* thread errno */
 #defineDIF_VAR_EXECARGS0x0121  /* process arguments */
 
+#if !defined(sun)
+#defineDIF_VAR_CPU 0x0200
+#endif
+
 #defineDIF_SUBR_RAND   0
 #defineDIF_SUBR_MUTEX_OWNED1
 #defineDIF_SUBR_MUTEX_OWNER2
___
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: r236028 - head/lib/libkiconv

2012-05-27 Thread Jan Beich
Gabor Kovesdan ga...@freebsd.org writes:

 Author: gabor
 Date: Fri May 25 22:07:13 2012
 New Revision: 236028
 URL: http://svn.freebsd.org/changeset/base/236028

 Log:
   - Add support for BSD iconv when it is build into libc
[...]
 +.if !defined(MK_ICONV)
 +CFLAGS+= -DICONV_DLOPEN
 +.endif

This doesn't work unless you include bsd.own.mk before.

  $ make WITH_ICONV= -C lib/libkiconv
  Warning: Object directory not changed from original /a/freebsd/lib/libkiconv
  clang ... -DICONV_DLOPEN ... -o kiconv_sysctl.o
  [...]
___
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: r236162 - stable/8/sys/dev/e1000

2012-05-27 Thread Ryan Stone
Author: rstone
Date: Sun May 27 19:03:16 2012
New Revision: 236162
URL: http://svn.freebsd.org/changeset/base/236162

Log:
  MFC r225640
  
   Clear transmit checksum offload context state upon lem(4) interface
   initialization.  Prior to this change packets may be transmitted with an
   incorrect checksum.
  
   em(4) already has an equivalent change in r213234.
  
   Obtained From:  Sandvine

Modified:
  stable/8/sys/dev/e1000/if_lem.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/dev/e1000/if_lem.c
==
--- stable/8/sys/dev/e1000/if_lem.c Sun May 27 18:57:20 2012
(r236161)
+++ stable/8/sys/dev/e1000/if_lem.c Sun May 27 19:03:16 2012
(r236162)
@@ -2655,6 +2655,7 @@ lem_setup_transmit_structures(struct ada
}
 
/* Reset state */
+   adapter-last_hw_offload = 0;
adapter-next_avail_tx_desc = 0;
adapter-next_tx_to_clean = 0;
adapter-num_tx_desc_avail = adapter-num_tx_desc;
___
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: r236163 - stable/7/usr.sbin/mfiutil

2012-05-27 Thread Sean Bruno
Author: sbruno
Date: Sun May 27 19:10:29 2012
New Revision: 236163
URL: http://svn.freebsd.org/changeset/base/236163

Log:
  MFC r235635
  
  Decode new battery status indications.

Modified:
  stable/7/usr.sbin/mfiutil/mfi_show.c
Directory Properties:
  stable/7/usr.sbin/mfiutil/   (props changed)

Modified: stable/7/usr.sbin/mfiutil/mfi_show.c
==
--- stable/7/usr.sbin/mfiutil/mfi_show.cSun May 27 19:03:16 2012
(r236162)
+++ stable/7/usr.sbin/mfiutil/mfi_show.cSun May 27 19:10:29 2012
(r236163)
@@ -219,7 +219,29 @@ show_battery(int ac, char **av)
}
if (stat.fw_status  MFI_BBU_STATE_DISCHARGE_ACTIVE) {
printf(%s DISCHARGING, comma ? , : );
+   comma = 1;
}
+   if (stat.fw_status  MFI_BBU_STATE_LEARN_CYC_REQ) {
+   printf(%s LEARN_CYCLE_REQUESTED, comma ? , : );
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_LEARN_CYC_ACTIVE) {
+   printf(%s LEARN_CYCLE_ACTIVE, comma ? , : );
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_LEARN_CYC_FAIL) {
+   printf(%s LEARN_CYCLE_FAIL, comma ? , : );
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_LEARN_CYC_TIMEOUT) {
+   printf(%s LEARN_CYCLE_TIMEOUT, comma ? , : );
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_I2C_ERR_DETECT) {
+   printf(%s I2C_ERROR_DETECT, comma ? , : );
+   comma = 1;
+   }
+
if (!comma)
printf( normal);
printf(\n);
___
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


Dealing with Bullies

2012-05-27 Thread For KidSake

Your email client cannot read this email.
To view it online, please go here:
http://www.forkidsake.net/emailmarketer/display.php?M=457049C=5d9abf6368eadd792a756feb3176031fS=47L=16N=2


To stop receiving these
emails:http://www.forkidsake.net/emailmarketer/unsubscribe.php?M=457049C=5d9abf6368eadd792a756feb3176031fL=16N=47
___
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: r236137 - head/contrib/gcc/config/i386

2012-05-27 Thread Roman Divacky
Fwiw, to enable the same thing in clang you want this simple patch:

===
--- Tools.cpp   (revision 157545)
+++ Tools.cpp   (working copy)
@@ -4794,6 +4794,7 @@
   if (Args.hasArg(options::OPT_static)) {
 CmdArgs.push_back(-Bstatic);
   } else {
+CmdArgs.push_back(--hash-style=both);
 if (Args.hasArg(options::OPT_rdynamic))
   CmdArgs.push_back(-export-dynamic);
 CmdArgs.push_back(--eh-frame-hdr);



I cant commit this upstream as this option doesn't work with ld 2.15. What
should be done here? Commit this to local FreeBSD version? Commit it upstream
making it not work with old ld? Leave it out completely?

On Sun, May 27, 2012 at 05:27:48AM +, Konstantin Belousov wrote:
 Author: kib
 Date: Sun May 27 05:27:47 2012
 New Revision: 236137
 URL: http://svn.freebsd.org/changeset/base/236137
 
 Log:
   Enable gnu hash generation for dynamic ELF binaries on x86.
   
   Reviewed by:kan
 
 Modified:
   head/contrib/gcc/config/i386/freebsd.h
   head/contrib/gcc/config/i386/freebsd64.h
 
 Modified: head/contrib/gcc/config/i386/freebsd.h
 ==
 --- head/contrib/gcc/config/i386/freebsd.hSun May 27 05:24:53 2012
 (r236136)
 +++ head/contrib/gcc/config/i386/freebsd.hSun May 27 05:27:47 2012
 (r236137)
 @@ -49,6 +49,7 @@ Boston, MA 02110-1301, USA.  */
   %{rdynamic: -export-dynamic} \
   %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \
%{static:-Bstatic}} \
 +%{!static:--hash-style=both} \
  %{symbolic:-Bsymbolic}
  
  /* Reset our STARTFILE_SPEC which was properly set in config/freebsd.h
 
 Modified: head/contrib/gcc/config/i386/freebsd64.h
 ==
 --- head/contrib/gcc/config/i386/freebsd64.h  Sun May 27 05:24:53 2012
 (r236136)
 +++ head/contrib/gcc/config/i386/freebsd64.h  Sun May 27 05:27:47 2012
 (r236137)
 @@ -54,4 +54,5 @@ Boston, MA 02110-1301, USA.  */
  %{rdynamic:-export-dynamic} \
   %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \
  %{static:-Bstatic}} \
 +  %{!static:--hash-style=both} \
%{symbolic:-Bsymbolic}
___
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: r236137 - head/contrib/gcc/config/i386

2012-05-27 Thread Konstantin Belousov
On Sun, May 27, 2012 at 10:31:00PM +0200, Roman Divacky wrote:
 Fwiw, to enable the same thing in clang you want this simple patch:
 
 ===
 --- Tools.cpp   (revision 157545)
 +++ Tools.cpp   (working copy)
 @@ -4794,6 +4794,7 @@
if (Args.hasArg(options::OPT_static)) {
  CmdArgs.push_back(-Bstatic);
} else {
 +CmdArgs.push_back(--hash-style=both);
  if (Args.hasArg(options::OPT_rdynamic))
CmdArgs.push_back(-export-dynamic);
  CmdArgs.push_back(--eh-frame-hdr);
 
 
 
 I cant commit this upstream as this option doesn't work with ld 2.15. What
 should be done here? Commit this to local FreeBSD version? Commit it upstream
 making it not work with old ld? Leave it out completely?
I cannot answer this question.

This should be discussed with our in-tree clang maintainers.

 
 On Sun, May 27, 2012 at 05:27:48AM +, Konstantin Belousov wrote:
  Author: kib
  Date: Sun May 27 05:27:47 2012
  New Revision: 236137
  URL: http://svn.freebsd.org/changeset/base/236137
  
  Log:
Enable gnu hash generation for dynamic ELF binaries on x86.

Reviewed by:  kan
  
  Modified:
head/contrib/gcc/config/i386/freebsd.h
head/contrib/gcc/config/i386/freebsd64.h
  
  Modified: head/contrib/gcc/config/i386/freebsd.h
  ==
  --- head/contrib/gcc/config/i386/freebsd.h  Sun May 27 05:24:53 2012
  (r236136)
  +++ head/contrib/gcc/config/i386/freebsd.h  Sun May 27 05:27:47 2012
  (r236137)
  @@ -49,6 +49,7 @@ Boston, MA 02110-1301, USA.  */
  %{rdynamic: -export-dynamic} \
  %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \
 %{static:-Bstatic}} \
  +%{!static:--hash-style=both} \
   %{symbolic:-Bsymbolic}
   
   /* Reset our STARTFILE_SPEC which was properly set in config/freebsd.h
  
  Modified: head/contrib/gcc/config/i386/freebsd64.h
  ==
  --- head/contrib/gcc/config/i386/freebsd64.hSun May 27 05:24:53 
  2012(r236136)
  +++ head/contrib/gcc/config/i386/freebsd64.hSun May 27 05:27:47 
  2012(r236137)
  @@ -54,4 +54,5 @@ Boston, MA 02110-1301, USA.  */
   %{rdynamic:-export-dynamic} \
  %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \
   %{static:-Bstatic}} \
  +  %{!static:--hash-style=both} \
 %{symbolic:-Bsymbolic}


pgpvfQn2j6NfX.pgp
Description: PGP signature


svn commit: r236164 - stable/9/sys/ufs/ffs

2012-05-27 Thread Kirk McKusick
Author: mckusick
Date: Sun May 27 21:31:28 2012
New Revision: 236164
URL: http://svn.freebsd.org/changeset/base/236164

Log:
  MFC of 235610
  
  Add missing `continue' statement at end of case.
  
  Found by:  Kevin Lo (kevlo@)

Modified:
  stable/9/sys/ufs/ffs/ffs_softdep.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/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/ufs/ffs/ffs_softdep.c
==
--- stable/9/sys/ufs/ffs/ffs_softdep.c  Sun May 27 19:10:29 2012
(r236163)
+++ stable/9/sys/ufs/ffs/ffs_softdep.c  Sun May 27 21:31:28 2012
(r236164)
@@ -10687,6 +10687,7 @@ handle_jwork(wkhd)
case D_FREEFRAG:
rele_jseg(WK_JSEG(WK_FREEFRAG(wk)-ff_jdep));
WORKITEM_FREE(wk, D_FREEFRAG);
+   continue;
case D_FREEWORK:
handle_written_freework(WK_FREEWORK(wk));
continue;
___
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: r236166 - stable/9/sys/net

2012-05-27 Thread Xin LI
Author: delphij
Date: Mon May 28 04:47:46 2012
New Revision: 236166
URL: http://svn.freebsd.org/changeset/base/236166

Log:
  MFC r235425:
  
  Sync DLTs with the latest pcap version.

Modified:
  stable/9/sys/net/bpf.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/net/bpf.h
==
--- stable/9/sys/net/bpf.h  Mon May 28 00:29:08 2012(r236165)
+++ stable/9/sys/net/bpf.h  Mon May 28 04:47:46 2012(r236166)
@@ -279,6 +279,24 @@ struct bpf_zbuf_header {
  */
 #define DLT_SYMANTEC_FIREWALL  99
 
+/*
+ * Values between 100 and 103 are used in capture file headers as
+ * link-layer header type LINKTYPE_ values corresponding to DLT_ types
+ * that differ between platforms; don't use those values for new DLT_
+ * new types.
+ */
+
+/*
+ * Values starting with 104 are used for newly-assigned link-layer
+ * header type values; for those link-layer header types, the DLT_
+ * value returned by pcap_datalink() and passed to pcap_open_dead(),
+ * and the LINKTYPE_ value that appears in capture files, are the
+ * same.
+ *
+ * DLT_MATCHING_MIN is the lowest such value; DLT_MATCHING_MAX is
+ * the highest such value.
+ */
+#define DLT_MATCHING_MIN   104
 
 /*
  * This value was defined by libpcap 0.5; platforms that have defined
@@ -978,8 +996,110 @@ struct bpf_zbuf_header {
  * Raw IPv4/IPv6; different from DLT_RAW in that the DLT_ value specifies
  * whether it's v4 or v6.  Requested by Darren Reed darren.r...@sun.com.
  */
-#defineDLT_IPV4228
-#defineDLT_IPV6229
+#define DLT_IPV4   228
+#define DLT_IPV6   229
+
+/*
+ * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
+ * nothing), and with no FCS at the end of the frame; requested by
+ * Jon Smirl jonsm...@gmail.com.
+ */
+#define DLT_IEEE802_15_4_NOFCS 230
+
+/*
+ * Raw D-Bus:
+ *
+ * http://www.freedesktop.org/wiki/Software/dbus
+ *
+ * messages:
+ *
+ * 
http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-messages
+ *
+ * starting with the endianness flag, followed by the message type, etc.,
+ * but without the authentication handshake before the message sequence:
+ *
+ * http://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
+ *
+ * Requested by Martin Vidner mar...@vidner.net.
+ */
+#define DLT_DBUS   231
+
+/*
+ * Juniper-private data link type, as per request from
+ * Hannes Gredler han...@juniper.net.
+ */
+#define DLT_JUNIPER_VS 232
+#define DLT_JUNIPER_SRX_E2E233
+#define DLT_JUNIPER_FIBRECHANNEL   234
+
+/*
+ * DVB-CI (DVB Common Interface for communication between a PC Card
+ * module and a DVB receiver).  See
+ *
+ * http://www.kaiser.cx/pcap-dvbci.html
+ *
+ * for the specification.
+ *
+ * Requested by Martin Kaiser mar...@kaiser.cx.
+ */
+#define DLT_DVB_CI 235
+
+/*
+ * Variant of 3GPP TS 27.010 multiplexing protocol (similar to, but
+ * *not* the same as, 27.010).  Requested by Hans-Christoph Schemmel
+ * hans-christoph.schem...@cinterion.com.
+ */
+#define DLT_MUX27010   236
+
+/*
+ * STANAG 5066 D_PDUs.  Requested by M. Baris Demiray
+ * barisdemi...@gmail.com.
+ */
+#define DLT_STANAG_5066_D_PDU  237
+
+/*
+ * Juniper-private data link type, as per request from
+ * Hannes Gredler han...@juniper.net.
+ */
+#define DLT_JUNIPER_ATM_CEMIC  238
+
+/*
+ * NetFilter LOG messages 
+ * (payload of netlink NFNL_SUBSYS_ULOG/NFULNL_MSG_PACKET packets)
+ *
+ * Requested by Jakub Zawadzki darkjames...@darkjames.pl
+ */
+#define DLT_NFLOG  239
+
+/*
+ * Hilscher Gesellschaft fuer Systemautomation mbH link-layer type
+ * for Ethernet packets with a 4-byte pseudo-header and always
+ * with the payload including the FCS, as supplied by their
+ * netANALYZER hardware and software.
+ *
+ * Requested by Holger P. Frommer hpfrom...@hilscher.com
+ */
+#define DLT_NETANALYZER240
+
+/*
+ * Hilscher Gesellschaft fuer Systemautomation mbH link-layer type
+ * for Ethernet packets with a 4-byte pseudo-header and FCS and
+ * with the Ethernet header preceded by 7 bytes of preamble and
+ * 1 byte of SFD, as supplied by their netANALYZER hardware and
+ * software.
+ *
+ * Requested by Holger P. Frommer hpfrom...@hilscher.com
+ */
+#define DLT_NETANALYZER_TRANSPARENT241
+
+/*
+ * IP-over-Infiniband, as specified by RFC 4391.
+ *
+ * Requested by Petr Sumbera petr.sumb...@oracle.com.
+ */
+#define DLT_IPOIB  242
+
+#define DLT_MATCHING_MAX   242 /* highest value in the matching 
range */
 
 /*
  * DLT and savefile link type values are split into a class and
___
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