This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] [PATCH 1/2] Allow early_param and identical __setup to exist

To: Andi Kleen <ak@xxxxxxx>
Subject: [Xen-devel] [PATCH 1/2] Allow early_param and identical __setup to exist
From: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Date: Wed, 02 Aug 2006 19:06:47 +1000
Cc: Andrew Morton <akpm@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxx, Linux Kernel <linux-kernel@xxxxxxxxxxxxxxx>, Chris Wright <chrisw@xxxxxxxxxxxx>, Ian Pratt <ian.pratt@xxxxxxxxxxxxx>, "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>, Christoph Lameter <clameter@xxxxxxx>
Delivery-date: Wed, 02 Aug 2006 02:07:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200608020724.23583.ak@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <0adfc39039c79e4f4121.1154462446@ezr> <200608020636.58133.ak@xxxxxxx> <1154496058.2570.57.camel@xxxxxxxxxxxxxxxxxxxxx> <200608020724.23583.ak@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
We currently assume that boot parameters which are handled by
early_param() will not overlap boot parameters handled by __setup: if
they do, behaviour is dependent on link order, usually meaning __setup
will not get called.

ACPI wants to use early_param("pci"), and pci uses __setup("pci="), so
we modify the core to let them coexist: "pci=noacpi" will now get
passed to both.

Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>

diff -urpN --exclude TAGS -X 
/home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal 
--- linux-2.6.18-rc2-mm1/init/main.c    2006-08-01 14:12:11.000000000 +1000
+++ working-2.6.18-rc2-mm1-i386-parse_early_param/init/main.c   2006-08-02 
16:48:39.000000000 +1000
@@ -182,16 +182,19 @@ extern struct obs_kernel_param __setup_s
 static int __init obsolete_checksetup(char *line)
        struct obs_kernel_param *p;
+       int had_early_param = 0;
        p = __setup_start;
        do {
                int n = strlen(p->str);
                if (!strncmp(line, p->str, n)) {
                        if (p->early) {
-                               /* Already done in parse_early_param?  (Needs
-                                * exact match on param part) */
+                               /* Already done in parse_early_param?
+                                * (Needs exact match on param part).
+                                * Keep iterating, as we can have early
+                                * params and __setups of same names 8( */
                                if (line[n] == '\0' || line[n] == '=')
-                                       return 1;
+                                       had_early_param = 1;
                        } else if (!p->setup_func) {
                                printk(KERN_WARNING "Parameter %s is obsolete,"
                                       " ignored\n", p->str);
@@ -201,7 +204,8 @@ static int __init obsolete_checksetup(ch
        } while (p < __setup_end);
-       return 0;
+       return had_early_param;

Help! Save Australia from the worst of the DMCA: http://linux.org.au/law

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>