VirtualBox

Changeset 1408 in vbox for trunk/src


Ignore:
Timestamp:
Mar 12, 2007 9:51:47 AM (18 years ago)
Author:
vboxsync
Message:

Initial changes for floating SELM hypervisor selectors.

Location:
trunk/src/VBox/VMM
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/SELM.cpp

    r1335 r1408  
    100100     */
    101101    AssertRelease(!(RT_OFFSETOF(VM, selm.s) & 31));
    102     AssertRelease(!(RT_OFFSETOF(VM, selm.s.Tss) & 15));
     102    AssertRelease(!(RT_OFFSETOF(VM, selm.s.aHyperSel[SELM_HYPER_SEL_TSS]) & 15));
    103103    AssertRelease(sizeof(pVM->selm.s) <= sizeof(pVM->selm.padding));
    104104
     
    106106     * Init the structure.
    107107     */
    108     pVM->selm.s.offVM           = RT_OFFSETOF(VM, selm);
    109     pVM->selm.s.SelCS           = (SELM_GDT_ELEMENTS - 0x1) << 3;
    110     pVM->selm.s.SelDS           = (SELM_GDT_ELEMENTS - 0x2) << 3;
    111     pVM->selm.s.SelCS64         = (SELM_GDT_ELEMENTS - 0x3) << 3;
    112     pVM->selm.s.SelTSS          = (SELM_GDT_ELEMENTS - 0x4) << 3;
    113     pVM->selm.s.SelTSSTrap08    = (SELM_GDT_ELEMENTS - 0x5) << 3;
     108    pVM->selm.s.offVM                                = RT_OFFSETOF(VM, selm);
     109    pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS]         = (SELM_GDT_ELEMENTS - 0x1) << 3;
     110    pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS]         = (SELM_GDT_ELEMENTS - 0x2) << 3;
     111    pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS64]       = (SELM_GDT_ELEMENTS - 0x3) << 3;
     112    pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS]        = (SELM_GDT_ELEMENTS - 0x4) << 3;
     113    pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] = (SELM_GDT_ELEMENTS - 0x5) << 3;
    114114
    115115    /*
     
    208208    {
    209209        PVBOXDESC paGdt = pVM->selm.s.paGdtHC;
    210         rc = PGMMapSetPage(pVM, MMHyperHC2GC(pVM, &paGdt[pVM->selm.s.SelTSSTrap08 >> 3]), sizeof(paGdt[0]),
     210        rc = PGMMapSetPage(pVM, MMHyperHC2GC(pVM, &paGdt[pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] >> 3]), sizeof(paGdt[0]),
    211211                           X86_PTE_RW | X86_PTE_P | X86_PTE_A | X86_PTE_D);
    212212        AssertRC(rc);
    213         rc = PGMMapSetPage(pVM, MMHyperHC2GC(pVM, &paGdt[pVM->selm.s.SelTSS >> 3]), sizeof(paGdt[0]),
     213        rc = PGMMapSetPage(pVM, MMHyperHC2GC(pVM, &paGdt[pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS] >> 3]), sizeof(paGdt[0]),
    214214                           X86_PTE_RW | X86_PTE_P | X86_PTE_A | X86_PTE_D);
    215215        AssertRC(rc);
    216         rc = PGMMapSetPage(pVM, VM_GUEST_ADDR(pVM, &pVM->selm.s.Tss), sizeof(pVM->selm.s.Tss),
     216        rc = PGMMapSetPage(pVM, VM_GUEST_ADDR(pVM, &pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS]), sizeof(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS]),
    217217                           X86_PTE_RW | X86_PTE_P | X86_PTE_A | X86_PTE_D);
    218218        AssertRC(rc);
    219         rc = PGMMapSetPage(pVM, VM_GUEST_ADDR(pVM, &pVM->selm.s.TssTrap08), sizeof(pVM->selm.s.TssTrap08),
     219        rc = PGMMapSetPage(pVM, VM_GUEST_ADDR(pVM, &pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08]), sizeof(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08]),
    220220                           X86_PTE_RW | X86_PTE_P | X86_PTE_A | X86_PTE_D);
    221221        AssertRC(rc);
     
    243243
    244244    /** @todo selector relocations should be a seperate operation? */
    245     CPUMSetHyperCS(pVM, pVM->selm.s.SelCS);
    246     CPUMSetHyperDS(pVM, pVM->selm.s.SelDS);
    247     CPUMSetHyperES(pVM, pVM->selm.s.SelDS);
    248     CPUMSetHyperSS(pVM, pVM->selm.s.SelDS);
    249     CPUMSetHyperTR(pVM, pVM->selm.s.SelTSS);
     245    CPUMSetHyperCS(pVM, pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS]);
     246    CPUMSetHyperDS(pVM, pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS]);
     247    CPUMSetHyperES(pVM, pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS]);
     248    CPUMSetHyperSS(pVM, pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS]);
     249    CPUMSetHyperTR(pVM, pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS]);
    250250
    251251    /*
     
    253253     * Both are wide open (base 0, limit 4GB)
    254254     */
    255     PVBOXDESC   pDesc = &paGdt[pVM->selm.s.SelCS >> 3];
     255    PVBOXDESC   pDesc = &paGdt[pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS] >> 3];
    256256    pDesc->Gen.u16LimitLow      = 0xffff;
    257257    pDesc->Gen.u4LimitHigh      = 0xf;
     
    269269
    270270    /* data */
    271     pDesc = &paGdt[pVM->selm.s.SelDS >> 3];
     271    pDesc = &paGdt[pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS] >> 3];
    272272    pDesc->Gen.u16LimitLow      = 0xffff;
    273273    pDesc->Gen.u4LimitHigh      = 0xf;
     
    285285
    286286    /* 64-bit mode code (& data?) */
    287     pDesc = &paGdt[pVM->selm.s.SelCS64 >> 3];
     287    pDesc = &paGdt[pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS64] >> 3];
    288288    pDesc->Gen.u16LimitLow      = 0xffff;
    289289    pDesc->Gen.u4LimitHigh      = 0xf;
     
    303303     * TSS descriptor
    304304     */
    305     pDesc = &paGdt[pVM->selm.s.SelTSS >> 3];
     305    pDesc = &paGdt[pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS] >> 3];
    306306    RTGCPTR pGCTSS = VM_GUEST_ADDR(pVM, &pVM->selm.s.Tss);
    307307    pDesc->Gen.u16BaseLow       = RT_LOWORD(pGCTSS);
     
    322322     * TSS descriptor for trap 08
    323323     */
    324     pDesc = &paGdt[pVM->selm.s.SelTSSTrap08 >> 3];
     324    pDesc = &paGdt[pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] >> 3];
    325325    pDesc->Gen.u16LimitLow      = sizeof(VBOXTSS) - 1;
    326326    pDesc->Gen.u4LimitHigh      = 0;
     
    345345    /* Current TSS */
    346346    pVM->selm.s.Tss.cr3     = PGMGetHyperCR3(pVM);
    347     pVM->selm.s.Tss.ss0     = pVM->selm.s.SelDS;
     347    pVM->selm.s.Tss.ss0     = pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS];
    348348    pVM->selm.s.Tss.esp0    = VMMGetStackGC(pVM);
    349     pVM->selm.s.Tss.cs      = pVM->selm.s.SelCS;
    350     pVM->selm.s.Tss.ds      = pVM->selm.s.SelDS;
    351     pVM->selm.s.Tss.es      = pVM->selm.s.SelDS;
     349    pVM->selm.s.Tss.cs      = pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS];
     350    pVM->selm.s.Tss.ds      = pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS];
     351    pVM->selm.s.Tss.es      = pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS];
    352352    pVM->selm.s.Tss.offIoBitmap = sizeof(VBOXTSS);
    353353
    354354    /* trap 08 */
    355355    pVM->selm.s.TssTrap08.cr3    = PGMGetInterGCCR3(pVM);                   /* this should give use better survival chances. */
    356     pVM->selm.s.TssTrap08.ss0    = pVM->selm.s.SelDS;
    357     pVM->selm.s.TssTrap08.ss     = pVM->selm.s.SelDS;
     356    pVM->selm.s.TssTrap08.ss0    = pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS];
     357    pVM->selm.s.TssTrap08.ss     = pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS];
    358358    pVM->selm.s.TssTrap08.esp0   = VMMGetStackGC(pVM) - PAGE_SIZE / 2;  /* upper half can be analysed this way. */
    359359    pVM->selm.s.TssTrap08.esp    = pVM->selm.s.TssTrap08.esp0;
    360360    pVM->selm.s.TssTrap08.ebp    = pVM->selm.s.TssTrap08.esp0;
    361     pVM->selm.s.TssTrap08.cs     = pVM->selm.s.SelCS;
    362     pVM->selm.s.TssTrap08.ds     = pVM->selm.s.SelDS;
    363     pVM->selm.s.TssTrap08.es     = pVM->selm.s.SelDS;
     361    pVM->selm.s.TssTrap08.cs     = pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS];
     362    pVM->selm.s.TssTrap08.ds     = pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS];
     363    pVM->selm.s.TssTrap08.es     = pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS];
    364364    pVM->selm.s.TssTrap08.fs     = 0;
    365365    pVM->selm.s.TssTrap08.gs     = 0;
     
    610610    SSMR3PutBool(pSSM, pSelm->fDisableMonitoring);
    611611    SSMR3PutBool(pSSM, pSelm->fSyncTSSRing0Stack);
    612     SSMR3PutSel(pSSM, pSelm->SelCS);
    613     SSMR3PutSel(pSSM, pSelm->SelDS);
    614     SSMR3PutSel(pSSM, pSelm->SelCS64);
    615     SSMR3PutSel(pSSM, pSelm->SelCS64); //reserved for DS64.
    616     SSMR3PutSel(pSSM, pSelm->SelTSS);
    617     return SSMR3PutSel(pSSM, pSelm->SelTSSTrap08);
     612    SSMR3PutSel(pSSM, pSelm->aHyperSel[SELM_HYPER_SEL_CS]);
     613    SSMR3PutSel(pSSM, pSelm->aHyperSel[SELM_HYPER_SEL_DS]);
     614    SSMR3PutSel(pSSM, pSelm->aHyperSel[SELM_HYPER_SEL_CS64]);
     615    SSMR3PutSel(pSSM, pSelm->aHyperSel[SELM_HYPER_SEL_CS64]); //reserved for DS64.
     616    SSMR3PutSel(pSSM, pSelm->aHyperSel[SELM_HYPER_SEL_TSS]);
     617    return SSMR3PutSel(pSSM, pSelm->aHyperSel[SELM_HYPER_SEL_TSS_TRAP08]);
    618618}
    619619
     
    676676    /* Check that no selectors have be relocated. */
    677677    PSELM pSelm = &pVM->selm.s;
    678     if (    SelCS        != pSelm->SelCS
    679         ||  SelDS        != pSelm->SelDS
    680         ||  SelCS64      != pSelm->SelCS64
    681         ||  SelDS64      != pSelm->SelCS64
    682         ||  SelTSS       != pSelm->SelTSS
    683         ||  SelTSSTrap08 != pSelm->SelTSSTrap08)
     678    if (    SelCS        != pSelm->aHyperSel[SELM_HYPER_SEL_CS]
     679        ||  SelDS        != pSelm->aHyperSel[SELM_HYPER_SEL_DS]
     680        ||  SelCS64      != pSelm->aHyperSel[SELM_HYPER_SEL_CS64]
     681        ||  SelDS64      != pSelm->aHyperSel[SELM_HYPER_SEL_CS64]
     682        ||  SelTSS       != pSelm->aHyperSel[SELM_HYPER_SEL_TSS]
     683        ||  SelTSSTrap08 != pSelm->aHyperSel[SELM_HYPER_SEL_TSS_TRAP08])
    684684    {
    685685        AssertMsgFailed(("Some selector have been relocated - this cannot happen!\n"));
     
    744744SELMR3DECL(int) SELMR3GdtSetup(PVM pVM, PCVBOXDESC paGDTEs, unsigned cGDTEs)
    745745{
    746     AssertMsg(cGDTEs <= (unsigned)(pVM->selm.s.SelTSSTrap08 >> 3), ("Oops! the loaded GDT is as large as our.. we assume no clashes!!!\n"));
     746    AssertMsg(cGDTEs <= (unsigned)(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] >> 3), ("Oops! the loaded GDT is as large as our.. we assume no clashes!!!\n"));
    747747
    748748    /*
     
    895895         */
    896896    //    RTSEL aHyperGDT[MAX_NEEDED_HYPERVISOR_GDTS];
    897         if (cbEffLimit >= pVM->selm.s.SelTSSTrap08)
     897        if (cbEffLimit >= pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08])
    898898        {
    899899#if 0
     
    976976         * Check if the Guest GDT intrudes on our GDT entries.
    977977         */
    978         if (cbEffLimit >= pVM->selm.s.SelTSSTrap08)
     978        if (cbEffLimit >= pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08])
    979979        {
    980980            /* Reinitialize our hypervisor GDTs */
    981             pVM->selm.s.SelCS        = aHyperGDT[0];
    982             pVM->selm.s.SelDS        = aHyperGDT[1];
    983             pVM->selm.s.SelCS64      = aHyperGDT[2];
    984             pVM->selm.s.SelTSS       = aHyperGDT[3];
    985             pVM->selm.s.SelTSSTrap08 = aHyperGDT[4];
     981            pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS]        = aHyperGDT[0];
     982            pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS]        = aHyperGDT[1];
     983            pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS64]      = aHyperGDT[2];
     984            pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS]       = aHyperGDT[3];
     985            pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] = aHyperGDT[4];
    986986            SELMR3Relocate(pVM); /** @todo r=bird: Must call VMR3Relocate! */
    987987        }
     
    15451545
    15461546#if 0
    1547     if (GDTR.cbGdt >= (unsigned)(pVM->selm.s.SelTSSTrap08 >> X86_SEL_SHIFT))
     1547    if (GDTR.cbGdt >= (unsigned)(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] >> X86_SEL_SHIFT))
    15481548    {
    15491549        AssertReleaseMsgFailed(("Internal SELM GDT conflict.\n"));
     
    18311831    VBOXDESC    Desc;
    18321832    if (    !(Sel & X86_SEL_LDT)
    1833         && (    pVM->selm.s.SelCS == (Sel & X86_SEL_MASK)
    1834             ||  pVM->selm.s.SelDS == (Sel & X86_SEL_MASK)
    1835             ||  pVM->selm.s.SelCS64 == (Sel & X86_SEL_MASK)
    1836             ||  pVM->selm.s.SelTSS == (Sel & X86_SEL_MASK)
    1837             ||  pVM->selm.s.SelTSSTrap08 == (Sel & X86_SEL_MASK))
     1833        && (    pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS] == (Sel & X86_SEL_MASK)
     1834            ||  pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS] == (Sel & X86_SEL_MASK)
     1835            ||  pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS64] == (Sel & X86_SEL_MASK)
     1836            ||  pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS] == (Sel & X86_SEL_MASK)
     1837            ||  pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] == (Sel & X86_SEL_MASK))
    18381838       )
    18391839    {
     
    19621962         */
    19631963        Desc = pVM->selm.s.paGdtHC[Sel >> X86_SEL_SHIFT];
    1964         pSelInfo->fHyper = pVM->selm.s.SelCS == (Sel & X86_SEL_MASK)
    1965                         || pVM->selm.s.SelDS == (Sel & X86_SEL_MASK)
    1966                         || pVM->selm.s.SelCS64 == (Sel & X86_SEL_MASK)
    1967                         || pVM->selm.s.SelTSS == (Sel & X86_SEL_MASK)
    1968                         || pVM->selm.s.SelTSSTrap08 == (Sel & X86_SEL_MASK);
     1964        pSelInfo->fHyper = pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS] == (Sel & X86_SEL_MASK)
     1965                        || pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS] == (Sel & X86_SEL_MASK)
     1966                        || pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS64] == (Sel & X86_SEL_MASK)
     1967                        || pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS] == (Sel & X86_SEL_MASK)
     1968                        || pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] == (Sel & X86_SEL_MASK);
    19691969        /** @todo check that the GDT offset is valid. */
    19701970    }
     
    21202120            selmR3FormatDescriptor(pVM->selm.s.paGdtHC[iGDT], iGDT << X86_SEL_SHIFT, &szOutput[0], sizeof(szOutput));
    21212121            const char *psz = "";
    2122             if (iGDT == ((unsigned)pVM->selm.s.SelCS >> X86_SEL_SHIFT))
     2122            if (iGDT == ((unsigned)pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS] >> X86_SEL_SHIFT))
    21232123                psz = " HyperCS";
    2124             else if (iGDT == ((unsigned)pVM->selm.s.SelDS >> X86_SEL_SHIFT))
     2124            else if (iGDT == ((unsigned)pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS] >> X86_SEL_SHIFT))
    21252125                psz = " HyperDS";
    2126             else if (iGDT == ((unsigned)pVM->selm.s.SelCS64 >> X86_SEL_SHIFT))
     2126            else if (iGDT == ((unsigned)pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS64] >> X86_SEL_SHIFT))
    21272127                psz = " HyperCS64";
    2128             else if (iGDT == ((unsigned)pVM->selm.s.SelTSS >> X86_SEL_SHIFT))
     2128            else if (iGDT == ((unsigned)pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS] >> X86_SEL_SHIFT))
    21292129                psz = " HyperTSS";
    2130             else if (iGDT == ((unsigned)pVM->selm.s.SelTSSTrap08 >> X86_SEL_SHIFT))
     2130            else if (iGDT == ((unsigned)pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] >> X86_SEL_SHIFT))
    21312131                psz = " HyperTSSTrap08";
    21322132            pHlp->pfnPrintf(pHlp, "%s%s\n", szOutput, psz);
  • trunk/src/VBox/VMM/SELMInternal.h

    r161 r1408  
    4040
    4141/** Number of GDTs we need for internal use */
    42 #define MAX_NEEDED_HYPERVISOR_GDTS      5
     42#define MAX_NEEDED_HYPERVISOR_GDTS          5
    4343
    4444/** The number of GDTS allocated for our GDT. (full size) */
    45 #define SELM_GDT_ELEMENTS               8192
     45#define SELM_GDT_ELEMENTS                   8192
     46
     47/** aHyperSel index to retrieve hypervisor selectors */
     48/** The Flat CS selector used by the VMM inside the GC. */
     49#define SELM_HYPER_SEL_CS                   0
     50/** The Flat DS selector used by the VMM inside the GC. */
     51#define SELM_HYPER_SEL_DS                   1
     52/** The 64-bit mode CS selector used by the VMM inside the GC. */
     53#define SELM_HYPER_SEL_CS64                 2
     54/** The TSS selector used by the VMM inside the GC. */
     55#define SELM_HYPER_SEL_TSS                  3
     56/** The TSS selector for taking trap 08 (\#DF). */
     57#define SELM_HYPER_SEL_TSS_TRAP08           4
     58#define SELM_HYPER_SEL_MAX                  (SELM_HYPER_SEL_TSS_TRAP08+1)
    4659
    4760/**
     
    6376    RTINT                   offVM;
    6477
    65     /** The Flat CS selector used by the VMM inside the GC. */
    66     RTSEL                   SelCS;
    67     /** The Flat DS selector used by the VMM inside the GC. */
    68     RTSEL                   SelDS;
    69     /** The 64-bit mode CS selector used by the VMM inside the GC. */
    70     RTSEL                   SelCS64;
    71     /** The TSS selector used by the VMM inside the GC. */
    72     RTSEL                   SelTSS;
    73     /** The TSS selector for taking trap 08 (\#DF). */
    74     RTSEL                   SelTSSTrap08;
     78    /* Flat CS, DS, 64 bit mode CS, TSS & trap 8 TSS */
     79    RTSEL                   aHyperSel[SELM_HYPER_SEL_MAX];
    7580
    7681    /** Pointer to the GCs - HC Ptr.
  • trunk/src/VBox/VMM/TRPM.cpp

    r1328 r1408  
    621621    for (uint32_t iTrap = 0; iTrap < ELEMENTS(pVM->trpm.s.aGuestTrapHandler); iTrap++)
    622622    {
    623         if (pVM->trpm.s.aGuestTrapHandler[iTrap])
     623        if (pVM->trpm.s.aGuestTrapHandler[iTrap] != TRPM_INVALID_HANDLER)
    624624        {
    625625            Log(("TRPMR3Relocate: iGate=%2X Handler %VGv -> %VGv\n", iTrap, pVM->trpm.s.aGuestTrapHandler[iTrap], pVM->trpm.s.aGuestTrapHandler[iTrap] + offDelta));
  • trunk/src/VBox/VMM/VMMAll/SELMAll.cpp

    r1361 r1408  
    496496SELMDECL(RTSEL) SELMGetTrap8Selector(PVM pVM)
    497497{
    498     return pVM->selm.s.SelTSSTrap08;
     498    return pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08];
    499499}
    500500
     
    657657SELMDECL(RTSEL) SELMGetHyperCS(PVM pVM)
    658658{
    659     return pVM->selm.s.SelCS;
     659    return pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS];
    660660}
    661661
     
    668668SELMDECL(RTSEL) SELMGetHyperCS64(PVM pVM)
    669669{
    670     return pVM->selm.s.SelCS64;
     670    return pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS64];
    671671}
    672672
     
    679679SELMDECL(RTSEL) SELMGetHyperDS(PVM pVM)
    680680{
    681     return pVM->selm.s.SelDS;
     681    return pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS];
    682682}
    683683
     
    690690SELMDECL(RTSEL) SELMGetHyperTSS(PVM pVM)
    691691{
    692     return pVM->selm.s.SelTSS;
     692    return pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS];
    693693}
    694694
     
    701701SELMDECL(RTSEL) SELMGetHyperTSSTrap08(PVM pVM)
    702702{
    703     return pVM->selm.s.SelTSSTrap08;
     703    return pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08];
    704704}
    705705
  • trunk/src/VBox/VMM/VMMGC/SELMGC.cpp

    r1327 r1408  
    7676     */
    7777    RTSEL   Sel = iGDTEntry << X86_SEL_SHIFT;
    78     Assert(   !(pVM->selm.s.SelCS & ~X86_SEL_MASK)
    79            && !(pVM->selm.s.SelDS & ~X86_SEL_MASK)
    80            && !(pVM->selm.s.SelCS64 & ~X86_SEL_MASK)
    81            && !(pVM->selm.s.SelTSS & ~X86_SEL_MASK)
    82            && !(pVM->selm.s.SelTSSTrap08 & ~X86_SEL_MASK));
    83     if (    pVM->selm.s.SelCS        == Sel
    84         ||  pVM->selm.s.SelDS        == Sel
    85         ||  pVM->selm.s.SelCS64      == Sel
    86         ||  pVM->selm.s.SelTSS       == Sel
    87         ||  pVM->selm.s.SelTSSTrap08 == Sel)
     78    Assert(   !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS] & ~X86_SEL_MASK)
     79           && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS] & ~X86_SEL_MASK)
     80           && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS64] & ~X86_SEL_MASK)
     81           && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS] & ~X86_SEL_MASK)
     82           && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] & ~X86_SEL_MASK));
     83    if (    pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS]        == Sel
     84        ||  pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS]        == Sel
     85        ||  pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS64]      == Sel
     86        ||  pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS]       == Sel
     87        ||  pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] == Sel)
    8888    {
    8989        if (Desc.Gen.u1Present)
  • trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp

    r1278 r1408  
    549549    GEN_CHECK_SIZE(SELM);
    550550    GEN_CHECK_OFF(SELM, offVM);
    551     GEN_CHECK_OFF(SELM, SelCS);
    552     GEN_CHECK_OFF(SELM, SelDS);
    553     GEN_CHECK_OFF(SELM, SelCS64);
    554     GEN_CHECK_OFF(SELM, SelTSS);
    555     GEN_CHECK_OFF(SELM, SelTSSTrap08);
     551    GEN_CHECK_OFF(SELM, aHyperSel[SELM_HYPER_SEL_CS]);
     552    GEN_CHECK_OFF(SELM, aHyperSel[SELM_HYPER_SEL_DS]);
     553    GEN_CHECK_OFF(SELM, aHyperSel[SELM_HYPER_SEL_CS64]);
     554    GEN_CHECK_OFF(SELM, aHyperSel[SELM_HYPER_SEL_TSS]);
     555    GEN_CHECK_OFF(SELM, aHyperSel[SELM_HYPER_SEL_TSS_TRAP08]);
    556556    GEN_CHECK_OFF(SELM, paGdtHC);
    557557    GEN_CHECK_OFF(SELM, paGdtGC);
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