Fix resume for 64K page size
PATCH 1/1 Fix resume for 64K page size
This fixes a bug when running 64K page size on r4k machines.
--- arch/mips/kernel/r4k_switch.S | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/kernel/r4k_switch.S +1 -1
@@ -85,7 +85,7 @@ #endif move $28, a2 cpu_restore_nonscratch a1 -#if (_THREAD_SIZE - 32) < 0x10000 +#if (_THREAD_SIZE) < 0x10000 PTR_ADDIU t0, $28, _THREAD_SIZE - 32 #else PTR_LI t0, _THREAD_SIZE - 32
Signature · 1 line
1.4.2.4
Ralf Baechle
AppliedQuoted 1 line · On Tue, Jul 10, 2007 at 01:20:51PM -0400, [email protected] wrote:
This fixes a bug when running 64K page size on r4k machines.
Thanks, applied.
Ralf
Quoted 13 lines · [email protected] wrote:
This fixes a bug when running 64K page size on r4k machines.
Signed-off-by Peter Watkins <[email protected]>--- arch/mips/kernel/r4k_switch.S | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/mips/kernel/r4k_switch.S +0
-0
arch/mips/kernel/r4k_switch.S #endif · line 91
Quoted 8 lines
arch/mips/kernel/r4k_switch.S +1
-1@@ -85,7 +85,7 @@ #endif move $28, a2 cpu_restore_nonscratch a1 -#if (_THREAD_SIZE - 32) < 0x10000 +#if (_THREAD_SIZE) < 0x10000 PTR_ADDIU t0, $28, _THREAD_SIZE - 32 #else PTR_LI t0, _THREAD_SIZE - 32
This doesn't look right. I think it should be
#if (_THREAD_SIZE - 32) < 0x8000
in order to avoid an overflow of the immediate.
Thiemo
arch/mips/kernel/r4k_switch.S #endif · line 91
Quoted 9 lines · On Tue, 10 Jul 2007, [email protected] wrote:
arch/mips/kernel/r4k_switch.S +1
-1@@ -85,7 +85,7 @@ #endif move $28, a2 cpu_restore_nonscratch a1 -#if (_THREAD_SIZE - 32) < 0x10000 +#if (_THREAD_SIZE) < 0x10000 PTR_ADDIU t0, $28, _THREAD_SIZE - 32 #else PTR_LI t0, _THREAD_SIZE - 32
It looks wrong to me. Shouldn't that be:
#if (_THREAD_SIZE - 32) < 0x8000
Maciej
Quoted 11 lines · Thiemo Seufer
Review
Quoted 5 lines
(quoted diff) +1
-1-#if (_THREAD_SIZE - 32) < 0x10000 +#if (_THREAD_SIZE) < 0x10000 PTR_ADDIU t0, $28, _THREAD_SIZE - 32 #else PTR_LI t0, _THREAD_SIZE - 32This doesn't look right. I think it should be
#if (
_THREAD_SIZE- 32) <0x8000in order to avoid an overflow of the immediate.
Indeed - that's the limitation of the (d)addiu instruction. But (d)addu instead handle large constants just fine, so I'd below patch instead. So why not let the assembler do the dirty work.
Ralf
arch/mips/kernel/r4k_switch.S +1 -6
@@ -85,12 +85,7 @@ move $28, a2 cpu_restore_nonscratch a1 -#if (_THREAD_SIZE) < 0x10000 - PTR_ADDIU t0, $28, _THREAD_SIZE - 32 -#else - PTR_LI t0, _THREAD_SIZE - 32 - PTR_ADDU t0, $28 -#endif + PTR_ADDU t0, $28, _THREAD_SIZE - 32 set_saved_sp t0, t1, t2 #ifdef CONFIG_MIPS_MT_SMTC /* Read-modify-writes of Status must be atomic on a VPE */