Alex Williamson
2007-Dec-05 20:15 UTC
[Xen-devel] Re: [Xen-staging] [xen-unstable] [QEMU-DM] Upgrade emulated UART to 16550A.
On Wed, 2007-12-05 at 14:22 +0000, Xen staging patchbot-unstable wrote:> # HG changeset patch > # User Keir Fraser > # Date 1196864460 0 > # Node ID f0ac46de680cc6fe8c91699fdda153b125ae515c > # Parent bf21e00155b7dd76653c5340099ecedac7a7de08 > [QEMU-DM] Upgrade emulated UART to 16550A. > > This patch adds 16550 emulation to qemu-dm. I still consider it a work > in progress, but from my testing, it consistently performs better than > the old code already, sometimes considerably so (on my laptop, dumping > out data over serial from a HVM DomU -> pty in Dom0 was up to 5.3 > times faster than with the old 16450 code). I can consistenly reach > full 115200 baud speeds over physical serial lines when the virtual > device is backed by a phys port, which I never could with the old code. > > There are still some things to be done. I want to add proper error > handling, so that overflow/framing & parity errors on the physical > port get detected and reported by the virtual port. Also, now that > FIFOs are in place, I believe performance could be improved > significantly by putting some code into the hypervisor so that reads & > writes from the FIFOs don''t have to exit into qemu-dm at all. I''m also > reading up on the specs for newer uarts with deeper FIFOs.I notice with this patch that my HVM domain, which specifies serial=pty in the config file, no longer boots without me attaching to the console via xm. Previously it would boot regardless of whether I was attached to the console. Is this change in behavior intentional? Note that I''m testing on ia64 where the HVM firmware spews lots of debug info out onto the serial port. Maybe this new UART model isn''t dropping transmit chars when there''s no client connected as it did before? Thanks, Alex -- Alex Williamson HP Open Source & Linux Org. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Trolle Selander
2007-Dec-05 20:30 UTC
[Xen-devel] Re: [Xen-staging] [xen-unstable] [QEMU-DM] Upgrade emulated UART to 16550A.
As you describe this, it does occur to me as you describe this that serial_xmit() never gives up on trying to retransmit characters out of the FIFO, which isn''t very good for backends like pty''s or pipes. I''ll fix it asap. On Dec 5, 2007 9:15 PM, Alex Williamson <alex.williamson@hp.com> wrote:> > On Wed, 2007-12-05 at 14:22 +0000, Xen staging patchbot-unstable wrote: > > # HG changeset patch > > # User Keir Fraser > > # Date 1196864460 0 > > # Node ID f0ac46de680cc6fe8c91699fdda153b125ae515c > > # Parent bf21e00155b7dd76653c5340099ecedac7a7de08 > > [QEMU-DM] Upgrade emulated UART to 16550A. > > > > This patch adds 16550 emulation to qemu-dm. I still consider it a work > > in progress, but from my testing, it consistently performs better than > > the old code already, sometimes considerably so (on my laptop, dumping > > out data over serial from a HVM DomU -> pty in Dom0 was up to 5.3 > > times faster than with the old 16450 code). I can consistenly reach > > full 115200 baud speeds over physical serial lines when the virtual > > device is backed by a phys port, which I never could with the old code. > > > > There are still some things to be done. I want to add proper error > > handling, so that overflow/framing & parity errors on the physical > > port get detected and reported by the virtual port. Also, now that > > FIFOs are in place, I believe performance could be improved > > significantly by putting some code into the hypervisor so that reads & > > writes from the FIFOs don''t have to exit into qemu-dm at all. I''m also > > reading up on the specs for newer uarts with deeper FIFOs. > > I notice with this patch that my HVM domain, which specifies > serial=pty in the config file, no longer boots without me attaching to > the console via xm. Previously it would boot regardless of whether I > was attached to the console. Is this change in behavior intentional? > Note that I''m testing on ia64 where the HVM firmware spews lots of debug > info out onto the serial port. Maybe this new UART model isn''t dropping > transmit chars when there''s no client connected as it did before? > Thanks, > > Alex > > -- > Alex Williamson HP Open Source & Linux Org. > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Trolle Selander
2007-Dec-05 22:07 UTC
[Xen-devel] Re: [Xen-staging] [xen-unstable] [QEMU-DM] Upgrade emulated UART to 16550A.
This patch fixes the issue. It also changes the name of an inappropriately named timer. Signed-off-by: Trolle Selander <trolle.selander@gmail.com> On Dec 5, 2007 9:30 PM, Trolle Selander <trolle.selander@gmail.com> wrote:> As you describe this, it does occur to me as you describe this that > serial_xmit() never gives up on trying to retransmit characters out of the > FIFO, which isn''t very good for backends like pty''s or pipes. I''ll fix it > asap. > > > On Dec 5, 2007 9:15 PM, Alex Williamson <alex.williamson@hp.com> wrote: > > > > > On Wed, 2007-12-05 at 14:22 +0000, Xen staging patchbot-unstable wrote: > > > # HG changeset patch > > > # User Keir Fraser > > > # Date 1196864460 0 > > > # Node ID f0ac46de680cc6fe8c91699fdda153b125ae515c > > > # Parent bf21e00155b7dd76653c5340099ecedac7a7de08 > > > [QEMU-DM] Upgrade emulated UART to 16550A. > > > > > > This patch adds 16550 emulation to qemu-dm. I still consider it a work > > > in progress, but from my testing, it consistently performs better than > > > > > the old code already, sometimes considerably so (on my laptop, dumping > > > out data over serial from a HVM DomU -> pty in Dom0 was up to 5.3 > > > times faster than with the old 16450 code). I can consistenly reach > > > full 115200 baud speeds over physical serial lines when the virtual > > > device is backed by a phys port, which I never could with the old > > code. > > > > > > There are still some things to be done. I want to add proper error > > > handling, so that overflow/framing & parity errors on the physical > > > port get detected and reported by the virtual port. Also, now that > > > FIFOs are in place, I believe performance could be improved > > > significantly by putting some code into the hypervisor so that reads & > > > writes from the FIFOs don''t have to exit into qemu-dm at all. I''m also > > > reading up on the specs for newer uarts with deeper FIFOs. > > > > I notice with this patch that my HVM domain, which specifies > > serial=pty in the config file, no longer boots without me attaching to > > the console via xm. Previously it would boot regardless of whether I > > was attached to the console. Is this change in behavior intentional? > > Note that I''m testing on ia64 where the HVM firmware spews lots of debug > > info out onto the serial port. Maybe this new UART model isn''t dropping > > > > transmit chars when there''s no client connected as it did before? > > Thanks, > > > > Alex > > > > -- > > Alex Williamson HP Open Source & Linux Org. > > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Alex Williamson
2007-Dec-07 17:21 UTC
[Xen-devel] Re: [Xen-staging] [xen-unstable] [QEMU-DM] Upgrade emulated UART to 16550A.
On Wed, 2007-12-05 at 23:07 +0100, Trolle Selander wrote:> This patch fixes the issue. It also changes the name of an > inappropriately named timer.Hi Trolle, Yes, with this patch, my HVM domain will eventually boot. Unfortunately it takes 2 minutes now to get through all the UART timeouts and get to the firmware menu. Prior to the new 16550A UART driver, it took 10 seconds. I think we need to do something smarter than drop characters after some number of timeouts. We''re doomed to terrible slowness anytime the console is disconnected that way. Thanks, Alex -- Alex Williamson HP Open Source & Linux Org. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-Dec-07 17:43 UTC
[Xen-devel] Re: [Xen-staging] [xen-unstable] [QEMU-DM] Upgrade emulated UART to 16550A.
On 7/12/07 17:21, "Alex Williamson" <alex.williamson@hp.com> wrote:> On Wed, 2007-12-05 at 23:07 +0100, Trolle Selander wrote: >> This patch fixes the issue. It also changes the name of an >> inappropriately named timer. > > Hi Trolle, > > Yes, with this patch, my HVM domain will eventually boot. > Unfortunately it takes 2 minutes now to get through all the UART > timeouts and get to the firmware menu. Prior to the new 16550A UART > driver, it took 10 seconds. I think we need to do something smarter > than drop characters after some number of timeouts. We''re doomed to > terrible slowness anytime the console is disconnected that way. Thanks,Perhaps we should latch the first timeout and fast-drop bursts of characters until the next character that is not immediately rejected? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Trolle Selander
2007-Dec-07 17:51 UTC
[Xen-devel] Re: [Xen-staging] [xen-unstable] [QEMU-DM] Upgrade emulated UART to 16550A.
I''ll look into it further, though I''m a bit puzzled as to why it was faster before - the old code would attempt to retransmit every 100ms, for up to 300ms. That''s a LOT longer than my code will retry at any kind of sane baud-rates. What guest are you running in the HVM? At one point I was considering adding a "backend type" field for the qemu char devices to prevent having to detect if the backend device was a physical port from within serial.c. Perhaps I''ll need to go back to that plan and treat pty''s differently, or simply skip the transmit retries entirely when the backend isn''t a physical serial port. On Dec 7, 2007 6:21 PM, Alex Williamson <alex.williamson@hp.com> wrote:> > On Wed, 2007-12-05 at 23:07 +0100, Trolle Selander wrote: > > This patch fixes the issue. It also changes the name of an > > inappropriately named timer. > > Hi Trolle, > > Yes, with this patch, my HVM domain will eventually boot. > Unfortunately it takes 2 minutes now to get through all the UART > timeouts and get to the firmware menu. Prior to the new 16550A UART > driver, it took 10 seconds. I think we need to do something smarter > than drop characters after some number of timeouts. We''re doomed to > terrible slowness anytime the console is disconnected that way. Thanks, > > Alex > > -- > Alex Williamson HP Open Source & Linux Org. > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Trolle Selander
2007-Dec-07 17:53 UTC
[Xen-devel] Re: [Xen-staging] [xen-unstable] [QEMU-DM] Upgrade emulated UART to 16550A.
That sounds like a workable idea, at least for the non-phys-port case. On Dec 7, 2007 6:43 PM, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:> On 7/12/07 17:21, "Alex Williamson" <alex.williamson@hp.com> wrote: > > > On Wed, 2007-12-05 at 23:07 +0100, Trolle Selander wrote: > >> This patch fixes the issue. It also changes the name of an > >> inappropriately named timer. > > > > Hi Trolle, > > > > Yes, with this patch, my HVM domain will eventually boot. > > Unfortunately it takes 2 minutes now to get through all the UART > > timeouts and get to the firmware menu. Prior to the new 16550A UART > > driver, it took 10 seconds. I think we need to do something smarter > > than drop characters after some number of timeouts. We''re doomed to > > terrible slowness anytime the console is disconnected that way. Thanks, > > Perhaps we should latch the first timeout and fast-drop bursts of > characters > until the next character that is not immediately rejected? > > -- Keir > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Trolle Selander
2007-Dec-07 19:36 UTC
[Xen-devel] Re: [Xen-staging] [xen-unstable] [QEMU-DM] Upgrade emulated UART to 16550A.
Here''s a patch based on Keir''s idea. Let''s hope this resolves the issue. It also includes the termios.h & sys/ioctl.h include fix discussed earlier, since I didn''t see that committed to xen-unstable yet. On Dec 7, 2007 6:53 PM, Trolle Selander <trolle.selander@gmail.com> wrote:> That sounds like a workable idea, at least for the non-phys-port case. > > > On Dec 7, 2007 6:43 PM, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote: > > > On 7/12/07 17:21, "Alex Williamson" < alex.williamson@hp.com> wrote: > > > > > On Wed, 2007-12-05 at 23:07 +0100, Trolle Selander wrote: > > >> This patch fixes the issue. It also changes the name of an > > >> inappropriately named timer. > > > > > > Hi Trolle, > > > > > > Yes, with this patch, my HVM domain will eventually boot. > > > Unfortunately it takes 2 minutes now to get through all the UART > > > timeouts and get to the firmware menu. Prior to the new 16550A UART > > > driver, it took 10 seconds. I think we need to do something smarter > > > than drop characters after some number of timeouts. We''re doomed to > > > terrible slowness anytime the console is disconnected that way. > > Thanks, > > > > Perhaps we should latch the first timeout and fast-drop bursts of > > characters > > until the next character that is not immediately rejected? > > > > -- Keir > > > > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Alex Williamson
2007-Dec-07 20:03 UTC
[Xen-devel] Re: [Xen-staging] [xen-unstable] [QEMU-DM] Upgrade emulated UART to 16550A.
On Fri, 2007-12-07 at 20:36 +0100, Trolle Selander wrote:> Here''s a patch based on Keir''s idea. Let''s hope this resolves the > issue.Great, this seems to work fine. Thanks!> It also includes the termios.h & sys/ioctl.h include fix discussed > earlier, since I didn''t see that committed to xen-unstable yet.This is already in the staging tree, so I only the last 2 chunks of the patch are necessary. Thanks, Alex -- Alex Williamson HP Open Source & Linux Org. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Trolle Selander
2007-Dec-07 20:14 UTC
[Xen-devel] Re: [Xen-staging] [xen-unstable] [QEMU-DM] Upgrade emulated UART to 16550A.
Alright, good to have this resolved. Here''s the patch with only the significant bits, and a signed-off-by line. Signed-off-by: Trolle Selander <trolle.selander@gmail.com> On Dec 7, 2007 9:03 PM, Alex Williamson <alex.williamson@hp.com> wrote:> > On Fri, 2007-12-07 at 20:36 +0100, Trolle Selander wrote: > > Here''s a patch based on Keir''s idea. Let''s hope this resolves the > > issue. > > Great, this seems to work fine. Thanks! > > > It also includes the termios.h & sys/ioctl.h include fix discussed > > earlier, since I didn''t see that committed to xen-unstable yet. > > This is already in the staging tree, so I only the last 2 chunks of > the patch are necessary. Thanks, > > Alex > > > -- > Alex Williamson HP Open Source & Linux Org. > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel