New issue
Advanced search Search tips

Issue 854766 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 16
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Convert virtio devices to PCI

Project Member Reported by dgreid@chromium.org, Jun 20 2018

Issue description

Now that we have PCI devices, convert the virtio devices to use that instead of MMIO plus command line args.
 

Comment 1 by vapier@chromium.org, Jun 21 2018

Components: OS>Systems>Containers
Labels: -M-70 M-71
Owner: dverkamp@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 4 by bugdroid1@chromium.org, Sep 25

Labels: merge-merged-chromeos-4.14
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/aa7119345bf77271db0d6bdf36de4d16adc779e7

commit aa7119345bf77271db0d6bdf36de4d16adc779e7
Author: Daniel Verkamp <dverkamp@chromium.org>
Date: Tue Sep 25 22:48:10 2018

CHROMIUM: arch: arm64: configs: enable PCI_HOST_GENERIC

crosvm is going to emulate this PCI host bridge for ARM PCI support.

BUG= chromium:854766 
TEST=emerge-tael chromeos-kernel-4_14

Change-Id: I3d1b76a6a6405e5c2f3d3d0a414e5b8f10942268
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1242627
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>

[modify] https://crrev.com/aa7119345bf77271db0d6bdf36de4d16adc779e7/arch/arm64/configs/chromiumos-container-vm-arm64_defconfig

Project Member

Comment 5 by bugdroid1@chromium.org, Oct 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/d635acbaf348c0863bc05b8f889b2fa5f8156aaa

commit d635acbaf348c0863bc05b8f889b2fa5f8156aaa
Author: Daniel Verkamp <dverkamp@chromium.org>
Date: Tue Oct 02 16:17:25 2018

linux: Convert all virtio devices to PCI

Change the main create_virtio_devs() function to create virtio devices
using the PCI transport rather than MMIO.

BUG= chromium:854766 
TEST=Boot crosvm and verify that all virtio devices still work

Change-Id: I9a6e60b21edea1e5ac2b3ae5c91793d45cf5063a
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1241541
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/d635acbaf348c0863bc05b8f889b2fa5f8156aaa/x86_64/Cargo.toml
[modify] https://crrev.com/d635acbaf348c0863bc05b8f889b2fa5f8156aaa/arch/src/lib.rs
[modify] https://crrev.com/d635acbaf348c0863bc05b8f889b2fa5f8156aaa/src/linux.rs
[modify] https://crrev.com/d635acbaf348c0863bc05b8f889b2fa5f8156aaa/Cargo.lock
[modify] https://crrev.com/d635acbaf348c0863bc05b8f889b2fa5f8156aaa/x86_64/src/lib.rs
[modify] https://crrev.com/d635acbaf348c0863bc05b8f889b2fa5f8156aaa/aarch64/src/lib.rs
[modify] https://crrev.com/d635acbaf348c0863bc05b8f889b2fa5f8156aaa/aarch64/Cargo.toml

Status: Fixed (was: Started)
Cc: rohi...@chromium.org avkodipelli@chromium.org
Observed these details from terminal on eve device on 11137.0.0, 71.0.3567.0.
$ ls -l /sys/class/block/?d[a-z]
lrwxrwxrwx 1 nobody nogroup 0 Oct  8 18:13 /sys/class/block/vda -> ../../devices/virtio-mmio-cmdline/virtio-mmio.0/virtio0/block/vda
lrwxrwxrwx 1 nobody nogroup 0 Oct  8 18:13 /sys/class/block/vdb -> ../../devices/virtio-mmio-cmdline/virtio-mmio.1/virtio1/block/vdb

 dverkamp@ Can I close the bug as per above details. If not, Please provide verification steps. Thanks!
The virtio PCI conversion was reverted in https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1259408 due to intermittent test failures in the tast.vm.* tests.  A proposed patch and re-land is being reviewed currently in this series: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1265862

To verify that virtio devices are actually exposed via PCI (rather than MMIO, as they were previously), you can check that the /sys/class/block device paths contain "pci" rather than "mmio" (your quoted output is from a build where the PCI patch has been reverted).  You can also check that lspci reports the expected virtio devices (lspci is part of the pciutils Debian package, not installed by default).
Status: Started (was: Fixed)
Opening this bug until new fix landed. After that, I'll verify based on #8 comments. Thanks!
Project Member

Comment 10 by bugdroid1@chromium.org, Oct 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/9357ceab6ac207498fc2cff4be70aa6975e9c79f

commit 9357ceab6ac207498fc2cff4be70aa6975e9c79f
Author: Daniel Verkamp <dverkamp@chromium.org>
Date: Thu Oct 11 00:07:55 2018

mptable: mark PCI interrupts as edge triggered

BUG= chromium:854766 
TEST=Boot crosvm on an x86_64 platform (nami)

Change-Id: Id55975a443a54e8b9c25616cd842507c57802af0
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1265047
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/9357ceab6ac207498fc2cff4be70aa6975e9c79f/x86_64/src/mptable.rs

Project Member

Comment 11 by bugdroid1@chromium.org, Oct 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/cf2e00e9827798de956ff564aa422e9f31983d69

commit cf2e00e9827798de956ff564aa422e9f31983d69
Author: Daniel Verkamp <dverkamp@chromium.org>
Date: Thu Oct 11 20:25:38 2018

arch: add virtio-pci eventfds with exact match

The virtio PCI spec (4.1.5.2 Notifying The Device) says:

  "The driver notifies the device by writing the 16-bit virtqueue index
  of this virtqueue to the Queue Notify address."

We were previously registering the notify address specifying
NoDatamatch; switch this to a 16-bit match of the queue index to follow
the specification.

BUG= chromium:854766 
TEST=Boot crosvm with virtio devices converted to PCI

Change-Id: Ic950a8c7751268f7fcc21d5c37b0afc859f1e6d0
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1265861
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/cf2e00e9827798de956ff564aa422e9f31983d69/devices/src/virtio/virtio_pci_device.rs
[modify] https://crrev.com/cf2e00e9827798de956ff564aa422e9f31983d69/arch/src/lib.rs
[modify] https://crrev.com/cf2e00e9827798de956ff564aa422e9f31983d69/devices/src/lib.rs
[modify] https://crrev.com/cf2e00e9827798de956ff564aa422e9f31983d69/Cargo.lock
[modify] https://crrev.com/cf2e00e9827798de956ff564aa422e9f31983d69/devices/Cargo.toml
[modify] https://crrev.com/cf2e00e9827798de956ff564aa422e9f31983d69/devices/src/pci/pci_device.rs

Project Member

Comment 12 by bugdroid1@chromium.org, Oct 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/1232debf1d60d4188a3e6fe88a597f88e87eda01

commit 1232debf1d60d4188a3e6fe88a597f88e87eda01
Author: Daniel Verkamp <dverkamp@chromium.org>
Date: Fri Oct 12 00:33:55 2018

devices: virtio: pci: reset ISR status on read

The virtio PCI spec (4.1.4.5.1 Device Requirements: ISR status
capability) says:

  "The device MUST reset ISR status to 0 on driver read."

BUG= chromium:854766 
TEST=None

Change-Id: I92a1ddccfc8e44bed7f4a16e3cfd11b946629e22
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1260252
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/1232debf1d60d4188a3e6fe88a597f88e87eda01/devices/src/virtio/virtio_pci_device.rs

Labels: -M-71 M-72
Moving this to M-72 as we are not planning to re-land it for 71.
Status: Fixed (was: Started)
Project Member

Comment 16 by bugdroid1@chromium.org, Nov 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/402d53bba8f92794e322e1497115eb2d15b635df

commit 402d53bba8f92794e322e1497115eb2d15b635df
Author: Daniel Verkamp <dverkamp@chromium.org>
Date: Thu Nov 01 04:59:16 2018

devices: virtio: remove virtio MMIO transport

All devices have been converted to PCI, so we don't need MmioDevice.

BUG= chromium:854766 
TEST=Boot crosvm on kevin and verify virtio devices still work

Change-Id: Ib6400e15bdb2153d14795de3cb0bfbf1845a8891
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1281832
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/402d53bba8f92794e322e1497115eb2d15b635df/aarch64/src/fdt.rs
[modify] https://crrev.com/402d53bba8f92794e322e1497115eb2d15b635df/aarch64/src/lib.rs
[modify] https://crrev.com/402d53bba8f92794e322e1497115eb2d15b635df/devices/src/virtio/mod.rs
[delete] https://crrev.com/5656c124af2bb956dba19e409a269ca588c685e3/devices/src/virtio/mmio.rs
[modify] https://crrev.com/402d53bba8f92794e322e1497115eb2d15b635df/arch/src/lib.rs

Sign in to add a comment