VirtualBox

Changeset 13067 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 8, 2008 10:11:24 AM (16 years ago)
Author:
vboxsync
Message:

#1865: More PGM changes.

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

Legend:

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

    r13062 r13067  
    668668#define PGM_SHW_TYPE                PGM_TYPE_32BIT
    669669#define PGM_SHW_NAME(name)          PGM_SHW_NAME_32BIT(name)
    670 #define PGM_SHW_NAME_GC_STR(name)   PGM_SHW_NAME_GC_32BIT_STR(name)
     670#define PGM_SHW_NAME_RC_STR(name)   PGM_SHW_NAME_RC_32BIT_STR(name)
    671671#define PGM_SHW_NAME_R0_STR(name)   PGM_SHW_NAME_R0_32BIT_STR(name)
    672672#include "PGMShw.h"
     
    675675#define PGM_GST_TYPE                PGM_TYPE_REAL
    676676#define PGM_GST_NAME(name)          PGM_GST_NAME_REAL(name)
    677 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_REAL_STR(name)
     677#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_REAL_STR(name)
    678678#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_REAL_STR(name)
    679679#define PGM_BTH_NAME(name)          PGM_BTH_NAME_32BIT_REAL(name)
    680 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_32BIT_REAL_STR(name)
     680#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_32BIT_REAL_STR(name)
    681681#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_32BIT_REAL_STR(name)
    682682#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_32BIT_PT_FOR_PHYS
     
    685685#undef BTH_PGMPOOLKIND_PT_FOR_PT
    686686#undef PGM_BTH_NAME
    687 #undef PGM_BTH_NAME_GC_STR
     687#undef PGM_BTH_NAME_RC_STR
    688688#undef PGM_BTH_NAME_R0_STR
    689689#undef PGM_GST_TYPE
    690690#undef PGM_GST_NAME
    691 #undef PGM_GST_NAME_GC_STR
     691#undef PGM_GST_NAME_RC_STR
    692692#undef PGM_GST_NAME_R0_STR
    693693
     
    695695#define PGM_GST_TYPE                PGM_TYPE_PROT
    696696#define PGM_GST_NAME(name)          PGM_GST_NAME_PROT(name)
    697 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_PROT_STR(name)
     697#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_PROT_STR(name)
    698698#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_PROT_STR(name)
    699699#define PGM_BTH_NAME(name)          PGM_BTH_NAME_32BIT_PROT(name)
    700 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_32BIT_PROT_STR(name)
     700#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_32BIT_PROT_STR(name)
    701701#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_32BIT_PROT_STR(name)
    702702#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_32BIT_PT_FOR_PHYS
     
    705705#undef BTH_PGMPOOLKIND_PT_FOR_PT
    706706#undef PGM_BTH_NAME
    707 #undef PGM_BTH_NAME_GC_STR
     707#undef PGM_BTH_NAME_RC_STR
    708708#undef PGM_BTH_NAME_R0_STR
    709709#undef PGM_GST_TYPE
    710710#undef PGM_GST_NAME
    711 #undef PGM_GST_NAME_GC_STR
     711#undef PGM_GST_NAME_RC_STR
    712712#undef PGM_GST_NAME_R0_STR
    713713
     
    715715#define PGM_GST_TYPE                PGM_TYPE_32BIT
    716716#define PGM_GST_NAME(name)          PGM_GST_NAME_32BIT(name)
    717 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_32BIT_STR(name)
     717#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_32BIT_STR(name)
    718718#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_32BIT_STR(name)
    719719#define PGM_BTH_NAME(name)          PGM_BTH_NAME_32BIT_32BIT(name)
    720 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_32BIT_32BIT_STR(name)
     720#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_32BIT_32BIT_STR(name)
    721721#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_32BIT_32BIT_STR(name)
    722722#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_32BIT_PT_FOR_32BIT_PT
     
    727727#undef BTH_PGMPOOLKIND_PT_FOR_PT
    728728#undef PGM_BTH_NAME
    729 #undef PGM_BTH_NAME_GC_STR
     729#undef PGM_BTH_NAME_RC_STR
    730730#undef PGM_BTH_NAME_R0_STR
    731731#undef PGM_GST_TYPE
    732732#undef PGM_GST_NAME
    733 #undef PGM_GST_NAME_GC_STR
     733#undef PGM_GST_NAME_RC_STR
    734734#undef PGM_GST_NAME_R0_STR
    735735
    736736#undef PGM_SHW_TYPE
    737737#undef PGM_SHW_NAME
    738 #undef PGM_SHW_NAME_GC_STR
     738#undef PGM_SHW_NAME_RC_STR
    739739#undef PGM_SHW_NAME_R0_STR
    740740
     
    745745#define PGM_SHW_TYPE                PGM_TYPE_PAE
    746746#define PGM_SHW_NAME(name)          PGM_SHW_NAME_PAE(name)
    747 #define PGM_SHW_NAME_GC_STR(name)   PGM_SHW_NAME_GC_PAE_STR(name)
     747#define PGM_SHW_NAME_RC_STR(name)   PGM_SHW_NAME_RC_PAE_STR(name)
    748748#define PGM_SHW_NAME_R0_STR(name)   PGM_SHW_NAME_R0_PAE_STR(name)
    749749#define PGM_BTH_NAME(name)          PGM_BTH_NAME_PAE_REAL(name)
     
    753753#define PGM_GST_TYPE                PGM_TYPE_REAL
    754754#define PGM_GST_NAME(name)          PGM_GST_NAME_REAL(name)
    755 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_REAL_STR(name)
     755#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_REAL_STR(name)
    756756#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_REAL_STR(name)
    757757#define PGM_BTH_NAME(name)          PGM_BTH_NAME_PAE_REAL(name)
    758 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_PAE_REAL_STR(name)
     758#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_PAE_REAL_STR(name)
    759759#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_PAE_REAL_STR(name)
    760760#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PHYS
     
    762762#undef BTH_PGMPOOLKIND_PT_FOR_PT
    763763#undef PGM_BTH_NAME
    764 #undef PGM_BTH_NAME_GC_STR
     764#undef PGM_BTH_NAME_RC_STR
    765765#undef PGM_BTH_NAME_R0_STR
    766766#undef PGM_GST_TYPE
    767767#undef PGM_GST_NAME
    768 #undef PGM_GST_NAME_GC_STR
     768#undef PGM_GST_NAME_RC_STR
    769769#undef PGM_GST_NAME_R0_STR
    770770
     
    772772#define PGM_GST_TYPE                PGM_TYPE_PROT
    773773#define PGM_GST_NAME(name)          PGM_GST_NAME_PROT(name)
    774 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_PROT_STR(name)
     774#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_PROT_STR(name)
    775775#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_PROT_STR(name)
    776776#define PGM_BTH_NAME(name)          PGM_BTH_NAME_PAE_PROT(name)
    777 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_PAE_PROT_STR(name)
     777#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_PAE_PROT_STR(name)
    778778#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_PAE_PROT_STR(name)
    779779#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PHYS
     
    781781#undef BTH_PGMPOOLKIND_PT_FOR_PT
    782782#undef PGM_BTH_NAME
    783 #undef PGM_BTH_NAME_GC_STR
     783#undef PGM_BTH_NAME_RC_STR
    784784#undef PGM_BTH_NAME_R0_STR
    785785#undef PGM_GST_TYPE
    786786#undef PGM_GST_NAME
    787 #undef PGM_GST_NAME_GC_STR
     787#undef PGM_GST_NAME_RC_STR
    788788#undef PGM_GST_NAME_R0_STR
    789789
     
    791791#define PGM_GST_TYPE                PGM_TYPE_32BIT
    792792#define PGM_GST_NAME(name)          PGM_GST_NAME_32BIT(name)
    793 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_32BIT_STR(name)
     793#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_32BIT_STR(name)
    794794#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_32BIT_STR(name)
    795795#define PGM_BTH_NAME(name)          PGM_BTH_NAME_PAE_32BIT(name)
    796 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_PAE_32BIT_STR(name)
     796#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_PAE_32BIT_STR(name)
    797797#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_PAE_32BIT_STR(name)
    798798#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_32BIT_PT
     
    802802#undef BTH_PGMPOOLKIND_PT_FOR_PT
    803803#undef PGM_BTH_NAME
    804 #undef PGM_BTH_NAME_GC_STR
     804#undef PGM_BTH_NAME_RC_STR
    805805#undef PGM_BTH_NAME_R0_STR
    806806#undef PGM_GST_TYPE
    807807#undef PGM_GST_NAME
    808 #undef PGM_GST_NAME_GC_STR
     808#undef PGM_GST_NAME_RC_STR
    809809#undef PGM_GST_NAME_R0_STR
    810810
     
    812812#define PGM_GST_TYPE                PGM_TYPE_PAE
    813813#define PGM_GST_NAME(name)          PGM_GST_NAME_PAE(name)
    814 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_PAE_STR(name)
     814#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_PAE_STR(name)
    815815#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_PAE_STR(name)
    816816#define PGM_BTH_NAME(name)          PGM_BTH_NAME_PAE_PAE(name)
    817 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_PAE_PAE_STR(name)
     817#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_PAE_PAE_STR(name)
    818818#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_PAE_PAE_STR(name)
    819819#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PAE_PT
     
    824824#undef BTH_PGMPOOLKIND_PT_FOR_PT
    825825#undef PGM_BTH_NAME
    826 #undef PGM_BTH_NAME_GC_STR
     826#undef PGM_BTH_NAME_RC_STR
    827827#undef PGM_BTH_NAME_R0_STR
    828828#undef PGM_GST_TYPE
    829829#undef PGM_GST_NAME
    830 #undef PGM_GST_NAME_GC_STR
     830#undef PGM_GST_NAME_RC_STR
    831831#undef PGM_GST_NAME_R0_STR
    832832
    833833#undef PGM_SHW_TYPE
    834834#undef PGM_SHW_NAME
    835 #undef PGM_SHW_NAME_GC_STR
     835#undef PGM_SHW_NAME_RC_STR
    836836#undef PGM_SHW_NAME_R0_STR
    837837
     
    842842#define PGM_SHW_TYPE                PGM_TYPE_AMD64
    843843#define PGM_SHW_NAME(name)          PGM_SHW_NAME_AMD64(name)
    844 #define PGM_SHW_NAME_GC_STR(name)   PGM_SHW_NAME_GC_AMD64_STR(name)
     844#define PGM_SHW_NAME_RC_STR(name)   PGM_SHW_NAME_RC_AMD64_STR(name)
    845845#define PGM_SHW_NAME_R0_STR(name)   PGM_SHW_NAME_R0_AMD64_STR(name)
    846846#include "PGMShw.h"
     
    849849#define PGM_GST_TYPE                PGM_TYPE_AMD64
    850850#define PGM_GST_NAME(name)          PGM_GST_NAME_AMD64(name)
    851 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_AMD64_STR(name)
     851#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_AMD64_STR(name)
    852852#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_AMD64_STR(name)
    853853#define PGM_BTH_NAME(name)          PGM_BTH_NAME_AMD64_AMD64(name)
    854 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_AMD64_AMD64_STR(name)
     854#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_AMD64_AMD64_STR(name)
    855855#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_AMD64_AMD64_STR(name)
    856856#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PAE_PT
     
    861861#undef BTH_PGMPOOLKIND_PT_FOR_PT
    862862#undef PGM_BTH_NAME
    863 #undef PGM_BTH_NAME_GC_STR
     863#undef PGM_BTH_NAME_RC_STR
    864864#undef PGM_BTH_NAME_R0_STR
    865865#undef PGM_GST_TYPE
    866866#undef PGM_GST_NAME
    867 #undef PGM_GST_NAME_GC_STR
     867#undef PGM_GST_NAME_RC_STR
    868868#undef PGM_GST_NAME_R0_STR
    869869
    870870#undef PGM_SHW_TYPE
    871871#undef PGM_SHW_NAME
    872 #undef PGM_SHW_NAME_GC_STR
     872#undef PGM_SHW_NAME_RC_STR
    873873#undef PGM_SHW_NAME_R0_STR
    874874
     
    878878#define PGM_SHW_TYPE                PGM_TYPE_NESTED
    879879#define PGM_SHW_NAME(name)          PGM_SHW_NAME_NESTED(name)
    880 #define PGM_SHW_NAME_GC_STR(name)   PGM_SHW_NAME_GC_NESTED_STR(name)
     880#define PGM_SHW_NAME_RC_STR(name)   PGM_SHW_NAME_RC_NESTED_STR(name)
    881881#define PGM_SHW_NAME_R0_STR(name)   PGM_SHW_NAME_R0_NESTED_STR(name)
    882882#include "PGMShw.h"
     
    885885#define PGM_GST_TYPE                PGM_TYPE_REAL
    886886#define PGM_GST_NAME(name)          PGM_GST_NAME_REAL(name)
    887 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_REAL_STR(name)
     887#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_REAL_STR(name)
    888888#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_REAL_STR(name)
    889889#define PGM_BTH_NAME(name)          PGM_BTH_NAME_NESTED_REAL(name)
    890 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_NESTED_REAL_STR(name)
     890#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_NESTED_REAL_STR(name)
    891891#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_NESTED_REAL_STR(name)
    892892#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PHYS
     
    894894#undef BTH_PGMPOOLKIND_PT_FOR_PT
    895895#undef PGM_BTH_NAME
    896 #undef PGM_BTH_NAME_GC_STR
     896#undef PGM_BTH_NAME_RC_STR
    897897#undef PGM_BTH_NAME_R0_STR
    898898#undef PGM_GST_TYPE
    899899#undef PGM_GST_NAME
    900 #undef PGM_GST_NAME_GC_STR
     900#undef PGM_GST_NAME_RC_STR
    901901#undef PGM_GST_NAME_R0_STR
    902902
     
    904904#define PGM_GST_TYPE                PGM_TYPE_PROT
    905905#define PGM_GST_NAME(name)          PGM_GST_NAME_PROT(name)
    906 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_PROT_STR(name)
     906#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_PROT_STR(name)
    907907#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_PROT_STR(name)
    908908#define PGM_BTH_NAME(name)          PGM_BTH_NAME_NESTED_PROT(name)
    909 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_NESTED_PROT_STR(name)
     909#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_NESTED_PROT_STR(name)
    910910#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_NESTED_PROT_STR(name)
    911911#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PHYS
     
    913913#undef BTH_PGMPOOLKIND_PT_FOR_PT
    914914#undef PGM_BTH_NAME
    915 #undef PGM_BTH_NAME_GC_STR
     915#undef PGM_BTH_NAME_RC_STR
    916916#undef PGM_BTH_NAME_R0_STR
    917917#undef PGM_GST_TYPE
    918918#undef PGM_GST_NAME
    919 #undef PGM_GST_NAME_GC_STR
     919#undef PGM_GST_NAME_RC_STR
    920920#undef PGM_GST_NAME_R0_STR
    921921
     
    923923#define PGM_GST_TYPE                PGM_TYPE_32BIT
    924924#define PGM_GST_NAME(name)          PGM_GST_NAME_32BIT(name)
    925 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_32BIT_STR(name)
     925#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_32BIT_STR(name)
    926926#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_32BIT_STR(name)
    927927#define PGM_BTH_NAME(name)          PGM_BTH_NAME_NESTED_32BIT(name)
    928 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_NESTED_32BIT_STR(name)
     928#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_NESTED_32BIT_STR(name)
    929929#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_NESTED_32BIT_STR(name)
    930930#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_32BIT_PT
     
    934934#undef BTH_PGMPOOLKIND_PT_FOR_PT
    935935#undef PGM_BTH_NAME
    936 #undef PGM_BTH_NAME_GC_STR
     936#undef PGM_BTH_NAME_RC_STR
    937937#undef PGM_BTH_NAME_R0_STR
    938938#undef PGM_GST_TYPE
    939939#undef PGM_GST_NAME
    940 #undef PGM_GST_NAME_GC_STR
     940#undef PGM_GST_NAME_RC_STR
    941941#undef PGM_GST_NAME_R0_STR
    942942
     
    944944#define PGM_GST_TYPE                PGM_TYPE_PAE
    945945#define PGM_GST_NAME(name)          PGM_GST_NAME_PAE(name)
    946 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_PAE_STR(name)
     946#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_PAE_STR(name)
    947947#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_PAE_STR(name)
    948948#define PGM_BTH_NAME(name)          PGM_BTH_NAME_NESTED_PAE(name)
    949 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_NESTED_PAE_STR(name)
     949#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_NESTED_PAE_STR(name)
    950950#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_NESTED_PAE_STR(name)
    951951#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PAE_PT
     
    955955#undef BTH_PGMPOOLKIND_PT_FOR_PT
    956956#undef PGM_BTH_NAME
    957 #undef PGM_BTH_NAME_GC_STR
     957#undef PGM_BTH_NAME_RC_STR
    958958#undef PGM_BTH_NAME_R0_STR
    959959#undef PGM_GST_TYPE
    960960#undef PGM_GST_NAME
    961 #undef PGM_GST_NAME_GC_STR
     961#undef PGM_GST_NAME_RC_STR
    962962#undef PGM_GST_NAME_R0_STR
    963963
     
    965965#define PGM_GST_TYPE                PGM_TYPE_AMD64
    966966#define PGM_GST_NAME(name)          PGM_GST_NAME_AMD64(name)
    967 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_AMD64_STR(name)
     967#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_AMD64_STR(name)
    968968#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_AMD64_STR(name)
    969969#define PGM_BTH_NAME(name)          PGM_BTH_NAME_NESTED_AMD64(name)
    970 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_NESTED_AMD64_STR(name)
     970#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_NESTED_AMD64_STR(name)
    971971#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_NESTED_AMD64_STR(name)
    972972#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PAE_PT
     
    976976#undef BTH_PGMPOOLKIND_PT_FOR_PT
    977977#undef PGM_BTH_NAME
    978 #undef PGM_BTH_NAME_GC_STR
     978#undef PGM_BTH_NAME_RC_STR
    979979#undef PGM_BTH_NAME_R0_STR
    980980#undef PGM_GST_TYPE
    981981#undef PGM_GST_NAME
    982 #undef PGM_GST_NAME_GC_STR
     982#undef PGM_GST_NAME_RC_STR
    983983#undef PGM_GST_NAME_R0_STR
    984984
    985985#undef PGM_SHW_TYPE
    986986#undef PGM_SHW_NAME
    987 #undef PGM_SHW_NAME_GC_STR
     987#undef PGM_SHW_NAME_RC_STR
    988988#undef PGM_SHW_NAME_R0_STR
    989989
     
    993993#define PGM_SHW_TYPE                PGM_TYPE_EPT
    994994#define PGM_SHW_NAME(name)          PGM_SHW_NAME_EPT(name)
    995 #define PGM_SHW_NAME_GC_STR(name)   PGM_SHW_NAME_GC_EPT_STR(name)
     995#define PGM_SHW_NAME_RC_STR(name)   PGM_SHW_NAME_RC_EPT_STR(name)
    996996#define PGM_SHW_NAME_R0_STR(name)   PGM_SHW_NAME_R0_EPT_STR(name)
    997997#include "PGMShw.h"
     
    10001000#define PGM_GST_TYPE                PGM_TYPE_REAL
    10011001#define PGM_GST_NAME(name)          PGM_GST_NAME_REAL(name)
    1002 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_REAL_STR(name)
     1002#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_REAL_STR(name)
    10031003#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_REAL_STR(name)
    10041004#define PGM_BTH_NAME(name)          PGM_BTH_NAME_EPT_REAL(name)
    1005 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_EPT_REAL_STR(name)
     1005#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_EPT_REAL_STR(name)
    10061006#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_EPT_REAL_STR(name)
    10071007#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PHYS
     
    10091009#undef BTH_PGMPOOLKIND_PT_FOR_PT
    10101010#undef PGM_BTH_NAME
    1011 #undef PGM_BTH_NAME_GC_STR
     1011#undef PGM_BTH_NAME_RC_STR
    10121012#undef PGM_BTH_NAME_R0_STR
    10131013#undef PGM_GST_TYPE
    10141014#undef PGM_GST_NAME
    1015 #undef PGM_GST_NAME_GC_STR
     1015#undef PGM_GST_NAME_RC_STR
    10161016#undef PGM_GST_NAME_R0_STR
    10171017
     
    10191019#define PGM_GST_TYPE                PGM_TYPE_PROT
    10201020#define PGM_GST_NAME(name)          PGM_GST_NAME_PROT(name)
    1021 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_PROT_STR(name)
     1021#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_PROT_STR(name)
    10221022#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_PROT_STR(name)
    10231023#define PGM_BTH_NAME(name)          PGM_BTH_NAME_EPT_PROT(name)
    1024 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_EPT_PROT_STR(name)
     1024#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_EPT_PROT_STR(name)
    10251025#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_EPT_PROT_STR(name)
    10261026#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PHYS
     
    10281028#undef BTH_PGMPOOLKIND_PT_FOR_PT
    10291029#undef PGM_BTH_NAME
    1030 #undef PGM_BTH_NAME_GC_STR
     1030#undef PGM_BTH_NAME_RC_STR
    10311031#undef PGM_BTH_NAME_R0_STR
    10321032#undef PGM_GST_TYPE
    10331033#undef PGM_GST_NAME
    1034 #undef PGM_GST_NAME_GC_STR
     1034#undef PGM_GST_NAME_RC_STR
    10351035#undef PGM_GST_NAME_R0_STR
    10361036
     
    10381038#define PGM_GST_TYPE                PGM_TYPE_32BIT
    10391039#define PGM_GST_NAME(name)          PGM_GST_NAME_32BIT(name)
    1040 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_32BIT_STR(name)
     1040#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_32BIT_STR(name)
    10411041#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_32BIT_STR(name)
    10421042#define PGM_BTH_NAME(name)          PGM_BTH_NAME_EPT_32BIT(name)
    1043 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_EPT_32BIT_STR(name)
     1043#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_EPT_32BIT_STR(name)
    10441044#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_EPT_32BIT_STR(name)
    10451045#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_32BIT_PT
     
    10491049#undef BTH_PGMPOOLKIND_PT_FOR_PT
    10501050#undef PGM_BTH_NAME
    1051 #undef PGM_BTH_NAME_GC_STR
     1051#undef PGM_BTH_NAME_RC_STR
    10521052#undef PGM_BTH_NAME_R0_STR
    10531053#undef PGM_GST_TYPE
    10541054#undef PGM_GST_NAME
    1055 #undef PGM_GST_NAME_GC_STR
     1055#undef PGM_GST_NAME_RC_STR
    10561056#undef PGM_GST_NAME_R0_STR
    10571057
     
    10591059#define PGM_GST_TYPE                PGM_TYPE_PAE
    10601060#define PGM_GST_NAME(name)          PGM_GST_NAME_PAE(name)
    1061 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_PAE_STR(name)
     1061#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_PAE_STR(name)
    10621062#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_PAE_STR(name)
    10631063#define PGM_BTH_NAME(name)          PGM_BTH_NAME_EPT_PAE(name)
    1064 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_EPT_PAE_STR(name)
     1064#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_EPT_PAE_STR(name)
    10651065#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_EPT_PAE_STR(name)
    10661066#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PAE_PT
     
    10701070#undef BTH_PGMPOOLKIND_PT_FOR_PT
    10711071#undef PGM_BTH_NAME
    1072 #undef PGM_BTH_NAME_GC_STR
     1072#undef PGM_BTH_NAME_RC_STR
    10731073#undef PGM_BTH_NAME_R0_STR
    10741074#undef PGM_GST_TYPE
    10751075#undef PGM_GST_NAME
    1076 #undef PGM_GST_NAME_GC_STR
     1076#undef PGM_GST_NAME_RC_STR
    10771077#undef PGM_GST_NAME_R0_STR
    10781078
     
    10801080#define PGM_GST_TYPE                PGM_TYPE_AMD64
    10811081#define PGM_GST_NAME(name)          PGM_GST_NAME_AMD64(name)
    1082 #define PGM_GST_NAME_GC_STR(name)   PGM_GST_NAME_GC_AMD64_STR(name)
     1082#define PGM_GST_NAME_RC_STR(name)   PGM_GST_NAME_RC_AMD64_STR(name)
    10831083#define PGM_GST_NAME_R0_STR(name)   PGM_GST_NAME_R0_AMD64_STR(name)
    10841084#define PGM_BTH_NAME(name)          PGM_BTH_NAME_EPT_AMD64(name)
    1085 #define PGM_BTH_NAME_GC_STR(name)   PGM_BTH_NAME_GC_EPT_AMD64_STR(name)
     1085#define PGM_BTH_NAME_RC_STR(name)   PGM_BTH_NAME_RC_EPT_AMD64_STR(name)
    10861086#define PGM_BTH_NAME_R0_STR(name)   PGM_BTH_NAME_R0_EPT_AMD64_STR(name)
    10871087#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PAE_PT
     
    10911091#undef BTH_PGMPOOLKIND_PT_FOR_PT
    10921092#undef PGM_BTH_NAME
    1093 #undef PGM_BTH_NAME_GC_STR
     1093#undef PGM_BTH_NAME_RC_STR
    10941094#undef PGM_BTH_NAME_R0_STR
    10951095#undef PGM_GST_TYPE
    10961096#undef PGM_GST_NAME
    1097 #undef PGM_GST_NAME_GC_STR
     1097#undef PGM_GST_NAME_RC_STR
    10981098#undef PGM_GST_NAME_R0_STR
    10991099
    11001100#undef PGM_SHW_TYPE
    11011101#undef PGM_SHW_NAME
    1102 #undef PGM_SHW_NAME_GC_STR
     1102#undef PGM_SHW_NAME_RC_STR
    11031103#undef PGM_SHW_NAME_R0_STR
    11041104
     
    14941494{
    14951495    PPGM pPGM = &pVM->pgm.s;
    1496     STAM_REG(pVM, &pPGM->StatGCInvalidatePage,              STAMTYPE_PROFILE, "/PGM/GC/InvalidatePage",             STAMUNIT_TICKS_PER_CALL, "PGMGCInvalidatePage() profiling.");
    1497     STAM_REG(pVM, &pPGM->StatGCInvalidatePage4KBPages,      STAMTYPE_COUNTER, "/PGM/GC/InvalidatePage/4KBPages",    STAMUNIT_OCCURENCES,     "The number of times PGMGCInvalidatePage() was called for a 4KB page.");
    1498     STAM_REG(pVM, &pPGM->StatGCInvalidatePage4MBPages,      STAMTYPE_COUNTER, "/PGM/GC/InvalidatePage/4MBPages",    STAMUNIT_OCCURENCES,     "The number of times PGMGCInvalidatePage() was called for a 4MB page.");
    1499     STAM_REG(pVM, &pPGM->StatGCInvalidatePage4MBPagesSkip,  STAMTYPE_COUNTER, "/PGM/GC/InvalidatePage/4MBPagesSkip",STAMUNIT_OCCURENCES,     "The number of times PGMGCInvalidatePage() skipped a 4MB page.");
    1500     STAM_REG(pVM, &pPGM->StatGCInvalidatePagePDMappings,    STAMTYPE_COUNTER, "/PGM/GC/InvalidatePage/PDMappings",  STAMUNIT_OCCURENCES,     "The number of times PGMGCInvalidatePage() was called for a page directory containing mappings (no conflict).");
    1501     STAM_REG(pVM, &pPGM->StatGCInvalidatePagePDNAs,         STAMTYPE_COUNTER, "/PGM/GC/InvalidatePage/PDNAs",       STAMUNIT_OCCURENCES,     "The number of times PGMGCInvalidatePage() was called for a not accessed page directory.");
    1502     STAM_REG(pVM, &pPGM->StatGCInvalidatePagePDNPs,         STAMTYPE_COUNTER, "/PGM/GC/InvalidatePage/PDNPs",       STAMUNIT_OCCURENCES,     "The number of times PGMGCInvalidatePage() was called for a not present page directory.");
    1503     STAM_REG(pVM, &pPGM->StatGCInvalidatePagePDOutOfSync,   STAMTYPE_COUNTER, "/PGM/GC/InvalidatePage/PDOutOfSync", STAMUNIT_OCCURENCES,     "The number of times PGMGCInvalidatePage() was called for an out of sync page directory.");
    1504     STAM_REG(pVM, &pPGM->StatGCInvalidatePageSkipped,       STAMTYPE_COUNTER, "/PGM/GC/InvalidatePage/Skipped",     STAMUNIT_OCCURENCES,     "The number of times PGMGCInvalidatePage() was skipped due to not present shw or pending pending SyncCR3.");
    1505     STAM_REG(pVM, &pPGM->StatGCSyncPT,                      STAMTYPE_PROFILE, "/PGM/GC/SyncPT",                     STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMGCSyncPT() body.");
    1506     STAM_REG(pVM, &pPGM->StatGCAccessedPage,                STAMTYPE_COUNTER, "/PGM/GC/AccessedPage",               STAMUNIT_OCCURENCES,     "The number of pages marked not present for accessed bit emulation.");
    1507     STAM_REG(pVM, &pPGM->StatGCDirtyPage,                   STAMTYPE_COUNTER, "/PGM/GC/DirtyPage/Mark",             STAMUNIT_OCCURENCES,     "The number of pages marked read-only for dirty bit tracking.");
    1508     STAM_REG(pVM, &pPGM->StatGCDirtyPageBig,                STAMTYPE_COUNTER, "/PGM/GC/DirtyPage/MarkBig",          STAMUNIT_OCCURENCES,     "The number of 4MB pages marked read-only for dirty bit tracking.");
    1509     STAM_REG(pVM, &pPGM->StatGCDirtyPageTrap,               STAMTYPE_COUNTER, "/PGM/GC/DirtyPage/Trap",             STAMUNIT_OCCURENCES,     "The number of traps generated for dirty bit tracking.");
    1510     STAM_REG(pVM, &pPGM->StatGCDirtyPageSkipped,            STAMTYPE_COUNTER, "/PGM/GC/DirtyPage/Skipped",          STAMUNIT_OCCURENCES,     "The number of pages already dirty or readonly.");
    1511     STAM_REG(pVM, &pPGM->StatGCDirtiedPage,                 STAMTYPE_COUNTER, "/PGM/GC/DirtyPage/SetDirty",         STAMUNIT_OCCURENCES,     "The number of pages marked dirty because of write accesses.");
    1512     STAM_REG(pVM, &pPGM->StatGCDirtyTrackRealPF,            STAMTYPE_COUNTER, "/PGM/GC/DirtyPage/RealPF",           STAMUNIT_OCCURENCES,     "The number of real pages faults during dirty bit tracking.");
    1513     STAM_REG(pVM, &pPGM->StatGCPageAlreadyDirty,            STAMTYPE_COUNTER, "/PGM/GC/DirtyPage/AlreadySet",       STAMUNIT_OCCURENCES,     "The number of pages already marked dirty because of write accesses.");
    1514     STAM_REG(pVM, &pPGM->StatGCDirtyBitTracking,            STAMTYPE_PROFILE, "/PGM/GC/DirtyPage",                  STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMTrackDirtyBit() body.");
    1515     STAM_REG(pVM, &pPGM->StatGCSyncPTAlloc,                 STAMTYPE_COUNTER, "/PGM/GC/SyncPT/Alloc",               STAMUNIT_OCCURENCES,     "The number of times PGMGCSyncPT() needed to allocate page tables.");
    1516     STAM_REG(pVM, &pPGM->StatGCSyncPTConflict,              STAMTYPE_COUNTER, "/PGM/GC/SyncPT/Conflicts",           STAMUNIT_OCCURENCES,     "The number of times PGMGCSyncPT() detected conflicts.");
    1517     STAM_REG(pVM, &pPGM->StatGCSyncPTFailed,                STAMTYPE_COUNTER, "/PGM/GC/SyncPT/Failed",              STAMUNIT_OCCURENCES,     "The number of times PGMGCSyncPT() failed.");
     1496
     1497    /*
     1498     * Note! The layout of this function matches the member layout exactly!
     1499     */
     1500
     1501    /* R3 only: */
     1502
     1503    /* GC only: */
     1504    STAM_REG(pVM, &pPGM->StatGCInvalidatePage,              STAMTYPE_PROFILE, "/PGM/GCInvalidatePage",              STAMUNIT_TICKS_PER_CALL, "PGMGCInvalidatePage() profiling.");
     1505
     1506    /* RZ only: */
     1507
     1508    /* R0 only: */
     1509
     1510    /* RZ & R3: */
     1511    STAM_REG(pVM, &pPGM->StatRZSyncCR3,                     STAMTYPE_PROFILE, "/PGM/RZ/SyncCR3",                        STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMSyncCR3() body.");
     1512    STAM_REG(pVM, &pPGM->StatRZSyncCR3Handlers,             STAMTYPE_PROFILE, "/PGM/RZ/SyncCR3/Handlers",               STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMSyncCR3() update handler section.");
     1513    STAM_REG(pVM, &pPGM->StatRZSyncCR3HandlerVirtualUpdate, STAMTYPE_PROFILE, "/PGM/RZ/SyncCR3/Handlers/VirtualUpdate", STAMUNIT_TICKS_PER_CALL, "Profiling of the virtual handler updates.");
     1514    STAM_REG(pVM, &pPGM->StatRZSyncCR3HandlerVirtualReset,  STAMTYPE_PROFILE, "/PGM/RZ/SyncCR3/Handlers/VirtualReset",  STAMUNIT_TICKS_PER_CALL, "Profiling of the virtual handler resets.");
     1515    STAM_REG(pVM, &pPGM->StatRZSyncCR3Global,               STAMTYPE_COUNTER, "/PGM/RZ/SyncCR3/Global",                 STAMUNIT_OCCURENCES,     "The number of global CR3 syncs.");
     1516    STAM_REG(pVM, &pPGM->StatRZSyncCR3NotGlobal,            STAMTYPE_COUNTER, "/PGM/RZ/SyncCR3/NotGlobal",              STAMUNIT_OCCURENCES,     "The number of non-global CR3 syncs.");
     1517    STAM_REG(pVM, &pPGM->StatRZSyncCR3DstCacheHit,          STAMTYPE_COUNTER, "/PGM/RZ/SyncCR3/DstChacheHit",           STAMUNIT_OCCURENCES,     "The number of times we got some kind of a cache hit.");
     1518    STAM_REG(pVM, &pPGM->StatRZSyncCR3DstFreed,             STAMTYPE_COUNTER, "/PGM/RZ/SyncCR3/DstFreed",               STAMUNIT_OCCURENCES,     "The number of times we've had to free a shadow entry.");
     1519    STAM_REG(pVM, &pPGM->StatRZSyncCR3DstFreedSrcNP,        STAMTYPE_COUNTER, "/PGM/RZ/SyncCR3/DstFreedSrcNP",          STAMUNIT_OCCURENCES,     "The number of times we've had to free a shadow entry for which the source entry was not present.");
     1520    STAM_REG(pVM, &pPGM->StatRZSyncCR3DstNotPresent,        STAMTYPE_COUNTER, "/PGM/RZ/SyncCR3/DstNotPresent",          STAMUNIT_OCCURENCES,     "The number of times we've encountered a not present shadow entry for a present guest entry.");
     1521    STAM_REG(pVM, &pPGM->StatRZSyncCR3DstSkippedGlobalPD,   STAMTYPE_COUNTER, "/PGM/RZ/SyncCR3/DstSkippedGlobalPD",     STAMUNIT_OCCURENCES,     "The number of times a global page directory wasn't flushed.");
     1522    STAM_REG(pVM, &pPGM->StatRZSyncCR3DstSkippedGlobalPT,   STAMTYPE_COUNTER, "/PGM/RZ/SyncCR3/DstSkippedGlobalPT",     STAMUNIT_OCCURENCES,     "The number of times a page table with only global entries wasn't flushed.");
     1523    STAM_REG(pVM, &pPGM->StatRZSyncPT,                      STAMTYPE_PROFILE, "/PGM/RZ/SyncPT",                         STAMUNIT_TICKS_PER_CALL, "Profiling of the pfnSyncPT() body.");
     1524    STAM_REG(pVM, &pPGM->StatRZSyncPTFailed,                STAMTYPE_COUNTER, "/PGM/RZ/SyncPT/Failed",                  STAMUNIT_OCCURENCES,     "The number of times pfnSyncPT() failed.");
     1525    STAM_REG(pVM, &pPGM->StatRZSyncPagePDNAs,               STAMTYPE_COUNTER, "/PGM/GC/SyncPagePDNAs",                  STAMUNIT_OCCURENCES,     "The number of time we've marked a PD not present from SyncPage to virtualize the accessed bit.");
     1526    STAM_REG(pVM, &pPGM->StatRZSyncPagePDOutOfSync,         STAMTYPE_COUNTER, "/PGM/GC/SyncPagePDOutOfSync",            STAMUNIT_OCCURENCES,     "The number of time we've encountered an out-of-sync PD in SyncPage.");
     1527    STAM_REG(pVM, &pPGM->StatRZAccessedPage,                STAMTYPE_COUNTER, "/PGM/RZ/AccessedPage",               STAMUNIT_OCCURENCES,     "The number of pages marked not present for accessed bit emulation.");
     1528    STAM_REG(pVM, &pPGM->StatRZDirtyBitTracking,            STAMTYPE_PROFILE, "/PGM/RZ/DirtyPage",                  STAMUNIT_TICKS_PER_CALL, "Profiling the dirty bit tracking in CheckPageFault().");
     1529    STAM_REG(pVM, &pPGM->StatRZDirtyPage,                   STAMTYPE_COUNTER, "/PGM/RZ/DirtyPage/Mark",             STAMUNIT_OCCURENCES,     "The number of pages marked read-only for dirty bit tracking.");
     1530    STAM_REG(pVM, &pPGM->StatRZDirtyPageBig,                STAMTYPE_COUNTER, "/PGM/RZ/DirtyPage/MarkBig",          STAMUNIT_OCCURENCES,     "The number of 4MB pages marked read-only for dirty bit tracking.");
     1531    STAM_REG(pVM, &pPGM->StatRZDirtyPageSkipped,            STAMTYPE_COUNTER, "/PGM/RZ/DirtyPage/Skipped",          STAMUNIT_OCCURENCES,     "The number of pages already dirty or readonly.");
     1532    STAM_REG(pVM, &pPGM->StatRZDirtyPageTrap,               STAMTYPE_COUNTER, "/PGM/RZ/DirtyPage/Trap",             STAMUNIT_OCCURENCES,     "The number of traps generated for dirty bit tracking.");
     1533    STAM_REG(pVM, &pPGM->StatRZDirtiedPage,                 STAMTYPE_COUNTER, "/PGM/RZ/DirtyPage/SetDirty",         STAMUNIT_OCCURENCES,     "The number of pages marked dirty because of write accesses.");
     1534    STAM_REG(pVM, &pPGM->StatRZDirtyTrackRealPF,            STAMTYPE_COUNTER, "/PGM/RZ/DirtyPage/RealPF",           STAMUNIT_OCCURENCES,     "The number of real pages faults during dirty bit tracking.");
     1535    STAM_REG(pVM, &pPGM->StatRZPageAlreadyDirty,            STAMTYPE_COUNTER, "/PGM/RZ/DirtyPage/AlreadySet",       STAMUNIT_OCCURENCES,     "The number of pages already marked dirty because of write accesses.");
     1536    STAM_REG(pVM, &pPGM->StatRZInvalidatePage,              STAMTYPE_PROFILE, "/PGM/RZ/InvalidatePage",             STAMUNIT_TICKS_PER_CALL, "PGMInvalidatePage() profiling.");
     1537    STAM_REG(pVM, &pPGM->StatRZInvalidatePage4KBPages,      STAMTYPE_COUNTER, "/PGM/RZ/InvalidatePage/4KBPages",    STAMUNIT_OCCURENCES,     "The number of times PGMInvalidatePage() was called for a 4KB page.");
     1538    STAM_REG(pVM, &pPGM->StatRZInvalidatePage4MBPages,      STAMTYPE_COUNTER, "/PGM/RZ/InvalidatePage/4MBPages",    STAMUNIT_OCCURENCES,     "The number of times PGMInvalidatePage() was called for a 4MB page.");
     1539    STAM_REG(pVM, &pPGM->StatRZInvalidatePage4MBPagesSkip,  STAMTYPE_COUNTER, "/PGM/RZ/InvalidatePage/4MBPagesSkip",STAMUNIT_OCCURENCES,     "The number of times PGMInvalidatePage() skipped a 4MB page.");
     1540    STAM_REG(pVM, &pPGM->StatRZInvalidatePagePDMappings,    STAMTYPE_COUNTER, "/PGM/RZ/InvalidatePage/PDMappings",  STAMUNIT_OCCURENCES,     "The number of times PGMInvalidatePage() was called for a page directory containing mappings (no conflict).");
     1541    STAM_REG(pVM, &pPGM->StatRZInvalidatePagePDNAs,         STAMTYPE_COUNTER, "/PGM/RZ/InvalidatePage/PDNAs",       STAMUNIT_OCCURENCES,     "The number of times PGMInvalidatePage() was called for a not accessed page directory.");
     1542    STAM_REG(pVM, &pPGM->StatRZInvalidatePagePDNPs,         STAMTYPE_COUNTER, "/PGM/RZ/InvalidatePage/PDNPs",       STAMUNIT_OCCURENCES,     "The number of times PGMInvalidatePage() was called for a not present page directory.");
     1543    STAM_REG(pVM, &pPGM->StatRZInvalidatePagePDOutOfSync,   STAMTYPE_COUNTER, "/PGM/RZ/InvalidatePage/PDOutOfSync", STAMUNIT_OCCURENCES,     "The number of times PGMInvalidatePage() was called for an out of sync page directory.");
     1544    STAM_REG(pVM, &pPGM->StatRZInvalidatePageSkipped,       STAMTYPE_COUNTER, "/PGM/RZ/InvalidatePage/Skipped",     STAMUNIT_OCCURENCES,     "The number of times PGMInvalidatePage() was skipped due to not present shw or pending pending SyncCR3.");
     1545
     1546
     1547    /* TODO: */
    15181548
    15191549    STAM_REG(pVM, &pPGM->StatGCTrap0e,                      STAMTYPE_PROFILE, "/PGM/GC/Trap0e",                     STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMGCTrap0eHandler() body.");
     
    15821612    STAM_REG(pVM, &pPGM->StatHCGuestPDWriteConflict,        STAMTYPE_COUNTER, "/PGM/HC/PDWriteConflict",            STAMUNIT_OCCURENCES,     "The number of times pgmHCGuestPDWriteHandler() detected a conflict.");
    15831613
    1584     STAM_REG(pVM, &pPGM->StatHCInvalidatePage,              STAMTYPE_PROFILE, "/PGM/HC/InvalidatePage",             STAMUNIT_TICKS_PER_CALL, "PGMHCInvalidatePage() profiling.");
    1585     STAM_REG(pVM, &pPGM->StatHCInvalidatePage4KBPages,      STAMTYPE_COUNTER, "/PGM/HC/InvalidatePage/4KBPages",    STAMUNIT_OCCURENCES,     "The number of times PGMHCInvalidatePage() was called for a 4KB page.");
    1586     STAM_REG(pVM, &pPGM->StatHCInvalidatePage4MBPages,      STAMTYPE_COUNTER, "/PGM/HC/InvalidatePage/4MBPages",    STAMUNIT_OCCURENCES,     "The number of times PGMHCInvalidatePage() was called for a 4MB page.");
    1587     STAM_REG(pVM, &pPGM->StatHCInvalidatePage4MBPagesSkip,  STAMTYPE_COUNTER, "/PGM/HC/InvalidatePage/4MBPagesSkip",STAMUNIT_OCCURENCES,     "The number of times PGMHCInvalidatePage() skipped a 4MB page.");
    1588     STAM_REG(pVM, &pPGM->StatHCInvalidatePagePDMappings,    STAMTYPE_COUNTER, "/PGM/HC/InvalidatePage/PDMappings",  STAMUNIT_OCCURENCES,     "The number of times PGMHCInvalidatePage() was called for a page directory containing mappings (no conflict).");
    1589     STAM_REG(pVM, &pPGM->StatHCInvalidatePagePDNAs,         STAMTYPE_COUNTER, "/PGM/HC/InvalidatePage/PDNAs",       STAMUNIT_OCCURENCES,     "The number of times PGMHCInvalidatePage() was called for a not accessed page directory.");
    1590     STAM_REG(pVM, &pPGM->StatHCInvalidatePagePDNPs,         STAMTYPE_COUNTER, "/PGM/HC/InvalidatePage/PDNPs",       STAMUNIT_OCCURENCES,     "The number of times PGMHCInvalidatePage() was called for a not present page directory.");
    1591     STAM_REG(pVM, &pPGM->StatHCInvalidatePagePDOutOfSync,   STAMTYPE_COUNTER, "/PGM/HC/InvalidatePage/PDOutOfSync", STAMUNIT_OCCURENCES,     "The number of times PGMGCInvalidatePage() was called for an out of sync page directory.");
    1592     STAM_REG(pVM, &pPGM->StatHCInvalidatePageSkipped,       STAMTYPE_COUNTER, "/PGM/HC/InvalidatePage/Skipped",     STAMUNIT_OCCURENCES,     "The number of times PGMHCInvalidatePage() was skipped due to not present shw or pending pending SyncCR3.");
    15931614    STAM_REG(pVM, &pPGM->StatHCResolveConflict,             STAMTYPE_PROFILE, "/PGM/HC/ResolveConflict",            STAMUNIT_TICKS_PER_CALL, "pgmR3SyncPTResolveConflict() profiling (includes the entire relocation).");
    15941615    STAM_REG(pVM, &pPGM->StatHCPrefetch,                    STAMTYPE_PROFILE, "/PGM/HC/Prefetch",                   STAMUNIT_TICKS_PER_CALL, "PGMR3PrefetchPage profiling.");
    15951616
    1596     STAM_REG(pVM, &pPGM->StatHCSyncPT,                      STAMTYPE_PROFILE, "/PGM/HC/SyncPT",                     STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMR3SyncPT() body.");
    1597     STAM_REG(pVM, &pPGM->StatHCAccessedPage,                STAMTYPE_COUNTER, "/PGM/HC/AccessedPage",               STAMUNIT_OCCURENCES,     "The number of pages marked not present for accessed bit emulation.");
    1598     STAM_REG(pVM, &pPGM->StatHCDirtyPage,                   STAMTYPE_COUNTER, "/PGM/HC/DirtyPage/Mark",             STAMUNIT_OCCURENCES,     "The number of pages marked read-only for dirty bit tracking.");
    1599     STAM_REG(pVM, &pPGM->StatHCDirtyPageBig,                STAMTYPE_COUNTER, "/PGM/HC/DirtyPage/MarkBig",          STAMUNIT_OCCURENCES,     "The number of 4MB pages marked read-only for dirty bit tracking.");
    1600     STAM_REG(pVM, &pPGM->StatHCDirtyPageTrap,               STAMTYPE_COUNTER, "/PGM/HC/DirtyPage/Trap",             STAMUNIT_OCCURENCES,     "The number of traps generated for dirty bit tracking.");
    1601     STAM_REG(pVM, &pPGM->StatHCDirtyPageSkipped,            STAMTYPE_COUNTER, "/PGM/HC/DirtyPage/Skipped",          STAMUNIT_OCCURENCES,     "The number of pages already dirty or readonly.");
    1602     STAM_REG(pVM, &pPGM->StatHCDirtyBitTracking,            STAMTYPE_PROFILE, "/PGM/HC/DirtyPage",                  STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMTrackDirtyBit() body.");
    1603 
    1604     STAM_REG(pVM, &pPGM->StatGCSyncPagePDNAs,               STAMTYPE_COUNTER, "/PGM/GC/SyncPagePDNAs",              STAMUNIT_OCCURENCES,     "The number of time we've marked a PD not present from SyncPage to virtualize the accessed bit.");
    1605     STAM_REG(pVM, &pPGM->StatGCSyncPagePDOutOfSync,         STAMTYPE_COUNTER, "/PGM/GC/SyncPagePDOutOfSync",        STAMUNIT_OCCURENCES,     "The number of time we've encountered an out-of-sync PD in SyncPage.");
    1606     STAM_REG(pVM, &pPGM->StatHCSyncPagePDNAs,               STAMTYPE_COUNTER, "/PGM/HC/SyncPagePDNAs",              STAMUNIT_OCCURENCES,     "The number of time we've marked a PD not present from SyncPage to virtualize the accessed bit.");
    1607     STAM_REG(pVM, &pPGM->StatHCSyncPagePDOutOfSync,         STAMTYPE_COUNTER, "/PGM/HC/SyncPagePDOutOfSync",        STAMUNIT_OCCURENCES,     "The number of time we've encountered an out-of-sync PD in SyncPage.");
     1617    STAM_REG(pVM, &pPGM->StatR3SyncPT,                      STAMTYPE_PROFILE, "/PGM/R3/SyncPT",                     STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMR3SyncPT() body.");
     1618
    16081619
    16091620    STAM_REG(pVM, &pPGM->StatFlushTLB,                      STAMTYPE_PROFILE, "/PGM/FlushTLB",                      STAMUNIT_OCCURENCES,     "Profiling of the PGMFlushTLB() body.");
     
    16131624    STAM_REG(pVM, &pPGM->StatFlushTLBSameCR3Global,         STAMTYPE_COUNTER, "/PGM/FlushTLB/SameCR3Global",        STAMUNIT_OCCURENCES,     "The number of times PGMFlushTLB was called with the same CR3, global. (flush)");
    16141625
    1615     STAM_REG(pVM, &pPGM->StatGCSyncCR3,                     STAMTYPE_PROFILE, "/PGM/GC/SyncCR3",                       STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMSyncCR3() body.");
    1616     STAM_REG(pVM, &pPGM->StatGCSyncCR3Handlers,             STAMTYPE_PROFILE, "/PGM/GC/SyncCR3/Handlers",              STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMSyncCR3() update handler section.");
    1617     STAM_REG(pVM, &pPGM->StatGCSyncCR3HandlerVirtualUpdate, STAMTYPE_PROFILE, "/PGM/GC/SyncCR3/Handlers/VirtualUpdate",STAMUNIT_TICKS_PER_CALL, "Profiling of the virtual handler updates.");
    1618     STAM_REG(pVM, &pPGM->StatGCSyncCR3HandlerVirtualReset,  STAMTYPE_PROFILE, "/PGM/GC/SyncCR3/Handlers/VirtualReset", STAMUNIT_TICKS_PER_CALL, "Profiling of the virtual handler resets.");
    1619     STAM_REG(pVM, &pPGM->StatGCSyncCR3Global,               STAMTYPE_COUNTER, "/PGM/GC/SyncCR3/Global",                STAMUNIT_OCCURENCES,     "The number of global CR3 syncs.");
    1620     STAM_REG(pVM, &pPGM->StatGCSyncCR3NotGlobal,            STAMTYPE_COUNTER, "/PGM/GC/SyncCR3/NotGlobal",             STAMUNIT_OCCURENCES,     "The number of non-global CR3 syncs.");
    1621     STAM_REG(pVM, &pPGM->StatGCSyncCR3DstCacheHit,          STAMTYPE_COUNTER, "/PGM/GC/SyncCR3/DstChacheHit",          STAMUNIT_OCCURENCES,     "The number of times we got some kind of a cache hit.");
    1622     STAM_REG(pVM, &pPGM->StatGCSyncCR3DstFreed,             STAMTYPE_COUNTER, "/PGM/GC/SyncCR3/DstFreed",              STAMUNIT_OCCURENCES,     "The number of times we've had to free a shadow entry.");
    1623     STAM_REG(pVM, &pPGM->StatGCSyncCR3DstFreedSrcNP,        STAMTYPE_COUNTER, "/PGM/GC/SyncCR3/DstFreedSrcNP",         STAMUNIT_OCCURENCES,     "The number of times we've had to free a shadow entry for which the source entry was not present.");
    1624     STAM_REG(pVM, &pPGM->StatGCSyncCR3DstNotPresent,        STAMTYPE_COUNTER, "/PGM/GC/SyncCR3/DstNotPresent",         STAMUNIT_OCCURENCES,     "The number of times we've encountered a not present shadow entry for a present guest entry.");
    1625     STAM_REG(pVM, &pPGM->StatGCSyncCR3DstSkippedGlobalPD,   STAMTYPE_COUNTER, "/PGM/GC/SyncCR3/DstSkippedGlobalPD",    STAMUNIT_OCCURENCES,     "The number of times a global page directory wasn't flushed.");
    1626     STAM_REG(pVM, &pPGM->StatGCSyncCR3DstSkippedGlobalPT,   STAMTYPE_COUNTER, "/PGM/GC/SyncCR3/DstSkippedGlobalPT",    STAMUNIT_OCCURENCES,     "The number of times a page table with only global entries wasn't flushed.");
    1627 
    1628     STAM_REG(pVM, &pPGM->StatHCSyncCR3,                     STAMTYPE_PROFILE, "/PGM/HC/SyncCR3",                       STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMSyncCR3() body.");
    1629     STAM_REG(pVM, &pPGM->StatHCSyncCR3Handlers,             STAMTYPE_PROFILE, "/PGM/HC/SyncCR3/Handlers",              STAMUNIT_TICKS_PER_CALL, "Profiling of the PGMSyncCR3() update handler section.");
    1630     STAM_REG(pVM, &pPGM->StatHCSyncCR3HandlerVirtualUpdate, STAMTYPE_PROFILE, "/PGM/HC/SyncCR3/Handlers/VirtualUpdate",STAMUNIT_TICKS_PER_CALL, "Profiling of the virtual handler updates.");
    1631     STAM_REG(pVM, &pPGM->StatHCSyncCR3HandlerVirtualReset,  STAMTYPE_PROFILE, "/PGM/HC/SyncCR3/Handlers/VirtualReset", STAMUNIT_TICKS_PER_CALL, "Profiling of the virtual handler resets.");
    1632     STAM_REG(pVM, &pPGM->StatHCSyncCR3Global,               STAMTYPE_COUNTER, "/PGM/HC/SyncCR3/Global",                STAMUNIT_OCCURENCES,     "The number of global CR3 syncs.");
    1633     STAM_REG(pVM, &pPGM->StatHCSyncCR3NotGlobal,            STAMTYPE_COUNTER, "/PGM/HC/SyncCR3/NotGlobal",             STAMUNIT_OCCURENCES,     "The number of non-global CR3 syncs.");
    1634     STAM_REG(pVM, &pPGM->StatHCSyncCR3DstCacheHit,          STAMTYPE_COUNTER, "/PGM/HC/SyncCR3/DstChacheHit",          STAMUNIT_OCCURENCES,     "The number of times we got some kind of a cache hit.");
    1635     STAM_REG(pVM, &pPGM->StatHCSyncCR3DstFreed,             STAMTYPE_COUNTER, "/PGM/HC/SyncCR3/DstFreed",              STAMUNIT_OCCURENCES,     "The number of times we've had to free a shadow entry.");
    1636     STAM_REG(pVM, &pPGM->StatHCSyncCR3DstFreedSrcNP,        STAMTYPE_COUNTER, "/PGM/HC/SyncCR3/DstFreedSrcNP",         STAMUNIT_OCCURENCES,     "The number of times we've had to free a shadow entry for which the source entry was not present.");
    1637     STAM_REG(pVM, &pPGM->StatHCSyncCR3DstNotPresent,        STAMTYPE_COUNTER, "/PGM/HC/SyncCR3/DstNotPresent",         STAMUNIT_OCCURENCES,     "The number of times we've encountered a not present shadow entry for a present guest entry.");
    1638     STAM_REG(pVM, &pPGM->StatHCSyncCR3DstSkippedGlobalPD,   STAMTYPE_COUNTER, "/PGM/HC/SyncCR3/DstSkippedGlobalPD",    STAMUNIT_OCCURENCES,     "The number of times a global page directory wasn't flushed.");
    1639     STAM_REG(pVM, &pPGM->StatHCSyncCR3DstSkippedGlobalPT,   STAMTYPE_COUNTER, "/PGM/HC/SyncCR3/DstSkippedGlobalPT",    STAMUNIT_OCCURENCES,     "The number of times a page table with only global entries wasn't flushed.");
    16401626
    16411627    STAM_REG(pVM, &pPGM->StatVirtHandleSearchByPhysGC,      STAMTYPE_PROFILE, "/PGM/VirtHandler/SearchByPhys/GC",   STAMUNIT_TICKS_PER_CALL, "Profiling of pgmHandlerVirtualFindByPhysAddr in GC.");
     
    28642850    pVM->pgm.s.pfnR3ShwModifyPage           = pModeData->pfnR3ShwModifyPage;
    28652851
    2866     pVM->pgm.s.pfnGCShwGetPage              = pModeData->pfnGCShwGetPage;
    2867     pVM->pgm.s.pfnGCShwModifyPage           = pModeData->pfnGCShwModifyPage;
     2852    pVM->pgm.s.pfnRCShwGetPage              = pModeData->pfnRCShwGetPage;
     2853    pVM->pgm.s.pfnRCShwModifyPage           = pModeData->pfnRCShwModifyPage;
    28682854
    28692855    pVM->pgm.s.pfnR0ShwGetPage              = pModeData->pfnR0ShwGetPage;
     
    28872873    pVM->pgm.s.pszR3GstPAEWriteHandlerCR3   = pModeData->pszR3GstPAEWriteHandlerCR3;
    28882874
    2889     pVM->pgm.s.pfnGCGstGetPage              = pModeData->pfnGCGstGetPage;
    2890     pVM->pgm.s.pfnGCGstModifyPage           = pModeData->pfnGCGstModifyPage;
    2891     pVM->pgm.s.pfnGCGstGetPDE               = pModeData->pfnGCGstGetPDE;
    2892     pVM->pgm.s.pfnGCGstMonitorCR3           = pModeData->pfnGCGstMonitorCR3;
    2893     pVM->pgm.s.pfnGCGstUnmonitorCR3         = pModeData->pfnGCGstUnmonitorCR3;
    2894     pVM->pgm.s.pfnGCGstMapCR3               = pModeData->pfnGCGstMapCR3;
    2895     pVM->pgm.s.pfnGCGstUnmapCR3             = pModeData->pfnGCGstUnmapCR3;
    2896     pVM->pgm.s.pfnGCGstWriteHandlerCR3      = pModeData->pfnGCGstWriteHandlerCR3;
    2897     pVM->pgm.s.pfnGCGstPAEWriteHandlerCR3   = pModeData->pfnGCGstPAEWriteHandlerCR3;
     2875    pVM->pgm.s.pfnRCGstGetPage              = pModeData->pfnRCGstGetPage;
     2876    pVM->pgm.s.pfnRCGstModifyPage           = pModeData->pfnRCGstModifyPage;
     2877    pVM->pgm.s.pfnRCGstGetPDE               = pModeData->pfnRCGstGetPDE;
     2878    pVM->pgm.s.pfnRCGstMonitorCR3           = pModeData->pfnRCGstMonitorCR3;
     2879    pVM->pgm.s.pfnRCGstUnmonitorCR3         = pModeData->pfnRCGstUnmonitorCR3;
     2880    pVM->pgm.s.pfnRCGstMapCR3               = pModeData->pfnRCGstMapCR3;
     2881    pVM->pgm.s.pfnRCGstUnmapCR3             = pModeData->pfnRCGstUnmapCR3;
     2882    pVM->pgm.s.pfnRCGstWriteHandlerCR3      = pModeData->pfnRCGstWriteHandlerCR3;
     2883    pVM->pgm.s.pfnRCGstPAEWriteHandlerCR3   = pModeData->pfnRCGstPAEWriteHandlerCR3;
    28982884
    28992885    pVM->pgm.s.pfnR0GstGetPage              = pModeData->pfnR0GstGetPage;
     
    29102896    /* both */
    29112897    pVM->pgm.s.pfnR3BthRelocate             = pModeData->pfnR3BthRelocate;
    2912     pVM->pgm.s.pfnR3BthTrap0eHandler        = pModeData->pfnR3BthTrap0eHandler;
    29132898    pVM->pgm.s.pfnR3BthInvalidatePage       = pModeData->pfnR3BthInvalidatePage;
    29142899    pVM->pgm.s.pfnR3BthSyncCR3              = pModeData->pfnR3BthSyncCR3;
     
    29212906#endif
    29222907
    2923     pVM->pgm.s.pfnGCBthTrap0eHandler        = pModeData->pfnGCBthTrap0eHandler;
    2924     pVM->pgm.s.pfnGCBthInvalidatePage       = pModeData->pfnGCBthInvalidatePage;
    2925     pVM->pgm.s.pfnGCBthSyncCR3              = pModeData->pfnGCBthSyncCR3;
    2926     pVM->pgm.s.pfnGCBthSyncPage             = pModeData->pfnGCBthSyncPage;
    2927     pVM->pgm.s.pfnGCBthPrefetchPage         = pModeData->pfnGCBthPrefetchPage;
    2928     pVM->pgm.s.pfnGCBthVerifyAccessSyncPage = pModeData->pfnGCBthVerifyAccessSyncPage;
     2908    pVM->pgm.s.pfnRCBthTrap0eHandler        = pModeData->pfnRCBthTrap0eHandler;
     2909    pVM->pgm.s.pfnRCBthInvalidatePage       = pModeData->pfnRCBthInvalidatePage;
     2910    pVM->pgm.s.pfnRCBthSyncCR3              = pModeData->pfnRCBthSyncCR3;
     2911    pVM->pgm.s.pfnRCBthSyncPage             = pModeData->pfnRCBthSyncPage;
     2912    pVM->pgm.s.pfnRCBthPrefetchPage         = pModeData->pfnRCBthPrefetchPage;
     2913    pVM->pgm.s.pfnRCBthVerifyAccessSyncPage = pModeData->pfnRCBthVerifyAccessSyncPage;
    29292914#ifdef VBOX_STRICT
    2930     pVM->pgm.s.pfnGCBthAssertCR3            = pModeData->pfnGCBthAssertCR3;
     2915    pVM->pgm.s.pfnRCBthAssertCR3            = pModeData->pfnRCBthAssertCR3;
    29312916#endif
    29322917
  • trunk/src/VBox/VMM/PGMBth.h

    r12975 r13067  
    5555    pModeData->pfnR3BthRelocate          = PGM_BTH_NAME(Relocate);
    5656    pModeData->pfnR3BthSyncCR3           = PGM_BTH_NAME(SyncCR3);
    57     pModeData->pfnR3BthTrap0eHandler     = PGM_BTH_NAME(Trap0eHandler);
    5857    pModeData->pfnR3BthInvalidatePage    = PGM_BTH_NAME(InvalidatePage);
    5958    pModeData->pfnR3BthSyncPage          = PGM_BTH_NAME(SyncPage);
     
    7069#if PGM_SHW_TYPE != PGM_TYPE_AMD64 && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT /* No AMD64 for traditional virtualization, only VT-x and AMD-V. */
    7170        /* GC */
    72         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_GC_STR(Trap0eHandler),  &pModeData->pfnGCBthTrap0eHandler);
    73         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_GC_STR(Trap0eHandler),  rc), rc);
    74         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_GC_STR(InvalidatePage), &pModeData->pfnGCBthInvalidatePage);
    75         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_GC_STR(InvalidatePage), rc), rc);
    76         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_GC_STR(SyncCR3), &pModeData->pfnGCBthSyncCR3);
    77         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_GC_STR(SyncPage), rc), rc);
    78         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_GC_STR(SyncPage), &pModeData->pfnGCBthSyncPage);
    79         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_GC_STR(SyncPage), rc), rc);
    80         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_GC_STR(PrefetchPage), &pModeData->pfnGCBthPrefetchPage);
    81         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_GC_STR(PrefetchPage), rc), rc);
    82         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_GC_STR(VerifyAccessSyncPage), &pModeData->pfnGCBthVerifyAccessSyncPage);
    83         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_GC_STR(VerifyAccessSyncPage), rc), rc);
     71        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_RC_STR(Trap0eHandler),  &pModeData->pfnRCBthTrap0eHandler);
     72        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_RC_STR(Trap0eHandler),  rc), rc);
     73        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_RC_STR(InvalidatePage), &pModeData->pfnRCBthInvalidatePage);
     74        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_RC_STR(InvalidatePage), rc), rc);
     75        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_RC_STR(SyncCR3), &pModeData->pfnRCBthSyncCR3);
     76        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_RC_STR(SyncPage), rc), rc);
     77        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_RC_STR(SyncPage), &pModeData->pfnRCBthSyncPage);
     78        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_RC_STR(SyncPage), rc), rc);
     79        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_RC_STR(PrefetchPage), &pModeData->pfnRCBthPrefetchPage);
     80        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_RC_STR(PrefetchPage), rc), rc);
     81        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_RC_STR(VerifyAccessSyncPage), &pModeData->pfnRCBthVerifyAccessSyncPage);
     82        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_RC_STR(VerifyAccessSyncPage), rc), rc);
    8483# ifdef VBOX_STRICT
    85         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_GC_STR(AssertCR3), &pModeData->pfnGCBthAssertCR3);
    86         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_GC_STR(AssertCR3), rc), rc);
     84        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_RC_STR(AssertCR3), &pModeData->pfnRCBthAssertCR3);
     85        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_BTH_NAME_RC_STR(AssertCR3), rc), rc);
    8786# endif
    8887#endif /* Not AMD64 shadow paging. */
  • trunk/src/VBox/VMM/PGMGst.h

    r12975 r13067  
    168168#if PGM_SHW_TYPE != PGM_TYPE_AMD64 /* No AMD64 for traditional virtualization, only VT-x and AMD-V. */
    169169        /* GC */
    170         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_GC_STR(GetPage),          &pModeData->pfnGCGstGetPage);
    171         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_GC_STR(GetPage),  rc), rc);
    172         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_GC_STR(ModifyPage),       &pModeData->pfnGCGstModifyPage);
    173         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_GC_STR(ModifyPage),  rc), rc);
    174         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_GC_STR(GetPDE),           &pModeData->pfnGCGstGetPDE);
    175         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_GC_STR(GetPDE), rc), rc);
    176         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_GC_STR(MonitorCR3),       &pModeData->pfnGCGstMonitorCR3);
    177         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_GC_STR(MonitorCR3), rc), rc);
    178         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_GC_STR(UnmonitorCR3),     &pModeData->pfnGCGstUnmonitorCR3);
    179         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_GC_STR(UnmonitorCR3), rc), rc);
    180         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_GC_STR(MapCR3),           &pModeData->pfnGCGstMapCR3);
    181         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_GC_STR(MapCR3), rc), rc);
    182         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_GC_STR(UnmapCR3),         &pModeData->pfnGCGstUnmapCR3);
    183         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_GC_STR(UnmapCR3), rc), rc);
     170        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(GetPage),          &pModeData->pfnRCGstGetPage);
     171        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(GetPage),  rc), rc);
     172        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(ModifyPage),       &pModeData->pfnRCGstModifyPage);
     173        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(ModifyPage),  rc), rc);
     174        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(GetPDE),           &pModeData->pfnRCGstGetPDE);
     175        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(GetPDE), rc), rc);
     176        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(MonitorCR3),       &pModeData->pfnRCGstMonitorCR3);
     177        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(MonitorCR3), rc), rc);
     178        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(UnmonitorCR3),     &pModeData->pfnRCGstUnmonitorCR3);
     179        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(UnmonitorCR3), rc), rc);
     180        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(MapCR3),           &pModeData->pfnRCGstMapCR3);
     181        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(MapCR3), rc), rc);
     182        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(UnmapCR3),         &pModeData->pfnRCGstUnmapCR3);
     183        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(UnmapCR3), rc), rc);
    184184# if PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_PAE
    185         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_GC_STR(WriteHandlerCR3),  &pModeData->pfnGCGstWriteHandlerCR3);
    186         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_GC_STR(WriteHandlerCR3), rc), rc);
    187         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_GC_STR(WriteHandlerCR3),  &pModeData->pfnGCGstPAEWriteHandlerCR3);
    188         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_GC_STR(PAEWriteHandlerCR3), rc), rc);
     185        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(WriteHandlerCR3),  &pModeData->pfnRCGstWriteHandlerCR3);
     186        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(WriteHandlerCR3), rc), rc);
     187        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(WriteHandlerCR3),  &pModeData->pfnRCGstPAEWriteHandlerCR3);
     188        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(PAEWriteHandlerCR3), rc), rc);
    189189# endif
    190190#endif /* Not AMD64 shadow paging. */
  • trunk/src/VBox/VMM/PGMInternal.h

    r13062 r13067  
    17121712 * @{ */
    17131713#ifdef IN_GC
    1714 # define PGM_CTX(a,b)                   a##GC##b
     1714# define PGM_CTX(a,b)                   a##RC##b
    17151715# define PGM_CTX_STR(a,b)               a "GC" b
    17161716# define PGM_CTX_DECL(type)             VMMRCDECL(type)
     
    17281728
    17291729#define PGM_GST_NAME_REAL(name)         PGM_CTX(pgm,GstReal##name)
    1730 #define PGM_GST_NAME_GC_REAL_STR(name)  "pgmGCGstReal" #name
     1730#define PGM_GST_NAME_RC_REAL_STR(name)  "pgmRCGstReal" #name
    17311731#define PGM_GST_NAME_R0_REAL_STR(name)  "pgmR0GstReal" #name
    17321732#define PGM_GST_NAME_PROT(name)         PGM_CTX(pgm,GstProt##name)
    1733 #define PGM_GST_NAME_GC_PROT_STR(name)  "pgmGCGstProt" #name
     1733#define PGM_GST_NAME_RC_PROT_STR(name)  "pgmRCGstProt" #name
    17341734#define PGM_GST_NAME_R0_PROT_STR(name)  "pgmR0GstProt" #name
    17351735#define PGM_GST_NAME_32BIT(name)        PGM_CTX(pgm,Gst32Bit##name)
    1736 #define PGM_GST_NAME_GC_32BIT_STR(name) "pgmGCGst32Bit" #name
     1736#define PGM_GST_NAME_RC_32BIT_STR(name) "pgmRCGst32Bit" #name
    17371737#define PGM_GST_NAME_R0_32BIT_STR(name) "pgmR0Gst32Bit" #name
    17381738#define PGM_GST_NAME_PAE(name)          PGM_CTX(pgm,GstPAE##name)
    1739 #define PGM_GST_NAME_GC_PAE_STR(name)   "pgmGCGstPAE" #name
     1739#define PGM_GST_NAME_RC_PAE_STR(name)   "pgmRCGstPAE" #name
    17401740#define PGM_GST_NAME_R0_PAE_STR(name)   "pgmR0GstPAE" #name
    17411741#define PGM_GST_NAME_AMD64(name)        PGM_CTX(pgm,GstAMD64##name)
    1742 #define PGM_GST_NAME_GC_AMD64_STR(name) "pgmGCGstAMD64" #name
     1742#define PGM_GST_NAME_RC_AMD64_STR(name) "pgmRCGstAMD64" #name
    17431743#define PGM_GST_NAME_R0_AMD64_STR(name) "pgmR0GstAMD64" #name
    17441744#define PGM_GST_PFN(name, pVM)          ((pVM)->pgm.s.PGM_CTX(pfn,Gst##name))
     
    17461746
    17471747#define PGM_SHW_NAME_32BIT(name)        PGM_CTX(pgm,Shw32Bit##name)
    1748 #define PGM_SHW_NAME_GC_32BIT_STR(name) "pgmGCShw32Bit" #name
     1748#define PGM_SHW_NAME_RC_32BIT_STR(name) "pgmRCShw32Bit" #name
    17491749#define PGM_SHW_NAME_R0_32BIT_STR(name) "pgmR0Shw32Bit" #name
    17501750#define PGM_SHW_NAME_PAE(name)          PGM_CTX(pgm,ShwPAE##name)
    1751 #define PGM_SHW_NAME_GC_PAE_STR(name)   "pgmGCShwPAE" #name
     1751#define PGM_SHW_NAME_RC_PAE_STR(name)   "pgmRCShwPAE" #name
    17521752#define PGM_SHW_NAME_R0_PAE_STR(name)   "pgmR0ShwPAE" #name
    17531753#define PGM_SHW_NAME_AMD64(name)        PGM_CTX(pgm,ShwAMD64##name)
    1754 #define PGM_SHW_NAME_GC_AMD64_STR(name) "pgmGCShwAMD64" #name
     1754#define PGM_SHW_NAME_RC_AMD64_STR(name) "pgmRCShwAMD64" #name
    17551755#define PGM_SHW_NAME_R0_AMD64_STR(name) "pgmR0ShwAMD64" #name
    17561756#define PGM_SHW_NAME_NESTED(name)        PGM_CTX(pgm,ShwNested##name)
    1757 #define PGM_SHW_NAME_GC_NESTED_STR(name) "pgmGCShwNested" #name
     1757#define PGM_SHW_NAME_RC_NESTED_STR(name) "pgmRCShwNested" #name
    17581758#define PGM_SHW_NAME_R0_NESTED_STR(name) "pgmR0ShwNested" #name
    17591759#define PGM_SHW_NAME_EPT(name)          PGM_CTX(pgm,ShwEPT##name)
    1760 #define PGM_SHW_NAME_GC_EPT_STR(name)   "pgmGCShwEPT" #name
     1760#define PGM_SHW_NAME_RC_EPT_STR(name)   "pgmRCShwEPT" #name
    17611761#define PGM_SHW_NAME_R0_EPT_STR(name)   "pgmR0ShwEPT" #name
    17621762#define PGM_SHW_DECL(type, name)        PGM_CTX_DECL(type) PGM_SHW_NAME(name)
     
    17841784#define PGM_BTH_NAME_EPT_AMD64(name)    PGM_CTX(pgm,BthEPTAMD64##name)
    17851785
    1786 #define PGM_BTH_NAME_GC_32BIT_REAL_STR(name)    "pgmGCBth32BitReal" #name
    1787 #define PGM_BTH_NAME_GC_32BIT_PROT_STR(name)    "pgmGCBth32BitProt" #name
    1788 #define PGM_BTH_NAME_GC_32BIT_32BIT_STR(name)   "pgmGCBth32Bit32Bit" #name
    1789 #define PGM_BTH_NAME_GC_PAE_REAL_STR(name)      "pgmGCBthPAEReal" #name
    1790 #define PGM_BTH_NAME_GC_PAE_PROT_STR(name)      "pgmGCBthPAEProt" #name
    1791 #define PGM_BTH_NAME_GC_PAE_32BIT_STR(name)     "pgmGCBthPAE32Bit" #name
    1792 #define PGM_BTH_NAME_GC_PAE_PAE_STR(name)       "pgmGCBthPAEPAE" #name
    1793 #define PGM_BTH_NAME_GC_AMD64_AMD64_STR(name)   "pgmGCBthAMD64AMD64" #name
    1794 #define PGM_BTH_NAME_GC_NESTED_REAL_STR(name)   "pgmGCBthNestedReal" #name
    1795 #define PGM_BTH_NAME_GC_NESTED_PROT_STR(name)   "pgmGCBthNestedProt" #name
    1796 #define PGM_BTH_NAME_GC_NESTED_32BIT_STR(name)  "pgmGCBthNested32Bit" #name
    1797 #define PGM_BTH_NAME_GC_NESTED_PAE_STR(name)    "pgmGCBthNestedPAE" #name
    1798 #define PGM_BTH_NAME_GC_NESTED_AMD64_STR(name)  "pgmGCBthNestedAMD64" #name
    1799 #define PGM_BTH_NAME_GC_EPT_REAL_STR(name)      "pgmGCBthEPTReal" #name
    1800 #define PGM_BTH_NAME_GC_EPT_PROT_STR(name)      "pgmGCBthEPTProt" #name
    1801 #define PGM_BTH_NAME_GC_EPT_32BIT_STR(name)     "pgmGCBthEPT32Bit" #name
    1802 #define PGM_BTH_NAME_GC_EPT_PAE_STR(name)       "pgmGCBthEPTPAE" #name
    1803 #define PGM_BTH_NAME_GC_EPT_AMD64_STR(name)     "pgmGCBthEPTAMD64" #name
     1786#define PGM_BTH_NAME_RC_32BIT_REAL_STR(name)    "pgmRCBth32BitReal" #name
     1787#define PGM_BTH_NAME_RC_32BIT_PROT_STR(name)    "pgmRCBth32BitProt" #name
     1788#define PGM_BTH_NAME_RC_32BIT_32BIT_STR(name)   "pgmRCBth32Bit32Bit" #name
     1789#define PGM_BTH_NAME_RC_PAE_REAL_STR(name)      "pgmRCBthPAEReal" #name
     1790#define PGM_BTH_NAME_RC_PAE_PROT_STR(name)      "pgmRCBthPAEProt" #name
     1791#define PGM_BTH_NAME_RC_PAE_32BIT_STR(name)     "pgmRCBthPAE32Bit" #name
     1792#define PGM_BTH_NAME_RC_PAE_PAE_STR(name)       "pgmRCBthPAEPAE" #name
     1793#define PGM_BTH_NAME_RC_AMD64_AMD64_STR(name)   "pgmRCBthAMD64AMD64" #name
     1794#define PGM_BTH_NAME_RC_NESTED_REAL_STR(name)   "pgmRCBthNestedReal" #name
     1795#define PGM_BTH_NAME_RC_NESTED_PROT_STR(name)   "pgmRCBthNestedProt" #name
     1796#define PGM_BTH_NAME_RC_NESTED_32BIT_STR(name)  "pgmRCBthNested32Bit" #name
     1797#define PGM_BTH_NAME_RC_NESTED_PAE_STR(name)    "pgmRCBthNestedPAE" #name
     1798#define PGM_BTH_NAME_RC_NESTED_AMD64_STR(name)  "pgmRCBthNestedAMD64" #name
     1799#define PGM_BTH_NAME_RC_EPT_REAL_STR(name)      "pgmRCBthEPTReal" #name
     1800#define PGM_BTH_NAME_RC_EPT_PROT_STR(name)      "pgmRCBthEPTProt" #name
     1801#define PGM_BTH_NAME_RC_EPT_32BIT_STR(name)     "pgmRCBthEPT32Bit" #name
     1802#define PGM_BTH_NAME_RC_EPT_PAE_STR(name)       "pgmRCBthEPTPAE" #name
     1803#define PGM_BTH_NAME_RC_EPT_AMD64_STR(name)     "pgmRCBthEPTAMD64" #name
    18041804#define PGM_BTH_NAME_R0_32BIT_REAL_STR(name)    "pgmR0Bth32BitReal" #name
    18051805#define PGM_BTH_NAME_R0_32BIT_PROT_STR(name)    "pgmR0Bth32BitProt" #name
     
    18441844    DECLR3CALLBACKMEMBER(int,  pfnR3ShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    18451845
    1846     DECLRCCALLBACKMEMBER(int,  pfnGCShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
    1847     DECLRCCALLBACKMEMBER(int,  pfnGCShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     1846    DECLRCCALLBACKMEMBER(int,  pfnRCShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
     1847    DECLRCCALLBACKMEMBER(int,  pfnRCShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    18481848
    18491849    DECLR0CALLBACKMEMBER(int,  pfnR0ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
     
    18681868    R3PTRTYPE(const char *)         pszR3GstPAEWriteHandlerCR3;
    18691869
    1870     DECLRCCALLBACKMEMBER(int,  pfnGCGstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
    1871     DECLRCCALLBACKMEMBER(int,  pfnGCGstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    1872     DECLRCCALLBACKMEMBER(int,  pfnGCGstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
    1873     DECLRCCALLBACKMEMBER(int,  pfnGCGstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    1874     DECLRCCALLBACKMEMBER(int,  pfnGCGstUnmonitorCR3,(PVM pVM));
    1875     DECLRCCALLBACKMEMBER(int,  pfnGCGstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    1876     DECLRCCALLBACKMEMBER(int,  pfnGCGstUnmapCR3,(PVM pVM));
    1877     RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnGCGstWriteHandlerCR3;
    1878     RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnGCGstPAEWriteHandlerCR3;
     1870    DECLRCCALLBACKMEMBER(int,  pfnRCGstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
     1871    DECLRCCALLBACKMEMBER(int,  pfnRCGstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     1872    DECLRCCALLBACKMEMBER(int,  pfnRCGstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
     1873    DECLRCCALLBACKMEMBER(int,  pfnRCGstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     1874    DECLRCCALLBACKMEMBER(int,  pfnRCGstUnmonitorCR3,(PVM pVM));
     1875    DECLRCCALLBACKMEMBER(int,  pfnRCGstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     1876    DECLRCCALLBACKMEMBER(int,  pfnRCGstUnmapCR3,(PVM pVM));
     1877    RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnRCGstWriteHandlerCR3;
     1878    RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnRCGstPAEWriteHandlerCR3;
    18791879
    18801880    DECLR0CALLBACKMEMBER(int,  pfnR0GstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
     
    18931893     */
    18941894    DECLR3CALLBACKMEMBER(int,       pfnR3BthRelocate,(PVM pVM, RTGCUINTPTR offDelta));
    1895     DECLR3CALLBACKMEMBER(int,       pfnR3BthTrap0eHandler,(PVM pVM, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault));
     1895    /*                           no pfnR3BthTrap0eHandler */
    18961896    DECLR3CALLBACKMEMBER(int,       pfnR3BthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage));
    18971897    DECLR3CALLBACKMEMBER(int,       pfnR3BthSyncCR3,(PVM pVM, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal));
     
    19031903#endif
    19041904
    1905     DECLRCCALLBACKMEMBER(int,       pfnGCBthTrap0eHandler,(PVM pVM, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault));
    1906     DECLRCCALLBACKMEMBER(int,       pfnGCBthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage));
    1907     DECLRCCALLBACKMEMBER(int,       pfnGCBthSyncCR3,(PVM pVM, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal));
    1908     DECLRCCALLBACKMEMBER(int,       pfnGCBthSyncPage,(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError));
    1909     DECLRCCALLBACKMEMBER(int,       pfnGCBthPrefetchPage,(PVM pVM, RTGCUINTPTR GCPtrPage));
    1910     DECLRCCALLBACKMEMBER(int,       pfnGCBthVerifyAccessSyncPage,(PVM pVM, RTGCUINTPTR GCPtrPage, unsigned fFlags, unsigned uError));
     1905    DECLRCCALLBACKMEMBER(int,       pfnRCBthTrap0eHandler,(PVM pVM, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault));
     1906    DECLRCCALLBACKMEMBER(int,       pfnRCBthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage));
     1907    DECLRCCALLBACKMEMBER(int,       pfnRCBthSyncCR3,(PVM pVM, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal));
     1908    DECLRCCALLBACKMEMBER(int,       pfnRCBthSyncPage,(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError));
     1909    DECLRCCALLBACKMEMBER(int,       pfnRCBthPrefetchPage,(PVM pVM, RTGCUINTPTR GCPtrPage));
     1910    DECLRCCALLBACKMEMBER(int,       pfnRCBthVerifyAccessSyncPage,(PVM pVM, RTGCUINTPTR GCPtrPage, unsigned fFlags, unsigned uError));
    19111911#ifdef VBOX_STRICT
    1912     DECLRCCALLBACKMEMBER(unsigned,  pfnGCBthAssertCR3,(PVM pVM, uint64_t cr3, uint64_t cr4, RTGCUINTPTR GCPtr, RTGCUINTPTR cb));
     1912    DECLRCCALLBACKMEMBER(unsigned,  pfnRCBthAssertCR3,(PVM pVM, uint64_t cr3, uint64_t cr4, RTGCUINTPTR GCPtr, RTGCUINTPTR cb));
    19131913#endif
    19141914
     
    21092109    DECLR3CALLBACKMEMBER(int,  pfnR3ShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    21102110
    2111     DECLRCCALLBACKMEMBER(int,  pfnGCShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
    2112     DECLRCCALLBACKMEMBER(int,  pfnGCShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     2111    DECLRCCALLBACKMEMBER(int,  pfnRCShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
     2112    DECLRCCALLBACKMEMBER(int,  pfnRCShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    21132113
    21142114    DECLR0CALLBACKMEMBER(int,  pfnR0ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
     
    21342134    R3PTRTYPE(const char *)         pszR3GstPAEWriteHandlerCR3;
    21352135
    2136     DECLRCCALLBACKMEMBER(int,  pfnGCGstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
    2137     DECLRCCALLBACKMEMBER(int,  pfnGCGstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    2138     DECLRCCALLBACKMEMBER(int,  pfnGCGstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
    2139     DECLRCCALLBACKMEMBER(int,  pfnGCGstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    2140     DECLRCCALLBACKMEMBER(int,  pfnGCGstUnmonitorCR3,(PVM pVM));
    2141     DECLRCCALLBACKMEMBER(int,  pfnGCGstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    2142     DECLRCCALLBACKMEMBER(int,  pfnGCGstUnmapCR3,(PVM pVM));
    2143     RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnGCGstWriteHandlerCR3;
    2144     RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnGCGstPAEWriteHandlerCR3;
     2136    DECLRCCALLBACKMEMBER(int,  pfnRCGstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
     2137    DECLRCCALLBACKMEMBER(int,  pfnRCGstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     2138    DECLRCCALLBACKMEMBER(int,  pfnRCGstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
     2139    DECLRCCALLBACKMEMBER(int,  pfnRCGstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     2140    DECLRCCALLBACKMEMBER(int,  pfnRCGstUnmonitorCR3,(PVM pVM));
     2141    DECLRCCALLBACKMEMBER(int,  pfnRCGstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     2142    DECLRCCALLBACKMEMBER(int,  pfnRCGstUnmapCR3,(PVM pVM));
     2143    RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnRCGstWriteHandlerCR3;
     2144    RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnRCGstPAEWriteHandlerCR3;
    21452145#if HC_ARCH_BITS == 64
    21462146    RTRCPTR                         alignment3; /**< structure size alignment. */
     
    21622162     */
    21632163    DECLR3CALLBACKMEMBER(int,       pfnR3BthRelocate,(PVM pVM, RTGCUINTPTR offDelta));
    2164     DECLR3CALLBACKMEMBER(int,       pfnR3BthTrap0eHandler,(PVM pVM, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault));
     2164    /*                           no pfnR3BthTrap0eHandler */
    21652165    DECLR3CALLBACKMEMBER(int,       pfnR3BthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage));
    21662166    DECLR3CALLBACKMEMBER(int,       pfnR3BthSyncCR3,(PVM pVM, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal));
     
    21782178    DECLR0CALLBACKMEMBER(unsigned,  pfnR0BthAssertCR3,(PVM pVM, uint64_t cr3, uint64_t cr4, RTGCUINTPTR GCPtr, RTGCUINTPTR cb));
    21792179
    2180     DECLRCCALLBACKMEMBER(int,       pfnGCBthTrap0eHandler,(PVM pVM, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault));
    2181     DECLRCCALLBACKMEMBER(int,       pfnGCBthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage));
    2182     DECLRCCALLBACKMEMBER(int,       pfnGCBthSyncCR3,(PVM pVM, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal));
    2183     DECLRCCALLBACKMEMBER(int,       pfnGCBthSyncPage,(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError));
    2184     DECLRCCALLBACKMEMBER(int,       pfnGCBthPrefetchPage,(PVM pVM, RTGCUINTPTR GCPtrPage));
    2185     DECLRCCALLBACKMEMBER(int,       pfnGCBthVerifyAccessSyncPage,(PVM pVM, RTGCUINTPTR GCPtrPage, unsigned fFlags, unsigned uError));
    2186     DECLRCCALLBACKMEMBER(unsigned,  pfnGCBthAssertCR3,(PVM pVM, uint64_t cr3, uint64_t cr4, RTGCUINTPTR GCPtr, RTGCUINTPTR cb));
     2180    DECLRCCALLBACKMEMBER(int,       pfnRCBthTrap0eHandler,(PVM pVM, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault));
     2181    DECLRCCALLBACKMEMBER(int,       pfnRCBthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage));
     2182    DECLRCCALLBACKMEMBER(int,       pfnRCBthSyncCR3,(PVM pVM, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal));
     2183    DECLRCCALLBACKMEMBER(int,       pfnRCBthSyncPage,(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError));
     2184    DECLRCCALLBACKMEMBER(int,       pfnRCBthPrefetchPage,(PVM pVM, RTGCUINTPTR GCPtrPage));
     2185    DECLRCCALLBACKMEMBER(int,       pfnRCBthVerifyAccessSyncPage,(PVM pVM, RTGCUINTPTR GCPtrPage, unsigned fFlags, unsigned uError));
     2186    DECLRCCALLBACKMEMBER(unsigned,  pfnRCBthAssertCR3,(PVM pVM, uint64_t cr3, uint64_t cr4, RTGCUINTPTR GCPtr, RTGCUINTPTR cb));
    21872187#if HC_ARCH_BITS == 64
    21882188    RTRCPTR                         alignment2; /**< structure size alignment. */
     
    23982398    /** @} */
    23992399
    2400 #ifdef VBOX_WITH_STATISTICS
    2401     /** GC: Which statistic this \#PF should be attributed to. */
    2402     RCPTRTYPE(PSTAMPROFILE)   pStatTrap0eAttributionGC;
    2403     RTRCPTR                   padding0;
    2404     /** HC: Which statistic this \#PF should be attributed to. */
    2405     R3R0PTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionHC;
    2406     RTHCPTR                   padding1;
     2400#ifdef VBOX_WITH_STATISTICS /** @todo move this chunk to the heap.  */
     2401    /** RC: Which statistic this \#PF should be attributed to. */
     2402    RCPTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionRC;
     2403    RTRCPTR                 padding0;
     2404    /** R0: Which statistic this \#PF should be attributed to. */
     2405    R0PTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionR0;
     2406    RTR0PTR                 padding1;
     2407
     2408    /* R3 only: */
     2409
     2410    /* GC only: */
     2411    STAMPROFILE StatGCInvalidatePage;               /**< GC: PGMGCInvalidatePage() profiling. */
     2412
     2413    /* RZ only: */
     2414
     2415    /* RZ & R3: */
     2416    STAMPROFILE StatRZSyncCR3;                      /**< RC/R0: PGMSyncCR3() profiling. */
     2417    STAMPROFILE StatRZSyncCR3Handlers;              /**< RC/R0: Profiling of the PGMSyncCR3() update handler section. */
     2418    STAMPROFILE StatRZSyncCR3HandlerVirtualReset;   /**< RC/R0: Profiling of the virtual handler resets. */
     2419    STAMPROFILE StatRZSyncCR3HandlerVirtualUpdate;  /**< RC/R0: Profiling of the virtual handler updates. */
     2420    STAMCOUNTER StatRZSyncCR3Global;                /**< RC/R0: The number of global CR3 syncs. */
     2421    STAMCOUNTER StatRZSyncCR3NotGlobal;             /**< RC/R0: The number of non-global CR3 syncs. */
     2422    STAMCOUNTER StatRZSyncCR3DstCacheHit;           /**< RC/R0: The number of times we got some kind of cache hit on a page table. */
     2423    STAMCOUNTER StatRZSyncCR3DstFreed;              /**< RC/R0: The number of times we've had to free a shadow entry. */
     2424    STAMCOUNTER StatRZSyncCR3DstFreedSrcNP;         /**< RC/R0: The number of times we've had to free a shadow entry for which the source entry was not present. */
     2425    STAMCOUNTER StatRZSyncCR3DstNotPresent;         /**< RC/R0: The number of times we've encountered a not present shadow entry for a present guest entry. */
     2426    STAMCOUNTER StatRZSyncCR3DstSkippedGlobalPD;    /**< RC/R0: The number of times a global page directory wasn't flushed. */
     2427    STAMCOUNTER StatRZSyncCR3DstSkippedGlobalPT;    /**< RC/R0: The number of times a page table with only global entries wasn't flushed. */
     2428    STAMPROFILE StatRZSyncPT;                       /**< RC/R0: PGMSyncPT() profiling. */
     2429    STAMCOUNTER StatRZSyncPTFailed;                 /**< RC/R0: The number of times PGMSyncPT() failed. */
     2430    STAMCOUNTER StatRZSyncPagePDNAs;                /**< RC/R0: The number of time we've marked a PD not present from SyncPage to virtualize the accessed bit. */
     2431    STAMCOUNTER StatRZSyncPagePDOutOfSync;          /**< RC/R0: The number of time we've encountered an out-of-sync PD in SyncPage. */
     2432    STAMCOUNTER StatRZAccessedPage;                 /**< RC/R0: The number of pages marked not present for accessed bit emulation. */
     2433    STAMPROFILE StatRZDirtyBitTracking;             /**< RC/R0: Profiling the dirty bit tracking in CheckPageFault().. */
     2434    STAMCOUNTER StatRZDirtyPage;                    /**< RC/R0: The number of pages marked read-only for dirty bit tracking. */
     2435    STAMCOUNTER StatRZDirtyPageBig;                 /**< RC/R0: The number of pages marked read-only for dirty bit tracking. */
     2436    STAMCOUNTER StatRZDirtyPageSkipped;             /**< RC/R0: The number of pages already dirty or readonly. */
     2437    STAMCOUNTER StatRZDirtyPageTrap;                /**< RC/R0: The number of traps generated for dirty bit tracking. */
     2438    STAMCOUNTER StatRZDirtyTrackRealPF;             /**< RC/R0: The number of real pages faults during dirty bit tracking. */
     2439    STAMCOUNTER StatRZDirtiedPage;                  /**< RC/R0: The number of pages marked dirty because of write accesses. */
     2440    STAMCOUNTER StatRZPageAlreadyDirty;             /**< RC/R0: The number of pages already marked dirty because of write accesses. */
     2441    STAMPROFILE StatRZInvalidatePage;               /**< RC/R0: PGMInvalidatePage() profiling. */
     2442    STAMCOUNTER StatRZInvalidatePage4KBPages;       /**< RC/R0: The number of times PGMInvalidatePage() was called for a 4KB page. */
     2443    STAMCOUNTER StatRZInvalidatePage4MBPages;       /**< RC/R0: The number of times PGMInvalidatePage() was called for a 4MB page. */
     2444    STAMCOUNTER StatRZInvalidatePage4MBPagesSkip;   /**< RC/R0: The number of times PGMInvalidatePage() skipped a 4MB page. */
     2445    STAMCOUNTER StatRZInvalidatePagePDMappings;     /**< RC/R0: The number of times PGMInvalidatePage() was called for a page directory containing mappings (no conflict). */
     2446    STAMCOUNTER StatRZInvalidatePagePDNAs;          /**< RC/R0: The number of times PGMInvalidatePage() was called for a not accessed page directory. */
     2447    STAMCOUNTER StatRZInvalidatePagePDNPs;          /**< RC/R0: The number of times PGMInvalidatePage() was called for a not present page directory. */
     2448    STAMCOUNTER StatRZInvalidatePagePDOutOfSync;    /**< RC/R0: The number of times PGMInvalidatePage() was called for an out of sync page directory. */
     2449    STAMCOUNTER StatRZInvalidatePageSkipped;        /**< RC/R0: The number of times PGMInvalidatePage() was skipped due to not present shw or pending pending SyncCR3. */
     2450
     2451    STAMPROFILE StatR3SyncCR3;                      /**< R3: PGMSyncCR3() profiling. */
     2452    STAMPROFILE StatR3SyncCR3Handlers;              /**< R3: Profiling of the PGMSyncCR3() update handler section. */
     2453    STAMPROFILE StatR3SyncCR3HandlerVirtualReset;   /**< R3: Profiling of the virtual handler resets. */
     2454    STAMPROFILE StatR3SyncCR3HandlerVirtualUpdate;  /**< R3: Profiling of the virtual handler updates. */
     2455    STAMCOUNTER StatR3SyncCR3Global;                /**< R3: The number of global CR3 syncs. */
     2456    STAMCOUNTER StatR3SyncCR3NotGlobal;             /**< R3: The number of non-global CR3 syncs. */
     2457    STAMCOUNTER StatR3SyncCR3DstFreed;              /**< R3: The number of times we've had to free a shadow entry. */
     2458    STAMCOUNTER StatR3SyncCR3DstFreedSrcNP;         /**< R3: The number of times we've had to free a shadow entry for which the source entry was not present. */
     2459    STAMCOUNTER StatR3SyncCR3DstNotPresent;         /**< R3: The number of times we've encountered a not present shadow entry for a present guest entry. */
     2460    STAMCOUNTER StatR3SyncCR3DstSkippedGlobalPD;    /**< R3: The number of times a global page directory wasn't flushed. */
     2461    STAMCOUNTER StatR3SyncCR3DstSkippedGlobalPT;    /**< R3: The number of times a page table with only global entries wasn't flushed. */
     2462    STAMCOUNTER StatR3SyncCR3DstCacheHit;           /**< R3: The number of times we got some kind of cache hit on a page table. */
     2463    STAMPROFILE StatR3SyncPT;                       /**< R3: PGMSyncPT() profiling. */
     2464    STAMCOUNTER StatR3SyncPTFailed;                 /**< R3: The number of times PGMSyncPT() failed. */
     2465    STAMCOUNTER StatR3SyncPagePDNAs;                /**< R3: The number of time we've marked a PD not present from SyncPage to virtualize the accessed bit. */
     2466    STAMCOUNTER StatR3SyncPagePDOutOfSync;          /**< R3: The number of time we've encountered an out-of-sync PD in SyncPage. */
     2467    STAMCOUNTER StatR3AccessedPage;                 /**< R3: The number of pages marked not present for accessed bit emulation. */
     2468    STAMPROFILE StatR3DirtyBitTracking;             /**< R3: Profiling the dirty bit tracking in CheckPageFault(). */
     2469    STAMCOUNTER StatR3DirtyPage;                    /**< R3: The number of pages marked read-only for dirty bit tracking. */
     2470    STAMCOUNTER StatR3DirtyPageBig;                 /**< R3: The number of pages marked read-only for dirty bit tracking. */
     2471    STAMCOUNTER StatR3DirtyPageSkipped;             /**< R3: The number of pages already dirty or readonly. */
     2472    STAMCOUNTER StatR3DirtyPageTrap;                /**< R3: The number of traps generated for dirty bit tracking. */
     2473    STAMCOUNTER StatR3DirtyTrackRealPF;             /**< R3: The number of real pages faults during dirty bit tracking. */
     2474    STAMCOUNTER StatR3DirtiedPage;                  /**< R3: The number of pages marked dirty because of write accesses. */
     2475    STAMCOUNTER StatR3PageAlreadyDirty;             /**< R3: The number of pages already marked dirty because of write accesses. */
     2476    STAMPROFILE StatR3InvalidatePage;               /**< R3: PGMInvalidatePage() profiling. */
     2477    STAMCOUNTER StatR3InvalidatePage4KBPages;       /**< R3: The number of times PGMInvalidatePage() was called for a 4KB page. */
     2478    STAMCOUNTER StatR3InvalidatePage4MBPages;       /**< R3: The number of times PGMInvalidatePage() was called for a 4MB page. */
     2479    STAMCOUNTER StatR3InvalidatePage4MBPagesSkip;   /**< R3: The number of times PGMInvalidatePage() skipped a 4MB page. */
     2480    STAMCOUNTER StatR3InvalidatePagePDNAs;          /**< R3: The number of times PGMInvalidatePage() was called for a not accessed page directory. */
     2481    STAMCOUNTER StatR3InvalidatePagePDNPs;          /**< R3: The number of times PGMInvalidatePage() was called for a not present page directory. */
     2482    STAMCOUNTER StatR3InvalidatePagePDMappings;     /**< R3: The number of times PGMInvalidatePage() was called for a page directory containing mappings (no conflict). */
     2483    STAMCOUNTER StatR3InvalidatePagePDOutOfSync;    /**< R3: The number of times PGMInvalidatePage() was called for an out of sync page directory. */
     2484    STAMCOUNTER StatR3InvalidatePageSkipped;        /**< R3: The number of times PGMInvalidatePage() was skipped due to not present shw or pending pending SyncCR3. */
     2485
     2486    /* TODO (cleanup):  */
     2487
     2488    /** GC: Profiling of pgmHandlerVirtualFindByPhysAddr. */
     2489    STAMPROFILE StatVirtHandleSearchByPhysGC;
     2490    /** HC: Profiling of pgmHandlerVirtualFindByPhysAddr. */
     2491    STAMPROFILE StatVirtHandleSearchByPhysHC;
     2492    /** HC: The number of times PGMR3HandlerPhysicalReset is called. */
     2493    STAMCOUNTER StatHandlePhysicalReset;
     2494
     2495    STAMPROFILE StatCheckPageFault;
     2496    STAMPROFILE StatLazySyncPT;
     2497    STAMPROFILE StatMapping;
     2498    STAMPROFILE StatOutOfSync;
     2499    STAMPROFILE StatHandlers;
     2500    STAMPROFILE StatEIPHandlers;
     2501    STAMPROFILE StatHCPrefetch;
     2502
     2503# ifdef PGMPOOL_WITH_GCPHYS_TRACKING
     2504    STAMCOUNTER StatTrackVirgin;                    /**< The number of first time shadowings. */
     2505    STAMCOUNTER StatTrackAliased;                   /**< The number of times switching to cRef2, i.e. the page is being shadowed by two PTs. */
     2506    STAMCOUNTER StatTrackAliasedMany;               /**< The number of times we're tracking using cRef2. */
     2507    STAMCOUNTER StatTrackAliasedLots;               /**< The number of times we're hitting pages which has overflowed cRef2. */
     2508    STAMCOUNTER StatTrackOverflows;                 /**< The number of times the extent list grows to long. */
     2509    STAMPROFILE StatTrackDeref;                     /**< Profiling of SyncPageWorkerTrackDeref (expensive). */
     2510# endif
     2511
     2512    STAMCOUNTER StatPageHCMapTlbHits;               /** Ring-3/0 page mapper TLB hits. */
     2513    STAMCOUNTER StatPageHCMapTlbMisses;             /** Ring-3/0 page mapper TLB misses. */
     2514    STAMCOUNTER StatChunkR3MapTlbHits;              /** Ring-3/0 chunk mapper TLB hits. */
     2515    STAMCOUNTER StatChunkR3MapTlbMisses;            /** Ring-3/0 chunk mapper TLB misses. */
     2516    STAMCOUNTER StatPageReplaceShared;              /** Times a shared page has been replaced by a private one. */
     2517    STAMCOUNTER StatPageReplaceZero;                /** Times the zero page has been replaced by a private one. */
     2518    STAMCOUNTER StatPageHandyAllocs;                /** The number of times we've executed GMMR3AllocateHandyPages. */
     2519
     2520    STAMCOUNTER StatDynRamTotal;                    /** Allocated MBs of guest ram */
     2521    STAMCOUNTER StatDynRamGrow;                     /** Nr of pgmr3PhysGrowRange calls. */
     2522
     2523    STAMCOUNTER StatGCTrap0ePD[X86_PG_ENTRIES];
     2524    STAMCOUNTER StatGCSyncPtPD[X86_PG_ENTRIES];
     2525    STAMCOUNTER StatGCSyncPagePD[X86_PG_ENTRIES];
     2526
    24072527    STAMPROFILE     StatGCTrap0e;                       /**< GC: PGMGCTrap0eHandler() profiling. */
    24082528    STAMPROFILE     StatTrap0eCSAM;                     /**< Profiling of the Trap0eHandler body when the cause is CSAM. */
     
    24412561    STAMCOUNTER     StatGCTrap0eMap;
    24422562
    2443     /** GC: PGMSyncPT() profiling. */
    2444     STAMPROFILE     StatGCSyncPT;
    2445     /** GC: The number of times PGMSyncPT() needed to allocate page tables. */
    2446     STAMCOUNTER     StatGCSyncPTAlloc;
    2447     /** GC: The number of times PGMSyncPT() detected conflicts. */
    2448     STAMCOUNTER     StatGCSyncPTConflict;
    2449     /** GC: The number of times PGMSyncPT() failed. */
    2450     STAMCOUNTER     StatGCSyncPTFailed;
    2451     /** GC: PGMGCInvalidatePage() profiling. */
    2452     STAMPROFILE     StatGCInvalidatePage;
    2453     /** GC: The number of times PGMGCInvalidatePage() was called for a 4KB page. */
    2454     STAMCOUNTER     StatGCInvalidatePage4KBPages;
    2455     /** GC: The number of times PGMGCInvalidatePage() was called for a 4MB page. */
    2456     STAMCOUNTER     StatGCInvalidatePage4MBPages;
    2457     /** GC: The number of times PGMGCInvalidatePage() skipped a 4MB page. */
    2458     STAMCOUNTER     StatGCInvalidatePage4MBPagesSkip;
    2459     /** GC: The number of times PGMGCInvalidatePage() was called for a not accessed page directory. */
    2460     STAMCOUNTER     StatGCInvalidatePagePDNAs;
    2461     /** GC: The number of times PGMGCInvalidatePage() was called for a not present page directory. */
    2462     STAMCOUNTER     StatGCInvalidatePagePDNPs;
    2463     /** GC: The number of times PGMGCInvalidatePage() was called for a page directory containing mappings (no conflict). */
    2464     STAMCOUNTER     StatGCInvalidatePagePDMappings;
    2465     /** GC: The number of times PGMGCInvalidatePage() was called for an out of sync page directory. */
    2466     STAMCOUNTER     StatGCInvalidatePagePDOutOfSync;
    2467     /** HC: The number of times PGMGCInvalidatePage() was skipped due to not present shw or pending pending SyncCR3. */
    2468     STAMCOUNTER     StatGCInvalidatePageSkipped;
    24692563    /** GC: The number of times user page is out of sync was detected in GC. */
    24702564    STAMCOUNTER     StatGCPageOutOfSyncUser;
     
    25012595    STAMCOUNTER     StatGCGuestROMWriteUnhandled;
    25022596
    2503     /** HC: PGMR3InvalidatePage() profiling. */
    2504     STAMPROFILE     StatHCInvalidatePage;
    2505     /** HC: The number of times PGMR3InvalidatePage() was called for a 4KB page. */
    2506     STAMCOUNTER     StatHCInvalidatePage4KBPages;
    2507     /** HC: The number of times PGMR3InvalidatePage() was called for a 4MB page. */
    2508     STAMCOUNTER     StatHCInvalidatePage4MBPages;
    2509     /** HC: The number of times PGMR3InvalidatePage() skipped a 4MB page. */
    2510     STAMCOUNTER     StatHCInvalidatePage4MBPagesSkip;
    2511     /** HC: The number of times PGMR3InvalidatePage() was called for a not accessed page directory. */
    2512     STAMCOUNTER     StatHCInvalidatePagePDNAs;
    2513     /** HC: The number of times PGMR3InvalidatePage() was called for a not present page directory. */
    2514     STAMCOUNTER     StatHCInvalidatePagePDNPs;
    2515     /** HC: The number of times PGMR3InvalidatePage() was called for a page directory containing mappings (no conflict). */
    2516     STAMCOUNTER     StatHCInvalidatePagePDMappings;
    2517     /** HC: The number of times PGMGCInvalidatePage() was called for an out of sync page directory. */
    2518     STAMCOUNTER     StatHCInvalidatePagePDOutOfSync;
    2519     /** HC: The number of times PGMR3InvalidatePage() was skipped due to not present shw or pending pending SyncCR3. */
    2520     STAMCOUNTER     StatHCInvalidatePageSkipped;
    2521     /** HC: PGMR3SyncPT() profiling. */
    2522     STAMPROFILE     StatHCSyncPT;
    25232597    /** HC: pgmr3SyncPTResolveConflict() profiling (includes the entire relocation). */
    25242598    STAMPROFILE     StatHCResolveConflict;
     
    25302604    STAMCOUNTER     StatHCGuestPDWriteConflict;
    25312605
    2532     /** HC: The number of pages marked not present for accessed bit emulation. */
    2533     STAMCOUNTER     StatHCAccessedPage;
    2534     /** HC: The number of pages marked read-only for dirty bit tracking. */
    2535     STAMCOUNTER     StatHCDirtyPage;
    2536     /** HC: The number of pages marked read-only for dirty bit tracking. */
    2537     STAMCOUNTER     StatHCDirtyPageBig;
    2538     /** HC: The number of traps generated for dirty bit tracking. */
    2539     STAMCOUNTER     StatHCDirtyPageTrap;
    2540     /** HC: The number of pages already dirty or readonly. */
    2541     STAMCOUNTER     StatHCDirtyPageSkipped;
    2542 
    2543     /** GC: The number of pages marked not present for accessed bit emulation. */
    2544     STAMCOUNTER     StatGCAccessedPage;
    2545     /** GC: The number of pages marked read-only for dirty bit tracking. */
    2546     STAMCOUNTER     StatGCDirtyPage;
    2547     /** GC: The number of pages marked read-only for dirty bit tracking. */
    2548     STAMCOUNTER     StatGCDirtyPageBig;
    2549     /** GC: The number of traps generated for dirty bit tracking. */
    2550     STAMCOUNTER     StatGCDirtyPageTrap;
    2551     /** GC: The number of pages already dirty or readonly. */
    2552     STAMCOUNTER     StatGCDirtyPageSkipped;
    2553     /** GC: The number of pages marked dirty because of write accesses. */
    2554     STAMCOUNTER     StatGCDirtiedPage;
    2555     /** GC: The number of pages already marked dirty because of write accesses. */
    2556     STAMCOUNTER     StatGCPageAlreadyDirty;
    2557     /** GC: The number of real pages faults during dirty bit tracking. */
    2558     STAMCOUNTER     StatGCDirtyTrackRealPF;
    2559 
    2560     /** GC: Profiling of the PGMTrackDirtyBit() body */
    2561     STAMPROFILE     StatGCDirtyBitTracking;
    2562     /** HC: Profiling of the PGMTrackDirtyBit() body */
    2563     STAMPROFILE     StatHCDirtyBitTracking;
    25642606
    25652607    /** GC: Profiling of the PGMGstModifyPage() body */
     
    25672609    /** HC: Profiling of the PGMGstModifyPage() body */
    25682610    STAMPROFILE     StatHCGstModifyPage;
    2569 
    2570     /** GC: The number of time we've marked a PD not present from SyncPage to virtualize the accessed bit. */
    2571     STAMCOUNTER     StatGCSyncPagePDNAs;
    2572     /** GC: The number of time we've encountered an out-of-sync PD in SyncPage. */
    2573     STAMCOUNTER     StatGCSyncPagePDOutOfSync;
    2574     /** HC: The number of time we've marked a PD not present from SyncPage to virtualize the accessed bit. */
    2575     STAMCOUNTER     StatHCSyncPagePDNAs;
    2576     /** HC: The number of time we've encountered an out-of-sync PD in SyncPage. */
    2577     STAMCOUNTER     StatHCSyncPagePDOutOfSync;
    25782611
    25792612    STAMCOUNTER StatSynPT4kGC;
     
    25932626    STAMCOUNTER StatFlushTLBSameCR3Global;
    25942627
    2595     STAMPROFILE StatGCSyncCR3;                      /**< GC: PGMSyncCR3() profiling. */
    2596     STAMPROFILE StatGCSyncCR3Handlers;              /**< GC: Profiling of the PGMSyncCR3() update handler section. */
    2597     STAMPROFILE StatGCSyncCR3HandlerVirtualReset;   /**< GC: Profiling of the virtual handler resets. */
    2598     STAMPROFILE StatGCSyncCR3HandlerVirtualUpdate;  /**< GC: Profiling of the virtual handler updates. */
    2599     STAMCOUNTER StatGCSyncCR3Global;                /**< GC: The number of global CR3 syncs. */
    2600     STAMCOUNTER StatGCSyncCR3NotGlobal;             /**< GC: The number of non-global CR3 syncs. */
    2601     STAMCOUNTER StatGCSyncCR3DstFreed;              /**< GC: The number of times we've had to free a shadow entry. */
    2602     STAMCOUNTER StatGCSyncCR3DstFreedSrcNP;         /**< GC: The number of times we've had to free a shadow entry for which the source entry was not present. */
    2603     STAMCOUNTER StatGCSyncCR3DstNotPresent;         /**< GC: The number of times we've encountered a not present shadow entry for a present guest entry. */
    2604     STAMCOUNTER StatGCSyncCR3DstSkippedGlobalPD;    /**< GC: The number of times a global page directory wasn't flushed. */
    2605     STAMCOUNTER StatGCSyncCR3DstSkippedGlobalPT;    /**< GC: The number of times a page table with only global entries wasn't flushed. */
    2606     STAMCOUNTER StatGCSyncCR3DstCacheHit;           /**< GC: The number of times we got some kind of cache hit on a page table. */
    2607 
    2608     STAMPROFILE StatHCSyncCR3;                      /**< HC: PGMSyncCR3() profiling. */
    2609     STAMPROFILE StatHCSyncCR3Handlers;              /**< HC: Profiling of the PGMSyncCR3() update handler section. */
    2610     STAMPROFILE StatHCSyncCR3HandlerVirtualReset;   /**< HC: Profiling of the virtual handler resets. */
    2611     STAMPROFILE StatHCSyncCR3HandlerVirtualUpdate;  /**< HC: Profiling of the virtual handler updates. */
    2612     STAMCOUNTER StatHCSyncCR3Global;                /**< HC: The number of global CR3 syncs. */
    2613     STAMCOUNTER StatHCSyncCR3NotGlobal;             /**< HC: The number of non-global CR3 syncs. */
    2614     STAMCOUNTER StatHCSyncCR3DstFreed;              /**< HC: The number of times we've had to free a shadow entry. */
    2615     STAMCOUNTER StatHCSyncCR3DstFreedSrcNP;         /**< HC: The number of times we've had to free a shadow entry for which the source entry was not present. */
    2616     STAMCOUNTER StatHCSyncCR3DstNotPresent;         /**< HC: The number of times we've encountered a not present shadow entry for a present guest entry. */
    2617     STAMCOUNTER StatHCSyncCR3DstSkippedGlobalPD;    /**< HC: The number of times a global page directory wasn't flushed. */
    2618     STAMCOUNTER StatHCSyncCR3DstSkippedGlobalPT;    /**< HC: The number of times a page table with only global entries wasn't flushed. */
    2619     STAMCOUNTER StatHCSyncCR3DstCacheHit;           /**< HC: The number of times we got some kind of cache hit on a page table. */
    2620 
    2621     /** GC: Profiling of pgmHandlerVirtualFindByPhysAddr. */
    2622     STAMPROFILE StatVirtHandleSearchByPhysGC;
    2623     /** HC: Profiling of pgmHandlerVirtualFindByPhysAddr. */
    2624     STAMPROFILE StatVirtHandleSearchByPhysHC;
    2625     /** HC: The number of times PGMR3HandlerPhysicalReset is called. */
    2626     STAMCOUNTER StatHandlePhysicalReset;
    2627 
    2628     STAMPROFILE StatCheckPageFault;
    2629     STAMPROFILE StatLazySyncPT;
    2630     STAMPROFILE StatMapping;
    2631     STAMPROFILE StatOutOfSync;
    2632     STAMPROFILE StatHandlers;
    2633     STAMPROFILE StatEIPHandlers;
    2634     STAMPROFILE StatHCPrefetch;
    2635 
    2636 # ifdef PGMPOOL_WITH_GCPHYS_TRACKING
    2637     /** The number of first time shadowings. */
    2638     STAMCOUNTER StatTrackVirgin;
    2639     /** The number of times switching to cRef2, i.e. the page is being shadowed by two PTs. */
    2640     STAMCOUNTER StatTrackAliased;
    2641     /** The number of times we're tracking using cRef2. */
    2642     STAMCOUNTER StatTrackAliasedMany;
    2643     /** The number of times we're hitting pages which has overflowed cRef2. */
    2644     STAMCOUNTER StatTrackAliasedLots;
    2645     /** The number of times the extent list grows to long. */
    2646     STAMCOUNTER StatTrackOverflows;
    2647     /** Profiling of SyncPageWorkerTrackDeref (expensive). */
    2648     STAMPROFILE StatTrackDeref;
    2649 # endif
    2650 
    2651     /** Ring-3/0 page mapper TLB hits. */
    2652     STAMCOUNTER StatPageHCMapTlbHits;
    2653     /** Ring-3/0 page mapper TLB misses. */
    2654     STAMCOUNTER StatPageHCMapTlbMisses;
    2655     /** Ring-3/0 chunk mapper TLB hits. */
    2656     STAMCOUNTER StatChunkR3MapTlbHits;
    2657     /** Ring-3/0 chunk mapper TLB misses. */
    2658     STAMCOUNTER StatChunkR3MapTlbMisses;
    2659     /** Times a shared page has been replaced by a private one. */
    2660     STAMCOUNTER StatPageReplaceShared;
    2661     /** Times the zero page has been replaced by a private one. */
    2662     STAMCOUNTER StatPageReplaceZero;
    2663     /** The number of times we've executed GMMR3AllocateHandyPages. */
    2664     STAMCOUNTER StatPageHandyAllocs;
    2665 
    2666     /** Allocated mbs of guest ram */
    2667     STAMCOUNTER     StatDynRamTotal;
    2668     /** Nr of pgmr3PhysGrowRange calls. */
    2669     STAMCOUNTER     StatDynRamGrow;
    2670 
    2671     STAMCOUNTER StatGCTrap0ePD[X86_PG_ENTRIES];
    2672     STAMCOUNTER StatGCSyncPtPD[X86_PG_ENTRIES];
    2673     STAMCOUNTER StatGCSyncPagePD[X86_PG_ENTRIES];
    2674 #endif
     2628#endif /* VBOX_WITH_STATISTICS */
    26752629} PGM, *PPGM;
    26762630
  • trunk/src/VBox/VMM/PGMShw.h

    r12975 r13067  
    115115#if PGM_SHW_TYPE != PGM_TYPE_AMD64 && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT /* No AMD64 for traditional virtualization, only VT-x and AMD-V. */
    116116        /* GC */
    117         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_SHW_NAME_GC_STR(GetPage),  &pModeData->pfnGCShwGetPage);
    118         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_SHW_NAME_GC_STR(GetPage),  rc), rc);
    119         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_SHW_NAME_GC_STR(ModifyPage),  &pModeData->pfnGCShwModifyPage);
    120         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_SHW_NAME_GC_STR(ModifyPage),  rc), rc);
     117        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_SHW_NAME_RC_STR(GetPage),  &pModeData->pfnRCShwGetPage);
     118        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_SHW_NAME_RC_STR(GetPage),  rc), rc);
     119        rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_SHW_NAME_RC_STR(ModifyPage),  &pModeData->pfnRCShwModifyPage);
     120        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_SHW_NAME_RC_STR(ModifyPage),  rc), rc);
    121121#endif /* Not AMD64 shadow paging. */
    122122
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r13060 r13067  
    337337#undef PGM_SHW_NAME
    338338
    339 #endif
    340 
     339#endif /* !IN_GC */
     340
     341
     342#ifndef IN_RING3
    341343/**
    342344 * #PF Handler.
     
    352354    LogFlow(("PGMTrap0eHandler: uErr=%RGu pvFault=%VGv eip=%VGv\n", uErr, pvFault, pRegFrame->rip));
    353355    STAM_PROFILE_START(&pVM->pgm.s.StatGCTrap0e, a);
    354     STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = NULL; } );
     356    STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = NULL; } );
    355357
    356358
     
    401403    if (rc == VINF_PGM_SYNCPAGE_MODIFIED_PDE)
    402404        rc = VINF_SUCCESS;
    403     STAM_STATS({ if (!pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution))
    404                     pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eMisc; });
    405     STAM_PROFILE_STOP_EX(&pVM->pgm.s.StatGCTrap0e, pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution), a);
     405    STAM_STATS({ if (!pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution))
     406                    pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eMisc; });
     407    STAM_PROFILE_STOP_EX(&pVM->pgm.s.StatGCTrap0e, pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution), a);
    406408    return rc;
    407409}
     410#endif /* !IN_RING3 */
     411
    408412
    409413/**
     
    446450            break;
    447451        if ((uintptr_t)GCPtr - (uintptr_t)pMapping->GCPtr < pMapping->cb)
    448         {
    449             STAM_COUNTER_INC(&pVM->pgm.s.StatGCSyncPTConflict);
    450452            return pMapping;
    451         }
    452453        pMapping = pMapping->CTX_SUFF(pNext);
    453454    }
     
    646647#endif
    647648
    648     STAM_PROFILE_START(&CTXMID(pVM->pgm.s.Stat,InvalidatePage), a);
     649    STAM_PROFILE_START(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePage), a);
    649650    rc = PGM_BTH_PFN(InvalidatePage, pVM)(pVM, GCPtrPage);
    650     STAM_PROFILE_STOP(&CTXMID(pVM->pgm.s.Stat,InvalidatePage), a);
     651    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePage), a);
    651652
    652653#ifndef IN_RING0
     
    15411542     * Let the 'Bth' function do the work and we'll just keep track of the flags.
    15421543     */
    1543     STAM_PROFILE_START(&pVM->pgm.s.CTXMID(Stat,SyncCR3), a);
     1544    STAM_PROFILE_START(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3), a);
    15441545    int rc = PGM_BTH_PFN(SyncCR3, pVM)(pVM, cr0, cr3, cr4, fGlobal);
    1545     STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncCR3), a);
     1546    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3), a);
    15461547    AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 || VBOX_FAILURE(rc), ("rc=%VRc\n", rc));
    15471548    if (rc == VINF_SUCCESS)
     
    19721973VMMDECL(unsigned) PGMAssertCR3(PVM pVM, uint64_t cr3, uint64_t cr4)
    19731974{
    1974     STAM_PROFILE_START(&pVM->pgm.s.CTXMID(Stat,SyncCR3), a);
     1975    STAM_PROFILE_START(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3), a);
    19751976    unsigned cErrors = PGM_BTH_PFN(AssertCR3, pVM)(pVM, cr3, cr4, 0, ~(RTGCUINTPTR)0);
    1976     STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncCR3), a);
     1977    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3), a);
    19771978    return cErrors;
    19781979    return 0;
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r13063 r13067  
    6767#endif
    6868
     69
     70#ifndef IN_RING3
    6971/**
    7072 * #PF Handler for raw-mode guest execution.
     
    7880PGM_BTH_DECL(int, Trap0eHandler)(PVM pVM, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault)
    7981{
    80 #if   (PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT || PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64) \
     82# if  (PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT || PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64) \
    8183    && PGM_SHW_TYPE != PGM_TYPE_NESTED    \
    8284    && (PGM_SHW_TYPE != PGM_TYPE_EPT || PGM_GST_TYPE == PGM_TYPE_PROT)
    8385
    84 # if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE != PGM_TYPE_PAE
     86#  if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE != PGM_TYPE_PAE
    8587    /*
    8688     * Hide the instruction fetch trap indicator for now.
     
    9294        TRPMSetErrorCode(pVM, uErr);
    9395    }
    94 # endif
     96#  endif
    9597
    9698    /*
     
    98100     */
    99101    int       rc;
    100 # if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    101 if PGM_GST_TYPE == PGM_TYPE_32BIT
     102#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
     103 if PGM_GST_TYPE == PGM_TYPE_32BIT
    102104    const unsigned  iPDSrc = (RTGCUINTPTR)pvFault >> GST_PD_SHIFT;
    103105    PGSTPD          pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);
    104106
    105 elif PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64
    106 
    107 #   if PGM_GST_TYPE == PGM_TYPE_PAE
     107 elif PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64
     108
     109#    if PGM_GST_TYPE == PGM_TYPE_PAE
    108110    unsigned        iPDSrc;
    109111    PGSTPD          pPDSrc = pgmGstGetPaePDPtr(&pVM->pgm.s, (RTGCUINTPTR)pvFault, &iPDSrc);
    110112
    111 #   elif PGM_GST_TYPE == PGM_TYPE_AMD64
     113#    elif PGM_GST_TYPE == PGM_TYPE_AMD64
    112114    unsigned     iPDSrc;
    113115    PX86PML4E    pPml4eSrc;
     
    117119    pPDSrc = pgmGstGetLongModePDPtr(&pVM->pgm.s, pvFault, &pPml4eSrc, &PdpeSrc, &iPDSrc);
    118120    Assert(pPml4eSrc);
    119 #   endif
     121#    endif
    120122    /* Quick check for a valid guest trap. */
    121123    if (!pPDSrc)
    122124    {
    123 #   if PGM_GST_TYPE == PGM_TYPE_AMD64 && GC_ARCH_BITS == 64
     125#    if PGM_GST_TYPE == PGM_TYPE_AMD64 && GC_ARCH_BITS == 64
    124126        LogFlow(("Trap0eHandler: guest PML4 %d not present CR3=%VGp\n", (int)(((RTGCUINTPTR)pvFault >> X86_PML4_SHIFT) & X86_PML4_MASK), CPUMGetGuestCR3(pVM) & X86_CR3_PAGE_MASK));
    125 #   else
     127#    else
    126128        LogFlow(("Trap0eHandler: guest iPDSrc=%u not present CR3=%VGp\n", iPDSrc, CPUMGetGuestCR3(pVM) & X86_CR3_PAGE_MASK));
    127 #   endif
    128         STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eGuestTrap; });
     129#    endif
     130        STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eGuestTrap; });
    129131        TRPMSetErrorCode(pVM, uErr);
    130132        return VINF_EM_RAW_GUEST_TRAP;
    131133    }
    132 endif
    133 # else
     134 endif
     135#  else
    134136    PGSTPD          pPDSrc = NULL;
    135137    const unsigned  iPDSrc = 0;
    136 # endif
    137 
    138 # if PGM_SHW_TYPE == PGM_TYPE_32BIT
     138#  endif
     139
     140#  if PGM_SHW_TYPE == PGM_TYPE_32BIT
    139141    const unsigned  iPDDst = (RTGCUINTPTR)pvFault >> SHW_PD_SHIFT;
    140142    PX86PD          pPDDst = pVM->pgm.s.CTXMID(p,32BitPD);
    141 # elif PGM_SHW_TYPE == PGM_TYPE_PAE
     143#  elif PGM_SHW_TYPE == PGM_TYPE_PAE
    142144    const unsigned  iPDDst = (RTGCUINTPTR)pvFault >> SHW_PD_SHIFT;
    143145    PX86PDPAE       pPDDst = pVM->pgm.s.CTXMID(ap,PaePDs)[0];       /* We treat this as a PD with 2048 entries, so no need to and with SHW_PD_MASK to get iPDDst */
    144146
    145 if PGM_GST_TYPE == PGM_TYPE_PAE
     147 if PGM_GST_TYPE == PGM_TYPE_PAE
    146148    /* Did we mark the PDPT as not present in SyncCR3? */
    147149    unsigned iPdpte = ((RTGCUINTPTR)pvFault >> SHW_PDPT_SHIFT) & SHW_PDPT_MASK;
     
    149151        pVM->pgm.s.CTXMID(p,PaePDPT)->a[iPdpte].n.u1Present = 1;
    150152
    151 endif
    152 
    153 # elif PGM_SHW_TYPE == PGM_TYPE_AMD64
     153 endif
     154
     155#  elif PGM_SHW_TYPE == PGM_TYPE_AMD64
    154156    const unsigned  iPDDst = (((RTGCUINTPTR)pvFault >> SHW_PD_SHIFT) & SHW_PD_MASK);
    155157    PX86PDPAE       pPDDst;
    156 if PGM_GST_TYPE == PGM_TYPE_PROT
     158 if PGM_GST_TYPE == PGM_TYPE_PROT
    157159    /* AMD-V nested paging */
    158160    X86PML4E     Pml4eSrc;
     
    163165    Pml4eSrc.u = X86_PML4E_P | X86_PML4E_RW | X86_PML4E_US | X86_PML4E_A;
    164166    PdpeSrc.u  = X86_PDPE_P | X86_PDPE_RW | X86_PDPE_US | X86_PDPE_A;
    165 endif
     167 endif
    166168
    167169    rc = PGMShwSyncLongModePDPtr(pVM, (RTGCUINTPTR)pvFault, pPml4eSrc, &PdpeSrc, &pPDDst);
     
    172174    }
    173175    Assert(pPDDst);
    174 # elif PGM_SHW_TYPE == PGM_TYPE_EPT
     176#  elif PGM_SHW_TYPE == PGM_TYPE_EPT
    175177    const unsigned  iPDDst = (((RTGCUINTPTR)pvFault >> SHW_PD_SHIFT) & SHW_PD_MASK);
    176178    PEPTPD          pPDDst;
     
    179181    AssertReturn(rc == VINF_SUCCESS /* *must* test for VINF_SUCCESS!! */, rc);
    180182    Assert(pPDDst);
    181 # endif
    182 
    183 # if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
     183#  endif
     184
     185#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    184186    /*
    185187     * If we successfully correct the write protection fault due to dirty bit
     
    192194        ||  rc == VINF_EM_RAW_GUEST_TRAP)
    193195    {
    194         STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution)
     196        STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution)
    195197                     = rc == VINF_PGM_HANDLED_DIRTY_BIT_FAULT ? &pVM->pgm.s.StatTrap0eDirtyAndAccessedBits : &pVM->pgm.s.StatTrap0eGuestTrap; });
    196198        LogBird(("Trap0eHandler: returns %s\n", rc == VINF_PGM_HANDLED_DIRTY_BIT_FAULT ? "VINF_SUCCESS" : "VINF_EM_RAW_GUEST_TRAP"));
     
    199201
    200202    STAM_COUNTER_INC(&pVM->pgm.s.StatGCTrap0ePD[iPDSrc]);
    201 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
     203#  endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    202204
    203205    /*
     
    212214     *
    213215     */
    214 # if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
     216#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    215217    GSTPDE PdeSrc = pPDSrc->a[iPDSrc];
    216 # else
     218#  else
    217219    GSTPDE PdeSrc;
    218220    PdeSrc.au32[0]      = 0; /* faked so we don't have to #ifdef everything */
     
    221223    PdeSrc.n.u1Accessed = 1;
    222224    PdeSrc.n.u1User     = 1;
    223 # endif
     225#  endif
    224226    if (    !(uErr & X86_TRAP_PF_P) /* not set means page not present instead of page protection violation */
    225227        &&  !pPDDst->a[iPDDst].n.u1Present
     
    228230
    229231    {
    230         STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eSyncPT; });
     232        STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eSyncPT; });
    231233        STAM_PROFILE_START(&pVM->pgm.s.StatLazySyncPT, f);
    232234        LogFlow(("=>SyncPT %04x = %08x\n", iPDSrc, PdeSrc.au32[0]));
     
    243245    }
    244246
    245 # if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
     247#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    246248    /*
    247249     * Check if this address is within any of our mappings.
     
    286288                    &&  uErr & X86_TRAP_PF_RW)
    287289                {
    288 ifdef IN_GC
     290 ifdef IN_GC
    289291                    STAM_PROFILE_START(&pCur->Stat, h);
    290292                    rc = pCur->CTX_SUFF(pfnHandler)(pVM, uErr, pRegFrame, pvFault, pCur->Core.Key, (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->Core.Key);
    291293                    STAM_PROFILE_STOP(&pCur->Stat, h);
    292 else
     294 else
    293295                    AssertFailed();
    294296                    rc = VINF_EM_RAW_EMULATE_INSTR; /* can't happen with VMX */
    295 endif
     297 endif
    296298                    STAM_COUNTER_INC(&pVM->pgm.s.StatTrap0eMapHandler);
    297299                    STAM_PROFILE_STOP(&pVM->pgm.s.StatMapping, a);
     
    311313        STAM_PROFILE_STOP(&pVM->pgm.s.StatMapping, a);
    312314    } /* pgmAreMappingsEnabled(&pVM->pgm.s) */
    313 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
     315#  endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    314316
    315317    /*
     
    325327        RTGCPHYS    GCPhys = NIL_RTGCPHYS;
    326328
    327 # if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    328 if PGM_GST_TYPE == PGM_TYPE_AMD64
     329#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
     330 if PGM_GST_TYPE == PGM_TYPE_AMD64
    329331        bool fBigPagesSupported = true;
    330 else
     332 else
    331333        bool fBigPagesSupported = !!(CPUMGetGuestCR4(pVM) & X86_CR4_PSE);
    332 endif
     334 endif
    333335        if (    PdeSrc.b.u1Size
    334336            &&  fBigPagesSupported)
     
    346348            }
    347349        }
    348 # else
     350#  else
    349351        /* No paging so the fault address is the physical address */
    350352        GCPhys = (RTGCPHYS)((RTGCUINTPTR)pvFault & ~PAGE_OFFSET_MASK);
    351 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
     353#  endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    352354
    353355        /*
     
    373375                        if (pCur)
    374376                        {
    375 # ifdef PGM_SYNC_N_PAGES
     377#  ifdef PGM_SYNC_N_PAGES
    376378                            /*
    377379                             * If the region is write protected and we got a page not present fault, then sync
     
    392394                                    STAM_COUNTER_INC(&pVM->pgm.s.StatHandlersOutOfSync);
    393395                                    STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b);
    394                                     STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eOutOfSyncHndPhys; });
     396                                    STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eOutOfSyncHndPhys; });
    395397                                    return rc;
    396398                                }
    397399                            }
    398 # endif
     400#  endif
    399401
    400402                            AssertMsg(   pCur->enmType != PGMPHYSHANDLERTYPE_PHYSICAL_WRITE
     
    402404                                      ("Unexpected trap for physical handler: %08X (phys=%08x) HCPhys=%X uErr=%X, enum=%d\n", pvFault, GCPhys, pPage->HCPhys, uErr, pCur->enmType));
    403405
    404 #if defined(IN_GC) || defined(IN_RING0)
     406# if defined(IN_GC) || defined(IN_RING0)
    405407                            if (pCur->CTX_SUFF(pfnHandler))
    406408                            {
     
    410412                            }
    411413                            else
    412 #endif
     414# endif
    413415                                rc = VINF_EM_RAW_EMULATE_INSTR;
    414416                            STAM_COUNTER_INC(&pVM->pgm.s.StatHandlersPhysical);
    415417                            STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b);
    416                             STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eHndPhys; });
     418                            STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eHndPhys; });
    417419                            return rc;
    418420                        }
    419421                    }
    420 # if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
     422#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    421423                    else
    422424                    {
    423 # ifdef PGM_SYNC_N_PAGES
     425#  ifdef PGM_SYNC_N_PAGES
    424426                        /*
    425427                         * If the region is write protected and we got a page not present fault, then sync
     
    438440                                STAM_COUNTER_INC(&pVM->pgm.s.StatHandlersOutOfSync);
    439441                                STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b);
    440                                 STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eOutOfSyncHndVirt; });
     442                                STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eOutOfSyncHndVirt; });
    441443                                return rc;
    442444                            }
    443445                        }
    444 # endif
     446#  endif
    445447                        /*
    446448                         * Ok, it's an virtual page access handler.
     
    466468                                     ||  pCur->enmType != PGMVIRTHANDLERTYPE_WRITE ) )
    467469                            {
    468 ifdef IN_GC
     470 ifdef IN_GC
    469471                                STAM_PROFILE_START(&pCur->Stat, h);
    470472                                rc = pCur->CTX_SUFF(pfnHandler)(pVM, uErr, pRegFrame, pvFault, pCur->Core.Key, (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->Core.Key);
    471473                                STAM_PROFILE_STOP(&pCur->Stat, h);
    472 else
     474 else
    473475                                rc = VINF_EM_RAW_EMULATE_INSTR; /** @todo for VMX */
    474 endif
     476 endif
    475477                                STAM_COUNTER_INC(&pVM->pgm.s.StatHandlersVirtual);
    476478                                STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b);
    477                                 STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eHndVirt; });
     479                                STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eHndVirt; });
    478480                                return rc;
    479481                            }
     
    493495                            {
    494496                                Assert((pCur->aPhysToVirt[iPage].Core.Key & X86_PTE_PAE_PG_MASK) == GCPhys);
    495 ifdef IN_GC
     497 ifdef IN_GC
    496498                                RTGCUINTPTR off = (iPage << PAGE_SHIFT) + ((RTGCUINTPTR)pvFault & PAGE_OFFSET_MASK) - ((RTGCUINTPTR)pCur->Core.Key & PAGE_OFFSET_MASK);
    497499                                Assert(off < pCur->cb);
     
    499501                                rc = pCur->CTX_SUFF(pfnHandler)(pVM, uErr, pRegFrame, pvFault, pCur->Core.Key, off);
    500502                                STAM_PROFILE_STOP(&pCur->Stat, h);
    501 else
     503 else
    502504                                rc = VINF_EM_RAW_EMULATE_INSTR; /** @todo for VMX */
    503 endif
     505 endif
    504506                                STAM_COUNTER_INC(&pVM->pgm.s.StatHandlersVirtualByPhys);
    505507                                STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b);
    506                                 STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eHndVirt; });
     508                                STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eHndVirt; });
    507509                                return rc;
    508510                            }
    509511                        }
    510512                    }
    511 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
     513#  endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    512514
    513515                    /*
     
    532534                            STAM_COUNTER_INC(&pVM->pgm.s.StatHandlersOutOfSync);
    533535                            STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b);
    534                             STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eOutOfSyncHndPhys; });
     536                            STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eOutOfSyncHndPhys; });
    535537                            return rc;
    536538                        }
     
    546548                             PGM_PAGE_HAS_ANY_VIRTUAL_HANDLERS(pPage)  ? " virt" : ""));
    547549                    STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b);
    548                     STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eHndUnhandled; });
     550                    STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eHndUnhandled; });
    549551                    return rc;
    550552                } /* if any kind of handler */
    551553
    552 # if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
     554#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    553555                if (uErr & X86_TRAP_PF_P)
    554556                {
     
    573575                                 ||  pCur->enmType != PGMVIRTHANDLERTYPE_WRITE ) )
    574576                        {
    575 ifdef IN_GC
     577 ifdef IN_GC
    576578                            STAM_PROFILE_START(&pCur->Stat, h);
    577579                            rc = pCur->CTX_SUFF(pfnHandler)(pVM, uErr, pRegFrame, pvFault, pCur->Core.Key, (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->Core.Key);
    578580                            STAM_PROFILE_STOP(&pCur->Stat, h);
    579 else
     581 else
    580582                            rc = VINF_EM_RAW_EMULATE_INSTR; /** @todo for VMX */
    581 endif
     583 endif
    582584                            STAM_COUNTER_INC(&pVM->pgm.s.StatHandlersVirtualUnmarked);
    583585                            STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b);
    584                             STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eHndVirt; });
     586                            STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eHndVirt; });
    585587                            return rc;
    586588                        }
    587589                    }
    588590                }
    589 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
     591#  endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    590592            }
    591593            else
     
    602604            STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b);
    603605
    604 # ifdef PGM_OUT_OF_SYNC_IN_GC
     606#  ifdef PGM_OUT_OF_SYNC_IN_GC
    605607            /*
    606608             * We are here only if page is present in Guest page tables and trap is not handled
     
    622624                    STAM_COUNTER_INC(&pVM->pgm.s.StatGCPageOutOfSyncSupervisor);
    623625
    624 if defined(LOG_ENABLED) && !defined(IN_RING0)
     626 if defined(LOG_ENABLED) && !defined(IN_RING0)
    625627                RTGCPHYS   GCPhys;
    626628                uint64_t   fPageGst;
     
    628630                Log(("Page out of sync: %VGv eip=%08x PdeSrc.n.u1User=%d fPageGst=%08llx GCPhys=%VGp scan=%d\n",
    629631                     pvFault, pRegFrame->eip, PdeSrc.n.u1User, fPageGst, GCPhys, CSAMDoesPageNeedScanning(pVM, (RTRCPTR)pRegFrame->eip)));
    630 endif /* LOG_ENABLED */
    631 
    632 if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) && !defined(IN_RING0)
     632 endif /* LOG_ENABLED */
     633
     634 if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) && !defined(IN_RING0)
    633635                if (CPUMGetGuestCPL(pVM, pRegFrame) == 0)
    634636                {
     
    641643                        if (    pvFault == (RTGCPTR)pRegFrame->eip
    642644                            ||  (RTGCUINTPTR)pvFault - pRegFrame->eip < 8    /* instruction crossing a page boundary */
    643 #   ifdef CSAM_DETECT_NEW_CODE_PAGES
     645#    ifdef CSAM_DETECT_NEW_CODE_PAGES
    644646                            ||  (   !PATMIsPatchGCAddr(pVM, (RTGCPTR)pRegFrame->eip)
    645647                                 && CSAMDoesPageNeedScanning(pVM, (RTRCPTR)pRegFrame->eip))   /* any new code we encounter here */
    646 #   endif /* CSAM_DETECT_NEW_CODE_PAGES */
     648#    endif /* CSAM_DETECT_NEW_CODE_PAGES */
    647649                           )
    648650                        {
     
    662664
    663665                                STAM_PROFILE_STOP(&pVM->pgm.s.StatOutOfSync, c);
    664                                 STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eCSAM; });
     666                                STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eCSAM; });
    665667                                return rc;
    666668                            }
    667669                        }
    668 #   ifdef CSAM_DETECT_NEW_CODE_PAGES
     670#    ifdef CSAM_DETECT_NEW_CODE_PAGES
    669671                        else
    670672                        if (    uErr == X86_TRAP_PF_RW
     
    697699                            }
    698700                        }
    699 #   endif  /* CSAM_DETECT_NEW_CODE_PAGES */
     701#    endif  /* CSAM_DETECT_NEW_CODE_PAGES */
    700702
    701703                        /*
     
    707709                    }
    708710                }
    709 endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) && !defined(IN_RING0) */
     711 endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) && !defined(IN_RING0) */
    710712                rc = PGM_BTH_NAME(SyncPage)(pVM, PdeSrc, (RTGCUINTPTR)pvFault, PGM_SYNC_NR_PAGES, uErr);
    711713                if (VBOX_SUCCESS(rc))
     
    713715                    /* The page was successfully synced, return to the guest. */
    714716                    STAM_PROFILE_STOP(&pVM->pgm.s.StatOutOfSync, c);
    715                     STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eOutOfSync; });
     717                    STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eOutOfSync; });
    716718                    return VINF_SUCCESS;
    717719                }
     
    741743                        * Page was successfully synced, return to guest.
    742744                        */
    743 ifdef VBOX_STRICT
     745 ifdef VBOX_STRICT
    744746                        RTGCPHYS GCPhys;
    745747                        uint64_t fPageGst;
     
    751753                        rc = PGMShwGetPage(pVM, pvFault, &fPageShw, NULL);
    752754                        AssertMsg(VBOX_SUCCESS(rc) && fPageShw & X86_PTE_RW, ("rc=%Vrc fPageShw=%VX64\n", rc, fPageShw));
    753 endif /* VBOX_STRICT */
     755 endif /* VBOX_STRICT */
    754756                        STAM_PROFILE_STOP(&pVM->pgm.s.StatOutOfSync, c);
    755                         STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eOutOfSyncObsHnd; });
     757                        STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eOutOfSyncObsHnd; });
    756758                        return VINF_SUCCESS;
    757759                    }
     
    780782                }
    781783
    782 if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    783 #   ifdef VBOX_STRICT
     784 if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
     785#    ifdef VBOX_STRICT
    784786                /*
    785787                 * Check for VMM page flags vs. Guest page flags consistency.
     
    808810                else
    809811                    AssertMsgFailed(("PGMGCGetPage rc=%Vrc\n", rc));
    810 #   endif /* VBOX_STRICT */
    811 endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
     812#    endif /* VBOX_STRICT */
     813 endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    812814            }
    813815            STAM_PROFILE_STOP(&pVM->pgm.s.StatOutOfSync, c);
    814 # endif /* PGM_OUT_OF_SYNC_IN_GC */
     816#  endif /* PGM_OUT_OF_SYNC_IN_GC */
    815817        }
    816818        else
     
    834836
    835837
    836 # if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
     838#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    837839    /*
    838840     * Conclusion, this is a guest trap.
     
    841843    STAM_COUNTER_INC(&pVM->pgm.s.StatGCTrap0eUnhandled);
    842844    return VINF_EM_RAW_GUEST_TRAP;
    843 # else
     845#  else
    844846    /* present, but not a monitored page; perhaps the guest is probing physical memory */
    845847    return VINF_EM_RAW_EMULATE_INSTR;
    846 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    847 
    848 
    849 #else /* PGM_GST_TYPE != PGM_TYPE_32BIT */
     848#  endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
     849
     850
     851# else /* PGM_GST_TYPE != PGM_TYPE_32BIT */
    850852
    851853    AssertReleaseMsgFailed(("Shw=%d Gst=%d is not implemented!\n", PGM_GST_TYPE, PGM_SHW_TYPE));
    852854    return VERR_INTERNAL_ERROR;
    853 #endif /* PGM_GST_TYPE != PGM_TYPE_32BIT */
     855# endif /* PGM_GST_TYPE != PGM_TYPE_32BIT */
    854856}
     857#endif /* !IN_RING3 */
    855858
    856859
     
    896899    {
    897900        Assert(!(pPdptDst->a[iPdpte].u & PGM_PLXFLAGS_MAPPING));
    898         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePageSkipped));
     901        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePageSkipped));
    899902        return VINF_SUCCESS;
    900903    }
     
    914917    {
    915918        AssertMsg(rc == VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT || rc == VERR_PAGE_MAP_LEVEL4_NOT_PRESENT, ("Unexpected rc=%Vrc\n", rc));
    916         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePageSkipped));
     919        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePageSkipped));
    917920        if (!VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3))
    918921            PGM_INVL_GUEST_TLBS();
     
    926929    if (!pPdpeDst->n.u1Present)
    927930    {
    928         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePageSkipped));
     931        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePageSkipped));
    929932        if (!VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3))
    930933            PGM_INVL_GUEST_TLBS();
     
    937940    if (!PdeDst.n.u1Present)
    938941    {
    939         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePageSkipped));
     942        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePageSkipped));
    940943        return VINF_SUCCESS;
    941944    }
     
    989992#  endif
    990993    {
    991         STAM_COUNTER_INC(&pVM->pgm.s.StatHCInvalidatePageSkipped);
     994        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePageSkipped));
    992995        return VINF_SUCCESS;
    993996    }
     
    10151018        pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.pHCShwAmd64CR3->idx, iPml4e);
    10161019        pPml4eDst->u = 0;
    1017         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePagePDNPs));
     1020        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNPs));
    10181021        PGM_INVL_GUEST_TLBS();
    10191022        return VINF_SUCCESS;
     
    10291032        pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.pHCShwAmd64CR3->idx, iPml4e);
    10301033        pPml4eDst->u = 0;
    1031         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePagePDOutOfSync));
     1034        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDOutOfSync));
    10321035        PGM_INVL_GUEST_TLBS();
    10331036    }
     
    10411044        pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.pHCShwAmd64CR3->idx, iPml4e);
    10421045        pPml4eDst->u = 0;
    1043         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePagePDNAs));
     1046        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNAs));
    10441047        PGM_INVL_GUEST_TLBS();
    10451048    }
     
    10551058        pgmPoolFreeByPage(pPool, pShwPde, pShwPdpt->idx, iPdpte);
    10561059        pPdpeDst->u = 0;
    1057         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePagePDNPs));
     1060        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNPs));
    10581061        PGM_INVL_GUEST_TLBS();
    10591062        return VINF_SUCCESS;
     
    10691072        pgmPoolFreeByPage(pPool, pShwPde, pShwPdpt->idx, iPdpte);
    10701073        pPdpeDst->u = 0;
    1071         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePagePDOutOfSync));
     1074        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDOutOfSync));
    10721075        PGM_INVL_GUEST_TLBS();
    10731076    }
     
    10811084        pgmPoolFreeByPage(pPool, pShwPde, pShwPdpt->idx, iPdpte);
    10821085        pPdpeDst->u = 0;
    1083         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePagePDNAs));
     1086        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNAs));
    10841087        PGM_INVL_GUEST_TLBS();
    10851088    }
     
    11441147# endif
    11451148            pPdeDst->u = 0;
    1146             STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePagePDOutOfSync));
     1149            STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDOutOfSync));
    11471150            PGM_INVL_GUEST_TLBS();
    11481151        }
     
    11601163# endif
    11611164            pPdeDst->u = 0;
    1162             STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePagePDNAs));
     1165            STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNAs));
    11631166            PGM_INVL_GUEST_TLBS();
    11641167        }
     
    11921195                    rc = VINF_SUCCESS;
    11931196# endif
    1194                 STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePage4KBPages));
     1197                STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePage4KBPages));
    11951198                PGM_INVL_PG(GCPtrPage);
    11961199            }
     
    12081211# endif
    12091212                pPdeDst->u = 0;
    1210                 STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePagePDOutOfSync));
     1213                STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDOutOfSync));
    12111214                PGM_INVL_GUEST_TLBS();
    12121215            }
     
    12351238                {
    12361239                    LogFlow(("Skipping flush for big page containing %VGv (PD=%X .u=%VX64)-> nothing has changed!\n", GCPtrPage, iPDSrc, PdeSrc.u));
    1237                     STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePage4MBPagesSkip));
     1240                    STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePage4MBPagesSkip));
    12381241                    return VINF_SUCCESS;
    12391242                }
     
    12541257# endif
    12551258            pPdeDst->u = 0;
    1256             STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePage4MBPages));
     1259            STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePage4MBPages));
    12571260            PGM_INVL_BIG_PG(GCPtrPage);
    12581261        }
     
    12711274# endif
    12721275            pPdeDst->u = 0;
    1273             STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePagePDNPs));
     1276            STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNPs));
    12741277            PGM_INVL_PG(GCPtrPage);
    12751278        }
     
    12771280        {
    12781281            Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s));
    1279             STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePagePDMappings));
     1282            STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDMappings));
    12801283        }
    12811284    }
     
    14491452                {
    14501453                    LogFlow(("SyncPageWorker: page and or page directory not accessed -> mark not present\n"));
    1451                     STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,AccessedPage));
     1454                    STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,AccessedPage));
    14521455                    PteDst.u = 0;
    14531456                }
     
    14591462                if (!PteSrc.n.u1Dirty && (PdeSrc.n.u1Write & PteSrc.n.u1Write))
    14601463                {
    1461                     STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,DirtyPage));
     1464                    STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyPage));
    14621465                    PteDst.u = (PteSrc.u & ~(X86_PTE_PAE_PG_MASK | X86_PTE_AVL_MASK | X86_PTE_PAT | X86_PTE_PCD | X86_PTE_PWT | X86_PTE_RW))
    14631466                             | (HCPhys & X86_PTE_PAE_PG_MASK)
     
    14671470#endif
    14681471                {
    1469                     STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,DirtyPageSkipped));
     1472                    STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyPageSkipped));
    14701473#if PGM_SHW_TYPE == PGM_TYPE_EPT
    14711474                    PteDst.u           = (HCPhys & EPT_PTE_PG_MASK);
     
    17751778                    if (!PdeSrc.b.u1Dirty && PdeSrc.b.u1Write)
    17761779                    {
    1777                         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,DirtyPageBig));
     1780                        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyPageBig));
    17781781                        PdeDst.u |= PGM_PDFLAGS_TRACK_DIRTY;
    17791782                        PdeDst.n.u1Write = 0;
     
    18001803            return VINF_SUCCESS;
    18011804        }
    1802         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,SyncPagePDNAs));
     1805        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncPagePDNAs));
    18031806    }
    18041807    else
    18051808    {
    1806         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,SyncPagePDOutOfSync));
     1809        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncPagePDOutOfSync));
    18071810        Log2(("SyncPage: Out-Of-Sync PDE at %VGp PdeSrc=%RX64 PdeDst=%RX64\n",
    18081811              GCPtrPage, (uint64_t)PdeSrc.u, (uint64_t)PdeDst.u));
     
    19781981    int rc;
    19791982
    1980     STAM_PROFILE_START(&pVM->pgm.s.CTXMID(Stat, DirtyBitTracking), a);
     1983    STAM_PROFILE_START(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyBitTracking), a);
    19811984    LogFlow(("CheckPageFault: GCPtrPage=%VGv uErr=%#x PdeSrc=%08x\n", GCPtrPage, uErr, pPdeSrc->u));
    19821985
     
    20652068            if (pPdeDst->n.u1Present && (pPdeDst->u & PGM_PDFLAGS_TRACK_DIRTY))
    20662069            {
    2067                 STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,DirtyPageTrap));
     2070                STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyPageTrap));
    20682071
    20692072                Assert(pPdeSrc->b.u1Write);
     
    20732076                pPdeDst->au32[0]       &= ~PGM_PDFLAGS_TRACK_DIRTY;
    20742077                PGM_INVL_BIG_PG(GCPtrPage);
    2075                 STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,DirtyBitTracking), a);
     2078                STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyBitTracking), a);
    20762079                return VINF_PGM_HANDLED_DIRTY_BIT_FAULT;
    20772080            }
    20782081        }
    2079         STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,DirtyBitTracking), a);
     2082        STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyBitTracking), a);
    20802083        return VINF_PGM_NO_DIRTY_BIT_TRACKING;
    20812084    }
     
    21022105           )
    21032106        {
    2104 #  ifdef IN_GC
    2105             STAM_COUNTER_INC(&pVM->pgm.s.StatGCDirtyTrackRealPF);
    2106 #  endif
    2107             STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,DirtyBitTracking), a);
     2107            STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyTrackRealPF));
     2108            STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyBitTracking), a);
    21082109            LogFlow(("CheckPageFault: real page fault at %VGv PteSrc.u=%08x (2)\n", GCPtrPage, PteSrc.u));
    21092110
     
    21142115                TRPMSetErrorCode(pVM, uErr | X86_TRAP_PF_P); /* page-level protection violation */
    21152116
    2116             STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,DirtyBitTracking), a);
     2117            STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyBitTracking), a);
    21172118            return VINF_EM_RAW_GUEST_TRAP;
    21182119        }
     
    21352136        {
    21362137            /* Write access, so mark guest entry as dirty. */
    2137 #  if defined(IN_GC) && defined(VBOX_WITH_STATISTICS)
     2138#  ifdef VBOX_WITH_STATISTICS
    21382139            if (!pPteSrc->n.u1Dirty)
    2139                 STAM_COUNTER_INC(&pVM->pgm.s.StatGCDirtiedPage);
     2140                STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,DirtiedPage));
    21402141            else
    2141                 STAM_COUNTER_INC(&pVM->pgm.s.StatGCPageAlreadyDirty);
     2142                STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,PageAlreadyDirty));
    21422143#  endif
    21432144
     
    21532154                {
    21542155                    LogRel(("CheckPageFault: write to hypervisor region %VGv\n", GCPtrPage));
    2155                     STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,DirtyBitTracking), a);
     2156                    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyBitTracking), a);
    21562157                    return VINF_SUCCESS;
    21572158                }
     
    21752176                                      ("Unexpected dirty bit tracking on monitored page %VGv (phys %VGp)!!!!!!\n", GCPtrPage, pPteSrc->u & X86_PTE_PAE_PG_MASK));
    21762177#  endif
    2177                         STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,DirtyPageTrap));
     2178                        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyPageTrap));
    21782179
    21792180                        Assert(pPteSrc->n.u1Write);
     
    21852186                        PGM_INVL_PG(GCPtrPage);
    21862187
    2187                         STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,DirtyBitTracking), a);
     2188                        STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyBitTracking), a);
    21882189                        return VINF_PGM_HANDLED_DIRTY_BIT_FAULT;
    21892190                    }
     
    22102211        }
    22112212#  endif /* VBOX_STRICT */
    2212         STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,DirtyBitTracking), a);
     2213        STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyBitTracking), a);
    22132214        return VINF_PGM_NO_DIRTY_BIT_TRACKING;
    22142215    }
    22152216    AssertRC(rc);
    2216     STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,DirtyBitTracking), a);
     2217    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyBitTracking), a);
    22172218    return rc;
    22182219
     
    22222223     * Single exit handler to get rid of duplicate code paths.
    22232224     */
    2224 #  ifdef IN_GC
    2225     STAM_COUNTER_INC(&pVM->pgm.s.StatGCDirtyTrackRealPF);
    2226 #  endif
    2227     STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat, DirtyBitTracking), a);
     2225    STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyTrackRealPF));
     2226    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyBitTracking), a);
    22282227    Log(("CheckPageFault: real page fault at %VGv (%d)\n", GCPtrPage, uPageFaultLevel));
    22292228
     
    22802279PGM_BTH_DECL(int, SyncPT)(PVM pVM, unsigned iPDSrc, PGSTPD pPDSrc, RTGCUINTPTR GCPtrPage)
    22812280{
    2282     STAM_PROFILE_START(&pVM->pgm.s.CTXMID(Stat,SyncPT), a);
     2281    STAM_PROFILE_START(&pVM->pgm.s.CTX_MID_Z(Stat,SyncPT), a);
    22832282    STAM_COUNTER_INC(&pVM->pgm.s.StatGCSyncPtPD[iPDSrc]);
    22842283    LogFlow(("SyncPT: GCPtrPage=%VGv\n", GCPtrPage));
     
    23342333#  ifndef IN_RING3
    23352334        Log(("SyncPT: Conflict at %VGv\n", GCPtrPage));
    2336         STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncPT), a);
     2335        STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,SyncPT), a);
    23372336        return VERR_ADDRESS_CONFLICT;
    23382337#  else
     
    23482347        if (VBOX_FAILURE(rc))
    23492348        {
    2350             STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncPT), a);
     2349            STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,SyncPT), a);
    23512350            return rc;
    23522351        }
     
    24192418                if (!PdeSrc.b.u1Dirty && PdeSrc.b.u1Write)
    24202419                {
    2421                     STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,DirtyPageBig));
     2420                    STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyPageBig));
    24222421                    PdeDst.u |= PGM_PDFLAGS_TRACK_DIRTY;
    24232422                    PdeDst.b.u1Write = 0;
     
    25582557            if (!PdeSrc.b.u1Dirty && PdeSrc.b.u1Write)
    25592558            {
    2560                 STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,DirtyPageBig));
     2559                STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,DirtyPageBig));
    25612560                PdeDst.u |= PGM_PDFLAGS_TRACK_DIRTY;
    25622561                PdeDst.b.u1Write = 0;
     
    26692668        AssertRelease(!PdeDst.n.u1Present);
    26702669
    2671     STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncPT), a);
    2672 # ifdef IN_GC
     2670    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,SyncPT), a);
    26732671    if (VBOX_FAILURE(rc))
    2674       STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,SyncPTFailed));
    2675 # endif
     2672        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncPTFailed));
    26762673    return rc;
    26772674
     
    27622759
    27632760    rc = PGM_BTH_NAME(SyncPage)(pVM, PdeSrc, (RTGCUINTPTR)GCPtrPage, PGM_SYNC_NR_PAGES, 0 /* page not present */);
    2764     STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncPT), a);
     2761    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,SyncPT), a);
    27652762    return rc;
    27662763
    27672764#else
    27682765    AssertReleaseMsgFailed(("Shw=%d Gst=%d is not implemented!\n", PGM_GST_TYPE, PGM_SHW_TYPE));
    2769     STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncPT), a);
     2766    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,SyncPT), a);
    27702767    return VERR_INTERNAL_ERROR;
    27712768#endif
     
    31003097     */
    31013098    /** @todo this MUST go away. See #1557. */
    3102     STAM_PROFILE_START(&pVM->pgm.s.CTXMID(Stat,SyncCR3Handlers), h);
     3099    STAM_PROFILE_START(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3Handlers), h);
    31033100    PGM_GST_NAME(HandlerVirtualUpdate)(pVM, cr4);
    3104     STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncCR3Handlers), h);
     3101    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3Handlers), h);
    31053102#endif
    31063103
     
    31223119
    31233120    Assert(fGlobal || (cr4 & X86_CR4_PGE));
    3124     MY_STAM_COUNTER_INC(fGlobal ? &pVM->pgm.s.CTXMID(Stat,SyncCR3Global) : &pVM->pgm.s.CTXMID(Stat,SyncCR3NotGlobal));
     3121    MY_STAM_COUNTER_INC(fGlobal ? &pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3Global) : &pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3NotGlobal));
    31253122
    31263123# if PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64
     
    34233420                                    && (cr4 & (X86_CR4_PGE | X86_CR4_PSE)) == (X86_CR4_PGE | X86_CR4_PSE))
    34243421#   endif
    3425                                     MY_STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,SyncCR3DstSkippedGlobalPD));
     3422                                    MY_STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3DstSkippedGlobalPD));
    34263423                                else if (!fGlobal && !pShwPage->fSeenNonGlobal && (cr4 & X86_CR4_PGE))
    3427                                     MY_STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,SyncCR3DstSkippedGlobalPT));
     3424                                    MY_STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3DstSkippedGlobalPT));
    34283425                                else
    3429                                     MY_STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,SyncCR3DstCacheHit));
     3426                                    MY_STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3DstCacheHit));
    34303427#  endif /* VBOX_WITH_STATISTICS */
    34313428        /** @todo a replacement strategy isn't really needed unless we're using a very small pool < 512 pages.
     
    34433440#  endif
    34443441                                pPDEDst->u = 0;
    3445                                 MY_STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,SyncCR3DstFreed));
     3442                                MY_STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3DstFreed));
    34463443                            }
    34473444                        }
    34483445                        else
    3449                             MY_STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,SyncCR3DstNotPresent));
     3446                            MY_STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3DstNotPresent));
    34503447                        pPDEDst++;
    34513448                    }
     
    34763473#  endif
    34773474                            pPDEDst->u = 0;
    3478                             MY_STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,SyncCR3DstFreedSrcNP));
     3475                            MY_STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3DstFreedSrcNP));
    34793476                        }
    34803477                        pPDEDst++;
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r13062 r13067  
    611611                                              pVM->pgm.s.pfnR3GstWriteHandlerCR3, 0,
    612612                                              pVM->pgm.s.pfnR0GstWriteHandlerCR3, 0,
    613                                               pVM->pgm.s.pfnGCGstWriteHandlerCR3, 0,
     613                                              pVM->pgm.s.pfnRCGstWriteHandlerCR3, 0,
    614614                                              pVM->pgm.s.pszR3GstWriteHandlerCR3);
    615615# else  /* PGMPOOL_WITH_MIXED_PT_CR3 */
     
    936936
    937937    pgmLock(pVM);
    938     STAM_PROFILE_START(&pVM->pgm.s.CTXMID(Stat,SyncCR3HandlerVirtualUpdate), a);
     938    STAM_PROFILE_START(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3HandlerVirtualUpdate), a);
    939939    State.pVM   = pVM;
    940940    State.fTodo = pVM->pgm.s.fSyncFlags;
    941941    State.cr4   = cr4;
    942942    RTAvlroGCPtrDoWithAll(&pVM->pgm.s.CTX_SUFF(pTrees)->VirtHandlers, true, PGM_GST_NAME(VirtHandlerUpdateOne), &State);
    943     STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncCR3HandlerVirtualUpdate), a);
     943    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3HandlerVirtualUpdate), a);
    944944
    945945
     
    949949    if (State.fTodo & PGM_SYNC_UPDATE_PAGE_BIT_VIRTUAL)
    950950    {
    951         STAM_PROFILE_START(&pVM->pgm.s.CTXMID(Stat,SyncCR3HandlerVirtualReset), b);
     951        STAM_PROFILE_START(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3HandlerVirtualReset), b);
    952952        Log(("pgmR3VirtualHandlersUpdate: resets bits\n"));
    953953        RTAvlroGCPtrDoWithAll(&pVM->pgm.s.CTX_SUFF(pTrees)->VirtHandlers, true, pgmHandlerVirtualResetOne, pVM);
    954954        pVM->pgm.s.fSyncFlags &= ~PGM_SYNC_UPDATE_PAGE_BIT_VIRTUAL;
    955         STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncCR3HandlerVirtualReset), b);
     955        STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3HandlerVirtualReset), b);
    956956    }
    957957    pgmUnlock(pVM);
  • trunk/src/VBox/VMM/VMMGC/PGMGC.cpp

    r13060 r13067  
    177177    LogFlow(("PGMGCInvalidatePage: GCPtrPage=%VGv\n", GCPtrPage));
    178178
    179     STAM_PROFILE_START(&CTXMID(pVM->pgm.s.Stat,InvalidatePage), a);
     179    STAM_PROFILE_START(&pVM->pgm.s.StatGCInvalidatePage, a);
    180180
    181181    /*
     
    189189            LogFlow(("PGMGCInvalidatePage: Conflict!\n"));
    190190            VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
    191             STAM_PROFILE_STOP(&CTXMID(pVM->pgm.s.Stat,InvalidatePage), a);
     191            STAM_PROFILE_STOP(&pVM->pgm.s.StatGCInvalidatePage, a);
    192192            return VINF_PGM_SYNC_CR3;
    193193        }
     
    196196        {
    197197            LogFlow(("PGMGCInvalidatePage: PGM_SYNC_MONITOR_CR3 -> reinterpret instruction in HC\n"));
    198             STAM_PROFILE_STOP(&CTXMID(pVM->pgm.s.Stat,InvalidatePage), a);
     198            STAM_PROFILE_STOP(&pVM->pgm.s.StatGCInvalidatePage, a);
    199199            /** @todo counter for these... */
    200200            return VINF_EM_RAW_EMULATE_INSTR;
     
    210210        rc = PGM_BTH_PFN(InvalidatePage, pVM)(pVM, GCPtrPage);
    211211
    212     STAM_PROFILE_STOP(&CTXMID(pVM->pgm.s.Stat,InvalidatePage), a);
     212    STAM_PROFILE_STOP(&pVM->pgm.s.StatGCInvalidatePage, a);
    213213    return rc;
    214214}
  • trunk/src/VBox/VMM/VMMR0/PGMR0.cpp

    r13038 r13067  
    8484    LogFlow(("PGMTrap0eHandler: uErr=%#x pvFault=%VGp eip=%VGv\n", uErr, pvFault, pRegFrame->rip));
    8585    STAM_PROFILE_START(&pVM->pgm.s.StatGCTrap0e, a);
    86     STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = NULL; } );
     86    STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = NULL; } );
    8787
    8888    /* AMD uses the host's paging mode; Intel has a single mode (EPT). */
     
    158158    if (rc == VINF_PGM_SYNCPAGE_MODIFIED_PDE)
    159159        rc = VINF_SUCCESS;
    160     STAM_STATS({ if (!pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution))
    161                     pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eMisc; });
    162     STAM_PROFILE_STOP_EX(&pVM->pgm.s.StatGCTrap0e, pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution), a);
     160    STAM_STATS({ if (!pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution))
     161                    pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatTrap0eMisc; });
     162    STAM_PROFILE_STOP_EX(&pVM->pgm.s.StatGCTrap0e, pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution), a);
    163163    return rc;
    164164}
  • trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp

    r13062 r13067  
    419419    GEN_CHECK_OFF(PGM, pfnR3ShwGetPage);
    420420    GEN_CHECK_OFF(PGM, pfnR3ShwModifyPage);
    421     GEN_CHECK_OFF(PGM, pfnGCShwGetPage);
    422     GEN_CHECK_OFF(PGM, pfnGCShwModifyPage);
     421    GEN_CHECK_OFF(PGM, pfnRCShwGetPage);
     422    GEN_CHECK_OFF(PGM, pfnRCShwModifyPage);
    423423    GEN_CHECK_OFF(PGM, pfnR3GstRelocate);
    424424    GEN_CHECK_OFF(PGM, pfnR3GstExit);
     
    430430    GEN_CHECK_OFF(PGM, pfnR3GstModifyPage);
    431431    GEN_CHECK_OFF(PGM, pfnR3GstGetPDE);
    432     GEN_CHECK_OFF(PGM, pfnGCGstGetPage);
    433     GEN_CHECK_OFF(PGM, pfnGCGstModifyPage);
    434     GEN_CHECK_OFF(PGM, pfnGCGstGetPDE);
     432    GEN_CHECK_OFF(PGM, pfnRCGstGetPage);
     433    GEN_CHECK_OFF(PGM, pfnRCGstModifyPage);
     434    GEN_CHECK_OFF(PGM, pfnRCGstGetPDE);
    435435    GEN_CHECK_OFF(PGM, pfnR3BthRelocate);
    436436    GEN_CHECK_OFF(PGM, pfnR3BthSyncCR3);
    437     GEN_CHECK_OFF(PGM, pfnR3BthTrap0eHandler);
    438437    GEN_CHECK_OFF(PGM, pfnR3BthInvalidatePage);
    439438    GEN_CHECK_OFF(PGM, pfnR3BthSyncPage);
     
    441440    GEN_CHECK_OFF(PGM, pfnR3BthVerifyAccessSyncPage);
    442441    GEN_CHECK_OFF(PGM, pfnR3BthAssertCR3);
    443     GEN_CHECK_OFF(PGM, pfnGCBthTrap0eHandler);
    444     GEN_CHECK_OFF(PGM, pfnGCBthInvalidatePage);
    445     GEN_CHECK_OFF(PGM, pfnGCBthSyncPage);
    446     GEN_CHECK_OFF(PGM, pfnGCBthPrefetchPage);
    447     GEN_CHECK_OFF(PGM, pfnGCBthVerifyAccessSyncPage);
    448     GEN_CHECK_OFF(PGM, pfnGCBthAssertCR3);
     442    GEN_CHECK_OFF(PGM, pfnRCBthTrap0eHandler);
     443    GEN_CHECK_OFF(PGM, pfnRCBthInvalidatePage);
     444    GEN_CHECK_OFF(PGM, pfnRCBthSyncPage);
     445    GEN_CHECK_OFF(PGM, pfnRCBthPrefetchPage);
     446    GEN_CHECK_OFF(PGM, pfnRCBthVerifyAccessSyncPage);
     447    GEN_CHECK_OFF(PGM, pfnRCBthAssertCR3);
    449448    GEN_CHECK_OFF(PGM, pRamRangesR3);
    450449    GEN_CHECK_OFF(PGM, pRamRangesR0);
     
    517516    GEN_CHECK_OFF(PGM, cGuestModeChanges);
    518517#ifdef VBOX_WITH_STATISTICS
    519     GEN_CHECK_OFF(PGM, pStatTrap0eAttributionHC);
     518    GEN_CHECK_OFF(PGM, pStatTrap0eAttributionR0);
     519    GEN_CHECK_OFF(PGM, pStatTrap0eAttributionRC);
    520520#endif
    521521
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