VirtualBox

Changeset 2065 in vbox for trunk


Ignore:
Timestamp:
Apr 13, 2007 8:46:06 AM (18 years ago)
Author:
vboxsync
Message:

Use EMInterpretInstructionCPU for rdtsc

File:
1 edited

Legend:

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

    r2013 r2065  
    687687        /*
    688688         * Handle virtualized TSC reads.
    689          * (EMInterpretInstructionCPU isn't usable here because it rejects cpl != 0.)
    690689         */
    691690        case OP_RDTSC:
    692691        {
    693             /** @todo statistics */
    694             if (CPUMGetGuestCR4(pVM) & X86_CR4_TSD)
    695                 rc = VINF_EM_RAW_EMULATE_INSTR;
    696             else
    697             {
    698                 uint64_t Tsc = TMCpuTickGet(pVM);
    699                 pRegFrame->eax = Tsc;
    700                 pRegFrame->edx = Tsc >> 32;
     692            uint32_t cbIgnored;
     693            rc = EMInterpretInstructionCPU(pVM, pCpu, pRegFrame, PC, &cbIgnored);
     694            if (VBOX_SUCCESS(rc))
    701695                pRegFrame->eip += pCpu->opsize;
    702                 rc = VINF_SUCCESS;
    703             }
     696            else if (rc == VERR_EM_INTERPRETER)
     697                rc = VINF_EM_RAW_EXCEPTION_PRIVILEGED;
    704698            return trpmGCExitTrap(pVM, rc, pRegFrame);
    705699        }
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