VirtualBox

Changeset 465 in vbox for trunk/src


Ignore:
Timestamp:
Jan 31, 2007 3:05:57 PM (18 years ago)
Author:
vboxsync
Message:

Added code to emulate rdtsc in the guest context. (disabled)

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

Legend:

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

    r464 r465  
    133133        pVM->cpum.s.CR4.OrMask  = X86_CR4_OSFSXR;
    134134    }
     135
     136#ifdef CPUM_TRAP_RDTSC
     137    pVM->cpum.s.CR4.OrMask |= X86_CR4_TSD;
     138#endif
    135139
    136140    if (!pVM->cpum.s.CPUFeatures.edx.u1MMX)
  • trunk/src/VBox/VMM/VMMGC/TRPMGCHandlers.cpp

    r269 r465  
    572572            return trpmGCExitTrap(pVM, rc, pRegFrame);
    573573        }
     574
     575        case OP_RDTSC:
     576        {
     577            unsigned uCR4 = CPUMGetGuestCR4(pVM);
     578
     579            if (uCR4 & X86_CR4_TSD)
     580                break; /* genuine #GP */
     581
     582            uint64_t uTicks = TMCpuTickGet(pVM);
     583
     584            pRegFrame->eax = uTicks;
     585            pRegFrame->edx = (uTicks >> 32ULL);
     586
     587            pRegFrame->eip += pCpu->opsize;
     588            return trpmGCExitTrap(pVM, VINF_SUCCESS, pRegFrame);
     589        }
    574590    }
    575591
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