From 9dde67c33a461e121574b1e90dbbca23bbcfafc3 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 11 Apr 2011 20:44:23 -0400 Subject: [PATCH] fix suspend to disk broken by 2.6.38.y --- kernel.spec | 8 ++++ ...tialize-mmu_cr4_features-during-boot.patch | 46 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 x86-hibernate-initialize-mmu_cr4_features-during-boot.patch diff --git a/kernel.spec b/kernel.spec index 7fccd8f32..8c1fa731f 100644 --- a/kernel.spec +++ b/kernel.spec @@ -738,6 +738,8 @@ Patch12303: dmar-disable-when-ricoh-multifunction.patch Patch12305: printk-do-not-mangle-valid-userspace-syslog-prefixes.patch Patch12306: scsi-sd-downgrade-caching-printk-from-error-to-notice.patch +Patch12307: x86-hibernate-initialize-mmu_cr4_features-during-boot.patch + %endif BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root @@ -1373,6 +1375,9 @@ ApplyPatch printk-do-not-mangle-valid-userspace-syslog-prefixes.patch ApplyPatch scsi-sd-downgrade-caching-printk-from-error-to-notice.patch +# fix hibernate broken by 2.6.38.y +ApplyPatch x86-hibernate-initialize-mmu_cr4_features-during-boot.patch + # END OF PATCH APPLICATIONS %endif @@ -1981,6 +1986,9 @@ fi # and build. %changelog +* Tue Apr 12 2011 Kyle McMartin +- fix hibernate which was broken by 2.6.38.y (korg#32222) + * Tue Apr 12 2011 Ben Skeggs 2.6.38-2.14 - nouveau: correct lock ordering problem diff --git a/x86-hibernate-initialize-mmu_cr4_features-during-boot.patch b/x86-hibernate-initialize-mmu_cr4_features-during-boot.patch new file mode 100644 index 000000000..ddccca117 --- /dev/null +++ b/x86-hibernate-initialize-mmu_cr4_features-during-boot.patch @@ -0,0 +1,46 @@ +From 157db94a095cbfa84a1932d516930f4371e7fab5 Mon Sep 17 00:00:00 2001 +From: H. Peter Anvin +Date: Wed, 6 Apr 2011 13:10:02 -0700 +Subject: [PATCH] x86, hibernate: Initialize mmu_cr4_features during boot + +Restore the initialization of mmu_cr4_features during boot, which was +removed without comment in checkin e5f15b45ddf3afa2bbbb10c7ea34fb32b6de0a0e + +x86: Cleanup highmap after brk is concluded + +thereby breaking resume from hibernate. This restores previous +functionality in approximately the same place, and corrects the +reading of %cr4 on pre-CPUID hardware (%cr4 exists if and only if +CPUID is supported.) + +However, part of the problem is that the hibernate suspend/resume +sequence should manage the save/restore of %cr4 explicitly. + +Signed-off-by: H. Peter Anvin +Cc: Rafael J. Wysocki +Cc: Stefano Stabellini +Cc: Yinghai Lu +LKML-Reference: <201104020154.57136.rjw@sisk.pl> +--- + arch/x86/kernel/setup.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c +index e543fe9..4e59873 100644 +--- a/arch/x86/kernel/setup.c ++++ b/arch/x86/kernel/setup.c +@@ -1013,6 +1013,11 @@ void __init setup_arch(char **cmdline_p) + paging_init(); + x86_init.paging.pagetable_setup_done(swapper_pg_dir); + ++ if (boot_cpu_data.cpuid_level >= 0) { ++ /* A CPU has %cr4 if and only if it has CPUID */ ++ mmu_cr4_features = read_cr4(); ++ } ++ + #ifdef CONFIG_X86_32 + /* sync back kernel address range */ + clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY, +-- +1.7.4.2 +