Changeset 72254 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 18, 2018 7:28:30 AM (7 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
r69111 r72254 402 402 */ 403 403 int rc = DBGFRZTrap01Handler(pVM, pVCpu, pRegFrame, uDr6, false /*fAltStepping*/); 404 AssertStmt(rc != VINF_EM_RAW_GUEST_TRAP, rc = VERR_TRPM_IPE_1);405 404 if (rc == VINF_EM_DBG_STEPPED) 406 405 pRegFrame->eflags.Bits.u1TF = 0; -
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlersA.asm
r69221 r72254 156 156 ALIGNCODE(16) 157 157 BEGINPROC_EXPORTED TRPMGCHandlerGeneric 158 %macro TRPMGenericEntry 1 158 %macro TRPMGenericEntry 2 159 EXPORTEDNAME_EX RT_CONCAT(TRPMRCHandlerAsmTrap,%2), function 159 160 db 06ah, i ; push imm8 - note that this is a signextended value. 160 161 jmp %1 … … 163 164 %endmacro 164 165 165 %assign i 0 ; start counter.166 TRPMGenericEntry GenericTrap ; 0167 TRPMGenericEntry GenericTrap ; 1168 TRPMGenericEntry GenericTrap ; 2169 TRPMGenericEntry GenericTrap ; 3170 TRPMGenericEntry GenericTrap ; 4171 TRPMGenericEntry GenericTrap ; 5172 TRPMGenericEntry GenericTrap ; 6173 TRPMGenericEntry GenericTrap ; 7174 TRPMGenericEntry GenericTrapErrCode ; 8175 TRPMGenericEntry GenericTrap ; 9176 TRPMGenericEntry GenericTrapErrCode ; a177 TRPMGenericEntry GenericTrapErrCode ; b178 TRPMGenericEntry GenericTrapErrCode ; c179 TRPMGenericEntry GenericTrapErrCode ; d180 TRPMGenericEntry GenericTrapErrCode ; e181 TRPMGenericEntry GenericTrap ; f (reserved)182 TRPMGenericEntry GenericTrap ; 10183 TRPMGenericEntry GenericTrapErrCode ; 11184 TRPMGenericEntry GenericTrap ; 12185 TRPMGenericEntry GenericTrap ; 13186 TRPMGenericEntry GenericTrap ; 14 (reserved)187 TRPMGenericEntry GenericTrap ; 15 (reserved)188 TRPMGenericEntry GenericTrap ; 16 (reserved)189 TRPMGenericEntry GenericTrap ; 17 (reserved)166 %assign i 0 ; start counter. 167 TRPMGenericEntry GenericTrap , 00 ; 0 168 TRPMGenericEntry GenericTrap , 01 ; 1 169 TRPMGenericEntry GenericTrap , 02 ; 2 170 TRPMGenericEntry GenericTrap , 03 ; 3 171 TRPMGenericEntry GenericTrap , 04 ; 4 172 TRPMGenericEntry GenericTrap , 05 ; 5 173 TRPMGenericEntry GenericTrap , 06 ; 6 174 TRPMGenericEntry GenericTrap , 07 ; 7 175 TRPMGenericEntry GenericTrapErrCode, 08 ; 8 176 TRPMGenericEntry GenericTrap , 09 ; 9 177 TRPMGenericEntry GenericTrapErrCode, 0a ; a 178 TRPMGenericEntry GenericTrapErrCode, 0b ; b 179 TRPMGenericEntry GenericTrapErrCode, 0c ; c 180 TRPMGenericEntry GenericTrapErrCode, 0d ; d 181 TRPMGenericEntry GenericTrapErrCode, 0e ; e 182 TRPMGenericEntry GenericTrap , 0f ; f (reserved) 183 TRPMGenericEntry GenericTrap , 10 ; 10 184 TRPMGenericEntry GenericTrapErrCode, 11 ; 11 185 TRPMGenericEntry GenericTrap , 12 ; 12 186 TRPMGenericEntry GenericTrap , 13 ; 13 187 TRPMGenericEntry GenericTrap , 14 ; 14 (reserved) 188 TRPMGenericEntry GenericTrap , 15 ; 15 (reserved) 189 TRPMGenericEntry GenericTrap , 16 ; 16 (reserved) 190 TRPMGenericEntry GenericTrap , 17 ; 17 (reserved) 190 191 %undef i 191 192 %undef TRPMGenericEntry … … 614 615 cmp eax, VINF_EM_DBG_HYPER_ASSERTION 615 616 je short .rc_to_host 617 cmp eax, VINF_EM_RAW_GUEST_TRAP ; Special #DB case, see bugref:9171. 618 je short .rc_to_host 616 619 jmp .rc_abandon_ship 617 620 -
trunk/src/VBox/VMM/VMMRZ/DBGFRZ.cpp
r69111 r72254 23 23 #include <VBox/vmm/dbgf.h> 24 24 #include <VBox/vmm/selm.h> 25 #ifdef IN_RC 26 # include <VBox/vmm/trpm.h> 27 #endif 25 28 #include <VBox/log.h> 26 29 #include "DBGFInternal.h" … … 29 32 #include <iprt/assert.h> 30 33 34 #ifdef IN_RC 35 DECLASM(void) TRPMRCHandlerAsmTrap03(void); 36 #endif 31 37 32 38 … … 88 94 } 89 95 96 #ifdef IN_RC 90 97 /* 91 98 * Either an ICEBP in hypervisor code or a guest related debug exception … … 94 101 if (RT_UNLIKELY(fInHyper)) 95 102 { 96 LogFlow(("DBGFRZTrap01Handler: unabled bp at %04x:%RGv\n", pRegFrame->cs.Sel, pRegFrame->rip)); 103 /* 104 * Is this a guest debug event that was delayed past a ring transition? 105 * 106 * Since we do no allow sysenter/syscall in raw-mode, the only 107 * non-trap/fault type transitions that can occur are thru interrupt gates. 108 * Of those, only INT3 (#BP) has a DPL other than 0 with a CS.RPL of 0. 109 * See bugref:9171 and bs3-cpu-weird-1 for more details. 110 * 111 * We need to reconstruct the guest register state from the hypervisor one 112 * here, so here is the layout of the IRET frame on the stack: 113 * 20:[8] GS (V86 only) 114 * 1C:[7] FS (V86 only) 115 * 18:[6] DS (V86 only) 116 * 14:[5] ES (V86 only) 117 * 10:[4] SS 118 * 0c:[3] ESP 119 * 08:[2] EFLAGS 120 * 04:[1] CS 121 * 00:[0] EIP 122 */ 123 if (pRegFrame->rip == (uintptr_t)TRPMRCHandlerAsmTrap03) 124 { 125 uint32_t const *pu32Stack = (uint32_t const *)pRegFrame->esp; 126 if ( (pu32Stack[2] & X86_EFL_VM) 127 || (pu32Stack[1] & X86_SEL_RPL)) 128 { 129 LogFlow(("DBGFRZTrap01Handler: Detected guest #DB delayed past ring transition %04x:%RX32 %#x\n", 130 pu32Stack[1] & 0xffff, pu32Stack[0], pu32Stack[2])); 131 PCPUMCTX pGstCtx = CPUMQueryGuestCtxPtr(pVCpu); 132 pGstCtx->rip = pu32Stack[0]; 133 pGstCtx->cs.Sel = pu32Stack[1]; 134 pGstCtx->eflags.u = pu32Stack[2]; 135 pGstCtx->rsp = pu32Stack[3]; 136 pGstCtx->ss.Sel = pu32Stack[4]; 137 if (pu32Stack[2] & X86_EFL_VM) 138 { 139 pGstCtx->es.Sel = pu32Stack[5]; 140 pGstCtx->ds.Sel = pu32Stack[6]; 141 pGstCtx->fs.Sel = pu32Stack[7]; 142 pGstCtx->gs.Sel = pu32Stack[8]; 143 } 144 else 145 { 146 pGstCtx->es.Sel = pRegFrame->es.Sel; 147 pGstCtx->ds.Sel = pRegFrame->ds.Sel; 148 pGstCtx->fs.Sel = pRegFrame->fs.Sel; 149 pGstCtx->gs.Sel = pRegFrame->gs.Sel; 150 } 151 pGstCtx->rax = pRegFrame->rax; 152 pGstCtx->rcx = pRegFrame->rcx; 153 pGstCtx->rdx = pRegFrame->rdx; 154 pGstCtx->rbx = pRegFrame->rbx; 155 pGstCtx->rsi = pRegFrame->rsi; 156 pGstCtx->rdi = pRegFrame->rdi; 157 pGstCtx->rbp = pRegFrame->rbp; 158 159 /* 160 * We should assert a #BP followed by a #DB here, but TRPM cannot 161 * do that. So, we'll just assert the #BP and ignore the #DB, even 162 * if that isn't strictly correct. 163 */ 164 TRPMResetTrap(pVCpu); 165 TRPMAssertTrap(pVCpu, X86_XCPT_BP, TRPM_SOFTWARE_INT); 166 return VINF_EM_RAW_GUEST_TRAP; 167 } 168 } 169 170 LogFlow(("DBGFRZTrap01Handler: Unknown bp at %04x:%RGv\n", pRegFrame->cs.Sel, pRegFrame->rip)); 97 171 return VERR_DBGF_HYPER_DB_XCPT; 98 172 } 173 #endif 99 174 100 175 LogFlow(("DBGFRZTrap01Handler: guest debug event %#x at %04x:%RGv!\n", (uint32_t)uDr6, pRegFrame->cs.Sel, pRegFrame->rip));
Note:
See TracChangeset
for help on using the changeset viewer.