Changeset 5342 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Oct 17, 2007 7:30:36 AM (17 years ago)
- Location:
- trunk/src/VBox/VMM/VMMGC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMGC/EMGCA.asm
r4071 r5342 26 26 ;; 27 27 ; Emulate lock CMPXCHG instruction, CDECL calling conv. 28 ; EMGCDECL(uint32_t) EMGCEmulateLockCmpXchg(RTGCPTR pu32Param1, uint32_t *pu32Param2, uint32_t u32Param3, size_t cbSize );28 ; EMGCDECL(uint32_t) EMGCEmulateLockCmpXchg(RTGCPTR pu32Param1, uint32_t *pu32Param2, uint32_t u32Param3, size_t cbSize, uint32_t *pEflags); 29 29 ; 30 ; @returns EFLAGS after the operation, only arithmetic flags is valid.30 ; @returns eax=0 if data written, other code - invalid access, #PF was generated. 31 31 ; @param [esp + 04h] Param 1 - First parameter - pointer to first parameter 32 32 ; @param [esp + 08h] Param 2 - Second parameter - pointer to second parameter (eax) 33 33 ; @param [esp + 0ch] Param 3 - Third parameter - third parameter 34 34 ; @param [esp + 10h] Param 4 - Size of parameters, only 1/2/4 is valid. 35 ; @param [esp + 14h] Param 4 - Pointer to eflags (out) 35 36 ; @uses eax, ecx, edx 36 37 ; … … 79 80 pop eax 80 81 82 mov edx, [esp + 14h + 4] ; eflags pointer 83 mov dword [edx], eax 84 81 85 pop ebx 86 mov eax, VINF_SUCCESS 82 87 retn 88 89 ; Read error - we will be here after our page fault handler. 90 GLOBALNAME EMGCEmulateLockCmpXchg_Error 91 pop ebx 92 mov eax, VERR_ACCESS_DENIED 93 ret 94 83 95 ENDPROC EMGCEmulateLockCmpXchg 84 96 85 97 ;; 86 98 ; Emulate CMPXCHG instruction, CDECL calling conv. 87 ; EMGCDECL(uint32_t) EMGCEmulateCmpXchg(RTGCPTR pu32Param1, uint32_t *pu32Param2, uint32_t u32Param3, size_t cbSize );99 ; EMGCDECL(uint32_t) EMGCEmulateCmpXchg(RTGCPTR pu32Param1, uint32_t *pu32Param2, uint32_t u32Param3, size_t cbSize, uint32_t *pEflags); 88 100 ; 89 ; @returns EFLAGS after the operation, only arithmetic flags is valid.101 ; @returns eax=0 if data written, other code - invalid access, #PF was generated. 90 102 ; @param [esp + 04h] Param 1 - First parameter - pointer to first parameter 91 103 ; @param [esp + 08h] Param 2 - Second parameter - pointer to second parameter (eax) 92 104 ; @param [esp + 0ch] Param 3 - Third parameter - third parameter 93 105 ; @param [esp + 10h] Param 4 - Size of parameters, only 1/2/4 is valid. 106 ; @param [esp + 14h] Param 4 - Pointer to eflags (out) 94 107 ; @uses eax, ecx, edx 95 108 ; … … 138 151 pop eax 139 152 153 mov edx, [esp + 14h + 4] ; eflags pointer 154 mov dword [edx], eax 155 140 156 pop ebx 157 mov eax, VINF_SUCCESS 141 158 retn 159 160 ; Read error - we will be here after our page fault handler. 161 GLOBALNAME EMGCEmulateCmpXchg_Error 162 pop ebx 163 mov eax, VERR_ACCESS_DENIED 164 ret 142 165 ENDPROC EMGCEmulateCmpXchg -
trunk/src/VBox/VMM/VMMGC/MMRamGC.cpp
r4071 r5342 24 24 #include <VBox/cpum.h> 25 25 #include <VBox/trpm.h> 26 #include <VBox/em.h> 26 27 #include "MMInternal.h" 27 28 #include <VBox/vm.h> … … 40 41 DECLASM(void) MMGCRamReadNoTrapHandler_EndProc(void); 41 42 DECLASM(void) MMGCRamWriteNoTrapHandler_EndProc(void); 42 43 DECLASM(void) EMGCEmulateCmpXchg_EndProc(void); 44 DECLASM(void) EMGCEmulateLockCmpXchg_EndProc(void); 45 DECLASM(void) EMGCEmulateCmpXchg_Error(void); 46 DECLASM(void) EMGCEmulateLockCmpXchg_Error(void); 43 47 DECLASM(void) MMGCRamRead_Error(void); 44 48 DECLASM(void) MMGCRamWrite_Error(void); … … 166 170 return VINF_SUCCESS; 167 171 } 172 else if ( (uintptr_t)&EMGCEmulateLockCmpXchg < (uintptr_t)pRegFrame->eip 173 && (uintptr_t)pRegFrame->eip < (uintptr_t)&EMGCEmulateLockCmpXchg_EndProc) 174 { 175 /* 176 * Page fault inside EMGCEmulateLockCmpXchg() func. 177 */ 178 179 /* Return execution to func at error label. */ 180 pRegFrame->eip = (uintptr_t)&EMGCEmulateLockCmpXchg_Error; 181 return VINF_SUCCESS; 182 } 183 else if ( (uintptr_t)&EMGCEmulateCmpXchg < (uintptr_t)pRegFrame->eip 184 && (uintptr_t)pRegFrame->eip < (uintptr_t)&EMGCEmulateCmpXchg_EndProc) 185 { 186 /* 187 * Page fault inside EMGCEmulateCmpXchg() func. 188 */ 189 190 /* Return execution to func at error label. */ 191 pRegFrame->eip = (uintptr_t)&EMGCEmulateCmpXchg_Error; 192 return VINF_SUCCESS; 193 } 168 194 169 195 /* #PF is not handled - kill the Hypervisor. */
Note:
See TracChangeset
for help on using the changeset viewer.