VirtualBox

Changeset 1981 in vbox for trunk


Ignore:
Timestamp:
Apr 6, 2007 9:20:43 PM (18 years ago)
Author:
vboxsync
Message:

Arg. Forgot that EMInterpretInstructionCPU doesn't accept cpl != 0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMGC/TRPMGCHandlers.cpp

    r1978 r1981  
    678678        /*
    679679         * Handle virtualized TSC reads.
     680         * (EMInterpretInstructionCPU isn't usable here because it rejects cpl != 0.)
    680681         */
    681682        case OP_RDTSC:
    682683        {
    683             uint32_t cbIgnored;
    684             rc = EMInterpretInstructionCPU(pVM, pCpu, pRegFrame, PC, &cbIgnored);
    685             if (VBOX_SUCCESS(rc))
     684            /** @todo statistics */
     685            if (CPUMGetGuestCR4(pVM) & X86_CR4_TSD)
     686                rc = VINF_EM_RAW_EMULATE_INSTR;
     687            else
     688            {
     689                uint64_t Tsc = TMCpuTickGet(pVM);
     690                pRegFrame->eax = Tsc;
     691                pRegFrame->edx = Tsc >> 32;
    686692                pRegFrame->eip += pCpu->opsize;
    687             else if (rc != VERR_EM_INTERPRETER)
    688                 AssertReleaseMsgFailed(("rc=%Vrc\n", rc));    /* Can't happen with RDTSC. */
     693                rc = VINF_SUCCESS;
     694            }
    689695            return trpmGCExitTrap(pVM, rc, pRegFrame);
    690696        }
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