Open
Conversation
The standard virtio-mmio devices use notification register to signal backend. This will cause vmexits and slow down the performance when we passthrough the virtio-mmio devices to guest virtual machines. We proposed to update virtio over MMIO spec to add the per-queue notify feature VIRTIO_F_MMIO_NOTIFICATION. It can allow the VMM to configure notify location for each queue. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com> Signed-off-by: Zha Bin <zhabin@linux.alibaba.com> Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com> Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
- bit 39 is not for vring on all transport layer so we need do like what SRIOV does. - priv is changed to notify_addr which seems more explicit, and unify the vm_notify address. Feel free to discuss if you have different idea. Once tested, just squash into previous commit. Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
721bb88 to
2ac726d
Compare
added 6 commits
January 20, 2020 23:10
Common functionality is refactored into virtio_mmio_common.h in order to MSI support in later patch set. Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
Create a generic irq domain for all architectures which supports virtio-mmio. The device offering VIRTIO_F_MMIO_MSI feature bit can use this irq domain. Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
The VIRTIO_F_MMIO_MSI feature bit (40) is used to indicate that device supports MSI for only MMIO transport layer. Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
Userspace VMMs (e.g. Qemu microvm, Firecracker) take advantage of using virtio over mmio devices as a lightweight machine model for modern cloud. The standard virtio over MMIO transport layer only supports one legacy interrupt, which is much heavier than virtio over PCI transport layer using MSI. Legacy interrupt has long work path and causes specific VMExits in following cases, which would considerably slow down the performance: 1) read interrupt status register 2) update interrupt status register 3) write IOAPIC EOI register We proposed to add MSI support for virtio over MMIO via new feature bit VIRTIO_F_MMIO_MSI which increases the interrupt performance for virtio multi-queue devices. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com> Signed-off-by: Zha Bin <zhabin@linux.alibaba.com> Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com> Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
Bit 1 in the return value of reading MsiState register indicates the MSI sharing mode that device uses. Bit 1 is 0: device uses non-sharing and fixed vector per event mapping. Bit 1 is 1: device uses sharing mode and dynamic mapping. For driver implementation, once device uses MSI sharing mode for not a high interrupt rate, let configuration event uses 1 vector and all queues use 1 vector. Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
Virtio-mmio supports a generic MSI irq domain for all archs. This patch adds the x86 architecture support. Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I refactored MSI related code with main changes as follows.
To simply reviewing, I just open the PR into master branch.
Please help test on your side, and re-arrange with previous notify patch set.