summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorJason Beloro <Jason.Beloro@Sun.COM>2009-01-19 22:27:58 -0800
committerJason Beloro <Jason.Beloro@Sun.COM>2009-01-19 22:27:58 -0800
commita6a911618075176ed839dbe7f7c90604d0954b46 (patch)
treeb9097d01ed14dadde5ce2413c2757f1b7402c7c1 /usr
parent9910327f7da260a7861568db7b3fecc4efe0715d (diff)
downloadillumos-joyent-a6a911618075176ed839dbe7f7c90604d0954b46.tar.gz
6755072 Frequency of calls to demap all could be reduced
6757028 Improve CRP error packet handling 6791608 SW support for humidity sensors 6793427 Optimize update to mmu primary context id 1
Diffstat (limited to 'usr')
-rw-r--r--usr/src/cmd/picl/plugins/inc/picldefs.h5
-rw-r--r--usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.c8
-rw-r--r--usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.h7
-rw-r--r--usr/src/lib/libprtdiag/common/display_sun4v.c78
-rw-r--r--usr/src/uts/sfmmu/ml/sfmmu_asm.s8
-rw-r--r--usr/src/uts/sfmmu/vm/hat_sfmmu.c4
-rw-r--r--usr/src/uts/sfmmu/vm/hat_sfmmu.h3
-rw-r--r--usr/src/uts/sun4v/cpu/rock.c8
-rw-r--r--usr/src/uts/sun4v/ml/mach_locore.s21
-rw-r--r--usr/src/uts/sun4v/os/error.c22
10 files changed, 135 insertions, 29 deletions
diff --git a/usr/src/cmd/picl/plugins/inc/picldefs.h b/usr/src/cmd/picl/plugins/inc/picldefs.h
index c24e1f0e1d..522a32542a 100644
--- a/usr/src/cmd/picl/plugins/inc/picldefs.h
+++ b/usr/src/cmd/picl/plugins/inc/picldefs.h
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -128,6 +128,8 @@ extern "C" {
#define PICL_CLASS_SENSOR "sensor"
#define PICL_CLASS_STACK "stack"
#define PICL_CLASS_UNKNOWN "unknown"
+#define PICL_CLASS_HUMIDITY_SENSOR "humidity-sensor"
+#define PICL_CLASS_HUMIDITY_INDICATOR "humidity-indicator"
/*
* Solaris driver property names
@@ -240,6 +242,7 @@ extern "C" {
#define PICL_PROP_BASE_UNITS "BaseUnits"
#define PICL_PROP_EXPONENT "Exponent"
#define PICL_PROP_RATE_UNITS "RateUnits"
+#define PICL_PROP_HUMIDITY "Humidity"
/*
* Various threshold property names
diff --git a/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.c b/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.c
index 623997cb46..2047e1a105 100644
--- a/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.c
+++ b/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -865,6 +865,10 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p)
ADD_NODE(PICL_CLASS_RPM_SENSOR)
add_prop(nodeh, &proph, node_name, row,
PP_SPEED, snmp_syserr_p);
+ } else if (sensor_type == SSST_HUMIDITY) {
+ ADD_NODE(PICL_CLASS_HUMIDITY_SENSOR)
+ add_prop(nodeh, &proph, node_name, row,
+ PP_HUMIDITY, snmp_syserr_p);
} else {
ADD_NODE(PICL_CLASS_SENSOR)
add_prop(nodeh, &proph, node_name, row,
@@ -902,6 +906,8 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p)
ADD_NODE(PICL_CLASS_RPM_INDICATOR)
} else if (sensor_type == SSST_PRESENCE) {
ADD_NODE(PICL_CLASS_PRESENCE_INDICATOR)
+ } else if (sensor_type == SSST_HUMIDITY) {
+ ADD_NODE(PICL_CLASS_HUMIDITY_INDICATOR)
} else {
ADD_NODE(PICL_CLASS_INDICATOR)
}
diff --git a/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.h b/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.h
index 3085b85f0f..871ed18f59 100644
--- a/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.h
+++ b/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.h
@@ -20,15 +20,13 @@
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SNMPPLUGIN_H
#define _SNMPPLUGIN_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -113,7 +111,8 @@ typedef enum {
PP_MFG_NAME,
PP_MODEL_NAME,
PP_DESCRIPTION,
- PP_LABEL
+ PP_LABEL,
+ PP_HUMIDITY
} sp_propid_t;
/*
diff --git a/usr/src/lib/libprtdiag/common/display_sun4v.c b/usr/src/lib/libprtdiag/common/display_sun4v.c
index 4db965a03a..e1277cc96e 100644
--- a/usr/src/lib/libprtdiag/common/display_sun4v.c
+++ b/usr/src/lib/libprtdiag/common/display_sun4v.c
@@ -19,12 +19,10 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <stdlib.h>
#include <alloca.h>
@@ -108,6 +106,8 @@ static void sun4v_env_print_current_sensors();
static void sun4v_env_print_current_indicators();
static void sun4v_env_print_voltage_sensors();
static void sun4v_env_print_voltage_indicators();
+static void sun4v_env_print_humidity_sensors();
+static void sun4v_env_print_humidity_indicators();
static void sun4v_env_print_LEDs();
static void sun4v_print_fru_status();
static void sun4v_print_fw_rev();
@@ -1100,6 +1100,16 @@ sun4v_disp_env_status()
class_node_found = 0;
all_status_ok = 1;
+ sun4v_env_print_humidity_sensors();
+ exit_code |= (!all_status_ok);
+
+ class_node_found = 0;
+ all_status_ok = 1;
+ sun4v_env_print_humidity_indicators();
+ exit_code |= (!all_status_ok);
+
+ class_node_found = 0;
+ all_status_ok = 1;
sun4v_env_print_LEDs();
exit_code |= (!all_status_ok);
@@ -1726,6 +1736,68 @@ sun4v_env_print_voltage_indicators()
}
static void
+sun4v_env_print_humidity_sensors()
+{
+ char *fmt = "%-34s %-14s %-10s\n";
+ (void) picl_walk_tree_by_class(phyplatformh,
+ PICL_CLASS_HUMIDITY_SENSOR,
+ (void *)PICL_PROP_HUMIDITY,
+ sun4v_env_print_sensor_callback);
+ if (!class_node_found)
+ return;
+ log_printf("\nHumidity sensors:\n");
+ if (syserrlog == 0) {
+ (void) picl_walk_tree_by_class(phyplatformh,
+ PICL_CLASS_HUMIDITY_SENSOR,
+ PICL_PROP_HUMIDITY, sun4v_env_print_sensor_callback);
+ if (all_status_ok) {
+ log_printf("All humidity sensors are OK.\n");
+ return;
+ }
+ }
+ log_printf("-------------------------------------------------"
+ "-----------\n");
+ log_printf(fmt, "Location", "Sensor", "Status", 0);
+ log_printf("-------------------------------------------------"
+ "-----------\n");
+ (void) picl_walk_tree_by_class(phyplatformh,
+ PICL_CLASS_HUMIDITY_SENSOR,
+ (void *)PICL_PROP_HUMIDITY,
+ sun4v_env_print_sensor_callback);
+}
+
+static void
+sun4v_env_print_humidity_indicators()
+{
+ char *fmt = "%-34s %-14s %-8s\n";
+ (void) picl_walk_tree_by_class(phyplatformh,
+ PICL_CLASS_HUMIDITY_INDICATOR,
+ (void *)PICL_PROP_CONDITION,
+ sun4v_env_print_indicator_callback);
+ if (!class_node_found)
+ return;
+ log_printf("\nHumidity indicators:\n");
+ if (syserrlog == 0) {
+ (void) picl_walk_tree_by_class(phyplatformh,
+ PICL_CLASS_HUMIDITY_INDICATOR, (void *)PICL_PROP_CONDITION,
+ sun4v_env_print_indicator_callback);
+ if (all_status_ok) {
+ log_printf("All humidity indicators are OK.\n");
+ return;
+ }
+ }
+ log_printf("-------------------------------------------------"
+ "-----------\n");
+ log_printf(fmt, "Location", "Indicator", "Condition", 0);
+ log_printf("-------------------------------------------------"
+ "-----------\n");
+ (void) picl_walk_tree_by_class(phyplatformh,
+ PICL_CLASS_HUMIDITY_INDICATOR,
+ (void *)PICL_PROP_CONDITION,
+ sun4v_env_print_indicator_callback);
+}
+
+static void
sun4v_env_print_LEDs()
{
char *fmt = "%-34s %-14s %-8s\n";
diff --git a/usr/src/uts/sfmmu/ml/sfmmu_asm.s b/usr/src/uts/sfmmu/ml/sfmmu_asm.s
index dbd9d98983..6e5e8848b3 100644
--- a/usr/src/uts/sfmmu/ml/sfmmu_asm.s
+++ b/usr/src/uts/sfmmu/ml/sfmmu_asm.s
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -1397,6 +1397,12 @@ sfmmu_kpm_unload_tsb(caddr_t addr, int vpshift)
flush %o0
add %o0, I_SIZE, %o0
st %o1, [%o0] ! nop 4th instruction
+ flush %o0
+ add %o0, I_SIZE, %o0
+ st %o1, [%o0] ! nop 5th instruction
+ flush %o0
+ add %o0, I_SIZE, %o0
+ st %o1, [%o0] ! nop 6th instruction
retl
flush %o0
#endif /* sun4u */
diff --git a/usr/src/uts/sfmmu/vm/hat_sfmmu.c b/usr/src/uts/sfmmu/vm/hat_sfmmu.c
index 206d22d960..6c9d340704 100644
--- a/usr/src/uts/sfmmu/vm/hat_sfmmu.c
+++ b/usr/src/uts/sfmmu/vm/hat_sfmmu.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -579,7 +579,7 @@ mmu_ctx_t **mmu_ctxs_tbl; /* global array of context domains */
uint64_t mmu_saved_gnum = 0; /* to init incoming MMUs' gnums */
#define DEFAULT_NUM_CTXS_PER_MMU 8192
-static uint_t nctxs = DEFAULT_NUM_CTXS_PER_MMU;
+uint_t nctxs = DEFAULT_NUM_CTXS_PER_MMU;
int cache; /* describes system cache */
diff --git a/usr/src/uts/sfmmu/vm/hat_sfmmu.h b/usr/src/uts/sfmmu/vm/hat_sfmmu.h
index e6ccb33185..0a3ddfc2ec 100644
--- a/usr/src/uts/sfmmu/vm/hat_sfmmu.h
+++ b/usr/src/uts/sfmmu/vm/hat_sfmmu.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -609,6 +609,7 @@ typedef struct mmu_ctx {
extern uint_t max_mmu_ctxdoms;
extern mmu_ctx_t **mmu_ctxs_tbl;
+extern uint_t nctxs;
extern void sfmmu_cpu_init(cpu_t *);
extern void sfmmu_cpu_cleanup(cpu_t *);
diff --git a/usr/src/uts/sun4v/cpu/rock.c b/usr/src/uts/sun4v/cpu/rock.c
index 6170735f83..4b230e018b 100644
--- a/usr/src/uts/sun4v/cpu/rock.c
+++ b/usr/src/uts/sun4v/cpu/rock.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -55,6 +55,7 @@
#include <sys/hypervisor_api.h>
#include <sys/rock_hypervisor_api.h>
#include <sys/hsvc.h>
+#include <vm/hat_sfmmu.h>
uint_t root_phys_addr_lo_mask = 0xffffffffU;
uint8_t enable_tm = 1;
@@ -88,6 +89,11 @@ cpu_setup(void)
cpu_setup_common(NULL);
/*
+ * Rock's max nctxs is 64K. Set it accordingly.
+ */
+ nctxs = MAX_NCTXS;
+
+ /*
* Rock I$ is non-coherent.
*/
mach_setup_icache(0);
diff --git a/usr/src/uts/sun4v/ml/mach_locore.s b/usr/src/uts/sun4v/ml/mach_locore.s
index 72cedd0f67..de815641bd 100644
--- a/usr/src/uts/sun4v/ml/mach_locore.s
+++ b/usr/src/uts/sun4v/ml/mach_locore.s
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -795,16 +795,25 @@ have_win:
mov MMU_PCONTEXT, %g1
stxa %g2, [%g1]ASI_MMU_CTX
!
- ! If shared context support is not enabled, then the next four
+ ! If shared context support is not enabled, then the next six
! instructions will be patched with nop instructions.
!
.global sfmmu_shctx_user_rtt_patch
sfmmu_shctx_user_rtt_patch:
+ !
+ ! On processors which support multiple contexts, writing to
+ ! pcontext0 automatically updates pcontext1 for backwards
+ ! compatibility. So, if scontext0 & scontext1 are the same
+ ! a write to pcontext0 is sufficient.
+ !
mov MMU_SCONTEXT1, %g1
- ldxa [%g1]ASI_MMU_CTX, %g2
- mov MMU_PCONTEXT1, %g1
- stxa %g2, [%g1]ASI_MMU_CTX
-
+ ldxa [%g1]ASI_MMU_CTX, %g3
+ cmp %g2, %g3
+ beq,pt %xcc, no_pctx1_update
+ mov MMU_PCONTEXT1, %g1
+ stxa %g3, [%g1]ASI_MMU_CTX
+
+no_pctx1_update:
! Ensure new ctxs take effect by the time the "retry" (below) completes
membar #Sync
diff --git a/usr/src/uts/sun4v/os/error.c b/usr/src/uts/sun4v/os/error.c
index 8a757fe136..05d014d0aa 100644
--- a/usr/src/uts/sun4v/os/error.c
+++ b/usr/src/uts/sun4v/os/error.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -279,20 +279,24 @@ process_nonresumable_error(struct regs *rp, uint64_t flags,
}
/*
* Context Register Parity - for reload of secondary
- * context register, see nonresumable_error. Note
- * that 'size' for CRP denotes a sense of version,
- * so if it's out of range, then just let it fall
- * through and be processed later.
+ * context register, see nonresumable_error.
*/
if ((errh_flt.errh_er.attr & ERRH_ATTR_ASI) &&
- (errh_flt.errh_er.asi == ASI_MMU_CTX) &&
- (errh_flt.errh_er.addr >= MMU_PCONTEXT0) &&
- (errh_flt.errh_er.addr + errh_flt.errh_er.sz <=
- MMU_SCONTEXT1 + sizeof (uint64_t))) {
+ (errh_flt.errh_er.asi == ASI_MMU_CTX)) {
if (aflt->flt_tl) /* TL>0, so panic */
break;
+ /* Panic on unknown context registers */
+ if (errh_flt.errh_er.addr < MMU_PCONTEXT0 ||
+ errh_flt.errh_er.addr + errh_flt.errh_er.sz
+ > MMU_SCONTEXT1 + sizeof (uint64_t)) {
+ cmn_err(CE_WARN, "Parity error on "
+ "unknown context register\n");
+ aflt->flt_panic = 1;
+ break;
+ }
+
u_kill = 0; /* do not terminate */
break;
}