- Timestamp:
- Aug 7, 2019 9:41:39 AM (5 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r80163 r80174 1889 1889 * Note! The sizes used here will influence the saved state. 1890 1890 */ 1891 uint32_t cbChunk; 1892 uint32_t cPagesPerChunk; 1893 if (!VM_IS_RAW_MODE_ENABLED(pVM)) 1894 { 1895 cbChunk = 16U*_1M; 1896 cPagesPerChunk = 1048048; /* max ~1048059 */ 1897 AssertCompile(sizeof(PGMRAMRANGE) + sizeof(PGMPAGE) * 1048048 < 16U*_1M - PAGE_SIZE * 2); 1898 } 1899 else 1900 { 1901 cbChunk = 4U*_1M; 1902 cPagesPerChunk = 261616; /* max ~261627 */ 1903 AssertCompile(sizeof(PGMRAMRANGE) + sizeof(PGMPAGE) * 261616 < 4U*_1M - PAGE_SIZE * 2); 1904 } 1891 uint32_t cbChunk = 16U*_1M; 1892 uint32_t cPagesPerChunk = 1048048; /* max ~1048059 */ 1893 AssertCompile(sizeof(PGMRAMRANGE) + sizeof(PGMPAGE) * 1048048 < 16U*_1M - PAGE_SIZE * 2); 1905 1894 AssertRelease(RT_UOFFSETOF_DYN(PGMRAMRANGE, aPages[cPagesPerChunk]) + PAGE_SIZE * 2 <= cbChunk); 1906 1895 … … 2715 2704 * us with an absolute maximum of 16777215 pages per chunk (close to 64 GB). 2716 2705 */ 2717 uint32_t cbChunk; 2718 uint32_t cPagesPerChunk; 2719 if (!VM_IS_RAW_MODE_ENABLED(pVM)) 2720 { 2721 cbChunk = 16U*_1M; 2722 cPagesPerChunk = 1048048; /* max ~1048059 */ 2723 AssertCompile(sizeof(PGMREGMMIORANGE) + sizeof(PGMPAGE) * 1048048 < 16U*_1M - PAGE_SIZE * 2); 2724 } 2725 else 2726 { 2727 cbChunk = 4U*_1M; 2728 cPagesPerChunk = 261616; /* max ~261627 */ 2729 AssertCompile(sizeof(PGMREGMMIORANGE) + sizeof(PGMPAGE) * 261616 < 4U*_1M - PAGE_SIZE * 2); 2730 } 2706 uint32_t cbChunk = 16U*_1M; 2707 uint32_t cPagesPerChunk = 1048048; /* max ~1048059 */ 2708 AssertCompile(sizeof(PGMREGMMIORANGE) + sizeof(PGMPAGE) * 1048048 < 16U*_1M - PAGE_SIZE * 2); 2731 2709 AssertRelease(cPagesPerChunk <= PGM_MMIO2_MAX_PAGE_COUNT); /* See above note. */ 2732 2710 AssertRelease(RT_UOFFSETOF_DYN(PGMREGMMIORANGE, RamRange.aPages[cPagesPerChunk]) + PAGE_SIZE * 2 <= cbChunk); -
trunk/src/VBox/VMM/include/PGMInternal.h
r80172 r80174 1116 1116 #define PGM_PAGE_HAS_ACTIVE_PHYSICAL_HANDLERS(a_pPage) \ 1117 1117 ( PGM_PAGE_GET_HNDL_PHYS_STATE(a_pPage) >= PGM_PAGE_HNDL_PHYS_STATE_WRITE ) 1118 1119 1120 /** @name Virtual Access Handler State values (PGMPAGE::u2HandlerVirtStateY).1121 *1122 * @remarks The values are assigned in order of priority, so we can calculate1123 * the correct state for a page with different handlers installed.1124 * @{ */1125 /** No handler installed. */1126 #define PGM_PAGE_HNDL_VIRT_STATE_NONE 01127 /* 1 is reserved so the lineup is identical with the physical ones. */1128 /** Write access is monitored. */1129 #define PGM_PAGE_HNDL_VIRT_STATE_WRITE 21130 /** All access is monitored. */1131 #define PGM_PAGE_HNDL_VIRT_STATE_ALL 31132 /** @} */1133 1134 /**1135 * Gets the virtual access handler state of a page.1136 * @returns PGM_PAGE_HNDL_VIRT_STATE_* value.1137 * @param a_pPage Pointer to the physical guest page tracking structure.1138 */1139 #define PGM_PAGE_GET_HNDL_VIRT_STATE(a_pPage) ( (a_pPage)->s.u2HandlerVirtStateY )1140 1141 /**1142 * Sets the virtual access handler state of a page.1143 * @param a_pPage Pointer to the physical guest page tracking structure.1144 * @param a_uState The new state value.1145 */1146 #define PGM_PAGE_SET_HNDL_VIRT_STATE(a_pPage, a_uState) \1147 do { (a_pPage)->s.u2HandlerVirtStateY = (a_uState); } while (0)1148 1149 /**1150 * Same as PGM_PAGE_HAS_ANY_VIRTUAL_HANDLERS - can't disable pages in1151 * virtual handlers.1152 * @returns true/false1153 * @param a_pPage Pointer to the physical guest page tracking structure.1154 */1155 #define PGM_PAGE_HAS_ACTIVE_VIRTUAL_HANDLERS(a_pPage) \1156 PGM_PAGE_HAS_ANY_VIRTUAL_HANDLERS(a_pPage)1157 1118 1158 1119
Note:
See TracChangeset
for help on using the changeset viewer.