svn commit: r332057 - head

2018-04-04 Thread Ed Maste
Author: emaste
Date: Thu Apr  5 03:26:42 2018
New Revision: 332057
URL: https://svnweb.freebsd.org/changeset/base/332057

Log:
  remove special handling for stale ptrace dependencies
  
  r318957 added special handling for stale ptrace dependency files to
  support a -DNO_CLEAN build in a tree last built before r305012.  That
  revision is now over a year and a half old, so retire the special case.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Apr  5 00:41:33 2018(r332056)
+++ head/Makefile.inc1  Thu Apr  5 03:26:42 2018(r332057)
@@ -804,10 +804,9 @@ _sanity_check: .PHONY .MAKE
 _cleanobj_fast_depend_hack: .PHONY
 # Syscall stubs rewritten in C and obsolete MD assembly implementations
 # Date  SVN Rev  Syscalls
-# 20160829  r305012  ptrace
 # 20170624  r320278  fstat fstatat fstatfs getdirentries getfsstat statfs
 # 20180404  r332048  sigreturn
-.for f in fstat fstatat fstatfs getdirentries getfsstat ptrace sigreturn statfs
+.for f in fstat fstatat fstatfs getdirentries getfsstat sigreturn statfs
 .if exists(${OBJTOP}/lib/libc/.depend.${f}.o)
@if egrep -qw '${f}\.[sS]' \
${OBJTOP}/lib/libc/.depend.${f}.o; then \
___
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: r332056 - stable/11/stand/i386/libi386

2018-04-04 Thread Kyle Evans
Author: kevans
Date: Thu Apr  5 00:41:33 2018
New Revision: 332056
URL: https://svnweb.freebsd.org/changeset/base/332056

Log:
  MFC r331718: stand: Add workaround for HP BIOS issues
  
  hrs@ and kuriyama@ have found that on some HP BIOS, a system will fail to
  boot immediately after installation with the claim that it can't work out
  which disk they are booting from.
  
  They tracked it down to a buffer overrun, and found that it could be
  alleviated by doing a dummy read before-hand.

Modified:
  stable/11/stand/i386/libi386/biosdisk.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/i386/libi386/biosdisk.c
==
--- stable/11/stand/i386/libi386/biosdisk.c Thu Apr  5 00:32:01 2018
(r332055)
+++ stable/11/stand/i386/libi386/biosdisk.c Thu Apr  5 00:41:33 2018
(r332056)
@@ -122,6 +122,8 @@ static int nbdinfo = 0;
 
 #defineBD(dev) (bdinfo[(dev)->d_unit])
 
+static void bd_io_workaround(struct disk_devdesc *dev);
+
 static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks,
 caddr_t dest);
 static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks,
@@ -726,6 +728,15 @@ bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int 
 return (0);
 }
 
+static void
+bd_io_workaround(struct disk_devdesc *dev)
+{
+   uint8_t buf[8 * 1024];
+
+   bd_edd_io(dev, 0x, 1, (caddr_t)buf, 0);
+}
+
+
 static int
 bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int 
write)
 {
@@ -738,6 +749,17 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks
 
 resid = blks;
 p = dest;
+
+/*
+ * Workaround for a problem with some HP ProLiant BIOS failing to work out
+ * the boot disk after installation. hrs and kuriyama discovered this
+ * problem with an HP ProLiant DL320e Gen 8 with a 3TB HDD, and discovered
+ * that an int13h call seems to cause a buffer overrun in the bios. The
+ * problem is alleviated by doing an extra read before the buggy read. It
+ * is not immediately known whether other models are similarly affected.
+ */
+if (dblk >= 0x1)
+   bd_io_workaround(dev);
 
 /* Decide whether we have to bounce */
 if (VTOP(dest) >> 20 != 0 || (BD(dev).bd_unit < 0x80 &&
___
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: r332055 - head/sys/ufs/ffs

2018-04-04 Thread Kirk McKusick
Author: mckusick
Date: Thu Apr  5 00:32:01 2018
New Revision: 332055
URL: https://svnweb.freebsd.org/changeset/base/332055

Log:
  Renumber soft-update types starting at 1 instead of 0 to avoid confusion
  of zero'ed memory appearing to have a valid soft-update type.
  
  Also correct some comments.
  
  Reviewed by: kib

Modified:
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ffs/softdep.h

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Thu Apr  5 00:03:38 2018
(r332054)
+++ head/sys/ufs/ffs/ffs_softdep.c  Thu Apr  5 00:32:01 2018
(r332055)
@@ -688,6 +688,7 @@ static MALLOC_DEFINE(M_MOUNTDATA, "softdep", "Softdep 
  * MUST match the defines above, such that memtype[D_XXX] == M_XXX
  */
 static struct malloc_type *memtype[] = {
+   NULL,
M_PAGEDEP,
M_INODEDEP,
M_BMSAFEMAP,
@@ -724,7 +725,8 @@ static struct malloc_type *memtype[] = {
  * Names of malloc types.
  */
 #define TYPENAME(type)  \
-   ((unsigned)(type) <= D_LAST ? memtype[type]->ks_shortdesc : "???")
+   ((unsigned)(type) <= D_LAST && (unsigned)(type) >= D_FIRST ? \
+   memtype[type]->ks_shortdesc : "???")
 /*
  * End system adaptation definitions.
  */
@@ -12960,7 +12962,7 @@ flush_newblk_dep(vp, mp, lbn)
break;
}
if (newblk->nb_list.wk_type != D_ALLOCDIRECT)
-   panic("flush_newblk_deps: Bad newblk %p", newblk);
+   panic("flush_newblk_dep: Bad newblk %p", newblk);
/*
 * Flush the journal.
 */

Modified: head/sys/ufs/ffs/softdep.h
==
--- head/sys/ufs/ffs/softdep.h  Thu Apr  5 00:03:38 2018(r332054)
+++ head/sys/ufs/ffs/softdep.h  Thu Apr  5 00:32:01 2018(r332055)
@@ -146,37 +146,45 @@
 
 #defineALLCOMPLETE (ATTACHED | COMPLETE | DEPCOMPLETE)
 
+#define PRINT_SOFTDEP_FLAGS "\20\27writesucceeded\26unlinkonlist" \
+   "\25unlinkprev\24unlinknext\23unlinked\22ondeplist\21iowaiting" \
+   "\20onworklist\17extdata\16ufs1fmt\15inprogress\14newblock" \
+   "\13delayedfree\12iostarted\11goingaway\10dirchg\7rmdir\6mkdir_body" \
+   "\5mkdir_parent\4depcomplete\3complete\2undone\1attached"
+
 /*
  * Values for each of the soft dependency types.
  */
-#defineD_PAGEDEP   0
-#defineD_INODEDEP  1
-#defineD_BMSAFEMAP 2
-#defineD_NEWBLK3
-#defineD_ALLOCDIRECT   4
-#defineD_INDIRDEP  5
-#defineD_ALLOCINDIR6
-#defineD_FREEFRAG  7
-#defineD_FREEBLKS  8
-#defineD_FREEFILE  9
-#defineD_DIRADD10
-#defineD_MKDIR 11
-#defineD_DIRREM12
-#defineD_NEWDIRBLK 13
-#defineD_FREEWORK  14
-#defineD_FREEDEP   15
-#defineD_JADDREF   16
-#defineD_JREMREF   17
-#defineD_JMVREF18
-#defineD_JNEWBLK   19
-#defineD_JFREEBLK  20
-#defineD_JFREEFRAG 21
-#defineD_JSEG  22
-#defineD_JSEGDEP   23
-#defineD_SBDEP 24
-#defineD_JTRUNC25
-#defineD_JFSYNC26
-#defineD_SENTINEL  27
+#defineD_UNUSED0
+#defineD_FIRST D_PAGEDEP
+#defineD_PAGEDEP   1
+#defineD_INODEDEP  2
+#defineD_BMSAFEMAP 3
+#defineD_NEWBLK4
+#defineD_ALLOCDIRECT   5
+#defineD_INDIRDEP  6
+#defineD_ALLOCINDIR7
+#defineD_FREEFRAG  8
+#defineD_FREEBLKS  9
+#defineD_FREEFILE  10
+#defineD_DIRADD11
+#defineD_MKDIR 12
+#defineD_DIRREM13
+#defineD_NEWDIRBLK 14
+#defineD_FREEWORK  15
+#defineD_FREEDEP   16
+#defineD_JADDREF   17
+#defineD_JREMREF   18
+#defineD_JMVREF19
+#defineD_JNEWBLK   20
+#defineD_JFREEBLK  21
+#defineD_JFREEFRAG 22
+#defineD_JSEG  23
+#defineD_JSEGDEP   24
+#defineD_SBDEP 25
+#defineD_JTRUNC26
+#defineD_JFSYNC27
+#defineD_SENTINEL  28
 #defineD_LAST  D_SENTINEL
 
 /*
@@ -469,17 +477,17 @@ struct allocdirect {
  * A single "indirdep" structure manages all allocation dependencies for
  * pointers in an indirect block. The up-to-date state of the indirect
  * block is stored in ir_savedata. The set of pointers that may be safely
- * written to the disk is stored in ir_safecopy. The state field is used
+ * written to the disk is stored in ir_savebp. The state field is used
  * only to track whether the buffer is currentl

svn commit: r332054 - stable/9/sys/dev/qlxgbe

2018-04-04 Thread David C Somayajulu
Author: davidcs
Date: Thu Apr  5 00:03:38 2018
New Revision: 332054
URL: https://svnweb.freebsd.org/changeset/base/332054

Log:
  MFC r331739
  1. Add additional debug prints.
  2. Break transmit when IFF_DRV_RUNNING is OFF.
  3. set desc_count=0 for default case in switch in ql_rcv_isr()

Modified:
  stable/9/sys/dev/qlxgbe/ql_dbg.h
  stable/9/sys/dev/qlxgbe/ql_hw.c
  stable/9/sys/dev/qlxgbe/ql_ioctl.c
  stable/9/sys/dev/qlxgbe/ql_isr.c
  stable/9/sys/dev/qlxgbe/ql_os.c
  stable/9/sys/dev/qlxgbe/ql_ver.h
Directory Properties:
  stable/9/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h
==
--- stable/9/sys/dev/qlxgbe/ql_dbg.hWed Apr  4 23:58:35 2018
(r332053)
+++ stable/9/sys/dev/qlxgbe/ql_dbg.hThu Apr  5 00:03:38 2018
(r332054)
@@ -57,6 +57,7 @@ extern void ql_dump_buf32(qla_host_t *ha, const char *
 #define INJCT_SGL_RCV_INV_DESC_COUNT   0xD
 #define INJCT_SGL_LRO_INV_DESC_COUNT   0xE
 #define INJCT_PEER_PORT_FAILURE_ERR_RECOVERY   0xF
+#define INJCT_TXBUF_MBUF_NON_NULL  0x00010
 
 #ifdef QL_DBG
 

Modified: stable/9/sys/dev/qlxgbe/ql_hw.c
==
--- stable/9/sys/dev/qlxgbe/ql_hw.c Wed Apr  4 23:58:35 2018
(r332053)
+++ stable/9/sys/dev/qlxgbe/ql_hw.c Thu Apr  5 00:03:38 2018
(r332054)
@@ -1088,7 +1088,11 @@ ql_hw_add_sysctls(qla_host_t *ha)
 "\t\t\t 8: mbx: mailbox command failure\n"
 "\t\t\t 9: heartbeat failure\n"
 "\t\t\t A: temperature failure\n"
-   "\t\t\t 11: m_getcl or m_getjcl failure\n" );
+   "\t\t\t 11: m_getcl or m_getjcl failure\n"
+   "\t\t\t 13: Invalid Descriptor Count in SGL Receive\n"
+   "\t\t\t 14: Invalid Descriptor Count in LRO Receive\n"
+   "\t\t\t 15: peer port error recovery failure\n"
+   "\t\t\t 16: tx_buf[next_prod_index].mbuf != NULL\n" );
 
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
@@ -2904,7 +2908,7 @@ ql_del_hw_if_exit:
 void
 qla_confirm_9kb_enable(qla_host_t *ha)
 {
-   uint32_t supports_9kb = 0;
+// uint32_t supports_9kb = 0;
 
ha->hw.mbx_intr_mask_offset = READ_REG32(ha, Q8_MBOX_INT_MASK_MSIX);
 
@@ -2912,10 +2916,12 @@ qla_confirm_9kb_enable(qla_host_t *ha)
WRITE_REG32(ha, Q8_MBOX_INT_ENABLE, BIT_2);
WRITE_REG32(ha, ha->hw.mbx_intr_mask_offset, 0x0);
 
+#if 0
qla_get_nic_partition(ha, &supports_9kb, NULL);
 
if (!supports_9kb)
-   ha->hw.enable_9kb = 0;
+#endif
+   ha->hw.enable_9kb = 0;
 
return;
 }
@@ -3587,6 +3593,13 @@ qla_hw_all_mcast(qla_host_t *ha, uint32_t add_mcast)
bcopy(ha->hw.mcast[i].addr, mcast, ETHER_ADDR_LEN);
mcast = mcast + ETHER_ADDR_LEN;
count++;
+
+   device_printf(ha->pci_dev,
+   "%s: %x:%x:%x:%x:%x:%x \n",
+   __func__, ha->hw.mcast[i].addr[0],
+   ha->hw.mcast[i].addr[1], 
ha->hw.mcast[i].addr[2],
+   ha->hw.mcast[i].addr[3], 
ha->hw.mcast[i].addr[4],
+   ha->hw.mcast[i].addr[5]);

if (count == Q8_MAX_MAC_ADDRS) {
if (qla_config_mac_addr(ha, ha->hw.mac_addr_arr,
@@ -3823,6 +3836,18 @@ ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx)
}
 
hw_tx_cntxt->txr_free += comp_count;
+
+   if (hw_tx_cntxt->txr_free > NUM_TX_DESCRIPTORS)
+   device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d txr_free = %d"
+   "txr_next = %d txr_comp = %d\n", __func__, __LINE__,
+   txr_idx, hw_tx_cntxt->txr_free,
+   hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp);
+
+   QL_ASSERT(ha, (hw_tx_cntxt->txr_free <= NUM_TX_DESCRIPTORS), \
+   ("%s [%d]: txr_idx = %d txr_free = %d txr_next = %d txr_comp = 
%d\n",\
+   __func__, __LINE__, txr_idx, hw_tx_cntxt->txr_free, \
+   hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp));
+   
return;
 }
 
@@ -3959,7 +3984,9 @@ qla_init_nic_func(qla_host_t *ha)
 
 if (err) {
 device_printf(dev, "%s: failed [0x%08x]\n", __func__, err);
-}
+} else {
+device_printf(dev, "%s: successful\n", __func__);
+   }
 
 return 0;
 }

Modified: stable/9/sys/dev/qlxgbe/ql_ioctl.c
==
--- stable/9/sys/dev/qlxgbe/ql_ioctl.c  Wed Apr  4 23:58:35 2018
(r332053)
+++ stable/9/sys/dev/qlxgbe/ql_io

svn commit: r332053 - stable/10/sys/dev/qlxgbe

2018-04-04 Thread David C Somayajulu
Author: davidcs
Date: Wed Apr  4 23:58:35 2018
New Revision: 332053
URL: https://svnweb.freebsd.org/changeset/base/332053

Log:
  MFC r331739
  1. Add additional debug prints.
  2. Break transmit when IFF_DRV_RUNNING is OFF.
  3. set desc_count=0 for default case in switch in ql_rcv_isr()

Modified:
  stable/10/sys/dev/qlxgbe/ql_dbg.h
  stable/10/sys/dev/qlxgbe/ql_hw.c
  stable/10/sys/dev/qlxgbe/ql_ioctl.c
  stable/10/sys/dev/qlxgbe/ql_isr.c
  stable/10/sys/dev/qlxgbe/ql_os.c
  stable/10/sys/dev/qlxgbe/ql_ver.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/qlxgbe/ql_dbg.h
==
--- stable/10/sys/dev/qlxgbe/ql_dbg.h   Wed Apr  4 23:53:29 2018
(r332052)
+++ stable/10/sys/dev/qlxgbe/ql_dbg.h   Wed Apr  4 23:58:35 2018
(r332053)
@@ -57,6 +57,7 @@ extern void ql_dump_buf32(qla_host_t *ha, const char *
 #define INJCT_SGL_RCV_INV_DESC_COUNT   0xD
 #define INJCT_SGL_LRO_INV_DESC_COUNT   0xE
 #define INJCT_PEER_PORT_FAILURE_ERR_RECOVERY   0xF
+#define INJCT_TXBUF_MBUF_NON_NULL  0x00010
 
 #ifdef QL_DBG
 

Modified: stable/10/sys/dev/qlxgbe/ql_hw.c
==
--- stable/10/sys/dev/qlxgbe/ql_hw.cWed Apr  4 23:53:29 2018
(r332052)
+++ stable/10/sys/dev/qlxgbe/ql_hw.cWed Apr  4 23:58:35 2018
(r332053)
@@ -1088,7 +1088,11 @@ ql_hw_add_sysctls(qla_host_t *ha)
 "\t\t\t 8: mbx: mailbox command failure\n"
 "\t\t\t 9: heartbeat failure\n"
 "\t\t\t A: temperature failure\n"
-   "\t\t\t 11: m_getcl or m_getjcl failure\n" );
+   "\t\t\t 11: m_getcl or m_getjcl failure\n"
+   "\t\t\t 13: Invalid Descriptor Count in SGL Receive\n"
+   "\t\t\t 14: Invalid Descriptor Count in LRO Receive\n"
+   "\t\t\t 15: peer port error recovery failure\n"
+   "\t\t\t 16: tx_buf[next_prod_index].mbuf != NULL\n" );
 
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
@@ -2904,7 +2908,7 @@ ql_del_hw_if_exit:
 void
 qla_confirm_9kb_enable(qla_host_t *ha)
 {
-   uint32_t supports_9kb = 0;
+// uint32_t supports_9kb = 0;
 
ha->hw.mbx_intr_mask_offset = READ_REG32(ha, Q8_MBOX_INT_MASK_MSIX);
 
@@ -2912,10 +2916,12 @@ qla_confirm_9kb_enable(qla_host_t *ha)
WRITE_REG32(ha, Q8_MBOX_INT_ENABLE, BIT_2);
WRITE_REG32(ha, ha->hw.mbx_intr_mask_offset, 0x0);
 
+#if 0
qla_get_nic_partition(ha, &supports_9kb, NULL);
 
if (!supports_9kb)
-   ha->hw.enable_9kb = 0;
+#endif
+   ha->hw.enable_9kb = 0;
 
return;
 }
@@ -3587,6 +3593,13 @@ qla_hw_all_mcast(qla_host_t *ha, uint32_t add_mcast)
bcopy(ha->hw.mcast[i].addr, mcast, ETHER_ADDR_LEN);
mcast = mcast + ETHER_ADDR_LEN;
count++;
+
+   device_printf(ha->pci_dev,
+   "%s: %x:%x:%x:%x:%x:%x \n",
+   __func__, ha->hw.mcast[i].addr[0],
+   ha->hw.mcast[i].addr[1], 
ha->hw.mcast[i].addr[2],
+   ha->hw.mcast[i].addr[3], 
ha->hw.mcast[i].addr[4],
+   ha->hw.mcast[i].addr[5]);

if (count == Q8_MAX_MAC_ADDRS) {
if (qla_config_mac_addr(ha, ha->hw.mac_addr_arr,
@@ -3823,6 +3836,18 @@ ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx)
}
 
hw_tx_cntxt->txr_free += comp_count;
+
+   if (hw_tx_cntxt->txr_free > NUM_TX_DESCRIPTORS)
+   device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d txr_free = %d"
+   "txr_next = %d txr_comp = %d\n", __func__, __LINE__,
+   txr_idx, hw_tx_cntxt->txr_free,
+   hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp);
+
+   QL_ASSERT(ha, (hw_tx_cntxt->txr_free <= NUM_TX_DESCRIPTORS), \
+   ("%s [%d]: txr_idx = %d txr_free = %d txr_next = %d txr_comp = 
%d\n",\
+   __func__, __LINE__, txr_idx, hw_tx_cntxt->txr_free, \
+   hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp));
+   
return;
 }
 
@@ -3959,7 +3984,9 @@ qla_init_nic_func(qla_host_t *ha)
 
 if (err) {
 device_printf(dev, "%s: failed [0x%08x]\n", __func__, err);
-}
+} else {
+device_printf(dev, "%s: successful\n", __func__);
+   }
 
 return 0;
 }

Modified: stable/10/sys/dev/qlxgbe/ql_ioctl.c
==
--- stable/10/sys/dev/qlxgbe/ql_ioctl.c Wed Apr  4 23:53:29 2018
(r332052)
+++ stable/10/sys/dev/qlxgbe/ql_ioctl.c Wed Apr  4 23:58:

svn commit: r332052 - stable/11/sys/dev/qlxgbe

2018-04-04 Thread David C Somayajulu
Author: davidcs
Date: Wed Apr  4 23:53:29 2018
New Revision: 332052
URL: https://svnweb.freebsd.org/changeset/base/332052

Log:
  MFC r331739
  1. Add additional debug prints.
  2. Break transmit when IFF_DRV_RUNNING is OFF.
  3. set desc_count=0 for default case in switch in ql_rcv_isr()

Modified:
  stable/11/sys/dev/qlxgbe/ql_dbg.h
  stable/11/sys/dev/qlxgbe/ql_hw.c
  stable/11/sys/dev/qlxgbe/ql_ioctl.c
  stable/11/sys/dev/qlxgbe/ql_isr.c
  stable/11/sys/dev/qlxgbe/ql_os.c
  stable/11/sys/dev/qlxgbe/ql_ver.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/qlxgbe/ql_dbg.h
==
--- stable/11/sys/dev/qlxgbe/ql_dbg.h   Wed Apr  4 23:30:19 2018
(r332051)
+++ stable/11/sys/dev/qlxgbe/ql_dbg.h   Wed Apr  4 23:53:29 2018
(r332052)
@@ -57,6 +57,7 @@ extern void ql_dump_buf32(qla_host_t *ha, const char *
 #define INJCT_SGL_RCV_INV_DESC_COUNT   0xD
 #define INJCT_SGL_LRO_INV_DESC_COUNT   0xE
 #define INJCT_PEER_PORT_FAILURE_ERR_RECOVERY   0xF
+#define INJCT_TXBUF_MBUF_NON_NULL  0x00010
 
 #ifdef QL_DBG
 

Modified: stable/11/sys/dev/qlxgbe/ql_hw.c
==
--- stable/11/sys/dev/qlxgbe/ql_hw.cWed Apr  4 23:30:19 2018
(r332051)
+++ stable/11/sys/dev/qlxgbe/ql_hw.cWed Apr  4 23:53:29 2018
(r332052)
@@ -1088,7 +1088,11 @@ ql_hw_add_sysctls(qla_host_t *ha)
 "\t\t\t 8: mbx: mailbox command failure\n"
 "\t\t\t 9: heartbeat failure\n"
 "\t\t\t A: temperature failure\n"
-   "\t\t\t 11: m_getcl or m_getjcl failure\n" );
+   "\t\t\t 11: m_getcl or m_getjcl failure\n"
+   "\t\t\t 13: Invalid Descriptor Count in SGL Receive\n"
+   "\t\t\t 14: Invalid Descriptor Count in LRO Receive\n"
+   "\t\t\t 15: peer port error recovery failure\n"
+   "\t\t\t 16: tx_buf[next_prod_index].mbuf != NULL\n" );
 
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
@@ -2904,7 +2908,7 @@ ql_del_hw_if_exit:
 void
 qla_confirm_9kb_enable(qla_host_t *ha)
 {
-   uint32_t supports_9kb = 0;
+// uint32_t supports_9kb = 0;
 
ha->hw.mbx_intr_mask_offset = READ_REG32(ha, Q8_MBOX_INT_MASK_MSIX);
 
@@ -2912,10 +2916,12 @@ qla_confirm_9kb_enable(qla_host_t *ha)
WRITE_REG32(ha, Q8_MBOX_INT_ENABLE, BIT_2);
WRITE_REG32(ha, ha->hw.mbx_intr_mask_offset, 0x0);
 
+#if 0
qla_get_nic_partition(ha, &supports_9kb, NULL);
 
if (!supports_9kb)
-   ha->hw.enable_9kb = 0;
+#endif
+   ha->hw.enable_9kb = 0;
 
return;
 }
@@ -3587,6 +3593,13 @@ qla_hw_all_mcast(qla_host_t *ha, uint32_t add_mcast)
bcopy(ha->hw.mcast[i].addr, mcast, ETHER_ADDR_LEN);
mcast = mcast + ETHER_ADDR_LEN;
count++;
+
+   device_printf(ha->pci_dev,
+   "%s: %x:%x:%x:%x:%x:%x \n",
+   __func__, ha->hw.mcast[i].addr[0],
+   ha->hw.mcast[i].addr[1], 
ha->hw.mcast[i].addr[2],
+   ha->hw.mcast[i].addr[3], 
ha->hw.mcast[i].addr[4],
+   ha->hw.mcast[i].addr[5]);

if (count == Q8_MAX_MAC_ADDRS) {
if (qla_config_mac_addr(ha, ha->hw.mac_addr_arr,
@@ -3823,6 +3836,18 @@ ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx)
}
 
hw_tx_cntxt->txr_free += comp_count;
+
+   if (hw_tx_cntxt->txr_free > NUM_TX_DESCRIPTORS)
+   device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d txr_free = %d"
+   "txr_next = %d txr_comp = %d\n", __func__, __LINE__,
+   txr_idx, hw_tx_cntxt->txr_free,
+   hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp);
+
+   QL_ASSERT(ha, (hw_tx_cntxt->txr_free <= NUM_TX_DESCRIPTORS), \
+   ("%s [%d]: txr_idx = %d txr_free = %d txr_next = %d txr_comp = 
%d\n",\
+   __func__, __LINE__, txr_idx, hw_tx_cntxt->txr_free, \
+   hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp));
+   
return;
 }
 
@@ -3959,7 +3984,9 @@ qla_init_nic_func(qla_host_t *ha)
 
 if (err) {
 device_printf(dev, "%s: failed [0x%08x]\n", __func__, err);
-}
+} else {
+device_printf(dev, "%s: successful\n", __func__);
+   }
 
 return 0;
 }

Modified: stable/11/sys/dev/qlxgbe/ql_ioctl.c
==
--- stable/11/sys/dev/qlxgbe/ql_ioctl.c Wed Apr  4 23:30:19 2018
(r332051)
+++ stable/11/sys/dev/qlxgbe/ql_ioctl.c Wed Apr  4 23:53:

svn commit: r332051 - stable/11

2018-04-04 Thread Kyle Evans
Author: kevans
Date: Wed Apr  4 23:30:19 2018
New Revision: 332051
URL: https://svnweb.freebsd.org/changeset/base/332051

Log:
  Record-only MFC of r325365, r325564
  
  r325365 fixed a bug in patch(1) that would cause a match if we ran out of
  context, say, at the beginning/end of a file. r325564 reverted it at the
  request of antoine until an exp-run could be completed to fix all of the
  ports with broken patches.
  
  r325365 was later committed as r326084, which has already been MFC'd.

Modified:
Directory Properties:
  stable/11/   (props changed)
___
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: r332050 - head/sys/dev/cxgbe

2018-04-04 Thread Navdeep Parhar
Author: np
Date: Wed Apr  4 22:52:24 2018
New Revision: 332050
URL: https://svnweb.freebsd.org/changeset/base/332050

Log:
  cxgbe(4): Always display an error message if SIOCSIFFLAGS will leave
  IFF_UP and IFF_DRV_RUNNING out of sync.  ifhwioctl in the kernel pays no
  attention to the return code from the driver ioctl during SIOCSIFFLAGS
  so these messages are the only indication that the ioctl was called but
  failed.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

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

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cWed Apr  4 22:46:30 2018
(r332049)
+++ head/sys/dev/cxgbe/t4_main.cWed Apr  4 22:52:24 2018
(r332050)
@@ -1636,8 +1636,13 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd
 redo_sifflags:
rc = begin_synchronized_op(sc, vi,
can_sleep ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4flg");
-   if (rc)
+   if (rc) {
+   if_printf(ifp, "%ssleepable synch operation failed: %d."
+   "  if_flags 0x%08x, if_drv_flags 0x%08x\n",
+   can_sleep ? "" : "non-", rc, ifp->if_flags,
+   ifp->if_drv_flags);
return (rc);
+   }
 
if (ifp->if_flags & IFF_UP) {
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
@@ -4306,8 +4311,13 @@ cxgbe_uninit_synchronized(struct vi_info *vi)
ASSERT_SYNCHRONIZED_OP(sc);
 
if (!(vi->flags & VI_INIT_DONE)) {
-   KASSERT(!(ifp->if_drv_flags & IFF_DRV_RUNNING),
-   ("uninited VI is running"));
+   if (__predict_false(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+   KASSERT(0, ("uninited VI is running"));
+   if_printf(ifp, "uninited VI with running ifnet.  "
+   "vi->flags 0x%016lx, if_flags 0x%08x, "
+   "if_drv_flags 0x%08x\n", vi->flags, ifp->if_flags,
+   ifp->if_drv_flags);
+   }
return (0);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332049 - head

2018-04-04 Thread Brooks Davis
Author: brooks
Date: Wed Apr  4 22:46:30 2018
New Revision: 332049
URL: https://svnweb.freebsd.org/changeset/base/332049

Log:
  Allow -DNO_CLEAN builds over r332048.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Apr  4 22:45:08 2018(r332048)
+++ head/Makefile.inc1  Wed Apr  4 22:46:30 2018(r332049)
@@ -802,11 +802,12 @@ _sanity_check: .PHONY .MAKE
 # tree changes, particularly with respect to removing source files and
 # replacing generated files.  Handle these cases here in an ad-hoc fashion.
 _cleanobj_fast_depend_hack: .PHONY
-# Syscall stubs rewritten in C
+# Syscall stubs rewritten in C and obsolete MD assembly implementations
 # Date  SVN Rev  Syscalls
 # 20160829  r305012  ptrace
 # 20170624  r320278  fstat fstatat fstatfs getdirentries getfsstat statfs
-.for f in fstat fstatat fstatfs getdirentries getfsstat ptrace statfs  
 
+# 20180404  r332048  sigreturn
+.for f in fstat fstatat fstatfs getdirentries getfsstat ptrace sigreturn statfs
 .if exists(${OBJTOP}/lib/libc/.depend.${f}.o)
@if egrep -qw '${f}\.[sS]' \
${OBJTOP}/lib/libc/.depend.${f}.o; then \
___
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: r332048 - in head/lib/libc: aarch64/sys amd64/sys arm/sys i386/sys riscv/sys

2018-04-04 Thread Brooks Davis
Author: brooks
Date: Wed Apr  4 22:45:08 2018
New Revision: 332048
URL: https://svnweb.freebsd.org/changeset/base/332048

Log:
  Remove architecture specific sigreturn.S files.
  
  All of these files are identical (modulo license blocks and VCS IDs) to
  the files generated by lib/libc/sys/Makefile.inc and serve no purpose.
  
  Reported by:  Ali Mashtizadeh 
  Reviewed by:  kib
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D14953

Deleted:
  head/lib/libc/aarch64/sys/sigreturn.S
  head/lib/libc/amd64/sys/sigreturn.S
  head/lib/libc/arm/sys/sigreturn.S
  head/lib/libc/i386/sys/sigreturn.S
  head/lib/libc/riscv/sys/sigreturn.S
Modified:
  head/lib/libc/aarch64/sys/Makefile.inc
  head/lib/libc/amd64/sys/Makefile.inc
  head/lib/libc/arm/sys/Makefile.inc
  head/lib/libc/i386/sys/Makefile.inc
  head/lib/libc/riscv/sys/Makefile.inc

Modified: head/lib/libc/aarch64/sys/Makefile.inc
==
--- head/lib/libc/aarch64/sys/Makefile.inc  Wed Apr  4 21:31:12 2018
(r332047)
+++ head/lib/libc/aarch64/sys/Makefile.inc  Wed Apr  4 22:45:08 2018
(r332048)
@@ -6,7 +6,6 @@ SRCS+=  __vdso_gettc.c
 
 MDASM= cerror.S \
shmat.S \
-   sigreturn.S \
syscall.S \
vfork.S
 

Modified: head/lib/libc/amd64/sys/Makefile.inc
==
--- head/lib/libc/amd64/sys/Makefile.incWed Apr  4 21:31:12 2018
(r332047)
+++ head/lib/libc/amd64/sys/Makefile.incWed Apr  4 22:45:08 2018
(r332048)
@@ -9,7 +9,7 @@ SRCS+=  \
amd64_set_gsbase.c
 
 MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \
-   sbrk.S setlogin.S sigreturn.S
+   sbrk.S setlogin.S
 
 # Don't generate default code for these syscalls:
 NOASM+=vfork.o

Modified: head/lib/libc/arm/sys/Makefile.inc
==
--- head/lib/libc/arm/sys/Makefile.inc  Wed Apr  4 21:31:12 2018
(r332047)
+++ head/lib/libc/arm/sys/Makefile.inc  Wed Apr  4 22:45:08 2018
(r332048)
@@ -2,7 +2,7 @@
 
 SRCS+= __vdso_gettc.c
 
-MDASM= Ovfork.S brk.S cerror.S sbrk.S shmat.S sigreturn.S syscall.S
+MDASM= Ovfork.S brk.S cerror.S sbrk.S shmat.S syscall.S
 
 # Don't generate default code for these syscalls:
 NOASM+=vfork.o

Modified: head/lib/libc/i386/sys/Makefile.inc
==
--- head/lib/libc/i386/sys/Makefile.inc Wed Apr  4 21:31:12 2018
(r332047)
+++ head/lib/libc/i386/sys/Makefile.inc Wed Apr  4 22:45:08 2018
(r332048)
@@ -8,7 +8,7 @@ SRCS+=  i386_get_fsbase.c i386_get_gsbase.c i386_get_io
i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c
 
 MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \
-   sbrk.S setlogin.S sigreturn.S syscall.S
+   sbrk.S setlogin.S syscall.S
 
 NOASM+=vfork.o
 

Modified: head/lib/libc/riscv/sys/Makefile.inc
==
--- head/lib/libc/riscv/sys/Makefile.incWed Apr  4 21:31:12 2018
(r332047)
+++ head/lib/libc/riscv/sys/Makefile.incWed Apr  4 22:45:08 2018
(r332048)
@@ -5,7 +5,6 @@ SRCS+=  trivial-vdso_tc.c
 #MDASM= ptrace.S
 MDASM= cerror.S \
shmat.S \
-   sigreturn.S \
syscall.S \
vfork.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"


svn commit: r332047 - in head/sys: dev/netmap net

2018-04-04 Thread Vincenzo Maffione
Author: vmaffione
Date: Wed Apr  4 21:31:12 2018
New Revision: 332047
URL: https://svnweb.freebsd.org/changeset/base/332047

Log:
  netmap: align if_ptnet guest driver to the upstream code (commit 0e15788)
  
  The change upgrades the driver to use the split Communication Status
  Block (CSB) format. In this way the variables written by the guest
  and read by the host are allocated in a different cacheline than
  the variables written by the host and read by the guest; this is
  needed to avoid cache thrashing.
  
  Approved by:  hrs (mentor)

Modified:
  head/sys/dev/netmap/if_ptnet.c
  head/sys/dev/netmap/netmap_kern.h
  head/sys/dev/netmap/netmap_pt.c
  head/sys/net/netmap_virt.h

Modified: head/sys/dev/netmap/if_ptnet.c
==
--- head/sys/dev/netmap/if_ptnet.c  Wed Apr  4 21:19:33 2018
(r332046)
+++ head/sys/dev/netmap/if_ptnet.c  Wed Apr  4 21:31:12 2018
(r332047)
@@ -88,10 +88,6 @@
 #include 
 #include 
 
-#ifndef PTNET_CSB_ALLOC
-#error "No support for on-device CSB"
-#endif
-
 #ifndef INET
 #error "INET not defined, cannot support offloadings"
 #endif
@@ -132,7 +128,8 @@ struct ptnet_queue {
struct  resource *irq;
void*cookie;
int kring_id;
-   struct ptnet_ring   *ptring;
+   struct ptnet_csb_gh *ptgh;
+   struct ptnet_csb_hg *pthg;
unsigned intkick;
struct mtx  lock;
struct buf_ring *bufring; /* for TX queues */
@@ -169,7 +166,8 @@ struct ptnet_softc {
unsigned intnum_tx_rings;
struct ptnet_queue  *queues;
struct ptnet_queue  *rxqueues;
-   struct ptnet_csb*csb;
+   struct ptnet_csb_gh*csb_gh;
+   struct ptnet_csb_hg*csb_hg;
 
unsigned intmin_tx_space;
 
@@ -323,33 +321,48 @@ ptnet_attach(device_t dev)
ptfeatures = bus_read_4(sc->iomem, PTNET_IO_PTFEAT); /* acked */
sc->ptfeatures = ptfeatures;
 
-   /* Allocate CSB and carry out CSB allocation protocol (CSBBAH first,
-* then CSBBAL). */
-   sc->csb = malloc(sizeof(struct ptnet_csb), M_DEVBUF,
-M_NOWAIT | M_ZERO);
-   if (sc->csb == NULL) {
+   num_tx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_TX_RINGS);
+   num_rx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_RX_RINGS);
+   sc->num_rings = num_tx_rings + num_rx_rings;
+   sc->num_tx_rings = num_tx_rings;
+
+   if (sc->num_rings * sizeof(struct ptnet_csb_gh) > PAGE_SIZE) {
+   device_printf(dev, "CSB cannot handle that many rings (%u)\n",
+   sc->num_rings);
+   err = ENOMEM;
+   goto err_path;
+   }
+
+   /* Allocate CSB and carry out CSB allocation protocol. */
+   sc->csb_gh = contigmalloc(2*PAGE_SIZE, M_DEVBUF, M_NOWAIT | M_ZERO,
+ (size_t)0, -1UL, PAGE_SIZE, 0);
+   if (sc->csb_gh == NULL) {
device_printf(dev, "Failed to allocate CSB\n");
err = ENOMEM;
goto err_path;
}
+   sc->csb_hg = (struct ptnet_csb_hg *)(((char *)sc->csb_gh) + PAGE_SIZE);
 
{
/*
 * We use uint64_t rather than vm_paddr_t since we
 * need 64 bit addresses even on 32 bit platforms.
 */
-   uint64_t paddr = vtophys(sc->csb);
+   uint64_t paddr = vtophys(sc->csb_gh);
 
-   bus_write_4(sc->iomem, PTNET_IO_CSBBAH,
-   (paddr >> 32) & 0x);
-   bus_write_4(sc->iomem, PTNET_IO_CSBBAL, paddr & 0x);
+   /* CSB allocation protocol: write to BAH first, then
+* to BAL (for both GH and HG sections). */
+   bus_write_4(sc->iomem, PTNET_IO_CSB_GH_BAH,
+   (paddr >> 32) & 0x);
+   bus_write_4(sc->iomem, PTNET_IO_CSB_GH_BAL,
+   paddr & 0x);
+   paddr = vtophys(sc->csb_hg);
+   bus_write_4(sc->iomem, PTNET_IO_CSB_HG_BAH,
+   (paddr >> 32) & 0x);
+   bus_write_4(sc->iomem, PTNET_IO_CSB_HG_BAL,
+   paddr & 0x);
}
 
-   num_tx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_TX_RINGS);
-   num_rx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_RX_RINGS);
-   sc->num_rings = num_tx_rings + num_rx_rings;
-   sc->num_tx_rings = num_tx_rings;
-
/* Allocate and initialize per-queue data structures. */
sc->queues = malloc(sizeof(struct ptnet_queue) * sc->num_rings,
M_DEVBUF, M_NOWAIT | M_ZERO);
@@ -365,7 +378,8 @@ ptnet_attach(device_t dev)
 

svn commit: r332046 - head/sys/dev/spibus

2018-04-04 Thread Ian Lepore
Author: ian
Date: Wed Apr  4 21:19:33 2018
New Revision: 332046
URL: https://svnweb.freebsd.org/changeset/base/332046

Log:
  Add a missing MODULE_DEPEND().

Modified:
  head/sys/dev/spibus/spigen.c

Modified: head/sys/dev/spibus/spigen.c
==
--- head/sys/dev/spibus/spigen.cWed Apr  4 21:12:35 2018
(r332045)
+++ head/sys/dev/spibus/spigen.cWed Apr  4 21:19:33 2018
(r332046)
@@ -456,3 +456,4 @@ static driver_t spigen_driver = {
 };
 
 DRIVER_MODULE(spigen, spibus, spigen_driver, spigen_devclass, 0, 0);
+MODULE_DEPEND(spigen, spibus, 1, 1, 1);
___
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: r332045 - head/sys/netinet

2018-04-04 Thread Ed Maste
Author: emaste
Date: Wed Apr  4 21:12:35 2018
New Revision: 332045
URL: https://svnweb.freebsd.org/changeset/base/332045

Log:
  Fix kernel memory disclosure in tcp_ctloutput
  
  strcpy was used to copy a string into a buffer copied to userland, which
  left uninitialized data after the terminating 0-byte.  Use the same
  approach as in tcp_subr.c: strncpy and explicit '\0'.
  
  admbugs:  765, 822
  MFC after:1 day
  Reported by:  Ilja Van Sprundel 
  Reported by:  Vlad Tsyrklevich
  Security: Kernel memory disclosure
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/netinet/tcp_usrreq.c

Modified: head/sys/netinet/tcp_usrreq.c
==
--- head/sys/netinet/tcp_usrreq.c   Wed Apr  4 20:29:55 2018
(r332044)
+++ head/sys/netinet/tcp_usrreq.c   Wed Apr  4 21:12:35 2018
(r332045)
@@ -1533,7 +1533,9 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt)
return (error);
} else if ((sopt->sopt_dir == SOPT_GET) && 
(sopt->sopt_name == TCP_FUNCTION_BLK)) {
-   strcpy(fsn.function_set_name, tp->t_fb->tfb_tcp_block_name);
+   strncpy(fsn.function_set_name, tp->t_fb->tfb_tcp_block_name,
+   TCP_FUNCTION_NAME_LEN_MAX);
+   fsn.function_set_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0';
fsn.pcbcnt = tp->t_fb->tfb_refcnt;
INP_WUNLOCK(inp);
error = sooptcopyout(sopt, &fsn, sizeof fsn);
___
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: r332044 - stable/11/share/termcap

2018-04-04 Thread Baptiste Daroussin
Author: bapt
Date: Wed Apr  4 20:29:55 2018
New Revision: 332044
URL: https://svnweb.freebsd.org/changeset/base/332044

Log:
  MFC r331005-r331006
  
  r331005:
  Fix tab vs space indentation
  
  r331006:
  Add termcap entries for the st terminal (https://st.suckless.org)

Modified:
  stable/11/share/termcap/termcap
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/termcap/termcap
==
--- stable/11/share/termcap/termcap Wed Apr  4 20:15:41 2018
(r332043)
+++ stable/11/share/termcap/termcap Wed Apr  4 20:29:55 2018
(r332044)
@@ -4664,24 +4664,61 @@ Eterm|Eterm Terminal Emulator (X11 Window System):\
 
 # Termcap for xterm-termite
 xterm-termite|VTE-based terminal:\
-:NP:am:hs:mi:ms:ut:xn:\
-:Co#256:co#80:it#8:li#24:pa#32767:\
-:@7=\EOF:@8=\EOM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:AL=\E[%dL:\
-:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:\
-:IC=\E[%d@:K2=\EOE:Km=\E[M:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:\
-:SA=\E[?7h:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ZH=\E[3m:\
-:ZR=\E[23m:al=\E[L:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\
-:ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\
-:cs=\E[%i%d;%dr:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=^J:\
-:ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
-:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
-:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kD=\E[3~:\
-:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:\
-:kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:\
-:me=\E[m:mr=\E[7m:nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:\
-:sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:ta=^I:te=\E[?1049l:\
-:ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\
-:up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:
+   :NP:am:hs:mi:ms:ut:xn:\
+   :Co#256:co#80:it#8:li#24:pa#32767:\
+   :@7=\EOF:@8=\EOM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:AL=\E[%dL:\
+   :DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:\
+   :IC=\E[%d@:K2=\EOE:Km=\E[M:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:\
+   :SA=\E[?7h:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ZH=\E[3m:\
+   :ZR=\E[23m:al=\E[L:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\
+   :ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\
+   :cs=\E[%i%d;%dr:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=^J:\
+   :ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
+   :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
+   :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kD=\E[3~:\
+   :kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:\
+   :kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:\
+   :me=\E[m:mr=\E[7m:nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:\
+   :sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:ta=^I:te=\E[?1049l:\
+   :ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\
+   :up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:
+
+# Termcap for st terminal taken from the st-0.8 sources
+st|simpleterm:\
+   :am:hs:mi:ms:xn:\
+   :co#80:it#8:li#24:\
+   :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
+   :K1=\E[1~:K2=\EOu:K3=\E[5~:K4=\E[4~:K5=\E[6~:LE=\E[%dD:\
+   :RI=\E[%dC:SF=\E[%dS:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:\
+   :bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\
+   :cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:\
+   :dl=\E[M:do=\n:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
+   :is=\E[4l\E>\E[?1034l:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\
+   :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\
+   :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:\
+   :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\
+   :ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[0m:mh=\E[2m:\
+   :mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:\
+   :sr=\EM:st=\EH:ta=^I:te=\E[?1049l:ti=\E[?1049h:ts=\E]0;:\
+   :ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\
+   :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?25h:
+
+st-256color|simpleterm with 256 colors:\
+   :cc:\
+   :Co#256:pa#32767:\
+   :AB=\E[48;5;%dm:AF=\E[38;5;%dm:\
+   
:..Ic=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\:\
+   :oc=\E]104\007:tc=st:
+
+st-meta|simpleterm with meta key:\
+   :km:\
+   :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\
+   :rs=\E[4l\E>\E[?1034h:tc=st:
+
+st-meta-256color|simpleterm with meta key and 256 colors:\
+   :km:\
+   :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\
+   :rs=\E[4l\E>\E[?1034h:tc=st-256color:
 
 #
 # END OF TERMCAP
___
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: r332043 - head/share/man/man9

2018-04-04 Thread Mark Johnston
Author: markj
Date: Wed Apr  4 20:15:41 2018
New Revision: 332043
URL: https://svnweb.freebsd.org/changeset/base/332043

Log:
  Typo.
  
  MFC after:3 days

Modified:
  head/share/man/man9/timeout.9

Modified: head/share/man/man9/timeout.9
==
--- head/share/man/man9/timeout.9   Wed Apr  4 19:58:25 2018
(r332042)
+++ head/share/man/man9/timeout.9   Wed Apr  4 20:15:41 2018
(r332043)
@@ -327,7 +327,6 @@ The
 .Fa drain
 function itself is called from the context of the completing callout
 i.e. softclock or hardclock, just like a callout itself.
-p
 .Pp
 The function
 .Fn callout_drain
___
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: r332042 - head/sys/compat/linux

2018-04-04 Thread Ed Maste
Author: emaste
Date: Wed Apr  4 19:58:25 2018
New Revision: 332042
URL: https://svnweb.freebsd.org/changeset/base/332042

Log:
  Fix kernel memory disclosure in linux_ioctl_socket
  
  strlcpy is used to copy a string into a buffer to be copied to userland,
  previously leaving uninitialized data after the terminating NUL.  Zero
  the buffer first to avoid a kernel memory disclosure.
  
  admbugs:  765, 811
  MFC after:1 day
  Reported by:  Ilja Van Sprundel 
  Reported by:  Vlad Tsyrklevich
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/linux/linux_ioctl.c

Modified: head/sys/compat/linux/linux_ioctl.c
==
--- head/sys/compat/linux/linux_ioctl.c Wed Apr  4 18:27:18 2018
(r332041)
+++ head/sys/compat/linux/linux_ioctl.c Wed Apr  4 19:58:25 2018
(r332042)
@@ -2478,6 +2478,7 @@ linux_ioctl_socket(struct thread *td, struct linux_ioc
printf("%s(): ioctl %d on %.*s\n", __func__,
args->cmd & 0x, LINUX_IFNAMSIZ, lifname);
 #endif
+   memset(ifname, 0, sizeof(ifname));
ifp = ifname_linux_to_bsd(td, lifname, ifname);
if (ifp == NULL)
return (EINVAL);
___
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: r332041 - svnadmin/conf

2018-04-04 Thread Alexander Motin
Author: mav
Date: Wed Apr  4 18:27:18 2018
New Revision: 332041
URL: https://svnweb.freebsd.org/changeset/base/332041

Log:
  Restore Sean Eric Fagan (sef) src commit bit.
  
  I (mav) will be his mentor.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessWed Apr  4 18:06:52 2018(r332040)
+++ svnadmin/conf/accessWed Apr  4 18:27:18 2018(r332041)
@@ -192,6 +192,7 @@ scf
 schweikh
 scottl
 se
+sef
 sephe
 sgalabov
 shurd

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Wed Apr  4 18:06:52 2018(r332040)
+++ svnadmin/conf/mentors   Wed Apr  4 18:27:18 2018(r332041)
@@ -27,6 +27,7 @@ mahrens   mckusick
 mjoras rstone
 peterj jhb Co-mentor: grog
 rgrimesgrehan
+sefmav
 slavashkib Co-mentor: hselasky
 slmken Co-mentor: scottl, ambrisko
 wosch  cem
___
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: r332040 - in stable/11: share/man/man4 sys/amd64/conf sys/conf sys/dev/ocs_fc sys/modules sys/modules/ocs_fc

2018-04-04 Thread Kenneth D. Merry
Author: ken
Date: Wed Apr  4 18:06:52 2018
New Revision: 332040
URL: https://svnweb.freebsd.org/changeset/base/332040

Log:
  MFC r331766, r331768:
  

r331766 | ken | 2018-03-30 09:28:25 -0600 (Fri, 30 Mar 2018) | 25 lines
  
Bring in the Broadcom/Emulex Fibre Channel driver, ocs_fc(4).
  
The ocs_fc(4) driver supports the following hardware:
  
Emulex 16/8G FC GEN 5 HBAS
LPe15004 FC Host Bus Adapters
LPe160XX FC Host Bus Adapters
  
Emulex 32/16G FC GEN 6 HBAS
LPe3100X FC Host Bus Adapters
LPe3200X FC Host Bus Adapters
  
The driver supports target and initiator mode, and also supports FC-Tape.
  
Note that the driver only currently works on little endian platforms.  It
is only included in the module build for amd64 and i386, and in GENERIC
on amd64 only.
  
Submitted by:   Ram Kishore Vegesna 
Reviewed by:mav
Relnotes:   yes
Sponsored by:   Broadcom
Differential Revision:  https://reviews.freebsd.org/D11423
  

r331768 | cem | 2018-03-30 10:44:54 -0600 (Fri, 30 Mar 2018) | 9 lines
  
ocs_fc(4): Fix GCC build (-Wredundant-decls)
  
These objects are defined earlier in the same file; an extern declaration
after definition is redundant.
  
Broken in r331766 (introduction of ocs_fc(4)).
  
Sponsored by:   Dell EMC Isilon
  

  
  Differential Revision:https://reviews.freebsd.org/D11423
  Relnotes: yes

Added:
  stable/11/share/man/man4/ocs_fc.4
 - copied unchanged from r331766, head/share/man/man4/ocs_fc.4
  stable/11/sys/dev/ocs_fc/
 - copied from r331766, head/sys/dev/ocs_fc/
  stable/11/sys/modules/ocs_fc/
 - copied from r331766, head/sys/modules/ocs_fc/
Modified:
  stable/11/share/man/man4/Makefile
  stable/11/sys/amd64/conf/GENERIC
  stable/11/sys/conf/files
  stable/11/sys/dev/ocs_fc/sli4.c
  stable/11/sys/modules/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/Makefile
==
--- stable/11/share/man/man4/Makefile   Wed Apr  4 17:45:05 2018
(r332039)
+++ stable/11/share/man/man4/Makefile   Wed Apr  4 18:06:52 2018
(r332040)
@@ -402,6 +402,7 @@ MAN=aac.4 \
${_nvram2env.4} \
${_nxge.4} \
oce.4 \
+   ocs_fc.4\
ohci.4 \
orm.4 \
ow.4 \

Copied: stable/11/share/man/man4/ocs_fc.4 (from r331766, 
head/share/man/man4/ocs_fc.4)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/share/man/man4/ocs_fc.4   Wed Apr  4 18:06:52 2018
(r332040, copy of r331766, head/share/man/man4/ocs_fc.4)
@@ -0,0 +1,194 @@
+.\" Copyright (c) 2017 Broadcom. All rights reserved.
+.\" The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries.
+.\"
+.\" 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.
+.\"
+.\" 3. Neither the name of the copyright holder nor the names of its 
contributors
+.\"may be used to endorse or promote products derived from this software
+.\"without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd March 30, 2018
+.Dt OCS_FC 4
+.Os
+.Sh NAME
+.Nm ocs_fc
+.Nd "Device driver for Emulex Fibre Channel Host Adapters"
+.Sh SYNOPSIS
+To compile this driver into the kernel, add this line to the
+kernel configuration file:
+.

svn commit: r332039 - stable/10/sys/compat/linux

2018-04-04 Thread Ed Maste
Author: emaste
Date: Wed Apr  4 17:45:05 2018
New Revision: 332039
URL: https://svnweb.freebsd.org/changeset/base/332039

Log:
  Fix build: correct variable names on stable/10
  
  r332032 merged r330356 from HEAD but did not account for a renamed
  variable (of a different type) between stable/10 and HEAD.  Further
  fix to r332036.

Modified:
  stable/10/sys/compat/linux/linux_ipc.c

Modified: stable/10/sys/compat/linux/linux_ipc.c
==
--- stable/10/sys/compat/linux/linux_ipc.c  Wed Apr  4 17:00:18 2018
(r332038)
+++ stable/10/sys/compat/linux/linux_ipc.c  Wed Apr  4 17:45:05 2018
(r332039)
@@ -664,7 +664,7 @@ linux_msgctl(struct thread *td, struct linux_msgctl_ar
struct l_msqid_ds linux_msqid;
struct msqid_ds bsd_msqid;
 
-   memset(&linux_msqid64, 0, sizeof(linux_msqid64));
+   memset(&linux_msqid, 0, sizeof(linux_msqid));
 
bsd_cmd = args->cmd & ~LINUX_IPC_64;
switch (bsd_cmd) {
@@ -796,8 +796,8 @@ linux_shmctl(struct thread *td, struct linux_shmctl_ar
int error;
 
memset(&linux_shm_info, 0, sizeof(linux_shm_info));
-   memset(&linux_shmid64, 0, sizeof(linux_shmid64));
-   memset(&linux_shminfo64, 0, sizeof(linux_shminfo64));
+   memset(&linux_shmid, 0, sizeof(linux_shmid));
+   memset(&linux_shminfo, 0, sizeof(linux_shminfo));
 
switch (args->cmd & ~LINUX_IPC_64) {
 
___
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: r332032 - stable/10/sys/compat/linux

2018-04-04 Thread Ed Maste
On 4 April 2018 at 10:12, Ed Maste  wrote:
> Author: emaste
> Date: Wed Apr  4 14:12:07 2018
> New Revision: 332032
> URL: https://svnweb.freebsd.org/changeset/base/332032
>
> Log:
>   MFC r330356 (eadler): sys/linux: Fix a few potential infoleaks in Linux IPC

stable/10 is still broken because of this change; I'll have a fix
committed soon.
___
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: r332038 - stable/11/etc/rc.d

2018-04-04 Thread Kyle Evans
Author: kevans
Date: Wed Apr  4 17:00:18 2018
New Revision: 332038
URL: https://svnweb.freebsd.org/changeset/base/332038

Log:
  MFC r328951: Refactor cleanvar to remove shell expansion vulnerability
  
  If any process creates a directory named "-P" in /var/run or
  /var/spool/lock it will cause the purgedir function to start to rm -r /.
  
  Simplify a lot of complicated shell logic by leveraging find(1).

Modified:
  stable/11/etc/rc.d/cleanvar
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/rc.d/cleanvar
==
--- stable/11/etc/rc.d/cleanvar Wed Apr  4 16:59:10 2018(r332037)
+++ stable/11/etc/rc.d/cleanvar Wed Apr  4 17:00:18 2018(r332038)
@@ -19,34 +19,6 @@ stop_cmd=":"
 extra_commands="reload"
 reload_cmd="${name}_start"
 
-purgedir()
-{
-   local dir file
-
-   if [ $# -eq 0 ]; then
-   purgedir .
-   else
-   for dir
-   do
-   (
-   cd "$dir" && for file in .* *
-   do
-   # Skip over logging sockets
-   [ -S "$file" -a "$file" = "log" ] && continue
-   [ -S "$file" -a "$file" = "logpriv" ] && 
continue
-   [ ."$file" = .. -o ."$file" = ... ] && continue
-   if [ -d "$file" -a ! -L "$file" ]
-   then
-   purgedir "$file"
-   else
-   rm -f -- "$file"
-   fi
-   done
-   )
-   done
-   fi
-}
-
 cleanvar_prestart()
 {
# These files must be removed only the first time this script is run
@@ -58,14 +30,17 @@ cleanvar_prestart()
 cleanvar_start()
 {
if [ -d /var/run -a ! -f /var/run/clean_var ]; then
-   purgedir /var/run
+   # Skip over logging sockets
+   find /var/run \( -type f -or -type s ! -name log -and ! -name 
logpriv \) -delete
>/var/run/clean_var
fi
if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then
-   purgedir /var/spool/lock
+   find /var/spool/lock -type f -delete
>/var/spool/lock/clean_var
fi
-   rm -rf /var/spool/uucp/.Temp/*
+   if [ -d /var/spool/uucp/.Temp ]; then
+   find /var/spool/uucp/.Temp -delete
+   fi
 }
 
 load_rc_config $name
___
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: r332037 - stable/11/etc

2018-04-04 Thread Kyle Evans
Author: kevans
Date: Wed Apr  4 16:59:10 2018
New Revision: 332037
URL: https://svnweb.freebsd.org/changeset/base/332037

Log:
  MFC r307826,r328949: Firstboot fs mount changes
  
  MFC r307826: Use checkyesno instead of rolling my own..
  
  MFC r328949: Fix firstboot fs mount logic
  
  The firstboot logic has an error which causes the filesystem to be
  mounted readonly even though root_rw_mount=YES. This fixes the error to
  ensure that the root filesystem is mounted rw as expected after the run
  of the firstboot scripts.

Modified:
  stable/11/etc/rc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/rc
==
--- stable/11/etc/rcWed Apr  4 16:28:30 2018(r332036)
+++ stable/11/etc/rcWed Apr  4 16:59:10 2018(r332037)
@@ -135,16 +135,16 @@ done
 # Note: this assumes firstboot_sentinel is on / when we have
 # a read-only /, or that it is on media that's writable.
 if [ -e ${firstboot_sentinel} ]; then
-   [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -uw /
+   checkyesno root_rw_mount && mount -uw /
chflags -R 0 ${firstboot_sentinel}
rm -rf ${firstboot_sentinel}
if [ -e ${firstboot_sentinel}-reboot ]; then
chflags -R 0 ${firstboot_sentinel}-reboot
rm -rf ${firstboot_sentinel}-reboot
-   [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur /
+   checkyesno root_rw_mount || mount -ur /
kill -INT 1
fi
-   [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur /
+   checkyesno root_rw_mount || mount -ur /
 fi
 
 echo ''
___
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: r332036 - stable/10/sys/compat/linux

2018-04-04 Thread Ed Maste
Author: emaste
Date: Wed Apr  4 16:28:30 2018
New Revision: 332036
URL: https://svnweb.freebsd.org/changeset/base/332036

Log:
  Fix build: use correct variable name on stable/10
  
  r332032 merged r330356 from HEAD but did not account for a renamed
  variable (of a different type) between stable/10 and HEAD.
  
  Reported by:  lwhsu

Modified:
  stable/10/sys/compat/linux/linux_ipc.c

Modified: stable/10/sys/compat/linux/linux_ipc.c
==
--- stable/10/sys/compat/linux/linux_ipc.c  Wed Apr  4 15:16:04 2018
(r332035)
+++ stable/10/sys/compat/linux/linux_ipc.c  Wed Apr  4 16:28:30 2018
(r332036)
@@ -517,7 +517,7 @@ linux_semctl(struct thread *td, struct linux_semctl_ar
int cmd, error;
 
memset(&linux_seminfo, 0, sizeof(linux_seminfo));
-   memset(&linux_semid64, 0, sizeof(linux_semid64));
+   memset(&linux_semid, 0, sizeof(linux_semid));
 
switch (args->cmd & ~LINUX_IPC_64) {
case LINUX_IPC_RMID:
___
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: r332012 - in vendor/opencsd: . dist dist/decoder dist/decoder/build dist/decoder/build/linux dist/decoder/build/linux/rctdl_c_api_lib dist/decoder/build/linux/ref_trace_decode_lib dist

2018-04-04 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Wed, Apr 04, 2018 at 08:02:04AM -0700, Rodney W. Grimes wrote:
> > > Author: br
> > > Date: Wed Apr  4 12:33:46 2018
> > > New Revision: 332012
> > > URL: https://svnweb.freebsd.org/changeset/base/332012
> > > 
> > > Log:
> > >   Import OpenCSD -- an ARM CoreSight Trace Decode library.
> > 
> > Why does this need to be in base?
> > Is there some reason it can not live as a port?
> > 
> 
> Yes opencsd is a dependancy for pmctrace(1) -- new HWPMC tracing tool.

Why does pmctrace(1) need to be in base?
I can see that there is kernel driver code to support this,
is it to keep the userland pmctrace(1) closely coupled to
the kernel hwpmc(4) code?

I shall assert this code also has a broken license form,
if you read LICENSE there is no copyright "above" to
retain, or print for a binary release.  As a consumer of
that LICENSE technically I have to display nothing.
I am sure that is not the desired intent.

I believe this is still under review without formal policy
from core.

> pmctrace(1) is currently on review:
> https://reviews.freebsd.org/D12875
> https://reviews.freebsd.org/D14618
> 
> Thanks
> 
> Rusoan
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
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: r332012 - in vendor/opencsd: . dist dist/decoder dist/decoder/build dist/decoder/build/linux dist/decoder/build/linux/rctdl_c_api_lib dist/decoder/build/linux/ref_trace_decode_lib dist

2018-04-04 Thread Ruslan Bukin
On Wed, Apr 04, 2018 at 08:02:04AM -0700, Rodney W. Grimes wrote:
> > Author: br
> > Date: Wed Apr  4 12:33:46 2018
> > New Revision: 332012
> > URL: https://svnweb.freebsd.org/changeset/base/332012
> > 
> > Log:
> >   Import OpenCSD -- an ARM CoreSight Trace Decode library.
> 
> Why does this need to be in base?
> Is there some reason it can not live as a port?
> 

Yes opencsd is a dependancy for pmctrace(1) -- new HWPMC tracing tool.

pmctrace(1) is currently on review:
https://reviews.freebsd.org/D12875
https://reviews.freebsd.org/D14618

Thanks

Rusoan
___
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: r332035 - head/include

2018-04-04 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr  4 15:16:04 2018
New Revision: 332035
URL: https://svnweb.freebsd.org/changeset/base/332035

Log:
  pthread.h: minor indentation cleanups.
  
  No functional change.
  
  X-MFC with:   r331969

Modified:
  head/include/pthread.h

Modified: head/include/pthread.h
==
--- head/include/pthread.h  Wed Apr  4 14:41:48 2018(r332034)
+++ head/include/pthread.h  Wed Apr  4 15:16:04 2018(r332035)
@@ -175,8 +175,7 @@ int 
pthread_barrierattr_destroy(pthread_barrierattr_t
 intpthread_barrierattr_getpshared(
const pthread_barrierattr_t *, int *);
 intpthread_barrierattr_init(pthread_barrierattr_t *);
-intpthread_barrierattr_setpshared(pthread_barrierattr_t *,
-   int);
+intpthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
 
 #definepthread_cleanup_push(cleanup_routine, cleanup_arg)  
\
{   
\
@@ -194,16 +193,13 @@ int   
pthread_barrierattr_setpshared(pthread_barrieratt
 intpthread_condattr_destroy(pthread_condattr_t *);
 intpthread_condattr_getclock(const pthread_condattr_t *,
clockid_t *);
-intpthread_condattr_getpshared(const pthread_condattr_t *,
-   int *);
+intpthread_condattr_getpshared(const pthread_condattr_t *, int *);
 intpthread_condattr_init(pthread_condattr_t *);
-intpthread_condattr_setclock(pthread_condattr_t *,
-   clockid_t);
+intpthread_condattr_setclock(pthread_condattr_t *, clockid_t);
 intpthread_condattr_setpshared(pthread_condattr_t *, int);
 intpthread_cond_broadcast(pthread_cond_t *);
 intpthread_cond_destroy(pthread_cond_t *);
-intpthread_cond_init(pthread_cond_t *,
-   const pthread_condattr_t *);
+intpthread_cond_init(pthread_cond_t *, const pthread_condattr_t *);
 intpthread_cond_signal(pthread_cond_t *);
 intpthread_cond_timedwait(pthread_cond_t *,
pthread_mutex_t * __mutex,
@@ -219,18 +215,15 @@ void  pthread_exit(void *) __dead2;
 void   *pthread_getspecific(pthread_key_t);
 intpthread_getcpuclockid(pthread_t, clockid_t *);
 intpthread_join(pthread_t, void **);
-intpthread_key_create(pthread_key_t *,
-   void (*) (void *));
+intpthread_key_create(pthread_key_t *, void (*) (void *));
 intpthread_key_delete(pthread_key_t);
 intpthread_mutexattr_init(pthread_mutexattr_t *);
 intpthread_mutexattr_destroy(pthread_mutexattr_t *);
-intpthread_mutexattr_getpshared(
-   const pthread_mutexattr_t *, int *);
-intpthread_mutexattr_gettype(pthread_mutexattr_t *,
+intpthread_mutexattr_getpshared(const pthread_mutexattr_t *,
int *);
+intpthread_mutexattr_gettype(pthread_mutexattr_t *, int *);
 intpthread_mutexattr_settype(pthread_mutexattr_t *, int);
-intpthread_mutexattr_setpshared(pthread_mutexattr_t *,
-   int);
+intpthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
 intpthread_mutex_consistent(pthread_mutex_t * __mutex)
__requires_exclusive(*__mutex);
 intpthread_mutex_destroy(pthread_mutex_t * __mutex)
@@ -247,8 +240,7 @@ int pthread_mutex_timedlock(pthread_mutex_t * 
__mutex
__trylocks_exclusive(0, *__mutex);
 intpthread_mutex_unlock(pthread_mutex_t * __mutex)
__unlocks(*__mutex);
-intpthread_once(pthread_once_t *,
-   void (*) (void));
+intpthread_once(pthread_once_t *, void (*) (void));
 intpthread_rwlock_destroy(pthread_rwlock_t * __rwlock)
__requires_unlocked(*__rwlock);
 intpthread_rwlock_init(pthread_rwlock_t * __rwlock,
@@ -271,15 +263,14 @@ int   pthread_rwlock_unlock(pthread_rwlock_t 
* __rwlock
 intpthread_rwlock_wrlock(pthread_rwlock_t * __rwlock)
__locks_exclusive(*__rwlock);
 intpthread_rwlockattr_destroy(pthread_rwlockattr_t *);
-intpthread_rwlockattr_getkind_np(
-   const pthread_rwlockattr_t *, int *);
-intpthread_rwlockattr_getpshared(
-   const pthread_rwlockattr_t *, int *);
+intpthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *,
+   int *);
+intpthread_rwlockattr_getpshared(const pthread_rwlockattr_t *,
+   int *);
 intpthread_rwlockattr_init(pthread_rwlo

Re: svn commit: r332012 - in vendor/opencsd: . dist dist/decoder dist/decoder/build dist/decoder/build/linux dist/decoder/build/linux/rctdl_c_api_lib dist/decoder/build/linux/ref_trace_decode_lib dist

2018-04-04 Thread Rodney W. Grimes
> Author: br
> Date: Wed Apr  4 12:33:46 2018
> New Revision: 332012
> URL: https://svnweb.freebsd.org/changeset/base/332012
> 
> Log:
>   Import OpenCSD -- an ARM CoreSight Trace Decode library.

Why does this need to be in base?
Is there some reason it can not live as a port?

-- 
Rod Grimes rgri...@freebsd.org
___
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: r332034 - head/sys/compat/linux

2018-04-04 Thread Ed Maste
Author: emaste
Date: Wed Apr  4 14:41:48 2018
New Revision: 332034
URL: https://svnweb.freebsd.org/changeset/base/332034

Log:
  linux_ioctl_hdio: fix kernel memory disclosure
  
  Stack-allocated struct linux_hd_big_geometry has undeclared padding
  copied to userland.
  
  admbugs:  765
  Reported by:  Vlad Tsyrklevich
  MFC after:1 day
  Security: Kernel memory disclosure
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/linux/linux_ioctl.c

Modified: head/sys/compat/linux/linux_ioctl.c
==
--- head/sys/compat/linux/linux_ioctl.c Wed Apr  4 14:31:56 2018
(r332033)
+++ head/sys/compat/linux/linux_ioctl.c Wed Apr  4 14:41:48 2018
(r332034)
@@ -253,6 +253,7 @@ linux_ioctl_hdio(struct thread *td, struct linux_ioctl
} else if ((args->cmd & 0x) == LINUX_HDIO_GET_GEO_BIG) {
struct linux_hd_big_geometry hdbg;
 
+   memset(&hdbg, 0, sizeof(hdbg));
hdbg.cylinders = fwcylinders;
hdbg.heads = fwheads;
hdbg.sectors = fwsectors;
___
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: r332033 - in head: etc/mtree lib lib/libopencsd share/mk

2018-04-04 Thread Ruslan Bukin
Author: br
Date: Wed Apr  4 14:31:56 2018
New Revision: 332033
URL: https://svnweb.freebsd.org/changeset/base/332033

Log:
  Add new shared library -- libopencsd.
  
  OpenCSD is an ARM CoreSight(tm) trace packets decoder.
  
  - Connect libopencsd to the arm64 build.
  - Install opencsd headers to /usr/include/opencsd/
  
  Sponsored by: DARPA, AFRL

Added:
  head/lib/libopencsd/
  head/lib/libopencsd/Makefile   (contents, props changed)
Modified:
  head/etc/mtree/BSD.include.dist
  head/lib/Makefile
  head/share/mk/bsd.libnames.mk
  head/share/mk/src.libnames.mk

Modified: head/etc/mtree/BSD.include.dist
==
--- head/etc/mtree/BSD.include.dist Wed Apr  4 14:12:07 2018
(r332032)
+++ head/etc/mtree/BSD.include.dist Wed Apr  4 14:31:56 2018
(r332033)
@@ -317,6 +317,18 @@
 ..
 nfsserver
 ..
+opencsd
+c_api
+..
+etmv3
+..
+etmv4
+..
+ptm
+..
+stm
+..
+..
 openssl
 ..
 pcap

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Wed Apr  4 14:12:07 2018(r332032)
+++ head/lib/Makefile   Wed Apr  4 14:31:56 2018(r332033)
@@ -175,6 +175,10 @@ SUBDIR.${MK_NIS}+= libypclnt
 _libvgl=   libvgl
 .endif
 
+.if ${MACHINE_CPUARCH} == "aarch64"
+SUBDIR.${MK_PMC}+= libopencsd
+.endif
+
 .if ${MACHINE_CPUARCH} == "amd64"
 SUBDIR.${MK_PMC}+= libipt
 SUBDIR.${MK_BHYVE}+=   libvmmapi

Added: head/lib/libopencsd/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libopencsd/MakefileWed Apr  4 14:31:56 2018
(r332033)
@@ -0,0 +1,175 @@
+# $FreeBSD$
+
+PACKAGE=lib${LIB}
+SHLIBDIR?= /lib
+
+.include 
+
+OPENCSDSRC=${SRCTOP}/contrib/opencsd
+
+.PATH: ${OPENCSDSRC}/decoder/source/etmv4/ \
+   ${OPENCSDSRC}/decoder/source/etmv3/ \
+   ${OPENCSDSRC}/decoder/source/pkt_printers/  \
+   ${OPENCSDSRC}/decoder/source/mem_acc/   \
+   ${OPENCSDSRC}/decoder/source/i_dec/ \
+   ${OPENCSDSRC}/decoder/source/c_api/ \
+   ${OPENCSDSRC}/decoder/source/ptm/   \
+   ${OPENCSDSRC}/decoder/source/stm/   \
+   ${OPENCSDSRC}/decoder/source/   \
+   ${OPENCSDSRC}/decoder/include/opencsd/etmv4/\
+   ${OPENCSDSRC}/decoder/include/opencsd/etmv3/\
+   ${OPENCSDSRC}/decoder/include/opencsd/stm/  \
+   ${OPENCSDSRC}/decoder/include/opencsd/ptm/  \
+   ${OPENCSDSRC}/decoder/include/opencsd/c_api/\
+   ${OPENCSDSRC}/decoder/include/opencsd/  \
+   ${OPENCSDSRC}/decoder/include
+
+LIB=   opencsd
+SHLIB_MAJOR=0
+
+# ETMv3
+SRCS=  \
+   trc_cmp_cfg_etmv3.cpp   \
+   trc_pkt_decode_etmv3.cpp\
+   trc_pkt_elem_etmv3.cpp  \
+   trc_pkt_proc_etmv3.cpp  \
+   trc_pkt_proc_etmv3_impl.cpp
+
+# ETMv4
+SRCS+= \
+   trc_cmp_cfg_etmv4.cpp   \
+   trc_etmv4_stack_elem.cpp\
+   trc_pkt_decode_etmv4i.cpp   \
+   trc_pkt_elem_etmv4d.cpp \
+   trc_pkt_elem_etmv4i.cpp \
+   trc_pkt_proc_etmv4.cpp  \
+   trc_pkt_proc_etmv4i_impl.cpp
+
+# PKT_PRINTERS
+SRCS+= \
+   raw_frame_printer.cpp   \
+   trc_print_fact.cpp
+
+# PTM
+SRCS+= \
+   trc_cmp_cfg_ptm.cpp \
+   trc_pkt_decode_ptm.cpp  \
+   trc_pkt_elem_ptm.cpp\
+   trc_pkt_proc_ptm.cpp
+
+# STM
+SRCS+= \
+   trc_pkt_decode_stm.cpp  \
+   trc_pkt_elem_stm.cpp\
+   trc_pkt_proc_stm.cpp
+
+# C_API
+SRCS+= \
+   ocsd_c_api_custom_obj.cpp   \
+   ocsd_c_api.cpp
+
+# SRC
+SRCS+= \
+   ocsd_code_follower.cpp  \
+   ocsd_dcd_tree.cpp   \
+   ocsd_error.cpp  \
+   ocsd_error_logger.cpp   \
+   ocsd_gen_elem_list.cpp  \
+   ocsd_lib_dcd_register.cpp   \
+   ocsd_msg_logger.cpp \
+   ocsd_version.cpp\
+   trc_component.cpp   \
+   trc_core_arch_map.cpp   \
+   trc_frame_deformatter.cpp   \
+   trc_gen_elem.cpp\
+   trc_printable_elem.cpp  \
+   trc_ret_stack.cpp
+
+# MEM_ACC
+SRCS+= \
+   trc_mem_acc_base.cpp\
+   trc_mem_acc_cb.cpp  \
+   trc_mem_acc_mapper.cpp  \
+   trc_mem_acc_bufptr.cpp  \
+   trc_m

svn commit: r332032 - stable/10/sys/compat/linux

2018-04-04 Thread Ed Maste
Author: emaste
Date: Wed Apr  4 14:12:07 2018
New Revision: 332032
URL: https://svnweb.freebsd.org/changeset/base/332032

Log:
  MFC r330356 (eadler): sys/linux: Fix a few potential infoleaks in Linux IPC
  
  admbugs:  765, 812, 813, 814
  Submitted by: Domagoj Stolfa 
  Reported by:  Ilja Van Sprundel 
  Reported by:  Vlad Tsyrklevich

Modified:
  stable/10/sys/compat/linux/linux_ipc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/linux/linux_ipc.c
==
--- stable/10/sys/compat/linux/linux_ipc.c  Wed Apr  4 14:09:44 2018
(r332031)
+++ stable/10/sys/compat/linux/linux_ipc.c  Wed Apr  4 14:12:07 2018
(r332032)
@@ -516,6 +516,9 @@ linux_semctl(struct thread *td, struct linux_semctl_ar
register_t rval;
int cmd, error;
 
+   memset(&linux_seminfo, 0, sizeof(linux_seminfo));
+   memset(&linux_semid64, 0, sizeof(linux_semid64));
+
switch (args->cmd & ~LINUX_IPC_64) {
case LINUX_IPC_RMID:
cmd = IPC_RMID;
@@ -661,12 +664,15 @@ linux_msgctl(struct thread *td, struct linux_msgctl_ar
struct l_msqid_ds linux_msqid;
struct msqid_ds bsd_msqid;
 
+   memset(&linux_msqid64, 0, sizeof(linux_msqid64));
+
bsd_cmd = args->cmd & ~LINUX_IPC_64;
switch (bsd_cmd) {
case LINUX_IPC_INFO:
case LINUX_MSG_INFO: {
struct l_msginfo linux_msginfo;
 
+   memset(&linux_msginfo, 0, sizeof(linux_msginfo));
/*
 * XXX MSG_INFO uses the same data structure but returns 
different
 * dynamic counters in msgpool, msgmap, and msgtql fields.
@@ -788,6 +794,10 @@ linux_shmctl(struct thread *td, struct linux_shmctl_ar
struct l_shm_info linux_shm_info;
struct shmid_ds bsd_shmid;
int error;
+
+   memset(&linux_shm_info, 0, sizeof(linux_shm_info));
+   memset(&linux_shmid64, 0, sizeof(linux_shmid64));
+   memset(&linux_shminfo64, 0, sizeof(linux_shminfo64));
 
switch (args->cmd & ~LINUX_IPC_64) {
 
___
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: r332031 - stable/11/sys/compat/linux

2018-04-04 Thread Ed Maste
Author: emaste
Date: Wed Apr  4 14:09:44 2018
New Revision: 332031
URL: https://svnweb.freebsd.org/changeset/base/332031

Log:
  MFC r330356 (eadler): sys/linux: Fix a few potential infoleaks in Linux IPC
  
  admbugs:  765, 812, 813, 814
  Submitted by: Domagoj Stolfa 
  Reported by:  Ilja Van Sprundel 
  Reported by:  Vlad Tsyrklevich

Modified:
  stable/11/sys/compat/linux/linux_ipc.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linux/linux_ipc.c
==
--- stable/11/sys/compat/linux/linux_ipc.c  Wed Apr  4 14:01:10 2018
(r332030)
+++ stable/11/sys/compat/linux/linux_ipc.c  Wed Apr  4 14:09:44 2018
(r332031)
@@ -548,6 +548,9 @@ linux_semctl(struct thread *td, struct linux_semctl_ar
register_t rval;
int cmd, error;
 
+   memset(&linux_seminfo, 0, sizeof(linux_seminfo));
+   memset(&linux_semid64, 0, sizeof(linux_semid64));
+
switch (args->cmd & ~LINUX_IPC_64) {
case LINUX_IPC_RMID:
cmd = IPC_RMID;
@@ -702,12 +705,15 @@ linux_msgctl(struct thread *td, struct linux_msgctl_ar
struct l_msqid64_ds linux_msqid64;
struct msqid_ds bsd_msqid;
 
+   memset(&linux_msqid64, 0, sizeof(linux_msqid64));
+
bsd_cmd = args->cmd & ~LINUX_IPC_64;
switch (bsd_cmd) {
case LINUX_IPC_INFO:
case LINUX_MSG_INFO: {
struct l_msginfo linux_msginfo;
 
+   memset(&linux_msginfo, 0, sizeof(linux_msginfo));
/*
 * XXX MSG_INFO uses the same data structure but returns 
different
 * dynamic counters in msgpool, msgmap, and msgtql fields.
@@ -832,6 +838,10 @@ linux_shmctl(struct thread *td, struct linux_shmctl_ar
struct l_shm_info linux_shm_info;
struct shmid_ds bsd_shmid;
int error;
+
+   memset(&linux_shm_info, 0, sizeof(linux_shm_info));
+   memset(&linux_shmid64, 0, sizeof(linux_shmid64));
+   memset(&linux_shminfo64, 0, sizeof(linux_shminfo64));
 
switch (args->cmd & ~LINUX_IPC_64) {
 
___
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: r332030 - stable/11/sys/dev/efidev

2018-04-04 Thread Kyle Evans
Author: kevans
Date: Wed Apr  4 14:01:10 2018
New Revision: 332030
URL: https://svnweb.freebsd.org/changeset/base/332030

Log:
  MFC r331413: efidev: Drop a quick note in about efi_cfgtbl/efi_runtime
  
  There's no real annotation for it, so it's not immediately obvious to the
  unfamiliar that these pointers are to locations in the EFI runtime map
  unlike the system table pointer immediately above them.

Modified:
  stable/11/sys/dev/efidev/efirt.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/efidev/efirt.c
==
--- stable/11/sys/dev/efidev/efirt.cWed Apr  4 13:59:42 2018
(r332029)
+++ stable/11/sys/dev/efidev/efirt.cWed Apr  4 14:01:10 2018
(r332030)
@@ -57,6 +57,11 @@ __FBSDID("$FreeBSD$");
 #include 
 
 static struct efi_systbl *efi_systbl;
+/*
+ * The following pointers point to tables in the EFI runtime service data 
pages.
+ * Care should be taken to make sure that we've properly entered the EFI 
runtime
+ * environment (efi_enter()) before dereferencing them.
+ */
 static struct efi_cfgtbl *efi_cfgtbl;
 static struct efi_rt *efi_runtime;
 
___
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: r332029 - stable/11/sys/dev/efidev

2018-04-04 Thread Kyle Evans
Author: kevans
Date: Wed Apr  4 13:59:42 2018
New Revision: 332029
URL: https://svnweb.freebsd.org/changeset/base/332029

Log:
  MFC r330844: Correct minor typo in comment, efi_dmcap -> efi_tmcap

Modified:
  stable/11/sys/dev/efidev/efirt.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/efidev/efirt.c
==
--- stable/11/sys/dev/efidev/efirt.cWed Apr  4 13:58:18 2018
(r332028)
+++ stable/11/sys/dev/efidev/efirt.cWed Apr  4 13:59:42 2018
(r332029)
@@ -315,7 +315,7 @@ efi_get_time(struct efi_tm *tm)
/*
 * UEFI spec states that the Capabilities argument to GetTime is
 * optional, but some UEFI implementations choke when passed a NULL
-* pointer. Pass a dummy efi_dmcap, even though we won't use it,
+* pointer. Pass a dummy efi_tmcap, even though we won't use it,
 * to workaround such implementations.
 */
error = efi_get_time_locked(tm, &dummy);
___
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: r332028 - in stable/11: stand/efi/loader sys/amd64/amd64 sys/dev/efidev

2018-04-04 Thread Kyle Evans
Author: kevans
Date: Wed Apr  4 13:58:18 2018
New Revision: 332028
URL: https://svnweb.freebsd.org/changeset/base/332028

Log:
  MFC r330868, r331241, r331361, r331365: EFIRT Fixes
  
  r330868:
  EFIRT: SetVirtualAddressMap with 1:1 mapping after exiting boot services
  
  This fixes a problem encountered on the Lenovo Thinkpad X220/Yoga 11e where
  runtime services would try to inexplicably jump to other parts of memory
  where it shouldn't be when attempting to enumerate EFI vars, causing a
  panic.
  
  The virtual mapping is enabled by default and can be disabled by setting
  efi_disable_vmap in loader.conf(5).
  
  r331241:
  Check if the gettime runtime service is valid.
  
  The U-Boot efi runtime service expects us to set the address map before
  calling any runtime services. It will then remap a few functions to their
  runtime version. One of these is the gettime function. If we call into
  this without having set a runtime map we get a page fault.
  
  Add a check to see if this is valid in efi_init() so we don't try to use
  the possibly invalid pointer.
  
  r331361:
  Enter into the EFI environment before dereferencing the runtime services
  pointer. This may be within the EFI address space and not the FreeBSD
  kernel address space.
  
  r331365:
  Re-work efidev ordering to fix efirt preloaded by loader on amd64
  
  On amd64, efi_enter calls fpu_kern_enter(). This may not be called until
  fpuinitstate has been invoked, resulting in a kernel panic with
  efirt_load="YES" in loader.conf(5).
  
  Move fpuinitstate a little earlier in SI_SUB_DRIVERS so that we can squeeze
  efirt between it and efirtc at SI_SUB_DRIVERS, SI_ORDER_ANY. efidev must be
  after efirt and doesn't really need to be at SI_SUB_DEVFS, so drop it at
  SI_SUB_DRIVER, SI_ORDER_ANY.
  
  The not immediately obvious dependency of fpuinitstate by efirt has been
  noted in both places.

Modified:
  stable/11/stand/efi/loader/bootinfo.c
  stable/11/sys/amd64/amd64/efirt_machdep.c
  stable/11/sys/amd64/amd64/fpu.c
  stable/11/sys/dev/efidev/efidev.c
  stable/11/sys/dev/efidev/efirt.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/efi/loader/bootinfo.c
==
--- stable/11/stand/efi/loader/bootinfo.c   Wed Apr  4 13:54:51 2018
(r332027)
+++ stable/11/stand/efi/loader/bootinfo.c   Wed Apr  4 13:58:18 2018
(r332028)
@@ -236,17 +236,48 @@ bi_copymodules(vm_offset_t addr)
return(addr);
 }
 
+static EFI_STATUS
+efi_do_vmap(EFI_MEMORY_DESCRIPTOR *mm, UINTN sz, UINTN mmsz, UINT32 mmver)
+{
+   EFI_MEMORY_DESCRIPTOR *desc, *viter, *vmap;
+   EFI_STATUS ret;
+   int curr, ndesc, nset;
+
+   nset = 0;
+   desc = mm;
+   ndesc = sz / mmsz;
+   vmap = malloc(sz);
+   if (vmap == NULL)
+   /* This isn't really an EFI error case, but pretend it is */
+   return (EFI_OUT_OF_RESOURCES);
+   viter = vmap;
+   for (curr = 0; curr < ndesc;
+   curr++, desc = NextMemoryDescriptor(desc, mmsz)) {
+   if ((desc->Attribute & EFI_MEMORY_RUNTIME) != 0) {
+   ++nset;
+   desc->VirtualStart = desc->PhysicalStart;
+   *viter = *desc;
+   viter = NextMemoryDescriptor(viter, mmsz);
+   }
+   }
+   ret = RS->SetVirtualAddressMap(nset * mmsz, mmsz, mmver, vmap);
+   free(vmap);
+   return (ret);
+}
+
 static int
 bi_load_efi_data(struct preloaded_file *kfp)
 {
EFI_MEMORY_DESCRIPTOR *mm;
EFI_PHYSICAL_ADDRESS addr;
EFI_STATUS status;
+   const char *efi_novmap;
size_t efisz;
UINTN efi_mapkey;
UINTN mmsz, pages, retry, sz;
UINT32 mmver;
struct efi_map_header *efihdr;
+   bool do_vmap;
 
 #if defined(__amd64__) || defined(__aarch64__)
struct efi_fb efifb;
@@ -266,6 +297,11 @@ bi_load_efi_data(struct preloaded_file *kfp)
}
 #endif
 
+   do_vmap = true;
+   efi_novmap = getenv("efi_disable_vmap");
+   if (efi_novmap != NULL)
+   do_vmap = strcasecmp(efi_novmap, "YES") != 0;
+
efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf;
 
/*
@@ -321,6 +357,13 @@ bi_load_efi_data(struct preloaded_file *kfp)
}
status = BS->ExitBootServices(IH, efi_mapkey);
if (EFI_ERROR(status) == 0) {
+   /*
+* This may be disabled by setting efi_disable_vmap in
+* loader.conf(5). By default we will setup the virtual
+* map entries.
+*/
+   if (do_vmap)
+   efi_do_vmap(mm, sz, mmsz, mmver);
efihdr->memory_size = sz;
efihdr->descriptor_size = mmsz;
efihdr->descripto

svn commit: r332027 - stable/11/lib/libdl

2018-04-04 Thread Kyle Evans
Author: kevans
Date: Wed Apr  4 13:54:51 2018
New Revision: 332027
URL: https://svnweb.freebsd.org/changeset/base/332027

Log:
  MFC r331743: Add libdl to clibs package
  
  libdl is a filter on libc, and pretty lightweight. Add it to the 'clibs'
  package with libc, effectively tying them together in a pkgbase world.

Modified:
  stable/11/lib/libdl/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libdl/Makefile
==
--- stable/11/lib/libdl/MakefileWed Apr  4 13:37:59 2018
(r332026)
+++ stable/11/lib/libdl/MakefileWed Apr  4 13:54:51 2018
(r332027)
@@ -1,5 +1,6 @@
 # $FreeBSD$
 
+PACKAGE=clibs
 LIB=dl
 SHLIB_MAJOR=1
 
___
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: r332026 - in head/sys: arm/mv dev/fdt

2018-04-04 Thread Andrew Turner
Author: andrew
Date: Wed Apr  4 13:37:59 2018
New Revision: 332026
URL: https://svnweb.freebsd.org/changeset/base/332026

Log:
  Remove fdt_pm_is_enabled as it's Marvell specific. Replace the only call to
  it with a call to the helper function fdt_pm_is_enabled would call.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm/mv/mv_common.c
  head/sys/arm/mv/mv_localbus.c
  head/sys/arm/mv/mvvar.h
  head/sys/dev/fdt/fdt_common.c
  head/sys/dev/fdt/fdt_common.h

Modified: head/sys/arm/mv/mv_common.c
==
--- head/sys/arm/mv/mv_common.c Wed Apr  4 13:23:06 2018(r332025)
+++ head/sys/arm/mv/mv_common.c Wed Apr  4 13:37:59 2018(r332026)
@@ -484,7 +484,7 @@ pm_disable_device(int mask)
 }
 
 int
-fdt_pm(phandle_t node)
+mv_fdt_pm(phandle_t node)
 {
uint32_t cpu_pm_ctrl;
int i, ena, compat;

Modified: head/sys/arm/mv/mv_localbus.c
==
--- head/sys/arm/mv/mv_localbus.c   Wed Apr  4 13:23:06 2018
(r332025)
+++ head/sys/arm/mv/mv_localbus.c   Wed Apr  4 13:37:59 2018
(r332026)
@@ -275,7 +275,7 @@ localbus_attach(device_t dev)
if (!(ofw_bus_node_status_okay(dt_child)))
continue;
 
-   if (!(fdt_pm_is_enabled(dt_child)))
+   if (!(mv_fdt_pm(dt_child)))
continue;
 
di = malloc(sizeof(*di), M_LOCALBUS, M_WAITOK | M_ZERO);

Modified: head/sys/arm/mv/mvvar.h
==
--- head/sys/arm/mv/mvvar.h Wed Apr  4 13:23:06 2018(r332025)
+++ head/sys/arm/mv/mvvar.h Wed Apr  4 13:37:59 2018(r332026)
@@ -141,6 +141,8 @@ int mv_pci_devmap(phandle_t, struct devmap_entry *, vm
 int fdt_localbus_devmap(phandle_t, struct devmap_entry *, int, int *);
 enum soc_family mv_check_soc_family(void);
 
+int mv_fdt_pm(phandle_t);
+
 uint32_t get_tclk_armadaxp(void);
 uint32_t get_tclk_armada38x(void);
 uint32_t get_cpu_freq_armadaxp(void);

Modified: head/sys/dev/fdt/fdt_common.c
==
--- head/sys/dev/fdt/fdt_common.c   Wed Apr  4 13:23:06 2018
(r332025)
+++ head/sys/dev/fdt/fdt_common.c   Wed Apr  4 13:37:59 2018
(r332026)
@@ -365,19 +365,6 @@ fdt_parent_addr_cells(phandle_t node)
return ((int)fdt32_to_cpu(addr_cells));
 }
 
-int
-fdt_pm_is_enabled(phandle_t node)
-{
-   int ret;
-
-   ret = 1;
-
-#if defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY)
-   ret = fdt_pm(node);
-#endif
-   return (ret);
-}
-
 u_long
 fdt_data_get(void *data, int cells)
 {

Modified: head/sys/dev/fdt/fdt_common.h
==
--- head/sys/dev/fdt/fdt_common.h   Wed Apr  4 13:23:06 2018
(r332025)
+++ head/sys/dev/fdt/fdt_common.h   Wed Apr  4 13:37:59 2018
(r332026)
@@ -91,10 +91,8 @@ int fdt_get_range(phandle_t, int, u_long *, u_long *);
 int fdt_immr_addr(vm_offset_t);
 int fdt_regsize(phandle_t, u_long *, u_long *);
 int fdt_is_compatible_strict(phandle_t, const char *);
-int fdt_pm_is_enabled(phandle_t);
 int fdt_is_type(phandle_t, const char *);
 int fdt_parent_addr_cells(phandle_t);
-int fdt_pm(phandle_t);
 int fdt_get_chosen_bootargs(char *bootargs, size_t max_size);
 
 #endif /* _FDT_COMMON_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: r332025 - in stable/11/sys: arm/allwinner arm/nvidia arm/nvidia/tegra124 conf dev/extres/phy dev/usb/controller

2018-04-04 Thread Michal Meloun
Author: mmel
Date: Wed Apr  4 13:23:06 2018
New Revision: 332025
URL: https://svnweb.freebsd.org/changeset/base/332025

Log:
  MFC r328201:
  
Convert extres/phy to kobj model.  Similarly as other extres pseudo-drivers,
implement phy by using kobj model.  This detaches it from provider device, 
so
single device driver can export multiple different phys. Additionally, this
allows phy to be subclassed to more specialized drivers, like is USB OTG 
phy,
or PCIe phy with hot-plug capability.

Added:
  stable/11/sys/dev/extres/phy/phydev_if.m
 - copied unchanged from r328201, head/sys/dev/extres/phy/phydev_if.m
  stable/11/sys/dev/extres/phy/phynode_if.m
 - copied unchanged from r328201, head/sys/dev/extres/phy/phynode_if.m
Deleted:
  stable/11/sys/dev/extres/phy/phy_if.m
Modified:
  stable/11/sys/arm/allwinner/a10_ehci.c
  stable/11/sys/arm/allwinner/aw_usbphy.c
  stable/11/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c
  stable/11/sys/arm/nvidia/tegra_ahci.c
  stable/11/sys/arm/nvidia/tegra_ehci.c
  stable/11/sys/arm/nvidia/tegra_pcie.c
  stable/11/sys/arm/nvidia/tegra_usbphy.c
  stable/11/sys/arm/nvidia/tegra_xhci.c
  stable/11/sys/conf/files
  stable/11/sys/dev/extres/phy/phy.c
  stable/11/sys/dev/extres/phy/phy.h
  stable/11/sys/dev/usb/controller/generic_ohci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/allwinner/a10_ehci.c
==
--- stable/11/sys/arm/allwinner/a10_ehci.c  Wed Apr  4 13:20:29 2018
(r332024)
+++ stable/11/sys/arm/allwinner/a10_ehci.c  Wed Apr  4 13:23:06 2018
(r332025)
@@ -231,7 +231,7 @@ a10_ehci_attach(device_t self)
device_printf(self, "Could not get phy\n");
goto error;
}
-   err = phy_enable(self, aw_sc->phy);
+   err = phy_enable(aw_sc->phy);
if (err != 0) {
device_printf(self, "Could not enable phy\n");
goto error;

Modified: stable/11/sys/arm/allwinner/aw_usbphy.c
==
--- stable/11/sys/arm/allwinner/aw_usbphy.c Wed Apr  4 13:20:29 2018
(r332024)
+++ stable/11/sys/arm/allwinner/aw_usbphy.c Wed Apr  4 13:23:06 2018
(r332025)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "phy_if.h"
+#include "phynode_if.h"
 
 #defineUSBPHY_NPHYS4
 
@@ -72,6 +72,16 @@ struct awusbphy_softc {
int vbus_det_valid;
 };
 
+ /* Phy class and methods. */
+static int awusbphy_phy_enable(struct phynode *phy, bool enable);
+static phynode_method_t awusbphy_phynode_methods[] = {
+   PHYNODEMETHOD(phynode_enable, awusbphy_phy_enable),
+
+   PHYNODEMETHOD_END
+};
+DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_class, 
awusbphy_phynode_methods,
+0, phynode_class);
+
 static int
 awusbphy_init(device_t dev)
 {
@@ -148,12 +158,18 @@ awusbphy_vbus_detect(device_t dev, int *val)
 }
 
 static int
-awusbphy_phy_enable(device_t dev, intptr_t phy, bool enable)
+awusbphy_phy_enable(struct phynode *phynode, bool enable)
 {
+   device_t dev;
+   intptr_t phy;
struct awusbphy_softc *sc;
regulator_t reg;
int error, vbus_det;
 
+   dev = phynode_get_device(phynode);
+   phy = phynode_get_id(phynode);
+   sc = device_get_softc(dev);
+
if (phy < 0 || phy >= USBPHY_NPHYS)
return (ERANGE);
 
@@ -203,6 +219,9 @@ static int
 awusbphy_attach(device_t dev)
 {
int error;
+   struct phynode *phynode;
+   struct phynode_init_def phy_init;
+   int i;
 
error = awusbphy_init(dev);
if (error) {
@@ -211,7 +230,22 @@ awusbphy_attach(device_t dev)
return (error);
}
 
-   phy_register_provider(dev);
+   /* Create and register phys. */
+   for (i = 0; i < USBPHY_NPHYS; i++) {
+   bzero(&phy_init, sizeof(phy_init));
+   phy_init.id = i;
+   phy_init.ofw_node = ofw_bus_get_node(dev);
+   phynode = phynode_create(dev, &awusbphy_phynode_class,
+   &phy_init);
+   if (phynode == NULL) {
+   device_printf(dev, "failed to create USB PHY\n");
+   return (ENXIO);
+   }
+   if (phynode_register(phynode) == NULL) {
+   device_printf(dev, "failed to create USB PHY\n");
+   return (ENXIO);
+   }
+   }
 
return (error);
 }
@@ -220,9 +254,6 @@ static device_method_t awusbphy_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, awusbphy_probe),
DEVMETHOD(device_attach,awusbphy_attach),
-
-   /* PHY interface */
-   DEVMETHOD(phy_enable,   awusbphy_phy_enable),
 
DEVMETHOD_END
 };

Modified: stable/11/sys/arm/nvidia/tegra124/tegra12

svn commit: r332024 - head/sys/arm/mv

2018-04-04 Thread Marcin Wojtas
Author: mw
Date: Wed Apr  4 13:20:29 2018
New Revision: 332024
URL: https://svnweb.freebsd.org/changeset/base/332024

Log:
  Enable Marvell gpio driver to work with many controllers
  
  This patch moves all global data structures into mv_gpio_softc,
  and puts device_t parameter to functions calls everywhere where needed.
  As a result, we can create multiple driver instances.
  
  Removed names in function declaration to keep style.
  
  Submitted by: Patryk Duda 
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14755

Modified:
  head/sys/arm/mv/gpio.c
  head/sys/arm/mv/mvreg.h

Modified: head/sys/arm/mv/gpio.c
==
--- head/sys/arm/mv/gpio.c  Wed Apr  4 13:16:00 2018(r332023)
+++ head/sys/arm/mv/gpio.c  Wed Apr  4 13:20:29 2018(r332024)
@@ -71,13 +71,14 @@ struct mv_gpio_softc {
int mem_rid;
struct resource *   irq_res[GPIO_MAX_INTR_COUNT];
int irq_rid[GPIO_MAX_INTR_COUNT];
+   struct intr_event * gpio_events[MV_GPIO_MAX_NPINS];
void*ih_cookie[GPIO_MAX_INTR_COUNT];
bus_space_tag_t bst;
bus_space_handle_t  bsh;
struct mtx  mutex;
uint8_t pin_num;/* number of GPIO pins */
uint8_t irq_num;/* number of real IRQs occupied 
by GPIO controller */
-   uint8_t use_high;
+   struct gpio_pin gpio_setup[MV_GPIO_MAX_NPINS];
 
/* Used for debouncing. */
uint32_tdebounced_state_lo;
@@ -86,52 +87,56 @@ struct mv_gpio_softc {
int *debounce_counters;
 };
 
-static struct mv_gpio_softc *mv_gpio_softc = NULL;
-static uint32_tgpio_setup[MV_GPIO_MAX_NPINS];
+struct mv_gpio_pindev {
+   device_t dev;
+   int pin;
+};
 
 static int mv_gpio_probe(device_t);
 static int mv_gpio_attach(device_t);
-static int mv_gpio_intr(void *);
-static int mv_gpio_init(void);
+static int mv_gpio_intr(device_t, void *);
+static int mv_gpio_init(device_t);
 
-static voidmv_gpio_double_edge_init(int pin);
+static voidmv_gpio_double_edge_init(device_t, int);
 
-static int mv_gpio_debounce_setup(int pin);
-static int mv_gpio_debounce_init(int pin);
-static voidmv_gpio_debounce_start(int pin);
-static int mv_gpio_debounce_prepare(int pin);
-static voidmv_gpio_debounce(void *arg);
-static voidmv_gpio_debounced_state_set(int pin, uint8_t new_state);
-static uint32_tmv_gpio_debounced_state_get(int pin);
+static int mv_gpio_debounce_setup(device_t, int);
+static int mv_gpio_debounce_prepare(device_t, int);
+static int mv_gpio_debounce_init(device_t, int);
+static voidmv_gpio_debounce_start(device_t, int);
+static voidmv_gpio_debounce(void *);
+static voidmv_gpio_debounced_state_set(device_t, int, uint8_t);
+static uint32_tmv_gpio_debounced_state_get(device_t, int);
 
-static voidmv_gpio_exec_intr_handlers(uint32_t status, int high);
-static voidmv_gpio_intr_handler(int pin);
-static uint32_tmv_gpio_reg_read(uint32_t reg);
-static voidmv_gpio_reg_write(uint32_t reg, uint32_t val);
-static voidmv_gpio_reg_set(uint32_t reg, uint32_t val);
-static voidmv_gpio_reg_clear(uint32_t reg, uint32_t val);
+static voidmv_gpio_exec_intr_handlers(device_t, uint32_t, int);
+static voidmv_gpio_intr_handler(device_t, int);
+static uint32_tmv_gpio_reg_read(device_t, uint32_t);
+static voidmv_gpio_reg_write(device_t, uint32_t, uint32_t);
+static voidmv_gpio_reg_set(device_t, uint32_t, uint32_t);
+static voidmv_gpio_reg_clear(device_t, uint32_t, uint32_t);
 
-static voidmv_gpio_blink(uint32_t pin, uint8_t enable);
-static voidmv_gpio_polarity(uint32_t pin, uint8_t enable, uint8_t toggle);
-static voidmv_gpio_level(uint32_t pin, uint8_t enable);
-static voidmv_gpio_edge(uint32_t pin, uint8_t enable);
-static voidmv_gpio_out_en(uint32_t pin, uint8_t enable);
-static voidmv_gpio_int_ack(uint32_t pin);
-static voidmv_gpio_value_set(uint32_t pin, uint8_t val);
-static uint32_tmv_gpio_value_get(uint32_t pin, uint8_t exclude_polar);
+static voidmv_gpio_blink(device_t, uint32_t, uint8_t);
+static voidmv_gpio_polarity(device_t, uint32_t, uint8_t, uint8_t);
+static voidmv_gpio_level(device_t, uint32_t, uint8_t);
+static voidmv_gpio_edge(device_t, uint32_t, uint8_t);
+static voidmv_gpio_out_en(device_t, uint32_t, uint8_t);
+static voidmv_gpio_int_ack(struct mv_gpio_pindev *);
+static voidmv_gpio_value_set(device_t, uint32_t, uint8_t);
+static uint32_tmv_gpio_value_get(device_t, uint32_t, uint8_t);
 
-static voidmv_gpio_intr_mask(int pin);
-static voidmv_gpio_intr_unmask(int pin);
-int 

svn commit: r332023 - stable/10/sys/fs/fuse

2018-04-04 Thread Ed Maste
Author: emaste
Date: Wed Apr  4 13:16:00 2018
New Revision: 332023
URL: https://svnweb.freebsd.org/changeset/base/332023

Log:
  MFC r330354 (eadler): sys/fuse: fix off by one error
  
  Reported by:  Ilja Van Sprundel 
  Submitted by: Domagoj Stolfa 

Modified:
  stable/10/sys/fs/fuse/fuse_internal.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/fuse/fuse_internal.c
==
--- stable/10/sys/fs/fuse/fuse_internal.c   Wed Apr  4 13:15:12 2018
(r332022)
+++ stable/10/sys/fs/fuse/fuse_internal.c   Wed Apr  4 13:16:00 2018
(r332023)
@@ -355,7 +355,7 @@ fuse_internal_readdir_processdata(struct uio *uio,
memcpy((char *)cookediov->base + sizeof(struct dirent) - 
   MAXNAMLEN - 1,
   (char *)buf + FUSE_NAME_OFFSET, fudge->namelen);
-   ((char *)cookediov->base)[bytesavail] = '\0';
+   ((char *)cookediov->base)[bytesavail - 1] = '\0';
 
err = uiomove(cookediov->base, cookediov->len, uio);
if (err) {
___
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: r332022 - stable/11/sys/fs/fuse

2018-04-04 Thread Ed Maste
Author: emaste
Date: Wed Apr  4 13:15:12 2018
New Revision: 332022
URL: https://svnweb.freebsd.org/changeset/base/332022

Log:
  MFC r330354 (eadler): sys/fuse: fix off by one error
  
  Reported by:  Ilja Van Sprundel 
  Submitted by: Domagoj Stolfa 

Modified:
  stable/11/sys/fs/fuse/fuse_internal.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/fuse/fuse_internal.c
==
--- stable/11/sys/fs/fuse/fuse_internal.c   Wed Apr  4 13:12:49 2018
(r332021)
+++ stable/11/sys/fs/fuse/fuse_internal.c   Wed Apr  4 13:15:12 2018
(r332022)
@@ -355,7 +355,7 @@ fuse_internal_readdir_processdata(struct uio *uio,
memcpy((char *)cookediov->base + sizeof(struct dirent) - 
   MAXNAMLEN - 1,
   (char *)buf + FUSE_NAME_OFFSET, fudge->namelen);
-   ((char *)cookediov->base)[bytesavail] = '\0';
+   ((char *)cookediov->base)[bytesavail - 1] = '\0';
 
err = uiomove(cookediov->base, cookediov->len, uio);
if (err) {
___
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: r332021 - head/sys/arm/mv

2018-04-04 Thread Marcin Wojtas
Author: mw
Date: Wed Apr  4 13:12:49 2018
New Revision: 332021
URL: https://svnweb.freebsd.org/changeset/base/332021

Log:
  Improve interrupt and resource allocation in Marvell GPIO driver
  
  This patch adds support for more than one interrupts
  in GPIO controller. It reads necessary information (such as cell size)
  from FDT, so there are no magic numbers.
  
  Note that interrupts are still not working, but this patch makes
  one good step in correct direction
  
  Submitted by: Patryk Duda 
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14754

Modified:
  head/sys/arm/mv/gpio.c
  head/sys/arm/mv/mvvar.h

Modified: head/sys/arm/mv/gpio.c
==
--- head/sys/arm/mv/gpio.c  Wed Apr  4 13:08:51 2018(r332020)
+++ head/sys/arm/mv/gpio.c  Wed Apr  4 13:12:49 2018(r332021)
@@ -67,7 +67,10 @@ __FBSDID("$FreeBSD$");
 #define DEBOUNCE_CHECK_TICKS   ((hz / 1000) * DEBOUNCE_CHECK_MS)
 
 struct mv_gpio_softc {
-   struct resource *   res[GPIO_MAX_INTR_COUNT + 1];
+   struct resource *   mem_res;
+   int mem_rid;
+   struct resource *   irq_res[GPIO_MAX_INTR_COUNT];
+   int irq_rid[GPIO_MAX_INTR_COUNT];
void*ih_cookie[GPIO_MAX_INTR_COUNT];
bus_space_tag_t bst;
bus_space_handle_t  bsh;
@@ -83,8 +86,6 @@ struct mv_gpio_softc {
int *debounce_counters;
 };
 
-extern struct resource_spec mv_gpio_res[];
-
 static struct mv_gpio_softc *mv_gpio_softc = NULL;
 static uint32_tgpio_setup[MV_GPIO_MAX_NPINS];
 
@@ -119,6 +120,15 @@ static voidmv_gpio_int_ack(uint32_t pin);
 static voidmv_gpio_value_set(uint32_t pin, uint8_t val);
 static uint32_tmv_gpio_value_get(uint32_t pin, uint8_t exclude_polar);
 
+static voidmv_gpio_intr_mask(int pin);
+static voidmv_gpio_intr_unmask(int pin);
+int mv_gpio_setup_intrhandler(const char *name, driver_filter_t *filt,
+void (*hand)(void *), void *arg, int pin, int flags, void **cookiep);
+
+int mv_gpio_configure(uint32_t pin, uint32_t flags, uint32_t mask);
+void mv_gpio_out(uint32_t pin, uint8_t val, uint8_t enable);
+uint8_t mv_gpio_in(uint32_t pin);
+
 #define MV_GPIO_LOCK() mtx_lock_spin(&mv_gpio_softc->mutex)
 #define MV_GPIO_UNLOCK()   mtx_unlock_spin(&mv_gpio_softc->mutex)
 #define MV_GPIO_ASSERT_LOCKED()mtx_assert(&mv_gpio_softc->mutex, 
MA_OWNED)
@@ -171,9 +181,12 @@ mv_gpio_probe(device_t dev)
 static int
 mv_gpio_attach(device_t dev)
 {
-   int error, i;
+   int error, i, size;
struct mv_gpio_softc *sc;
uint32_t dev_id, rev_id;
+   pcell_t pincnt = 0;
+   pcell_t irq_cells = 0;
+   phandle_t iparent;
 
sc = (struct mv_gpio_softc *)device_get_softc(dev);
if (sc == NULL)
@@ -201,10 +214,45 @@ mv_gpio_attach(device_t dev)
sc->use_high = 1;
 
} else {
-   device_printf(dev, "unknown chip id=0x%x\n", dev_id);
+   if (OF_getencprop(ofw_bus_get_node(dev), "pin-count", &pincnt,
+   sizeof(pcell_t)) >= 0 ||
+   OF_getencprop(ofw_bus_get_node(dev), "ngpios", &pincnt,
+   sizeof(pcell_t)) >= 0) {
+   sc->pin_num = pincnt;
+   device_printf(dev, "%d pins available\n", sc->pin_num);
+   } else {
+   device_printf(dev, "ERROR: no pin-count entry 
found!\n");
+   return (ENXIO);
+   }
+   }
+
+   /* Find root interrupt controller */
+   iparent = ofw_bus_find_iparent(ofw_bus_get_node(dev));
+   if (iparent == 0) {
+   device_printf(dev, "No interrupt-parrent found. "
+   "Error in DTB\n");
return (ENXIO);
+   } else {
+   /* While at parent - store interrupt cells prop */
+   if (OF_searchencprop(OF_node_from_xref(iparent),
+   "#interrupt-cells", &irq_cells, sizeof(irq_cells)) == -1) {
+   device_printf(dev, "DTB: Missing #interrupt-cells "
+   "property in interrupt parent node\n");
+   return (ENXIO);
+   }
}
 
+   size = OF_getproplen(ofw_bus_get_node(dev), "interrupts");
+   if (size != -1) {
+   size = size / sizeof(pcell_t);
+   size = size / irq_cells;
+   sc->irq_num = size;
+   device_printf(dev, "%d IRQs available\n", sc->irq_num);
+   } else {
+   device_printf(dev, "ERROR: no interrupts entry found!\n");
+   return (ENXIO);
+   }
+
sc->debounce_callouts = (struct callout **)malloc(sc->pin_num *
sizeof(struct callout *), M_DEVBUF, M_WAITOK | M_ZERO);
if (sc->de

svn commit: r332020 - head/sys/arm/mv

2018-04-04 Thread Marcin Wojtas
Author: mw
Date: Wed Apr  4 13:08:51 2018
New Revision: 332020
URL: https://svnweb.freebsd.org/changeset/base/332020

Log:
  Introduce port debouncing mechanism in mv_gpio driver
  
  This patch introduces gpio debouncing mechanism
  with fixed memory allocation in critical section.
  
  When you press button, value at gpio pin connected to button
  is changing many times which will cause in unexpected behaviour.
  Debouncing mechanism will prevent this phenomenon
  
  Submitted by: Patryk Duda 
  Wojciech Macek 
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14753

Modified:
  head/sys/arm/mv/gpio.c
  head/sys/arm/mv/mvreg.h
  head/sys/arm/mv/mvvar.h

Modified: head/sys/arm/mv/gpio.c
==
--- head/sys/arm/mv/gpio.c  Wed Apr  4 13:01:14 2018(r332019)
+++ head/sys/arm/mv/gpio.c  Wed Apr  4 13:08:51 2018(r332020)
@@ -3,6 +3,7 @@
  *
  * Copyright (c) 2006 Benno Rice.
  * Copyright (C) 2008 MARVELL INTERNATIONAL LTD.
+ * Copyright (c) 2017 Semihalf.
  * All rights reserved.
  *
  * Adapted and extended for Marvell SoCs by Semihalf.
@@ -45,6 +46,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
@@ -58,13 +61,26 @@ __FBSDID("$FreeBSD$");
 #define GPIO_MAX_INTR_COUNT8
 #define GPIO_PINS_PER_REG  32
 
+#define DEBOUNCE_CHECK_MS  1
+#define DEBOUNCE_LO_HI_MS  2
+#define DEBOUNCE_HI_LO_MS  2
+#define DEBOUNCE_CHECK_TICKS   ((hz / 1000) * DEBOUNCE_CHECK_MS)
+
 struct mv_gpio_softc {
struct resource *   res[GPIO_MAX_INTR_COUNT + 1];
void*ih_cookie[GPIO_MAX_INTR_COUNT];
bus_space_tag_t bst;
bus_space_handle_t  bsh;
+   struct mtx  mutex;
uint8_t pin_num;/* number of GPIO pins */
uint8_t irq_num;/* number of real IRQs occupied 
by GPIO controller */
+   uint8_t use_high;
+
+   /* Used for debouncing. */
+   uint32_tdebounced_state_lo;
+   uint32_tdebounced_state_hi;
+   struct callout  **debounce_callouts;
+   int *debounce_counters;
 };
 
 extern struct resource_spec mv_gpio_res[];
@@ -77,6 +93,17 @@ static int   mv_gpio_attach(device_t);
 static int mv_gpio_intr(void *);
 static int mv_gpio_init(void);
 
+static voidmv_gpio_double_edge_init(int pin);
+
+static int mv_gpio_debounce_setup(int pin);
+static int mv_gpio_debounce_init(int pin);
+static voidmv_gpio_debounce_start(int pin);
+static int mv_gpio_debounce_prepare(int pin);
+static voidmv_gpio_debounce(void *arg);
+static voidmv_gpio_debounced_state_set(int pin, uint8_t new_state);
+static uint32_tmv_gpio_debounced_state_get(int pin);
+
+static voidmv_gpio_exec_intr_handlers(uint32_t status, int high);
 static voidmv_gpio_intr_handler(int pin);
 static uint32_tmv_gpio_reg_read(uint32_t reg);
 static voidmv_gpio_reg_write(uint32_t reg, uint32_t val);
@@ -84,14 +111,18 @@ static voidmv_gpio_reg_set(uint32_t reg, uint32_t 
val
 static voidmv_gpio_reg_clear(uint32_t reg, uint32_t val);
 
 static voidmv_gpio_blink(uint32_t pin, uint8_t enable);
-static voidmv_gpio_polarity(uint32_t pin, uint8_t enable);
+static voidmv_gpio_polarity(uint32_t pin, uint8_t enable, uint8_t toggle);
 static voidmv_gpio_level(uint32_t pin, uint8_t enable);
 static voidmv_gpio_edge(uint32_t pin, uint8_t enable);
 static voidmv_gpio_out_en(uint32_t pin, uint8_t enable);
 static voidmv_gpio_int_ack(uint32_t pin);
 static voidmv_gpio_value_set(uint32_t pin, uint8_t val);
-static uint32_tmv_gpio_value_get(uint32_t pin);
+static uint32_tmv_gpio_value_get(uint32_t pin, uint8_t exclude_polar);
 
+#define MV_GPIO_LOCK() mtx_lock_spin(&mv_gpio_softc->mutex)
+#define MV_GPIO_UNLOCK()   mtx_unlock_spin(&mv_gpio_softc->mutex)
+#define MV_GPIO_ASSERT_LOCKED()mtx_assert(&mv_gpio_softc->mutex, 
MA_OWNED)
+
 static device_method_t mv_gpio_methods[] = {
DEVMETHOD(device_probe, mv_gpio_probe),
DEVMETHOD(device_attach,mv_gpio_attach),
@@ -148,6 +179,8 @@ mv_gpio_attach(device_t dev)
if (sc == NULL)
return (ENXIO);
 
+   if (mv_gpio_softc != NULL)
+   return (ENXIO);
mv_gpio_softc = sc;
 
/* Get chip id and revision */
@@ -159,19 +192,34 @@ mv_gpio_attach(device_t dev)
dev_id == MV_DEV_MV78100_Z0 ) {
sc->pin_num = 32;
sc->irq_num = 4;
+   sc->use_high = 0;
 
} else if (dev_id == MV_DEV_88F6281 ||
dev_id == MV_DEV_88F6282) {
sc->pin_num = 50;
sc->irq_num = 7;
+   sc->use_high = 

svn commit: r332019 - in head/sys: arm/mv dts/arm

2018-04-04 Thread Marcin Wojtas
Author: mw
Date: Wed Apr  4 13:01:14 2018
New Revision: 332019
URL: https://svnweb.freebsd.org/changeset/base/332019

Log:
  Match Marvell Armada38X PCIE ranges in dts with Linux
  
  If driver cannot determine ranges based on fdt, it will calculate
  them based on number and type of current port.
  
  Submitted by: Rafal Kozik 
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14752

Modified:
  head/sys/arm/mv/mv_pci.c
  head/sys/dts/arm/armada-380.dtsi
  head/sys/dts/arm/armada-385.dtsi

Modified: head/sys/arm/mv/mv_pci.c
==
--- head/sys/arm/mv/mv_pci.cWed Apr  4 12:55:31 2018(r332018)
+++ head/sys/arm/mv/mv_pci.cWed Apr  4 13:01:14 2018(r332019)
@@ -100,6 +100,7 @@ struct mv_pci_range {
 };
 
 #define FDT_RANGES_CELLS   ((3 + 3 + 2) * 2)
+#define PCI_SPACE_LEN  0x0010
 
 static void
 mv_pci_range_dump(struct mv_pci_range *range)
@@ -122,6 +123,7 @@ mv_pci_ranges_decode(phandle_t node, struct mv_pci_ran
pcell_t *rangesptr;
pcell_t cell0, cell1, cell2;
int tuple_size, tuples, i, rv, offset_cells, len;
+   int  portid, is_io_space;
 
/*
 * Retrieve 'ranges' property.
@@ -163,11 +165,14 @@ mv_pci_ranges_decode(phandle_t node, struct mv_pci_ran
rangesptr++;
cell2 = fdt_data_get((void *)rangesptr, 1);
rangesptr++;
+   portid = fdt_data_get((void *)(rangesptr+1), 1);
 
if (cell0 & 0x0200) {
pci_space = mem_space;
+   is_io_space = 0;
} else if (cell0 & 0x0100) {
pci_space = io_space;
+   is_io_space = 1;
} else {
rv = ERANGE;
goto out;
@@ -198,6 +203,12 @@ mv_pci_ranges_decode(phandle_t node, struct mv_pci_ran
rangesptr += size_cells;
 
pci_space->base_pci = cell2;
+
+   if (pci_space->len == 0) {
+   pci_space->len = PCI_SPACE_LEN;
+   pci_space->base_parent = fdt_immr_va +
+   PCI_SPACE_LEN * ( 2 * portid + is_io_space);
+   }
}
rv = 0;
 out:

Modified: head/sys/dts/arm/armada-380.dtsi
==
--- head/sys/dts/arm/armada-380.dtsiWed Apr  4 12:55:31 2018
(r332018)
+++ head/sys/dts/arm/armada-380.dtsiWed Apr  4 13:01:14 2018
(r332019)
@@ -103,8 +103,8 @@
#address-cells = <3>;
#size-cells = <2>;
#interrupt-cells = <1>;
-   ranges = <0x8200 0x0 0x0 0x8200 0x0 
0xf120 0x0 0x0010
- 0x8100 0x0 0x0 0x8100 0x0 
0xf130 0x0 0x0010>;
+   ranges = <0x8200 0 0 0x8200 0x1 0 1 0
+ 0x8100 0 0 0x8100 0x1 0 1 0>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &gic GIC_SPI 29 
IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&gic>;
@@ -122,8 +122,8 @@
#address-cells = <3>;
#size-cells = <2>;
#interrupt-cells = <1>;
-   ranges = <0x8200 0x0 0x0 0x8200 0x0 
0xf140 0x0 0x0010
- 0x8100 0x0 0x0 0x8100 0x0 
0xf150 0x0 0x0010>;
+   ranges = <0x8200 0 0 0x8200 0x2 0 1 0
+ 0x8100 0 0 0x8100 0x2 0 1 0>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &gic GIC_SPI 33 
IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&gic>;
@@ -141,8 +141,8 @@
#address-cells = <3>;
#size-cells = <2>;
#interrupt-cells = <1>;
-   ranges = <0x8200 0x0 0x0 0x8200 0x0 
0xf160 0x0 0x0010
- 0x8100 0x0 0x0 0x8100 0x0 
0xf170 0x0 0x0010>;
+   ranges = <0x8200 0 0 0x8200 0x3 0 1 0
+ 0x8100 0 0 0x8100 0x3 0 1 0>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &gic GIC_SPI 70 
IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&gic>;

Modified: head/sys/dts/arm/armada

svn commit: r332018 - in head/contrib/opencsd: . decoder decoder/include decoder/source

2018-04-04 Thread Ruslan Bukin
Author: br
Date: Wed Apr  4 12:55:31 2018
New Revision: 332018
URL: https://svnweb.freebsd.org/changeset/base/332018

Log:
  Import OpenCSD -- an ARM CoreSight(tm) Trace Decode Library.
  
  Sponsored by: DARPA, AFRL

Added:
  head/contrib/opencsd/
  head/contrib/opencsd/decoder/
  head/contrib/opencsd/decoder/include/
 - copied from r332013, vendor/opencsd/dist/decoder/include/
  head/contrib/opencsd/decoder/source/
 - copied from r332013, vendor/opencsd/dist/decoder/source/
___
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: r332017 - in head/sys: arm/mv dts/arm

2018-04-04 Thread Marcin Wojtas
Author: mw
Date: Wed Apr  4 12:54:18 2018
New Revision: 332017
URL: https://svnweb.freebsd.org/changeset/base/332017

Log:
  Change reg in Marvell Armada38X pcie FDT
  
  Ranges in pcie-controller are unused, so could be changed to match Linux
  device tree represntation. Same with interrupt-cells and interrupt-parent.
  In PCI controller driver ocd_data are used for matching driver and
  choose proper resources acquisition function.
  fdt_win_process_child have new argument which provide information
  about fdt node containing addresses of MMIO registers.
  
  Submitted by: Rafal Kozik 
  Reviewed by: manu [DT part]
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14751

Modified:
  head/sys/arm/mv/mv_common.c
  head/sys/arm/mv/mv_pci_ctrl.c
  head/sys/dts/arm/armada-380.dtsi
  head/sys/dts/arm/armada-385.dtsi

Modified: head/sys/arm/mv/mv_common.c
==
--- head/sys/arm/mv/mv_common.c Wed Apr  4 12:47:41 2018(r332016)
+++ head/sys/arm/mv/mv_common.c Wed Apr  4 12:54:18 2018(r332017)
@@ -176,7 +176,7 @@ int gic_decode_fdt(phandle_t iparent, pcell_t *intr, i
 static int win_cpu_from_dt(void);
 static int fdt_win_setup(void);
 
-static int fdt_win_process_child(phandle_t, struct soc_node_spec *);
+static int fdt_win_process_child(phandle_t, struct soc_node_spec *, const 
char*);
 
 static uint32_t dev_mask = 0;
 static int cpu_wins_no = 0;
@@ -2757,7 +2757,7 @@ fdt_win_process(phandle_t child)
if (!ofw_bus_node_is_compatible(child, soc_nodes[i].compat))
continue;
 
-   ret = fdt_win_process_child(child, &soc_nodes[i]);
+   ret = fdt_win_process_child(child, &soc_nodes[i], "reg");
if (ret != 0)
return (ret);
}
@@ -2766,7 +2766,8 @@ fdt_win_process(phandle_t child)
 }
 
 static int
-fdt_win_process_child(phandle_t child, struct soc_node_spec *soc_node)
+fdt_win_process_child(phandle_t child, struct soc_node_spec *soc_node,
+const char* mimo_reg_source)
 {
int addr_cells, size_cells;
pcell_t reg[8];
@@ -2778,8 +2779,7 @@ fdt_win_process_child(phandle_t child, struct soc_node
 
if ((sizeof(pcell_t) * (addr_cells + size_cells)) > sizeof(reg))
return (ENOMEM);
-
-   if (OF_getprop(child, "reg", ®, sizeof(reg)) <= 0)
+   if (OF_getprop(child, mimo_reg_source, ®, sizeof(reg)) <= 0)
return (EINVAL);
 
if (addr_cells <= 2)
@@ -2836,7 +2836,8 @@ fdt_win_setup(void)
child_pci = OF_child(child);
while (child_pci != 0) {
err = fdt_win_process_child(child_pci,
-   &soc_nodes[SOC_NODE_PCIE_ENTRY_IDX]);
+   &soc_nodes[SOC_NODE_PCIE_ENTRY_IDX],
+   "assigned-addresses");
if (err != 0)
return (err);
 

Modified: head/sys/arm/mv/mv_pci_ctrl.c
==
--- head/sys/arm/mv/mv_pci_ctrl.c   Wed Apr  4 12:47:41 2018
(r332016)
+++ head/sys/arm/mv/mv_pci_ctrl.c   Wed Apr  4 12:54:18 2018
(r332017)
@@ -67,6 +67,9 @@ struct mv_pcib_ctrl_range {
uint64_t size;
 };
 
+typedef int (*get_rl_t)(device_t dev, phandle_t node, pcell_t acells,
+pcell_t scells, struct resource_list *rl);
+
 struct mv_pcib_ctrl_softc {
pcell_t addr_cells;
pcell_t size_cells;
@@ -107,6 +110,13 @@ static device_method_t mv_pcib_ctrl_methods[] = {
DEVMETHOD_END
 };
 
+static struct ofw_compat_data mv_pcib_ctrl_compat[] = {
+   {"mrvl,pcie-ctrl",  (uintptr_t)&ofw_bus_reg_to_rl},
+   {"marvell,armada-370-pcie",
+   (uintptr_t)&ofw_bus_assigned_addresses_to_rl},
+   {NULL,  (uintptr_t)NULL},
+};
+
 static driver_t mv_pcib_ctrl_driver = {
"pcib_ctrl",
mv_pcib_ctrl_methods,
@@ -124,10 +134,12 @@ static int
 mv_pcib_ctrl_probe(device_t dev)
 {
 
-   if (!ofw_bus_is_compatible(dev, "mrvl,pcie-ctrl") &&
-   !ofw_bus_is_compatible(dev, "marvell,armada-370-pcie"))
+   if (!ofw_bus_status_okay(dev))
return (ENXIO);
 
+   if (!ofw_bus_search_compatible(dev, mv_pcib_ctrl_compat)->ocd_data)
+   return (ENXIO);
+
device_set_desc(dev, "Marvell Integrated PCIe Bus Controller");
return (BUS_PROBE_DEFAULT);
 }
@@ -151,6 +163,7 @@ mv_pcib_ofw_bus_attach(device_t dev)
struct mv_pcib_ctrl_softc *sc;
device_t child;
phandle_t parent, node;
+   get_rl_t get_rl;
 
parent = ofw_bus_get_node(dev);
sc = device_get_softc(dev);
@@ -189,8 +202,11 @@ mv_pcib_ofw_bus_attach(

svn commit: r332016 - head/sys/dev/ofw

2018-04-04 Thread Marcin Wojtas
Author: mw
Date: Wed Apr  4 12:47:41 2018
New Revision: 332016
URL: https://svnweb.freebsd.org/changeset/base/332016

Log:
  Add api for creating resource list based on 'assigned-addresses'
  
  According to device tree binding 'assigned-addresses' can refer to PCIE MMIO
  register space. New function ofw_bus_assigned_addresses_to_rl is
  provided to support it.
  
  Submitted by: Rafal Kozik 
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14750

Modified:
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/dev/ofw/ofw_bus_subr.h

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==
--- head/sys/dev/ofw/ofw_bus_subr.c Wed Apr  4 12:41:42 2018
(r332015)
+++ head/sys/dev/ofw/ofw_bus_subr.c Wed Apr  4 12:47:41 2018
(r332016)
@@ -489,9 +489,9 @@ ofw_bus_msimap(phandle_t node, uint16_t pci_rid, phand
return (err);
 }
 
-int
-ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_t acells, pcell_t scells,
-struct resource_list *rl)
+static int
+ofw_bus_reg_to_rl_helper(device_t dev, phandle_t node, pcell_t acells, pcell_t 
scells,
+struct resource_list *rl, const char *reg_source)
 {
uint64_t phys, size;
ssize_t i, j, rid, nreg, ret;
@@ -506,7 +506,7 @@ ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_
if (ret == -1)
name = NULL;
 
-   ret = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)®);
+   ret = OF_getencprop_alloc(node, reg_source, sizeof(*reg), (void 
**)®);
nreg = (ret == -1) ? 0 : ret;
 
if (nreg % (acells + scells) != 0) {
@@ -535,6 +535,23 @@ ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_
free(reg, M_OFWPROP);
 
return (0);
+}
+
+int
+ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_t acells, pcell_t scells,
+struct resource_list *rl)
+{
+
+   return (ofw_bus_reg_to_rl_helper(dev, node, acells, scells, rl, "reg"));
+}
+
+int
+ofw_bus_assigned_addresses_to_rl(device_t dev, phandle_t node, pcell_t acells,
+pcell_t scells, struct resource_list *rl)
+{
+
+   return (ofw_bus_reg_to_rl_helper(dev, node, acells, scells,
+   rl, "assigned-addresses"));
 }
 
 /*

Modified: head/sys/dev/ofw/ofw_bus_subr.h
==
--- head/sys/dev/ofw/ofw_bus_subr.h Wed Apr  4 12:41:42 2018
(r332015)
+++ head/sys/dev/ofw/ofw_bus_subr.h Wed Apr  4 12:47:41 2018
(r332016)
@@ -95,6 +95,8 @@ int ofw_bus_msimap(phandle_t, uint16_t, phandle_t *, u
 /* Routines for parsing device-tree data into resource lists. */
 int ofw_bus_reg_to_rl(device_t, phandle_t, pcell_t, pcell_t,
 struct resource_list *);
+int ofw_bus_assigned_addresses_to_rl(device_t, phandle_t, pcell_t, pcell_t,
+struct resource_list *);
 int ofw_bus_intr_to_rl(device_t, phandle_t, struct resource_list *, int *);
 int ofw_bus_intr_by_rid(device_t, phandle_t, int, phandle_t *, int *,
 pcell_t **);
___
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: r332015 - in head/sys: arm/mv dts/arm

2018-04-04 Thread Marcin Wojtas
Author: mw
Date: Wed Apr  4 12:41:42 2018
New Revision: 332015
URL: https://svnweb.freebsd.org/changeset/base/332015

Log:
  Match Marvell Armada38X PCI compatible with Linux
  
  In Linux FDT pcie does not have compatible string.
  Configuration of windows in mv_common was based on fdt compatible.
  Now pcie windows are configured by their parent: pcie_controller.
  Processing is moved to fdt_win_process_child. fdt_win_process now
  only walk through the tree. SOC_NODE_PCI is position of pcie function in
  soc_node_spec array.
  
  PCIe probe cannot use ofw_bus_search_compatible, because it needs to
  check also device type and parents compatible.
  
  Submitted by: Rafal Kozik 
  Reviewed by: manu [DT part]
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14749

Modified:
  head/sys/arm/mv/mv_common.c
  head/sys/arm/mv/mv_pci.c
  head/sys/dts/arm/armada-380.dtsi
  head/sys/dts/arm/armada-385.dtsi

Modified: head/sys/arm/mv/mv_common.c
==
--- head/sys/arm/mv/mv_common.c Wed Apr  4 12:36:55 2018(r332014)
+++ head/sys/arm/mv/mv_common.c Wed Apr  4 12:41:42 2018(r332015)
@@ -76,6 +76,8 @@ MALLOC_DEFINE(M_IDMA, "idma", "idma dma test memory");
 #define MV_DUMP_WIN0
 #endif
 
+struct soc_node_spec;
+
 static enum soc_family soc_family;
 
 static int mv_win_cesa_attr(int wng_sel);
@@ -174,6 +176,8 @@ int gic_decode_fdt(phandle_t iparent, pcell_t *intr, i
 static int win_cpu_from_dt(void);
 static int fdt_win_setup(void);
 
+static int fdt_win_process_child(phandle_t, struct soc_node_spec *);
+
 static uint32_t dev_mask = 0;
 static int cpu_wins_no = 0;
 static int eth_port = 0;
@@ -225,6 +229,8 @@ static struct soc_node_spec soc_nodes[] = {
{ NULL, NULL, NULL, NULL },
 };
 
+#defineSOC_NODE_PCIE_ENTRY_IDX 11
+
 typedef uint32_t(*read_cpu_ctrl_t)(uint32_t);
 typedef void(*write_cpu_ctrl_t)(uint32_t, uint32_t);
 typedef uint32_t (*win_read_t)(int);
@@ -2741,55 +2747,63 @@ moveon:
 static int
 fdt_win_process(phandle_t child)
 {
-   int i;
-   struct soc_node_spec *soc_node;
-   int addr_cells, size_cells;
-   pcell_t reg[8];
-   u_long size, base;
+   int i, ret;
 
for (i = 0; soc_nodes[i].compat != NULL; i++) {
-
-   soc_node = &soc_nodes[i];
-
/* Setup only for enabled devices */
if (ofw_bus_node_status_okay(child) == 0)
continue;
 
-   if (!ofw_bus_node_is_compatible(child, soc_node->compat))
+   if (!ofw_bus_node_is_compatible(child, soc_nodes[i].compat))
continue;
 
-   if (fdt_addrsize_cells(OF_parent(child), &addr_cells,
-   &size_cells))
-   return (ENXIO);
+   ret = fdt_win_process_child(child, &soc_nodes[i]);
+   if (ret != 0)
+   return (ret);
+   }
 
-   if ((sizeof(pcell_t) * (addr_cells + size_cells)) > sizeof(reg))
-   return (ENOMEM);
+   return (0);
+}
 
-   if (OF_getprop(child, "reg", ®, sizeof(reg)) <= 0)
-   return (EINVAL);
+static int
+fdt_win_process_child(phandle_t child, struct soc_node_spec *soc_node)
+{
+   int addr_cells, size_cells;
+   pcell_t reg[8];
+   u_long size, base;
 
-   if (addr_cells <= 2)
-   base = fdt_data_get(®[0], addr_cells);
-   else
-   base = fdt_data_get(®[addr_cells - 2], 2);
-   size = fdt_data_get(®[addr_cells], size_cells);
+   if (fdt_addrsize_cells(OF_parent(child), &addr_cells,
+   &size_cells))
+   return (ENXIO);
 
-   if (soc_node->valid_handler != NULL)
-   if (!soc_node->valid_handler())
-   return (EINVAL);
+   if ((sizeof(pcell_t) * (addr_cells + size_cells)) > sizeof(reg))
+   return (ENOMEM);
 
-   base = (base & 0x000f) | fdt_immr_va;
-   if (soc_node->decode_handler != NULL)
-   soc_node->decode_handler(base);
-   else
-   return (ENXIO);
+   if (OF_getprop(child, "reg", ®, sizeof(reg)) <= 0)
+   return (EINVAL);
 
-   if (MV_DUMP_WIN && (soc_node->dump_handler != NULL))
-   soc_node->dump_handler(base);
-   }
+   if (addr_cells <= 2)
+   base = fdt_data_get(®[0], addr_cells);
+   else
+   base = fdt_data_get(®[addr_cells - 2], 2);
+   size = fdt_data_get(®[addr_cells], size_cells);
 
+   if (soc_node->valid_handler != NULL)
+   if (!soc_node->valid_handler())
+   return (EINVAL);
+
+   base = (base & 0x000f) | fdt_immr_va;
+   if (soc_node->decode_handler != NULL)
+

svn commit: r332014 - head/sys/arm/mv

2018-04-04 Thread Marcin Wojtas
Author: mw
Date: Wed Apr  4 12:36:55 2018
New Revision: 332014
URL: https://svnweb.freebsd.org/changeset/base/332014

Log:
  Add support of PCI_RES_BUS to Marvell PCI driver
  
  GENERIC ARM config use NEW_PCIB driver (https://wiki.freebsd.org/NEW_PCIB).
  To satisfy it, allocation and deallocation of PCI_RES_BUS is necessary.
  Conditional compilation is added for backward compatibility with ARMv5
  configs.
  
  Submitted by: Rafal Kozik 
  Reviewed by: jhb
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14748

Modified:
  head/sys/arm/mv/mv_pci.c

Modified: head/sys/arm/mv/mv_pci.c
==
--- head/sys/arm/mv/mv_pci.cWed Apr  4 12:35:28 2018(r332013)
+++ head/sys/arm/mv/mv_pci.cWed Apr  4 12:36:55 2018(r332014)
@@ -312,6 +312,8 @@ struct mv_pcib_softc {
int sc_skip_enable_procedure;
int sc_enable_find_root_slot;
struct ofw_bus_iinfosc_pci_iinfo;
+
+   int ap_segment; /* PCI domain */
 };
 
 /* Local forward prototypes */
@@ -441,6 +443,8 @@ mv_pcib_attach(device_t self)
return(ENXIO);
}
 
+   sc->ap_segment = port_id;
+
if (ofw_bus_node_is_compatible(node, "mrvl,pcie")) {
sc->sc_type = MV_TYPE_PCIE;
if (ofw_bus_node_is_compatible(parnode, 
"marvell,armada-370-pcie")) {
@@ -879,6 +883,11 @@ mv_pcib_alloc_resource(device_t dev, device_t child, i
case SYS_RES_MEMORY:
rm = &sc->sc_mem_rman;
break;
+#ifdef PCI_RES_BUS
+   case PCI_RES_BUS:
+   return (pci_domain_alloc_bus(sc->ap_segment, child, rid, start,
+   end, count, flags));
+#endif
default:
return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
type, rid, start, end, count, flags));
@@ -915,7 +924,12 @@ static int
 mv_pcib_release_resource(device_t dev, device_t child, int type, int rid,
 struct resource *res)
 {
+#ifdef PCI_RES_BUS
+   struct mv_pcib_softc *sc = device_get_softc(dev);
 
+   if (type == PCI_RES_BUS)
+   return (pci_domain_release_bus(sc->ap_segment, child, rid, 
res));
+#endif
if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY)
return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child,
type, rid, res));
___
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: r332013 - vendor/opencsd/900407e9d6400f6541138d6c2e483a9fc2d699a4

2018-04-04 Thread Ruslan Bukin
Author: br
Date: Wed Apr  4 12:35:28 2018
New Revision: 332013
URL: https://svnweb.freebsd.org/changeset/base/332013

Log:
  Tag OpenCSD revision.
  
  Sponsored by: DARPA, AFRL

Added:
  vendor/opencsd/900407e9d6400f6541138d6c2e483a9fc2d699a4/
 - copied from r332012, vendor/opencsd/dist/
___
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: r332012 - in vendor/opencsd: . dist dist/decoder dist/decoder/build dist/decoder/build/linux dist/decoder/build/linux/rctdl_c_api_lib dist/decoder/build/linux/ref_trace_decode_lib dist/...

2018-04-04 Thread Ruslan Bukin
Author: br
Date: Wed Apr  4 12:33:46 2018
New Revision: 332012
URL: https://svnweb.freebsd.org/changeset/base/332012

Log:
  Import OpenCSD -- an ARM CoreSight Trace Decode library.
  
  Git ID 900407e9d6400f6541138d6c2e483a9fc2d699a4
  
  Sponsored by: DARPA, AFRL

Added:
  vendor/opencsd/
  vendor/opencsd/dist/
  vendor/opencsd/dist/.gitignore
  vendor/opencsd/dist/HOWTO.md
  vendor/opencsd/dist/LICENSE
  vendor/opencsd/dist/README.md
  vendor/opencsd/dist/TODO
  vendor/opencsd/dist/decoder/
  vendor/opencsd/dist/decoder/build/
  vendor/opencsd/dist/decoder/build/linux/
  vendor/opencsd/dist/decoder/build/linux/makefile   (contents, props changed)
  vendor/opencsd/dist/decoder/build/linux/rctdl_c_api_lib/
  vendor/opencsd/dist/decoder/build/linux/rctdl_c_api_lib/makefile   (contents, 
props changed)
  vendor/opencsd/dist/decoder/build/linux/ref_trace_decode_lib/
  vendor/opencsd/dist/decoder/build/linux/ref_trace_decode_lib/makefile   
(contents, props changed)
  vendor/opencsd/dist/decoder/build/win-vs2015/
  vendor/opencsd/dist/decoder/build/win-vs2015/opencsd.props
  vendor/opencsd/dist/decoder/build/win-vs2015/rctdl_c_api_lib/
  
vendor/opencsd/dist/decoder/build/win-vs2015/rctdl_c_api_lib/rctdl_c_api_lib.vcxproj
  
vendor/opencsd/dist/decoder/build/win-vs2015/rctdl_c_api_lib/rctdl_c_api_lib.vcxproj.filters
  vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/
  
vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.sln
  
vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj
  
vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj.filters
  vendor/opencsd/dist/decoder/docs/
  vendor/opencsd/dist/decoder/docs/build_libs.md
  vendor/opencsd/dist/decoder/docs/doxygen_config.dox
  vendor/opencsd/dist/decoder/docs/external_custom.md
  vendor/opencsd/dist/decoder/docs/specs/
  vendor/opencsd/dist/decoder/docs/specs/ARM Trace and Debug Snapshot file 
format 0v2.pdf   (contents, props changed)
  vendor/opencsd/dist/decoder/docs/test_progs.md
  vendor/opencsd/dist/decoder/include/
  vendor/opencsd/dist/decoder/include/common/
  vendor/opencsd/dist/decoder/include/common/comp_attach_notifier_i.h   
(contents, props changed)
  vendor/opencsd/dist/decoder/include/common/comp_attach_pt_t.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_code_follower.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_dcd_mngr.h   (contents, props 
changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_dcd_mngr_i.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_dcd_tree.h   (contents, props 
changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_dcd_tree_elem.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_error.h   (contents, props 
changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_error_logger.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_list.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_lib_dcd_register.h   
(contents, props changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_msg_logger.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_pe_context.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/ocsd_version.h   (contents, props 
changed)
  vendor/opencsd/dist/decoder/include/common/trc_component.h   (contents, props 
changed)
  vendor/opencsd/dist/decoder/include/common/trc_core_arch_map.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/trc_cs_config.h   (contents, props 
changed)
  vendor/opencsd/dist/decoder/include/common/trc_frame_deformatter.h   
(contents, props changed)
  vendor/opencsd/dist/decoder/include/common/trc_gen_elem.h   (contents, props 
changed)
  vendor/opencsd/dist/decoder/include/common/trc_pkt_decode_base.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/trc_pkt_elem_base.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/trc_pkt_proc_base.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/trc_printable_elem.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/common/trc_ret_stack.h   (contents, props 
changed)
  vendor/opencsd/dist/decoder/include/i_dec/
  vendor/opencsd/dist/decoder/include/i_dec/trc_i_decode.h   (contents, props 
changed)
  vendor/opencsd/dist/decoder/include/i_dec/trc_idec_arminst.h   (contents, 
props changed)
  vendor/opencsd/dist/decoder/include/interfaces/
  vendor/opencsd/dist/decoder/include/interfaces/trc_abs_typed_base_i.h   
(contents, props changed)
  vendor/opencsd/dist/decoder/include/interfaces/trc_data_raw_in_i.h   
(contents, props changed)
  vendor/opencsd/dist/decoder/include/interfaces/trc_data_rawframe_in_i.h   
(contents, props changed)
 

svn commit: r332011 - in head/sys/arm/mv: . armada

2018-04-04 Thread Marcin Wojtas
Author: mw
Date: Wed Apr  4 12:30:52 2018
New Revision: 332011
URL: https://svnweb.freebsd.org/changeset/base/332011

Log:
  Make Marvell armv7 timer and wdt registers definitions common
  
  Define timers registers for both SoCs and choose proper one during runtime
  based on information from FDT.
  In WDT driver there are different function for ArmadaXP and other ARMv5 SoCs.
  In timer driver registers definitions are stored in resource_spec structure
  and chosen during runtime.
  
  Submitted by: Rafal Kozik 
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14746

Modified:
  head/sys/arm/mv/armada/wdt.c
  head/sys/arm/mv/mvreg.h
  head/sys/arm/mv/timer.c

Modified: head/sys/arm/mv/armada/wdt.c
==
--- head/sys/arm/mv/armada/wdt.cWed Apr  4 11:30:20 2018
(r332010)
+++ head/sys/arm/mv/armada/wdt.cWed Apr  4 12:30:52 2018
(r332011)
@@ -253,8 +253,12 @@ mv_wdt_enable_armada_38x_xp_helper()
 static void
 mv_wdt_enable_armada_38x(void)
 {
-   uint32_t val;
+   uint32_t val, irq_cause;
 
+   irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE);
+   irq_cause &= IRQ_TIMER_WD_CLR;
+   write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause);
+
mv_wdt_enable_armada_38x_xp_helper();
 
val = mv_get_timer_control();
@@ -265,7 +269,10 @@ mv_wdt_enable_armada_38x(void)
 static void
 mv_wdt_enable_armada_xp(void)
 {
-   uint32_t val;
+   uint32_t val, irq_cause;
+   irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE_ARMADAXP);
+   irq_cause &= IRQ_TIMER_WD_CLR_ARMADAXP;
+   write_cpu_ctrl(BRIDGE_IRQ_CAUSE_ARMADAXP, irq_cause);
 
mv_wdt_enable_armada_38x_xp_helper();
 

Modified: head/sys/arm/mv/mvreg.h
==
--- head/sys/arm/mv/mvreg.h Wed Apr  4 11:30:20 2018(r332010)
+++ head/sys/arm/mv/mvreg.h Wed Apr  4 12:30:52 2018(r332011)
@@ -76,18 +76,16 @@
 #define MSI_IRQ_NUM32
 
 #define IRQ_CPU_SELF   0x0001
-#if defined(SOC_MV_ARMADAXP)
-#define BRIDGE_IRQ_CAUSE   0x68
-#define IRQ_TIMER0 0x0001
-#define IRQ_TIMER1 0x0002
-#define IRQ_TIMER_WD   0x0004
-#else
+#defineBRIDGE_IRQ_CAUSE_ARMADAXP   0x68
+#defineIRQ_TIMER0_ARMADAXP 0x0001
+#defineIRQ_TIMER1_ARMADAXP 0x0002
+#defineIRQ_TIMER_WD_ARMADAXP   0x0004
+
 #define BRIDGE_IRQ_CAUSE   0x10
 #define IRQ_CPU_SELF   0x0001
 #define IRQ_TIMER0 0x0002
 #define IRQ_TIMER1 0x0004
 #define IRQ_TIMER_WD   0x0008
-#endif
 
 #define BRIDGE_IRQ_MASK0x14
 #define IRQ_CPU_MASK   0x0001
@@ -97,8 +95,10 @@
 
 #define IRQ_CPU_SELF_CLR   (~IRQ_CPU_SELF)
 #define IRQ_TIMER0_CLR (~IRQ_TIMER0)
-#define IRQ_TIMER1_CLR (~IRQ_TIMER1)
 #define IRQ_TIMER_WD_CLR   (~IRQ_TIMER_WD)
+
+#defineIRQ_TIMER0_CLR_ARMADAXP (~IRQ_TIMER0_ARMADAXP)
+#defineIRQ_TIMER_WD_CLR_ARMADAXP   (~IRQ_TIMER_WD_ARMADAXP)
 
 /*
  * System reset

Modified: head/sys/arm/mv/timer.c
==
--- head/sys/arm/mv/timer.c Wed Apr  4 11:30:20 2018(r332010)
+++ head/sys/arm/mv/timer.c Wed Apr  4 12:30:52 2018(r332011)
@@ -73,6 +73,9 @@ struct mv_timer_config {
mv_watchdog_enable_twatchdog_enable;
mv_watchdog_disable_t   watchdog_disable;
unsigned intclock_src;
+   uint32_tbridge_irq_cause;
+   uint32_tirq_timer0_clr;
+   uint32_tirq_timer_wd_clr;
 };
 
 struct mv_timer_softc {
@@ -132,6 +135,9 @@ static struct mv_timer_config timer_armadaxp_config =
&mv_watchdog_enable_armadaxp,
&mv_watchdog_disable_armadaxp,
MV_CLOCK_SRC_ARMV7,
+   BRIDGE_IRQ_CAUSE_ARMADAXP,
+   IRQ_TIMER0_CLR_ARMADAXP,
+   IRQ_TIMER_WD_CLR_ARMADAXP,
 };
 static struct mv_timer_config timer_armv5_config =
 {
@@ -139,6 +145,9 @@ static struct mv_timer_config timer_armv5_config =
&mv_watchdog_enable_armv5,
&mv_watchdog_disable_armv5,
0,
+   BRIDGE_IRQ_CAUSE,
+   IRQ_TIMER0_CLR,
+   IRQ_TIMER_WD_CLR,
 };
 
 static struct ofw_compat_data mv_timer_soc_config[] = {
@@ -228,10 +237,10 @@ mv_timer_attach(device_t dev)
 
mv_setup_timers();
if (sc->config->soc_family != MV_SOC_ARMADA_XP ) {
-   irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE);
-   irq_cause &= IRQ_TIMER0_CLR;
+   irq_cause = read_cpu_ctrl(sc->config->bridge_irq_cause);
+   irq_cause &= sc->config->irq_timer0_clr;
 
-   write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause);
+   write_cpu_ctrl(sc->

svn commit: r332010 - in stable/11/sys: arm/conf arm/nvidia arm/nvidia/drm2 arm/nvidia/tegra124 boot/fdt/dts/arm contrib/dev/nvidia gnu/dts/arm gnu/dts/include/dt-bindings/clock gnu/dts/include/dt-...

2018-04-04 Thread Michal Meloun
Author: mmel
Date: Wed Apr  4 11:30:20 2018
New Revision: 332010
URL: https://svnweb.freebsd.org/changeset/base/332010

Log:
  MFC (cherry pick)r306197,r306327,r306328,r308390,r308391,r310600,r314703:
  
cherry pick from r306197:
  Nvidia Tegra 124 and Jetson TK1 related DTS.
r306327:
  Update AHCI driver to match new dts tree
r306328:
  Update PCI driver to match new dts tree
r308390:
  Rework NVIDIA Tegra124 XUSBPAD driver.
   - Adapt it for new, incompatible, DT bindings introduced by r306197.  -
   Add support for USB super speed pads/ports.
r308391:
  Add NVIDIA Tegra XHCI driver and coresponding firmware blob.
r310600:
  Implement drivers for NVIDIA tegra124 display controller, HDMI source and
  host1x module. Unfortunately, tegra124 SoC doesn't have 2D acceleration
  engine and 3D requires not yet started nouveau driver.
r314703:
  Add support for card detect and write protect gpio pins to Tegra SDHCI.

Added:
  stable/11/sys/arm/nvidia/drm2/
 - copied from r310600, head/sys/arm/nvidia/drm2/
  stable/11/sys/arm/nvidia/tegra_xhci.c
 - copied unchanged from r308391, head/sys/arm/nvidia/tegra_xhci.c
  stable/11/sys/contrib/dev/nvidia/
 - copied from r308391, head/sys/contrib/dev/nvidia/
Modified:
  stable/11/sys/arm/conf/TEGRA124
  stable/11/sys/arm/nvidia/tegra124/files.tegra124
  stable/11/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c
  stable/11/sys/arm/nvidia/tegra_ahci.c
  stable/11/sys/arm/nvidia/tegra_pcie.c
  stable/11/sys/arm/nvidia/tegra_sdhci.c
  stable/11/sys/boot/fdt/dts/arm/tegra124-jetson-tk1-fbsd.dts
  stable/11/sys/gnu/dts/arm/tegra124-jetson-tk1-emc.dtsi   (contents, props 
changed)
  stable/11/sys/gnu/dts/arm/tegra124-jetson-tk1.dts
  stable/11/sys/gnu/dts/arm/tegra124.dtsi
  stable/11/sys/gnu/dts/include/dt-bindings/clock/tegra124-car-common.h
  stable/11/sys/gnu/dts/include/dt-bindings/clock/tegra124-car.h
  stable/11/sys/gnu/dts/include/dt-bindings/gpio/tegra-gpio.h
  stable/11/sys/gnu/dts/include/dt-bindings/memory/tegra124-mc.h
  stable/11/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h
  stable/11/sys/gnu/dts/include/dt-bindings/reset/tegra124-car.h   (contents, 
props changed)
  stable/11/sys/gnu/dts/include/dt-bindings/thermal/tegra124-soctherm.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/conf/TEGRA124
==
--- stable/11/sys/arm/conf/TEGRA124 Wed Apr  4 11:14:27 2018
(r332009)
+++ stable/11/sys/arm/conf/TEGRA124 Wed Apr  4 11:30:20 2018
(r332010)
@@ -50,7 +50,7 @@ devicevlan# 802.1Q VLAN 
support
 #devicetun # Packet tunnel.
 device md  # Memory "disks"
 #devicegif # IPv6 and IPv4 tunneling
-#devicefirmware# firmware assist module
+device firmware# firmware assist module
 device ether   # Ethernet support
 device miibus  # Required for ethernet
 device bpf # Berkeley packet filter (required for 
DHCP)
@@ -86,6 +86,8 @@ devicepass# Passthrough 
device (direct ATA/SCSI a
 # USB support
 optionsUSB_HOST_ALIGN=64   # Align usb buffers to cache line size.
 device ehci# EHCI USB interface
+device xhci# XHCI USB interface
+device tegra124_xusb_fw# Tegra XUSB firmware
 device usb # USB Bus (required)
 device umass   # Disks/Mass storage - Requires scbus 
and da
 device uhid# "Human Interface Devices"
@@ -121,11 +123,10 @@ devicepci
 device re  # RealTek 8139C+/8169/8169S/8110S
 
 # DRM2
-#devicefbd
-#devicevt
-#devicesplash
-#devicekbdmux
-#devicedrm2
+device fbd
+device vt
+device kbdmux
+device drm2
 
 # Sound
 #devicesound

Modified: stable/11/sys/arm/nvidia/tegra124/files.tegra124
==
--- stable/11/sys/arm/nvidia/tegra124/files.tegra124Wed Apr  4 11:14:27 
2018(r332009)
+++ stable/11/sys/arm/nvidia/tegra124/files.tegra124Wed Apr  4 11:30:20 
2018(r332010)
@@ -24,6 +24,7 @@ arm/nvidia/tegra_uart.c   optional
uart
 arm/nvidia/tegra_sdhci.c   optionalsdhci
 arm/nvidia/tegra_gpio.coptionalgpio
 arm/nvidia/tegra_ehci.coptionalehci
+arm/nvidia/tegra_xhci.coptionalxhci
 arm/nvidia/tegra_ahci.c  

svn commit: r332003 - head/sys/dev/mlx5/mlx5_en

2018-04-04 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Apr  4 10:45:06 2018
New Revision: 332003
URL: https://svnweb.freebsd.org/changeset/base/332003

Log:
  Bump driver version number in mlx5en(4).
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cWed Apr  4 10:14:43 2018
(r332002)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cWed Apr  4 10:45:06 2018
(r332003)
@@ -30,7 +30,9 @@
 #include 
 #include 
 
-#defineETH_DRIVER_VERSION  "3.1.0-dev"
+#ifndef ETH_DRIVER_VERSION
+#defineETH_DRIVER_VERSION  "3.4.1"
+#endif
 char mlx5e_version[] = "Mellanox Ethernet driver"
 " (" ETH_DRIVER_VERSION ")";
 
___
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: r332002 - in head/sys/arm/mv: . armada

2018-04-04 Thread Marcin Wojtas
Author: mw
Date: Wed Apr  4 10:14:43 2018
New Revision: 332002
URL: https://svnweb.freebsd.org/changeset/base/332002

Log:
  Make Marvell Armada reset registers usage generic
  
  Define reset registers for both Armada38X and ArmadaXP and
  choose proper one during runtime based on information from FDT.
  
  Submitted by: Rafal Kozik 
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14745

Modified:
  head/sys/arm/mv/armada/wdt.c
  head/sys/arm/mv/mv_armv7_machdep.c
  head/sys/arm/mv/mvreg.h
  head/sys/arm/mv/timer.c

Modified: head/sys/arm/mv/armada/wdt.c
==
--- head/sys/arm/mv/armada/wdt.cWed Apr  4 09:11:15 2018
(r332001)
+++ head/sys/arm/mv/armada/wdt.cWed Apr  4 10:14:43 2018
(r332002)
@@ -245,9 +245,9 @@ mv_wdt_enable_armada_38x_xp_helper()
val |= (WD_GLOBAL_MASK | WD_CPU0_MASK);
write_cpu_mp_clocks(WD_RSTOUTn_MASK, val);
 
-   val = read_cpu_misc(RSTOUTn_MASK);
+   val = read_cpu_misc(RSTOUTn_MASK_ARMV7);
val &= ~RSTOUTn_MASK_WD;
-   write_cpu_misc(RSTOUTn_MASK, val);
+   write_cpu_misc(RSTOUTn_MASK_ARMV7, val);
 }
 
 static void
@@ -305,9 +305,9 @@ mv_wdt_disable_armada_38x_xp_helper(void)
val &= ~(WD_GLOBAL_MASK | WD_CPU0_MASK);
write_cpu_mp_clocks(WD_RSTOUTn_MASK, val);
 
-   val = read_cpu_misc(RSTOUTn_MASK);
+   val = read_cpu_misc(RSTOUTn_MASK_ARMV7);
val |= RSTOUTn_MASK_WD;
-   write_cpu_misc(RSTOUTn_MASK, RSTOUTn_MASK_WD);
+   write_cpu_misc(RSTOUTn_MASK_ARMV7, RSTOUTn_MASK_WD);
 }
 
 static void

Modified: head/sys/arm/mv/mv_armv7_machdep.c
==
--- head/sys/arm/mv/mv_armv7_machdep.c  Wed Apr  4 09:11:15 2018
(r332001)
+++ head/sys/arm/mv/mv_armv7_machdep.c  Wed Apr  4 10:14:43 2018
(r332002)
@@ -439,8 +439,8 @@ static void
 mv_cpu_reset(platform_t plat)
 {
 
-   write_cpu_misc(RSTOUTn_MASK, SOFT_RST_OUT_EN);
-   write_cpu_misc(SYSTEM_SOFT_RESET, SYS_SOFT_RST);
+   write_cpu_misc(RSTOUTn_MASK_ARMV7, SOFT_RST_OUT_EN_ARMV7);
+   write_cpu_misc(SYSTEM_SOFT_RESET_ARMV7, SYS_SOFT_RST_ARMV7);
 }
 
 #if defined(SOC_MV_ARMADA38X)

Modified: head/sys/arm/mv/mvreg.h
==
--- head/sys/arm/mv/mvreg.h Wed Apr  4 09:11:15 2018(r332001)
+++ head/sys/arm/mv/mvreg.h Wed Apr  4 10:14:43 2018(r332002)
@@ -103,17 +103,15 @@
 /*
  * System reset
  */
-#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X)
-#define RSTOUTn_MASK   0x60
-#define SYSTEM_SOFT_RESET  0x64
-#define SOFT_RST_OUT_EN0x0001
-#define SYS_SOFT_RST   0x0001
-#else
+#defineRSTOUTn_MASK_ARMV7  0x60
+#defineSYSTEM_SOFT_RESET_ARMV7 0x64
+#defineSOFT_RST_OUT_EN_ARMV7   0x0001
+#defineSYS_SOFT_RST_ARMV7  0x0001
+
 #define RSTOUTn_MASK   0x8
 #define SOFT_RST_OUT_EN0x0004
 #define SYSTEM_SOFT_RESET  0xc
 #define SYS_SOFT_RST   0x0001
-#endif
 #define RSTOUTn_MASK_WD0x400
 #define WD_RSTOUTn_MASK0x4
 #define WD_GLOBAL_MASK 0x0100

Modified: head/sys/arm/mv/timer.c
==
--- head/sys/arm/mv/timer.c Wed Apr  4 09:11:15 2018(r332001)
+++ head/sys/arm/mv/timer.c Wed Apr  4 10:14:43 2018(r332002)
@@ -411,9 +411,9 @@ mv_watchdog_enable_armadaxp(void)
val |= (WD_GLOBAL_MASK | WD_CPU0_MASK);
write_cpu_mp_clocks(WD_RSTOUTn_MASK, val);
 
-   val = read_cpu_misc(RSTOUTn_MASK);
+   val = read_cpu_misc(RSTOUTn_MASK_ARMV7);
val &= ~RSTOUTn_MASK_WD;
-   write_cpu_misc(RSTOUTn_MASK, val);
+   write_cpu_misc(RSTOUTn_MASK_ARMV7, val);
 
val = mv_get_timer_control();
val |= CPU_TIMER2_EN | CPU_TIMER2_AUTO | CPU_TIMER_WD_25MHZ_EN;
@@ -451,9 +451,9 @@ mv_watchdog_disable_armadaxp(void)
val &= ~(WD_GLOBAL_MASK | WD_CPU0_MASK);
write_cpu_mp_clocks(WD_RSTOUTn_MASK, val);
 
-   val = read_cpu_misc(RSTOUTn_MASK);
+   val = read_cpu_misc(RSTOUTn_MASK_ARMV7);
val |= RSTOUTn_MASK_WD;
-   write_cpu_misc(RSTOUTn_MASK, RSTOUTn_MASK_WD);
+   write_cpu_misc(RSTOUTn_MASK_ARMV7, RSTOUTn_MASK_WD);
 
irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE);
irq_cause &= IRQ_TIMER_WD_CLR;
___
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: r331997 - stable/10/sys/dev/usb/input

2018-04-04 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Apr  4 08:45:41 2018
New Revision: 331997
URL: https://svnweb.freebsd.org/changeset/base/331997

Log:
  MFC r331642:
  Add support for right and middle click with integrated button to WSP
  USB trackpad driver.
  
  Submitted by: James Wright 
  PR:   226961
  Sponsored by: Mellanox Technologies

Modified:
  stable/10/sys/dev/usb/input/wsp.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/input/wsp.c
==
--- stable/10/sys/dev/usb/input/wsp.c   Wed Apr  4 08:41:10 2018
(r331996)
+++ stable/10/sys/dev/usb/input/wsp.c   Wed Apr  4 08:45:41 2018
(r331997)
@@ -922,7 +922,12 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t e
sc->sc_status.button = 0;
 
if (ibt != 0) {
-   sc->sc_status.button |= MOUSE_BUTTON1DOWN;
+   if ((params->caps & HAS_INTEGRATED_BUTTON) && ntouch == 
2)
+   sc->sc_status.button |= MOUSE_BUTTON3DOWN;
+   else if ((params->caps & HAS_INTEGRATED_BUTTON) && 
ntouch == 3)
+   sc->sc_status.button |= MOUSE_BUTTON2DOWN;
+   else 
+   sc->sc_status.button |= MOUSE_BUTTON1DOWN;
sc->ibtn = 1;
}
sc->intr_count++;
___
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: r331996 - in stable/11/sys/compat/linuxkpi/common: include/linux src

2018-04-04 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Apr  4 08:41:10 2018
New Revision: 331996
URL: https://svnweb.freebsd.org/changeset/base/331996

Log:
  MFC r331828:
  Optimise use of Giant in the LinuxKPI.
  
  - Make sure Giant is locked when calling PCI device methods.
  Newbus currently requires this.
  
  - Avoid unlocking Giant right before aquiring the sleepqueue lock.
  This can save a task switch.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/module.h
  stable/11/sys/compat/linuxkpi/common/src/linux_compat.c
  stable/11/sys/compat/linuxkpi/common/src/linux_pci.c
  stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c
  stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/module.h
==
--- stable/11/sys/compat/linuxkpi/common/include/linux/module.h Wed Apr  4 
08:40:49 2018(r331995)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/module.h Wed Apr  4 
08:41:10 2018(r331996)
@@ -78,9 +78,7 @@ _module_run(void *arg)
printf("Running %s (%p)\n", name, pc);
 #endif
fn = arg;
-   DROP_GIANT();
fn();
-   PICKUP_GIANT();
 }
 
 #definemodule_init(fn) 
\

Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Apr  4 
08:40:49 2018(r331995)
+++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Apr  4 
08:41:10 2018(r331996)
@@ -1804,8 +1804,6 @@ linux_wait_for_common(struct completion *c, int flags)
if (SCHEDULER_STOPPED())
return (0);
 
-   DROP_GIANT();
-
task = current;
 
if (flags != 0)
@@ -1819,22 +1817,25 @@ linux_wait_for_common(struct completion *c, int flags)
break;
sleepq_add(c, NULL, "completion", flags, 0);
if (flags & SLEEPQ_INTERRUPTIBLE) {
+   DROP_GIANT();
error = -sleepq_wait_sig(c, 0);
+   PICKUP_GIANT();
if (error != 0) {
linux_schedule_save_interrupt_value(task, 
error);
error = -ERESTARTSYS;
goto intr;
}
-   } else
+   } else {
+   DROP_GIANT();
sleepq_wait(c, 0);
+   PICKUP_GIANT();
+   }
}
if (c->done != UINT_MAX)
c->done--;
sleepq_release(c);
 
 intr:
-   PICKUP_GIANT();
-
return (error);
 }
 
@@ -1851,8 +1852,6 @@ linux_wait_for_timeout_common(struct completion *c, in
if (SCHEDULER_STOPPED())
return (0);
 
-   DROP_GIANT();
-
task = current;
 
if (flags != 0)
@@ -1866,10 +1865,14 @@ linux_wait_for_timeout_common(struct completion *c, in
break;
sleepq_add(c, NULL, "completion", flags, 0);
sleepq_set_timeout(c, linux_timer_jiffies_until(end));
+
+   DROP_GIANT();
if (flags & SLEEPQ_INTERRUPTIBLE)
error = -sleepq_timedwait_sig(c, 0);
else
error = -sleepq_timedwait(c, 0);
+   PICKUP_GIANT();
+
if (error != 0) {
/* check for timeout */
if (error == -EWOULDBLOCK) {
@@ -1889,8 +1892,6 @@ linux_wait_for_timeout_common(struct completion *c, in
/* return how many jiffies are left */
error = linux_timer_jiffies_until(end);
 done:
-   PICKUP_GIANT();
-
return (error);
 }
 

Modified: stable/11/sys/compat/linuxkpi/common/src/linux_pci.c
==
--- stable/11/sys/compat/linuxkpi/common/src/linux_pci.cWed Apr  4 
08:40:49 2018(r331995)
+++ stable/11/sys/compat/linuxkpi/common/src/linux_pci.cWed Apr  4 
08:41:10 2018(r331996)
@@ -171,12 +171,11 @@ linux_pci_attach(device_t dev)
pdev->bus = pbus;
}
 
-   DROP_GIANT();
spin_lock(&pci_lock);
list_add(&pdev->links, &pci_devices);
spin_unlock(&pci_lock);
+
error = pdrv->probe(pdev, id);
-   PICKUP_GIANT();
if (error) {
spin_lock(&pci_lock);
list_del(&pdev->links);
@@ -194,9 +193,9 @@ linux_pci_detach(device_t dev)
 
linux_set_current(curthread);
pdev = device_get_softc(dev);
-   DROP_GIANT();
+
pdev->pdrv->remove(pdev);
-   PICKUP_GIANT();
+
spin

svn commit: r331995 - in head/sys/arm: conf mv mv/armada38x mv/armadaxp

2018-04-04 Thread Marcin Wojtas
Author: mw
Date: Wed Apr  4 08:40:49 2018
New Revision: 331995
URL: https://svnweb.freebsd.org/changeset/base/331995

Log:
  Use PLATFORM for initializing Marvell ArmadaXP and Armada38X
  
  Spliting armv5 and armv7 machdep is necessary for adding Armada38X and
  ArmadaXP to GENERIC config.
  PLATFORM framework checks SOC type in FDT and will select proper
  initialization function implementation during runtime.
  Pointers to SoC specific implementation are stored in array of
  platform_method_t and provided to framework by FDT_PLATFORM_DEF macro.
  PLATFORM framework supports also reset function. To simplify implementation
  cpu_reset is moved from mv_common to armv5 and armv7 machdep.
  
  Armada38X and ArmadaXP share now common list of files, so resolve all
  dependencies as well.
  
  Submitted by: Rafal Kozik 
  Marcin Wojtas 
  Reviewed by: mw
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14744

Added:
  head/sys/arm/mv/armada38x/armada38x_pl310.h   (contents, props changed)
  head/sys/arm/mv/armv5_machdep.c
 - copied, changed from r331994, head/sys/arm/mv/mv_machdep.c
  head/sys/arm/mv/mv_armv7_machdep.c   (contents, props changed)
Deleted:
  head/sys/arm/mv/mv_machdep.c
Modified:
  head/sys/arm/conf/ARMADA38X
  head/sys/arm/conf/ARMADAXP
  head/sys/arm/mv/armada38x/armada38x_mp.c
  head/sys/arm/mv/armada38x/armada38x_pl310.c
  head/sys/arm/mv/armada38x/std.armada38x
  head/sys/arm/mv/armadaxp/armadaxp_mp.c
  head/sys/arm/mv/armadaxp/std.mv78x60
  head/sys/arm/mv/files.arm7
  head/sys/arm/mv/files.mv
  head/sys/arm/mv/mv_common.c
  head/sys/arm/mv/std-pj4b.mv

Modified: head/sys/arm/conf/ARMADA38X
==
--- head/sys/arm/conf/ARMADA38X Wed Apr  4 08:39:59 2018(r331994)
+++ head/sys/arm/conf/ARMADA38X Wed Apr  4 08:40:49 2018(r331995)
@@ -48,9 +48,6 @@ deviceneta
 # PCI
 device pci
 
-# RTC
-device mv_rtc
-
 # Interrupt controllers
 device gic
 optionsINTRNG
@@ -95,6 +92,8 @@ devicecryptodev
 
 # L2 Cache
 device pl310
+
+optionsPLATFORM
 
 # FDT
 optionsFDT

Modified: head/sys/arm/conf/ARMADAXP
==
--- head/sys/arm/conf/ARMADAXP  Wed Apr  4 08:39:59 2018(r331994)
+++ head/sys/arm/conf/ARMADAXP  Wed Apr  4 08:40:49 2018(r331995)
@@ -90,3 +90,5 @@ options   FDT_DTB_STATIC
 makeoptionsFDT_DTS_FILE=db78460.dts
 
 options INTRNG
+
+optionsPLATFORM

Modified: head/sys/arm/mv/armada38x/armada38x_mp.c
==
--- head/sys/arm/mv/armada38x/armada38x_mp.cWed Apr  4 08:39:59 2018
(r331994)
+++ head/sys/arm/mv/armada38x/armada38x_mp.cWed Apr  4 08:40:49 2018
(r331995)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -43,9 +44,11 @@ __FBSDID("$FreeBSD$");
 
 #include "pmsu.h"
 
-int cpu_reset_deassert(void);
+static int cpu_reset_deassert(void);
+void mv_a38x_platform_mp_setmaxid(platform_t plate);
+void mv_a38x_platform_mp_start_ap(platform_t plate);
 
-int
+static int
 cpu_reset_deassert(void)
 {
bus_space_handle_t vaddr;
@@ -122,7 +125,7 @@ platform_cnt_cpus(void)
 }
 
 void
-platform_mp_setmaxid(void)
+mv_a38x_platform_mp_setmaxid(platform_t plate)
 {
 
/* Armada38x family supports maximum 2 cores */
@@ -131,7 +134,7 @@ platform_mp_setmaxid(void)
 }
 
 void
-platform_mp_start_ap(void)
+mv_a38x_platform_mp_start_ap(platform_t plate)
 {
int rv;
 

Modified: head/sys/arm/mv/armada38x/armada38x_pl310.c
==
--- head/sys/arm/mv/armada38x/armada38x_pl310.c Wed Apr  4 08:39:59 2018
(r331994)
+++ head/sys/arm/mv/armada38x/armada38x_pl310.c Wed Apr  4 08:40:49 2018
(r331995)
@@ -40,9 +40,14 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
+#include 
 
+#include "armada38x_pl310.h"
+#include "platform_pl310_if.h"
+
 void
-platform_pl310_init(struct pl310_softc *sc)
+mv_a38x_platform_pl310_init(platform_t plat, struct pl310_softc *sc)
 {
uint32_t reg;
 
@@ -63,14 +68,14 @@ platform_pl310_init(struct pl310_softc *sc)
 }
 
 void
-platform_pl310_write_ctrl(struct pl310_softc *sc, uint32_t val)
+mv_a38x_platform_pl310_write_ctrl(platform_t plat, struct pl310_softc *sc, 
uint32_t val)
 {
 
pl310_write4(sc, PL310_CTRL, val);
 }
 
 void
-platform_pl310_write_debug(struct pl310_softc *sc, uint32_t val)
+mv_a38x_platform_pl310_write_debug(platform_t plat, struct pl310_softc *sc, 
uint32_t val)
 {
 
pl310_write4(sc, PL310_DEBUG_CTRL, val);

Added: head/sys/arm/mv/armada38x/armada38x_pl310.h
===

svn commit: r331994 - stable/11/sys/compat/linuxkpi/common/include/linux

2018-04-04 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Apr  4 08:39:59 2018
New Revision: 331994
URL: https://svnweb.freebsd.org/changeset/base/331994

Log:
  MFC r331694:
  Swap two instances of regular macros with function macros in the LinuxKPI,
  to narrow down the substitution scope.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/pci.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h
==
--- stable/11/sys/compat/linuxkpi/common/include/linux/pci.hWed Apr  4 
08:37:24 2018(r331993)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/pci.hWed Apr  4 
08:39:59 2018(r331994)
@@ -538,7 +538,9 @@ struct msix_entry {
  * NB: define added to prevent this definition of pci_enable_msix from
  * clashing with the native FreeBSD version.
  */
-#definepci_enable_msix linux_pci_enable_msix
+#definepci_enable_msix(...) \
+  linux_pci_enable_msix(__VA_ARGS__)
+
 static inline int
 pci_enable_msix(struct pci_dev *pdev, struct msix_entry *entries, int nreq)
 {
@@ -572,7 +574,9 @@ pci_enable_msix(struct pci_dev *pdev, struct msix_entr
return (0);
 }
 
-#definepci_enable_msix_range   linux_pci_enable_msix_range
+#definepci_enable_msix_range(...) \
+  linux_pci_enable_msix_range(__VA_ARGS__)
+
 static inline int
 pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
 int minvec, int maxvec)
___
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: r331993 - stable/11/sys/dev/usb/input

2018-04-04 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Apr  4 08:37:24 2018
New Revision: 331993
URL: https://svnweb.freebsd.org/changeset/base/331993

Log:
  MFC r331642:
  Add support for right and middle click with integrated button to WSP
  USB trackpad driver.
  
  Submitted by: James Wright 
  PR:   226961
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/usb/input/wsp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/input/wsp.c
==
--- stable/11/sys/dev/usb/input/wsp.c   Wed Apr  4 08:09:25 2018
(r331992)
+++ stable/11/sys/dev/usb/input/wsp.c   Wed Apr  4 08:37:24 2018
(r331993)
@@ -927,7 +927,12 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t e
sc->sc_status.button = 0;
 
if (ibt != 0) {
-   sc->sc_status.button |= MOUSE_BUTTON1DOWN;
+   if ((params->caps & HAS_INTEGRATED_BUTTON) && ntouch == 
2)
+   sc->sc_status.button |= MOUSE_BUTTON3DOWN;
+   else if ((params->caps & HAS_INTEGRATED_BUTTON) && 
ntouch == 3)
+   sc->sc_status.button |= MOUSE_BUTTON2DOWN;
+   else 
+   sc->sc_status.button |= MOUSE_BUTTON1DOWN;
sc->ibtn = 1;
}
sc->intr_count++;
___
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: r331988 - in stable/11/sys/arm: arm include

2018-04-04 Thread Alexey Dokuchaev
On Wed, Apr 04, 2018 at 06:11:06AM +, Michal Meloun wrote:
> New Revision: 331988
> URL: https://svnweb.freebsd.org/changeset/base/331988
> 
> Log:
>   MFC r328467:
>   
> Implement mitigation for Spectre version 2 attacks on ARMv7.
> 
> + case CPU_ARCH_CORTEX_A8:
> + /*
> +  * For Cortex-A8, IBE bit must be set otherwise
> +  * BPIALL is effectively NOP.
> +  * Unfortunately, Cortex-A is also affected by
> +  * ARM erratum 687067 which causes non-working
> +  * BPIALL if IBE bit is set and 'Instruction L1 System
> +  * Array Debug Register 0' is not 0.
> +  * This register is not reset on power-up and is
> +  * accessible only from secure world, so we cannot do
> +  * nothing (nor detect) to fix this issue.
> +  * I afraid that on chip ROM based secure monitor on

"I'm afraid", perhaps?

> + printf("!!!WARNING!!! CPU(%d) is vulnerable to speculative "
> + "branch attacks. !!!\n"
> + "Qualcomm Krait cores are known (or believed) to be "
> + "vulnerable to \n"
> + "speculative branch attacks, no mitigation exists yet.\n",
> + PCPU_GET(cpuid));
> + goto unkonown_mitigation;
> + }  else {
> + goto unkonown_mitigation;

unkonown? :-)

./danfe
___
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"