VirtualBox

Changeset 23107 in vbox


Ignore:
Timestamp:
Sep 17, 2009 4:19:58 PM (15 years ago)
Author:
vboxsync
Message:

Backed out 52463

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r23099 r23107  
    244244    rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled",          1);     /* boolean */   RC_CHECK();
    245245
    246     PCFGMNODE pCPUM;
    247     rc = CFGMR3InsertNode(pRoot, "CPUM", &pCPUM);                                   RC_CHECK();
    248 
    249246    if (osTypeId == "WindowsNT4")
    250247    {
     
    254251         */
    255252        LogRel(("Limiting CPUID leaf count for NT4 guests\n"));
     253        PCFGMNODE pCPUM;
     254        rc = CFGMR3InsertNode(pRoot, "CPUM", &pCPUM);                               RC_CHECK();
    256255        rc = CFGMR3InsertInteger(pCPUM, "NT4LeafLimit", true);                      RC_CHECK();
    257256    }
     
    274273    rc = CFGMR3InsertInteger(pRoot, "HwVirtExtForced",      fHwVirtExtForced);      RC_CHECK();
    275274#endif
    276 
    277     if (!fHWVirtExEnabled && osTypeId == "NetBSD")
    278     {
    279         /*
    280          * Use additional NetBSD-specific raw mode heuristics in PATM and CPUM,
    281          * see #4291.
    282          */
    283         PCFGMNODE pPATM;
    284         rc = CFGMR3InsertNode(pRoot, "PATM", &pPATM);                               RC_CHECK();
    285         rc = CFGMR3InsertInteger(pPATM, "SearchImmediatesBackward", 1);                      RC_CHECK();
    286         rc = CFGMR3InsertInteger(pCPUM, "HideCX8", 1);                      RC_CHECK();
    287     }
    288 
    289275
    290276    PCFGMNODE pHWVirtExt;
  • trunk/src/VBox/VMM/CPUM.cpp

    r23099 r23107  
    528528    }
    529529
    530     PCFGMNODE pCpum = CFGMR3GetChild(CFGMR3GetRoot(pVM), "CPUM");
    531530    /** @cfgm{/CPUM/NT4LeafLimit, boolean, false}
    532531     * Limit the number of standard CPUID leafs to 0..2 to prevent NT4 from
     
    536535     */
    537536    bool fNt4LeafLimit;
    538     CFGMR3QueryBoolDef(pCpum, "NT4LeafLimit", &fNt4LeafLimit, false);
     537    CFGMR3QueryBoolDef(CFGMR3GetChild(CFGMR3GetRoot(pVM), "CPUM"), "NT4LeafLimit", &fNt4LeafLimit, false);
    539538    if (fNt4LeafLimit)
    540539        pCPUM->aGuestCpuIdStd[0].eax = 2;
    541 
    542     /**
    543      * @todo: very hacky, may need to change, once better understand real reason
    544      */
    545     bool fHideCX8;
    546     CFGMR3QueryBoolDef(pCpum, "HideCX8", &fHideCX8, false);
    547     if (fHideCX8)
    548         pCPUM->aGuestCpuIdStd[1].edx &= ~X86_CPUID_FEATURE_EDX_CX8;
    549540
    550541    /*
  • trunk/src/VBox/VMM/PATM/PATM.cpp

    r23099 r23107  
    167167# endif
    168168#endif
    169     pVM->patm.s.uPATMFlags = 0;
    170     bool fSearchBackward;
    171     CFGMR3QueryBoolDef(CFGMR3GetChild(CFGMR3GetRoot(pVM), "PATM"), "SearchImmediatesBackward", &fSearchBackward, false);
    172     if (fSearchBackward)
    173         pVM->patm.s.uPATMFlags |= PATMGFL_SEARCH_IMM_BACKWARD;
    174169
    175170    rc = patmReinit(pVM);
     
    15511546
    15521547/**
    1553  * Checks if few instructions before patch contain something
    1554  * which looks like immediate referring potential patch instruction
    1555  *
    1556  * @returns boolean
    1557  * @param   pVM         The VM to operate on.
    1558  * @param   pInstrGC    Guest context pointer to instruction
    1559  */
    1560 static bool patmHasImmsReferringPatch(PVM pVM, RCPTRTYPE(uint8_t *) pInstrGC)
    1561 {
    1562     int rc;
    1563     uint32_t value;
    1564 
    1565     if (!(pVM->patm.s.uPATMFlags & PATMGFL_SEARCH_IMM_BACKWARD))
    1566         return false;
    1567 
    1568     PVMCPU pCpu = VMMGetCpu0(pVM);
    1569     for (int i = 4; i < 12; i++)
    1570     {
    1571         rc = PGMPhysSimpleReadGCPtr(pCpu, &value, pInstrGC - i, 4);
    1572         if (rc == VINF_SUCCESS)
    1573         {
    1574             if ((uint32_t)(value-(uint32_t)pInstrGC) < 6)
    1575                 return true;
    1576         }
    1577         else
    1578             break;
    1579     }
    1580     return false;
    1581 }
    1582 
    1583 /**
    15841548 * Recompiles the instructions in a code block
    15851549 *
     
    16091573        Log(("patmRecompileCallback: jump to code we've recompiled before %RRv!\n", pCurInstrGC));
    16101574        return patmPatchGenRelJump(pVM, pPatch, pCurInstrGC, OP_JMP, !!(pCpu->prefix & PREFIX_OPSIZE));
    1611     }
    1612 
    1613 
    1614     if (patmHasImmsReferringPatch(pVM, pInstrGC))
    1615     {
    1616         pPatch->flags |= PATMFL_INT3_REPLACEMENT_BLOCK;
    16171575    }
    16181576
  • trunk/src/VBox/VMM/PATM/PATMInternal.h

    r23099 r23107  
    7979#define PATMFL_EXTERNAL_JUMP_INSIDE         RT_BIT_64(33) /** A trampoline patch was created that jumps to an instruction in the patch block */
    8080#define PATMFL_CODE_REFERENCED              RT_BIT_64(34) /** patch block referenced (called, jumped to) by another patch. */
    81 
    82 /* Global flags, affect PATM behavior */
    83 #define PATMGFL_SEARCH_IMM_BACKWARD         RT_BIT_32(0)  /** search backward from priveledged insn for immediates referring inside patch */
    8481
    8582#define SIZEOF_NEARJUMP8                   2 //opcode byte + 1 byte relative offset
     
    523520    STAMCOUNTER             StatFunctionLookupInsert;
    524521    uint32_t                StatU32FunctionMaxSlotsUsed;
    525     uint32_t                uPATMFlags;
     522    uint32_t                Alignment0; /**< Align the structure size on a 8-byte boundrary. */
    526523} PATM, *PPATM;
    527524
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