Changeset 60682 in vbox for trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Timestamp:
- Apr 24, 2016 6:56:17 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 106850
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r60676 r60682 87 87 bs3-cmn-PagingInitRootForLM.c \ 88 88 bs3-cmn-PagingProtect.c \ 89 bs3-cmn-PagingSetupCanonicalTraps.c \ 89 90 bs3-cmn-PicMaskAll.c \ 90 91 bs3-cmn-RegCtxRestore.asm \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingData.c
r60311 r60682 42 42 uint32_t g_PhysPagingRootLM = UINT32_MAX; 43 43 44 uint32_t g_uBs3PagingCanonicalTrapsAddr = UINT32_MAX; 45 uint16_t g_cbBs3PagingCanonicalTraps = 0; 46 uint16_t g_cbBs3PagingOneCanonicalTrap = 0; 47 44 48 #endif 45 49 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingProtect.c
r60678 r60682 93 93 { 94 94 if (pPD->a[iPde].u <= uMaxAddr) 95 {96 95 pPTE = &((X86PT BS3_FAR *)Bs3XptrFlatToCurrent(pPD->a[iPde].u & ~(uint32_t)PAGE_OFFSET_MASK))->a[iPte]; 97 *prc = VINF_SUCCESS;98 }99 96 else 100 97 BS3PAGING_DPRINTF1(("bs3PagingGetLegacyPte: out of range! iPde=%#x: %#x\n", iPde, pPD->a[iPde].u)); … … 122 119 ASMInvalidatePage(uFlat); 123 120 pPTE = &pPT->a[iPte]; 124 *prc = VINF_SUCCESS;125 121 } 126 122 } … … 134 130 135 131 132 /** 133 * Get the PTE for an address, given a PAE or long mode CR3. 134 * 135 * @returns Pointer to the PTE on success, NULL on failure. 136 * @param cr3 The CR3. 137 * @param bMode Indicates whether it's PAE or long mode. 138 * @param uFlat The address for which we want the PTE. 139 * @param fUseInvlPg Whether we can use invalidate page when 140 * replacing large pages. 141 * @param prc Updated only on failure. 142 */ 136 143 #undef bs3PagingGetPte 137 BS3_CMN_DEF(X86PTEPAE BS3_FAR *, bs3PagingGetPte,(RTCCUINTXREG cr3, uint 64_t uFlat, bool fUseInvlPg, int *prc))144 BS3_CMN_DEF(X86PTEPAE BS3_FAR *, bs3PagingGetPte,(RTCCUINTXREG cr3, uint8_t bMode, uint64_t uFlat, bool fUseInvlPg, int *prc)) 138 145 { 139 146 X86PTEPAE BS3_FAR *pPTE = NULL; … … 148 155 { 149 156 X86PDPAE BS3_FAR *pPD; 150 if (BS3_MODE_IS_64BIT_SYS( g_bBs3CurrentMode))157 if (BS3_MODE_IS_64BIT_SYS(bMode)) 151 158 { 152 159 unsigned const iPml4e = (uFlat >> X86_PML4_SHIFT) & X86_PML4_MASK; … … 206 213 { 207 214 if ((pPD->a[iPde].u & X86_PDE_PAE_PG_MASK) <= uMaxAddr) 208 {209 215 pPTE = &((X86PTPAE BS3_FAR *)Bs3XptrFlatToCurrent(pPD->a[iPde].u & ~(uint64_t)PAGE_OFFSET_MASK))->a[iPte]; 210 *prc = VINF_SUCCESS;211 }212 216 else 213 217 BS3PAGING_DPRINTF1(("bs3PagingGetPte: out of range! iPde=%#x: %RX64 max=%RX32\n", … … 233 237 ASMInvalidatePage(uFlat); 234 238 pPTE = &pPT->a[iPte]; 235 *prc = VINF_SUCCESS;236 239 } 237 240 } … … 304 307 while (cb > 0) 305 308 { 306 PX86PTEPAE pPte = BS3_CMN_FAR_NM(bs3PagingGetPte)(cr3, uFlat, fUseInvlPg, &rc);309 PX86PTEPAE pPte = BS3_CMN_FAR_NM(bs3PagingGetPte)(cr3, g_bBs3CurrentMode, uFlat, fUseInvlPg, &rc); 307 310 if (!pPte) 308 311 return rc; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSub.c
r60527 r60682 53 53 g_cusBs3SubTestAtErrors = g_cusBs3TestErrors; 54 54 BS3_ASSERT(!g_fbBs3SubTestSkipped); 55 g_cusBs3SubTests++; 55 56 56 57 /* -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-paging.h
r60311 r60682 31 31 #include <iprt/asm.h> 32 32 33 RT_C_DECLS_BEGIN ;33 RT_C_DECLS_BEGIN 34 34 35 35 /** Root directory for page protected mode. 36 36 * UINT32_MAX if not initialized. */ 37 #ifndef DOXYGEN_RUNNING38 # define g_PhysPagingRootPP BS3_DATA_NM(g_PhysPagingRootPP)39 #endif40 37 extern uint32_t g_PhysPagingRootPP; 41 38 /** Root directory pointer table for PAE mode. 42 39 * UINT32_MAX if not initialized. */ 43 #ifndef DOXYGEN_RUNNING44 # define g_PhysPagingRootPAE BS3_DATA_NM(g_PhysPagingRootPAE)45 #endif46 40 extern uint32_t g_PhysPagingRootPAE; 47 41 /** Root table (level 4) for long mode. 48 42 * UINT32_MAX if not initialized. */ 49 #ifndef DOXYGEN_RUNNING50 # define g_PhysPagingRootLM BS3_DATA_NM(g_PhysPagingRootLM)51 #endif52 43 extern uint32_t g_PhysPagingRootLM; 53 44 54 RT_C_DECLS_END; 45 #undef bs3PagingGetLegacyPte 46 BS3_CMN_PROTO_STUB(X86PTE BS3_FAR *, bs3PagingGetLegacyPte,(RTCCUINTXREG cr3, uint32_t uFlat, bool fUseInvlPg, int *prc)); 47 #undef bs3PagingGetPte 48 BS3_CMN_PROTO_STUB(X86PTEPAE BS3_FAR *, bs3PagingGetPte,(RTCCUINTXREG cr3, uint8_t bMode, uint64_t uFlat, 49 bool fUseInvlPg, int *prc)); 55 50 51 RT_C_DECLS_END 56 52 57 #define bs3PagingGetLegacyPte BS3_CMN_NM(bs3PagingGetLegacyPte) 58 BS3_DECL(X86PTE BS3_FAR *) bs3PagingGetLegacyPte(RTCCUINTXREG cr3, uint32_t uFlat, bool fUseInvlPg, int *prc); 59 60 #define bs3PagingGetPte BS3_CMN_NM(bs3PagingGetPte) 61 BS3_DECL(X86PTEPAE BS3_FAR *) bs3PagingGetPte(RTCCUINTXREG cr3, uint64_t uFlat, bool fUseInvlPg, int *prc); 62 53 #include "bs3kit-mangling-code.h" 63 54 64 55 #endif -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk
r60676 r60682 61 61 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemMove) 62 62 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemPCpy) 63 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingSetupCanonicalTraps) 63 64 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAlloc) 64 65 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAllocEx) … … 109 110 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3UInt32Div) 110 111 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3UInt64Div) 112 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,bs3PagingGetLegacyPte) 113 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,bs3PagingGetPte) 111 114 $(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,Bs3TrapInit) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h
r60676 r60682 47 47 #define Bs3MemSet BS3_CMN_MANGLER(Bs3MemSet) 48 48 #define Bs3MemZero BS3_CMN_MANGLER(Bs3MemZero) 49 #define bs3PagingGetLegacyPte BS3_CMN_MANGLER(bs3PagingGetLegacyPte) 50 #define bs3PagingGetPte BS3_CMN_MANGLER(bs3PagingGetPte) 49 51 #define Bs3PagingInitRootForLM BS3_CMN_MANGLER(Bs3PagingInitRootForLM) 50 52 #define Bs3PagingInitRootForPAE BS3_CMN_MANGLER(Bs3PagingInitRootForPAE) … … 52 54 #define Bs3PagingProtect BS3_CMN_MANGLER(Bs3PagingProtect) 53 55 #define Bs3PagingProtectPtr BS3_CMN_MANGLER(Bs3PagingProtectPtr) 56 #define Bs3PagingSetupCanonicalTraps BS3_CMN_MANGLER(Bs3PagingSetupCanonicalTraps) 54 57 #define Bs3Panic BS3_CMN_MANGLER(Bs3Panic) 55 58 #define Bs3PicMaskAll BS3_CMN_MANGLER(Bs3PicMaskAll) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
r60676 r60682 47 47 #undef Bs3MemSet 48 48 #undef Bs3MemZero 49 #undef bs3PagingGetLegacyPte 50 #undef bs3PagingGetPte 49 51 #undef Bs3PagingInitRootForLM 50 52 #undef Bs3PagingInitRootForPAE … … 52 54 #undef Bs3PagingProtect 53 55 #undef Bs3PagingProtectPtr 56 #undef Bs3PagingSetupCanonicalTraps 54 57 #undef Bs3Panic 55 58 #undef Bs3PicMaskAll -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r60681 r60682 2137 2137 BS3_CMN_PROTO_STUB(int, Bs3PagingProtectPtr,(void BS3_FAR *pv, size_t cb, uint64_t fSet, uint64_t fClear)); 2138 2138 2139 /** The physical / flat address of the buffer backing the canonical traps. 2140 * This buffer is spread equally on each side of the 64-bit non-canonical 2141 * address divide. Non-64-bit code can use this to setup trick shots and 2142 * inspect their results. */ 2143 extern uint32_t g_uBs3PagingCanonicalTrapsAddr; 2144 /** The size of the buffer at g_uPagingCanonicalTraps (both sides). */ 2145 extern uint16_t g_cbBs3PagingCanonicalTraps; 2146 /** The size of one trap buffer (low or high). 2147 * This is g_cbBs3PagingCanonicalTraps divided by two. */ 2148 extern uint16_t g_cbBs3PagingOneCanonicalTrap; 2149 2150 /** 2151 * Sets up the 64-bit canonical address space trap buffers, if neceessary. 2152 * 2153 * @returns Pointer to the buffers (i.e. the first page of the low one) on 2154 * success. NULL on failure. 2155 */ 2156 BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3PagingSetupCanonicalTraps,(void)); 2157 2139 2158 /** 2140 2159 * Waits for the keyboard controller to become ready.
Note:
See TracChangeset
for help on using the changeset viewer.