|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Re: [patch 16/20] XEN-paravirt: Add the Xen virtual console
To: |
Jeremy Fitzhardinge <jeremy@xxxxxxxx> |
Subject: |
[Xen-devel] Re: [patch 16/20] XEN-paravirt: Add the Xen virtual console driver. |
From: |
Alan <alan@xxxxxxxxxxxxxxxxxxx> |
Date: |
Sun, 14 Jan 2007 00:37:52 +0000 |
Cc: |
Andrew Morton <akpm@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Pratt <ian.pratt@xxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Chris Wright <chrisw@xxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxx, Christian Limpach <Christian.Limpach@xxxxxxxxxxxx> |
Delivery-date: |
Sat, 13 Jan 2007 16:26:26 -0800 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxx |
In-reply-to: |
<20070113014648.767777869@xxxxxxxx> |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<20070113014539.408244126@xxxxxxxx> <20070113014648.767777869@xxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
> +#endif
> + tty_insert_flip_char(xencons_tty, buf[i], 0);
Please use the defines like TTY_NORMAL not just 0.
> + if ((xencons_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
> + (xencons_tty->ldisc.write_wakeup != NULL))
> + (xencons_tty->ldisc.write_wakeup)(xencons_tty);
> + }
You are't allowed to derefence and call ldisc methods without
holding the lock. You can replace that chunk with a call to the helper
function tty_wakeup(tty). Small but real race condition otherwise as you
xencons_tty->ldisc may be changing as you call it.
> +static inline int __xencons_put_char(int ch)
> +{
> + char _ch = (char)ch;
> + if ((wp - wc) == wbuf_size)
> + return 0;
> + wbuf[WBUF_MASK(wp++)] = _ch;
> + return 1;
> +}
A lot of very confusing sign stuff here - you turn an int into a char and
put it into a uchar array
> + for (i = 0; i < count; i++)
> + if (!__xencons_put_char(buf[i]))
> + break;
The int coming from a uchar array
Don't think its wrong - just acutely weird and perhaps could be tidier
> +static void xencons_close(struct tty_struct *tty, struct file *filp)
> +{
> + unsigned long flags;
> +
> + mutex_lock(&tty_mutex);
It would be good in future if you could avoid using tty_mutex and use a
private lock. At the moment vt "borrows" it and there are a couple of
incestuous spots but the plan is to eventually fix them and make it
private to tty_io.
Andrew: No objection to this tty stuff being merged provided the bugs
noted above (not worried about the sign stuff) are fixed before it goes
on to Linus.
Alan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [patch 03/20] XEN-paravirt: paravirt: page-table accessors, (continued)
- [Xen-devel] [patch 03/20] XEN-paravirt: paravirt: page-table accessors, Jeremy Fitzhardinge
- [Xen-devel] [patch 05/20] XEN-paravirt: paravirt: reserve fixmap slot, Jeremy Fitzhardinge
- [Xen-devel] [patch 07/20] XEN-paravirt: paravirt shared kernel pmd flag, Jeremy Fitzhardinge
- [Xen-devel] [patch 06/20] XEN-paravirt: remove pgd ctor, Jeremy Fitzhardinge
- [Xen-devel] [patch 12/20] XEN-paravirt: Xen: Add nosegneg capability to the vsyscall page notes, Jeremy Fitzhardinge
- [Xen-devel] [patch 08/20] XEN-paravirt: paravirt pgd allocation alignment, Jeremy Fitzhardinge
- [Xen-devel] [patch 11/20] XEN-paravirt: Add apply_to_page_range() which applies a function to a pte range., Jeremy Fitzhardinge
- [Xen-devel] [patch 10/20] XEN-paravirt: mm lifetime hooks, Jeremy Fitzhardinge
- [Xen-devel] [patch 16/20] XEN-paravirt: Add the Xen virtual console driver., Jeremy Fitzhardinge
- [Xen-devel] [patch 18/20] XEN-paravirt: Add Xen driver utility functions., Jeremy Fitzhardinge
- [Xen-devel] [patch 17/20] XEN-paravirt: Add Xen grant table support, Jeremy Fitzhardinge
- [Xen-devel] [patch 15/20] XEN-paravirt: Xen: core paravirt guest changes, Jeremy Fitzhardinge
- [Xen-devel] [patch 13/20] XEN-paravirt: Xen: Add config options and disable unsupported config options., Jeremy Fitzhardinge
|
|
|
|
|