summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stormont <astormont@racktopsystems.com>2020-05-19 20:59:45 +0100
committerAndrew Stormont <astormont@racktopsystems.com>2020-08-17 15:33:49 +0100
commitb445c7c6f2f09c2296534b5ccda2c05321c474b1 (patch)
tree8c3de023dfebe22e1b8fb4a17ab8e0a23bcd5f01
parent06260e34c28df0a3a191e42e1b51c9de745b3510 (diff)
downloadillumos-joyent-b445c7c6f2f09c2296534b5ccda2c05321c474b1.tar.gz
12755 Double fault when booting under Amazon EC2
Reviewed by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Patrick Mooney <pmooney@pfmooney.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/uts/i86pc/cpu/generic_cpu/gcpu_main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/usr/src/uts/i86pc/cpu/generic_cpu/gcpu_main.c b/usr/src/uts/i86pc/cpu/generic_cpu/gcpu_main.c
index a7effbdc46..04286b642c 100644
--- a/usr/src/uts/i86pc/cpu/generic_cpu/gcpu_main.c
+++ b/usr/src/uts/i86pc/cpu/generic_cpu/gcpu_main.c
@@ -31,6 +31,7 @@
/*
* Copyright (c) 2018, Joyent, Inc.
+ * Copyright 2020 RackTop Systems, Inc.
*/
/*
@@ -113,6 +114,14 @@ gcpu_init_ident_ppin(cmi_hdl_t hdl)
return (NULL);
}
+ /*
+ * If the PPIN is not enabled and not locked, attempt to enable it.
+ * Note: in some environments such as Amazon EC2 the PPIN appears
+ * to be disabled and unlocked but our attempts to enable it don't
+ * stick, and when we attempt to read the PPIN we get an uncaught
+ * #GP. To avoid that happening we read the MSR back and verify it
+ * has taken the new value.
+ */
if ((value & MSR_PPIN_CTL_ENABLED) == 0) {
if ((value & MSR_PPIN_CTL_LOCKED) != 0) {
return (NULL);
@@ -122,6 +131,14 @@ gcpu_init_ident_ppin(cmi_hdl_t hdl)
CMI_SUCCESS) {
return (NULL);
}
+
+ if (cmi_hdl_rdmsr(hdl, ppin_ctl_msr, &value) != CMI_SUCCESS) {
+ return (NULL);
+ }
+
+ if ((value & MSR_PPIN_CTL_ENABLED) == 0) {
+ return (NULL);
+ }
}
if (cmi_hdl_rdmsr(hdl, ppin_msr, &value) != CMI_SUCCESS) {