From: Santosh <santosh.shilimkar@ti.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 08/11] ARM: pm: no need to save/restore context ID register
Date: Sat, 03 Sep 2011 22:03:00 +0530 [thread overview]
Message-ID: <4E6256BC.3080604@ti.com> (raw)
In-Reply-To: <E1Qz6jT-00078d-LC@rmk-PC.arm.linux.org.uk>
On Thursday 01 September 2011 06:20 PM, Russell King - ARM Linux wrote:
> There is no need to save and restore the context ID register on ARMv6
> and ARMv7 with a temporary page table as we write the context ID
> register when we switch back to the real page tables for the thread.
>
> Moreover, the temporary page tables do not contain any non-global
> mappings, so the context ID value should not be used. To be safe,
> initialize the register to a reserved context ID value.
>
> Signed-off-by: Russell King<rmk+kernel@arm.linux.org.uk>
> ---
> arch/arm/mm/proc-v6.S | 33 ++++++++++++++++-----------------
> arch/arm/mm/proc-v7.S | 13 ++++++-------
> 2 files changed, 22 insertions(+), 24 deletions(-)
>
> diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
> index 2e27b46..a92c3c3 100644
> --- a/arch/arm/mm/proc-v6.S
> +++ b/arch/arm/mm/proc-v6.S
> @@ -128,19 +128,18 @@ ENTRY(cpu_v6_set_pte_ext)
>
> /* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */
> .globl cpu_v6_suspend_size
> -.equ cpu_v6_suspend_size, 4 * 7
> +.equ cpu_v6_suspend_size, 4 * 6
> #ifdef CONFIG_PM_SLEEP
> ENTRY(cpu_v6_do_suspend)
> - stmfd sp!, {r4 - r10, lr}
> + stmfd sp!, {r4 - r9, lr}
> mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
> - mrc p15, 0, r5, c13, c0, 1 @ Context ID
> - mrc p15, 0, r6, c3, c0, 0 @ Domain ID
> - mrc p15, 0, r7, c2, c0, 1 @ Translation table base 1
> - mrc p15, 0, r8, c1, c0, 1 @ auxiliary control register
> - mrc p15, 0, r9, c1, c0, 2 @ co-processor access control
> - mrc p15, 0, r10, c1, c0, 0 @ control register
> - stmia r0, {r4 - r10}
> - ldmfd sp!, {r4- r10, pc}
> + mrc p15, 0, r5, c3, c0, 0 @ Domain ID
> + mrc p15, 0, r6, c2, c0, 1 @ Translation table base 1
> + mrc p15, 0, r7, c1, c0, 1 @ auxiliary control register
> + mrc p15, 0, r8, c1, c0, 2 @ co-processor access control
> + mrc p15, 0, r9, c1, c0, 0 @ control register
> + stmia r0, {r4 - r9}
> + ldmfd sp!, {r4- r9, pc}
> ENDPROC(cpu_v6_do_suspend)
>
> ENTRY(cpu_v6_do_resume)
> @@ -149,19 +148,19 @@ ENTRY(cpu_v6_do_resume)
> mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
> mcr p15, 0, ip, c7, c15, 0 @ clean+invalidate cache
> mcr p15, 0, ip, c7, c10, 4 @ drain write buffer
> - ldmia r0, {r4 - r10}
> + mcr p15, 0, ip, c13, 0, 1 @ set reserved context ID
Typo which results in build error.
Error: co-processor register expected -- `mcr p15,0,ip,c13,0,1'
You can fold below fix.
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 53bba9d..b3455c1 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -148,7 +148,7 @@ ENTRY(cpu_v6_do_resume)
mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
mcr p15, 0, ip, c7, c15, 0 @ clean+invalidate cache
mcr p15, 0, ip, c7, c10, 4 @ drain write buffer
- mcr p15, 0, ip, c13, 0, 1 @ set reserved context ID
+ mcr p15, 0, ip, c13, c0, 1 @ set reserved context ID
ldmia r0, {r4 - r9}
mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
mcr p15, 0, r5, c3, c0, 0 @ Domain ID
--
1.7.4.1
Regards
Santosh
WARNING: multiple messages have this Message-ID (diff)
From: santosh.shilimkar@ti.com (Santosh)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/11] ARM: pm: no need to save/restore context ID register
Date: Sat, 03 Sep 2011 22:03:00 +0530 [thread overview]
Message-ID: <4E6256BC.3080604@ti.com> (raw)
In-Reply-To: <E1Qz6jT-00078d-LC@rmk-PC.arm.linux.org.uk>
On Thursday 01 September 2011 06:20 PM, Russell King - ARM Linux wrote:
> There is no need to save and restore the context ID register on ARMv6
> and ARMv7 with a temporary page table as we write the context ID
> register when we switch back to the real page tables for the thread.
>
> Moreover, the temporary page tables do not contain any non-global
> mappings, so the context ID value should not be used. To be safe,
> initialize the register to a reserved context ID value.
>
> Signed-off-by: Russell King<rmk+kernel@arm.linux.org.uk>
> ---
> arch/arm/mm/proc-v6.S | 33 ++++++++++++++++-----------------
> arch/arm/mm/proc-v7.S | 13 ++++++-------
> 2 files changed, 22 insertions(+), 24 deletions(-)
>
> diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
> index 2e27b46..a92c3c3 100644
> --- a/arch/arm/mm/proc-v6.S
> +++ b/arch/arm/mm/proc-v6.S
> @@ -128,19 +128,18 @@ ENTRY(cpu_v6_set_pte_ext)
>
> /* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */
> .globl cpu_v6_suspend_size
> -.equ cpu_v6_suspend_size, 4 * 7
> +.equ cpu_v6_suspend_size, 4 * 6
> #ifdef CONFIG_PM_SLEEP
> ENTRY(cpu_v6_do_suspend)
> - stmfd sp!, {r4 - r10, lr}
> + stmfd sp!, {r4 - r9, lr}
> mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
> - mrc p15, 0, r5, c13, c0, 1 @ Context ID
> - mrc p15, 0, r6, c3, c0, 0 @ Domain ID
> - mrc p15, 0, r7, c2, c0, 1 @ Translation table base 1
> - mrc p15, 0, r8, c1, c0, 1 @ auxiliary control register
> - mrc p15, 0, r9, c1, c0, 2 @ co-processor access control
> - mrc p15, 0, r10, c1, c0, 0 @ control register
> - stmia r0, {r4 - r10}
> - ldmfd sp!, {r4- r10, pc}
> + mrc p15, 0, r5, c3, c0, 0 @ Domain ID
> + mrc p15, 0, r6, c2, c0, 1 @ Translation table base 1
> + mrc p15, 0, r7, c1, c0, 1 @ auxiliary control register
> + mrc p15, 0, r8, c1, c0, 2 @ co-processor access control
> + mrc p15, 0, r9, c1, c0, 0 @ control register
> + stmia r0, {r4 - r9}
> + ldmfd sp!, {r4- r9, pc}
> ENDPROC(cpu_v6_do_suspend)
>
> ENTRY(cpu_v6_do_resume)
> @@ -149,19 +148,19 @@ ENTRY(cpu_v6_do_resume)
> mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
> mcr p15, 0, ip, c7, c15, 0 @ clean+invalidate cache
> mcr p15, 0, ip, c7, c10, 4 @ drain write buffer
> - ldmia r0, {r4 - r10}
> + mcr p15, 0, ip, c13, 0, 1 @ set reserved context ID
Typo which results in build error.
Error: co-processor register expected -- `mcr p15,0,ip,c13,0,1'
You can fold below fix.
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 53bba9d..b3455c1 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -148,7 +148,7 @@ ENTRY(cpu_v6_do_resume)
mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
mcr p15, 0, ip, c7, c15, 0 @ clean+invalidate cache
mcr p15, 0, ip, c7, c10, 4 @ drain write buffer
- mcr p15, 0, ip, c13, 0, 1 @ set reserved context ID
+ mcr p15, 0, ip, c13, c0, 1 @ set reserved context ID
ldmia r0, {r4 - r9}
mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
mcr p15, 0, r5, c3, c0, 0 @ Domain ID
--
1.7.4.1
Regards
Santosh
next prev parent reply other threads:[~2011-09-03 16:33 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-01 12:47 [PATCH 00/11] Add L2 cache cleaning to generic CPU suspend Russell King - ARM Linux
2011-09-01 12:47 ` Russell King - ARM Linux
2011-09-01 12:48 ` [PATCH 01/11] ARM: pm: CPU specific code should not overwrite r1 (v:p offset) Russell King - ARM Linux
2011-09-01 12:48 ` Russell King - ARM Linux
2011-09-01 12:48 ` [PATCH 02/11] ARM: pm: arm920/926: fix number of registers saved Russell King - ARM Linux
2011-09-01 12:48 ` Russell King - ARM Linux
2011-09-01 12:49 ` [PATCH 03/11] ARM: pm: some ARMv7 requires a dsb in resume to ensure correctness Russell King - ARM Linux
2011-09-01 12:49 ` Russell King - ARM Linux
2011-09-07 15:41 ` Catalin Marinas
2011-09-07 15:41 ` Catalin Marinas
2011-09-07 16:19 ` Russell King - ARM Linux
2011-09-07 16:19 ` Russell King - ARM Linux
2011-09-07 16:26 ` Catalin Marinas
2011-09-07 16:26 ` Catalin Marinas
2011-09-07 16:54 ` Catalin Marinas
2011-09-07 16:54 ` Catalin Marinas
2011-09-01 12:49 ` [PATCH 04/11] ARM: pm: avoid writing the auxillary control register for ARMv7 Russell King - ARM Linux
2011-09-01 12:49 ` Russell King - ARM Linux
2011-09-01 12:49 ` [PATCH 05/11] ARM: pm: force non-zero return value from __cpu_suspend when aborting Russell King - ARM Linux
2011-09-01 12:49 ` Russell King - ARM Linux
2011-09-01 12:50 ` [PATCH 06/11] ARM: pm: preallocate a page table for suspend/resume Russell King - ARM Linux
2011-09-01 12:50 ` Russell King - ARM Linux
2011-09-01 12:50 ` [PATCH 07/11] ARM: pm: only use preallocated page table during resume Russell King - ARM Linux
2011-09-01 12:50 ` Russell King - ARM Linux
2011-09-01 12:50 ` [PATCH 08/11] ARM: pm: no need to save/restore context ID register Russell King - ARM Linux
2011-09-01 12:50 ` Russell King - ARM Linux
2011-09-03 16:33 ` Santosh [this message]
2011-09-03 16:33 ` Santosh
2011-09-04 10:08 ` Russell King - ARM Linux
2011-09-04 10:08 ` Russell King - ARM Linux
2011-09-01 12:51 ` [PATCH 09/11] ARM: pm: get rid of cpu_resume_turn_mmu_on Russell King - ARM Linux
2011-09-01 12:51 ` Russell King - ARM Linux
2011-09-01 12:51 ` [PATCH 10/11] ARM: pm: convert some assembly to C Russell King - ARM Linux
2011-09-01 12:51 ` Russell King - ARM Linux
2011-09-07 15:48 ` Lorenzo Pieralisi
2011-09-07 15:48 ` Lorenzo Pieralisi
2011-09-19 16:32 ` Russell King - ARM Linux
2011-09-19 16:32 ` Russell King - ARM Linux
2011-09-01 12:51 ` [PATCH 11/11] ARM: pm: add L2 cache cleaning for suspend Russell King - ARM Linux
2011-09-01 12:51 ` Russell King - ARM Linux
2011-09-01 15:33 ` [PATCH 00/11] Add L2 cache cleaning to generic CPU suspend Shawn Guo
2011-09-01 15:33 ` Shawn Guo
2011-09-01 15:34 ` Russell King - ARM Linux
2011-09-01 15:34 ` Russell King - ARM Linux
2011-09-01 15:57 ` Shawn Guo
2011-09-01 15:57 ` Shawn Guo
2011-09-10 16:10 ` Shawn Guo
2011-09-10 16:10 ` Shawn Guo
2011-09-19 16:22 ` Russell King - ARM Linux
2011-09-19 16:22 ` Russell King - ARM Linux
2011-09-20 3:24 ` Shawn Guo
2011-09-20 3:24 ` Shawn Guo
2011-09-03 16:36 ` Santosh
2011-09-03 16:36 ` Santosh
2011-09-04 10:12 ` Russell King - ARM Linux
2011-09-04 10:12 ` Russell King - ARM Linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E6256BC.3080604@ti.com \
--to=santosh.shilimkar@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.