Repository navigation
machine-arm: take iommu_platform on the virtio-mmio devices of virt - #341
Merged
Merged
Conversation
3 of 11 tasks
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.
Part of #9.
What
iommu_platformon the virtio-mmio devices of Arm virt (-device virtio-*-device,iommu_platform=on), as QEMU 11.1 takes it. Before this,-device virtio-blk-device,iommu_platform=onfailed with "Property 'virtio-blk-device.iommu_platform' not found".get_dma_as. So, as invirtio_bus_device_plugged(), the device offersVIRTIO_F_IOMMU_PLATFORMand does its DMA in system memory.-global virtio-mmio.force-legacy=false. That matchesvirtio_mmio_read().VirtMachine::attach_virtio_withandattach_virtio_at_withtake the property.attach_virtioandattach_virtio_atcall them with it off.Comparison with QEMU 11.1
The same Alpine 6.12 guest booted on QEMU 11.1 and on ruvm with
-M virt,iommu=smmuv3,gic-version=3 -cpu max -m 1G -smp 1(plus-nodefaultsin theforce-legacy=falseruns, which ruvm needs for-global) and-device virtio-blk-device,drive=d0,iommu_platform=onover a 16 MiB raw image. It loads virtio_mmio and virtio_blk, prints the device features from sysfs, takes the md5 of /dev/vda, writes a sector, drops caches, reads it back and takes the md5 again.-global virtio-mmio.force-legacy=falseforce-legacy=falseIn all runs the md5 before the write was 95934ad229a3114a0de2dc62cee94d4e, the sector read back as written, and the md5 after the write was 269d53a2fae97c0c7de47a8a3d6776b2 in the guest and on the host image, on both emulators. The ruvm boots used a release build of this diff on debd8d2; #339 and #340, which came in after, do not touch the virtio-mmio path.
Not done here
iommu_platformonly on its PCI types.accel=on, CMDQV) needs host SMMU hardware we do not have, so it comes last.Tests
virtio_mmio_iommu_platform: the high feature word showsVIRTIO_F_IOMMU_PLATFORMon a modern transport with the property, not without it, and shows nothing on a legacy transport.virtio-rng-device,iommu_platform=on.cargo fmt --checkand clippy-D warningson machine-arm, system and hw-virtio;cargo check --workspace --all-targets;cargo test -p ruvm-system --lib(113 passed); the tests of machine-arm, system, hw-virtio, hw-iommu and hw-pci, and the linux-user x86 suite (user-common, linux-user, jit-x86_64, jit-core), 729 passed and 0 failed in all; the provenance, unsafe-audit, layers and style xtasks;cargo check --target x86_64-pc-windows-msvcon machine-arm and system with no warnings.