svn commit: r310762 - head/sys/dev/sfxge/common

2016-12-29 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 08:10:51 2016
New Revision: 310762
URL: https://svnweb.freebsd.org/changeset/base/310762

Log:
  sfxge(4): regenerate MCDI headers from firmwaresrc .yml
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_regs_mcdi.h

Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h
==
--- head/sys/dev/sfxge/common/efx_regs_mcdi.h   Thu Dec 29 07:27:13 2016
(r310761)
+++ head/sys/dev/sfxge/common/efx_regs_mcdi.h   Thu Dec 29 08:10:51 2016
(r310762)
@@ -136,6 +136,8 @@
 #define MCDI_HEADER_XFLAGS_WIDTH 8
 /* Request response using event */
 #define MCDI_HEADER_XFLAGS_EVREQ 0x01
+/* Request (and signal) early doorbell return */
+#define MCDI_HEADER_XFLAGS_DBRET 0x02
 
 /* Maximum number of payload bytes */
 #define MCDI_CTL_SDU_LEN_MAX_V1 0xfc
@@ -149,7 +151,7 @@
 
 
 /* The MC can generate events for two reasons:
- *   - To complete a shared memory request if XFLAGS_EVREQ was set
+ *   - To advance a shared memory request if XFLAGS_EVREQ was set
  *   - As a notification (link state, i2c event), controlled
  * via MC_CMD_LOG_CTRL
  *
@@ -302,6 +304,12 @@
 /* The clock whose frequency you've attempted to set set
  * doesn't exist on this NIC */
 #define MC_CMD_ERR_NO_CLOCK 0x1015
+/* Returned by MC_CMD_TESTASSERT if the action that should
+ * have caused an assertion failed to do so.  */
+#define MC_CMD_ERR_UNREACHABLE 0x1016
+/* This command needs to be processed in the background but there were no
+ * resources to do so. Send it again after a command has completed. */
+#define MC_CMD_ERR_QUEUE_FULL 0x1017
 
 #define MC_CMD_ERR_CODE_OFST 0
 
@@ -483,8 +491,48 @@
 #defineMCDI_EVENT_AOE_DDR_ECC_STATUS 0xa
 /* enum: PTP status update */
 #defineMCDI_EVENT_AOE_PTP_STATUS 0xb
+/* enum: FPGA header incorrect */
+#defineMCDI_EVENT_AOE_FPGA_LOAD_HEADER_ERR 0xc
+/* enum: FPGA Powered Off due to error in powering up FPGA */
+#defineMCDI_EVENT_AOE_FPGA_POWER_OFF 0xd
+/* enum: AOE FPGA load failed due to MC to MUM communication failure */
+#defineMCDI_EVENT_AOE_FPGA_LOAD_FAILED 0xe
+/* enum: Notify that invalid flash type detected */
+#defineMCDI_EVENT_AOE_INVALID_FPGA_FLASH_TYPE 0xf
+/* enum: Notify that the attempt to run FPGA Controller firmware timedout */
+#defineMCDI_EVENT_AOE_FC_RUN_TIMEDOUT 0x10
 #defineMCDI_EVENT_AOE_ERR_DATA_LBN 8
 #defineMCDI_EVENT_AOE_ERR_DATA_WIDTH 8
+#defineMCDI_EVENT_AOE_ERR_CODE_FPGA_HEADER_VERIFY_FAILED_LBN 8
+#defineMCDI_EVENT_AOE_ERR_CODE_FPGA_HEADER_VERIFY_FAILED_WIDTH 8
+/* enum: Reading from NV failed */
+#defineMCDI_EVENT_AOE_ERR_FPGA_HEADER_NV_READ_FAIL 0x0
+/* enum: Invalid Magic Number if FPGA header */
+#defineMCDI_EVENT_AOE_ERR_FPGA_HEADER_MAGIC_FAIL 0x1
+/* enum: Invalid Silicon type detected in header */
+#defineMCDI_EVENT_AOE_ERR_FPGA_HEADER_SILICON_TYPE 0x2
+/* enum: Unsupported VRatio */
+#defineMCDI_EVENT_AOE_ERR_FPGA_HEADER_VRATIO 0x3
+/* enum: Unsupported DDR Type */
+#defineMCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_TYPE 0x4
+/* enum: DDR Voltage out of supported range */
+#defineMCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_VOLTAGE 0x5
+/* enum: Unsupported DDR speed */
+#defineMCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_SPEED 0x6
+/* enum: Unsupported DDR size */
+#defineMCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_SIZE 0x7
+/* enum: Unsupported DDR rank */
+#defineMCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_RANK 0x8
+#defineMCDI_EVENT_AOE_ERR_CODE_INVALID_FPGA_FLASH_TYPE_INFO_LBN 8
+#defineMCDI_EVENT_AOE_ERR_CODE_INVALID_FPGA_FLASH_TYPE_INFO_WIDTH 8
+/* enum: Primary boot flash */
+#defineMCDI_EVENT_AOE_FLASH_TYPE_BOOT_PRIMARY 0x0
+/* enum: Secondary boot flash */
+#defineMCDI_EVENT_AOE_FLASH_TYPE_BOOT_SECONDARY 0x1
+#defineMCDI_EVENT_AOE_ERR_CODE_FPGA_POWER_OFF_LBN 8
+#defineMCDI_EVENT_AOE_ERR_CODE_FPGA_POWER_OFF_WIDTH 8
+#defineMCDI_EVENT_AOE_ERR_CODE_FPGA_LOAD_FAILED_LBN 8
+#defineMCDI_EVENT_AOE_ERR_CODE_FPGA_LOAD_FAILED_WIDTH 8
 #defineMCDI_EVENT_RX_ERR_RXQ_LBN 0
 #defineMCDI_EVENT_RX_ERR_RXQ_WIDTH 12
 #defineMCDI_EVENT_RX_ERR_TYPE_LBN 12
@@ -765,7 +813,7 @@
 #defineFCDI_EVENT_BOOT_RESULT_WIDTH 32
 
 /* FCDI_EXTENDED_EVENT_PPS structuredef: Extended FCDI event to send PPS events
- * to the MC. Note that this structure | is overlaid over a normal FCDI event
+ * to the MC. Note that this structure | is overlayed over a normal FCDI event
  * such that bits 32-63 containing | event code, level, source etc remain the
  * same. In this case the data | field of the header is defined to be the
  * number of timestamps
@@ -966,6 +1014,8 @@
 #defineMC_CMD_COPYCODE_IN_BOOT_MAGIC_SKIP_BOOT_ICORE_SYNC_WIDTH 1
 #defineMC_CMD_COPYCODE_IN_BOOT_MAGIC_FORCE_STANDALONE_LBN 5

svn commit: r310763 - head/contrib/bsnmp/snmpd

2016-12-29 Thread Ngie Cooper
Author: ngie
Date: Thu Dec 29 08:16:43 2016
New Revision: 310763
URL: https://svnweb.freebsd.org/changeset/base/310763

Log:
  Use uint32_t instead of u_int32_t for or_last_change and services in "struct 
systemg"
  
  This is being done to match "struct systemg" in snmpmod(3)
  
  No functional change
  
  MFC after:3 days

Modified:
  head/contrib/bsnmp/snmpd/snmpmod.h

Modified: head/contrib/bsnmp/snmpd/snmpmod.h
==
--- head/contrib/bsnmp/snmpd/snmpmod.h  Thu Dec 29 08:10:51 2016
(r310762)
+++ head/contrib/bsnmp/snmpd/snmpmod.h  Thu Dec 29 08:16:43 2016
(r310763)
@@ -317,8 +317,8 @@ struct systemg {
u_char  *contact;
u_char  *name;
u_char  *location;
-   u_int32_t   services;
-   u_int32_t   or_last_change;
+   uint32_tservices;
+   uint32_tor_last_change;
 };
 extern struct systemg systemg;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310764 - head/sys/dev/sfxge/common

2016-12-29 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 08:25:00 2016
New Revision: 310764
URL: https://svnweb.freebsd.org/changeset/base/310764

Log:
  sfxge(4): sync up tlv_layout.h (from firmwaresrc 82cd8a5715e9)
  
  Submitted by:   Matthew Slattery 
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/ef10_tlv_layout.h

Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h
==
--- head/sys/dev/sfxge/common/ef10_tlv_layout.h Thu Dec 29 08:16:43 2016
(r310763)
+++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Thu Dec 29 08:25:00 2016
(r310764)
@@ -432,6 +432,7 @@ struct tlv_firmware_options {
 #define TLV_FIRMWARE_VARIANT_HIGH_TX_RATEMC_CMD_FW_HIGH_TX_RATE
 #define TLV_FIRMWARE_VARIANT_PACKED_STREAM_HASH_MODE_1 \
  
MC_CMD_FW_PACKED_STREAM_HASH_MODE_1
+#define TLV_FIRMWARE_VARIANT_RULES_ENGINEMC_CMD_FW_RULES_ENGINE
 };
 
 /* Voltage settings
@@ -797,20 +798,6 @@ struct tlv_tx_event_merging_config {
 #define TLV_TX_EVENT_MERGING_TIMEOUT_NS_DEFAULT (0x)
 #define TLV_TX_EVENT_MERGING_QEMPTY_TIMEOUT_NS_DEFAULT (0x)
 
-/* Tx vFIFO Low latency configuration 
- * 
- * To keep the desired booting behaviour for the switch, it just requires to
- * know if the low latency mode is enabled.
- */
-
-#define TLV_TAG_TX_VFIFO_ULL_MODE  (0x1027)
-struct tlv_tx_vfifo_ull_mode {
-  uint32_t tag;
-  uint32_t length;
-  uint8_t  mode;
-#define TLV_TX_VFIFO_ULL_MODE_DEFAULT0
-};
-
 /* BIU mode
  *
  * Medford2 tag for selecting VI window decode (see values below)
@@ -856,8 +843,8 @@ typedef struct tlv_tsan_config {
   uint32_t netmask;
   uint32_t gateway;
   uint32_t port;
-  uint32_t bind_retry;
-  uint32_t bind_bkout;
+  uint32_t bind_retry;  /* DEPRECATED */
+  uint32_t bind_bkout;  /* DEPRECATED */
 } tlv_tsan_config_t;
 
 /* TSA Controller IP address configuration
@@ -898,7 +885,7 @@ typedef struct tlv_binding_ticket {
   uint8_t  bytes[];
 } tlv_binding_ticket_t;
 
-/* Solarflare private key
+/* Solarflare private key  (DEPRECATED)
  *
  * Sets the Solareflare private key used for signing during the binding process
  *
@@ -907,7 +894,7 @@ typedef struct tlv_binding_ticket {
  * released code yet.
  */
 
-#define TLV_TAG_TMP_PIK_SF  (0x1025)
+#define TLV_TAG_TMP_PIK_SF  (0x1025)/* DEPRECATED */
 
 typedef struct tlv_pik_sf {
   uint32_t tag;
@@ -933,4 +920,18 @@ typedef struct tlv_ca_root_cert {
   uint8_t  bytes[];
 } tlv_ca_root_cert_t;
 
+/* Tx vFIFO Low latency configuration
+ *
+ * To keep the desired booting behaviour for the switch, it just requires to
+ * know if the low latency mode is enabled.
+ */
+
+#define TLV_TAG_TX_VFIFO_ULL_MODE   (0x1027)
+struct tlv_tx_vfifo_ull_mode {
+  uint32_t tag;
+  uint32_t length;
+  uint8_t  mode;
+#define TLV_TX_VFIFO_ULL_MODE_DEFAULT0
+};
+
 #endif /* CI_MGMT_TLV_LAYOUT_H */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310765 - head/sys/dev/sfxge/common

2016-12-29 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 08:28:42 2016
New Revision: 310765
URL: https://svnweb.freebsd.org/changeset/base/310765

Log:
  sfxge(4): add support for firmware-verified NVRAM updates to the common code
  
  Submitted by:   Andy Moreton 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  1 week
  Differential Revision:  https://reviews.freebsd.org/D8942

Modified:
  head/sys/dev/sfxge/common/ef10_impl.h
  head/sys/dev/sfxge/common/ef10_nic.c
  head/sys/dev/sfxge/common/ef10_nvram.c
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_impl.h
  head/sys/dev/sfxge/common/efx_nvram.c
  head/sys/dev/sfxge/common/siena_impl.h
  head/sys/dev/sfxge/common/siena_nic.c
  head/sys/dev/sfxge/common/siena_nvram.c

Modified: head/sys/dev/sfxge/common/ef10_impl.h
==
--- head/sys/dev/sfxge/common/ef10_impl.h   Thu Dec 29 08:25:00 2016
(r310764)
+++ head/sys/dev/sfxge/common/ef10_impl.h   Thu Dec 29 08:28:42 2016
(r310765)
@@ -384,7 +384,7 @@ ef10_nvram_partn_lock(
__inefx_nic_t *enp,
__inuint32_t partn);
 
-extern void
+extern __checkReturn   efx_rc_t
 ef10_nvram_partn_unlock(
__inefx_nic_t *enp,
__inuint32_t partn);
@@ -451,7 +451,7 @@ ef10_nvram_partn_write(
__out_bcount(size)  caddr_t data,
__insize_t size);
 
-extern void
+extern __checkReturn   efx_rc_t
 ef10_nvram_partn_rw_finish(
__inefx_nic_t *enp,
__inuint32_t partn);

Modified: head/sys/dev/sfxge/common/ef10_nic.c
==
--- head/sys/dev/sfxge/common/ef10_nic.cThu Dec 29 08:25:00 2016
(r310764)
+++ head/sys/dev/sfxge/common/ef10_nic.cThu Dec 29 08:28:42 2016
(r310765)
@@ -1105,6 +1105,18 @@ ef10_get_datapath_caps(
encp->enc_mac_stats_40g_tx_size_bins =
CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE;
 
+   /*
+* Check if firmware-verified NVRAM updates must be used.
+*
+* The firmware trusted installer requires all NVRAM updates to use
+* version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update)
+* and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated
+* partition and report the result).
+*/
+   encp->enc_fw_verified_nvram_update_required =
+   CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ?
+   B_TRUE : B_FALSE;
+
 #undef CAP_FLAG
 #undef CAP_FLAG2
 

Modified: head/sys/dev/sfxge/common/ef10_nvram.c
==
--- head/sys/dev/sfxge/common/ef10_nvram.c  Thu Dec 29 08:25:00 2016
(r310764)
+++ head/sys/dev/sfxge/common/ef10_nvram.c  Thu Dec 29 08:28:42 2016
(r310765)
@@ -2046,22 +2046,26 @@ fail1:
return (rc);
 }
 
-   void
+   __checkReturn   efx_rc_t
 ef10_nvram_partn_unlock(
__inefx_nic_t *enp,
__inuint32_t partn)
 {
-   boolean_t reboot;
+   boolean_t reboot = B_FALSE;
+   uint32_t result = 0; /* FIXME: MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */
efx_rc_t rc;
 
-   reboot = B_FALSE;
-   if ((rc = efx_mcdi_nvram_update_finish(enp, partn, reboot)) != 0)
+   rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, &result);
+   if (rc != 0)
goto fail1;
 
-   return;
+   return (0);
 
 fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+   /* FIXME: log result if verified firmware update fails */
+   return (rc);
 }
 
__checkReturn   efx_rc_t
@@ -2359,12 +2363,22 @@ fail1:
return (rc);
 }
 
-   void
+   __checkReturn   efx_rc_t
 ef10_nvram_partn_rw_finish(
__inefx_nic_t *enp,
__inuint32_t partn)
 {
-   ef10_nvram_partn_unlock(enp, partn);
+   efx_rc_t rc;
+
+   if ((rc = ef10_nvram_partn_unlock(enp, partn)) != 0)
+   goto fail1;
+
+   return (0);
+
+fail1:
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+   return (rc);
 }
 
 #endif /* EFSYS_OPT_NVRAM */

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Thu Dec 29 08:25:00 2016
(r310764)
+++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 08:28:42 2016
(r310765)
@@ -1183,6 +1183,8 @@ typedef struct efx_nic_cfg_s {
/* Minimum unidirectional bandwidth in Mb/s to max out all ports */
uint32_tenc_requi

svn commit: r310766 - head/sys/kern

2016-12-29 Thread Mateusz Guzik
Author: mjg
Date: Thu Dec 29 08:34:50 2016
New Revision: 310766
URL: https://svnweb.freebsd.org/changeset/base/310766

Log:
  cache: drop the NULL check from VP2VNODELOCK
  
  Now that negative entries are annotated with a dedicated flag, NULL vnodes
  are no longer passed.

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Dec 29 08:28:42 2016(r310765)
+++ head/sys/kern/vfs_cache.c   Thu Dec 29 08:34:50 2016(r310766)
@@ -260,12 +260,8 @@ static struct mtx *vnodelocks;
 static inline struct mtx *
 VP2VNODELOCK(struct vnode *vp)
 {
-   struct mtx *vlp;
 
-   if (vp == NULL)
-   return (NULL);
-   vlp = &vnodelocks[(((uintptr_t)(vp) >> 8) % numvnodelocks)];
-   return (vlp);
+   return (&vnodelocks[(((uintptr_t)(vp) >> 8) % numvnodelocks)]);
 }
 
 /*
@@ -1373,10 +1369,9 @@ cache_lock_vnodes_cel_3(struct celocksta
cache_assert_vlp_locked(cel->vlp[0]);
cache_assert_vlp_locked(cel->vlp[1]);
MPASS(cel->vlp[2] == NULL);
+   MPASS(vp != NULL);
 
vlp = VP2VNODELOCK(vp);
-   MPASS(vlp != NULL);
-
ret = true;
if (vlp >= cel->vlp[1]) {
mtx_lock(vlp);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310767 - head/sys/kern

2016-12-29 Thread Mateusz Guzik
Author: mjg
Date: Thu Dec 29 08:41:25 2016
New Revision: 310767
URL: https://svnweb.freebsd.org/changeset/base/310767

Log:
  cache: depessimize hashing macros/inlines
  
  All hash sizes are power-of-2, but the compiler does not know that for sure
  and 'foo % size' forces doing a division.
  
  Store the size - 1 and use 'foo & hash' instead which allows mere shift.

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Dec 29 08:34:50 2016(r310766)
+++ head/sys/kern/vfs_cache.c   Thu Dec 29 08:41:25 2016(r310767)
@@ -242,26 +242,29 @@ static struct neglist ncneg_hot;
 
 static int shrink_list_turn;
 
-static u_int   numneglists;
+#definenumneglists (ncneghash + 1)
+static u_int   ncneghash;
 static inline struct neglist *
 NCP2NEGLIST(struct namecache *ncp)
 {
 
-   return (&neglists[(((uintptr_t)(ncp) >> 8) % numneglists)]);
+   return (&neglists[(((uintptr_t)(ncp) >> 8) & ncneghash)]);
 }
 
-static u_int   numbucketlocks;
+#definenumbucketlocks (ncbuckethash + 1)
+static u_int   ncbuckethash;
 static struct rwlock_padalign  *bucketlocks;
 #defineHASH2BUCKETLOCK(hash) \
-   ((struct rwlock *)(&bucketlocks[((hash) % numbucketlocks)]))
+   ((struct rwlock *)(&bucketlocks[((hash) & ncbuckethash)]))
 
-static u_int   numvnodelocks;
+#definenumvnodelocks (ncvnodehash + 1)
+static u_int   ncvnodehash;
 static struct mtx *vnodelocks;
 static inline struct mtx *
 VP2VNODELOCK(struct vnode *vp)
 {
 
-   return (&vnodelocks[(((uintptr_t)(vp) >> 8) % numvnodelocks)]);
+   return (&vnodelocks[(((uintptr_t)(vp) >> 8) & ncvnodehash)]);
 }
 
 /*
@@ -1369,9 +1372,10 @@ cache_lock_vnodes_cel_3(struct celocksta
cache_assert_vlp_locked(cel->vlp[0]);
cache_assert_vlp_locked(cel->vlp[1]);
MPASS(cel->vlp[2] == NULL);
-   MPASS(vp != NULL);
 
+   MPASS(vp != NULL);
vlp = VP2VNODELOCK(vp);
+
ret = true;
if (vlp >= cel->vlp[1]) {
mtx_lock(vlp);
@@ -1774,21 +1778,21 @@ nchinit(void *dummy __unused)
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
 
nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash);
-   numbucketlocks = cache_roundup_2(mp_ncpus * 64);
-   if (numbucketlocks > nchash + 1)
-   numbucketlocks = nchash + 1;
+   ncbuckethash = cache_roundup_2(mp_ncpus * 64) - 1;
+   if (ncbuckethash > nchash)
+   ncbuckethash = nchash;
bucketlocks = malloc(sizeof(*bucketlocks) * numbucketlocks, M_VFSCACHE,
M_WAITOK | M_ZERO);
for (i = 0; i < numbucketlocks; i++)
rw_init_flags(&bucketlocks[i], "ncbuc", RW_DUPOK | RW_RECURSE);
-   numvnodelocks = cache_roundup_2(mp_ncpus * 64);
+   ncvnodehash = cache_roundup_2(mp_ncpus * 64) - 1;
vnodelocks = malloc(sizeof(*vnodelocks) * numvnodelocks, M_VFSCACHE,
M_WAITOK | M_ZERO);
for (i = 0; i < numvnodelocks; i++)
mtx_init(&vnodelocks[i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE);
ncpurgeminvnodes = numbucketlocks;
 
-   numneglists = 4;
+   ncneghash = 3;
neglists = malloc(sizeof(*neglists) * numneglists, M_VFSCACHE,
M_WAITOK | M_ZERO);
for (i = 0; i < numneglists; i++) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310770 - head/sys/dev/sfxge

2016-12-29 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 09:15:27 2016
New Revision: 310770
URL: https://svnweb.freebsd.org/changeset/base/310770

Log:
  sfxge(4): cleanup: clarify/unify variable name used for put-list length
  
  get_count is used for get-list.
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/sfxge_tx.c
==
--- head/sys/dev/sfxge/sfxge_tx.c   Thu Dec 29 09:10:37 2016
(r310769)
+++ head/sys/dev/sfxge/sfxge_tx.c   Thu Dec 29 09:15:27 2016
(r310770)
@@ -608,7 +608,7 @@ sfxge_tx_qdpl_put_unlocked(struct sfxge_
volatile uintptr_t *putp;
uintptr_t old;
uintptr_t new;
-   unsigned old_len;
+   unsigned int put_count;
 
KASSERT(mbuf->m_nextpkt == NULL, ("mbuf->m_nextpkt != NULL"));
 
@@ -622,14 +622,14 @@ sfxge_tx_qdpl_put_unlocked(struct sfxge_
old = *putp;
if (old != 0) {
struct mbuf *mp = (struct mbuf *)old;
-   old_len = mp->m_pkthdr.csum_data;
+   put_count = mp->m_pkthdr.csum_data;
} else
-   old_len = 0;
-   if (old_len >= stdp->std_put_max) {
+   put_count = 0;
+   if (put_count >= stdp->std_put_max) {
atomic_add_long(&txq->put_overflow, 1);
return (ENOBUFS);
}
-   mbuf->m_pkthdr.csum_data = old_len + 1;
+   mbuf->m_pkthdr.csum_data = put_count + 1;
mbuf->m_nextpkt = (void *)old;
} while (atomic_cmpset_ptr(putp, old, new) == 0);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r310234 - head/sys/vm

2016-12-29 Thread Konstantin Belousov
On Wed, Dec 28, 2016 at 07:03:52PM -0800, Adrian Chadd wrote:
> hi,
> 
> I've bisected a boot failure on mips24k (carambola2) to this commit.
> Nothing useful is printed - it hangs at startup time.
What do you mean exactly ?  Is copyright notice printed ?
Show verbose dmesg of the failing boot.

> 
> Any ideas?
No. The patch you picked changes code that is only executed for the
shadowed anonymous memory. AFAIK, including mips, there is no shadow
chains in the kernel map. Such constructs are only instantiated when
user space is operating and forking. Even if such data structure appears
in the kernel mappings, vm object code is not initialized until much
later in the boot, at vm_init stage.

> 
> 
> -adrian
> 
> 
> On 18 December 2016 at 12:56, Konstantin Belousov  wrote:
> > Author: kib
> > Date: Sun Dec 18 20:56:14 2016
> > New Revision: 310234
> > URL: https://svnweb.freebsd.org/changeset/base/310234
> >
> > Log:
> >   Improve vm_object_scan_all_shadowed() to also check swap backing objects.
> >
> >   As noted in the removed comment, it is possible and not prohibitively
> >   costly to look up the swap blocks for the given page index.  Implement
> >   a swap_pager_find_least() function to do that, and use it to iterate
> >   simultaneously over both backing object page queue and swap
> >   allocations when looking for shadowed pages.
> >
> >   Testing shows that number of new succesful scans, enabled by this
> >   addition, is small but non-zero.  When worked out, the change both
> >   further reduces the depth of the shadow object chain, and frees unused
> >   but allocated swap and memory.
> >
> >   Suggested and reviewed by:alc
> >   Tested by:pho (previous version)
> >   Sponsored by: The FreeBSD Foundation
> >   MFC after:2 weeks
> >
> > Modified:
> >   head/sys/vm/swap_pager.c
> >   head/sys/vm/swap_pager.h
> >   head/sys/vm/vm_object.c
> >
> > Modified: head/sys/vm/swap_pager.c
> > ==
> > --- head/sys/vm/swap_pager.cSun Dec 18 20:40:22 2016(r310233)
> > +++ head/sys/vm/swap_pager.cSun Dec 18 20:56:14 2016(r310234)
> > @@ -2013,6 +2013,44 @@ swp_pager_meta_ctl(vm_object_t object, v
> >  }
> >
> >  /*
> > + * Returns the least page index which is greater than or equal to the
> > + * parameter pindex and for which there is a swap block allocated.
> > + * Returns object's size if the object's type is not swap or if there
> > + * are no allocated swap blocks for the object after the requested
> > + * pindex.
> > + */
> > +vm_pindex_t
> > +swap_pager_find_least(vm_object_t object, vm_pindex_t pindex)
> > +{
> > +   struct swblock **pswap, *swap;
> > +   vm_pindex_t i, j, lim;
> > +   int idx;
> > +
> > +   VM_OBJECT_ASSERT_LOCKED(object);
> > +   if (object->type != OBJT_SWAP || object->un_pager.swp.swp_bcount == 
> > 0)
> > +   return (object->size);
> > +
> > +   mtx_lock(&swhash_mtx);
> > +   for (j = pindex; j < object->size; j = lim) {
> > +   pswap = swp_pager_hash(object, j);
> > +   lim = rounddown2(j + SWAP_META_PAGES, SWAP_META_PAGES);
> > +   if (lim > object->size)
> > +   lim = object->size;
> > +   if ((swap = *pswap) != NULL) {
> > +   for (idx = j & SWAP_META_MASK, i = j; i < lim;
> > +   i++, idx++) {
> > +   if (swap->swb_pages[idx] != SWAPBLK_NONE)
> > +   goto found;
> > +   }
> > +   }
> > +   }
> > +   i = object->size;
> > +found:
> > +   mtx_unlock(&swhash_mtx);
> > +   return (i);
> > +}
> > +
> > +/*
> >   * System call swapon(name) enables swapping on device name,
> >   * which must be in the swdevsw.  Return EBUSY
> >   * if already swapping on this device.
> >
> > Modified: head/sys/vm/swap_pager.h
> > ==
> > --- head/sys/vm/swap_pager.hSun Dec 18 20:40:22 2016(r310233)
> > +++ head/sys/vm/swap_pager.hSun Dec 18 20:56:14 2016(r310234)
> > @@ -79,6 +79,7 @@ extern int swap_pager_avail;
> >  struct xswdev;
> >  int swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len);
> >  void swap_pager_copy(vm_object_t, vm_object_t, vm_pindex_t, int);
> > +vm_pindex_t swap_pager_find_least(vm_object_t object, vm_pindex_t pindex);
> >  void swap_pager_freespace(vm_object_t, vm_pindex_t, vm_size_t);
> >  void swap_pager_swap_init(void);
> >  int swap_pager_isswapped(vm_object_t, struct swdevt *);
> >
> > Modified: head/sys/vm/vm_object.c
> > ==
> > --- head/sys/vm/vm_object.c Sun Dec 18 20:40:22 2016(r310233)
> > +++ head/sys/vm/vm_object.c Sun Dec 18 20:56:14 2016(r310234)
> > @@ -1436,36 +1436,40 @@ vm_object_

svn commit: r310774 - head/sys/kern

2016-12-29 Thread Mateusz Guzik
Author: mjg
Date: Thu Dec 29 12:01:54 2016
New Revision: 310774
URL: https://svnweb.freebsd.org/changeset/base/310774

Log:
  cache: move shrink lock init to nchinit
  
  This gets rid of unnecesary sysinit usage.
  
  While here also rename the lock to be consistent with the rest.

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Dec 29 11:32:42 2016(r310773)
+++ head/sys/kern/vfs_cache.c   Thu Dec 29 12:01:54 2016(r310774)
@@ -229,8 +229,6 @@ SYSCTL_UINT(_vfs, OID_AUTO, ncneghitsreq
 struct nchstatsnchstats;   /* cache effectiveness 
statistics */
 
 static struct mtx   ncneg_shrink_lock;
-MTX_SYSINIT(vfscache_shrink_neg, &ncneg_shrink_lock, "Name Cache shrink neg",
-MTX_DEF);
 
 struct neglist {
struct mtx  nl_lock;
@@ -1802,6 +1800,8 @@ nchinit(void *dummy __unused)
mtx_init(&ncneg_hot.nl_lock, "ncneglh", NULL, MTX_DEF);
TAILQ_INIT(&ncneg_hot.nl_list);
 
+   mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF);
+
numcalls = counter_u64_alloc(M_WAITOK);
dothits = counter_u64_alloc(M_WAITOK);
dotdothits = counter_u64_alloc(M_WAITOK);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r310234 - head/sys/vm

2016-12-29 Thread Adrian Chadd
Hiya,

It hung completely. No echoing, no early printf (after I added it), nothing.

I dug into it some more and yes, it doesn't seem to be this. Something
else is causing the now much larger kernel then before to not boot.

Sorry! Thanks for the explanation though!


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


svn commit: r310775 - in head: lib/clang/libllvm usr.bin/clang

2016-12-29 Thread Dimitry Andric
Author: dim
Date: Thu Dec 29 13:27:04 2016
New Revision: 310775
URL: https://svnweb.freebsd.org/changeset/base/310775

Log:
  Move llvm-objdump from CLANG_EXTRAS to installed by default
  
  We currently install three tools from binutils 2.17.50: as, ld, and
  objdump. Work is underway to migrate to a permissively-licensed
  tool-chain, with one goal being the retirement of binutils 2.17.50.
  
  LLVM's llvm-objdump is intended to be compatible with GNU objdump
  although it is currently missing some options and may have formatting
  differences. Enable it by default for testing and further investigation.
  It may later be changed to install as /usr/bin/objdump, it becomes a
  fully viable replacement.
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D8879

Modified:
  head/lib/clang/libllvm/Makefile
  head/usr.bin/clang/Makefile

Modified: head/lib/clang/libllvm/Makefile
==
--- head/lib/clang/libllvm/Makefile Thu Dec 29 12:01:54 2016
(r310774)
+++ head/lib/clang/libllvm/Makefile Thu Dec 29 13:27:04 2016
(r310775)
@@ -308,24 +308,24 @@ SRCS_MIN+=DebugInfo/CodeView/TypeRecord
 SRCS_MIN+= DebugInfo/CodeView/TypeRecordBuilder.cpp
 SRCS_MIN+= DebugInfo/CodeView/TypeStreamMerger.cpp
 SRCS_MIN+= DebugInfo/CodeView/TypeTableBuilder.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFCompileUnit.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFContext.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFDebugAranges.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFDebugFrame.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFDebugLine.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFDebugLoc.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFDebugMacro.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFDebugRangeList.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFFormValue.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFTypeUnit.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFUnit.cpp
-SRCS_EXT+= DebugInfo/DWARF/DWARFUnitIndex.cpp
-SRCS_EXT+= DebugInfo/DWARF/SyntaxHighlighting.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFCompileUnit.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFContext.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAranges.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFDebugFrame.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLine.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLoc.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFDebugMacro.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFDebugRangeList.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFFormValue.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFTypeUnit.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFUnit.cpp
+SRCS_MIW+= DebugInfo/DWARF/DWARFUnitIndex.cpp
+SRCS_MIW+= DebugInfo/DWARF/SyntaxHighlighting.cpp
 SRCS_EXT+= DebugInfo/PDB/GenericError.cpp
 SRCS_EXT+= DebugInfo/PDB/PDB.cpp
 SRCS_EXT+= DebugInfo/PDB/PDBContext.cpp
@@ -699,7 +699,7 @@ SRCS_MIN+=  Target/AArch64/AArch64TargetO
 SRCS_MIN+= Target/AArch64/AArch64TargetTransformInfo.cpp
 SRCS_MIN+= Target/AArch64/AsmParser/AArch64AsmParser.cpp
 SRCS_XDB+= Target/AArch64/Disassembler/AArch64Disassembler.cpp
-SRCS_XDB+= Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
+SRCS_XDW+= Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
 SRCS_MIN+= Target/AArch64/InstPrinter/AArch64InstPrinter.cpp
 SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
 SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp
@@ -880,7 +880,7 @@ SRCS_MIN+=  Target/TargetSubtargetInfo.cp
 SRCS_MIN+= Target/X86/AsmParser/X86AsmInstrumentation.cpp
 SRCS_MIN+= Target/X86/AsmParser/X86AsmParser.cpp
 SRCS_XDB+= Target/X86/Disassembler/X86Disassembler.cpp
-SRCS_XDB+= Target/X86/Disassembler/X86DisassemblerDecoder.cpp
+SRCS_XDW+= Target/X86/Disassembler/X86DisassemblerDecoder.cpp
 SRCS_MIN+= Target/X86/InstPrinter/X86ATTInstPrinter.cpp
 SRCS_MIN+= Target/X86/InstPrinter/X86InstComments.cpp
 SRCS_MIN+= Target/X86/InstPrinter/X86IntelInstPrinter.cpp
@@ -1090,6 +1090,9 @@ SRCS_MIN+=Transforms/Vectorize/SLPVecto
 SRCS_EXT+= Transforms/Vectorize/Vectorize.cpp
 
 SRCS_ALL+= ${SRCS_MIN}
+.if !defined(TOOLS_PREFIX)
+SRCS_ALL+= ${SRCS_MIW}
+.endif
 .if ${MK_CLANG_EXTRAS} != "no"
 SRCS_ALL+= ${SRCS_EXT}
 .endif
@@ -1105,6 +1108,9 @@ SRCS_ALL+=${SRCS_XDB}
 .if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "n

svn commit: r310776 - head/sys/mips/ingenic

2016-12-29 Thread Jared McNeill
Author: jmcneill
Date: Thu Dec 29 14:00:10 2016
New Revision: 310776
URL: https://svnweb.freebsd.org/changeset/base/310776

Log:
  The JZ4780 I2S can feed either the internal audio codec or the HDMI
  transmitter, but not both at the same time. This patch:
  
   - Adds a dev.pcm.0.internal_codec sysctl node for selecting between
 internal and external codec
   - Changes playback sample rate from 96 kHz to 48 kHz for HDMI compatibility
   - Enables i2s clock on codec access
  
  Reviewed by:  br
  Differential Revision:https://reviews.freebsd.org/D8960

Modified:
  head/sys/mips/ingenic/jz4780_aic.c
  head/sys/mips/ingenic/jz4780_codec.c
  head/sys/mips/ingenic/jz4780_codec.h

Modified: head/sys/mips/ingenic/jz4780_aic.c
==
--- head/sys/mips/ingenic/jz4780_aic.c  Thu Dec 29 13:27:04 2016
(r310775)
+++ head/sys/mips/ingenic/jz4780_aic.c  Thu Dec 29 14:00:10 2016
(r310776)
@@ -81,6 +81,7 @@ struct aic_softc {
void*ih;
struct xdma_channel *xchan;
xdma_controller_t   *xdma_tx;
+   int internal_codec;
 };
 
 /* Channel registers */
@@ -120,7 +121,7 @@ struct aic_rate {
 };
 
 static struct aic_rate rate_map[] = {
-   { 96000 },
+   { 48000 },
/* TODO: add more frequences */
{ 0 },
 };
@@ -355,7 +356,6 @@ aic_start(struct sc_pcminfo *scp)
int reg;
 
sc = scp->sc;
-   sc->pos = 0;
 
/* Ensure clock enabled. */
reg = READ4(sc, I2SCR);
@@ -387,10 +387,6 @@ aic_stop(struct sc_pcminfo *scp)
 
xdma_terminate(sc->xchan);
 
-   sc->pos = 0;
-
-   bzero(sc->buf_base, sc->dma_size);
-
return (0);
 }
 
@@ -411,6 +407,8 @@ aicchan_trigger(kobj_t obj, void *data, 
case PCMTRIG_START:
ch->run = 1;
 
+   sc->pos = 0;
+
aic_start(scp);
 
break;
@@ -421,6 +419,10 @@ aicchan_trigger(kobj_t obj, void *data, 
 
aic_stop(scp);
 
+   sc->pos = 0;
+
+   bzero(sc->buf_base, sc->dma_size);
+
break;
}
 
@@ -448,7 +450,7 @@ static uint32_t aic_pfmt[] = {
0
 };
 
-static struct pcmchan_caps aic_pcaps = {96000, 96000, aic_pfmt, 0};
+static struct pcmchan_caps aic_pcaps = {48000, 48000, aic_pfmt, 0};
 
 static struct pcmchan_caps *
 aicchan_getcaps(kobj_t obj, void *data)
@@ -583,16 +585,13 @@ aic_configure_clocks(struct aic_softc *s
 static int
 aic_configure(struct aic_softc *sc)
 {
-   int internal_codec;
int reg;
 
-   internal_codec = 1;
-
WRITE4(sc, AICFR, AICFR_RST);
 
/* Configure AIC */
reg = 0;
-   if (internal_codec) {
+   if (sc->internal_codec) {
reg |= (AICFR_ICDC);
} else {
reg |= (AICFR_SYNCD | AICFR_BCKD);
@@ -610,6 +609,48 @@ aic_configure(struct aic_softc *sc)
 }
 
 static int
+sysctl_hw_pcm_internal_codec(SYSCTL_HANDLER_ARGS)
+{
+   struct sc_pcminfo *scp;
+   struct sc_chinfo *ch;
+   struct aic_softc *sc;
+   int error, val;
+
+   if (arg1 == NULL)
+   return (EINVAL);
+
+   scp = arg1;
+   sc = scp->sc;
+   ch = &scp->chan[0];
+
+   snd_mtxlock(sc->lock);
+
+   val = sc->internal_codec;
+   error = sysctl_handle_int(oidp, &val, 0, req);
+   if (error || req->newptr == NULL) {
+   snd_mtxunlock(sc->lock);
+   return (error);
+   }
+   if (val < 0 || val > 1) {
+   snd_mtxunlock(sc->lock);
+   return (EINVAL);
+   }
+
+   if (sc->internal_codec != val) {
+   sc->internal_codec = val;
+   if (ch->run)
+   aic_stop(scp);
+   aic_configure(sc);
+   if (ch->run)
+   aic_start(scp);
+   }
+
+   snd_mtxunlock(sc->lock);
+
+   return (0);
+}
+
+static int
 aic_probe(device_t dev)
 {
 
@@ -635,6 +676,7 @@ aic_attach(device_t dev)
sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
sc->dev = dev;
sc->pos = 0;
+   sc->internal_codec = 1;
 
/* Get xDMA controller */
sc->xdma_tx = xdma_ofw_get(sc->dev, "tx");
@@ -718,6 +760,13 @@ aic_attach(device_t dev)
 
mixer_init(dev, &aicmixer_class, scp);
 
+   /* Create device sysctl node. */
+   SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+   OID_AUTO, "internal_codec", CTLTYPE_INT | CTLFLAG_RW,
+   scp, 0, sysctl_hw_pcm_internal_codec, "I",
+   "use internal audio codec");
+
return (0);
 }
 

Modified: head/sys/mips/ingenic/jz4780_codec.c
==
--- head/sys/mips/ingenic/jz4780_codec.cThu Dec 29 13:27:04 2016
(r310775)
+++ head/sys/mips/ingenic/

svn commit: r310777 - in head/sys: arm/freescale/imx dev/hdmi

2016-12-29 Thread Jared McNeill
Author: jmcneill
Date: Thu Dec 29 14:08:24 2016
New Revision: 310777
URL: https://svnweb.freebsd.org/changeset/base/310777

Log:
  Add support for audio on I2S based DesignWare HDMI controllers.
  
  Relnotes: yes

Modified:
  head/sys/arm/freescale/imx/imx6_hdmi.c
  head/sys/dev/hdmi/dwc_hdmi.c
  head/sys/dev/hdmi/dwc_hdmi.h
  head/sys/dev/hdmi/dwc_hdmi_fdt.c
  head/sys/dev/hdmi/dwc_hdmireg.h

Modified: head/sys/arm/freescale/imx/imx6_hdmi.c
==
--- head/sys/arm/freescale/imx/imx6_hdmi.c  Thu Dec 29 14:00:10 2016
(r310776)
+++ head/sys/arm/freescale/imx/imx6_hdmi.c  Thu Dec 29 14:08:24 2016
(r310777)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #include 
 #include 

Modified: head/sys/dev/hdmi/dwc_hdmi.c
==
--- head/sys/dev/hdmi/dwc_hdmi.cThu Dec 29 14:00:10 2016
(r310776)
+++ head/sys/dev/hdmi/dwc_hdmi.cThu Dec 29 14:08:24 2016
(r310777)
@@ -53,8 +53,23 @@ __FBSDID("$FreeBSD$");
 #include "hdmi_if.h"
 
 #defineI2C_DDC_ADDR(0x50 << 1)
+#defineI2C_DDC_SEGADDR (0x30 << 1)
 #defineEDID_LENGTH 0x80
 
+#defineEXT_TAG 0x00
+#defineCEA_TAG_ID  0x02
+#defineCEA_DTD 0x03
+#defineDTD_BASIC_AUDIO (1 << 6)
+#defineCEA_REV 0x02
+#defineCEA_DATA_OFF0x03
+#defineCEA_DATA_START  4
+#defineBLOCK_TAG(x)(((x) >> 5) & 0x7)
+#defineBLOCK_TAG_VSDB  3
+#defineBLOCK_LEN(x)((x) & 0x1f)
+#defineHDMI_VSDB_MINLEN5
+#defineHDMI_OUI"\x03\x0c\x00"
+#defineHDMI_OUI_LEN3
+
 static void
 dwc_hdmi_phy_wait_i2c_done(struct dwc_hdmi_softc *sc, int msec)
 {
@@ -122,7 +137,7 @@ dwc_hdmi_av_composer(struct dwc_hdmi_sof
HDMI_FC_INVIDCONF_IN_I_P_PROGRESSIVE);
 
/* TODO: implement HDMI part */
-   is_dvi = 1;
+   is_dvi = sc->sc_has_audio == 0;
inv_val |= (is_dvi ?
HDMI_FC_INVIDCONF_DVI_MODEZ_DVI_MODE :
HDMI_FC_INVIDCONF_DVI_MODEZ_HDMI_MODE);
@@ -419,6 +434,70 @@ dwc_hdmi_enable_video_path(struct dwc_hd
 }
 
 static void
+dwc_hdmi_configure_audio(struct dwc_hdmi_softc *sc)
+{
+   unsigned int n;
+   uint8_t val;
+
+   if (sc->sc_has_audio == 0)
+   return;
+
+   /* The following values are for 48 kHz */
+   switch (sc->sc_mode.dot_clock) {
+   case 25170:
+   n = 6864;
+   break;
+   case 27020:
+   n = 6144;
+   break;
+   case 74170:
+   n = 11648;
+   break;
+   case 148350:
+   n = 5824;
+   break;
+   default:
+   n = 6144;
+   break;
+   }
+
+   WR1(sc, HDMI_AUD_N1, (n >> 0) & 0xff);
+   WR1(sc, HDMI_AUD_N2, (n >> 8) & 0xff);
+   WR1(sc, HDMI_AUD_N3, (n >> 16) & 0xff);
+
+   val = RD1(sc, HDMI_AUD_CTS3);
+   val &= ~(HDMI_AUD_CTS3_N_SHIFT_MASK | HDMI_AUD_CTS3_CTS_MANUAL);
+   WR1(sc, HDMI_AUD_CTS3, val);
+
+   val = RD1(sc, HDMI_AUD_CONF0);
+   val &= ~HDMI_AUD_CONF0_INTERFACE_MASK;
+   val |= HDMI_AUD_CONF0_INTERFACE_IIS;
+   val &= ~HDMI_AUD_CONF0_I2SINEN_MASK;
+   val |= HDMI_AUD_CONF0_I2SINEN_CH2;
+   WR1(sc, HDMI_AUD_CONF0, val);
+
+   val = RD1(sc, HDMI_AUD_CONF1);
+   val &= ~HDMI_AUD_CONF1_DATAMODE_MASK;
+   val |= HDMI_AUD_CONF1_DATAMODE_IIS;
+   val &= ~HDMI_AUD_CONF1_DATWIDTH_MASK;
+   val |= HDMI_AUD_CONF1_DATWIDTH_16BIT;
+   WR1(sc, HDMI_AUD_CONF1, val);
+
+   WR1(sc, HDMI_AUD_INPUTCLKFS, HDMI_AUD_INPUTCLKFS_64);
+
+   WR1(sc, HDMI_FC_AUDICONF0, 1 << 4); /* CC=1 */
+   WR1(sc, HDMI_FC_AUDICONF1, 0);
+   WR1(sc, HDMI_FC_AUDICONF2, 0);  /* CA=0 */
+   WR1(sc, HDMI_FC_AUDICONF3, 0);
+   WR1(sc, HDMI_FC_AUDSV, 0xee);   /* channels valid */
+
+   /* Enable audio clock */
+   val = RD1(sc, HDMI_MC_CLKDIS);
+   val &= ~HDMI_MC_CLKDIS_AUDCLK_DISABLE;
+   WR1(sc, HDMI_MC_CLKDIS, val);
+}
+
+static void
 dwc_hdmi_video_packetize(struct dwc_hdmi_softc *sc)
 {
unsigned int color_depth = 0;
@@ -552,11 +631,15 @@ static int
 dwc_hdmi_set_mode(struct dwc_hdmi_softc *sc)
 {
 
+   /* XXX */
+   sc->sc_has_audio = 1;
+
dwc_hdmi_disable_overflow_interrupts(sc);
dwc_hdmi_av_composer(sc);
dwc_hdmi_phy_init(sc);
dwc_hdmi_enable_video_path(sc);
-   /* TODO: AVI infoframes */
+   dwc_hdmi_configure_audio(sc);
+   /* TODO:  dwc_hdmi_config_avi(sc); */
dwc_hdmi_video_packetize(sc);
/* TODO:  dwc_hdmi_video_csc(sc); */
dwc_hdmi_video_sample(sc);
@@ -567,14 +650,17 @@ dwc_hd

svn commit: r310778 - head/sys/cam/ctl

2016-12-29 Thread Alexander Motin
Author: mav
Date: Thu Dec 29 15:09:34 2016
New Revision: 310778
URL: https://svnweb.freebsd.org/changeset/base/310778

Log:
  Improve use of I/O's private area.
  
   - Since I/Os are allocates from per-port pools, make allocations store
  pointer to CTL softc there, and use it where needed instead of global.
   - Created bunch of helper macros to access LUN, port and CTL softc.
  
  MFC after: 2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_backend_ramdisk.c
  head/sys/cam/ctl/ctl_error.c
  head/sys/cam/ctl/ctl_io.h
  head/sys/cam/ctl/ctl_tpc.c

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Thu Dec 29 14:08:24 2016(r310777)
+++ head/sys/cam/ctl/ctl.c  Thu Dec 29 15:09:34 2016(r310778)
@@ -437,7 +437,6 @@ static int ctl_alloc_lun(struct ctl_soft
 struct ctl_be_lun *be_lun);
 static int ctl_free_lun(struct ctl_lun *lun);
 static void ctl_create_lun(struct ctl_be_lun *be_lun);
-static struct ctl_port * ctl_io_port(struct ctl_io_hdr *io_hdr);
 
 static int ctl_do_mode_select(union ctl_io *io);
 static int ctl_pro_preempt(struct ctl_softc *softc, struct ctl_lun *lun,
@@ -448,7 +447,7 @@ static int ctl_pro_preempt(struct ctl_so
   struct scsi_per_res_out_parms* param);
 static void ctl_pro_preempt_other(struct ctl_lun *lun,
  union ctl_ha_msg *msg);
-static void ctl_hndl_per_res_out_on_other_sc(union ctl_ha_msg *msg);
+static void ctl_hndl_per_res_out_on_other_sc(union ctl_io *io);
 static int ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len);
 static int ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len);
 static int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len);
@@ -567,13 +566,12 @@ static struct ctl_frontend ha_frontend =
 static void
 ctl_ha_datamove(union ctl_io *io)
 {
-   struct ctl_lun *lun;
+   struct ctl_lun *lun = CTL_LUN(io);
struct ctl_sg_entry *sgl;
union ctl_ha_msg msg;
uint32_t sg_entries_sent;
int do_sg_copy, i, j;
 
-   lun = (struct ctl_lun *)io->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
memset(&msg.dt, 0, sizeof(msg.dt));
msg.hdr.msg_type = CTL_MSG_DATAMOVE;
msg.hdr.original_sc = io->io_hdr.original_sc;
@@ -1803,7 +1801,8 @@ ctl_init(void)
args.mda_si_drv1 = softc;
error = make_dev_s(&args, &softc->dev, "cam/ctl");
if (error != 0) {
-   free(control_softc, M_DEVBUF);
+   free(softc, M_DEVBUF);
+   control_softc = NULL;
return (error);
}
 
@@ -1815,7 +1814,7 @@ ctl_init(void)
if (softc->sysctl_tree == NULL) {
printf("%s: unable to allocate sysctl tree\n", __func__);
destroy_dev(softc->dev);
-   free(control_softc, M_DEVBUF);
+   free(softc, M_DEVBUF);
control_softc = NULL;
return (ENOMEM);
}
@@ -1963,7 +1962,7 @@ ctl_shutdown(void)
 
sysctl_ctx_free(&softc->sysctl_ctx);
 
-   free(control_softc, M_DEVBUF);
+   free(softc, M_DEVBUF);
control_softc = NULL;
 }
 
@@ -2205,18 +2204,16 @@ ctl_create_iid(struct ctl_port *port, in
 static void
 ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio)
 {
-   struct ctl_softc *softc = control_softc;
+   struct ctl_softc *softc = CTL_SOFTC(ctsio);
+   struct ctl_port *port = CTL_PORT(ctsio);
union ctl_ha_msg msg_info;
-   struct ctl_port *port;
struct ctl_lun *lun;
const struct ctl_cmd_entry *entry;
uint32_t targ_lun;
 
targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun;
-   mtx_lock(&softc->ctl_lock);
 
/* Make sure that we know about this port. */
-   port = ctl_io_port(&ctsio->io_hdr);
if (port == NULL || (port->status & CTL_PORT_STATUS_ONLINE) == 0) {
ctl_set_internal_failure(ctsio, /*sks_valid*/ 0,
 /*retry_count*/ 1);
@@ -2224,6 +2221,7 @@ ctl_serialize_other_sc_cmd(struct ctl_sc
}
 
/* Make sure that we know about this LUN. */
+   mtx_lock(&softc->ctl_lock);
if (targ_lun >= CTL_MAX_LUNS ||
(lun = softc->ctl_luns[targ_lun]) == NULL) {
mtx_unlock(&softc->ctl_lock);
@@ -2256,8 +2254,8 @@ ctl_serialize_other_sc_cmd(struct ctl_sc
goto badjuju;
}
 
-   ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = lun;
-   ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = lun->be_lun;
+   CTL_LUN(ctsio) = lun;
+   CTL_BACKEND_LUN(ctsio) = lun->be_lun;
 
/*
 * Every I/O goes into the OOA queue for a
@@ -3625,13 +3623,6 @@ ctl_encode_lun(uint32_t decoded)
return uint64_t)RPL_LUNDATA_ATYP_EXTLUN | 0x22) << 56) | (l << 16));
 }
 
-static struct c

svn commit: r310779 - head/sys/kern

2016-12-29 Thread Mateusz Guzik
Author: mjg
Date: Thu Dec 29 16:35:49 2016
New Revision: 310779
URL: https://svnweb.freebsd.org/changeset/base/310779

Log:
  cache: sprinkle __predict_false

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Dec 29 15:09:34 2016(r310778)
+++ head/sys/kern/vfs_cache.c   Thu Dec 29 16:35:49 2016(r310779)
@@ -1104,7 +1104,7 @@ cache_lookup(struct vnode *dvp, struct v
uint32_t hash;
int error, ltype;
 
-   if (!doingcache) {
+   if (__predict_false(!doingcache)) {
cnp->cn_flags &= ~MAKEENTRY;
return (0);
}
@@ -1544,13 +1544,13 @@ cache_enter_time(struct vnode *dvp, stru
VNASSERT(dvp == NULL || (dvp->v_iflag & VI_DOOMED) == 0, dvp,
("cache_enter: Doomed vnode used as src"));
 
-   if (!doingcache)
+   if (__predict_false(!doingcache))
return;
 
/*
 * Avoid blowout in namecache entries.
 */
-   if (numcache >= desiredvnodes * ncsizefactor)
+   if (__predict_false(numcache >= desiredvnodes * ncsizefactor))
return;
 
cache_celockstate_init(&cel);
@@ -2054,9 +2054,9 @@ kern___getcwd(struct thread *td, char *b
struct vnode *cdir, *rdir;
int error;
 
-   if (disablecwd)
+   if (__predict_false(disablecwd))
return (ENODEV);
-   if (buflen < 2)
+   if (__predict_false(buflen < 2))
return (EINVAL);
if (buflen > path_max)
buflen = path_max;
@@ -2107,9 +2107,9 @@ vn_fullpath(struct thread *td, struct vn
struct vnode *rdir;
int error;
 
-   if (disablefullpath)
+   if (__predict_false(disablefullpath))
return (ENODEV);
-   if (vn == NULL)
+   if (__predict_false(vn == NULL))
return (EINVAL);
 
buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
@@ -2141,9 +2141,9 @@ vn_fullpath_global(struct thread *td, st
char *buf;
int error;
 
-   if (disablefullpath)
+   if (__predict_false(disablefullpath))
return (ENODEV);
-   if (vn == NULL)
+   if (__predict_false(vn == NULL))
return (EINVAL);
buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
error = vn_fullpath1(td, vn, rootvnode, buf, retbuf, MAXPATHLEN);
@@ -2407,7 +2407,7 @@ vn_path_to_global_path(struct thread *td
ASSERT_VOP_ELOCKED(vp, __func__);
 
/* Return ENODEV if sysctl debug.disablefullpath==1 */
-   if (disablefullpath)
+   if (__predict_false(disablefullpath))
return (ENODEV);
 
/* Construct global filesystem path from vp. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310780 - head/sys/mips/atheros

2016-12-29 Thread Adrian Chadd
Author: adrian
Date: Thu Dec 29 17:31:07 2016
New Revision: 310780
URL: https://svnweb.freebsd.org/changeset/base/310780

Log:
  [ar71xx] put in an implicit read-after-write to flush things out.
  
  Note: I may need to revisit this for mips74k.

Modified:
  head/sys/mips/atheros/ar71xxreg.h

Modified: head/sys/mips/atheros/ar71xxreg.h
==
--- head/sys/mips/atheros/ar71xxreg.h   Thu Dec 29 16:35:49 2016
(r310779)
+++ head/sys/mips/atheros/ar71xxreg.h   Thu Dec 29 17:31:07 2016
(r310780)
@@ -527,7 +527,10 @@ typedef enum {
 *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg)))
 
 #define ATH_WRITE_REG(reg, val) \
-*((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) = (val)
+do { \
+  *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) = (val); \
+  (void) ATH_READ_REG(reg); \
+} while (0)
 
 static inline void
 ar71xx_ddr_flush(uint32_t reg)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310781 - head/sys/mips/atheros

2016-12-29 Thread Adrian Chadd
Author: adrian
Date: Thu Dec 29 17:31:38 2016
New Revision: 310781
URL: https://svnweb.freebsd.org/changeset/base/310781

Log:
  [ar71xx] add EARLY_PRINTF support for the AR933x (Hornet) UART.
  
  Tested:
  
  * Carambola 2

Modified:
  head/sys/mips/atheros/uart_bus_ar933x.c

Modified: head/sys/mips/atheros/uart_bus_ar933x.c
==
--- head/sys/mips/atheros/uart_bus_ar933x.c Thu Dec 29 17:31:07 2016
(r310780)
+++ head/sys/mips/atheros/uart_bus_ar933x.c Thu Dec 29 17:31:38 2016
(r310781)
@@ -44,6 +44,9 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#ifdef EARLY_PRINTF
+#include 
+#endif
 
 #include "uart_if.h"
 
@@ -88,4 +91,25 @@ uart_ar933x_probe(device_t dev)
return (uart_bus_probe(dev, 2, freq, 0, 0));
 }
 
+/*
+ * Assume the UART is setup by the bootloader and just echo that.
+ */
+#ifdefined(EARLY_PRINTF)
+static void
+ar933x_early_putc(int c)
+{
+   int i = 1000;
+
+   /* Wait until FIFO is clear */
+   while ((i > 0) && (ATH_READ_REG(AR71XX_UART_ADDR + AR933X_UART_CS_REG) &
+AR933X_UART_CS_TX_BUSY))
+   i--;
+
+   /* Write it out */
+   ATH_WRITE_REG(AR71XX_UART_ADDR + AR933X_UART_DATA_REG,
+   (c  & 0xff)| AR933X_UART_DATA_TX_CSR);
+}
+early_putc_t *early_putc = ar933x_early_putc;
+#endif /* EARLY_PRINTF */
+
 DRIVER_MODULE(uart, apb, uart_ar933x_driver, uart_devclass, 0, 0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r310778 - head/sys/cam/ctl

2016-12-29 Thread Mateusz Guzik
On Thu, Dec 29, 2016 at 03:09:34PM +, Alexander Motin wrote:
> Author: mav
> Date: Thu Dec 29 15:09:34 2016
> New Revision: 310778
> URL: https://svnweb.freebsd.org/changeset/base/310778
> 
> Log:
>   Improve use of I/O's private area.
>   
>- Since I/Os are allocates from per-port pools, make allocations store
>   pointer to CTL softc there, and use it where needed instead of global.
>- Created bunch of helper macros to access LUN, port and CTL softc.
>   

This fails to build with:

sys/modules/ctl/../../cam/ctl/ctl.c:12522:27: error: member reference
base type 'void' is not a structure or union
mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED);

Looks like thep roblem is that CTL_SOFTC indeed does not cast and
returns void instead:
+#define CTL_SOFTC(io)  ((io)->io_hdr.ctl_private[CTL_PRIV_LUN].ptrs[1])

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


svn commit: r310782 - head/sys/cam/ctl

2016-12-29 Thread Alexander Motin
Author: mav
Date: Thu Dec 29 18:08:04 2016
New Revision: 310782
URL: https://svnweb.freebsd.org/changeset/base/310782

Log:
  Fix build with enabled debug after r310778.
  
  MFC after:2 weeks

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

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Thu Dec 29 17:31:38 2016(r310781)
+++ head/sys/cam/ctl/ctl.c  Thu Dec 29 18:08:04 2016(r310782)
@@ -12519,7 +12519,7 @@ ctl_datamove(union ctl_io *io)
 {
void (*fe_datamove)(union ctl_io *io);
 
-   mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED);
+   mtx_assert(&((struct ctl_softc *)CTL_SOFTC(io))->ctl_lock, MA_NOTOWNED);
 
CTL_DEBUG_PRINT(("ctl_datamove\n"));
 
@@ -13012,7 +13012,7 @@ static void
 ctl_datamove_remote(union ctl_io *io)
 {
 
-   mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED);
+   mtx_assert(&((struct ctl_softc *)CTL_SOFTC(io))->ctl_lock, MA_NOTOWNED);
 
if (io->io_hdr.flags & CTL_FLAG_FAILOVER) {
ctl_failover_io(io, /*have_lock*/ 0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r310778 - head/sys/cam/ctl

2016-12-29 Thread Alexander Motin
On 29.12.2016 20:02, Mateusz Guzik wrote:
> On Thu, Dec 29, 2016 at 03:09:34PM +, Alexander Motin wrote:
>> Author: mav
>> Date: Thu Dec 29 15:09:34 2016
>> New Revision: 310778
>> URL: https://svnweb.freebsd.org/changeset/base/310778
>>
>> Log:
>>   Improve use of I/O's private area.
>>   
>>- Since I/Os are allocates from per-port pools, make allocations store
>>   pointer to CTL softc there, and use it where needed instead of global.
>>- Created bunch of helper macros to access LUN, port and CTL softc.
>>   
> 
> This fails to build with:
> 
> sys/modules/ctl/../../cam/ctl/ctl.c:12522:27: error: member reference
> base type 'void' is not a structure or union
> mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED);
> 
> Looks like thep roblem is that CTL_SOFTC indeed does not cast and
> returns void instead:
> +#define CTL_SOFTC(io)  ((io)->io_hdr.ctl_private[CTL_PRIV_LUN].ptrs[1])

Thank you!  Fixed.

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


svn commit: r310783 - head/sys/netinet

2016-12-29 Thread Andrey V. Elsukov
Author: ae
Date: Thu Dec 29 19:57:46 2016
New Revision: 310783
URL: https://svnweb.freebsd.org/changeset/base/310783

Log:
  When we are sending IP fragments, update ip pointers in IP_PROBE() for
  each fragment.
  
  MFC after:1 week

Modified:
  head/sys/netinet/ip_fastfwd.c
  head/sys/netinet/ip_output.c

Modified: head/sys/netinet/ip_fastfwd.c
==
--- head/sys/netinet/ip_fastfwd.c   Thu Dec 29 18:08:04 2016
(r310782)
+++ head/sys/netinet/ip_fastfwd.c   Thu Dec 29 19:57:46 2016
(r310783)
@@ -400,8 +400,9 @@ passout:
 */
m_clrprotoflags(m);
 
-   IP_PROBE(send, NULL, NULL, ip, nh.nh_ifp,
-   ip, NULL);
+   IP_PROBE(send, NULL, NULL,
+   mtod(m, struct ip *), nh.nh_ifp,
+   mtod(m, struct ip *), NULL);
/* XXX: we can use cached route here */
error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m,
(struct sockaddr *)&dst, NULL);

Modified: head/sys/netinet/ip_output.c
==
--- head/sys/netinet/ip_output.cThu Dec 29 18:08:04 2016
(r310782)
+++ head/sys/netinet/ip_output.cThu Dec 29 19:57:46 2016
(r310783)
@@ -696,7 +696,8 @@ sendit:
 */
m_clrprotoflags(m);
 
-   IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL);
+   IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), ifp,
+   mtod(m, struct ip *), NULL);
error = (*ifp->if_output)(ifp, m,
(const struct sockaddr *)gw, ro);
} else
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310784 - head/sys/mips/mips

2016-12-29 Thread Alexander Kabaev
Author: kan
Date: Thu Dec 29 20:11:50 2016
New Revision: 310784
URL: https://svnweb.freebsd.org/changeset/base/310784

Log:
  Use mips_dcache_wbinv_range instead of mips_dcache_wb_range on CPU_XBURST
  
  Ingenic CPUs treat plain cache writeback as local-only operation and do
  nothing if that is a remote CPU that holds the dirty cache line. They
  do broadcast invalidate and write-and-invalidate to other cores though,
  so take advantage of that and use wbinv in place of wb as this still gives
  us required busdma semantics. Otherwise we'd have to do IPI to remote CPU
  ourselves.

Modified:
  head/sys/mips/mips/busdma_machdep.c

Modified: head/sys/mips/mips/busdma_machdep.c
==
--- head/sys/mips/mips/busdma_machdep.c Thu Dec 29 19:57:46 2016
(r310783)
+++ head/sys/mips/mips/busdma_machdep.c Thu Dec 29 20:11:50 2016
(r310784)
@@ -66,6 +66,16 @@ __FBSDID("$FreeBSD$");
 #define BUS_DMA_COULD_BOUNCE   BUS_DMA_BUS3
 #define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4
 
+/*
+ * On XBurst cores from Ingenic, cache-line writeback is local
+ * only, unless accompanied by invalidation. Invalidations force
+ * dirty line writeout and invalidation requests forwarded to
+ * other cores if other cores have the cache line dirty.
+ */
+#if defined(SMP) && defined(CPU_XBURST)
+#defineBUS_DMA_FORCE_WBINV
+#endif
+
 struct bounce_zone;
 
 struct bus_dma_tag {
@@ -1069,7 +1079,7 @@ bus_dmamap_sync_buf(vm_offset_t buf, int
/*
 * dcache invalidation operates on cache line aligned addresses
 * and could modify areas of memory that share the same cache line
-* at the beginning and the ending of the buffer. In order to 
+* at the beginning and the ending of the buffer. In order to
 * prevent a data loss we save these chunks in temporary buffer
 * before invalidation and restore them afer it.
 *
@@ -1099,7 +1109,7 @@ bus_dmamap_sync_buf(vm_offset_t buf, int
case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE:
case BUS_DMASYNC_POSTREAD:
 
-   /* 
+   /*
 * Save buffers that might be modified by invalidation
 */
if (size_cl)
@@ -1107,14 +1117,14 @@ bus_dmamap_sync_buf(vm_offset_t buf, int
if (size_clend)
memcpy (tmp_clend, (void*)buf_clend, size_clend);
mips_dcache_inv_range(buf, len);
-   /* 
+   /*
 * Restore them
 */
if (size_cl)
memcpy ((void*)buf_cl, tmp_cl, size_cl);
if (size_clend)
memcpy ((void*)buf_clend, tmp_clend, size_clend);
-   /* 
+   /*
 * Copies above have brought corresponding memory
 * cache lines back into dirty state. Write them back
 * out and invalidate affected cache lines again if
@@ -1132,7 +1142,7 @@ bus_dmamap_sync_buf(vm_offset_t buf, int
break;
 
case BUS_DMASYNC_PREREAD:
-   /* 
+   /*
 * Save buffers that might be modified by invalidation
 */
if (size_cl)
@@ -1147,7 +1157,7 @@ bus_dmamap_sync_buf(vm_offset_t buf, int
memcpy ((void *)buf_cl, tmp_cl, size_cl);
if (size_clend)
memcpy ((void *)buf_clend, tmp_clend, size_clend);
-   /* 
+   /*
 * Copies above have brought corresponding memory
 * cache lines back into dirty state. Write them back
 * out and invalidate affected cache lines again if
@@ -1161,7 +1171,11 @@ bus_dmamap_sync_buf(vm_offset_t buf, int
break;
 
case BUS_DMASYNC_PREWRITE:
+#ifdef BUS_DMA_FORCE_WBINV
+   mips_dcache_wbinv_range(buf, len);
+#else
mips_dcache_wb_range(buf, len);
+#endif
break;
}
 }
@@ -1175,19 +1189,24 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, 
if (op & BUS_DMASYNC_PREWRITE) {
if (bpage->datavaddr != 0)
bcopy((void *)bpage->datavaddr,
-   (void *)(bpage->vaddr_nocache != 0 ? 
+   (void *)(bpage->vaddr_nocache != 0 ?
 bpage->vaddr_nocache :
 bpage->vaddr),
bpage->datacount);
else
physcopyout(bpage->dataaddr,
-   (void *)(bpage->vaddr_nocache != 0 ? 
+   (void *)(bpage->vaddr_nocache != 0 ?
 bpage->vaddr_nocache :
   

svn commit: r310785 - head/cddl/lib/libdtrace

2016-12-29 Thread Andrey V. Elsukov
Author: ae
Date: Thu Dec 29 20:27:54 2016
New Revision: 310785
URL: https://svnweb.freebsd.org/changeset/base/310785

Log:
  Convert ipv4_flags and ipv4_offset fields into host byte order.
  Also save only high bits in the ipv4_flags, because it is defined
  as uint8_t. So now it will show DF and MF flags as 0x40 and 0x20.
  
  Reviewed by:  markj@
  MFC after:1 week

Modified:
  head/cddl/lib/libdtrace/ip.d

Modified: head/cddl/lib/libdtrace/ip.d
==
--- head/cddl/lib/libdtrace/ip.dThu Dec 29 20:11:50 2016
(r310784)
+++ head/cddl/lib/libdtrace/ip.dThu Dec 29 20:27:54 2016
(r310785)
@@ -255,8 +255,8 @@ translator ipv4info_t < struct ip *p > {
ipv4_tos =  p == NULL ? 0 : p->ip_tos;
ipv4_length =   p == NULL ? 0 : ntohs(p->ip_len);
ipv4_ident =p == NULL ? 0 : ntohs(p->ip_id);
-   ipv4_flags =p == NULL ? 0 : (p->ip_off & 0xe000);
-   ipv4_offset =   p == NULL ? 0 : p->ip_off;
+   ipv4_flags =p == NULL ? 0 : (ntohs(p->ip_off) & 0xe000) >> 8;
+   ipv4_offset =   p == NULL ? 0 : ntohs(p->ip_off) & 0x1fff;
ipv4_ttl =  p == NULL ? 0 : p->ip_ttl;
ipv4_protocol = p == NULL ? 0 : p->ip_p;
ipv4_protostr = p == NULL ? "" : protocols[p->ip_p];
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310786 - head/tests/sys/geom/class/eli

2016-12-29 Thread Alan Somers
Author: asomers
Date: Thu Dec 29 20:28:50 2016
New Revision: 310786
URL: https://svnweb.freebsd.org/changeset/base/310786

Log:
  Reduce the runtime of the GELI tests
  
  There is no reduction in test coverage.  On my system runtime is reduced
  from 38m32s to 6m24s.
  
  tests/sys/geom/class/eli/conf.sh
  tests/sys/geom/class/eli/init_a_test.sh
  tests/sys/geom/class/eli/init_test.sh
  tests/sys/geom/class/eli/integrity_copy_test.sh
  tests/sys/geom/class/eli/integrity_data_test.sh
  tests/sys/geom/class/eli/integrity_hmac_test.sh
  tests/sys/geom/class/eli/onetime_a_test.sh
  tests/sys/geom/class/eli/onetime_test.sh
Move the looping code into common functions in conf.sh, and remove
alias ciphers from the list.
  
  tests/sys/geom/class/eli/init_a_test.sh
  tests/sys/geom/class/eli/init_test.sh
  tests/sys/geom/class/eli/integrity_copy_test.sh
  tests/sys/geom/class/eli/integrity_data_test.sh
  tests/sys/geom/class/eli/integrity_hmac_test.sh
  tests/sys/geom/class/eli/onetime_a_test.sh
Move a few commands that don't need to be in the inner loop out.
  
  tests/sys/geom/class/eli/init_test.sh
  tests/sys/geom/class/eli/onetime_a_test.sh
Reduce the sector count
  
  tests/sys/geom/class/eli/Makefile
  tests/sys/geom/class/eli/init_alias_test.sh
Add a test for initializing a GELI device using one of the cipher
aliases, and check that the alias is correctly interpreted.
  
  MFC after:4 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D8814

Added:
  head/tests/sys/geom/class/eli/init_alias_test.sh   (contents, props changed)
Modified:
  head/tests/sys/geom/class/eli/Makefile
  head/tests/sys/geom/class/eli/conf.sh
  head/tests/sys/geom/class/eli/init_a_test.sh
  head/tests/sys/geom/class/eli/init_test.sh
  head/tests/sys/geom/class/eli/integrity_copy_test.sh
  head/tests/sys/geom/class/eli/integrity_data_test.sh
  head/tests/sys/geom/class/eli/integrity_hmac_test.sh
  head/tests/sys/geom/class/eli/onetime_a_test.sh
  head/tests/sys/geom/class/eli/onetime_test.sh

Modified: head/tests/sys/geom/class/eli/Makefile
==
--- head/tests/sys/geom/class/eli/Makefile  Thu Dec 29 20:27:54 2016
(r310785)
+++ head/tests/sys/geom/class/eli/Makefile  Thu Dec 29 20:28:50 2016
(r310786)
@@ -11,6 +11,7 @@ TAP_TESTS_SH+= detach_l_test
 TAP_TESTS_SH+= init_B_test
 TAP_TESTS_SH+= init_J_test
 TAP_TESTS_SH+= init_a_test
+TAP_TESTS_SH+= init_alias_test
 TAP_TESTS_SH+= init_i_P_test
 TAP_TESTS_SH+= init_test
 TAP_TESTS_SH+= integrity_copy_test

Modified: head/tests/sys/geom/class/eli/conf.sh
==
--- head/tests/sys/geom/class/eli/conf.sh   Thu Dec 29 20:27:54 2016
(r310785)
+++ head/tests/sys/geom/class/eli/conf.sh   Thu Dec 29 20:28:50 2016
(r310786)
@@ -11,6 +11,54 @@ while [ -c /dev/md$no ]; do
: $(( no += 1 ))
 done
 
+# Execute `func` for each combination of cipher, sectorsize, and hmac algo
+# `func` usage should be:
+# func   
+for_each_geli_config() {
+   func=$1
+
+   for cipher in aes-xts:128 aes-xts:256 \
+   aes-cbc:128 aes-cbc:192 aes-cbc:256 \
+   3des-cbc:192 \
+   blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 \
+   blowfish-cbc:224 blowfish-cbc:256 blowfish-cbc:288 \
+   blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \
+   blowfish-cbc:416 blowfish-cbc:448 \
+   camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do
+   ealgo=${cipher%%:*}
+   keylen=${cipher##*:}
+   for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 \
+   hmac/sha384 hmac/sha512; do
+   for secsize in 512 1024 2048 4096 8192; do
+   ${func} $cipher $aalgo $secsize
+   done
+   done
+   done
+}
+
+# Execute `func` for each combination of cipher, and sectorsize, with no hmac
+# `func` usage should be:
+# func  
+for_each_geli_config_nointegrity() {
+   func=$1
+
+   for cipher in aes-xts:128 aes-xts:256 \
+   aes-cbc:128 aes-cbc:192 aes-cbc:256 \
+   3des-cbc:192 \
+   blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 \
+   blowfish-cbc:224 blowfish-cbc:256 blowfish-cbc:288 \
+   blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \
+   blowfish-cbc:416 blowfish-cbc:448 \
+   camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do
+   ealgo=${cipher%%:*}
+   keylen=${cipher##*:}
+   for secsize in 512 1024 2048 4096 8192; do
+   ${func} $cipher $aalgo $secsize
+   done
+   done
+}
+
+
 geli_test_cleanup()
 {
[ -c /dev/md${no}.eli ] && geli detach md${no}.eli

Modified: head/tests/sys/geom/cla

svn commit: r310789 - head/lib/libpam/static_libpam

2016-12-29 Thread Alexander Kabaev
Author: kan
Date: Thu Dec 29 21:30:52 2016
New Revision: 310789
URL: https://svnweb.freebsd.org/changeset/base/310789

Log:
  Use compiler driver to build relocatable object
  
  This works better with external toolchains where LD
  will not necessarily defailt to emulation we want.
  Compiler driver knows better.

Modified:
  head/lib/libpam/static_libpam/Makefile

Modified: head/lib/libpam/static_libpam/Makefile
==
--- head/lib/libpam/static_libpam/Makefile  Thu Dec 29 21:06:31 2016
(r310788)
+++ head/lib/libpam/static_libpam/Makefile  Thu Dec 29 21:30:52 2016
(r310789)
@@ -64,6 +64,6 @@ CLEANFILES+=  openpam_static.o \
openpam_static_modules.o
 
 openpam_static_modules.o: openpam_static.o ${STATIC_MODULES}
-   ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC}
+   ${CC} -nostdlib ${CFLAGS} -o ${.TARGET} -r -Wl,--whole-archive 
${.ALLSRC}
 
 .include "${.CURDIR}/../libpam/Makefile"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310790 - head/sys/conf

2016-12-29 Thread Alexander Kabaev
Author: kan
Date: Thu Dec 29 21:36:04 2016
New Revision: 310790
URL: https://svnweb.freebsd.org/changeset/base/310790

Log:
  Use TARGET_ARCH instead of MACHINE_ARCH for MIPS kernel
  
  MACHINE_ARCH is overwritten by config file and will not
  contain -hf suffix, so uname -p reported by kernel will
  be wrong.

Modified:
  head/sys/conf/kern.pre.mk

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Thu Dec 29 21:30:52 2016(r310789)
+++ head/sys/conf/kern.pre.mk   Thu Dec 29 21:36:04 2016(r310790)
@@ -74,7 +74,7 @@ CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KE
 CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100
 CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000
 .if ${MACHINE_CPUARCH} == "mips"
-CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 
-DMACHINE_ARCH='"${MACHINE_ARCH}"'
+CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 
-DMACHINE_ARCH='"${TARGET_ARCH}"'
 .endif
 CFLAGS.gcc+= -fno-common -fms-extensions -finline-limit=${INLINE_LIMIT}
 CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-12-29 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Dec 29 21:55:23 2016
New Revision: 310791
URL: https://svnweb.freebsd.org/changeset/base/310791

Log:
  [qemu] Fix VERSATILEPB kernel boot in QEMU broken by r300968
  
  QEMU does not implement hardware debug registers so when
  dbg_monitor_is_enabled is called kernel receives "invalid instruction"
  exception. QEMU implements only DIDR register and on read returns all
  zeroes to indicate that it doesn't support other registers. Real
  hardware has Version bits set.
  
  MFC after:1 week

Modified:
  head/sys/arm/arm/debug_monitor.c

Modified: head/sys/arm/arm/debug_monitor.c
==
--- head/sys/arm/arm/debug_monitor.cThu Dec 29 21:36:04 2016
(r310790)
+++ head/sys/arm/arm/debug_monitor.cThu Dec 29 21:55:23 2016
(r310791)
@@ -792,10 +792,21 @@ dbg_get_ossr(void)
 static __inline boolean_t
 dbg_arch_supported(void)
 {
+   uint32_t dbg_didr;
 
switch (dbg_model) {
case ID_DFR0_CP_DEBUG_M_V6:
case ID_DFR0_CP_DEBUG_M_V6_1:
+   dbg_didr = cp14_dbgdidr_get();
+   /*
+* read-all-zeroes is used by QEMU
+* to indicate that ARMv6 debug support
+* is not implemented. Real hardware has at
+* least version bits set
+*/
+   if (dbg_didr == 0)
+   return (FALSE);
+   return (TRUE);
case ID_DFR0_CP_DEBUG_M_V7:
case ID_DFR0_CP_DEBUG_M_V7_1:   /* fall through */
return (TRUE);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310792 - in head: lib/clang/libllvm usr.bin/clang

2016-12-29 Thread Dimitry Andric
Author: dim
Date: Thu Dec 29 21:57:16 2016
New Revision: 310792
URL: https://svnweb.freebsd.org/changeset/base/310792

Log:
  Revert r310775 for now, until we can figure out why it does not seem to
  work properly when cross-building.  Sorry for the breakage.

Modified:
  head/lib/clang/libllvm/Makefile
  head/usr.bin/clang/Makefile

Modified: head/lib/clang/libllvm/Makefile
==
--- head/lib/clang/libllvm/Makefile Thu Dec 29 21:55:23 2016
(r310791)
+++ head/lib/clang/libllvm/Makefile Thu Dec 29 21:57:16 2016
(r310792)
@@ -308,24 +308,24 @@ SRCS_MIN+=DebugInfo/CodeView/TypeRecord
 SRCS_MIN+= DebugInfo/CodeView/TypeRecordBuilder.cpp
 SRCS_MIN+= DebugInfo/CodeView/TypeStreamMerger.cpp
 SRCS_MIN+= DebugInfo/CodeView/TypeTableBuilder.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFCompileUnit.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFContext.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAranges.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFDebugFrame.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLine.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLoc.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFDebugMacro.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFDebugRangeList.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFFormValue.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFTypeUnit.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFUnit.cpp
-SRCS_MIW+= DebugInfo/DWARF/DWARFUnitIndex.cpp
-SRCS_MIW+= DebugInfo/DWARF/SyntaxHighlighting.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFCompileUnit.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFContext.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFDebugAranges.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFDebugFrame.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFDebugLine.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFDebugLoc.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFDebugMacro.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFDebugRangeList.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFFormValue.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFTypeUnit.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFUnit.cpp
+SRCS_EXT+= DebugInfo/DWARF/DWARFUnitIndex.cpp
+SRCS_EXT+= DebugInfo/DWARF/SyntaxHighlighting.cpp
 SRCS_EXT+= DebugInfo/PDB/GenericError.cpp
 SRCS_EXT+= DebugInfo/PDB/PDB.cpp
 SRCS_EXT+= DebugInfo/PDB/PDBContext.cpp
@@ -699,7 +699,7 @@ SRCS_MIN+=  Target/AArch64/AArch64TargetO
 SRCS_MIN+= Target/AArch64/AArch64TargetTransformInfo.cpp
 SRCS_MIN+= Target/AArch64/AsmParser/AArch64AsmParser.cpp
 SRCS_XDB+= Target/AArch64/Disassembler/AArch64Disassembler.cpp
-SRCS_XDW+= Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
+SRCS_XDB+= Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
 SRCS_MIN+= Target/AArch64/InstPrinter/AArch64InstPrinter.cpp
 SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
 SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp
@@ -880,7 +880,7 @@ SRCS_MIN+=  Target/TargetSubtargetInfo.cp
 SRCS_MIN+= Target/X86/AsmParser/X86AsmInstrumentation.cpp
 SRCS_MIN+= Target/X86/AsmParser/X86AsmParser.cpp
 SRCS_XDB+= Target/X86/Disassembler/X86Disassembler.cpp
-SRCS_XDW+= Target/X86/Disassembler/X86DisassemblerDecoder.cpp
+SRCS_XDB+= Target/X86/Disassembler/X86DisassemblerDecoder.cpp
 SRCS_MIN+= Target/X86/InstPrinter/X86ATTInstPrinter.cpp
 SRCS_MIN+= Target/X86/InstPrinter/X86InstComments.cpp
 SRCS_MIN+= Target/X86/InstPrinter/X86IntelInstPrinter.cpp
@@ -1090,9 +1090,6 @@ SRCS_MIN+=Transforms/Vectorize/SLPVecto
 SRCS_EXT+= Transforms/Vectorize/Vectorize.cpp
 
 SRCS_ALL+= ${SRCS_MIN}
-.if !defined(TOOLS_PREFIX)
-SRCS_ALL+= ${SRCS_MIW}
-.endif
 .if ${MK_CLANG_EXTRAS} != "no"
 SRCS_ALL+= ${SRCS_EXT}
 .endif
@@ -1108,9 +1105,6 @@ SRCS_ALL+=${SRCS_XDB}
 .if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || ${MK_LLD} != "no"
 SRCS_ALL+= ${SRCS_XDL}
 .endif
-.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || !defined(TOOLS_PREFIX)
-SRCS_ALL+= ${SRCS_XDW}
-.endif
 SRCS+= ${SRCS_ALL:O}
 
 llvm/IR/Attributes.inc: ${LLVM_SRCS}/include/llvm/IR/Attributes.td

Modified: head/usr.bin/clang/Makefile
==
--- head/usr.bin/clang/Makefile Thu Dec 29 21:55:23 2016(r310791)
+++ head/usr.bin/clang/Makefile Thu Dec 29 21:57:16 2016(r310792)
@@

Re: svn commit: r310790 - head/sys/conf

2016-12-29 Thread Warner Losh
On Thu, Dec 29, 2016 at 2:36 PM, Alexander Kabaev  wrote:
> Author: kan
> Date: Thu Dec 29 21:36:04 2016
> New Revision: 310790
> URL: https://svnweb.freebsd.org/changeset/base/310790
>
> Log:
>   Use TARGET_ARCH instead of MACHINE_ARCH for MIPS kernel

TARGET_ARCH is only defined for cross builds. I'm pretty sure this is wrong.
It won't work for native builds. TARGET_ARCH only has meaning in Makefile.inc1.

>   MACHINE_ARCH is overwritten by config file and will not
>   contain -hf suffix, so uname -p reported by kernel will
>   be wrong.

Then that must be fixed instead.

Warner

> Modified:
>   head/sys/conf/kern.pre.mk
>
> Modified: head/sys/conf/kern.pre.mk
> ==
> --- head/sys/conf/kern.pre.mk   Thu Dec 29 21:30:52 2016(r310789)
> +++ head/sys/conf/kern.pre.mk   Thu Dec 29 21:36:04 2016(r310790)
> @@ -74,7 +74,7 @@ CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KE
>  CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100
>  CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000
>  .if ${MACHINE_CPUARCH} == "mips"
> -CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 
> -DMACHINE_ARCH='"${MACHINE_ARCH}"'
> +CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 
> -DMACHINE_ARCH='"${TARGET_ARCH}"'
>  .endif
>  CFLAGS.gcc+= -fno-common -fms-extensions -finline-limit=${INLINE_LIMIT}
>  CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH}
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310793 - head/sys/dev/rtwn/rtl8812a

2016-12-29 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Dec 29 22:36:16 2016
New Revision: 310793
URL: https://svnweb.freebsd.org/changeset/base/310793

Log:
  rtwn: silence compiler warning (-Wmaybe-uninitialized).
  
  Reported by:  adrian

Modified:
  head/sys/dev/rtwn/rtl8812a/r12a_chan.c

Modified: head/sys/dev/rtwn/rtl8812a/r12a_chan.c
==
--- head/sys/dev/rtwn/rtl8812a/r12a_chan.c  Thu Dec 29 21:57:16 2016
(r310792)
+++ head/sys/dev/rtwn/rtl8812a/r12a_chan.c  Thu Dec 29 22:36:16 2016
(r310793)
@@ -332,7 +332,7 @@ r12a_set_band(struct rtwn_softc *sc, str
 
/* XXX PATH_B is set by vendor driver. */
for (i = 0; i < 2; i++) {
-   uint16_t val;
+   uint16_t val = 0;
 
switch ((swing >> i * 2) & 0x3) {
case 0:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310794 - in head/sys: conf mips/conf

2016-12-29 Thread Alexander Kabaev
Author: kan
Date: Fri Dec 30 00:34:52 2016
New Revision: 310794
URL: https://svnweb.freebsd.org/changeset/base/310794

Log:
  Support mips[*]hf variants in config files
  
  Recognize new MACHINE_ARCH names now as we have added hardfloat support.
  Switch JZ4780 to mipselhf and remove all uses of TARGET_ARCH in kernel
  .mk files.
  
  Reviewed by:  adrian
  Differential Revision:https://reviews.freebsd.org/D8989

Modified:
  head/sys/conf/files.mips
  head/sys/conf/kern.mk
  head/sys/conf/kern.pre.mk
  head/sys/conf/options.mips
  head/sys/mips/conf/JZ4780

Modified: head/sys/conf/files.mips
==
--- head/sys/conf/files.mipsThu Dec 29 22:36:16 2016(r310793)
+++ head/sys/conf/files.mipsFri Dec 30 00:34:52 2016(r310794)
@@ -52,7 +52,7 @@ kern/kern_clocksource.c   standard
 kern/link_elf_obj.cstandard
 kern/subr_busdma_bufalloc.cstandard
 kern/subr_dummy_vdso_tc.c  standard
-kern/subr_sfbuf.c  optionalmips | mipsel | mipsn32
+kern/subr_sfbuf.c  standard
 
 # gcc/clang runtime
 libkern/ffsl.c standard
@@ -61,8 +61,8 @@ libkern/fls.c standard
 libkern/flsl.c standard
 libkern/flsll.cstandard
 libkern/memmove.c  standard
-libkern/cmpdi2.c   optionalmips | mipsel
-libkern/ucmpdi2.c  optionalmips | mipsel
+libkern/cmpdi2.c   optionalmips | mipshf | mipsel 
| mipselhf
+libkern/ucmpdi2.c  optionalmips | mipshf | mipsel 
| mipselhf
 libkern/ashldi3.c  standard
 libkern/ashrdi3.c  standard
 

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Thu Dec 29 22:36:16 2016(r310793)
+++ head/sys/conf/kern.mk   Fri Dec 30 00:34:52 2016(r310794)
@@ -184,7 +184,7 @@ CFLAGS.gcc+=-mcall-aixdesc
 .if ${MACHINE_CPUARCH} == "mips"
 CFLAGS+=   -msoft-float
 INLINE_LIMIT?= 8000
-.if ${TARGET_ARCH:Mmips*hf} != ""
+.if ${MACHINE_ARCH:Mmips*hf} != ""
 CFLAGS+= -DCPU_HAVEFPU
 .endif
 .endif

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Thu Dec 29 22:36:16 2016(r310793)
+++ head/sys/conf/kern.pre.mk   Fri Dec 30 00:34:52 2016(r310794)
@@ -74,7 +74,7 @@ CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KE
 CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100
 CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000
 .if ${MACHINE_CPUARCH} == "mips"
-CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 
-DMACHINE_ARCH='"${TARGET_ARCH}"'
+CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 
-DMACHINE_ARCH='"${MACHINE_ARCH}"'
 .endif
 CFLAGS.gcc+= -fno-common -fms-extensions -finline-limit=${INLINE_LIMIT}
 CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH}

Modified: head/sys/conf/options.mips
==
--- head/sys/conf/options.mips  Thu Dec 29 22:36:16 2016(r310793)
+++ head/sys/conf/options.mips  Fri Dec 30 00:34:52 2016(r310794)
@@ -50,9 +50,13 @@ CPU_MALTAopt_global.h
 
 # which MACHINE_ARCH architecture
 MIPS
+MIPSHF
 MIPSEL
+MIPSELHF
 MIPS64
+MIPS64HF
 MIPS64EL
+MIPS64ELHF
 MIPSN32
 
 COMPAT_FREEBSD32   opt_compat.h

Modified: head/sys/mips/conf/JZ4780
==
--- head/sys/mips/conf/JZ4780   Thu Dec 29 22:36:16 2016(r310793)
+++ head/sys/mips/conf/JZ4780   Fri Dec 30 00:34:52 2016(r310794)
@@ -5,7 +5,7 @@
 #NO_UNIVERSE
 
 ident  JZ4780
-machinemips mipsel
+machinemips mipselhf
 cpuCPU_XBURST
 cpuCPU_MIPS4KC
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r310782 - head/sys/cam/ctl

2016-12-29 Thread Ravi Pokala
Hi Alexander,

Wouldn't it be better to put the cast directly in the definition of 
CTL_SOFTC()? That puts the cast in a single place, and anything that calls 
CTL_SOFTC() will expect a (struct ctl_softc *) anyway.

Thanks, and happy holidays!

-Ravi (rpokala@)

-Original Message-
> From:  on behalf of Alexander Motin 
> 
> Date: 2016-12-29, Thursday at 12:08
> To: , , 
> 
> Subject: svn commit: r310782 - head/sys/cam/ctl
> 
> Author: mav
> Date: Thu Dec 29 18:08:04 2016
> New Revision: 310782
> URL: https://svnweb.freebsd.org/changeset/base/310782
> 
> Log:
>   Fix build with enabled debug after r310778.
>   
>   MFC after:  2 weeks
> 
> Modified:
>   head/sys/cam/ctl/ctl.c
> 
> Modified: head/sys/cam/ctl/ctl.c
> ==
> --- head/sys/cam/ctl/ctl.cThu Dec 29 17:31:38 2016(r310781)
> +++ head/sys/cam/ctl/ctl.cThu Dec 29 18:08:04 2016(r310782)
> @@ -12519,7 +12519,7 @@ ctl_datamove(union ctl_io *io)
>  {
>   void (*fe_datamove)(union ctl_io *io);
>  
> - mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED);
> + mtx_assert(&((struct ctl_softc *)CTL_SOFTC(io))->ctl_lock, MA_NOTOWNED);
>  
>   CTL_DEBUG_PRINT(("ctl_datamove\n"));
>  
> @@ -13012,7 +13012,7 @@ static void
>  ctl_datamove_remote(union ctl_io *io)
>  {
>  
> - mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED);
> + mtx_assert(&((struct ctl_softc *)CTL_SOFTC(io))->ctl_lock, MA_NOTOWNED);
>  
>   if (io->io_hdr.flags & CTL_FLAG_FAILOVER) {
>   ctl_failover_io(io, /*have_lock*/ 0);



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


Re: svn commit: r310789 - head/lib/libpam/static_libpam

2016-12-29 Thread Ravi Pokala
Hi Alexander,

I'm a little confused - the original version had to have had a compile-only 
step to generate the object first, before running the link-only operation 
against the object. The new code replaces the link-only operation with a 
compile+link operation. Shouldn't the pre-existing compile-only operation be 
removed, since the new compile+link operation supersedes it?

Thanks,

Ravi (rpokala@)


-Original Message-
> From:  on behalf of Alexander Kabaev 
> 
> Date: 2016-12-29, Thursday at 15:30
> To: , , 
> 
> Subject: svn commit: r310789 - head/lib/libpam/static_libpam
> 
> Author: kan
> Date: Thu Dec 29 21:30:52 2016
> New Revision: 310789
> URL: https://svnweb.freebsd.org/changeset/base/310789
> 
> Log:
>   Use compiler driver to build relocatable object
>   
>   This works better with external toolchains where LD
>   will not necessarily defailt to emulation we want.
>   Compiler driver knows better.
> 
> Modified:
>   head/lib/libpam/static_libpam/Makefile
> 
> Modified: head/lib/libpam/static_libpam/Makefile
> ==
> --- head/lib/libpam/static_libpam/MakefileThu Dec 29 21:06:31 2016
> (r310788)
> +++ head/lib/libpam/static_libpam/MakefileThu Dec 29 21:30:52 2016
> (r310789)
> @@ -64,6 +64,6 @@ CLEANFILES+=openpam_static.o \
>   openpam_static_modules.o
>  
>  openpam_static_modules.o: openpam_static.o ${STATIC_MODULES}
> - ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC}
> + ${CC} -nostdlib ${CFLAGS} -o ${.TARGET} -r -Wl,--whole-archive 
> ${.ALLSRC}
>  
>  .include "${.CURDIR}/../libpam/Makefile"



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


Re: svn commit: r310789 - head/lib/libpam/static_libpam

2016-12-29 Thread Alexander Kabaev
On Thu, 29 Dec 2016 18:59:17 -0600
Ravi Pokala  wrote:

> Hi Alexander,
> 
> I'm a little confused - the original version had to have had a
> compile-only step to generate the object first, before running the
> link-only operation against the object. The new code replaces the
> link-only operation with a compile+link operation. Shouldn't the
> pre-existing compile-only operation be removed, since the new
> compile+link operation supersedes it?
> 
> Thanks,
> 
> Ravi (rpokala@)
> 

Well, clearly it does not replace link-only operation with compile+link
as you suggest. It feeds .o file to to the compiler driver which
then invokes ld with all the correct parameters for the target object
format.

-- 
Alexander Kabaev


pgpcFsm1wwEwq.pgp
Description: Цифровая подпись OpenPGP


svn commit: r310803 - head/tests/sys/geom/class/nop

2016-12-29 Thread Alan Somers
Author: asomers
Date: Fri Dec 30 02:22:38 2016
New Revision: 310803
URL: https://svnweb.freebsd.org/changeset/base/310803

Log:
  ATFify the gnop tests
  
  Also, add test cases for the -p, -P, and -s options to gnop create
  
  Reviewed by:  ngie
  MFC after:4 weeks
  Differential Revision:https://reviews.freebsd.org/D8892

Added:
  head/tests/sys/geom/class/nop/nop_test.sh   (contents, props changed)
Deleted:
  head/tests/sys/geom/class/nop/1_test.sh
  head/tests/sys/geom/class/nop/2_test.sh
  head/tests/sys/geom/class/nop/conf.sh
Modified:
  head/tests/sys/geom/class/nop/Makefile

Modified: head/tests/sys/geom/class/nop/Makefile
==
--- head/tests/sys/geom/class/nop/Makefile  Fri Dec 30 02:18:34 2016
(r310802)
+++ head/tests/sys/geom/class/nop/Makefile  Fri Dec 30 02:22:38 2016
(r310803)
@@ -4,13 +4,6 @@ PACKAGE=   tests
 
 TESTSDIR=  ${TESTSBASE}/sys/geom/class/${.CURDIR:T}
 
-TAP_TESTS_SH+= 1_test
-TAP_TESTS_SH+= 2_test
-
-${PACKAGE}FILES+=  conf.sh
-
-.for t in ${TAP_TESTS_SH}
-TEST_METADATA.$t+= required_user="root"
-.endfor
+ATF_TESTS_SH+= nop_test
 
 .include 

Added: head/tests/sys/geom/class/nop/nop_test.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/geom/class/nop/nop_test.sh   Fri Dec 30 02:22:38 2016
(r310803)
@@ -0,0 +1,166 @@
+# Copyright (c) 2016 Alan Somers
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
+MD_DEVS="md.devs"
+PLAINFILES=plainfiles
+
+atf_test_case diskinfo cleanup
+diskinfo_head()
+{
+   atf_set "descr" "gnop should preserve diskinfo's basic properties"
+   atf_set "require.user" "root"
+   atf_set "timeout" 15
+}
+diskinfo_body()
+{
+   us=$(alloc_md)
+   atf_check gnop create /dev/${us}
+   md_secsize=$(diskinfo ${us} | cut -wf 2)
+   md_mediasize=$(diskinfo ${us} | cut -wf 3)
+   md_stripesize=$(diskinfo ${us} | cut -wf 5)
+   nop_secsize=$(diskinfo ${us}.nop | cut -wf 2)
+   nop_mediasize=$(diskinfo ${us}.nop | cut -wf 3)
+   nop_stripesize=$(diskinfo ${us}.nop | cut -wf 5)
+   atf_check_equal "$md_secsize" "$nop_secsize"
+   atf_check_equal "$md_mediasize" "$nop_mediasize"
+   atf_check_equal "$md_stripesize" "$nop_stripesize"
+}
+diskinfo_cleanup()
+{
+   common_cleanup
+}
+
+atf_test_case io cleanup
+io_head()
+{
+   atf_set "descr" "I/O works on gnop devices"
+   atf_set "require.user" "root"
+   atf_set "timeout" 15
+}
+io_body()
+{
+   us=$(alloc_md)
+   atf_check gnop create /dev/${us}
+
+   echo src >> $PLAINFILES
+   echo dst >> $PLAINFILES
+   dd if=/dev/random of=src bs=1m count=1 >/dev/null 2>&1
+   dd if=src of=/dev/${us}.nop bs=1m count=1 > /dev/null 2>&1
+   dd if=/dev/${us}.nop of=dst bs=1m count=1 > /dev/null 2>&1
+
+   atf_check_equal `md5 -q src` `md5 -q dst`
+}
+io_cleanup()
+{
+   common_cleanup
+}
+
+atf_test_case size cleanup
+size_head()
+{
+   atf_set "descr" "Test gnop's -s option"
+   atf_set "require.user" "root"
+   atf_set "timeout" 15
+}
+size_body()
+{
+   us=$(alloc_md)
+   for mediasize in 65536 524288 1048576; do
+   atf_check gnop create -s ${mediasize} /dev/${us}
+   gnop_mediasize=`diskinfo /dev/${us}.nop | cut -wf 3`
+   atf_check_equal "${mediasize}" "${gnop_mediasize}"
+   atf_check gnop destroy /dev/${us}.nop
+   done
+   # We shouldn't be able to extend the provider's size
+   atf_check -s not-exit:0 -e ignore gnop create -s 2

svn commit: r310804 - head/sys/dev/rtwn/rtl8812a

2016-12-29 Thread Kevin Lo
Author: kevlo
Date: Fri Dec 30 03:08:46 2016
New Revision: 310804
URL: https://svnweb.freebsd.org/changeset/base/310804

Log:
  - Fix incorrect values in the computation of OFDM and MCS Tx power.
  - Make power a uint8_t rather than a uint16_t.
  - Replace the hardcoded RF chains.
  
  Reviewed by:  avos

Modified:
  head/sys/dev/rtwn/rtl8812a/r12a_chan.c

Modified: head/sys/dev/rtwn/rtl8812a/r12a_chan.c
==
--- head/sys/dev/rtwn/rtl8812a/r12a_chan.c  Fri Dec 30 02:22:38 2016
(r310803)
+++ head/sys/dev/rtwn/rtl8812a/r12a_chan.c  Fri Dec 30 03:08:46 2016
(r310804)
@@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
 
 static void
 r12a_write_txpower(struct rtwn_softc *sc, int chain,
-struct ieee80211_channel *c, uint16_t power[RTWN_RIDX_COUNT])
+struct ieee80211_channel *c, uint8_t power[RTWN_RIDX_COUNT])
 {
 
if (IEEE80211_IS_CHAN_2GHZ(c)) {
@@ -163,7 +163,7 @@ r12a_get_power_group(struct rtwn_softc *
 
 static void
 r12a_get_txpower(struct rtwn_softc *sc, int chain,
-struct ieee80211_channel *c, uint16_t power[RTWN_RIDX_COUNT])
+struct ieee80211_channel *c, uint8_t power[RTWN_RIDX_COUNT])
 {
struct r12a_softc *rs = sc->sc_priv;
int i, ridx, group, max_mcs;
@@ -187,11 +187,8 @@ r12a_get_txpower(struct rtwn_softc *sc, 
for (ridx = RTWN_RIDX_OFDM6; ridx <= max_mcs; ridx++)
power[ridx] = rs->ht40_tx_pwr_2g[chain][group];
 
-   if (RTWN_RATE_IS_OFDM(ridx)) {
-   uint8_t pwr_diff = rs->ofdm_tx_pwr_diff_2g[chain][0];
-   for (ridx = RTWN_RIDX_CCK1; ridx <= max_mcs; ridx++)
-   power[ridx] += pwr_diff;
-   }
+   for (ridx = RTWN_RIDX_OFDM6; ridx <= RTWN_RIDX_OFDM54; ridx++)
+   power[ridx] += rs->ofdm_tx_pwr_diff_2g[chain][0];
 
for (i = 0; i < sc->ntxchains; i++) {
uint8_t min_mcs;
@@ -208,7 +205,7 @@ r12a_get_txpower(struct rtwn_softc *sc, 
else
pwr_diff = rs->bw20_tx_pwr_diff_2g[chain][i];
 
-   min_mcs = RTWN_RIDX_MCS(i * 8 + 7);
+   min_mcs = RTWN_RIDX_MCS(i * 8);
for (ridx = min_mcs; ridx <= max_mcs; ridx++)
power[ridx] += pwr_diff;
}
@@ -216,6 +213,9 @@ r12a_get_txpower(struct rtwn_softc *sc, 
for (ridx = RTWN_RIDX_OFDM6; ridx <= max_mcs; ridx++)
power[ridx] = rs->ht40_tx_pwr_5g[chain][group];
 
+   for (ridx = RTWN_RIDX_OFDM6; ridx <= RTWN_RIDX_OFDM54; ridx++)
+   power[ridx] += rs->ofdm_tx_pwr_diff_5g[chain][0];
+
for (i = 0; i < sc->ntxchains; i++) {
uint8_t min_mcs;
uint8_t pwr_diff;
@@ -231,7 +231,7 @@ r12a_get_txpower(struct rtwn_softc *sc, 
else
pwr_diff = rs->bw20_tx_pwr_diff_5g[chain][i];
 
-   min_mcs = RTWN_RIDX_MCS(i * 8 + 7);
+   min_mcs = RTWN_RIDX_MCS(i * 8);
for (ridx = min_mcs; ridx <= max_mcs; ridx++)
power[ridx] += pwr_diff;
}
@@ -256,7 +256,7 @@ r12a_get_txpower(struct rtwn_softc *sc, 
 static void
 r12a_set_txpower(struct rtwn_softc *sc, struct ieee80211_channel *c)
 {
-   uint16_t power[RTWN_RIDX_COUNT];
+   uint8_t power[RTWN_RIDX_COUNT];
int i;
 
for (i = 0; i < sc->ntxchains; i++) {
@@ -463,7 +463,7 @@ r12a_set_chan(struct rtwn_softc *sc, str
/* RTL8812AU-specific */
rtwn_r12a_fix_spur(sc, c);
 
-   for (i = 0; i < 2; i++)
+   for (i = 0; i < sc->nrxchains; i++)
rtwn_rf_setbits(sc, i, R92C_RF_CHNLBW, 0xc00, val);
 
/* Set Tx power for this new channel. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310805 - in head/sys: kern sys vm

2016-12-29 Thread Mateusz Guzik
Author: mjg
Date: Fri Dec 30 06:26:17 2016
New Revision: 310805
URL: https://svnweb.freebsd.org/changeset/base/310805

Log:
  Remove cpu_spinwait after seq_consistent.
  
  It does not add any benefit as the read routine will do it as necessary.

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/sys/seq.h
  head/sys/vm/vm_domain.c

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cFri Dec 30 03:08:46 2016
(r310804)
+++ head/sys/kern/kern_descrip.cFri Dec 30 06:26:17 2016
(r310805)
@@ -2556,10 +2556,8 @@ fget_unlocked(struct filedesc *fdp, int 
fde = &fdt->fdt_ofiles[fd];
haverights = *cap_rights_fde(fde);
fp = fde->fde_file;
-   if (!seq_consistent(fd_seq(fdt, fd), seq)) {
-   cpu_spinwait();
+   if (!seq_consistent(fd_seq(fdt, fd), seq))
continue;
-   }
 #else
fp = fdt->fdt_ofiles[fd].fde_file;
 #endif

Modified: head/sys/sys/seq.h
==
--- head/sys/sys/seq.h  Fri Dec 30 03:08:46 2016(r310804)
+++ head/sys/sys/seq.h  Fri Dec 30 06:26:17 2016(r310805)
@@ -59,7 +59,6 @@ typedef uint32_t seq_t;
  * lobj = gobj;
  * if (seq_consistent(&gobj->seq, seq))
  * break;
- * cpu_spinwait();
  * }
  * foo(lobj);
  */

Modified: head/sys/vm/vm_domain.c
==
--- head/sys/vm/vm_domain.c Fri Dec 30 03:08:46 2016(r310804)
+++ head/sys/vm/vm_domain.c Fri Dec 30 06:26:17 2016(r310805)
@@ -140,7 +140,6 @@ vm_domain_policy_localcopy(struct vm_dom
*dst = *src;
if (seq_consistent(&src->seq, seq))
return;
-   cpu_spinwait();
}
 }
 
@@ -168,7 +167,6 @@ vm_domain_policy_copy(struct vm_domain_p
seq_write_end(&dst->seq);
return;
}
-   cpu_spinwait();
}
 }
 
@@ -330,7 +328,6 @@ vm_domain_iterator_set_policy(struct vm_
_vm_domain_iterator_set_policy(vi, &vt_lcl);
return;
}
-   cpu_spinwait();
}
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"