svn commit: r306551 - head/sys/arm/nvidia/tegra124

2016-10-01 Thread Michal Meloun
Author: mmel
Date: Sat Oct  1 06:50:16 2016
New Revision: 306551
URL: https://svnweb.freebsd.org/changeset/base/306551

Log:
  TEGRA: Fix bindings for cpufreq and coretemp drivers,
  it was broken in r306477.
  Correct a description for coretemp driver.

Modified:
  head/sys/arm/nvidia/tegra124/tegra124_coretemp.c
  head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c

Modified: head/sys/arm/nvidia/tegra124/tegra124_coretemp.c
==
--- head/sys/arm/nvidia/tegra124/tegra124_coretemp.cSat Oct  1 03:35:03 
2016(r306550)
+++ head/sys/arm/nvidia/tegra124/tegra124_coretemp.cSat Oct  1 06:50:16 
2016(r306551)
@@ -179,9 +179,9 @@ static void
 tegra124_coretemp_identify(driver_t *driver, device_t parent)
 {
 
-   if (device_find_child(parent, "tegra124_coretemp", -1) != NULL)
+   if (device_find_child(parent, "coretemp", -1) != NULL)
return;
-   if (BUS_ADD_CHILD(parent, 0, "tegra124_coretemp", -1) == NULL)
+   if (BUS_ADD_CHILD(parent, 0, "coretemp", -1) == NULL)
device_printf(parent, "add child failed\n");
 }
 
@@ -189,7 +189,7 @@ static int
 tegra124_coretemp_probe(device_t dev)
 {
 
-   device_set_desc(dev, "CPU Frequency Control");
+   device_set_desc(dev, "CPU Thermal Sensor");
return (0);
 }
 

Modified: head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c
==
--- head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Sat Oct  1 03:35:03 
2016(r306550)
+++ head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Sat Oct  1 06:50:16 
2016(r306551)
@@ -476,6 +476,8 @@ static void
 tegra124_cpufreq_identify(driver_t *driver, device_t parent)
 {
 
+   if (device_get_unit(parent) != 0)
+   return;
if (device_find_child(parent, "tegra124_cpufreq", -1) != NULL)
return;
if (BUS_ADD_CHILD(parent, 0, "tegra124_cpufreq", -1) == NULL)
@@ -486,8 +488,6 @@ static int
 tegra124_cpufreq_probe(device_t dev)
 {
 
-   if (device_get_unit(dev) != 0)
-   return (ENXIO);
device_set_desc(dev, "CPU Frequency Control");
 
return (0);
@@ -588,7 +588,7 @@ static device_method_t tegra124_cpufreq_
 };
 
 static devclass_t tegra124_cpufreq_devclass;
-static DEFINE_CLASS_0(cpufreq, tegra124_cpufreq_driver,
+static DEFINE_CLASS_0(tegra124_cpufreq, tegra124_cpufreq_driver,
 tegra124_cpufreq_methods, sizeof(struct tegra124_cpufreq_softc));
 DRIVER_MODULE(tegra124_cpufreq, cpu, tegra124_cpufreq_driver,
 tegra124_cpufreq_devclass, NULL, NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306552 - head/lib/libstand

2016-10-01 Thread Toomas Soome
Author: tsoome
Date: Sat Oct  1 07:46:28 2016
New Revision: 306552
URL: https://svnweb.freebsd.org/changeset/base/306552

Log:
  Fix remaining cstyle issues in libstand/cd9660.c
  
  Reported by:  Bruce Evans 
  Reviewed by:  allanjude
  Approved by:  allanjude (mentor)
  Differential Revision:https://reviews.freebsd.org/D8107

Modified:
  head/lib/libstand/cd9660.c

Modified: head/lib/libstand/cd9660.c
==
--- head/lib/libstand/cd9660.c  Sat Oct  1 06:50:16 2016(r306551)
+++ head/lib/libstand/cd9660.c  Sat Oct  1 07:46:28 2016(r306552)
@@ -353,15 +353,13 @@ cd9660_open(const char *path, struct ope
 
dp = (struct iso_directory_record *)
((char *) dp + isonum_711(dp->length));
-
/* if the new block is zero length, its padding */
if (isonum_711(dp->length) == 0) {
/* skip to next block, if any */
off = boff * ISO_DEFAULT_BLOCK_SIZE;
continue;
-   } else {
-   off += isonum_711(dp->length);
}
+   off += isonum_711(dp->length);
}
if (off >= dsize) {
rc = ENOENT;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306553 - in stable/11: lib/libprocstat sys/ufs/ffs sys/ufs/ufs

2016-10-01 Thread Konstantin Belousov
Author: kib
Date: Sat Oct  1 09:19:43 2016
New Revision: 306553
URL: https://svnweb.freebsd.org/changeset/base/306553

Log:
  MFC r305902:
  Reduce size of ufs inode.
  
  MFC r305903:
  Fix libprocstat build after r305902.

Modified:
  stable/11/lib/libprocstat/common_kvm.c
  stable/11/sys/ufs/ffs/ffs_alloc.c
  stable/11/sys/ufs/ffs/ffs_balloc.c
  stable/11/sys/ufs/ffs/ffs_inode.c
  stable/11/sys/ufs/ffs/ffs_rawread.c
  stable/11/sys/ufs/ffs/ffs_snapshot.c
  stable/11/sys/ufs/ffs/ffs_softdep.c
  stable/11/sys/ufs/ffs/ffs_subr.c
  stable/11/sys/ufs/ffs/ffs_vfsops.c
  stable/11/sys/ufs/ffs/ffs_vnops.c
  stable/11/sys/ufs/ufs/extattr.h
  stable/11/sys/ufs/ufs/inode.h
  stable/11/sys/ufs/ufs/ufs_acl.c
  stable/11/sys/ufs/ufs/ufs_bmap.c
  stable/11/sys/ufs/ufs/ufs_gjournal.c
  stable/11/sys/ufs/ufs/ufs_inode.c
  stable/11/sys/ufs/ufs/ufs_quota.c
  stable/11/sys/ufs/ufs/ufs_vnops.c
  stable/11/sys/ufs/ufs/ufsmount.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libprocstat/common_kvm.c
==
--- stable/11/lib/libprocstat/common_kvm.c  Sat Oct  1 07:46:28 2016
(r306552)
+++ stable/11/lib/libprocstat/common_kvm.c  Sat Oct  1 09:19:43 2016
(r306553)
@@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #undef _KERNEL
@@ -88,17 +90,22 @@ int
 ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn)
 {
struct inode inode;
+   struct ufsmount um;
 
if (!kvm_read_all(kd, (unsigned long)VTOI(vp), , sizeof(inode))) {
warnx("can't read inode at %p", (void *)VTOI(vp));
return (1);
}
+   if (!kvm_read_all(kd, (unsigned long)inode.i_ump, , sizeof(um))) {
+   warnx("can't read ufsmount at %p", (void *)inode.i_ump);
+   return (1);
+   }
/*
 * The st_dev from stat(2) is a dev_t. These kernel structures
 * contain cdev pointers. We need to convert to dev_t to make
 * comparisons
 */
-   vn->vn_fsid = dev2udev(kd, inode.i_dev);
+   vn->vn_fsid = dev2udev(kd, um.um_dev);
vn->vn_fileid = inode.i_number;
vn->vn_mode = (mode_t)inode.i_mode;
vn->vn_size = inode.i_size;

Modified: stable/11/sys/ufs/ffs/ffs_alloc.c
==
--- stable/11/sys/ufs/ffs/ffs_alloc.c   Sat Oct  1 07:46:28 2016
(r306552)
+++ stable/11/sys/ufs/ffs/ffs_alloc.c   Sat Oct  1 09:19:43 2016
(r306553)
@@ -163,13 +163,13 @@ ffs_alloc(ip, lbn, bpref, size, flags, c
 #endif
 
*bnp = 0;
-   fs = ip->i_fs;
-   ump = ip->i_ump;
+   ump = ITOUMP(ip);
+   fs = ump->um_fs;
mtx_assert(UFS_MTX(ump), MA_OWNED);
 #ifdef INVARIANTS
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) {
printf("dev = %s, bsize = %ld, size = %d, fs = %s\n",
-   devtoname(ip->i_dev), (long)fs->fs_bsize, size,
+   devtoname(ump->um_dev), (long)fs->fs_bsize, size,
fs->fs_fsmnt);
panic("ffs_alloc: bad size");
}
@@ -260,9 +260,9 @@ ffs_realloccg(ip, lbprev, bprev, bpref, 
int64_t delta;
 
vp = ITOV(ip);
-   fs = ip->i_fs;
+   ump = ITOUMP(ip);
+   fs = ump->um_fs;
bp = NULL;
-   ump = ip->i_ump;
gbflags = (flags & BA_UNMAPPED) != 0 ? GB_UNMAPPED : 0;
 
mtx_assert(UFS_MTX(ump), MA_OWNED);
@@ -273,7 +273,7 @@ ffs_realloccg(ip, lbprev, bprev, bpref, 
(u_int)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) {
printf(
"dev = %s, bsize = %ld, osize = %d, nsize = %d, fs = %s\n",
-   devtoname(ip->i_dev), (long)fs->fs_bsize, osize,
+   devtoname(ump->um_dev), (long)fs->fs_bsize, osize,
nsize, fs->fs_fsmnt);
panic("ffs_realloccg: bad size");
}
@@ -288,7 +288,7 @@ retry:
}
if (bprev == 0) {
printf("dev = %s, bsize = %ld, bprev = %jd, fs = %s\n",
-   devtoname(ip->i_dev), (long)fs->fs_bsize, (intmax_t)bprev,
+   devtoname(ump->um_dev), (long)fs->fs_bsize, (intmax_t)bprev,
fs->fs_fsmnt);
panic("ffs_realloccg: bad bprev");
}
@@ -383,7 +383,7 @@ retry:
break;
default:
printf("dev = %s, optim = %ld, fs = %s\n",
-   devtoname(ip->i_dev), (long)fs->fs_optim, fs->fs_fsmnt);
+   devtoname(ump->um_dev), (long)fs->fs_optim, fs->fs_fsmnt);
panic("ffs_realloccg: bad optim");
/* NOTREACHED */
}
@@ -391,7 +391,7 @@ retry:
if (bno > 0) {
bp->b_blkno = fsbtodb(fs, bno);
if (!DOINGSOFTDEP(vp))
-   

svn commit: r306558 - in stable/11/sys: amd64/amd64 arm/arm i386/i386 sparc64/sparc64

2016-10-01 Thread Alan Cox
Author: alc
Date: Sat Oct  1 19:30:28 2016
New Revision: 306558
URL: https://svnweb.freebsd.org/changeset/base/306558

Log:
  MFC r305213,305319,305398
As an optimization to the machine-independent layer, change the machine-
dependent pmap_ts_referenced() so that it updates the page's dirty field
if a modified bit is found while counting reference bits.  This
opportunistic update can be performed at low cost and can eliminate the
need for some future calls to pmap_is_modified() by the machine-
independent layer.
  
Replace the number 4 in sparc64's pmap_ts_referenced() by
PMAP_TS_REFERENCED_MAX, like we've done elsewhere, e.g., amd64.

Modified:
  stable/11/sys/amd64/amd64/pmap.c
  stable/11/sys/arm/arm/pmap-v6.c
  stable/11/sys/i386/i386/pmap.c
  stable/11/sys/sparc64/sparc64/pmap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/pmap.c
==
--- stable/11/sys/amd64/amd64/pmap.cSat Oct  1 17:57:32 2016
(r306557)
+++ stable/11/sys/amd64/amd64/pmap.cSat Oct  1 19:30:28 2016
(r306558)
@@ -5831,6 +5831,14 @@ safe_to_clear_referenced(pmap_t pmap, pt
  * should be tested and standardized at some point in the future for
  * optimal aging of shared pages.
  *
+ * As an optimization, update the page's dirty field if a modified bit is
+ * found while counting reference bits.  This opportunistic update can be
+ * performed at low cost and can eliminate the need for some future calls
+ * to pmap_is_modified().  However, since this function stops after
+ * finding PMAP_TS_REFERENCED_MAX reference bits, it may not detect some
+ * dirty pages.  Those dirty pages will only be detected by a future call
+ * to pmap_is_modified().
+ *
  * A DI block is not needed within this function, because
  * invalidations are performed before the PV list lock is
  * released.
@@ -5843,7 +5851,7 @@ pmap_ts_referenced(vm_page_t m)
pmap_t pmap;
struct rwlock *lock;
pd_entry_t oldpde, *pde;
-   pt_entry_t *pte, PG_A;
+   pt_entry_t *pte, PG_A, PG_M, PG_RW;
vm_offset_t va;
vm_paddr_t pa;
int cleared, md_gen, not_cleared, pvh_gen;
@@ -5878,9 +5886,19 @@ retry:
}
}
PG_A = pmap_accessed_bit(pmap);
+   PG_M = pmap_modified_bit(pmap);
+   PG_RW = pmap_rw_bit(pmap);
va = pv->pv_va;
pde = pmap_pde(pmap, pv->pv_va);
oldpde = *pde;
+   if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW)) {
+   /*
+* Although "oldpde" is mapping a 2MB page, because
+* this function is called at a 4KB page granularity,
+* we only update the 4KB page under test.
+*/
+   vm_page_dirty(m);
+   }
if ((*pde & PG_A) != 0) {
/*
 * Since this reference bit is shared by 512 4KB
@@ -5974,11 +5992,15 @@ small_mappings:
}
}
PG_A = pmap_accessed_bit(pmap);
+   PG_M = pmap_modified_bit(pmap);
+   PG_RW = pmap_rw_bit(pmap);
pde = pmap_pde(pmap, pv->pv_va);
KASSERT((*pde & PG_PS) == 0,
("pmap_ts_referenced: found a 2mpage in page %p's pv list",
m));
pte = pmap_pde_to_pte(pde, pv->pv_va);
+   if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW))
+   vm_page_dirty(m);
if ((*pte & PG_A) != 0) {
if (safe_to_clear_referenced(pmap, *pte)) {
atomic_clear_long(pte, PG_A);

Modified: stable/11/sys/arm/arm/pmap-v6.c
==
--- stable/11/sys/arm/arm/pmap-v6.c Sat Oct  1 17:57:32 2016
(r306557)
+++ stable/11/sys/arm/arm/pmap-v6.c Sat Oct  1 19:30:28 2016
(r306558)
@@ -5178,6 +5178,14 @@ pmap_is_referenced(vm_page_t m)
  * XXX: The exact number of bits to check and clear is a matter that
  * should be tested and standardized at some point in the future for
  * optimal aging of shared pages.
+ *
+ * As an optimization, update the page's dirty field if a modified bit is
+ * found while counting reference bits.  This opportunistic update can be
+ * performed at low cost and can eliminate the need for some future calls
+ * to pmap_is_modified().  However, since this function stops after
+ * finding PMAP_TS_REFERENCED_MAX reference bits, it may not detect some
+ * dirty pages.  Those dirty pages will only be detected by a future call
+ * to pmap_is_modified().
  */
 int
 

svn commit: r306559 - head/sys/netinet

2016-10-01 Thread Rick Macklem
Author: rmacklem
Date: Sat Oct  1 19:39:09 2016
New Revision: 306559
URL: https://svnweb.freebsd.org/changeset/base/306559

Log:
  r297225 broke udp_output() for the case where the "addr" argument
  is NULL and the function jumps to the "release:" label.
  For this case, the "inp" was write locked, but the code attempted to
  read unlock it. This patch fixes the problem.
  This case could occur for NFS over UDP mounts, where the server was
  down for a few minutes under certain circumstances.
  
  Reported by:  bde
  Tested by:bde
  Reviewed by:  gnn
  MFC after:2 weeks

Modified:
  head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c
==
--- head/sys/netinet/udp_usrreq.c   Sat Oct  1 19:30:28 2016
(r306558)
+++ head/sys/netinet/udp_usrreq.c   Sat Oct  1 19:39:09 2016
(r306559)
@@ -1567,12 +1567,18 @@ udp_output(struct inpcb *inp, struct mbu
 
 release:
if (unlock_udbinfo == UH_WLOCKED) {
+   KASSERT(unlock_inp == UH_WLOCKED,
+   ("%s: excl udbinfo lock, shared inp lock", __func__));
INP_HASH_WUNLOCK(pcbinfo);
INP_WUNLOCK(inp);
} else if (unlock_udbinfo == UH_RLOCKED) {
+   KASSERT(unlock_inp == UH_RLOCKED,
+   ("%s: shared udbinfo lock, excl inp lock", __func__));
INP_HASH_RUNLOCK(pcbinfo);
INP_RUNLOCK(inp);
-   } else
+   } else if (unlock_inp == UH_WLOCKED)
+   INP_WUNLOCK(inp);
+   else
INP_RUNLOCK(inp);
m_freem(m);
return (error);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-10-01 Thread Baptiste Daroussin
Author: bapt
Date: Sat Oct  1 11:43:37 2016
New Revision: 306554
URL: https://svnweb.freebsd.org/changeset/base/306554

Log:
  Use accept4 with O_NONBLOCK rather than accept + fcntl

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

Modified: head/usr.sbin/bhyve/dbgport.c
==
--- head/usr.sbin/bhyve/dbgport.c   Sat Oct  1 09:19:43 2016
(r306553)
+++ head/usr.sbin/bhyve/dbgport.c   Sat Oct  1 11:43:37 2016
(r306554)
@@ -73,10 +73,8 @@ again:
printf("Waiting for connection from gdb\r\n");
printonce = 1;
}
-   conn_fd = accept(listen_fd, NULL, NULL);
-   if (conn_fd >= 0)
-   fcntl(conn_fd, F_SETFL, O_NONBLOCK);
-   else if (errno != EINTR)
+   conn_fd = accept4(listen_fd, NULL, NULL, O_NONBLOCK);
+   if (conn_fd < 0 && errno != EINTR)
perror("accept");
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306571 - head/usr.sbin/rtsold

2016-10-01 Thread Mark Johnston
Author: markj
Date: Sun Oct  2 00:56:21 2016
New Revision: 306571
URL: https://svnweb.freebsd.org/changeset/base/306571

Log:
  rtsold: Log messages about unexpected RAs at LOG_DEBUG.
  
  Because rtsold listens for RAs on a raw socket, it may receive RAs from
  interfaces that it does not manage. Such events can result in excessive
  logging.
  
  Submitted by: Franco Fichtner 
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D8108

Modified:
  head/usr.sbin/rtsold/rtsol.c

Modified: head/usr.sbin/rtsold/rtsol.c
==
--- head/usr.sbin/rtsold/rtsol.cSun Oct  2 00:35:00 2016
(r306570)
+++ head/usr.sbin/rtsold/rtsol.cSun Oct  2 00:56:21 2016
(r306571)
@@ -347,7 +347,7 @@ rtsol_input(int s)
/* xxx: more validation? */
 
if ((ifi = find_ifinfo(pi->ipi6_ifindex)) == NULL) {
-   warnmsg(LOG_INFO, __func__,
+   warnmsg(LOG_DEBUG, __func__,
"received RA from %s on an unexpected IF(%s)",
inet_ntop(AF_INET6, _addr, ntopbuf,
sizeof(ntopbuf)),
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306575 - stable/11/sys/vm

2016-10-01 Thread Mark Johnston
Author: markj
Date: Sun Oct  2 01:21:02 2016
New Revision: 306575
URL: https://svnweb.freebsd.org/changeset/base/306575

Log:
  MFC r305056, r305367:
  Restore swap pager readahead.

Modified:
  stable/11/sys/vm/swap_pager.c
  stable/11/sys/vm/vm_page.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/swap_pager.c
==
--- stable/11/sys/vm/swap_pager.c   Sun Oct  2 01:18:34 2016
(r306574)
+++ stable/11/sys/vm/swap_pager.c   Sun Oct  2 01:21:02 2016
(r306575)
@@ -990,22 +990,21 @@ swap_pager_copy(vm_object_t srcobject, v
  * page and return TRUE if it does, FALSE if it doesn't.
  *
  * If TRUE, we also try to determine how much valid, contiguous backing
- * store exists before and after the requested page within a reasonable
- * distance.  We do not try to restrict it to the swap device stripe
- * (that is handled in getpages/putpages).  It probably isn't worth
- * doing here.
+ * store exists before and after the requested page.
  */
 static boolean_t
-swap_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int 
*after)
+swap_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before,
+int *after)
 {
-   daddr_t blk0;
+   daddr_t blk, blk0;
+   int i;
 
VM_OBJECT_ASSERT_LOCKED(object);
+
/*
 * do we have good backing store at the requested index ?
 */
blk0 = swp_pager_meta_ctl(object, pindex, 0);
-
if (blk0 == SWAPBLK_NONE) {
if (before)
*before = 0;
@@ -1018,34 +1017,26 @@ swap_pager_haspage(vm_object_t object, v
 * find backwards-looking contiguous good backing store
 */
if (before != NULL) {
-   int i;
-
-   for (i = 1; i < (SWB_NPAGES/2); ++i) {
-   daddr_t blk;
-
+   for (i = 1; i < SWB_NPAGES; i++) {
if (i > pindex)
break;
blk = swp_pager_meta_ctl(object, pindex - i, 0);
if (blk != blk0 - i)
break;
}
-   *before = (i - 1);
+   *before = i - 1;
}
 
/*
 * find forward-looking contiguous good backing store
 */
if (after != NULL) {
-   int i;
-
-   for (i = 1; i < (SWB_NPAGES/2); ++i) {
-   daddr_t blk;
-
+   for (i = 1; i < SWB_NPAGES; i++) {
blk = swp_pager_meta_ctl(object, pindex + i, 0);
if (blk != blk0 + i)
break;
}
-   *after = (i - 1);
+   *after = i - 1;
}
return (TRUE);
 }
@@ -1077,62 +1068,108 @@ swap_pager_unswapped(vm_page_t m)
 }
 
 /*
- * SWAP_PAGER_GETPAGES() - bring pages in from swap
- *
- * Attempt to retrieve (m, count) pages from backing store, but make
- * sure we retrieve at least m[reqpage].  We try to load in as large
- * a chunk surrounding m[reqpage] as is contiguous in swap and which
- * belongs to the same object.
- *
- * The code is designed for asynchronous operation and
- * immediate-notification of 'reqpage' but tends not to be
- * used that way.  Please do not optimize-out this algorithmic
- * feature, I intend to improve on it in the future.
+ * swap_pager_getpages() - bring pages in from swap
  *
- * The parent has a single vm_object_pip_add() reference prior to
- * calling us and we should return with the same.
+ * Attempt to page in the pages in array "m" of length "count".  The caller
+ * may optionally specify that additional pages preceding and succeeding
+ * the specified range be paged in.  The number of such pages is returned
+ * in the "rbehind" and "rahead" parameters, and they will be in the
+ * inactive queue upon return.
  *
- * The parent has BUSY'd the pages.  We should return with 'm'
- * left busy, but the others adjusted.
+ * The pages in "m" must be busied and will remain busied upon return.
  */
 static int
 swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind,
 int *rahead)
 {
struct buf *bp;
+   vm_page_t mpred, msucc, p;
+   vm_pindex_t pindex;
daddr_t blk;
+   int i, j, maxahead, maxbehind, reqcount, shift;
 
-   /*
-* Calculate range to retrieve.  The pages have already been assigned
-* their swapblks.  We require a *contiguous* range but we know it to
-* not span devices.   If we do not supply it, bad things
-* happen.  Note that blk, iblk & jblk can be SWAPBLK_NONE, but the
-* loops are set up such that the case(s) are handled implicitly.
-*
-* The swp_*() calls must be made with the object locked.

svn commit: r306577 - head/sys/netinet

2016-10-01 Thread Eric van Gyzen
Author: vangyzen
Date: Sun Oct  2 01:42:45 2016
New Revision: 306577
URL: https://svnweb.freebsd.org/changeset/base/306577

Log:
  Add GARP retransmit capability
  
  A single gratuitous ARP (GARP) is always transmitted when an IPv4
  address is added to an interface, and that is usually sufficient.
  However, in some circumstances, such as when a shared address is
  passed between cluster nodes, this single GARP may occasionally be
  dropped or lost.  This can lead to neighbors on the network link
  working with a stale ARP cache and sending packets destined for
  that address to the node that previously owned the address, which
  may not respond.
  
  To avoid this situation, GARP retransmissions can be enabled by setting
  the net.link.ether.inet.garp_rexmit_count sysctl to a value greater
  than zero.  The setting represents the maximum number of retransmissions.
  The interval between retransmissions is calculated using an exponential
  backoff algorithm, doubling each time, so the retransmission intervals
  are: {1, 2, 4, 8, 16, ...} (seconds).
  
  Due to the exponential backoff algorithm used for the interval
  between GARP retransmissions, the maximum number of retransmissions
  is limited to 16 for sanity.  This limit corresponds to a maximum
  interval between retransmissions of 2^16 seconds ~= 18 hours.
  Increasing this limit is possible, but sending out GARPs spaced
  days apart would be of little use.
  
  Submitted by: David A. Bright 
  MFC after:1 month
  Relnotes: yes
  Sponsored by: Dell EMC
  Differential Revision:https://reviews.freebsd.org/D7695

Modified:
  head/sys/netinet/if_ether.c
  head/sys/netinet/in.c
  head/sys/netinet/in_var.h

Modified: head/sys/netinet/if_ether.c
==
--- head/sys/netinet/if_ether.c Sun Oct  2 01:22:38 2016(r306576)
+++ head/sys/netinet/if_ether.c Sun Oct  2 01:42:45 2016(r306577)
@@ -137,6 +137,28 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUT
"Maximum number of remotely triggered ARP messages that can be "
"logged per second");
 
+/*
+ * Due to the exponential backoff algorithm used for the interval between GARP
+ * retransmissions, the maximum number of retransmissions is limited for
+ * sanity. This limit corresponds to a maximum interval between retransmissions
+ * of 2^16 seconds ~= 18 hours.
+ *
+ * Making this limit more dynamic is more complicated than worthwhile,
+ * especially since sending out GARPs spaced days apart would be of little
+ * use. A maximum dynamic limit would look something like:
+ *
+ * const int max = fls(INT_MAX / hz) - 1;
+ */
+#define MAX_GARP_RETRANSMITS 16
+static int sysctl_garp_rexmit(SYSCTL_HANDLER_ARGS);
+static int garp_rexmit_count = 0; /* GARP retransmission setting. */
+
+SYSCTL_PROC(_net_link_ether_inet, OID_AUTO, garp_rexmit_count,
+CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE,
+_rexmit_count, 0, sysctl_garp_rexmit, "I",
+"Number of times to retransmit GARP packets;"
+" 0 to disable, maximum of 16");
+
 #defineARP_LOG(pri, ...)   do {
\
if (ppsratecheck(_lastlog, _curpps, arp_maxpps))\
log((pri), "arp: " __VA_ARGS__);\
@@ -1287,6 +1309,109 @@ arp_add_ifa_lle(struct ifnet *ifp, const
lltable_free_entry(LLTABLE(ifp), lle_tmp);
 }
 
+/*
+ * Handle the garp_rexmit_count. Like sysctl_handle_int(), but limits the range
+ * of valid values.
+ */
+static int
+sysctl_garp_rexmit(SYSCTL_HANDLER_ARGS)
+{
+   int error;
+   int rexmit_count = *(int *)arg1;
+
+   error = sysctl_handle_int(oidp, _count, 0, req);
+
+   /* Enforce limits on any new value that may have been set. */
+   if (!error && req->newptr) {
+   /* A new value was set. */
+   if (rexmit_count < 0) {
+   rexmit_count = 0;
+   } else if (rexmit_count > MAX_GARP_RETRANSMITS) {
+   rexmit_count = MAX_GARP_RETRANSMITS;
+   }
+   *(int *)arg1 = rexmit_count;
+   }
+
+   return (error);
+}
+
+/*
+ * Retransmit a Gratuitous ARP (GARP) and, if necessary, schedule a callout to
+ * retransmit it again. A pending callout owns a reference to the ifa.
+ */
+static void
+garp_rexmit(void *arg)
+{
+   struct in_ifaddr *ia = arg;
+
+   if (callout_pending(>ia_garp_timer) ||
+   !callout_active(>ia_garp_timer)) {
+   IF_ADDR_WUNLOCK(ia->ia_ifa.ifa_ifp);
+   ifa_free(>ia_ifa);
+   return;
+   }
+
+   /*
+* Drop lock while the ARP request is generated.
+*/
+   IF_ADDR_WUNLOCK(ia->ia_ifa.ifa_ifp);
+
+   arprequest(ia->ia_ifa.ifa_ifp, _SIN(ia)->sin_addr,
+   _SIN(ia)->sin_addr, IF_LLADDR(ia->ia_ifa.ifa_ifp));
+
+   /*
+* Increment the count of retransmissions. If the count has 

svn commit: r306573 - stable/11/sys/netinet6

2016-10-01 Thread Mark Johnston
Author: markj
Date: Sun Oct  2 01:16:02 2016
New Revision: 306573
URL: https://svnweb.freebsd.org/changeset/base/306573

Log:
  MFC r306285:
  Rename ndpr_refcnt to ndpr_addrcnt.

Modified:
  stable/11/sys/netinet6/in6.c
  stable/11/sys/netinet6/nd6.c
  stable/11/sys/netinet6/nd6.h
  stable/11/sys/netinet6/nd6_rtr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/in6.c
==
--- stable/11/sys/netinet6/in6.cSun Oct  2 01:14:26 2016
(r306572)
+++ stable/11/sys/netinet6/in6.cSun Oct  2 01:16:02 2016
(r306573)
@@ -630,7 +630,7 @@ in6_control(struct socket *so, u_long cm
/* relate the address to the prefix */
if (ia->ia6_ndpr == NULL) {
ia->ia6_ndpr = pr;
-   pr->ndpr_refcnt++;
+   pr->ndpr_addrcnt++;
 
/*
 * If this is the first autoconf address from the
@@ -638,7 +638,7 @@ in6_control(struct socket *so, u_long cm
 * (when required).
 */
if ((ia->ia6_flags & IN6_IFF_AUTOCONF) &&
-   V_ip6_use_tempaddr && pr->ndpr_refcnt == 1) {
+   V_ip6_use_tempaddr && pr->ndpr_addrcnt == 1) {
int e;
if ((e = in6_tmpifadd(ia, 1, 0)) != 0) {
log(LOG_NOTICE, "in6_control: failed "
@@ -690,11 +690,11 @@ aifaddr_out:
 * and the prefix management.  We do this, however, to provide
 * as much backward compatibility as possible in terms of
 * the ioctl operation.
-* Note that in6_purgeaddr() will decrement ndpr_refcnt.
+* Note that in6_purgeaddr() will decrement ndpr_addrcnt.
 */
pr = ia->ia6_ndpr;
in6_purgeaddr(>ia_ifa);
-   if (pr && pr->ndpr_refcnt == 0)
+   if (pr && pr->ndpr_addrcnt == 0)
prelist_remove(pr);
EVENTHANDLER_INVOKE(ifaddr_event, ifp);
break;
@@ -1305,9 +1305,9 @@ in6_unlink_ifa(struct in6_ifaddr *ia, st
"in6_unlink_ifa: autoconf'ed address "
"%s has no prefix\n", ip6_sprintf(ip6buf, IA6_IN6(ia;
} else {
-   ia->ia6_ndpr->ndpr_refcnt--;
+   ia->ia6_ndpr->ndpr_addrcnt--;
/* Do not delete lles within prefix if refcont != 0 */
-   if (ia->ia6_ndpr->ndpr_refcnt == 0)
+   if (ia->ia6_ndpr->ndpr_addrcnt == 0)
remove_lle = 1;
ia->ia6_ndpr = NULL;
}

Modified: stable/11/sys/netinet6/nd6.c
==
--- stable/11/sys/netinet6/nd6.cSun Oct  2 01:14:26 2016
(r306572)
+++ stable/11/sys/netinet6/nd6.cSun Oct  2 01:16:02 2016
(r306573)
@@ -1159,7 +1159,7 @@ nd6_purge(struct ifnet *ifp)
 * still be above zero. We therefore reset it to
 * make sure that the prefix really gets purged.
 */
-   pr->ndpr_refcnt = 0;
+   pr->ndpr_addrcnt = 0;
 
prelist_remove(pr);
}
@@ -2674,7 +2674,7 @@ nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS)
else
p.expire = maxexpire;
}
-   p.refcnt = pr->ndpr_refcnt;
+   p.refcnt = pr->ndpr_addrcnt;
p.flags = pr->ndpr_stateflags;
p.advrtrs = 0;
LIST_FOREACH(pfr, >ndpr_advrtrs, pfr_entry)

Modified: stable/11/sys/netinet6/nd6.h
==
--- stable/11/sys/netinet6/nd6.hSun Oct  2 01:14:26 2016
(r306572)
+++ stable/11/sys/netinet6/nd6.hSun Oct  2 01:16:02 2016
(r306573)
@@ -275,7 +275,7 @@ struct nd_prefix {
/* list of routers that advertise the prefix: */
LIST_HEAD(pr_rtrhead, nd_pfxrouter) ndpr_advrtrs;
u_char  ndpr_plen;
-   int ndpr_refcnt;/* reference couter from addresses */
+   int ndpr_addrcnt;   /* count of derived addresses */
 };
 
 #define ndpr_raf   ndpr_flags

Modified: stable/11/sys/netinet6/nd6_rtr.c
==
--- stable/11/sys/netinet6/nd6_rtr.cSun Oct  2 01:14:26 2016
(r306572)
+++ stable/11/sys/netinet6/nd6_rtr.cSun Oct  2 01:16:02 2016
(r306573)
@@ -1053,7 +1053,7 @@ prelist_remove(struct nd_prefix *pr)
/* what should we do? */
}
 
-   if (pr->ndpr_refcnt > 0)
+   if 

svn commit: r306576 - stable/11/cddl/contrib/opensolaris/cmd/dtrace

2016-10-01 Thread Mark Johnston
Author: markj
Date: Sun Oct  2 01:22:38 2016
New Revision: 306576
URL: https://svnweb.freebsd.org/changeset/base/306576

Log:
  MFC r304431:
  Add a SIGINFO handler for dtrace(1).

Modified:
  stable/11/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
==
--- stable/11/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c  Sun Oct  2 
01:21:02 2016(r306575)
+++ stable/11/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c  Sun Oct  2 
01:22:38 2016(r306576)
@@ -93,6 +93,9 @@ static int g_flowindent;
 static int g_intr;
 static int g_impatient;
 static int g_newline;
+#ifdef __FreeBSD__
+static int g_siginfo;
+#endif
 static int g_total;
 static int g_cflags;
 static int g_oflags;
@@ -1260,6 +1263,16 @@ intr(int signo)
g_impatient = 1;
 }
 
+#ifdef __FreeBSD__
+static void
+siginfo(int signo __unused)
+{
+
+   g_siginfo++;
+   g_newline = 1;
+}
+#endif
+
 static void
 installsighands(void)
 {
@@ -1275,12 +1288,16 @@ installsighands(void)
if (sigaction(SIGTERM, NULL, ) == 0 && oact.sa_handler != SIG_IGN)
(void) sigaction(SIGTERM, , NULL);
 
-#ifndef illumos
+#ifdef __FreeBSD__
if (sigaction(SIGPIPE, NULL, ) == 0 && oact.sa_handler != SIG_IGN)
(void) sigaction(SIGPIPE, , NULL);
 
if (sigaction(SIGUSR1, NULL, ) == 0 && oact.sa_handler != SIG_IGN)
(void) sigaction(SIGUSR1, , NULL);
+
+   act.sa_handler = siginfo;
+   if (sigaction(SIGINFO, NULL, ) == 0 && oact.sa_handler != SIG_IGN)
+   (void) sigaction(SIGINFO, , NULL);
 #endif
 }
 
@@ -1944,6 +1961,13 @@ main(int argc, char *argv[])
if (!g_intr && !done)
dtrace_sleep(g_dtp);
 
+#ifdef __FreeBSD__
+   if (g_siginfo) {
+   (void)dtrace_aggregate_print(g_dtp, g_ofp, NULL);
+   g_siginfo = 0;
+   }
+#endif
+
if (g_newline) {
/*
 * Output a newline just to make the output look
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306579 - in head/sys: arm/conf arm/ti conf dev/evdev dev/usb/input modules modules/evdev modules/uinput

2016-10-01 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Oct  2 03:20:31 2016
New Revision: 306579
URL: https://svnweb.freebsd.org/changeset/base/306579

Log:
  Modularize evdev
  
  - Convert "options EVDEV" to "device evdev" and "device uinput", add
  modules for both new devices. They are isolated subsystems and do not
  require any compile-time changes to general kernel subsytems
  - For hybrid drivers that have evdev as an optional way to deliver input
  events add option EVDEV_SUPPORT. Update all existing hybrid drivers
  to use it instead of EVDEV
  - Remove no-op DECLARE_MODULE in evdev, it's not required, MODULE_VERSION
  is enough
  - Add evdev module dependency to uinput
  
  Submitted by: Vladimir Kondratiev 

Added:
  head/sys/modules/evdev/
  head/sys/modules/evdev/Makefile   (contents, props changed)
  head/sys/modules/uinput/
  head/sys/modules/uinput/Makefile   (contents, props changed)
Modified:
  head/sys/arm/conf/BEAGLEBONE
  head/sys/arm/ti/ti_adc.c
  head/sys/arm/ti/ti_adcvar.h
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/dev/evdev/evdev.c
  head/sys/dev/evdev/uinput.c
  head/sys/dev/usb/input/ukbd.c
  head/sys/dev/usb/input/ums.c
  head/sys/modules/Makefile

Modified: head/sys/arm/conf/BEAGLEBONE
==
--- head/sys/arm/conf/BEAGLEBONESun Oct  2 03:06:58 2016
(r306578)
+++ head/sys/arm/conf/BEAGLEBONESun Oct  2 03:20:31 2016
(r306579)
@@ -133,4 +133,4 @@ device  ukbd
 device kbdmux
 
 # Uncomment to enable evdev support for ti_adc
-# options  EVDEV
+# options  EVDEV_SUPPORT

Modified: head/sys/arm/ti/ti_adc.c
==
--- head/sys/arm/ti/ti_adc.cSun Oct  2 03:06:58 2016(r306578)
+++ head/sys/arm/ti/ti_adc.cSun Oct  2 03:20:31 2016(r306579)
@@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
 #include 
 #include 
 #endif
@@ -89,7 +89,7 @@ static int ti_adc_samples[5] = { 0, 2, 4
 
 static int ti_adc_detach(device_t dev);
 
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
 static void
 ti_adc_ev_report(struct ti_adc_softc *sc)
 {
@@ -472,7 +472,7 @@ ti_adc_tsc_read_data(struct ti_adc_softc
device_printf(sc->sc_dev, "touchscreen x: %d, y: %d\n", x, y);
 #endif
 
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
if ((sc->sc_x != x) || (sc->sc_y != y)) {
sc->sc_x = x;
sc->sc_y = y;
@@ -516,7 +516,7 @@ ti_adc_intr(void *arg)
status |= ADC_IRQ_HW_PEN_ASYNC;
ADC_WRITE4(sc, ADC_IRQENABLE_CLR,
ADC_IRQ_HW_PEN_ASYNC);
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
ti_adc_ev_report(sc);
 #endif
}
@@ -524,7 +524,7 @@ ti_adc_intr(void *arg)
if (rawstatus & ADC_IRQ_PEN_UP) {
sc->sc_pen_down = 0;
status |= ADC_IRQ_PEN_UP;
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
ti_adc_ev_report(sc);
 #endif
}
@@ -874,7 +874,7 @@ ti_adc_attach(device_t dev)
ti_adc_setup(sc);
TI_ADC_UNLOCK(sc);
 
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
if (sc->sc_tsc_wires > 0) {
sc->sc_evdev = evdev_alloc();
evdev_set_name(sc->sc_evdev, device_get_desc(dev));
@@ -921,7 +921,7 @@ ti_adc_detach(device_t dev)
ti_adc_reset(sc);
ti_adc_setup(sc);
 
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
evdev_free(sc->sc_evdev);
 #endif
 
@@ -958,6 +958,6 @@ static devclass_t ti_adc_devclass;
 DRIVER_MODULE(ti_adc, simplebus, ti_adc_driver, ti_adc_devclass, 0, 0);
 MODULE_VERSION(ti_adc, 1);
 MODULE_DEPEND(ti_adc, simplebus, 1, 1, 1);
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
 MODULE_DEPEND(ti_adc, evdev, 1, 1, 1);
 #endif

Modified: head/sys/arm/ti/ti_adcvar.h
==
--- head/sys/arm/ti/ti_adcvar.h Sun Oct  2 03:06:58 2016(r306578)
+++ head/sys/arm/ti/ti_adcvar.h Sun Oct  2 03:20:31 2016(r306579)
@@ -55,7 +55,7 @@ struct ti_adc_softc {
int sc_yn_bit, sc_yn_inp;
uint32_tsc_tsc_enabled;
int sc_pen_down;
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
int sc_x;
int sc_y;
struct evdev_dev *sc_evdev;

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Sun Oct  2 03:06:58 2016(r306578)
+++ head/sys/conf/NOTES Sun Oct  2 03:20:31 2016(r306579)
@@ -3054,6 +3054,8 @@ options   GZIO
 optionsBHND_LOGLEVEL   # Logging threshold level
 
 # evdev interface 
-optionsEVDEV
-optionsEVDEV_DEBUG
-optionsUINPUT_DEBUG
+device evdev   # input event device support
+optionsEVDEV_SUPPORT   

svn commit: r306570 - in head/sys/cddl/dev/fbt: . arm powerpc x86

2016-10-01 Thread Mark Johnston
Author: markj
Date: Sun Oct  2 00:35:00 2016
New Revision: 306570
URL: https://svnweb.freebsd.org/changeset/base/306570

Log:
  Allow tracing of functions prefixed by "__".
  
  This restriction was inherited from upstream but is not relevant on FreeBSD.
  Furthermore, it hindered the tracing of locking primitive subroutines.
  
  MFC after:1 week

Modified:
  head/sys/cddl/dev/fbt/arm/fbt_isa.c
  head/sys/cddl/dev/fbt/fbt.c
  head/sys/cddl/dev/fbt/powerpc/fbt_isa.c
  head/sys/cddl/dev/fbt/x86/fbt_isa.c

Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c
==
--- head/sys/cddl/dev/fbt/arm/fbt_isa.c Sat Oct  1 23:08:26 2016
(r306569)
+++ head/sys/cddl/dev/fbt/arm/fbt_isa.c Sun Oct  2 00:35:00 2016
(r306570)
@@ -106,9 +106,6 @@ fbt_provide_module_function(linker_file_
return (0);
}
 
-   if (name[0] == '_' && name[1] == '_')
-   return (0);
-
instr = (uint32_t *)symval->value;
limit = (uint32_t *)(symval->value + symval->size);
 

Modified: head/sys/cddl/dev/fbt/fbt.c
==
--- head/sys/cddl/dev/fbt/fbt.c Sat Oct  1 23:08:26 2016(r306569)
+++ head/sys/cddl/dev/fbt/fbt.c Sun Oct  2 00:35:00 2016(r306570)
@@ -126,10 +126,6 @@ fbt_excluded(const char *name)
return (1);
}
 
-   /* Exclude some internal functions */
-   if (name[0] == '_' && name[1] == '_')
-   return (1);
-
/*
 * When DTrace is built into the kernel we need to exclude
 * the FBT functions from instrumentation.

Modified: head/sys/cddl/dev/fbt/powerpc/fbt_isa.c
==
--- head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Sat Oct  1 23:08:26 2016
(r306569)
+++ head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Sun Oct  2 00:35:00 2016
(r306570)
@@ -138,9 +138,6 @@ fbt_provide_module_function(linker_file_
return (0);
}
 
-   if (name[0] == '_' && name[1] == '_')
-   return (0);
-
instr = (uint32_t *) symval->value;
limit = (uint32_t *) (symval->value + symval->size);
 

Modified: head/sys/cddl/dev/fbt/x86/fbt_isa.c
==
--- head/sys/cddl/dev/fbt/x86/fbt_isa.c Sat Oct  1 23:08:26 2016
(r306569)
+++ head/sys/cddl/dev/fbt/x86/fbt_isa.c Sun Oct  2 00:35:00 2016
(r306570)
@@ -174,9 +174,6 @@ fbt_provide_module_function(linker_file_
return (0);
}
 
-   if (name[0] == '_' && name[1] == '_')
-   return (0);
-
size = symval->size;
 
instr = (uint8_t *) symval->value;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306578 - head/sys/dev/evdev

2016-10-01 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Oct  2 03:06:58 2016
New Revision: 306578
URL: https://svnweb.freebsd.org/changeset/base/306578

Log:
  Fix gcc compilation error
  
  input_absinfo.code is unsigned so condition is always false

Modified:
  head/sys/dev/evdev/uinput.c

Modified: head/sys/dev/evdev/uinput.c
==
--- head/sys/dev/evdev/uinput.c Sun Oct  2 01:42:45 2016(r306577)
+++ head/sys/dev/evdev/uinput.c Sun Oct  2 03:06:58 2016(r306578)
@@ -527,7 +527,7 @@ uinput_ioctl_sub(struct uinput_cdev_stat
return (EINVAL);
 
uabs = (struct uinput_abs_setup *)data;
-   if (uabs->code > ABS_MAX || uabs->code < 0)
+   if (uabs->code > ABS_MAX)
return (EINVAL);
 
evdev_support_abs(state->ucs_evdev, uabs->code,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306572 - in stable/11/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/intel/dtrace cddl/contrib/opensolaris/uts/powerpc/dtrace conf modules/o...

2016-10-01 Thread Mark Johnston
Author: markj
Date: Sun Oct  2 01:14:26 2016
New Revision: 306572
URL: https://svnweb.freebsd.org/changeset/base/306572

Log:
  MFC r306304:
  Move implementations of uread() and uwrite() to the illumos compat layer.

Added:
  stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c
 - copied unchanged from r306304, 
head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c
Modified:
  stable/11/sys/cddl/compat/opensolaris/sys/proc.h
  stable/11/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
  stable/11/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c
  stable/11/sys/conf/files
  stable/11/sys/modules/opensolaris/Makefile
Directory Properties:
  stable/11/   (props changed)

Copied: stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c (from 
r306304, head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c   Sun Oct 
 2 01:14:26 2016(r306572, copy of r306304, 
head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c)
@@ -0,0 +1,57 @@
+/*-
+ * Copyright 2016 Mark Johnston 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+
+int
+uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
+{
+   ssize_t n;
+
+   PHOLD(p);
+   n = proc_readmem(curthread, p, uaddr, kaddr, len);
+   PRELE(p);
+   if (n != len)
+   return (ENOMEM);
+   return (0);
+}
+
+int
+uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
+{
+   ssize_t n;
+
+   PHOLD(p);
+   n = proc_writemem(curthread, p, uaddr, kaddr, len);
+   PRELE(p);
+   if (n != len)
+   return (ENOMEM);
+   return (0);
+}

Modified: stable/11/sys/cddl/compat/opensolaris/sys/proc.h
==
--- stable/11/sys/cddl/compat/opensolaris/sys/proc.hSun Oct  2 00:56:21 
2016(r306571)
+++ stable/11/sys/cddl/compat/opensolaris/sys/proc.hSun Oct  2 01:14:26 
2016(r306572)
@@ -92,6 +92,9 @@ do_thread_create(caddr_t stk, size_t stk
do_thread_create(stk, stksize, proc, arg, len, pp, state, pri)
 #definethread_exit()   kthread_exit()
 
+inturead(proc_t *, void *, size_t, uintptr_t);
+intuwrite(proc_t *, void *, size_t, uintptr_t);
+
 #endif /* _KERNEL */
 
 #endif /* _OPENSOLARIS_SYS_PROC_H_ */

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c  
Sun Oct  2 00:56:21 2016(r306571)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c  
Sun Oct  2 01:14:26 2016(r306572)
@@ -59,34 +59,8 @@
 #include 
 #else
 #include 
-
-static int
-uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
-{
-   ssize_t n;
-
-   PHOLD(p);
-   n = proc_readmem(curthread, p, uaddr, kaddr, len);
-   PRELE(p);
-   if (n != len)
-   return (ENOMEM);
-   return (0);
-}
-
-static int
-uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
-{
-   ssize_t n;
-
-   PHOLD(p);
-   n = proc_writemem(curthread, p, uaddr, kaddr, len);
-   PRELE(p);
-   if (n != len)
-   return (ENOMEM);
-   return (0);
-}
-
 #endif /* illumos */
+
 #ifdef __i386__
 #definer_rax   r_eax
 #definer_rbx   r_ebx

Modified: 

svn commit: r306574 - stable/11/sys/cddl/dev/systrace

2016-10-01 Thread Mark Johnston
Author: markj
Date: Sun Oct  2 01:18:34 2016
New Revision: 306574
URL: https://svnweb.freebsd.org/changeset/base/306574

Log:
  MFC r306220:
  Re-check the systrace probe ID before calling dtrace_probe().

Modified:
  stable/11/sys/cddl/dev/systrace/systrace.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/dev/systrace/systrace.c
==
--- stable/11/sys/cddl/dev/systrace/systrace.c  Sun Oct  2 01:16:02 2016
(r306573)
+++ stable/11/sys/cddl/dev/systrace/systrace.c  Sun Oct  2 01:18:34 2016
(r306574)
@@ -193,7 +193,8 @@ systrace_probe(struct syscall_args *sa, 
memset(uargs, 0, sizeof(uargs));
 
if (type == SYSTRACE_ENTRY) {
-   id = sa->callp->sy_entry;
+   if ((id = sa->callp->sy_entry) == DTRACE_IDNONE)
+   return;
 
if (sa->callp->sy_systrace_args_func != NULL)
/*
@@ -215,7 +216,8 @@ systrace_probe(struct syscall_args *sa, 
 */
curthread->t_dtrace_systrace_args = uargs;
} else {
-   id = sa->callp->sy_return;
+   if ((id = sa->callp->sy_return) == DTRACE_IDNONE)
+   return;
 
curthread->t_dtrace_systrace_args = NULL;
/* Set arg0 and arg1 as the return value of this syscall. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306564 - in head: sys/sys usr.bin/kdump

2016-10-01 Thread John Baldwin
Author: jhb
Date: Sat Oct  1 22:08:07 2016
New Revision: 306564
URL: https://svnweb.freebsd.org/changeset/base/306564

Log:
  Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined.
  
  The kernel uses a few negative errno values for internal conditions
  such as requesting a system call restart.  Normally these errno values
  are not exposed to userland.  However, kdump needs access to these
  values as some of then can be present in a ktrace system call return
  record.  Previously kdump was defining _KERNEL to gain access to ehse
  values, but was then having to manually declare 'errno' (and doing it
  incorrectly).  Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL
  and uses the system-provided declaration of errno.

Modified:
  head/sys/sys/errno.h
  head/usr.bin/kdump/kdump.c

Modified: head/sys/sys/errno.h
==
--- head/sys/sys/errno.hSat Oct  1 22:03:41 2016(r306563)
+++ head/sys/sys/errno.hSat Oct  1 22:08:07 2016(r306564)
@@ -184,7 +184,7 @@ __END_DECLS
 #defineELAST   96  /* Must be equal largest errno 
*/
 #endif /* _POSIX_SOURCE */
 
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO)
 /* pseudo-errors returned inside kernel to modify return to process */
 #defineERESTART(-1)/* restart syscall */
 #defineEJUSTRETURN (-2)/* don't modify regs, just 
return */

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Sat Oct  1 22:03:41 2016(r306563)
+++ head/usr.bin/kdump/kdump.c  Sat Oct  1 22:08:07 2016(r306564)
@@ -41,10 +41,7 @@ static char sccsid[] = "@(#)kdump.c  8.1 
 #include 
 __FBSDID("$FreeBSD$");
 
-#define _KERNEL
-extern int errno;
-#include 
-#undef _KERNEL
+#define _WANT_KERNEL_ERRNO
 #include 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-10-01 Thread John Baldwin
Author: jhb
Date: Sat Oct  1 22:12:33 2016
New Revision: 306565
URL: https://svnweb.freebsd.org/changeset/base/306565

Log:
  Use timercmp() and timersub() in kdump.
  
  Previously, kdump used the kernel-only timervalsub() macro which required
  defining _KERNEL when including .  Now, kdump uses the existing
  userland API.  The timercmp() usage to check for a backwards timestamp is
  also clearer and simpler than the previous code which checked the result of
  the subtraction for a negative value.
  
  While here, take advantage of the 3-arg timersub() to store the subtraction
  results in a tempory timeval instead of overwriting the timestamp in the
  ktrace record and then having to restore it.

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

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Sat Oct  1 22:08:07 2016(r306564)
+++ head/usr.bin/kdump/kdump.c  Sat Oct  1 22:12:33 2016(r306565)
@@ -45,9 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define _KERNEL
 #include 
-#undef _KERNEL
 #include 
 #include 
 #include 
@@ -637,27 +635,23 @@ dumpheader(struct ktr_header *kth)
if (timestamp & TIMESTAMP_ELAPSED) {
if (prevtime_e.tv_sec == 0)
prevtime_e = kth->ktr_time;
-   timevalsub(>ktr_time, _e);
-   printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec,
-   kth->ktr_time.tv_usec);
-   timevaladd(>ktr_time, _e);
+   timersub(>ktr_time, _e, );
+   printf("%jd.%06ld ", (intmax_t)temp.tv_sec,
+   temp.tv_usec);
}
if (timestamp & TIMESTAMP_RELATIVE) {
if (prevtime.tv_sec == 0)
prevtime = kth->ktr_time;
-   temp = kth->ktr_time;
-   timevalsub(>ktr_time, );
-   if ((intmax_t)kth->ktr_time.tv_sec < 0) {
-   kth->ktr_time = prevtime;
-   prevtime = temp;
-   timevalsub(>ktr_time, );
+   if (timercmp(>ktr_time, , <)) {
+   timersub(, >ktr_time, );
sign = "-";
} else {
-   prevtime = temp;
+   timersub(>ktr_time, , );
sign = "";
}
-   printf("%s%jd.%06ld ", sign, 
(intmax_t)kth->ktr_time.tv_sec,
-   kth->ktr_time.tv_usec);
+   prevtime = kth->ktr_time;
+   printf("%s%jd.%06ld ", sign, (intmax_t)temp.tv_sec,
+   temp.tv_usec);
}
}
printf("%s  ", type);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-10-01 Thread John Baldwin
Author: jhb
Date: Sat Oct  1 22:17:40 2016
New Revision: 306566
URL: https://svnweb.freebsd.org/changeset/base/306566

Log:
  Don't declare the 'temp' timeval as static.

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

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Sat Oct  1 22:12:33 2016(r306565)
+++ head/usr.bin/kdump/kdump.c  Sat Oct  1 22:17:40 2016(r306566)
@@ -562,7 +562,8 @@ void
 dumpheader(struct ktr_header *kth)
 {
static char unknown[64];
-   static struct timeval prevtime, prevtime_e, temp;
+   static struct timeval prevtime, prevtime_e;
+   struct timeval temp;
const char *type;
const char *sign;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306567 - head/sys/dev/lmc

2016-10-01 Thread Eric van Gyzen
Author: vangyzen
Date: Sat Oct  1 22:21:10 2016
New Revision: 306567
URL: https://svnweb.freebsd.org/changeset/base/306567

Log:
  lmc(4): fix the build without the bpf device
  
  "make buildkernel" now works with and without "device bpf".
  
  Reported by:  Dave Mischler 
  MFC after:3 days
  Sponsored by: Dell EMC

Modified:
  head/sys/dev/lmc/if_lmc.c

Modified: head/sys/dev/lmc/if_lmc.c
==
--- head/sys/dev/lmc/if_lmc.c   Sat Oct  1 22:17:40 2016(r306566)
+++ head/sys/dev/lmc/if_lmc.c   Sat Oct  1 22:21:10 2016(r306567)
@@ -91,7 +91,11 @@
 # define  P2P 0/* not in FreeBSD */
 # define NSPPP 1   /* No count devices in FreeBSD 5 */
 # include "opt_bpf.h"  /* DEV_BPF */
-# define NBPFILTER DEV_BPF
+# ifdef DEV_BPF
+#  define NBPFILTER 1
+# else
+#  define NBPFILTER 0
+# endif
 # define  GEN_HDLC 0   /* not in FreeBSD */
 #
 # include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306560 - head/usr.bin/patch

2016-10-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Oct  1 20:31:00 2016
New Revision: 306560
URL: https://svnweb.freebsd.org/changeset/base/306560

Log:
  patch(1): make some macros look boolean.
  
  Minor cleanup inspired by a new patch(1) variant in schily tools.
  
  For reference:
  https://sourceforge.net/p/schillix-on/
  
  MFC after:1 week

Modified:
  head/usr.bin/patch/common.h

Modified: head/usr.bin/patch/common.h
==
--- head/usr.bin/patch/common.h Sat Oct  1 19:39:09 2016(r306559)
+++ head/usr.bin/patch/common.h Sat Oct  1 20:31:00 2016(r306560)
@@ -48,9 +48,9 @@
 /* handy definitions */
 
 #definestrNE(s1,s2) (strcmp(s1, s2))
-#definestrEQ(s1,s2) (!strcmp(s1, s2))
+#definestrEQ(s1,s2) (strcmp(s1, s2) == 0)
 #definestrnNE(s1,s2,l) (strncmp(s1, s2, l))
-#definestrnEQ(s1,s2,l) (!strncmp(s1, s2, l))
+#definestrnEQ(s1,s2,l) (strncmp(s1, s2, l) == 0)
 
 /* typedefs */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-10-01 Thread John Baldwin
Author: jhb
Date: Sat Oct  1 22:03:41 2016
New Revision: 306563
URL: https://svnweb.freebsd.org/changeset/base/306563

Log:
  Decode arguments to truncate and ftruncate.
  
  In particular, decode the off_t argument as a 64-bit argument to fix
  decoding for 32-bit processes.

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

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Sat Oct  1 22:01:41 2016(r306562)
+++ head/usr.bin/kdump/kdump.c  Sat Oct  1 22:03:41 2016(r306563)
@@ -1341,6 +1341,12 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
}
ip++;
narg--;
+   break;
+   case SYS_ftruncate:
+   case SYS_truncate:
+   print_number(ip, narg, c);
+   print_number64(first, ip, narg, c);
+   break;
}
}
while (narg > 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-10-01 Thread John Baldwin
Author: jhb
Date: Sat Oct  1 22:01:41 2016
New Revision: 306562
URL: https://svnweb.freebsd.org/changeset/base/306562

Log:
  Handle 64-bit system call arguments (off_t, id_t).
  
  In particular, 64-bit system call arguments use up two register_t
  arguments for 32-bit processes.  They must also be aligned on a 64-bit
  boundary on 32-bit powerpc processes.  This fixes the decoding of
  lseek(), procctl(), and wait6() arguments for 32-bit processes (both
  native and via freebsd32).
  
  Note that the ktrace system call return record only returns a single
  register, so the return value of lseek is always truncated to the low
  32-bits for 32-bit processes.

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

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Sat Oct  1 20:46:01 2016(r306561)
+++ head/usr.bin/kdump/kdump.c  Sat Oct  1 22:01:41 2016(r306562)
@@ -74,6 +74,7 @@ extern int errno;
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -132,6 +133,27 @@ static struct ktr_header ktr_header;
 #define TIME_FORMAT"%b %e %T %Y"
 #define eqs(s1, s2)(strcmp((s1), (s2)) == 0)
 
+#defineprint_number64(first,i,n,c) do {
\
+   uint64_t __v;   \
+   \
+   if (quad_align && (((ptrdiff_t)((i) - (first))) & 1) == 1) {\
+   (i)++;  \
+   (n)--;  \
+   }   \
+   if (quad_slots == 2)\
+   __v = (uint64_t)(uint32_t)(i)[0] |  \
+   ((uint64_t)(uint32_t)(i)[1]) << 32; \
+   else\
+   __v = (uint64_t)*(i);   \
+   if (decimal)\
+   printf("%c%jd", (c), (intmax_t)__v);\
+   else\
+   printf("%c%#jx", (c), (uintmax_t)__v);  \
+   (i) += quad_slots;  \
+   (n) -= quad_slots;  \
+   (c) = ',';  \
+} while (0)
+
 #define print_number(i,n,c) do {   \
if (decimal)\
printf("%c%jd", c, (intmax_t)*i);   \
@@ -705,16 +727,25 @@ void
 ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags)
 {
int narg = ktr->ktr_narg;
-   register_t *ip;
+   register_t *ip, *first;
intmax_t arg;
+   int quad_align, quad_slots;
 
syscallname(ktr->ktr_code, sv_flags);
-   ip = >ktr_args[0];
+   ip = first = >ktr_args[0];
if (narg) {
char c = '(';
if (fancy &&
(sv_flags == 0 ||
(sv_flags & SV_ABI_MASK) == SV_ABI_FREEBSD)) {
+   quad_align = 0;
+   if (sv_flags & SV_ILP32) {
+#ifdef __powerpc__
+   quad_align = 1;
+#endif
+   quad_slots = 2;
+   } else
+   quad_slots = 1;
switch (ktr->ktr_code) {
case SYS_bindat:
case SYS_connectat:
@@ -796,7 +827,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
c = ',';
ip++;
narg--;
-   print_number(ip, narg, c);
+   print_number64(first, ip, narg, c);
print_number(ip, narg, c);
putchar(',');
wait6optname(*ip);
@@ -996,7 +1027,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
print_number(ip, narg, c);
/* Hidden 'pad' argument, not in lseek(2) */
print_number(ip, narg, c);
-   print_number(ip, narg, c);
+   print_number64(first, ip, narg, c);
putchar(',');
whencename(*ip);
ip++;
@@ -1005,8 +1036,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
 #endif
case SYS_lseek:
print_number(ip, narg, c);
-  

svn commit: r306557 - head/sys/arm/broadcom/bcm2835

2016-10-01 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Oct  1 17:57:32 2016
New Revision: 306557
URL: https://svnweb.freebsd.org/changeset/base/306557

Log:
  Use VM_MEMATTR_WRITE_COMBINING memattr for mmap(2) on framebuffer
  
  VM_MEMATTR_WRITE_COMBINING sets write-through cache flag for framebuffer
  memory that prevents pixel data from being stuck in cache until evicition
  happens

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Sat Oct  1 17:48:41 2016
(r306556)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Sat Oct  1 17:57:32 2016
(r306557)
@@ -113,6 +113,8 @@ bcm_fb_setup_fbd(struct bcmsc_softc *sc)
sc->info.fb_stride = fb.pitch;
sc->info.fb_width = fb.xres;
sc->info.fb_height = fb.yres;
+   sc->info.fb_flags = FB_FLAG_MEMATTR;
+   sc->info.fb_memattr = VM_MEMATTR_WRITE_COMBINING;
 
if (sc->fbswap) {
switch (sc->info.fb_bpp) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306555 - in head/sys: dev/fb sys

2016-10-01 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Oct  1 17:43:02 2016
New Revision: 306555
URL: https://svnweb.freebsd.org/changeset/base/306555

Log:
  Provide way for framebuffer driver to request mmap(2) mapping type
  
  On ARM if memattr is not overriden mmap(2) maps framebuffer
  memory as WBWA which means part of changes to content in userland
  end up in cache and appear on screen gradually as cache lines are
  evicted. This change adds configurable memattr that hardware fb
  implementation can set to get the memory mapping type it
  requires:
  
  - Add new flag FB_FLAG_MEMATTR that indicates that framebuffer
  driver overrides default memattr
  - Add new field fb_memattr to struct fb_info to specify requested
  memattr
  
  Reviewed by:  ray
  Differential Revision:https://reviews.freebsd.org/D8064

Modified:
  head/sys/dev/fb/fbd.c
  head/sys/sys/fbio.h

Modified: head/sys/dev/fb/fbd.c
==
--- head/sys/dev/fb/fbd.c   Sat Oct  1 11:43:37 2016(r306554)
+++ head/sys/dev/fb/fbd.c   Sat Oct  1 17:43:02 2016(r306555)
@@ -178,6 +178,8 @@ fb_mmap(struct cdev *dev, vm_ooffset_t o
*paddr = vtophys((uint8_t *)info->fb_vbase + offset);
else
*paddr = info->fb_pbase + offset;
+   if (info->fb_flags & FB_FLAG_MEMATTR)
+   *memattr = info->fb_memattr;
return (0);
}
return (EINVAL);

Modified: head/sys/sys/fbio.h
==
--- head/sys/sys/fbio.h Sat Oct  1 11:43:37 2016(r306554)
+++ head/sys/sys/fbio.h Sat Oct  1 17:43:02 2016(r306555)
@@ -142,6 +142,8 @@ struct fb_info {
uint32_tfb_flags;
 #defineFB_FLAG_NOMMAP  1   /* mmap unsupported. */
 #defineFB_FLAG_NOWRITE 2   /* disable writes for the time 
being */
+#defineFB_FLAG_MEMATTR 4   /* override memattr for mmap */
+   vm_memattr_tfb_memattr;
int fb_stride;
int fb_bpp; /* bits per pixel */
uint32_tfb_cmap[16];
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306556 - head/sys/sys

2016-10-01 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Oct  1 17:48:41 2016
New Revision: 306556
URL: https://svnweb.freebsd.org/changeset/base/306556

Log:
  Bump _FreeBSD_version after adding fb_memattr field to fb_info in r306555

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hSat Oct  1 17:43:02 2016(r306555)
+++ head/sys/sys/param.hSat Oct  1 17:48:41 2016(r306556)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200010  /* Master, propagated to newvers */
+#define __FreeBSD_version 1200011  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306568 - head/include

2016-10-01 Thread Eric van Gyzen
Author: vangyzen
Date: Sat Oct  1 22:34:38 2016
New Revision: 306568
URL: https://svnweb.freebsd.org/changeset/base/306568

Log:
  Add the __printflike attribute to the declaration of dprintf(3)
  
  MFC after:3 days
  Sponsored by: Dell EMC

Modified:
  head/include/stdio.h

Modified: head/include/stdio.h
==
--- head/include/stdio.hSat Oct  1 22:21:10 2016(r306567)
+++ head/include/stdio.hSat Oct  1 22:34:38 2016(r306568)
@@ -359,7 +359,7 @@ int  renameat(int, const char *, int, co
 int vdprintf(int, const char * __restrict, __va_list);
 /* _WITH_GETLINE to allow pre 11 sources to build on 11+ systems */
 ssize_t getline(char ** __restrict, size_t * __restrict, FILE * 
__restrict);
-int dprintf(int, const char * __restrict, ...);
+int dprintf(int, const char * __restrict, ...) __printflike(2, 3);
 #endif /* __POSIX_VISIBLE >= 200809 */
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306569 - head/include

2016-10-01 Thread Eric van Gyzen
Author: vangyzen
Date: Sat Oct  1 23:08:26 2016
New Revision: 306569
URL: https://svnweb.freebsd.org/changeset/base/306569

Log:
  Add the __printflike attribute to the declaration of vdprintf(3)
  
  I intended to add this in r306568.
  
  MFC after:3 days
  Sponsored by: Dell EMC

Modified:
  head/include/stdio.h

Modified: head/include/stdio.h
==
--- head/include/stdio.hSat Oct  1 22:34:38 2016(r306568)
+++ head/include/stdio.hSat Oct  1 23:08:26 2016(r306569)
@@ -356,7 +356,7 @@ ssize_t  getdelim(char ** __restrict, si
FILE * __restrict);
 FILE   *open_memstream(char **, size_t *);
 int renameat(int, const char *, int, const char *);
-int vdprintf(int, const char * __restrict, __va_list);
+int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0);
 /* _WITH_GETLINE to allow pre 11 sources to build on 11+ systems */
 ssize_t getline(char ** __restrict, size_t * __restrict, FILE * 
__restrict);
 int dprintf(int, const char * __restrict, ...) __printflike(2, 3);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"