WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[rfc] Re: [XenPPC] Booting xen_maple_defconfig kernel on bare hardware

To: Amos Waterland <apw@xxxxxxxxxx>
Subject: [rfc] Re: [XenPPC] Booting xen_maple_defconfig kernel on bare hardware
From: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Date: Thu, 27 Jul 2006 08:48:51 -0400
Cc: Chris Wright <chrisw@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, xen-ppc-devel <xen-ppc-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 27 Jul 2006 05:49:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060726082633.GA3283@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060726082633.GA3283@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx

On Jul 26, 2006, at 4:26 AM, Amos Waterland wrote:

It would be nice to boot the exact same Linux kernel binary image on
bare hardware and as a Xen dom0 on that same hardware.

the XenPPC team  considers this a requirement.

At present we
cannot do this: you stop seeing output early in the boot process.

Glad to find out that functionally it seems to only be the serial stuff.
The Xen Console stuff is a little wierd since instead of creating a new console device like all the other virtual console drivers they decided they would override ttyS by default for Dom0. We thought this was odd but figured it would get resolved when the xen patches went into the kernel.

Anyways, the Xen solution is to activate serial and figure out/guess at that number in ttyS<n> would be since the native serial driver will be loaded _before_ the xen console (because it was linked first), usually some large <n> would be chosen, but for our <ppc> purposes, 8 will do for demonstration.
With that "solution" in mind you need to add:
  "xencons=ttyS8 console=ttyS8"

to your dom0/kernel parameters, and it should work.
xencons= will try to allocate unique "minor" number space and the console= will force the "preferred" console

As I see it there are a few good solutions:
1) xencons uses its own devname (like "ttyXC<n>" instead of "ttyS<n>") this would require a little distro and/or admin pain that may be acceptable now.

2) We move drivers/xen/console into drivers/char so that it gets linked/inited before drivers/serial *** moving drivers/xen before drivers/serial will not work because drivers/xen needs other drivers first.

For now at least the following is sufficient, tho a little hacky.. thoughts?
-JX
**** WARNING **** my mailer will mangle this informal patch

hg diff arch/powerpc/platforms/xen/setup.c drivers/xen/console/console.c
diff -r e30fba67c38d arch/powerpc/platforms/xen/setup.c
--- a/arch/powerpc/platforms/xen/setup.c        Wed Jul 26 15:00:06 2006 -0400
+++ b/arch/powerpc/platforms/xen/setup.c        Thu Jul 27 08:35:28 2006 -0400
@@ -111,6 +111,9 @@ static void __init xen_init_early(void)
        is_dom0 = !!(xen_start_info->flags & SIF_INITDOMAIN);
        if (is_dom0) {
+               int ttySn = 0;
+               extern int xc_num;
+
                ppc_md.pcibios_fixup            = mach_maple_md.pcibios_fixup;
                ppc_md.pci_get_legacy_ide_irq   = 
mach_maple_md.pci_get_legacy_ide_irq;
                ppc_md.restart                  = mach_maple_md.restart;
@@ -120,7 +123,11 @@ static void __init xen_init_early(void)
                ppc_md.set_rtc_time             = mach_maple_md.set_rtc_time;
                ppc_md.get_rtc_time             = mach_maple_md.get_rtc_time;
-               add_preferred_console("ttyS", 0, NULL);
+#ifndef CONFIG_XEN_DISABLE_SERIAL
+               ttySn = 128;
+#endif
+               xc_num = ttySn;
+               add_preferred_console("ttyS", ttySn, NULL);
        }
        DBG("Hello World I'm Maple Xen-LPAR!\n");
diff -r e30fba67c38d drivers/xen/console/console.c
--- a/drivers/xen/console/console.c     Wed Jul 26 15:00:06 2006 -0400
+++ b/drivers/xen/console/console.c     Thu Jul 27 08:35:28 2006 -0400
@@ -69,7 +69,7 @@
  * warnings from standard distro startup scripts.
  */
static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL } xc_mode = XC_DEFAULT;
-static int xc_num = -1;
+int xc_num = -1;
#ifdef CONFIG_MAGIC_SYSRQ
static unsigned long sysrq_requested;


_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

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