From: "Trolle Selander" Subject: Re: [Xen-staging] [xen-unstable] [QEMU-DM] Upgrade emulated UART to 16550A. Date: Wed, 5 Dec 2007 23:07:20 +0100 Message-ID: <515922b50712051407y2021b363lb659f9645b53a67e@mail.gmail.com> References: <200712051422.lB5EMOK6007392@latara.uk.xensource.com> <1196885729.6509.36.camel@lappy> <515922b50712051230w1876610blb75937b1d224858e@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_4385_20817582.1196892440764" Return-path: In-Reply-To: <515922b50712051230w1876610blb75937b1d224858e@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Alex Williamson Cc: xen-devel List-Id: xen-devel@lists.xenproject.org ------=_Part_4385_20817582.1196892440764 Content-Type: multipart/alternative; boundary="----=_Part_4386_1791570.1196892440764" ------=_Part_4386_1791570.1196892440764 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline This patch fixes the issue. It also changes the name of an inappropriately named timer. Signed-off-by: Trolle Selander On Dec 5, 2007 9:30 PM, Trolle Selander 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 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. > > > > > ------=_Part_4386_1791570.1196892440764 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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.



------=_Part_4386_1791570.1196892440764-- ------=_Part_4385_20817582.1196892440764 Content-Type: text/x-patch; name=xen-qemudm-16550A-limit-retransmit.patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_f9uesc140 Content-Disposition: attachment; filename=xen-qemudm-16550A-limit-retransmit.patch ZGlmZiAtdU5yIHhlbi11bnN0YWJsZS5oZy1wYXRjaGVkL3Rvb2xzL2lvZW11L2h3L3NlcmlhbC5j IHhlbi11bnN0YWJsZS5oZy1wYXRjaGVkMi90b29scy9pb2VtdS9ody9zZXJpYWwuYwotLS0geGVu LXVuc3RhYmxlLmhnLXBhdGNoZWQvdG9vbHMvaW9lbXUvaHcvc2VyaWFsLmMJMjAwNy0xMi0wNiAy Mzo1MDo1OC42NTIwNTQ4ODMgKzAxMDAKKysrIHhlbi11bnN0YWJsZS5oZy1wYXRjaGVkMi90b29s cy9pb2VtdS9ody9zZXJpYWwuYwkyMDA3LTEyLTA3IDAxOjAxOjEzLjIzNjIzMDM0OCArMDEwMApA QCAtOTYsNiArOTYsNyBAQAogCiAjZGVmaW5lIFhNSVRfRklGTyAgICAgICAgICAgMAogI2RlZmlu ZSBSRUNWX0ZJRk8gICAgICAgICAgIDEKKyNkZWZpbmUgTUFYX1hNSVRfUkVUUlkgICAgICA0CiAg CiBzdHJ1Y3QgU2VyaWFsRklGTyB7CiAgICAgdWludDhfdCBkYXRhW1VBUlRfRklGT19MRU5HVEhd OwpAQCAtMTM2LDcgKzEzNyw3IEBACiAKICAgICBzdHJ1Y3QgUUVNVVRpbWVyICpmaWZvX3RpbWVv dXRfdGltZXI7CiAgICAgaW50IHRpbWVvdXRfaXBlbmRpbmc7ICAgICAgICAgICAgICAgICAgIC8q IHRpbWVvdXQgaW50ZXJydXB0IHBlbmRpbmcgc3RhdGUgKi8KLSAgICBzdHJ1Y3QgUUVNVVRpbWVy ICpmaWZvX3RyYW5zbWl0X3RpbWVyOworICAgIHN0cnVjdCBRRU1VVGltZXIgKnRyYW5zbWl0X3Rp bWVyOwogCiAKICAgICB1aW50NjRfdCBjaGFyX3RyYW5zbWl0X3RpbWU7ICAgICAgICAgICAgICAg LyogdGltZSB0byB0cmFuc21pdCBhIGNoYXIgaW4gdGlja3MqLwpAQCAtMzcwLDE1ICszNzEsMTcg QEAKIAogICAgIGlmICggcWVtdV9jaHJfd3JpdGUocy0+Y2hyLCAmcy0+dHNyLCAxKSAhPSAxICkg ewogICAgICAgICBzLT50c3JfcmV0cnkrKzsKLSAgICAgICAgcWVtdV9tb2RfdGltZXIocy0+Zmlm b190cmFuc21pdF90aW1lciwgIG5ld194bWl0X3RzICsgcy0+Y2hhcl90cmFuc21pdF90aW1lICk7 Ci0gICAgICAgIHJldHVybjsKKyAgICAgICAgaWYgKCBzLT50c3JfcmV0cnkgPD0gTUFYX1hNSVRf UkVUUlkgKSB7CisgICAgICAgICAgICBxZW11X21vZF90aW1lcihzLT50cmFuc21pdF90aW1lciwg IG5ld194bWl0X3RzICsgcy0+Y2hhcl90cmFuc21pdF90aW1lICk7CisgICAgICAgICAgICByZXR1 cm47CisgICAgICAgIH0KICAgICB9CiAgCiAgICAgcy0+dHNyX3JldHJ5ID0gMDsKICAgICBzLT5s YXN0X3htaXRfdHMgPSBxZW11X2dldF9jbG9jayh2bV9jbG9jayk7CiAKLSAgICBpZiAoIHMtPnht aXRfZmlmby5jb3VudCA+IDAgKQotICAgICAgICBxZW11X21vZF90aW1lcihzLT5maWZvX3RyYW5z bWl0X3RpbWVyLCBzLT5sYXN0X3htaXRfdHMgKyBzLT5jaGFyX3RyYW5zbWl0X3RpbWUgKTsKKyAg ICBpZiAoICEocy0+bHNyICYgVUFSVF9MU1JfVEhSRSkgKQorICAgICAgICBxZW11X21vZF90aW1l cihzLT50cmFuc21pdF90aW1lciwgcy0+bGFzdF94bWl0X3RzICsgcy0+Y2hhcl90cmFuc21pdF90 aW1lICk7CiAKICAgICBpZiAoIHMtPmxzciAmIFVBUlRfTFNSX1RIUkUgKSB7CiAgICAgICAgIHMt PmxzciB8PSBVQVJUX0xTUl9URU1UOwpAQCAtNzUyLDcgKzc1NSw3IEBACiAgICAgZmlmb19jbGVh cihzLFhNSVRfRklGTyk7CiAgICAgcy0+bGFzdF94bWl0X3RzID0gcWVtdV9nZXRfY2xvY2sodm1f Y2xvY2spOwogICAgIHMtPmZpZm9fdGltZW91dF90aW1lciA9IHFlbXVfbmV3X3RpbWVyKHZtX2Ns b2NrLCAoIFFFTVVUaW1lckNCICopIGZpZm9fdGltZW91dF9pbnQsIHMpOwotICAgIHMtPmZpZm9f dHJhbnNtaXRfdGltZXIgPSBxZW11X25ld190aW1lcih2bV9jbG9jaywgKCBRRU1VVGltZXJDQiAq KSBzZXJpYWxfeG1pdCwgcyk7CisgICAgcy0+dHJhbnNtaXRfdGltZXIgPSBxZW11X25ld190aW1l cih2bV9jbG9jaywgKCBRRU1VVGltZXJDQiAqKSBzZXJpYWxfeG1pdCwgcyk7CiAKICAgICByZWdp c3Rlcl9zYXZldm0oInNlcmlhbCIsIGJhc2UsIDIsIHNlcmlhbF9zYXZlLCBzZXJpYWxfbG9hZCwg cyk7CiAK ------=_Part_4385_20817582.1196892440764 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ------=_Part_4385_20817582.1196892440764--