[PATCH] - add "fixpae" bootparam to fix/workaround #930447

Roland Kletzing devzero at web.de
Tue Nov 26 23:09:22 UTC 2013


Hello kernel-team, 

regarding https://bugs.launchpad.net/ubuntu/+source/syslinux/+bug/930447 , i have developed a simple patch to (hopefully) provide an easy and elegant workaround/fix for the issue. I assume some hundred users (if not some thousand, as entries in bugreports are only the tip of an iceberg) are affected by this issue.

Please take a review and feel free to merge.

As defaulting to PAE kernels is specific for some distros only, i think this is no patch for mainline (yet).

I did not often do patches, nor am i a good programmer - so sorry if the patch or the submission style is not perfect.

regards
Roland

---
This patch adds a kernel bootparam "fixpae". If integrated into the kernel, this should make life more easy, as installation quirks like fake-pae package, upgrade path from ubuntu 12.04 onwards or specially crafted installation media are not needed anymore. Affected users also get a hint that their issue may be workarounded with this param. Just add the bootparam to the kernel commandline and you`re done.

       fixpae          [x86] Workaround for a nasty PAE issue with older CPU`s
                       like Pentium M, as they may report PAE incapability
                       although they support it. This bootparam adds a fake
                       pae entry to the flags section in /proc/cpuinfo and
                       skips the validate_cpu() routine in arch/x86/boot/main.c
                       This is necesssary as major distros nowadays only ship
                       PAE Kernels for x86 and there is no easy workaround.

signed-off-by: Roland Kletzing <devzero at web.de>
---

diff -uprN linux-source-3.11.0.orig/arch/x86/boot/main.c linux-source-3.11.0/arch/x86/boot/main.c
--- linux-source-3.11.0.orig/arch/x86/boot/main.c       2013-09-02 22:46:10.000000000 +0200
+++ linux-source-3.11.0/arch/x86/boot/main.c    2013-11-26 20:56:01.175269235 +0100
@@ -146,9 +146,17 @@ void main(void)

        /* Make sure we have all the proper CPU support */
        if (validate_cpu()) {
-               puts("Unable to boot - please use a kernel appropriate "
-                    "for your CPU.\n");
-               die();
+               if(cmdline_find_option_bool("fixpae"))
+                       puts("fixpae bootparam active. Skipping CPU "
+                            "validation and continuing Kernel execution\n");
+               else {
+                       puts("Unable to boot - please use a kernel appropriate "
+                            "for your CPU.\n"
+                            "Hint: CPU`s like Pentium M may incorrectly report "
+                            "on PAE incapability, so you may try booting with "
+                            "fixpae bootparam as a workaround.\n");
+                       die();
+               }
        }

        /* Tell the BIOS what CPU mode we intend to run in. */
diff -uprN linux-source-3.11.0.orig/arch/x86/kernel/cpu/proc.c linux-source-3.11.0/arch/x86/kernel/cpu/proc.c
--- linux-source-3.11.0.orig/arch/x86/kernel/cpu/proc.c 2013-09-02 22:46:10.000000000 +0200
+++ linux-source-3.11.0/arch/x86/kernel/cpu/proc.c      2013-11-26 21:15:53.961267903 +0100
@@ -4,6 +4,17 @@
 #include <linux/seq_file.h>
 #include <linux/cpufreq.h>

+/* fixpae kernelparam workaround, see kernel-parameters.txt */
+static int fixpaeflag = 0;
+
+static int __init fixpae(char *s)
+{
+       fixpaeflag=1;
+        return 1;
+}
+
+__setup("fixpae", fixpae);
+
 /*
  *     Get CPU information for use by the procfs.
  */
@@ -96,6 +107,8 @@ static int show_cpuinfo(struct seq_file
        show_cpuinfo_misc(m, c);

        seq_printf(m, "flags\t\t:");
+       if(fixpaeflag)
+               seq_printf(m, " pae");
        for (i = 0; i < 32*NCAPINTS; i++)
                if (cpu_has(c, i) && x86_cap_flags[i] != NULL)
                        seq_printf(m, " %s", x86_cap_flags[i]);
diff -uprN linux-source-3.11.0.orig/Documentation/kernel-parameters.txt linux-source-3.11.0/Documentation/kernel-parameters.txt
--- linux-source-3.11.0.orig/Documentation/kernel-parameters.txt        2013-10-23 19:26:00.000000000 +0200
+++ linux-source-3.11.0/Documentation/kernel-parameters.txt     2013-11-26 21:13:28.515313678 +0100
@@ -900,6 +900,14 @@ bytes respectively. Such letter suffixes
                        Format: <interval>,<probability>,<space>,<times>
                        See also Documentation/fault-injection/.

+       fixpae          [x86] Workaround for a nasty PAE issue with older CPU`s
+                       like Pentium M, as they may report PAE incapability
+                       although they support it. This bootparam adds a fake
+                       pae entry to the flags section in /proc/cpuinfo and
+                       skips the validate_cpu() routine in arch/x86/boot/main.c
+                       This is necesssary as major distros nowadays only ship
+                       PAE Kernels for x86 and there is no easy workaround.
+
        floppy=         [HW]
                        See Documentation/blockdev/floppy.txt.





More information about the kernel-team mailing list