mm/page_poisoning.c: allow for zero poisoning
[deliverable/linux.git] / kernel / power / hibernate.c
index b7342a24f559211934fb90db21a4a06d5479b21a..aa0f26b5842659a5c12b794ed8535e77edd44f15 100644 (file)
@@ -1158,6 +1158,22 @@ static int __init kaslr_nohibernate_setup(char *str)
        return nohibernate_setup(str);
 }
 
+static int __init page_poison_nohibernate_setup(char *str)
+{
+#ifdef CONFIG_PAGE_POISONING_ZERO
+       /*
+        * The zeroing option for page poison skips the checks on alloc.
+        * since hibernation doesn't save free pages there's no way to
+        * guarantee the pages will still be zeroed.
+        */
+       if (!strcmp(str, "on")) {
+               pr_info("Disabling hibernation due to page poisoning\n");
+               return nohibernate_setup(str);
+       }
+#endif
+       return 1;
+}
+
 __setup("noresume", noresume_setup);
 __setup("resume_offset=", resume_offset_setup);
 __setup("resume=", resume_setup);
@@ -1166,3 +1182,4 @@ __setup("resumewait", resumewait_setup);
 __setup("resumedelay=", resumedelay_setup);
 __setup("nohibernate", nohibernate_setup);
 __setup("kaslr", kaslr_nohibernate_setup);
+__setup("page_poison=", page_poison_nohibernate_setup);
This page took 0.03907 seconds and 5 git commands to generate.