All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 14287 followup - console
@ 2007-03-12 20:14 Ben Thomas
  2007-03-13  9:33 ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Thomas @ 2007-03-12 20:14 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

Part of the original submission that resulted in 14287 was to catch
all output to the console/vga. 14287, as committed, only captures
a portion of the console output. The attached patch allows capture of
the rest of the output.

Signed-off-by: Ben Thomas (ben@virtualiron.com)

-b

-- 
------------------------------------------------------------------------
Ben Thomas                                         Virtual Iron Software
bthomas@virtualiron.com                            Tower 1, Floor 2
978-849-1214                                       900 Chelmsford Street
                                                    Lowell, MA 01851

[-- Attachment #2: xen-console.patch --]
[-- Type: text/x-patch, Size: 596 bytes --]

diff -r f136ed65b65a xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Fri Mar 09 14:52:13 2007 -0500
+++ b/xen/drivers/char/console.c	Fri Mar 09 15:17:07 2007 -0500
@@ -328,8 +328,12 @@ static long guest_console_write(XEN_GUES
 
         sercon_puts(kbuf);
 
-        for ( kptr = kbuf; *kptr != '\0'; kptr++ )
+        for ( kptr = kbuf; *kptr != '\0'; kptr++ ) {
             vga_putchar(*kptr);
+            putchar_console_ring(*kptr);
+        }
+
+        send_guest_global_virq(dom0, VIRQ_CON_RING);
 
         guest_handle_add_offset(buffer, kcount);
         count -= kcount;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 14287 followup - console
  2007-03-12 20:14 [PATCH] 14287 followup - console Ben Thomas
@ 2007-03-13  9:33 ` Keir Fraser
  2007-03-13 12:24   ` Ben Thomas
  0 siblings, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2007-03-13  9:33 UTC (permalink / raw)
  To: Ben Thomas, xen-devel

On 12/3/07 20:14, "Ben Thomas" <bthomas@virtualiron.com> wrote:

> Part of the original submission that resulted in 14287 was to catch
> all output to the console/vga. 14287, as committed, only captures
> a portion of the console output. The attached patch allows capture of
> the rest of the output.

The console ring is only for Xen output (and also, as it happens, HVM domU
bootstrap output since bytes output via port 0xe9 also get printk'ed). The
only other useful output would be from dom0, and you can already obtain that
via syslog. By not capturing dom0 output in the console ring we prevent
interactive sessions on the dom0 console from obliterating useful Xen debug
output which we may want to gather later (if we're not running an automatic
gatherer daemon). 

 -- Keir

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 14287 followup - console
  2007-03-13  9:33 ` Keir Fraser
@ 2007-03-13 12:24   ` Ben Thomas
  2007-03-13 13:18     ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Thomas @ 2007-03-13 12:24 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

Hi,

I understand what you're saying; it was one of the considerations
when first putting the patch together some time ago.  The console
ring was used for two reasons:  the primary reason was to get
a more WYSIWYG output.  Two input sources are inherently capable
of getting slightly out of sync (or worse).  The second reason
is that syslog can be expensive.  In the end, the WYSIWYG and
cost resulted in the console ring approach.

Would this be more acceptable if it were selectable ?  That is,
come up with a libxc/sysctl mechanism (which should be pretty
easy) to control the gating of character data to the console ring
fom guest_console_write ?

The capability is pretty useful in remoting the vga output to
another node (and logging it).  It would be nice to find a
way to preserve current behavior (as you note), and also allow
the ability to continue to remote it.

Thanks,
-b




Keir Fraser wrote:
> On 12/3/07 20:14, "Ben Thomas" <bthomas@virtualiron.com> wrote:
> 
>> Part of the original submission that resulted in 14287 was to catch
>> all output to the console/vga. 14287, as committed, only captures
>> a portion of the console output. The attached patch allows capture of
>> the rest of the output.
> 
> The console ring is only for Xen output (and also, as it happens, HVM domU
> bootstrap output since bytes output via port 0xe9 also get printk'ed). The
> only other useful output would be from dom0, and you can already obtain that
> via syslog. By not capturing dom0 output in the console ring we prevent
> interactive sessions on the dom0 console from obliterating useful Xen debug
> output which we may want to gather later (if we're not running an automatic
> gatherer daemon). 
> 
>  -- Keir
> 


-- 
------------------------------------------------------------------------
Ben Thomas                                         Virtual Iron Software
bthomas@virtualiron.com                            Tower 1, Floor 2
978-849-1214                                       900 Chelmsford Street
                                                    Lowell, MA 01851

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 14287 followup - console
  2007-03-13 12:24   ` Ben Thomas
@ 2007-03-13 13:18     ` Keir Fraser
  2007-03-14 12:40       ` Ben Thomas
  0 siblings, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2007-03-13 13:18 UTC (permalink / raw)
  To: Ben Thomas, Keir Fraser; +Cc: xen-devel

On 13/3/07 12:24, "Ben Thomas" <bthomas@virtualiron.com> wrote:

> Two input sources are inherently capable
> of getting slightly out of sync (or worse).  The second reason
> is that syslog can be expensive.  In the end, the WYSIWYG and
> cost resulted in the console ring approach.
> 
> Would this be more acceptable if it were selectable ?  That is,
> come up with a libxc/sysctl mechanism (which should be pretty
> easy) to control the gating of character data to the console ring
> fom guest_console_write ?

You could add a Xen boot parameter.

 -- Keir

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 14287 followup - console
  2007-03-13 13:18     ` Keir Fraser
@ 2007-03-14 12:40       ` Ben Thomas
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Thomas @ 2007-03-14 12:40 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1008 bytes --]

Sounds like a plan...

How about this ?

-b

Keir Fraser wrote:
> On 13/3/07 12:24, "Ben Thomas" <bthomas@virtualiron.com> wrote:
> 
>> Two input sources are inherently capable
>> of getting slightly out of sync (or worse).  The second reason
>> is that syslog can be expensive.  In the end, the WYSIWYG and
>> cost resulted in the console ring approach.
>>
>> Would this be more acceptable if it were selectable ?  That is,
>> come up with a libxc/sysctl mechanism (which should be pretty
>> easy) to control the gating of character data to the console ring
>> fom guest_console_write ?
> 
> You could add a Xen boot parameter.
> 
>  -- Keir
> 


-- 
------------------------------------------------------------------------
Ben Thomas                                         Virtual Iron Software
bthomas@virtualiron.com                            Tower 1, Floor 2
978-849-1214                                       900 Chelmsford Street
                                                    Lowell, MA 01851

[-- Attachment #2: xen-console.patch --]
[-- Type: text/x-patch, Size: 2311 bytes --]

Add boot option to allow console I/O to be placed into ring buffer

This option allows console I/O to be placed into the hypervisor
console ring buffer. When enabled, all output to the console
device will be reflected in the ring buffer.  When disabled (the
default), only hypervisor output is available from the ring
buffer.

Signed-off-by: Ben Thomas (ben@virtualiron.com)

diff -r f183e0a4d0c9 docs/src/user.tex
--- a/docs/src/user.tex	Wed Mar 14 08:32:05 2007 -0400
+++ b/docs/src/user.tex	Wed Mar 14 08:35:11 2007 -0400
@@ -3179,6 +3179,11 @@ editing \path{grub.conf}.
   one of 80x25, 80x28, 80x30, 80x34, 80x43, 80x50, 80x60.
   \item[ keep ] Keep the VGA console even after domain 0 boots.
   \end{description}
+\item [ console\_to\_ring ] Place guest console output into the
+  hypervisor console ring buffer. This is disabled by default.
+  When enabled, both hypervisor output and guest console output
+  is available from the ring buffer. This can be useful for logging
+  and/or remote presentation of console data.
 \item [ sync\_console ] Force synchronous console output. This is
   useful if you system fails unexpectedly before it has sent all
   available output to the console. In most cases Xen will
diff -r f183e0a4d0c9 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Wed Mar 14 08:32:05 2007 -0400
+++ b/xen/drivers/char/console.c	Wed Mar 14 08:32:06 2007 -0400
@@ -48,6 +48,10 @@ static int opt_sync_console;
 static int opt_sync_console;
 boolean_param("sync_console", opt_sync_console);
 
+/* console_to_ring: send guest (incl dom 0) console data to console ring */
+static int opt_console_to_ring;
+boolean_param("console_to_ring", opt_console_to_ring);
+
 #define CONRING_SIZE 16384
 #define CONRING_IDX_MASK(i) ((i)&(CONRING_SIZE-1))
 static char conring[CONRING_SIZE];
@@ -328,8 +332,14 @@ static long guest_console_write(XEN_GUES
 
         sercon_puts(kbuf);
 
-        for ( kptr = kbuf; *kptr != '\0'; kptr++ )
+        for ( kptr = kbuf; *kptr != '\0'; kptr++ ) {
             vga_putchar(*kptr);
+            if (opt_console_to_ring)
+                putchar_console_ring(*kptr);
+        }
+
+        if (opt_console_to_ring)
+            send_guest_global_virq(dom0, VIRQ_CON_RING);
 
         guest_handle_add_offset(buffer, kcount);
         count -= kcount;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-14 12:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-12 20:14 [PATCH] 14287 followup - console Ben Thomas
2007-03-13  9:33 ` Keir Fraser
2007-03-13 12:24   ` Ben Thomas
2007-03-13 13:18     ` Keir Fraser
2007-03-14 12:40       ` Ben Thomas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.