VirtualBox

Changeset 35023 in vbox


Ignore:
Timestamp:
Dec 13, 2010 3:25:51 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
68851
Message:

Introduce sane upper and lower limits for the preemption timer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r35005 r35023  
    2121*******************************************************************************/
    2222#define LOG_GROUP LOG_GROUP_HWACCM
     23#include <iprt/asm-amd64-x86.h>
    2324#include <VBox/hwaccm.h>
    2425#include <VBox/pgm.h>
     
    3435#include <VBox/err.h>
    3536#include <VBox/log.h>
    36 #include <iprt/asm-amd64-x86.h>
    3737#include <iprt/assert.h>
    3838#include <iprt/param.h>
     
    19011901    {
    19021902        uint64_t cTicksToDeadline = TMCpuTickGetDeadlineAndTscOffset(pVCpu, &fOffsettedTsc, &pVCpu->hwaccm.s.vmx.u64TSCOffset);
     1903
     1904        /* Make sure the returned values have sane upper and lower boundaries. */
     1905        uint64_t u64CpuHz = SUPGetCpuHzFromGIP(g_pSUPGlobalInfoPage);
     1906
     1907        cTicksToDeadline = RT_MIN(cTicksToDeadline, u64CpuHz / 64);   /* 1/64 of a second */
     1908        cTicksToDeadline = RT_MAX(cTicksToDeadline, u64CpuHz / 2048); /* 1/2048th of a second */
     1909
    19031910        cTicksToDeadline >>= pVM->hwaccm.s.vmx.cPreemptTimerShift;
    19041911        uint32_t cPreemptionTickCount = (uint32_t)RT_MIN(cTicksToDeadline, UINT32_MAX - 16);
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