All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Sarah Newman <srn@prgmr.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 8/9] xen/consoled: discard NUL from guest
Date: Fri, 19 Jan 2018 15:25:28 +0000	[thread overview]
Message-ID: <20180119152528.iehyehmjoffvcjqg@citrix.com> (raw)
In-Reply-To: <20180119110302.x7fm2txqjqqamfyi@MacBook-Pro-de-Roger.local>

On Fri, Jan 19, 2018 at 11:03:02AM +0000, Roger Pau Monné wrote:
> On Thu, Jan 18, 2018 at 06:16:51PM +0000, Wei Liu wrote:
> > According to [0], some program sends NUL for padding purpose. We can
> > discard them.
> > 
> > https://www.gnu.org/software/termutils/manual/termcap-1.3/html_mono/termcap.html#SEC7
> > 
> > Reported-by: Sarah Newman <srn@prgmr.com>
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> 
> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Although I have a suggestion below.
> 
> > ---
> > Cc: Sarah Newman <srn@prgmr.com>
> > Cc: Jan Beulich <jbeulich@suse.com>
> > Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > 
> > A bit RFC. Awaiting test results.
> > ---
> >  xen/drivers/char/consoled.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/xen/drivers/char/consoled.c b/xen/drivers/char/consoled.c
> > index 552abf5766..6fcb2aa115 100644
> > --- a/xen/drivers/char/consoled.c
> > +++ b/xen/drivers/char/consoled.c
> > @@ -72,7 +72,9 @@ size_t consoled_guest_rx(void)
> >      {
> >          char c = cons_ring->out[MASK_XENCONS_IDX(cons++, cons_ring->out)];
> 
> You could also do:
> 
> if ( c == '\0' )
>     continue;
> 
> recv AFAICT it's just a cosmetic return value that's not consumed by
> the caller. This avoids checking the "idx >= BUF_SZ" condition with
> the same idx value.
> 

I would like to keep the increment of recv but I like the idea of not
repeatedly checking idx. I will rearrange the code a bit.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-01-19 15:25 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 18:16 [PATCH 0/9] Fix and improvements to pvshim Wei Liu
2018-01-18 18:16 ` [PATCH 1/9] Update shim.config Wei Liu
2018-01-18 18:26   ` Andrew Cooper
2018-01-18 18:28     ` Wei Liu
2018-01-18 18:30       ` Andrew Cooper
2018-01-19 10:16         ` Roger Pau Monné
2018-01-18 18:16 ` [PATCH 2/9] libxl: remove whitespaces introduced in 62982da926 Wei Liu
2018-01-19 10:18   ` Roger Pau Monné
2018-01-18 18:16 ` [PATCH 3/9] x86/guest: clean up guest/xen.h Wei Liu
2018-01-18 18:26   ` Andrew Cooper
2018-01-19 10:21   ` Roger Pau Monné
2018-01-19 12:22     ` Wei Liu
2018-01-19 12:29       ` Roger Pau Monné
2018-01-19 12:34         ` Wei Liu
2018-01-18 18:16 ` [PATCH 4/9] Remove sched=null from shim cmdline and doc Wei Liu
2018-01-18 18:27   ` Andrew Cooper
2018-01-19 10:28   ` Roger Pau Monné
2018-01-19 11:40     ` Wei Liu
2018-01-18 18:16 ` [PATCH 5/9] x86: relocate pvh_info Wei Liu
2018-01-19 10:07   ` Jan Beulich
2018-01-19 10:10   ` Andrew Cooper
2018-01-19 10:20     ` Jan Beulich
2018-01-19 10:53   ` Roger Pau Monné
2018-01-19 11:48     ` Jan Beulich
2018-01-18 18:16 ` [PATCH 6/9] Revert "x86/boot: Map more than the first 16MB" Wei Liu
2018-01-19 10:07   ` Jan Beulich
2018-01-18 18:16 ` [PATCH 7/9] libxl: lower shim related message to level info Wei Liu
2018-01-19 10:57   ` Roger Pau Monné
2018-01-18 18:16 ` [PATCH 8/9] xen/consoled: discard NUL from guest Wei Liu
2018-01-19 11:03   ` Roger Pau Monné
2018-01-19 15:25     ` Wei Liu [this message]
2018-01-18 18:16 ` [PATCH 9/9] x86/shim: pass through vcpu runstate to L0 Xen Wei Liu
2018-01-19 11:18   ` Roger Pau Monné
2018-01-19 15:18     ` Wei Liu

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=20180119152528.iehyehmjoffvcjqg@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=srn@prgmr.com \
    --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.