VirtualBox

Changeset 72469 in vbox


Ignore:
Timestamp:
Jun 7, 2018 11:35:23 AM (7 years ago)
Author:
vboxsync
Message:

GIM,IEM: Correctly hook up hypercalls thru IEM. bugref:9044

  • IEM: Pass opcode and instruction length to GIM so it can do patching.
  • GIM: Introduced GIMHypercallEx API for receiving hypercalls with instruction opcode+length. Hooking this into the exiting #UD code paths.
  • GIM: Move the VMMPatchHypercall API into GIM and corrected the name to GIMQueryHypercallOpcodeBytes.
  • GIM/KVM: Use GIMQueryHypercallOpcodeBytes to decide which instruction is native and cache the opcode bytes for patching.
  • GIM/KVM: Check the VMCALL instruction encoding length rather than assuming its always 3 bytes when patching.
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/gim.h

    r69107 r72469  
    189189VMM_INT_DECL(bool)          GIMAreHypercallsEnabled(PVMCPU pVCpu);
    190190VMM_INT_DECL(VBOXSTRICTRC)  GIMHypercall(PVMCPU pVCpu, PCPUMCTX pCtx);
     191VMM_INT_DECL(VBOXSTRICTRC)  GIMHypercallEx(PVMCPU pVCpu, PCPUMCTX pCtx, unsigned uDisOpcode, uint8_t cbInstr);
    191192VMM_INT_DECL(VBOXSTRICTRC)  GIMExecHypercallInstr(PVMCPU pVCpu, PCPUMCTX pCtx, uint8_t *pcbInstr);
    192193VMM_INT_DECL(VBOXSTRICTRC)  GIMXcptUD(PVMCPU pVCpu, PCPUMCTX pCtx, PDISCPUSTATE pDis, uint8_t *pcbInstr);
     
    194195VMM_INT_DECL(VBOXSTRICTRC)  GIMReadMsr(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue);
    195196VMM_INT_DECL(VBOXSTRICTRC)  GIMWriteMsr(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue, uint64_t uRawValue);
     197VMM_INT_DECL(int)           GIMQueryHypercallOpcodeBytes(PVM pVM, void *pvBuf, size_t cbBuf,
     198                                                         size_t *pcbWritten, uint16_t *puDisOpcode);
    196199/** @} */
    197200
  • trunk/include/VBox/vmm/vmm.h

    r72462 r72469  
    286286VMM_INT_DECL(bool)          VMMIsInRing3Call(PVMCPU pVCpu);
    287287VMM_INT_DECL(void)          VMMTrashVolatileXMMRegs(void);
    288 VMM_INT_DECL(int)           VMMPatchHypercall(PVM pVM, void *pvBuf, size_t cbBuf, size_t *pcbWritten);
    289288
    290289
  • trunk/src/VBox/VMM/VMMAll/GIMAll.cpp

    r69111 r72469  
    133133
    134134/**
     135 * Same as GIMHypercall, except with disassembler opcode and instruction length.
     136 *
     137 * This is the interface used by IEM.
     138 *
     139 * @returns Strict VBox status code.
     140 * @retval  VINF_SUCCESS if the hypercall succeeded (even if its operation
     141 *          failed).
     142 * @retval  VINF_GIM_HYPERCALL_CONTINUING continue hypercall without updating
     143 *          RIP.
     144 * @retval  VINF_GIM_R3_HYPERCALL re-start the hypercall from ring-3.
     145 * @retval  VERR_GIM_HYPERCALL_ACCESS_DENIED CPL is insufficient.
     146 * @retval  VERR_GIM_HYPERCALLS_NOT_AVAILABLE hypercalls unavailable.
     147 * @retval  VERR_GIM_NOT_ENABLED GIM is not enabled (shouldn't really happen)
     148 * @retval  VERR_GIM_HYPERCALL_MEMORY_READ_FAILED hypercall failed while reading
     149 *          memory.
     150 * @retval  VERR_GIM_HYPERCALL_MEMORY_WRITE_FAILED hypercall failed while
     151 *          writing memory.
     152 * @retval  VERR_GIM_INVALID_HYPERCALL_INSTR if uDisOpcode is the wrong one; raise \#UD.
     153 *
     154 * @param   pVCpu       The cross context virtual CPU structure.
     155 * @param   pCtx        Pointer to the guest-CPU context.
     156 * @param   uDisOpcode  The disassembler opcode.
     157 * @param   cbInstr     The instruction length.
     158 *
     159 * @remarks The caller of this function needs to advance RIP as required.
     160 * @thread  EMT.
     161 */
     162VMM_INT_DECL(VBOXSTRICTRC) GIMHypercallEx(PVMCPU pVCpu, PCPUMCTX pCtx, unsigned uDisOpcode, uint8_t cbInstr)
     163{
     164    PVM pVM = pVCpu->CTX_SUFF(pVM);
     165    VMCPU_ASSERT_EMT(pVCpu);
     166
     167    if (RT_UNLIKELY(!GIMIsEnabled(pVM)))
     168        return VERR_GIM_NOT_ENABLED;
     169
     170    switch (pVM->gim.s.enmProviderId)
     171    {
     172        case GIMPROVIDERID_HYPERV:
     173            return gimHvHypercallEx(pVCpu, pCtx, uDisOpcode, cbInstr);
     174
     175        case GIMPROVIDERID_KVM:
     176            return gimKvmHypercallEx(pVCpu, pCtx, uDisOpcode, cbInstr);
     177
     178        default:
     179            AssertMsgFailedReturn(("enmProviderId=%u\n", pVM->gim.s.enmProviderId), VERR_GIM_HYPERCALLS_NOT_AVAILABLE);
     180    }
     181}
     182
     183
     184/**
    135185 * Disassembles the instruction at RIP and if it's a hypercall
    136186 * instruction, performs the hypercall.
     
    163213        {
    164214            case GIMPROVIDERID_HYPERV:
    165                 return gimHvExecHypercallInstr(pVCpu, pCtx, &Dis);
     215                return gimHvHypercallEx(pVCpu, pCtx, Dis.pCurInstr->uOpcode, Dis.cbInstr);
    166216
    167217            case GIMPROVIDERID_KVM:
    168                 return gimKvmExecHypercallInstr(pVCpu, pCtx, &Dis);
     218                return gimKvmHypercallEx(pVCpu, pCtx, Dis.pCurInstr->uOpcode, Dis.cbInstr);
    169219
    170220            default:
     
    352402}
    353403
     404
     405/**
     406 * Queries the opcode bytes for a native hypercall.
     407 *
     408 * @returns VBox status code.
     409 * @param   pVM         The cross context VM structure.
     410 * @param   pvBuf       The destination buffer.
     411 * @param   cbBuf       The size of the buffer.
     412 * @param   pcbWritten  Where to return the number of bytes written.  This is
     413 *                      reliably updated only on successful return.  Optional.
     414 * @param   puDisOpcode Where to return the disassembler opcode.  Optional.
     415 */
     416VMM_INT_DECL(int) GIMQueryHypercallOpcodeBytes(PVM pVM, void *pvBuf, size_t cbBuf, size_t *pcbWritten, uint16_t *puDisOpcode)
     417{
     418    AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
     419
     420    CPUMCPUVENDOR  enmHostCpu = CPUMGetHostCpuVendor(pVM);
     421    uint8_t const *pbSrc;
     422    size_t         cbSrc;
     423    switch (enmHostCpu)
     424    {
     425        case CPUMCPUVENDOR_AMD:
     426        {
     427            if (puDisOpcode)
     428                *puDisOpcode = OP_VMMCALL;
     429            static uint8_t const s_abHypercall[] = { 0x0F, 0x01, 0xD9 };   /* VMMCALL */
     430            pbSrc = s_abHypercall;
     431            cbSrc = sizeof(s_abHypercall);
     432            break;
     433        }
     434
     435        case CPUMCPUVENDOR_INTEL:
     436        case CPUMCPUVENDOR_VIA:
     437        {
     438            if (puDisOpcode)
     439                *puDisOpcode = OP_VMCALL;
     440            static uint8_t const s_abHypercall[] = { 0x0F, 0x01, 0xC1 };   /* VMCALL */
     441            pbSrc = s_abHypercall;
     442            cbSrc = sizeof(s_abHypercall);
     443            break;
     444        }
     445
     446        default:
     447            AssertMsgFailedReturn(("%d\n", enmHostCpu), VERR_UNSUPPORTED_CPU);
     448    }
     449    if (RT_LIKELY(cbBuf >= cbSrc))
     450    {
     451        memcpy(pvBuf, pbSrc, cbSrc);
     452        if (pcbWritten)
     453            *pcbWritten = cbSrc;
     454        return VINF_SUCCESS;
     455    }
     456    return VERR_BUFFER_OVERFLOW;
     457}
     458
  • trunk/src/VBox/VMM/VMMAll/GIMAllHv.cpp

    r72462 r72469  
    13811381
    13821382/**
    1383  * Checks the currently disassembled instruction and executes the hypercall if
    1384  * it's a hypercall instruction.
     1383 * Checks the instruction and executes the hypercall if it's a valid hypercall
     1384 * instruction.
     1385 *
     1386 * This interface is used by \#UD handlers and IEM.
    13851387 *
    13861388 * @returns Strict VBox status code.
    13871389 * @param   pVCpu       The cross context virtual CPU structure.
    13881390 * @param   pCtx        Pointer to the guest-CPU context.
    1389  * @param   pDis        Pointer to the disassembled instruction state at RIP.
     1391 * @param   uDisOpcode  The disassembler opcode.
     1392 * @param   cbInstr     The instruction length.
    13901393 *
    13911394 * @thread  EMT(pVCpu).
    1392  *
    1393  * @todo    Make this function static when @bugref{7270#c168} is addressed.
    1394  */
    1395 VMM_INT_DECL(VBOXSTRICTRC) gimHvExecHypercallInstr(PVMCPU pVCpu, PCPUMCTX pCtx, PDISCPUSTATE pDis)
     1395 */
     1396VMM_INT_DECL(VBOXSTRICTRC) gimHvHypercallEx(PVMCPU pVCpu, PCPUMCTX pCtx, unsigned uDisOpcode, uint8_t cbInstr)
    13961397{
    13971398    Assert(pVCpu);
    13981399    Assert(pCtx);
    1399     Assert(pDis);
    14001400    VMCPU_ASSERT_EMT(pVCpu);
    14011401
    14021402    PVM pVM = pVCpu->CTX_SUFF(pVM);
    1403     CPUMCPUVENDOR const enmGuestCpuVendor = CPUMGetGuestCpuVendor(pVM);
    1404     if (   (   pDis->pCurInstr->uOpcode == OP_VMCALL
     1403    CPUMCPUVENDOR const enmGuestCpuVendor = (CPUMCPUVENDOR)pVM->cpum.ro.GuestFeatures.enmCpuVendor;
     1404    if (   (   uDisOpcode == OP_VMCALL
    14051405            && (   enmGuestCpuVendor == CPUMCPUVENDOR_INTEL
    14061406                || enmGuestCpuVendor == CPUMCPUVENDOR_VIA))
    1407         || (   pDis->pCurInstr->uOpcode == OP_VMMCALL
     1407        || (   uDisOpcode == OP_VMMCALL
    14081408            && enmGuestCpuVendor == CPUMCPUVENDOR_AMD))
    1409     {
    14101409        return gimHvHypercall(pVCpu, pCtx);
    1411     }
    1412 
     1410
     1411    RT_NOREF_PV(cbInstr);
    14131412    return VERR_GIM_INVALID_HYPERCALL_INSTR;
    14141413}
     
    14601459            if (pcbInstr)
    14611460                *pcbInstr = (uint8_t)cbInstr;
    1462             return gimHvExecHypercallInstr(pVCpu, pCtx, &Dis);
     1461            return gimHvHypercallEx(pVCpu, pCtx, Dis.pCurInstr->uOpcode, Dis.cbInstr);
    14631462        }
    14641463
     
    14671466    }
    14681467
    1469     return gimHvExecHypercallInstr(pVCpu, pCtx, pDis);
     1468    return gimHvHypercallEx(pVCpu, pCtx, pDis->pCurInstr->uOpcode, pDis->cbInstr);
    14701469}
    14711470
  • trunk/src/VBox/VMM/VMMAll/GIMAllKvm.cpp

    r70948 r72469  
    351351
    352352/**
    353  * Checks the currently disassembled instruction and executes the hypercall if
    354  * it's a hypercall instruction.
     353 * Checks the instruction and executes the hypercall if it's a valid hypercall
     354 * instruction.
     355 *
     356 * This interface is used by \#UD handlers and IEM.
    355357 *
    356358 * @returns Strict VBox status code.
    357359 * @param   pVCpu       The cross context virtual CPU structure.
    358360 * @param   pCtx        Pointer to the guest-CPU context.
    359  * @param   pDis        Pointer to the disassembled instruction state at RIP.
     361 * @param   uDisOpcode  The disassembler opcode.
     362 * @param   cbInstr     The instruction length.
    360363 *
    361364 * @thread  EMT(pVCpu).
    362  *
    363  * @todo    Make this function static when @bugref{7270#c168} is addressed.
    364  */
    365 VMM_INT_DECL(VBOXSTRICTRC) gimKvmExecHypercallInstr(PVMCPU pVCpu, PCPUMCTX pCtx, PDISCPUSTATE pDis)
     365 */
     366VMM_INT_DECL(VBOXSTRICTRC) gimKvmHypercallEx(PVMCPU pVCpu, PCPUMCTX pCtx, unsigned uDisOpcode, uint8_t cbInstr)
    366367{
    367368    Assert(pVCpu);
    368369    Assert(pCtx);
    369     Assert(pDis);
    370370    VMCPU_ASSERT_EMT(pVCpu);
    371371
     
    378378     * will not require disassembly (when coming from HM).
    379379     */
    380     if (   pDis->pCurInstr->uOpcode == OP_VMCALL
    381         || pDis->pCurInstr->uOpcode == OP_VMMCALL)
     380    if (   uDisOpcode == OP_VMCALL
     381        || uDisOpcode == OP_VMMCALL)
    382382    {
    383383        /*
     
    399399            PVM      pVM  = pVCpu->CTX_SUFF(pVM);
    400400            PCGIMKVM pKvm = &pVM->gim.s.u.Kvm;
    401             if (   pDis->pCurInstr->uOpcode != pKvm->uOpCodeNative
    402                 && !VM_IS_RAW_MODE_ENABLED(pVM))
     401            if (   uDisOpcode != pKvm->uOpcodeNative
     402                && !VM_IS_RAW_MODE_ENABLED(pVM)
     403                && cbInstr == sizeof(pKvm->abOpcodeNative) )
    403404            {
    404405                /** @todo r=ramshankar: we probably should be doing this in an
    405406                 *        EMT rendezvous. */
    406                 uint8_t abHypercall[3];
    407                 size_t  cbWritten = 0;
    408                 int rc = VMMPatchHypercall(pVM, &abHypercall, sizeof(abHypercall), &cbWritten);
     407                /** @todo Add stats for patching. */
     408                int rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, pKvm->abOpcodeNative, sizeof(pKvm->abOpcodeNative));
    409409                AssertRC(rc);
    410                 Assert(sizeof(abHypercall) == pDis->cbInstr);
    411                 Assert(sizeof(abHypercall) == cbWritten);
    412 
    413                 rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, &abHypercall, sizeof(abHypercall));
    414                 AssertRC(rc);
    415 
    416                 /** @todo Add stats for patching. */
    417410            }
    418411        }
     
    473466            if (pcbInstr)
    474467                *pcbInstr = (uint8_t)cbInstr;
    475             return gimKvmExecHypercallInstr(pVCpu, pCtx, &Dis);
     468            return gimKvmHypercallEx(pVCpu, pCtx, Dis.pCurInstr->uOpcode, Dis.cbInstr);
    476469        }
    477470
     
    480473    }
    481474
    482     return gimKvmExecHypercallInstr(pVCpu, pCtx, pDis);
    483 }
    484 
     475    return gimKvmHypercallEx(pVCpu, pCtx, pDis->pCurInstr->uOpcode, pDis->cbInstr);
     476}
     477
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h

    r72462 r72469  
    10921092 * Common code for iemCImpl_vmmcall and iemCImpl_vmcall (latter in IEMAllCImplVmxInstr.cpp.h).
    10931093 */
    1094 IEM_CIMPL_DEF_0(iemCImpl_Hypercall)
     1094IEM_CIMPL_DEF_1(iemCImpl_Hypercall, uint16_t, uDisOpcode)
    10951095{
    10961096    if (EMAreHypercallInstructionsEnabled(pVCpu))
    10971097    {
    1098         VBOXSTRICTRC rcStrict = GIMHypercall(pVCpu, IEM_GET_CTX(pVCpu));
     1098        NOREF(uDisOpcode);
     1099        VBOXSTRICTRC rcStrict = GIMHypercallEx(pVCpu, IEM_GET_CTX(pVCpu), uDisOpcode, cbInstr);
    10991100        if (RT_SUCCESS(rcStrict))
    11001101        {
     
    11451146
    11461147    /* Join forces with vmcall. */
    1147     return IEM_CIMPL_CALL_0(iemCImpl_Hypercall);
     1148    return IEM_CIMPL_CALL_1(iemCImpl_Hypercall, OP_VMMCALL);
    11481149}
    11491150
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r72462 r72469  
    2525
    2626    /* Join forces with vmmcall. */
    27     return IEM_CIMPL_CALL_0(iemCImpl_Hypercall);
     27    return IEM_CIMPL_CALL_1(iemCImpl_Hypercall, OP_VMCALL);
    2828}
    2929
  • trunk/src/VBox/VMM/VMMAll/VMMAll.cpp

    r72462 r72469  
    396396}
    397397
    398 
    399 /**
    400  * Patches the instructions necessary for making a hypercall to the hypervisor.
    401  * Used by GIM.
    402  *
    403  * @returns VBox status code.
    404  * @param   pVM         The cross context VM structure.
    405  * @param   pvBuf       The buffer in the hypercall page(s) to be patched.
    406  * @param   cbBuf       The size of the buffer.
    407  * @param   pcbWritten  Where to store the number of bytes patched. This
    408  *                      is reliably updated only when this function returns
    409  *                      VINF_SUCCESS.
    410  */
    411 VMM_INT_DECL(int) VMMPatchHypercall(PVM pVM, void *pvBuf, size_t cbBuf, size_t *pcbWritten)
    412 {
    413     AssertReturn(pvBuf, VERR_INVALID_POINTER);
    414     AssertReturn(pcbWritten, VERR_INVALID_POINTER);
    415 
    416     CPUMCPUVENDOR enmHostCpu = CPUMGetHostCpuVendor(pVM);
    417     switch (enmHostCpu)
    418     {
    419         case CPUMCPUVENDOR_AMD:
    420         {
    421             uint8_t abHypercall[] = { 0x0F, 0x01, 0xD9 };   /* VMMCALL */
    422             if (RT_LIKELY(cbBuf >= sizeof(abHypercall)))
    423             {
    424                 memcpy(pvBuf, abHypercall, sizeof(abHypercall));
    425                 *pcbWritten = sizeof(abHypercall);
    426                 return VINF_SUCCESS;
    427             }
    428             return VERR_BUFFER_OVERFLOW;
    429         }
    430 
    431         case CPUMCPUVENDOR_INTEL:
    432         case CPUMCPUVENDOR_VIA:
    433         {
    434             uint8_t abHypercall[] = { 0x0F, 0x01, 0xC1 };   /* VMCALL */
    435             if (RT_LIKELY(cbBuf >= sizeof(abHypercall)))
    436             {
    437                 memcpy(pvBuf, abHypercall, sizeof(abHypercall));
    438                 *pcbWritten = sizeof(abHypercall);
    439                 return VINF_SUCCESS;
    440             }
    441             return VERR_BUFFER_OVERFLOW;
    442         }
    443 
    444         default:
    445             AssertFailed();
    446             return VERR_UNSUPPORTED_CPU;
    447     }
    448 }
    449 
  • trunk/src/VBox/VMM/VMMR3/GIMHv.cpp

    r72462 r72469  
    15211521     * Patch the hypercall-page.
    15221522     */
    1523     size_t cbWritten = 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*/);
    15251525    if (   RT_SUCCESS(rc)
    1526         && cbWritten < PAGE_SIZE)
    1527     {
    1528         uint8_t *pbLast = (uint8_t *)pvHypercallPage + cbWritten;
     1526        && cbHypercall < PAGE_SIZE)
     1527    {
     1528        uint8_t *pbLast = (uint8_t *)pvHypercallPage + cbHypercall;
    15291529        *pbLast = 0xc3;  /* RET */
    15301530
     
    15431543        if (rc == VINF_SUCCESS)
    15441544            rc = VERR_GIM_OPERATION_FAILED;
    1545         LogRel(("GIM: HyperV: VMMPatchHypercall failed. rc=%Rrc cbWritten=%u\n", rc, cbWritten));
     1545        LogRel(("GIM: HyperV: VMMPatchHypercall failed. rc=%Rrc cbHypercall=%u\n", rc, cbHypercall));
    15461546    }
    15471547
  • trunk/src/VBox/VMM/VMMR3/GIMKvm.cpp

    r72462 r72469  
    158158    /*
    159159     * Setup hypercall and #UD handling.
     160     * Note! We always need to trap VMCALL/VMMCALL hypercall using #UDs for raw-mode VMs.
    160161     */
    161162    for (VMCPUID i = 0; i < pVM->cCpus; i++)
    162163        EMSetHypercallInstructionsEnabled(&pVM->aCpus[i], true);
    163164
    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);
    179170
    180171    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/include/GIMHvInternal.h

    r72460 r72469  
    13681368VMM_INT_DECL(VBOXSTRICTRC)      gimHvXcptUD(PVMCPU pVCpu, PCPUMCTX pCtx, PDISCPUSTATE pDis, uint8_t *pcbInstr);
    13691369VMM_INT_DECL(VBOXSTRICTRC)      gimHvHypercall(PVMCPU pVCpu, PCPUMCTX pCtx);
    1370 VMM_INT_DECL(VBOXSTRICTRC)      gimHvExecHypercallInstr(PVMCPU pVCpu, PCPUMCTX pCtx, PDISCPUSTATE pDis);
     1370VMM_INT_DECL(VBOXSTRICTRC)      gimHvHypercallEx(PVMCPU pVCpu, PCPUMCTX pCtx, unsigned uDisOpcode, uint8_t cbInstr);
    13711371VMM_INT_DECL(VBOXSTRICTRC)      gimHvReadMsr(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue);
    13721372VMM_INT_DECL(VBOXSTRICTRC)      gimHvWriteMsr(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uRawValue);
  • trunk/src/VBox/VMM/include/GIMKvmInternal.h

    r69111 r72469  
    200200    bool                        fTrapXcptUD;
    201201    /** Disassembler opcode of hypercall instruction native for this host CPU. */
    202     uint16_t                    uOpCodeNative;
     202    uint16_t                    uOpcodeNative;
     203    /** Native hypercall opcode bytes.  Use for replacing. */
     204    uint8_t                     abOpcodeNative[3];
     205    /** Alignment padding. */
     206    uint8_t                     abPadding[5];
    203207    /** The TSC frequency (in HZ) reported to the guest. */
    204208    uint64_t                    cTscTicksPerSecond;
     
    266270VMM_INT_DECL(bool)              gimKvmShouldTrapXcptUD(PVMCPU pVCpu);
    267271VMM_INT_DECL(VBOXSTRICTRC)      gimKvmXcptUD(PVMCPU pVCpu, PCPUMCTX pCtx, PDISCPUSTATE pDis, uint8_t *pcbInstr);
    268 VMM_INT_DECL(VBOXSTRICTRC)      gimKvmExecHypercallInstr(PVMCPU pVCpu, PCPUMCTX pCtx, PDISCPUSTATE pDis);
     272VMM_INT_DECL(VBOXSTRICTRC)      gimKvmHypercallEx(PVMCPU pVCpu, PCPUMCTX pCtx, unsigned uDisOpcode, uint8_t cbInstr);
    269273
    270274
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette