* [PATCH] [MIPS] Fix resume for 64K page size
@ 2007-07-10 17:20 ` pwatkins
0 siblings, 0 replies; 9+ messages in thread
From: pwatkins @ 2007-07-10 17:20 UTC (permalink / raw)
To: linux-mips, ralf; +Cc: Peter Watkins
This fixes a bug when running 64K page size on r4k machines.
Signed-off-by: Peter Watkins <pwatkins@sicortex.com>
---
arch/mips/kernel/r4k_switch.S | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 0672959..65f0f91 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -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
--
1.4.2.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] [MIPS] Fix resume for 64K page size
@ 2007-07-10 17:20 ` pwatkins
0 siblings, 0 replies; 9+ messages in thread
From: pwatkins @ 2007-07-10 17:20 UTC (permalink / raw)
To: linux-mips, ralf; +Cc: Peter Watkins
This fixes a bug when running 64K page size on r4k machines.
Signed-off-by: Peter Watkins <pwatkins@sicortex.com>
---
arch/mips/kernel/r4k_switch.S | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 0672959..65f0f91 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -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
--
1.4.2.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] [MIPS] Fix resume for 64K page size
@ 2007-07-10 17:15 ` Ralf Baechle
0 siblings, 0 replies; 9+ messages in thread
From: Ralf Baechle @ 2007-07-10 17:15 UTC (permalink / raw)
To: pwatkins; +Cc: linux-mips
On Tue, Jul 10, 2007 at 01:20:51PM -0400, pwatkins@sicortex.com wrote:
> This fixes a bug when running 64K page size on r4k machines.
Thanks, applied.
Ralf
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] [MIPS] Fix resume for 64K page size
@ 2007-07-10 17:34 ` Thiemo Seufer
0 siblings, 0 replies; 9+ messages in thread
From: Thiemo Seufer @ 2007-07-10 17:34 UTC (permalink / raw)
To: pwatkins; +Cc: linux-mips, ralf
pwatkins@sicortex.com wrote:
> This fixes a bug when running 64K page size on r4k machines.
>
>
> Signed-off-by: Peter Watkins <pwatkins@sicortex.com>
> ---
> arch/mips/kernel/r4k_switch.S | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
> index 0672959..65f0f91 100644
> --- a/arch/mips/kernel/r4k_switch.S
> +++ b/arch/mips/kernel/r4k_switch.S
> @@ -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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] [MIPS] Fix resume for 64K page size
@ 2007-07-10 17:34 ` Thiemo Seufer
0 siblings, 0 replies; 9+ messages in thread
From: Thiemo Seufer @ 2007-07-10 17:34 UTC (permalink / raw)
To: pwatkins; +Cc: linux-mips, ralf
pwatkins@sicortex.com wrote:
> This fixes a bug when running 64K page size on r4k machines.
>
>
> Signed-off-by: Peter Watkins <pwatkins@sicortex.com>
> ---
> arch/mips/kernel/r4k_switch.S | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
> index 0672959..65f0f91 100644
> --- a/arch/mips/kernel/r4k_switch.S
> +++ b/arch/mips/kernel/r4k_switch.S
> @@ -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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] [MIPS] Fix resume for 64K page size
@ 2007-07-11 7:36 ` Ralf Baechle
0 siblings, 0 replies; 9+ messages in thread
From: Ralf Baechle @ 2007-07-11 7:36 UTC (permalink / raw)
To: Thiemo Seufer; +Cc: pwatkins, linux-mips
On Tue, Jul 10, 2007 at 06:34:54PM +0100, Thiemo Seufer wrote:
> > -#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.
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
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 65f0f91..d9bfae5 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -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 */
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] [MIPS] Fix resume for 64K page size
@ 2007-07-11 7:36 ` Ralf Baechle
0 siblings, 0 replies; 9+ messages in thread
From: Ralf Baechle @ 2007-07-11 7:36 UTC (permalink / raw)
To: Thiemo Seufer; +Cc: pwatkins, linux-mips
On Tue, Jul 10, 2007 at 06:34:54PM +0100, Thiemo Seufer wrote:
> > -#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.
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
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 65f0f91..d9bfae5 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -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 */
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] [MIPS] Fix resume for 64K page size
2007-07-10 17:20 ` pwatkins
` (2 preceding siblings ...)
(?)
@ 2007-07-10 17:36 ` Maciej W. Rozycki
-1 siblings, 0 replies; 9+ messages in thread
From: Maciej W. Rozycki @ 2007-07-10 17:36 UTC (permalink / raw)
To: Peter Watkins; +Cc: linux-mips, ralf
On Tue, 10 Jul 2007, pwatkins@sicortex.com wrote:
> @@ -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
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-07-11 9:59 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-10 17:20 [PATCH] [MIPS] Fix resume for 64K page size pwatkins
2007-07-10 17:20 ` pwatkins
2007-07-10 17:15 ` Ralf Baechle
2007-07-10 17:15 ` Ralf Baechle
2007-07-10 17:34 ` Thiemo Seufer
2007-07-10 17:34 ` Thiemo Seufer
2007-07-11 7:36 ` Ralf Baechle
2007-07-11 7:36 ` Ralf Baechle
2007-07-10 17:36 ` Maciej W. Rozycki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.