Changeset 41902 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 23, 2012 8:32:12 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r41899 r41902 259 259 static const SSMFIELD g_aCpumCtxFieldsV16[] = 260 260 { 261 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.FCW),262 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.FSW),263 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.FTW),264 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.FOP),265 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.FPUIP),266 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.CS),267 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.Rsrvd1),268 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.FPUDP),269 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.DS),270 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.Rsrvd2),271 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.MXCSR),272 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.MXCSR_MASK),273 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aRegs[0]),274 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aRegs[1]),275 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aRegs[2]),276 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aRegs[3]),277 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aRegs[4]),278 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aRegs[5]),279 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aRegs[6]),280 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aRegs[7]),281 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[0]),282 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[1]),283 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[2]),284 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[3]),285 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[4]),286 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[5]),287 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[6]),288 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[7]),289 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[8]),290 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[9]),291 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[10]),292 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[11]),293 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[12]),294 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[13]),295 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[14]),296 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fpu.aXMM[15]),297 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, fpu.au32RsrvdRest),298 SSMFIELD_ENTRY( CPUMCTX_VER1_6, rdi),299 SSMFIELD_ENTRY( CPUMCTX_VER1_6, rsi),300 SSMFIELD_ENTRY( CPUMCTX_VER1_6, rbp),301 SSMFIELD_ENTRY( CPUMCTX_VER1_6, rax),302 SSMFIELD_ENTRY( CPUMCTX_VER1_6, rbx),303 SSMFIELD_ENTRY( CPUMCTX_VER1_6, rdx),304 SSMFIELD_ENTRY( CPUMCTX_VER1_6, rcx),305 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, esp),306 SSMFIELD_ENTRY( CPUMCTX_VER1_6, ss),307 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, ssPadding),308 SSMFIELD_ENTRY_ IGNORE( CPUMCTX_VER1_6, rsp_notused),309 SSMFIELD_ENTRY( CPUMCTX_VER1_6, gs),310 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, gsPadding),311 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fs),312 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, fsPadding),313 SSMFIELD_ENTRY( CPUMCTX_VER1_6, es),314 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, esPadding),315 SSMFIELD_ENTRY( CPUMCTX_VER1_6, ds),316 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, dsPadding),317 SSMFIELD_ENTRY( CPUMCTX_VER1_6, cs),318 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, csPadding),319 SSMFIELD_ENTRY( CPUMCTX_VER1_6, rflags),320 SSMFIELD_ENTRY( CPUMCTX_VER1_6, rip),321 SSMFIELD_ENTRY( CPUMCTX_VER1_6, r8),322 SSMFIELD_ENTRY( CPUMCTX_VER1_6, r9),323 SSMFIELD_ENTRY( CPUMCTX_VER1_6, r10),324 SSMFIELD_ENTRY( CPUMCTX_VER1_6, r11),325 SSMFIELD_ENTRY( CPUMCTX_VER1_6, r12),326 SSMFIELD_ENTRY( CPUMCTX_VER1_6, r13),327 SSMFIELD_ENTRY( CPUMCTX_VER1_6, r14),328 SSMFIELD_ENTRY( CPUMCTX_VER1_6, r15),329 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, esHid.u32Base),330 SSMFIELD_ENTRY( CPUMCTX_VER1_6, esHid.u32Limit),331 SSMFIELD_ENTRY( CPUMCTX_VER1_6, esHid.Attr),332 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, csHid.u32Base),333 SSMFIELD_ENTRY( CPUMCTX_VER1_6, csHid.u32Limit),334 SSMFIELD_ENTRY( CPUMCTX_VER1_6, csHid.Attr),335 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, ssHid.u32Base),336 SSMFIELD_ENTRY( CPUMCTX_VER1_6, ssHid.u32Limit),337 SSMFIELD_ENTRY( CPUMCTX_VER1_6, ssHid.Attr),338 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, dsHid.u32Base),339 SSMFIELD_ENTRY( CPUMCTX_VER1_6, dsHid.u32Limit),340 SSMFIELD_ENTRY( CPUMCTX_VER1_6, dsHid.Attr),341 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, fsHid.u32Base),342 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fsHid.u32Limit),343 SSMFIELD_ENTRY( CPUMCTX_VER1_6, fsHid.Attr),344 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, gsHid.u32Base),345 SSMFIELD_ENTRY( CPUMCTX_VER1_6, gsHid.u32Limit),346 SSMFIELD_ENTRY( CPUMCTX_VER1_6, gsHid.Attr),347 SSMFIELD_ENTRY( CPUMCTX_VER1_6, cr0),348 SSMFIELD_ENTRY( CPUMCTX_VER1_6, cr2),349 SSMFIELD_ENTRY( CPUMCTX_VER1_6, cr3),350 SSMFIELD_ENTRY( CPUMCTX_VER1_6, cr4),351 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, cr8),352 SSMFIELD_ENTRY( CPUMCTX_VER1_6, dr0),353 SSMFIELD_ENTRY( CPUMCTX_VER1_6, dr1),354 SSMFIELD_ENTRY( CPUMCTX_VER1_6, dr2),355 SSMFIELD_ENTRY( CPUMCTX_VER1_6, dr3),356 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, dr4),357 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, dr5),358 SSMFIELD_ENTRY _IGNORE( CPUMCTX_VER1_6, dr6),359 SSMFIELD_ENTRY( CPUMCTX_VER1_6, dr7),360 SSMFIELD_ENTRY( CPUMCTX_VER1_6, gdtr.cbGdt),361 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, gdtr.pGdt),362 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, gdtrPadding),363 SSMFIELD_ENTRY_ IGNORE( CPUMCTX_VER1_6, gdtrPadding64),364 SSMFIELD_ENTRY( CPUMCTX_VER1_6, idtr.cbIdt),365 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, idtr.pIdt),366 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, idtrPadding),367 SSMFIELD_ENTRY_ IGNORE( CPUMCTX_VER1_6, idtrPadding64),368 SSMFIELD_ENTRY( CPUMCTX_VER1_6, ldtr),369 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, ldtrPadding),370 SSMFIELD_ENTRY( CPUMCTX_VER1_6, tr),371 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, trPadding),372 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, SysEnter.cs),373 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, SysEnter.eip),374 SSMFIELD_ENTRY_IGNORE( CPUMCTX_VER1_6, SysEnter.esp),375 SSMFIELD_ENTRY( CPUMCTX_VER1_6, msrEFER),376 SSMFIELD_ENTRY( CPUMCTX_VER1_6, msrSTAR),377 SSMFIELD_ENTRY( CPUMCTX_VER1_6, msrPAT),378 SSMFIELD_ENTRY( CPUMCTX_VER1_6, msrLSTAR),379 SSMFIELD_ENTRY( CPUMCTX_VER1_6, msrCSTAR),380 SSMFIELD_ENTRY( CPUMCTX_VER1_6, msrSFMASK),381 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, msrFSBASE),382 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, msrGSBASE),383 SSMFIELD_ENTRY( CPUMCTX_VER1_6, msrKERNELGSBASE),384 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, ldtrHid.u32Base),385 SSMFIELD_ENTRY( CPUMCTX_VER1_6, ldtrHid.u32Limit),386 SSMFIELD_ENTRY( CPUMCTX_VER1_6, ldtrHid.Attr),387 SSMFIELD_ENTRY ( CPUMCTX_VER1_6, trHid.u32Base),388 SSMFIELD_ENTRY( CPUMCTX_VER1_6, trHid.u32Limit),389 SSMFIELD_ENTRY( CPUMCTX_VER1_6, trHid.Attr),390 SSMFIELD_ENTRY_ IGNORE( CPUMCTX_VER1_6, padding),261 SSMFIELD_ENTRY( CPUMCTX, fpu.FCW), 262 SSMFIELD_ENTRY( CPUMCTX, fpu.FSW), 263 SSMFIELD_ENTRY( CPUMCTX, fpu.FTW), 264 SSMFIELD_ENTRY( CPUMCTX, fpu.FOP), 265 SSMFIELD_ENTRY( CPUMCTX, fpu.FPUIP), 266 SSMFIELD_ENTRY( CPUMCTX, fpu.CS), 267 SSMFIELD_ENTRY( CPUMCTX, fpu.Rsrvd1), 268 SSMFIELD_ENTRY( CPUMCTX, fpu.FPUDP), 269 SSMFIELD_ENTRY( CPUMCTX, fpu.DS), 270 SSMFIELD_ENTRY( CPUMCTX, fpu.Rsrvd2), 271 SSMFIELD_ENTRY( CPUMCTX, fpu.MXCSR), 272 SSMFIELD_ENTRY( CPUMCTX, fpu.MXCSR_MASK), 273 SSMFIELD_ENTRY( CPUMCTX, fpu.aRegs[0]), 274 SSMFIELD_ENTRY( CPUMCTX, fpu.aRegs[1]), 275 SSMFIELD_ENTRY( CPUMCTX, fpu.aRegs[2]), 276 SSMFIELD_ENTRY( CPUMCTX, fpu.aRegs[3]), 277 SSMFIELD_ENTRY( CPUMCTX, fpu.aRegs[4]), 278 SSMFIELD_ENTRY( CPUMCTX, fpu.aRegs[5]), 279 SSMFIELD_ENTRY( CPUMCTX, fpu.aRegs[6]), 280 SSMFIELD_ENTRY( CPUMCTX, fpu.aRegs[7]), 281 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[0]), 282 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[1]), 283 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[2]), 284 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[3]), 285 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[4]), 286 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[5]), 287 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[6]), 288 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[7]), 289 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[8]), 290 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[9]), 291 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[10]), 292 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[11]), 293 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[12]), 294 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[13]), 295 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[14]), 296 SSMFIELD_ENTRY( CPUMCTX, fpu.aXMM[15]), 297 SSMFIELD_ENTRY_IGNORE( CPUMCTX, fpu.au32RsrvdRest), 298 SSMFIELD_ENTRY( CPUMCTX, rdi), 299 SSMFIELD_ENTRY( CPUMCTX, rsi), 300 SSMFIELD_ENTRY( CPUMCTX, rbp), 301 SSMFIELD_ENTRY( CPUMCTX, rax), 302 SSMFIELD_ENTRY( CPUMCTX, rbx), 303 SSMFIELD_ENTRY( CPUMCTX, rdx), 304 SSMFIELD_ENTRY( CPUMCTX, rcx), 305 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, rsp), 306 SSMFIELD_ENTRY( CPUMCTX, ss), 307 SSMFIELD_ENTRY_IGNORE( CPUMCTX, ssPadding), 308 SSMFIELD_ENTRY_OLD( CPUMCTX, sizeof(uint64_t) /*rsp_notused*/), 309 SSMFIELD_ENTRY( CPUMCTX, gs), 310 SSMFIELD_ENTRY_IGNORE( CPUMCTX, gsPadding), 311 SSMFIELD_ENTRY( CPUMCTX, fs), 312 SSMFIELD_ENTRY_IGNORE( CPUMCTX, fsPadding), 313 SSMFIELD_ENTRY( CPUMCTX, es), 314 SSMFIELD_ENTRY_IGNORE( CPUMCTX, esPadding), 315 SSMFIELD_ENTRY( CPUMCTX, ds), 316 SSMFIELD_ENTRY_IGNORE( CPUMCTX, dsPadding), 317 SSMFIELD_ENTRY( CPUMCTX, cs), 318 SSMFIELD_ENTRY_IGNORE( CPUMCTX, csPadding), 319 SSMFIELD_ENTRY( CPUMCTX, rflags), 320 SSMFIELD_ENTRY( CPUMCTX, rip), 321 SSMFIELD_ENTRY( CPUMCTX, r8), 322 SSMFIELD_ENTRY( CPUMCTX, r9), 323 SSMFIELD_ENTRY( CPUMCTX, r10), 324 SSMFIELD_ENTRY( CPUMCTX, r11), 325 SSMFIELD_ENTRY( CPUMCTX, r12), 326 SSMFIELD_ENTRY( CPUMCTX, r13), 327 SSMFIELD_ENTRY( CPUMCTX, r14), 328 SSMFIELD_ENTRY( CPUMCTX, r15), 329 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, esHid.u64Base), 330 SSMFIELD_ENTRY( CPUMCTX, esHid.u32Limit), 331 SSMFIELD_ENTRY( CPUMCTX, esHid.Attr), 332 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, csHid.u64Base), 333 SSMFIELD_ENTRY( CPUMCTX, csHid.u32Limit), 334 SSMFIELD_ENTRY( CPUMCTX, csHid.Attr), 335 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, ssHid.u64Base), 336 SSMFIELD_ENTRY( CPUMCTX, ssHid.u32Limit), 337 SSMFIELD_ENTRY( CPUMCTX, ssHid.Attr), 338 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, dsHid.u64Base), 339 SSMFIELD_ENTRY( CPUMCTX, dsHid.u32Limit), 340 SSMFIELD_ENTRY( CPUMCTX, dsHid.Attr), 341 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, fsHid.u64Base), 342 SSMFIELD_ENTRY( CPUMCTX, fsHid.u32Limit), 343 SSMFIELD_ENTRY( CPUMCTX, fsHid.Attr), 344 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, gsHid.u64Base), 345 SSMFIELD_ENTRY( CPUMCTX, gsHid.u32Limit), 346 SSMFIELD_ENTRY( CPUMCTX, gsHid.Attr), 347 SSMFIELD_ENTRY( CPUMCTX, cr0), 348 SSMFIELD_ENTRY( CPUMCTX, cr2), 349 SSMFIELD_ENTRY( CPUMCTX, cr3), 350 SSMFIELD_ENTRY( CPUMCTX, cr4), 351 SSMFIELD_ENTRY_OLD( cr8, sizeof(uint64_t)), 352 SSMFIELD_ENTRY( CPUMCTX, dr[0]), 353 SSMFIELD_ENTRY( CPUMCTX, dr[1]), 354 SSMFIELD_ENTRY( CPUMCTX, dr[2]), 355 SSMFIELD_ENTRY( CPUMCTX, dr[3]), 356 SSMFIELD_ENTRY_IGNORE( CPUMCTX, dr[4]), 357 SSMFIELD_ENTRY_IGNORE( CPUMCTX, dr[5]), 358 SSMFIELD_ENTRY( CPUMCTX, dr[6]), 359 SSMFIELD_ENTRY( CPUMCTX, dr[7]), 360 SSMFIELD_ENTRY( CPUMCTX, gdtr.cbGdt), 361 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, gdtr.pGdt), 362 SSMFIELD_ENTRY_IGNORE( CPUMCTX, gdtrPadding), 363 SSMFIELD_ENTRY_OLD( gdtrPadding64, sizeof(uint64_t)), 364 SSMFIELD_ENTRY( CPUMCTX, idtr.cbIdt), 365 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, idtr.pIdt), 366 SSMFIELD_ENTRY_IGNORE( CPUMCTX, idtrPadding), 367 SSMFIELD_ENTRY_OLD( idtrPadding64, sizeof(uint64_t)), 368 SSMFIELD_ENTRY( CPUMCTX, ldtr), 369 SSMFIELD_ENTRY_IGNORE( CPUMCTX, ldtrPadding), 370 SSMFIELD_ENTRY( CPUMCTX, tr), 371 SSMFIELD_ENTRY_IGNORE( CPUMCTX, trPadding), 372 SSMFIELD_ENTRY_IGNORE( CPUMCTX, SysEnter.cs), 373 SSMFIELD_ENTRY_IGNORE( CPUMCTX, SysEnter.eip), 374 SSMFIELD_ENTRY_IGNORE( CPUMCTX, SysEnter.esp), 375 SSMFIELD_ENTRY( CPUMCTX, msrEFER), 376 SSMFIELD_ENTRY( CPUMCTX, msrSTAR), 377 SSMFIELD_ENTRY( CPUMCTX, msrPAT), 378 SSMFIELD_ENTRY( CPUMCTX, msrLSTAR), 379 SSMFIELD_ENTRY( CPUMCTX, msrCSTAR), 380 SSMFIELD_ENTRY( CPUMCTX, msrSFMASK), 381 SSMFIELD_ENTRY_OLD( msrFSBASE, sizeof(uint64_t)), 382 SSMFIELD_ENTRY_OLD( msrGSBASE, sizeof(uint64_t)), 383 SSMFIELD_ENTRY( CPUMCTX, msrKERNELGSBASE), 384 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, ldtrHid.u64Base), 385 SSMFIELD_ENTRY( CPUMCTX, ldtrHid.u32Limit), 386 SSMFIELD_ENTRY( CPUMCTX, ldtrHid.Attr), 387 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, trHid.u64Base), 388 SSMFIELD_ENTRY( CPUMCTX, trHid.u32Limit), 389 SSMFIELD_ENTRY( CPUMCTX, trHid.Attr), 390 SSMFIELD_ENTRY_OLD( padding, sizeof(uint32_t)*2), 391 391 SSMFIELD_ENTRY_TERM() 392 392 }; … … 2249 2249 2250 2250 /** 2251 * Load a version 1.6 CPUMCTX structure.2252 *2253 * @returns VBox status code.2254 * @param pVM Pointer to the VM.2255 * @param pCpumctx16 Version 1.6 CPUMCTX2256 */2257 static void cpumR3LoadCPUM1_6(PVM pVM, CPUMCTX_VER1_6 *pCpumctx16)2258 {2259 #define CPUMCTX16_LOADREG(RegName) \2260 pVM->aCpus[0].cpum.s.Guest.RegName = pCpumctx16->RegName;2261 2262 #define CPUMCTX16_LOADDRXREG(RegName) \2263 pVM->aCpus[0].cpum.s.Guest.dr[RegName] = pCpumctx16->dr##RegName;2264 2265 #define CPUMCTX16_LOADHIDREG(RegName) \2266 pVM->aCpus[0].cpum.s.Guest.RegName##Hid.u64Base = pCpumctx16->RegName##Hid.u32Base; \2267 pVM->aCpus[0].cpum.s.Guest.RegName##Hid.u32Limit = pCpumctx16->RegName##Hid.u32Limit; \2268 pVM->aCpus[0].cpum.s.Guest.RegName##Hid.Attr = pCpumctx16->RegName##Hid.Attr;2269 2270 #define CPUMCTX16_LOADSEGREG(RegName) \2271 pVM->aCpus[0].cpum.s.Guest.RegName = pCpumctx16->RegName; \2272 CPUMCTX16_LOADHIDREG(RegName);2273 2274 pVM->aCpus[0].cpum.s.Guest.fpu = pCpumctx16->fpu;2275 2276 CPUMCTX16_LOADREG(rax);2277 CPUMCTX16_LOADREG(rbx);2278 CPUMCTX16_LOADREG(rcx);2279 CPUMCTX16_LOADREG(rdx);2280 CPUMCTX16_LOADREG(rdi);2281 CPUMCTX16_LOADREG(rsi);2282 CPUMCTX16_LOADREG(rbp);2283 CPUMCTX16_LOADREG(esp);2284 CPUMCTX16_LOADREG(rip);2285 CPUMCTX16_LOADREG(rflags);2286 2287 CPUMCTX16_LOADSEGREG(cs);2288 CPUMCTX16_LOADSEGREG(ds);2289 CPUMCTX16_LOADSEGREG(es);2290 CPUMCTX16_LOADSEGREG(fs);2291 CPUMCTX16_LOADSEGREG(gs);2292 CPUMCTX16_LOADSEGREG(ss);2293 2294 CPUMCTX16_LOADREG(r8);2295 CPUMCTX16_LOADREG(r9);2296 CPUMCTX16_LOADREG(r10);2297 CPUMCTX16_LOADREG(r11);2298 CPUMCTX16_LOADREG(r12);2299 CPUMCTX16_LOADREG(r13);2300 CPUMCTX16_LOADREG(r14);2301 CPUMCTX16_LOADREG(r15);2302 2303 CPUMCTX16_LOADREG(cr0);2304 CPUMCTX16_LOADREG(cr2);2305 CPUMCTX16_LOADREG(cr3);2306 CPUMCTX16_LOADREG(cr4);2307 2308 CPUMCTX16_LOADDRXREG(0);2309 CPUMCTX16_LOADDRXREG(1);2310 CPUMCTX16_LOADDRXREG(2);2311 CPUMCTX16_LOADDRXREG(3);2312 CPUMCTX16_LOADDRXREG(4);2313 CPUMCTX16_LOADDRXREG(5);2314 CPUMCTX16_LOADDRXREG(6);2315 CPUMCTX16_LOADDRXREG(7);2316 2317 pVM->aCpus[0].cpum.s.Guest.gdtr.cbGdt = pCpumctx16->gdtr.cbGdt;2318 pVM->aCpus[0].cpum.s.Guest.gdtr.pGdt = pCpumctx16->gdtr.pGdt;2319 pVM->aCpus[0].cpum.s.Guest.idtr.cbIdt = pCpumctx16->idtr.cbIdt;2320 pVM->aCpus[0].cpum.s.Guest.idtr.pIdt = pCpumctx16->idtr.pIdt;2321 2322 CPUMCTX16_LOADREG(ldtr);2323 CPUMCTX16_LOADREG(tr);2324 2325 pVM->aCpus[0].cpum.s.Guest.SysEnter = pCpumctx16->SysEnter;2326 2327 CPUMCTX16_LOADREG(msrEFER);2328 CPUMCTX16_LOADREG(msrSTAR);2329 CPUMCTX16_LOADREG(msrPAT);2330 CPUMCTX16_LOADREG(msrLSTAR);2331 CPUMCTX16_LOADREG(msrCSTAR);2332 CPUMCTX16_LOADREG(msrSFMASK);2333 CPUMCTX16_LOADREG(msrKERNELGSBASE);2334 2335 CPUMCTX16_LOADHIDREG(ldtr);2336 CPUMCTX16_LOADHIDREG(tr);2337 2338 #undef CPUMCTX16_LOADSEGREG2339 #undef CPUMCTX16_LOADHIDREG2340 #undef CPUMCTX16_LOADDRXREG2341 #undef CPUMCTX16_LOADREG2342 }2343 2344 2345 /**2346 2251 * @copydoc FNSSMINTLOADPREP 2347 2252 */ … … 2406 2311 } 2407 2312 2408 if (uVersion == CPUM_SAVED_STATE_VERSION_VER1_6)2313 if (uVersion >= CPUM_SAVED_STATE_VERSION_VER2_1_NOMSR) 2409 2314 { 2410 CPUMCTX_VER1_6 cpumctx16; 2411 memset(&pVM->aCpus[0].cpum.s.Guest, 0, sizeof(pVM->aCpus[0].cpum.s.Guest)); 2412 SSMR3GetStructEx(pSSM, &cpumctx16, sizeof(cpumctx16), fLoad, 2315 uint32_t cCpus; 2316 int rc = SSMR3GetU32(pSSM, &cCpus); AssertRCReturn(rc, rc); 2317 AssertLogRelMsgReturn(cCpus == pVM->cCpus, ("Mismatching CPU counts: saved: %u; configured: %u \n", cCpus, pVM->cCpus), 2318 VERR_SSM_UNEXPECTED_DATA); 2319 } 2320 AssertLogRelMsgReturn( uVersion > CPUM_SAVED_STATE_VERSION_VER2_0 2321 || pVM->cCpus == 1, 2322 ("cCpus=%u\n", pVM->cCpus), 2323 VERR_SSM_UNEXPECTED_DATA); 2324 2325 uint32_t cbMsrs = 0; 2326 if (uVersion > CPUM_SAVED_STATE_VERSION_NO_MSR_SIZE) 2327 { 2328 int rc = SSMR3GetU32(pSSM, &cbMsrs); AssertRCReturn(rc, rc); 2329 AssertLogRelMsgReturn(RT_ALIGN(cbMsrs, sizeof(uint64_t)) == cbMsrs, ("Size of MSRs is misaligned: %#x\n", cbMsrs), 2330 VERR_SSM_UNEXPECTED_DATA); 2331 AssertLogRelMsgReturn(cbMsrs <= sizeof(CPUMCTXMSRS) && cbMsrs > 0, ("Size of MSRs is out of range: %#x\n", cbMsrs), 2332 VERR_SSM_UNEXPECTED_DATA); 2333 } 2334 2335 for (VMCPUID i = 0; i < pVM->cCpus; i++) 2336 { 2337 SSMR3GetStructEx(pSSM, &pVM->aCpus[i].cpum.s.Guest, sizeof(pVM->aCpus[i].cpum.s.Guest), fLoad, 2413 2338 paCpumCtxFields, NULL); 2414 2415 /* Save the old cpumctx state into the new one. */ 2416 cpumR3LoadCPUM1_6(pVM, &cpumctx16); 2417 2418 SSMR3GetU32(pSSM, &pVM->aCpus[0].cpum.s.fUseFlags); 2419 SSMR3GetU32(pSSM, &pVM->aCpus[0].cpum.s.fChanged); 2420 } 2421 else 2422 { 2423 if (uVersion >= CPUM_SAVED_STATE_VERSION_VER2_1_NOMSR) 2339 SSMR3GetU32(pSSM, &pVM->aCpus[i].cpum.s.fUseFlags); 2340 SSMR3GetU32(pSSM, &pVM->aCpus[i].cpum.s.fChanged); 2341 if (uVersion > CPUM_SAVED_STATE_VERSION_NO_MSR_SIZE) 2342 SSMR3GetMem(pSSM, &pVM->aCpus[i].cpum.s.GuestMsrs.au64[0], cbMsrs); 2343 else if (uVersion >= CPUM_SAVED_STATE_VERSION_VER3_0) 2424 2344 { 2425 uint32_t cCpus; 2426 int rc = SSMR3GetU32(pSSM, &cCpus); AssertRCReturn(rc, rc); 2427 AssertLogRelMsgReturn(cCpus == pVM->cCpus, ("Mismatching CPU counts: saved: %u; configured: %u \n", cCpus, pVM->cCpus), 2428 VERR_SSM_UNEXPECTED_DATA); 2429 } 2430 AssertLogRelMsgReturn( uVersion > CPUM_SAVED_STATE_VERSION_VER2_0 2431 || pVM->cCpus == 1, 2432 ("cCpus=%u\n", pVM->cCpus), 2433 VERR_SSM_UNEXPECTED_DATA); 2434 2435 uint32_t cbMsrs = 0; 2436 if (uVersion > CPUM_SAVED_STATE_VERSION_NO_MSR_SIZE) 2437 { 2438 int rc = SSMR3GetU32(pSSM, &cbMsrs); AssertRCReturn(rc, rc); 2439 AssertLogRelMsgReturn(RT_ALIGN(cbMsrs, sizeof(uint64_t)) == cbMsrs, ("Size of MSRs is misaligned: %#x\n", cbMsrs), 2440 VERR_SSM_UNEXPECTED_DATA); 2441 AssertLogRelMsgReturn(cbMsrs <= sizeof(CPUMCTXMSRS) && cbMsrs > 0, ("Size of MSRs is out of range: %#x\n", cbMsrs), 2442 VERR_SSM_UNEXPECTED_DATA); 2443 } 2444 2445 for (VMCPUID i = 0; i < pVM->cCpus; i++) 2446 { 2447 SSMR3GetStructEx(pSSM, &pVM->aCpus[i].cpum.s.Guest, sizeof(pVM->aCpus[i].cpum.s.Guest), fLoad, 2448 paCpumCtxFields, NULL); 2449 SSMR3GetU32(pSSM, &pVM->aCpus[i].cpum.s.fUseFlags); 2450 SSMR3GetU32(pSSM, &pVM->aCpus[i].cpum.s.fChanged); 2451 if (uVersion > CPUM_SAVED_STATE_VERSION_NO_MSR_SIZE) 2452 SSMR3GetMem(pSSM, &pVM->aCpus[i].cpum.s.GuestMsrs.au64[0], cbMsrs); 2453 else if (uVersion >= CPUM_SAVED_STATE_VERSION_VER3_0) 2454 { 2455 SSMR3GetMem(pSSM, &pVM->aCpus[i].cpum.s.GuestMsrs.au64[0], 2 * sizeof(uint64_t)); /* Restore two MSRs. */ 2456 SSMR3Skip(pSSM, 62 * sizeof(uint64_t)); 2457 } 2345 SSMR3GetMem(pSSM, &pVM->aCpus[i].cpum.s.GuestMsrs.au64[0], 2 * sizeof(uint64_t)); /* Restore two MSRs. */ 2346 SSMR3Skip(pSSM, 62 * sizeof(uint64_t)); 2458 2347 } 2459 2348 }
Note:
See TracChangeset
for help on using the changeset viewer.