Commit e7b1438a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] swsusp: fix swsusp with intel-agp

From: Pavel Machek <pavel@suse.cz>

swsusp contained rather nasty bug where it killed machine when intel-agp or
anything else split kernel 4MB mapping.  Herbert Xu diagnosed this.  Fixed by
switching to "known good" mapping for during suspend/resume.
parent e7653a14
...@@ -328,9 +328,30 @@ static void __init pagetable_init (void) ...@@ -328,9 +328,30 @@ static void __init pagetable_init (void)
#endif #endif
} }
#if defined(CONFIG_PM_DISK) || defined(CONFIG_SOFTWARE_SUSPEND)
/*
* Swap suspend & friends need this for resume because things like the intel-agp
* driver might have split up a kernel 4MB mapping.
*/
char __nosavedata swsusp_pg_dir[PAGE_SIZE]
__attribute__ ((aligned (PAGE_SIZE)));
static inline void save_pg_dir(void)
{
memcpy(swsusp_pg_dir, swapper_pg_dir, PAGE_SIZE);
}
#else
static inline void save_pg_dir(void)
{
}
#endif
void zap_low_mappings (void) void zap_low_mappings (void)
{ {
int i; int i;
save_pg_dir();
/* /*
* Zap initial low-memory mappings. * Zap initial low-memory mappings.
* *
......
...@@ -21,7 +21,7 @@ ENTRY(pmdisk_arch_suspend) ...@@ -21,7 +21,7 @@ ENTRY(pmdisk_arch_suspend)
jmp .L1449 jmp .L1449
.p2align 4,,7 .p2align 4,,7
.L1450: .L1450:
movl $swapper_pg_dir-__PAGE_OFFSET,%ecx movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx
movl %ecx,%cr3 movl %ecx,%cr3
movl pm_pagedir_nosave,%ebx movl pm_pagedir_nosave,%ebx
......
...@@ -36,7 +36,7 @@ ENTRY(do_magic) ...@@ -36,7 +36,7 @@ ENTRY(do_magic)
jmp .L1449 jmp .L1449
.p2align 4,,7 .p2align 4,,7
.L1450: .L1450:
movl $swapper_pg_dir-__PAGE_OFFSET,%ecx movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx
movl %ecx,%cr3 movl %ecx,%cr3
call do_magic_resume_1 call do_magic_resume_1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment