VirtualBox

Changeset 58909 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Nov 29, 2015 7:23:46 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104409
Message:

DBGF: More groundwork for port I/O, MMIO, interrupt and generic event breakpoints.

Location:
trunk/include/VBox/vmm
Files:
4 edited

Legend:

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

    r58903 r58909  
    189189     */
    190190    DBGFEVENT_POWERING_OFF,
     191
     192    /** Hardware Interrupt break.
     193     * @todo not yet implemented. */
     194    DBGFEVENT_INTERRUPT_HARDWARE,
     195    /** Software Interrupt break.
     196     * @todo not yet implemented. */
     197    DBGFEVENT_INTERRUPT_SOFTWARE,
    191198
    192199    /** The first selectable event.
     
    435442    } u;
    436443} DBGFEVENT;
     444AssertCompileSizeAlignment(DBGFEVENT, 8);
    437445/** Pointer to VMM Debug Event. */
    438446typedef DBGFEVENT *PDBGFEVENT;
     
    478486VMMR3DECL(int)          DBGFR3InjectNMI(PUVM pUVM, VMCPUID idCpu);
    479487
     488/**
     489 * Event configuration array element, see DBGFR3EventConfigEx.
     490 */
     491typedef struct DBGFEVENTCONFIG
     492{
     493    /** The event to configure */
     494    DBGFEVENTTYPE   enmType;
     495    /** The new state. */
     496    bool            fEnabled;
     497} DBGFEVENTCONFIG;
     498/** Pointer to an event config. */
     499typedef DBGFEVENTCONFIG *PDBGFEVENTCONFIG;
     500/** Pointer to a const event config. */
     501typedef const DBGFEVENTCONFIG *PCDBGFEVENTCONFIG;
     502
     503VMMR3DECL(int)          DBGFR3EventConfigEx(PUVM pUVM, PCDBGFEVENTCONFIG paConfigs, size_t cConfigs);
     504VMMR3DECL(int)          DBGFR3EventConfig(PUVM pUVM, DBGFEVENTTYPE enmEvent, bool fEnabled);
     505VMMR3DECL(bool)         DBGFR3EventIsEnabled(PUVM pUVM, DBGFEVENTTYPE enmEvent);
     506VMMR3DECL(int)          DBGFR3EventQuery(PUVM pUVM, PDBGFEVENTCONFIG paConfigs, size_t cConfigs);
     507
     508/** @name DBGFINTERRUPTSTATE_XXX - interrupt break state.
     509 * @{ */
     510#define DBGFINTERRUPTSTATE_DISABLED     0
     511#define DBGFINTERRUPTSTATE_ENABLED      1
     512#define DBGFINTERRUPTSTATE_DONT_TOUCH   2
     513/** @} */
     514
     515/**
     516 * Interrupt break state configuration entry.
     517 */
     518typedef struct DBGFINTERRUPTCONFIG
     519{
     520    /** The interrupt number. */
     521    uint8_t     iInterrupt;
     522    /** The hardware interrupt state (DBGFINTERRUPTSTATE_XXX). */
     523    uint8_t     enmHardState;
     524    /** The software interrupt state (DBGFINTERRUPTSTATE_XXX). */
     525    uint8_t     enmSoftState;
     526} DBGFINTERRUPTCONFIG;
     527/** Pointer to an interrupt break state config entyr. */
     528typedef DBGFINTERRUPTCONFIG *PDBGFINTERRUPTCONFIG;
     529/** Pointer to a const interrupt break state config entyr. */
     530typedef DBGFINTERRUPTCONFIG const *PCDBGFINTERRUPTCONFIG;
     531
     532VMMR3DECL(int) DBGFR3InterruptConfigEx(PUVM pUVM, PCDBGFINTERRUPTCONFIG paConfigs, size_t cConfigs);
     533VMMR3DECL(int) DBGFR3InterruptHardwareConfig(PUVM pUVM, uint8_t iInterrupt, bool fEnabled);
     534VMMR3DECL(int) DBGFR3InterruptSoftwareConfig(PUVM pUVM, uint8_t iInterrupt, bool fEnabled);
     535VMMR3DECL(int) DBGFR3InterruptHardwareIsEnabled(PUVM pUVM, uint8_t iInterrupt);
     536VMMR3DECL(int) DBGFR3InterruptSoftwareIsEnabled(PUVM pUVM, uint8_t iInterrupt);
     537
    480538#endif /* IN_RING3 */
     539
     540/** @def DBGF_IS_EVENT_ENABLED
     541 * Checks if a selectable debug event is enabled or not (fast).
     542 *
     543 * @returns true/false.
     544 * @param   a_pVM       Pointer to the cross context VM structure.
     545 * @param   a_enmEvent  The selectable event to check.
     546 * @remarks Only for use internally in the VMM. Use DBGFR3EventIsEnabled elsewhere.
     547 */
     548#if defined(VBOX_STRICT) && defined(RT_COMPILER_SUPPORTS_LAMBDA)
     549# define DBGF_IS_EVENT_ENABLED(a_pVM, a_enmEvent) \
     550    ([](PVM a_pLambdaVM, DBGFEVENTTYPE a_enmLambdaEvent) -> bool { \
     551        Assert(a_enmLambdaEvent >= DBGFEVENT_FIRST_SELECTABLE); \
     552        Assert(a_enmLambdaEvent < DBGFEVENT_END); \
     553        return ASMBitTest(&a_pLambdaVM->dbgf.ro.bmSelectedEvents, a_enmLambdaEvent); \
     554    }(a_pVM, a_enmEvent))
     555#elif defined(VBOX_STRICT) && defined(__GNUC__)
     556# define DBGF_IS_EVENT_ENABLED(a_pVM, a_enmEvent) \
     557    __extension__ ({ \
     558        Assert((a_enmEvent) >= DBGFEVENT_FIRST_SELECTABLE); \
     559        Assert((a_enmEvent) < DBGFEVENT_END); \
     560        ASMBitTest(&(a_pVM)->dbgf.ro.bmSelectedEvents, (a_enmEvent)); \
     561    })
     562#else
     563# define DBGF_IS_EVENT_ENABLED(a_pVM, a_enmEvent) \
     564        ASMBitTest(&(a_pVM)->dbgf.ro.bmSelectedEvents, (a_enmEvent))
     565#endif
     566
     567
     568/** @def DBGF_IS_HARDWARE_INT_ENABLED
     569 * Checks if hardware interrupt interception is enabled or not for an interrupt.
     570 *
     571 * @returns true/false.
     572 * @param   a_pVM           Pointer to the cross context VM structure.
     573 * @param   a_iInterrupt    Interrupt to check.
     574 * @remarks Only for use internally in the VMM.  Use
     575 *          DBGFR3InterruptHardwareIsEnabled elsewhere.
     576 */
     577#define DBGF_IS_HARDWARE_INT_ENABLED(a_pVM, a_iInterrupt) \
     578        ASMBitTest(&(a_pVM)->dbgf.ro.bmHardIntBreakpoints, (uint8_t)(a_iInterrupt))
     579
     580/** @def DBGF_IS_SOFTWARE_INT_ENABLED
     581 * Checks if software interrupt interception is enabled or not for an interrupt.
     582 *
     583 * @returns true/false.
     584 * @param   a_pVM           Pointer to the cross context VM structure.
     585 * @param   a_iInterrupt    Interrupt to check.
     586 * @remarks Only for use internally in the VMM.  Use
     587 *          DBGFR3InterruptSoftwareIsEnabled elsewhere.
     588 */
     589#define DBGF_IS_SOFTWARE_INT_ENABLED(a_pVM, a_iInterrupt) \
     590        ASMBitTest(&(a_pVM)->dbgf.ro.bmSoftIntBreakpoints, (uint8_t)(a_iInterrupt))
    481591
    482592
     
    644754 * Breakpoint enumeration callback function.
    645755 *
    646  * @returns VBox status code. Any failure will stop the enumeration.
     756 * @returns VBox status code.
     757 *          The enumeration stops on failure status and VINF_CALLBACK_RETURN.
    647758 * @param   pUVM        The user mode VM handle.
    648759 * @param   pvUser      The user argument.
  • trunk/include/VBox/vmm/iom.h

    r58903 r58909  
    339339VMMR3_INT_DECL(int)  IOMR3MmioDeregister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange);
    340340
    341 VMMR3_INT_DECL(void) IOMR3NotifyBreakpointCountChange(PVM pVM, unsigned cPortIo, unsigned cMmio);
     341VMMR3_INT_DECL(void) IOMR3NotifyBreakpointCountChange(PVM pVM, bool fPortIo, bool fMmio);
    342342VMMR3_INT_DECL(void) IOMR3NotifyDebugEventChange(PVM pVM, DBGFEVENT enmEvent, bool fEnabled);
    343343
  • trunk/include/VBox/vmm/vm.h

    r58283 r58909  
    217217        struct DBGFCPU      s;
    218218#endif
    219         uint8_t             padding[64];        /* multiple of 64 */
     219        uint8_t             padding[256];       /* multiple of 64 */
    220220    } dbgf;
    221221
     
    230230
    231231    /** Align the following members on page boundary. */
    232     uint8_t                 abAlignment2[3584];
     232    uint8_t                 abAlignment2[3392];
    233233
    234234    /** PGM part. */
     
    983983#endif
    984984#ifdef ___VBox_vmm_cpum_h
    985         /** Read only info exposed about the host and guest CPUs.   */
     985        /** Read only info exposed about the host and guest CPUs. */
    986986        struct
    987987        {
     
    11111111        struct DBGF s;
    11121112#endif
     1113#ifdef ___VBox_vmm_dbgf_h
     1114        /** Read only info exposed about interrupt breakpoints and selected events. */
     1115        struct
     1116        {
     1117            /** Bitmap of enabled hardware interrupt breakpoints. */
     1118            uint32_t                    bmHardIntBreakpoints[256 / 32];
     1119            /** Bitmap of enabled software interrupt breakpoints. */
     1120            uint32_t                    bmSoftIntBreakpoints[256 / 32];
     1121            /** Bitmap of selected events.
     1122             * This includes non-selectable events too for simplicity, we maintain the
     1123             * state for some of these, as it may come in handy. */
     1124            uint32_t                    bmSelectedEvents[(DBGFEVENT_END + 31) / 32];
     1125            /** Enabled hardware interrupt breakpoints. */
     1126            uint32_t                    cHardIntBreakpoints;
     1127            /** Enabled software interrupt breakpoints. */
     1128            uint32_t                    cSoftIntBreakpoints;
     1129            /** Number of selected events. */
     1130            uint32_t                    cSelectedEvents;
     1131        } const     ro;
     1132#endif
    11131133        uint8_t     padding[2368];      /* multiple of 64 */
    11141134    } dbgf;
  • trunk/include/VBox/vmm/vm.mac

    r56291 r58909  
    142142    .pdm                    resb 256
    143143    .iom                    resb 512
    144     .dbgf                   resb 64
     144    .dbgf                   resb 256
    145145    .gim                    resb 64
    146146
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