]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86/guest: use PV console for Xen/Dom0 I/O
authorSergey Dyasli <sergey.dyasli@citrix.com>
Fri, 24 Nov 2017 11:21:17 +0000 (11:21 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 7 Dec 2017 16:40:40 +0000 (16:40 +0000)
Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
docs/misc/xen-command-line.markdown
xen/arch/x86/guest/xen.c
xen/drivers/char/console.c

index 781110d4b2a54c38cad829ea2654888e362deeb0..334adfe35d19a5d5a2a8a5ba148fc6d76691a551 100644 (file)
@@ -365,7 +365,7 @@ The following are examples of correct specifications:
 Specify the size of the console ring buffer.
 
 ### console
-> `= List of [ vga | com1[H,L] | com2[H,L] | dbgp | none ]`
+> `= List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | none ]`
 
 > Default: `console=com1,vga`
 
@@ -381,6 +381,9 @@ the converse; transmitted and received characters will have their MSB
 cleared.  This allows a single port to be shared by two subsystems
 (e.g. console and debugger).
 
+`pv` indicates that Xen should use Xen's PV console. This option is
+only available when used together with `pv-in-pvh`.
+
 `dbgp` indicates that Xen should use a USB debug port.
 
 `none` indicates that Xen should not use a console.  This option only
index 781bfa493bb338584d736c94e80f89725716f73a..0319a5f9e876dd5658ebff6cbccebacb1de55585 100644 (file)
@@ -20,6 +20,7 @@
  */
 #include <xen/init.h>
 #include <xen/types.h>
+#include <xen/pv_console.h>
 
 #include <asm/apic.h>
 #include <asm/guest.h>
@@ -101,6 +102,8 @@ static void xen_evtchn_upcall(struct cpu_user_regs *regs)
     vcpu_info->evtchn_upcall_pending = 0;
     xchg(&vcpu_info->evtchn_pending_sel, 0);
 
+    pv_console_rx(regs);
+
     ack_APIC_irq();
 }
 
index 5882b04cf05cfa010b008f3ac814e474d40f98a0..121b12bba170005387864bda1c4fd721d63c3a55 100644 (file)
@@ -16,6 +16,7 @@
 #include <xen/event.h>
 #include <xen/console.h>
 #include <xen/serial.h>
+#include <xen/pv_console.h>
 #include <xen/softirq.h>
 #include <xen/keyhandler.h>
 #include <xen/guest_access.h>
@@ -339,6 +340,9 @@ static void sercon_puts(const char *s)
         (*serial_steal_fn)(s);
     else
         serial_puts(sercon_handle, s);
+
+    /* Copy all serial output into PV console */
+    pv_console_puts(s);
 }
 
 static void dump_console_ring_key(unsigned char key)
@@ -789,7 +793,9 @@ void __init console_init_preirq(void)
     {
         if ( *p == ',' )
             p++;
-        if ( !strncmp(p, "vga", 3) )
+        if ( !strncmp(p, "pv", 2) )
+            pv_console_init();
+        else if ( !strncmp(p, "vga", 3) )
             video_init();
         else if ( !strncmp(p, "xen", 3) )
             opt_console_xen = true;
@@ -812,6 +818,7 @@ void __init console_init_preirq(void)
     }
 
     serial_set_rx_handler(sercon_handle, serial_rx);
+    pv_console_set_rx_handler(serial_rx);
 
     /* HELLO WORLD --- start-of-day banner text. */
     spin_lock(&console_lock);
@@ -864,6 +871,7 @@ void __init console_init_ring(void)
 void __init console_init_postirq(void)
 {
     serial_init_postirq();
+    pv_console_init_postirq();
 
     if ( conring != _conring )
         return;