Skip to content

Commit 128d513

Browse files
jongwuretrage
authored andcommitted
aarch64: fix get time runtime service failure
When enable efi_rtc inside guest kernel, a warning occurs: [ 0.764401] [Firmware Bug]: Unable to handle paging request in EFI runtime service [ 0.770671] ------------[ cut here ]------------ [ 0.772014] WARNING: CPU: 0 PID: 1 at drivers/firmware/efi/runtime-wrappers.c:262 virt_efi_get_time+0x12c/0x17c It derives from that there is lack of memory map descriptor for IO address of RTC_PL031 passed to kernel. Allocate IO Map for it before execute kernel/bootloader can avoid this failure and then we can get the right time inside guest. Fixes: #289 Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
1 parent a86359a commit 128d513

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/efi/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,15 @@ fn populate_allocator(info: &dyn bootinfo::Info, image_address: u64, image_size:
994994
);
995995
}
996996

997+
// Add IO map for RTC PL031 on aarch64
998+
#[cfg(target_arch = "aarch64")]
999+
ALLOCATOR.borrow_mut().add_initial_allocation(
1000+
efi::MEMORY_MAPPED_IO,
1001+
1,
1002+
crate::arch::aarch64::layout::map::mmio::PL031_START as u64,
1003+
r_efi::efi::MEMORY_RUNTIME,
1004+
);
1005+
9971006
// Add the loaded binary
9981007
ALLOCATOR.borrow_mut().allocate_pages(
9991008
efi::ALLOCATE_ADDRESS,

0 commit comments

Comments
 (0)