aboutsummaryrefslogtreecommitdiff
path: root/hw/slw.c
diff options
context:
space:
mode:
authorPreeti U Murthy <preeti@linux.vnet.ibm.com>2014-08-01 00:46:23 +0530
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-08-01 08:15:49 +1000
commit7f73dfca263e8797091482cf06b38215e59899b3 (patch)
tree60f4a50968e5afaec8067feb377b27e39bf6502b /hw/slw.c
parente1b455b982cd1fd4d6c4da61d5eb52795903f437 (diff)
downloadskiboot-7f73dfca263e8797091482cf06b38215e59899b3.zip
skiboot-7f73dfca263e8797091482cf06b38215e59899b3.tar.gz
skiboot-7f73dfca263e8797091482cf06b38215e59899b3.tar.bz2
idle: Make idle flags endian safe
The idle flag IDLE_LOSE_HYP_CONTEXT can be wrongly interpreted for IDLE_USE_INST_SLEEP if the kernel has endian bug, which would incorrectly enable fastsleep even though the device tree does not advertise it. Unfortunately, some kernels currently do have such a bug. Additionally, current fastsleep wakeup path makes opal calls to sync timebase which is not endian safe. This can lead to checkstops. Hence for now change the bits used in IDLE_LOSE_HYP_CONTEXT to avoid misinterpretation with IDLE_USE_INST_SLEEP in LE kernels. Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw/slw.c')
-rw-r--r--hw/slw.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/slw.c b/hw/slw.c
index 12c09af..d8d664b 100644
--- a/hw/slw.c
+++ b/hw/slw.c
@@ -424,13 +424,14 @@ struct cpu_idle_states {
};
/* Flag definitions */
+/* Set bits to avoid misinterpretation even if kernel has endian bugs */
#define IDLE_DEC_STOP 0x00000001 /* Decrementer would stop */
#define IDLE_TB_STOP 0x00000002 /* Timebase would stop */
-#define IDLE_LOSE_USER_CONTEXT 0x00000100 /* Restore GPRs like nap */
-#define IDLE_LOSE_HYP_CONTEXT 0x00000200 /* Restore hypervisor resource
+#define IDLE_LOSE_USER_CONTEXT 0x00001000 /* Restore GPRs like nap */
+#define IDLE_LOSE_HYP_CONTEXT 0x00002000 /* Restore hypervisor resource
from PACA pointer */
-#define IDLE_LOSE_FULL_CONTEXT 0x00000400 /* Restore hypervisor resource
+#define IDLE_LOSE_FULL_CONTEXT 0x00004000 /* Restore hypervisor resource
by searching PACA */
#define IDLE_USE_INST_NAP 0x00010000 /* Use nap instruction */
#define IDLE_USE_INST_SLEEP 0x00020000 /* Use sleep instruction (no workaround) */