What is the plan for the future of the Xen virtual console driver? Will it continue to hijack /dev/ttyS0 or get its own device like /dev/xencons? The reason I ask is that I need a single Linux kernel binary, including one with builtin console=X command line arguments, to run on bare hardware and as a dom0 under Xen. Xen''s current approach is to disable the physical serial port drivers in the Linux .config, which I need enabled to run properly on bare JS21 blades. I am currently using the below patch, but would really prefer not to. It''s basic approach is to have the Xen virtual console driver react "gracefully" in the case that a real serial driver has already registered ttyS0-ttyS3. It''s current behavior is to fail if the 8250 driver was initialized ahead of it, and console is lost. In the process I found a bug in Linux, and have included the patch for it since otherwise the Xen driver initialization will succeed but with negative side effects in the kobject subsystem. What is the story? --- diff -r 17aa29a18b08 arch/powerpc/configs/xen_maple_defconfig --- a/arch/powerpc/configs/xen_maple_defconfig Thu Jul 27 18:57:20 2006 -0400 +++ b/arch/powerpc/configs/xen_maple_defconfig Mon Jul 31 21:04:17 2006 -0400 @@ -704,10 +704,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 @@ -1307,7 +1315,7 @@ CONFIG_XEN_BLKDEV_FRONTEND=y CONFIG_XEN_BLKDEV_FRONTEND=y CONFIG_XEN_NETDEV_FRONTEND=y CONFIG_XEN_SCRUB_PAGES=y -CONFIG_XEN_DISABLE_SERIAL=y +# CONFIG_XEN_DISABLE_SERIAL is not set CONFIG_XEN_SYSFS=y # CONFIG_XEN_COMPAT_030002_AND_LATER is not set CONFIG_XEN_COMPAT_LATEST_ONLY=y diff -r 17aa29a18b08 drivers/xen/console/console.c --- a/drivers/xen/console/console.c Thu Jul 27 18:57:20 2006 -0400 +++ b/drivers/xen/console/console.c Mon Jul 31 21:04:17 2006 -0400 @@ -70,6 +70,7 @@ */ static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL } xc_mode = XC_DEFAULT; static int xc_num = -1; +enum { XC_NUM_MAX = 8 }; #ifdef CONFIG_MAGIC_SYSRQ static unsigned long sysrq_requested; @@ -576,6 +577,7 @@ static int __init xencons_init(void) xencons_ring_init(); +retry: xencons_driver = alloc_tty_driver((xc_mode == XC_SERIAL) ? 1 : MAX_NR_CONSOLES); if (xencons_driver == NULL) @@ -612,6 +614,15 @@ static int __init xencons_init(void) DRV(xencons_driver)->name_base); put_tty_driver(xencons_driver); xencons_driver = NULL; + + /* Somebody, almost certainly the real serial port + driver, registered ahead of us, so find the first + unused minor. */ + if (xc_num <= XC_NUM_MAX) { + xc_num++; + goto retry; + } + return rc; } diff -r 17aa29a18b08 fs/char_dev.c --- a/fs/char_dev.c Thu Jul 27 18:57:20 2006 -0400 +++ b/fs/char_dev.c Mon Jul 31 21:04:17 2006 -0400 @@ -111,10 +111,13 @@ __register_chrdev_region(unsigned int ma for (cp = &chrdevs[i]; *cp; cp = &(*cp)->next) if ((*cp)->major > major || - ((*cp)->major == major && (*cp)->baseminor >= baseminor)) + ((*cp)->major == major && + (((*cp)->baseminor >= baseminor) || + ((*cp)->baseminor + (*cp)->minorct > baseminor)))) break; if (*cp && (*cp)->major == major && - (*cp)->baseminor < baseminor + minorct) { + (((*cp)->baseminor < baseminor + minorct) || + ((*cp)->baseminor + (*cp)->minorct > baseminor))) { ret = -EBUSY; goto out; } _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> I am currently using the below patch, but would really prefer not to. > It''s basic approach is to have the Xen virtual console driver react > "gracefully" in the case that a real serial driver has already > registered ttyS0-ttyS3. It''s current behavior is to fail if the 8250 > driver was initialized ahead of it, and console is lost. In theprocess> I found a bug in Linux, and have included the patch for it since > otherwise the Xen driver initialization will succeed but with negative > side effects in the kobject subsystem.It would certainly be good to split the linux bug fix out and submit it upstream, and put it in our patches directory in the meantime. Grabbing the next free minor aint pretty, but I agree its an improvement. Ian> What is the story? > > --- > > diff -r 17aa29a18b08 arch/powerpc/configs/xen_maple_defconfig > --- a/arch/powerpc/configs/xen_maple_defconfig Thu Jul 2718:57:20 2006 -> 0400 > +++ b/arch/powerpc/configs/xen_maple_defconfig Mon Jul 3121:04:17 2006 -> 0400 > @@ -704,10 +704,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 > @@ -1307,7 +1315,7 @@ CONFIG_XEN_BLKDEV_FRONTEND=y > CONFIG_XEN_BLKDEV_FRONTEND=y > CONFIG_XEN_NETDEV_FRONTEND=y > CONFIG_XEN_SCRUB_PAGES=y > -CONFIG_XEN_DISABLE_SERIAL=y > +# CONFIG_XEN_DISABLE_SERIAL is not set > CONFIG_XEN_SYSFS=y > # CONFIG_XEN_COMPAT_030002_AND_LATER is not set > CONFIG_XEN_COMPAT_LATEST_ONLY=y > diff -r 17aa29a18b08 drivers/xen/console/console.c > --- a/drivers/xen/console/console.c Thu Jul 27 18:57:20 2006 -0400 > +++ b/drivers/xen/console/console.c Mon Jul 31 21:04:17 2006 -0400 > @@ -70,6 +70,7 @@ > */ > static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL } xc_mode > XC_DEFAULT; > static int xc_num = -1; > +enum { XC_NUM_MAX = 8 }; > > #ifdef CONFIG_MAGIC_SYSRQ > static unsigned long sysrq_requested; > @@ -576,6 +577,7 @@ static int __init xencons_init(void) > > xencons_ring_init(); > > +retry: > xencons_driver = alloc_tty_driver((xc_mode == XC_SERIAL) ? > 1 : MAX_NR_CONSOLES); > if (xencons_driver == NULL) > @@ -612,6 +614,15 @@ static int __init xencons_init(void) > DRV(xencons_driver)->name_base); > put_tty_driver(xencons_driver); > xencons_driver = NULL; > + > + /* Somebody, almost certainly the real serial port > + driver, registered ahead of us, so find the first > + unused minor. */ > + if (xc_num <= XC_NUM_MAX) { > + xc_num++; > + goto retry; > + } > + > return rc; > } > > diff -r 17aa29a18b08 fs/char_dev.c > --- a/fs/char_dev.c Thu Jul 27 18:57:20 2006 -0400 > +++ b/fs/char_dev.c Mon Jul 31 21:04:17 2006 -0400 > @@ -111,10 +111,13 @@ __register_chrdev_region(unsigned int ma > > for (cp = &chrdevs[i]; *cp; cp = &(*cp)->next) > if ((*cp)->major > major || > - ((*cp)->major == major && (*cp)->baseminor >baseminor)) > + ((*cp)->major == major && > + (((*cp)->baseminor >= baseminor) || > + ((*cp)->baseminor + (*cp)->minorct > baseminor)))) > break; > if (*cp && (*cp)->major == major && > - (*cp)->baseminor < baseminor + minorct) { > + (((*cp)->baseminor < baseminor + minorct) || > + ((*cp)->baseminor + (*cp)->minorct > baseminor))) { > ret = -EBUSY; > goto out; > } > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 2 Aug 2006, at 22:42, Amos Waterland wrote:> I am currently using the below patch, but would really prefer not to. > It''s basic approach is to have the Xen virtual console driver react > "gracefully" in the case that a real serial driver has already > registered ttyS0-ttyS3. It''s current behavior is to fail if the 8250 > driver was initialized ahead of it, and console is lost. In the > process > I found a bug in Linux, and have included the patch for it since > otherwise the Xen driver initialization will succeed but with negative > side effects in the kobject subsystem. > > What is the story?We need to obtain our own device number and then patch the driver. It''d be great if someone else wants to look into this. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Amos Waterland
2006-Aug-03 23:07 UTC
[Xen-devel] [PATCH] Virtual console driver on /dev/xvc0
On Thu, Aug 03, 2006 at 09:01:15AM +0100, Keir Fraser wrote:> On 2 Aug 2006, at 22:42, Amos Waterland wrote: > > I am currently using the below patch, but would really prefer not > > to. It''s basic approach is to have the Xen virtual console driver > > react "gracefully" in the case that a real serial driver has already > > registered ttyS0-ttyS3. It''s current behavior is to fail if the > > 8250 driver was initialized ahead of it, and console is lost. In > > the process I found a bug in Linux, and have included the patch for > > it since otherwise the Xen driver initialization will succeed but > > with negative side effects in the kobject subsystem. > > > > What is the story? > > We need to obtain our own device number and then patch the driver. It''d > be great if someone else wants to look into this. > > -- KeirThe below is the least invasive approach I can find, and works well on my PPC64 blades: I can boot the exact same kernel on bare hardware and as a dom0. I am sure there will be distro concerns (such as /etc/inittab and /etc/securetty), but I''d like to get the ball rolling with this initial submission. Note that you have to put `xencons=xvc0'' in your Linux .config, and run `mknod /dev/xvc0 c 232 0'' in your rootfs. Signed-off-by: Amos Waterland <apw@us.ibm.com> --- drivers/xen/console/console.c | 19 +++++++++++++++++-- include/linux/major.h | 2 ++ 2 files changed, 19 insertions(+), 2 deletions(-) diff -r 17aa29a18b08 drivers/xen/console/console.c --- a/drivers/xen/console/console.c Thu Jul 27 18:57:20 2006 -0400 +++ b/drivers/xen/console/console.c Thu Aug 03 18:57:28 2006 -0400 @@ -63,12 +63,14 @@ * ''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; #ifdef CONFIG_MAGIC_SYSRQ @@ -85,6 +87,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; @@ -192,7 +196,7 @@ static int __init xen_console_init(void) if (xc_mode == XC_DEFAULT) xc_mode = XC_SERIAL; kcons_info.write = kcons_write_dom0; - if (xc_mode == XC_SERIAL) + if (xc_mode == XC_SERIAL || xc_mode == XC_XVC) kcons_info.flags |= CON_ENABLED; } else { if (xc_mode == XC_DEFAULT) @@ -201,6 +205,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) @@ -597,6 +607,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 = XEN_VIRTUAL_CONSOLE; + DRV(xencons_driver)->minor_start = 0; + DRV(xencons_driver)->name_base = 0; } else { DRV(xencons_driver)->name = "tty"; DRV(xencons_driver)->minor_start = xc_num; diff -r 17aa29a18b08 include/linux/major.h --- a/include/linux/major.h Thu Jul 27 18:57:20 2006 -0400 +++ b/include/linux/major.h Thu Aug 03 18:57:28 2006 -0400 @@ -166,4 +166,6 @@ #define VIOTAPE_MAJOR 230 +#define XEN_VIRTUAL_CONSOLE 232 + #endif _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Aug-04 07:55 UTC
[Xen-devel] Re: [PATCH] Virtual console driver on /dev/xvc0
On 4 Aug 2006, at 00:07, Amos Waterland wrote:> The below is the least invasive approach I can find, and works well on > my PPC64 blades: I can boot the exact same kernel on bare hardware and > as a dom0. I am sure there will be distro concerns (such as > /etc/inittab and /etc/securetty), but I''d like to get the ball rolling > with this initial submission. > > Note that you have to put `xencons=xvc0'' in your Linux .config, and run > `mknod /dev/xvc0 c 232 0'' in your rootfs. > > Signed-off-by: Amos Waterland <apw@us.ibm.com>How did you pick the major? Is there a process for allocating one (I think our bklock-device major is now official)? Could we use a more dynamic (e.g., udev-based) scheme to avoid locking down 1/256th of the 8-bit major space for this? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jimi Xenidis
2006-Aug-04 13:01 UTC
Re: [Xen-devel] [PATCH] Virtual console driver on /dev/xvc0
On Aug 3, 2006, at 7:07 PM, Amos Waterland wrote:> > The below is the least invasive approach I can find, and works well on > my PPC64 blades: I can boot the exact same kernel on bare hardware and > as a dom0. I am sure there will be distro concerns (such as > /etc/inittab and /etc/securetty), but I''d like to get the ball rolling > with this initial submission.Most modern distros are getty''ing /dev/console, and your logic wires that up correctly. So for recent kernels I do not see why we would want to maintain the older ones. Kier, perhaps we can make this: - CONFIG_XEN_XVC=y to make it the default - CONFIG_XEN_XVC_ONLY=y and depricate the ttySn and ttyn And any distro that is broken by XVC can keep the backward compat. -JX _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Katz
2006-Aug-04 14:23 UTC
Re: [Xen-devel] Re: [PATCH] Virtual console driver on /dev/xvc0
On Fri, 2006-08-04 at 08:55 +0100, Keir Fraser wrote:> On 4 Aug 2006, at 00:07, Amos Waterland wrote: > > > The below is the least invasive approach I can find, and works well on > > my PPC64 blades: I can boot the exact same kernel on bare hardware and > > as a dom0. I am sure there will be distro concerns (such as > > /etc/inittab and /etc/securetty), but I''d like to get the ball rolling > > with this initial submission. > > > > Note that you have to put `xencons=xvc0'' in your Linux .config, and run > > `mknod /dev/xvc0 c 232 0'' in your rootfs. > > > > Signed-off-by: Amos Waterland <apw@us.ibm.com> > > How did you pick the major? Is there a process for allocating one (I > think our bklock-device major is now official)? Could we use a more > dynamic (e.g., udev-based) scheme to avoid locking down 1/256th of the > 8-bit major space for this?The instructions for getting a major are available at http://www.lanana.org/docs/device-list/instructions.txt and the official list of majors/minors is at http://www.lanana.org/docs/device-list/devices-2.6+.txt. char major 232 is already taken for biometrics. There''s no reason that we shouldn''t be able to get a minor (or a couple, if it makes more sense to have more than one xvc device in some case) char devices in the low-density serial console region (char major 204) Jeremy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Aug-04 14:31 UTC
Re: [Xen-devel] Re: [PATCH] Virtual console driver on /dev/xvc0
On 4/8/06 3:23 pm, "Jeremy Katz" <katzj@redhat.com> wrote:>> How did you pick the major? Is there a process for allocating one (I >> think our bklock-device major is now official)? Could we use a more >> dynamic (e.g., udev-based) scheme to avoid locking down 1/256th of the >> 8-bit major space for this? > > The instructions for getting a major are available at > http://www.lanana.org/docs/device-list/instructions.txt and the official > list of majors/minors is at > http://www.lanana.org/docs/device-list/devices-2.6+.txt. > > char major 232 is already taken for biometrics. There''s no reason that > we shouldn''t be able to get a minor (or a couple, if it makes more sense > to have more than one xvc device in some case) char devices in the > low-density serial console region (char major 204)That page makes it sound like the static allocation of device numbers is obsolete. Is there some preferred dynamic method now? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Katz
2006-Aug-04 14:34 UTC
Re: [Xen-devel] Re: [PATCH] Virtual console driver on /dev/xvc0
On Fri, 2006-08-04 at 15:31 +0100, Keir Fraser wrote:> On 4/8/06 3:23 pm, "Jeremy Katz" <katzj@redhat.com> wrote: > >> How did you pick the major? Is there a process for allocating one (I > >> think our bklock-device major is now official)? Could we use a more > >> dynamic (e.g., udev-based) scheme to avoid locking down 1/256th of the > >> 8-bit major space for this? > > > > The instructions for getting a major are available at > > http://www.lanana.org/docs/device-list/instructions.txt and the official > > list of majors/minors is at > > http://www.lanana.org/docs/device-list/devices-2.6+.txt. > > > > char major 232 is already taken for biometrics. There''s no reason that > > we shouldn''t be able to get a minor (or a couple, if it makes more sense > > to have more than one xvc device in some case) char devices in the > > low-density serial console region (char major 204) > > That page makes it sound like the static allocation of device numbers is > obsolete. Is there some preferred dynamic method now?Using udev or similar is the way of doing things dynamically. But there are still a number of areas where static major/minor is strongly desirable and consoles are one of those areas. Jeremy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Amos Waterland
2006-Aug-04 17:15 UTC
[Xen-devel] [PATCH] Virtual console driver on /dev/xvc0 (take two)
Use the low-density serial console major and the next free minor according to the Lanana. Since it would be awkward to say ''xencons=xvc187'', use name_base to allow /dev/xvc0 to be major/minor 204/187. To use, put `xencons=xvc0'' in your Linux .config, 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 <apw@us.ibm.com> --- drivers/xen/console/console.c | 29 +++++++++++++++++++++++++++-- include/linux/major.h | 1 + 2 files changed, 28 insertions(+), 2 deletions(-) diff -r 17aa29a18b08 drivers/xen/console/console.c --- a/drivers/xen/console/console.c Thu Jul 27 18:57:20 2006 -0400 +++ b/drivers/xen/console/console.c Fri Aug 04 13:04:06 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; @@ -192,7 +206,7 @@ static int __init xen_console_init(void) if (xc_mode == XC_DEFAULT) xc_mode = XC_SERIAL; kcons_info.write = kcons_write_dom0; - if (xc_mode == XC_SERIAL) + if (xc_mode == XC_SERIAL || xc_mode == XC_XVC) kcons_info.flags |= CON_ENABLED; } else { if (xc_mode == XC_DEFAULT) @@ -201,6 +215,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) @@ -597,6 +617,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 17aa29a18b08 include/linux/major.h --- a/include/linux/major.h Thu Jul 27 18:57:20 2006 -0400 +++ b/include/linux/major.h Fri Aug 04 13:04:06 2006 -0400 @@ -158,6 +158,7 @@ #define MSR_MAJOR 202 #define CPUID_MAJOR 203 +#define LOW_DENS_SERIAL_MAJOR 204 #define OSST_MAJOR 206 /* OnStream-SCx0 SCSI tape */ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Katz
2006-Aug-04 17:21 UTC
Re: [Xen-devel] [PATCH] Virtual console driver on /dev/xvc0 (take two)
On Fri, 2006-08-04 at 13:15 -0400, Amos Waterland wrote:> Use the low-density serial console major and the next free minor > according to the Lanana. Since it would be awkward to say > ''xencons=xvc187'', use name_base to allow /dev/xvc0 to be > major/minor 204/187.Please go through the process of sending mail to lanana and getting an officially assigned number. Once that''s done and it''s being used, this should be okay but not before. Jeremy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jimi Xenidis
2006-Aug-04 17:22 UTC
[Xen-devel] Re: [PATCH] Virtual console driver on /dev/xvc0 (take two)
On Aug 4, 2006, at 1:15 PM, Amos Waterland wrote:> > diff -r 17aa29a18b08 drivers/xen/console/console.c > --- a/drivers/xen/console/console.c Thu Jul 27 18:57:20 2006 -0400 > +++ b/drivers/xen/console/console.c Fri Aug 04 13:04:06 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.Can''t we switch the DomU''s to XVC as well? -JX _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Katz
2006-Aug-04 17:37 UTC
[Xen-devel] Re: [PATCH] Virtual console driver on /dev/xvc0 (take two)
On Fri, 2006-08-04 at 13:22 -0400, Jimi Xenidis wrote:> On Aug 4, 2006, at 1:15 PM, Amos Waterland wrote: > > diff -r 17aa29a18b08 drivers/xen/console/console.c > > --- a/drivers/xen/console/console.c Thu Jul 27 18:57:20 2006 -0400 > > +++ b/drivers/xen/console/console.c Fri Aug 04 13:04:06 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. > > Can''t we switch the DomU''s to XVC as well?I would expect that''s what we want to do. At which point, the current xenconsole should behave like a serial console (stop taking over /dev/tty*, etc) and we can hopefully have the xenfb stuff to provide a more full-featured console for domUs Jeremy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Amos Waterland
2006-Aug-04 17:37 UTC
Re: [Xen-devel] [PATCH] Virtual console driver on /dev/xvc0 (take two)
On Fri, Aug 04, 2006 at 01:21:39PM -0400, Jeremy Katz wrote:> On Fri, 2006-08-04 at 13:15 -0400, Amos Waterland wrote: > > Use the low-density serial console major and the next free minor > > according to the Lanana. Since it would be awkward to say > > ''xencons=xvc187'', use name_base to allow /dev/xvc0 to be > > major/minor 204/187. > > Please go through the process of sending mail to lanana and getting an > officially assigned number. Once that''s done and it''s being used, this > should be okay but not before.I can send this to device@lanana.org. Keir, is this all right with you? --- The Xen virtual console driver would like to request the following. 204 char Low-density serial ports 187 = /dev/xvc0 Xen virtual console device _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Aug-04 19:21 UTC
[Xen-devel] Re: [PATCH] Virtual console driver on /dev/xvc0 (take two)
On 4/8/06 6:15 pm, "Amos Waterland" <apw@us.ibm.com> wrote:> Use the low-density serial console major and the next free minor > according to the Lanana. Since it would be awkward to say > ''xencons=xvc187'', use name_base to allow /dev/xvc0 to be > major/minor 204/187. > > To use, put `xencons=xvc0'' in your Linux .config, 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 <apw@us.ibm.com>It''d be polite to email Lanana and request the minor to be allocated for us. Could you do that, please? Apart from that the patch looks fine to me, but I think we should wait for the major/minor to be allocated before we apply it. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Aug-04 19:23 UTC
[Xen-devel] Re: [PATCH] Virtual console driver on /dev/xvc0 (take two)
On 4/8/06 6:22 pm, "Jimi Xenidis" <jimix@watson.ibm.com> wrote:>> diff -r 17aa29a18b08 drivers/xen/console/console.c >> --- a/drivers/xen/console/console.c Thu Jul 27 18:57:20 2006 -0400 >> +++ b/drivers/xen/console/console.c Fri Aug 04 13:04:06 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. > > > Can''t we switch the DomU''s to XVC as well?Once the patch is applied and tested out, making xvc the default (or maybe the only choice) probably does make sense. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Aug-04 19:23 UTC
Re: [Xen-devel] [PATCH] Virtual console driver on /dev/xvc0 (take two)
On 4/8/06 6:37 pm, "Amos Waterland" <apw@us.ibm.com> wrote:>> Please go through the process of sending mail to lanana and getting an >> officially assigned number. Once that''s done and it''s being used, this >> should be okay but not before. > > I can send this to device@lanana.org. Keir, is this all right with you?Yes, please! -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel