ia64/xen-unstable

changeset 19064:a0dddcbd9e32

x86, hvm: Limit output debug port to printable characters.

In particular, '\r' was causing output corruption, and it's not
actually needed.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 20 16:41:29 2009 +0000 (2009-01-20)
parents adee46c3fbfa
children 033945166a3a
files xen/arch/x86/hvm/hvm.c
line diff
     1.1 --- a/xen/arch/x86/hvm/hvm.c	Tue Jan 20 15:10:28 2009 +0000
     1.2 +++ b/xen/arch/x86/hvm/hvm.c	Tue Jan 20 16:41:29 2009 +0000
     1.3 @@ -20,6 +20,7 @@
     1.4   */
     1.5  
     1.6  #include <xen/config.h>
     1.7 +#include <xen/ctype.h>
     1.8  #include <xen/init.h>
     1.9  #include <xen/lib.h>
    1.10  #include <xen/trace.h>
    1.11 @@ -273,6 +274,10 @@ static int hvm_print_line(
    1.12  
    1.13      BUG_ON(bytes != 1);
    1.14  
    1.15 +    /* Accept only printable characters, newline, and horizontal tab. */
    1.16 +    if ( !isprint(c) && (c != '\n') && (c != '\t') )
    1.17 +        return X86EMUL_OKAY;
    1.18 +
    1.19      spin_lock(&hd->pbuf_lock);
    1.20      hd->pbuf[hd->pbuf_idx++] = c;
    1.21      if ( (hd->pbuf_idx == (sizeof(hd->pbuf) - 2)) || (c == '\n') )