Changeset 97213 in vbox
- Timestamp:
- Oct 18, 2022 3:00:16 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/types.h
r96407 r97213 500 500 /** Pointer to a const CPUMCTX. */ 501 501 typedef const struct CPUMCTX *PCCPUMCTX; 502 503 /** Pointer to a CPU context core. */504 typedef struct CPUMCTXCORE *PCPUMCTXCORE;505 /** Pointer to a const CPU context core. */506 typedef const struct CPUMCTXCORE *PCCPUMCTXCORE;507 502 508 503 /** Pointer to a selector register. */ -
trunk/include/VBox/vmm/cpum.h
r97187 r97213 3059 3059 VMM_INT_DECL(PCPUMCTXMSRS) CPUMQueryGuestCtxMsrsPtr(PVMCPU pVCpu); 3060 3060 #endif 3061 VMMDECL(PCCPUMCTXCORE) CPUMGetGuestCtxCore(PVMCPU pVCpu);3062 3061 3063 3062 /** @name Changed flags. -
trunk/include/VBox/vmm/cpum.mac
r97178 r97213 85 85 %define CPUMUNKNOWNCPUID_PASSTHRU 4 86 86 ;; @} 87 88 89 ;;90 ; Registers frame.91 ; This is used internally in TRPM, VMMSwitcher_GuestToHost_GuestCtx92 ; and other places.93 struc CPUMCTXCORE94 .eax resq 195 .ecx resq 196 .edx resq 197 .ebx resq 198 .esp resq 199 .ebp resq 1100 .esi resq 1101 .edi resq 1102 .r8 resq 1103 .r9 resq 1104 .r10 resq 1105 .r11 resq 1106 .r12 resq 1107 .r13 resq 1108 .r14 resq 1109 .r15 resq 1110 .es.Sel resw 1111 .es.PaddingSel resw 1112 .es.ValidSel resw 1113 .es.fFlags resw 1114 .es.u64Base resq 1115 .es.u32Limit resd 1116 .es.Attr resd 1117 .cs.Sel resw 1118 .cs.PaddingSel resw 1119 .cs.ValidSel resw 1120 .cs.fFlags resw 1121 .cs.u64Base resq 1122 .cs.u32Limit resd 1123 .cs.Attr resd 1124 .ss.Sel resw 1125 .ss.PaddingSel resw 1126 .ss.ValidSel resw 1127 .ss.fFlags resw 1128 .ss.u64Base resq 1129 .ss.u32Limit resd 1130 .ss.Attr resd 1131 .ds.Sel resw 1132 .ds.PaddingSel resw 1133 .ds.ValidSel resw 1134 .ds.fFlags resw 1135 .ds.u64Base resq 1136 .ds.u32Limit resd 1137 .ds.Attr resd 1138 .fs.Sel resw 1139 .fs.PaddingSel resw 1140 .fs.ValidSel resw 1141 .fs.fFlags resw 1142 .fs.u64Base resq 1143 .fs.u32Limit resd 1144 .fs.Attr resd 1145 .gs.Sel resw 1146 .gs.PaddingSel resw 1147 .gs.ValidSel resw 1148 .gs.fFlags resw 1149 .gs.u64Base resq 1150 .gs.u32Limit resd 1151 .gs.Attr resd 1152 153 .ldtr.Sel resw 1154 .ldtr.PaddingSel resw 1155 .ldtr.ValidSel resw 1156 .ldtr.fFlags resw 1157 .ldtr.u64Base resq 1158 .ldtr.u32Limit resd 1159 .ldtr.Attr resd 1160 .tr.Sel resw 1161 .tr.PaddingSel resw 1162 .tr.ValidSel resw 1163 .tr.fFlags resw 1164 .tr.u64Base resq 1165 .tr.u32Limit resd 1166 .tr.Attr resd 1167 168 .eip resq 1169 .eflags resq 1170 endstruc171 87 172 88 -
trunk/include/VBox/vmm/cpumctx.h
r97178 r97213 176 176 #endif 177 177 178 179 180 /**181 * CPU context core.182 *183 * @todo Eliminate this structure!184 * @deprecated We don't push any context cores any more in TRPM.185 */186 #pragma pack(1)187 typedef struct CPUMCTXCORE188 {189 /** @name General Register.190 * @note These follow the encoding order (X86_GREG_XXX) and can be accessed as191 * an array starting a rax.192 * @{ */193 union194 {195 uint8_t al;196 uint16_t ax;197 uint32_t eax;198 uint64_t rax;199 } CPUM_UNION_NM(rax);200 union201 {202 uint8_t cl;203 uint16_t cx;204 uint32_t ecx;205 uint64_t rcx;206 } CPUM_UNION_NM(rcx);207 union208 {209 uint8_t dl;210 uint16_t dx;211 uint32_t edx;212 uint64_t rdx;213 } CPUM_UNION_NM(rdx);214 union215 {216 uint8_t bl;217 uint16_t bx;218 uint32_t ebx;219 uint64_t rbx;220 } CPUM_UNION_NM(rbx);221 union222 {223 uint16_t sp;224 uint32_t esp;225 uint64_t rsp;226 } CPUM_UNION_NM(rsp);227 union228 {229 uint16_t bp;230 uint32_t ebp;231 uint64_t rbp;232 } CPUM_UNION_NM(rbp);233 union234 {235 uint8_t sil;236 uint16_t si;237 uint32_t esi;238 uint64_t rsi;239 } CPUM_UNION_NM(rsi);240 union241 {242 uint8_t dil;243 uint16_t di;244 uint32_t edi;245 uint64_t rdi;246 } CPUM_UNION_NM(rdi);247 uint64_t r8;248 uint64_t r9;249 uint64_t r10;250 uint64_t r11;251 uint64_t r12;252 uint64_t r13;253 uint64_t r14;254 uint64_t r15;255 /** @} */256 257 /** @name Segment registers.258 * @note These follow the encoding order (X86_SREG_XXX) and can be accessed as259 * an array starting a es.260 * @{ */261 CPUMSELREG es;262 CPUMSELREG cs;263 CPUMSELREG ss;264 CPUMSELREG ds;265 CPUMSELREG fs;266 CPUMSELREG gs;267 /** @} */268 269 CPUMSELREG ldtr;270 CPUMSELREG tr;271 272 /** The program counter. */273 union274 {275 uint16_t ip;276 uint32_t eip;277 uint64_t rip;278 } CPUM_UNION_NM(rip);279 280 /** The flags register. */281 union282 {283 X86EFLAGS eflags;284 X86RFLAGS rflags;285 } CPUM_UNION_NM(rflags);286 287 } CPUMCTXCORE;288 #pragma pack()289 178 290 179 … … 346 235 typedef struct CPUMCTX 347 236 { 348 /** CPUMCTXCORE Part.349 * @{ */350 351 237 /** General purpose registers. */ 352 238 union /* no tag! */ … … 423 309 X86RFLAGS rflags; 424 310 } CPUM_UNION_NM(rflags); 425 426 /** @} */ /*(CPUMCTXCORE)*/427 311 428 312 /** Interrupt & exception inhibiting (CPUMCTX_INHIBIT_XXX). */ … … 851 735 852 736 /** 853 * Gets the CPUMCTXCORE part of a CPUMCTX.854 */855 # define CPUMCTX2CORE(pCtx) ((PCPUMCTXCORE)(void *)&(pCtx)->rax)856 857 /**858 * Gets the CPUMCTX part from a CPUMCTXCORE.859 */860 # define CPUMCTX_FROM_CORE(a_pCtxCore) RT_FROM_MEMBER(a_pCtxCore, CPUMCTX, rax)861 862 /**863 737 * Gets the first selector register of a CPUMCTX. 864 738 * -
trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp
r96407 r97213 764 764 } 765 765 766 VMMDECL(PCCPUMCTXCORE) CPUMGetGuestCtxCore(PVMCPU pVCpu)767 {768 return NULL;769 }770 771 766 VMMDECL(uint32_t) CPUMGetGuestEIP(PCVMCPU pVCpu) 772 767 { -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r97178 r97213 184 184 { 185 185 return pVCpu->cpum.s.Hyper.dr[7]; 186 }187 188 189 /**190 * Gets the pointer to the internal CPUMCTXCORE structure.191 * This is only for reading in order to save a few calls.192 *193 * @param pVCpu The cross context virtual CPU structure.194 */195 VMMDECL(PCCPUMCTXCORE) CPUMGetGuestCtxCore(PVMCPU pVCpu)196 {197 return CPUMCTX2CORE(&pVCpu->cpum.s.Guest);198 186 } 199 187 -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r97208 r97213 10421 10421 10422 10422 10423 #if 0 /* The IRET-to-v8086 mode in PATM is very optimistic, so I don't dare do this yet. */10424 /**10425 * Executes a IRET instruction with default operand size.10426 *10427 * This is for PATM.10428 *10429 * @returns VBox status code.10430 * @param pVCpu The cross context virtual CPU structure of the calling EMT.10431 * @param pCtxCore The register frame.10432 */10433 VMM_INT_DECL(int) IEMExecInstr_iret(PVMCPUCC pVCpu, PCPUMCTXCORE pCtxCore)10434 {10435 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);10436 10437 iemCtxCoreToCtx(pCtx, pCtxCore);10438 iemInitDecoder(pVCpu);10439 VBOXSTRICTRC rcStrict = iemCImpl_iret(pVCpu, 1, pVCpu->iem.s.enmDefOpSize);10440 if (rcStrict == VINF_SUCCESS)10441 iemCtxToCtxCore(pCtxCore, pCtx);10442 else10443 LogFlow(("IEMExecInstr_iret: cs:rip=%04x:%08RX64 ss:rsp=%04x:%08RX64 EFL=%06x - rcStrict=%Rrc\n",10444 pVCpu->cpum.GstCtx.cs, pVCpu->cpum.GstCtx.rip, pVCpu->cpum.GstCtx.ss, pVCpu->cpum.GstCtx.rsp, pVCpu->cpum.GstCtx.eflags.u, VBOXSTRICTRC_VAL(rcStrict)));10445 return rcStrict;10446 }10447 #endif10448 10449 10450 10423 /** 10451 10424 * Interface for HM and EM for executing string I/O OUT (write) instructions. -
trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp
r97193 r97213 455 455 SelInfo.u.Raw.Gen.u4LimitHigh = 0xf; 456 456 457 pSRegCS = &CPUM GetGuestCtxCore(pVCpu)->cs;457 pSRegCS = &CPUMQueryGuestCtxPtr(pVCpu)->cs; 458 458 if (CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, pSRegCS)) 459 459 { -
trunk/src/VBox/VMM/dtrace/lib/vbox-types.d
r96407 r97213 51 51 typedef struct SUPDRVSESSION *PSUPDRVSESSION; 52 52 typedef struct UVM *PUVM; 53 typedef struct CPUMCTX CORE *PCPUMCTXCORE;53 typedef struct CPUMCTX *PCPUMCTX; 54 54 typedef struct SVMVMCB *PSVMVMCB; 55 55 typedef uint32_t VMXVDIAG; -
trunk/src/VBox/VMM/include/CPUMInternal.h
r96407 r97213 55 55 * @{ 56 56 */ 57 58 /** Flags and types for CPUM fault handlers59 * @{ */60 /** Type: Load DS */61 #define CPUM_HANDLER_DS 162 /** Type: Load ES */63 #define CPUM_HANDLER_ES 264 /** Type: Load FS */65 #define CPUM_HANDLER_FS 366 /** Type: Load GS */67 #define CPUM_HANDLER_GS 468 /** Type: IRET */69 #define CPUM_HANDLER_IRET 570 /** Type mask. */71 #define CPUM_HANDLER_TYPEMASK 0xff72 /** If set EBP points to the CPUMCTXCORE that's being used. */73 #define CPUM_HANDLER_CTXCORE_IN_EBP RT_BIT(31)74 /** @} */75 76 57 77 58 /** Use flags (CPUM::fUseFlags). -
trunk/src/VBox/VMM/include/CPUMInternal.mac
r97178 r97213 75 75 %define CPUM_USE_FFXSR_LEAKY RT_BIT(19) 76 76 %define CPUM_USE_SUPPORTS_LONGMODE RT_BIT(20) 77 78 %define CPUM_HANDLER_DS 179 %define CPUM_HANDLER_ES 280 %define CPUM_HANDLER_FS 381 %define CPUM_HANDLER_GS 482 %define CPUM_HANDLER_IRET 583 %define CPUM_HANDLER_TYPEMASK 0ffh84 %define CPUM_HANDLER_CTXCORE_IN_EBP RT_BIT(31)85 77 86 78 -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r97178 r97213 226 226 227 227 GEN_CHECK_SIZE(CPUMCTXMSRS); 228 GEN_CHECK_SIZE(CPUMCTXCORE);229 228 230 229 #ifndef VBOX_FOR_DTRACE_LIB -
trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
r97150 r97213 110 110 } while (0) 111 111 112 #define CHECK_CPUMCTXCORE(member) \113 do { \114 unsigned off1 = RT_OFFSETOF(CPUMCTX, member) - RT_OFFSETOF(CPUMCTX, rax); \115 unsigned off2 = RT_OFFSETOF(CPUMCTXCORE, member); \116 if (off1 != off2) \117 { \118 RTPrintf("error! CPUMCTX/CORE:: %s! (%#x vs %#x (ctx))\n", #member, off1, off2); \119 rc++; \120 } \121 } while (0)122 123 112 #define CHECK_PADDING_UVM(align, member) \ 124 113 do \ … … 284 273 CHECK_MEMBER_ALIGNMENT(CPUMCTX, SysEnter, 8); 285 274 CHECK_MEMBER_ALIGNMENT(CPUMCTX, hwvirt, 8); 286 CHECK_CPUMCTXCORE(rax);287 CHECK_CPUMCTXCORE(rcx);288 CHECK_CPUMCTXCORE(rdx);289 CHECK_CPUMCTXCORE(rbx);290 CHECK_CPUMCTXCORE(rsp);291 CHECK_CPUMCTXCORE(rbp);292 CHECK_CPUMCTXCORE(rsi);293 CHECK_CPUMCTXCORE(rdi);294 CHECK_CPUMCTXCORE(r8);295 CHECK_CPUMCTXCORE(r9);296 CHECK_CPUMCTXCORE(r10);297 CHECK_CPUMCTXCORE(r11);298 CHECK_CPUMCTXCORE(r12);299 CHECK_CPUMCTXCORE(r13);300 CHECK_CPUMCTXCORE(r14);301 CHECK_CPUMCTXCORE(r15);302 CHECK_CPUMCTXCORE(es);303 CHECK_CPUMCTXCORE(ss);304 CHECK_CPUMCTXCORE(cs);305 CHECK_CPUMCTXCORE(ds);306 CHECK_CPUMCTXCORE(fs);307 CHECK_CPUMCTXCORE(gs);308 CHECK_CPUMCTXCORE(rip);309 CHECK_CPUMCTXCORE(rflags);310 275 311 276 #if HC_ARCH_BITS == 32
Note:
See TracChangeset
for help on using the changeset viewer.