Re: [XenPPC] [PATCH] Use xvc to boot on bare metal
On Tue, Oct 24, 2006 at 03:18:26PM -0500, Hollis Blanchard wrote: > I don't see the dependency? It depends on that patch in that it is irrelevent without that patch. Linux would not make it far enough to worry about console. > This doesn't seem to be PowerPC-specific. Why don't you send this to > xen-devel? You are correct: it is not PowerPC-specific, and I have posted it to xen-devel. We are currently trying to get LANANA to assign the minor number, but Redhat is using the patch with a minor in the experimental range. I only posted it here because some people who use Xen/PPC needed it. ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
Re: [XenPPC] [PATCH] Use xvc to boot on bare metal
On Tue, 2006-10-24 at 11:14 -0400, Amos Waterland wrote: > This patch allows Linux compiled with xen_maple_defconfig to boot on > both bare hardware and as a dom0. I had to respin it to keep up with changes. > > Note that this depends on a xen_start_info patch soon to be posted by Jimi. I don't see the dependency? > To use, put `xencons=xvc0' in your Linux bootargs, and run > `mknod /dev/xvc0 c 204 187' in your rootfs. Built and booted up to > nfsroot on a JS21 ppc64 blade both on bare hardware and as a dom0. This doesn't seem to be PowerPC-specific. Why don't you send this to xen-devel? > Signed-off-by: Amos Waterland <[EMAIL PROTECTED]> > > --- > > arch/powerpc/configs/xen_maple_defconfig | 12 ++-- > drivers/xen/console/console.c| 27 ++- > include/linux/major.h|1 + > 3 files changed, 37 insertions(+), 3 deletions(-) > > diff -r 968ced1469e8 drivers/xen/console/console.c > --- a/drivers/xen/console/console.c Tue Oct 17 17:03:31 2006 -0400 > +++ b/drivers/xen/console/console.c Mon Oct 23 22:12:03 2006 -0400 > @@ -63,13 +63,20 @@ > * 'xencons=off' [XC_OFF]: Console is disabled. > * 'xencons=tty' [XC_TTY]: Console attached to '/dev/tty[0-9]+'. > * 'xencons=ttyS' [XC_SERIAL]: Console attached to '/dev/ttyS[0-9]+'. > + * 'xencons=xvc' [XC_XVC]: Console attached to '/dev/xvc[0-9]+'. > * [XC_DEFAULT]: DOM0 -> XC_SERIAL ; all others -> XC_TTY. > * > * NB. In mode XC_TTY, we create dummy consoles for tty2-63. This suppresses > * warnings from standard distro startup scripts. > */ > -static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL } xc_mode = XC_DEFAULT; > +static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL, XC_XVC } > +xc_mode = XC_DEFAULT; > static int xc_num = -1; > + > +/* If we are in XC_XVC mode (a virtual console at /dev/xvcX), we need to > + * comply with Lanana and use a minor under the low density serial major. > + */ > +#define XEN_XVC_MINOR 187 > > #ifdef CONFIG_MAGIC_SYSRQ > static unsigned long sysrq_requested; > @@ -85,6 +92,8 @@ static int __init xencons_setup(char *st > xc_mode = XC_SERIAL; > else if (!strncmp(str, "tty", 3)) > xc_mode = XC_TTY; > + else if (!strncmp(str, "xvc", 3)) > + xc_mode = XC_XVC; > else if (!strncmp(str, "off", 3)) > xc_mode = XC_OFF; > > @@ -95,6 +104,11 @@ static int __init xencons_setup(char *st > xc_num = n; > break; > case XC_TTY: > + n = simple_strtol(str+3, &q, 10); > + if (q > (str + 3)) > + xc_num = n; > + break; > + case XC_XVC: > n = simple_strtol(str+3, &q, 10); > if (q > (str + 3)) > xc_num = n; > @@ -199,6 +213,12 @@ static int __init xen_console_init(void) > } > > switch (xc_mode) { > + case XC_XVC: > + strcpy(kcons_info.name, "xvc"); > + if (xc_num == -1) > + xc_num = 0; > + break; > + > case XC_SERIAL: > strcpy(kcons_info.name, "ttyS"); > if (xc_num == -1) > @@ -595,6 +615,11 @@ static int __init xencons_init(void) > DRV(xencons_driver)->name= "ttyS"; > DRV(xencons_driver)->minor_start = 64 + xc_num; > DRV(xencons_driver)->name_base = 0 + xc_num; > + } else if (xc_mode == XC_XVC) { > + DRV(xencons_driver)->name= "xvc"; > + DRV(xencons_driver)->major = LOW_DENS_SERIAL_MAJOR; > + DRV(xencons_driver)->minor_start = XEN_XVC_MINOR; > + DRV(xencons_driver)->name_base = xc_num; > } else { > DRV(xencons_driver)->name= "tty"; > DRV(xencons_driver)->minor_start = xc_num; > diff -r 968ced1469e8 include/linux/major.h > --- a/include/linux/major.h Tue Oct 17 17:03:31 2006 -0400 > +++ b/include/linux/major.h Mon Oct 23 22:12:03 2006 -0400 > @@ -158,6 +158,7 @@ > > #define MSR_MAJOR202 > #define CPUID_MAJOR 203 > +#define LOW_DENS_SERIAL_MAJOR204 > > #define OSST_MAJOR 206 /* OnStream-SCx0 SCSI tape */ > > diff -r 968ced1469e8 arch/powerpc/configs/xen_maple_defconfig > --- a/arch/powerpc/configs/xen_maple_defconfigTue Oct 17 17:03:31 > 2006 -0400 > +++ b/arch/powerpc/configs/xen_maple_defconfigTue Oct 24 10:55:38 > 2006 -0400 > @@ -1,7 +1,7 @@ > # > # Automatically generated make config: don't edit > # Linux kernel version: 2.6.17 > -# Sat Oct 7 08:37:53 2006 > +# Tue Oct 24 10:51:54 2006 > # > CONFIG_PPC64=y > CONFIG_64BIT=y > @@ -711,10 +711,18 @@ CONFIG_HW_CONSOLE=y > # > # Serial drivers > # > +CONFIG_SERIAL_8250=y > +CONFIG_SERIAL_8250_CONSOLE=y > +CONFIG_SERIAL_8250_PCI=y > +CONFIG_SERIAL_8250_NR_UARTS=4 > +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 >
[XenPPC] [PATCH] Use xvc to boot on bare metal
This patch allows Linux compiled with xen_maple_defconfig to boot on both bare hardware and as a dom0. I had to respin it to keep up with changes. Note that this depends on a xen_start_info patch soon to be posted by Jimi. To use, put `xencons=xvc0' in your Linux bootargs, and run `mknod /dev/xvc0 c 204 187' in your rootfs. Built and booted up to nfsroot on a JS21 ppc64 blade both on bare hardware and as a dom0. Signed-off-by: Amos Waterland <[EMAIL PROTECTED]> --- arch/powerpc/configs/xen_maple_defconfig | 12 ++-- drivers/xen/console/console.c| 27 ++- include/linux/major.h|1 + 3 files changed, 37 insertions(+), 3 deletions(-) diff -r 968ced1469e8 drivers/xen/console/console.c --- a/drivers/xen/console/console.c Tue Oct 17 17:03:31 2006 -0400 +++ b/drivers/xen/console/console.c Mon Oct 23 22:12:03 2006 -0400 @@ -63,13 +63,20 @@ * 'xencons=off' [XC_OFF]: Console is disabled. * 'xencons=tty' [XC_TTY]: Console attached to '/dev/tty[0-9]+'. * 'xencons=ttyS' [XC_SERIAL]: Console attached to '/dev/ttyS[0-9]+'. + * 'xencons=xvc' [XC_XVC]: Console attached to '/dev/xvc[0-9]+'. * [XC_DEFAULT]: DOM0 -> XC_SERIAL ; all others -> XC_TTY. * * NB. In mode XC_TTY, we create dummy consoles for tty2-63. This suppresses * warnings from standard distro startup scripts. */ -static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL } xc_mode = XC_DEFAULT; +static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL, XC_XVC } +xc_mode = XC_DEFAULT; static int xc_num = -1; + +/* If we are in XC_XVC mode (a virtual console at /dev/xvcX), we need to + * comply with Lanana and use a minor under the low density serial major. + */ +#define XEN_XVC_MINOR 187 #ifdef CONFIG_MAGIC_SYSRQ static unsigned long sysrq_requested; @@ -85,6 +92,8 @@ static int __init xencons_setup(char *st xc_mode = XC_SERIAL; else if (!strncmp(str, "tty", 3)) xc_mode = XC_TTY; + else if (!strncmp(str, "xvc", 3)) + xc_mode = XC_XVC; else if (!strncmp(str, "off", 3)) xc_mode = XC_OFF; @@ -95,6 +104,11 @@ static int __init xencons_setup(char *st xc_num = n; break; case XC_TTY: + n = simple_strtol(str+3, &q, 10); + if (q > (str + 3)) + xc_num = n; + break; + case XC_XVC: n = simple_strtol(str+3, &q, 10); if (q > (str + 3)) xc_num = n; @@ -199,6 +213,12 @@ static int __init xen_console_init(void) } switch (xc_mode) { + case XC_XVC: + strcpy(kcons_info.name, "xvc"); + if (xc_num == -1) + xc_num = 0; + break; + case XC_SERIAL: strcpy(kcons_info.name, "ttyS"); if (xc_num == -1) @@ -595,6 +615,11 @@ static int __init xencons_init(void) DRV(xencons_driver)->name= "ttyS"; DRV(xencons_driver)->minor_start = 64 + xc_num; DRV(xencons_driver)->name_base = 0 + xc_num; + } else if (xc_mode == XC_XVC) { + DRV(xencons_driver)->name= "xvc"; + DRV(xencons_driver)->major = LOW_DENS_SERIAL_MAJOR; + DRV(xencons_driver)->minor_start = XEN_XVC_MINOR; + DRV(xencons_driver)->name_base = xc_num; } else { DRV(xencons_driver)->name= "tty"; DRV(xencons_driver)->minor_start = xc_num; diff -r 968ced1469e8 include/linux/major.h --- a/include/linux/major.h Tue Oct 17 17:03:31 2006 -0400 +++ b/include/linux/major.h Mon Oct 23 22:12:03 2006 -0400 @@ -158,6 +158,7 @@ #define MSR_MAJOR 202 #define CPUID_MAJOR203 +#define LOW_DENS_SERIAL_MAJOR 204 #define OSST_MAJOR 206 /* OnStream-SCx0 SCSI tape */ diff -r 968ced1469e8 arch/powerpc/configs/xen_maple_defconfig --- a/arch/powerpc/configs/xen_maple_defconfig Tue Oct 17 17:03:31 2006 -0400 +++ b/arch/powerpc/configs/xen_maple_defconfig Tue Oct 24 10:55:38 2006 -0400 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.17 -# Sat Oct 7 08:37:53 2006 +# Tue Oct 24 10:51:54 2006 # CONFIG_PPC64=y CONFIG_64BIT=y @@ -711,10 +711,18 @@ CONFIG_HW_CONSOLE=y # # Serial drivers # +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_ICOM is not set # CONFIG_SERIAL_JSM is not set CONFIG_UNIX98_PTYS=y @@ -1168,7 +1176,7 @@ CONFIG_XEN_BLKDEV_FRONTEND=y CONFIG_XEN_BLKDEV_FRONTEND=y CONFIG_XEN_NETDEV_FRONTEND=y CONFI