Changeset 81821 in vbox for trunk/src/VBox/Devices/EFI
- Timestamp:
- Nov 13, 2019 11:37:39 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuDxe/CpuGdt.c
r80721 r81821 128 128 IA32_DESCRIPTOR gdtPtr; 129 129 130 #ifndef VBOX 130 131 // 131 132 // Allocate Runtime Data for the GDT 132 133 // 133 gdt = AllocateR eservedPool (sizeof (GdtTemplate) + 8); /* VBox: Required for OS X (tested with 32-bit 10.6), original uses AllocateRuntimePool here. */134 gdt = AllocateRuntimePool (sizeof (GdtTemplate) + 8); 134 135 ASSERT (gdt != NULL); 135 136 gdt = ALIGN_POINTER (gdt, 8); 137 #else 138 /* 139 * With previous versions of the EDK2 changing AllocateRuntimePool to AllocateReservedPool 140 * was enough to get earlier mac OS versions (Tiger up until at least Snow Leopard) not overwriting the GDT 141 * when freeing not required EFI memory ranges anymore. 142 * With the current version however the memory map (memmap command in EFI shell) returned to boot.efi 143 * will have the Runtime flag always cleared no matter what. boot.efi overwrites the memory and 144 * the VM triple faults because of the invalid GDT. 145 * Using the AllocatePages() method with EfiRuntimeServicesData works around that and the GDT memory 146 * has the proper Runtime flag set so boot.efi will leave it alone. 147 */ 148 EFI_STATUS Status; 149 EFI_PHYSICAL_ADDRESS PhysicalAddress = SIZE_4GB - 1; 150 Status = gBS->AllocatePages(AllocateMaxAddress, 151 EfiRuntimeServicesData, 152 1, 153 &PhysicalAddress); 154 ASSERT(!EFI_ERROR(Status)); 155 gdt = ALIGN_POINTER ((void *)(UINTN)PhysicalAddress, 8); 156 #endif 136 157 137 158 //
Note:
See TracChangeset
for help on using the changeset viewer.