All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Manfred Haertel <Manfred.Haertel@rz-online.de>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] xen: allow 8bit input in Xen serial console
Date: Tue, 28 Jul 2015 18:20:10 +0100	[thread overview]
Message-ID: <55B7B9CA.9000603@citrix.com> (raw)
In-Reply-To: <55B7B5AE.5050801@rz-online.de>

On 28/07/15 18:02, Manfred Haertel wrote:
> The Xen serial console cuts off the most significant bit from input
> characters, so you can't use e.g. German umlauts when logging in to
> the DOM0 Linux system from the serial console.
>
> The following patch fixes that problem.

Thanks for the submission.  However, please sign your patch off, per

http://wiki.xen.org/wiki/Submitting_Xen_Project_Patches#Signing_off_a_patch

>
> --- xen/drivers/char/serial.c.orig    2015-07-28 18:44:49.443889719 +0200
> +++ xen/drivers/char/serial.c    2015-07-28 18:47:10.593728590 +0200
> @@ -66,7 +66,7 @@
>      spin_unlock_irqrestore(&port->rx_lock, flags);
>
>      if ( fn != NULL )
> -        (*fn)(c & 0x7f, regs);
> +        (*fn)(c, regs);
>  }
>
>  void serial_tx_interrupt(struct serial_port *port, struct
> cpu_user_regs *regs)
> @@ -297,7 +297,11 @@
>      } while ( ((handle & SERHND_LO) &&  (c & 0x80)) ||
>                ((handle & SERHND_HI) && !(c & 0x80)) );
>
> -    return c & 0x7f;
> +    if (handle & SERHND_HI)

Please read CODING_STYLE in the root of the tree, but to summarise here,
spaces inside the first level of brackes, so "if ( handle & SERHND_HI
)", and no braces for single statements.

> +    {
> +        c &= 0x7f;
> +    }
> +    return c;

I think in both cases you need to mask out the top bit if either
SERHND_HI or SERHND_LO is set, and leave all 8 bits alone if neither are
set. 

Both of these are opt-in with command line options, so the default
configuration in most cases pass 8-bit characters unmodified.  You
probably also want to patch docs/misc/xen-command-line.markdown to
indicate that choosing the 'H' or 'L' option will prevent the use of
8-bit characters.

~Andrew

      reply	other threads:[~2015-07-28 17:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28 17:02 [PATCH] xen: allow 8bit input in Xen serial console Manfred Haertel
2015-07-28 17:20 ` Andrew Cooper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55B7B9CA.9000603@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Manfred.Haertel@rz-online.de \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.