FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 05-27-2010, 03:35 PM
Tim Gardner
 
Default UBUNTU: SAUCE: dove: avoid page table overwrite when resuming from hibernation

On 05/27/2010 09:03 AM, Eric Miao wrote:
> From 1ae0436f8c2159936ca42d9ef938055b68af64f7 Mon Sep 17 00:00:00 2001
> From: Eric Miao<eric.miao@canonical.com>
> Date: Fri, 23 Apr 2010 14:16:17 +0800
> Subject: [PATCH] UBUNTU: SAUCE: dove: avoid page table overwrite when
> resuming from hibernation
>
> BugLink: http://bugs.launchpad.net/bugs/509006
>
> Resuming from hibernation is OK if 'resume=/dev/sdaX' is explicitly
> specified on the kernel command line, but it fails if scripts in
> initramfs are used to trigger the resume. It turned out to be page
> table being overwritten when restoring the memory content because
> it's using a normal user process's page table in the latter case,
> which is not safe and could be overwritten. Fix this by using the
> safe swapper_pg_dir during restoring.
>
> Signed-off-by: Eric Miao<eric.miao@canonical.com>
> ---
>
> It was posted weeks ago, thought it was merged but not. This is an updated
> version addressing the previous comments to make it cleaner.
>
> arch/arm/mach-dove/Makefile | 2 ++
> arch/arm/mach-dove/swsusp.S | 8 ++++++++
> 2 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
> index 0be1e1c..c5c028f 100755
> --- a/arch/arm/mach-dove/Makefile
> +++ b/arch/arm/mach-dove/Makefile
> @@ -1,3 +1,5 @@
> +AFLAGS_swsusp.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
> +
> obj-y += clock.o common.o addr-map.o irq.o pcie.o mpp.o
> sdhci_cam_mbus.o
> obj-$(CONFIG_MACH_DOVE_RD_AVNG) += dove-rd-avng-setup.o
> diff --git a/arch/arm/mach-dove/swsusp.S b/arch/arm/mach-dove/swsusp.S
> index 4f4a884..9b752a0 100644
> --- a/arch/arm/mach-dove/swsusp.S
> +++ b/arch/arm/mach-dove/swsusp.S
> @@ -28,6 +28,7 @@
> */
>
> #include<linux/linkage.h>
> +#include<asm/memory.h>
> #include<asm/segment.h>
> #include<asm/page.h>
> #include<asm/asm-offsets.h>
> @@ -209,8 +210,15 @@ FUNC(swsusp_arch_suspend)
>
> FUNC_END(swsusp_arch_suspend)
>
> +#define KERNEL_RAM_PADDR (PHYS_OFFSET + TEXT_OFFSET)
> +#define SWAPPER_PG_DIR (KERNEL_RAM_PADDR - 0x4000)
> +
> FUNC(swsusp_arch_resume)
> /* set page table if needed */
> + ldr r0, =SWAPPER_PG_DIR
> + mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
> + mcr p15, 0, r0, c8, c7, 0 @ invalidate I,D TLBs
> + mcr p15, 0, r0, c7, c5, 4 @ ISB
>
> /*
> * retore "nr_copy_pages" pages which are saved and specified

Test results in the LP report look good. Has this patch been upstreamed?
I cannot remember from the original discussions a few weeks ago.

Acked-by: Tim Gardner <tim.gardner@canonical.com>

--
Tim Gardner tim.gardner@canonical.com

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 05-27-2010, 09:27 PM
Nigel Cunningham
 
Default UBUNTU: SAUCE: dove: avoid page table overwrite when resuming from hibernation

Hi.

On 28/05/10 01:35, Tim Gardner wrote:
> Test results in the LP report look good. Has this patch been upstreamed?
> I cannot remember from the original discussions a few weeks ago.

I noticed this thread last night and brought it to Rafael's attention,
because I don't remember seeing anything like this before.

Regards,

Nigel

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 12:18 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org