VirtualBox

Ignore:
Timestamp:
Nov 20, 2015 5:21:41 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104257
Message:

EFI/Firmware: Fix page table location for amd64 after MEMFD had to be relocated because of OS X guests. The page table location must match the gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase PCD defined in OvmfPkgX64.fdf. Remove unused modifications in the old ResetVector code which now moved to OvmfPkg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/ResetVector/Ia32/PageTables64.asm

    r58464 r58803  
    4545
    4646    ;
     47%ifdef VBOX
     48    ; For OVMF, build some initial page tables at 0x2000000-0x2006000.
     49    ; Required because we had to relocate MEMFD where the page table resides
     50    ; from 0x800000 to not interfere with certain OS X bootloaders.
     51%else
    4752    ; For OVMF, build some initial page tables at 0x800000-0x806000.
     53%endif
    4854    ;
    4955    ; This range should match with PcdOvmfSecPageTablesBase and
     
    5763    xor     eax, eax
    5864clearPageTablesMemoryLoop:
     65%ifdef VBOX
     66    mov     dword[ecx * 4 + 0x2000000 - 4], eax
     67%else
    5968    mov     dword[ecx * 4 + 0x800000 - 4], eax
     69%endif
    6070    loop    clearPageTablesMemoryLoop
    6171
     
    6373    ; Top level Page Directory Pointers (1 * 512GB entry)
    6474    ;
     75%ifdef VBOX
     76    mov     dword[0x2000000], 0x2001000 + PAGE_PDP_ATTR
     77%else
    6578    mov     dword[0x800000], 0x801000 + PAGE_PDP_ATTR
     79%endif
    6680
    6781    ;
    6882    ; Next level Page Directory Pointers (4 * 1GB entries => 4GB)
    6983    ;
     84%ifdef VBOX
     85    mov     dword[0x2001000], 0x2002000 + PAGE_PDP_ATTR
     86    mov     dword[0x2001008], 0x2003000 + PAGE_PDP_ATTR
     87    mov     dword[0x2001010], 0x2004000 + PAGE_PDP_ATTR
     88    mov     dword[0x2001018], 0x2005000 + PAGE_PDP_ATTR
     89%else
    7090    mov     dword[0x801000], 0x802000 + PAGE_PDP_ATTR
    7191    mov     dword[0x801008], 0x803000 + PAGE_PDP_ATTR
    7292    mov     dword[0x801010], 0x804000 + PAGE_PDP_ATTR
    7393    mov     dword[0x801018], 0x805000 + PAGE_PDP_ATTR
     94%endif
    7495
    7596    ;
     
    82103    shl     eax, 21
    83104    add     eax, PAGE_2M_PDE_ATTR
     105%ifdef VBOX
     106    mov     [ecx * 8 + 0x2002000 - 8], eax
     107%else
    84108    mov     [ecx * 8 + 0x802000 - 8], eax
     109%endif
    85110    loop    pageTableEntriesLoop
    86111
     
    88113    ; Set CR3 now that the paging structures are available
    89114    ;
     115%ifdef VBOX
     116    mov     eax, 0x2000000
     117%else
    90118    mov     eax, 0x800000
     119%endif
    91120    mov     cr3, eax
    92121
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette