Overhaul of the crate to fit our use case#1
Open
lucido-simon wants to merge 5 commits intovirt-do:mainfrom
Open
Overhaul of the crate to fit our use case#1lucido-simon wants to merge 5 commits intovirt-do:mainfrom
lucido-simon wants to merge 5 commits intovirt-do:mainfrom
Conversation
Signed-off-by: Simon LUCIDO <simon.lucido@etu.umontpellier.fr>
Signed-off-by: Simon LUCIDO <simon.lucido@etu.umontpellier.fr>
Signed-off-by: Simon LUCIDO <simon.lucido@etu.umontpellier.fr>
Signed-off-by: Simon LUCIDO <simon.lucido@etu.umontpellier.fr>
sameo
reviewed
Apr 4, 2023
| @@ -1,5 +1,5 @@ | |||
| // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |||
| // SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause | |||
| // SPDX-License-Identifier: GuestAddresspache-2.0 OR BSD-3-Clause | |||
| } | ||
| pub trait VirtioMmioDevice { | ||
| fn virtio_mmio_read(&self, base: GuestAddress, offset: VirtioMmioOffset, data: &mut [u8]); | ||
| fn virtio_mmio_write(&self, base: GuestAddress, offset: VirtioMmioOffset, data: &[u8]); |
There was a problem hiding this comment.
This commit is huge and highly intrusive. Since it seems to be turning the vm_device crate into a virtio specific one, I have a couple of fundamental questions:
- How is a virtio MMIO device different than a
DeviceMmioone? - You're renaming a bunch of structures, deleting a bunch of modules, to essentially accommodate for virtio MMIO. But is there something missing from the
vm_devicecrate that would prevent you to use it as is?
Author
There was a problem hiding this comment.
- A virtio MMIO device is basically a
DeviceMmio, with some slightly tweaked QoL (such as having the offset as an Enum corresponding to the virtio layout, or usingGuestAddress, the same as in lumper). They are essentially the same. - Nothing is missing from
vm_device. However, this fork is easier to work with, since it corresponds to our use case.
I will try giving another shot at using the upstream crate.
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.
Hi !
This PR is aimed at providing a more specific use case of the
rust-vmm/vm-devicecrate. Since we are exclusively using it for virtio-mmio device, I've deleted all the code related to PIO devices, to make the code more readable.I've also taken the liberty of specializing this crate to virtio 1.2 mmio devices, and not for all kind of mmio-mapped devices. This is also our only use case, and allows for some virtio abstractions higher up in the layers when managing virtio devices.
Most of the PR is deletions and renaming.