Changeset 72469 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Jun 7, 2018 11:35:23 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 122954
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
r72462 r72469 1521 1521 * Patch the hypercall-page. 1522 1522 */ 1523 size_t cb Written= 0;1524 int rc = VMMPatchHypercall(pVM, pvHypercallPage, PAGE_SIZE, &cbWritten);1523 size_t cbHypercall = 0; 1524 int rc = GIMQueryHypercallOpcodeBytes(pVM, pvHypercallPage, PAGE_SIZE, &cbHypercall, NULL /*puDisOpcode*/); 1525 1525 if ( RT_SUCCESS(rc) 1526 && cb Written< PAGE_SIZE)1527 { 1528 uint8_t *pbLast = (uint8_t *)pvHypercallPage + cb Written;1526 && cbHypercall < PAGE_SIZE) 1527 { 1528 uint8_t *pbLast = (uint8_t *)pvHypercallPage + cbHypercall; 1529 1529 *pbLast = 0xc3; /* RET */ 1530 1530 … … 1543 1543 if (rc == VINF_SUCCESS) 1544 1544 rc = VERR_GIM_OPERATION_FAILED; 1545 LogRel(("GIM: HyperV: VMMPatchHypercall failed. rc=%Rrc cb Written=%u\n", rc, cbWritten));1545 LogRel(("GIM: HyperV: VMMPatchHypercall failed. rc=%Rrc cbHypercall=%u\n", rc, cbHypercall)); 1546 1546 } 1547 1547 -
trunk/src/VBox/VMM/VMMR3/GIMKvm.cpp
r72462 r72469 158 158 /* 159 159 * Setup hypercall and #UD handling. 160 * Note! We always need to trap VMCALL/VMMCALL hypercall using #UDs for raw-mode VMs. 160 161 */ 161 162 for (VMCPUID i = 0; i < pVM->cCpus; i++) 162 163 EMSetHypercallInstructionsEnabled(&pVM->aCpus[i], true); 163 164 164 if (ASMIsAmdCpu()) 165 { 166 pKvm->fTrapXcptUD = true; 167 pKvm->uOpCodeNative = OP_VMMCALL; 168 } 169 else 170 { 171 Assert(ASMIsIntelCpu() || ASMIsViaCentaurCpu()); 172 pKvm->fTrapXcptUD = false; 173 pKvm->uOpCodeNative = OP_VMCALL; 174 } 175 176 /* We always need to trap VMCALL/VMMCALL hypercall using #UDs for raw-mode VMs. */ 177 if (VM_IS_RAW_MODE_ENABLED(pVM)) 178 pKvm->fTrapXcptUD = true; 165 size_t cbHypercall = 0; 166 rc = GIMQueryHypercallOpcodeBytes(pVM, pKvm->abOpcodeNative, sizeof(pKvm->abOpcodeNative), &cbHypercall, &pKvm->uOpcodeNative); 167 AssertLogRelRCReturn(rc, rc); 168 AssertLogRelReturn(cbHypercall == sizeof(pKvm->abOpcodeNative), VERR_GIM_IPE_1); 169 pKvm->fTrapXcptUD = pKvm->uOpcodeNative != OP_VMCALL || VM_IS_RAW_MODE_ENABLED(pVM); 179 170 180 171 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.