Skip to content

Commit

Permalink
vmmplatsupport, vesa: fix vesa mapping
Browse files Browse the repository at this point in the history
The previous behavior would only attempt to map the vesa framebuffer and
set the screen info struct if the vbe protection mode interface was
successfully mapped in. This removes the dependency on the vbe protected
mode interface. It is not clear that it is needed as vesa framebuffer
passthrough works without it.

Signed-off-by: Chris Guikema <[email protected]>
  • Loading branch information
chrisguikema authored and abrandnewusername committed Nov 3, 2023
1 parent e219913 commit 8d71a8a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
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

0 comments on commit 8d71a8a

Please sign in to comment.