--- old/usr/src/man/man9f/ddi_get_time.9f	2014-05-05 14:29:41.187672741 -0400
+++ new/usr/src/man/man9f/ddi_get_time.9f	2014-05-05 14:29:41.193326650 -0400
@@ -1,10 +1,11 @@
 '\" te
 .\" Copyright (c) 2000, Sun Microsystems, Inc.
+.\" Copyright (c) 2014, Nexenta Systems, Inc.
 .\"  All Rights Reserved
 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH DDI_GET_TIME 9F "Feb 18, 1998"
+.TH DDI_GET_TIME 9F "Apr 15, 2014"
 .SH NAME
 ddi_get_time \- returns the current time in seconds
 .SH SYNOPSIS
@@ -27,7 +28,10 @@
 .sp
 .LP
 \fBddi_get_time()\fR returns the current time in seconds since 00:00:00 UTC,
-January 1, 1970. This value can be used to set of wait or expiration intervals.
+January 1, 1970. Changes in time of day clock may result in this value
+changing. In other words, the value is not monotonically increasing and
+therefore it must not be used to set wait or expiration intervals. For that,
+instead use \fBddi_get_lbolt\fR(9F) or \fBgethrtime\fR(9F).
 .SH RETURN VALUES
 .sp
 .LP
@@ -39,7 +43,8 @@
 .SH SEE ALSO
 .sp
 .LP
-\fBddi_get_lbolt\fR(9F), \fBdrv_getparm\fR(9F), \fBdrv_usectohz\fR(9F)
+\fBddi_get_lbolt\fR(9F), \fBdrv_getparm\fR(9F), \fBdrv_usectohz\fR(9F),
+\fBgethrtime\fR(9F)
 .sp
 .LP
 \fIWriting Device Drivers\fR
--- old/usr/src/uts/common/inet/ipf/ip_fil_solaris.c	2014-05-05 14:29:41.353601454 -0400
+++ new/usr/src/uts/common/inet/ipf/ip_fil_solaris.c	2014-05-05 14:29:41.359803842 -0400
@@ -1292,44 +1292,6 @@
 #include <stdio.h>
 #endif
 
-#define	NULLADDR_RATE_LIMIT 10	/* 10 seconds */
-
-
-/*
- * Print out warning message at rate-limited speed.
- */
-static void rate_limit_message(ipf_stack_t *ifs,
-			       int rate, const char *message, ...)
-{
-	static time_t last_time = 0;
-	time_t now;
-	va_list args;
-	char msg_buf[256];
-	int  need_printed = 0;
-
-	now = ddi_get_time();
-
-	/* make sure, no multiple entries */
-	ASSERT(MUTEX_NOT_HELD(&(ifs->ifs_ipf_rw.ipf_lk)));
-	MUTEX_ENTER(&ifs->ifs_ipf_rw);
-	if (now - last_time >= rate) {
-		need_printed = 1;
-		last_time = now;
-	}
-	MUTEX_EXIT(&ifs->ifs_ipf_rw);
-
-	if (need_printed) {
-		va_start(args, message);
-		(void)vsnprintf(msg_buf, 255, message, args);
-		va_end(args);
-#ifdef _KERNEL
-		cmn_err(CE_WARN, msg_buf);
-#else
-		fprintf(std_err, msg_buf);
-#endif
-	}
-}
-
 /*
  * Return the first IP Address associated with an interface
  * For IPv6, we walk through the list of logical interfaces and return
--- old/usr/src/uts/common/io/comstar/port/iscsit/iscsit.c	2014-05-05 14:29:41.618895222 -0400
+++ new/usr/src/uts/common/io/comstar/port/iscsit/iscsit.c	2014-05-05 14:29:41.624584441 -0400
@@ -21,7 +21,7 @@
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  *
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
  */
 
 #include <sys/cpuvar.h>
@@ -3125,7 +3125,7 @@
 		 * staging queue, the commands are processed out of the
 		 * queue in cmdSN order only.
 		 */
-		rx_pdu->isp_queue_time = ddi_get_time();
+		rx_pdu->isp_queue_time = gethrtime();
 		iscsit_add_pdu_to_queue(ist, rx_pdu);
 		mutex_exit(&ist->ist_sn_mutex);
 		return (ISCSIT_CMDSN_GT_EXPCMDSN);
@@ -3395,8 +3395,8 @@
 			 * stop scanning the staging queue until the timer
 			 * fires again
 			 */
-			if ((ddi_get_time() - next_pdu->isp_queue_time)
-			    < rxpdu_queue_threshold) {
+			if ((gethrtime() - next_pdu->isp_queue_time)
+			    < (rxpdu_queue_threshold * NANOSEC)) {
 				mutex_exit(&ist->ist_sn_mutex);
 				return;
 			}
--- old/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c	2014-05-05 14:29:41.904462461 -0400
+++ new/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c	2014-05-05 14:29:41.910565466 -0400
@@ -23,6 +23,9 @@
  * Copyright 2010 Emulex.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 
 #include <emlxs.h>
@@ -7601,7 +7604,7 @@
 	uint32_t drv_time;
 	uint32_t timeout;
 	uint32_t reauth_tmo;
-	time_t last_auth_time;
+	uint32_t last_auth_time;
 
 	node_dhc->flag &= ~NLP_SET_REAUTH_TIME;
 
@@ -9656,7 +9659,7 @@
 	dfc_auth_status_t *auth_status;
 	NODELIST *ndlp;
 	uint32_t rc;
-	time_t auth_time;
+	uint32_t auth_time;
 	uint32_t update;
 
 	/* Return is authentication is not enabled */
--- old/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_solaris.c	2014-05-05 14:29:42.434319646 -0400
+++ new/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_solaris.c	2014-05-05 14:29:42.440365156 -0400
@@ -23,6 +23,7 @@
  * Copyright 2010 Emulex.  All rights reserved.
  * Use is subject to license terms.
  * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  */
 
 
@@ -1097,7 +1098,7 @@
 	mutex_init(&emlxs_device.lock, buf, MUTEX_DRIVER, NULL);
 
 	(void) drv_getparm(LBOLT, &emlxs_device.log_timestamp);
-	emlxs_device.drv_timestamp = ddi_get_time();
+	emlxs_device.drv_timestamp = gethrtime();
 
 	for (ret = 0; ret < MAX_FC_BRDS; ret++) {
 		emlxs_instance[ret] = (uint32_t)-1;
--- old/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c	2014-05-05 14:29:42.989745383 -0400
+++ new/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c	2014-05-05 14:29:42.995531092 -0400
@@ -21,6 +21,9 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  */
+/*
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 /*
  * ibdm.c
@@ -36,6 +39,7 @@
  * HCA's and IOC's (behind the IOU) present on the IB fabric.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/systm.h>
 #include <sys/taskq.h>
 #include <sys/ib/mgt/ibdm/ibdm_impl.h>
@@ -971,7 +975,7 @@
 	    (sizeof (ibdm_port_attr_t) * hca_attr->hca_nports), KM_SLEEP);
 	hca_list->hl_hca_guid = hca_attr->hca_node_guid;
 	hca_list->hl_nports = hca_attr->hca_nports;
-	hca_list->hl_attach_time = ddi_get_time();
+	hca_list->hl_attach_time = gethrtime();
 	hca_list->hl_hca_hdl = hca_hdl;
 
 	/*
@@ -4691,11 +4695,13 @@
  * ibdm_get_waittime()
  *	Calculates the wait time based on the last HCA attach time
  */
-static time_t
-ibdm_get_waittime(ib_guid_t hca_guid, int dft_wait)
+static clock_t
+ibdm_get_waittime(ib_guid_t hca_guid, int dft_wait_sec)
 {
-	int		ii;
-	time_t		temp, wait_time = 0;
+	const hrtime_t	dft_wait = dft_wait_sec * NANOSEC;
+	hrtime_t	temp, wait_time = 0;
+	clock_t		usecs;
+	int		i;
 	ibdm_hca_list_t	*hca;
 
 	IBTF_DPRINTF_L4("ibdm", "\tget_waittime hcaguid:%llx"
@@ -4705,56 +4711,43 @@
 
 	hca = ibdm.ibdm_hca_list_head;
 
-	if (hca_guid) {
-		for (ii = 0; ii < ibdm.ibdm_hca_count; ii++) {
-			if ((hca_guid == hca->hl_hca_guid) &&
-			    (hca->hl_nports != hca->hl_nports_active)) {
-				wait_time =
-				    ddi_get_time() - hca->hl_attach_time;
-				wait_time = ((wait_time >= dft_wait) ?
-				    0 : (dft_wait - wait_time));
-				break;
-			}
-			hca = hca->hl_next;
+	for (i = 0; i < ibdm.ibdm_hca_count; i++, hca = hca->hl_next) {
+		if (hca->hl_nports == hca->hl_nports_active)
+			continue;
+
+		if (hca_guid && (hca_guid != hca->hl_hca_guid))
+			continue;
+
+		temp = gethrtime() - hca->hl_attach_time;
+		temp = MAX(0, (dft_wait - temp));
+
+		if (hca_guid) {
+			wait_time = temp;
+			break;
 		}
-		IBTF_DPRINTF_L2("ibdm", "\tget_waittime: wait_time = %ld secs",
-		    (long)wait_time);
-		return (wait_time);
+
+		wait_time = MAX(temp, wait_time);
 	}
 
-	for (ii = 0; ii < ibdm.ibdm_hca_count; ii++) {
-		if (hca->hl_nports != hca->hl_nports_active) {
-			temp = ddi_get_time() - hca->hl_attach_time;
-			temp = ((temp >= dft_wait) ? 0 : (dft_wait - temp));
-			wait_time = (temp > wait_time) ? temp : wait_time;
-		}
-		hca = hca->hl_next;
-	}
-	IBTF_DPRINTF_L2("ibdm", "\tget_waittime: wait_time = %ld secs",
-	    (long)wait_time);
-	return (wait_time);
+	/* convert to microseconds */
+	usecs = MIN(wait_time, dft_wait) / (NANOSEC / MICROSEC);
+
+	IBTF_DPRINTF_L2("ibdm", "\tget_waittime: wait_time = %ld usecs",
+	    (long)usecs);
+
+	return (drv_usectohz(usecs));
 }
 
 void
 ibdm_ibnex_port_settle_wait(ib_guid_t hca_guid, int dft_wait)
 {
-	time_t wait_time;
-	clock_t delta;
+	clock_t wait_time;
 
 	mutex_enter(&ibdm.ibdm_hl_mutex);
 
-	while ((wait_time = ibdm_get_waittime(hca_guid, dft_wait)) > 0) {
-		if (wait_time > dft_wait) {
-			IBTF_DPRINTF_L1("ibdm",
-			    "\tibnex_port_settle_wait: wait_time = %ld secs; "
-			    "Resetting to %d secs",
-			    (long)wait_time, dft_wait);
-			wait_time = dft_wait;
-		}
-		delta = drv_usectohz(wait_time * 1000000);
+	while ((wait_time = ibdm_get_waittime(hca_guid, dft_wait)) > 0)
 		(void) cv_reltimedwait(&ibdm.ibdm_port_settle_cv,
-		    &ibdm.ibdm_hl_mutex, delta, TR_CLOCK_TICK);
-	}
+		    &ibdm.ibdm_hl_mutex, wait_time, TR_CLOCK_TICK);
 
 	mutex_exit(&ibdm.ibdm_hl_mutex);
 }
--- old/usr/src/uts/common/io/iprb/iprb.c	2014-05-05 14:29:43.423926148 -0400
+++ new/usr/src/uts/common/io/iprb/iprb.c	2014-05-05 14:29:43.429571740 -0400
@@ -298,8 +298,8 @@
 	/*
 	 * Precalculate watchdog times.
 	 */
-	ip->tx_timeout = drv_usectohz(TX_WATCHDOG * 1000000);
-	ip->rx_timeout = drv_usectohz(RX_WATCHDOG * 1000000);
+	ip->tx_timeout = TX_WATCHDOG;
+	ip->rx_timeout = RX_WATCHDOG;
 
 	iprb_identify(ip);
 
@@ -703,7 +703,7 @@
 		if (ip->cmd_count == 0) {
 			ip->tx_wdog = 0;
 		} else {
-			ip->tx_wdog = ddi_get_time();
+			ip->tx_wdog = gethrtime();
 		}
 	}
 }
@@ -775,7 +775,7 @@
 	PUT8(ip, CSR_CMD, CUC_RESUME);
 	(void) GET8(ip, CSR_CMD);	/* flush CSR */
 
-	ip->tx_wdog = ddi_get_time();
+	ip->tx_wdog = gethrtime();
 	ip->cmd_last = ip->cmd_head;
 	ip->cmd_head++;
 	ip->cmd_head %= NUM_TX;
@@ -1010,15 +1010,15 @@
 iprb_update_stats(iprb_t *ip)
 {
 	iprb_dma_t	*sp = &ip->stats;
-	time_t		tstamp;
+	hrtime_t	tstamp;
 	int		i;
 
 	ASSERT(mutex_owned(&ip->culock));
 
 	/* Collect the hardware stats, but don't keep redoing it */
-	if ((tstamp = ddi_get_time()) == ip->stats_time) {
+	tstamp = gethrtime();
+	if (tstamp / NANOSEC == ip->stats_time / NANOSEC)
 		return;
-	}
 
 	PUTSTAT(sp, STATS_DONE_OFFSET, 0);
 	SYNCSTATS(sp, 0, 0, DDI_DMA_SYNC_FORDEV);
@@ -1174,7 +1174,7 @@
 			break;
 		}
 
-		ip->rx_wdog = ddi_get_time();
+		ip->rx_wdog = gethrtime();
 
 		SYNCRFD(rfd, 0, 0, DDI_DMA_SYNC_FORKERNEL);
 		cnt = GETRFD16(rfd, RFD_CNT_OFFSET);
@@ -1663,7 +1663,7 @@
 	 */
 	if (ip->rxhangbug &&
 	    ((ip->miih == NULL) || (mii_get_speed(ip->miih) == 10000000)) &&
-	    ((ddi_get_time() - ip->rx_wdog) > ip->rx_timeout)) {
+	    ((gethrtime() - ip->rx_wdog) > ip->rx_timeout)) {
 		cmn_err(CE_CONT, "?Possible RU hang, resetting.\n");
 		reset = B_TRUE;
 	}
@@ -1671,7 +1671,7 @@
 	/* update the statistics */
 	mutex_enter(&ip->culock);
 
-	if (ip->tx_wdog && ((ddi_get_time() - ip->tx_wdog) > ip->tx_timeout)) {
+	if (ip->tx_wdog && ((gethrtime() - ip->tx_wdog) > ip->tx_timeout)) {
 		/* transmit/CU hang? */
 		cmn_err(CE_CONT, "?CU stalled, resetting.\n");
 		reset = B_TRUE;
--- old/usr/src/uts/common/io/iprb/iprb.h	2014-05-05 14:29:43.648893341 -0400
+++ new/usr/src/uts/common/io/iprb/iprb.h	2014-05-05 14:29:43.654526971 -0400
@@ -10,7 +10,7 @@
  */
 
 /*
- * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  */
 
 #ifndef _IPRB_H
@@ -26,8 +26,9 @@
 #define	NUM_TX		128	/* outstanding tx queue */
 #define	NUM_RX		128	/* outstanding rx queue */
 
-#define	RX_WATCHDOG	15	/* timeout for rx watchdog (sec) */
-#define	TX_WATCHDOG	15	/* timeout for tx watchdog (sec) */
+/* timeouts for the rx and tx watchdogs (nsec) */
+#define	RX_WATCHDOG	(15 * NANOSEC)
+#define	TX_WATCHDOG	(15 * NANOSEC)
 
 /*
  * Driver structures.
@@ -72,7 +73,7 @@
 	iprb_dma_t		cmds[NUM_TX];
 	iprb_dma_t		rxb[NUM_RX];
 	iprb_dma_t		stats;
-	time_t			stats_time;
+	hrtime_t		stats_time;
 
 	uint16_t		cmd_head;
 	uint16_t		cmd_last;
@@ -81,10 +82,10 @@
 
 	uint16_t		rx_index;
 	uint16_t		rx_last;
-	time_t			rx_wdog;
-	time_t			rx_timeout;
-	time_t			tx_wdog;
-	time_t			tx_timeout;
+	hrtime_t		rx_wdog;
+	hrtime_t		rx_timeout;
+	hrtime_t		tx_wdog;
+	hrtime_t		tx_timeout;
 
 	uint16_t		eeprom_bits;
 
--- old/usr/src/uts/common/io/mac/mac_protect.c	2014-05-05 14:29:43.823918179 -0400
+++ new/usr/src/uts/common/io/mac/mac_protect.c	2014-05-05 14:29:43.829710346 -0400
@@ -22,6 +22,9 @@
 /*
  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  */
+/*
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 #include <sys/strsun.h>
 #include <sys/sdt.h>
@@ -141,7 +144,7 @@
  */
 static ulong_t	dhcp_max_pending_txn = 512;
 static ulong_t	dhcp_max_completed_txn = 512;
-static time_t	txn_cleanup_interval = 60;
+static hrtime_t	txn_cleanup_interval = 60 * NANOSEC;
 
 /*
  * DHCPv4 transaction. It may be added to three different tables
@@ -149,7 +152,7 @@
  */
 typedef struct dhcpv4_txn {
 	uint32_t		dt_xid;
-	time_t			dt_timestamp;
+	hrtime_t		dt_timestamp;
 	uint8_t			dt_cid[DHCP_MAX_OPT_SIZE];
 	uint8_t			dt_cid_len;
 	ipaddr_t		dt_ipaddr;
@@ -186,7 +189,7 @@
  */
 typedef struct dhcpv6_txn {
 	uint32_t		dt_xid;
-	time_t			dt_timestamp;
+	hrtime_t		dt_timestamp;
 	dhcpv6_cid_t		*dt_cid;
 	avl_node_t		dt_node;
 	struct dhcpv6_txn	*dt_next;
@@ -455,7 +458,7 @@
 		return (NULL);
 
 	txn->dt_xid = xid;
-	txn->dt_timestamp = ddi_get_time();
+	txn->dt_timestamp = gethrtime();
 	if (cid_len > 0)
 		bcopy(cid, &txn->dt_cid, cid_len);
 	txn->dt_cid_len = cid_len;
@@ -512,8 +515,7 @@
 	 */
 	for (txn = avl_first(&mcip->mci_v4_pending_txn); txn != NULL;
 	    txn = avl_walk(&mcip->mci_v4_pending_txn, txn, AVL_AFTER)) {
-		if (ddi_get_time() - txn->dt_timestamp >
-		    txn_cleanup_interval) {
+		if (gethrtime() - txn->dt_timestamp > txn_cleanup_interval) {
 			DTRACE_PROBE2(found__expired__txn,
 			    mac_client_impl_t *, mcip,
 			    dhcpv4_txn_t *, txn);
@@ -617,7 +619,7 @@
 	if ((txn = find_dhcpv4_pending_txn(mcip, dh4->xid)) != NULL) {
 		DTRACE_PROBE2(update, mac_client_impl_t *, mcip,
 		    dhcpv4_txn_t *, txn);
-		txn->dt_timestamp = ddi_get_time();
+		txn->dt_timestamp = gethrtime();
 		goto done;
 	}
 
@@ -1116,7 +1118,7 @@
 
 	txn->dt_xid = xid;
 	txn->dt_cid = cid;
-	txn->dt_timestamp = ddi_get_time();
+	txn->dt_timestamp = gethrtime();
 	return (txn);
 }
 
@@ -1183,8 +1185,7 @@
 	 */
 	for (txn = avl_first(&mcip->mci_v6_pending_txn); txn != NULL;
 	    txn = avl_walk(&mcip->mci_v6_pending_txn, txn, AVL_AFTER)) {
-		if (ddi_get_time() - txn->dt_timestamp >
-		    txn_cleanup_interval) {
+		if (gethrtime() - txn->dt_timestamp > txn_cleanup_interval) {
 			DTRACE_PROBE2(found__expired__txn,
 			    mac_client_impl_t *, mcip,
 			    dhcpv6_txn_t *, txn);
@@ -1248,7 +1249,7 @@
 	if ((txn = find_dhcpv6_pending_txn(mcip, xid)) != NULL) {
 		DTRACE_PROBE2(update, mac_client_impl_t *, mcip,
 		    dhcpv6_txn_t *, txn);
-		txn->dt_timestamp = ddi_get_time();
+		txn->dt_timestamp = gethrtime();
 		goto done;
 	}
 	if ((txn = create_dhcpv6_txn(xid, cid)) == NULL)
@@ -1357,7 +1358,7 @@
 		DTRACE_PROBE1(restarting__timer, mac_client_impl_t *, mcip);
 
 		mcip->mci_txn_cleanup_tid = timeout(txn_cleanup_timer, mcip,
-		    drv_usectohz(txn_cleanup_interval * 1000000));
+		    drv_usectohz(txn_cleanup_interval / (NANOSEC / MICROSEC)));
 	}
 	mutex_exit(&mcip->mci_protect_lock);
 }
@@ -1368,7 +1369,7 @@
 	ASSERT(MUTEX_HELD(&mcip->mci_protect_lock));
 	if (mcip->mci_txn_cleanup_tid == 0) {
 		mcip->mci_txn_cleanup_tid = timeout(txn_cleanup_timer, mcip,
-		    drv_usectohz(txn_cleanup_interval * 1000000));
+		    drv_usectohz(txn_cleanup_interval / (NANOSEC / MICROSEC)));
 	}
 }
 
--- old/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c	2014-05-05 14:29:44.071526330 -0400
+++ new/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c	2014-05-05 14:29:44.077356011 -0400
@@ -21,6 +21,9 @@
 /*
  * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  */
+/*
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 /*
  * Multiplexed I/O SCSI vHCI implementation
@@ -2226,7 +2229,6 @@
 	int			held;
 	int			mps_flag = MDI_SELECT_ONLINE_PATH;
 	struct scsi_vhci_lun	*vlun;
-	time_t			tnow;
 	int			path_instance = 0;
 
 	vlun = ADDR2VLUN(ap);
@@ -2364,7 +2366,7 @@
 			if ((rval != MDI_SUCCESS) || (pip == NULL)) {
 				if (vlun->svl_waiting_for_activepath == 0) {
 					vlun->svl_waiting_for_activepath = 1;
-					vlun->svl_wfa_time = ddi_get_time();
+					vlun->svl_wfa_time = gethrtime();
 				}
 				mps_flag |= MDI_SELECT_STANDBY_PATH;
 				rval = mdi_select_path(cdip,
@@ -2396,8 +2398,8 @@
 				 * show up obviating the need for a
 				 * failover
 				 */
-				tnow = ddi_get_time();
-				if (tnow - vlun->svl_wfa_time >= 60) {
+				if ((gethrtime() - vlun->svl_wfa_time) >=
+				    (60 * NANOSEC)) {
 					vlun->svl_waiting_for_activepath = 0;
 				} else {
 					drv_usecwait(1000);
@@ -3624,7 +3626,7 @@
 			return (PKT_RETURN);
 		}
 		swarg->svs_svp = svp;
-		swarg->svs_tos = ddi_get_time();
+		swarg->svs_tos = gethrtime();
 		swarg->svs_pi = vpkt->vpkt_path;
 		swarg->svs_release_lun = 0;
 		swarg->svs_done = 0;
@@ -3685,7 +3687,7 @@
 	updt_paths = 0;
 
 	if (pkt->pkt_reason != CMD_CMPLT) {
-		if ((ddi_get_time() - swarg->svs_tos) >= VHCI_EXTFO_TIMEOUT) {
+		if ((gethrtime() - swarg->svs_tos) >= VHCI_EXTFO_TIMEOUT) {
 			swarg->svs_release_lun = 1;
 			goto done;
 		}
@@ -3707,7 +3709,7 @@
 				updt_paths = 1;
 				break;
 			default:
-				if ((ddi_get_time() - swarg->svs_tos)
+				if ((gethrtime() - swarg->svs_tos)
 				    >= VHCI_EXTFO_TIMEOUT) {
 					swarg->svs_release_lun = 1;
 					goto done;
@@ -3739,7 +3741,7 @@
 		    KM_SLEEP);
 		return (0);
 	}
-	if ((ddi_get_time() - swarg->svs_tos) >= VHCI_EXTFO_TIMEOUT) {
+	if ((gethrtime() - swarg->svs_tos) >= VHCI_EXTFO_TIMEOUT) {
 		swarg->svs_release_lun = 1;
 		goto done;
 	}
--- old/usr/src/uts/common/io/scsi/targets/sd.c	2014-05-05 14:29:44.548751382 -0400
+++ new/usr/src/uts/common/io/scsi/targets/sd.c	2014-05-05 14:29:44.555066462 -0400
@@ -25,7 +25,7 @@
 /*
  * Copyright (c) 2011 Bayard G. Bell.  All rights reserved.
  * Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2012 DEY Storage Systems, Inc.  All rights reserved.
  */
 /*
@@ -6541,10 +6541,9 @@
 static void
 sd_pm_idletimeout_handler(void *arg)
 {
+	const hrtime_t idletime = sd_pm_idletime * NANOSEC;
 	struct sd_lun *un = arg;
 
-	time_t	now;
-
 	mutex_enter(&sd_detach_mutex);
 	if (un->un_detach_count != 0) {
 		/* Abort if the instance is detaching */
@@ -6553,14 +6552,13 @@
 	}
 	mutex_exit(&sd_detach_mutex);
 
-	now = ddi_get_time();
 	/*
 	 * Grab both mutexes, in the proper order, since we're accessing
 	 * both PM and softstate variables.
 	 */
 	mutex_enter(SD_MUTEX(un));
 	mutex_enter(&un->un_pm_mutex);
-	if (((now - un->un_pm_idle_time) > sd_pm_idletime) &&
+	if (((gethrtime() - un->un_pm_idle_time) > idletime) &&
 	    (un->un_ncmds_in_driver == 0) && (un->un_pm_count == 0)) {
 		/*
 		 * Update the chain types.
@@ -12461,7 +12459,7 @@
 		 * This is for lowering the overhead, and therefore improving
 		 * performance per I/O operation.
 		 */
-		un->un_pm_idle_time = ddi_get_time();
+		un->un_pm_idle_time = gethrtime();
 
 		un->un_ncmds_in_driver--;
 		ASSERT(un->un_ncmds_in_driver >= 0);
@@ -12511,7 +12509,7 @@
 	 * This is for lowering the overhead, and therefore improving
 	 * performance per I/O operation.
 	 */
-	un->un_pm_idle_time = ddi_get_time();
+	un->un_pm_idle_time = gethrtime();
 
 	un->un_ncmds_in_driver--;
 	ASSERT(un->un_ncmds_in_driver >= 0);
--- old/usr/src/uts/common/io/usb/usba/hubdi.c	2014-05-05 14:29:45.833626346 -0400
+++ new/usr/src/uts/common/io/usb/usba/hubdi.c	2014-05-05 14:29:45.839402090 -0400
@@ -21,6 +21,7 @@
 /*
  * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012 Garrett D'Amore <garrett@damore.org>.  All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  */
 
 /*
@@ -749,7 +750,7 @@
 	 * Don't go to lower power if haven't been at full power for enough
 	 * time to let hotplug thread kickoff.
 	 */
-	if (ddi_get_time() < (hubpm->hubp_time_at_full_power +
+	if (gethrtime() < (hubpm->hubp_time_at_full_power +
 	    hubpm->hubp_min_pm_threshold)) {
 
 		return (USB_FAILURE);
@@ -1720,7 +1721,7 @@
 		ASSERT(rval == USB_SUCCESS);
 		hubd->h_dev_state = USB_DEV_ONLINE;
 		hubpm->hubp_current_power = USB_DEV_OS_FULL_PWR;
-		hubpm->hubp_time_at_full_power = ddi_get_time();
+		hubpm->hubp_time_at_full_power = gethrtime();
 		hubd_start_polling(hubd, 0);
 
 		/* FALLTHRU */
@@ -3712,7 +3713,7 @@
 
 			/* mark the root hub as full power */
 			hubpm->hubp_current_power = USB_DEV_OS_FULL_PWR;
-			hubpm->hubp_time_at_full_power = ddi_get_time();
+			hubpm->hubp_time_at_full_power = gethrtime();
 			mutex_exit(HUBD_MUTEX(hubd));
 
 			USB_DPRINTF_L4(DPRINT_MASK_HOTPLUG, hubd->h_log_handle,
@@ -7273,8 +7274,8 @@
 	hubpm->hubp_hubd = hubd;
 	hubpm->hubp_pm_capabilities = 0;
 	hubpm->hubp_current_power = USB_DEV_OS_FULL_PWR;
-	hubpm->hubp_time_at_full_power = ddi_get_time();
-	hubpm->hubp_min_pm_threshold = hubdi_min_pm_threshold;
+	hubpm->hubp_time_at_full_power = gethrtime();
+	hubpm->hubp_min_pm_threshold = hubdi_min_pm_threshold * NANOSEC;
 
 	/* alloc memory to save power states of children */
 	hubpm->hubp_child_pwrstate = (uint8_t *)
@@ -8709,7 +8710,7 @@
 
 		/* mark the root hub as full power */
 		hubpm->hubp_current_power = USB_DEV_OS_FULL_PWR;
-		hubpm->hubp_time_at_full_power = ddi_get_time();
+		hubpm->hubp_time_at_full_power = gethrtime();
 		mutex_exit(HUBD_MUTEX(hubd));
 
 		USB_DPRINTF_L3(DPRINT_MASK_HOTPLUG, hubd->h_log_handle,
--- old/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_device.h	2014-05-05 14:29:46.333612075 -0400
+++ new/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_device.h	2014-05-05 14:29:46.339283192 -0400
@@ -23,6 +23,9 @@
  * Copyright 2009 Emulex.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 #ifndef _EMLXS_DEVICE_H
 #define	_EMLXS_DEVICE_H
@@ -46,7 +49,7 @@
 	emlxs_hba_t *hba[MAX_FC_BRDS];
 	kmutex_t lock;
 
-	time_t drv_timestamp;
+	hrtime_t drv_timestamp;
 	clock_t	log_timestamp;
 	emlxs_msg_log_t *log[MAX_FC_BRDS];
 
--- old/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_dhchap.h	2014-05-05 14:29:46.498437711 -0400
+++ new/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_dhchap.h	2014-05-05 14:29:46.504156990 -0400
@@ -23,6 +23,9 @@
  * Copyright 2010 Emulex.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 #ifndef _EMLXS_DHCHAP_H
 #define	_EMLXS_DHCHAP_H
@@ -276,7 +279,7 @@
 	uint32_t		reauthenticate_time_interval;
 
 	dfc_auth_status_t	auth_status;
-	time_t			auth_time;
+	uint32_t		auth_time;
 	struct emlxs_node	*node;
 
 	struct emlxs_auth_cfg	*prev;
@@ -356,7 +359,7 @@
 #define	ELX_FABRIC_IN_REAUTH		0x05
 
 	dfc_auth_status_t	auth_status;  /* Fabric auth status */
-	time_t			auth_time;
+	uint32_t		auth_time;
 
 } emlxs_port_dhc_t;
 
--- old/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_fc.h	2014-05-05 14:29:46.709394457 -0400
+++ new/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_fc.h	2014-05-05 14:29:46.715114232 -0400
@@ -23,6 +23,9 @@
  * Copyright 2010 Emulex.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 #ifndef _EMLXS_FC_H
 #define	_EMLXS_FC_H
@@ -2040,7 +2043,7 @@
 #define	EMLXS_PM_ADAPTER	0
 
 
-#define	DRV_TIME	(uint32_t)(ddi_get_time() - emlxs_device.drv_timestamp)
+#define	DRV_TIME	(uint32_t)((gethrtime() - emlxs_device.drv_timestamp) / NANOSEC)
 
 #define	HBA			port->hba
 #define	PPORT			hba->port[0]
--- old/usr/src/uts/common/sys/ib/mgt/ibdm/ibdm_ibnex.h	2014-05-05 14:29:46.948575215 -0400
+++ new/usr/src/uts/common/sys/ib/mgt/ibdm/ibdm_ibnex.h	2014-05-05 14:29:46.954242439 -0400
@@ -22,6 +22,9 @@
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 #ifndef _SYS_IB_MGT_IBDM_IBDM_IBNEX_H
 #define	_SYS_IB_MGT_IBDM_IBDM_IBNEX_H
@@ -215,7 +218,7 @@
 	ib_guid_t		hl_hca_guid;		/* HCA GUID */
 	uint32_t		hl_nports;		/* #ports of this HCA */
 	uint32_t		hl_nports_active;	/* #ports active */
-	time_t			hl_attach_time;		/* attach time */
+	hrtime_t		hl_attach_time;		/* attach time */
 	ibt_hca_hdl_t		hl_hca_hdl;		/* HCA handle */
 	ibdm_port_attr_t	*hl_hca_port_attr;	/* Dummy Port Attr */
 							/* for HCA node */
--- old/usr/src/uts/common/sys/idm/idm_impl.h	2014-05-05 14:29:47.126561558 -0400
+++ new/usr/src/uts/common/sys/idm/idm_impl.h	2014-05-05 14:29:47.132474318 -0400
@@ -22,7 +22,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 /*
- * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  */
 
 #ifndef	_IDM_IMPL_H_
@@ -377,7 +377,7 @@
 	uint32_t	isp_flags;
 	uint_t		isp_hdrbuflen;
 	uint_t		isp_databuflen;
-	time_t		isp_queue_time;
+	hrtime_t	isp_queue_time;
 
 	/* Taskq dispatching state for deferred PDU */
 	taskq_ent_t	isp_tqent;
--- old/usr/src/uts/common/sys/scsi/adapters/scsi_vhci.h	2014-05-05 14:29:47.308469053 -0400
+++ new/usr/src/uts/common/sys/scsi/adapters/scsi_vhci.h	2014-05-05 14:29:47.314224620 -0400
@@ -22,6 +22,9 @@
 /*
  * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  */
+/*
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 #ifndef	_SYS_SCSI_ADAPTERS_SCSI_VHCI_H
 #define	_SYS_SCSI_ADAPTERS_SCSI_VHCI_H
@@ -65,7 +68,7 @@
 #define	TRAN2HBAPRIVATE(tran)	((struct scsi_vhci *)(tran)->tran_hba_private)
 #define	VHCI_INIT_WAIT_TIMEOUT	60000000
 #define	VHCI_FOWATCH_INTERVAL	1000000		/* in usecs */
-#define	VHCI_EXTFO_TIMEOUT	3*60		/* 3 minutes */
+#define	VHCI_EXTFO_TIMEOUT	(3 * 60 * NANOSEC)	/* 3 minutes in nsec */
 
 #define	SCBP_C(pkt)	((*(pkt)->pkt_scbp) & STATUS_MASK)
 
@@ -316,7 +319,7 @@
 	 * is still comng up
 	 */
 	int			svl_waiting_for_activepath;
-	time_t			svl_wfa_time;
+	hrtime_t		svl_wfa_time;
 
 	/*
 	 * to keep the failover status in order to return the
@@ -462,7 +465,7 @@
  */
 typedef struct scsi_vhci_swarg {
 	scsi_vhci_priv_t	*svs_svp;
-	time_t			svs_tos;	/* time of submission */
+	hrtime_t		svs_tos;	/* time of submission */
 	mdi_pathinfo_t		*svs_pi;	/* pathinfo being "watched" */
 	int			svs_release_lun;
 	int			svs_done;
--- old/usr/src/uts/common/sys/scsi/targets/sddef.h	2014-05-05 14:29:47.503163121 -0400
+++ new/usr/src/uts/common/sys/scsi/targets/sddef.h	2014-05-05 14:29:47.508921866 -0400
@@ -23,6 +23,7 @@
  */
 /*
  * Copyright 2011 cyril.galibern@opensvc.com
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  */
 
 #ifndef	_SYS_SCSI_TARGETS_SDDEF_H
@@ -516,7 +517,7 @@
 
 	timeout_id_t	un_retry_timeid;
 
-	time_t		un_pm_idle_time;
+	hrtime_t	un_pm_idle_time;
 	timeout_id_t	un_pm_idle_timeid;
 
 	/*
--- old/usr/src/uts/common/sys/usb/hubd/hubdvar.h	2014-05-05 14:29:47.753669791 -0400
+++ new/usr/src/uts/common/sys/usb/hubd/hubdvar.h	2014-05-05 14:29:47.759453800 -0400
@@ -22,6 +22,9 @@
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 #ifndef	_SYS_USB_HUBDVAR_H
 #define	_SYS_USB_HUBDVAR_H
@@ -91,9 +94,9 @@
 
 	uint8_t		hubp_current_power;	/* current power level */
 
-	time_t		hubp_time_at_full_power;	/* timestamp 0->3 */
+	hrtime_t	hubp_time_at_full_power;	/* timestamp 0->3 */
 
-	uint8_t		hubp_min_pm_threshold;		/* in seconds */
+	hrtime_t	hubp_min_pm_threshold;		/* in nanoseconds */
 
 	/* power state of all children are tracked here */
 	uint8_t		*hubp_child_pwrstate;
