qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Jiahuan Zhang <jiahuanzhang90@gmail.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Hight Processor time of Socket communciation
Date: Wed, 19 Apr 2017 21:03:13 +0100	[thread overview]
Message-ID: <CAFEAcA-07u6=pCcK-HsqBttwXemZ-c4QCjwc1V76S2r8obsRwg@mail.gmail.com> (raw)
In-Reply-To: <CAJy91Cbo+CQbRMmS-1b32Hf=kgWb22N3htmiuyORW7y-of7Raw@mail.gmail.com>

On 19 April 2017 at 14:34, Jiahuan Zhang <jiahuanzhang90@gmail.com> wrote:
> 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 main characteristic is that the data transfer is over
the standard virtio channel (ie a ring buffer in guest
memory). That's why it's fast.

> 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.

It's a PCI device, it has registers the same way PCI
devices do. (Or for virtio-mmio, it has MMIO registers
like other MMIO devices).

> Without Linux kernel driver, I don't know how to manipulate it.

You can look at the virtio spec if you want to do direct
work with virtio devices. Programming one isn't any
more complicated than any other high-data-transfer
device (like a modern ethernet card, for instance).

> 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.

Well, anything like this is never going to be of interest
to QEMU upstream, because PL011s don't work like that.
Virtio is our answer to "what is the most efficient way
to transfer data from a guest to a host in a virtual
machine", so we don't need to reinvent that wheel.
The chances are that ad-hoc modifications to the PL011
will end up being slower than virtio.

thanks
-- PMM

      reply	other threads:[~2017-04-19 20:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 16:19 [Qemu-devel] Hight Processor time of Socket communciation Jiahuan Zhang
2017-04-18 16:26 ` Peter Maydell
2017-04-19  8:56   ` Jiahuan Zhang
2017-04-19  9:15     ` Peter Maydell
2017-04-19  9:25       ` Jiahuan Zhang
2017-04-19  9:55         ` Peter Maydell
2017-04-19 10:04           ` Jiahuan Zhang
2017-04-19 10:09             ` Peter Maydell
2017-04-19 13:34               ` Jiahuan Zhang
2017-04-19 20:03                 ` Peter Maydell [this message]

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='CAFEAcA-07u6=pCcK-HsqBttwXemZ-c4QCjwc1V76S2r8obsRwg@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=jiahuanzhang90@gmail.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).