From: Roger Pau Monné Date: Wed, 31 Oct 2018 16:58:47 +0000 (+0100) Subject: x86/hvm: introduce a define for the debug output IO port X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d3611dd500bb7cf29a9a5dbf3eb761a31c2724f9;p=people%2Fdariof%2Fxen.git x86/hvm: introduce a define for the debug output IO port No functional change intended. Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich Reviewed-by: Wei Liu --- diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 42d7a9bd1b..0e9d316b40 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -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; diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 5419493dbf..907aa97cd4 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -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 diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h index 69ee4bc40d..c76622654a 100644 --- a/xen/include/public/arch-x86/xen.h +++ b/xen/include/public/arch-x86/xen.h @@ -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__ */ /*