-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul of the crate to fit our use case #1
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Simon LUCIDO <[email protected]>
Signed-off-by: Simon LUCIDO <[email protected]>
Signed-off-by: Simon LUCIDO <[email protected]>
Signed-off-by: Simon LUCIDO <[email protected]>
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-)
} | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
DeviceMmio
one? - 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_device
crate that would prevent you to use it as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
Hi !
This PR is aimed at providing a more specific use case of the
rust-vmm/vm-device
crate. 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.