From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0pkk-0008CH-OQ for qemu-devel@nongnu.org; Wed, 19 Apr 2017 09:34:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0pkj-0001qJ-Ml for qemu-devel@nongnu.org; Wed, 19 Apr 2017 09:34:38 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:33427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0pkj-0001qA-HO for qemu-devel@nongnu.org; Wed, 19 Apr 2017 09:34:37 -0400 Received: by mail-qt0-x241.google.com with SMTP id c45so3182371qtb.0 for ; Wed, 19 Apr 2017 06:34:37 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Jiahuan Zhang Date: Wed, 19 Apr 2017 15:34:36 +0200 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] Hight Processor time of Socket communciation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers On 19 April 2017 at 12:09, Peter Maydell wrote: > On 19 April 2017 at 11:04, Jiahuan Zhang wrote: > > Okay. Thank you for pointing this out. > > I would like to make a new serial device based on pl011, > > but containing a buffer for guest-to-host data transfer. > > As I've said, the PL011 is inherently byte at a time. > If you want better than that, I recommend you use virtio-serial, > because it already exists for this purpose. > > thanks > -- PMM > Hi Peter, But from the source code, I found the main characteristic of virtio-serial is that, virtio-serial can create multiple serial ports and each port has a pair of control virt-queues and a pair of guest input/output virt-queues. Its "have_data" callback function enables multi-byte data transfer from guest. And it is not in a tranditional device emulation format. I mean that no exact IO region is emulated for it. Without Linux kernel driver, I don't know how to manipulate it. For the time being, I enable the guest app to send data to the pl011's data register directly via a pointer, as you see that in the code above. This is why I am thinking if adding a transmit buffer in pl011 for guest writing is a feasible alternative. Any suggestion is welcome. Regards, Huan