Changeset 97286 in vbox for trunk/include
- Timestamp:
- Oct 24, 2022 10:15:44 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 154277
- Location:
- trunk/include/VBox/vmm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r97262 r97286 1931 1931 * @param pCtx Current guest CPU context. 1932 1932 * @note Requires pCtx->rip to be up to date. 1933 * @note Does not clear fInhibit when CPUMCTX::uRipInhibitInt differs1934 * from CPUMCTX::rip.1933 * @note Does NOT clear CPUMCTX_INHIBIT_SHADOW when CPUMCTX::uRipInhibitInt 1934 * differs from CPUMCTX::rip. 1935 1935 */ 1936 1936 DECLINLINE(bool) CPUMIsInInterruptShadow(PCCPUMCTX pCtx) 1937 1937 { 1938 if (!(pCtx-> fInhibit& CPUMCTX_INHIBIT_SHADOW))1938 if (!(pCtx->eflags.uBoth & CPUMCTX_INHIBIT_SHADOW)) 1939 1939 return false; 1940 1940 … … 1956 1956 DECLINLINE(bool) CPUMIsInInterruptShadowWithUpdate(PCPUMCTX pCtx) 1957 1957 { 1958 if (!(pCtx-> fInhibit& CPUMCTX_INHIBIT_SHADOW))1958 if (!(pCtx->eflags.uBoth & CPUMCTX_INHIBIT_SHADOW)) 1959 1959 return false; 1960 1960 … … 1963 1963 return true; 1964 1964 1965 pCtx-> fInhibit &= (uint8_t)~CPUMCTX_INHIBIT_SHADOW;1965 pCtx->eflags.uBoth &= ~CPUMCTX_INHIBIT_SHADOW; 1966 1966 return false; 1967 1967 } … … 1977 1977 * @param pCtx Current guest CPU context. 1978 1978 * @note Requires pCtx->rip to be up to date. 1979 * @note Does not clear fInhibit when CPUMCTX::uRipInhibitInt differs1980 * from CPUMCTX::rip.1979 * @note Does NOT clear CPUMCTX_INHIBIT_SHADOW when CPUMCTX::uRipInhibitInt 1980 * differs from CPUMCTX::rip. 1981 1981 * @note Both CPUMIsInInterruptShadowAfterSti() and this function may return 1982 1982 * true depending on the execution engine being used. … … 1984 1984 DECLINLINE(bool) CPUMIsInInterruptShadowAfterSs(PCCPUMCTX pCtx) 1985 1985 { 1986 if (!(pCtx-> fInhibit& CPUMCTX_INHIBIT_SHADOW_SS))1986 if (!(pCtx->eflags.uBoth & CPUMCTX_INHIBIT_SHADOW_SS)) 1987 1987 return false; 1988 1988 … … 2000 2000 * @param pCtx Current guest CPU context. 2001 2001 * @note Requires pCtx->rip to be up to date. 2002 * @note Does not clear fInhibit when CPUMCTX::uRipInhibitInt differs2003 * from CPUMCTX::rip.2002 * @note Does NOT clear CPUMCTX_INHIBIT_SHADOW when CPUMCTX::uRipInhibitInt 2003 * differs from CPUMCTX::rip. 2004 2004 * @note Both CPUMIsInInterruptShadowAfterSs() and this function may return 2005 2005 * true depending on the execution engine being used. … … 2007 2007 DECLINLINE(bool) CPUMIsInInterruptShadowAfterSti(PCCPUMCTX pCtx) 2008 2008 { 2009 if (!(pCtx-> fInhibit& CPUMCTX_INHIBIT_SHADOW_STI))2009 if (!(pCtx->eflags.uBoth & CPUMCTX_INHIBIT_SHADOW_STI)) 2010 2010 return false; 2011 2011 … … 2023 2023 { 2024 2024 CPUMCTX_ASSERT_NOT_EXTRN(pCtx, CPUMCTX_EXTRN_RIP); 2025 pCtx-> fInhibit|= CPUMCTX_INHIBIT_SHADOW;2025 pCtx->eflags.uBoth |= CPUMCTX_INHIBIT_SHADOW; 2026 2026 pCtx->uRipInhibitInt = pCtx->rip; 2027 2027 } … … 2036 2036 DECLINLINE(void) CPUMSetInInterruptShadowEx(PCPUMCTX pCtx, uint64_t rip) 2037 2037 { 2038 pCtx-> fInhibit|= CPUMCTX_INHIBIT_SHADOW;2038 pCtx->eflags.uBoth |= CPUMCTX_INHIBIT_SHADOW; 2039 2039 pCtx->uRipInhibitInt = rip; 2040 2040 } … … 2049 2049 { 2050 2050 CPUMCTX_ASSERT_NOT_EXTRN(pCtx, CPUMCTX_EXTRN_RIP); 2051 pCtx-> fInhibit|= CPUMCTX_INHIBIT_SHADOW_SS;2051 pCtx->eflags.uBoth |= CPUMCTX_INHIBIT_SHADOW_SS; 2052 2052 pCtx->uRipInhibitInt = pCtx->rip; 2053 2053 } … … 2062 2062 { 2063 2063 CPUMCTX_ASSERT_NOT_EXTRN(pCtx, CPUMCTX_EXTRN_RIP); 2064 pCtx-> fInhibit|= CPUMCTX_INHIBIT_SHADOW_STI;2064 pCtx->eflags.uBoth |= CPUMCTX_INHIBIT_SHADOW_STI; 2065 2065 pCtx->uRipInhibitInt = pCtx->rip; 2066 2066 } … … 2073 2073 DECLINLINE(void) CPUMClearInterruptShadow(PCPUMCTX pCtx) 2074 2074 { 2075 pCtx-> fInhibit &= (uint8_t)~CPUMCTX_INHIBIT_SHADOW;2075 pCtx->eflags.uBoth &= ~CPUMCTX_INHIBIT_SHADOW; 2076 2076 } 2077 2077 … … 2087 2087 CPUMCTX_ASSERT_NOT_EXTRN(pCtx, CPUMCTX_EXTRN_RIP); 2088 2088 if (!fInhibited) 2089 pCtx-> fInhibit &= (uint8_t)~CPUMCTX_INHIBIT_SHADOW;2089 pCtx->eflags.uBoth &= ~CPUMCTX_INHIBIT_SHADOW; 2090 2090 else 2091 2091 { 2092 pCtx-> fInhibit|= CPUMCTX_INHIBIT_SHADOW;2092 pCtx->eflags.uBoth |= CPUMCTX_INHIBIT_SHADOW; 2093 2093 pCtx->uRipInhibitInt = pCtx->rip; 2094 2094 } … … 2106 2106 { 2107 2107 if (!fInhibited) 2108 pCtx-> fInhibit &= (uint8_t)~CPUMCTX_INHIBIT_SHADOW;2108 pCtx->eflags.uBoth &= ~CPUMCTX_INHIBIT_SHADOW; 2109 2109 else 2110 2110 { 2111 pCtx-> fInhibit|= CPUMCTX_INHIBIT_SHADOW;2111 pCtx->eflags.uBoth |= CPUMCTX_INHIBIT_SHADOW; 2112 2112 pCtx->uRipInhibitInt = rip; 2113 2113 } … … 2126 2126 { 2127 2127 if (!(fInhibitedBySs | fInhibitedBySti)) 2128 pCtx-> fInhibit &= (uint8_t)~CPUMCTX_INHIBIT_SHADOW;2128 pCtx->eflags.uBoth &= ~CPUMCTX_INHIBIT_SHADOW; 2129 2129 else 2130 2130 { 2131 pCtx-> fInhibit |= (fInhibitedBySs ? (uint8_t)CPUMCTX_INHIBIT_SHADOW_SS : (uint8_t)0)2132 | (fInhibitedBySti ? (uint8_t)CPUMCTX_INHIBIT_SHADOW_STI : (uint8_t)0);2131 pCtx->eflags.uBoth |= (fInhibitedBySs ? CPUMCTX_INHIBIT_SHADOW_SS : UINT32_C(0)) 2132 | (fInhibitedBySti ? CPUMCTX_INHIBIT_SHADOW_STI : UINT32_C(0)); 2133 2133 pCtx->uRipInhibitInt = rip; 2134 2134 } … … 2153 2153 DECLINLINE(bool) CPUMAreInterruptsInhibitedByNmi(PCCPUMCTX pCtx) 2154 2154 { 2155 return (pCtx-> fInhibit& CPUMCTX_INHIBIT_NMI) != 0;2155 return (pCtx->eflags.uBoth & CPUMCTX_INHIBIT_NMI) != 0; 2156 2156 } 2157 2157 … … 2180 2180 DECLINLINE(void) CPUMSetInterruptInhibitingByNmi(PCPUMCTX pCtx) 2181 2181 { 2182 pCtx-> fInhibit|= CPUMCTX_INHIBIT_NMI;2182 pCtx->eflags.uBoth |= CPUMCTX_INHIBIT_NMI; 2183 2183 } 2184 2184 … … 2207 2207 DECLINLINE(void) CPUMClearInterruptInhibitingByNmi(PCPUMCTX pCtx) 2208 2208 { 2209 pCtx-> fInhibit &= (uint8_t)~CPUMCTX_INHIBIT_NMI;2209 pCtx->eflags.uBoth &= ~CPUMCTX_INHIBIT_NMI; 2210 2210 } 2211 2211 … … 2236 2236 { 2237 2237 if (!fInhibited) 2238 pCtx-> fInhibit &= (uint8_t)~CPUMCTX_INHIBIT_NMI;2238 pCtx->eflags.uBoth &= ~CPUMCTX_INHIBIT_NMI; 2239 2239 else 2240 pCtx-> fInhibit|= CPUMCTX_INHIBIT_NMI;2240 pCtx->eflags.uBoth |= CPUMCTX_INHIBIT_NMI; 2241 2241 } 2242 2242 -
trunk/include/VBox/vmm/cpum.mac
r97213 r97286 165 165 .eip resq 1 166 166 .eflags resq 1 167 . fInhibit resb 1167 .abPadding resb 8 168 168 alignb 8 169 169 .uRipInhibitInt resq 1 -
trunk/include/VBox/vmm/cpumctx.h
r97281 r97286 274 274 #endif 275 275 276 /** Mask of internal flags kept with EFLAGS, 64-bit version. */ 277 #define CPUMX86EFLAGS_INT_MASK_64 UINT64_C(0x0000000000000000) 278 /** Mask of internal flags kept with EFLAGS, 32-bit version. */ 279 #define CPUMX86EFLAGS_INT_MASK_32 UINT64_C(0x0000000000000000) 276 /** 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. 279 */ 280 #define CPUMX86EFLAGS_INT_MASK_64 UINT64_C(0x0000000007000000) 281 /** Mask of internal flags kept with EFLAGS, 32-bit version. */ 282 #define CPUMX86EFLAGS_INT_MASK_32 UINT32_C(0x07000000) 280 283 281 284 … … 414 417 } CPUM_UNION_NM(rflags); 415 418 416 /** Interrupt & exception inhibiting (CPUMCTX_INHIBIT_XXX). */ 417 uint8_t fInhibit; 418 uint8_t abPadding[7]; 419 /** The RIP value fInhibit is/was valid for. */ 419 uint8_t abPadding[8]; 420 /** The RIP value an interrupt shadow is/was valid for. */ 420 421 uint64_t uRipInhibitInt; 421 422 … … 674 675 AssertCompileMemberOffset(CPUMCTX, rip, 0x0140); 675 676 AssertCompileMemberOffset(CPUMCTX, rflags, 0x0148); 676 AssertCompileMemberOffset(CPUMCTX, fInhibit, 0x0150);677 677 AssertCompileMemberOffset(CPUMCTX, uRipInhibitInt, 0x0158); 678 678 AssertCompileMemberOffset(CPUMCTX, cr0, 0x0160); … … 1016 1016 * instructions will have any effect on the instruction following the last one 1017 1017 * of them. */ 1018 #define CPUMCTX_INHIBIT_SHADOW_SS UINT8_C(0x01)1018 #define CPUMCTX_INHIBIT_SHADOW_SS RT_BIT_32(0 + CPUMX86EFLAGS_HW_BITS) 1019 1019 /** Interrupt shadow following STI. 1020 1020 * Same as CPUMCTX_INHIBIT_SHADOW_SS but without blocking any debug exceptions. */ 1021 #define CPUMCTX_INHIBIT_SHADOW_STI UINT8_C(0x02)1021 #define CPUMCTX_INHIBIT_SHADOW_STI RT_BIT_32(1 + CPUMX86EFLAGS_HW_BITS) 1022 1022 /** Mask combining STI and SS shadowing. */ 1023 #define CPUMCTX_INHIBIT_SHADOW (CPUMCTX_INHIBIT_SHADOW_SS | CPUMCTX_INHIBIT_SHADOW_STI)1023 #define CPUMCTX_INHIBIT_SHADOW (CPUMCTX_INHIBIT_SHADOW_SS | CPUMCTX_INHIBIT_SHADOW_STI) 1024 1024 1025 1025 /** Interrupts blocked by NMI delivery. This condition is cleared by IRET. … … 1030 1030 * handler has completed executing." This flag indicates that these 1031 1031 * conditions are currently active. */ 1032 #define CPUMCTX_INHIBIT_NMI UINT8_C(0x04) 1032 #define CPUMCTX_INHIBIT_NMI RT_BIT_32(2 + CPUMX86EFLAGS_HW_BITS) 1033 1034 /** Mask containing all the interrupt inhibit bits. */ 1035 #define CPUMCTX_INHIBIT_ALL_MASK (CPUMCTX_INHIBIT_SHADOW_SS | CPUMCTX_INHIBIT_SHADOW_STI | CPUMCTX_INHIBIT_NMI) 1036 AssertCompile(CPUMCTX_INHIBIT_ALL_MASK < UINT32_MAX); 1033 1037 /** @} */ 1034 1038 -
trunk/include/VBox/vmm/vm.h
r97178 r97286 521 521 /* 22 used to be VMCPU_FF_SELM_SYNC_GDT (raw-mode only). */ 522 522 /* 23 used to be VMCPU_FF_SELM_SYNC_LDT (raw-mode only). */ 523 /* 24 used to be VMCPU_FF_INHIBIT_INTERRUPTS, which moved to CPUMCTX:: fInhibitin v7.0.4. */524 /* 25 used to be VMCPU_FF_BLOCK_NMIS, which moved to CPUMCTX:: fInhibitin v7.0.4. */523 /* 24 used to be VMCPU_FF_INHIBIT_INTERRUPTS, which moved to CPUMCTX::eflags.uBoth in v7.0.4. */ 524 /* 25 used to be VMCPU_FF_BLOCK_NMIS, which moved to CPUMCTX::eflags.uBoth in v7.0.4. */ 525 525 /** Force return to Ring-3. */ 526 526 #define VMCPU_FF_TO_R3 RT_BIT_64(VMCPU_FF_TO_R3_BIT)
Note:
See TracChangeset
for help on using the changeset viewer.