]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
x86/hvm: introduce a define for the debug output IO port
authorRoger Pau Monné <roger.pau@citrix.com>
Wed, 31 Oct 2018 16:58:47 +0000 (17:58 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 31 Oct 2018 16:58:47 +0000 (17:58 +0100)
No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/hvm/hvm.c
xen/drivers/char/console.c
xen/include/public/arch-x86/xen.h

index 42d7a9bd1b10f68d1bacd18509796d676eaa8184..0e9d316b40b55fc7e8bc77d9c0d2bd33610329d0 100644 (file)
@@ -545,7 +545,7 @@ static int hvm_print_line(
     struct domain *cd = current->domain;
     char c = *val;
 
-    ASSERT(bytes == 1 && port == 0xe9);
+    ASSERT(bytes == 1 && port == XEN_HVM_DEBUGCONS_IOPORT);
 
     /* Deny any input requests. */
     if ( dir != IOREQ_WRITE )
@@ -654,7 +654,7 @@ int hvm_domain_initialise(struct domain *d)
 
     rtc_init(d);
 
-    register_portio_handler(d, 0xe9, 1, hvm_print_line);
+    register_portio_handler(d, XEN_HVM_DEBUGCONS_IOPORT, 1, hvm_print_line);
 
     if ( hvm_tsc_scaling_supported )
         d->arch.hvm.tsc_scaling_ratio = hvm_default_tsc_scaling_ratio;
index 5419493dbf045b3418df8027c881c7dbec2aea66..907aa97cd44b37e420ce37585ee84c969ab919f3 100644 (file)
@@ -458,7 +458,7 @@ static inline void xen_console_write_debug_port(const char *buf, size_t len)
     unsigned long tmp;
     asm volatile ( "rep outsb;"
                    : "=&S" (tmp), "=&c" (tmp)
-                   : "0" (buf), "1" (len), "d" (0xe9) );
+                   : "0" (buf), "1" (len), "d" (XEN_HVM_DEBUGCONS_IOPORT) );
 }
 #endif
 
index 69ee4bc40d927b14eba11648c6c39b251d81b0b8..c76622654a22c0a0ca1dcd595ffc85f2c6036b2c 100644 (file)
@@ -346,6 +346,13 @@ struct xen_arch_domainconfig {
 #define XEN_CPUID          XEN_EMULATE_PREFIX "cpuid"
 #endif
 
+/*
+ * Debug console IO port, also called "port E9 hack". Each character written
+ * to this IO port will be printed on the hypervisor console, subject to log
+ * level restrictions.
+ */
+#define XEN_HVM_DEBUGCONS_IOPORT 0xe9
+
 #endif /* __XEN_PUBLIC_ARCH_X86_XEN_H__ */
 
 /*