Changeset 61628 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 9, 2016 5:52:51 PM (9 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp
r59073 r61628 299 299 * @returns Strict VBox status code. 300 300 * @retval VINF_EM_DBG_EVENT if the event was raised and the caller should 301 * return ASAP to the debugger (via EM). 301 * return ASAP to the debugger (via EM). We set VMCPU_FF_DBGF so, it 302 * is okay not to pass this along in some situations . 302 303 * @retval VINF_SUCCESS if the event was disabled or ignored. 303 304 * … … 370 371 pVCpu->dbgf.s.cEvents = i + 1; 371 372 373 VMCPU_FF_SET(pVCpu, VMCPU_FF_DBGF); 372 374 return VINF_EM_DBG_EVENT; 373 375 } -
trunk/src/VBox/VMM/VMMAll/GIMAllHv.cpp
r61559 r61628 21 21 *********************************************************************************************************************************/ 22 22 #define LOG_GROUP LOG_GROUP_GIM 23 #include <VBox/vmm/em.h> 24 #include <VBox/vmm/hm.h> 25 #include <VBox/vmm/tm.h> 26 #include <VBox/vmm/dbgf.h> 27 #include <VBox/vmm/pgm.h> 23 28 #include "GIMHvInternal.h" 24 29 #include "GIMInternal.h" 30 #include <VBox/vmm/vm.h> 31 32 #include <VBox/vmm/pdmdev.h> 33 #include <VBox/vmm/pdmapi.h> 34 #include <VBox/err.h> 25 35 26 36 #include <iprt/asm-amd64-x86.h> … … 28 38 # include <iprt/mem.h> 29 39 #endif 30 31 #include <VBox/err.h>32 #include <VBox/vmm/em.h>33 #include <VBox/vmm/hm.h>34 #include <VBox/vmm/tm.h>35 #include <VBox/vmm/vm.h>36 #include <VBox/vmm/pgm.h>37 #include <VBox/vmm/pdmdev.h>38 #include <VBox/vmm/pdmapi.h>39 40 40 41 … … 726 727 LogRel(("GIM: HyperV: Guest indicates a fatal condition! P0=%#RX64 P1=%#RX64 P2=%#RX64 P3=%#RX64 P4=%#RX64\n", 727 728 pHv->uCrashP0Msr, pHv->uCrashP1Msr, pHv->uCrashP2Msr, pHv->uCrashP3Msr, pHv->uCrashP4Msr)); 729 730 PVM pVM = pVCpu->CTX_SUFF(pVM); 731 if (DBGF_IS_EVENT_ENABLED(pVM, DBGFEVENT_BSOD_MSR)) 732 DBGFEventGenericWithArg(pVM, pVCpu, DBGFEVENT_BSOD_MSR, pHv->uCrashP0Msr, DBGFEVENTCTX_OTHER); 733 /* (Do not try pass VINF_EM_DBG_EVENT, doesn't work from here!) */ 728 734 } 729 735 return VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r60993 r61628 1126 1126 /* Get guest page flags. */ 1127 1127 uint64_t fPageGst; 1128 rc= PGMGstGetPage(pVCpu, pvFault, &fPageGst, NULL);1129 if (RT_SUCCESS(rc ))1128 int rc2 = PGMGstGetPage(pVCpu, pvFault, &fPageGst, NULL); 1129 if (RT_SUCCESS(rc2)) 1130 1130 { 1131 uint64_t fPageShw ;1132 rc = PGMShwGetPage(pVCpu, pvFault, &fPageShw, NULL);1131 uint64_t fPageShw = 0; 1132 rc2 = PGMShwGetPage(pVCpu, pvFault, &fPageShw, NULL); 1133 1133 1134 1134 /* … … 1143 1143 && (fPageShw & (X86_PTE_RW | X86_PTE_US)) == X86_PTE_RW 1144 1144 && (fPageGst & (X86_PTE_RW | X86_PTE_US)) == X86_PTE_US), 1145 ("Page flags mismatch! pvFault=%RGv uErr=%x GCPhys=%RGp fPageShw=%RX64 fPageGst=%RX64 \n",1146 pvFault, (uint32_t)uErr, GCPhys, fPageShw, fPageGst ));1145 ("Page flags mismatch! pvFault=%RGv uErr=%x GCPhys=%RGp fPageShw=%RX64 fPageGst=%RX64 rc=%d\n", 1146 pvFault, (uint32_t)uErr, GCPhys, fPageShw, fPageGst, rc)); 1147 1147 } 1148 1148 else -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r61212 r61628 859 859 * Must do this in raw mode (!); XP boot will fail otherwise. 860 860 */ 861 RTLogPrintf("pgmPoolAccessPfHandlerFlush\n"); 861 862 VBOXSTRICTRC rc2 = EMInterpretInstructionDisasState(pVCpu, pDis, pRegFrame, pvFault, EMCODETYPE_ALL); 862 863 if (rc2 == VINF_SUCCESS) … … 1025 1026 * Interpret the instruction. 1026 1027 */ 1028 RTLogPrintf("pgmPoolAccessPfHandlerSimple\n"); 1027 1029 VBOXSTRICTRC rc = EMInterpretInstructionDisasState(pVCpu, pDis, pRegFrame, pvFault, EMCODETYPE_ALL); 1028 1030 if (RT_SUCCESS(rc)) -
trunk/src/VBox/VMM/VMMR3/DBGF.cpp
r60872 r61628 394 394 /** 395 395 * Forced action callback. 396 * The VMM will call this from it's main loop when VM_FF_DBGF is set. 397 * 398 * The function checks and executes pending commands from the debugger. 396 * 397 * The VMM will call this from it's main loop when either VM_FF_DBGF or 398 * VMCPU_FF_DBGF are set. 399 * 400 * The function checks for and executes pending commands from the debugger. 401 * Then it checks for pending debug events and serves these. 399 402 * 400 403 * @returns VINF_SUCCESS normally. … … 402 405 * @param pVM The cross context VM structure. 403 406 */ 404 VMMR3_INT_DECL(int) DBGFR3VMMForcedAction(PVM pVM )405 { 406 int rc= VINF_SUCCESS;407 VMMR3_INT_DECL(int) DBGFR3VMMForcedAction(PVM pVM, PVMCPU pVCpu) 408 { 409 VBOXSTRICTRC rcStrict = VINF_SUCCESS; 407 410 408 411 if (VM_FF_TEST_AND_CLEAR(pVM, VM_FF_DBGF)) 409 412 { 410 PVMCPU pVCpu = VMMGetCpu(pVM);411 412 413 /* 413 414 * Command pending? Process it. … … 418 419 DBGFCMDDATA CmdData = pVM->dbgf.s.VMMCmdData; 419 420 DBGFCMD enmCmd = dbgfR3SetCmd(pVM, DBGFCMD_NO_COMMAND); 420 rc = dbgfR3VMMCmd(pVM, enmCmd, &CmdData, &fResumeExecution);421 rcStrict = dbgfR3VMMCmd(pVM, enmCmd, &CmdData, &fResumeExecution); 421 422 if (!fResumeExecution) 422 rc = dbgfR3VMMWait(pVM); 423 } 424 } 425 return rc; 423 rcStrict = dbgfR3VMMWait(pVM); 424 } 425 } 426 427 /* 428 * Dispatch pending events. 429 */ 430 if (VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_DBGF)) 431 { 432 if ( pVCpu->dbgf.s.cEvents > 0 433 && pVCpu->dbgf.s.aEvents[pVCpu->dbgf.s.cEvents - 1].enmState == DBGFEVENTSTATE_CURRENT) 434 { 435 VBOXSTRICTRC rcStrict2 = DBGFR3EventHandlePending(pVM, pVCpu); 436 if ( rcStrict2 != VINF_SUCCESS 437 && ( rcStrict == VINF_SUCCESS 438 || RT_FAILURE(rcStrict2) 439 || rcStrict2 < rcStrict) ) /** @todo oversimplified? */ 440 rcStrict = rcStrict2; 441 } 442 } 443 444 return VBOXSTRICTRC_TODO(rcStrict); 426 445 } 427 446 … … 554 573 { 555 574 VMCPU_ASSERT_EMT(pVCpu); 575 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_DBGF); 556 576 557 577 /* … … 567 587 int rc = dbgfR3EventPrologue(pVM, pEvent->enmType); 568 588 if (RT_FAILURE(rc)) 589 { 590 /** @todo drop them events? */ 569 591 return rc; 592 } 570 593 571 594 /** @todo SMP + debugger speaker logic */ -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r61027 r61628 895 895 * Process the result. 896 896 */ 897 do 898 { 899 switch (VBOXSTRICTRC_VAL(rc)) 900 { 901 /* 902 * Continue the debugging loop. 903 */ 904 case VINF_EM_DBG_STEP: 905 case VINF_EM_DBG_STOP: 906 case VINF_EM_DBG_EVENT: 907 case VINF_EM_DBG_STEPPED: 908 case VINF_EM_DBG_BREAKPOINT: 909 case VINF_EM_DBG_HYPER_STEPPED: 910 case VINF_EM_DBG_HYPER_BREAKPOINT: 911 case VINF_EM_DBG_HYPER_ASSERTION: 912 break; 913 914 /* 915 * Resuming execution (in some form) has to be done here if we got 916 * a hypervisor debug event. 917 */ 918 case VINF_SUCCESS: 919 case VINF_EM_RESUME: 920 case VINF_EM_SUSPEND: 921 case VINF_EM_RESCHEDULE: 922 case VINF_EM_RESCHEDULE_RAW: 923 case VINF_EM_RESCHEDULE_REM: 924 case VINF_EM_HALT: 925 if (pVCpu->em.s.enmState == EMSTATE_DEBUG_HYPER) 926 { 897 switch (VBOXSTRICTRC_VAL(rc)) 898 { 899 /* 900 * Continue the debugging loop. 901 */ 902 case VINF_EM_DBG_STEP: 903 case VINF_EM_DBG_STOP: 904 case VINF_EM_DBG_EVENT: 905 case VINF_EM_DBG_STEPPED: 906 case VINF_EM_DBG_BREAKPOINT: 907 case VINF_EM_DBG_HYPER_STEPPED: 908 case VINF_EM_DBG_HYPER_BREAKPOINT: 909 case VINF_EM_DBG_HYPER_ASSERTION: 910 break; 911 912 /* 913 * Resuming execution (in some form) has to be done here if we got 914 * a hypervisor debug event. 915 */ 916 case VINF_SUCCESS: 917 case VINF_EM_RESUME: 918 case VINF_EM_SUSPEND: 919 case VINF_EM_RESCHEDULE: 920 case VINF_EM_RESCHEDULE_RAW: 921 case VINF_EM_RESCHEDULE_REM: 922 case VINF_EM_HALT: 923 if (pVCpu->em.s.enmState == EMSTATE_DEBUG_HYPER) 924 { 927 925 #ifdef VBOX_WITH_RAW_MODE 928 929 930 926 rc = emR3RawResumeHyper(pVM, pVCpu); 927 if (rc != VINF_SUCCESS && RT_SUCCESS(rc)) 928 continue; 931 929 #else 932 AssertLogRelMsgFailedReturn(("Not implemented\n"), VERR_EM_INTERNAL_ERROR); 933 #endif 934 } 935 if (rc == VINF_SUCCESS) 936 rc = VINF_EM_RESCHEDULE; 937 return rc; 938 939 /* 940 * The debugger isn't attached. 941 * We'll simply turn the thing off since that's the easiest thing to do. 942 */ 943 case VERR_DBGF_NOT_ATTACHED: 944 switch (VBOXSTRICTRC_VAL(rcLast)) 945 { 946 case VINF_EM_DBG_HYPER_STEPPED: 947 case VINF_EM_DBG_HYPER_BREAKPOINT: 948 case VINF_EM_DBG_HYPER_ASSERTION: 949 case VERR_TRPM_PANIC: 950 case VERR_TRPM_DONT_PANIC: 951 case VERR_VMM_RING0_ASSERTION: 952 case VERR_VMM_HYPER_CR3_MISMATCH: 953 case VERR_VMM_RING3_CALL_DISABLED: 954 return rcLast; 955 } 956 return VINF_EM_OFF; 957 958 /* 959 * Status codes terminating the VM in one or another sense. 960 */ 961 case VINF_EM_TERMINATE: 962 case VINF_EM_OFF: 963 case VINF_EM_RESET: 964 case VINF_EM_NO_MEMORY: 965 case VINF_EM_RAW_STALE_SELECTOR: 966 case VINF_EM_RAW_IRET_TRAP: 967 case VERR_TRPM_PANIC: 968 case VERR_TRPM_DONT_PANIC: 969 case VERR_IEM_INSTR_NOT_IMPLEMENTED: 970 case VERR_IEM_ASPECT_NOT_IMPLEMENTED: 971 case VERR_VMM_RING0_ASSERTION: 972 case VERR_VMM_HYPER_CR3_MISMATCH: 973 case VERR_VMM_RING3_CALL_DISABLED: 974 case VERR_INTERNAL_ERROR: 975 case VERR_INTERNAL_ERROR_2: 976 case VERR_INTERNAL_ERROR_3: 977 case VERR_INTERNAL_ERROR_4: 978 case VERR_INTERNAL_ERROR_5: 979 case VERR_IPE_UNEXPECTED_STATUS: 980 case VERR_IPE_UNEXPECTED_INFO_STATUS: 981 case VERR_IPE_UNEXPECTED_ERROR_STATUS: 982 return rc; 983 984 /* 985 * The rest is unexpected, and will keep us here. 986 */ 987 default: 988 AssertMsgFailed(("Unexpected rc %Rrc!\n", VBOXSTRICTRC_VAL(rc))); 989 break; 990 } 991 } while (false); 930 AssertLogRelMsgFailedReturn(("Not implemented\n"), VERR_EM_INTERNAL_ERROR); 931 #endif 932 } 933 if (rc == VINF_SUCCESS) 934 rc = VINF_EM_RESCHEDULE; 935 return rc; 936 937 /* 938 * The debugger isn't attached. 939 * We'll simply turn the thing off since that's the easiest thing to do. 940 */ 941 case VERR_DBGF_NOT_ATTACHED: 942 switch (VBOXSTRICTRC_VAL(rcLast)) 943 { 944 case VINF_EM_DBG_HYPER_STEPPED: 945 case VINF_EM_DBG_HYPER_BREAKPOINT: 946 case VINF_EM_DBG_HYPER_ASSERTION: 947 case VERR_TRPM_PANIC: 948 case VERR_TRPM_DONT_PANIC: 949 case VERR_VMM_RING0_ASSERTION: 950 case VERR_VMM_HYPER_CR3_MISMATCH: 951 case VERR_VMM_RING3_CALL_DISABLED: 952 return rcLast; 953 } 954 return VINF_EM_OFF; 955 956 /* 957 * Status codes terminating the VM in one or another sense. 958 */ 959 case VINF_EM_TERMINATE: 960 case VINF_EM_OFF: 961 case VINF_EM_RESET: 962 case VINF_EM_NO_MEMORY: 963 case VINF_EM_RAW_STALE_SELECTOR: 964 case VINF_EM_RAW_IRET_TRAP: 965 case VERR_TRPM_PANIC: 966 case VERR_TRPM_DONT_PANIC: 967 case VERR_IEM_INSTR_NOT_IMPLEMENTED: 968 case VERR_IEM_ASPECT_NOT_IMPLEMENTED: 969 case VERR_VMM_RING0_ASSERTION: 970 case VERR_VMM_HYPER_CR3_MISMATCH: 971 case VERR_VMM_RING3_CALL_DISABLED: 972 case VERR_INTERNAL_ERROR: 973 case VERR_INTERNAL_ERROR_2: 974 case VERR_INTERNAL_ERROR_3: 975 case VERR_INTERNAL_ERROR_4: 976 case VERR_INTERNAL_ERROR_5: 977 case VERR_IPE_UNEXPECTED_STATUS: 978 case VERR_IPE_UNEXPECTED_INFO_STATUS: 979 case VERR_IPE_UNEXPECTED_ERROR_STATUS: 980 return rc; 981 982 /* 983 * The rest is unexpected, and will keep us here. 984 */ 985 default: 986 AssertMsgFailed(("Unexpected rc %Rrc!\n", VBOXSTRICTRC_VAL(rc))); 987 break; 988 } 992 989 } /* debug for ever */ 993 990 } … … 1715 1712 * Debugger Facility polling. 1716 1713 */ 1717 if (VM_FF_IS_PENDING(pVM, VM_FF_DBGF)) 1718 { 1719 rc2 = DBGFR3VMMForcedAction(pVM); 1714 if ( VM_FF_IS_PENDING(pVM, VM_FF_DBGF) 1715 || VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_DBGF) ) 1716 { 1717 rc2 = DBGFR3VMMForcedAction(pVM, pVCpu); 1720 1718 UPDATE_RC(); 1721 1719 } … … 1760 1758 /* check that we got them all */ 1761 1759 AssertCompile(VM_FF_NORMAL_PRIORITY_POST_MASK == (VM_FF_CHECK_VM_STATE | VM_FF_DBGF | VM_FF_RESET | VM_FF_PGM_NO_MEMORY | VM_FF_EMT_RENDEZVOUS)); 1762 AssertCompile(VMCPU_FF_NORMAL_PRIORITY_POST_MASK == VM_WHEN_RAW_MODE(VMCPU_FF_CSAM_SCAN_PAGE, 0));1760 AssertCompile(VMCPU_FF_NORMAL_PRIORITY_POST_MASK == (VM_WHEN_RAW_MODE(VMCPU_FF_CSAM_SCAN_PAGE, 0) | VMCPU_FF_DBGF)); 1763 1761 } 1764 1762 … … 1999 1997 * Debugger Facility request. 2000 1998 */ 2001 if (VM_FF_IS_PENDING_EXCEPT(pVM, VM_FF_DBGF, VM_FF_PGM_NO_MEMORY)) 2002 { 2003 rc2 = DBGFR3VMMForcedAction(pVM); 1999 if ( ( VM_FF_IS_PENDING(pVM, VM_FF_DBGF) 2000 || VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_DBGF) ) 2001 && !VM_FF_IS_PENDING(pVM, VM_FF_PGM_NO_MEMORY) ) 2002 { 2003 rc2 = DBGFR3VMMForcedAction(pVM, pVCpu); 2004 2004 UPDATE_RC(); 2005 2005 } … … 2084 2084 /* check that we got them all */ 2085 2085 AssertCompile(VM_FF_HIGH_PRIORITY_PRE_MASK == (VM_FF_TM_VIRTUAL_SYNC | VM_FF_DBGF | VM_FF_CHECK_VM_STATE | VM_FF_DEBUG_SUSPEND | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY | VM_FF_EMT_RENDEZVOUS)); 2086 AssertCompile(VMCPU_FF_HIGH_PRIORITY_PRE_MASK == (VMCPU_FF_TIMER | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_INHIBIT_INTERRUPTS | VM_WHEN_RAW_MODE(VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT , 0)));2086 AssertCompile(VMCPU_FF_HIGH_PRIORITY_PRE_MASK == (VMCPU_FF_TIMER | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_INHIBIT_INTERRUPTS | VM_WHEN_RAW_MODE(VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT | VMCPU_FF_DBGF, 0))); 2087 2087 } 2088 2088 -
trunk/src/VBox/VMM/VMMR3/VMEmt.cpp
r60804 r61628 153 153 * servicing requests. (Look after the ifs.) 154 154 */ 155 PVM pVM = pUVM->pVM; 155 PVM pVM = pUVM->pVM; 156 PVMCPU pVCpu = pUVCpu->pVCpu; 156 157 enmBefore = pVM->enmVMState; 157 158 if (pUVM->vm.s.fTerminateEMT) … … 182 183 Log(("vmR3EmulationThread: Req (cpu=%u) rc=%Rrc, VM state %s -> %s\n", pUVCpu->idCpu, rc, VMR3GetStateName(enmBefore), VMR3GetStateName(pVM->enmVMState))); 183 184 } 184 else if (VM_FF_IS_SET(pVM, VM_FF_DBGF)) 185 else if ( VM_FF_IS_SET(pVM, VM_FF_DBGF) 186 || VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_DBGF)) 185 187 { 186 188 /* 187 189 * Service the debugger request. 188 190 */ 189 rc = DBGFR3VMMForcedAction(pVM );191 rc = DBGFR3VMMForcedAction(pVM, pVCpu); 190 192 Log(("vmR3EmulationThread: Dbg rc=%Rrc, VM state %s -> %s\n", rc, VMR3GetStateName(enmBefore), VMR3GetStateName(pVM->enmVMState))); 191 193 } -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r61625 r61628 2858 2858 PRINT_FLAG(VMCPU_FF_,IEM); 2859 2859 PRINT_FLAG(VMCPU_FF_,UPDATE_APIC); 2860 PRINT_FLAG(VMCPU_FF_,DBGF); 2860 2861 PRINT_FLAG(VMCPU_FF_,REQUEST); 2861 2862 PRINT_FLAG(VMCPU_FF_,HM_UPDATE_CR3);
Note:
See TracChangeset
for help on using the changeset viewer.