diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 21:41:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 21:41:00 -0400 |
commit | 3448097fccdce4ea8f0fcad4f37f502a8cd72e68 (patch) | |
tree | 583ee97128a9e2657d5bf73def841c460371804a /arch/x86_64 | |
parent | 5503967307f3fa443f5770a4df5ea4fbe9fb3917 (diff) |
Revert "swsusp special saveable pages support" commits
This reverts commits
3e3318dee0878d42ed62a19c292a2ac284135db3 [PATCH] swsusp: x86_64 mark special saveable/unsaveable pages
b6370d96e09944c6e3ae8d5743ca8a8ab1f79f6c [PATCH] swsusp: i386 mark special saveable/unsaveable pages
ce4ab0012b32c1a4a1d6e934aeb73bf3151c48d9 [PATCH] swsusp: add architecture special saveable pages support
because not only do they apparently cause page faults on x86, the
infrastructure doesn't compile on powerpc.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/setup.c | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index fdb82658b1a1..fb850b52b4da 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -47,7 +47,6 @@ | |||
47 | #include <linux/dmi.h> | 47 | #include <linux/dmi.h> |
48 | #include <linux/dma-mapping.h> | 48 | #include <linux/dma-mapping.h> |
49 | #include <linux/ctype.h> | 49 | #include <linux/ctype.h> |
50 | #include <linux/suspend.h> | ||
51 | 50 | ||
52 | #include <asm/mtrr.h> | 51 | #include <asm/mtrr.h> |
53 | #include <asm/uaccess.h> | 52 | #include <asm/uaccess.h> |
@@ -596,100 +595,6 @@ static void discover_ebda(void) | |||
596 | ebda_size = 64*1024; | 595 | ebda_size = 64*1024; |
597 | } | 596 | } |
598 | 597 | ||
599 | #ifdef CONFIG_SOFTWARE_SUSPEND | ||
600 | static void __init mark_nosave_page_range(unsigned long start, unsigned long end) | ||
601 | { | ||
602 | struct page *page; | ||
603 | while (start <= end) { | ||
604 | page = pfn_to_page(start); | ||
605 | SetPageNosave(page); | ||
606 | start++; | ||
607 | } | ||
608 | } | ||
609 | |||
610 | static void __init e820_nosave_reserved_pages(void) | ||
611 | { | ||
612 | int i; | ||
613 | unsigned long r_start = 0, r_end = 0; | ||
614 | |||
615 | /* Assume e820 map is sorted */ | ||
616 | for (i = 0; i < e820.nr_map; i++) { | ||
617 | struct e820entry *ei = &e820.map[i]; | ||
618 | unsigned long start, end; | ||
619 | |||
620 | start = round_down(ei->addr, PAGE_SIZE); | ||
621 | end = round_up(ei->addr + ei->size, PAGE_SIZE); | ||
622 | if (start >= end) | ||
623 | continue; | ||
624 | if (ei->type == E820_RESERVED) | ||
625 | continue; | ||
626 | r_end = start>>PAGE_SHIFT; | ||
627 | /* swsusp ignores invalid pfn, ignore these pages here */ | ||
628 | if (r_end > end_pfn) | ||
629 | r_end = end_pfn; | ||
630 | if (r_end > r_start) | ||
631 | mark_nosave_page_range(r_start, r_end-1); | ||
632 | if (r_end >= end_pfn) | ||
633 | break; | ||
634 | r_start = end>>PAGE_SHIFT; | ||
635 | } | ||
636 | } | ||
637 | |||
638 | static void __init e820_save_acpi_pages(void) | ||
639 | { | ||
640 | int i; | ||
641 | |||
642 | /* Assume e820 map is sorted */ | ||
643 | for (i = 0; i < e820.nr_map; i++) { | ||
644 | struct e820entry *ei = &e820.map[i]; | ||
645 | unsigned long start, end; | ||
646 | |||
647 | start = ei->addr, PAGE_SIZE; | ||
648 | end = ei->addr + ei->size; | ||
649 | if (start >= end) | ||
650 | continue; | ||
651 | if (ei->type != E820_ACPI && ei->type != E820_NVS) | ||
652 | continue; | ||
653 | /* | ||
654 | * If the region is below end_pfn, it will be | ||
655 | * saved/restored by swsusp follow 'RAM' type. | ||
656 | */ | ||
657 | if (start < (end_pfn << PAGE_SHIFT)) | ||
658 | start = end_pfn << PAGE_SHIFT; | ||
659 | if (end > start) | ||
660 | swsusp_add_arch_pages(start, end); | ||
661 | } | ||
662 | } | ||
663 | |||
664 | extern char __start_rodata, __end_rodata; | ||
665 | /* | ||
666 | * BIOS reserved region/hole - no save/restore | ||
667 | * ACPI NVS - save/restore | ||
668 | * ACPI Data - this is a little tricky, the mem could be used by OS after OS | ||
669 | * reads tables from the region, but anyway save/restore the memory hasn't any | ||
670 | * side effect and Linux runtime module load/unload might use it. | ||
671 | * kernel rodata - no save/restore (kernel rodata isn't changed) | ||
672 | */ | ||
673 | static int __init mark_nosave_pages(void) | ||
674 | { | ||
675 | unsigned long pfn_start, pfn_end; | ||
676 | |||
677 | /* BIOS reserved regions & holes */ | ||
678 | e820_nosave_reserved_pages(); | ||
679 | |||
680 | /* kernel rodata */ | ||
681 | pfn_start = round_up(__pa_symbol(&__start_rodata), PAGE_SIZE) >> PAGE_SHIFT; | ||
682 | pfn_end = round_down(__pa_symbol(&__end_rodata), PAGE_SIZE) >> PAGE_SHIFT; | ||
683 | mark_nosave_page_range(pfn_start, pfn_end-1); | ||
684 | |||
685 | /* record ACPI Data/NVS as saveable */ | ||
686 | e820_save_acpi_pages(); | ||
687 | |||
688 | return 0; | ||
689 | } | ||
690 | core_initcall(mark_nosave_pages); | ||
691 | #endif | ||
692 | |||
693 | void __init setup_arch(char **cmdline_p) | 598 | void __init setup_arch(char **cmdline_p) |
694 | { | 599 | { |
695 | unsigned long kernel_end; | 600 | unsigned long kernel_end; |