linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zha Bin <zhabin@linux.alibaba.com>
To: linux-kernel@vger.kernel.org
Cc: mst@redhat.com, jasowang@redhat.com, slp@redhat.com,
	virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org,
	gerry@linux.alibaba.com, zhabin@linux.alibaba.com,
	jing2.liu@linux.intel.com, chao.p.peng@linux.intel.com
Subject: [PATCH v2 0/5] virtio mmio specification enhancement
Date: Mon, 10 Feb 2020 17:05:16 +0800	[thread overview]
Message-ID: <cover.1581305609.git.zhabin@linux.alibaba.com> (raw)

In cloud native environment, we need a lightweight and secure system. It
should benefit from the speed of containers and the security of VM, which
is classified as secure containers. The traditional solution of cloud VM
is Qemu. In fact we don't need to pay for the legacy devices. Currently,
more userspace VMMs, e.g. Qemu, Firecracker, Cloud Hypervisor and Alibaba
Cloud VMM which is called Dragonball, began to pay attention to a
lightweight solution.

The lightweight VMM is suitable to cloud native infrastructure which is
designed for creating secure sandbox to address the requirements of
multi-tenant. Meanwhile, with faster startup time and lower memory
overhead, it makes possible to launch thousands of microVMs on the same
machine. This VMM minimizes the emulation devices and uses virtio-mmio to
get a more lightweight transport layer. The virtio-mmio devices have less
code than virtio-pci, which can decrease boot time and increase deploy
density by customizing kernel such as setting pci=off. From another point
of view, the minimal device can reduce the attack surface.

We have compared the number of files and the lines of code between
virtio-mmio and virio-pci.

				Virtio-PCI	    Virtio-MMIO	
	number of files(Linux)	    161			1
	lines of code(Linux)	    78237		538
	number of files(Qemu)	    24			1
	lines of code(Qemu)	    8952		421

But the current standard virtio-mmio spec has some limitations which is
only support legacy interrupt and will cause performance penalties.

To address such limitation, we proposed to update virtio-mmio spec with
two new feature bits to support MSI interrupt and enhancing notification
mechanism[1], which can achieve the same performance as virtio-pci devices
with only around 600 lines of code.

Here are the performance gain of MSI interrupt in virtio-mmio. Each case is
repeated three times.

        netperf -t TCP_RR -H 192.168.1.36 -l 30 -- -r 32,1024

                Virtio-PCI    Virtio-MMIO   Virtio-MMIO(MSI)
        trans/s     9536        6939            9500
        trans/s     9734        7029            9749
        trans/s     9894        7095            9318

With the virtio spec proposal[1], other VMMs (e.g. Qemu) can also make use
of the new features to get a enhancing performance.

[1] https://lkml.org/lkml/2020/1/21/31

Change Log:
v1->v2
* Change version update to feature bit
* Add mask/unmask support
* Add two MSI sharing/non-sharing modes
* Create generic irq domain for all architectures

Liu Jiang (5):
  virtio-mmio: add notify feature for per-queue
  virtio-mmio: refactor common functionality
  virtio-mmio: create a generic MSI irq domain
  virtio-mmio: add MSI interrupt feature support
  x86: virtio-mmio: support virtio-mmio with MSI for x86

 arch/x86/kernel/apic/msi.c          |  11 +-
 drivers/base/platform-msi.c         |   4 +-
 drivers/virtio/Kconfig              |   9 +
 drivers/virtio/virtio_mmio.c        | 351 ++++++++++++++++++++++++++++++++----
 drivers/virtio/virtio_mmio_common.h |  39 ++++
 drivers/virtio/virtio_mmio_msi.h    | 175 ++++++++++++++++++
 include/linux/msi.h                 |   1 +
 include/uapi/linux/virtio_config.h  |  13 +-
 include/uapi/linux/virtio_mmio.h    |  31 ++++
 9 files changed, 596 insertions(+), 38 deletions(-)
 create mode 100644 drivers/virtio/virtio_mmio_common.h
 create mode 100644 drivers/virtio/virtio_mmio_msi.h

-- 
1.8.3.1


             reply	other threads:[~2020-02-10  9:06 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10  9:05 Zha Bin [this message]
2020-02-10  9:05 ` [PATCH v2 1/5] virtio-mmio: add notify feature for per-queue Zha Bin
2020-02-11 10:50   ` Michael S. Tsirkin
2020-02-11 11:33   ` Michael S. Tsirkin
2020-02-12  3:39     ` Jason Wang
2020-02-12  8:18       ` Michael S. Tsirkin
2020-02-12  8:53         ` Jason Wang
2020-02-12  9:33           ` Jason Wang
2020-02-12  9:55             ` Michael S. Tsirkin
2020-02-13  3:38               ` Jason Wang
2020-02-10  9:05 ` [PATCH v2 2/5] virtio-mmio: refactor common functionality Zha Bin
2020-02-11 11:19   ` Michael S. Tsirkin
2020-02-12  2:58     ` [virtio-dev] " Liu, Jing2
2020-02-12  7:29       ` Michael S. Tsirkin
2020-02-10  9:05 ` [PATCH v2 3/5] virtio-mmio: create a generic MSI irq domain Zha Bin
2020-02-11 11:16   ` Michael S. Tsirkin
2020-02-12  7:40   ` Michael S. Tsirkin
2020-02-10  9:05 ` [PATCH v2 4/5] virtio-mmio: add MSI interrupt feature support Zha Bin
2020-02-11  3:17   ` Jason Wang
2020-02-11  3:35     ` [virtio-dev] " Liu, Jing2
2020-02-11  4:02       ` Jason Wang
     [not found]         ` <5522f205-207b-b012-6631-3cc77dde3bfe@linux.intel.com>
2020-02-11  7:40           ` Jason Wang
2020-02-11 11:58             ` Michael S. Tsirkin
2020-02-11 12:04               ` Jason Wang
2020-02-11 12:08                 ` Michael S. Tsirkin
2020-02-11 12:18                   ` Jason Wang
2020-02-11 14:00                     ` Michael S. Tsirkin
2020-02-12  9:03                       ` Jason Wang
2020-02-12  9:15                         ` Michael S. Tsirkin
     [not found]             ` <4c19292f-9d25-a859-3dde-6dd5a03fdf0b@linux.intel.com>
2020-02-12  7:33               ` Michael S. Tsirkin
2020-02-12  9:06               ` Jason Wang
2020-02-12  9:16                 ` Michael S. Tsirkin
2020-02-13  3:40                   ` Jason Wang
2020-02-11 11:21       ` Michael S. Tsirkin
2020-02-11 11:11   ` Michael S. Tsirkin
2020-02-10  9:05 ` [PATCH v2 5/5] x86: virtio-mmio: support virtio-mmio with MSI for x86 Zha Bin
2020-02-11 11:14   ` Michael S. Tsirkin
2020-02-10 11:44 ` [PATCH v2 0/5] virtio mmio specification enhancement Michael S. Tsirkin
2020-02-11 16:05   ` Chao Peng
2020-02-11 10:57     ` Michael S. Tsirkin
     [not found] <DM6PR11MB4331B490586462DE7353E0B8F9710@DM6PR11MB4331.namprd11.prod.outlook.com>
2020-07-31 10:13 ` Stefan Hajnoczi
2020-07-31 15:44 ` Alex Bennée
2020-08-03 16:19   ` Alex Bennée
2020-08-03 23:31   ` Pincus, Josh

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=cover.1581305609.git.zhabin@linux.alibaba.com \
    --to=zhabin@linux.alibaba.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=gerry@linux.alibaba.com \
    --cc=jasowang@redhat.com \
    --cc=jing2.liu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=slp@redhat.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --subject='Re: [PATCH v2 0/5] virtio mmio specification enhancement' \
    /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

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