VirtualBox

Changeset 45750 in vbox for trunk


Ignore:
Timestamp:
Apr 26, 2013 1:20:24 AM (12 years ago)
Author:
vboxsync
Message:

VMMSwitcher: Fixed assertion in debug builds (harmless).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/VMMSwitcher.cpp

    r45746 r45750  
    917917
    918918/**
     919 * Wrapper around SELMGetHyperGDT() that avoids calling it when raw-mode context
     920 * is not initialized.
     921 *
     922 * @returns Raw-mode contet GDT address. Null pointer if not applicable.
     923 * @param   pVM         The cross context VM structure.
     924 */
     925static RTRCPTR vmmR3SwitcherGetHyperGDT(PVM pVM)
     926{
     927    if (HMIsRawModeCtxNeeded(pVM))
     928        return SELMGetHyperGDT(pVM);
     929#if HC_ARCH_BITS != 32 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
     930    AssertFailed(); /* This path is only applicable to some 32-bit hosts. */
     931#endif
     932    return NIL_RTRCPTR;
     933}
     934
     935/**
    919936 * Relocator for the 32-Bit to 32-Bit world switcher.
    920937 */
     
    942959{
    943960    vmmR3SwitcherGenericRelocate(pVM, pSwitcher, R0PtrCode, pu8CodeR3, GCPtrCode, u32IDCode,
    944                                  SELMGetHyperCS(pVM), SELMGetHyperDS(pVM), SELMGetHyperTSS(pVM), SELMGetHyperGDT(pVM), SELMGetHyperCS64(pVM));
     961                                 SELMGetHyperCS(pVM), SELMGetHyperDS(pVM), SELMGetHyperTSS(pVM), vmmR3SwitcherGetHyperGDT(pVM), SELMGetHyperCS64(pVM));
    945962}
    946963
     
    971988{
    972989    vmmR3SwitcherGenericRelocate(pVM, pSwitcher, R0PtrCode, pu8CodeR3, GCPtrCode, u32IDCode,
    973                                  SELMGetHyperCS(pVM), SELMGetHyperDS(pVM), SELMGetHyperTSS(pVM), SELMGetHyperGDT(pVM), SELMGetHyperCS64(pVM));
     990                                 SELMGetHyperCS(pVM), SELMGetHyperDS(pVM), SELMGetHyperTSS(pVM), vmmR3SwitcherGetHyperGDT(pVM), SELMGetHyperCS64(pVM));
    974991}
    975992
     
    10601077     * Validate input.
    10611078     */
    1062     if (    enmSwitcher < VMMSWITCHER_INVALID
    1063         ||  enmSwitcher >= VMMSWITCHER_MAX)
    1064     {
    1065         AssertMsgFailed(("Invalid input enmSwitcher=%d\n", enmSwitcher));
    1066         return NIL_RTR0PTR;
    1067     }
     1079    AssertMsgReturn(   enmSwitcher == VMMSWITCHER_32_TO_AMD64
     1080                    || enmSwitcher == VMMSWITCHER_PAE_TO_AMD64,
     1081                    ("%d\n", enmSwitcher),
     1082                    NIL_RTR0PTR);
     1083    AssertReturn(HMIsEnabled(pVM), NIL_RTR0PTR);
    10681084
    10691085    /*
    10701086     * Select the new switcher.
    10711087     */
    1072     const PVMMSWITCHERDEF *papSwitchers = HMIsEnabled(pVM) ? g_apHmSwitchers : g_apRawModeSwitchers;
     1088    const PVMMSWITCHERDEF *papSwitchers = g_apHmSwitchers;
    10731089    PVMMSWITCHERDEF pSwitcher = papSwitchers[enmSwitcher];
    10741090    if (pSwitcher)
    10751091    {
    1076         RTR0PTR     pbCodeR0 = (RTR0PTR)pVM->vmm.s.pvCoreCodeR0 + pVM->vmm.s.aoffSwitchers[enmSwitcher]; /** @todo fix the pvCoreCodeR0 type */
     1092        /** @todo fix the pvCoreCodeR0 type */
     1093        RTR0PTR pbCodeR0 = (RTR0PTR)pVM->vmm.s.pvCoreCodeR0 + pVM->vmm.s.aoffSwitchers[enmSwitcher];
    10771094        return pbCodeR0 + pSwitcher->offR0ToRawMode;
    10781095    }
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