VirtualBox

Changeset 92262 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Nov 8, 2021 11:12:17 AM (3 years ago)
Author:
vboxsync
Message:

ValKit/bs3kit: Added Bs3PagingMapRamAbove4GForLM and made Bs3InitMemory_rm_far produce global variable g_uBs3EndOfRamAbove4G. bugref:10093

Location:
trunk/src/VBox/ValidationKit/bootsectors/bs3kit
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r92256 r92262  
    290290bs3kit-common-32_ASDEFS   = RT_ASMDEFS_INC_FIRST_FILE
    291291bs3kit-common-32_SOURCES  = $(VBOX_BS3KIT_COMMON_SOURCES) \
     292       bs3-cmn-PagingMapRamAbove4GForLM.c \
    292293       bs3-cmn-SwitchHlpConvFlatRetToRetfProtMode.asm \
    293294        bs3-cmn-UInt64Div.c \
     
    307308bs3kit-common-64_ASDEFS   = RT_ASMDEFS_INC_FIRST_FILE
    308309bs3kit-common-64_SOURCES  = $(VBOX_BS3KIT_COMMON_SOURCES) \
     310       bs3-cmn-PagingMapRamAbove4GForLM.c \
    309311       bs3-cmn-SwitchHlpConvFlatRetToRetfProtMode.asm \
    310312       bs3-c64-Trap64Generic.asm \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitMemory.c

    r92256 r92262  
    9494
    9595
    96 /** The last RAM address below 4GB (approximately). */
     96/** The end RAM address below 4GB (approximately). */
    9797uint32_t                g_uBs3EndOfRamBelow4G = 0;
    98 
     98/** The end RAM address above 4GB, zero if no memory above 4GB. */
     99uint64_t                g_uBs3EndOfRamAbove4G = 0;
    99100
    100101
     
    241242        {
    242243            if (Entry.uType == INT15E820_TYPE_USABLE)
     244            {
    243245                if (!(Entry.uBaseAddr >> 32))
    244246                    /* Convert from 64-bit to 32-bit value and record it. */
    245247                    bs3InitMemoryAddRange32((uint32_t)Entry.uBaseAddr,
    246248                                            (Entry.cbRange >> 32) ? UINT32_C(0xfffff000) : (uint32_t)Entry.cbRange);
     249                else
     250                {
     251                    uint64_t uEnd = Entry.uBaseAddr + Entry.cbRange;
     252                    if (uEnd > g_uBs3EndOfRamAbove4G)
     253                        g_uBs3EndOfRamAbove4G = uEnd;
     254                }
     255            }
    247256
    248257            /* next */
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk

    r92256 r92262  
    4949$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForPAE)
    5050$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForPP)
     51$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingMapRamAbove4GForLM)
    5152$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtect)
    5253$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtectPtr)
     
    143144$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,bs3PagingGetLegacyPte)
    144145$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,bs3PagingGetPaePte)
     146$(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,Bs3BiosInt15hE820)
    145147$(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,Bs3SwitchTo32BitAndCallC)
    146148$(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,Bs3BiosInt15h88)
    147 $(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,Bs3BiosInt15hE820)
    148149$(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,Bs3TrapInit)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h

    r92256 r92262  
    6565#define Bs3PagingInitRootForPAE BS3_CMN_MANGLER(Bs3PagingInitRootForPAE)
    6666#define Bs3PagingInitRootForPP BS3_CMN_MANGLER(Bs3PagingInitRootForPP)
     67#define Bs3PagingMapRamAbove4GForLM BS3_CMN_MANGLER(Bs3PagingMapRamAbove4GForLM)
    6768#define Bs3PagingProtect BS3_CMN_MANGLER(Bs3PagingProtect)
    6869#define Bs3PagingProtectPtr BS3_CMN_MANGLER(Bs3PagingProtectPtr)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h

    r92256 r92262  
    6565#undef Bs3PagingInitRootForPAE
    6666#undef Bs3PagingInitRootForPP
     67#undef Bs3PagingMapRamAbove4GForLM
    6768#undef Bs3PagingProtect
    6869#undef Bs3PagingProtectPtr
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r92256 r92262  
    21862186BS3_CMN_PROTO_STUB(void, Bs3MemPrintInfo, (void));
    21872187
    2188 /** Highes RAM byte below 4G. */
     2188/** The end RAM address below 4GB (approximately). */
    21892189extern uint32_t  g_uBs3EndOfRamBelow4G;
     2190/** The end RAM address above 4GB, zero if no memory above 4GB. */
     2191extern uint64_t  g_uBs3EndOfRamAbove4G;
    21902192
    21912193
     
    22462248 */
    22472249BS3_CMN_PROTO_STUB(int, Bs3PagingInitRootForLM,(void));
     2250
     2251/**
     2252 * Maps all RAM above 4GB into the long mode page tables.
     2253 *
     2254 * This requires Bs3PagingInitRootForLM to have been called first.
     2255 *
     2256 * @returns IPRT status code.
     2257 * @retval  VERR_WRONG_ORDER if Bs3PagingInitRootForLM wasn't called.
     2258 * @retval  VINF_ALREADY_INITIALIZED if already called or someone mapped
     2259 *          something else above 4GiB already.
     2260 * @retval  VERR_OUT_OF_RANGE if too much RAM (more than 2^47 bytes).
     2261 * @retval  VERR_NO_MEMORY if no more memory for paging structures.
     2262 * @retval  VERR_UNSUPPORTED_ALIGNMENT if the bs3kit allocator malfunctioned and
     2263 *          didn't give us page aligned memory as it should.
     2264 *
     2265 * @param   puFailurePoint      Where to return the address where we encountered
     2266 *                              a failure.  Optional.
     2267 *
     2268 * @remarks Must be called in 32-bit or 64-bit mode as paging structures will be
     2269 *          allocated using BS3MEMKIND_FLAT32, as there might not be sufficient
     2270 *          BS3MEMKIND_TILED memory around.  (Also, too it's simply too much of
     2271 *          a bother to deal with 16-bit for something that's long-mode only.)
     2272 */
     2273BS3_CMN_PROTO_STUB(int, Bs3PagingMapRamAbove4GForLM,(uint64_t *puFailurePoint));
    22482274
    22492275/**
Note: See TracChangeset for help on using the changeset viewer.

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