VirtualBox

Changeset 62106 in vbox for trunk/src


Ignore:
Timestamp:
Jul 7, 2016 2:24:52 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
108588
Message:

hmR0VmxIs32BitSwitcherSafe: Use return, it's one of the major perks implementing a predicate function as a function. Corrected docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r62045 r62106  
    48244824
    48254825
    4826 #if HC_ARCH_BITS == 32
    4827 # ifdef VBOX_ENABLE_64_BITS_GUESTS
     4826#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
    48284827/**
    48294828 * Check if guest state allows safe use of 32-bit switcher again.
    48304829 *
    4831  * @returns VBox status code.
     4830 * Segment bases and protected mode structures must be 32-bit addressable
     4831 * because the  32-bit switcher will ignore high dword when writing these VMCS
     4832 * fields.  See @bugref{8432} for details.
     4833 *
     4834 * @returns true if safe, false if must continue to use the 64-bit switcher.
    48324835 * @param   pVCpu       The cross context virtual CPU structure.
    48334836 * @param   pMixedCtx   Pointer to the guest-CPU context. The data may be
     
    48394842static bool hmR0VmxIs32BitSwitcherSafe(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
    48404843{
    4841     bool    rc = false;
    4842 
    4843     do
    4844     {
    4845         if (pMixedCtx->gdtr.pGdt & UINT64_C(0xffffffff00000000))
    4846             break;
    4847         if (pMixedCtx->idtr.pIdt & UINT64_C(0xffffffff00000000))
    4848             break;
    4849         if (pMixedCtx->ldtr.u64Base & UINT64_C(0xffffffff00000000))
    4850             break;
    4851         if (pMixedCtx->tr.u64Base & UINT64_C(0xffffffff00000000))
    4852             break;
    4853         if (pMixedCtx->es.u64Base & UINT64_C(0xffffffff00000000))
    4854             break;
    4855         if (pMixedCtx->cs.u64Base & UINT64_C(0xffffffff00000000))
    4856             break;
    4857         if (pMixedCtx->ss.u64Base & UINT64_C(0xffffffff00000000))
    4858             break;
    4859         if (pMixedCtx->ds.u64Base & UINT64_C(0xffffffff00000000))
    4860             break;
    4861         if (pMixedCtx->fs.u64Base & UINT64_C(0xffffffff00000000))
    4862             break;
    4863         if (pMixedCtx->gs.u64Base & UINT64_C(0xffffffff00000000))
    4864             break;
    4865         /* All good, bases are 32-bit. */
    4866         rc = true;
    4867     } while (0);
    4868 
    4869     return rc;
    4870 }
    4871 # endif
     4844    if (pMixedCtx->gdtr.pGdt    & UINT64_C(0xffffffff00000000))
     4845        return false;
     4846    if (pMixedCtx->idtr.pIdt    & UINT64_C(0xffffffff00000000))
     4847        return false;
     4848    if (pMixedCtx->ldtr.u64Base & UINT64_C(0xffffffff00000000))
     4849        return false;
     4850    if (pMixedCtx->tr.u64Base   & UINT64_C(0xffffffff00000000))
     4851        return false;
     4852    if (pMixedCtx->es.u64Base   & UINT64_C(0xffffffff00000000))
     4853        return false;
     4854    if (pMixedCtx->cs.u64Base   & UINT64_C(0xffffffff00000000))
     4855        return false;
     4856    if (pMixedCtx->ss.u64Base   & UINT64_C(0xffffffff00000000))
     4857        return false;
     4858    if (pMixedCtx->ds.u64Base   & UINT64_C(0xffffffff00000000))
     4859        return false;
     4860    if (pMixedCtx->fs.u64Base   & UINT64_C(0xffffffff00000000))
     4861        return false;
     4862    if (pMixedCtx->gs.u64Base   & UINT64_C(0xffffffff00000000))
     4863        return false;
     4864    /* All good, bases are 32-bit. */
     4865    return true;
     4866}
    48724867#endif
    48734868
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