VirtualBox

Ignore:
Timestamp:
Jun 7, 2018 11:35:23 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
122954
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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.

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