VirtualBox

Changeset 97705 in vbox for trunk/include/VBox/vmm


Ignore:
Timestamp:
Nov 29, 2022 2:11:49 PM (2 years ago)
Author:
vboxsync
Message:

VMM/IEM,DBGF,CPUM: Do debugger I/O breakpoints via the internal EFLAGS bits too. Seems we might need two bits, so had to shift the internal bits down from 24 to 22. bugref:9898

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

Legend:

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

    r97406 r97705  
    261261 * clear drop in thruput, it would on the whole make the most sense to use 24
    262262 * here.
    263  */
    264 #define CPUMX86EFLAGS_HW_BITS       24
     263 *
     264 * Update: We need more than 8 bits because of DBGF, so using 22 now.
     265 */
     266#define CPUMX86EFLAGS_HW_BITS       22
    265267/** Mask for the hardware EFLAGS bits, 64-bit version. */
    266268#define CPUMX86EFLAGS_HW_MASK_64    (RT_BIT_64(CPUMX86EFLAGS_HW_BITS) - UINT64_C(1))
     
    275277
    276278/** Mask of internal flags kept with EFLAGS, 64-bit version.
    277  * The first 3 available bits are taken by CPUMCTX_INHIBIT_SHADOW_SS,
    278  * CPUMCTX_INHIBIT_SHADOW_STI and CPUMCTX_INHIBIT_NMI.  The next 4 bits are
    279  * taken by CPUMCTX_DBG_HIT_DRX_MASK.
    280  */
    281 #define CPUMX86EFLAGS_INT_MASK_64   UINT64_C(0x000000007f000000)
     279 * Bits 22-24 are taken by CPUMCTX_INHIBIT_SHADOW_SS, CPUMCTX_INHIBIT_SHADOW_STI
     280 * and CPUMCTX_INHIBIT_NMI, bits 25-28 are for CPUMCTX_DBG_HIT_DRX_MASK, and
     281 * bits 29-30 are for DBGF events and breakpoints.
     282 *
     283 * @todo The two DBGF bits could be merged.  The NMI inhibiting could move to
     284 *       bit 32 or higher as it isn't automatically cleared on instruction
     285 *       completion (except for iret).
     286 */
     287#define CPUMX86EFLAGS_INT_MASK_64   UINT64_C(0x00000000ffc00000)
    282288/** Mask of internal flags kept with EFLAGS, 32-bit version. */
    283 #define CPUMX86EFLAGS_INT_MASK_32           UINT32_C(0x7f000000)
     289#define CPUMX86EFLAGS_INT_MASK_32           UINT32_C(0xffc00000)
    284290
    285291
     
    10541060#define CPUMCTX_DBG_HIT_DRX_SHIFT       CPUMCTX_DBG_HIT_DR0_BIT
    10551061/** Mask of all guest pending DR0-DR3 breakpoint indicators. */
    1056 #define CPUMCTX_DBG_HIT_DRX_MASK       (CPUMCTX_DBG_HIT_DR0 | CPUMCTX_DBG_HIT_DR1 | CPUMCTX_DBG_HIT_DR2 | CPUMCTX_DBG_HIT_DR3)
    1057 AssertCompile(CPUMCTX_DBG_HIT_DRX_MASK < UINT32_MAX);
     1062#define CPUMCTX_DBG_HIT_DRX_MASK        (CPUMCTX_DBG_HIT_DR0 | CPUMCTX_DBG_HIT_DR1 | CPUMCTX_DBG_HIT_DR2 | CPUMCTX_DBG_HIT_DR3)
     1063/** DBGF event/breakpoint pending. */
     1064#define CPUMCTX_DBG_DBGF_EVENT          RT_BIT_32(CPUMCTX_DBG_DBGF_EVENT_BIT)
     1065#define CPUMCTX_DBG_DBGF_EVENT_BIT      (7 + CPUMX86EFLAGS_HW_BITS)
     1066/** DBGF event/breakpoint pending. */
     1067#define CPUMCTX_DBG_DBGF_BP             RT_BIT_32(CPUMCTX_DBG_DBGF_BP_BIT)
     1068#define CPUMCTX_DBG_DBGF_BP_BIT         (8 + CPUMX86EFLAGS_HW_BITS)
     1069/** Mask of all DBGF indicators. */
     1070#define CPUMCTX_DBG_DBGF_MASK           (CPUMCTX_DBG_DBGF_EVENT | CPUMCTX_DBG_DBGF_BP)
     1071AssertCompile((CPUMCTX_DBG_HIT_DRX_MASK | CPUMCTX_DBG_DBGF_MASK) < UINT32_MAX);
    10581072/** @}  */
    10591073
  • trunk/include/VBox/vmm/dbgf.h

    r97693 r97705  
    11241124VMM_INT_DECL(VBOXSTRICTRC)  DBGFBpCheckInstruction(PVMCC pVM, PVMCPUCC pVCpu, RTGCPTR GCPtrPC);
    11251125VMM_INT_DECL(VBOXSTRICTRC)  DBGFBpCheckIo(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, RTIOPORT uIoPort, uint8_t cbValue);
     1126VMM_INT_DECL(uint32_t)      DBGFBpCheckIo2(PVMCC pVM, PVMCPUCC pVCpu, RTIOPORT uIoPort, uint8_t cbValue);
    11261127VMM_INT_DECL(VBOXSTRICTRC)  DBGFBpCheckPortIo(PVMCC pVM, PVMCPU pVCpu, RTIOPORT uIoPort,
    11271128                                              uint32_t fAccess, uint32_t uValue, bool fBefore);
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