svn commit: r254899 - head/sys/modules/drm2

2013-08-26 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Mon Aug 26 09:17:21 2013
New Revision: 254899
URL: http://svnweb.freebsd.org/changeset/base/254899

Log:
  drm/radeon: Disable build on i386/pc98

Modified:
  head/sys/modules/drm2/Makefile

Modified: head/sys/modules/drm2/Makefile
==
--- head/sys/modules/drm2/Makefile  Mon Aug 26 07:48:50 2013
(r254898)
+++ head/sys/modules/drm2/Makefile  Mon Aug 26 09:17:21 2013
(r254899)
@@ -2,14 +2,26 @@
 
 .include 
 
-.if ${MK_SOURCELESS_UCODE} != "no"
+.if ${MACHINE_CPUARCH} == "amd64"
+_radeonkms=radeonkms
+. if ${MK_SOURCELESS_UCODE} != "no"
 _radeonkmsfw=  radeonkmsfw
+. endif
+.endif
+
+.if ${MACHINE_CPUARCH} == "i386"
+. if ${MACHINE} != "pc98"
+_radeonkms=radeonkms
+.  if ${MK_SOURCELESS_UCODE} != "no"
+_radeonkmsfw=  radeonkmsfw
+.  endif
+. endif
 .endif
 
 SUBDIR = \
drm2 \
i915kms \
-   radeonkms \
+   ${_radeonkms} \
${_radeonkmsfw}
 
 .include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r254527 - in head/sys: net80211 netinet sys

2013-08-26 Thread Gleb Smirnoff
A> Author: andre
A> Date: Mon Aug 19 14:25:11 2013
A> New Revision: 254527
A> URL: http://svnweb.freebsd.org/changeset/base/254527
A> 
A> Log:
A>   Reorder the mbuf defines to make more sense and group related flags
A>   together.
A>   
A>   Add M_FLAG_PRINTF for use with printf(9) %b indentifier.
A>   
A>   Use the generic mbuf flags print names in the net80211 code and adjust
A>   the protocol specific bits for their new positions.
A>   
A>   Change SCTP M_PROTO mapping from 5 to 1 to fit within the 16bit field
A>   they use internally to store some additional information.
A>   
A>   Discussed with:trociny, glebius

The first part: "reorder the mbuf flag defines" wasn't actually discussed.

Tossing values of M_BCAST, M_MCAST, M_VLANTAG for no value except code
tidyness isn't a safe idea. These are the flags that device drivers use.
After this change binary drivers are still loadable but would be buggy.

We allow ourselves ABI changes in head, but this doesn't mean that we
should do them for no important reason.

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


svn commit: r254900 - head/sys/net80211

2013-08-26 Thread Adrian Chadd
Author: adrian
Date: Mon Aug 26 09:52:05 2013
New Revision: 254900
URL: http://svnweb.freebsd.org/changeset/base/254900

Log:
  Migrate the ff_encap1() routine out into the normal output code.
  
  This will eventually be used by the A-MSDU encapsulation code that
  I'm writing - the sub-frame encapsulation requirement is the same.

Modified:
  head/sys/net80211/ieee80211_output.c
  head/sys/net80211/ieee80211_proto.h
  head/sys/net80211/ieee80211_superg.c

Modified: head/sys/net80211/ieee80211_output.c
==
--- head/sys/net80211/ieee80211_output.cMon Aug 26 09:17:21 2013
(r254899)
+++ head/sys/net80211/ieee80211_output.cMon Aug 26 09:52:05 2013
(r254900)
@@ -3316,3 +3316,40 @@ ieee80211_beacon_update(struct ieee80211
 
return len_changed;
 }
+
+/*
+ * Do Ethernet-LLC encapsulation for each payload in a fast frame
+ * tunnel encapsulation.  The frame is assumed to have an Ethernet
+ * header at the front that must be stripped before prepending the
+ * LLC followed by the Ethernet header passed in (with an Ethernet
+ * type that specifies the payload size).
+ */
+struct mbuf *
+ieee80211_ff_encap1(struct ieee80211vap *vap, struct mbuf *m,
+   const struct ether_header *eh)
+{
+   struct llc *llc;
+   uint16_t payload;
+
+   /* XXX optimize by combining m_adj+M_PREPEND */
+   m_adj(m, sizeof(struct ether_header) - sizeof(struct llc));
+   llc = mtod(m, struct llc *);
+   llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
+   llc->llc_control = LLC_UI;
+   llc->llc_snap.org_code[0] = 0;
+   llc->llc_snap.org_code[1] = 0;
+   llc->llc_snap.org_code[2] = 0;
+   llc->llc_snap.ether_type = eh->ether_type;
+   payload = m->m_pkthdr.len;  /* NB: w/o Ethernet header */
+
+   M_PREPEND(m, sizeof(struct ether_header), M_NOWAIT);
+   if (m == NULL) {/* XXX cannot happen */
+   IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG,
+   "%s: no space for ether_header\n", __func__);
+   vap->iv_stats.is_tx_nobuf++;
+   return NULL;
+   }
+   ETHER_HEADER_COPY(mtod(m, void *), eh);
+   mtod(m, struct ether_header *)->ether_type = htons(payload);
+   return m;
+}

Modified: head/sys/net80211/ieee80211_proto.h
==
--- head/sys/net80211/ieee80211_proto.h Mon Aug 26 09:17:21 2013
(r254899)
+++ head/sys/net80211/ieee80211_proto.h Mon Aug 26 09:52:05 2013
(r254900)
@@ -125,6 +125,9 @@ int ieee80211_send_probereq(struct ieee8
const uint8_t da[IEEE80211_ADDR_LEN],
const uint8_t bssid[IEEE80211_ADDR_LEN],
const uint8_t *ssid, size_t ssidlen);
+struct mbuf *  ieee80211_ff_encap1(struct ieee80211vap *, struct mbuf *,
+   const struct ether_header *);
+
 /*
  * The formation of ProbeResponse frames requires guidance to
  * deal with legacy clients.  When the client is identified as

Modified: head/sys/net80211/ieee80211_superg.c
==
--- head/sys/net80211/ieee80211_superg.cMon Aug 26 09:17:21 2013
(r254899)
+++ head/sys/net80211/ieee80211_superg.cMon Aug 26 09:52:05 2013
(r254900)
@@ -330,43 +330,6 @@ ieee80211_ff_decap(struct ieee80211_node
 }
 
 /*
- * Do Ethernet-LLC encapsulation for each payload in a fast frame
- * tunnel encapsulation.  The frame is assumed to have an Ethernet
- * header at the front that must be stripped before prepending the
- * LLC followed by the Ethernet header passed in (with an Ethernet
- * type that specifies the payload size).
- */
-static struct mbuf *
-ff_encap1(struct ieee80211vap *vap, struct mbuf *m,
-   const struct ether_header *eh)
-{
-   struct llc *llc;
-   uint16_t payload;
-
-   /* XXX optimize by combining m_adj+M_PREPEND */
-   m_adj(m, sizeof(struct ether_header) - sizeof(struct llc));
-   llc = mtod(m, struct llc *);
-   llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
-   llc->llc_control = LLC_UI;
-   llc->llc_snap.org_code[0] = 0;
-   llc->llc_snap.org_code[1] = 0;
-   llc->llc_snap.org_code[2] = 0;
-   llc->llc_snap.ether_type = eh->ether_type;
-   payload = m->m_pkthdr.len;  /* NB: w/o Ethernet header */
-
-   M_PREPEND(m, sizeof(struct ether_header), M_NOWAIT);
-   if (m == NULL) {/* XXX cannot happen */
-   IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG,
-   "%s: no space for ether_header\n", __func__);
-   vap->iv_stats.is_tx_nobuf++;
-   return NULL;
-   }
-   ETHER_HEADER_COPY(mtod(m, void *), eh);
-   mtod(m, struct ether_header *)->ether_type = htons(payload);
-   return m;
-}
-
-/*
  * Fast frame encapsulation.  The

svn commit: r254901 - head/sys/arm/arm

2013-08-26 Thread Andrew Turner
Author: andrew
Date: Mon Aug 26 10:24:59 2013
New Revision: 254901
URL: http://svnweb.freebsd.org/changeset/base/254901

Log:
  Revert r251370 as it contains a deadlock.

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Mon Aug 26 09:52:05 2013(r254900)
+++ head/sys/arm/arm/pmap-v6.c  Mon Aug 26 10:24:59 2013(r254901)
@@ -2944,126 +2944,6 @@ void
 pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr,
 vm_size_t len, vm_offset_t src_addr)
 {
-   struct l2_bucket *l2b_src, *l2b_dst;
-   struct pv_entry *pve;
-   vm_offset_t addr;
-   vm_offset_t end_addr;
-   vm_offset_t next_bucket;
-   u_int flags;
-   boolean_t l2b_alloc;
-
-   CTR4(KTR_PMAP, "%s: VA = 0x%08x, len = 0x%08x. Will %s\n", __func__,
-   src_addr, len, (dst_addr != src_addr) ? "exit" : "copy");
-
-   if (dst_addr != src_addr)
-   return;
-
-   rw_wlock(&pvh_global_lock);
-   if (dst_pmap < src_pmap) {
-   PMAP_LOCK(dst_pmap);
-   PMAP_LOCK(src_pmap);
-   } else {
-   PMAP_LOCK(src_pmap);
-   PMAP_LOCK(dst_pmap);
-   }
-
-   end_addr = src_addr + len;
-   addr = src_addr;
-   /*
-* Iterate through all used l2_buckets in a given range.
-*/
-   while (addr < end_addr) {
-   pt_entry_t *src_ptep, *dst_ptep;
-   pt_entry_t src_pte;
-
-   next_bucket = L2_NEXT_BUCKET(addr);
-   /*
-* If the next bucket VA is out of the
-* copy range then set it to end_addr in order
-* to copy all mappings until the given limit.
-*/ 
-   if (next_bucket > end_addr)
-   next_bucket = end_addr;
-
-   l2b_src = pmap_get_l2_bucket(src_pmap, addr);
-   if (l2b_src == NULL) {
-   addr = next_bucket;
-   continue;
-   }
-   src_ptep = &l2b_src->l2b_kva[l2pte_index(addr)];
-
-   while (addr < next_bucket) {
-   vm_page_t srcmpte;
-
-   src_pte = *src_ptep;
-   srcmpte = PHYS_TO_VM_PAGE(l2pte_pa(src_pte));
-   /*
-* We only virtual copy managed pages
-*/
-   if (srcmpte && (srcmpte->oflags & VPO_UNMANAGED) == 0) {
-   l2b_alloc = FALSE;
-   l2b_dst = pmap_get_l2_bucket(dst_pmap, addr);
-   /*
-* Check if the allocation of another
-* l2_bucket is necessary.
-*/
-   if (l2b_dst == NULL) {
-   l2b_dst = pmap_alloc_l2_bucket(dst_pmap,
-   addr);
-   l2b_alloc = TRUE;
-   }
-   if (l2b_dst == NULL)
-   goto out;
-
-   dst_ptep = &l2b_dst->l2b_kva[l2pte_index(addr)];
-
-   if (*dst_ptep == 0 &&
-   (pve = pmap_get_pv_entry(dst_pmap, TRUE))) {
-   /*
-* Check whether the source mapping is
-* writable and set the proper flag
-* for a copied mapping so that right
-* permissions could be set on the
-* access fault.
-*/
-   flags = 0;
-   if ((src_pte & L2_APX) == 0)
-   flags = PVF_WRITE;
-   pmap_enter_pv(srcmpte, pve, dst_pmap,
-   addr, flags);
-   /*
-* Clear the modified and
-* accessed (referenced) flags
-* and don't set the wired flag
-* during the copy.
-*/
-   *dst_ptep = src_pte;
-   *dst_ptep &= ~L2_S_REF;
-   *dst_ptep |= L2_APX;
-   /*
-* Update stats
-*/
-   

svn commit: r254902 - head/sys/arm/conf

2013-08-26 Thread Andrew Turner
Author: andrew
Date: Mon Aug 26 10:27:15 2013
New Revision: 254902
URL: http://svnweb.freebsd.org/changeset/base/254902

Log:
  Update the root device to be correct for use with crochet.

Modified:
  head/sys/arm/conf/VERSATILEPB

Modified: head/sys/arm/conf/VERSATILEPB
==
--- head/sys/arm/conf/VERSATILEPB   Mon Aug 26 10:24:59 2013
(r254901)
+++ head/sys/arm/conf/VERSATILEPB   Mon Aug 26 10:27:15 2013
(r254902)
@@ -53,7 +53,7 @@ options   SYSVMSG #SYSV-style message q
 optionsSYSVSEM #SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
 optionsKBD_INSTALL_CDEV# install a CDEV entry in /dev
-options ROOTDEVNAME=\"ufs:da0s2a\"
+optionsROOTDEVNAME=\"ufs:da0s1a\"
 optionsVFP # vfp/neon
 
 optionsPREEMPTION
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r254779 - head/sys/kern

2013-08-26 Thread Gleb Smirnoff
On Sat, Aug 24, 2013 at 12:24:59PM +, Andre Oppermann wrote:
A> Author: andre
A> Date: Sat Aug 24 12:24:58 2013
A> New Revision: 254779
A> URL: http://svnweb.freebsd.org/changeset/base/254779
A> 
A> Log:
A>   Avoid code duplication for mbuf initialization and use m_init() instead
A>   in mb_ctor_mbuf() and mb_ctor_pack().

m_init() is inline, but it calls m_pkthdr_init() which isn't inline. It
might be that compiler inline it due to m_pkthdr_init() living in the same
file as mb_ctor_mbuf() and mb_ctor_pack(), but not sure.

m_pkthdr_init() zeroes much more than deleted code did. Some zeroing
operations are definitely superfluous job.

The change is definitely not an no-op change. It might have pessimized
the mbuf allocation performance.

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


Re: svn commit: r254805 - head/sys/sys

2013-08-26 Thread Gleb Smirnoff
On Sat, Aug 24, 2013 at 07:58:36PM +, Andre Oppermann wrote:
A> Author: andre
A> Date: Sat Aug 24 19:58:36 2013
A> New Revision: 254805
A> URL: http://svnweb.freebsd.org/changeset/base/254805
A> 
A> Log:
A>   Add mtodo(m, o) macro taking an additional offset into the mbuf data 
section.
A>   
A>   Sponsored by:  The FreeBSD Foundation
A> 
A> Modified:
A>   head/sys/sys/mbuf.h
A> 
A> Modified: head/sys/sys/mbuf.h
A> 
==
A> --- head/sys/sys/mbuf.h  Sat Aug 24 19:51:18 2013(r254804)
A> +++ head/sys/sys/mbuf.h  Sat Aug 24 19:58:36 2013(r254805)
A> @@ -67,8 +67,10 @@
A>   * type:
A>   *
A>   * mtod(m, t)   -- Convert mbuf pointer to data pointer of correct type.
A> + * mtodo(m, o) -- Same as above but with offset 'o' into data.
A>   */
A>  #define mtod(m, t)  ((t)((m)->m_data))
A> +#define mtodo(m, o) ((void *)(((m)->m_data) + (o)))

IMO, having a typecast would be better. Then mtodo() would be really same as
mtod(), as stated in comment.

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


Re: svn commit: r254823 - head/sys/net

2013-08-26 Thread Gleb Smirnoff
On Sun, Aug 25, 2013 at 01:55:15AM +, Alfred Perlstein wrote:
A> Author: alfred
A> Date: Sun Aug 25 01:55:14 2013
A> New Revision: 254823
A> URL: http://svnweb.freebsd.org/changeset/base/254823
A> 
A> Log:
A>   Remove the #ifdef OFED from the 20 byte mac in struct llentry.
A>   
A>   With this change it is now possible to build the entire infiniband
A>   stack as modules and load it dynamically including IP over IB.
A> 
A> Modified:
A>   head/sys/net/if_llatbl.h
A> 
A> Modified: head/sys/net/if_llatbl.h
A> 
==
A> --- head/sys/net/if_llatbl.h Sun Aug 25 00:34:44 2013(r254822)
A> +++ head/sys/net/if_llatbl.h Sun Aug 25 01:55:14 2013(r254823)
A> @@ -75,9 +75,7 @@ struct llentry {
A>  union {
A>  uint64_tmac_aligned;
A>  uint16_tmac16[3];
A> -#ifdef OFED
A>  uint8_t mac8[20];   /* IB needs 20 bytes. */
A> -#endif
A>  } ll_addr;
A>  
A>  /* XXX af-private? */

#include "opt_ofed.h" should be removed from the file as well.

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


svn commit: r254906 - head/usr.sbin/mfiutil

2013-08-26 Thread Sean Bruno
Author: sbruno
Date: Mon Aug 26 12:05:38 2013
New Revision: 254906
URL: http://svnweb.freebsd.org/changeset/base/254906

Log:
  Add support to reconfigure a drive as SYSPD (real JBOD in LSI
  terminology).
  
  Adds command "mfiutil syspd " to change a drive to SYSPD.  Drive
  will then be scanned/reported immediately as /dev/mfisyspdX by the host.
  
  "mfiutil good " clears SYSPD mode, remove /dev/mfisyspdX and
  sets disk into UNCONFIGURED mode.
  
  Tested on Dell H310 SAS/SATA RAID controller.
  
  MFC after:2 weeks
  Sponsored by: Yahoo! Inc.

Modified:
  head/usr.sbin/mfiutil/mfi_drive.c
  head/usr.sbin/mfiutil/mfiutil.8
  head/usr.sbin/mfiutil/mfiutil.c

Modified: head/usr.sbin/mfiutil/mfi_drive.c
==
--- head/usr.sbin/mfiutil/mfi_drive.c   Mon Aug 26 12:04:22 2013
(r254905)
+++ head/usr.sbin/mfiutil/mfi_drive.c   Mon Aug 26 12:05:38 2013
(r254906)
@@ -474,6 +474,20 @@ rebuild_drive(int ac, char **av)
 MFI_COMMAND(top, rebuild, rebuild_drive);
 
 static int
+syspd_drive(int ac, char **av)
+{
+
+   if (ac != 2) {
+   warnx("syspd: %s", ac > 2 ? "extra arguments" :
+   "drive required");
+   return (EINVAL);
+   }
+
+   return (drive_set_state(av[1], MFI_PD_STATE_SYSTEM));
+}
+MFI_COMMAND(top, syspd, syspd_drive);
+
+static int
 start_rebuild(int ac, char **av)
 {
struct mfi_pd_info info;

Modified: head/usr.sbin/mfiutil/mfiutil.8
==
--- head/usr.sbin/mfiutil/mfiutil.8 Mon Aug 26 12:04:22 2013
(r254905)
+++ head/usr.sbin/mfiutil/mfiutil.8 Mon Aug 26 12:05:38 2013
(r254906)
@@ -91,6 +91,9 @@
 .Cm rebuild Ar drive
 .Nm
 .Op Fl u Ar unit
+.Cm syspd Ar drive
+.Nm
+.Op Fl u Ar unit
 .Cm drive progress Ar drive
 .Nm
 .Op Fl u Ar unit
@@ -372,6 +375,11 @@ Mark a failed
 that is still part of an array as a good drive suitable for a rebuild.
 The firmware should kick off an array rebuild on its own if a failed drive
 is marked as a rebuild drive.
+.It Cm syspd Ar drive
+Present the drive to the host operating system as a disk SYSPD block device in
+the format /dev/mfisyspdX.  Clear this flag with
+.Cm good
+.Ar drive
 .It Cm drive progress Ar drive
 Report the current progress and estimated completion time of drive operations
 such as rebuilds or patrol reads.
@@ -679,6 +687,10 @@ Add the drive in slot 2 in the main chas
 .Pp
 .Dl Nm Cm add s2 mfid0
 .Pp
+Reconfigure a disk as a SYSPD block device with no RAID
+.Pp
+.Dl Nm Cm syspd 0
+.Pp
 Configure the adapter to run periodic patrol reads once a week with the first
 patrol read starting in 5 minutes:
 .Pp

Modified: head/usr.sbin/mfiutil/mfiutil.c
==
--- head/usr.sbin/mfiutil/mfiutil.c Mon Aug 26 12:04:22 2013
(r254905)
+++ head/usr.sbin/mfiutil/mfiutil.c Mon Aug 26 12:05:38 2013
(r254906)
@@ -66,8 +66,9 @@ usage(void)
fprintf(stderr, "show patrol   - display patrol read 
status\n");
fprintf(stderr, "show progress - display status of 
active operations\n");
fprintf(stderr, "fail   - fail a physical 
drive\n");
-   fprintf(stderr, "good   - mark a bad physical 
drive as good\n");
+   fprintf(stderr, "good   - set a failed/SYSPD 
drive as UNCONFIGURED\n");
fprintf(stderr, "rebuild- mark failed drive 
ready for rebuild\n");
+   fprintf(stderr, "syspd  - set drive into use as 
SYSPD JBOD\n");
fprintf(stderr, "drive progress - display status of 
active operations\n");
fprintf(stderr, "drive clear   - clear a drive 
with all 0x00\n");
fprintf(stderr, "start rebuild \n");
@@ -103,7 +104,7 @@ static int
 version(int ac __unused, char **av __unused)
 {
 
-   printf("mfiutil version 1.0.14");
+   printf("mfiutil version 1.0.15");
 #ifdef DEBUG
printf(" (DEBUG)");
 #endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254910 - head/sys/dev/xen/netback

2013-08-26 Thread Andre Oppermann
Author: andre
Date: Mon Aug 26 13:17:37 2013
New Revision: 254910
URL: http://svnweb.freebsd.org/changeset/base/254910

Log:
  Fix mbuf debugging printf()'s after the recent mbuf header changes.

Modified:
  head/sys/dev/xen/netback/netback.c

Modified: head/sys/dev/xen/netback/netback.c
==
--- head/sys/dev/xen/netback/netback.c  Mon Aug 26 13:00:25 2013
(r254909)
+++ head/sys/dev/xen/netback/netback.c  Mon Aug 26 13:17:37 2013
(r254910)
@@ -587,14 +587,14 @@ xnb_dump_mbuf(const struct mbuf *m)
if (m->m_flags & M_PKTHDR) {
printf("flowid=%10d, csum_flags=%#8x, csum_data=%#8x, "
   "tso_segsz=%5hd\n",
-  m->m_pkthdr.flowid, m->m_pkthdr.csum_flags,
+  m->m_pkthdr.flowid, (int)m->m_pkthdr.csum_flags,
   m->m_pkthdr.csum_data, m->m_pkthdr.tso_segsz);
-   printf("rcvif=%16p,  header=%18p, len=%19d\n",
-  m->m_pkthdr.rcvif, m->m_pkthdr.header, m->m_pkthdr.len);
+   printf("rcvif=%16p,  len=%19d\n",
+  m->m_pkthdr.rcvif, m->m_pkthdr.len);
}
printf("m_next=%16p, m_nextpk=%16p, m_data=%16p\n",
   m->m_next, m->m_nextpkt, m->m_data);
-   printf("m_len=%17d, m_flags=%#15x, m_type=%18hd\n",
+   printf("m_len=%17d, m_flags=%#15x, m_type=%18u\n",
   m->m_len, m->m_flags, m->m_type);
 
len = m->m_len;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r254527 - in head/sys: net80211 netinet sys

2013-08-26 Thread Andre Oppermann

On 26.08.2013 11:43, Gleb Smirnoff wrote:

A> Author: andre
A> Date: Mon Aug 19 14:25:11 2013
A> New Revision: 254527
A> URL: http://svnweb.freebsd.org/changeset/base/254527
A>
A> Log:
A>   Reorder the mbuf defines to make more sense and group related flags
A>   together.
A>
A>   Add M_FLAG_PRINTF for use with printf(9) %b indentifier.
A>
A>   Use the generic mbuf flags print names in the net80211 code and adjust
A>   the protocol specific bits for their new positions.
A>
A>   Change SCTP M_PROTO mapping from 5 to 1 to fit within the 16bit field
A>   they use internally to store some additional information.
A>
A>   Discussed with: trociny, glebius

The first part: "reorder the mbuf flag defines" wasn't actually discussed.


It was part of the patch to the email I sent you, and a couple of others,
to which you replied with no objection to the M_FLAGS cleanup.  It wasn't
explicitly spelled out but very visible in the patch.


Tossing values of M_BCAST, M_MCAST, M_VLANTAG for no value except code
tidyness isn't a safe idea. These are the flags that device drivers use.
After this change binary drivers are still loadable but would be buggy.


As I already explained elsewhere, on -current only KLD's compiled at the same
time/revision as the kernel are supported.  It has been this way as long as
I can remember.  There never was any guarantee, not even implicit, that a KLD
from r254000 will continue to work with a kernel from r254527.  In fact, if
it were, it would be almost impossible to develop anything on -current.

On -stable we do have this ABI+API guarantee, so a KLD from 9.0 is supposed
to work on 9.2 as well and we generally keep that promise.


We allow ourselves ABI changes in head, but this doesn't mean that we
should do them for no important reason.


The "important" reason are the later updates to the mbuf headers and that
it simply doesn't make sense to keep the defines spaghetti while the whole
thing is being overhauled.

It seems from a technical point of view both arguments, maintain bits vs.
reordering, are rather weak and prone to bike-shedding. ;)  It certainly
doesn't make sense to change again and revert it just for the sake of it.

--
Andre

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


Re: svn commit: r254823 - head/sys/net

2013-08-26 Thread Alfred Perlstein

Thanks Gleb.  Will do.

-Alfred

On 8/26/13 4:52 AM, Gleb Smirnoff wrote:

On Sun, Aug 25, 2013 at 01:55:15AM +, Alfred Perlstein wrote:
A> Author: alfred
A> Date: Sun Aug 25 01:55:14 2013
A> New Revision: 254823
A> URL: http://svnweb.freebsd.org/changeset/base/254823
A>
A> Log:
A>   Remove the #ifdef OFED from the 20 byte mac in struct llentry.
A>
A>   With this change it is now possible to build the entire infiniband
A>   stack as modules and load it dynamically including IP over IB.
A>
A> Modified:
A>   head/sys/net/if_llatbl.h
A>
A> Modified: head/sys/net/if_llatbl.h
A> 
==
A> --- head/sys/net/if_llatbl.h  Sun Aug 25 00:34:44 2013(r254822)
A> +++ head/sys/net/if_llatbl.h  Sun Aug 25 01:55:14 2013(r254823)
A> @@ -75,9 +75,7 @@ struct llentry {
A>   union {
A>   uint64_tmac_aligned;
A>   uint16_tmac16[3];
A> -#ifdef OFED
A>   uint8_t mac8[20];   /* IB needs 20 bytes. */
A> -#endif
A>   } ll_addr;
A>
A>   /* XXX af-private? */

#include "opt_ofed.h" should be removed from the file as well.



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


svn commit: r254911 - head/sys/vm

2013-08-26 Thread Gleb Smirnoff
Author: glebius
Date: Mon Aug 26 14:14:25 2013
New Revision: 254911
URL: http://svnweb.freebsd.org/changeset/base/254911

Log:
  Remove comment that is no longer relevant since r254182.

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Mon Aug 26 13:17:37 2013(r254910)
+++ head/sys/vm/vm_page.c   Mon Aug 26 14:14:25 2013(r254911)
@@ -1753,10 +1753,6 @@ retry:
if (drop != NULL) {
/*
 * Enqueue the vnode for deferred vdrop().
-*
-* Once the pages are removed from the free
-* page list, "pageq" can be safely abused to
-* construct a short-lived list of vnodes.
 */
m->plinks.s.pv = drop;
SLIST_INSERT_HEAD(&deferred_vdrop_list, m,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r254779 - head/sys/kern

2013-08-26 Thread Andre Oppermann

On 26.08.2013 12:50, Gleb Smirnoff wrote:

On Sat, Aug 24, 2013 at 12:24:59PM +, Andre Oppermann wrote:
A> Author: andre
A> Date: Sat Aug 24 12:24:58 2013
A> New Revision: 254779
A> URL: http://svnweb.freebsd.org/changeset/base/254779
A>
A> Log:
A>   Avoid code duplication for mbuf initialization and use m_init() instead
A>   in mb_ctor_mbuf() and mb_ctor_pack().

m_init() is inline, but it calls m_pkthdr_init() which isn't inline. It
might be that compiler inline it due to m_pkthdr_init() living in the same
file as mb_ctor_mbuf() and mb_ctor_pack(), but not sure.


It depends on the optimization level.


m_pkthdr_init() zeroes much more than deleted code did. Some zeroing
operations are definitely superfluous job.


It's exactly the same for mb_ctor_mbuf() and one more for mb_ctor_pack().

Overall it has become more because we've got a couple more (small) fields
in the mbuf headers now.  Looking at the size of the headers it may be
faster to just bzero() it instead of doing it one by one.

The overall problem is that replicating the same operations in multiple
places is dangerous from a consistency point of view.


The change is definitely not an no-op change. It might have pessimized
the mbuf allocation performance.


Heavy inlining is not always an advantage and cause i-cache bloat.  But
you're right I haven't benchmarked it (yet) and thus we don't know.

I've been setting up my 10G benchmark environment but had to re-prioritize
due to the impeding freeze on -current.  If the benchmarking shows a conclusive
pessimization I'm more than happy to compensate for it, either by inlining
m_pkthdr_init() as well or some form of macro.  Such changes can still be
done during API freeze, but before BETA1.

--
Andre

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


Re: svn commit: r254805 - head/sys/sys

2013-08-26 Thread Andre Oppermann

On 26.08.2013 13:00, Gleb Smirnoff wrote:

On Sat, Aug 24, 2013 at 07:58:36PM +, Andre Oppermann wrote:
A> Author: andre
A> Date: Sat Aug 24 19:58:36 2013
A> New Revision: 254805
A> URL: http://svnweb.freebsd.org/changeset/base/254805
A>
A> Log:
A>   Add mtodo(m, o) macro taking an additional offset into the mbuf data 
section.
A>
A>   Sponsored by:   The FreeBSD Foundation
A>
A> Modified:
A>   head/sys/sys/mbuf.h
A>
A> Modified: head/sys/sys/mbuf.h
A> 
==
A> --- head/sys/sys/mbuf.h   Sat Aug 24 19:51:18 2013(r254804)
A> +++ head/sys/sys/mbuf.h   Sat Aug 24 19:58:36 2013(r254805)
A> @@ -67,8 +67,10 @@
A>   * type:
A>   *
A>   * mtod(m, t)-- Convert mbuf pointer to data pointer of correct type.
A> + * mtodo(m, o) -- Same as above but with offset 'o' into data.
A>   */
A>  #define  mtod(m, t)  ((t)((m)->m_data))
A> +#define  mtodo(m, o) ((void *)(((m)->m_data) + (o)))

IMO, having a typecast would be better. Then mtodo() would be really same as
mtod(), as stated in comment.


There was a big discussion about 10 month back when I did this change in my
tcp_workqueue branch with the typecast in.  The conclusion was that a typecast
is really not necessary and only causes one to type a lot more for the compiler
to throw away anyway.  But yes, the comment isn't perfect in that sense.

--
Andre

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


Re: svn commit: r254585 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-08-26 Thread Andriy Gapon
on 26/08/2013 01:15 Jeremie Le Hen said the following:
> Hi Xin,
> 
> On Tue, Aug 20, 2013 at 10:31:14PM +, Xin LI wrote:
>> Author: delphij
>> Date: Tue Aug 20 22:31:13 2013
>> New Revision: 254585
>> URL: http://svnweb.freebsd.org/changeset/base/254585
>>
>> Log:
>>   MFV r254220:
>>   
>>   Illumos ZFS issues:
>> 4039 zfs_rename()/zfs_link() needs stronger test for XDEV
>>
>> Modified:
>>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
>> Directory Properties:
>>   head/sys/cddl/contrib/opensolaris/   (props changed)
>>
>> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
>> ==
>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c  Tue Aug 
>> 20 21:47:07 2013(r254584)
>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c  Tue Aug 
>> 20 22:31:13 2013(r254585)
>> @@ -21,6 +21,7 @@
>>  /*
>>   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights 
>> reserved.
>>   * Copyright (c) 2013 by Delphix. All rights reserved.
>> + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
>>   */
>>  
>>  /* Portions Copyright 2007 Jeremy Teo */
>> @@ -3727,13 +3728,18 @@ zfs_rename(vnode_t *sdvp, char *snm, vno
>>  if (VOP_REALVP(tdvp, &realvp, ct) == 0)
>>  tdvp = realvp;
>>  
>> -if (tdvp->v_vfsp != sdvp->v_vfsp || zfsctl_is_node(tdvp)) {
>> +tdzp = VTOZ(tdvp);

The problem with this change, at least on FreeBSD, is that tdvp may not belong
to ZFS.  In that case VTOZ(tdvp) does not make any sense and would produce
garbage or trigger an assert.  Previously tdvp->v_vfsp != sdvp->v_vfsp check
would catch that situations.

Two side notes:
- v_vfsp is actually v_mount on FreeBSD
- VOP_REALVP is a glorified nop on FreeBSD

Another unrelated problem that existed before this change and has been noted by
Davide Italiano is that sdvp is not locked and so it can potentially be recycled
before ZFS_ENTER() enter and for that reason sdzp and zfsvfs could be invalid.
Because sdvp is referenced, this problem can currently occur only if a forced
unmount runs concurrently to zfs_rename.
tdvp should be locked and thus could be used instead of sdvp as a source for 
zfsvfs.

> I suspect this leads to a panic on my -CURRENT machine:
> 
> 
> #1  0x8033a664 in db_fncall_generic (addr=-2138557936,
> rv=0xfe00e5a30c90, nargs=0, args=0xfe00e5a30ca0)
> at /usr/src/sys/ddb/db_command.c:578
> #2  0x8033a34a in db_fncall (dummy1=-2138210939, dummy2=0, dummy3=-1,
> dummy4=0xfe00e5a30d80 "") at /usr/src/sys/ddb/db_command.c:630
> #3  0x80339fe1 in db_command (last_cmdp=0x812b7850,
> cmd_table=0x0, dopager=0) at /usr/src/sys/ddb/db_command.c:449
> #4  0x8033a0c2 in db_command_script (
> command=0x812b8754 "call doadump")
> at /usr/src/sys/ddb/db_command.c:520
> #5  0x80340b09 in db_script_exec (
> scriptname=0xfe00e5a30f50 "kdb.enter.panic", warnifnotfound=0)
> at /usr/src/sys/ddb/db_script.c:302
> #6  0x8034096c in db_script_kdbenter (
> eventname=0x80f7cd55 "panic") at /usr/src/sys/ddb/db_script.c:324
> #7  0x8033dee1 in db_trap (type=3, code=0)
> at /usr/src/sys/ddb/db_main.c:230
> #8  0x808d84b6 in kdb_trap (type=3, code=0, tf=0xfe00e5a31390)
> at /usr/src/sys/kern/subr_kdb.c:654
> #9  0x80dbc22a in trap (frame=0xfe00e5a31390)
> at /usr/src/sys/amd64/amd64/trap.c:579
> #10 0x80d99282 in calltrap ()
> at /usr/src/sys/amd64/amd64/exception.S:232
> #11 0x808d7d85 in breakpoint () at cpufunc.h:63
> #12 0x808d79eb in kdb_enter (why=0x80f7cd55 "panic",
> msg=0x80f7cd55 "panic") at /usr/src/sys/kern/subr_kdb.c:445
> #13 0x808838b3 in vpanic (
> fmt=0x81b05389 "solaris assert: %s, file: %s, line: %d",
> ap=0xfe00e5a31530) at /usr/src/sys/kern/kern_shutdown.c:747
> #14 0x80883960 in panic (
> fmt=0x81b05389 "solaris assert: %s, file: %s, line: %d")
> at /usr/src/sys/kern/kern_shutdown.c:683
> #15 0x81b0443c in assfail (
> a=0x819ab3cc "zp == NULL || zp->z_vnode == NULL || zp->z_vnode == 
> vp",
> f=0x819ab403 
> "/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h",
>  l=248)
> at 
> /usr/src/sys/modules/opensolaris/../../cddl/compat/opensolaris/kern/opensolaris_cmn_err.c:81
> #16 0x8191b111 in VTOZ (vp=0xf800967f5b10) at zfs_znode.h:248
> #17 0x8192372c in zfs_rename (sdvp=0xf800911bf3b0,
> snm=0xf80004a9d806 "patchoHq2mGI", tdvp=0xf800967f5b10,
> tnm=0xf8000451780f "periodic.conf.5", cr=0xf80011d4ce00, ct=0x0,
> flags=0)
> at 
> /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c:3731
> #18 0x8191ec06 

svn commit: r254913 - head/sys/arm/arm

2013-08-26 Thread Rafal Jaworowski
Author: raj
Date: Mon Aug 26 15:38:27 2013
New Revision: 254913
URL: http://svnweb.freebsd.org/changeset/base/254913

Log:
  Add missing TAILQ initializer (omitted in r250634).
  
  Submitted by: Zbigniew Bodek 
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation, Semihalf

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Mon Aug 26 15:34:18 2013(r254912)
+++ head/sys/arm/arm/pmap-v6.c  Mon Aug 26 15:38:27 2013(r254913)
@@ -1143,6 +1143,7 @@ pmap_pinit0(struct pmap *pmap)
bcopy(kernel_pmap, pmap, sizeof(*pmap));
bzero(&pmap->pm_mtx, sizeof(pmap->pm_mtx));
PMAP_LOCK_INIT(pmap);
+   TAILQ_INIT(&pmap->pm_pvchunk);
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254915 - head/sys/arm/include

2013-08-26 Thread Rafal Jaworowski
Author: raj
Date: Mon Aug 26 16:23:54 2013
New Revision: 254915
URL: http://svnweb.freebsd.org/changeset/base/254915

Log:
  Provide settings for superpage reservation system on ARM.
  
  This allows for enabling and configuring superpages reservation mechanism in
  order to allocate and populate 256 4KB base pages (for the purpose of
  promotion to a 1MB superpage).
  
  Submitted by: Zbigniew Bodek 
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation, Semihalf

Modified:
  head/sys/arm/include/vmparam.h

Modified: head/sys/arm/include/vmparam.h
==
--- head/sys/arm/include/vmparam.h  Mon Aug 26 16:04:52 2013
(r254914)
+++ head/sys/arm/include/vmparam.h  Mon Aug 26 16:23:54 2013
(r254915)
@@ -109,10 +109,17 @@
 #defineVM_NFREEORDER   9
 
 /*
- * Disable superpage reservations.
+ * Enable superpage reservations: 1 level.
  */
 #ifndefVM_NRESERVLEVEL
-#defineVM_NRESERVLEVEL 0
+#defineVM_NRESERVLEVEL 1
+#endif
+
+/*
+ * Level 0 reservations consist of 256 pages.
+ */
+#ifndefVM_LEVEL_0_ORDER
+#defineVM_LEVEL_0_ORDER8
 #endif
 
 #define UPT_MAX_ADDRESSVADDR(UPTPTDI + 3, 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254917 - head/share/man/man9

2013-08-26 Thread Antoine Brodin
Author: antoine
Date: Mon Aug 26 16:38:40 2013
New Revision: 254917
URL: http://svnweb.freebsd.org/changeset/base/254917

Log:
  Hook vm_page_busy.9 to the build

Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileMon Aug 26 16:32:56 2013
(r254916)
+++ head/share/man/man9/MakefileMon Aug 26 16:38:40 2013
(r254917)
@@ -324,6 +324,7 @@ MAN=accept_filter.9 \
vm_map_wire.9 \
vm_page_alloc.9 \
vm_page_bits.9 \
+   vm_page_busy.9 \
vm_page_cache.9 \
vm_page_deactivate.9 \
vm_page_dontneed.9 \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254918 - in head/sys/arm: arm include

2013-08-26 Thread Rafal Jaworowski
Author: raj
Date: Mon Aug 26 17:12:30 2013
New Revision: 254918
URL: http://svnweb.freebsd.org/changeset/base/254918

Log:
  Introduce superpages support for ARMv6/v7.
  
  Promoting base pages to superpages can increase TLB coverage and allow for
  efficient use of page table entries.  This development provides FreeBSD/ARM
  with superpages management mechanism roughly equivalent to what we have for
  i386 and amd64 architectures.
  
  1. Add mechanism for automatic promotion of 4KB page mappings to 1MB section
 mappings (and demotion when not needed, respectively).
  
  2. Managed and non-kernel mappings are now superpages-aware.
  
  3. The functionality can be enabled by setting "vm.pmap.sp_enabled" tunable to
 a non-zero value (either in loader.conf or by modifying "sp_enabled"
 variable in pmap-v6.c file).  By default, automatic promotion is currently
 disabled.
  
  Submitted by: Zbigniew Bodek 
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation, Semihalf

Modified:
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/include/param.h
  head/sys/arm/include/pmap.h
  head/sys/arm/include/pte.h

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Mon Aug 26 16:38:40 2013(r254917)
+++ head/sys/arm/arm/pmap-v6.c  Mon Aug 26 17:12:30 2013(r254918)
@@ -171,6 +171,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -201,6 +202,8 @@ int pmap_debug_level = 0;
 #define PV_STAT(x) do { } while (0)
 #endif
 
+#definepa_to_pvh(pa)   (&pv_table[pa_index(pa)])
+
 #ifdef ARM_L2_PIPT
 #define pmap_l2cache_wbinv_range(va, pa, size) cpu_l2cache_wbinv_range((pa), 
(size))
 #define pmap_l2cache_inv_range(va, pa, size) cpu_l2cache_inv_range((pa), 
(size))
@@ -215,10 +218,16 @@ extern struct pv_addr systempage;
  * Internal function prototypes
  */
 
+static PMAP_INLINE
+struct pv_entry*pmap_find_pv(struct md_page *, pmap_t, 
vm_offset_t);
 static voidpmap_free_pv_chunk(struct pv_chunk *pc);
 static voidpmap_free_pv_entry(pmap_t pmap, pv_entry_t pv);
 static pv_entry_t  pmap_get_pv_entry(pmap_t pmap, boolean_t try);
 static vm_page_t   pmap_pv_reclaim(pmap_t locked_pmap);
+static boolean_t   pmap_pv_insert_section(pmap_t, vm_offset_t,
+vm_paddr_t);
+static struct pv_entry *pmap_remove_pv(struct vm_page *, pmap_t, vm_offset_t);
+static int pmap_pvh_wired_mappings(struct md_page *, int);
 
 static voidpmap_enter_locked(pmap_t, vm_offset_t, vm_prot_t,
 vm_page_t, vm_prot_t, boolean_t, int);
@@ -226,6 +235,14 @@ static vm_paddr_t  pmap_extract_locked(pm
 static voidpmap_alloc_l1(pmap_t);
 static voidpmap_free_l1(pmap_t);
 
+static voidpmap_map_section(pmap_t, vm_offset_t, vm_offset_t,
+vm_prot_t, boolean_t);
+static voidpmap_promote_section(pmap_t, vm_offset_t);
+static boolean_t   pmap_demote_section(pmap_t, vm_offset_t);
+static boolean_t   pmap_enter_section(pmap_t, vm_offset_t, vm_page_t,
+vm_prot_t);
+static voidpmap_remove_section(pmap_t, vm_offset_t);
+
 static int pmap_clearbit(struct vm_page *, u_int);
 
 static struct l2_bucket *pmap_get_l2_bucket(pmap_t, vm_offset_t);
@@ -403,6 +420,7 @@ int pmap_needs_pte_sync;
  */
 static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks);
 static int pv_entry_count, pv_entry_max, pv_entry_high_water;
+static struct md_page *pv_table;
 static int shpgperproc = PMAP_SHPGPERPROC;
 
 struct pv_chunk *pv_chunkbase; /* KVA block for pv_chunks */
@@ -433,6 +451,11 @@ static const uint32_t pc_freemask[_NPCM]
 
 static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters");
 
+/* Superpages utilization enabled = 1 / disabled = 0 */
+static int sp_enabled = 0;
+SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN, &sp_enabled, 0,
+"Are large page mappings enabled?");
+
 SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, &pv_entry_count, 0,
 "Current number of pv entries");
 
@@ -891,7 +914,9 @@ static int
 pmap_clearbit(struct vm_page *m, u_int maskbits)
 {
struct l2_bucket *l2b;
-   struct pv_entry *pv;
+   struct pv_entry *pv, *pve, *next_pv;
+   struct md_page *pvh;
+   pd_entry_t *pl1pd;
pt_entry_t *ptep, npte, opte;
pmap_t pmap;
vm_offset_t va;
@@ -899,7 +924,79 @@ pmap_clearbit(struct vm_page *m, u_int m
int count = 0;
 
rw_wlock(&pvh_global_lock);
+   if ((m->flags & PG_FICTITIOUS) != 0)
+   goto small_mappings;
 
+   pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
+   TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) {
+   va = pv->pv_va;
+   pmap = PV_PMAP(pv);
+   PMAP_LOCK(pmap);
+   pl1pd = &pmap->pm_l1->l1_kva[L1_IDX(va)];
+ 

svn commit: r254919 - head/tools/build/options

2013-08-26 Thread Antoine Brodin
Author: antoine
Date: Mon Aug 26 17:15:56 2013
New Revision: 254919
URL: http://svnweb.freebsd.org/changeset/base/254919

Log:
  Document WITHOUT_ICONV, WITH_LIBICONV_COMPAT and WITH_USB_GADGET_EXAMPLES

Added:
  head/tools/build/options/WITHOUT_ICONV
 - copied, changed from r254918, head/tools/build/options/WITH_ICONV
  head/tools/build/options/WITH_LIBICONV_COMPAT   (contents, props changed)
  head/tools/build/options/WITH_USB_GADGET_EXAMPLES   (contents, props changed)
Deleted:
  head/tools/build/options/WITH_ICONV

Copied and modified: head/tools/build/options/WITHOUT_ICONV (from r254918, 
head/tools/build/options/WITH_ICONV)
==
--- head/tools/build/options/WITH_ICONV Mon Aug 26 17:12:30 2013
(r254918, copy source)
+++ head/tools/build/options/WITHOUT_ICONV  Mon Aug 26 17:15:56 2013
(r254919)
@@ -1,2 +1,2 @@
 .\" $FreeBSD$
-Set to build iconv as part of libc.
+Set to not build iconv as part of libc.

Added: head/tools/build/options/WITH_LIBICONV_COMPAT
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_LIBICONV_COMPAT   Mon Aug 26 17:15:56 
2013(r254919)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to build libiconv API and link time compatibility.

Added: head/tools/build/options/WITH_USB_GADGET_EXAMPLES
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_USB_GADGET_EXAMPLES   Mon Aug 26 17:15:56 
2013(r254919)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to build USB gadget kernel modules.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254920 - head/share/man/man5

2013-08-26 Thread Antoine Brodin
Author: antoine
Date: Mon Aug 26 17:18:21 2013
New Revision: 254920
URL: http://svnweb.freebsd.org/changeset/base/254920

Log:
  Regenerate src.conf.5

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Mon Aug 26 17:15:56 2013
(r254919)
+++ head/share/man/man5/src.conf.5  Mon Aug 26 17:18:21 2013
(r254920)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 253304 2013-07-12 23:08:44Z 
bapt
 .\" $FreeBSD$
-.Dd July 16, 2013
+.Dd August 26, 2013
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -245,9 +245,6 @@ Set to not build the BSD licensed versio
 .It Va WITH_BSD_GREP
 .\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 73 2011-05-25 
01:04:12Z obrien
 Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
-.It Va WITH_BSD_PATCH
-.\" from FreeBSD: head/tools/build/options/WITH_BSD_PATCH 246074 2013-01-29 
17:03:18Z gabor
-Install BSD-licensed patch as 'patch' instead of GNU patch.
 .It Va WITHOUT_BSNMP
 .\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 
16:15:42Z sam
 Set to not build or install
@@ -506,6 +503,9 @@ When set, it also enforces the following
 .It
 .Va WITHOUT_GNU_SUPPORT
 .El
+.It Va WITH_GNU_PATCH
+.\" from FreeBSD: head/tools/build/options/WITH_GNU_PATCH 253689 2013-07-26 
21:25:18Z pfg
+Install GNU-licensed patch as 'patch' instead of BSD patch.
 .It Va WITHOUT_GNU_SUPPORT
 .\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_SUPPORT 156932 
2006-03-21 07:50:50Z ru
 Set to build some programs without optional GNU support.
@@ -538,9 +538,15 @@ Set to build Hesiod support.
 .It Va WITHOUT_HTML
 .\" from FreeBSD: head/tools/build/options/WITHOUT_HTML 156932 2006-03-21 
07:50:50Z ru
 Set to not build HTML docs.
-.It Va WITH_ICONV
-.\" from FreeBSD: head/tools/build/options/WITH_ICONV 219020 2011-02-25 
00:10:26Z gabor
-Set to build iconv as part of libc.
+.It Va WITHOUT_ICONV
+.\" from FreeBSD: head/tools/build/options/WITHOUT_ICONV 254919 2013-08-26 
17:15:56Z antoine
+Set to not build iconv as part of libc.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_LIBICONV_COMPAT
+.El
 .It Va WITHOUT_INET
 .\" from FreeBSD: head/tools/build/options/WITHOUT_INET 221266 2011-04-30 
17:58:28Z bz
 Set to not build programs and libraries related to IPv4 networking.
@@ -701,6 +707,9 @@ runtime linker.
 .It Va WITHOUT_LIBCPLUSPLUS
 .\" from FreeBSD: head/tools/build/options/WITHOUT_LIBCPLUSPLUS 246262 
2013-02-02 22:42:46Z dim
 Set to avoid building libcxxrt and libc++.
+.It Va WITH_LIBICONV_COMPAT
+.\" from FreeBSD: head/tools/build/options/WITH_LIBICONV_COMPAT 254919 
2013-08-26 17:15:56Z antoine
+Set to build libiconv API and link time compatibility.
 .It Va WITHOUT_LIBPTHREAD
 .\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 188848 
2009-02-20 11:09:55Z mtm
 Set to not build the
@@ -1129,6 +1138,9 @@ When set, it also enforces the following
 .It Va WITHOUT_USB
 .\" from FreeBSD: head/tools/build/options/WITHOUT_USB 156932 2006-03-21 
07:50:50Z ru
 Set to not build USB-related programs and libraries.
+.It Va WITH_USB_GADGET_EXAMPLES
+.\" from FreeBSD: head/tools/build/options/WITH_USB_GADGET_EXAMPLES 254919 
2013-08-26 17:15:56Z antoine
+Set to build USB gadget kernel modules.
 .It Va WITHOUT_UTMPX
 .\" from FreeBSD: head/tools/build/options/WITHOUT_UTMPX 231530 2012-02-11 
20:28:42Z ed
 Set to not build user accounting tools such as
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254921 - in head: . tools/build/mk

2013-08-26 Thread Antoine Brodin
Author: antoine
Date: Mon Aug 26 17:21:40 2013
New Revision: 254921
URL: http://svnweb.freebsd.org/changeset/base/254921

Log:
  Add more obsolete files.

Modified:
  head/ObsoleteFiles.inc
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Mon Aug 26 17:18:21 2013(r254920)
+++ head/ObsoleteFiles.inc  Mon Aug 26 17:21:40 2013(r254921)
@@ -38,6 +38,14 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20130822: bind 9.9.3-P2 import
+OLD_LIBS+=usr/lib/liblwres.so.80
+# 20130814: vm_page_busy(9)
+OLD_FILES+=usr/share/man/man9/vm_page_flash.9.gz
+OLD_FILES+=usr/share/man/man9/vm_page_io.9.gz
+OLD_FILES+=usr/share/man/man9/vm_page_io_finish.9.gz
+OLD_FILES+=usr/share/man/man9/vm_page_io_start.9.gz
+OLD_FILES+=usr/share/man/man9/vm_page_wakeup.9.gz
 # 20130710: libkvm version bump 
 OLD_LIBS+=lib/libkvm.so.5
 OLD_LIBS+=usr/lib32/libkvm.so.5
@@ -114,6 +122,7 @@ OLD_FILES+=usr/include/clang/3.2/xmmintr
 OLD_FILES+=usr/include/clang/3.2/xopintrin.h
 OLD_DIRS+=usr/include/clang/3.2
 # 20130404: legacy ATA stack removed
+OLD_FILES+=etc/periodic/daily/405.status-ata-raid
 OLD_FILES+=rescue/atacontrol
 OLD_FILES+=sbin/atacontrol
 OLD_FILES+=usr/share/man/man8/atacontrol.8.gz

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Aug 26 17:18:21 
2013(r254920)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Aug 26 17:21:40 
2013(r254921)
@@ -1600,6 +1600,11 @@ OLD_FILES+=usr/share/man/man1/gdbserver.
 OLD_FILES+=usr/share/man/man1/kgdb.1.gz
 .endif
 
+.if ${MK_GNU_PATCH} == no
+OLD_FILES+=usr/bin/bsdpatch
+OLD_FILES+=usr/share/man/man1/bsdpatch.1.gz
+.endif
+
 .if ${MK_GPIB} == no
 OLD_FILES+=usr/include/dev/ieee488/ibfoo_int.h
 OLD_FILES+=usr/include/dev/ieee488/ugpib.h
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254922 - head/usr.bin/kdump

2013-08-26 Thread Jilles Tjoelker
Author: jilles
Date: Mon Aug 26 17:22:51 2013
New Revision: 254922
URL: http://svnweb.freebsd.org/changeset/base/254922

Log:
  kdump: Decode SOCK_CLOEXEC and SOCK_NONBLOCK in socket() and socketpair().

Modified:
  head/usr.bin/kdump/kdump.c
  head/usr.bin/kdump/mksubr

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Mon Aug 26 17:21:40 2013(r254921)
+++ head/usr.bin/kdump/kdump.c  Mon Aug 26 17:22:51 2013(r254922)
@@ -830,7 +830,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
ip++;
narg--;
putchar(',');
-   socktypename(*ip);
+   socktypenamewithflags(*ip);
ip++;
narg--;
if (sockdomain == PF_INET ||
@@ -908,7 +908,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
ip++;
narg--;
putchar(',');
-   socktypename(*ip);
+   socktypenamewithflags(*ip);
ip++;
narg--;
c = ',';

Modified: head/usr.bin/kdump/mksubr
==
--- head/usr.bin/kdump/mksubr   Mon Aug 26 17:21:40 2013(r254921)
+++ head/usr.bin/kdump/mksubr   Mon Aug 26 17:22:51 2013(r254922)
@@ -368,6 +368,19 @@ vmprotname (int type)
if_print_or(type, VM_PROT_EXECUTE, or);
if_print_or(type, VM_PROT_COPY, or);
 }
+
+/*
+ * MANUAL
+ */
+void
+socktypenamewithflags(int type)
+{
+   if (type & SOCK_CLOEXEC)
+   printf("SOCK_CLOEXEC|"), type &= ~SOCK_CLOEXEC;
+   if (type & SOCK_NONBLOCK)
+   printf("SOCK_NONBLOCK|"), type &= ~SOCK_NONBLOCK;
+   socktypename(type);
+}
 _EOF_
 
 auto_or_type "accessmodename"  "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+"  
   "sys/unistd.h"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254923 - head/share/misc

2013-08-26 Thread John-Mark Gurney
Author: jmg
Date: Mon Aug 26 17:36:55 2013
New Revision: 254923
URL: http://svnweb.freebsd.org/changeset/base/254923

Log:
  Joerg was my mentor way back when...

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Mon Aug 26 17:22:51 2013
(r254922)
+++ head/share/misc/committers-src.dot  Mon Aug 26 17:36:55 2013
(r254923)
@@ -187,6 +187,7 @@ jkim [label="Jung-uk Kim\njkim@FreeBSD.o
 jkoshy [label="A. Joseph Koshy\njko...@freebsd.org\n1998/05/13"]
 jlh [label="Jeremie Le Hen\n...@freebsd.org\n2012/04/22"]
 jls [label="Jordan Sissel\n...@freebsd.org\n2006/12/06"]
+jmg [label="John-Mark Gurney\n...@freebsd.org\n1997/02/13"]
 joerg [label="Joerg Wunsch\njo...@freebsd.org\n1993/11/14"]
 jon [label="Jonathan Chen\n...@freebsd.org\n2000/10/17"]
 jonathan [label="Jonathan Anderson\njonat...@freebsd.org\n2010/10/07"]
@@ -495,6 +496,7 @@ jlemon -> brooks
 
 joerg -> brian
 joerg -> eik
+joerg -> jmg
 joerg -> le
 joerg -> netchild
 joerg -> schweikh
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254924 - head/sys/dev/amdtemp

2013-08-26 Thread John-Mark Gurney
Author: jmg
Date: Mon Aug 26 17:38:36 2013
New Revision: 254924
URL: http://svnweb.freebsd.org/changeset/base/254924

Log:
  Add support for my:
  CPU: AMD A10-5700 APU with Radeon(tm) HD Graphics(3393.89-MHz K8-class 
CPU)

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

Modified: head/sys/dev/amdtemp/amdtemp.c
==
--- head/sys/dev/amdtemp/amdtemp.c  Mon Aug 26 17:36:55 2013
(r254923)
+++ head/sys/dev/amdtemp/amdtemp.c  Mon Aug 26 17:38:36 2013
(r254924)
@@ -76,6 +76,7 @@ struct amdtemp_softc {
 #defineDEVICEID_AMD_MISC0F 0x1103
 #defineDEVICEID_AMD_MISC10 0x1203
 #defineDEVICEID_AMD_MISC11 0x1303
+#defineDEVICEID_AMD_MISC12 0x1403
 #defineDEVICEID_AMD_MISC14 0x1703
 #defineDEVICEID_AMD_MISC15 0x1603
 
@@ -86,6 +87,7 @@ static struct amdtemp_product {
{ VENDORID_AMD, DEVICEID_AMD_MISC0F },
{ VENDORID_AMD, DEVICEID_AMD_MISC10 },
{ VENDORID_AMD, DEVICEID_AMD_MISC11 },
+   { VENDORID_AMD, DEVICEID_AMD_MISC12 },
{ VENDORID_AMD, DEVICEID_AMD_MISC14 },
{ VENDORID_AMD, DEVICEID_AMD_MISC15 },
{ 0, 0 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254925 - in head/sys: fs/nfs net netinet netinet6 netipsec sys

2013-08-26 Thread John Baldwin
Author: jhb
Date: Mon Aug 26 18:16:05 2013
New Revision: 254925
URL: http://svnweb.freebsd.org/changeset/base/254925

Log:
  Remove most of the remaining sysctl name list macros.  They were only
  ever intended for use in sysctl(8) and it has not used them for many
  years.
  
  Reviewed by:  bde
  Tested by:exp-run by bdrewery

Modified:
  head/sys/fs/nfs/nfs.h
  head/sys/net/if_pfsync.h
  head/sys/netinet/icmp_var.h
  head/sys/netinet/igmp_var.h
  head/sys/netinet/in.h
  head/sys/netinet/pim_var.h
  head/sys/netinet/tcp_var.h
  head/sys/netinet/udp_var.h
  head/sys/netinet6/pim6_var.h
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/key_var.h
  head/sys/sys/socket.h
  head/sys/sys/sysctl.h

Modified: head/sys/fs/nfs/nfs.h
==
--- head/sys/fs/nfs/nfs.h   Mon Aug 26 17:38:36 2013(r254924)
+++ head/sys/fs/nfs/nfs.h   Mon Aug 26 18:16:05 2013(r254925)
@@ -335,11 +335,6 @@ struct nfsreferral {
  */
 #defineNFS_NFSSTATS1   /* struct: struct nfsstats */
 
-#defineFS_NFS_NAMES {  
\
-  { 0, 0 },\
-  { "nfsstats", CTLTYPE_STRUCT },  \
-}
-
 /*
  * Here is the definition of the attribute bits array and macros that
  * manipulate it.

Modified: head/sys/net/if_pfsync.h
==
--- head/sys/net/if_pfsync.hMon Aug 26 17:38:36 2013(r254924)
+++ head/sys/net/if_pfsync.hMon Aug 26 18:16:05 2013(r254925)
@@ -211,11 +211,6 @@ struct pfsync_tdb {
 #definePFSYNCCTL_STATS 1   /* PFSYNC stats */
 #definePFSYNCCTL_MAXID 2
 
-#definePFSYNCCTL_NAMES { \
-   { 0, 0 }, \
-   { "stats", CTLTYPE_STRUCT }, \
-}
-
 struct pfsyncstats {
u_int64_t   pfsyncs_ipackets;   /* total input packets, IPv4 */
u_int64_t   pfsyncs_ipackets6;  /* total input packets, IPv6 */

Modified: head/sys/netinet/icmp_var.h
==
--- head/sys/netinet/icmp_var.h Mon Aug 26 17:38:36 2013(r254924)
+++ head/sys/netinet/icmp_var.h Mon Aug 26 18:16:05 2013(r254925)
@@ -85,13 +85,6 @@ void kmod_icmpstat_inc(int statnum);
 #define ICMPCTL_ICMPLIM3
 #define ICMPCTL_MAXID  4
 
-#define ICMPCTL_NAMES { \
-   { 0, 0 }, \
-   { "maskrepl", CTLTYPE_INT }, \
-   { "stats", CTLTYPE_STRUCT }, \
-   { "icmplim", CTLTYPE_INT }, \
-}
-
 #ifdef _KERNEL
 SYSCTL_DECL(_net_inet_icmp);
 

Modified: head/sys/netinet/igmp_var.h
==
--- head/sys/netinet/igmp_var.h Mon Aug 26 17:38:36 2013(r254924)
+++ head/sys/netinet/igmp_var.h Mon Aug 26 18:16:05 2013(r254925)
@@ -218,8 +218,4 @@ SYSCTL_DECL(_net_inet_igmp);
 #define IGMPCTL_STATS  1   /* statistics (read-only) */
 #define IGMPCTL_MAXID  2
 
-#define IGMPCTL_NAMES { \
-   { 0, 0 }, \
-   { "stats", CTLTYPE_STRUCT } \
-}
 #endif

Modified: head/sys/netinet/in.h
==
--- head/sys/netinet/in.h   Mon Aug 26 17:38:36 2013(r254924)
+++ head/sys/netinet/in.h   Mon Aug 26 18:16:05 2013(r254925)
@@ -699,24 +699,6 @@ intgetsourcefilter(int, uint32_t, struc
 #defineIPCTL_GIF_TTL   16  /* default TTL for gif encap 
packet */
 #defineIPCTL_MAXID 17
 
-#defineIPCTL_NAMES { \
-   { 0, 0 }, \
-   { "forwarding", CTLTYPE_INT }, \
-   { "redirect", CTLTYPE_INT }, \
-   { "ttl", CTLTYPE_INT }, \
-   { "mtu", CTLTYPE_INT }, \
-   { "rtexpire", CTLTYPE_INT }, \
-   { "rtminexpire", CTLTYPE_INT }, \
-   { "rtmaxcache", CTLTYPE_INT }, \
-   { "sourceroute", CTLTYPE_INT }, \
-   { "directed-broadcast", CTLTYPE_INT }, \
-   { "intr-queue-maxlen", CTLTYPE_INT }, \
-   { "intr-queue-drops", CTLTYPE_INT }, \
-   { "stats", CTLTYPE_STRUCT }, \
-   { "accept_sourceroute", CTLTYPE_INT }, \
-   { "fastforwarding", CTLTYPE_INT }, \
-}
-
 #endif /* __BSD_VISIBLE */
 
 #ifdef _KERNEL

Modified: head/sys/netinet/pim_var.h
==
--- head/sys/netinet/pim_var.h  Mon Aug 26 17:38:36 2013(r254924)
+++ head/sys/netinet/pim_var.h  Mon Aug 26 18:16:05 2013(r254925)
@@ -71,11 +71,6 @@ struct pimstat {
 #define PIMCTL_STATS   1   /* statistics (read-only) */
 #define PIMCTL_MAXID   2
 
-#define PIMCTL_NAMES { \
-   { 0, 0 },   \
-   { "stats", CTLTYPE_STRUCT },\
-}
-
 #ifdef _KERNEL
 
 void pim_input(struct mbuf *, int);

Mo

Re: svn commit: r254882 - head/sys/dev/pci

2013-08-26 Thread John Baldwin
On Sunday, August 25, 2013 2:09:12 pm Jean-Sebastien Pedron wrote:
> Author: dumbbell
> Date: Sun Aug 25 18:09:11 2013
> New Revision: 254882
> URL: http://svnweb.freebsd.org/changeset/base/254882
> 
> Log:
>   vga_pci: Add API to map the Video BIOS
>   
>   Here are two new functions to map and unmap the Video BIOS:
>   void * vga_pci_map_bios(device_t dev, size_t *size);
>   void   vga_pci_unmap_bios(device_t dev, void *bios);
>   
>   The BIOS is either taken from the shadow copy made by the System BIOS at
>   boot time if the given device was used for the default display (i386,
>   amd64 and ia64 only), or from the PCI expansion ROM.
>   
>   Additionally, one can determine if a given device was the default
>   display at boot time using the following new function:
>   void   vga_pci_unmap_bios(device_t dev, void *bios);
> 
> Modified:
>   head/sys/dev/pci/pcivar.h
>   head/sys/dev/pci/vga_pci.c
> 
> Modified: head/sys/dev/pci/pcivar.h
> 
==
> --- head/sys/dev/pci/pcivar.h Sun Aug 25 17:26:05 2013(r254881)
> +++ head/sys/dev/pci/pcivar.h Sun Aug 25 18:09:11 2013(r254882)
> @@ -517,4 +517,11 @@ extern uint32_t  pci_generation;
>  struct pci_map *pci_find_bar(device_t dev, int reg);
>  int  pci_bar_enabled(device_t dev, struct pci_map *pm);
>  
> +#define  VGA_PCI_BIOS_SHADOW_ADDR0xC
> +#define  VGA_PCI_BIOS_SHADOW_SIZE131072
> +
> +int  vga_pci_is_boot_display(device_t dev);
> +void *   vga_pci_map_bios(device_t dev, size_t *size);
> +void vga_pci_unmap_bios(device_t dev, void *bios);
> +
>  #endif /* _PCIVAR_H_ */
> 
> Modified: head/sys/dev/pci/vga_pci.c
> 
==
> --- head/sys/dev/pci/vga_pci.cSun Aug 25 17:26:05 2013
> (r254881)
> +++ head/sys/dev/pci/vga_pci.cSun Aug 25 18:09:11 2013
> (r254882)
> @@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  
> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__)
> +#include 
> +#include 
> +#endif
> +
>  #include 
>  #include 
>  
> @@ -67,6 +72,99 @@ TUNABLE_INT("hw.pci.default_vgapci_unit"
>  SYSCTL_INT(_hw_pci, OID_AUTO, default_vgapci_unit, CTLFLAG_RDTUN,
>  &vga_pci_default_unit, -1, "Default VGA-compatible display");
>  
> +int
> +vga_pci_is_boot_display(device_t dev)
> +{
> +
> + /*
> +  * Return true if the given device is the default display used
> +  * at boot time.
> +  */
> +
> + return (
> + (pci_get_class(dev) == PCIC_DISPLAY ||
> +  (pci_get_class(dev) == PCIC_OLD &&
> +   pci_get_subclass(dev) == PCIS_OLD_VGA)) &&
> + device_get_unit(dev) == vga_pci_default_unit);
> +}
> +
> +void *
> +vga_pci_map_bios(device_t dev, size_t *size)
> +{
> + int rid;
> + struct resource *res;
> +
> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__)
> + if (vga_pci_is_boot_display(dev)) {
> + /*
> +  * On x86, the System BIOS copy the default display
> +  * device's Video BIOS at a fixed location in system
> +  * memory (0xC, 128 kBytes long) at boot time.
> +  *
> +  * We use this copy for the default boot device, because
> +  * the original ROM may not be valid after boot.
> +  */
> +
> + printf("%s: Mapping BIOS shadow\n", __func__);
> + *size = VGA_PCI_BIOS_SHADOW_SIZE;
> + return (pmap_mapbios(VGA_PCI_BIOS_SHADOW_ADDR, *size));
> + }
> +#endif
> +
> + printf("%s: Mapping PCI expansion ROM\n", __func__);
> + rid = PCIR_BIOS;
> + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
> + if (res == NULL) {
> + return (NULL);
> + }
> +
> + *size = rman_get_size(res);
> + return (rman_get_virtual(res));
> +}
> +
> +void
> +vga_pci_unmap_bios(device_t dev, void *bios)
> +{
> + int rid;
> + struct resource *res;
> +
> + if (bios == NULL) {
> + return;
> + }
> +
> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__)
> + if (vga_pci_is_boot_display(dev)) {
> + /* We mapped the BIOS shadow copy located at 0xC. */
> + printf("%s: Unmapping BIOS shadow\n", __func__);
> + pmap_unmapdev((vm_offset_t)bios, VGA_PCI_BIOS_SHADOW_SIZE);
> +
> + return;
> + }
> +#endif
> +
> + /*
> +  * FIXME: We returned only the virtual address of the resource
> +  * to the caller. Now, to get the resource struct back, we
> +  * allocate it again: the struct exists once in memory in
> +  * device softc. Therefore, we release twice now to release the
> +  * reference we just obtained to get the structure back and the
> +  * caller's reference.
> +  */

This won't actually work (the PCI bus will panic when you do the duplic

Re: svn commit: r254925 - in head/sys: fs/nfs net netinet netinet6 netipsec sys

2013-08-26 Thread John Baldwin
On Monday, August 26, 2013 2:16:05 pm John Baldwin wrote:
> Author: jhb
> Date: Mon Aug 26 18:16:05 2013
> New Revision: 254925
> URL: http://svnweb.freebsd.org/changeset/base/254925
> 
> Log:
>   Remove most of the remaining sysctl name list macros.  They were only
>   ever intended for use in sysctl(8) and it has not used them for many
>   years.
>   
>   Reviewed by:bde
>   Tested by:  exp-run by bdrewery

There is one remaining macro that is (ab)used by the security/prelude-pflogger 
port.  I have a patch to fix it to use getprotobynumber(3) (ports/181488).  If 
that goes in I will remove the remaining macro.

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


Re: svn commit: r254703 - in head: share/man/man9 sys/sys

2013-08-26 Thread Davide Italiano
On Fri, Aug 23, 2013 at 9:58 AM, John Baldwin  wrote:
> On Friday, August 23, 2013 11:29:45 am Davide Italiano wrote:
>> On Fri, Aug 23, 2013 at 4:51 PM, John Baldwin  wrote:
>> > On Friday, August 23, 2013 10:12:39 am Davide Italiano wrote:
>> >> Author: davide
>> >> Date: Fri Aug 23 14:12:39 2013
>> >> New Revision: 254703
>> >> URL: http://svnweb.freebsd.org/changeset/base/254703
>> >>
>> >> Log:
>> >>   Introduce callout_init_rm() so that callouts can be used in conjunction
>> >>   with rmlocks. This works only with non-sleepable rm because handlers run
>> >>   in SWI context. While here, document the new KPI in the timeout(9)
>> >>   manpage.
>> >
>> > It also only works with exclusive locks.  (lc_unlock/lc_lock only handle
>> > write locks for rmlocks).
>> >
>> > --
>> > John Baldwin
>>
>> Thanks for pointing out this.
>> I think it would be nice to have lc_lock/lc_unlock working both for
>> shared and exclusive locks but I'm not 100% sure about all the
>> implications/complications. From what I see for rwlocks asserting if a
>> lock is held in read-mode is really cheap (check against a flag) while
>> for rmlocks the assertion relies on traversing the tracker list for
>> the rmlock so I'm worried this operation could be expensive. What's
>> your opinion about?
>
> The much bigger problem is you need an rmtracker object to pass to the
> lock/unlock routines.
>
> You could make this work hackishly in the callout case by special casing
> rm locks that use read locking and using a tracker on softclock's stack,
> but it is much harder to fix this for the rm_sleep() case where the
> sequence is lc_unlock/lc_lock.
>
> --
> John Baldwin

I see. I would really like to go for a clean solution if possible, and
if the timeframe for 10 doesn't allow this just revert the commit
until a better solution would be available. FWIW, I pondered a bit
about this and the only way I was able to think is that of augmenting
'struct lock_object' with a 'void *arg' field  that in this case could
be used to store a pointer to something, which in this case is a
pointer to a rmtracker object, and this could allow easily to retrieve
the needed information (as far as I see something similar is done to
store WITNESS information). This, OTOH, could be overkill just to fix
this case though.

Thanks,

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254929 - head/share/man/man4

2013-08-26 Thread John-Mark Gurney
Author: jmg
Date: Mon Aug 26 18:47:10 2013
New Revision: 254929
URL: http://svnweb.freebsd.org/changeset/base/254929

Log:
  none of the drivers in the tree support CDIOCCAPABILITY or CDIOCPITCH..
  remove the documentation so people won't get confused and think they
  are supported...

Modified:
  head/share/man/man4/cd.4

Modified: head/share/man/man4/cd.4
==
--- head/share/man/man4/cd.4Mon Aug 26 18:35:21 2013(r254928)
+++ head/share/man/man4/cd.4Mon Aug 26 18:47:10 2013(r254929)
@@ -113,69 +113,6 @@ read from the scsi inquiry commands, and
 the information printed at boot.
 This structure is defined in the header file
 .In sys/disklabel.h .
-.It Dv CDIOCCAPABILITY
-.Pq Li "struct ioc_capability"
-Retrieve information from the drive on what features it supports.
-The information is returned in the following structure:
-.Bd -literal -offset indent
-struct ioc_capability {
-   u_long  play_function;
-#define CDDOPLAYTRK0x0001
-   /* Can play tracks/index */
-#defineCDDOPLAYMSF 0x0002
-   /* Can play msf to msf */
-#defineCDDOPLAYBLOCKS  0x0004
-   /* Can play range of blocks */
-#defineCDDOPAUSE   0x0100
-   /* Output can be paused */
-#defineCDDORESUME  0x0200
-   /* Output can be resumed */
-#defineCDDORESET   0x0400
-   /* Drive can be completely reset */
-#defineCDDOSTART   0x0800
-   /* Audio can be started */
-#define CDDOSTOP   0x1000
-   /* Audio can be stopped */
-#define CDDOPITCH  0x2000
-   /* Audio pitch can be changed */
-
-   u_long  routing_function;
-#define CDREADVOLUME   0x0001
-   /* Volume settings can be read */
-#define CDSETVOLUME0x0002
-   /* Volume settings can be set */
-#defineCDSETMONO   0x0100
-   /* Output can be set to mono */
-#define CDSETSTEREO0x0200
-   /* Output can be set to stereo (def) */
-#defineCDSETLEFT   0x0400
-   /* Output can be set to left only */
-#defineCDSETRIGHT  0x0800
-   /* Output can be set to right only */
-#defineCDSETMUTE   0x1000
-   /* Output can be muted */
-#define CDSETPATCH 0x8000
-   /* Direct routing control allowed */
-
-   u_long  special_function;
-#defineCDDOEJECT   0x0001
-   /* The tray can be opened */
-#defineCDDOCLOSE   0x0002
-   /* The tray can be closed */
-#defineCDDOLOCK0x0004
-   /* The tray can be locked */
-#define CDREADHEADER   0x0100
-   /* Can read Table of Contents */
-#defineCDREADENTRIES   0x0200
-   /* Can read TOC Entries */
-#defineCDREADSUBQ  0x0200
-   /* Can read Subchannel info */
-#define CDREADRW   0x0400
-   /* Can read subcodes R-W */
-#defineCDHASDEBUG  0x4000
-   /* The tray has dynamic debugging */
-};
-.Ed
 .It Dv CDIOCPLAYTRACKS
 .Pq Li "struct ioc_play_track"
 Start audio playback given a track address and length.
@@ -320,24 +257,6 @@ Eject the
 .It Dv CDIOCCLOSE
 Tell the drive to close its door and load the media.
 Not all drives support this feature.
-.It Dv CDIOCPITCH
-.Pq Li "struct ioc_pitch"
-For drives that support it, this command instructs the drive to play
-the audio at a faster or slower rate than normal.
-Values of
-.Li speed
-between -32767 and -1 result in slower playback; a zero value
-indicates normal speed; and values from 1 to 32767 give faster
-playback.
-Drives with less than 16 bits of resolution will silently
-ignore less-significant bits.
-The structure is defined thusly:
-.Bd -literal -offset indent
-struct ioc_pitch
-{
-   short   speed;
-};
-.Ed
 .El
 .Sh NOTES
 When a
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254930 - head/share/man/man4

2013-08-26 Thread John-Mark Gurney
Author: jmg
Date: Mon Aug 26 18:50:40 2013
New Revision: 254930
URL: http://svnweb.freebsd.org/changeset/base/254930

Log:
  fix up my copyright..

Modified:
  head/share/man/man4/sysmouse.4

Modified: head/share/man/man4/sysmouse.4
==
--- head/share/man/man4/sysmouse.4  Mon Aug 26 18:47:10 2013
(r254929)
+++ head/share/man/man4/sysmouse.4  Mon Aug 26 18:50:40 2013
(r254930)
@@ -1,5 +1,4 @@
-.\" Copyright (c) 1997
-.\"John-Mark Gurney.  All rights reserved.
+.\" Copyright 1997 John-Mark Gurney.  All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254931 - head/usr.bin/brandelf

2013-08-26 Thread John-Mark Gurney
Author: jmg
Date: Mon Aug 26 18:51:48 2013
New Revision: 254931
URL: http://svnweb.freebsd.org/changeset/base/254931

Log:
  fix up my copyright and remove third clause..

Modified:
  head/usr.bin/brandelf/brandelf.1

Modified: head/usr.bin/brandelf/brandelf.1
==
--- head/usr.bin/brandelf/brandelf.1Mon Aug 26 18:50:40 2013
(r254930)
+++ head/usr.bin/brandelf/brandelf.1Mon Aug 26 18:51:48 2013
(r254931)
@@ -1,5 +1,4 @@
-.\" Copyright (c) 1997
-.\"John-Mark Gurney.  All rights reserved.
+.\" Copyright 1997 John-Mark Gurney.  All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -9,9 +8,6 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"notice, this list of conditions and the following disclaimer in the
 .\"documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the author nor the names of any co-contributors
-.\"may be used to endorse or promote products derived from this software
-.\"without specific prior written permission.
 .\"
 .\" THIS SOFTWARE IS PROVIDED BY John-Mark Gurney AND CONTRIBUTORS ``AS IS''
 .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254932 - head/sys/kern

2013-08-26 Thread John-Mark Gurney
Author: jmg
Date: Mon Aug 26 18:53:19 2013
New Revision: 254932
URL: http://svnweb.freebsd.org/changeset/base/254932

Log:
  fix up some comments and a white space issue...
  
  MFC after:3 days

Modified:
  head/sys/kern/kern_event.c

Modified: head/sys/kern/kern_event.c
==
--- head/sys/kern/kern_event.c  Mon Aug 26 18:51:48 2013(r254931)
+++ head/sys/kern/kern_event.c  Mon Aug 26 18:53:19 2013(r254932)
@@ -565,7 +565,7 @@ filt_timerattach(struct knote *kn)
memory_order_relaxed));
 
kn->kn_flags |= EV_CLEAR;   /* automatically set */
-   kn->kn_status &= ~KN_DETACHED;  /* knlist_add usually sets it */
+   kn->kn_status &= ~KN_DETACHED;  /* knlist_add clears it */
calloutp = malloc(sizeof(*calloutp), M_KQUEUE, M_WAITOK);
callout_init(calloutp, CALLOUT_MPSAFE);
kn->kn_hook = calloutp;
@@ -587,7 +587,7 @@ filt_timerdetach(struct knote *kn)
free(calloutp, M_KQUEUE);
old = atomic_fetch_sub_explicit(&kq_ncallouts, 1, memory_order_relaxed);
KASSERT(old > 0, ("Number of callouts cannot become negative"));
-   kn->kn_status |= KN_DETACHED;   /* knlist_remove usually clears it */
+   kn->kn_status |= KN_DETACHED;   /* knlist_remove sets it */
 }
 
 static int
@@ -1467,7 +1467,7 @@ retry:
*kevp = kn->kn_kevent;
KQ_LOCK(kq);
KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal);
-   if (kn->kn_flags & (EV_CLEAR |  EV_DISPATCH)) {
+   if (kn->kn_flags & (EV_CLEAR | EV_DISPATCH)) {
/* 
 * Manually clear knotes who weren't 
 * 'touch'ed.
@@ -1859,7 +1859,7 @@ knlist_remove_kq(struct knlist *knl, str
 }
 
 /*
- * remove all knotes from a specified klist
+ * remove knote from the specified knlist
  */
 void
 knlist_remove(struct knlist *knl, struct knote *kn, int islocked)
@@ -1869,7 +1869,7 @@ knlist_remove(struct knlist *knl, struct
 }
 
 /*
- * remove knote from a specified klist while in f_event handler.
+ * remove knote from the specified knlist while in f_event handler.
  */
 void
 knlist_remove_inevent(struct knlist *knl, struct knote *kn)
@@ -2002,7 +2002,7 @@ knlist_destroy(struct knlist *knl)
 #ifdef INVARIANTS
/*
 * if we run across this error, we need to find the offending
-* driver and have it call knlist_clear.
+* driver and have it call knlist_clear or knlist_delete.
 */
if (!SLIST_EMPTY(&knl->kl_list))
printf("WARNING: destroying knlist w/ knotes on it!\n");
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254933 - head/sys/dev/cxgbe

2013-08-26 Thread Navdeep Parhar
Author: np
Date: Mon Aug 26 19:02:52 2013
New Revision: 254933
URL: http://svnweb.freebsd.org/changeset/base/254933

Log:
  Use correct mailbox and PCIe PF number when querying RDMA parameters.

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cMon Aug 26 18:53:19 2013
(r254932)
+++ head/sys/dev/cxgbe/t4_main.cMon Aug 26 19:02:52 2013
(r254933)
@@ -2492,7 +2492,7 @@ get_params__post_init(struct adapter *sc
param[3] = FW_PARAM_PFVF(CQ_END);
param[4] = FW_PARAM_PFVF(OCQ_START);
param[5] = FW_PARAM_PFVF(OCQ_END);
-   rc = -t4_query_params(sc, 0, 0, 0, 6, param, val);
+   rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 6, param, val);
if (rc != 0) {
device_printf(sc->dev,
"failed to query RDMA parameters(2): %d.\n", rc);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r254703 - in head: share/man/man9 sys/sys

2013-08-26 Thread John Baldwin
On Monday, August 26, 2013 2:33:41 pm Davide Italiano wrote:
> On Fri, Aug 23, 2013 at 9:58 AM, John Baldwin  wrote:
> > On Friday, August 23, 2013 11:29:45 am Davide Italiano wrote:
> >> On Fri, Aug 23, 2013 at 4:51 PM, John Baldwin  wrote:
> >> > On Friday, August 23, 2013 10:12:39 am Davide Italiano wrote:
> >> >> Author: davide
> >> >> Date: Fri Aug 23 14:12:39 2013
> >> >> New Revision: 254703
> >> >> URL: http://svnweb.freebsd.org/changeset/base/254703
> >> >>
> >> >> Log:
> >> >>   Introduce callout_init_rm() so that callouts can be used in 
conjunction
> >> >>   with rmlocks. This works only with non-sleepable rm because handlers 
run
> >> >>   in SWI context. While here, document the new KPI in the timeout(9)
> >> >>   manpage.
> >> >
> >> > It also only works with exclusive locks.  (lc_unlock/lc_lock only 
handle
> >> > write locks for rmlocks).
> >> >
> >> > --
> >> > John Baldwin
> >>
> >> Thanks for pointing out this.
> >> I think it would be nice to have lc_lock/lc_unlock working both for
> >> shared and exclusive locks but I'm not 100% sure about all the
> >> implications/complications. From what I see for rwlocks asserting if a
> >> lock is held in read-mode is really cheap (check against a flag) while
> >> for rmlocks the assertion relies on traversing the tracker list for
> >> the rmlock so I'm worried this operation could be expensive. What's
> >> your opinion about?
> >
> > The much bigger problem is you need an rmtracker object to pass to the
> > lock/unlock routines.
> >
> > You could make this work hackishly in the callout case by special casing
> > rm locks that use read locking and using a tracker on softclock's stack,
> > but it is much harder to fix this for the rm_sleep() case where the
> > sequence is lc_unlock/lc_lock.
> >
> > --
> > John Baldwin
> 
> I see. I would really like to go for a clean solution if possible, and
> if the timeframe for 10 doesn't allow this just revert the commit
> until a better solution would be available. FWIW, I pondered a bit
> about this and the only way I was able to think is that of augmenting
> 'struct lock_object' with a 'void *arg' field  that in this case could
> be used to store a pointer to something, which in this case is a
> pointer to a rmtracker object, and this could allow easily to retrieve
> the needed information (as far as I see something similar is done to
> store WITNESS information). This, OTOH, could be overkill just to fix
> this case though.

Well, I've thought about changing lc_lock/unlock to return a uintptr_t or
void * instead of an int and then I could make rm_sleep work fine.  However, 
that still doesn't solve the callout case.  The callout case can't be fixed
easily without explicitly allocating storage in the softclock thread itself.

Also, I don't think you want a pointer in a lock_object.  Imagine if two 
threads both locked and then slept on the same rm lock in succession while
waiting for a wakeup.  You would have two trackers to keep track of, but only
one pointer in the lock_object.

I'm not sure you need to revert your commit.  It should pretty much panic
instantly if someone tries to use it with a read lock instead of a write
lock, even without INVARIANTS.

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


svn commit: r254936 - head/sys/geom/zero

2013-08-26 Thread Alexander Motin
Author: mav
Date: Mon Aug 26 20:39:02 2013
New Revision: 254936
URL: http://svnweb.freebsd.org/changeset/base/254936

Log:
  MFprojects/camlock r254895:
  Add unmapped BIO support to GEOM ZERO if kern.geom.zero.clear is cleared.

Modified:
  head/sys/geom/zero/g_zero.c

Modified: head/sys/geom/zero/g_zero.c
==
--- head/sys/geom/zero/g_zero.c Mon Aug 26 20:03:44 2013(r254935)
+++ head/sys/geom/zero/g_zero.c Mon Aug 26 20:39:02 2013(r254936)
@@ -41,16 +41,37 @@ __FBSDID("$FreeBSD$");
 
 #defineG_ZERO_CLASS_NAME   "ZERO"
 
+static int g_zero_clear_sysctl(SYSCTL_HANDLER_ARGS);
+
 SYSCTL_DECL(_kern_geom);
 static SYSCTL_NODE(_kern_geom, OID_AUTO, zero, CTLFLAG_RW, 0,
 "GEOM_ZERO stuff");
 static int g_zero_clear = 1;
-SYSCTL_INT(_kern_geom_zero, OID_AUTO, clear, CTLFLAG_RW, &g_zero_clear, 0,
-"Clear read data buffer");
+SYSCTL_PROC(_kern_geom_zero, OID_AUTO, clear, CTLTYPE_INT|CTLFLAG_RW,
+&g_zero_clear, 0, g_zero_clear_sysctl, "I", "Clear read data buffer");
 static int g_zero_byte = 0;
 SYSCTL_INT(_kern_geom_zero, OID_AUTO, byte, CTLFLAG_RW, &g_zero_byte, 0,
 "Byte (octet) value to clear the buffers with");
 
+static struct g_provider *gpp;
+
+static int
+g_zero_clear_sysctl(SYSCTL_HANDLER_ARGS)
+{
+   int error;
+
+   error = sysctl_handle_int(oidp, &g_zero_clear, 0, req);
+   if (error != 0 || req->newptr == NULL)
+   return (error);
+   if (gpp == NULL)
+   return (ENXIO);
+   if (g_zero_clear)
+   gpp->flags &= ~G_PF_ACCEPT_UNMAPPED;
+   else
+   gpp->flags |= G_PF_ACCEPT_UNMAPPED;
+   return (0);
+}
+
 static void
 g_zero_start(struct bio *bp)
 {
@@ -58,7 +79,7 @@ g_zero_start(struct bio *bp)
 
switch (bp->bio_cmd) {
case BIO_READ:
-   if (g_zero_clear)
+   if (g_zero_clear && (bp->bio_flags & BIO_UNMAPPED) == 0)
memset(bp->bio_data, g_zero_byte, bp->bio_length);
/* FALLTHROUGH */
case BIO_DELETE:
@@ -84,7 +105,9 @@ g_zero_init(struct g_class *mp)
gp = g_new_geomf(mp, "gzero");
gp->start = g_zero_start;
gp->access = g_std_access;
-   pp = g_new_providerf(gp, "%s", gp->name);
+   gpp = pp = g_new_providerf(gp, "%s", gp->name);
+   if (!g_zero_clear)
+   pp->flags |= G_PF_ACCEPT_UNMAPPED;
pp->mediasize = 1152921504606846976LLU;
pp->sectorsize = 512;
g_error_provider(pp, 0);
@@ -104,6 +127,7 @@ g_zero_destroy_geom(struct gctl_req *req
return (0);
if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)
return (EBUSY);
+   gpp = NULL;
g_wither_geom(gp, ENXIO);
return (0);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254937 - head/sys/dev/fdc

2013-08-26 Thread Joerg Wunsch
Author: joerg
Date: Mon Aug 26 21:15:50 2013
New Revision: 254937
URL: http://svnweb.freebsd.org/changeset/base/254937

Log:
  Reimplement the FDOPT_NOERROR feature that was kicked out in r134081.
  
  It is needed for fdread(1) in order to be able to recover from CRC
  errors in the data field of a floppy sector (by returning the sector
  data that failed CRC, rather than inventing dummy data).
  
  When closing the device, clear all transient device options.
  
  MFC after:1 week

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

Modified: head/sys/dev/fdc/fdc.c
==
--- head/sys/dev/fdc/fdc.c  Mon Aug 26 20:39:02 2013(r254936)
+++ head/sys/dev/fdc/fdc.c  Mon Aug 26 21:15:50 2013(r254937)
@@ -761,10 +761,13 @@ fdc_worker(struct fdc_data *fdc)
int i, nsect;
int st0, st3, cyl, mfm, steptrac, cylinder, descyl, sec;
int head;
+   int override_error;
static int need_recal;
struct fdc_readid *idp;
struct fd_formb *finfo;
 
+   override_error = 0;
+
/* Have we exhausted our retries ? */
bp = fdc->bp;
fd = fdc->fd;
@@ -1090,7 +1093,10 @@ fdc_worker(struct fdc_data *fdc)
fdc->status[3], fdc->status[4], fdc->status[5]);
}
retry_line = __LINE__;
-   return (1);
+   if (fd->options & FDOPT_NOERROR)
+   override_error = 1;
+   else
+   return (1);
}
/* All OK */
switch(bp->bio_cmd) {
@@ -,10 +1117,16 @@ fdc_worker(struct fdc_data *fdc)
bp->bio_resid -= fd->fd_iosize;
bp->bio_completed += fd->fd_iosize;
fd->fd_ioptr += fd->fd_iosize;
-   /* Since we managed to get something done, reset the retry */
-   fdc->retry = 0;
-   if (bp->bio_resid > 0)
-   return (0);
+   if (override_error) {
+   if ((debugflags & 4))
+   printf("FDOPT_NOERROR: returning bad data\n");
+   } else {
+   /* Since we managed to get something done,
+* reset the retry */
+   fdc->retry = 0;
+   if (bp->bio_resid > 0)
+   return (0);
+   }
break;
case BIO_FMT:
break;
@@ -1406,6 +1418,7 @@ fd_access(struct g_provider *pp, int r, 
ae = e + pp->ace;
 
if (ar == 0 && aw == 0 && ae == 0) {
+   fd->options &= ~(FDOPT_NORETRY | FDOPT_NOERRLOG | 
FDOPT_NOERROR);
device_unbusy(fd->dev);
return (0);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r253550 - head/sys/dev/mps

2013-08-26 Thread Kenneth D. Merry
On Tue, Aug 13, 2013 at 19:30:29 +0400, Slawa Olhovchenkov wrote:
> On Mon, Aug 12, 2013 at 01:02:29PM -0600, Kenneth D. Merry wrote:
> 
> > If you really want one now, I've attached a patch from stable/9 on June
> > 27th.  It may or may not apply now.
> 
> Its apply witch litle edit.
> 
> > > > Now that it's done, I hope to merge that change to stable/9 this week.
> > > 
> > > Also, I see strange behaviour of LSI 9211-8i -- after some activity
> > > got timeout and HBA put in looped reset.
> > 
> > That's not good.  Try with the newer driver and see whether if affects the
> > behavior.
> 
> Witch this driver I got same behavior: after intesive i/o got timeout,
> driver try re-init controller without success. On all HDD activity LED
> ON w/o blinking at this moment.

Do you have any logs or dmesg output showing the problem?

I have merged the latest driver changes to stable/9, including a bug fix
for out of chain frame handling.

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


Re: svn commit: r253550 - head/sys/dev/mps

2013-08-26 Thread Slawa Olhovchenkov
On Mon, Aug 26, 2013 at 03:40:27PM -0600, Kenneth D. Merry wrote:

> On Tue, Aug 13, 2013 at 19:30:29 +0400, Slawa Olhovchenkov wrote:
> > On Mon, Aug 12, 2013 at 01:02:29PM -0600, Kenneth D. Merry wrote:
> > 
> > > If you really want one now, I've attached a patch from stable/9 on June
> > > 27th.  It may or may not apply now.
> > 
> > Its apply witch litle edit.
> > 
> > > > > Now that it's done, I hope to merge that change to stable/9 this week.
> > > > 
> > > > Also, I see strange behaviour of LSI 9211-8i -- after some activity
> > > > got timeout and HBA put in looped reset.
> > > 
> > > That's not good.  Try with the newer driver and see whether if affects the
> > > behavior.
> > 
> > Witch this driver I got same behavior: after intesive i/o got timeout,
> > driver try re-init controller without success. On all HDD activity LED
> > ON w/o blinking at this moment.
> 
> Do you have any logs or dmesg output showing the problem?

Currenly not awailable, but simmilar as here
http://lists.freebsd.org/pipermail/freebsd-current/2013-May/041943.html
or here http://forums.freebsd.org/showthread.php?t=28252.

At the time of problem -- no any messages in the log or concole, just
stopping all operations. After some time (aprox 30-60 seconds) --
circular messages about timeout, reset and massive 'SCSI command
timeout'.


> I have merged the latest driver changes to stable/9, including a bug fix
> for out of chain frame handling.

Now I can't test anymore -- controller replaced to asr.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254941 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2013-08-26 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Aug 26 22:29:42 2013
New Revision: 254941
URL: http://svnweb.freebsd.org/changeset/base/254941

Log:
  Merge various CTF fixes from illumos
  
  2942 CTF tools need to handle files which legitimately lack data
  2978 ctfconvert still needs to ignore legitimately dataless files on SPARC
  
  Illumos Revisions:13745:6b3106b4250f
13754:7231b684c18b
  
  Reference:
  
  https://www.illumos.org/issues/2942
  https://www.illumos.org/issues/2978
  
  MFC after:3 weeks

Modified:
  head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
==
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Aug 26 22:29:22 
2013(r254940)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Aug 26 22:29:42 
2013(r254941)
@@ -23,8 +23,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident  "%Z%%M% %I% %E% SMI"
-
 /*
  * DWARF to tdata conversion
  *
@@ -1796,6 +1794,59 @@ die_resolve(dwarf_t *dw)
} while (dw->dw_nunres != 0);
 }
 
+/*
+ * Any object containing a function or object symbol at any scope should also
+ * contain DWARF data.
+ */
+static boolean_t
+should_have_dwarf(Elf *elf)
+{
+   Elf_Scn *scn = NULL;
+   Elf_Data *data = NULL;
+   GElf_Shdr shdr;
+   GElf_Sym sym;
+   uint32_t symdx = 0;
+   size_t nsyms = 0;
+   boolean_t found = B_FALSE;
+
+   while ((scn = elf_nextscn(elf, scn)) != NULL) {
+   gelf_getshdr(scn, &shdr);
+
+   if (shdr.sh_type == SHT_SYMTAB) {
+   found = B_TRUE;
+   break;
+   }
+   }
+
+   if (!found)
+   terminate("cannot convert stripped objects\n");
+
+   data = elf_getdata(scn, NULL);
+   nsyms = shdr.sh_size / shdr.sh_entsize;
+
+   for (symdx = 0; symdx < nsyms; symdx++) {
+   gelf_getsym(data, symdx, &sym);
+
+   if ((GELF_ST_TYPE(sym.st_info) == STT_FUNC) ||
+   (GELF_ST_TYPE(sym.st_info) == STT_TLS) ||
+   (GELF_ST_TYPE(sym.st_info) == STT_OBJECT)) {
+   char *name;
+
+   name = elf_strptr(elf, shdr.sh_link, sym.st_name);
+
+   /* Studio emits these local symbols regardless */
+   if ((strcmp(name, "Bbss.bss") != 0) &&
+   (strcmp(name, "Ttbss.bss") != 0) &&
+   (strcmp(name, "Ddata.data") != 0) &&
+   (strcmp(name, "Ttdata.data") != 0) &&
+   (strcmp(name, "Drodata.rodata") != 0))
+   return (B_TRUE);
+   }
+   }
+
+   return (B_FALSE);
+}
+
 /*ARGSUSED*/
 int
 dw_read(tdata_t *td, Elf *elf, char *filename __unused)
@@ -1820,8 +1871,12 @@ dw_read(tdata_t *td, Elf *elf, char *fil
 
if ((rc = dwarf_elf_init(elf, DW_DLC_READ, &dw.dw_dw,
&dw.dw_err)) == DW_DLV_NO_ENTRY) {
-   errno = ENOENT;
-   return (-1);
+   if (should_have_dwarf(elf)) {
+   errno = ENOENT;
+   return (-1);
+   } else {
+   return (0);
+   }
} else if (rc != DW_DLV_OK) {
if (dwarf_errno(&dw.dw_err) == DW_DLE_DEBUG_INFO_NULL) {
/*
@@ -1839,9 +1894,14 @@ dw_read(tdata_t *td, Elf *elf, char *fil
&addrsz, &nxthdr, &dw.dw_err)) != DW_DLV_OK)
terminate("rc = %d %s\n", rc, dwarf_errmsg(&dw.dw_err));
 
-   if ((cu = die_sibling(&dw, NULL)) == NULL)
+   if ((cu = die_sibling(&dw, NULL)) == NULL ||
+   (((child = die_child(&dw, cu)) == NULL) &&
+   should_have_dwarf(elf))) {
terminate("file does not contain dwarf type data "
"(try compiling with -g)\n");
+   } else if (child == NULL) {
+   return (0);
+   }
 
dw.dw_maxoff = nxthdr - 1;
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r253550 - head/sys/dev/mps

2013-08-26 Thread Kenneth D. Merry
On Tue, Aug 27, 2013 at 02:25:26 +0400, Slawa Olhovchenkov wrote:
> On Mon, Aug 26, 2013 at 03:40:27PM -0600, Kenneth D. Merry wrote:
> 
> > On Tue, Aug 13, 2013 at 19:30:29 +0400, Slawa Olhovchenkov wrote:
> > > On Mon, Aug 12, 2013 at 01:02:29PM -0600, Kenneth D. Merry wrote:
> > > 
> > > > If you really want one now, I've attached a patch from stable/9 on June
> > > > 27th.  It may or may not apply now.
> > > 
> > > Its apply witch litle edit.
> > > 
> > > > > > Now that it's done, I hope to merge that change to stable/9 this 
> > > > > > week.
> > > > > 
> > > > > Also, I see strange behaviour of LSI 9211-8i -- after some activity
> > > > > got timeout and HBA put in looped reset.
> > > > 
> > > > That's not good.  Try with the newer driver and see whether if affects 
> > > > the
> > > > behavior.
> > > 
> > > Witch this driver I got same behavior: after intesive i/o got timeout,
> > > driver try re-init controller without success. On all HDD activity LED
> > > ON w/o blinking at this moment.
> > 
> > Do you have any logs or dmesg output showing the problem?
> 
> Currenly not awailable, but simmilar as here
> http://lists.freebsd.org/pipermail/freebsd-current/2013-May/041943.html

That one is relatively recent, but all it shows is timeouts.  There are
lots of potential causes.

Without dmesg output, we don't know what firmware version he's running, and
that could be an issue.  As can SATA drives behind an expander.

> or here http://forums.freebsd.org/showthread.php?t=28252.

This one shows lots of IOC terminated errors, but it looks like his problem
was solved by upgrading his SSD firmware.

> At the time of problem -- no any messages in the log or concole, just
> stopping all operations. After some time (aprox 30-60 seconds) --
> circular messages about timeout, reset and massive 'SCSI command
> timeout'.

What was your topology?  i.e. mps(4) controller connected directly to the
drives, or via an expander?  SAS or SATA drives?

> > I have merged the latest driver changes to stable/9, including a bug fix
> > for out of chain frame handling.
> 
> Now I can't test anymore -- controller replaced to asr.

An asr(4) controller?

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


Re: svn commit: r253550 - head/sys/dev/mps

2013-08-26 Thread Slawa Olhovchenkov
On Mon, Aug 26, 2013 at 04:43:35PM -0600, Kenneth D. Merry wrote:

> On Tue, Aug 27, 2013 at 02:25:26 +0400, Slawa Olhovchenkov wrote:
> > On Mon, Aug 26, 2013 at 03:40:27PM -0600, Kenneth D. Merry wrote:
> > 
> > > On Tue, Aug 13, 2013 at 19:30:29 +0400, Slawa Olhovchenkov wrote:
> > > > On Mon, Aug 12, 2013 at 01:02:29PM -0600, Kenneth D. Merry wrote:
> > > > 
> > > > > If you really want one now, I've attached a patch from stable/9 on 
> > > > > June
> > > > > 27th.  It may or may not apply now.
> > > > 
> > > > Its apply witch litle edit.
> > > > 
> > > > > > > Now that it's done, I hope to merge that change to stable/9 this 
> > > > > > > week.
> > > > > > 
> > > > > > Also, I see strange behaviour of LSI 9211-8i -- after some activity
> > > > > > got timeout and HBA put in looped reset.
> > > > > 
> > > > > That's not good.  Try with the newer driver and see whether if 
> > > > > affects the
> > > > > behavior.
> > > > 
> > > > Witch this driver I got same behavior: after intesive i/o got timeout,
> > > > driver try re-init controller without success. On all HDD activity LED
> > > > ON w/o blinking at this moment.
> > > 
> > > Do you have any logs or dmesg output showing the problem?
> > 
> > Currenly not awailable, but simmilar as here
> > http://lists.freebsd.org/pipermail/freebsd-current/2013-May/041943.html
> 
> That one is relatively recent, but all it shows is timeouts.  There are
> lots of potential causes.

In my case only timeouts showed.

> Without dmesg output, we don't know what firmware version he's running, and
> that could be an issue.  As can SATA drives behind an expander.

firmware try bundled (v14 IR), v16 IR from LSI site,
v14 IT from supermicro site. No expander, but SATA drive.

> > or here http://forums.freebsd.org/showthread.php?t=28252.
> 
> This one shows lots of IOC terminated errors, but it looks like his problem
> was solved by upgrading his SSD firmware.

It's only as sample of dmesg output (in my dmesg no other questionably
information).
Firmware of SATA disk marked as compatible on LSI site (ST91000640NS SN02).

> > At the time of problem -- no any messages in the log or concole, just
> > stopping all operations. After some time (aprox 30-60 seconds) --
> > circular messages about timeout, reset and massive 'SCSI command
> > timeout'.
> 
> What was your topology?  i.e. mps(4) controller connected directly to the
> drives, or via an expander?  SAS or SATA drives?

directly to 8 SATA drives. drives ST91000640NS SN02

> > > I have merged the latest driver changes to stable/9, including a bug fix
> > > for out of chain frame handling.
> > 
> > Now I can't test anymore -- controller replaced to asr.
> 
> An asr(4) controller?

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


Re: svn commit: r254585 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-08-26 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 08/26/13 08:35, Andriy Gapon wrote:
> on 26/08/2013 01:15 Jeremie Le Hen said the following:
>> Hi Xin,
>> 
>> On Tue, Aug 20, 2013 at 10:31:14PM +, Xin LI wrote:
>>> Author: delphij Date: Tue Aug 20 22:31:13 2013 New Revision:
>>> 254585 URL: http://svnweb.freebsd.org/changeset/base/254585
>>> 
>>> Log: MFV r254220:
>>> 
>>> Illumos ZFS issues: 4039 zfs_rename()/zfs_link() needs stronger
>>> test for XDEV
>>> 
>>> Modified: 
>>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
>>>
>>> 
Directory Properties:
>>> head/sys/cddl/contrib/opensolaris/   (props changed)
>>> 
>>> Modified:
>>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
>>>
>>> 
==
>>> ---
>>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
>>> Tue Aug 20 21:47:07 2013(r254584) +++
>>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
>>> Tue Aug 20 22:31:13 2013(r254585) @@ -21,6 +21,7 @@ /* *
>>> Copyright (c) 2005, 2010, Oracle and/or its affiliates. All
>>> rights reserved. * Copyright (c) 2013 by Delphix. All rights
>>> reserved. + * Copyright 2013 Nexenta Systems, Inc.  All rights
>>> reserved. */
>>> 
>>> /* Portions Copyright 2007 Jeremy Teo */ @@ -3727,13 +3728,18
>>> @@ zfs_rename(vnode_t *sdvp, char *snm, vno if
>>> (VOP_REALVP(tdvp, &realvp, ct) == 0) tdvp = realvp;
>>> 
>>> -   if (tdvp->v_vfsp != sdvp->v_vfsp || zfsctl_is_node(tdvp)) { +
>>> tdzp = VTOZ(tdvp);
> 
> The problem with this change, at least on FreeBSD, is that tdvp may
> not belong to ZFS.  In that case VTOZ(tdvp) does not make any sense
> and would produce garbage or trigger an assert.  Previously
> tdvp->v_vfsp != sdvp->v_vfsp check would catch that situations. Two
> side notes: - v_vfsp is actually v_mount on FreeBSD

Ah that's good point.  Any objection in putting a change to their
_freebsd_ counterpart (zfs_freebsd_rename and zfs_freebsd_link) as
attached?

> - VOP_REALVP is a glorified nop on FreeBSD

It's not clear to me what was the intention for having a macro instead
of just ifdef'ing the code out -- maybe to prevent unwanted conflict
with upstream?  These two VOP's are the only consumers of VOP_REALVP
in tree.

> Another unrelated problem that existed before this change and has
> been noted by Davide Italiano is that sdvp is not locked and so it
> can potentially be recycled before ZFS_ENTER() enter and for that
> reason sdzp and zfsvfs could be invalid. Because sdvp is
> referenced, this problem can currently occur only if a forced 
> unmount runs concurrently to zfs_rename. tdvp should be locked and
> thus could be used instead of sdvp as a source for zfsvfs.

I think this would need more work, I'll take a look after we have this
regression fixed.

Cheers,
- -- 
Xin LI https://www.delphij.net/
FreeBSD - The Power to Serve!   Live free or die
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.21 (FreeBSD)

iQEcBAEBCgAGBQJSG96rAAoJEG80Jeu8UPuzQG4IAK/Qw1McLNoy0egEzelYcsar
iBRwoGDXfJuufCy04TEXD5rEz78VdqOl+g0tFqhSMbKHzQj+qEa6P6DIKptEnSsW
AtQOQABs0gHY4SZ3MUdvdlEmFlWtyYPTqw471k2jIjRMNEM3wyslVn/SHvfymmwT
s9VTI40jkoHWCUMW217jvER5co/niQDU4QL9ZNPb8vzRT02obqiq7ugZ7eqgklAI
zqzB46Trn6Oplab+vNt/dWgSK/cuPwDaeTNeRBiw2YQ/uQMsOEdNPB2JqLUA5XgF
WezHnotyFT/vdiQCe6dHjatOaR5ui7qWTUKTAwcq4gUrLJQx9FYYV3Im9xmesSM=
=FjK7
-END PGP SIGNATURE-
Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
===
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c  (revision 
254924)
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c  (working copy)
@@ -6250,6 +6250,9 @@ zfs_freebsd_rename(ap)
ASSERT(ap->a_fcnp->cn_flags & (SAVENAME|SAVESTART));
ASSERT(ap->a_tcnp->cn_flags & (SAVENAME|SAVESTART));
 
+   if (fdvp->v_mount != tdvp->v_mount)
+   return (EXDEV);
+
error = zfs_rename(fdvp, ap->a_fcnp->cn_nameptr, tdvp,
ap->a_tcnp->cn_nameptr, ap->a_fcnp->cn_cred, NULL, 0);
 
@@ -6308,10 +6311,15 @@ zfs_freebsd_link(ap)
} */ *ap;
 {
struct componentname *cnp = ap->a_cnp;
+   vnode_t *vp = ap->a_vp;
+   vnode_t *tdvp = ap->a_tdvp;
 
+   if (tdvp->v_mount != vp->v_mount)
+   return (EXDEV);
+
ASSERT(cnp->cn_flags & SAVENAME);
 
-   return (zfs_link(ap->a_tdvp, ap->a_vp, cnp->cn_nameptr, cnp->cn_cred, 
NULL, 0));
+   return (zfs_link(tdvp, vp, cnp->cn_nameptr, cnp->cn_cred, NULL, 0));
 }
 
 static int
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r254942 - head/sys/boot/forth

2013-08-26 Thread Devin Teske
Author: dteske
Date: Mon Aug 26 23:37:11 2013
New Revision: 254942
URL: http://svnweb.freebsd.org/changeset/base/254942

Log:
  Building upon SVN r254237, disable automated activation of alternate layouts
  and add support for default underride to $loader_version, acting as a way to
  name a release. Release text is not displayed for the aforementioned feature
  of alternate display layout (introduced in r254237); however, for all other
  layouts (incl. default), the release name is displayed at lower-right.
  
  See version.4th(8) for additional information and/or historical details.
  NOTE: Also a minor edit to version.4th(8) while we're here.

Modified:
  head/sys/boot/forth/beastie.4th
  head/sys/boot/forth/version.4th
  head/sys/boot/forth/version.4th.8

Modified: head/sys/boot/forth/beastie.4th
==
--- head/sys/boot/forth/beastie.4th Mon Aug 26 22:29:42 2013
(r254941)
+++ head/sys/boot/forth/beastie.4th Mon Aug 26 23:37:11 2013
(r254942)
@@ -205,21 +205,9 @@ variable logoY
s" loader_logo" getenv dup -1 = if
logoX @ logoY @
loader_color? if
-   s" tribute-logo"
-   sfind if
-   execute
-   else
-   drop
-   orb-logo
-   then
+   orb-logo
else
-   s" tributebw-logo"
-   sfind if
-   execute
-   else
-   drop
-   orbbw-logo
-   then
+   orbbw-logo
then
drop exit
then
@@ -249,7 +237,7 @@ variable logoY
s" tribute-logo" sfind if
execute
else
-   orb-logo
+   drop orb-logo
then
2drop exit
then
@@ -258,7 +246,7 @@ variable logoY
s" tributebw-logo" sfind if
execute
else
-   orbbw-logo
+   drop orbbw-logo
then
2drop exit
then

Modified: head/sys/boot/forth/version.4th
==
--- head/sys/boot/forth/version.4th Mon Aug 26 22:29:42 2013
(r254941)
+++ head/sys/boot/forth/version.4th Mon Aug 26 23:37:11 2013
(r254942)
@@ -29,6 +29,9 @@ marker task-version.4th
 variable versionX
 variable versionY
 
+\ Default $loader_version value if not overridden or using tribute screen
+: str_loader_version ( -- C-ADDR/U|-1 ) -1 ;
+
 \ Initialize text placement to defaults
 80 versionX !  \ NOTE: this is the ending column (text is right-justified)
 24 versionY !
@@ -43,9 +46,33 @@ variable versionY
?number drop versionY ! -1
then drop
 
-   \ Exit if a version was not set
+   \ Default version if none was set
s" loader_version" getenv dup -1 = if
-   drop exit
+   drop
+   \ Default version if no logo is requested
+   s" loader_logo" getenv dup -1 = if
+   drop str_loader_version
+   else
+   2dup s" tribute" compare-insensitive 0= if
+   2drop
+   s" tribute-logo" sfind if
+   drop exit \ see beastie tribute-text
+   else
+   drop str_loader_version
+   then
+   else 2dup s" tributebw" compare-insensitive 0= if
+   2drop
+   s" tributebw-logo" sfind if
+   drop exit \ see beastie tribute-text
+   else
+   drop str_loader_version
+   then
+   else
+   2drop str_loader_version
+   then then
+   then
+   then dup -1 = if
+   drop exit \ default version (above) is disabled
then
 
\ Right justify the text

Modified: head/sys/boot/forth/version.4th.8
==
--- head/sys/boot/forth/version.4th.8   Mon Aug 26 22:29:42 2013
(r254941)
+++ head/sys/boot/forth/version.4th.8   Mon Aug 26 23:37:11 2013
(r254942)
@@ -91,7 +91,7 @@ causes the version to be printed without
 .Pq default is ANSI Cyan .
 .El
 .Sh FILES
-.Bl -tag -width /boot/loader.4th -compact
+.Bl -tag -width /boot/version.4th -compact
 .It Pa /boot/

svn commit: r254943 - in head: bin/ps sys/compat/freebsd32 sys/kern sys/sys

2013-08-26 Thread Will Andrews
Author: will
Date: Mon Aug 26 23:48:21 2013
New Revision: 254943
URL: http://svnweb.freebsd.org/changeset/base/254943

Log:
  Add the ability to display the default FIB number for a process to the
  ps(1) utility, e.g. "ps -O fib".
  
  bin/ps/keyword.c:
Add the "fib" keyword and default its column name to "FIB".
  
  bin/ps/ps.1:
Add "fib" as a supported keyword.
  
  sys/compat/freebsd32/freebsd32.h:
  sys/kern/kern_proc.c:
  sys/sys/user.h:
Add the default fib number for a process (p->p_fibnum)
to the user land accessible process data of struct kinfo_proc.
  
  Submitted by: Oliver Fromme , gibbs

Modified:
  head/bin/ps/keyword.c
  head/bin/ps/ps.1
  head/sys/compat/freebsd32/freebsd32.h
  head/sys/kern/kern_proc.c
  head/sys/sys/user.h

Modified: head/bin/ps/keyword.c
==
--- head/bin/ps/keyword.c   Mon Aug 26 23:37:11 2013(r254942)
+++ head/bin/ps/keyword.c   Mon Aug 26 23:48:21 2013(r254943)
@@ -87,6 +87,7 @@ static VAR var[] = {
{"etimes", "ELAPSED", NULL, USER, elapseds, 0, CHAR, NULL, 0},
{"euid", "", "uid", 0, NULL, 0, CHAR, NULL, 0},
{"f", "F", NULL, 0, kvar, KOFF(ki_flag), INT, "x", 0},
+   {"fib", "FIB", NULL, 0, kvar, KOFF(ki_fibnum), INT, "d", 0},
{"flags", "", "f", 0, NULL, 0, CHAR, NULL, 0},
{"gid", "GID", NULL, 0, kvar, KOFF(ki_groups), UINT, UIDFMT, 0},
{"group", "GROUP", NULL, LJUST, egroupname, 0, CHAR, NULL, 0},

Modified: head/bin/ps/ps.1
==
--- head/bin/ps/ps.1Mon Aug 26 23:37:11 2013(r254942)
+++ head/bin/ps/ps.1Mon Aug 26 23:48:21 2013(r254943)
@@ -512,6 +512,9 @@ elapsed running time, format
 minutes:seconds.
 .It Cm etimes
 elapsed running time, in decimal integer seconds
+.It Cm fib
+default FIB number, see
+.Xr setfib 1
 .It Cm flags
 the process flags, in hexadecimal (alias
 .Cm f )

Modified: head/sys/compat/freebsd32/freebsd32.h
==
--- head/sys/compat/freebsd32/freebsd32.h   Mon Aug 26 23:37:11 2013
(r254942)
+++ head/sys/compat/freebsd32/freebsd32.h   Mon Aug 26 23:48:21 2013
(r254943)
@@ -342,6 +342,7 @@ struct kinfo_proc32 {
charki_loginclass[LOGINCLASSLEN+1];
charki_sparestrings[50];
int ki_spareints[KI_NSPARE_INT];
+   int ki_fibnum;
u_int   ki_cr_flags;
int ki_jid;
int ki_numthreads;

Modified: head/sys/kern/kern_proc.c
==
--- head/sys/kern/kern_proc.c   Mon Aug 26 23:37:11 2013(r254942)
+++ head/sys/kern/kern_proc.c   Mon Aug 26 23:48:21 2013(r254943)
@@ -862,6 +862,7 @@ fill_kinfo_proc_only(struct proc *p, str
kp->ki_swtime = (ticks - p->p_swtick) / hz;
kp->ki_pid = p->p_pid;
kp->ki_nice = p->p_nice;
+   kp->ki_fibnum = p->p_fibnum;
kp->ki_start = p->p_stats->p_start;
timevaladd(&kp->ki_start, &boottime);
PROC_SLOCK(p);
@@ -1160,6 +1161,7 @@ freebsd32_kinfo_proc_out(const struct ki
bcopy(ki->ki_comm, ki32->ki_comm, COMMLEN + 1);
bcopy(ki->ki_emul, ki32->ki_emul, KI_EMULNAMELEN + 1);
bcopy(ki->ki_loginclass, ki32->ki_loginclass, LOGINCLASSLEN + 1);
+   CP(*ki, *ki32, ki_fibnum);
CP(*ki, *ki32, ki_cr_flags);
CP(*ki, *ki32, ki_jid);
CP(*ki, *ki32, ki_numthreads);

Modified: head/sys/sys/user.h
==
--- head/sys/sys/user.h Mon Aug 26 23:37:11 2013(r254942)
+++ head/sys/sys/user.h Mon Aug 26 23:48:21 2013(r254943)
@@ -83,7 +83,7 @@
  * it in two places: function fill_kinfo_proc in sys/kern/kern_proc.c and
  * function kvm_proclist in lib/libkvm/kvm_proc.c .
  */
-#defineKI_NSPARE_INT   9
+#defineKI_NSPARE_INT   8
 #defineKI_NSPARE_LONG  12
 #defineKI_NSPARE_PTR   6
 
@@ -186,6 +186,7 @@ struct kinfo_proc {
 */
charki_sparestrings[50];/* spare string space */
int ki_spareints[KI_NSPARE_INT];/* spare room for growth */
+   int ki_fibnum;  /* Default FIB number */
u_int   ki_cr_flags;/* Credential flags */
int ki_jid; /* Process jail ID */
int ki_numthreads;  /* XXXKSE number of threads in total */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254944 - head/sys/mips/malta

2013-08-26 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Aug 27 01:08:55 2013
New Revision: 254944
URL: http://svnweb.freebsd.org/changeset/base/254944

Log:
  - Initialize freq variable so we will not end up with random value
  if there is no YAMON present

Modified:
  head/sys/mips/malta/yamon.c

Modified: head/sys/mips/malta/yamon.c
==
--- head/sys/mips/malta/yamon.c Mon Aug 26 23:48:21 2013(r254943)
+++ head/sys/mips/malta/yamon.c Tue Aug 27 01:08:55 2013(r254944)
@@ -56,6 +56,7 @@ yamon_getcpufreq(void)
uint32_t freq;
int ret;
 
+   freq = 0;
ret = YAMON_SYSCON_READ(SYSCON_BOARD_CPU_CLOCK_FREQ_ID, &freq,
sizeof(freq));
if (ret != 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254945 - head/sys/kern

2013-08-26 Thread Konstantin Belousov
Author: kib
Date: Tue Aug 27 01:31:12 2013
New Revision: 254945
URL: http://svnweb.freebsd.org/changeset/base/254945

Log:
  When allocating a pbuf for the cluster write, do not sleep waiting
  for the available pbuf when passed vnode is backing md(4). Other i/o
  directed to the same md device might already hold pbufs, and then we
  could deadlock since only our progress can free a pbuf needed for
  wakeup.
  
  Obtained from:projects/vm6
  Reminded and tested by:   pho
  MFC after:1 week

Modified:
  head/sys/kern/vfs_cluster.c

Modified: head/sys/kern/vfs_cluster.c
==
--- head/sys/kern/vfs_cluster.c Tue Aug 27 01:08:55 2013(r254944)
+++ head/sys/kern/vfs_cluster.c Tue Aug 27 01:31:12 2013(r254945)
@@ -837,7 +837,9 @@ cluster_wbuild(struct vnode *vp, long si
  (tbp->b_bcount != tbp->b_bufsize) ||
  (tbp->b_bcount != size) ||
  (len == 1) ||
- ((bp = getpbuf(&cluster_pbuf_freecnt)) == NULL)) {
+ ((bp = (vp->v_vflag & VV_MD) != 0 ?
+ trypbuf(&cluster_pbuf_freecnt) :
+ getpbuf(&cluster_pbuf_freecnt)) == NULL)) {
totalwritten += tbp->b_bufsize;
bawrite(tbp);
++start_lbn;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254946 - head/sys/mips/malta

2013-08-26 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Aug 27 01:40:13 2013
New Revision: 254946
URL: http://svnweb.freebsd.org/changeset/base/254946

Log:
  Fixes for compatibility with QEMU:
  
  - Route PCI interrupt for NIC
  - Make "no mapping" warning more user-friendly: add device name and mention
  that it's IRQ mapping
  - Do not overlap ICUs' IO window with PCI devices' IO windows by starting
  IO rman at offset 0x100

Modified:
  head/sys/mips/malta/gt_pci.c

Modified: head/sys/mips/malta/gt_pci.c
==
--- head/sys/mips/malta/gt_pci.cTue Aug 27 01:31:12 2013
(r254945)
+++ head/sys/mips/malta/gt_pci.cTue Aug 27 01:40:13 2013
(r254946)
@@ -266,8 +266,12 @@ gt_pci_attach(device_t dev)
sc->sc_io = MIPS_PHYS_TO_KSEG1(MALTA_PCI0_IO_BASE);
sc->sc_io_rman.rm_type = RMAN_ARRAY;
sc->sc_io_rman.rm_descr = "GT64120 PCI I/O Ports";
+   /* 
+* First 256 bytes are ISA's registers: e.g. i8259's
+* So do not use them for general purpose PCI I/O window
+*/
if (rman_init(&sc->sc_io_rman) != 0 ||
-   rman_manage_region(&sc->sc_io_rman, 0, 0x) != 0) {
+   rman_manage_region(&sc->sc_io_rman, 0x100, 0x) != 0) {
panic("gt_pci_attach: failed to set up I/O rman");
}
 
@@ -568,8 +572,10 @@ gt_pci_route_interrupt(device_t pcib, de
 * PIIX4 IDE adapter. HW IRQ0
 */
return 0;
+   case 11: /* Ethernet */
+   return 10;
default:
-   printf("No mapping for %d/%d/%d/%d\n", bus, device, func, pin);
+   device_printf(pcib, "no IRQ mapping for %d/%d/%d/%d\n", bus, 
device, func, pin);

}
return (0);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r254585 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-08-26 Thread Jeremie Le Hen
On Mon, Aug 26, 2013 at 04:03:08PM -0700, Xin Li wrote:
> Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
> ===
> --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
> (revision 254924)
> +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
> (working copy)
> @@ -6250,6 +6250,9 @@ zfs_freebsd_rename(ap)
>   ASSERT(ap->a_fcnp->cn_flags & (SAVENAME|SAVESTART));
>   ASSERT(ap->a_tcnp->cn_flags & (SAVENAME|SAVESTART));
>  
> + if (fdvp->v_mount != tdvp->v_mount)
> + return (EXDEV);
> +
>   error = zfs_rename(fdvp, ap->a_fcnp->cn_nameptr, tdvp,
>   ap->a_tcnp->cn_nameptr, ap->a_fcnp->cn_cred, NULL, 0);

I think this won't work with my setup where the target directory stands on a
nullfs-mounted zfs dataset.  I don't know anything about the VFS, but
here is what I see with kgdb(1):

(kgdb) print *tdvp
$1 = {v_tag = 0x80f5 "null", v_op = 0x81235a80, 
  v_data = 0xf800adbb5440, v_mount = 0xf80015af5990, v_nmntvnodes = 
{
  [...]
  v_holdcnt = 3, v_usecount = 2, v_iflag = 512, v_vflag = 0, v_writecount = 
0, 
  v_hash = 4723827, v_type = VDIR}

(kgdb) print *fdvp
$2 = {v_tag = 0x819a37a5 "zfs", v_op = 0x819b5f80, 
  v_data = 0xf80023ba3b80, v_mount = 0xf80011eae000, v_nmntvnodes = 
{
  [...]
  v_holdcnt = 4, v_usecount = 2, v_iflag = 512, v_vflag = 0, v_writecount = 
0, 
  v_hash = 2337681, v_type = VDIR}



Also, I got another panic.  I don't know if this is the same problem,
but the bottom of the stacktrace is pretty similar though:

Unread portion of the kernel message buffer:
panic: solaris assert: tx->tx_objset == NULL || dn->dn_objset == 
tx->tx_objset, file: 
/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c,
 line: 818
cpuid = 1
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2e/frame 
0xfe00e5ccbe50
kdb_backtrace() at kdb_backtrace+0x54/frame 0xfe00e5ccbf00
vpanic() at vpanic+0x1bf/frame 0xfe00e5ccbf70
kproc_shutdown() at kproc_shutdown/frame 0xfe00e5ccbfd0
assfail() at assfail+0x2c/frame 0xfe00e5ccc000
dmu_tx_dirty_buf() at dmu_tx_dirty_buf+0xcf/frame 0xfe00e5ccc0b0
dbuf_dirty() at dbuf_dirty+0xf2/frame 0xfe00e5ccc2a0
dbuf_will_dirty() at dbuf_will_dirty+0x11a/frame 0xfe00e5ccc2e0
sa_attr_op() at sa_attr_op+0x2be/frame 0xfe00e5ccc350
sa_bulk_update_impl() at sa_bulk_update_impl+0x105/frame 0xfe00e5ccc3b0
sa_bulk_update() at sa_bulk_update+0x81/frame 0xfe00e5ccc3f0
zfs_link_create() at zfs_link_create+0x3f6/frame 0xfe00e5ccc5b0
zfs_rename() at zfs_rename+0xc3c/frame 0xfe00e5ccc6e0
zfs_freebsd_rename() at zfs_freebsd_rename+0x116/frame 0xfe00e5ccc730
VOP_RENAME_APV() at VOP_RENAME_APV+0x22e/frame 0xfe00e5ccc790
VOP_RENAME() at VOP_RENAME+0x69/frame 0xfe00e5ccc810
kern_renameat() at kern_renameat+0x41e/frame 0xfe00e5ccca30
kern_rename() at kern_rename+0x33/frame 0xfe00e5ccca60
sys_rename() at sys_rename+0x2a/frame 0xfe00e5ccca80
syscallenter() at syscallenter+0x46e/frame 0xfe00e5cccaf0
amd64_syscall() at amd64_syscall+0x1f/frame 0xfe00e5cccbf0
Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfe00e5cccbf0
--- syscall (128, FreeBSD ELF64, sys_rename), rip = 0x80088a40a, rsp = 
0x7fffd0a8, rbp = 0x7fffd790 ---
KDB: enter: panic


(kgdb) frame 16
#16 0x818340ff in dmu_tx_dirty_buf (tx=0xf80008610600, 
db=0xf800c1627d20)
at 
/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c:818
818 ASSERT(tx->tx_objset == NULL || dn->dn_objset == 
tx->tx_objset);
(kgdb) print tx->tx_objset
$3 = (objset_t *) 0xf800046e4000
(kgdb) print dn->dn_objset
$4 = (struct objset *) 0xf800045fcc00



-- 
Jeremie Le Hen

Scientists say the world is made up of Protons, Neutrons and Electrons.
They forgot to mention Morons.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254948 - head/usr.sbin/bhyve

2013-08-26 Thread Peter Grehan
Author: grehan
Date: Tue Aug 27 03:49:47 2013
New Revision: 254948
URL: http://svnweb.freebsd.org/changeset/base/254948

Log:
  Fix off-by-1 error in assert.
  
  Submitted by: Tycho Nightingale (tycho.nighting...@pluribusnetworks.com)

Modified:
  head/usr.sbin/bhyve/pci_virtio_block.c

Modified: head/usr.sbin/bhyve/pci_virtio_block.c
==
--- head/usr.sbin/bhyve/pci_virtio_block.c  Tue Aug 27 03:11:49 2013
(r254947)
+++ head/usr.sbin/bhyve/pci_virtio_block.c  Tue Aug 27 03:49:47 2013
(r254948)
@@ -156,7 +156,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s
 * XXX - note - this fails on crash dump, which does a
 * VIRTIO_BLK_T_FLUSH with a zero transfer length
 */
-   assert (n >= 3 && n < VTBLK_MAXSEGS + 2);
+   assert (n >= 3 && n <= VTBLK_MAXSEGS + 2);
 
assert((flags[0] & VRING_DESC_F_WRITE) == 0);
assert(iov[0].iov_len == sizeof(struct virtio_blk_hdr));
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254949 - in head/cddl: lib/libzpool usr.bin/ztest usr.sbin/zdb

2013-08-26 Thread Will Andrews
Author: will
Date: Tue Aug 27 04:01:31 2013
New Revision: 254949
URL: http://svnweb.freebsd.org/changeset/base/254949

Log:
  Build all ZFS testing & debugging tools with -g.
  
  These programs and everything using libzpool rely on the embedded asserts to
  verify the correctness of operations.  Given that, the core dumps would be
  useless without debug symbols.

Modified:
  head/cddl/lib/libzpool/Makefile
  head/cddl/usr.bin/ztest/Makefile
  head/cddl/usr.sbin/zdb/Makefile

Modified: head/cddl/lib/libzpool/Makefile
==
--- head/cddl/lib/libzpool/Makefile Tue Aug 27 03:49:47 2013
(r254948)
+++ head/cddl/lib/libzpool/Makefile Tue Aug 27 04:01:31 2013
(r254949)
@@ -64,7 +64,9 @@ NO_PROFILE=
 
 CSTD=  c99
 
-CFLAGS+=   -DDEBUG=1
-#DEBUG_FLAGS+= -g
+# Since there are many asserts in this library, it makes no sense to compile
+# it without debugging.
+
+CFLAGS+=   -g -DDEBUG=1
 
 .include 

Modified: head/cddl/usr.bin/ztest/Makefile
==
--- head/cddl/usr.bin/ztest/MakefileTue Aug 27 03:49:47 2013
(r254948)
+++ head/cddl/usr.bin/ztest/MakefileTue Aug 27 04:01:31 2013
(r254949)
@@ -25,7 +25,8 @@ LDADD=-lgeom -lm -lnvpair -lumem -lzpoo
 
 CSTD=  c99
 
-CFLAGS+= -DDEBUG=1
-#DEBUG_FLAGS+= -g
+# Since there are many asserts in this program, it makes no sense to compile
+# it without debugging.
+CFLAGS+= -g -DDEBUG=1
 
 .include 

Modified: head/cddl/usr.sbin/zdb/Makefile
==
--- head/cddl/usr.sbin/zdb/Makefile Tue Aug 27 03:49:47 2013
(r254948)
+++ head/cddl/usr.sbin/zdb/Makefile Tue Aug 27 04:01:31 2013
(r254949)
@@ -27,7 +27,8 @@ DPADD=${LIBGEOM} ${LIBM} ${LIBNVPAIR} $
${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
 LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs_core -lzfs -lzpool
 
-CFLAGS+=   -DDEBUG=1
-#DEBUG_FLAGS+= -g
+# Since there are many asserts in this program, it makes no sense to compile
+# it without debugging.
+CFLAGS+=   -g -DDEBUG=1
 
 .include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254950 - head/sys/dev/vmware/vmxnet3

2013-08-26 Thread Bryan Venteicher
Author: bryanv
Date: Tue Aug 27 04:05:18 2013
New Revision: 254950
URL: http://svnweb.freebsd.org/changeset/base/254950

Log:
  Couple minor if_vmx tweaks
  
- Use queue size fields from the Tx/Rx queues in various places
  instead of (currently the same values) from the softc.
- Fix potential crash in detach if the attached failed to alloc
  queue memory.
- Move the VMXNET3_MAX_RX_SEGS define to a better spot.
- Tweak frame size calculation w.r.t. ETHER_ALIGN. This could be
  tweaked some more, or removed since it probably doesn't matter
  much for x86 (and the x86 class of machines this driver will
  be used on).

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmx.c
  head/sys/dev/vmware/vmxnet3/if_vmxvar.h

Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c
==
--- head/sys/dev/vmware/vmxnet3/if_vmx.cTue Aug 27 04:01:31 2013
(r254949)
+++ head/sys/dev/vmware/vmxnet3/if_vmx.cTue Aug 27 04:05:18 2013
(r254950)
@@ -437,15 +437,15 @@ vmxnet3_check_version(struct vmxnet3_sof
device_printf(dev, "unsupported hardware version %#x\n",
version);
return (ENOTSUP);
-   } else
-   vmxnet3_write_bar1(sc, VMXNET3_BAR1_VRRS, 1);
+   }
+   vmxnet3_write_bar1(sc, VMXNET3_BAR1_VRRS, 1);
 
version = vmxnet3_read_bar1(sc, VMXNET3_BAR1_UVRS);
if ((version & 0x01) == 0) {
device_printf(dev, "unsupported UPT version %#x\n", version);
return (ENOTSUP);
-   } else
-   vmxnet3_write_bar1(sc, VMXNET3_BAR1_UVRS, 1);
+   }
+   vmxnet3_write_bar1(sc, VMXNET3_BAR1_UVRS, 1);
 
return (0);
 }
@@ -781,10 +781,9 @@ vmxnet3_init_rxq(struct vmxnet3_softc *s
sizeof(struct vmxnet3_rxbuf), M_DEVBUF, M_NOWAIT | M_ZERO);
if (rxr->vxrxr_rxbuf == NULL)
return (ENOMEM);
-   }
 
-   rxq->vxrxq_comp_ring.vxcr_ndesc =
-   sc->vmx_nrxdescs * VMXNET3_RXRINGS_PERQ;
+   rxq->vxrxq_comp_ring.vxcr_ndesc += sc->vmx_nrxdescs;
+   }
 
return (0);
 }
@@ -1240,8 +1239,11 @@ static void
 vmxnet3_free_queue_data(struct vmxnet3_softc *sc)
 {
 
-   vmxnet3_free_rxq_data(sc);
-   vmxnet3_free_txq_data(sc);
+   if (sc->vmx_rxq != NULL)
+   vmxnet3_free_rxq_data(sc);
+
+   if (sc->vmx_txq != NULL)
+   vmxnet3_free_txq_data(sc);
 }
 
 static int
@@ -1325,9 +1327,9 @@ vmxnet3_init_shared_data(struct vmxnet3_
txs = txq->vxtxq_ts;
 
txs->cmd_ring = txq->vxtxq_cmd_ring.vxtxr_dma.dma_paddr;
-   txs->cmd_ring_len = sc->vmx_ntxdescs;
+   txs->cmd_ring_len = txq->vxtxq_cmd_ring.vxtxr_ndesc;
txs->comp_ring = txq->vxtxq_comp_ring.vxcr_dma.dma_paddr;
-   txs->comp_ring_len = sc->vmx_ntxdescs;
+   txs->comp_ring_len = txq->vxtxq_comp_ring.vxcr_ndesc;
txs->driver_data = vtophys(txq);
txs->driver_data_len = sizeof(struct vmxnet3_txqueue);
}
@@ -1342,8 +1344,7 @@ vmxnet3_init_shared_data(struct vmxnet3_
rxs->cmd_ring[1] = rxq->vxrxq_cmd_ring[1].vxrxr_dma.dma_paddr;
rxs->cmd_ring_len[1] = rxq->vxrxq_cmd_ring[1].vxrxr_ndesc;
rxs->comp_ring = rxq->vxrxq_comp_ring.vxcr_dma.dma_paddr;
-   rxs->comp_ring_len = rxq->vxrxq_cmd_ring[0].vxrxr_ndesc +
-   rxq->vxrxq_cmd_ring[1].vxrxr_ndesc;
+   rxs->comp_ring_len = rxq->vxrxq_comp_ring.vxcr_ndesc;
rxs->driver_data = vtophys(rxq);
rxs->driver_data_len = sizeof(struct vmxnet3_rxqueue);
}
@@ -1558,6 +1559,7 @@ vmxnet3_txq_eof(struct vmxnet3_txqueue *
txcd = &txc->vxcr_u.txcd[txc->vxcr_next];
if (txcd->gen != txc->vxcr_gen)
break;
+   vmxnet3_barrier(sc, VMXNET3_BARRIER_RD);
 
if (++txc->vxcr_next == txc->vxcr_ndesc) {
txc->vxcr_next = 0;
@@ -1647,7 +1649,7 @@ vmxnet3_newbuf(struct vmxnet3_softc *sc,
BUS_DMA_NOWAIT);
if (error) {
m_freem(m);
-   sc->vmx_stats.vmst_mbuf_load_failed++;;
+   sc->vmx_stats.vmst_mbuf_load_failed++;
return (error);
}
KASSERT(nsegs == 1,
@@ -2119,19 +2121,19 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc,
int i, populate, idx, frame_size, error;
 
ifp = sc->vmx_ifp;
-   frame_size = ifp->if_mtu + sizeof(struct ether_vlan_header);
+   frame_size = ETHER_ALIGN + sizeof(struct ether_vlan_header) +
+   ifp->if_mtu;
 
/*
-* If the MTU causes us to exceed what a regular sized cluster
-* can handle, we allocate a second MJUMPAGESIZE cluster after
-* it in ring 0. If in use, ring 1 always conta

svn commit: r254951 - head/release/scripts

2013-08-26 Thread Will Andrews
Author: will
Date: Tue Aug 27 04:42:42 2013
New Revision: 254951
URL: http://svnweb.freebsd.org/changeset/base/254951

Log:
  Fix 'make release' on older hosts: use buildworld legacy utilities.
  
  Newer FreeBSD installs require an install(1) that supports the new flags.
  
  This adds ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp/legacy/{bin,usr/{bin,sbin}}
  to the PATH while generating an mtree database for 'make release'.
  
  Note that the problem only exists here because mm-mtree.sh generates
  its own object tree to avoid mucking with the existing one, which
  results in a PATH containing legacy utility dirs that are empty.

Modified:
  head/release/scripts/mm-mtree.sh

Modified: head/release/scripts/mm-mtree.sh
==
--- head/release/scripts/mm-mtree.shTue Aug 27 04:05:18 2013
(r254950)
+++ head/release/scripts/mm-mtree.shTue Aug 27 04:42:42 2013
(r254951)
@@ -81,6 +81,11 @@ if [ ! -f ${SOURCEDIR}/Makefile.inc1 -a 
 fi
 
 # Setup make to use system files from SOURCEDIR
+objp=${MAKEOBJDIRPREFIX}
+[ -z "${objp}" ] && objp=/usr/obj
+legacydir=${objp}${SOURCEDIR}/tmp/legacy
+legacypath=${legacydir}/usr/sbin:${legacydir}/usr/bin:${legacydir}/bin
+MM_MAKE_ARGS="${MM_MAKE_ARGS} PATH=${legacypath}:${PATH}"
 MM_MAKE="make ${ARCHSTRING} ${MM_MAKE_ARGS} -m ${SOURCEDIR}/share/mk"
 
 delete_temproot () {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254952 - head/sys/boot/forth

2013-08-26 Thread Devin Teske
Author: dteske
Date: Tue Aug 27 06:09:28 2013
New Revision: 254952
URL: http://svnweb.freebsd.org/changeset/base/254952

Log:
  Update copyright.

Modified:
  head/sys/boot/forth/version.4th

Modified: head/sys/boot/forth/version.4th
==
--- head/sys/boot/forth/version.4th Tue Aug 27 04:42:42 2013
(r254951)
+++ head/sys/boot/forth/version.4th Tue Aug 27 06:09:28 2013
(r254952)
@@ -1,4 +1,4 @@
-\ Copyright (c) 2006-2011 Devin Teske 
+\ Copyright (c) 2006-2013 Devin Teske 
 \ All rights reserved.
 \ 
 \ Redistribution and use in source and binary forms, with or without
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254954 - head/sbin/camcontrol

2013-08-26 Thread Alexander Motin
Author: mav
Date: Tue Aug 27 06:50:46 2013
New Revision: 254954
URL: http://svnweb.freebsd.org/changeset/base/254954

Log:
  Add missing newlines to Fibre Channel attributes output.

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==
--- head/sbin/camcontrol/camcontrol.c   Tue Aug 27 06:31:50 2013
(r254953)
+++ head/sbin/camcontrol/camcontrol.c   Tue Aug 27 06:50:46 2013
(r254954)
@@ -4488,13 +4488,13 @@ cts_print(struct cam_device *device, str
&cts->xport_specific.fc;
 
if (fc->valid & CTS_FC_VALID_WWNN)
-   fprintf(stdout, "%sWWNN: 0x%llx", pathstr,
+   fprintf(stdout, "%sWWNN: 0x%llx\n", pathstr,
(long long) fc->wwnn);
if (fc->valid & CTS_FC_VALID_WWPN)
-   fprintf(stdout, "%sWWPN: 0x%llx", pathstr,
+   fprintf(stdout, "%sWWPN: 0x%llx\n", pathstr,
(long long) fc->wwpn);
if (fc->valid & CTS_FC_VALID_PORT)
-   fprintf(stdout, "%sPortID: 0x%x", pathstr, fc->port);
+   fprintf(stdout, "%sPortID: 0x%x\n", pathstr, fc->port);
if (fc->valid & CTS_FC_VALID_SPEED)
fprintf(stdout, "%stransfer speed: %d.%03dMB/s\n",
pathstr, fc->bitrate / 1000, fc->bitrate % 1000);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"