VirtualBox

Changeset 15605 in vbox for trunk


Ignore:
Timestamp:
Dec 16, 2008 7:54:21 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
41117
Message:

#3281: Making #undef HWACCM_VMX_EMULATE_REALMODE work again, looks like the Windows XP hacks doesn't work and that VT-x doesn't like esp >= ss.limit. Make sure we update the limit and everything else in that case.

Location:
trunk/src
Files:
4 edited

Legend:

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

    r15588 r15605  
    782782
    783783            /* Allocate three pages for the TSS we need for real mode emulation. (2 page for the IO bitmap) */
     784#if 1
    784785            rc = PDMR3VMMDevHeapAlloc(pVM, HWACCM_VTX_TOTAL_DEVHEAP_MEM, (RTR3PTR *)&pVM->hwaccm.s.vmx.pRealModeTSS);
     786#else
     787            rc = VERR_NO_MEMORY; /* simulation of no VMMDev Heap. */
     788#endif
    785789            if (RT_SUCCESS(rc))
    786790            {
    787 
    788791                /* The I/O bitmap starts right after the virtual interrupt redirection bitmap. */
    789792                ASMMemZero32(pVM->hwaccm.s.vmx.pRealModeTSS, sizeof(*pVM->hwaccm.s.vmx.pRealModeTSS));
     
    12491252        if (!CPUMIsGuestInLongModeEx(pCtx))
    12501253        {
     1254            /** @todo   This should (probably) be set on every excursion to the REM,
     1255             *          however it's too risky right now. So, only apply it when we go
     1256             *          back to REM for real mode execution. (The XP hack below doesn't
     1257             *          work reliably without this.) */
     1258            pVM->aCpus[0].hwaccm.s.fContextUseFlags |= HWACCM_CHANGED_ALL_GUEST;
     1259
    12511260            /* Too early for VT-x; Solaris guests will fail with a guru meditation otherwise; same for XP. */
    12521261            if (pCtx->idtr.pIdt == 0 || pCtx->idtr.cbIdt == 0 || pCtx->tr == 0)
     
    12601269            if (pCtx->ssHid.Attr.n.u1Present == 0)
    12611270                return false;
     1271
     1272            /* Windows XP: possible same as above, but new recompiler requires new heuristics?
     1273               VT-x doesn't seem to like something about the guest state and this stuff avoids it. */
     1274            if (pCtx->rsp >= pCtx->ssHid.u32Limit)
     1275                return false;
     1276#if 0
     1277            if (    pCtx->cs >= pCtx->gdtr.cbGdt
     1278                ||  pCtx->ss >= pCtx->gdtr.cbGdt
     1279                ||  pCtx->ds >= pCtx->gdtr.cbGdt
     1280                ||  pCtx->es >= pCtx->gdtr.cbGdt
     1281                ||  pCtx->fs >= pCtx->gdtr.cbGdt
     1282                ||  pCtx->gs >= pCtx->gdtr.cbGdt)
     1283                return false;
     1284#endif
    12621285        }
    12631286    }
     
    15021525}
    15031526
    1504 
    1505 
    1506 
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r15587 r15605  
    14311431        val =   0
    14321432#ifdef HWACCM_VMX_EMULATE_REALMODE
    1433               | X86_CR4_VME
     1433              | (pVM->hwaccm.s.vmx.pRealModeTSS ? X86_CR4_VME : 0)
    14341434#endif
    14351435              | X86_CR4_PAE
     
    31213121
    31223122        VMXReadVMCS(VMX_VMCS64_GUEST_CR0, &val);
    3123         Log(("VMX_VMCS_GUEST_CR0        %RX64\n", val));
     3123        Log(("VMX_VMCS_GUEST_CR0        %RX64\n", (uint64_t)val));
    31243124
    31253125        VMXReadVMCS(VMX_VMCS64_GUEST_CR3, &val);
    3126         Log(("VMX_VMCS_GUEST_CR3        %RGp\n", val));
     3126        Log(("VMX_VMCS_GUEST_CR3        %RX64\n", (uint64_t)val));
    31273127
    31283128        VMXReadVMCS(VMX_VMCS64_GUEST_CR4, &val);
    3129         Log(("VMX_VMCS_GUEST_CR4        %RX64\n", val));
     3129        Log(("VMX_VMCS_GUEST_CR4        %RX64\n", (uint64_t)val));
    31303130
    31313131        VMXReadVMCS(VMX_VMCS_GUEST_RFLAGS, &val);
     
    31423142
    31433143        VMXReadVMCS(VMX_VMCS64_GUEST_GDTR_BASE, &val);
    3144         Log(("VMX_VMCS_GUEST_GDTR_BASE    %RGv\n", val));
     3144        Log(("VMX_VMCS_GUEST_GDTR_BASE    %RX64\n", (uint64_t)val));
    31453145        VMXReadVMCS(VMX_VMCS64_GUEST_IDTR_BASE, &val);
    3146         Log(("VMX_VMCS_GUEST_IDTR_BASE    %RGv\n", val));
     3146        Log(("VMX_VMCS_GUEST_IDTR_BASE    %RX64\n", (uint64_t)val));
    31473147#endif /* VBOX_STRICT */
    31483148        rc = VERR_VMX_INVALID_GUEST_STATE;
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.h

    r15414 r15605  
    263263        Log(("%s Limit        %x\n", szSelReg, val));                \
    264264        VMXReadVMCS(VMX_VMCS64_GUEST_##REG##_BASE,          &val);   \
    265         Log(("%s Base         %RX64\n", szSelReg, val));             \
     265        Log(("%s Base         %RX64\n", szSelReg, (uint64_t)val));   \
    266266        VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, &val);   \
    267267        Log(("%s Attributes   %x\n", szSelReg, val));                \
  • trunk/src/recompiler_new/VBoxRecompiler.c

    r15300 r15605  
    10351035        Ctx.idtr.pIdt      = env->idt.base;
    10361036
     1037        Ctx.gdtr.cbGdt     = env->gdt.limit;
     1038        Ctx.gdtr.pGdt      = env->gdt.base;
     1039
     1040        Ctx.rsp            = env->regs[R_ESP];
     1041#ifdef LOG_ENABLED
     1042        Ctx.rip            = env->eip;
     1043#endif
     1044
    10371045        Ctx.eflags.u32     = env->eflags;
    10381046
     
    13771385    if (!fGlobal && !(env->cr[4] & X86_CR4_PGE))
    13781386        fGlobal = true;
    1379     Log(("remR3FlushTLB: CR0=%RGr CR3=%RGr CR4=%RGr %s\n", env->cr[0], env->cr[3], env->cr[4], fGlobal ? " global" : ""));
     1387    Log(("remR3FlushTLB: CR0=%08RX64 CR3=%08RX64 CR4=%08RX64 %s\n", (uint64_t)env->cr[0], (uint64_t)env->cr[3], (uint64_t)env->cr[4], fGlobal ? " global" : ""));
    13801388
    13811389    /*
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