Skip to content
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

vmmplatsupport, vesa: fix vesa mapping #119

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libsel4vmmplatsupport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ target_link_libraries(
sel4_autoconf
sel4vm_Config
usbdrivers_Config
sel4vmmplatsupport_Config
)
26 changes: 14 additions & 12 deletions libsel4vmmplatsupport/src/arch/x86/guest_boot_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <autoconf.h>
#include <sel4vm/gen_config.h>
#include <sel4vmmplatsupport/gen_config.h>

#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -91,19 +92,20 @@ static void make_guest_screen_info(vm_t *vm, struct screen_info *info)
}
}
if (error) {
ZF_LOGE("Failed to map vbe protected mode interface for VESA frame buffer. Disabling");
ZF_LOGE("Failed to map vbe protected mode interface for VESA frame buffer. Not disabling");
}

fbuffer_size = vmm_plat_vesa_fbuffer_size(&vbeinfo.vbeModeInfoBlock);
ZF_LOGI("VESA Frame buffer size: 0x%x\n", fbuffer_size);
vm_memory_reservation_t *reservation = vm_reserve_anon_memory(vm, fbuffer_size, 0x1000,
default_error_fault_callback, NULL, &base);
if (!reservation) {
ZF_LOGE("Failed to reserve base pointer for VESA frame buffer. Not Disabling\n");
} else {
fbuffer_size = vmm_plat_vesa_fbuffer_size(&vbeinfo.vbeModeInfoBlock);
vm_memory_reservation_t *reservation = vm_reserve_anon_memory(vm, fbuffer_size, 0x1000,
default_error_fault_callback, NULL, &base);
if (!reservation) {
ZF_LOGE("Failed to reserve base pointer for VESA frame buffer. Disabling");
} else {
error = map_ut_alloc_reservation_with_base_paddr(vm, vbeinfo.vbeModeInfoBlock.vbe20.physBasePtr, reservation);
if (error) {
ZF_LOGE("Failed to map base pointer for VESA frame buffer. Disabling");
base = 0;
}
error = map_ut_alloc_reservation_with_base_paddr(vm, vbeinfo.vbeModeInfoBlock.vbe20.physBasePtr, reservation);
if (error) {
ZF_LOGE("Failed to map base pointer for VESA frame buffer. Disabling");
base = 0;
}
}
}
Expand Down