VirtualBox

Changeset 61414 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 2, 2016 3:30:09 PM (9 years ago)
Author:
vboxsync
Message:

VMM/HM: Added 'info exithistory' command. Prettier formatting comes later.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r61155 r61414  
    2323 * {summary of what HM does}
    2424 *
    25  * Hardware assited virtualization manager was origianlly abriviated HWACCM,
     25 * Hardware assisted virtualization manager was originally abbreviated HWACCM,
    2626 * however that was cumbersome to write and parse for such a central component,
    27  * so it was shorted to HM when refactoring the code in the 4.3 development
     27 * so it was shortened to HM when refactoring the code in the 4.3 development
    2828 * cycle.
    2929 *
     
    7777static const char * const g_apszVTxExitReasons[MAX_EXITREASON_STAT] =
    7878{
    79     EXIT_REASON(VMX_EXIT_XCPT_OR_NMI        ,  0, "Exception or non-maskable interrupt (NMI)."),
    80     EXIT_REASON(VMX_EXIT_EXT_INT            ,  1, "External interrupt."),
    81     EXIT_REASON(VMX_EXIT_TRIPLE_FAULT       ,  2, "Triple fault."),
    82     EXIT_REASON(VMX_EXIT_INIT_SIGNAL        ,  3, "INIT signal."),
    83     EXIT_REASON(VMX_EXIT_SIPI               ,  4, "Start-up IPI (SIPI)."),
    84     EXIT_REASON(VMX_EXIT_IO_SMI_IRQ         ,  5, "I/O system-management interrupt (SMI)."),
    85     EXIT_REASON(VMX_EXIT_SMI_IRQ            ,  6, "Other SMI."),
    86     EXIT_REASON(VMX_EXIT_INT_WINDOW         ,  7, "Interrupt window."),
    87     EXIT_REASON(VMX_EXIT_NMI_WINDOW         ,  8, "NMI window."),
    88     EXIT_REASON(VMX_EXIT_TASK_SWITCH        ,  9, "Task switch."),
    89     EXIT_REASON(VMX_EXIT_CPUID              , 10, "CPUID instruction."),
     79    EXIT_REASON(VMX_EXIT_XCPT_OR_NMI            ,   0, "Exception or non-maskable interrupt (NMI)."),
     80    EXIT_REASON(VMX_EXIT_EXT_INT                ,   1, "External interrupt."),
     81    EXIT_REASON(VMX_EXIT_TRIPLE_FAULT           ,   2, "Triple fault."),
     82    EXIT_REASON(VMX_EXIT_INIT_SIGNAL            ,   3, "INIT signal."),
     83    EXIT_REASON(VMX_EXIT_SIPI                   ,   4, "Start-up IPI (SIPI)."),
     84    EXIT_REASON(VMX_EXIT_IO_SMI_IRQ             ,   5, "I/O system-management interrupt (SMI)."),
     85    EXIT_REASON(VMX_EXIT_SMI_IRQ                ,   6, "Other SMI."),
     86    EXIT_REASON(VMX_EXIT_INT_WINDOW             ,   7, "Interrupt window."),
     87    EXIT_REASON(VMX_EXIT_NMI_WINDOW             ,   8, "NMI window."),
     88    EXIT_REASON(VMX_EXIT_TASK_SWITCH            ,   9, "Task switch."),
     89    EXIT_REASON(VMX_EXIT_CPUID                  , 10, "CPUID instruction."),
    9090    EXIT_REASON_NIL(),
    91     EXIT_REASON(VMX_EXIT_HLT                , 12, "HLT instruction."),
    92     EXIT_REASON(VMX_EXIT_INVD               , 13, "INVD instruction."),
    93     EXIT_REASON(VMX_EXIT_INVLPG             , 14, "INVLPG instruction."),
    94     EXIT_REASON(VMX_EXIT_RDPMC              , 15, "RDPMCinstruction."),
    95     EXIT_REASON(VMX_EXIT_RDTSC              , 16, "RDTSC instruction."),
    96     EXIT_REASON(VMX_EXIT_RSM                , 17, "RSM instruction in SMM."),
    97     EXIT_REASON(VMX_EXIT_VMCALL             , 18, "VMCALL instruction."),
    98     EXIT_REASON(VMX_EXIT_VMCLEAR            , 19, "VMCLEAR instruction."),
    99     EXIT_REASON(VMX_EXIT_VMLAUNCH           , 20, "VMLAUNCH instruction."),
    100     EXIT_REASON(VMX_EXIT_VMPTRLD            , 21, "VMPTRLD instruction."),
    101     EXIT_REASON(VMX_EXIT_VMPTRST            , 22, "VMPTRST instruction."),
    102     EXIT_REASON(VMX_EXIT_VMREAD             , 23, "VMREAD instruction."),
    103     EXIT_REASON(VMX_EXIT_VMRESUME           , 24, "VMRESUME instruction."),
    104     EXIT_REASON(VMX_EXIT_VMWRITE            , 25, "VMWRITE instruction."),
    105     EXIT_REASON(VMX_EXIT_VMXOFF             , 26, "VMXOFF instruction."),
    106     EXIT_REASON(VMX_EXIT_VMXON              , 27, "VMXON instruction."),
    107     EXIT_REASON(VMX_EXIT_MOV_CRX            , 28, "Control-register accesses."),
    108     EXIT_REASON(VMX_EXIT_MOV_DRX            , 29, "Debug-register accesses."),
    109     EXIT_REASON(VMX_EXIT_PORT_IO            , 30, "I/O instruction."),
    110     EXIT_REASON(VMX_EXIT_RDMSR              , 31, "RDMSR instruction."),
    111     EXIT_REASON(VMX_EXIT_WRMSR              , 32, "WRMSR instruction."),
     91    EXIT_REASON(VMX_EXIT_HLT                    , 12, "HLT instruction."),
     92    EXIT_REASON(VMX_EXIT_INVD                   , 13, "INVD instruction."),
     93    EXIT_REASON(VMX_EXIT_INVLPG                 , 14, "INVLPG instruction."),
     94    EXIT_REASON(VMX_EXIT_RDPMC                  , 15, "RDPMCinstruction."),
     95    EXIT_REASON(VMX_EXIT_RDTSC                  , 16, "RDTSC instruction."),
     96    EXIT_REASON(VMX_EXIT_RSM                    , 17, "RSM instruction in SMM."),
     97    EXIT_REASON(VMX_EXIT_VMCALL                 , 18, "VMCALL instruction."),
     98    EXIT_REASON(VMX_EXIT_VMCLEAR                , 19, "VMCLEAR instruction."),
     99    EXIT_REASON(VMX_EXIT_VMLAUNCH               , 20, "VMLAUNCH instruction."),
     100    EXIT_REASON(VMX_EXIT_VMPTRLD                , 21, "VMPTRLD instruction."),
     101    EXIT_REASON(VMX_EXIT_VMPTRST                , 22, "VMPTRST instruction."),
     102    EXIT_REASON(VMX_EXIT_VMREAD                 , 23, "VMREAD instruction."),
     103    EXIT_REASON(VMX_EXIT_VMRESUME               , 24, "VMRESUME instruction."),
     104    EXIT_REASON(VMX_EXIT_VMWRITE                , 25, "VMWRITE instruction."),
     105    EXIT_REASON(VMX_EXIT_VMXOFF                 , 26, "VMXOFF instruction."),
     106    EXIT_REASON(VMX_EXIT_VMXON                  , 27, "VMXON instruction."),
     107    EXIT_REASON(VMX_EXIT_MOV_CRX                , 28, "Control-register accesses."),
     108    EXIT_REASON(VMX_EXIT_MOV_DRX                , 29, "Debug-register accesses."),
     109    EXIT_REASON(VMX_EXIT_PORT_IO                , 30, "I/O instruction."),
     110    EXIT_REASON(VMX_EXIT_RDMSR                  , 31, "RDMSR instruction."),
     111    EXIT_REASON(VMX_EXIT_WRMSR                  , 32, "WRMSR instruction."),
    112112    EXIT_REASON(VMX_EXIT_ERR_INVALID_GUEST_STATE,  33, "VM-entry failure due to invalid guest state."),
    113     EXIT_REASON(VMX_EXIT_ERR_MSR_LOAD       , 34, "VM-entry failure due to MSR loading."),
     113    EXIT_REASON(VMX_EXIT_ERR_MSR_LOAD           ,  34, "VM-entry failure due to MSR loading."),
     114    EXIT_REASON(VMX_EXIT_MWAIT                  ,  36, "MWAIT instruction."),
     115    EXIT_REASON(VMX_EXIT_MTF                    ,  37, "Monitor Trap Flag."),
     116    EXIT_REASON(VMX_EXIT_MONITOR                ,  39, "MONITOR instruction."),
     117    EXIT_REASON(VMX_EXIT_PAUSE                  ,  40, "PAUSE instruction."),
     118    EXIT_REASON(VMX_EXIT_ERR_MACHINE_CHECK      ,  41, "VM-entry failure due to machine-check."),
    114119    EXIT_REASON_NIL(),
    115     EXIT_REASON(VMX_EXIT_MWAIT              , 36, "MWAIT instruction."),
    116     EXIT_REASON(VMX_EXIT_MTF                , 37, "Monitor Trap Flag."),
     120    EXIT_REASON(VMX_EXIT_TPR_BELOW_THRESHOLD    ,  43, "TPR below threshold (MOV to CR8)."),
     121    EXIT_REASON(VMX_EXIT_APIC_ACCESS            ,  44, "APIC access."),
     122    EXIT_REASON(VMX_EXIT_XDTR_ACCESS            ,  46, "Access to GDTR or IDTR using LGDT, LIDT, SGDT, or SIDT."),
     123    EXIT_REASON(VMX_EXIT_TR_ACCESS              ,  47, "Access to LDTR or TR using LLDT, LTR, SLDT, or STR."),
     124    EXIT_REASON(VMX_EXIT_EPT_VIOLATION          ,  48, "EPT violation."),
     125    EXIT_REASON(VMX_EXIT_EPT_MISCONFIG          ,  49, "EPT misconfiguration."),
     126    EXIT_REASON(VMX_EXIT_INVEPT                 ,  50, "INVEPT instruction."),
     127    EXIT_REASON(VMX_EXIT_RDTSCP                 ,  51, "RDTSCP instruction."),
     128    EXIT_REASON(VMX_EXIT_PREEMPT_TIMER          ,  52, "VMX-preemption timer expired."),
     129    EXIT_REASON(VMX_EXIT_INVVPID                ,  53, "INVVPID instruction."),
     130    EXIT_REASON(VMX_EXIT_WBINVD                 ,  54, "WBINVD instruction."),
     131    EXIT_REASON(VMX_EXIT_XSETBV                 ,  55, "XSETBV instruction."),
     132    EXIT_REASON(VMX_EXIT_RDRAND                 ,  57, "RDRAND instruction."),
     133    EXIT_REASON(VMX_EXIT_INVPCID                ,  58, "INVPCID instruction."),
     134    EXIT_REASON(VMX_EXIT_VMFUNC                 ,  59, "VMFUNC instruction."),
    117135    EXIT_REASON_NIL(),
    118     EXIT_REASON(VMX_EXIT_MONITOR            , 39, "MONITOR instruction."),
    119     EXIT_REASON(VMX_EXIT_PAUSE              , 40, "PAUSE instruction."),
    120     EXIT_REASON(VMX_EXIT_ERR_MACHINE_CHECK  , 41, "VM-entry failure due to machine-check."),
     136    EXIT_REASON(VMX_EXIT_RDSEED                 ,  61, "RDSEED instruction."),
    121137    EXIT_REASON_NIL(),
    122     EXIT_REASON(VMX_EXIT_TPR_BELOW_THRESHOLD, 43, "TPR below threshold (MOV to CR8)."),
    123     EXIT_REASON(VMX_EXIT_APIC_ACCESS        , 44, "APIC access."),
    124     EXIT_REASON_NIL(),
    125     EXIT_REASON(VMX_EXIT_XDTR_ACCESS        , 46, "Access to GDTR or IDTR using LGDT, LIDT, SGDT, or SIDT."),
    126     EXIT_REASON(VMX_EXIT_TR_ACCESS          , 47, "Access to LDTR or TR using LLDT, LTR, SLDT, or STR."),
    127     EXIT_REASON(VMX_EXIT_EPT_VIOLATION      , 48, "EPT violation."),
    128     EXIT_REASON(VMX_EXIT_EPT_MISCONFIG      , 49, "EPT misconfiguration."),
    129     EXIT_REASON(VMX_EXIT_INVEPT             , 50, "INVEPT instruction."),
    130     EXIT_REASON(VMX_EXIT_RDTSCP             , 51, "RDTSCP instruction."),
    131     EXIT_REASON(VMX_EXIT_PREEMPT_TIMER      , 52, "VMX-preemption timer expired."),
    132     EXIT_REASON(VMX_EXIT_INVVPID            , 53, "INVVPID instruction."),
    133     EXIT_REASON(VMX_EXIT_WBINVD             , 54, "WBINVD instruction."),
    134     EXIT_REASON(VMX_EXIT_XSETBV             , 55, "XSETBV instruction."),
    135     EXIT_REASON_NIL(),
    136     EXIT_REASON(VMX_EXIT_RDRAND             , 57, "RDRAND instruction."),
    137     EXIT_REASON(VMX_EXIT_INVPCID            , 58, "INVPCID instruction."),
    138     EXIT_REASON(VMX_EXIT_VMFUNC             , 59, "VMFUNC instruction."),
    139     EXIT_REASON_NIL(),
    140     EXIT_REASON(VMX_EXIT_RDSEED             , 61, "RDSEED instruction."),
    141     EXIT_REASON_NIL(),
    142     EXIT_REASON(VMX_EXIT_XSAVES             , 61, "XSAVES instruction."),
    143     EXIT_REASON(VMX_EXIT_XRSTORS            , 62, "XRSTORS instruction.")
     138    EXIT_REASON(VMX_EXIT_XSAVES                 ,  63, "XSAVES instruction."),
     139    EXIT_REASON(VMX_EXIT_XRSTORS                ,  64, "XRSTORS instruction.")
    144140};
    145 /** Exit reason descriptions for AMD-V, used to describe statistics. */
     141/** Array index of the last valid VT-x exit reason. */
     142#define MAX_EXITREASON_VTX                         64
     143
     144/** A partial list of Exit reason descriptions for AMD-V, used to describe
     145 *  statistics.
     146 *
     147 *  @note AMD-V have annoyingly large gaps (e.g. \#NPF VMEXIT comes at 1024),
     148 *        this array doesn't contain the entire set of exit reasons. */
    146149static const char * const g_apszAmdVExitReasons[MAX_EXITREASON_STAT] =
    147150{
    148     EXIT_REASON(SVM_EXIT_READ_CR0           ,  0, "Read CR0."),
    149     EXIT_REASON(SVM_EXIT_READ_CR1           ,  1, "Read CR1."),
    150     EXIT_REASON(SVM_EXIT_READ_CR2           ,  2, "Read CR2."),
    151     EXIT_REASON(SVM_EXIT_READ_CR3           ,  3, "Read CR3."),
    152     EXIT_REASON(SVM_EXIT_READ_CR4           ,  4, "Read CR4."),
    153     EXIT_REASON(SVM_EXIT_READ_CR5           ,  5, "Read CR5."),
    154     EXIT_REASON(SVM_EXIT_READ_CR6           ,  6, "Read CR6."),
    155     EXIT_REASON(SVM_EXIT_READ_CR7           ,  7, "Read CR7."),
    156     EXIT_REASON(SVM_EXIT_READ_CR8           ,  8, "Read CR8."),
    157     EXIT_REASON(SVM_EXIT_READ_CR9           ,  9, "Read CR9."),
    158     EXIT_REASON(SVM_EXIT_READ_CR10          , 10, "Read CR10."),
    159     EXIT_REASON(SVM_EXIT_READ_CR11          , 11, "Read CR11."),
    160     EXIT_REASON(SVM_EXIT_READ_CR12          , 12, "Read CR12."),
    161     EXIT_REASON(SVM_EXIT_READ_CR13          , 13, "Read CR13."),
    162     EXIT_REASON(SVM_EXIT_READ_CR14          , 14, "Read CR14."),
    163     EXIT_REASON(SVM_EXIT_READ_CR15          , 15, "Read CR15."),
    164     EXIT_REASON(SVM_EXIT_WRITE_CR0          , 16, "Write CR0."),
    165     EXIT_REASON(SVM_EXIT_WRITE_CR1          , 17, "Write CR1."),
    166     EXIT_REASON(SVM_EXIT_WRITE_CR2          , 18, "Write CR2."),
    167     EXIT_REASON(SVM_EXIT_WRITE_CR3          , 19, "Write CR3."),
    168     EXIT_REASON(SVM_EXIT_WRITE_CR4          , 20, "Write CR4."),
    169     EXIT_REASON(SVM_EXIT_WRITE_CR5          , 21, "Write CR5."),
    170     EXIT_REASON(SVM_EXIT_WRITE_CR6          , 22, "Write CR6."),
    171     EXIT_REASON(SVM_EXIT_WRITE_CR7          , 23, "Write CR7."),
    172     EXIT_REASON(SVM_EXIT_WRITE_CR8          , 24, "Write CR8."),
    173     EXIT_REASON(SVM_EXIT_WRITE_CR9          , 25, "Write CR9."),
    174     EXIT_REASON(SVM_EXIT_WRITE_CR10         , 26, "Write CR10."),
    175     EXIT_REASON(SVM_EXIT_WRITE_CR11         , 27, "Write CR11."),
    176     EXIT_REASON(SVM_EXIT_WRITE_CR12         , 28, "Write CR12."),
    177     EXIT_REASON(SVM_EXIT_WRITE_CR13         , 29, "Write CR13."),
    178     EXIT_REASON(SVM_EXIT_WRITE_CR14         , 30, "Write CR14."),
    179     EXIT_REASON(SVM_EXIT_WRITE_CR15         , 31, "Write CR15."),
    180     EXIT_REASON(SVM_EXIT_READ_DR0           , 32, "Read DR0."),
    181     EXIT_REASON(SVM_EXIT_READ_DR1           , 33, "Read DR1."),
    182     EXIT_REASON(SVM_EXIT_READ_DR2           , 34, "Read DR2."),
    183     EXIT_REASON(SVM_EXIT_READ_DR3           , 35, "Read DR3."),
    184     EXIT_REASON(SVM_EXIT_READ_DR4           , 36, "Read DR4."),
    185     EXIT_REASON(SVM_EXIT_READ_DR5           , 37, "Read DR5."),
    186     EXIT_REASON(SVM_EXIT_READ_DR6           , 38, "Read DR6."),
    187     EXIT_REASON(SVM_EXIT_READ_DR7           , 39, "Read DR7."),
    188     EXIT_REASON(SVM_EXIT_READ_DR8           , 40, "Read DR8."),
    189     EXIT_REASON(SVM_EXIT_READ_DR9           , 41, "Read DR9."),
    190     EXIT_REASON(SVM_EXIT_READ_DR10          , 42, "Read DR10."),
    191     EXIT_REASON(SVM_EXIT_READ_DR11          , 43, "Read DR11"),
    192     EXIT_REASON(SVM_EXIT_READ_DR12          , 44, "Read DR12."),
    193     EXIT_REASON(SVM_EXIT_READ_DR13          , 45, "Read DR13."),
    194     EXIT_REASON(SVM_EXIT_READ_DR14          , 46, "Read DR14."),
    195     EXIT_REASON(SVM_EXIT_READ_DR15          , 47, "Read DR15."),
    196     EXIT_REASON(SVM_EXIT_WRITE_DR0          , 48, "Write DR0."),
    197     EXIT_REASON(SVM_EXIT_WRITE_DR1          , 49, "Write DR1."),
    198     EXIT_REASON(SVM_EXIT_WRITE_DR2          , 50, "Write DR2."),
    199     EXIT_REASON(SVM_EXIT_WRITE_DR3          , 51, "Write DR3."),
    200     EXIT_REASON(SVM_EXIT_WRITE_DR4          , 52, "Write DR4."),
    201     EXIT_REASON(SVM_EXIT_WRITE_DR5          , 53, "Write DR5."),
    202     EXIT_REASON(SVM_EXIT_WRITE_DR6          , 54, "Write DR6."),
    203     EXIT_REASON(SVM_EXIT_WRITE_DR7          , 55, "Write DR7."),
    204     EXIT_REASON(SVM_EXIT_WRITE_DR8          , 56, "Write DR8."),
    205     EXIT_REASON(SVM_EXIT_WRITE_DR9          , 57, "Write DR9."),
    206     EXIT_REASON(SVM_EXIT_WRITE_DR10         , 58, "Write DR10."),
    207     EXIT_REASON(SVM_EXIT_WRITE_DR11         , 59, "Write DR11."),
    208     EXIT_REASON(SVM_EXIT_WRITE_DR12         , 60, "Write DR12."),
    209     EXIT_REASON(SVM_EXIT_WRITE_DR13         , 61, "Write DR13."),
    210     EXIT_REASON(SVM_EXIT_WRITE_DR14         , 62, "Write DR14."),
    211     EXIT_REASON(SVM_EXIT_WRITE_DR15         , 63, "Write DR15."),
    212     EXIT_REASON(SVM_EXIT_EXCEPTION_0        , 64, "Exception Vector 0  (#DE)."),
    213     EXIT_REASON(SVM_EXIT_EXCEPTION_1        , 65, "Exception Vector 1  (#DB)."),
    214     EXIT_REASON(SVM_EXIT_EXCEPTION_2        , 66, "Exception Vector 2  (#NMI)."),
    215     EXIT_REASON(SVM_EXIT_EXCEPTION_3        , 67, "Exception Vector 3  (#BP)."),
    216     EXIT_REASON(SVM_EXIT_EXCEPTION_4        , 68, "Exception Vector 4  (#OF)."),
    217     EXIT_REASON(SVM_EXIT_EXCEPTION_5        , 69, "Exception Vector 5  (#BR)."),
    218     EXIT_REASON(SVM_EXIT_EXCEPTION_6        , 70, "Exception Vector 6  (#UD)."),
    219     EXIT_REASON(SVM_EXIT_EXCEPTION_7        , 71, "Exception Vector 7  (#NM)."),
    220     EXIT_REASON(SVM_EXIT_EXCEPTION_8        , 72, "Exception Vector 8  (#DF)."),
    221     EXIT_REASON(SVM_EXIT_EXCEPTION_9        , 73, "Exception Vector 9  (#CO_SEG_OVERRUN)."),
    222     EXIT_REASON(SVM_EXIT_EXCEPTION_A        , 74, "Exception Vector 10 (#TS)."),
    223     EXIT_REASON(SVM_EXIT_EXCEPTION_B        , 75, "Exception Vector 11 (#NP)."),
    224     EXIT_REASON(SVM_EXIT_EXCEPTION_C        , 76, "Exception Vector 12 (#SS)."),
    225     EXIT_REASON(SVM_EXIT_EXCEPTION_D        , 77, "Exception Vector 13 (#GP)."),
    226     EXIT_REASON(SVM_EXIT_EXCEPTION_E        , 78, "Exception Vector 14 (#PF)."),
    227     EXIT_REASON(SVM_EXIT_EXCEPTION_F        , 79, "Exception Vector 15 (0x0f)."),
    228     EXIT_REASON(SVM_EXIT_EXCEPTION_10       , 80, "Exception Vector 16 (#MF)."),
    229     EXIT_REASON(SVM_EXIT_EXCEPTION_11       , 81, "Exception Vector 17 (#AC)."),
    230     EXIT_REASON(SVM_EXIT_EXCEPTION_12       , 82, "Exception Vector 18 (#MC)."),
    231     EXIT_REASON(SVM_EXIT_EXCEPTION_13       , 83, "Exception Vector 19 (#XF)."),
    232     EXIT_REASON(SVM_EXIT_EXCEPTION_14       , 84, "Exception Vector 20 (0x14)."),
    233     EXIT_REASON(SVM_EXIT_EXCEPTION_15       , 85, "Exception Vector 22 (0x15)."),
    234     EXIT_REASON(SVM_EXIT_EXCEPTION_16       , 86, "Exception Vector 22 (0x16)."),
    235     EXIT_REASON(SVM_EXIT_EXCEPTION_17       , 87, "Exception Vector 23 (0x17)."),
    236     EXIT_REASON(SVM_EXIT_EXCEPTION_18       , 88, "Exception Vector 24 (0x18)."),
    237     EXIT_REASON(SVM_EXIT_EXCEPTION_19       , 89, "Exception Vector 25 (0x19)."),
    238     EXIT_REASON(SVM_EXIT_EXCEPTION_1A       , 90, "Exception Vector 26 (0x1A)."),
    239     EXIT_REASON(SVM_EXIT_EXCEPTION_1B       , 91, "Exception Vector 27 (0x1B)."),
    240     EXIT_REASON(SVM_EXIT_EXCEPTION_1C       , 92, "Exception Vector 28 (0x1C)."),
    241     EXIT_REASON(SVM_EXIT_EXCEPTION_1D       , 93, "Exception Vector 29 (0x1D)."),
    242     EXIT_REASON(SVM_EXIT_EXCEPTION_1E       , 94, "Exception Vector 30 (0x1E)."),
    243     EXIT_REASON(SVM_EXIT_EXCEPTION_1F       , 95, "Exception Vector 31 (0x1F)."),
    244     EXIT_REASON(SVM_EXIT_INTR               , 96, "Physical maskable interrupt (host)."),
    245     EXIT_REASON(SVM_EXIT_NMI                , 97, "Physical non-maskable interrupt (host)."),
    246     EXIT_REASON(SVM_EXIT_SMI                , 98, "System management interrupt (host)."),
    247     EXIT_REASON(SVM_EXIT_INIT               , 99, "Physical INIT signal (host)."),
    248     EXIT_REASON(SVM_EXIT_VINTR              ,100, "Virtual interrupt-window exit."),
    249     EXIT_REASON(SVM_EXIT_CR0_SEL_WRITE      ,101, "Write to CR0 that changed any bits other than CR0.TS or CR0.MP."),
    250     EXIT_REASON(SVM_EXIT_IDTR_READ          ,102, "Read IDTR"),
    251     EXIT_REASON(SVM_EXIT_GDTR_READ          ,103, "Read GDTR"),
    252     EXIT_REASON(SVM_EXIT_LDTR_READ          ,104, "Read LDTR."),
    253     EXIT_REASON(SVM_EXIT_TR_READ            ,105, "Read TR."),
    254     EXIT_REASON(SVM_EXIT_IDTR_WRITE         ,106, "Write IDTR."),
    255     EXIT_REASON(SVM_EXIT_GDTR_WRITE         ,107, "Write GDTR."),
    256     EXIT_REASON(SVM_EXIT_LDTR_WRITE         ,108, "Write LDTR."),
    257     EXIT_REASON(SVM_EXIT_TR_WRITE           ,109, "Write TR."),
    258     EXIT_REASON(SVM_EXIT_RDTSC              ,110, "RDTSC instruction."),
    259     EXIT_REASON(SVM_EXIT_RDPMC              ,111, "RDPMC instruction."),
    260     EXIT_REASON(SVM_EXIT_PUSHF              ,112, "PUSHF instruction."),
    261     EXIT_REASON(SVM_EXIT_POPF               ,113, "POPF instruction."),
    262     EXIT_REASON(SVM_EXIT_CPUID              ,114, "CPUID instruction."),
    263     EXIT_REASON(SVM_EXIT_RSM                ,115, "RSM instruction."),
    264     EXIT_REASON(SVM_EXIT_IRET               ,116, "IRET instruction."),
    265     EXIT_REASON(SVM_EXIT_SWINT              ,117, "Software interrupt (INTn instructions)."),
    266     EXIT_REASON(SVM_EXIT_INVD               ,118, "INVD instruction."),
    267     EXIT_REASON(SVM_EXIT_PAUSE              ,119, "PAUSE instruction."),
    268     EXIT_REASON(SVM_EXIT_HLT                ,120, "HLT instruction."),
    269     EXIT_REASON(SVM_EXIT_INVLPG             ,121, "INVLPG instruction."),
    270     EXIT_REASON(SVM_EXIT_INVLPGA            ,122, "INVLPGA instruction."),
    271     EXIT_REASON(SVM_EXIT_IOIO               ,123, "IN/OUT accessing protected port."),
    272     EXIT_REASON(SVM_EXIT_MSR                ,124, "RDMSR or WRMSR access to protected MSR."),
    273     EXIT_REASON(SVM_EXIT_TASK_SWITCH        ,125, "Task switch."),
    274     EXIT_REASON(SVM_EXIT_FERR_FREEZE        ,126, "Legacy FPU handling enabled; processor is frozen in an x87/mmx instruction waiting for an interrupt"),
    275     EXIT_REASON(SVM_EXIT_SHUTDOWN           ,127, "Shutdown."),
    276     EXIT_REASON(SVM_EXIT_VMRUN              ,128, "VMRUN instruction."),
    277     EXIT_REASON(SVM_EXIT_VMMCALL            ,129, "VMCALL instruction."),
    278     EXIT_REASON(SVM_EXIT_VMLOAD             ,130, "VMLOAD instruction."),
    279     EXIT_REASON(SVM_EXIT_VMSAVE             ,131, "VMSAVE instruction."),
    280     EXIT_REASON(SVM_EXIT_STGI               ,132, "STGI instruction."),
    281     EXIT_REASON(SVM_EXIT_CLGI               ,133, "CLGI instruction."),
    282     EXIT_REASON(SVM_EXIT_SKINIT             ,134, "SKINIT instruction."),
    283     EXIT_REASON(SVM_EXIT_RDTSCP             ,135, "RDTSCP instruction."),
    284     EXIT_REASON(SVM_EXIT_ICEBP              ,136, "ICEBP instruction."),
    285     EXIT_REASON(SVM_EXIT_WBINVD             ,137, "WBINVD instruction."),
    286     EXIT_REASON(SVM_EXIT_MONITOR            ,138, "MONITOR instruction."),
    287     EXIT_REASON(SVM_EXIT_MWAIT              ,139, "MWAIT instruction."),
    288     EXIT_REASON(SVM_EXIT_MWAIT_ARMED        ,140, "MWAIT instruction when armed."),
    289     EXIT_REASON(SVM_EXIT_XSETBV             ,141, "XSETBV instruction."),
    290     EXIT_REASON(SVM_EXIT_NPF                ,1024, "Nested paging fault."),
    291     EXIT_REASON(SVM_EXIT_AVIC_INCOMPLETE_IPI,1025, "AVIC incomplete IPI delivery."),
    292     EXIT_REASON(SVM_EXIT_AVIC_NOACCEL       ,1026, "AVIC unaccelerated register."),
    293     EXIT_REASON_NIL()
     151    EXIT_REASON(SVM_EXIT_READ_CR0           ,    0, "Read CR0."),
     152    EXIT_REASON(SVM_EXIT_READ_CR1           ,    1, "Read CR1."),
     153    EXIT_REASON(SVM_EXIT_READ_CR2           ,    2, "Read CR2."),
     154    EXIT_REASON(SVM_EXIT_READ_CR3           ,    3, "Read CR3."),
     155    EXIT_REASON(SVM_EXIT_READ_CR4           ,    4, "Read CR4."),
     156    EXIT_REASON(SVM_EXIT_READ_CR5           ,    5, "Read CR5."),
     157    EXIT_REASON(SVM_EXIT_READ_CR6           ,    6, "Read CR6."),
     158    EXIT_REASON(SVM_EXIT_READ_CR7           ,    7, "Read CR7."),
     159    EXIT_REASON(SVM_EXIT_READ_CR8           ,    8, "Read CR8."),
     160    EXIT_REASON(SVM_EXIT_READ_CR9           ,    9, "Read CR9."),
     161    EXIT_REASON(SVM_EXIT_READ_CR10          ,   10, "Read CR10."),
     162    EXIT_REASON(SVM_EXIT_READ_CR11          ,   11, "Read CR11."),
     163    EXIT_REASON(SVM_EXIT_READ_CR12          ,   12, "Read CR12."),
     164    EXIT_REASON(SVM_EXIT_READ_CR13          ,   13, "Read CR13."),
     165    EXIT_REASON(SVM_EXIT_READ_CR14          ,   14, "Read CR14."),
     166    EXIT_REASON(SVM_EXIT_READ_CR15          ,   15, "Read CR15."),
     167    EXIT_REASON(SVM_EXIT_WRITE_CR0          ,   16, "Write CR0."),
     168    EXIT_REASON(SVM_EXIT_WRITE_CR1          ,   17, "Write CR1."),
     169    EXIT_REASON(SVM_EXIT_WRITE_CR2          ,   18, "Write CR2."),
     170    EXIT_REASON(SVM_EXIT_WRITE_CR3          ,   19, "Write CR3."),
     171    EXIT_REASON(SVM_EXIT_WRITE_CR4          ,   20, "Write CR4."),
     172    EXIT_REASON(SVM_EXIT_WRITE_CR5          ,   21, "Write CR5."),
     173    EXIT_REASON(SVM_EXIT_WRITE_CR6          ,   22, "Write CR6."),
     174    EXIT_REASON(SVM_EXIT_WRITE_CR7          ,   23, "Write CR7."),
     175    EXIT_REASON(SVM_EXIT_WRITE_CR8          ,   24, "Write CR8."),
     176    EXIT_REASON(SVM_EXIT_WRITE_CR9          ,   25, "Write CR9."),
     177    EXIT_REASON(SVM_EXIT_WRITE_CR10         ,   26, "Write CR10."),
     178    EXIT_REASON(SVM_EXIT_WRITE_CR11         ,   27, "Write CR11."),
     179    EXIT_REASON(SVM_EXIT_WRITE_CR12         ,   28, "Write CR12."),
     180    EXIT_REASON(SVM_EXIT_WRITE_CR13         ,   29, "Write CR13."),
     181    EXIT_REASON(SVM_EXIT_WRITE_CR14         ,   30, "Write CR14."),
     182    EXIT_REASON(SVM_EXIT_WRITE_CR15         ,   31, "Write CR15."),
     183    EXIT_REASON(SVM_EXIT_READ_DR0           ,   32, "Read DR0."),
     184    EXIT_REASON(SVM_EXIT_READ_DR1           ,   33, "Read DR1."),
     185    EXIT_REASON(SVM_EXIT_READ_DR2           ,   34, "Read DR2."),
     186    EXIT_REASON(SVM_EXIT_READ_DR3           ,   35, "Read DR3."),
     187    EXIT_REASON(SVM_EXIT_READ_DR4           ,   36, "Read DR4."),
     188    EXIT_REASON(SVM_EXIT_READ_DR5           ,   37, "Read DR5."),
     189    EXIT_REASON(SVM_EXIT_READ_DR6           ,   38, "Read DR6."),
     190    EXIT_REASON(SVM_EXIT_READ_DR7           ,   39, "Read DR7."),
     191    EXIT_REASON(SVM_EXIT_READ_DR8           ,   40, "Read DR8."),
     192    EXIT_REASON(SVM_EXIT_READ_DR9           ,   41, "Read DR9."),
     193    EXIT_REASON(SVM_EXIT_READ_DR10          ,   42, "Read DR10."),
     194    EXIT_REASON(SVM_EXIT_READ_DR11          ,   43, "Read DR11"),
     195    EXIT_REASON(SVM_EXIT_READ_DR12          ,   44, "Read DR12."),
     196    EXIT_REASON(SVM_EXIT_READ_DR13          ,   45, "Read DR13."),
     197    EXIT_REASON(SVM_EXIT_READ_DR14          ,   46, "Read DR14."),
     198    EXIT_REASON(SVM_EXIT_READ_DR15          ,   47, "Read DR15."),
     199    EXIT_REASON(SVM_EXIT_WRITE_DR0          ,   48, "Write DR0."),
     200    EXIT_REASON(SVM_EXIT_WRITE_DR1          ,   49, "Write DR1."),
     201    EXIT_REASON(SVM_EXIT_WRITE_DR2          ,   50, "Write DR2."),
     202    EXIT_REASON(SVM_EXIT_WRITE_DR3          ,   51, "Write DR3."),
     203    EXIT_REASON(SVM_EXIT_WRITE_DR4          ,   52, "Write DR4."),
     204    EXIT_REASON(SVM_EXIT_WRITE_DR5          ,   53, "Write DR5."),
     205    EXIT_REASON(SVM_EXIT_WRITE_DR6          ,   54, "Write DR6."),
     206    EXIT_REASON(SVM_EXIT_WRITE_DR7          ,   55, "Write DR7."),
     207    EXIT_REASON(SVM_EXIT_WRITE_DR8          ,   56, "Write DR8."),
     208    EXIT_REASON(SVM_EXIT_WRITE_DR9          ,   57, "Write DR9."),
     209    EXIT_REASON(SVM_EXIT_WRITE_DR10         ,   58, "Write DR10."),
     210    EXIT_REASON(SVM_EXIT_WRITE_DR11         ,   59, "Write DR11."),
     211    EXIT_REASON(SVM_EXIT_WRITE_DR12         ,   60, "Write DR12."),
     212    EXIT_REASON(SVM_EXIT_WRITE_DR13         ,   61, "Write DR13."),
     213    EXIT_REASON(SVM_EXIT_WRITE_DR14         ,   62, "Write DR14."),
     214    EXIT_REASON(SVM_EXIT_WRITE_DR15         ,   63, "Write DR15."),
     215    EXIT_REASON(SVM_EXIT_EXCEPTION_0        ,   64, "Exception Vector 0  (#DE)."),
     216    EXIT_REASON(SVM_EXIT_EXCEPTION_1        ,   65, "Exception Vector 1  (#DB)."),
     217    EXIT_REASON(SVM_EXIT_EXCEPTION_2        ,   66, "Exception Vector 2  (#NMI)."),
     218    EXIT_REASON(SVM_EXIT_EXCEPTION_3        ,   67, "Exception Vector 3  (#BP)."),
     219    EXIT_REASON(SVM_EXIT_EXCEPTION_4        ,   68, "Exception Vector 4  (#OF)."),
     220    EXIT_REASON(SVM_EXIT_EXCEPTION_5        ,   69, "Exception Vector 5  (#BR)."),
     221    EXIT_REASON(SVM_EXIT_EXCEPTION_6        ,   70, "Exception Vector 6  (#UD)."),
     222    EXIT_REASON(SVM_EXIT_EXCEPTION_7        ,   71, "Exception Vector 7  (#NM)."),
     223    EXIT_REASON(SVM_EXIT_EXCEPTION_8        ,   72, "Exception Vector 8  (#DF)."),
     224    EXIT_REASON(SVM_EXIT_EXCEPTION_9        ,   73, "Exception Vector 9  (#CO_SEG_OVERRUN)."),
     225    EXIT_REASON(SVM_EXIT_EXCEPTION_A        ,   74, "Exception Vector 10 (#TS)."),
     226    EXIT_REASON(SVM_EXIT_EXCEPTION_B        ,   75, "Exception Vector 11 (#NP)."),
     227    EXIT_REASON(SVM_EXIT_EXCEPTION_C        ,   76, "Exception Vector 12 (#SS)."),
     228    EXIT_REASON(SVM_EXIT_EXCEPTION_D        ,   77, "Exception Vector 13 (#GP)."),
     229    EXIT_REASON(SVM_EXIT_EXCEPTION_E        ,   78, "Exception Vector 14 (#PF)."),
     230    EXIT_REASON(SVM_EXIT_EXCEPTION_F        ,   79, "Exception Vector 15 (0x0f)."),
     231    EXIT_REASON(SVM_EXIT_EXCEPTION_10       ,   80, "Exception Vector 16 (#MF)."),
     232    EXIT_REASON(SVM_EXIT_EXCEPTION_11       ,   81, "Exception Vector 17 (#AC)."),
     233    EXIT_REASON(SVM_EXIT_EXCEPTION_12       ,   82, "Exception Vector 18 (#MC)."),
     234    EXIT_REASON(SVM_EXIT_EXCEPTION_13       ,   83, "Exception Vector 19 (#XF)."),
     235    EXIT_REASON(SVM_EXIT_EXCEPTION_14       ,   84, "Exception Vector 20 (0x14)."),
     236    EXIT_REASON(SVM_EXIT_EXCEPTION_15       ,   85, "Exception Vector 22 (0x15)."),
     237    EXIT_REASON(SVM_EXIT_EXCEPTION_16       ,   86, "Exception Vector 22 (0x16)."),
     238    EXIT_REASON(SVM_EXIT_EXCEPTION_17       ,   87, "Exception Vector 23 (0x17)."),
     239    EXIT_REASON(SVM_EXIT_EXCEPTION_18       ,   88, "Exception Vector 24 (0x18)."),
     240    EXIT_REASON(SVM_EXIT_EXCEPTION_19       ,   89, "Exception Vector 25 (0x19)."),
     241    EXIT_REASON(SVM_EXIT_EXCEPTION_1A       ,   90, "Exception Vector 26 (0x1A)."),
     242    EXIT_REASON(SVM_EXIT_EXCEPTION_1B       ,   91, "Exception Vector 27 (0x1B)."),
     243    EXIT_REASON(SVM_EXIT_EXCEPTION_1C       ,   92, "Exception Vector 28 (0x1C)."),
     244    EXIT_REASON(SVM_EXIT_EXCEPTION_1D       ,   93, "Exception Vector 29 (0x1D)."),
     245    EXIT_REASON(SVM_EXIT_EXCEPTION_1E       ,   94, "Exception Vector 30 (0x1E)."),
     246    EXIT_REASON(SVM_EXIT_EXCEPTION_1F       ,   95, "Exception Vector 31 (0x1F)."),
     247    EXIT_REASON(SVM_EXIT_INTR               ,   96, "Physical maskable interrupt (host)."),
     248    EXIT_REASON(SVM_EXIT_NMI                ,   97, "Physical non-maskable interrupt (host)."),
     249    EXIT_REASON(SVM_EXIT_SMI                ,   98, "System management interrupt (host)."),
     250    EXIT_REASON(SVM_EXIT_INIT               ,   99, "Physical INIT signal (host)."),
     251    EXIT_REASON(SVM_EXIT_VINTR              ,  100, "Virtual interrupt-window exit."),
     252    EXIT_REASON(SVM_EXIT_CR0_SEL_WRITE      ,  101, "Write to CR0 that changed any bits other than CR0.TS or CR0.MP."),
     253    EXIT_REASON(SVM_EXIT_IDTR_READ          ,  102, "Read IDTR"),
     254    EXIT_REASON(SVM_EXIT_GDTR_READ          ,  103, "Read GDTR"),
     255    EXIT_REASON(SVM_EXIT_LDTR_READ          ,  104, "Read LDTR."),
     256    EXIT_REASON(SVM_EXIT_TR_READ            ,  105, "Read TR."),
     257    EXIT_REASON(SVM_EXIT_IDTR_WRITE         ,  106, "Write IDTR."),
     258    EXIT_REASON(SVM_EXIT_GDTR_WRITE         ,  107, "Write GDTR."),
     259    EXIT_REASON(SVM_EXIT_LDTR_WRITE         ,  108, "Write LDTR."),
     260    EXIT_REASON(SVM_EXIT_TR_WRITE           ,  109, "Write TR."),
     261    EXIT_REASON(SVM_EXIT_RDTSC              ,  110, "RDTSC instruction."),
     262    EXIT_REASON(SVM_EXIT_RDPMC              ,  111, "RDPMC instruction."),
     263    EXIT_REASON(SVM_EXIT_PUSHF              ,  112, "PUSHF instruction."),
     264    EXIT_REASON(SVM_EXIT_POPF               ,  113, "POPF instruction."),
     265    EXIT_REASON(SVM_EXIT_CPUID              ,  114, "CPUID instruction."),
     266    EXIT_REASON(SVM_EXIT_RSM                ,  115, "RSM instruction."),
     267    EXIT_REASON(SVM_EXIT_IRET               ,  116, "IRET instruction."),
     268    EXIT_REASON(SVM_EXIT_SWINT              ,  117, "Software interrupt (INTn instructions)."),
     269    EXIT_REASON(SVM_EXIT_INVD               ,  118, "INVD instruction."),
     270    EXIT_REASON(SVM_EXIT_PAUSE              ,  119, "PAUSE instruction."),
     271    EXIT_REASON(SVM_EXIT_HLT                ,  120, "HLT instruction."),
     272    EXIT_REASON(SVM_EXIT_INVLPG             ,  121, "INVLPG instruction."),
     273    EXIT_REASON(SVM_EXIT_INVLPGA            ,  122, "INVLPGA instruction."),
     274    EXIT_REASON(SVM_EXIT_IOIO               ,  123, "IN/OUT accessing protected port."),
     275    EXIT_REASON(SVM_EXIT_MSR                ,  124, "RDMSR or WRMSR access to protected MSR."),
     276    EXIT_REASON(SVM_EXIT_TASK_SWITCH        ,  125, "Task switch."),
     277    EXIT_REASON(SVM_EXIT_FERR_FREEZE        ,  126, "Legacy FPU handling enabled; CPU frozen in an x87/mmx instr. waiting for interrupt"),
     278    EXIT_REASON(SVM_EXIT_SHUTDOWN           ,  127, "Shutdown."),
     279    EXIT_REASON(SVM_EXIT_VMRUN              ,  128, "VMRUN instruction."),
     280    EXIT_REASON(SVM_EXIT_VMMCALL            ,  129, "VMCALL instruction."),
     281    EXIT_REASON(SVM_EXIT_VMLOAD             ,  130, "VMLOAD instruction."),
     282    EXIT_REASON(SVM_EXIT_VMSAVE             ,  131, "VMSAVE instruction."),
     283    EXIT_REASON(SVM_EXIT_STGI               ,  132, "STGI instruction."),
     284    EXIT_REASON(SVM_EXIT_CLGI               ,  133, "CLGI instruction."),
     285    EXIT_REASON(SVM_EXIT_SKINIT             ,  134, "SKINIT instruction."),
     286    EXIT_REASON(SVM_EXIT_RDTSCP             ,  135, "RDTSCP instruction."),
     287    EXIT_REASON(SVM_EXIT_ICEBP              ,  136, "ICEBP instruction."),
     288    EXIT_REASON(SVM_EXIT_WBINVD             ,  137, "WBINVD instruction."),
     289    EXIT_REASON(SVM_EXIT_MONITOR            ,  138, "MONITOR instruction."),
     290    EXIT_REASON(SVM_EXIT_MWAIT              ,  139, "MWAIT instruction."),
     291    EXIT_REASON(SVM_EXIT_MWAIT_ARMED        ,  140, "MWAIT instruction when armed."),
     292    EXIT_REASON(SVM_EXIT_XSETBV             ,  141, "XSETBV instruction."),
    294293};
    295 # undef EXIT_REASON
     294/** Array index of the last valid AMD-V exit reason. */
     295#define MAX_EXITREASON_AMDV                    141
     296#define SVM_EXIT_REASON_NPF                    EXIT_REASON(SVM_EXIT_NPF, 1024, "Nested Page Fault.")
     297
    296298# undef EXIT_REASON_NIL
    297299#endif /* VBOX_WITH_STATISTICS */
     
    328330*   Internal Functions                                                                                                           *
    329331*********************************************************************************************************************************/
    330 static DECLCALLBACK(int) hmR3Save(PVM pVM, PSSMHANDLE pSSM);
    331 static DECLCALLBACK(int) hmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
    332 static int               hmR3InitCPU(PVM pVM);
    333 static int               hmR3InitFinalizeR0(PVM pVM);
    334 static int               hmR3InitFinalizeR0Intel(PVM pVM);
    335 static int               hmR3InitFinalizeR0Amd(PVM pVM);
    336 static int               hmR3TermCPU(PVM pVM);
     332static DECLCALLBACK(int)  hmR3Save(PVM pVM, PSSMHANDLE pSSM);
     333static DECLCALLBACK(int)  hmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
     334static DECLCALLBACK(void) hmR3InfoExitHistory(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
     335static int                hmR3InitCPU(PVM pVM);
     336static int                hmR3InitFinalizeR0(PVM pVM);
     337static int                hmR3InitFinalizeR0Intel(PVM pVM);
     338static int                hmR3InitFinalizeR0Amd(PVM pVM);
     339static int                hmR3TermCPU(PVM pVM);
    337340
    338341
     
    374377    if (RT_FAILURE(rc))
    375378        return rc;
     379
     380    /*
     381     * Register info handlers.
     382     */
     383    rc = DBGFR3InfoRegisterInternalEx(pVM, "exithistory", "Dumps the HM VM-exit history.", hmR3InfoExitHistory,
     384                                      DBGFINFO_FLAGS_RUN_ON_EMT);
     385    AssertRCReturn(rc, rc);
    376386
    377387    /*
     
    13861396            }
    13871397
    1388             /* We convert it here every time as pci regions could be reconfigured. */
     1398            /* We convert it here every time as PCI regions could be reconfigured. */
    13891399            if (PDMVmmDevHeapIsEnabled(pVM))
    13901400            {
     
    34473457}
    34483458
     3459
     3460/**
     3461 * Displays the guest VM-exit history.
     3462 *
     3463 * @param   pVM         The cross context VM structure.
     3464 * @param   pHlp        The info helper functions.
     3465 * @param   pszArgs     Arguments, ignored.
     3466 */
     3467static DECLCALLBACK(void) hmR3InfoExitHistory(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
     3468{
     3469    PVMCPU pVCpu = VMMGetCpu(pVM);
     3470    Assert(pVCpu);
     3471
     3472    if (HMIsEnabled(pVM))
     3473    {
     3474        bool const fIsVtx = pVM->hm.s.vmx.fSupported;
     3475        const char * const *papszDesc;
     3476        unsigned cMaxExitDesc;
     3477        if (fIsVtx)
     3478        {
     3479            cMaxExitDesc = MAX_EXITREASON_VTX;
     3480            papszDesc    = &g_apszVTxExitReasons[0];
     3481            pHlp->pfnPrintf(pHlp, "CPU[%u]: VT-x VM-exit history:\n", pVCpu->idCpu);
     3482        }
     3483        else
     3484        {
     3485            cMaxExitDesc = MAX_EXITREASON_AMDV;
     3486            papszDesc    = &g_apszAmdVExitReasons[0];
     3487            pHlp->pfnPrintf(pHlp, "CPU[%u]: AMD-V #VMEXIT history:\n", pVCpu->idCpu);
     3488        }
     3489
     3490        pHlp->pfnPrintf(pHlp, "  idxExitHistoryFree = %u\n", pVCpu->hm.s.idxExitHistoryFree);
     3491        unsigned const idxLast = pVCpu->hm.s.idxExitHistoryFree > 0 ?
     3492                                                                    pVCpu->hm.s.idxExitHistoryFree - 1 :
     3493                                                                    RT_ELEMENTS(pVCpu->hm.s.auExitHistory) - 1;
     3494        for (unsigned i = 0; i < RT_ELEMENTS(pVCpu->hm.s.auExitHistory); i++)
     3495        {
     3496            uint16_t const uExit = pVCpu->hm.s.auExitHistory[i];
     3497            const char *pszExit  = NULL;
     3498            if (uExit <= cMaxExitDesc)
     3499                pszExit = papszDesc[uExit];
     3500            else if (!fIsVtx && uExit == SVM_EXIT_NPF)
     3501                pszExit = SVM_EXIT_REASON_NPF;
     3502
     3503            pHlp->pfnPrintf(pHlp, "  auExitHistory[%2u] = 0x%04x  %s %s\n", i, uExit, pszExit,
     3504                            idxLast == i ? "<-- Latest exit" : "");
     3505        }
     3506    }
     3507    else
     3508        pHlp->pfnPrintf(pHlp, "HM is not enabled for this VM!\n");
     3509}
     3510
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