-
Notifications
You must be signed in to change notification settings - Fork 58
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: let ubuntu 20.04+ boot from rust hypervisor firmware #262
Changes from all commits
2391a65
d327a57
3e48283
03c37ca
ab9b25e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,17 @@ ENTRY(ram64_start) | |
DRAM: [0x4000_0000-0xfc00_0000] | ||
FDT: [0x4000_0000-0x401f_ffff) | ||
ACPI: [0x4020_0000-0x403f_ffff) | ||
kernel: [0x4048_0000-] | ||
The stack start is at the end of the DRAM region. */ | ||
ram_min = 0x40480000; | ||
payload:[0x4040_0000-0x405f_ffff) | ||
RHF: [0x40600000-] | ||
Assuming 2MB is enough to load payload. | ||
The stack start is at the end of the RHF region. */ | ||
ram_min = 0x40600000; | ||
|
||
/* This value must be identical with arch::aarch64::layout::map::dram::KERNEL_START. */ | ||
PAYLOAD_START = 0x40400000; | ||
|
||
efi_image_size = rhf_end - ram_min; | ||
efi_image_offset = ram_min - PAYLOAD_START; | ||
|
||
SECTIONS | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand how this gives more room for GRUB. This is file determines the layout of the ELF executable that is compiled from the project. Your commit message seems to imply that the EFI payload is loaded into the memory just below the RHF executable code. I think this is a bit different to how we do it elsewhere. If you want to keep it the same it would be better to. Make @retrage Perhaps you can clarify on this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @rbradford -, In current design, 0x40400000 ~ 0x40480000 is reserved for RHF payload. 0x40000000 ~0x40400000 is reserved for DTB and ACPI. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So what does that have to do with the EFI payload? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be better to load the kernel/grub so that it doesn't overwrite the memory that RHF is loaded at e.g. on x86 RHF is loaded at 1MiB and the EFI binary/kernel is loaded at 2MiB. The correct place to change is probably the value provided to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a big change that impact CH, RHF and maybe also future change for EDK2 (I'd like to unify the boot process of EDK2 and RHF), so let me think it through carefully. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The points are:
So, my suggestion is to just add comments to the memory layout assumption. See #262 (comment). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK |
||
|
@@ -41,4 +49,7 @@ SECTIONS | |
*(.symtab) | ||
*(.strtab) | ||
} | ||
|
||
. = ALIGN(4K); | ||
rhf_end = .; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -614,7 +614,6 @@ pub extern "efiapi" fn install_configuration_table(guid: *mut Guid, table: *mut | |
|
||
for entry in ct.iter_mut() { | ||
if entry.vendor_guid == unsafe { *guid } { | ||
entry.vendor_table = table; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be a separate commit. |
||
if table.is_null() { | ||
entry.vendor_guid = INVALID_GUID; | ||
entry.vendor_table = null_mut(); | ||
|
@@ -1115,6 +1114,9 @@ pub fn efi_exec( | |
let mut ct_index = 0; | ||
|
||
// Populate with FDT table if present | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you update the commit title to mark as aarch64 specific. |
||
// To ensure ACPI is used during boot do not include FDT table on aarch64 | ||
// https://github.com/torvalds/linux/blob/d528014517f2b0531862c02865b9d4c908019dc4/arch/arm64/kernel/acpi.c#L203 | ||
#[cfg(not(target_arch = "aarch64"))] | ||
retrage marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if let Some(fdt_entry) = info.fdt_reservation() { | ||
ct[ct_index] = efi::ConfigurationTable { | ||
vendor_guid: Guid::from_fields( | ||
|
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.
Your commit message should focus on why you're doing something. Generally there is no need to repeat what the code does.
e.g.
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.
Thanks @rbradford -, done.