VirtualBox

Changeset 42427 in vbox for trunk/include


Ignore:
Timestamp:
Jul 26, 2012 11:48:01 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79529
Message:

VMM: Fixed some selector arithmetic, introducing a new constand and renaming and old one to make things clearer. Also added CPUMGetGuestLdtrEx and make some (but not all) of SELM use this instead of shadow GDT.

Location:
trunk/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.h

    r42420 r42427  
    9191VMMDECL(RTSEL)      CPUMGetGuestTR(PVMCPU pVCpu, PCPUMSELREGHID pHidden);
    9292VMMDECL(RTSEL)      CPUMGetGuestLDTR(PVMCPU pVCpu);
     93VMMDECL(RTSEL)      CPUMGetGuestLdtrEx(PVMCPU pVCpu, uint64_t *pGCPtrBase, uint32_t *pcbLimit);
    9394VMMDECL(uint64_t)   CPUMGetGuestCR0(PVMCPU pVCpu);
    9495VMMDECL(uint64_t)   CPUMGetGuestCR2(PVMCPU pVCpu);
  • trunk/include/VBox/vmm/cpumctx.h

    r42415 r42427  
    8686     && (   (a_pSelReg)->ValidSel == (a_pSelReg)->Sel \
    8787         || (   (a_pVCpu) /*!= NULL*/ \
    88              && (a_pSelReg)->ValidSel == ((a_pSelReg)->Sel & X86_SEL_MASK_RPL) \
     88             && (a_pSelReg)->ValidSel == ((a_pSelReg)->Sel & X86_SEL_MASK_OFF_RPL) \
    8989             && ((a_pSelReg)->Sel      & X86_SEL_RPL) == 1 \
    9090             && ((a_pSelReg)->ValidSel & X86_SEL_RPL) == 0 \
  • trunk/include/VBox/vmm/selm.h

    r42407 r42427  
    8080VMMDECL(int)            SELMValidateAndConvertCSAddr(PVMCPU pVCpu, X86EFLAGS eflags, RTSEL SelCPL, RTSEL SelCS,
    8181                                                     PCPUMSELREG pSRegCS, RTGCPTR Addr, PRTGCPTR ppvFlat);
    82 VMMDECL(int)            SELMGetLDTFromSel(PVM pVM, RTSEL SelLdt, PRTGCPTR ppvLdt, unsigned *pcbLimit);
    8382#ifdef VBOX_WITH_RAW_MODE
    8483VMM_INT_DECL(void)      SELMLoadHiddenSelectorReg(PVMCPU pVCpu, PCCPUMCTX pCtx, PCPUMSELREG pSReg);
  • trunk/include/iprt/x86.h

    r42407 r42427  
    29552955 * The shift used to convert a selector from and to index an index (C).
    29562956 */
    2957 #define X86_SEL_SHIFT       3
     2957#define X86_SEL_SHIFT           3
    29582958
    29592959/**
    29602960 * The mask used to mask off the table indicator and RPL of an selector.
    29612961 */
    2962 #define X86_SEL_MASK        0xfff8U
     2962#define X86_SEL_MASK            0xfff8U
    29632963
    29642964/**
    29652965 * The mask used to mask off the RPL of an selector.
    2966  */
    2967 #define X86_SEL_MASK_RPL    0xfffcU
     2966 * This is suitable for checking for NULL selectors.
     2967 */
     2968#define X86_SEL_MASK_OFF_RPL    0xfffcU
    29682969
    29692970/**
    29702971 * The bit indicating that a selector is in the LDT and not in the GDT.
    29712972 */
    2972 #define X86_SEL_LDT         0x0004U
     2973#define X86_SEL_LDT             0x0004U
     2974
    29732975/**
    29742976 * The bit mask for getting the RPL of a selector.
    29752977 */
    2976 #define X86_SEL_RPL         0x0003U
     2978#define X86_SEL_RPL             0x0003U
     2979
     2980/**
     2981 * The mask covering both RPL and LDT.
     2982 * This is incidentally the same as sizeof(X86DESC) - 1, so good for limit
     2983 * checks.
     2984 */
     2985#define X86_SEL_RPL_LDT         0x0007U
    29772986
    29782987/** @} */
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