VirtualBox

Changeset 49966 in vbox


Ignore:
Timestamp:
Dec 17, 2013 8:43:23 PM (11 years ago)
Author:
vboxsync
Message:

CPUM: Added AMD Athlon64 3200+ (130nm) and Pentium4 (mod 4, w/ 64-bit).

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.h

    r49933 r49966  
    240240    ((a_enmMicroarch) >= kCpumMicroarch_Intel_Core7_First && (a_enmMicroarch) <= kCpumMicroarch_Intel_Core7_End)
    241241
    242 /** Predicate macro for catching AMD Family 8H CPUs (aka K8).    */
    243 #define CPUMMICROARCH_IS_AMD_FAM_8H(a_enmMicroarch) \
     242/** Predicate macro for catching AMD Family OFh CPUs (aka K8).    */
     243#define CPUMMICROARCH_IS_AMD_FAM_0FH(a_enmMicroarch) \
    244244    ((a_enmMicroarch) >= kCpumMicroarch_AMD_K8_First && (a_enmMicroarch) <= kCpumMicroarch_AMD_K8_End)
    245245
  • trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp

    r49927 r49966  
    221221
    222222
     223/** @callback_method_impl{FNCPUMRDMSR} */
     224static DECLCALLBACK(int) cpumMsrRd_Ia32BiosSignId(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
     225{
     226    /** @todo fake microcode update. */
     227    *puValue = pRange->uInitOrReadValue;
     228    return VINF_SUCCESS;
     229}
     230
     231
     232/** @callback_method_impl{FNCPUMWRMSR} */
     233static DECLCALLBACK(int) cpumMsrWr_Ia32BiosSignId(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue)
     234{
     235    return VERR_CPUM_RAISE_GP_0;
     236}
     237
     238
    223239/** @callback_method_impl{FNCPUMWRMSR} */
    224240static DECLCALLBACK(int) cpumMsrWr_Ia32BiosUpdateTrigger(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue)
     
    695711    /** @todo implement IA32_PERFSTATUS. */
    696712    *puValue = pRange->uInitOrReadValue;
     713    return VINF_SUCCESS;
     714}
     715
     716
     717/** @callback_method_impl{FNCPUMWRMSR} */
     718static DECLCALLBACK(int) cpumMsrWr_Ia32PerfStatus(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue)
     719{
     720    /* Pentium4 allows writing, but all bits are ignored. */
    697721    return VINF_SUCCESS;
    698722}
     
    14651489
    14661490/** @callback_method_impl{FNCPUMRDMSR} */
     1491static DECLCALLBACK(int) cpumMsrRd_IntelP4EbcHardPowerOn(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
     1492{
     1493    /** @todo P4 hard power on config */
     1494    *puValue = pRange->uInitOrReadValue;
     1495    return VINF_SUCCESS;
     1496}
     1497
     1498
     1499/** @callback_method_impl{FNCPUMWRMSR} */
     1500static DECLCALLBACK(int) cpumMsrWr_IntelP4EbcHardPowerOn(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue)
     1501{
     1502    /** @todo P4 hard power on config */
     1503    return VINF_SUCCESS;
     1504}
     1505
     1506
     1507/** @callback_method_impl{FNCPUMRDMSR} */
     1508static DECLCALLBACK(int) cpumMsrRd_IntelP4EbcSoftPowerOn(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
     1509{
     1510    /** @todo P4 soft power on config  */
     1511    *puValue = pRange->uInitOrReadValue;
     1512    return VINF_SUCCESS;
     1513}
     1514
     1515
     1516/** @callback_method_impl{FNCPUMWRMSR} */
     1517static DECLCALLBACK(int) cpumMsrWr_IntelP4EbcSoftPowerOn(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue)
     1518{
     1519    /** @todo P4 soft power on config */
     1520    return VINF_SUCCESS;
     1521}
     1522
     1523
     1524/** @callback_method_impl{FNCPUMRDMSR} */
     1525static DECLCALLBACK(int) cpumMsrRd_IntelP4EbcFrequencyId(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
     1526{
     1527    /** @todo P4 bus frequency config  */
     1528    *puValue = pRange->uInitOrReadValue;
     1529    return VINF_SUCCESS;
     1530}
     1531
     1532
     1533/** @callback_method_impl{FNCPUMWRMSR} */
     1534static DECLCALLBACK(int) cpumMsrWr_IntelP4EbcFrequencyId(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue)
     1535{
     1536    /** @todo P4 bus frequency config  */
     1537    return VINF_SUCCESS;
     1538}
     1539
     1540
     1541/** @callback_method_impl{FNCPUMRDMSR} */
    14671542static DECLCALLBACK(int) cpumMsrRd_IntelPlatformInfo100MHz(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
    14681543{
     
    28132888
    28142889/** @callback_method_impl{FNCPUMRDMSR} */
     2890static DECLCALLBACK(int) cpumMsrRd_AmdK8FidVidControl(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
     2891{
     2892    /** @todo AMD FIDVID_CTL. */
     2893    *puValue = pRange->uInitOrReadValue;
     2894    return VINF_SUCCESS;
     2895}
     2896
     2897
     2898/** @callback_method_impl{FNCPUMWRMSR} */
     2899static DECLCALLBACK(int) cpumMsrWr_AmdK8FidVidControl(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue)
     2900{
     2901    /** @todo AMD FIDVID_CTL. */
     2902    return VINF_SUCCESS;
     2903}
     2904
     2905
     2906/** @callback_method_impl{FNCPUMRDMSR} */
     2907static DECLCALLBACK(int) cpumMsrRd_AmdK8FidVidStatus(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
     2908{
     2909    /** @todo AMD FIDVID_STATUS. */
     2910    *puValue = pRange->uInitOrReadValue;
     2911    return VINF_SUCCESS;
     2912}
     2913
     2914
     2915/** @callback_method_impl{FNCPUMRDMSR} */
    28152916static DECLCALLBACK(int) cpumMsrRd_AmdK8McCtlMaskN(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
    28162917{
     
    34533554{
    34543555    /** @todo Changing CPUID leaf 0x80000001. */
     3556    return VINF_SUCCESS;
     3557}
     3558
     3559
     3560/** @callback_method_impl{FNCPUMRDMSR} */
     3561static DECLCALLBACK(int) cpumMsrRd_AmdK8PatchLevel(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
     3562{
     3563    /** @todo Fake AMD microcode patching.  */
     3564    *puValue = pRange->uInitOrReadValue;
     3565    return VINF_SUCCESS;
     3566}
     3567
     3568
     3569/** @callback_method_impl{FNCPUMWRMSR} */
     3570static DECLCALLBACK(int) cpumMsrWr_AmdK8PatchLoader(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue)
     3571{
     3572    /** @todo Fake AMD microcode patching.  */
    34553573    return VINF_SUCCESS;
    34563574}
     
    41444262    cpumMsrRd_Ia32ApicBase,
    41454263    cpumMsrRd_Ia32FeatureControl,
     4264    cpumMsrRd_Ia32BiosSignId,
    41464265    cpumMsrRd_Ia32SmmMonitorCtl,
    41474266    cpumMsrRd_Ia32PmcN,
     
    42174336
    42184337    cpumMsrRd_IntelEblCrPowerOn,
     4338    cpumMsrRd_IntelP4EbcHardPowerOn,
     4339    cpumMsrRd_IntelP4EbcSoftPowerOn,
     4340    cpumMsrRd_IntelP4EbcFrequencyId,
    42194341    cpumMsrRd_IntelPlatformInfo100MHz,
    42204342    cpumMsrRd_IntelPlatformInfo133MHz,
     
    43044426    cpumMsrRd_AmdK8HwThermalCtrl,
    43054427    cpumMsrRd_AmdK8SwThermalCtrl,
     4428    cpumMsrRd_AmdK8FidVidControl,
     4429    cpumMsrRd_AmdK8FidVidStatus,
    43064430    cpumMsrRd_AmdK8McCtlMaskN,
    43074431    cpumMsrRd_AmdK8SmiOnIoTrapN,
     
    43414465    cpumMsrRd_AmdK8CpuIdCtlStd01hEdcx,
    43424466    cpumMsrRd_AmdK8CpuIdCtlExt01hEdcx,
     4467    cpumMsrRd_AmdK8PatchLevel,
    43434468    cpumMsrRd_AmdK7DebugStatusMaybe,
    43444469    cpumMsrRd_AmdK7BHTraceBaseMaybe,
     
    43934518    cpumMsrWr_Ia32ApicBase,
    43944519    cpumMsrWr_Ia32FeatureControl,
     4520    cpumMsrWr_Ia32BiosSignId,
    43954521    cpumMsrWr_Ia32BiosUpdateTrigger,
    43964522    cpumMsrWr_Ia32SmmMonitorCtl,
     
    44154541    cpumMsrWr_Ia32Dca0Cap,
    44164542    cpumMsrWr_Ia32PerfEvtSelN,
     4543    cpumMsrWr_Ia32PerfStatus,
    44174544    cpumMsrWr_Ia32PerfCtl,
    44184545    cpumMsrWr_Ia32FixedCtrN,
     
    44464573
    44474574    cpumMsrWr_IntelEblCrPowerOn,
     4575    cpumMsrWr_IntelP4EbcHardPowerOn,
     4576    cpumMsrWr_IntelP4EbcSoftPowerOn,
     4577    cpumMsrWr_IntelP4EbcFrequencyId,
    44484578    cpumMsrWr_IntelPkgCStConfigControl,
    44494579    cpumMsrWr_IntelPmgIoCaptureBase,
     
    45114641    cpumMsrWr_AmdK8HwThermalCtrl,
    45124642    cpumMsrWr_AmdK8SwThermalCtrl,
     4643    cpumMsrWr_AmdK8FidVidControl,
    45134644    cpumMsrWr_AmdK8McCtlMaskN,
    45144645    cpumMsrWr_AmdK8SmiOnIoTrapN,
     
    45474678    cpumMsrWr_AmdK8CpuIdCtlStd01hEdcx,
    45484679    cpumMsrWr_AmdK8CpuIdCtlExt01hEdcx,
     4680    cpumMsrWr_AmdK8PatchLoader,
    45494681    cpumMsrWr_AmdK7DebugStatusMaybe,
    45504682    cpumMsrWr_AmdK7BHTraceBaseMaybe,
     
    47854917    CPUM_ASSERT_RD_MSR_FN(Ia32ApicBase);
    47864918    CPUM_ASSERT_RD_MSR_FN(Ia32FeatureControl);
     4919    CPUM_ASSERT_RD_MSR_FN(Ia32BiosSignId);
    47874920    CPUM_ASSERT_RD_MSR_FN(Ia32SmmMonitorCtl);
    47884921    CPUM_ASSERT_RD_MSR_FN(Ia32PmcN);
     
    48574990
    48584991    CPUM_ASSERT_RD_MSR_FN(IntelEblCrPowerOn);
     4992    CPUM_ASSERT_RD_MSR_FN(IntelP4EbcHardPowerOn);
     4993    CPUM_ASSERT_RD_MSR_FN(IntelP4EbcSoftPowerOn);
     4994    CPUM_ASSERT_RD_MSR_FN(IntelP4EbcFrequencyId);
    48594995    CPUM_ASSERT_RD_MSR_FN(IntelPlatformInfo100MHz);
    48604996    CPUM_ASSERT_RD_MSR_FN(IntelPlatformInfo133MHz);
     
    49445080    CPUM_ASSERT_RD_MSR_FN(AmdK8HwThermalCtrl);
    49455081    CPUM_ASSERT_RD_MSR_FN(AmdK8SwThermalCtrl);
     5082    CPUM_ASSERT_RD_MSR_FN(AmdK8FidVidControl);
     5083    CPUM_ASSERT_RD_MSR_FN(AmdK8FidVidStatus);
    49465084    CPUM_ASSERT_RD_MSR_FN(AmdK8McCtlMaskN);
    49475085    CPUM_ASSERT_RD_MSR_FN(AmdK8SmiOnIoTrapN);
     
    49815119    CPUM_ASSERT_RD_MSR_FN(AmdK8CpuIdCtlStd01hEdcx);
    49825120    CPUM_ASSERT_RD_MSR_FN(AmdK8CpuIdCtlExt01hEdcx);
     5121    CPUM_ASSERT_RD_MSR_FN(AmdK8PatchLevel);
    49835122    CPUM_ASSERT_RD_MSR_FN(AmdK7DebugStatusMaybe);
    49845123    CPUM_ASSERT_RD_MSR_FN(AmdK7BHTraceBaseMaybe);
     
    50235162    CPUM_ASSERT_WR_MSR_FN(Ia32ApicBase);
    50245163    CPUM_ASSERT_WR_MSR_FN(Ia32FeatureControl);
     5164    CPUM_ASSERT_WR_MSR_FN(Ia32BiosSignId);
    50255165    CPUM_ASSERT_WR_MSR_FN(Ia32BiosUpdateTrigger);
    50265166    CPUM_ASSERT_WR_MSR_FN(Ia32SmmMonitorCtl);
     
    50455185    CPUM_ASSERT_WR_MSR_FN(Ia32Dca0Cap);
    50465186    CPUM_ASSERT_WR_MSR_FN(Ia32PerfEvtSelN);
     5187    CPUM_ASSERT_WR_MSR_FN(Ia32PerfStatus);
    50475188    CPUM_ASSERT_WR_MSR_FN(Ia32PerfCtl);
    50485189    CPUM_ASSERT_WR_MSR_FN(Ia32FixedCtrN);
     
    50755216
    50765217    CPUM_ASSERT_WR_MSR_FN(IntelEblCrPowerOn);
     5218    CPUM_ASSERT_WR_MSR_FN(IntelP4EbcHardPowerOn);
     5219    CPUM_ASSERT_WR_MSR_FN(IntelP4EbcSoftPowerOn);
     5220    CPUM_ASSERT_WR_MSR_FN(IntelP4EbcFrequencyId);
    50775221    CPUM_ASSERT_WR_MSR_FN(IntelPkgCStConfigControl);
    50785222    CPUM_ASSERT_WR_MSR_FN(IntelPmgIoCaptureBase);
     
    51405284    CPUM_ASSERT_WR_MSR_FN(AmdK8HwThermalCtrl);
    51415285    CPUM_ASSERT_WR_MSR_FN(AmdK8SwThermalCtrl);
     5286    CPUM_ASSERT_WR_MSR_FN(AmdK8FidVidControl);
    51425287    CPUM_ASSERT_WR_MSR_FN(AmdK8McCtlMaskN);
    51435288    CPUM_ASSERT_WR_MSR_FN(AmdK8SmiOnIoTrapN);
     
    51765321    CPUM_ASSERT_WR_MSR_FN(AmdK8CpuIdCtlStd01hEdcx);
    51775322    CPUM_ASSERT_WR_MSR_FN(AmdK8CpuIdCtlExt01hEdcx);
     5323    CPUM_ASSERT_WR_MSR_FN(AmdK8PatchLoader);
    51785324    CPUM_ASSERT_WR_MSR_FN(AmdK7DebugStatusMaybe);
    51795325    CPUM_ASSERT_WR_MSR_FN(AmdK7BHTraceBaseMaybe);
  • trunk/src/VBox/VMM/VMMR3/CPUMR3Db.cpp

    r49952 r49966  
    173173
    174174
    175 #include "cpus/Intel_Pentium_M_processor_2_00GHz.h"
    176175#include "cpus/Intel_Core_i7_3960X.h"
    177176#include "cpus/Intel_Core_i5_3570.h"
    178177#include "cpus/Intel_Xeon_X5482_3_20GHz.h"
     178#include "cpus/Intel_Pentium_M_processor_2_00GHz.h"
     179#include "cpus/Intel_Pentium_4_3_00GHz.h"
    179180
    180181#include "cpus/AMD_FX_8150_Eight_Core.h"
    181182#include "cpus/AMD_Phenom_II_X6_1100T.h"
    182183#include "cpus/Quad_Core_AMD_Opteron_2384.h"
     184#include "cpus/AMD_Athlon_64_3200.h"
    183185
    184186
     
    204206    &g_Entry_Intel_Xeon_X5482_3_20GHz,
    205207#endif
     208#ifdef VBOX_CPUDB_Intel_Pentium_4_3_00GHz
     209    &g_Entry_Intel_Pentium_4_3_00GHz,
     210#endif
     211
    206212#ifdef VBOX_CPUDB_AMD_FX_8150_Eight_Core
    207213    &g_Entry_AMD_FX_8150_Eight_Core,
     
    212218#ifdef VBOX_CPUDB_Quad_Core_AMD_Opteron_2384
    213219    &g_Entry_Quad_Core_AMD_Opteron_2384,
     220#endif
     221#ifdef VBOX_CPUDB_AMD_Athlon_64_3200
     222    &g_Entry_AMD_Athlon_64_3200,
    214223#endif
    215224};
  • trunk/src/VBox/VMM/include/CPUMInternal.h

    r49927 r49966  
    132132    kCpumMsrRdFn_Ia32ApicBase,
    133133    kCpumMsrRdFn_Ia32FeatureControl,
     134    kCpumMsrRdFn_Ia32BiosSignId,            /**< Range value returned. */
    134135    kCpumMsrRdFn_Ia32SmmMonitorCtl,
    135136    kCpumMsrRdFn_Ia32PmcN,
     
    205206
    206207    kCpumMsrRdFn_IntelEblCrPowerOn,
     208    kCpumMsrRdFn_IntelP4EbcHardPowerOn,
     209    kCpumMsrRdFn_IntelP4EbcSoftPowerOn,
     210    kCpumMsrRdFn_IntelP4EbcFrequencyId,
    207211    kCpumMsrRdFn_IntelPlatformInfo100MHz,
    208212    kCpumMsrRdFn_IntelPlatformInfo133MHz,
     
    292296    kCpumMsrRdFn_AmdK8HwThermalCtrl,        /**< Range value returned. */
    293297    kCpumMsrRdFn_AmdK8SwThermalCtrl,
     298    kCpumMsrRdFn_AmdK8FidVidControl,        /**< Range value returned. */
     299    kCpumMsrRdFn_AmdK8FidVidStatus,         /**< Range value returned. */
    294300    kCpumMsrRdFn_AmdK8McCtlMaskN,
    295301    kCpumMsrRdFn_AmdK8SmiOnIoTrapN,
     
    329335    kCpumMsrRdFn_AmdK8CpuIdCtlStd01hEdcx,
    330336    kCpumMsrRdFn_AmdK8CpuIdCtlExt01hEdcx,
     337    kCpumMsrRdFn_AmdK8PatchLevel,           /**< Returns range value. */
    331338    kCpumMsrRdFn_AmdK7DebugStatusMaybe,
    332339    kCpumMsrRdFn_AmdK7BHTraceBaseMaybe,
     
    390397    kCpumMsrWrFn_Ia32ApicBase,
    391398    kCpumMsrWrFn_Ia32FeatureControl,
     399    kCpumMsrWrFn_Ia32BiosSignId,
    392400    kCpumMsrWrFn_Ia32BiosUpdateTrigger,
    393401    kCpumMsrWrFn_Ia32SmmMonitorCtl,
     
    412420    kCpumMsrWrFn_Ia32Dca0Cap,
    413421    kCpumMsrWrFn_Ia32PerfEvtSelN,           /**< Range value indicates the register number. */
     422    kCpumMsrWrFn_Ia32PerfStatus,
    414423    kCpumMsrWrFn_Ia32PerfCtl,
    415424    kCpumMsrWrFn_Ia32FixedCtrN,             /**< Takes register number of start of range. */
     
    442451    kCpumMsrWrFn_Amd64TscAux,
    443452    kCpumMsrWrFn_IntelEblCrPowerOn,
     453    kCpumMsrWrFn_IntelP4EbcHardPowerOn,
     454    kCpumMsrWrFn_IntelP4EbcSoftPowerOn,
     455    kCpumMsrWrFn_IntelP4EbcFrequencyId,
    444456    kCpumMsrWrFn_IntelPkgCStConfigControl,
    445457    kCpumMsrWrFn_IntelPmgIoCaptureBase,
     
    507519    kCpumMsrWrFn_AmdK8HwThermalCtrl,
    508520    kCpumMsrWrFn_AmdK8SwThermalCtrl,
     521    kCpumMsrWrFn_AmdK8FidVidControl,
    509522    kCpumMsrWrFn_AmdK8McCtlMaskN,
    510523    kCpumMsrWrFn_AmdK8SmiOnIoTrapN,
     
    543556    kCpumMsrWrFn_AmdK8CpuIdCtlStd01hEdcx,
    544557    kCpumMsrWrFn_AmdK8CpuIdCtlExt01hEdcx,
     558    kCpumMsrWrFn_AmdK8PatchLoader,
    545559    kCpumMsrWrFn_AmdK7DebugStatusMaybe,
    546560    kCpumMsrWrFn_AmdK7BHTraceBaseMaybe,
  • trunk/src/VBox/VMM/tools/VBoxCpuReport.cpp

    r49952 r49966  
    6767/** Set if g_enmMicroarch indicates an Intel NetBurst CPU. */
    6868static bool             g_fIntelNetBurst = false;
    69 /** The report stream. */
     69/** The alternative report stream. */
    7070static PRTSTREAM        g_pReportOut;
    71 /** The debug stream. */
     71/** The alternative debug stream. */
    7272static PRTSTREAM        g_pDebugOut;
    7373
     
    7575static void vbCpuRepDebug(const char *pszMsg, ...)
    7676{
     77    va_list va;
     78
     79    /* Always print a copy of the report to standard error. */
     80    va_start(va, pszMsg);
     81    RTStrmPrintfV(g_pStdErr, pszMsg, va);
     82    va_end(va);
     83    RTStrmFlush(g_pStdErr);
     84
     85    /* Alternatively, also print to a log file. */
    7786    if (g_pDebugOut)
    7887    {
    79         va_list va;
    8088        va_start(va, pszMsg);
    8189        RTStrmPrintfV(g_pDebugOut, pszMsg, va);
    8290        va_end(va);
    8391        RTStrmFlush(g_pDebugOut);
    84         RTThreadSleep(1);
    85     }
     92    }
     93
     94    /* Give the output device a chance to write / display it. */
     95    RTThreadSleep(1);
    8696}
    8797
     
    537547                     * Tweaks.  On Intel CPUs we've got trouble detecting
    538548                     * IA32_BIOS_UPDT_TRIG (0x00000079), so we have to add it manually here.
     549                     * Ditto on AMD with PATCH_LOADER (0xc0010020).
    539550                     */
    540551                    if (   uMsr == 0x00000079
     
    542553                        && g_enmMicroarch >= kCpumMicroarch_Intel_P6_Core_Atom_First
    543554                        && g_enmMicroarch <= kCpumMicroarch_Intel_End)
     555                        fGp = false;
     556                    if (   uMsr == 0xc0010020
     557                        && fGp
     558                        && g_enmMicroarch >= kCpumMicroarch_AMD_K8_First
     559                        && g_enmMicroarch <= kCpumMicroarch_AMD_End)
    544560                        fGp = false;
    545561                }
     
    588604        case 0x0000001b: return "IA32_APIC_BASE";
    589605        case 0x00000021: return "C2_UNK_0000_0021"; /* Core2_Penryn */
    590         case 0x0000002a: return "EBL_CR_POWERON";
     606        case 0x0000002a: return g_fIntelNetBurst ? "P4_EBC_HARD_POWERON" : "EBL_CR_POWERON";
     607        case 0x0000002b: return g_fIntelNetBurst ? "P4_EBC_SOFT_POWERON" : NULL;
     608        case 0x0000002c: return g_fIntelNetBurst ? "P4_EBC_FREQUENCY_ID" : NULL;
    591609        case 0x0000002e: return "I7_UNK_0000_002e"; /* SandyBridge, IvyBridge. */
    592610        case 0x0000002f: return "P6_UNK_0000_002f"; /* P6_M_Dothan. */
     
    635653        case 0x0000006f: return "P6_UNK_0000_006f"; /* P6_M_Dothan. */
    636654        case 0x00000079: return "IA32_BIOS_UPDT_TRIG";
     655        case 0x00000080: return "P4_UNK_0000_0080";
    637656        case 0x00000088: return "BBL_CR_D0";
    638657        case 0x00000089: return "BBL_CR_D1";
    639658        case 0x0000008a: return "BBL_CR_D2";
    640         case 0x0000008b: return "BBL_CR_D3|BIOS_SIGN";
     659        case 0x0000008b: return g_enmVendor == CPUMCPUVENDOR_AMD ? "AMD_K8_PATCH_LEVEL"
     660                              : g_fIntelNetBurst ? "IA32_BIOS_SIGN_ID" : "BBL_CR_D3|BIOS_SIGN";
    641661        case 0x0000008c: return "P6_UNK_0000_008c"; /* P6_M_Dothan. */
    642662        case 0x0000008d: return "P6_UNK_0000_008d"; /* P6_M_Dothan. */
     
    748768        case 0x0000019f: return "P6_UNK_0000_019f"; /* P6_M_Dothan. */
    749769        case 0x000001a0: return "IA32_MISC_ENABLE";
    750         case 0x000001a1: return "P6_UNK_0000_01a1"; /* P6_M_Dothan. */
    751         case 0x000001a2: return "I7_MSR_TEMPERATURE_TARGET"; /* SandyBridge, IvyBridge. */
     770        case 0x000001a1: return g_fIntelNetBurst ? "MSR_PLATFORM_BRV" : "P6_UNK_0000_01a1" /* P6_M_Dothan. */;
     771        case 0x000001a2: return g_fIntelNetBurst ? "P4_UNK_0000_01a2" : "I7_MSR_TEMPERATURE_TARGET" /* SandyBridge, IvyBridge. */;
    752772        case 0x000001a4: return "I7_UNK_0000_01a4"; /* SandyBridge, IvyBridge. */
    753773        case 0x000001a6: return "I7_MSR_OFFCORE_RSP_0";
     
    768788                              ? "MSR_LASTBRANCH_TOS" : NULL /* Pentium M Dothan seems to have something else here. */;
    769789        case 0x000001d3: return "P6_UNK_0000_01d3"; /* P6_M_Dothan. */
     790        case 0x000001d7: return g_fIntelNetBurst ? "MSR_LER_FROM_LIP" : NULL;
     791        case 0x000001d8: return g_fIntelNetBurst ? "MSR_LER_TO_LIP"   : NULL;
    770792        case 0x000001d9: return "IA32_DEBUGCTL";
    771         case 0x000001db: return "P6_LAST_BRANCH_FROM_IP"; /* Not exclusive to P6, also AMD. */
    772         case 0x000001dc: return "P6_LAST_BRANCH_TO_IP";
    773         case 0x000001dd: return "P6_LAST_INT_FROM_IP";
    774         case 0x000001de: return "P6_LAST_INT_TO_IP";
     793        case 0x000001da: return g_fIntelNetBurst ? "MSR_LASTBRANCH_TOS" : NULL;
     794        case 0x000001db: return g_fIntelNetBurst ? "P6_LASTBRANCH_0" : "P6_LAST_BRANCH_FROM_IP"; /* Not exclusive to P6, also AMD. */
     795        case 0x000001dc: return g_fIntelNetBurst ? "P6_LASTBRANCH_1" : "P6_LAST_BRANCH_TO_IP";
     796        case 0x000001dd: return g_fIntelNetBurst ? "P6_LASTBRANCH_2" : "P6_LAST_INT_FROM_IP";
     797        case 0x000001de: return g_fIntelNetBurst ? "P6_LASTBRANCH_3" : "P6_LAST_INT_TO_IP";
    775798        case 0x000001e0: return "MSR_ROB_CR_BKUPTMPDR6";
    776799        case 0x000001e1: return "I7_SB_UNK_0000_01e1";
     
    866889        case 0x000002e7: return "I7_IB_UNK_0000_02e7"; /* IvyBridge */
    867890        case 0x000002ff: return "IA32_MTRR_DEF_TYPE";
    868         case 0x00000300: return CPUMMICROARCH_IS_INTEL_NETBURST(g_enmMicroarch) ? "P4_MSR_BPU_COUNTER0"   : "I7_SB_UNK_0000_0300" /* SandyBridge */;
    869         case 0x00000305: return CPUMMICROARCH_IS_INTEL_NETBURST(g_enmMicroarch) ? "P4_MSR_MS_COUNTER1"    : "I7_SB_UNK_0000_0305" /* SandyBridge, IvyBridge */;
    870         case 0x00000309: return CPUMMICROARCH_IS_INTEL_NETBURST(g_enmMicroarch) ? "P4_MSR_FLAME_COUNTER1" : "IA32_FIXED_CTR0";
    871         case 0x0000030a: return CPUMMICROARCH_IS_INTEL_NETBURST(g_enmMicroarch) ? "P4_MSR_FLAME_COUNTER2" : "IA32_FIXED_CTR1";
    872         case 0x0000030b: return CPUMMICROARCH_IS_INTEL_NETBURST(g_enmMicroarch) ? "P4_MSR_FLAME_COUNTER3" : "IA32_FIXED_CTR2";
     891        case 0x00000300: return g_fIntelNetBurst ? "P4_MSR_BPU_COUNTER0"   : "I7_SB_UNK_0000_0300" /* SandyBridge */;
     892        case 0x00000301: return g_fIntelNetBurst ? "P4_MSR_BPU_COUNTER1"   : NULL;
     893        case 0x00000302: return g_fIntelNetBurst ? "P4_MSR_BPU_COUNTER2"   : NULL;
     894        case 0x00000303: return g_fIntelNetBurst ? "P4_MSR_BPU_COUNTER3"   : NULL;
     895        case 0x00000304: return g_fIntelNetBurst ? "P4_MSR_MS_COUNTER0"    : NULL;
     896        case 0x00000305: return g_fIntelNetBurst ? "P4_MSR_MS_COUNTER1"    : "I7_SB_UNK_0000_0305" /* SandyBridge, IvyBridge */;
     897        case 0x00000306: return g_fIntelNetBurst ? "P4_MSR_MS_COUNTER2"    : NULL;
     898        case 0x00000307: return g_fIntelNetBurst ? "P4_MSR_MS_COUNTER3"    : NULL;
     899        case 0x00000308: return g_fIntelNetBurst ? "P4_MSR_FLAME_COUNTER0" : NULL;
     900        case 0x00000309: return g_fIntelNetBurst ? "P4_MSR_FLAME_COUNTER1" : "IA32_FIXED_CTR0";
     901        case 0x0000030a: return g_fIntelNetBurst ? "P4_MSR_FLAME_COUNTER2" : "IA32_FIXED_CTR1";
     902        case 0x0000030b: return g_fIntelNetBurst ? "P4_MSR_FLAME_COUNTER3" : "IA32_FIXED_CTR2";
     903        case 0x0000030c: return g_fIntelNetBurst ? "P4_MSR_IQ_COUNTER0" : NULL;
     904        case 0x0000030d: return g_fIntelNetBurst ? "P4_MSR_IQ_COUNTER1" : NULL;
     905        case 0x0000030e: return g_fIntelNetBurst ? "P4_MSR_IQ_COUNTER2" : NULL;
     906        case 0x0000030f: return g_fIntelNetBurst ? "P4_MSR_IQ_COUNTER3" : NULL;
     907        case 0x00000310: return g_fIntelNetBurst ? "P4_MSR_IQ_COUNTER4" : NULL;
     908        case 0x00000311: return g_fIntelNetBurst ? "P4_MSR_IQ_COUNTER5" : NULL;
    873909        case 0x00000345: return "IA32_PERF_CAPABILITIES";
     910        case 0x00000360: return g_fIntelNetBurst ? "P4_MSR_BPU_CCCR0"   : NULL;
     911        case 0x00000361: return g_fIntelNetBurst ? "P4_MSR_BPU_CCCR1"   : NULL;
     912        case 0x00000362: return g_fIntelNetBurst ? "P4_MSR_BPU_CCCR2"   : NULL;
     913        case 0x00000363: return g_fIntelNetBurst ? "P4_MSR_BPU_CCCR3"   : NULL;
     914        case 0x00000364: return g_fIntelNetBurst ? "P4_MSR_MS_CCCR0"    : NULL;
     915        case 0x00000365: return g_fIntelNetBurst ? "P4_MSR_MS_CCCR1"    : NULL;
     916        case 0x00000366: return g_fIntelNetBurst ? "P4_MSR_MS_CCCR2"    : NULL;
     917        case 0x00000367: return g_fIntelNetBurst ? "P4_MSR_MS_CCCR3"    : NULL;
     918        case 0x00000368: return g_fIntelNetBurst ? "P4_MSR_FLAME_CCCR0" : NULL;
     919        case 0x00000369: return g_fIntelNetBurst ? "P4_MSR_FLAME_CCCR1" : NULL;
     920        case 0x0000036a: return g_fIntelNetBurst ? "P4_MSR_FLAME_CCCR2" : NULL;
     921        case 0x0000036b: return g_fIntelNetBurst ? "P4_MSR_FLAME_CCCR3" : NULL;
     922        case 0x0000036c: return g_fIntelNetBurst ? "P4_MSR_IQ_CCCR0"    : NULL;
     923        case 0x0000036d: return g_fIntelNetBurst ? "P4_MSR_IQ_CCCR1"    : NULL;
     924        case 0x0000036e: return g_fIntelNetBurst ? "P4_MSR_IQ_CCCR2"    : NULL;
     925        case 0x0000036f: return g_fIntelNetBurst ? "P4_MSR_IQ_CCCR3"    : NULL;
     926        case 0x00000370: return g_fIntelNetBurst ? "P4_MSR_IQ_CCCR4"    : NULL;
     927        case 0x00000371: return g_fIntelNetBurst ? "P4_MSR_IQ_CCCR5"    : NULL;
    874928        case 0x0000038d: return "IA32_FIXED_CTR_CTRL";
    875929        case 0x0000038e: return "IA32_PERF_GLOBAL_STATUS";
     
    884938        case 0x00000397: return g_enmMicroarch < kCpumMicroarch_Intel_Core7_IvyBridge   ? NULL                                : "I7_IB_UNK_0000_0397";
    885939        case 0x0000039c: return "I7_SB_MSR_PEBS_NUM_ALT";
    886         case 0x000003b0: return g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "I7_UNC_PMC0" /* X */               : "I7_UNC_ARB_PERF_CTR0";       /* >= S,H */
    887         case 0x000003b1: return g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "I7_UNC_PMC1" /* X */               : "I7_UNC_ARB_PERF_CTR1";       /* >= S,H */
    888         case 0x000003b2: return g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "I7_UNC_PMC2" /* X */               : "I7_UNC_ARB_PERF_EVT_SEL0";   /* >= S,H */
    889         case 0x000003b3: return g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "I7_UNC_PMC3" /* X */               : "I7_UNC_ARB_PERF_EVT_SEL1";   /* >= S,H */
    890         case 0x000003b4: return "I7_UNC_PMC4";
    891         case 0x000003b5: return "I7_UNC_PMC5";
    892         case 0x000003b6: return "I7_UNC_PMC6";
    893         case 0x000003b7: return "I7_UNC_PMC7";
    894         case 0x000003c0: return "I7_UNC_PERF_EVT_SEL0";
    895         case 0x000003c1: return "I7_UNC_PERF_EVT_SEL1";
    896         case 0x000003c2: return "I7_UNC_PERF_EVT_SEL2";
    897         case 0x000003c3: return "I7_UNC_PERF_EVT_SEL3";
    898         case 0x000003c4: return "I7_UNC_PERF_EVT_SEL4";
    899         case 0x000003c5: return "I7_UNC_PERF_EVT_SEL5";
    900         case 0x000003c6: return "I7_UNC_PERF_EVT_SEL6";
    901         case 0x000003c7: return "I7_UNC_PERF_EVT_SEL7";
     940        case 0x000003a0: return g_fIntelNetBurst ? "P4_MSR_BSU_ESCR0"   : NULL;
     941        case 0x000003a1: return g_fIntelNetBurst ? "P4_MSR_BSU_ESCR1"   : NULL;
     942        case 0x000003a2: return g_fIntelNetBurst ? "P4_MSR_FSB_ESCR0"   : NULL;
     943        case 0x000003a3: return g_fIntelNetBurst ? "P4_MSR_FSB_ESCR1"   : NULL;
     944        case 0x000003a4: return g_fIntelNetBurst ? "P4_MSR_FIRM_ESCR0"  : NULL;
     945        case 0x000003a5: return g_fIntelNetBurst ? "P4_MSR_FIRM_ESCR1"  : NULL;
     946        case 0x000003a6: return g_fIntelNetBurst ? "P4_MSR_FLAME_ESCR0" : NULL;
     947        case 0x000003a7: return g_fIntelNetBurst ? "P4_MSR_FLAME_ESCR1" : NULL;
     948        case 0x000003a8: return g_fIntelNetBurst ? "P4_MSR_DAC_ESCR0"   : NULL;
     949        case 0x000003a9: return g_fIntelNetBurst ? "P4_MSR_DAC_ESCR1"   : NULL;
     950        case 0x000003aa: return g_fIntelNetBurst ? "P4_MSR_MOB_ESCR0"   : NULL;
     951        case 0x000003ab: return g_fIntelNetBurst ? "P4_MSR_MOB_ESCR1"   : NULL;
     952        case 0x000003ac: return g_fIntelNetBurst ? "P4_MSR_PMH_ESCR0"   : NULL;
     953        case 0x000003ad: return g_fIntelNetBurst ? "P4_MSR_PMH_ESCR1"   : NULL;
     954        case 0x000003ae: return g_fIntelNetBurst ? "P4_MSR_SAAT_ESCR0"  : NULL;
     955        case 0x000003af: return g_fIntelNetBurst ? "P4_MSR_SAAT_ESCR1"  : NULL;
     956        case 0x000003b0: return g_fIntelNetBurst ? "P4_MSR_U2L_ESCR0" : g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "I7_UNC_PMC0" /* X */               : "I7_UNC_ARB_PERF_CTR0";       /* >= S,H */
     957        case 0x000003b1: return g_fIntelNetBurst ? "P4_MSR_U2L_ESCR1" : g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "I7_UNC_PMC1" /* X */               : "I7_UNC_ARB_PERF_CTR1";       /* >= S,H */
     958        case 0x000003b2: return g_fIntelNetBurst ? "P4_MSR_BPU_ESCR0" : g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "I7_UNC_PMC2" /* X */               : "I7_UNC_ARB_PERF_EVT_SEL0";   /* >= S,H */
     959        case 0x000003b3: return g_fIntelNetBurst ? "P4_MSR_BPU_ESCR1" : g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "I7_UNC_PMC3" /* X */               : "I7_UNC_ARB_PERF_EVT_SEL1";   /* >= S,H */
     960        case 0x000003b4: return g_fIntelNetBurst ? "P4_MSR_IS_ESCR0"    : "I7_UNC_PMC4";
     961        case 0x000003b5: return g_fIntelNetBurst ? "P4_MSR_IS_ESCR1"    : "I7_UNC_PMC5";
     962        case 0x000003b6: return g_fIntelNetBurst ? "P4_MSR_ITLB_ESCR0"  : "I7_UNC_PMC6";
     963        case 0x000003b7: return g_fIntelNetBurst ? "P4_MSR_ITLB_ESCR1"  : "I7_UNC_PMC7";
     964        case 0x000003b8: return g_fIntelNetBurst ? "P4_MSR_CRU_ESCR0"   : NULL;
     965        case 0x000003b9: return g_fIntelNetBurst ? "P4_MSR_CRU_ESCR1"   : NULL;
     966        case 0x000003ba: return g_fIntelNetBurst ? "P4_MSR_IQ_ESCR0"    : NULL;
     967        case 0x000003bb: return g_fIntelNetBurst ? "P4_MSR_IQ_ESCR1"    : NULL;
     968        case 0x000003bc: return g_fIntelNetBurst ? "P4_MSR_RAT_ESCR0"   : NULL;
     969        case 0x000003bd: return g_fIntelNetBurst ? "P4_MSR_RAT_ESCR1"   : NULL;
     970        case 0x000003be: return g_fIntelNetBurst ? "P4_MSR_SSU_ESCR0"   : NULL;
     971        case 0x000003c0: return g_fIntelNetBurst ? "P4_MSR_MS_ESCR0"    : "I7_UNC_PERF_EVT_SEL0";
     972        case 0x000003c1: return g_fIntelNetBurst ? "P4_MSR_MS_ESCR1"    : "I7_UNC_PERF_EVT_SEL1";
     973        case 0x000003c2: return g_fIntelNetBurst ? "P4_MSR_TBPU_ESCR0"  : "I7_UNC_PERF_EVT_SEL2";
     974        case 0x000003c3: return g_fIntelNetBurst ? "P4_MSR_TBPU_ESCR1"  : "I7_UNC_PERF_EVT_SEL3";
     975        case 0x000003c4: return g_fIntelNetBurst ? "P4_MSR_TC_ESCR0"    : "I7_UNC_PERF_EVT_SEL4";
     976        case 0x000003c5: return g_fIntelNetBurst ? "P4_MSR_TC_ESCR1"    : "I7_UNC_PERF_EVT_SEL5";
     977        case 0x000003c6: return g_fIntelNetBurst ? NULL                 : "I7_UNC_PERF_EVT_SEL6";
     978        case 0x000003c7: return g_fIntelNetBurst ? NULL                 : "I7_UNC_PERF_EVT_SEL7";
     979        case 0x000003c8: return g_fIntelNetBurst ? "P4_MSR_IX_ESCR0"    : NULL;
     980        case 0x000003c9: return g_fIntelNetBurst ? "P4_MSR_IX_ESCR0"    : NULL;
     981        case 0x000003ca: return g_fIntelNetBurst ? "P4_MSR_ALF_ESCR0"   : NULL;
     982        case 0x000003cb: return g_fIntelNetBurst ? "P4_MSR_ALF_ESCR1"   : NULL;
     983        case 0x000003cc: return g_fIntelNetBurst ? "P4_MSR_CRU_ESCR2"   : NULL;
     984        case 0x000003cd: return g_fIntelNetBurst ? "P4_MSR_CRU_ESCR3"   : NULL;
     985        case 0x000003e0: return g_fIntelNetBurst ? "P4_MSR_CRU_ESCR4"   : NULL;
     986        case 0x000003e1: return g_fIntelNetBurst ? "P4_MSR_CRU_ESCR5"   : NULL;
     987        case 0x000003f0: return g_fIntelNetBurst ? "P4_MSR_TC_PRECISE_EVENT" : NULL;
    902988        case 0x000003f1: return "IA32_PEBS_ENABLE";
    903         case 0x000003f6: return "I7_MSR_PEBS_LD_LAT";
    904         case 0x000003f8: return "I7_MSR_PKG_C3_RESIDENCY";
     989        case 0x000003f2: return g_fIntelNetBurst ? "P4_MSR_PEBS_MATRIX_VERT" : "IA32_PEBS_ENABLE";
     990        case 0x000003f3: return g_fIntelNetBurst ? "P4_UNK_0000_03f3" : NULL;
     991        case 0x000003f4: return g_fIntelNetBurst ? "P4_UNK_0000_03f4" : NULL;
     992        case 0x000003f5: return g_fIntelNetBurst ? "P4_UNK_0000_03f5" : NULL;
     993        case 0x000003f6: return g_fIntelNetBurst ? "P4_UNK_0000_03f6" : "I7_MSR_PEBS_LD_LAT";
     994        case 0x000003f7: return g_fIntelNetBurst ? "P4_UNK_0000_03f7" : "I7_MSR_PEBS_LD_LAT";
     995        case 0x000003f8: return g_fIntelNetBurst ? "P4_UNK_0000_03f8" : "I7_MSR_PKG_C3_RESIDENCY";
    905996        case 0x000003f9: return "I7_MSR_PKG_C6_RESIDENCY";
    906997        case 0x000003fa: return "I7_MSR_PKG_C7_RESIDENCY";
     
    10741165        case 0xc001001e: return "AMD_K8_MANID";
    10751166        case 0xc001001f: return "AMD_K8_NB_CFG1";
    1076         case 0xc0010021: return "AMD_10H_UNK_c001_0021";
     1167        case 0xc0010020: return "AMD_K8_PATCH_LOADER";
     1168        case 0xc0010021: return "AMD_K8_UNK_c001_0021";
    10771169        case 0xc0010022: return "AMD_K8_MC_XCPT_REDIR";
    10781170        case 0xc0010028: return "AMD_K8_UNK_c001_0028";
     
    10901182        case 0xc001003e: return "AMD_K8_HTC";
    10911183        case 0xc001003f: return "AMD_K8_STC";
     1184        case 0xc0010041: return "AMD_K8_FIDVID_CTL";
     1185        case 0xc0010042: return "AMD_K8_FIDVID_STATUS";
    10921186        case 0xc0010043: return "AMD_K8_THERMTRIP_STATUS"; /* BDKG says it was removed in K8 revision C.*/
    10931187        case 0xc0010044: return "AMD_K8_MC_CTL_MASK_0";
     
    11381232        case 0xc0010112: return "AMD_K8_SMM_ADDR";
    11391233        case 0xc0010113: return "AMD_K8_SMM_MASK";
    1140         case 0xc0010114: return "AMD_K8_VM_CR";
    1141         case 0xc0010115: return "AMD_K8_IGNNE";
    1142         case 0xc0010116: return "AMD_K8_SMM_CTL";
    1143         case 0xc0010117: return "AMD_K8_VM_HSAVE_PA";
    1144         case 0xc0010118: return "AMD_10H_VM_LOCK_KEY";
    1145         case 0xc0010119: return "AMD_10H_SSM_LOCK_KEY";
    1146         case 0xc001011a: return "AMD_10H_LOCAL_SMI_STS";
     1234        case 0xc0010114: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm_AMDV ? "AMD_K8_VM_CR"          : "AMD_K8_UNK_c001_0114";
     1235        case 0xc0010115: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm      ? "AMD_K8_IGNNE"          : "AMD_K8_UNK_c001_0115";
     1236        case 0xc0010116: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm      ? "AMD_K8_SMM_CTL"        : "AMD_K8_UNK_c001_0116";
     1237        case 0xc0010117: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm_AMDV ? "AMD_K8_VM_HSAVE_PA"    : "AMD_K8_UNK_c001_0117";
     1238        case 0xc0010118: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm_AMDV ? "AMD_10H_VM_LOCK_KEY"   : "AMD_K8_UNK_c001_0118";
     1239        case 0xc0010119: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm      ? "AMD_10H_SSM_LOCK_KEY"  : "AMD_K8_UNK_c001_0119";
     1240        case 0xc001011a: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm      ? "AMD_10H_LOCAL_SMI_STS" : "AMD_K8_UNK_c001_011a";
     1241        case 0xc001011b: return "AMD_K8_UNK_c001_011b";
     1242        case 0xc001011c: return "AMD_K8_UNK_c001_011c";
    11471243        case 0xc0010140: return "AMD_10H_OSVW_ID_LEN";
    11481244        case 0xc0010141: return "AMD_10H_OSVW_STS";
     
    15381634        case 0x00000010: return "Ia32TimestampCounter";
    15391635        case 0x0000001b: return "Ia32ApicBase";
    1540         case 0x0000002a: *pfTakesValue = true; return "IntelEblCrPowerOn";
     1636        case 0x0000002a: *pfTakesValue = true; return g_fIntelNetBurst ? "IntelP4EbcHardPowerOn" : "IntelEblCrPowerOn";
     1637        case 0x0000002b: *pfTakesValue = true; return g_fIntelNetBurst ? "IntelP4EbcSoftPowerOn" : NULL;
     1638        case 0x0000002c: *pfTakesValue = true; return g_fIntelNetBurst ? "IntelP4EbcFrequencyId" : NULL;
    15411639        //case 0x00000033: return "IntelTestCtl";
    15421640        case 0x0000003a: return "Ia32FeatureControl";
     
    15521650            return "IntelLastBranchFromToN";
    15531651
     1652        case 0x0000008b: return g_enmVendor == CPUMCPUVENDOR_AMD ? "AmdK8PatchLevel" : "Ia32BiosSignId";
    15541653        case 0x0000009b: return "Ia32SmmMonitorCtl";
    15551654
     
    16091708        case 0x00000186: return "Ia32PerfEvtSelN";
    16101709        case 0x00000187: return "Ia32PerfEvtSelN";
    1611         case 0x00000193: return /*CPUMMICROARCH_IS_INTEL_NETBURST(g_enmMicroarch) ? NULL :*/ NULL /* Core2_Penryn. */;
     1710        case 0x00000193: return /*g_fIntelNetBurst ? NULL :*/ NULL /* Core2_Penryn. */;
    16121711        case 0x00000198: *pfTakesValue = true; return "Ia32PerfStatus";
    16131712        case 0x00000199: *pfTakesValue = true; return "Ia32PerfCtl";
     
    16261725                                && g_enmMicroarch <= kCpumMicroarch_Intel_P6_Core_Atom_End
    16271726                              ? "IntelLastBranchTos" : NULL /* Pentium M Dothan seems to have something else here. */;
     1727        case 0x000001d7: return g_fIntelNetBurst ? "P6LastIntFromIp" : NULL;
     1728        case 0x000001d8: return g_fIntelNetBurst ? "P6LastIntToIp"   : NULL;
    16281729        case 0x000001d9: return "Ia32DebugCtl";
    1629         case 0x000001db: return "P6LastBranchFromIp";
    1630         case 0x000001dc: return "P6LastBranchToIp";
    1631         case 0x000001dd: return "P6LastIntFromIp";
    1632         case 0x000001de: return "P6LastIntToIp";
     1730        case 0x000001da: return g_fIntelNetBurst ? "IntelLastBranchTos" : NULL;
     1731        case 0x000001db: return g_fIntelNetBurst ? "IntelLastBranchFromToN" : "P6LastBranchFromIp";
     1732        case 0x000001dc: return g_fIntelNetBurst ? "IntelLastBranchFromToN" : "P6LastBranchToIp";
     1733        case 0x000001dd: return g_fIntelNetBurst ? "IntelLastBranchFromToN" : "P6LastIntFromIp";
     1734        case 0x000001de: return g_fIntelNetBurst ? "IntelLastBranchFromToN" : "P6LastIntToIp";
    16331735        case 0x000001f0: return "IntelI7VirtualLegacyWireCap"; /* SandyBridge. */
    16341736        case 0x000001f2: return "Ia32SmrrPhysBase";
     
    16671769
    16681770        case 0x000002ff: return "Ia32MtrrDefType";
    1669         //case 0x00000305: return CPUMMICROARCH_IS_INTEL_NETBURST(g_enmMicroarch) ? TODO : NULL;
    1670         case 0x00000309: return CPUMMICROARCH_IS_INTEL_NETBURST(g_enmMicroarch) ? NULL /** @todo P4 */ : "Ia32FixedCtrN";
    1671         case 0x0000030a: return CPUMMICROARCH_IS_INTEL_NETBURST(g_enmMicroarch) ? NULL /** @todo P4 */ : "Ia32FixedCtrN";
    1672         case 0x0000030b: return CPUMMICROARCH_IS_INTEL_NETBURST(g_enmMicroarch) ? NULL /** @todo P4 */ : "Ia32FixedCtrN";
     1771        //case 0x00000305: return g_fIntelNetBurst ? TODO : NULL;
     1772        case 0x00000309: return g_fIntelNetBurst ? NULL /** @todo P4 */ : "Ia32FixedCtrN";
     1773        case 0x0000030a: return g_fIntelNetBurst ? NULL /** @todo P4 */ : "Ia32FixedCtrN";
     1774        case 0x0000030b: return g_fIntelNetBurst ? NULL /** @todo P4 */ : "Ia32FixedCtrN";
    16731775        case 0x00000345: *pfTakesValue = true; return "Ia32PerfCapabilities";
     1776        /* Note! Lots of P4 MSR 0x00000360..0x00000371. */
    16741777        case 0x0000038d: return "Ia32FixedCtrCtrl";
    16751778        case 0x0000038e: *pfTakesValue = true; return "Ia32PerfGlobalStatus";
     
    16831786        case 0x00000396: return g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "IntelI7UncAddrOpcodeMatch" /* X */ : "IntelI7UncCBoxConfig";       /* >= S,H */
    16841787        case 0x0000039c: return "IntelI7SandyPebsNumAlt";
    1685         case 0x000003b0: return g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "IntelI7UncPmcN" /* X */            : "IntelI7UncArbPerfCtrN";      /* >= S,H */
    1686         case 0x000003b1: return g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "IntelI7UncPmcN" /* X */            : "IntelI7UncArbPerfCtrN";      /* >= S,H */
    1687         case 0x000003b2: return g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "IntelI7UncPmcN" /* X */            : "IntelI7UncArbPerfEvtSelN";   /* >= S,H */
    1688         case 0x000003b3: return g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "IntelI7UncPmcN" /* X */            : "IntelI7UncArbPerfEvtSelN";   /* >= S,H */
     1788         /* Note! Lots of P4 MSR 0x000003a0..0x000003e1. */
     1789        case 0x000003b0: return g_fIntelNetBurst ? NULL : g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "IntelI7UncPmcN" /* X */            : "IntelI7UncArbPerfCtrN";      /* >= S,H */
     1790        case 0x000003b1: return g_fIntelNetBurst ? NULL : g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "IntelI7UncPmcN" /* X */            : "IntelI7UncArbPerfCtrN";      /* >= S,H */
     1791        case 0x000003b2: return g_fIntelNetBurst ? NULL : g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "IntelI7UncPmcN" /* X */            : "IntelI7UncArbPerfEvtSelN";   /* >= S,H */
     1792        case 0x000003b3: return g_fIntelNetBurst ? NULL : g_enmMicroarch < kCpumMicroarch_Intel_Core7_SandyBridge ? "IntelI7UncPmcN" /* X */            : "IntelI7UncArbPerfEvtSelN";   /* >= S,H */
    16891793        case 0x000003b4: case 0x000003b5: case 0x000003b6: case 0x000003b7:
    1690             return "IntelI7UncPmcN";
     1794            return g_fIntelNetBurst ? NULL : "IntelI7UncPmcN";
    16911795        case 0x000003c0: case 0x000003c1: case 0x000003c2: case 0x000003c3:
    16921796        case 0x000003c4: case 0x000003c5: case 0x000003c6: case 0x000003c7:
    1693             return "IntelI7UncPerfEvtSelN";
     1797            return g_fIntelNetBurst ? NULL : "IntelI7UncPerfEvtSelN";
    16941798        case 0x000003f1: return "Ia32PebsEnable";
    1695         case 0x000003f6: return "IntelI7PebsLdLat";
    1696         case 0x000003f8: return "IntelI7PkgCnResidencyN";
     1799        case 0x000003f6: return g_fIntelNetBurst ? NULL /*??*/ : "IntelI7PebsLdLat";
     1800        case 0x000003f8: return g_fIntelNetBurst ? NULL : "IntelI7PkgCnResidencyN";
    16971801        case 0x000003f9: return "IntelI7PkgCnResidencyN";
    16981802        case 0x000003fa: return "IntelI7PkgCnResidencyN";
     
    18181922        case 0xc001001a: case 0xc001001d: return "AmdK8TopOfMemN";
    18191923        case 0xc001001f: return "AmdK8NbCfg1";
     1924        case 0xc0010020: return "AmdK8PatchLoader";
    18201925        case 0xc0010022: return "AmdK8McXcptRedir";
    18211926        case 0xc0010030: case 0xc0010031: case 0xc0010032:
     
    18241929        case 0xc001003e: *pfTakesValue = true; return "AmdK8HwThermalCtrl";
    18251930        case 0xc001003f: return "AmdK8SwThermalCtrl";
     1931        case 0xc0010041: *pfTakesValue = true; return "AmdK8FidVidControl";
     1932        case 0xc0010042: *pfTakesValue = true; return "AmdK8FidVidStatus";
    18261933        case 0xc0010044: case 0xc0010045: case 0xc0010046: case 0xc0010047:
    18271934        case 0xc0010048: case 0xc0010049: case 0xc001004a: //case 0xc001004b:
     
    18531960        case 0xc0010112: return "AmdK8SmmAddr";     /** @todo probably misdetected ign/gp due to locking */
    18541961        case 0xc0010113: return "AmdK8SmmMask";     /** @todo probably misdetected ign/gp due to locking */
    1855         case 0xc0010114: return "AmdK8VmCr";        /** @todo probably misdetected due to locking */
    1856         case 0xc0010115: return "AmdK8IgnNe";
    1857         case 0xc0010116: return "AmdK8SmmCtl";
    1858         case 0xc0010117: return "AmdK8VmHSavePa";   /** @todo probably misdetected due to locking */
    1859         case 0xc0010118: return "AmdFam10hVmLockKey";
    1860         case 0xc0010119: return "AmdFam10hSmmLockKey"; /* Not documented by BKDG, found in netbsd patch. */
    1861         case 0xc001011a: return "AmdFam10hLocalSmiStatus";
     1962        case 0xc0010114: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm_AMDV ? "AmdK8VmCr" : NULL;        /** @todo probably misdetected due to locking */
     1963        case 0xc0010115: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm      ? "AmdK8IgnNe" : NULL;
     1964        case 0xc0010116: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm      ? "AmdK8SmmCtl" : NULL;
     1965        case 0xc0010117: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm_AMDV ? "AmdK8VmHSavePa" : NULL;   /** @todo probably misdetected due to locking */
     1966        case 0xc0010118: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm_AMDV ? "AmdFam10hVmLockKey" : NULL;
     1967        case 0xc0010119: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm      ? "AmdFam10hSmmLockKey" : NULL; /* Not documented by BKDG, found in netbsd patch. */
     1968        case 0xc001011a: return g_enmMicroarch >= kCpumMicroarch_AMD_K8_90nm      ? "AmdFam10hLocalSmiStatus" : NULL;
    18621969        case 0xc0010140: *pfTakesValue = true; return "AmdFam10hOsVisWrkIdLength";
    18631970        case 0xc0010141: *pfTakesValue = true; return "AmdFam10hOsVisWrkStatus";
     
    20352142        case 0x00000040: case 0x00000041: case 0x00000042: case 0x00000043:
    20362143        case 0x00000044: case 0x00000045: case 0x00000046: case 0x00000047:
     2144        case 0x00000600:
    20372145            if (g_enmMicroarch >= kCpumMicroarch_Intel_Core2_First)
    20382146                return UINT64_C(0xffff800000000000);
    20392147            break;
     2148
     2149
     2150        /* Write only bits. */
     2151        case 0xc0010041: return RT_BIT_64(16); /* FIDVID_CTL.InitFidVid */
    20402152
    20412153        /* Time counters - fudge them to avoid incorrect ignore masks. */
     
    21062218            return VBCPUREPBADNESS_BOND_VILLAIN;
    21072219
     2220        case 0xc0011012:
     2221            if (CPUMMICROARCH_IS_AMD_FAM_0FH(g_enmMicroarch))
     2222                return VBCPUREPBADNESS_MIGHT_BITE;
     2223            break;
     2224
    21082225        case 0x000001a0: /* IA32_MISC_ENABLE */
    21092226        case 0x00000199: /* IA32_PERF_CTL */
     
    27212838    uint64_t fSkipMask = 0;
    27222839
    2723     /** @todo test & adjust on P4. */
    2724     if (   (   g_enmMicroarch >= kCpumMicroarch_Intel_NB_First
    2725             && g_enmMicroarch <= kCpumMicroarch_Intel_NB_End)
    2726         || (   g_enmMicroarch >= kCpumMicroarch_Intel_Core7_Broadwell
     2840    if (   (   g_enmMicroarch >= kCpumMicroarch_Intel_Core7_Broadwell
    27272841            && g_enmMicroarch <= kCpumMicroarch_Intel_Core7_End)
    27282842        || (   g_enmMicroarch >= kCpumMicroarch_Intel_Atom_Airmount
     
    30153129        || vbCpuRepSupportsNX())
    30163130        fSkipMask |= MSR_K6_EFER_NXE;
     3131
     3132    /* NetBurst prescott 2MB (model 4) hung or triple faulted here.  The extra
     3133       sleep or something seemed to help for some screwed up reason. */
     3134    if (g_fIntelNetBurst)
     3135    {
     3136        // This doesn't matter:
     3137        //fSkipMask |= MSR_K6_EFER_SCE;
     3138        //if (vbCpuRepSupportsLongMode())
     3139        //    fSkipMask |= MSR_K6_EFER_LMA;
     3140        //vbCpuRepDebug("EFER - netburst workaround - ignore SCE & LMA (fSkipMask=%#llx)\n", fSkipMask);
     3141
     3142        vbCpuRepDebug("EFER - netburst sleep fudge - fSkipMask=%#llx\n", fSkipMask);
     3143        RTThreadSleep(1000);
     3144    }
     3145
    30173146    return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, NULL);
    30183147}
     
    31793308    if (g_enmMicroarch >= kCpumMicroarch_AMD_K8_First && g_enmMicroarch < kCpumMicroarch_AMD_15h_First)
    31803309        fSkipMask |= RT_BIT(9);  /* SetDirtyEnS */
    3181     if (   CPUMMICROARCH_IS_AMD_FAM_8H(g_enmMicroarch)
     3310    if (   CPUMMICROARCH_IS_AMD_FAM_0FH(g_enmMicroarch)
    31823311        || CPUMMICROARCH_IS_AMD_FAM_10H(g_enmMicroarch))
    31833312        fSkipMask |= RT_BIT(8);  /* SetDirtyEnE */
    3184     if (   CPUMMICROARCH_IS_AMD_FAM_8H(g_enmMicroarch)
     3313    if (   CPUMMICROARCH_IS_AMD_FAM_0FH(g_enmMicroarch)
    31853314        || CPUMMICROARCH_IS_AMD_FAM_11H(g_enmMicroarch) )
    31863315        fSkipMask |= RT_BIT(7)   /* SysVicLimit */
     
    32133342                  |  RT_BIT(9);  /* MonMwaitDis */
    32143343    fSkipMask |= RT_BIT(8);      /* #IGNNE port emulation */
    3215     if (   CPUMMICROARCH_IS_AMD_FAM_8H(g_enmMicroarch)
     3344    if (   CPUMMICROARCH_IS_AMD_FAM_0FH(g_enmMicroarch)
    32163345        || CPUMMICROARCH_IS_AMD_FAM_11H(g_enmMicroarch) )
    32173346        fSkipMask |= RT_BIT(7)   /* DisLock */
     
    32193348    fSkipMask |= RT_BIT(4);      /* INVD to WBINVD */
    32203349    fSkipMask |= RT_BIT(3);      /* TLBCACHEDIS */
    3221     if (   CPUMMICROARCH_IS_AMD_FAM_8H(g_enmMicroarch)
     3350    if (   CPUMMICROARCH_IS_AMD_FAM_0FH(g_enmMicroarch)
    32223351        || CPUMMICROARCH_IS_AMD_FAM_10H(g_enmMicroarch)
    32233352        || CPUMMICROARCH_IS_AMD_FAM_11H(g_enmMicroarch) )
     
    34803609        uint64_t    uValue     = paMsrs[i].uValue;
    34813610        int         rc;
    3482 #if 0
    3483         if (uMsr >= 0x10011007)
     3611#if 1
     3612        if (uMsr >= 0xc0000000 && g_fIntelNetBurst)
    34843613        {
    34853614            vbCpuRepDebug("produceMsrReport: uMsr=%#x (%s)...\n", uMsr, getMsrNameHandled(uMsr));
     
    35243653        else if (uMsr >= 0x000001a6 && uMsr <= 0x000001a7)
    35253654            rc = reportMsr_GenRangeFunction(&paMsrs[i], cMsrs - i, 2 /*cMax*/, "IntelI7MsrOffCoreResponseN", &i);
     3655        else if (uMsr == 0x000001db && g_fIntelNetBurst)
     3656            rc = reportMsr_GenRangeFunction(&paMsrs[i], cMsrs - i, 4 /*cMax*/, "IntelLastBranchFromToN", &i);
    35263657        else if (uMsr == 0x00000200)
    35273658            rc = reportMsr_Ia32MtrrPhysBaseMaskN(&paMsrs[i], cMsrs - i, &i);
     
    35323663        else if (uMsr == 0x000002ff)
    35333664            rc = reportMsr_Ia32MtrrDefType(uMsr);
    3534         else if (uMsr >= 0x00000309 && uMsr <= 0x0000030b)
     3665        else if (uMsr >= 0x00000309 && uMsr <= 0x0000030b && !g_fIntelNetBurst)
    35353666            rc = reportMsr_GenRangeFunctionEx(&paMsrs[i], cMsrs - i, 3 /*cMax*/, NULL, 0x00000309, true /*fEarlyEndOk*/, false, 0, &i);
    3536         else if (uMsr == 0x000003f8 || uMsr == 0x000003fc || uMsr == 0x0000060a)
     3667        else if ((uMsr == 0x000003f8 || uMsr == 0x000003fc || uMsr == 0x0000060a) && !g_fIntelNetBurst)
    35373668            rc = reportMsr_GenRangeFunctionEx(&paMsrs[i], cMsrs - i, 4, NULL, uMsr - 3, true, false, 0, &i);
    3538         else if (uMsr == 0x000003f9 || uMsr == 0x000003fd || uMsr == 0x0000060b)
     3669        else if ((uMsr == 0x000003f9 || uMsr == 0x000003fd || uMsr == 0x0000060b) && !g_fIntelNetBurst)
    35393670            rc = reportMsr_GenRangeFunctionEx(&paMsrs[i], cMsrs - i, 8, NULL, uMsr - 6, true, false, 0, &i);
    3540         else if (uMsr == 0x000003fa || uMsr == 0x000003fe || uMsr == 0x0000060c)
     3671        else if ((uMsr == 0x000003fa || uMsr == 0x000003fe || uMsr == 0x0000060c) && !g_fIntelNetBurst)
    35413672            rc = reportMsr_GenRangeFunctionEx(&paMsrs[i], cMsrs - i, 8, NULL, uMsr - 7, true, false, 0, &i);
    35423673        else if (uMsr >= 0x00000400 && uMsr <= 0x00000477)
     
    35453676            rc = reportMsr_GenRangeFunction(&paMsrs[i], cMsrs - i, 8, NULL, &i);
    35463677        else if (uMsr == 0x00000680 || uMsr == 0x000006c0)
    3547             rc = reportMsr_GenRangeFunctionEx(&paMsrs[i], cMsrs - i, 16, NULL, uMsr, false, false, UINT64_C(0xffff800000000000), &i);
     3678            rc = reportMsr_GenRangeFunctionEx(&paMsrs[i], cMsrs - i, 16, NULL, uMsr, false, false,
     3679                                              g_fIntelNetBurst
     3680                                              ? UINT64_C(0xffffffffffffff00) /* kludge */
     3681                                              : UINT64_C(0xffff800000000000), &i);
    35483682        else if (uMsr >= 0x00000800 && uMsr <= 0x000008ff)
    35493683            rc = reportMsr_GenX2Apic(&paMsrs[i], cMsrs - i, &i);
     
    35943728        else if (uMsr == 0xc0010070)
    35953729            rc = reportMsr_AmdFam10hCofVidControl(uMsr, uValue);
    3596         else if (uMsr == 0xc0010118 || uMsr == 0xc0010119)
     3730        else if ((uMsr == 0xc0010118 || uMsr == 0xc0010119) && getMsrFnName(uMsr, NULL))
    35973731            rc = printMsrFunction(uMsr, NULL, NULL, annotateValue(uValue)); /* RAZ, write key. */
    35983732        else if (uMsr == 0xc0010200)
     
    36553789#else
    36563790
    3657     uint32_t uMsr = 0xc0010015;
     3791    uint32_t uMsr = 0xc0000080;
    36583792    uint64_t uValue = 0;
    36593793    msrProberRead(uMsr, &uValue);
    3660     reportMsr_AmdK8HwCr(uMsr, uValue);
     3794    reportMsr_Amd64Efer(uMsr, uValue);
    36613795#endif
    36623796    return VINF_SUCCESS;
     
    39284062            if (!RT_C_IS_ALNUM(*psz) && *psz != '_')
    39294063                *psz = '_';
     4064        for (size_t off = strlen(szNameC); off > 1 && szNameC[off - 1] == '_'; off--)
     4065            szNameC[off - 1] = '\0';
    39304066        vbCpuRepDebug("NameC: %s\n", szNameC);
    39314067    }
     
    40704206        { "--msrs-dev",  'd', RTGETOPT_REQ_NOTHING },
    40714207        { "--output",    'o', RTGETOPT_REQ_STRING  },
     4208        { "--log",       'l', RTGETOPT_REQ_STRING  },
    40724209    };
    40734210    RTGETOPTSTATE State;
     
    40824219    g_pReportOut = NULL;
    40834220    g_pDebugOut  = g_pStdErr;
    4084     const char *pszOutput = NULL;
     4221    const char *pszOutput   = NULL;
     4222    const char *pszDebugOut = NULL;
    40854223
    40864224    int iOpt;
     
    41024240                break;
    41034241
     4242            case 'l':
     4243                pszDebugOut = ValueUnion.psz;
     4244                break;
     4245
    41044246            case 'h':
    4105                 RTPrintf("Usage: VBoxCpuReport [-m|--msrs-only] [-d|--msrs-dev] [-h|--help] [-V|--version]\n");
     4247                RTPrintf("Usage: VBoxCpuReport [-m|--msrs-only] [-d|--msrs-dev] [-h|--help] [-V|--version] [-o filename.h] [-l debug.log]\n");
    41064248                RTPrintf("Internal tool for gathering information to the VMM CPU database.\n");
    41074249                return RTEXITCODE_SUCCESS;
     
    41114253            default:
    41124254                return RTGetOptPrintError(iOpt, &ValueUnion);
     4255        }
     4256    }
     4257
     4258    /*
     4259     * Open the alternative debug log stream.
     4260     */
     4261    if (pszDebugOut)
     4262    {
     4263        if (RTFileExists(pszDebugOut) && !RTSymlinkExists(pszDebugOut))
     4264        {
     4265            char szOld[RTPATH_MAX];
     4266            rc = RTStrCopy(szOld, sizeof(szOld), pszDebugOut);
     4267            if (RT_SUCCESS(rc))
     4268                rc = RTStrCat(szOld, sizeof(szOld), ".old");
     4269            if (RT_SUCCESS(rc))
     4270                RTFileRename(pszDebugOut, szOld, RTFILEMOVE_FLAGS_REPLACE);
     4271        }
     4272        rc = RTStrmOpen(pszDebugOut, "w", &g_pDebugOut);
     4273        if (RT_FAILURE(rc))
     4274        {
     4275            RTMsgError("Error opening '%s': %Rrc", pszDebugOut, rc);
     4276            g_pDebugOut = NULL;
    41134277        }
    41144278    }
     
    41474311            break;
    41484312    }
     4313
     4314    /*
     4315     * Close the output files.
     4316     */
     4317    if (g_pReportOut)
     4318    {
     4319        RTStrmClose(g_pReportOut);
     4320        g_pReportOut = NULL;
     4321    }
     4322
     4323    if (g_pDebugOut)
     4324    {
     4325        RTStrmClose(g_pDebugOut);
     4326        g_pDebugOut = NULL;
     4327    }
     4328
    41494329    return RT_SUCCESS(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
    41504330}
    41514331
    4152 
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