All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Subject: Re: VirtioSound device emulation implementation
Date: Sun, 10 Jan 2021 13:55:56 +0530	[thread overview]
Message-ID: <CAAQ-SiO4VvVTo77J2ga1FmUZ9yrwopeASweO6-AFaakrAUZ80w@mail.gmail.com> (raw)
In-Reply-To: <20210108083433.pfzhxrd4rezk6yxe@sirius.home.kraxel.org>

[-- Attachment #1: Type: text/plain, Size: 2253 bytes --]

Hi,

I have been reading about the virtio and vhost specifications, however I
have a few doubts. I tried looking for them but I still
do not understand them clearly enough. From what I understand, there are
two protocols:

The virtio protocol: The one that specifies how we can have common
emulation for virtual devices. The front end drivers
interact with these devices, and these devices could then process the
information that they have received either in QEMU,
or somewhere else. From what I understand the front driver uses mmaps to
communicate with the virtio device.

The vhost protocol: The one that specifies how we can _offload_ the
processing from QEMU to a separate process. We
want to offload so that we do not have to stop the guest when we are
processing information passed to a virtio device. This
service could either be implemented in the host kernel or the host
userspace. Now when we offload the processing, we map the
memory of the device to this vhost service, so that this service has all
the information that it should process.
  Also, this process can generate the vCPU interrupts, and this process
responds to the ioeventfd notifications.

What I do not understand is, once we have this vhost service, either in
userspace or in kernel space, which does the information processing,
why do we need a virtio device still emulated in QEMU? Is it only to pass
on the configurations between the driver and the
vhost service? I know that the vhost service doesn't emulate anything, but
then what is the difference between "processing" the
information and "emulating" a device?

Also, from article[3], moving the vhost-net service to userspace was faster
somehow. I am assuming this was only the case for
networking devices, and would not be true in general. Since there would be
more context switches between user and kernel space?
(KVM receives the irq/ioevent notification and then transfers control back
to user space, as opposed to when vhost was in kernel
space.)

For context, I've been reading the following:
[1]
https://www.redhat.com/en/blog/introduction-virtio-networking-and-vhost-net
[2] https://www.redhat.com/en/blog/deep-dive-virtio-networking-and-vhost-net
[3] https://www.redhat.com/en/blog/journey-vhost-users-realm

[-- Attachment #2: Type: text/html, Size: 2897 bytes --]

  reply	other threads:[~2021-01-10  8:27 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 10:00 VirtioSound device emulation implementation Shreyansh Chouhan
2021-01-06 11:40 ` Alex Bennée
2021-01-07 14:58   ` Shreyansh Chouhan
2021-01-07 15:58     ` Gerd Hoffmann
2021-01-07 17:17     ` Alex Bennée
2021-01-08  7:53       ` Shreyansh Chouhan
2021-01-08  8:34       ` Gerd Hoffmann
2021-01-10  8:25         ` Shreyansh Chouhan [this message]
     [not found]           ` <CAAQ-SiPiq5NQN=2mvP3isZ9PtYO2Bu64kVEvE6T+3OJd5B-U5A@mail.gmail.com>
2021-01-11  6:29             ` Fwd: " Shreyansh Chouhan
2021-01-11 11:59               ` Alex Bennée
2021-01-14 15:00                 ` Shreyansh Chouhan
2021-01-14 17:41                   ` Alex Bennée
2021-01-15  8:00                     ` Shreyansh Chouhan
2021-01-17 10:30                       ` Shreyansh Chouhan
2021-01-18 18:53                         ` Shreyansh Chouhan
2021-01-20 11:41                           ` Shreyansh Chouhan
2021-01-25  6:02                             ` Shreyansh Chouhan
2021-01-25 11:23                               ` Alex Bennée
2021-01-28  4:28                                 ` Shreyansh Chouhan
2021-01-28 10:42                                   ` Alex Bennée
2021-01-28 15:40                                     ` Shreyansh Chouhan
2021-01-28 11:25                                   ` Gerd Hoffmann
2021-01-28 15:50                                     ` Shreyansh Chouhan
2021-01-28 16:30                                       ` Gerd Hoffmann
2021-01-28 17:34                                         ` Shreyansh Chouhan
2021-02-11  4:59                                           ` Shreyansh Chouhan
2021-02-15 14:39                                             ` Gerd Hoffmann
2021-04-04 13:55                                               ` Shreyansh Chouhan
2021-04-16 11:32                                                 ` Gerd Hoffmann
2021-04-19 12:30                                                   ` Shreyansh Chouhan
2021-04-19 12:33                                                     ` Shreyansh Chouhan
2021-04-19 13:10                                                     ` Gerd Hoffmann
     [not found]                                                       ` <CAAQ-SiMf=BV-HUudRayZkRPJjmkYWuiBuKqYHHLzYjcFnPOgLQ@mail.gmail.com>
     [not found]                                                         ` <20210419135627.dlerwnswhfxt6ciz@sirius.home.kraxel.org>
     [not found]                                                           ` <CAAQ-SiM6uWUgHTS5PQ-hSkuXNOoKC7fw6Y1ZHhJ0MCUE3oaBqg@mail.gmail.com>
     [not found]                                                             ` <20210420071304.gmndase3r6mwp5yt@sirius.home.kraxel.org>
     [not found]                                                               ` <CAAQ-SiPPNK0xqnPPSjNZgwQCs+Vj0_A5koq5xK8HzhZKDgqVJw@mail.gmail.com>
2021-12-29  5:52                                                                 ` Shreyansh Chouhan
2022-01-20 10:39                                                                   ` Laurent Vivier
2022-02-07  4:06                                                                     ` Shreyansh Chouhan
2022-02-08 17:26                                                                       ` Shreyansh Chouhan

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=CAAQ-SiO4VvVTo77J2ga1FmUZ9yrwopeASweO6-AFaakrAUZ80w@mail.gmail.com \
    --to=chouhan.shreyansh2702@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=kraxel@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.