From patchwork Tue Nov 26 23:09:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland X-Patchwork-Id: 294538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 2AA252C0084 for ; Wed, 27 Nov 2013 21:09:04 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Vlc3F-0007wA-U0; Wed, 27 Nov 2013 10:08:57 +0000 Received: from mout.web.de ([212.227.15.14]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VlRkw-0002xE-KZ for kernel-team@lists.ubuntu.com; Tue, 26 Nov 2013 23:09:22 +0000 Received: from 3capp-webde-bs36.server.lan ([172.19.170.36]) by mriweb.server.lan (mriweb001) with ESMTP (Nemesis) id 0LaYPB-1VMWOT1ZHD-00mIb9 for ; Wed, 27 Nov 2013 00:09:22 +0100 Received: from [87.79.185.175] by 3capp-webde-bs36.server.lan with HTTP; Wed Nov 27 00:09:22 CET 2013 MIME-Version: 1.0 Message-ID: From: "Roland Kletzing" To: kernel-team@lists.ubuntu.com Subject: [PATCH] - add "fixpae" bootparam to fix/workaround #930447 Date: Wed, 27 Nov 2013 00:09:22 +0100 (CET) Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K0:1r6p2Bh/iUizicrf1KvCTVWzWD2YDWCCsN1yR7fYEpo D8wMfOM+h6dHZkfKKT9y1WNmsYMdFpjIvHFBx9w8SJJP+4ZcV+ 3TL7l/XE8jrjtixhOg8sAXo38EsbfCig9eFmcx8NCWAwXomYMG qOA+eL+APUpgFXR4FzLEb7t+fJ9P6mqrRdhdT3L+iIYF6Z9wWE +sr5H3w7CfjTMPwi6qzYcbwdloM5A2VD0NUciEz6wPHQzqXUFs /G5YAZgYI0qnL6IVBYy2Oq6eGhrYLlZWPxP9c6IhDjdw1+If/Q too41lNYQbgDPCmg+dowoQNQr6X X-Mailman-Approved-At: Wed, 27 Nov 2013 10:08:57 +0000 Cc: "H. Peter Anvin" X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 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 --- 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 #include +/* 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: ,,, 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.