VirtualBox

Changeset 89924 in vbox for trunk/include


Ignore:
Timestamp:
Jun 28, 2021 8:16:29 AM (4 years ago)
Author:
vboxsync
Message:

VMM/DBGFBp: Continue work on I/O breakpoints, bugref:9837

  • Breakpoint owners now have a dedicated callback for I/O breakpoints which can convey information about the access like direction, size, address/port and value so the callback doesn't has to disassemble the instruction to get at those values.
  • Port I/O breakpoints are now mostly complete on the DBGF side and need to be hooked up to IOM next.
File:
1 edited

Legend:

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

    r89912 r89924  
    854854/** All kind of access (read, write, all sizes). */
    855855#define DBGFBPIOACCESS_ALL                  UINT32_C(0x00001f1f)
     856/** All kind of access for MMIO (read, write, all sizes). */
     857#define DBGFBPIOACCESS_ALL_MMIO             DBGFBPIOACCESS_ALL
     858/** All kind of access (read, write, all sizes). */
     859#define DBGFBPIOACCESS_ALL_PORT_IO          UINT32_C(0x00000303)
    856860
    857861/** The acceptable mask for I/O ports.   */
     
    970974 * after the instruction causing the breakpoint to hit was executed. */
    971975#define DBGF_BP_F_HIT_EXEC_AFTER            RT_BIT(2)
     976/** The acceptable flags mask.   */
     977#define DBGF_BP_F_VALID_MASK                UINT32_C(0x00000007)
    972978/** @} */
    973979
     
    9981004
    9991005
     1006/**
     1007 * I/O breakpoint hit handler.
     1008 *
     1009 * @returns Strict VBox status code.
     1010 * @retval  VINF_SUCCESS if the breakpoint was handled and guest execution can resume.
     1011 * @retval  VINF_DBGF_BP_HALT if guest execution should be stopped and the debugger should be invoked.
     1012 * @retval  VINF_DBGF_R3_BP_OWNER_DEFER return to ring-3 and invoke the owner callback there again.
     1013 *
     1014 * @param   pVM         The cross-context VM structure pointer.
     1015 * @param   idCpu       ID of the vCPU triggering the breakpoint.
     1016 * @param   pvUserBp    User argument of the set breakpoint.
     1017 * @param   hBp         The breakpoint handle.
     1018 * @param   pBpPub      Pointer to the readonly public state of the breakpoint.
     1019 * @param   fFlags      Flags indicating when the handler was called (DBGF_BP_F_HIT_EXEC_BEFORE vs DBGF_BP_F_HIT_EXEC_AFTER).
     1020 * @param   fAccess     Access flags, see DBGFBPIOACCESS_XXX.
     1021 * @param   uAddr       The address of the access, for port I/O this will hold the port number.
     1022 * @param   uValue      The value read or written (the value for reads is only valid when DBGF_BP_F_HIT_EXEC_AFTER is set).
     1023 *
     1024 * @remarks The handler is called on the EMT of vCPU triggering the breakpoint and no locks are held.
     1025 * @remarks Any status code returned other than the ones mentioned will send the VM straight into a
     1026 *          guru meditation.
     1027 */
     1028typedef DECLCALLBACKTYPE(VBOXSTRICTRC, FNDBGFBPIOHIT,(PVM pVM, VMCPUID idCpu, void *pvUserBp, DBGFBP hBp, PCDBGFBPPUB pBpPub,
     1029                                                      uint16_t fFlags, uint32_t fAccess, uint64_t uAddr, uint64_t uValue));
     1030/** Pointer to a FNDBGFBPIOHIT(). */
     1031typedef FNDBGFBPIOHIT *PFNDBGFBPIOHIT;
     1032
     1033
    10001034#ifdef IN_RING3
    10011035/** @defgroup grp_dbgf_bp_r3    The DBGF Breakpoint Host Context Ring-3 API
    10021036 * @{ */
    1003 VMMR3DECL(int) DBGFR3BpOwnerCreate(PUVM pUVM, PFNDBGFBPHIT pfnBpHit, PDBGFBPOWNER phBpOwner);
     1037VMMR3DECL(int) DBGFR3BpOwnerCreate(PUVM pUVM, PFNDBGFBPHIT pfnBpHit, PFNDBGFBPIOHIT pfnBpIoHit, PDBGFBPOWNER phBpOwner);
    10041038VMMR3DECL(int) DBGFR3BpOwnerDestroy(PUVM pUVM, DBGFBPOWNER hBpOwner);
    10051039
     
    10261060VMMR3DECL(int) DBGFR3BpSetMmioEx(PUVM pUVM, DBGFBPOWNER hOwner, void *pvUser,
    10271061                                 RTGCPHYS GCPhys, uint32_t cb, uint32_t fAccess,
    1028                                  uint64_t iHitTrigger, uint64_t iHitDisable, PDBGFBP phBp);
     1062                                 uint32_t fFlags, uint64_t iHitTrigger, uint64_t iHitDisable, PDBGFBP phBp);
    10291063VMMR3DECL(int) DBGFR3BpClear(PUVM pUVM, DBGFBP hBp);
    10301064VMMR3DECL(int) DBGFR3BpEnable(PUVM pUVM, DBGFBP hBp);
     
    10581092VMMR0_INT_DECL(void) DBGFR0CleanupVM(PGVM pGVM);
    10591093
    1060 VMMR0_INT_DECL(int)  DBGFR0BpOwnerSetUpContext(PGVM pGVM, DBGFBPOWNER hBpOwner, PFNDBGFBPHIT pfnBpHit);
     1094VMMR0_INT_DECL(int)  DBGFR0BpOwnerSetUpContext(PGVM pGVM, DBGFBPOWNER hBpOwner, PFNDBGFBPHIT pfnBpHit, PFNDBGFBPIOHIT pfnBpIoHit);
    10611095VMMR0_INT_DECL(int)  DBGFR0BpOwnerDestroyContext(PGVM pGVM, DBGFBPOWNER hBpOwner);
    10621096
     
    10761110VMM_INT_DECL(bool)          DBGFIsStepping(PVMCPU pVCpu);
    10771111VMM_INT_DECL(VBOXSTRICTRC)  DBGFBpCheckIo(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, RTIOPORT uIoPort, uint8_t cbValue);
     1112VMM_INT_DECL(VBOXSTRICTRC)  DBGFBpCheckPortIo(PVMCC pVM, PVMCPU pVCpu, RTIOPORT uIoPort,
     1113                                              uint32_t fAccess, uint32_t uValue, bool fBefore);
    10781114VMM_INT_DECL(VBOXSTRICTRC)  DBGFEventGenericWithArgs(PVM pVM, PVMCPU pVCpu, DBGFEVENTTYPE enmEvent, DBGFEVENTCTX enmCtx,
    10791115                                                     unsigned cArgs, ...);
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