svn commit: r298734 - head/sys/compat/ndis

2016-04-27 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Apr 28 03:19:53 2016
New Revision: 298734
URL: https://svnweb.freebsd.org/changeset/base/298734

Log:
  ndis(4): it's rather unrealistic to expect a size_t here.
  
  int was actually OK, and u_int is more than enough.

Modified:
  head/sys/compat/ndis/subr_ndis.c

Modified: head/sys/compat/ndis/subr_ndis.c
==
--- head/sys/compat/ndis/subr_ndis.cThu Apr 28 02:46:08 2016
(r298733)
+++ head/sys/compat/ndis/subr_ndis.cThu Apr 28 03:19:53 2016
(r298734)
@@ -2670,7 +2670,7 @@ ndis_find_sym(lf, filename, suffix, sym)
 {
char*fullsym;
char*suf;
-   size_t  i;
+   u_int   i;
 
fullsym = ExAllocatePoolWithTag(NonPagedPool, MAXPATHLEN, 0);
if (fullsym == 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: r298733 - head/sys/netinet

2016-04-27 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Apr 28 02:46:08 2016
New Revision: 298733
URL: https://svnweb.freebsd.org/changeset/base/298733

Log:
  ipdivert: Remove unnecessary and incorrectly typed variable.
  
  In principle n is only used to carry a copy of ipi_count, which is
  unsigned, in the non-VIMAGE case, however ipi_count can be used
  directly so it is not needed at all. Removing it makes things look
  cleaner.

Modified:
  head/sys/netinet/ip_divert.c

Modified: head/sys/netinet/ip_divert.c
==
--- head/sys/netinet/ip_divert.cThu Apr 28 02:39:43 2016
(r298732)
+++ head/sys/netinet/ip_divert.cThu Apr 28 02:46:08 2016
(r298733)
@@ -765,9 +765,6 @@ static int
 div_modevent(module_t mod, int type, void *unused)
 {
int err = 0;
-#ifndef VIMAGE
-   int n;
-#endif
 
switch (type) {
case MOD_LOAD:
@@ -808,8 +805,7 @@ div_modevent(module_t mod, int type, voi
 * we destroy the lock.
 */
INP_INFO_WLOCK(_divcbinfo);
-   n = V_divcbinfo.ipi_count;
-   if (n != 0) {
+   if (V_divcbinfo.ipi_count != 0) {
err = EBUSY;
INP_INFO_WUNLOCK(_divcbinfo);
break;
___
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: r298732 - head/sys/fs/devfs

2016-04-27 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Apr 28 02:39:43 2016
New Revision: 298732
URL: https://svnweb.freebsd.org/changeset/base/298732

Log:
  sys/devfs: unsign an index to prevent signed integer overflow.
  
  cdp_maxdirent in struct:cdev_priv is of type u_int.  Use the same
  type for the corresponding index in devfs_revoke().
  
  MFC after:1 week

Modified:
  head/sys/fs/devfs/devfs_vnops.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==
--- head/sys/fs/devfs/devfs_vnops.c Thu Apr 28 01:58:56 2016
(r298731)
+++ head/sys/fs/devfs/devfs_vnops.c Thu Apr 28 02:39:43 2016
(r298732)
@@ -1444,7 +1444,7 @@ devfs_revoke(struct vop_revoke_args *ap)
struct cdev *dev;
struct cdev_priv *cdp;
struct devfs_dirent *de;
-   int i;
+   u_int i;
 
KASSERT((ap->a_flags & REVOKEALL) != 0, ("devfs_revoke !REVOKEALL"));
 
___
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: r298731 - head/sys/compat/ndis

2016-04-27 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Apr 28 01:58:56 2016
New Revision: 298731
URL: https://svnweb.freebsd.org/changeset/base/298731

Log:
  ndis(4): unsign some indexes to prevent overflows.
  
  The "len" parameter is uint32_t, indexing it with an int may
  end up in a signed integer overflow.
  
  strlen(3) returns an integer of size_t so the corresponding index should
  have that size.
  
  MFC after:1 week

Modified:
  head/sys/compat/ndis/subr_ndis.c

Modified: head/sys/compat/ndis/subr_ndis.c
==
--- head/sys/compat/ndis/subr_ndis.cThu Apr 28 01:43:18 2016
(r298730)
+++ head/sys/compat/ndis/subr_ndis.cThu Apr 28 01:58:56 2016
(r298731)
@@ -896,7 +896,7 @@ NdisReadPciSlotInformation(adapter, slot
uint32_tlen;
 {
ndis_miniport_block *block;
-   int i;
+   uint32_ti;
char*dest;
device_tdev;
 
@@ -939,7 +939,7 @@ NdisWritePciSlotInformation(adapter, slo
uint32_tlen;
 {
ndis_miniport_block *block;
-   int i;
+   uint32_ti;
char*dest;
device_tdev;
 
@@ -2432,7 +2432,7 @@ NdisReadPcmciaAttributeMemory(handle, of
bus_space_handle_t  bh;
bus_space_tag_t bt;
char*dest;
-   int i;
+   uint32_ti;
 
if (handle == NULL)
return (0);
@@ -2462,7 +2462,7 @@ NdisWritePcmciaAttributeMemory(handle, o
bus_space_handle_t  bh;
bus_space_tag_t bt;
char*src;
-   int i;
+   uint32_ti;
 
if (handle == NULL)
return (0);
@@ -2670,7 +2670,7 @@ ndis_find_sym(lf, filename, suffix, sym)
 {
char*fullsym;
char*suf;
-   int i;
+   size_t  i;
 
fullsym = ExAllocatePoolWithTag(NonPagedPool, MAXPATHLEN, 0);
if (fullsym == 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"


Re: svn commit: r298696 - head/sys/netinet

2016-04-27 Thread Sepherosa Ziehau
On Wed, Apr 27, 2016 at 11:56 PM, hiren panchasara
 wrote:
> On 04/27/16 at 09:40P, Sepherosa Ziehau wrote:
>> Author: sephe
>> Date: Wed Apr 27 09:40:55 2016
>> New Revision: 298696
>> URL: https://svnweb.freebsd.org/changeset/base/298696
>>
>> Log:
>>   tcp/lro: Fix typo.
>>
>>   MFC after:  1 week
>>   Sponsored by:   Microsoft OSTC
>>
>> Modified:
>>   head/sys/netinet/tcp_lro.c
>>
>> Modified: head/sys/netinet/tcp_lro.c
>> ==
>> --- head/sys/netinet/tcp_lro.cWed Apr 27 07:46:38 2016
>> (r298695)
>> +++ head/sys/netinet/tcp_lro.cWed Apr 27 09:40:55 2016
>> (r298696)
>> @@ -569,7 +569,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
>>   if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0)
>>   return (TCP_LRO_CANNOT);
>>
>> - /* XXX-BZ We lose a AKC|PUSH flag concatinating multiple segments. */
>> + /* XXX-BZ We lose a ACK|PUSH flag concatinating multiple segments. */
>
> Also s/concatinating /concatenating / ?

Fixed, thanks!

-- 
Tomorrow Will Never Die
___
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: r298730 - head/sys/netinet

2016-04-27 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Apr 28 01:43:18 2016
New Revision: 298730
URL: https://svnweb.freebsd.org/changeset/base/298730

Log:
  tcp/lro: Fix more typo
  
  Noticed by:   hiren
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/netinet/tcp_lro.c

Modified: head/sys/netinet/tcp_lro.c
==
--- head/sys/netinet/tcp_lro.c  Thu Apr 28 01:40:47 2016(r298729)
+++ head/sys/netinet/tcp_lro.c  Thu Apr 28 01:43:18 2016(r298730)
@@ -569,7 +569,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0)
return (TCP_LRO_CANNOT);
 
-   /* XXX-BZ We lose a ACK|PUSH flag concatinating multiple segments. */
+   /* XXX-BZ We lose a ACK|PUSH flag concatenating multiple segments. */
/* XXX-BZ Ideally we'd flush on PUSH? */
 
/*
___
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: r298729 - stable/10/usr.sbin/jail

2016-04-27 Thread Jamie Gritton
Author: jamie
Date: Thu Apr 28 01:40:47 2016
New Revision: 298729
URL: https://svnweb.freebsd.org/changeset/base/298729

Log:
  MFC r298562:
  
Make jail(8) interpret escape codes in fstab the same as getfsent(3).
  
  PR:   208663

Modified:
  stable/10/usr.sbin/jail/command.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/jail/command.c
==
--- stable/10/usr.sbin/jail/command.c   Thu Apr 28 01:31:07 2016
(r298728)
+++ stable/10/usr.sbin/jail/command.c   Thu Apr 28 01:40:47 2016
(r298729)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include "jailp.h"
 
@@ -445,8 +446,14 @@ run_command(struct cfjail *j)
strcpy(comcs, comstring->s);
argc = 0;
for (cs = strtok(comcs, " \t\f\v\r\n"); cs && argc < 4;
-cs = strtok(NULL, " \t\f\v\r\n"))
+cs = strtok(NULL, " \t\f\v\r\n")) {
+   if (argc <= 1 && strunvis(cs, cs) < 0) {
+   jail_warnx(j, "%s: %s: fstab parse error",
+   j->intparams[comparam]->name, comstring->s);
+   return -1;
+   }
argv[argc++] = cs;
+   }
if (argc == 0)
return 0;
if (argc < 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"


svn commit: r298728 - stable/10/etc/rc.d

2016-04-27 Thread Jamie Gritton
Author: jamie
Date: Thu Apr 28 01:31:07 2016
New Revision: 298728
URL: https://svnweb.freebsd.org/changeset/base/298728

Log:
  MFC r298516:
  
Don't remove the /var/run/jail_name.id file if a jail fails to start.
This messes up ezjail (and possibly others), when attempting to start
a jail that already exists.
  
  PR:   208806
  Reviewed by:  tj

Modified:
  stable/10/etc/rc.d/jail
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/etc/rc.d/jail
==
--- stable/10/etc/rc.d/jail Thu Apr 28 01:12:38 2016(r298727)
+++ stable/10/etc/rc.d/jail Thu Apr 28 01:31:07 2016(r298728)
@@ -471,7 +471,6 @@ jail_start()
if _jid=$($jail_jls -j $_j jid); then
echo "$_jid" > /var/run/jail_${_j}.id
else
-   rm -f /var/run/jail_${_j}.id
echo " cannot start jail " \
"\"${_hostname:-${_j}}\": "
fi
@@ -495,7 +494,6 @@ jail_start()
_jid=$($jail_jls -j $_j jid)
echo $_jid > /var/run/jail_${_j}.id
else
-   rm -f /var/run/jail_${_j}.id
echo " cannot start jail " \
"\"${_hostname:-${_j}}\": "
cat $_tmp
___
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: r298727 - stable/9/lib/libc/regex

2016-04-27 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Apr 28 01:12:38 2016
New Revision: 298727
URL: https://svnweb.freebsd.org/changeset/base/298727

Log:
  MFC r298521;
  regex: prevent two improbable signed integer overflows.
  
  In matcher() we used an integer to index nsub of type size_t.
  In print() we used an integer to index nstates of type sopno,
  typedef'd long.
  In both cases the indexes never take negative values.
  
  Match the types to avoid any error.

Modified:
  stable/9/lib/libc/regex/engine.c
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/regex/engine.c
==
--- stable/9/lib/libc/regex/engine.cThu Apr 28 01:11:25 2016
(r298726)
+++ stable/9/lib/libc/regex/engine.cThu Apr 28 01:12:38 2016
(r298727)
@@ -154,7 +154,7 @@ matcher(struct re_guts *g,
int eflags)
 {
const char *endp;
-   int i;
+   size_t i;
struct match mv;
struct match *m = 
const char *dp;
@@ -1108,7 +1108,7 @@ print(struct match *m,
FILE *d)
 {
struct re_guts *g = m->g;
-   int i;
+   sopno i;
int first = 1;
 
if (!(m->eflags_TRACE))
___
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: r298726 - stable/10/lib/libc/regex

2016-04-27 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Apr 28 01:11:25 2016
New Revision: 298726
URL: https://svnweb.freebsd.org/changeset/base/298726

Log:
  MFC r298521;
  regex: prevent two improbable signed integer overflows.
  
  In matcher() we used an integer to index nsub of type size_t.
  In print() we used an integer to index nstates of type sopno,
  typedef'd long.
  In both cases the indexes never take negative values.
  
  Match the types to avoid any error.

Modified:
  stable/10/lib/libc/regex/engine.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/regex/engine.c
==
--- stable/10/lib/libc/regex/engine.c   Thu Apr 28 01:05:40 2016
(r298725)
+++ stable/10/lib/libc/regex/engine.c   Thu Apr 28 01:11:25 2016
(r298726)
@@ -154,7 +154,7 @@ matcher(struct re_guts *g,
int eflags)
 {
const char *endp;
-   int i;
+   size_t i;
struct match mv;
struct match *m = 
const char *dp;
@@ -1108,7 +1108,7 @@ print(struct match *m,
FILE *d)
 {
struct re_guts *g = m->g;
-   int i;
+   sopno i;
int first = 1;
 
if (!(m->eflags_TRACE))
___
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: r298725 - stable/10/sys/fs/ext2fs

2016-04-27 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Apr 28 01:05:40 2016
New Revision: 298725
URL: https://svnweb.freebsd.org/changeset/base/298725

Log:
  MFC r298518:
  ext2_htree_release(): prevent signed integer overflow in a loop.
  
  h_levels_num, as most data structs in ext2fs, is unsigned so
  the index that addresses it has to be unsigned as well.
  
  To get to overflow here we would probably be considering a
  degenerate case though.
  
  MFC after:5 days

Modified:
  stable/10/sys/fs/ext2fs/ext2_htree.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/ext2fs/ext2_htree.c
==
--- stable/10/sys/fs/ext2fs/ext2_htree.cWed Apr 27 23:04:42 2016
(r298724)
+++ stable/10/sys/fs/ext2fs/ext2_htree.cThu Apr 28 01:05:40 2016
(r298725)
@@ -191,7 +191,7 @@ ext2_htree_set_limit(struct ext2fs_htree
 static void
 ext2_htree_release(struct ext2fs_htree_lookup_info *info)
 {
-   int i;
+   u_int i;
 
for (i = 0; i < info->h_levels_num; i++) {
struct buf *bp = info->h_levels[i].h_bp;
___
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: r298724 - stable/10/usr.sbin/bhyve

2016-04-27 Thread John Baldwin
Author: jhb
Date: Wed Apr 27 23:04:42 2016
New Revision: 298724
URL: https://svnweb.freebsd.org/changeset/base/298724

Log:
  MFC 297932,298295:
  Improvements for PCI passthru devices.
  
  297932:
  Handle PBA that shares a page with MSI-X table for passthrough devices.
  
  If the PBA shares a page with the MSI-X table, map the shared page via
  /dev/mem and emulate accesses to the portion of the PBA in the shared
  page by accessing the mapped page.
  
  298295:
  Always emit an error message on passthru configuration errors.
  
  Previously, many errors (such as the PCI device not being attached
  to the ppt(4) driver) resulted in bhyve silently exiting without
  starting the virtual machine.  Now any errors encountered when
  configuring a virtual slot for a PCI passthru device should be noted
  on stderr.

Modified:
  stable/10/usr.sbin/bhyve/pci_emul.h
  stable/10/usr.sbin/bhyve/pci_passthru.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bhyve/pci_emul.h
==
--- stable/10/usr.sbin/bhyve/pci_emul.h Wed Apr 27 21:51:24 2016
(r298723)
+++ stable/10/usr.sbin/bhyve/pci_emul.h Wed Apr 27 23:04:42 2016
(r298724)
@@ -142,6 +142,8 @@ struct pci_devinst {
int pba_size;
int function_mask;  
struct msix_table_entry *table; /* allocated at runtime */
+   void*pba_page;
+   int pba_page_offset;
} pi_msix;
 
void  *pi_arg;  /* devemu-private data */

Modified: stable/10/usr.sbin/bhyve/pci_passthru.c
==
--- stable/10/usr.sbin/bhyve/pci_passthru.c Wed Apr 27 21:51:24 2016
(r298723)
+++ stable/10/usr.sbin/bhyve/pci_passthru.c Wed Apr 27 23:04:42 2016
(r298724)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -42,7 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -59,6 +60,10 @@ __FBSDID("$FreeBSD$");
 #define_PATH_DEVIO "/dev/io"
 #endif
 
+#ifndef _PATH_MEM
+#define_PATH_MEM   "/dev/mem"
+#endif
+
 #defineLEGACY_SUPPORT  1
 
 #define MSIX_TABLE_COUNT(ctrl) (((ctrl) & PCIM_MSIXCTRL_TABLE_SIZE) + 1)
@@ -66,6 +71,7 @@ __FBSDID("$FreeBSD$");
 
 static int pcifd = -1;
 static int iofd = -1;
+static int memfd = -1;
 
 struct passthru_softc {
struct pci_devinst *psc_pi;
@@ -279,6 +285,35 @@ msix_table_read(struct passthru_softc *s
int index;
 
pi = sc->psc_pi;
+   if (offset >= pi->pi_msix.pba_offset &&
+   offset < pi->pi_msix.pba_offset + pi->pi_msix.pba_size) {
+   switch(size) {
+   case 1:
+   src8 = (uint8_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   data = *src8;
+   break;
+   case 2:
+   src16 = (uint16_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   data = *src16;
+   break;
+   case 4:
+   src32 = (uint32_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   data = *src32;
+   break;
+   case 8:
+   src64 = (uint64_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   data = *src64;
+   break;
+   default:
+   return (-1);
+   }
+   return (data);
+   }
+
if (offset < pi->pi_msix.table_offset)
return (-1);
 
@@ -320,12 +355,44 @@ msix_table_write(struct vmctx *ctx, int 
 {
struct pci_devinst *pi;
struct msix_table_entry *entry;
-   uint32_t *dest;
+   uint8_t *dest8;
+   uint16_t *dest16;
+   uint32_t *dest32;
+   uint64_t *dest64;
size_t entry_offset;
uint32_t vector_control;
int error, index;
 
pi = sc->psc_pi;
+   if (offset >= pi->pi_msix.pba_offset &&
+   offset < pi->pi_msix.pba_offset + pi->pi_msix.pba_size) {
+   switch(size) {
+   case 1:
+   dest8 = (uint8_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   *dest8 = data;
+   break;
+   case 2:
+   dest16 = (uint16_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   *dest16 = data;
+   break;
+   case 4:
+ 

svn commit: r298723 - head/sys/vm

2016-04-27 Thread John Baldwin
Author: jhb
Date: Wed Apr 27 21:51:24 2016
New Revision: 298723
URL: https://svnweb.freebsd.org/changeset/base/298723

Log:
  Trim redundant message.
  
  WITNESS_WARN() appends "with non-sleepable lock" to the caller's message.
  
  Sponsored by: Chelsio Communications

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==
--- head/sys/vm/vm_map.cWed Apr 27 21:12:05 2016(r298722)
+++ head/sys/vm/vm_map.cWed Apr 27 21:51:24 2016(r298723)
@@ -345,7 +345,7 @@ vmspace_free(struct vmspace *vm)
 {
 
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
-   "vmspace_free() called with non-sleepable lock held");
+   "vmspace_free() called");
 
if (vm->vm_refcnt == 0)
panic("vmspace_free: attempt to free already freed vmspace");
___
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: r298722 - head/sys/dev/acpica

2016-04-27 Thread John Baldwin
Author: jhb
Date: Wed Apr 27 21:12:05 2016
New Revision: 298722
URL: https://svnweb.freebsd.org/changeset/base/298722

Log:
  Adjust prototypes for NUMA-related functions to match the style of the
  rest of this file.

Modified:
  head/sys/dev/acpica/acpivar.h

Modified: head/sys/dev/acpica/acpivar.h
==
--- head/sys/dev/acpica/acpivar.h   Wed Apr 27 20:49:57 2016
(r298721)
+++ head/sys/dev/acpica/acpivar.h   Wed Apr 27 21:12:05 2016
(r298722)
@@ -505,9 +505,9 @@ SYSCTL_DECL(_debug_acpi);
  *
  * Returns the VM domain ID if found, or -1 if not found / invalid.
  */
-extern int acpi_map_pxm_to_vm_domainid(int pxm);
-extern int acpi_get_domain(device_t dev, device_t child, int *domain);
-extern int acpi_parse_pxm(device_t dev, int *domain);
+intacpi_map_pxm_to_vm_domainid(int pxm);
+intacpi_get_domain(device_t dev, device_t child, int *domain);
+intacpi_parse_pxm(device_t dev, int *domain);
 
 #endif /* _KERNEL */
 #endif /* !_ACPIVAR_H_ */
___
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: r298721 - head/sys/arm/allwinner

2016-04-27 Thread Emmanuel Vadot
Author: manu
Date: Wed Apr 27 20:49:57 2016
New Revision: 298721
URL: https://svnweb.freebsd.org/changeset/base/298721

Log:
  Add support for the Non-maskable interrupt driver found in the Allwinner A20 
and A31 SoCs.
  This is normally used for the PMU.
  
  Reviewed by:  andrew
  Approved by:  andrew (mentor)
  Differential Revision:https://reviews.freebsd.org/D5663

Added:
  head/sys/arm/allwinner/aw_nmi.c   (contents, props changed)
Modified:
  head/sys/arm/allwinner/files.allwinner

Added: head/sys/arm/allwinner/aw_nmi.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/allwinner/aw_nmi.c Wed Apr 27 20:49:57 2016
(r298721)
@@ -0,0 +1,396 @@
+/*-
+ * Copyright (c) 2016 Emmanuel Vadot 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, 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 THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "opt_platform.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "pic_if.h"
+
+#defineNMI_IRQ_CTRL_REG0x0
+#define NMI_IRQ_LOW_LEVEL  0x0
+#define NMI_IRQ_LOW_EDGE   0x1
+#define NMI_IRQ_HIGH_LEVEL 0x2
+#define NMI_IRQ_HIGH_EDGE  0x3
+#defineNMI_IRQ_PENDING_REG 0x4
+#define NMI_IRQ_ACK(1U << 0)
+#defineA20_NMI_IRQ_ENABLE_REG  0x8
+#defineA31_NMI_IRQ_ENABLE_REG  0x34
+#define NMI_IRQ_ENABLE (1U << 0)
+
+#defineSC_NMI_READ(_sc, _reg)  bus_read_4(_sc->res[0], _reg)
+#defineSC_NMI_WRITE(_sc, _reg, _val)   bus_write_4(_sc->res[0], _reg, 
_val)
+
+static struct resource_spec aw_nmi_res_spec[] = {
+   { SYS_RES_MEMORY,   0,  RF_ACTIVE },
+   { SYS_RES_IRQ,  0,  RF_ACTIVE },
+   { -1,   0,  0 }
+};
+
+struct aw_nmi_intr {
+   struct intr_irqsrc  isrc;
+   u_int   irq;
+   enum intr_polarity  pol;
+   enum intr_trigger   tri;
+};
+
+struct aw_nmi_softc {
+   device_tdev;
+   struct resource *   res[2];
+   void *  intrcookie;
+   struct aw_nmi_intr  intr;
+   uint8_t enable_reg;
+};
+
+#defineA20_NMI 1
+#defineA31_NMI 2
+
+static struct ofw_compat_data compat_data[] = {
+   {"allwinner,sun7i-a20-sc-nmi", A20_NMI},
+   {"allwinner,sun6i-a31-sc-nmi", A31_NMI},
+
+   {NULL, 0},
+};
+
+static int
+aw_nmi_intr(void *arg)
+{
+   struct aw_nmi_softc *sc;
+
+   sc = arg;
+
+   if (SC_NMI_READ(sc, NMI_IRQ_PENDING_REG) == 0) {
+   device_printf(sc->dev, "Spurious interrupt\n");
+   return (FILTER_HANDLED);
+   }
+
+   if (intr_isrc_dispatch(>intr.isrc, curthread->td_intr_frame) != 0) {
+   SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE);
+   device_printf(sc->dev, "Stray interrupt, NMI disabled\n");
+   }
+
+   return (FILTER_HANDLED);
+}
+
+static void
+aw_nmi_enable_intr(device_t dev, struct intr_irqsrc *isrc)
+{
+   struct aw_nmi_softc *sc;
+
+   sc = device_get_softc(dev);
+
+   SC_NMI_WRITE(sc, sc->enable_reg, NMI_IRQ_ENABLE);
+}
+
+static void
+aw_nmi_disable_intr(device_t dev, struct intr_irqsrc *isrc)
+{
+   struct aw_nmi_softc *sc;
+
+   sc = device_get_softc(dev);
+
+   SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE);
+}
+
+static int
+aw_nmi_map_fdt(device_t dev, u_int ncells, pcell_t *cells, u_int *irqp,
+enum intr_polarity *polp, enum intr_trigger 

Re: svn commit: r298714 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compo

2016-04-27 Thread Jung-uk Kim
On 04/27/16 04:24 PM, Ngie Cooper wrote:
> On Wed, Apr 27, 2016 at 12:09 PM, Jung-uk Kim  wrote:
>> Author: jkim
>> Date: Wed Apr 27 19:09:21 2016
>> New Revision: 298714
>> URL: https://svnweb.freebsd.org/changeset/base/298714
>>
>> Log:
>>   Merge ACPICA 20160422.
> 
> This broke i386: 
> https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/2980/console

Fixed.  Sorry.

Jung-uk Kim



signature.asc
Description: OpenPGP digital signature


svn commit: r298720 - head/sys/contrib/dev/acpica/include

2016-04-27 Thread Jung-uk Kim
Author: jkim
Date: Wed Apr 27 20:24:48 2016
New Revision: 298720
URL: https://svnweb.freebsd.org/changeset/base/298720

Log:
  Fix build without ACPI_DEBUG.

Modified:
  head/sys/contrib/dev/acpica/include/acoutput.h

Modified: head/sys/contrib/dev/acpica/include/acoutput.h
==
--- head/sys/contrib/dev/acpica/include/acoutput.h  Wed Apr 27 20:12:16 
2016(r298719)
+++ head/sys/contrib/dev/acpica/include/acoutput.h  Wed Apr 27 20:24:48 
2016(r298720)
@@ -489,6 +489,7 @@
 #define return_VOID return
 #define return_ACPI_STATUS(s)   return(s)
 #define return_PTR(s)   return(s)
+#define return_STR(s)   return(s)
 #define return_VALUE(s) return(s)
 #define return_UINT8(s) return(s)
 #define return_UINT32(s)return(s)
___
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"


Re: svn commit: r298714 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compo

2016-04-27 Thread Ngie Cooper
On Wed, Apr 27, 2016 at 12:09 PM, Jung-uk Kim  wrote:
> Author: jkim
> Date: Wed Apr 27 19:09:21 2016
> New Revision: 298714
> URL: https://svnweb.freebsd.org/changeset/base/298714
>
> Log:
>   Merge ACPICA 20160422.

This broke i386: https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/2980/console
___
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: r298717 - head/sys/dev/pci

2016-04-27 Thread John Baldwin
Author: jhb
Date: Wed Apr 27 19:54:56 2016
New Revision: 298717
URL: https://svnweb.freebsd.org/changeset/base/298717

Log:
  Fix build for systems without PCI_RES_BUS.
  
  Submitted by: vangyzen

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

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Wed Apr 27 19:38:24 2016(r298716)
+++ head/sys/dev/pci/pci.c  Wed Apr 27 19:54:56 2016(r298717)
@@ -4150,8 +4150,8 @@ pci_detach(device_t dev)
error = bus_generic_detach(dev);
if (error)
return (error);
-   sc = device_get_softc(dev);
 #ifdef PCI_RES_BUS
+   sc = device_get_softc(dev);
error = bus_release_resource(dev, PCI_RES_BUS, 0, sc->sc_bus);
if (error)
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"


Re: svn commit: r298712 - in head/sys: dev/cardbus kern mips/nlm powerpc/ofw sparc64/pci sys

2016-04-27 Thread Marius Strobl
On Wed, Apr 27, 2016 at 10:54:42AM -0700, John Baldwin wrote:
> On Wednesday, April 27, 2016 05:49:42 PM John Baldwin wrote:
> > Author: jhb
> > Date: Wed Apr 27 17:49:42 2016
> > New Revision: 298712
> > URL: https://svnweb.freebsd.org/changeset/base/298712
> > 
> > Log:
> >   Add a bus_null_rescan() method that always fails with an error.
> >   
> >   Use this in place of kobj_error_method to disable BUS_RESCAN() on
> >   PCI drivers that do not use the "standard" scanning algorithm.
> 
> This should fix the build.
> 
> > Modified:
> >   head/sys/dev/cardbus/cardbus.c
> >   head/sys/kern/subr_bus.c
> >   head/sys/mips/nlm/xlp_pci.c
> >   head/sys/powerpc/ofw/ofw_pcibus.c
> >   head/sys/sparc64/pci/ofw_pcibus.c
> >   head/sys/sys/bus.h
> 
> Note that some of these drivers could be changed to use the "standard"
> scanning algorithm and support rescans if they moved some of their custom
> scanning logic into a pci_child_added callback.  This is generally true of
> all but cardbus except that the OFW busses use the OFW tree to drive
> scanning (so it seems they will add PCI devices that don't appear valid to
> a PCI scan but are in the OFW tree).

As for sparc64, the latter isn't true AFAICT, i. e. all PCI devices
added based on information obtained from the device tree should also
be found with the "standard" scanning method (apart from 2 or 3 known
dupes with partially incomplete information in the known device trees;
these nodes are skipped, though). Actually, IIRC "standard" PCI device
scanning is how things worked before the OFW_NEWPCI code was added in
r117119. However, OFW information is used for enumerating PCI busses
and devices since then so the order within FreeBSD matches connector/
port markings on chassis and add-on cards (i. e. on-board MACs end up
as bge[0-3], an add-on card gets bge4, analogous for multi-port cards,
same for HBAs etc.), which previously wasn't the case with "standard"
scanning. So what could work for sparc64 is to do a first pass still
based on OFW information and then a second one using the "standard"
scanning method, especially in the rescan case. However, given that
at least some sun4u models support PCI hot-plug it's also not totally
unthinkable that OFW nodes for PCI devices will be added/removed on
the fly; so far I just wasn't adventurous enough to give that a try,
though.

Marius

___
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: r298716 - head/sys/modules/acpi

2016-04-27 Thread Jung-uk Kim
Author: jkim
Date: Wed Apr 27 19:38:24 2016
New Revision: 298716
URL: https://svnweb.freebsd.org/changeset/base/298716

Log:
  Sort SUBDIR.

Modified:
  head/sys/modules/acpi/Makefile

Modified: head/sys/modules/acpi/Makefile
==
--- head/sys/modules/acpi/Makefile  Wed Apr 27 19:12:49 2016
(r298715)
+++ head/sys/modules/acpi/Makefile  Wed Apr 27 19:38:24 2016
(r298716)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
-SUBDIR=acpi_asus acpi_asus_wmi acpi_fujitsu acpi_hp acpi_ibm   
\
-   acpi_panasonic acpi_sony acpi_toshiba acpi_video\
-   acpi_dock acpi_wmi aibs
+SUBDIR=acpi_asus acpi_asus_wmi acpi_dock acpi_fujitsu acpi_hp  
\
+   acpi_ibm acpi_panasonic acpi_sony acpi_toshiba  \
+   acpi_video acpi_wmi aibs
 
 .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: r298715 - stable/10/sys/x86/x86

2016-04-27 Thread John Baldwin
Author: jhb
Date: Wed Apr 27 19:12:49 2016
New Revision: 298715
URL: https://svnweb.freebsd.org/changeset/base/298715

Log:
  MFC 297039,297374,297398,297484:
  Poll the IPI status while waiting constantly instead of delaying
  5 microseconds between checks.  This avoids inserting a minimum
  latency of 5 microseconds on each IPI.
  
  297039:
  Check IPI status more frequently when waiting.
  
  An IPI cannot be sent via the local APIC if a previous IPI is still
  being delivered.  Attempts to send an IPI will wait for a pending IPI
  to clear.  Prior to r278325 these checks used a spin loop with a
  hardcoded maximum count which broke AP startup on some systems.
  However, r278325 also enforced a minimum latency of 5 microseconds if an
  IPI was still pending which resulted in a measurable performance hit.
  This change reduces that minimum latency to 1 microsecond.
  
  297374:
  Calibrate the frequency of the of the native_lapic_ipi_wait() loop,
  and avoid a delay while waiting for IPI delivery acknowledgement in
  xAPIC mode.  This makes the loop exit immediately after the delivery
  bit in APIC_ICR register is set, instead of waiting for some
  microseconds.
  
  We only need to ensure that some amount of time is allowed for the
  LAPIC to react to the command, and we need that the wait time is
  finite and reasonable.  For that reasons, it is irrelevant if the CPU
  frequency or throttling decrease the speed and make the loop,
  calibrated for full CPU speed at boot time, execute somewhat slower.
  
  297398:
  Fix several bugs in r297374:
  - fix UP build [1]
  - do not obliterate initial reading of rdtsc by the loop counter [2]
  - restore the meaning of the argument -1 to native_lapic_ipi_wait()
as wait until LAPIC acknowledge without timeout
  - correct formula for calculating loop iteration count for 1us, it was
inverted, and ensure that even on unlikely slow CPUs at least one
check for ack is performed.
  
  297484:
  Style(9), use tabs for the #define LOOPS line.
  Print unsigned values with %u.
  Make code slightly more compact by inlining loop limit.

Modified:
  stable/10/sys/x86/x86/local_apic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/x86/x86/local_apic.c
==
--- stable/10/sys/x86/x86/local_apic.c  Wed Apr 27 19:09:21 2016
(r298714)
+++ stable/10/sys/x86/x86/local_apic.c  Wed Apr 27 19:12:49 2016
(r298715)
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -158,6 +159,9 @@ volatile lapic_t *lapic;
 vm_paddr_t lapic_paddr;
 static u_long lapic_timer_divisor;
 static struct eventtimer lapic_et;
+#ifdef SMP
+static uint64_t lapic_ipi_wait_mult;
+#endif
 
 static voidlapic_enable(void);
 static voidlapic_resume(struct pic *pic, bool suspend_cancelled);
@@ -221,6 +225,9 @@ lvt_mode(struct lapic *la, u_int pin, ui
 void
 lapic_init(vm_paddr_t addr)
 {
+#ifdef SMP
+   uint64_t r, r1, r2, rx;
+#endif
u_int regs[4];
int i, arat;
 
@@ -275,6 +282,38 @@ lapic_init(vm_paddr_t addr)
lapic_et.et_priv = NULL;
et_register(_et);
}
+
+#ifdef SMP
+#defineLOOPS   100
+   /*
+* Calibrate the busy loop waiting for IPI ack in xAPIC mode.
+* lapic_ipi_wait_mult contains the number of iterations which
+* approximately delay execution for 1 microsecond (the
+* argument to native_lapic_ipi_wait() is in microseconds).
+*
+* We assume that TSC is present and already measured.
+* Possible TSC frequency jumps are irrelevant to the
+* calibration loop below, the CPU clock management code is
+* not yet started, and we do not enter sleep states.
+*/
+   KASSERT((cpu_feature & CPUID_TSC) != 0 && tsc_freq != 0,
+   ("TSC not initialized"));
+   r = rdtsc();
+   for (rx = 0; rx < LOOPS; rx++) {
+   (void)lapic->icr_lo;
+   ia32_pause();
+   }
+   r = rdtsc() - r;
+   r1 = tsc_freq * LOOPS;
+   r2 = r * 100;
+   lapic_ipi_wait_mult = r1 >= r2 ? r1 / r2 : 1;
+   if (bootverbose) {
+   printf("LAPIC: ipi_wait() us multiplier %ju (r %ju tsc %ju)\n",
+   (uintmax_t)lapic_ipi_wait_mult, (uintmax_t)r,
+   (uintmax_t)tsc_freq);
+   }
+#undef LOOPS
+#endif /* SMP */
 }
 
 /*
@@ -1381,25 +1420,20 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_O
  * private to the MD code.  The public interface for the rest of the
  * kernel is defined in mp_machdep.c.
  */
+
+/*
+ * Wait delay microseconds for IPI to be sent.  If delay is -1, we
+ * wait forever.
+ */
 int
 lapic_ipi_wait(int delay)
 {
-   int x;
-
-   /*
-* Wait delay microseconds for IPI to be sent.  If delay is
-* -1, we wait forever.
-*/
-   if (delay == -1) {
-   

svn commit: r298714 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon...

2016-04-27 Thread Jung-uk Kim
Author: jkim
Date: Wed Apr 27 19:09:21 2016
New Revision: 298714
URL: https://svnweb.freebsd.org/changeset/base/298714

Log:
  Merge ACPICA 20160422.

Added:
  head/sys/contrib/dev/acpica/common/acfileio.c
 - copied, changed from r291333, 
vendor-sys/acpica/dist/source/common/acfileio.c
  head/sys/contrib/dev/acpica/common/dmtables.c
 - copied, changed from r291333, 
vendor-sys/acpica/dist/source/common/dmtables.c
  head/sys/contrib/dev/acpica/compiler/aslcstyle.y
 - copied, changed from r288425, 
vendor-sys/acpica/dist/source/compiler/aslcstyle.y
  head/sys/contrib/dev/acpica/compiler/asldebug.c   (contents, props changed)
 - copied, changed from r295571, 
vendor-sys/acpica/dist/source/compiler/asldebug.c
  head/sys/contrib/dev/acpica/compiler/aslexternal.c   (contents, props changed)
 - copied, changed from r295571, 
vendor-sys/acpica/dist/source/compiler/aslexternal.c
  head/sys/contrib/dev/acpica/compiler/aslpld.c
 - copied, changed from r297044, 
vendor-sys/acpica/dist/source/compiler/aslpld.c
  head/sys/contrib/dev/acpica/compiler/aslresources.y
 - copied, changed from r288425, 
vendor-sys/acpica/dist/source/compiler/aslresources.y
  head/sys/contrib/dev/acpica/compiler/aslxrefout.c   (contents, props changed)
 - copied, changed from r295571, 
vendor-sys/acpica/dist/source/compiler/aslxrefout.c
  head/sys/contrib/dev/acpica/compiler/dttable1.c
 - copied, changed from r291333, 
vendor-sys/acpica/dist/source/compiler/dttable1.c
  head/sys/contrib/dev/acpica/compiler/dttable2.c
 - copied, changed from r291333, 
vendor-sys/acpica/dist/source/compiler/dttable2.c
  head/sys/contrib/dev/acpica/components/executer/exconcat.c
 - copied, changed from r297044, 
vendor-sys/acpica/dist/source/components/executer/exconcat.c
  head/sys/contrib/dev/acpica/components/executer/extrace.c
 - copied, changed from r291333, 
vendor-sys/acpica/dist/source/components/executer/extrace.c
  head/sys/contrib/dev/acpica/components/utilities/utascii.c   (contents, props 
changed)
 - copied, changed from r298595, 
vendor-sys/acpica/dist/source/components/utilities/utascii.c
  head/sys/libkern/strncat.c   (contents, props changed)
Deleted:
  head/sys/contrib/dev/acpica/components/utilities/utfileio.c
Modified:
  head/sys/conf/files
  head/sys/contrib/dev/acpica/acpica_prep.sh
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/common/acgetline.c
  head/sys/contrib/dev/acpica/common/adfile.c
  head/sys/contrib/dev/acpica/common/adisasm.c
  head/sys/contrib/dev/acpica/common/adwalk.c
  head/sys/contrib/dev/acpica/common/ahids.c
  head/sys/contrib/dev/acpica/common/ahpredef.c
  head/sys/contrib/dev/acpica/common/ahtable.c
  head/sys/contrib/dev/acpica/common/ahuuids.c
  head/sys/contrib/dev/acpica/common/cmfsize.c
  head/sys/contrib/dev/acpica/common/dmextern.c
  head/sys/contrib/dev/acpica/common/dmrestag.c
  head/sys/contrib/dev/acpica/common/dmtable.c
  head/sys/contrib/dev/acpica/common/dmtbdump.c
  head/sys/contrib/dev/acpica/common/dmtbinfo.c
  head/sys/contrib/dev/acpica/common/getopt.c
  head/sys/contrib/dev/acpica/compiler/aslanalyze.c
  head/sys/contrib/dev/acpica/compiler/aslascii.c
  head/sys/contrib/dev/acpica/compiler/aslbtypes.c
  head/sys/contrib/dev/acpica/compiler/aslcodegen.c
  head/sys/contrib/dev/acpica/compiler/aslcompile.c
  head/sys/contrib/dev/acpica/compiler/aslcompiler.h
  head/sys/contrib/dev/acpica/compiler/aslcompiler.l
  head/sys/contrib/dev/acpica/compiler/asldefine.h
  head/sys/contrib/dev/acpica/compiler/aslerror.c
  head/sys/contrib/dev/acpica/compiler/aslfileio.c
  head/sys/contrib/dev/acpica/compiler/aslfiles.c
  head/sys/contrib/dev/acpica/compiler/aslfold.c
  head/sys/contrib/dev/acpica/compiler/aslglobal.h
  head/sys/contrib/dev/acpica/compiler/aslhex.c
  head/sys/contrib/dev/acpica/compiler/asllength.c
  head/sys/contrib/dev/acpica/compiler/asllisting.c
  head/sys/contrib/dev/acpica/compiler/asllistsup.c
  head/sys/contrib/dev/acpica/compiler/aslload.c
  head/sys/contrib/dev/acpica/compiler/asllookup.c
  head/sys/contrib/dev/acpica/compiler/aslmain.c
  head/sys/contrib/dev/acpica/compiler/aslmap.c
  head/sys/contrib/dev/acpica/compiler/aslmapenter.c
  head/sys/contrib/dev/acpica/compiler/aslmapoutput.c
  head/sys/contrib/dev/acpica/compiler/aslmaputils.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.h
  head/sys/contrib/dev/acpica/compiler/aslmethod.c
  head/sys/contrib/dev/acpica/compiler/aslnamesp.c
  head/sys/contrib/dev/acpica/compiler/asloffset.c
  head/sys/contrib/dev/acpica/compiler/aslopcodes.c
  head/sys/contrib/dev/acpica/compiler/asloperands.c
  head/sys/contrib/dev/acpica/compiler/aslopt.c
  head/sys/contrib/dev/acpica/compiler/asloptions.c
  head/sys/contrib/dev/acpica/compiler/aslparser.y
  head/sys/contrib/dev/acpica/compiler/aslpredef.c
  head/sys/contrib/dev/acpica/compiler/aslprepkg.c
  head/sys/contrib/dev/acpica/compiler/aslprintf.c
  

svn commit: r298713 - head/sys/netinet

2016-04-27 Thread Michael Tuexen
Author: tuexen
Date: Wed Apr 27 18:58:47 2016
New Revision: 298713
URL: https://svnweb.freebsd.org/changeset/base/298713

Log:
  Don't use the control argument after calling sctp_add_to_readq().
  This breaks the userland stack. There should be no functional change
  for the FreeBSD kernel stack.
  While there, use consistent variable nameing.

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Wed Apr 27 17:49:42 2016
(r298712)
+++ head/sys/netinet/sctp_indata.c  Wed Apr 27 18:58:47 2016
(r298713)
@@ -812,11 +812,6 @@ restart:
control->on_strm_q = 0;
}
}
-   if (control->on_read_q == 0) {
-   sctp_add_to_readq(stcb->sctp_ep, stcb, 
control,
-   >sctp_socket->so_rcv, 
control->end_added,
-   SCTP_READ_LOCK_NOT_HELD, 
SCTP_SO_NOT_LOCKED);
-   }
if (control->pdapi_started) {
strm->pd_api_started = 0;
control->pdapi_started = 0;
@@ -825,6 +820,11 @@ restart:
TAILQ_REMOVE(>uno_inqueue, 
control, next_instrm);
control->on_strm_q = 0;
}
+   if (control->on_read_q == 0) {
+   sctp_add_to_readq(stcb->sctp_ep, stcb, 
control,
+   >sctp_socket->so_rcv, 
control->end_added,
+   SCTP_READ_LOCK_NOT_HELD, 
SCTP_SO_NOT_LOCKED);
+   }
sctp_wakeup_the_read_socket(stcb->sctp_ep, 
stcb, SCTP_SO_NOT_LOCKED);
if ((nc) && (nc->first_frag_seen)) {
/*
@@ -843,11 +843,11 @@ restart:
}
}
if ((control->length > pd_point) && (strm->pd_api_started == 0)) {
+   strm->pd_api_started = 1;
+   control->pdapi_started = 1;
sctp_add_to_readq(stcb->sctp_ep, stcb, control,
>sctp_socket->so_rcv, control->end_added,
SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
-   strm->pd_api_started = 1;
-   control->pdapi_started = 1;
sctp_wakeup_the_read_socket(stcb->sctp_ep, stcb, 
SCTP_SO_NOT_LOCKED);
return (0);
} else {
@@ -1083,16 +1083,16 @@ done_un:
TAILQ_REMOVE(>inqueue, control, 
next_instrm);
control->on_strm_q = 0;
}
+   if (strm->pd_api_started && control->pdapi_started) {
+   control->pdapi_started = 0;
+   strm->pd_api_started = 0;
+   }
if (control->on_read_q == 0) {
sctp_add_to_readq(stcb->sctp_ep, stcb,
control,
>sctp_socket->so_rcv, 
control->end_added,
SCTP_READ_LOCK_NOT_HELD, 
SCTP_SO_NOT_LOCKED);
}
-   if (strm->pd_api_started && control->pdapi_started) {
-   control->pdapi_started = 0;
-   strm->pd_api_started = 0;
-   }
control = nctl;
}
}
@@ -1113,6 +1113,8 @@ deliver_more:
nctl = TAILQ_NEXT(control, next_instrm);
if ((control->sinfo_ssn == next_to_del) &&
(control->first_frag_seen)) {
+   int done;
+
/* Ok we can deliver it onto the stream. */
if (control->end_added) {
/* We are done with it afterwards */
@@ -1147,6 +1149,7 @@ deliver_more:
goto out;
}
}
+   done = (control->end_added) && 
(control->last_frag_seen);
if (control->on_read_q == 0) {
sctp_add_to_readq(stcb->sctp_ep, stcb,
control,
@@ -1154,7 +1157,7 @@ deliver_more:
SCTP_READ_LOCK_NOT_HELD, 
SCTP_SO_NOT_LOCKED);
}
strm->last_sequence_delivered = next_to_del;
-   if ((control->end_added) && 

Re: svn commit: r298712 - in head/sys: dev/cardbus kern mips/nlm powerpc/ofw sparc64/pci sys

2016-04-27 Thread John Baldwin
On Wednesday, April 27, 2016 05:49:42 PM John Baldwin wrote:
> Author: jhb
> Date: Wed Apr 27 17:49:42 2016
> New Revision: 298712
> URL: https://svnweb.freebsd.org/changeset/base/298712
> 
> Log:
>   Add a bus_null_rescan() method that always fails with an error.
>   
>   Use this in place of kobj_error_method to disable BUS_RESCAN() on
>   PCI drivers that do not use the "standard" scanning algorithm.

This should fix the build.

> Modified:
>   head/sys/dev/cardbus/cardbus.c
>   head/sys/kern/subr_bus.c
>   head/sys/mips/nlm/xlp_pci.c
>   head/sys/powerpc/ofw/ofw_pcibus.c
>   head/sys/sparc64/pci/ofw_pcibus.c
>   head/sys/sys/bus.h

Note that some of these drivers could be changed to use the "standard"
scanning algorithm and support rescans if they moved some of their custom
scanning logic into a pci_child_added callback.  This is generally true of
all but cardbus except that the OFW busses use the OFW tree to drive
scanning (so it seems they will add PCI devices that don't appear valid to
a PCI scan but are in the OFW tree).  I'm not sure how well that can work
in practice as no PCI device driver is going to attach to a PCI device
with a vendor ID of 0x (ACPI doesn't attempt to handle devices that
show up in the ACPI namespace but not in a PCI scan).

The xlp driver would just move the function-specific fixups into the
pci_child_added callback (though the special interrupt routing is
perhaps best done in PCI_ASSIGN_INTERRUPT or the like).  OFW would
walk the OFW tree to find the corresponding node (if one is found)
and initialize the OFW ivars (similar to what ACPI does) in the callback.

-- 
John Baldwin
___
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: r298712 - in head/sys: dev/cardbus kern mips/nlm powerpc/ofw sparc64/pci sys

2016-04-27 Thread John Baldwin
Author: jhb
Date: Wed Apr 27 17:49:42 2016
New Revision: 298712
URL: https://svnweb.freebsd.org/changeset/base/298712

Log:
  Add a bus_null_rescan() method that always fails with an error.
  
  Use this in place of kobj_error_method to disable BUS_RESCAN() on
  PCI drivers that do not use the "standard" scanning algorithm.

Modified:
  head/sys/dev/cardbus/cardbus.c
  head/sys/kern/subr_bus.c
  head/sys/mips/nlm/xlp_pci.c
  head/sys/powerpc/ofw/ofw_pcibus.c
  head/sys/sparc64/pci/ofw_pcibus.c
  head/sys/sys/bus.h

Modified: head/sys/dev/cardbus/cardbus.c
==
--- head/sys/dev/cardbus/cardbus.c  Wed Apr 27 16:39:05 2016
(r298711)
+++ head/sys/dev/cardbus/cardbus.c  Wed Apr 27 17:49:42 2016
(r298712)
@@ -346,7 +346,7 @@ static device_method_t cardbus_methods[]
DEVMETHOD(bus_get_dma_tag,  bus_generic_get_dma_tag),
DEVMETHOD(bus_read_ivar,cardbus_read_ivar),
DEVMETHOD(bus_driver_added, cardbus_driver_added),
-   DEVMETHOD(bus_rescan,   kobj_error_method),
+   DEVMETHOD(bus_rescan,   bus_null_rescan),
 
/* Card Interface */
DEVMETHOD(card_attach_card, cardbus_attach_card),

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cWed Apr 27 16:39:05 2016(r298711)
+++ head/sys/kern/subr_bus.cWed Apr 27 17:49:42 2016(r298712)
@@ -4289,6 +4289,19 @@ bus_generic_get_domain(device_t dev, dev
return (ENOENT);
 }
 
+/**
+ * @brief Helper function for implementing BUS_RESCAN().
+ *
+ * This null implementation of BUS_RESCAN() always fails to indicate
+ * the bus does not support rescanning.
+ */
+int
+bus_null_rescan(device_t dev)
+{
+
+   return (ENXIO);
+}
+
 /*
  * Some convenience functions to make it easier for drivers to use the
  * resource-management functions.  All these really do is hide the

Modified: head/sys/mips/nlm/xlp_pci.c
==
--- head/sys/mips/nlm/xlp_pci.c Wed Apr 27 16:39:05 2016(r298711)
+++ head/sys/mips/nlm/xlp_pci.c Wed Apr 27 17:49:42 2016(r298712)
@@ -154,7 +154,7 @@ static device_method_t xlp_pci_methods[]
/* Device interface */
DEVMETHOD(device_probe, xlp_pci_probe),
DEVMETHOD(device_attach,xlp_pci_attach),
-   DEVMETHOD(bus_rescan,   kobj_error_method),
+   DEVMETHOD(bus_rescan,   bus_null_rescan),
DEVMETHOD_END
 };
 

Modified: head/sys/powerpc/ofw/ofw_pcibus.c
==
--- head/sys/powerpc/ofw/ofw_pcibus.c   Wed Apr 27 16:39:05 2016
(r298711)
+++ head/sys/powerpc/ofw/ofw_pcibus.c   Wed Apr 27 17:49:42 2016
(r298712)
@@ -77,7 +77,7 @@ static device_method_t ofw_pcibus_method
/* Bus interface */
DEVMETHOD(bus_child_deleted,ofw_pcibus_child_deleted),
DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_child_pnpinfo_str_method),
-   DEVMETHOD(bus_rescan,   kobj_error_method),
+   DEVMETHOD(bus_rescan,   bus_null_rescan),
 
/* PCI interface */
DEVMETHOD(pci_alloc_devinfo,ofw_pcibus_alloc_devinfo),

Modified: head/sys/sparc64/pci/ofw_pcibus.c
==
--- head/sys/sparc64/pci/ofw_pcibus.c   Wed Apr 27 16:39:05 2016
(r298711)
+++ head/sys/sparc64/pci/ofw_pcibus.c   Wed Apr 27 17:49:42 2016
(r298712)
@@ -81,7 +81,7 @@ static device_method_t ofw_pcibus_method
/* Bus interface */
DEVMETHOD(bus_child_deleted,ofw_pcibus_child_deleted),
DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_pnpinfo_str),
-   DEVMETHOD(bus_rescan,   kobj_error_method),
+   DEVMETHOD(bus_rescan,   bus_null_rescan),
 
/* PCI interface */
DEVMETHOD(pci_alloc_devinfo,ofw_pcibus_alloc_devinfo),

Modified: head/sys/sys/bus.h
==
--- head/sys/sys/bus.h  Wed Apr 27 16:39:05 2016(r298711)
+++ head/sys/sys/bus.h  Wed Apr 27 17:49:42 2016(r298712)
@@ -430,6 +430,7 @@ int bus_generic_teardown_intr(device_t d
  struct resource *irq, void *cookie);
 intbus_generic_write_ivar(device_t dev, device_t child, int which,
   uintptr_t value);
+intbus_null_rescan(device_t dev);
 
 /*
  * Wrapper functions for the BUS_*_RESOURCE methods to make client 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"


Re: svn commit: r298425 - head/sys/dev/acpica

2016-04-27 Thread Zbigniew Bodek
2016-04-27 18:46 GMT+02:00 John Baldwin :

> On Wednesday, April 27, 2016 04:57:28 PM Zbigniew Bodek wrote:
> > Hello,
> >
> > I'm forwarding a message from Michal Stanek who found some problems wit
> > this commit. Please see below:
>
> It looks like you have "cpuX" devices that aren't acpi_cpu.c devices.
> That's fine, but that is why this driver is confused a bit.  Before my
> change all that happened was that this triggered extra probe/attach of
> child devices, but now it queues the ACPI-specific task as well.
>
> I've add you to a review for a change I think will fix this (and which I've
> tested on amd64 with ACPI):
>
> https://reviews.freebsd.org/D6133
>
> Thanks. Please add Michal Stanek (mst) as well.

Best regards
zbb
___
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"


Re: svn commit: r298425 - head/sys/dev/acpica

2016-04-27 Thread John Baldwin
On Wednesday, April 27, 2016 04:57:28 PM Zbigniew Bodek wrote:
> Hello,
> 
> I'm forwarding a message from Michal Stanek who found some problems wit
> this commit. Please see below:

It looks like you have "cpuX" devices that aren't acpi_cpu.c devices.
That's fine, but that is why this driver is confused a bit.  Before my
change all that happened was that this triggered extra probe/attach of
child devices, but now it queues the ACPI-specific task as well.

I've add you to a review for a change I think will fix this (and which I've
tested on amd64 with ACPI):

https://reviews.freebsd.org/D6133

-- 
John Baldwin
___
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"


Re: svn commit: r298708 - in head/sys: dev/cardbus dev/pci mips/nlm powerpc/ofw sparc64/pci

2016-04-27 Thread John Baldwin
On Wednesday, April 27, 2016 04:31:12 PM John Baldwin wrote:
> Author: jhb
> Date: Wed Apr 27 16:31:12 2016
> New Revision: 298708
> URL: https://svnweb.freebsd.org/changeset/base/298708
> 
> Log:
>   Implement a PCI bus rescan method.
>   
>   Rescanning a PCI bus uses the following steps:
>   - Fetch the current set of child devices and save it in the 'devlist'
> array.
>   - Allocate a parallel array 'unchanged' initalized with NULL pointers.
>   - Scan the bus checking each slot (and each function on slots with a
> multifunction device).
>   - If a valid function is found, look for a matching device in the 'devlist'
> array.  If a device is found, save the pointer in the 'unchanged' array.
> If a device is not found, add a new device.
>   - After the scan has finished, walk the 'devlist' array deleting any
> devices that do not have a matching pointer in the 'unchanged' array.
>   - Finally, fetch an updated set of child devices and explicitly attach any
> devices that are not present in the 'unchanged' array.
>   
>   This builds on the previous changes to move subclass data management into
>   pci_alloc_devinfo(), pci_child_added(), and bus_child_deleted().
>   
>   Subclasses of the PCI bus use custom rescan logic explicitly override the
>   rescan method to disable rescans.
>   
>   Differential Revision:  https://reviews.freebsd.org/D6018

Argh, I thought for certain I had done a tinderbox build, but using
kobj_error_method breaks the build.  I will test a fix that adds a
null_rescan method instead and commit it shortly.

-- 
John Baldwin
___
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"


Re: svn commit: r298425 - head/sys/dev/acpica

2016-04-27 Thread Andrew Turner
On Wed, 27 Apr 2016 16:57:28 +0200
Zbigniew Bodek  wrote:

> Hello,
> 
> I'm forwarding a message from Michal Stanek who found some problems
> wit this commit. Please see below:
> 
> ---
> I'm getting a lot of ACPI error messages on ThunderX (arm64). The
> kernel also panics before it gets to prompt.
> Running bisect pointed to this patch as the culprit.
> 
> Removing acpi from GENERIC configuration fixes the issue.

See r298639.

I know the issue, the code is picking up the ofw cpu devices. I'm
expecting to work on ACPI in a few months so will expect to fix this
then (unless someone else gets to it first)

Andrew
___
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"


Re: svn commit: r298709 - in head: lib/libdevctl sys/kern sys/sys usr.sbin/devctl

2016-04-27 Thread John Baldwin
On Wednesday, April 27, 2016 04:33:17 PM John Baldwin wrote:
> Author: jhb
> Date: Wed Apr 27 16:33:17 2016
> New Revision: 298709
> URL: https://svnweb.freebsd.org/changeset/base/298709
> 
> Log:
>   Add 'devctl delete' that calls device_delete_child().
>   
>   'devctl delete' can be used to delete a device that is no longer present.
>   As an anti-foot-shooting measure, 'delete' will not delete a device
>   unless it's parent bus says it is no longer present.  This can be
>   overridden by passing the force ('-f') flag.
>   
>   Note that this command should be used with care.  If a device is deleted
>   that is actually present it can't be resurrected unless the parent bus
>   device's driver supports rescans.
>   
>   Differential Revision:  https://reviews.freebsd.org/D6019

Oops, both of the devctl commits probably warranted a 'Relnotes: yes'.

One obscure-ish use case for these commands is if you are working with a
PCI FPGA adapter that you can flash while the host machine is running.
The new configuration may involve changes to BAR layout, etc.  In that
case you should now be able to 'devctl delete' the device before flashing
it and 'devctl rescan' the parent bus after the flash is complete.

You can also use 'devctl rescan' for a poor-man's PCI-e hotplug support
on bridges that support automated PCI-e hotplug (no power controller, etc.)
such as the ExpressCard slot on the two Lenovo's I have (T400 and X220).

-- 
John Baldwin
___
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: r298711 - in head/sys: dev/acpica dev/pci powerpc/ofw sparc64/pci

2016-04-27 Thread John Baldwin
Author: jhb
Date: Wed Apr 27 16:39:05 2016
New Revision: 298711
URL: https://svnweb.freebsd.org/changeset/base/298711

Log:
  Add a pcib_attach_child() method to manage adding the child "pci" device.
  
  This allows the PCI-PCI bridge driver to save a reference to the child
  device in its softc.
  
  Note that this required moving the "pci" device creation out of
  acpi_pcib_attach().  Instead, acpi_pcib_attach() is renamed to
  acpi_pcib_fetch_prt() as it's sole action now is to fetch the PCI
  interrupt routing table.
  
  Differential Revision:https://reviews.freebsd.org/D6021

Modified:
  head/sys/dev/acpica/acpi_pcib.c
  head/sys/dev/acpica/acpi_pcib_acpi.c
  head/sys/dev/acpica/acpi_pcib_pci.c
  head/sys/dev/acpica/acpi_pcibvar.h
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/pci/pcib_private.h
  head/sys/powerpc/ofw/ofw_pcib_pci.c
  head/sys/sparc64/pci/ofw_pcib.c

Modified: head/sys/dev/acpica/acpi_pcib.c
==
--- head/sys/dev/acpica/acpi_pcib.c Wed Apr 27 16:34:29 2016
(r298710)
+++ head/sys/dev/acpica/acpi_pcib.c Wed Apr 27 16:39:05 2016
(r298711)
@@ -126,11 +126,10 @@ prt_attach_devices(ACPI_PCI_ROUTING_TABL
ACPI_ADR_PCI_SLOT(entry->Address), entry->Pin);
 }
 
-int
-acpi_pcib_attach(device_t dev, ACPI_BUFFER *prt, int busno)
+void
+acpi_pcib_fetch_prt(device_t dev, ACPI_BUFFER *prt)
 {
 ACPI_STATUS status;
-int error;
 
 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
@@ -148,20 +147,9 @@ acpi_pcib_attach(device_t dev, ACPI_BUFF
acpi_name(acpi_get_handle(dev)), AcpiFormatException(status));
 
 /*
- * Attach the PCI bus proper.
- */
-if (device_add_child(dev, "pci", -1) == NULL) {
-   device_printf(device_get_parent(dev), "couldn't attach pci bus\n");
-   return_VALUE(ENXIO);
-}
-
-/*
- * Now go scan the bus.
+ * Ensure all the link devices are attached.
  */
 prt_walk_table(prt, prt_attach_devices, dev);
-
-error = bus_generic_attach(dev);
-return_VALUE(error);
 }
 
 static void

Modified: head/sys/dev/acpica/acpi_pcib_acpi.c
==
--- head/sys/dev/acpica/acpi_pcib_acpi.cWed Apr 27 16:34:29 2016
(r298710)
+++ head/sys/dev/acpica/acpi_pcib_acpi.cWed Apr 27 16:39:05 2016
(r298711)
@@ -502,7 +502,13 @@ acpi_pcib_acpi_attach(device_t dev)
 if (sc->ap_segment == 0 && sc->ap_bus == 0)
bus0_seen = 1;
 
-return (acpi_pcib_attach(dev, >ap_prt, sc->ap_bus));
+acpi_pcib_fetch_prt(dev, >ap_prt);
+
+if (device_add_child(dev, "pci", -1) == NULL) {
+   device_printf(device_get_parent(dev), "couldn't attach pci bus\n");
+   return (ENXIO);
+}
+return (bus_generic_attach(dev));
 }
 
 /*

Modified: head/sys/dev/acpica/acpi_pcib_pci.c
==
--- head/sys/dev/acpica/acpi_pcib_pci.c Wed Apr 27 16:34:29 2016
(r298710)
+++ head/sys/dev/acpica/acpi_pcib_pci.c Wed Apr 27 16:39:05 2016
(r298711)
@@ -120,7 +120,9 @@ acpi_pcib_pci_attach(device_t dev)
 pcib_attach_common(dev);
 sc = device_get_softc(dev);
 sc->ap_handle = acpi_get_handle(dev);
-return (acpi_pcib_attach(dev, >ap_prt, sc->ap_pcibsc.bus.sec));
+acpi_pcib_fetch_prt(dev, >ap_prt);
+
+return (pcib_attach_child(dev));
 }
 
 static int

Modified: head/sys/dev/acpica/acpi_pcibvar.h
==
--- head/sys/dev/acpica/acpi_pcibvar.h  Wed Apr 27 16:34:29 2016
(r298710)
+++ head/sys/dev/acpica/acpi_pcibvar.h  Wed Apr 27 16:39:05 2016
(r298711)
@@ -35,7 +35,7 @@
 void   acpi_pci_link_add_reference(device_t dev, int index, device_t pcib,
 int slot, int pin);
 intacpi_pci_link_route_interrupt(device_t dev, int index);
-intacpi_pcib_attach(device_t bus, ACPI_BUFFER *prt, int busno);
+void   acpi_pcib_fetch_prt(device_t bus, ACPI_BUFFER *prt);
 intacpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
 ACPI_BUFFER *prtbuf);
 intacpi_pcib_power_for_sleep(device_t pcib, device_t dev,

Modified: head/sys/dev/pci/pci_pci.c
==
--- head/sys/dev/pci/pci_pci.c  Wed Apr 27 16:34:29 2016(r298710)
+++ head/sys/dev/pci/pci_pci.c  Wed Apr 27 16:39:05 2016(r298711)
@@ -1075,21 +1075,26 @@ pcib_attach_common(device_t dev)
 }
 
 int
+pcib_attach_child(device_t dev)
+{
+   struct pcib_softc *sc;
+
+   sc = device_get_softc(dev);
+   if (sc->bus.sec == 0) {
+   /* no secondary bus; we should have fixed this */
+   return(0);
+   }
+
+   sc->child = device_add_child(dev, "pci", -1);
+   return (bus_generic_attach(dev));
+}
+
+int
 pcib_attach(device_t dev)
 {
-struct pcib_softc  *sc;
-  

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

2016-04-27 Thread John Baldwin
On Wednesday, April 27, 2016 04:34:29 PM John Baldwin wrote:
> Author: jhb
> Date: Wed Apr 27 16:34:29 2016
> New Revision: 298710
> URL: https://svnweb.freebsd.org/changeset/base/298710
> 
> Log:
>   Fix PCI bus detach to delete child devices.
>   
>   Differential Revision:  https://reviews.freebsd.org/D6020

Arguably, bus_generic_detach() should be calling device_delete_children()
as most (if not all) buses should delete child devices when detaching,
but that's a larger problem to solve.

If I had my druthers I'd probably rename bus_generic_detach() to
device_detach_children() and change bus_generic_detach() to call
device_detach_children() followed by device_delete_children().

Perhaps in 12 we can try to drain that swamp.  bus_generic_attach()
has similar issues in that a generic bus attach routine should really
do what 'bus_generic_probe()' and 'bus_generic_attach()' should do.
There is no "generic" probe routine for a bus since a probe routine
must set a device description which is unique to the driver.

-- 
John Baldwin
___
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: r298710 - head/sys/dev/pci

2016-04-27 Thread John Baldwin
Author: jhb
Date: Wed Apr 27 16:34:29 2016
New Revision: 298710
URL: https://svnweb.freebsd.org/changeset/base/298710

Log:
  Fix PCI bus detach to delete child devices.
  
  Differential Revision:https://reviews.freebsd.org/D6020

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

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Wed Apr 27 16:33:17 2016(r298709)
+++ head/sys/dev/pci/pci.c  Wed Apr 27 16:34:29 2016(r298710)
@@ -97,9 +97,7 @@ static intpci_add_map(device_t bus, de
struct resource_list *rl, int force, int prefetch);
 static int pci_probe(device_t dev);
 static int pci_attach(device_t dev);
-#ifdef PCI_RES_BUS
 static int pci_detach(device_t dev);
-#endif
 static voidpci_load_vendor_data(void);
 static int pci_describe_parse_line(char **ptr, int *vendor,
int *device, char **desc);
@@ -133,11 +131,7 @@ static device_method_t pci_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, pci_probe),
DEVMETHOD(device_attach,pci_attach),
-#ifdef PCI_RES_BUS
DEVMETHOD(device_detach,pci_detach),
-#else
-   DEVMETHOD(device_detach,bus_generic_detach),
-#endif
DEVMETHOD(device_shutdown,  bus_generic_shutdown),
DEVMETHOD(device_suspend,   bus_generic_suspend),
DEVMETHOD(device_resume,pci_resume),
@@ -4145,20 +4139,25 @@ pci_attach(device_t dev)
return (bus_generic_attach(dev));
 }
 
-#ifdef PCI_RES_BUS
 static int
 pci_detach(device_t dev)
 {
+#ifdef PCI_RES_BUS
struct pci_softc *sc;
+#endif
int error;
 
error = bus_generic_detach(dev);
if (error)
return (error);
sc = device_get_softc(dev);
-   return (bus_release_resource(dev, PCI_RES_BUS, 0, sc->sc_bus));
-}
+#ifdef PCI_RES_BUS
+   error = bus_release_resource(dev, PCI_RES_BUS, 0, sc->sc_bus);
+   if (error)
+   return (error);
 #endif
+   return (device_delete_children(dev));
+}
 
 static void
 pci_set_power_child(device_t dev, device_t child, int state)
___
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: r298709 - in head: lib/libdevctl sys/kern sys/sys usr.sbin/devctl

2016-04-27 Thread John Baldwin
Author: jhb
Date: Wed Apr 27 16:33:17 2016
New Revision: 298709
URL: https://svnweb.freebsd.org/changeset/base/298709

Log:
  Add 'devctl delete' that calls device_delete_child().
  
  'devctl delete' can be used to delete a device that is no longer present.
  As an anti-foot-shooting measure, 'delete' will not delete a device
  unless it's parent bus says it is no longer present.  This can be
  overridden by passing the force ('-f') flag.
  
  Note that this command should be used with care.  If a device is deleted
  that is actually present it can't be resurrected unless the parent bus
  device's driver supports rescans.
  
  Differential Revision:https://reviews.freebsd.org/D6019

Modified:
  head/lib/libdevctl/devctl.3
  head/lib/libdevctl/devctl.c
  head/lib/libdevctl/devctl.h
  head/sys/kern/subr_bus.c
  head/sys/sys/bus.h
  head/usr.sbin/devctl/devctl.8
  head/usr.sbin/devctl/devctl.c

Modified: head/lib/libdevctl/devctl.3
==
--- head/lib/libdevctl/devctl.3 Wed Apr 27 16:31:12 2016(r298708)
+++ head/lib/libdevctl/devctl.3 Wed Apr 27 16:33:17 2016(r298709)
@@ -31,6 +31,7 @@
 .Sh NAME
 .Nm devctl ,
 .Nm devctl_attach ,
+.Nm devctl_delete ,
 .Nm devctl_detach ,
 .Nm devctl_disable ,
 .Nm devctl_enable ,
@@ -46,6 +47,8 @@
 .Ft int
 .Fn devctl_attach "const char *device"
 .Ft int
+.Fn devctl_delete "const char *device" "bool force"
+.Ft int
 .Fn devctl_detach "const char *device" "bool force"
 .Ft int
 .Fn devctl_disable "const char *device" "bool force_detach"
@@ -110,6 +113,15 @@ is true,
 the current device driver will be detached even if the device is busy.
 .Pp
 The
+.Fn devctl_delete
+function deletes a device from the device tree.
+No
+If
+.Fa force
+is true,
+the device is deleted even if the device is physically present.
+.Pp
+The
 .Fn devctl_disable
 function disables a device.
 If the device is currently attached to a device driver,
@@ -158,8 +170,8 @@ The
 function rescans a bus device checking for devices that have been added or
 removed.
 .Sh RETURN VALUES
-.Rv -std devctl_attach devctl_detach devctl_disable devctl_enable \
-devctl_suspend devctl_rescan devctl_resume devctl_set_driver
+.Rv -std devctl_attach devctl_delete devctl_detach devctl_disable \
+devctl_enable devctl_suspend devctl_rescan devctl_resume devctl_set_driver
 .Sh ERRORS
 In addition to specific errors noted below,
 all of the
@@ -298,6 +310,19 @@ The device is not attached to a driver.
 .It Bq Er ENXIO
 The bus driver does not support rescanning.
 .El
+.Pp
+The
+.Fn devctl_delete
+function may fail if:
+.Bl -tag -width Er
+.It Bq Er EBUSY
+The device is physically present and
+.Fa force
+is false.
+.It Bq Er EINVAL
+.Fa dev
+is the root device of the device tree.
+.El
 .Sh SEE ALSO
 .Xr devinfo 3 ,
 .Xr devstat 3 ,

Modified: head/lib/libdevctl/devctl.c
==
--- head/lib/libdevctl/devctl.c Wed Apr 27 16:31:12 2016(r298708)
+++ head/lib/libdevctl/devctl.c Wed Apr 27 16:33:17 2016(r298709)
@@ -129,3 +129,11 @@ devctl_rescan(const char *device)
 
return (devctl_simple_request(DEV_RESCAN, device, 0));
 }
+
+int
+devctl_delete(const char *device, bool force)
+{
+
+   return (devctl_simple_request(DEV_DELETE, device, force ?
+   DEVF_FORCE_DELETE : 0));
+}

Modified: head/lib/libdevctl/devctl.h
==
--- head/lib/libdevctl/devctl.h Wed Apr 27 16:31:12 2016(r298708)
+++ head/lib/libdevctl/devctl.h Wed Apr 27 16:33:17 2016(r298709)
@@ -39,5 +39,6 @@ int   devctl_suspend(const char *device);
 intdevctl_resume(const char *device);
 intdevctl_set_driver(const char *device, const char *driver, bool force);
 intdevctl_rescan(const char *device);
+intdevctl_delete(const char *device, bool force);
 
 #endif /* !__DEVCTL_H__ */

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cWed Apr 27 16:31:12 2016(r298708)
+++ head/sys/kern/subr_bus.cWed Apr 27 16:33:17 2016(r298709)
@@ -5204,6 +5204,7 @@ devctl2_ioctl(struct cdev *cdev, u_long 
case DEV_RESUME:
case DEV_SET_DRIVER:
case DEV_RESCAN:
+   case DEV_DELETE:
error = priv_check(td, PRIV_DRIVER);
if (error == 0)
error = find_device(req, );
@@ -5374,6 +5375,24 @@ devctl2_ioctl(struct cdev *cdev, u_long 
}
error = BUS_RESCAN(dev);
break;
+   case DEV_DELETE: {
+   device_t parent;
+
+   parent = device_get_parent(dev);
+   if (parent == NULL) {
+   error = EINVAL;
+   break;
+   }
+   if (!(req->dr_flags & DEVF_FORCE_DELETE)) {
+

svn commit: r298708 - in head/sys: dev/cardbus dev/pci mips/nlm powerpc/ofw sparc64/pci

2016-04-27 Thread John Baldwin
Author: jhb
Date: Wed Apr 27 16:31:12 2016
New Revision: 298708
URL: https://svnweb.freebsd.org/changeset/base/298708

Log:
  Implement a PCI bus rescan method.
  
  Rescanning a PCI bus uses the following steps:
  - Fetch the current set of child devices and save it in the 'devlist'
array.
  - Allocate a parallel array 'unchanged' initalized with NULL pointers.
  - Scan the bus checking each slot (and each function on slots with a
multifunction device).
  - If a valid function is found, look for a matching device in the 'devlist'
array.  If a device is found, save the pointer in the 'unchanged' array.
If a device is not found, add a new device.
  - After the scan has finished, walk the 'devlist' array deleting any
devices that do not have a matching pointer in the 'unchanged' array.
  - Finally, fetch an updated set of child devices and explicitly attach any
devices that are not present in the 'unchanged' array.
  
  This builds on the previous changes to move subclass data management into
  pci_alloc_devinfo(), pci_child_added(), and bus_child_deleted().
  
  Subclasses of the PCI bus use custom rescan logic explicitly override the
  rescan method to disable rescans.
  
  Differential Revision:https://reviews.freebsd.org/D6018

Modified:
  head/sys/dev/cardbus/cardbus.c
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_private.h
  head/sys/mips/nlm/xlp_pci.c
  head/sys/powerpc/ofw/ofw_pcibus.c
  head/sys/sparc64/pci/ofw_pcibus.c

Modified: head/sys/dev/cardbus/cardbus.c
==
--- head/sys/dev/cardbus/cardbus.c  Wed Apr 27 16:29:03 2016
(r298707)
+++ head/sys/dev/cardbus/cardbus.c  Wed Apr 27 16:31:12 2016
(r298708)
@@ -346,6 +346,7 @@ static device_method_t cardbus_methods[]
DEVMETHOD(bus_get_dma_tag,  bus_generic_get_dma_tag),
DEVMETHOD(bus_read_ivar,cardbus_read_ivar),
DEVMETHOD(bus_driver_added, cardbus_driver_added),
+   DEVMETHOD(bus_rescan,   kobj_error_method),
 
/* Card Interface */
DEVMETHOD(card_attach_card, cardbus_attach_card),

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Wed Apr 27 16:29:03 2016(r298707)
+++ head/sys/dev/pci/pci.c  Wed Apr 27 16:31:12 2016(r298708)
@@ -168,6 +168,7 @@ static device_method_t pci_methods[] = {
DEVMETHOD(bus_remap_intr,   pci_remap_intr_method),
DEVMETHOD(bus_suspend_child,pci_suspend_child),
DEVMETHOD(bus_resume_child, pci_resume_child),
+   DEVMETHOD(bus_rescan,   pci_rescan_method),
 
/* PCI interface */
DEVMETHOD(pci_read_config,  pci_read_config_method),
@@ -3917,6 +3918,103 @@ pci_add_children(device_t dev, int domai
 #undef REG
 }
 
+int
+pci_rescan_method(device_t dev)
+{
+#defineREG(n, w)   PCIB_READ_CONFIG(pcib, busno, s, f, n, w)
+   device_t pcib = device_get_parent(dev);
+   struct pci_softc *sc;
+   device_t child, *devlist, *unchanged;
+   int devcount, error, i, j, maxslots, oldcount;
+   int busno, domain, s, f, pcifunchigh;
+   uint8_t hdrtype;
+
+   /* No need to check for ARI on a rescan. */
+   error = device_get_children(dev, , );
+   if (error)
+   return (error);
+   if (devcount != 0) {
+   unchanged = malloc(devcount * sizeof(device_t), M_TEMP,
+   M_NOWAIT | M_ZERO);
+   if (unchanged == NULL) {
+   free(devlist, M_TEMP);
+   return (ENOMEM);
+   }
+   } else
+   unchanged = NULL;
+
+   sc = device_get_softc(dev);
+   domain = pcib_get_domain(dev);
+   busno = pcib_get_bus(dev);
+   maxslots = PCIB_MAXSLOTS(pcib);
+   for (s = 0; s <= maxslots; s++) {
+   /* If function 0 is not present, skip to the next slot. */
+   f = 0;
+   if (REG(PCIR_VENDOR, 2) == 0x)
+   continue;
+   pcifunchigh = 0;
+   hdrtype = REG(PCIR_HDRTYPE, 1);
+   if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+   continue;
+   if (hdrtype & PCIM_MFDEV)
+   pcifunchigh = PCIB_MAXFUNCS(pcib);
+   for (f = 0; f <= pcifunchigh; f++) {
+   if (REG(PCIR_VENDOR, 2) == 0xfff)
+   continue;
+
+   /*
+* Found a valid function.  Check if a
+* device_t for this device already exists.
+*/
+   for (i = 0; i < devcount; i++) {
+   child = devlist[i];
+   if (child == NULL)
+   continue;
+ 

svn commit: r298707 - in head: lib/libdevctl share/man/man9 sys/kern sys/sys usr.sbin/devctl

2016-04-27 Thread John Baldwin
Author: jhb
Date: Wed Apr 27 16:29:03 2016
New Revision: 298707
URL: https://svnweb.freebsd.org/changeset/base/298707

Log:
  Add a new rescan method to the bus interface.
  
  The BUS_RESCAN() method rescans a single bus device checking for devices
  that have been added or removed from the bus.  A new 'rescan' command is
  added to devctl(8) to trigger a rescan.
  
  Differential Revision:https://reviews.freebsd.org/D6016

Added:
  head/share/man/man9/BUS_RESCAN.9   (contents, props changed)
Modified:
  head/lib/libdevctl/devctl.3
  head/lib/libdevctl/devctl.c
  head/lib/libdevctl/devctl.h
  head/share/man/man9/Makefile
  head/sys/kern/bus_if.m
  head/sys/kern/subr_bus.c
  head/sys/sys/bus.h
  head/usr.sbin/devctl/devctl.8
  head/usr.sbin/devctl/devctl.c

Modified: head/lib/libdevctl/devctl.3
==
--- head/lib/libdevctl/devctl.3 Wed Apr 27 16:23:16 2016(r298706)
+++ head/lib/libdevctl/devctl.3 Wed Apr 27 16:29:03 2016(r298707)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 2, 2016
+.Dd April 27, 2016
 .Dt DEVCTL 3
 .Os
 .Sh NAME
@@ -34,6 +34,7 @@
 .Nm devctl_detach ,
 .Nm devctl_disable ,
 .Nm devctl_enable ,
+.Nm devctl_rescan ,
 .Nm devctl_resume ,
 .Nm devctl_set_driver ,
 .Nm devctl_suspend
@@ -51,6 +52,8 @@
 .Ft int
 .Fn devctl_enable "const char *device"
 .Ft int
+.Fn devctl_rescan "const char *device"
+.Ft int
 .Fn devctl_resume "const char *device"
 .Ft int
 .Fn devctl_set_driver "const char *device" "const char *driver" "bool force"
@@ -149,9 +152,14 @@ If the device is already attached and
 is true,
 the device will be detached from its current device driver before it is
 attached to the new device driver.
+.Pp
+The
+.Fn devctl_rescan
+function rescans a bus device checking for devices that have been added or
+removed.
 .Sh RETURN VALUES
 .Rv -std devctl_attach devctl_detach devctl_disable devctl_enable \
-devctl_suspend devctl_resume devctl_set_driver
+devctl_suspend devctl_rescan devctl_resume devctl_set_driver
 .Sh ERRORS
 In addition to specific errors noted below,
 all of the
@@ -280,6 +288,16 @@ The device is disabled.
 .It Bq Er ENXIO
 The new device driver failed to attach.
 .El
+.Pp
+The
+.Fn devctl_rescan
+function may fail if:
+.Bl -tag -width Er
+.It Bq Er ENXIO
+The device is not attached to a driver.
+.It Bq Er ENXIO
+The bus driver does not support rescanning.
+.El
 .Sh SEE ALSO
 .Xr devinfo 3 ,
 .Xr devstat 3 ,

Modified: head/lib/libdevctl/devctl.c
==
--- head/lib/libdevctl/devctl.c Wed Apr 27 16:23:16 2016(r298706)
+++ head/lib/libdevctl/devctl.c Wed Apr 27 16:29:03 2016(r298707)
@@ -122,3 +122,10 @@ devctl_set_driver(const char *device, co
req.dr_flags |= DEVF_SET_DRIVER_DETACH;
return (devctl_request(DEV_SET_DRIVER, ));
 }
+
+int
+devctl_rescan(const char *device)
+{
+
+   return (devctl_simple_request(DEV_RESCAN, device, 0));
+}

Modified: head/lib/libdevctl/devctl.h
==
--- head/lib/libdevctl/devctl.h Wed Apr 27 16:23:16 2016(r298706)
+++ head/lib/libdevctl/devctl.h Wed Apr 27 16:29:03 2016(r298707)
@@ -38,5 +38,6 @@ int   devctl_disable(const char *device, b
 intdevctl_suspend(const char *device);
 intdevctl_resume(const char *device);
 intdevctl_set_driver(const char *device, const char *driver, bool force);
+intdevctl_rescan(const char *device);
 
 #endif /* !__DEVCTL_H__ */

Added: head/share/man/man9/BUS_RESCAN.9
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man9/BUS_RESCAN.9Wed Apr 27 16:29:03 2016
(r298707)
@@ -0,0 +1,51 @@
+.\" -*- nroff -*-
+.\"
+.\" Copyright (c) 2016 John H. Baldwin 
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, 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 THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 

svn commit: r298706 - stable/10/usr.sbin/jexec

2016-04-27 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Wed Apr 27 16:23:16 2016
New Revision: 298706
URL: https://svnweb.freebsd.org/changeset/base/298706

Log:
  MFC r298524:
  
  Define which of the username options (-u/-U) to jexec(8) is the default.
  Bump Dd.
  
  PR:   207587
  Submitted by: dewa...@heuristicsystems.com.au
  Sponsored by:   Essen Hackathon 2016

Modified:
  stable/10/usr.sbin/jexec/jexec.8
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/jexec/jexec.8
==
--- stable/10/usr.sbin/jexec/jexec.8Wed Apr 27 15:48:47 2016
(r298705)
+++ stable/10/usr.sbin/jexec/jexec.8Wed Apr 27 16:23:16 2016
(r298706)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Jul 11, 2015
+.Dd April 24, 2016
 .Dt JEXEC 8
 .Os
 .Sh NAME
@@ -59,6 +59,7 @@ and anything from the login class capabi
 The user name from host environment as whom the
 .Ar command
 should run.
+This is the default.
 .It Fl U Ar username
 The user name from jailed environment as whom the
 .Ar command
___
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"


Re: svn commit: r298696 - head/sys/netinet

2016-04-27 Thread hiren panchasara
On 04/27/16 at 09:40P, Sepherosa Ziehau wrote:
> Author: sephe
> Date: Wed Apr 27 09:40:55 2016
> New Revision: 298696
> URL: https://svnweb.freebsd.org/changeset/base/298696
> 
> Log:
>   tcp/lro: Fix typo.
>   
>   MFC after:  1 week
>   Sponsored by:   Microsoft OSTC
> 
> Modified:
>   head/sys/netinet/tcp_lro.c
> 
> Modified: head/sys/netinet/tcp_lro.c
> ==
> --- head/sys/netinet/tcp_lro.cWed Apr 27 07:46:38 2016
> (r298695)
> +++ head/sys/netinet/tcp_lro.cWed Apr 27 09:40:55 2016
> (r298696)
> @@ -569,7 +569,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
>   if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0)
>   return (TCP_LRO_CANNOT);
>  
> - /* XXX-BZ We lose a AKC|PUSH flag concatinating multiple segments. */
> + /* XXX-BZ We lose a ACK|PUSH flag concatinating multiple segments. */

Also s/concatinating /concatenating / ?

Cheers,
Hiren


pgpBNtMUlLgr9.pgp
Description: PGP signature


svn commit: r298705 - stable/10/share/man/man5

2016-04-27 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Wed Apr 27 15:48:47 2016
New Revision: 298705
URL: https://svnweb.freebsd.org/changeset/base/298705

Log:
  MFC r298522:
  
  The default value of MINFREE is defined to be 8% in
  ufs/ffs/fs.h and not 10%.  The newfs(8) and tunefs(8)
  man pages had this change already, but fs(5) did not.
  This change makes it consistent again.
  
  Bump Dd.
  
  PR: 204929
  Submitted by:   am...@amutu.com
  Sponsored by:   Essen Linuxhotel Hackathon 2016

Modified:
  stable/10/share/man/man5/fs.5
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man5/fs.5
==
--- stable/10/share/man/man5/fs.5   Wed Apr 27 15:38:56 2016
(r298704)
+++ stable/10/share/man/man5/fs.5   Wed Apr 27 15:48:47 2016
(r298705)
@@ -32,7 +32,7 @@
 .\" @(#)fs.5   8.2 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd October 31, 2006
+.Dd April 23, 2016
 .Dt FS 5
 .Os
 .Sh NAME
@@ -266,7 +266,7 @@ however severe performance degradations 
 file system is run at greater than 90% full; thus the default
 value of
 .Fa fs_minfree
-is 10%.
+is 8%.
 .Pp
 Empirically the best trade-off between block fragmentation and
 overall disk utilization at a loading of 90% comes with a
@@ -278,10 +278,10 @@ The element
 specifies whether the file system should try to minimize the time spent
 allocating blocks, or if it should attempt to minimize the space
 fragmentation on the disk.
-If the value of fs_minfree (see above) is less than 10%,
+If the value of fs_minfree (see above) is less than 8%,
 then the file system defaults to optimizing for space to avoid
 running out of full sized blocks.
-If the value of minfree is greater than or equal to 10%,
+If the value of minfree is greater than or equal to 8%,
 fragmentation is unlikely to be problematical, and
 the file system defaults to optimizing for time.
 .Pp
___
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: r298703 - in head/sys/cam: . ctl

2016-04-27 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 27 15:35:05 2016
New Revision: 298703
URL: https://svnweb.freebsd.org/changeset/base/298703

Log:
  cam: unsign some types to match their definitions and avoid overflows.
  
  numpatterns is u_int.
  
  ctl:
  CTL_NUM_MODE_PAGES comes from sizeof().
  In struct:ctl_scsiio, kern_sg_entries is uint32_t.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/cam_xpt.c
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Wed Apr 27 15:28:25 2016(r298702)
+++ head/sys/cam/cam_xpt.c  Wed Apr 27 15:35:05 2016(r298703)
@@ -1182,7 +1182,7 @@ xptbusmatch(struct dev_match_pattern *pa
struct cam_eb *bus)
 {
dev_match_ret retval;
-   int i;
+   u_int i;
 
retval = DM_RET_NONE;
 
@@ -1294,7 +1294,7 @@ xptdevicematch(struct dev_match_pattern 
   struct cam_ed *device)
 {
dev_match_ret retval;
-   int i;
+   u_int i;
 
retval = DM_RET_NONE;
 
@@ -1417,7 +1417,7 @@ xptperiphmatch(struct dev_match_pattern 
   struct cam_periph *periph)
 {
dev_match_ret retval;
-   int i;
+   u_int i;
 
/*
 * If we aren't given something to match against, that's an error.

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Wed Apr 27 15:28:25 2016(r298702)
+++ head/sys/cam/ctl/ctl.c  Wed Apr 27 15:35:05 2016(r298703)
@@ -916,7 +916,7 @@ ctl_isc_announce_mode(struct ctl_lun *lu
 {
struct ctl_softc *softc = lun->ctl_softc;
union ctl_ha_msg msg;
-   int i;
+   u_int i;
 
if (softc->ha_link != CTL_HA_LINK_ONLINE)
return;
@@ -1284,7 +1284,7 @@ static void
 ctl_isc_mode_sync(struct ctl_softc *softc, union ctl_ha_msg *msg, int len)
 {
struct ctl_lun *lun;
-   int i;
+   u_int i;
uint32_t initidx, targ_lun;
 
targ_lun = msg->hdr.nexus.targ_mapped_lun;
@@ -6405,7 +6405,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio)
 */
switch (page_code) {
case SMS_ALL_PAGES_PAGE: {
-   int i;
+   u_int i;
 
page_len = 0;
 
@@ -6457,7 +6457,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio)
break;
}
default: {
-   int i;
+   u_int i;
 
page_len = 0;
 
@@ -12775,7 +12775,7 @@ static void
 ctl_datamove_remote_write_cb(struct ctl_ha_dt_req *rq)
 {
union ctl_io *io;
-   int i;
+   uint32_t i;
 
io = rq->context;
 
@@ -12853,7 +12853,7 @@ ctl_datamove_remote_dm_read_cb(union ctl
char path_str[64];
struct sbuf sb;
 #endif
-   int i;
+   uint32_t i;
 
for (i = 0; i < io->scsiio.kern_sg_entries; i++)
free(io->io_hdr.local_sglist[i].addr, M_CTL);
@@ -13094,7 +13094,7 @@ static void
 ctl_datamove_remote_read(union ctl_io *io)
 {
int retval;
-   int i;
+   uint32_t i;
 
/*
 * This will send an error to the other controller in the case of a
___
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: r298702 - head/sys/netpfil/ipfw

2016-04-27 Thread Andrey V. Elsukov
Author: ae
Date: Wed Apr 27 15:28:25 2016
New Revision: 298702
URL: https://svnweb.freebsd.org/changeset/base/298702

Log:
  Make create_object callback optional and return EOPNOTSUPP when it isn't
  defined. Remove eaction_create_compat() and use designated initializers to
  initialize eaction_opcodes structure.
  
  Obtained from:Yandex LLC

Modified:
  head/sys/netpfil/ipfw/ip_fw_eaction.c
  head/sys/netpfil/ipfw/ip_fw_sockopt.c

Modified: head/sys/netpfil/ipfw/ip_fw_eaction.c
==
--- head/sys/netpfil/ipfw/ip_fw_eaction.c   Wed Apr 27 15:27:23 2016
(r298701)
+++ head/sys/netpfil/ipfw/ip_fw_eaction.c   Wed Apr 27 15:28:25 2016
(r298702)
@@ -151,20 +151,14 @@ eaction_findbykidx(struct ip_fw_chain *c
return (ipfw_objhash_lookup_kidx(CHAIN_TO_SRV(ch), idx));
 }
 
-static int
-eaction_create_compat(struct ip_fw_chain *ch, struct tid_info *ti,
-uint16_t *pkidx)
-{
-
-   return (EOPNOTSUPP);
-}
-
 static struct opcode_obj_rewrite eaction_opcodes[] = {
{
-   O_EXTERNAL_ACTION, IPFW_TLV_EACTION,
-   eaction_classify, eaction_update,
-   eaction_findbyname, eaction_findbykidx,
-   eaction_create_compat
+   .opcode = O_EXTERNAL_ACTION,
+   .etlv = IPFW_TLV_EACTION,
+   .classifier = eaction_classify,
+   .update = eaction_update,
+   .find_byname = eaction_findbyname,
+   .find_bykidx = eaction_findbykidx,
},
 };
 

Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c
==
--- head/sys/netpfil/ipfw/ip_fw_sockopt.c   Wed Apr 27 15:27:23 2016
(r298701)
+++ head/sys/netpfil/ipfw/ip_fw_sockopt.c   Wed Apr 27 15:28:25 2016
(r298702)
@@ -2236,7 +2236,10 @@ create_objects_compat(struct ip_fw_chain
KASSERT(rw != NULL, ("Unable to find handler for op %d",
(cmd + p->off)->opcode));
 
-   error = rw->create_object(ch, ti, );
+   if (rw->create_object == NULL)
+   error = EOPNOTSUPP;
+   else
+   error = rw->create_object(ch, ti, );
if (error == 0) {
p->kidx = kidx;
continue;
___
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: r298700 - in stable/9: contrib/ntp contrib/ntp/html contrib/ntp/include contrib/ntp/lib/isc contrib/ntp/lib/isc/include/isc contrib/ntp/libntp contrib/ntp/ntpd contrib/ntp/ntpdate contr...

2016-04-27 Thread Xin LI
Author: delphij
Date: Wed Apr 27 15:25:18 2016
New Revision: 298700
URL: https://svnweb.freebsd.org/changeset/base/298700

Log:
  MFC r298695: MFV r298691: ntp 4.2.8p7.
  
  Security: CVE-2016-1547, CVE-2016-1548, CVE-2016-1549, CVE-2016-1550
  Security: CVE-2016-1551, CVE-2016-2516, CVE-2016-2517, CVE-2016-2518
  Security: CVE-2016-2519
  Security: FreeBSD-SA-16:16.ntp
  With hat: so

Added:
  stable/9/contrib/ntp/README.pullrequests
 - copied unchanged from r298695, head/contrib/ntp/README.pullrequests
  stable/9/contrib/ntp/lib/isc/tsmemcmp.c
 - copied unchanged from r298695, head/contrib/ntp/lib/isc/tsmemcmp.c
  stable/9/contrib/ntp/tests/libntp/run-tsafememcmp.c
 - copied unchanged from r298695, 
head/contrib/ntp/tests/libntp/run-tsafememcmp.c
  stable/9/contrib/ntp/tests/libntp/tsafememcmp.c
 - copied unchanged from r298695, 
head/contrib/ntp/tests/libntp/tsafememcmp.c
Modified:
  stable/9/contrib/ntp/ChangeLog
  stable/9/contrib/ntp/CommitLog
  stable/9/contrib/ntp/Makefile.am
  stable/9/contrib/ntp/Makefile.in
  stable/9/contrib/ntp/NEWS
  stable/9/contrib/ntp/config.h.in
  stable/9/contrib/ntp/configure
  stable/9/contrib/ntp/configure.ac
  stable/9/contrib/ntp/html/authentic.html
  stable/9/contrib/ntp/html/monopt.html
  stable/9/contrib/ntp/html/xleave.html
  stable/9/contrib/ntp/include/ntp.h
  stable/9/contrib/ntp/include/ntp_keyacc.h
  stable/9/contrib/ntp/include/ntp_refclock.h
  stable/9/contrib/ntp/include/ntp_stdlib.h
  stable/9/contrib/ntp/include/ntp_types.h
  stable/9/contrib/ntp/include/ntp_worker.h
  stable/9/contrib/ntp/include/recvbuff.h
  stable/9/contrib/ntp/lib/isc/hmacmd5.c
  stable/9/contrib/ntp/lib/isc/hmacsha.c
  stable/9/contrib/ntp/lib/isc/include/isc/string.h
  stable/9/contrib/ntp/libntp/Makefile.am
  stable/9/contrib/ntp/libntp/Makefile.in
  stable/9/contrib/ntp/libntp/a_md5encrypt.c
  stable/9/contrib/ntp/libntp/authkeys.c
  stable/9/contrib/ntp/libntp/authreadkeys.c
  stable/9/contrib/ntp/libntp/is_ip_address.c
  stable/9/contrib/ntp/libntp/ntp_intres.c
  stable/9/contrib/ntp/libntp/ntp_worker.c
  stable/9/contrib/ntp/libntp/recvbuff.c
  stable/9/contrib/ntp/libntp/work_fork.c
  stable/9/contrib/ntp/libntp/work_thread.c
  stable/9/contrib/ntp/ntpd/invoke-ntp.conf.texi
  stable/9/contrib/ntp/ntpd/invoke-ntp.keys.texi
  stable/9/contrib/ntp/ntpd/invoke-ntpd.texi
  stable/9/contrib/ntp/ntpd/ntp.conf.5man
  stable/9/contrib/ntp/ntpd/ntp.conf.5mdoc
  stable/9/contrib/ntp/ntpd/ntp.conf.def
  stable/9/contrib/ntp/ntpd/ntp.conf.html
  stable/9/contrib/ntp/ntpd/ntp.conf.man.in
  stable/9/contrib/ntp/ntpd/ntp.conf.mdoc.in
  stable/9/contrib/ntp/ntpd/ntp.keys.5man
  stable/9/contrib/ntp/ntpd/ntp.keys.5mdoc
  stable/9/contrib/ntp/ntpd/ntp.keys.html
  stable/9/contrib/ntp/ntpd/ntp.keys.man.in
  stable/9/contrib/ntp/ntpd/ntp.keys.mdoc.in
  stable/9/contrib/ntp/ntpd/ntp_control.c
  stable/9/contrib/ntp/ntpd/ntp_io.c
  stable/9/contrib/ntp/ntpd/ntp_proto.c
  stable/9/contrib/ntp/ntpd/ntp_request.c
  stable/9/contrib/ntp/ntpd/ntp_timer.c
  stable/9/contrib/ntp/ntpd/ntpd-opts.c
  stable/9/contrib/ntp/ntpd/ntpd-opts.h
  stable/9/contrib/ntp/ntpd/ntpd.1ntpdman
  stable/9/contrib/ntp/ntpd/ntpd.1ntpdmdoc
  stable/9/contrib/ntp/ntpd/ntpd.c
  stable/9/contrib/ntp/ntpd/ntpd.html
  stable/9/contrib/ntp/ntpd/ntpd.man.in
  stable/9/contrib/ntp/ntpd/ntpd.mdoc.in
  stable/9/contrib/ntp/ntpdate/ntpdate.c
  stable/9/contrib/ntp/ntpdc/invoke-ntpdc.texi
  stable/9/contrib/ntp/ntpdc/ntpdc-opts.c
  stable/9/contrib/ntp/ntpdc/ntpdc-opts.h
  stable/9/contrib/ntp/ntpdc/ntpdc.1ntpdcman
  stable/9/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc
  stable/9/contrib/ntp/ntpdc/ntpdc.html
  stable/9/contrib/ntp/ntpdc/ntpdc.man.in
  stable/9/contrib/ntp/ntpdc/ntpdc.mdoc.in
  stable/9/contrib/ntp/ntpq/invoke-ntpq.texi
  stable/9/contrib/ntp/ntpq/ntpq-opts.c
  stable/9/contrib/ntp/ntpq/ntpq-opts.def
  stable/9/contrib/ntp/ntpq/ntpq-opts.h
  stable/9/contrib/ntp/ntpq/ntpq-subs.c
  stable/9/contrib/ntp/ntpq/ntpq.1ntpqman
  stable/9/contrib/ntp/ntpq/ntpq.1ntpqmdoc
  stable/9/contrib/ntp/ntpq/ntpq.c
  stable/9/contrib/ntp/ntpq/ntpq.h
  stable/9/contrib/ntp/ntpq/ntpq.html
  stable/9/contrib/ntp/ntpq/ntpq.man.in
  stable/9/contrib/ntp/ntpq/ntpq.mdoc.in
  stable/9/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi
  stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c
  stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h
  stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
  stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
  stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd.html
  stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in
  stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in
  stable/9/contrib/ntp/packageinfo.sh
  stable/9/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
  stable/9/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
  stable/9/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html
  stable/9/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in
  

svn commit: r298698 - in head/sys/geom: . mirror raid virstor

2016-04-27 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 27 15:10:40 2016
New Revision: 298698
URL: https://svnweb.freebsd.org/changeset/base/298698

Log:
  geom: unsign some types to match their definitions and avoid overflows.
  
  In struct:gctl_req, nargs is unsigned.
  
  In mirror:
  g_mirror_syncreqs is unsigned.
  
  In raid:
  in struct:g_raid_volume, v_disks_count is unsigned.
  
  In virstor:
  in struct:g_virstor_softc, n_components is unsigned.
  
  MFC after:2 weeks

Modified:
  head/sys/geom/geom_ctl.c
  head/sys/geom/mirror/g_mirror.c
  head/sys/geom/raid/md_promise.c
  head/sys/geom/raid/md_sii.c
  head/sys/geom/virstor/g_virstor.c

Modified: head/sys/geom/geom_ctl.c
==
--- head/sys/geom/geom_ctl.cWed Apr 27 13:10:43 2016(r298697)
+++ head/sys/geom/geom_ctl.cWed Apr 27 15:10:40 2016(r298698)
@@ -135,7 +135,7 @@ gctl_copyin(struct gctl_req *req)
 {
struct gctl_req_arg *ap;
char *p;
-   int i;
+   u_int i;
 
ap = geom_alloc_copyin(req, req->arg, req->narg * sizeof(*ap));
if (ap == NULL) {
@@ -212,7 +212,7 @@ gctl_copyout(struct gctl_req *req)
 static void
 gctl_free(struct gctl_req *req)
 {
-   int i;
+   u_int i;
 
sbuf_delete(req->serror);
if (req->arg == NULL)
@@ -270,7 +270,7 @@ int
 gctl_set_param(struct gctl_req *req, const char *param, void const *ptr,
 int len)
 {
-   int i;
+   u_int i;
struct gctl_req_arg *ap;
 
for (i = 0; i < req->narg; i++) {
@@ -311,7 +311,7 @@ gctl_set_param_err(struct gctl_req *req,
 void *
 gctl_get_param(struct gctl_req *req, const char *param, int *len)
 {
-   int i;
+   u_int i;
void *p;
struct gctl_req_arg *ap;
 
@@ -332,7 +332,7 @@ gctl_get_param(struct gctl_req *req, con
 char const *
 gctl_get_asciiparam(struct gctl_req *req, const char *param)
 {
-   int i;
+   u_int i;
char const *p;
struct gctl_req_arg *ap;
 

Modified: head/sys/geom/mirror/g_mirror.c
==
--- head/sys/geom/mirror/g_mirror.c Wed Apr 27 13:10:43 2016
(r298697)
+++ head/sys/geom/mirror/g_mirror.c Wed Apr 27 15:10:40 2016
(r298698)
@@ -1160,7 +1160,7 @@ g_mirror_sync_collision(struct g_mirror_
struct g_mirror_disk *disk;
struct bio *sbp;
off_t rstart, rend, sstart, send;
-   int i;
+   u_int i;
 
if (sc->sc_sync.ds_ndisks == 0)
return (0);

Modified: head/sys/geom/raid/md_promise.c
==
--- head/sys/geom/raid/md_promise.c Wed Apr 27 13:10:43 2016
(r298697)
+++ head/sys/geom/raid/md_promise.c Wed Apr 27 15:10:40 2016
(r298698)
@@ -893,7 +893,7 @@ g_raid_md_promise_start(struct g_raid_vo
struct g_raid_md_promise_perdisk *pd;
struct g_raid_md_promise_pervolume *pv;
struct promise_raid_conf *meta;
-   int i;
+   u_int i;
 
sc = vol->v_softc;
md = sc->sc_md;

Modified: head/sys/geom/raid/md_sii.c
==
--- head/sys/geom/raid/md_sii.c Wed Apr 27 13:10:43 2016(r298697)
+++ head/sys/geom/raid/md_sii.c Wed Apr 27 15:10:40 2016(r298698)
@@ -1482,7 +1482,7 @@ g_raid_md_write_sii(struct g_raid_md_obj
struct g_raid_md_sii_object *mdi;
struct g_raid_md_sii_perdisk *pd;
struct sii_raid_conf *meta;
-   int i;
+   u_int i;
 
sc = md->mdo_softc;
mdi = (struct g_raid_md_sii_object *)md;

Modified: head/sys/geom/virstor/g_virstor.c
==
--- head/sys/geom/virstor/g_virstor.c   Wed Apr 27 13:10:43 2016
(r298697)
+++ head/sys/geom/virstor/g_virstor.c   Wed Apr 27 15:10:40 2016
(r298698)
@@ -471,7 +471,7 @@ static void
 update_metadata(struct g_virstor_softc *sc)
 {
struct g_virstor_metadata md;
-   int n;
+   u_int n;
 
if (virstor_valid_components(sc) != sc->n_components)
return; /* Incomplete device */
@@ -928,7 +928,7 @@ virstor_geom_destroy(struct g_virstor_so
 {
struct g_provider *pp;
struct g_geom *gp;
-   int n;
+   u_int n;
 
g_topology_assert();
 
___
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"


Re: svn commit: r298425 - head/sys/dev/acpica

2016-04-27 Thread Zbigniew Bodek
Hello,

I'm forwarding a message from Michal Stanek who found some problems wit
this commit. Please see below:

---
I'm getting a lot of ACPI error messages on ThunderX (arm64). The kernel
also panics before it gets to prompt.
Running bisect pointed to this patch as the culprit.

Removing acpi from GENERIC configuration fixes the issue.

Here is the boot log:

FreeBSD/SMP: Multiprocessor System Detected: 48 CPUs
random: entropy device external interface
ACPI: Table initialisation failed: AE_NOT_FOUND
ACPI: Try disabling either ACPI or apic support.
ofwbus0: 
simplebus0:  on ofwbus0
(...)
Timecounters tick every 1.000 msec
usbus0: 5.0Gbps Super Speed USB v3.0
usbus1: 5.0Gbps Super Speed USB v3.0
ugen0.1: <0x177d> at usbus0
uhub0: <0x177d XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
ugen1.1: <0x177d> at usbus1
uhub1: <0x177d XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex
[0x1] (20150818/utmutex-320)
ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex
[0x1] (20150818/utmutex-320)
ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex
[0x1] (20150818/utmutex-320)
ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex
[0x1] (20150818/utmutex-320)
ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex
[0x1] (20150818/utmutex-320)
ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex
[0x1] (20150818/utmutex-320)
ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex
[0x1] (20150818/utmutex-320)
ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex
[0x1] (20150818/utmutex-320)
ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex
[0x1] (20150818/utmutex-320)
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0:  ATA-7 SATA 1.x device
ada0: Serial Number 9QZ6QN7K
ada0: 150.000MB/s transfers (SATA 1.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 76319MB (156301488 512 byte sectors)
ACPI Exception: AE_BAD_PARAMETER, nfs_diskless: no NFS handle
Release APs
CPU  0: Cavium Thunder r0p1 affinity:  0  0
 Instruction Set Attributes 0 = 
 Instruction Set Attributes 1 = <0>
Thread 100112 could not acquire Mutex [0x1] Processor Features 0 =
< (20150818/utmutex-320)
GICACPI Exception: AE_BAD_PARAMETER, ,AdvSIMDThread 100112 could not
acquire Mutex [0x1],Float (20150818/utmutex-320)
,EL3ACPI Exception: AE_BAD_PARAMETER, ,EL2Thread 100112 could not acquire
Mutex [0x1],EL1 (20150818/utmutex-320)
,EL0ACPI Exception: AE_BAD_PARAMETER, >
Thread 100112 could not acquire Mutex [0x1] Processor Features 1 =
<0>
 (20150818/utmutex-320)
  Memory Model Features 0 = 
 (20150818/utmutex-320)
  Memory Model Features 1 = <0x20>
ACPI Exception: AE_BAD_PARAMETER,  Debug Features 0 = 
Thread 100112 could not acquire Mutex [0x1] Debug Features 1 =
<0>
 (20150818/utmutex-320)
 Auxiliary Features 0 = <0>
ACPI Exception: AE_BAD_PARAMETER,  Auxiliary Features 1 = <0>
Thread 100112 could not acquire Mutex [0x1]CPU  1: Cavium Thunder r0p1
(20150818/utmutex-320)
 affinity:ACPI Exception: AE_BAD_PARAMETER,   0Thread 100112 could not
acquire Mutex [0x1]  1 (20150818/utmutex-320)

ACPI Exception: AE_BAD_PARAMETER, CPU  2: Cavium Thunder r0p1Thread 100112
could not acquire Mutex [0x1] affinity: (20150818/utmutex-320)
  0ACPI Exception: AE_BAD_PARAMETER,   2Thread 100112 could not acquire
Mutex [0x1]
 (20150818/utmutex-320)
CPU  3: Cavium Thunder r0p1ACPI Exception: AE_BAD_PARAMETER,
 affinity:Thread 100112 could not acquire Mutex [0x1]  0
(20150818/utmutex-320)
  3ACPI Exception: AE_BAD_PARAMETER,
Thread 100112 could not acquire Mutex [0x1]CPU  4: Cavium Thunder r0p1
(20150818/utmutex-320)
 affinity:ACPI Exception: AE_BAD_PARAMETER,   0Thread 100112 could not
acquire Mutex [0x1]  4 (20150818/utmutex-320)

ACPI Exception: AE_BAD_PARAMETER, CPU  5: Cavium Thunder r0p1Thread 100112
could not acquire Mutex [0x1] affinity: (20150818/utmutex-320)
  0ACPI Exception: AE_BAD_PARAMETER,   5Thread 100112 could not acquire
Mutex [0x1]
 (20150818/utmutex-320)
CPU  6: Cavium Thunder r0p1ACPI Exception: AE_BAD_PARAMETER,
 affinity:Thread 100112 could not acquire Mutex [0x1]  0
(20150818/utmutex-320)
  6ACPI Exception: AE_BAD_PARAMETER,
Thread 100112 could not acquire Mutex [0x1]CPU  7: Cavium Thunder r0p1
(20150818/utmutex-320)
 affinity:ACPI Exception: AE_BAD_PARAMETER,   0Thread 100112 could not
acquire Mutex [0x1]  7 (20150818/utmutex-320)

ACPI Exception: AE_BAD_PARAMETER, CPU  8: Cavium Thunder r0p1Thread 100112
could not acquire Mutex [0x1] affinity: (20150818/utmutex-320)
  0ACPI Exception: AE_BAD_PARAMETER,   8Thread 100112 could not acquire
Mutex [0x1]
 (20150818/utmutex-320)
CPU  9: Cavium Thunder r0p1ACPI Exception: AE_BAD_PARAMETER,
 affinity:Thread 100112 could not acquire Mutex [0x1] 

Leshow Moscow

2016-04-27 Thread Divyajit Kaur
** 27 April 2016



** Wednesday

http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=9323eb3a35=1417440e3e

http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=f54d165284=1417440e3e


** Leshow Moscow


http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=159992cbf6=1417440e3e


** ARS ARPEL GROUP



** Since 1947 in the field of footwear and leather goods, ARS ARPEL GROUP 
magazines bring you the latest news on collections from trade fairs...
Read More 
(http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=c5408ba74c=1417440e3e)

http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=00aaae5e64=1417440e3e


** WELL WAY INDUSTRIES



** WELLWAY is Globally reputed manufacturers & exporters of an extensive range 
of all kind of Fashion Leather Garments...
Read More 
(http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=3e84623329=1417440e3e)


http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=301e004e70=1417440e3e


** FUXIN AODELI LEATHER CO LTD



** Fuxin Aodeli Leather Co., Ltd. is a professional enterprise, which combine 
the development, production, sales ,devote ourselves...
Read More 
(http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=5f703d7735=1417440e3e)


http://fashionablyin.us1.list-manage1.com/track/click?u=8e7d8ec661c4606682b4765dd=3915a8e002=1417440e3e


**
YOU



**
CAN

BE

HERE


http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=4bb3703e33=1417440e3e


** ARMADA FUR COLLECTION



** Armada Fur Collection - is a brand in the fur industry, which is a very 
short time has won the trust and respectability of its customers...
Read More 
(http://fashionablyin.us1.list-manage1.com/track/click?u=8e7d8ec661c4606682b4765dd=c40e5a99b2=1417440e3e)


http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=9119efaf76=1417440e3e


** SOFT GOLD



** Soft Gold Studio is a line of modern jewelry grounded by minimalist 
metalwork & inspired by unique materials. You'll find a mix of gold...
Read More 
(http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=ec4a23ba16=1417440e3e)



** 
(http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=dc03d7b619=1417440e3e)

Denim : Fashion's Frontier

** 
(http://fashionablyin.us1.list-manage2.com/track/click?u=8e7d8ec661c4606682b4765dd=ed01c0c1b9=1417440e3e)

BECOME A FASHIONABLYIN CONSULTANT

** GO PREMIUM!! 
(http://fashionablyin.us1.list-manage1.com/track/click?u=8e7d8ec661c4606682b4765dd=ee844d299b=1417440e3e)
** MARKETING SERVICES 
(http://fashionablyin.us1.list-manage2.com/track/click?u=8e7d8ec661c4606682b4765dd=220c9f9b45=1417440e3e)
** ADVERTISE ON FASHIONABLYIN 
(http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=f0f9637367=1417440e3e)
** 
(http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=e20bd43dff=1417440e3e)
** 
(http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=9b1928403f=1417440e3e)
** 
(http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=e21b854cde=1417440e3e)
** 
(http://fashionablyin.us1.list-manage.com/track/click?u=8e7d8ec661c4606682b4765dd=db8ae4cde1=1417440e3e)
Copyright © 2016 FASHIONABLYIN, All rights reserved.
 You subscribed on our website - Fashionablyin.com

Our mailing address is:
FASHIONABLYIN
2-4 Unit 27 Exmoor Street
London,  W10 6BD
United Kingdom
Want to change how you receive these emails?
You can ** update your preferences 
(http://fashionablyin.us1.list-manage2.com/profile?u=8e7d8ec661c4606682b4765dd=b4c7b5ed13=1417440e3e)
or ** unsubscribe from this list 
(http://fashionablyin.us1.list-manage1.com/unsubscribe?u=8e7d8ec661c4606682b4765dd=b4c7b5ed13=1417440e3e=e0a87c6572)
___

svn commit: r298697 - svnadmin/conf

2016-04-27 Thread Marius Strobl
Author: marius
Date: Wed Apr 27 13:10:43 2016
New Revision: 298697
URL: https://svnweb.freebsd.org/changeset/base/298697

Log:
  - Require re@ approval for release.
  - Hand releng/10.3 over to so@.
  
  Approved by:  re (implicit)

Modified:
  svnadmin/conf/approvers

Modified: svnadmin/conf/approvers
==
--- svnadmin/conf/approvers Wed Apr 27 09:40:55 2016(r298696)
+++ svnadmin/conf/approvers Wed Apr 27 13:10:43 2016(r298697)
@@ -18,8 +18,8 @@
 #
 #^head/re
 #^stable/10/   re
-^releng/10.3/  re
-^releng/10.[0-2]/  (security-officer|so)
+^release/  re
+^releng/10.[0-3]/  (security-officer|so)
 ^releng/9.[0-3]/   (security-officer|so)
 ^releng/8.[0-4]/   (security-officer|so)
 ^releng/7.[0-4]/   (security-officer|so)
___
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: r298696 - head/sys/netinet

2016-04-27 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Apr 27 09:40:55 2016
New Revision: 298696
URL: https://svnweb.freebsd.org/changeset/base/298696

Log:
  tcp/lro: Fix typo.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/netinet/tcp_lro.c

Modified: head/sys/netinet/tcp_lro.c
==
--- head/sys/netinet/tcp_lro.c  Wed Apr 27 07:46:38 2016(r298695)
+++ head/sys/netinet/tcp_lro.c  Wed Apr 27 09:40:55 2016(r298696)
@@ -569,7 +569,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0)
return (TCP_LRO_CANNOT);
 
-   /* XXX-BZ We lose a AKC|PUSH flag concatinating multiple segments. */
+   /* XXX-BZ We lose a ACK|PUSH flag concatinating multiple segments. */
/* XXX-BZ Ideally we'd flush on PUSH? */
 
/*
___
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"


Re: svn commit: r298671 - head/sys/geom/part

2016-04-27 Thread Bruce Evans

On Tue, 26 Apr 2016, Conrad E. Meyer wrote:


Log:
 g_part_bsd64: Check for valid on-disk npartitions value

 This value is u32 on disk, but assigned to an int in memory.  After we do the
 implicit conversion via assignment, check that the result is at least one[1]
 (non-negative[2]).

 1. The subsequent for-loop iterates from gpt_entries minus one, down, until
reaching zero.  A negative or zero initial index results in undefined signed
integer overflow.
 2. It is also used to index into arrays later.

 In practice, we expected non-malicious disks to contain small positive values.


It is a common programming error to use unsigned types to contain small
positive values.  This gives [un]sign extension/overflow bugs like (1)
by making it difficult to use subtraction operators.  (The loop doesn't
actually have bug (1) -- it correctly uses only ints in the loop -- see
below near the end.  Signed integer overflow mostly doesn't occur either.
Only an initial value if INT_MIN would give it for subtracting 1.  The
first undefined behaviour for a negative initial index is actually for
the array indexing in crc32(... d_partitions[basetable->gpt_entries]).)

struct g_part_table doesn't have as many instances of this bug as struct
disklabel or struct disklabel64, so conversions tend to cause [un]sign
extension/overflow bugs like [0].  Using unsigned types just gives wrong
values with no overflow if the target type is too small.


 Reported by:   Coverity
 CID:   1223202
 Sponsored by:  EMC / Isilon Storage Division

Modified:
 head/sys/geom/part/g_part_bsd64.c

Modified: head/sys/geom/part/g_part_bsd64.c
==
--- head/sys/geom/part/g_part_bsd64.c   Tue Apr 26 22:01:07 2016
(r298670)
+++ head/sys/geom/part/g_part_bsd64.c   Tue Apr 26 22:30:54 2016
(r298671)
@@ -509,7 +509,8 @@ g_part_bsd64_read(struct g_part_table *b

dlp = (struct disklabel64 *)buf;
basetable->gpt_entries = le32toh(dlp->d_npartitions);


Overflow still occurs here if the source value actually uses all 32 of its
bits (assuming 32-bit ints -- otherwise the analysis is even more complicated.
POSIX now requires >= 32-bit ints, and FreeBSD never supported anything else,
so this assumption is safe for now, but stating it complicates the analysis).


-   if (basetable->gpt_entries > MAXPARTITIONS64)
+   if (basetable->gpt_entries > MAXPARTITIONS64 ||
+   basetable->gpt_entries < 1)
goto invalid_label;


This check is still bogus, since it checks for overflow after overflow
has caused implementation-defined behaviour.  This requires a complicated
analysis to justify even for the usual behaviour of 2's complement
wrapping.  I've never seen any implementation that documuments this.

The correct check doesn't need any complicated analysis.  It just
checks the source value before clobbering it by assigning it to a
possibly-different type.  It is still not so easy to know the correct
type to use, since the source value is encoded and
__typeof(source_value) is unportable.  But we already had to use
knowledge of its type to hard-code the decoding method as le32toh().
So we may as well hard-code the type too:

uint32_t npart; /* XXX: assume that dlp_npartitions is u32 */
...
npart = le32toh(dlp->d_npartitions);
if (npart < 1 || npart > MAXPARTITIONS64)
goto invalid_label;
basetable->gpt_entries = npart;

Old struct disklabel has the same design bug, but its d_npartitions has
type uint16_t.  With 32-bit ints, uint16_t promotes to plain int, so its
unsigned features are hard to use even if you want them.  Expressions
like le16toh(dlp->d_npartitions) - 1 worked as intended but rarely as
wanted after C90 standardised the bad "value-preserving" sign extension
rules: when the source value is 0, the value of this subtraction is -1
with a 16-bit source but 0xU with a 32-bit source (assuming a
32-bit int target -- the general case is more complicated).

This makes loops difficult to write.  If you use an index variable i
then it should have type int, but might need to be uint32_t depending
on the source type and compiler warnings.  If you use the entry in
the struct more directly, then counting down from -1 to 0 just won't
work if the type in the struct is unsigned, except in some contexts
where this type is smaller than int and the "value-preserving" rule
gives the normally-unwanted value of -1.  The decoding step prevents
direct use in most cases.  Thus it is very natural to fix unsigned
design errors in standard structs -- you have to check bounds when
converting, and the bounds usually don't go above INT16_MAX, so you
can use signed types in your own structs.

gpt->gpt_entries and the index variable ('index') for the loop that
counts it down actually have the correct type (int), so point (1)
is incorrect -- a negative or zero initial index just 

svn commit: r298694 - head/sys/dev/hyperv/netvsc

2016-04-27 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Apr 27 06:49:16 2016
New Revision: 298694
URL: https://svnweb.freebsd.org/changeset/base/298694

Log:
  hyperv/hn: Add stat for # of chimney sending tries
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.h
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Apr 27 05:45:14 2016
(r298693)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Apr 27 06:49:16 2016
(r298694)
@@ -1211,6 +1211,7 @@ struct hn_tx_ring {
u_long  hn_send_failed;
u_long  hn_txdma_failed;
u_long  hn_tx_collapsed;
+   u_long  hn_tx_chimney_tried;
u_long  hn_tx_chimney;
u_long  hn_pkts;
 

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Wed Apr 27 05:45:14 
2016(r298693)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Wed Apr 27 06:49:16 
2016(r298694)
@@ -1004,6 +1004,7 @@ hn_encap(struct hn_tx_ring *txr, struct 
netvsc_dev *net_dev = txr->hn_sc->net_dev;
uint32_t send_buf_section_idx;
 
+   txr->hn_tx_chimney_tried++;
send_buf_section_idx =
hv_nv_get_next_send_section(net_dev);
if (send_buf_section_idx !=
@@ -2595,6 +2596,10 @@ hn_create_tx_data(struct hn_softc *sc, i
CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc,
__offsetof(struct hn_tx_ring, hn_tx_chimney),
hn_tx_stat_ulong_sysctl, "LU", "# of chimney send");
+   SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney_tried",
+   CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc,
+   __offsetof(struct hn_tx_ring, hn_tx_chimney_tried),
+   hn_tx_stat_ulong_sysctl, "LU", "# of chimney send tries");
SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_cnt",
CTLFLAG_RD, >hn_tx_ring[0].hn_txdesc_cnt, 0,
"# of total TX descs");
___
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"