-
Notifications
You must be signed in to change notification settings - Fork 55
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
Aarch64 Image format and device tree loading support for linux-loader #16
Conversation
@aghecenco I'm aware of that. It is lacking device tree support and somehow complicated. I am just trying to upstream my work after launching a kernel with cloud-hypervisor on ARM64. |
There's also a proposal for a |
src/loader/mod.rs
Outdated
/// * `guest_addr` - The address in `guest_mem` at which to load the device tree blob. | ||
/// * `dtb_image` - The device tree blob. | ||
#[cfg(target_arch = "aarch64")] | ||
pub fn load_dtb<F, M: GuestMemory>( |
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.
I think that this function should be residing somewhere higher in the design. The way I see it is: the vmm obtains the entry address for where the kernel should be loaded, it also knows about the dtb and it is the one who writes things to memory, to the dtb etc. I see this as a more decoupled and flexible design.
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 function is just a helper loading a dtb blob into memory. How to generate and modify a dtb should be implemented in vmm-fdt.
@aghecenco I had a chat with Marc Zyngier about adding fdt support in rust-vmm. It is a hard problem to tackle right now because we do not really have a resource allocator based on which the fdt can be created. We might want to postpone that work until we have a clear path forward for creating the fdt in a VMM agnostic way. |
@aghecenco Architecture specific features is not ready today. A possible work around is making |
795ee95
to
8b182c4
Compare
Agreed. I logged #27 to track this as I can't think of a better solution either. There's of course the option of having no default features, @andreeaflorescu and I had a quick chat about it but didn't explore it; I for one prefer having them as I think it would simplify the vmm's |
I don't have a strong preference. I am not super sure though that |
8fa2521
to
dab9208
Compare
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.
The readme and crate root (/src/lib.rs
) should also be updated to specify that we support aarch64 as well.
src/loader/mod.rs
Outdated
/// # Arguments | ||
/// | ||
/// * `guest_mem` - The guest memory where the kernel image is loaded. | ||
/// * `kernel_start` - The offset into 'guest_mem' at which to load the kernel. |
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.
nit: We typically add code-related things in backticks. This is the case for guest_mem
.
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.
I think it should be addressed in #23 since these comments are copied from other loaders.
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.
The comment is for: "The offset into 'guest_mem'" where guest_mem is wrapped in single quotes. But you can ignore it, it is just a nit.
962c843
to
4c2915c
Compare
rebased to the master branch. |
Signed-off-by: Qiu Wenbo <[email protected]>
Signed-off-by: Qiu Wenbo <[email protected]>
The test_image.bin is a cut of the first 4096 bytes of a pre-compiled linux kernel ARM64 Image. You can generate by: make Image head -c 4096 arch/arm64/boot/Image > test_image.bin Signed-off-by: Qiu Wenbo <[email protected]>
Signed-off-by: Qiu Wenbo <[email protected]>
Signed-off-by: Qiu Wenbo <[email protected]>
I am working on porting cloud-hypervisor to ARM64 platform and this is part of my effort.