[PowerPC64LE] Fix sleeping on POWER8.
Due to enter_idle_powerx fabricating a MSR from scratch, it is necessary for it to care about the endianness, so we don't accidentally switch endian the first time we idle a thread. Took about five seconds to spot after seeing an unmangled backtrace. The hard bit was needing to temporarily set up a mutex to sort out the logjam that happens when every thread simultaneously wakes up in the wrong endian due to the panic IPI and panics, leaving what I can best describe as "alphabet soup" on the console. Luckily, I already had a patch sitting around to do that. This brings POWER8 up to equivilence with POWER9 on PPC64LE. Sponsored by: Tag1 Consulting, Inc.
This commit is contained in:
@@ -71,7 +71,11 @@ ENTRY(enter_idle_powerx)
|
|||||||
|
|
||||||
/* Set MSR */
|
/* Set MSR */
|
||||||
li %r3,0
|
li %r3,0
|
||||||
|
#ifdef __LITTLE_ENDIAN__
|
||||||
|
ori %r3,%r3,(PSL_ME | PSL_RI | PSL_LE)
|
||||||
|
#else
|
||||||
ori %r3,%r3,(PSL_ME | PSL_RI)
|
ori %r3,%r3,(PSL_ME | PSL_RI)
|
||||||
|
#endif
|
||||||
li %r8,0x9 /* PSL_SF and PSL_HV */
|
li %r8,0x9 /* PSL_SF and PSL_HV */
|
||||||
insrdi %r3,%r8,4,0
|
insrdi %r3,%r8,4,0
|
||||||
mtsrr1 %r3
|
mtsrr1 %r3
|
||||||
|
|||||||
Reference in New Issue
Block a user