status = efi_bs_call(install_configuration_table, &cpu_state_guid,
efi_entry_state); if (status != EFI_SUCCESS) {
efi_err("install_configuration_table() failed\n"); goto free_state;
}
/* non-LPAE kernels can run anywhere */ if (!IS_ENABLED(CONFIG_ARM_LPAE)) return EFI_SUCCESS;
/* LPAE kernels need compatible hardware */
block = cpuid_feature_extract(CPUID_EXT_MMFR0, 0); if (block < 5) {
efi_err("This LPAE kernel is not supported by your CPU\n");
status = EFI_UNSUPPORTED; goto drop_table;
} return EFI_SUCCESS;
/* * Allocate space for the decompressed kernel as low as possible. * The region should be 16 MiB aligned, but the first 'slack' bytes * are not used by Linux, so we allow those to be occupied by the * firmware.
*/
status = efi_low_alloc_above(alloc_size, EFI_PAGE_SIZE, &alloc_base, 0x0); if (status != EFI_SUCCESS) {
efi_err("Unable to allocate memory for uncompressed kernel.\n"); return status;
}
if ((alloc_base % EFI_PHYS_ALIGN) > slack) { /* * More than 'slack' bytes are already occupied at the base of * the allocation, so we need to advance to the next 16 MiB block.
*/
kernel_base = round_up(alloc_base, EFI_PHYS_ALIGN);
efi_info("Free memory starts at 0x%lx, setting kernel_base to 0x%lx\n",
alloc_base, kernel_base);
} else {
kernel_base = round_down(alloc_base, EFI_PHYS_ALIGN);
}
/* now free the parts that we will not use */ if (*reserve_addr > alloc_base) {
efi_bs_call(free_pages, alloc_base,
(*reserve_addr - alloc_base) / EFI_PAGE_SIZE);
alloc_size -= *reserve_addr - alloc_base;
}
efi_bs_call(free_pages, *reserve_addr + MAX_UNCOMP_KERNEL_SIZE,
(alloc_size - MAX_UNCOMP_KERNEL_SIZE) / EFI_PAGE_SIZE);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.