VirtualBox

Changeset 100020 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
May 31, 2023 1:09:06 AM (22 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
157695
Message:

VMM/IEM: Draft for execution mode flags and translation block flags. bugref:10369

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IEMInline.h

    r99996 r100020  
    182182}
    183183
     184
     185/**
     186 * Checks if CS, SS, DS and SS are all wide open flat 32-bit segments.
     187 *
     188 * This will reject expand down data segments and conforming code segments.
     189 *
     190 * @returns The indicator.
     191 * @param   pVCpu               The cross context virtual CPU structure of the
     192 *                              calling thread.
     193 */
     194DECLINLINE(uint8_t) iemCalc32BitFlatIndicator(PVMCPUCC pVCpu) RT_NOEXCEPT
     195{
     196    AssertCompile(X86_SEL_TYPE_DOWN == X86_SEL_TYPE_CONF);
     197    return pVCpu->iem.s.enmCpuMode == IEMMODE_32BIT
     198        &&   (  (  pVCpu->cpum.GstCtx.es.Attr.u
     199                 | pVCpu->cpum.GstCtx.cs.Attr.u
     200                 | pVCpu->cpum.GstCtx.ss.Attr.u
     201                 | pVCpu->cpum.GstCtx.ds.Attr.u)
     202              & (X86_SEL_TYPE_ACCESSED | X86_SEL_TYPE_DOWN | X86DESCATTR_UNUSABLE | X86DESCATTR_G | X86DESCATTR_D | X86DESCATTR_P))
     203           ==   (X86_SEL_TYPE_ACCESSED | X86_SEL_TYPE_DOWN | X86DESCATTR_UNUSABLE | X86DESCATTR_G | X86DESCATTR_D | X86DESCATTR_P)
     204        &&    (  (pVCpu->cpum.GstCtx.es.u32Limit + 1)
     205               | (pVCpu->cpum.GstCtx.cs.u32Limit + 1)
     206               | (pVCpu->cpum.GstCtx.ss.u32Limit + 1)
     207               | (pVCpu->cpum.GstCtx.ds.u32Limit + 1))
     208           == 0
     209        &&    (  pVCpu->cpum.GstCtx.es.u64Base
     210               | pVCpu->cpum.GstCtx.cs.u64Base
     211               | pVCpu->cpum.GstCtx.ss.u64Base
     212               | pVCpu->cpum.GstCtx.ds.u64Base)
     213           == 0
     214        ? 1 : 0; /** @todo define a constant/flag for this. */
     215}
     216
    184217#ifndef IEM_WITH_OPAQUE_DECODER_STATE
    185218
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