generated from rust-vmm/crate-template
-
Notifications
You must be signed in to change notification settings - Fork 61
Riscv vmm #251
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
Open
samvosys
wants to merge
10
commits into
rust-vmm:main
Choose a base branch
from
vitamin-v-software:riscv-vmm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Riscv vmm #251
Conversation
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
The following crates have been updated to a newer version kvm-ioctls 0.13.0 kvm-bindings 0.6 vmm-sys-util 0.11.2 event-manager 0.3.0 Signed-off-by: Alvise Rigo <[email protected]> Reviewed-by: Timos Ampelikiotis <[email protected]>
The new version of vm-memory requires to bump the log crate to version 0.4.20 and vm-virtio to 0.10.0. This has various consequences to the rest of the code. In particular: The vmm crate had to be reworked to add a reference to the guest memory in various places as it is not part of the Queue struct anymore. For this reason, it is preferable to wrap the array of Arc<GuestRegionMmap> with an Arc reference to optimize the various clone() operation that will be added. This has the advantage of reducing the duplication of memory and makes sure the various parts of the code to see the same array of elements (which would not be the case if we clone the array of Arc<> iteself). While at it, the reference to the guest memory was added to some key virtio functions. devices::virtio::{self, block, net} had all to be updated to also accept the Arc reference to the guest memory. Signed-off-by: Alvise Rigo <[email protected]> Reviewed-by: Timos Ampelikiotis <[email protected]>
Signed-off-by: Alvise Rigo <[email protected]> Reviewed-by: Timos Ampelikiotis <[email protected]>
Update to align to the new Cmdline API and kernel image loader. While at it, update the load_kernel() tests as well. Signed-off-by: Alvise Rigo <[email protected]> Reviewed-by: Timos Ampelikiotis <[email protected]>
Signed-off-by: Alvise Rigo <[email protected]>
This commit updates the following: - vm-memory - vmm-sys-util - kvm-ioctls - kvm-bindings - linux-loader - virtio-queue - virtio-blk - virtio-device - vm-superio - clap Signed-off-by: Samuele Paone <[email protected]>
This commit adds the --dump-dtb, which enables the user to make a dump of the dtb being used Signed-off-by: Samuele Paone <[email protected]>
This commit adds the --dtb option which enables the user to upload his own dtb Signed-off-by: Samuele Paone <[email protected]>
This commit implments the device tree autogeneration for the RISC-V architecture Signed-off-by: Samuele Paone <[email protected]>
This commit implements a first support to the RISC-V architecture. Major changes are related to interrupts handling: - use of in-kernel IRQCHIP (APLIC) - interrupt injection from userspace through kvm ioctl (KVM_SET_IRQ_LINE) Signed-off-by: Samuele Paone <[email protected]>
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.
Summary of the PR
This pull request adds support for the RISC-V architecture and updates the
vmm-reference
crate dependencies to the following versions:linux-loader
0.13.0vm-memory
0.16.0kvm-ioctls
0.20.0kvm-bindings
0.11.0vmm-sys-util
0.12.1event-manager
0.4.0vm-superio
0.8.0vm-fdt
0.3.0clap
4.5.28Interrupt Handling
A key aspect of porting
vmm-reference
to RISC-V is the handling of interrupts.For x86 and aarch64,
vmm-reference
relies on the KVM-provided irqchip and uses IRQFD for interrupt injection.However, in RISC-V we could not rely on the same mechanism for injecting the interrupt because of an issue - which we are investigating - in the virtualization of edge interrupts in KVM. For this reason, it has been used an IOCTL that allow us to perform this operation from userspace. This implementation leverages the in-kernel irqchip (APLIC). Interrupts are signaled through an abstraction called
APlicTrigger
, which implements theTrigger
trait. This allows devices to trigger interrupts similarly to IRQFD, but in this case, injection is performed viaAPlicTrigger
using theKVM_SET_IRQ_LINE
ioctl.New Features
This PR also introduces two new features:
--dtb: Allows passing a custom device tree.
--dtb-dump: Enables dumping the current device tree blob (DTB).
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s
), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafe
code is properly documented.