aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-11-29 15:37:01 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-03 22:10:55 -0600
commit0d84ea6bda03a00a1765dd7240a9e5231a537e96 (patch)
treef3b3b27baa34392bb77dece570087d871ae71f99 /include
parent602c6d44a302aedb02065934ab8db57311261654 (diff)
downloadskiboot-0d84ea6bda03a00a1765dd7240a9e5231a537e96.zip
skiboot-0d84ea6bda03a00a1765dd7240a9e5231a537e96.tar.gz
skiboot-0d84ea6bda03a00a1765dd7240a9e5231a537e96.tar.bz2
core: Add support for quiescing OPAL
Quiescing is ensuring all host controlled CPUs (except the current one) are out of OPAL and prevented from entering. This can be use in debug and shutdown paths, particularly with system reset sequences. This patch adds per-CPU entry and exit tracking for OPAL calls, and adds logic to "hold" or "reject" at entry time, if OPAL is quiesced. An OPAL call is added, to expose the functionality to Linux, where it can be used for shutdown, kexec, and before generating sreset IPIs for debugging (so the debug code does not recurse into OPAL). Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r--include/cpu.h2
-rw-r--r--include/opal-api.h9
-rw-r--r--include/opal-internal.h2
3 files changed, 12 insertions, 1 deletions
diff --git a/include/cpu.h b/include/cpu.h
index 3d5dbd4..2804105 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -55,9 +55,11 @@ struct cpu_thread {
struct trace_info *trace;
uint64_t save_r1;
void *icp_regs;
+ uint32_t in_opal_call;
uint32_t lock_depth;
uint32_t con_suspend;
bool con_need_flush;
+ bool quiesce_opal_call;
bool in_mcount;
bool in_poller;
bool in_reinit;
diff --git a/include/opal-api.h b/include/opal-api.h
index e058089..1c1b9cc 100644
--- a/include/opal-api.h
+++ b/include/opal-api.h
@@ -214,7 +214,14 @@
#define OPAL_SET_POWER_SHIFT_RATIO 155
#define OPAL_SENSOR_GROUP_CLEAR 156
#define OPAL_PCI_SET_P2P 157
-#define OPAL_LAST 157
+#define OPAL_QUIESCE 158
+#define OPAL_LAST 158
+
+#define QUIESCE_HOLD 1 /* Spin all calls at entry */
+#define QUIESCE_REJECT 2 /* Fail all calls with OPAL_BUSY */
+#define QUIESCE_LOCK_BREAK 3 /* Set to ignore locks. */
+#define QUIESCE_RESUME 4 /* Un-quiesce */
+#define QUIESCE_RESUME_FAST_REBOOT 5 /* Un-quiesce, fast reboot */
/* Device tree flags */
diff --git a/include/opal-internal.h b/include/opal-internal.h
index 583e999..8d3d0a1 100644
--- a/include/opal-internal.h
+++ b/include/opal-internal.h
@@ -61,6 +61,8 @@ extern void add_opal_node(void);
(func), (nargs))
extern void __opal_register(uint64_t token, void *func, unsigned num_args);
+int64_t opal_quiesce(uint32_t shutdown_type, int32_t cpu);
+
/* Warning: no locking at the moment, do at init time only
*
* XXX TODO: Add the big RCU-ish "opal API lock" to protect us here