Changeset 41906 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Jun 24, 2012 3:44:03 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 78759
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r41905 r41906 176 176 SSMFIELD_ENTRY( CPUMCTX, rsp), 177 177 SSMFIELD_ENTRY_OLD( lss_esp, sizeof(uint32_t)), 178 SSMFIELD_ENTRY( CPUMCTX, ss ),178 SSMFIELD_ENTRY( CPUMCTX, ss.Sel), 179 179 SSMFIELD_ENTRY_OLD( ssPadding, sizeof(uint16_t)), 180 SSMFIELD_ENTRY( CPUMCTX, gs ),180 SSMFIELD_ENTRY( CPUMCTX, gs.Sel), 181 181 SSMFIELD_ENTRY_OLD( gsPadding, sizeof(uint16_t)), 182 SSMFIELD_ENTRY( CPUMCTX, fs ),182 SSMFIELD_ENTRY( CPUMCTX, fs.Sel), 183 183 SSMFIELD_ENTRY_OLD( fsPadding, sizeof(uint16_t)), 184 SSMFIELD_ENTRY( CPUMCTX, es ),184 SSMFIELD_ENTRY( CPUMCTX, es.Sel), 185 185 SSMFIELD_ENTRY_OLD( esPadding, sizeof(uint16_t)), 186 SSMFIELD_ENTRY( CPUMCTX, ds ),186 SSMFIELD_ENTRY( CPUMCTX, ds.Sel), 187 187 SSMFIELD_ENTRY_OLD( dsPadding, sizeof(uint16_t)), 188 SSMFIELD_ENTRY( CPUMCTX, cs ),188 SSMFIELD_ENTRY( CPUMCTX, cs.Sel), 189 189 SSMFIELD_ENTRY_OLD( csPadding, sizeof(uint16_t)*3), 190 190 SSMFIELD_ENTRY( CPUMCTX, rflags), … … 198 198 SSMFIELD_ENTRY( CPUMCTX, r14), 199 199 SSMFIELD_ENTRY( CPUMCTX, r15), 200 SSMFIELD_ENTRY( CPUMCTX, es Hid.u64Base),201 SSMFIELD_ENTRY( CPUMCTX, es Hid.u32Limit),202 SSMFIELD_ENTRY( CPUMCTX, es Hid.Attr),203 SSMFIELD_ENTRY( CPUMCTX, cs Hid.u64Base),204 SSMFIELD_ENTRY( CPUMCTX, cs Hid.u32Limit),205 SSMFIELD_ENTRY( CPUMCTX, cs Hid.Attr),206 SSMFIELD_ENTRY( CPUMCTX, ss Hid.u64Base),207 SSMFIELD_ENTRY( CPUMCTX, ss Hid.u32Limit),208 SSMFIELD_ENTRY( CPUMCTX, ss Hid.Attr),209 SSMFIELD_ENTRY( CPUMCTX, ds Hid.u64Base),210 SSMFIELD_ENTRY( CPUMCTX, ds Hid.u32Limit),211 SSMFIELD_ENTRY( CPUMCTX, ds Hid.Attr),212 SSMFIELD_ENTRY( CPUMCTX, fs Hid.u64Base),213 SSMFIELD_ENTRY( CPUMCTX, fs Hid.u32Limit),214 SSMFIELD_ENTRY( CPUMCTX, fs Hid.Attr),215 SSMFIELD_ENTRY( CPUMCTX, gs Hid.u64Base),216 SSMFIELD_ENTRY( CPUMCTX, gs Hid.u32Limit),217 SSMFIELD_ENTRY( CPUMCTX, gs Hid.Attr),200 SSMFIELD_ENTRY( CPUMCTX, es.u64Base), 201 SSMFIELD_ENTRY( CPUMCTX, es.u32Limit), 202 SSMFIELD_ENTRY( CPUMCTX, es.Attr), 203 SSMFIELD_ENTRY( CPUMCTX, cs.u64Base), 204 SSMFIELD_ENTRY( CPUMCTX, cs.u32Limit), 205 SSMFIELD_ENTRY( CPUMCTX, cs.Attr), 206 SSMFIELD_ENTRY( CPUMCTX, ss.u64Base), 207 SSMFIELD_ENTRY( CPUMCTX, ss.u32Limit), 208 SSMFIELD_ENTRY( CPUMCTX, ss.Attr), 209 SSMFIELD_ENTRY( CPUMCTX, ds.u64Base), 210 SSMFIELD_ENTRY( CPUMCTX, ds.u32Limit), 211 SSMFIELD_ENTRY( CPUMCTX, ds.Attr), 212 SSMFIELD_ENTRY( CPUMCTX, fs.u64Base), 213 SSMFIELD_ENTRY( CPUMCTX, fs.u32Limit), 214 SSMFIELD_ENTRY( CPUMCTX, fs.Attr), 215 SSMFIELD_ENTRY( CPUMCTX, gs.u64Base), 216 SSMFIELD_ENTRY( CPUMCTX, gs.u32Limit), 217 SSMFIELD_ENTRY( CPUMCTX, gs.Attr), 218 218 SSMFIELD_ENTRY( CPUMCTX, cr0), 219 219 SSMFIELD_ENTRY( CPUMCTX, cr2), … … 234 234 SSMFIELD_ENTRY( CPUMCTX, idtr.pIdt), 235 235 SSMFIELD_ENTRY_OLD( idtrPadding, sizeof(uint16_t)), 236 SSMFIELD_ENTRY( CPUMCTX, ldtr ),236 SSMFIELD_ENTRY( CPUMCTX, ldtr.Sel), 237 237 SSMFIELD_ENTRY_OLD( ldtrPadding, sizeof(uint16_t)), 238 SSMFIELD_ENTRY( CPUMCTX, tr ),238 SSMFIELD_ENTRY( CPUMCTX, tr.Sel), 239 239 SSMFIELD_ENTRY_OLD( trPadding, sizeof(uint16_t)), 240 240 SSMFIELD_ENTRY( CPUMCTX, SysEnter.cs), … … 248 248 SSMFIELD_ENTRY( CPUMCTX, msrSFMASK), 249 249 SSMFIELD_ENTRY( CPUMCTX, msrKERNELGSBASE), 250 SSMFIELD_ENTRY( CPUMCTX, ldtr Hid.u64Base),251 SSMFIELD_ENTRY( CPUMCTX, ldtr Hid.u32Limit),252 SSMFIELD_ENTRY( CPUMCTX, ldtr Hid.Attr),253 SSMFIELD_ENTRY( CPUMCTX, tr Hid.u64Base),254 SSMFIELD_ENTRY( CPUMCTX, tr Hid.u32Limit),255 SSMFIELD_ENTRY( CPUMCTX, tr Hid.Attr),250 SSMFIELD_ENTRY( CPUMCTX, ldtr.u64Base), 251 SSMFIELD_ENTRY( CPUMCTX, ldtr.u32Limit), 252 SSMFIELD_ENTRY( CPUMCTX, ldtr.Attr), 253 SSMFIELD_ENTRY( CPUMCTX, tr.u64Base), 254 SSMFIELD_ENTRY( CPUMCTX, tr.u32Limit), 255 SSMFIELD_ENTRY( CPUMCTX, tr.Attr), 256 256 SSMFIELD_ENTRY_TERM() 257 257 }; … … 305 305 SSMFIELD_ENTRY( CPUMCTX, rcx), 306 306 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, rsp), 307 SSMFIELD_ENTRY( CPUMCTX, ss ),307 SSMFIELD_ENTRY( CPUMCTX, ss.Sel), 308 308 SSMFIELD_ENTRY_OLD( ssPadding, sizeof(uint16_t)), 309 309 SSMFIELD_ENTRY_OLD( CPUMCTX, sizeof(uint64_t) /*rsp_notused*/), 310 SSMFIELD_ENTRY( CPUMCTX, gs ),310 SSMFIELD_ENTRY( CPUMCTX, gs.Sel), 311 311 SSMFIELD_ENTRY_OLD( gsPadding, sizeof(uint16_t)), 312 SSMFIELD_ENTRY( CPUMCTX, fs ),312 SSMFIELD_ENTRY( CPUMCTX, fs.Sel), 313 313 SSMFIELD_ENTRY_OLD( fsPadding, sizeof(uint16_t)), 314 SSMFIELD_ENTRY( CPUMCTX, es ),314 SSMFIELD_ENTRY( CPUMCTX, es.Sel), 315 315 SSMFIELD_ENTRY_OLD( esPadding, sizeof(uint16_t)), 316 SSMFIELD_ENTRY( CPUMCTX, ds ),316 SSMFIELD_ENTRY( CPUMCTX, ds.Sel), 317 317 SSMFIELD_ENTRY_OLD( dsPadding, sizeof(uint16_t)), 318 SSMFIELD_ENTRY( CPUMCTX, cs ),318 SSMFIELD_ENTRY( CPUMCTX, cs.Sel), 319 319 SSMFIELD_ENTRY_OLD( csPadding, sizeof(uint16_t)*3), 320 320 SSMFIELD_ENTRY( CPUMCTX, rflags), … … 328 328 SSMFIELD_ENTRY( CPUMCTX, r14), 329 329 SSMFIELD_ENTRY( CPUMCTX, r15), 330 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, es Hid.u64Base),331 SSMFIELD_ENTRY( CPUMCTX, es Hid.u32Limit),332 SSMFIELD_ENTRY( CPUMCTX, es Hid.Attr),333 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, cs Hid.u64Base),334 SSMFIELD_ENTRY( CPUMCTX, cs Hid.u32Limit),335 SSMFIELD_ENTRY( CPUMCTX, cs Hid.Attr),336 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, ss Hid.u64Base),337 SSMFIELD_ENTRY( CPUMCTX, ss Hid.u32Limit),338 SSMFIELD_ENTRY( CPUMCTX, ss Hid.Attr),339 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, ds Hid.u64Base),340 SSMFIELD_ENTRY( CPUMCTX, ds Hid.u32Limit),341 SSMFIELD_ENTRY( CPUMCTX, ds Hid.Attr),342 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, fs Hid.u64Base),343 SSMFIELD_ENTRY( CPUMCTX, fs Hid.u32Limit),344 SSMFIELD_ENTRY( CPUMCTX, fs Hid.Attr),345 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, gs Hid.u64Base),346 SSMFIELD_ENTRY( CPUMCTX, gs Hid.u32Limit),347 SSMFIELD_ENTRY( CPUMCTX, gs Hid.Attr),330 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, es.u64Base), 331 SSMFIELD_ENTRY( CPUMCTX, es.u32Limit), 332 SSMFIELD_ENTRY( CPUMCTX, es.Attr), 333 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, cs.u64Base), 334 SSMFIELD_ENTRY( CPUMCTX, cs.u32Limit), 335 SSMFIELD_ENTRY( CPUMCTX, cs.Attr), 336 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, ss.u64Base), 337 SSMFIELD_ENTRY( CPUMCTX, ss.u32Limit), 338 SSMFIELD_ENTRY( CPUMCTX, ss.Attr), 339 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, ds.u64Base), 340 SSMFIELD_ENTRY( CPUMCTX, ds.u32Limit), 341 SSMFIELD_ENTRY( CPUMCTX, ds.Attr), 342 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, fs.u64Base), 343 SSMFIELD_ENTRY( CPUMCTX, fs.u32Limit), 344 SSMFIELD_ENTRY( CPUMCTX, fs.Attr), 345 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, gs.u64Base), 346 SSMFIELD_ENTRY( CPUMCTX, gs.u32Limit), 347 SSMFIELD_ENTRY( CPUMCTX, gs.Attr), 348 348 SSMFIELD_ENTRY( CPUMCTX, cr0), 349 349 SSMFIELD_ENTRY( CPUMCTX, cr2), … … 367 367 SSMFIELD_ENTRY_OLD( idtrPadding, sizeof(uint16_t)), 368 368 SSMFIELD_ENTRY_OLD( idtrPadding64, sizeof(uint64_t)), 369 SSMFIELD_ENTRY( CPUMCTX, ldtr ),369 SSMFIELD_ENTRY( CPUMCTX, ldtr.Sel), 370 370 SSMFIELD_ENTRY_OLD( ldtrPadding, sizeof(uint16_t)), 371 SSMFIELD_ENTRY( CPUMCTX, tr ),371 SSMFIELD_ENTRY( CPUMCTX, tr.Sel), 372 372 SSMFIELD_ENTRY_OLD( trPadding, sizeof(uint16_t)), 373 373 SSMFIELD_ENTRY( CPUMCTX, SysEnter.cs), … … 383 383 SSMFIELD_ENTRY_OLD( msrGSBASE, sizeof(uint64_t)), 384 384 SSMFIELD_ENTRY( CPUMCTX, msrKERNELGSBASE), 385 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, ldtr Hid.u64Base),386 SSMFIELD_ENTRY( CPUMCTX, ldtr Hid.u32Limit),387 SSMFIELD_ENTRY( CPUMCTX, ldtr Hid.Attr),388 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, tr Hid.u64Base),389 SSMFIELD_ENTRY( CPUMCTX, tr Hid.u32Limit),390 SSMFIELD_ENTRY( CPUMCTX, tr Hid.Attr),385 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, ldtr.u64Base), 386 SSMFIELD_ENTRY( CPUMCTX, ldtr.u32Limit), 387 SSMFIELD_ENTRY( CPUMCTX, ldtr.Attr), 388 SSMFIELD_ENTRY_U32_ZX_U64( CPUMCTX, tr.u64Base), 389 SSMFIELD_ENTRY( CPUMCTX, tr.u32Limit), 390 SSMFIELD_ENTRY( CPUMCTX, tr.Attr), 391 391 SSMFIELD_ENTRY_OLD( padding, sizeof(uint32_t)*2), 392 392 SSMFIELD_ENTRY_TERM() … … 1358 1358 pCtx->eflags.Bits.u1Reserved0 = 1; 1359 1359 1360 pCtx->cs = 0xf000; 1361 pCtx->csHid.u64Base = UINT64_C(0xffff0000); 1362 pCtx->csHid.u32Limit = 0x0000ffff; 1363 pCtx->csHid.Attr.n.u1DescType = 1; /* code/data segment */ 1364 pCtx->csHid.Attr.n.u1Present = 1; 1365 pCtx->csHid.Attr.n.u4Type = X86_SEL_TYPE_READ | X86_SEL_TYPE_CODE; 1366 1367 pCtx->dsHid.u32Limit = 0x0000ffff; 1368 pCtx->dsHid.Attr.n.u1DescType = 1; /* code/data segment */ 1369 pCtx->dsHid.Attr.n.u1Present = 1; 1370 pCtx->dsHid.Attr.n.u4Type = X86_SEL_TYPE_RW; 1371 1372 pCtx->esHid.u32Limit = 0x0000ffff; 1373 pCtx->esHid.Attr.n.u1DescType = 1; /* code/data segment */ 1374 pCtx->esHid.Attr.n.u1Present = 1; 1375 pCtx->esHid.Attr.n.u4Type = X86_SEL_TYPE_RW; 1376 1377 pCtx->fsHid.u32Limit = 0x0000ffff; 1378 pCtx->fsHid.Attr.n.u1DescType = 1; /* code/data segment */ 1379 pCtx->fsHid.Attr.n.u1Present = 1; 1380 pCtx->fsHid.Attr.n.u4Type = X86_SEL_TYPE_RW; 1381 1382 pCtx->gsHid.u32Limit = 0x0000ffff; 1383 pCtx->gsHid.Attr.n.u1DescType = 1; /* code/data segment */ 1384 pCtx->gsHid.Attr.n.u1Present = 1; 1385 pCtx->gsHid.Attr.n.u4Type = X86_SEL_TYPE_RW; 1386 1387 pCtx->ssHid.u32Limit = 0x0000ffff; 1388 pCtx->ssHid.Attr.n.u1Present = 1; 1389 pCtx->ssHid.Attr.n.u1DescType = 1; /* code/data segment */ 1390 pCtx->ssHid.Attr.n.u4Type = X86_SEL_TYPE_RW; 1360 pCtx->cs.Sel = 0xf000; 1361 pCtx->cs.ValidSel = 0xf000; 1362 pCtx->cs.fFlags = CPUMSELREG_FLAGS_VALID; 1363 pCtx->cs.u64Base = UINT64_C(0xffff0000); 1364 pCtx->cs.u32Limit = 0x0000ffff; 1365 pCtx->cs.Attr.n.u1DescType = 1; /* code/data segment */ 1366 pCtx->cs.Attr.n.u1Present = 1; 1367 pCtx->cs.Attr.n.u4Type = X86_SEL_TYPE_READ | X86_SEL_TYPE_CODE; 1368 1369 pCtx->ds.fFlags = CPUMSELREG_FLAGS_VALID; 1370 pCtx->ds.u32Limit = 0x0000ffff; 1371 pCtx->ds.Attr.n.u1DescType = 1; /* code/data segment */ 1372 pCtx->ds.Attr.n.u1Present = 1; 1373 pCtx->ds.Attr.n.u4Type = X86_SEL_TYPE_RW; 1374 1375 pCtx->es.fFlags = CPUMSELREG_FLAGS_VALID; 1376 pCtx->es.u32Limit = 0x0000ffff; 1377 pCtx->es.Attr.n.u1DescType = 1; /* code/data segment */ 1378 pCtx->es.Attr.n.u1Present = 1; 1379 pCtx->es.Attr.n.u4Type = X86_SEL_TYPE_RW; 1380 1381 pCtx->fs.fFlags = CPUMSELREG_FLAGS_VALID; 1382 pCtx->fs.u32Limit = 0x0000ffff; 1383 pCtx->fs.Attr.n.u1DescType = 1; /* code/data segment */ 1384 pCtx->fs.Attr.n.u1Present = 1; 1385 pCtx->fs.Attr.n.u4Type = X86_SEL_TYPE_RW; 1386 1387 pCtx->gs.fFlags = CPUMSELREG_FLAGS_VALID; 1388 pCtx->gs.u32Limit = 0x0000ffff; 1389 pCtx->gs.Attr.n.u1DescType = 1; /* code/data segment */ 1390 pCtx->gs.Attr.n.u1Present = 1; 1391 pCtx->gs.Attr.n.u4Type = X86_SEL_TYPE_RW; 1392 1393 pCtx->ss.fFlags = CPUMSELREG_FLAGS_VALID; 1394 pCtx->ss.u32Limit = 0x0000ffff; 1395 pCtx->ss.Attr.n.u1Present = 1; 1396 pCtx->ss.Attr.n.u1DescType = 1; /* code/data segment */ 1397 pCtx->ss.Attr.n.u4Type = X86_SEL_TYPE_RW; 1391 1398 1392 1399 pCtx->idtr.cbIdt = 0xffff; 1393 1400 pCtx->gdtr.cbGdt = 0xffff; 1394 1401 1395 pCtx->ldtrHid.u32Limit = 0xffff; 1396 pCtx->ldtrHid.Attr.n.u1Present = 1; 1397 pCtx->ldtrHid.Attr.n.u4Type = X86_SEL_TYPE_SYS_LDT; 1398 1399 pCtx->trHid.u32Limit = 0xffff; 1400 pCtx->trHid.Attr.n.u1Present = 1; 1401 pCtx->trHid.Attr.n.u4Type = X86_SEL_TYPE_SYS_386_TSS_BUSY; /* Deduction, not properly documented by Intel. */ 1402 pCtx->ldtr.fFlags = CPUMSELREG_FLAGS_VALID; 1403 pCtx->ldtr.u32Limit = 0xffff; 1404 pCtx->ldtr.Attr.n.u1Present = 1; 1405 pCtx->ldtr.Attr.n.u4Type = X86_SEL_TYPE_SYS_LDT; 1406 1407 pCtx->tr.fFlags = CPUMSELREG_FLAGS_VALID; 1408 pCtx->tr.u32Limit = 0xffff; 1409 pCtx->tr.Attr.n.u1Present = 1; 1410 pCtx->tr.Attr.n.u4Type = X86_SEL_TYPE_SYS_386_TSS_BUSY; /* Deduction, not properly documented by Intel. */ 1402 1411 1403 1412 pCtx->dr[6] = X86_DR6_INIT_VAL; … … 2614 2623 pszPrefix, pCtxCore->r14, pszPrefix, pCtxCore->r15, 2615 2624 pszPrefix, pCtxCore->rip, pszPrefix, pCtxCore->rsp, pszPrefix, pCtxCore->rbp, pszPrefix, X86_EFL_GET_IOPL(efl), *pszPrefix ? 33 : 31, szEFlags, 2616 pszPrefix, (RTSEL)pCtxCore->cs, pszPrefix, (RTSEL)pCtxCore->ss, pszPrefix, (RTSEL)pCtxCore->ds, pszPrefix, (RTSEL)pCtxCore->es,2617 pszPrefix, (RTSEL)pCtxCore->fs, pszPrefix, (RTSEL)pCtxCore->gs, pszPrefix, efl);2625 pszPrefix, pCtxCore->cs.Sel, pszPrefix, pCtxCore->ss.Sel, pszPrefix, pCtxCore->ds.Sel, pszPrefix, pCtxCore->es.Sel, 2626 pszPrefix, pCtxCore->fs.Sel, pszPrefix, pCtxCore->gs.Sel, pszPrefix, efl); 2618 2627 else 2619 2628 pHlp->pfnPrintf(pHlp, … … 2623 2632 pszPrefix, pCtxCore->eax, pszPrefix, pCtxCore->ebx, pszPrefix, pCtxCore->ecx, pszPrefix, pCtxCore->edx, pszPrefix, pCtxCore->esi, pszPrefix, pCtxCore->edi, 2624 2633 pszPrefix, pCtxCore->eip, pszPrefix, pCtxCore->esp, pszPrefix, pCtxCore->ebp, pszPrefix, X86_EFL_GET_IOPL(efl), *pszPrefix ? 33 : 31, szEFlags, 2625 pszPrefix, (RTSEL)pCtxCore->cs, pszPrefix, (RTSEL)pCtxCore->ss, pszPrefix, (RTSEL)pCtxCore->ds, pszPrefix, (RTSEL)pCtxCore->es,2626 pszPrefix, (RTSEL)pCtxCore->fs, pszPrefix, (RTSEL)pCtxCore->gs, pszPrefix, efl);2634 pszPrefix, pCtxCore->cs.Sel, pszPrefix, pCtxCore->ss.Sel, pszPrefix, pCtxCore->ds.Sel, pszPrefix, pCtxCore->es.Sel, 2635 pszPrefix, pCtxCore->fs.Sel, pszPrefix, pCtxCore->gs.Sel, pszPrefix, efl); 2627 2636 break; 2628 2637 … … 2642 2651 pszPrefix, pCtxCore->r14, pszPrefix, pCtxCore->r15, 2643 2652 pszPrefix, pCtxCore->rip, pszPrefix, pCtxCore->rsp, pszPrefix, pCtxCore->rbp, pszPrefix, X86_EFL_GET_IOPL(efl), *pszPrefix ? 33 : 31, szEFlags, 2644 pszPrefix, (RTSEL)pCtxCore->cs, pszPrefix, (RTSEL)pCtxCore->ss, pszPrefix, (RTSEL)pCtxCore->ds, pszPrefix, (RTSEL)pCtxCore->es,2645 pszPrefix, (RTSEL)pCtxCore->fs, pszPrefix, (RTSEL)pCtxCore->gs, pszPrefix, (RTSEL)pCtx->tr, pszPrefix, efl,2653 pszPrefix, pCtxCore->cs.Sel, pszPrefix, pCtxCore->ss.Sel, pszPrefix, pCtxCore->ds.Sel, pszPrefix, pCtxCore->es.Sel, 2654 pszPrefix, pCtxCore->fs.Sel, pszPrefix, pCtxCore->gs.Sel, pszPrefix, pCtx->tr.Sel, pszPrefix, efl, 2646 2655 pszPrefix, pCtx->cr0, pszPrefix, pCtx->cr2, pszPrefix, pCtx->cr3, pszPrefix, pCtx->cr4, 2647 pszPrefix, pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pszPrefix, (RTSEL)pCtx->ldtr);2656 pszPrefix, pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pszPrefix, pCtx->ldtr.Sel); 2648 2657 else 2649 2658 pHlp->pfnPrintf(pHlp, … … 2655 2664 pszPrefix, pCtxCore->eax, pszPrefix, pCtxCore->ebx, pszPrefix, pCtxCore->ecx, pszPrefix, pCtxCore->edx, pszPrefix, pCtxCore->esi, pszPrefix, pCtxCore->edi, 2656 2665 pszPrefix, pCtxCore->eip, pszPrefix, pCtxCore->esp, pszPrefix, pCtxCore->ebp, pszPrefix, X86_EFL_GET_IOPL(efl), *pszPrefix ? 33 : 31, szEFlags, 2657 pszPrefix, (RTSEL)pCtxCore->cs, pszPrefix, (RTSEL)pCtxCore->ss, pszPrefix, (RTSEL)pCtxCore->ds, pszPrefix, (RTSEL)pCtxCore->es,2658 pszPrefix, (RTSEL)pCtxCore->fs, pszPrefix, (RTSEL)pCtxCore->gs, pszPrefix, (RTSEL)pCtx->tr, pszPrefix, efl,2666 pszPrefix, pCtxCore->cs.Sel, pszPrefix, pCtxCore->ss.Sel, pszPrefix, pCtxCore->ds.Sel, pszPrefix, pCtxCore->es.Sel, 2667 pszPrefix, pCtxCore->fs.Sel, pszPrefix, pCtxCore->gs.Sel, pszPrefix, pCtx->tr.Sel, pszPrefix, efl, 2659 2668 pszPrefix, pCtx->cr0, pszPrefix, pCtx->cr2, pszPrefix, pCtx->cr3, pszPrefix, pCtx->cr4, 2660 pszPrefix, pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pszPrefix, (RTSEL)pCtx->ldtr);2669 pszPrefix, pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pszPrefix, pCtx->ldtr.Sel); 2661 2670 break; 2662 2671 … … 2687 2696 pszPrefix, pCtxCore->r14, pszPrefix, pCtxCore->r15, 2688 2697 pszPrefix, pCtxCore->rip, pszPrefix, pCtxCore->rsp, pszPrefix, pCtxCore->rbp, pszPrefix, X86_EFL_GET_IOPL(efl), *pszPrefix ? 33 : 31, szEFlags, 2689 pszPrefix, (RTSEL)pCtxCore->cs, pCtx->csHid.u64Base, pCtx->csHid.u32Limit, pCtx->csHid.Attr.u,2690 pszPrefix, (RTSEL)pCtxCore->ds, pCtx->dsHid.u64Base, pCtx->dsHid.u32Limit, pCtx->dsHid.Attr.u,2691 pszPrefix, (RTSEL)pCtxCore->es, pCtx->esHid.u64Base, pCtx->esHid.u32Limit, pCtx->esHid.Attr.u,2692 pszPrefix, (RTSEL)pCtxCore->fs, pCtx->fsHid.u64Base, pCtx->fsHid.u32Limit, pCtx->fsHid.Attr.u,2693 pszPrefix, (RTSEL)pCtxCore->gs, pCtx->gsHid.u64Base, pCtx->gsHid.u32Limit, pCtx->gsHid.Attr.u,2694 pszPrefix, (RTSEL)pCtxCore->ss, pCtx->ssHid.u64Base, pCtx->ssHid.u32Limit, pCtx->ssHid.Attr.u,2698 pszPrefix, pCtxCore->cs.Sel, pCtx->cs.u64Base, pCtx->cs.u32Limit, pCtx->cs.Attr.u, 2699 pszPrefix, pCtxCore->ds.Sel, pCtx->ds.u64Base, pCtx->ds.u32Limit, pCtx->ds.Attr.u, 2700 pszPrefix, pCtxCore->es.Sel, pCtx->es.u64Base, pCtx->es.u32Limit, pCtx->es.Attr.u, 2701 pszPrefix, pCtxCore->fs.Sel, pCtx->fs.u64Base, pCtx->fs.u32Limit, pCtx->fs.Attr.u, 2702 pszPrefix, pCtxCore->gs.Sel, pCtx->gs.u64Base, pCtx->gs.u32Limit, pCtx->gs.Attr.u, 2703 pszPrefix, pCtxCore->ss.Sel, pCtx->ss.u64Base, pCtx->ss.u32Limit, pCtx->ss.Attr.u, 2695 2704 pszPrefix, pCtx->cr0, pszPrefix, pCtx->cr2, pszPrefix, pCtx->cr3, pszPrefix, pCtx->cr4, 2696 2705 pszPrefix, pCtx->dr[0], pszPrefix, pCtx->dr[1], pszPrefix, pCtx->dr[2], pszPrefix, pCtx->dr[3], 2697 2706 pszPrefix, pCtx->dr[4], pszPrefix, pCtx->dr[5], pszPrefix, pCtx->dr[6], pszPrefix, pCtx->dr[7], 2698 2707 pszPrefix, pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pszPrefix, pCtx->idtr.pIdt, pCtx->idtr.cbIdt, pszPrefix, efl, 2699 pszPrefix, (RTSEL)pCtx->ldtr, pCtx->ldtrHid.u64Base, pCtx->ldtrHid.u32Limit, pCtx->ldtrHid.Attr.u,2700 pszPrefix, (RTSEL)pCtx->tr, pCtx->trHid.u64Base, pCtx->trHid.u32Limit, pCtx->trHid.Attr.u,2708 pszPrefix, pCtx->ldtr.Sel, pCtx->ldtr.u64Base, pCtx->ldtr.u32Limit, pCtx->ldtr.Attr.u, 2709 pszPrefix, pCtx->tr.Sel, pCtx->tr.u64Base, pCtx->tr.u32Limit, pCtx->tr.Attr.u, 2701 2710 pszPrefix, pCtx->SysEnter.cs, pCtx->SysEnter.eip, pCtx->SysEnter.esp); 2702 2711 else … … 2717 2726 pszPrefix, pCtxCore->eax, pszPrefix, pCtxCore->ebx, pszPrefix, pCtxCore->ecx, pszPrefix, pCtxCore->edx, pszPrefix, pCtxCore->esi, pszPrefix, pCtxCore->edi, 2718 2727 pszPrefix, pCtxCore->eip, pszPrefix, pCtxCore->esp, pszPrefix, pCtxCore->ebp, pszPrefix, X86_EFL_GET_IOPL(efl), *pszPrefix ? 33 : 31, szEFlags, 2719 pszPrefix, (RTSEL)pCtxCore->cs, pCtx->csHid.u64Base, pCtx->csHid.u32Limit, pCtx->csHid.Attr.u, pszPrefix, pCtx->dr[0], pszPrefix, pCtx->dr[1],2720 pszPrefix, (RTSEL)pCtxCore->ds, pCtx->dsHid.u64Base, pCtx->dsHid.u32Limit, pCtx->dsHid.Attr.u, pszPrefix, pCtx->dr[2], pszPrefix, pCtx->dr[3],2721 pszPrefix, (RTSEL)pCtxCore->es, pCtx->esHid.u64Base, pCtx->esHid.u32Limit, pCtx->esHid.Attr.u, pszPrefix, pCtx->dr[4], pszPrefix, pCtx->dr[5],2722 pszPrefix, (RTSEL)pCtxCore->fs, pCtx->fsHid.u64Base, pCtx->fsHid.u32Limit, pCtx->fsHid.Attr.u, pszPrefix, pCtx->dr[6], pszPrefix, pCtx->dr[7],2723 pszPrefix, (RTSEL)pCtxCore->gs, pCtx->gsHid.u64Base, pCtx->gsHid.u32Limit, pCtx->gsHid.Attr.u, pszPrefix, pCtx->cr0, pszPrefix, pCtx->cr2,2724 pszPrefix, (RTSEL)pCtxCore->ss, pCtx->ssHid.u64Base, pCtx->ssHid.u32Limit, pCtx->ssHid.Attr.u, pszPrefix, pCtx->cr3, pszPrefix, pCtx->cr4,2728 pszPrefix, pCtxCore->cs.Sel, pCtx->cs.u64Base, pCtx->cs.u32Limit, pCtx->cs.Attr.u, pszPrefix, pCtx->dr[0], pszPrefix, pCtx->dr[1], 2729 pszPrefix, pCtxCore->ds.Sel, pCtx->ds.u64Base, pCtx->ds.u32Limit, pCtx->ds.Attr.u, pszPrefix, pCtx->dr[2], pszPrefix, pCtx->dr[3], 2730 pszPrefix, pCtxCore->es.Sel, pCtx->es.u64Base, pCtx->es.u32Limit, pCtx->es.Attr.u, pszPrefix, pCtx->dr[4], pszPrefix, pCtx->dr[5], 2731 pszPrefix, pCtxCore->fs.Sel, pCtx->fs.u64Base, pCtx->fs.u32Limit, pCtx->fs.Attr.u, pszPrefix, pCtx->dr[6], pszPrefix, pCtx->dr[7], 2732 pszPrefix, pCtxCore->gs.Sel, pCtx->gs.u64Base, pCtx->gs.u32Limit, pCtx->gs.Attr.u, pszPrefix, pCtx->cr0, pszPrefix, pCtx->cr2, 2733 pszPrefix, pCtxCore->ss.Sel, pCtx->ss.u64Base, pCtx->ss.u32Limit, pCtx->ss.Attr.u, pszPrefix, pCtx->cr3, pszPrefix, pCtx->cr4, 2725 2734 pszPrefix, pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pszPrefix, pCtx->idtr.pIdt, pCtx->idtr.cbIdt, pszPrefix, efl, 2726 pszPrefix, (RTSEL)pCtx->ldtr, pCtx->ldtrHid.u64Base, pCtx->ldtrHid.u32Limit, pCtx->ldtrHid.Attr.u,2727 pszPrefix, (RTSEL)pCtx->tr, pCtx->trHid.u64Base, pCtx->trHid.u32Limit, pCtx->trHid.Attr.u,2735 pszPrefix, pCtx->ldtr.Sel, pCtx->ldtr.u64Base, pCtx->ldtr.u32Limit, pCtx->ldtr.Attr.u, 2736 pszPrefix, pCtx->tr.Sel, pCtx->tr.u64Base, pCtx->tr.u32Limit, pCtx->tr.Attr.u, 2728 2737 pszPrefix, pCtx->SysEnter.cs, pCtx->SysEnter.eip, pCtx->SysEnter.esp); 2729 2738 … … 2964 2973 /*pCtx->eax,*/ pCtx->ebx, /*pCtx->ecx, pCtx->edx,*/ pCtx->esi, pCtx->edi, 2965 2974 /*pCtx->eip,*/ pCtx->esp, pCtx->ebp, X86_EFL_GET_IOPL(efl), szEFlags, 2966 (RTSEL)pCtx->cs, (RTSEL)pCtx->ds, (RTSEL)pCtx->es, (RTSEL)pCtx->fs, (RTSEL)pCtx->gs, efl,2975 pCtx->cs, pCtx->ds, pCtx->es, pCtx->fs, pCtx->gs, efl, 2967 2976 pCtx->cr0, /*pCtx->cr2,*/ pCtx->cr3, pCtx->cr4, 2968 2977 pCtx->dr0, pCtx->dr1, pCtx->dr2, pCtx->dr3, pCtx->dr6, pCtx->dr7, 2969 (uint32_t)pCtx->gdtr.uAddr, pCtx->gdtr.cb, (RTSEL)pCtx->ldtr,2978 (uint32_t)pCtx->gdtr.uAddr, pCtx->gdtr.cb, pCtx->ldtr, 2970 2979 pCtx->SysEnter.cs, pCtx->SysEnter.eip, pCtx->SysEnter.esp); 2971 2980 } … … 3000 3009 pCtx->r14, pCtx->r15, 3001 3010 X86_EFL_GET_IOPL(efl), szEFlags, 3002 (RTSEL)pCtx->cs, (RTSEL)pCtx->ds, (RTSEL)pCtx->es, (RTSEL)pCtx->fs, (RTSEL)pCtx->gs, efl,3011 pCtx->cs, pCtx->ds, pCtx->es, pCtx->fs, pCtx->gs, efl, 3003 3012 pCtx->cr0, /*pCtx->cr2,*/ pCtx->cr3, 3004 3013 pCtx->cr4, pCtx->ldtr, pCtx->tr, … … 3827 3836 if (CPUMAreHiddenSelRegsValid(pVCpu)) 3828 3837 { 3829 State.f64Bits = enmMode >= PGMMODE_AMD64 && pCtx->cs Hid.Attr.n.u1Long;3830 State.GCPtrSegBase = pCtx->cs Hid.u64Base;3831 State.GCPtrSegEnd = pCtx->cs Hid.u32Limit + 1 + (RTGCUINTPTR)pCtx->csHid.u64Base;3832 State.cbSegLimit = pCtx->cs Hid.u32Limit;3838 State.f64Bits = enmMode >= PGMMODE_AMD64 && pCtx->cs.Attr.n.u1Long; 3839 State.GCPtrSegBase = pCtx->cs.u64Base; 3840 State.GCPtrSegEnd = pCtx->cs.u32Limit + 1 + (RTGCUINTPTR)pCtx->cs.u64Base; 3841 State.cbSegLimit = pCtx->cs.u32Limit; 3833 3842 enmDisCpuMode = (State.f64Bits) 3834 3843 ? DISCPUMODE_64BIT 3835 : pCtx->cs Hid.Attr.n.u1DefBig3844 : pCtx->cs.Attr.n.u1DefBig 3836 3845 ? DISCPUMODE_32BIT 3837 3846 : DISCPUMODE_16BIT; … … 3841 3850 DBGFSELINFO SelInfo; 3842 3851 3843 rc = SELMR3GetShadowSelectorInfo(pVM, pCtx->cs , &SelInfo);3852 rc = SELMR3GetShadowSelectorInfo(pVM, pCtx->cs.Sel, &SelInfo); 3844 3853 if (RT_FAILURE(rc)) 3845 3854 { 3846 AssertMsgFailed(("SELMR3GetShadowSelectorInfo failed for %04X:%RGv rc=%d\n", pCtx->cs , GCPtrPC, rc));3855 AssertMsgFailed(("SELMR3GetShadowSelectorInfo failed for %04X:%RGv rc=%d\n", pCtx->cs.Sel, GCPtrPC, rc)); 3847 3856 return rc; 3848 3857 } … … 3851 3860 * Validate the selector. 3852 3861 */ 3853 rc = DBGFR3SelInfoValidateCS(&SelInfo, pCtx->ss );3862 rc = DBGFR3SelInfoValidateCS(&SelInfo, pCtx->ss.Sel); 3854 3863 if (RT_FAILURE(rc)) 3855 3864 { 3856 AssertMsgFailed(("SELMSelInfoValidateCS failed for %04X:%RGv rc=%d\n", pCtx->cs , GCPtrPC, rc));3865 AssertMsgFailed(("SELMSelInfoValidateCS failed for %04X:%RGv rc=%d\n", pCtx->cs.Sel, GCPtrPC, rc)); 3857 3866 return rc; 3858 3867 } … … 3867 3876 /* real or V86 mode */ 3868 3877 enmDisCpuMode = DISCPUMODE_16BIT; 3869 State.GCPtrSegBase = pCtx->cs * 16;3878 State.GCPtrSegBase = pCtx->cs.Sel * 16; 3870 3879 State.GCPtrSegEnd = 0xFFFFFFFF; 3871 3880 State.cbSegLimit = 0xFFFFFFFF; … … 3895 3904 } 3896 3905 else 3897 Log(("CPUMR3DisasmInstrCPU: DISInstr failed for %04X:%RGv rc=%Rrc\n", pCtx->cs , GCPtrPC, rc));3906 Log(("CPUMR3DisasmInstrCPU: DISInstr failed for %04X:%RGv rc=%Rrc\n", pCtx->cs.Sel, GCPtrPC, rc)); 3898 3907 3899 3908 /* Release mapping lock acquired in cpumR3DisasInstrRead. */ … … 4009 4018 * Are we in Ring-0? 4010 4019 */ 4011 if ( pCtxCore->ss && (pCtxCore->ss& X86_SEL_RPL) == 04020 if ( pCtxCore->ss.Sel && (pCtxCore->ss.Sel & X86_SEL_RPL) == 0 4012 4021 && !pCtxCore->eflags.Bits.u1VM) 4013 4022 { … … 4020 4029 * Set CPL to Ring-1. 4021 4030 */ 4022 pCtxCore->ss |= 1;4023 if (pCtxCore->cs && (pCtxCore->cs& X86_SEL_RPL) == 0)4024 pCtxCore->cs |= 1;4031 pCtxCore->ss.Sel |= 1; 4032 if (pCtxCore->cs.Sel && (pCtxCore->cs.Sel & X86_SEL_RPL) == 0) 4033 pCtxCore->cs.Sel |= 1; 4025 4034 } 4026 4035 else 4027 4036 { 4028 AssertMsg((pCtxCore->ss & X86_SEL_RPL) >= 2 || pCtxCore->eflags.Bits.u1VM,4037 AssertMsg((pCtxCore->ss.Sel & X86_SEL_RPL) >= 2 || pCtxCore->eflags.Bits.u1VM, 4029 4038 ("ring-1 code not supported\n")); 4030 4039 /* … … 4043 4052 */ 4044 4053 AssertMsg((pCtxCore->eflags.u32 & X86_EFL_IF), ("X86_EFL_IF is clear\n")); 4045 AssertReleaseMsg( pCtxCore->eflags.Bits.u2IOPL < (unsigned)(pCtxCore->ss & X86_SEL_RPL)4054 AssertReleaseMsg( pCtxCore->eflags.Bits.u2IOPL < (unsigned)(pCtxCore->ss.Sel & X86_SEL_RPL) 4046 4055 || pCtxCore->eflags.Bits.u1VM, 4047 ("X86_EFL_IOPL=%d CPL=%d\n", pCtxCore->eflags.Bits.u2IOPL, pCtxCore->ss & X86_SEL_RPL));4056 ("X86_EFL_IOPL=%d CPL=%d\n", pCtxCore->eflags.Bits.u2IOPL, pCtxCore->ss.Sel & X86_SEL_RPL)); 4048 4057 Assert((pVCpu->cpum.s.Guest.cr0 & (X86_CR0_PG | X86_CR0_WP | X86_CR0_PE)) == (X86_CR0_PG | X86_CR0_PE | X86_CR0_WP)); 4049 4058 … … 4082 4091 if (!pCtxCore) 4083 4092 pCtxCore = CPUMCTX2CORE(pCtx); 4084 Assert(pCtxCore->eflags.Bits.u1VM || (pCtxCore->ss & X86_SEL_RPL));4085 AssertMsg(pCtxCore->eflags.Bits.u1VM || pCtxCore->eflags.Bits.u2IOPL < (unsigned)(pCtxCore->ss & X86_SEL_RPL),4086 ("X86_EFL_IOPL=%d CPL=%d\n", pCtxCore->eflags.Bits.u2IOPL, pCtxCore->ss & X86_SEL_RPL));4093 Assert(pCtxCore->eflags.Bits.u1VM || (pCtxCore->ss.Sel & X86_SEL_RPL)); 4094 AssertMsg(pCtxCore->eflags.Bits.u1VM || pCtxCore->eflags.Bits.u2IOPL < (unsigned)(pCtxCore->ss.Sel & X86_SEL_RPL), 4095 ("X86_EFL_IOPL=%d CPL=%d\n", pCtxCore->eflags.Bits.u2IOPL, pCtxCore->ss.Sel & X86_SEL_RPL)); 4087 4096 4088 4097 /* 4089 4098 * Are we executing in raw ring-1? 4090 4099 */ 4091 if ( (pCtxCore->ss & X86_SEL_RPL) == 14100 if ( (pCtxCore->ss.Sel & X86_SEL_RPL) == 1 4092 4101 && !pCtxCore->eflags.Bits.u1VM) 4093 4102 { … … 4098 4107 /* Not quite sure if this is really required, but shouldn't harm (too much anyways). */ 4099 4108 /** @todo See what happens if we remove this. */ 4100 if ((pCtxCore->ds & X86_SEL_RPL) == 1)4101 pCtxCore->ds &= ~X86_SEL_RPL;4102 if ((pCtxCore->es & X86_SEL_RPL) == 1)4103 pCtxCore->es &= ~X86_SEL_RPL;4104 if ((pCtxCore->fs & X86_SEL_RPL) == 1)4105 pCtxCore->fs &= ~X86_SEL_RPL;4106 if ((pCtxCore->gs & X86_SEL_RPL) == 1)4107 pCtxCore->gs &= ~X86_SEL_RPL;4109 if ((pCtxCore->ds.Sel & X86_SEL_RPL) == 1) 4110 pCtxCore->ds.Sel &= ~X86_SEL_RPL; 4111 if ((pCtxCore->es.Sel & X86_SEL_RPL) == 1) 4112 pCtxCore->es.Sel &= ~X86_SEL_RPL; 4113 if ((pCtxCore->fs.Sel & X86_SEL_RPL) == 1) 4114 pCtxCore->fs.Sel &= ~X86_SEL_RPL; 4115 if ((pCtxCore->gs.Sel & X86_SEL_RPL) == 1) 4116 pCtxCore->gs.Sel &= ~X86_SEL_RPL; 4108 4117 4109 4118 /* 4110 4119 * Ring-1 selector => Ring-0. 4111 4120 */ 4112 pCtxCore->ss &= ~X86_SEL_RPL;4113 if ((pCtxCore->cs & X86_SEL_RPL) == 1)4114 pCtxCore->cs &= ~X86_SEL_RPL;4121 pCtxCore->ss.Sel &= ~X86_SEL_RPL; 4122 if ((pCtxCore->cs.Sel & X86_SEL_RPL) == 1) 4123 pCtxCore->cs.Sel &= ~X86_SEL_RPL; 4115 4124 } 4116 4125 else … … 4123 4132 { 4124 4133 /** @todo See what happens if we remove this. */ 4125 if ((pCtxCore->ds & X86_SEL_RPL) == 1)4126 pCtxCore->ds &= ~X86_SEL_RPL;4127 if ((pCtxCore->es & X86_SEL_RPL) == 1)4128 pCtxCore->es &= ~X86_SEL_RPL;4129 if ((pCtxCore->fs & X86_SEL_RPL) == 1)4130 pCtxCore->fs &= ~X86_SEL_RPL;4131 if ((pCtxCore->gs & X86_SEL_RPL) == 1)4132 pCtxCore->gs &= ~X86_SEL_RPL;4134 if ((pCtxCore->ds.Sel & X86_SEL_RPL) == 1) 4135 pCtxCore->ds.Sel &= ~X86_SEL_RPL; 4136 if ((pCtxCore->es.Sel & X86_SEL_RPL) == 1) 4137 pCtxCore->es.Sel &= ~X86_SEL_RPL; 4138 if ((pCtxCore->fs.Sel & X86_SEL_RPL) == 1) 4139 pCtxCore->fs.Sel &= ~X86_SEL_RPL; 4140 if ((pCtxCore->gs.Sel & X86_SEL_RPL) == 1) 4141 pCtxCore->gs.Sel &= ~X86_SEL_RPL; 4133 4142 } 4134 4143 } -
trunk/src/VBox/VMM/VMMR3/CPUMDbg.cpp
r41803 r41906 1013 1013 1014 1014 #define CPU_REG_SEG(UName, LName) \ 1015 CPU_REG_RW_AS(#LName, UName, U16, LName ,cpumR3RegGet_Generic, cpumR3RegSet_seg, NULL, NULL ), \1016 CPU_REG_RW_AS(#LName "_attr", UName##_ATTR, U32, LName ##Hid.Attr.u,cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, g_aCpumRegFields_seg), \1017 CPU_REG_RW_AS(#LName "_base", UName##_BASE, U64, LName ##Hid.u64Base,cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), \1018 CPU_REG_RW_AS(#LName "_lim", UName##_LIMIT, U32, LName ##Hid.u32Limit,cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL )1015 CPU_REG_RW_AS(#LName, UName, U16, LName.Sel, cpumR3RegGet_Generic, cpumR3RegSet_seg, NULL, NULL ), \ 1016 CPU_REG_RW_AS(#LName "_attr", UName##_ATTR, U32, LName.Attr.u, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, g_aCpumRegFields_seg), \ 1017 CPU_REG_RW_AS(#LName "_base", UName##_BASE, U64, LName.u64Base, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), \ 1018 CPU_REG_RW_AS(#LName "_lim", UName##_LIMIT, U32, LName.u32Limit, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ) 1019 1019 1020 1020 #define CPU_REG_MM(n) \ -
trunk/src/VBox/VMM/VMMR3/CSAM.cpp
r41886 r41906 2295 2295 { 2296 2296 /* Assuming 32 bits code for now. */ 2297 Assert(SELMGetCpuModeFromSelector(VMMGetCpu0(pVM), pCtxCore->eflags, pCtxCore->cs , &pCtxCore->csHid) == DISCPUMODE_32BIT);2297 Assert(SELMGetCpuModeFromSelector(VMMGetCpu0(pVM), pCtxCore->eflags, pCtxCore->cs.Sel, &pCtxCore->cs) == DISCPUMODE_32BIT); 2298 2298 2299 2299 pInstrGC = SELMToFlat(pVM, DISSELREG_CS, pCtxCore, pInstrGC); -
trunk/src/VBox/VMM/VMMR3/DBGF.cpp
r41801 r41906 588 588 /* @todo SMP support!! */ 589 589 PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(VMMGetCpu(pVM)); 590 RTGCPTR eip = pCtx->rip + pCtx->cs Hid.u64Base;590 RTGCPTR eip = pCtx->rip + pCtx->cs.u64Base; 591 591 #endif 592 592 for (iBp = 0; iBp < RT_ELEMENTS(pVM->dbgf.s.aBreakpoints); iBp++) -
trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp
r41803 r41906 353 353 else 354 354 pCtxCore = CPUMGetHyperCtxCore(pVCpu); 355 Sel = pCtxCore->cs ;356 pHiddenSel = ( CPUMSELREGHID *)&pCtxCore->csHid;355 Sel = pCtxCore->cs.Sel; 356 pHiddenSel = (PCPUMSELREGHID)&pCtxCore->cs; 357 357 GCPtr = pCtxCore->rip; 358 358 } … … 413 413 { /* Assume the current CS defines the execution mode. */ 414 414 pCtxCore = CPUMGetGuestCtxCore(pVCpu); 415 pHiddenSel = (CPUMSELREGHID *)&pCtxCore->cs Hid;415 pHiddenSel = (CPUMSELREGHID *)&pCtxCore->cs; 416 416 417 417 SelInfo.u.Raw.Gen.u1Present = pHiddenSel->Attr.n.u1Present; -
trunk/src/VBox/VMM/VMMR3/DBGFStack.cpp
r41783 r41906 301 301 pCur->AddrPC = *pAddrPC; 302 302 else 303 rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrPC, pCtxCore->cs , pCtxCore->rip);303 rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrPC, pCtxCore->cs.Sel, pCtxCore->rip); 304 304 if (RT_SUCCESS(rc)) 305 305 { … … 341 341 pCur->AddrStack = *pAddrStack; 342 342 else 343 rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrStack, pCtxCore->ss , pCtxCore->rsp & fAddrMask);343 rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrStack, pCtxCore->ss.Sel, pCtxCore->rsp & fAddrMask); 344 344 345 345 if (pAddrFrame) 346 346 pCur->AddrFrame = *pAddrFrame; 347 347 else if (RT_SUCCESS(rc)) 348 rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrFrame, pCtxCore->ss , pCtxCore->rbp & fAddrMask);348 rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrFrame, pCtxCore->ss.Sel, pCtxCore->rbp & fAddrMask); 349 349 } 350 350 else -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r41801 r41906 965 965 966 966 if (pCtx->eflags.Bits.u1VM) 967 Log(("EMV86: %04X:%08X IF=%d\n", pCtx->cs , pCtx->eip, pCtx->eflags.Bits.u1IF));967 Log(("EMV86: %04X:%08X IF=%d\n", pCtx->cs.Sel, pCtx->eip, pCtx->eflags.Bits.u1IF)); 968 968 else 969 Log(("EMR%d: %04X:%08X ESP=%08X IF=%d CR0=%x eflags=%x\n", cpl, pCtx->cs , pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, (uint32_t)pCtx->cr0, pCtx->eflags.u));969 Log(("EMR%d: %04X:%08X ESP=%08X IF=%d CR0=%x eflags=%x\n", cpl, pCtx->cs.Sel, pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, (uint32_t)pCtx->cr0, pCtx->eflags.u)); 970 970 #endif 971 971 STAM_REL_PROFILE_ADV_START(&pVCpu->em.s.StatREMTotal, a); … … 1243 1243 } 1244 1244 1245 unsigned uSS = pCtx->ss ;1245 unsigned uSS = pCtx->ss.Sel; 1246 1246 if ( pCtx->eflags.Bits.u1VM 1247 1247 || (uSS & X86_SEL_RPL) == 3) … … 1276 1276 // Let's start with pure 32 bits ring 0 code first 1277 1277 /** @todo What's pure 32-bit mode? flat? */ 1278 if ( !(pCtx->ss Hid.Attr.n.u1DefBig)1279 || !(pCtx->cs Hid.Attr.n.u1DefBig))1278 if ( !(pCtx->ss.Attr.n.u1DefBig) 1279 || !(pCtx->cs.Attr.n.u1DefBig)) 1280 1280 { 1281 1281 Log2(("raw r0 mode refused: SS/CS not 32bit\n")); -
trunk/src/VBox/VMM/VMMR3/EMHwaccm.cpp
r41836 r41906 231 231 #endif /* 0 */ 232 232 STAM_PROFILE_START(&pVCpu->em.s.StatREMEmu, a); 233 Log(("EMINS: %04x:%RGv RSP=%RGv\n", pCtx->cs , (RTGCPTR)pCtx->rip, (RTGCPTR)pCtx->rsp));233 Log(("EMINS: %04x:%RGv RSP=%RGv\n", pCtx->cs.Sel, (RTGCPTR)pCtx->rip, (RTGCPTR)pCtx->rsp)); 234 234 #ifdef VBOX_WITH_REM 235 235 EMRemLock(pVM); … … 469 469 PCPUMCTX pCtx = pVCpu->em.s.pCtx; 470 470 471 LogFlow(("emR3HwAccExecute%d: (cs:eip=%04x:%RGv)\n", pVCpu->idCpu, pCtx->cs , (RTGCPTR)pCtx->rip));471 LogFlow(("emR3HwAccExecute%d: (cs:eip=%04x:%RGv)\n", pVCpu->idCpu, pCtx->cs.Sel, (RTGCPTR)pCtx->rip)); 472 472 *pfFFDone = false; 473 473 … … 509 509 */ 510 510 if (TRPMHasTrap(pVCpu)) 511 Log(("CPU%d: Pending hardware interrupt=0x%x cs:rip=%04X:%RGv\n", pVCpu->idCpu, TRPMGetTrapNo(pVCpu), pCtx->cs , (RTGCPTR)pCtx->rip));511 Log(("CPU%d: Pending hardware interrupt=0x%x cs:rip=%04X:%RGv\n", pVCpu->idCpu, TRPMGetTrapNo(pVCpu), pCtx->cs.Sel, (RTGCPTR)pCtx->rip)); 512 512 513 513 uint32_t cpl = CPUMGetGuestCPL(pVCpu, CPUMCTX2CORE(pCtx)); … … 518 518 Log(("HWV86: %08X IF=%d\n", pCtx->eip, pCtx->eflags.Bits.u1IF)); 519 519 else if (CPUMIsGuestIn64BitCodeEx(pCtx)) 520 Log(("HWR%d: %04X:%RGv ESP=%RGv IF=%d IOPL=%d CR0=%x CR4=%x EFER=%x\n", cpl, pCtx->cs , (RTGCPTR)pCtx->rip, pCtx->rsp, pCtx->eflags.Bits.u1IF, pCtx->eflags.Bits.u2IOPL, (uint32_t)pCtx->cr0, (uint32_t)pCtx->cr4, (uint32_t)pCtx->msrEFER));520 Log(("HWR%d: %04X:%RGv ESP=%RGv IF=%d IOPL=%d CR0=%x CR4=%x EFER=%x\n", cpl, pCtx->cs.Sel, (RTGCPTR)pCtx->rip, pCtx->rsp, pCtx->eflags.Bits.u1IF, pCtx->eflags.Bits.u2IOPL, (uint32_t)pCtx->cr0, (uint32_t)pCtx->cr4, (uint32_t)pCtx->msrEFER)); 521 521 else 522 Log(("HWR%d: %04X:%08X ESP=%08X IF=%d IOPL=%d CR0=%x CR4=%x EFER=%x\n", cpl, pCtx->cs , pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, pCtx->eflags.Bits.u2IOPL, (uint32_t)pCtx->cr0, (uint32_t)pCtx->cr4, (uint32_t)pCtx->msrEFER));522 Log(("HWR%d: %04X:%08X ESP=%08X IF=%d IOPL=%d CR0=%x CR4=%x EFER=%x\n", cpl, pCtx->cs.Sel, pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, pCtx->eflags.Bits.u2IOPL, (uint32_t)pCtx->cr0, (uint32_t)pCtx->cr4, (uint32_t)pCtx->msrEFER)); 523 523 } 524 524 else … … 527 527 Log(("HWV86-CPU%d: %08X IF=%d\n", pVCpu->idCpu, pCtx->eip, pCtx->eflags.Bits.u1IF)); 528 528 else if (CPUMIsGuestIn64BitCodeEx(pCtx)) 529 Log(("HWR%d-CPU%d: %04X:%RGv ESP=%RGv IF=%d IOPL=%d CR0=%x CR4=%x EFER=%x\n", cpl, pVCpu->idCpu, pCtx->cs , (RTGCPTR)pCtx->rip, pCtx->rsp, pCtx->eflags.Bits.u1IF, pCtx->eflags.Bits.u2IOPL, (uint32_t)pCtx->cr0, (uint32_t)pCtx->cr4, (uint32_t)pCtx->msrEFER));529 Log(("HWR%d-CPU%d: %04X:%RGv ESP=%RGv IF=%d IOPL=%d CR0=%x CR4=%x EFER=%x\n", cpl, pVCpu->idCpu, pCtx->cs.Sel, (RTGCPTR)pCtx->rip, pCtx->rsp, pCtx->eflags.Bits.u1IF, pCtx->eflags.Bits.u2IOPL, (uint32_t)pCtx->cr0, (uint32_t)pCtx->cr4, (uint32_t)pCtx->msrEFER)); 530 530 else 531 Log(("HWR%d-CPU%d: %04X:%08X ESP=%08X IF=%d IOPL=%d CR0=%x CR4=%x EFER=%x\n", cpl, pVCpu->idCpu, pCtx->cs , pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, pCtx->eflags.Bits.u2IOPL, (uint32_t)pCtx->cr0, (uint32_t)pCtx->cr4, (uint32_t)pCtx->msrEFER));531 Log(("HWR%d-CPU%d: %04X:%08X ESP=%08X IF=%d IOPL=%d CR0=%x CR4=%x EFER=%x\n", cpl, pVCpu->idCpu, pCtx->cs.Sel, pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, pCtx->eflags.Bits.u2IOPL, (uint32_t)pCtx->cr0, (uint32_t)pCtx->cr4, (uint32_t)pCtx->msrEFER)); 532 532 } 533 533 #endif /* LOG_ENABLED */ -
trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
r41801 r41906 123 123 PCPUMCTX pCtx = pVCpu->em.s.pCtx; 124 124 Assert(pVCpu->em.s.enmState == EMSTATE_DEBUG_HYPER); 125 Log(("emR3RawResumeHyper: cs:eip=%RTsel:%RGr efl=%RGr\n", pCtx->cs , pCtx->eip, pCtx->eflags));125 Log(("emR3RawResumeHyper: cs:eip=%RTsel:%RGr efl=%RGr\n", pCtx->cs.Sel, pCtx->eip, pCtx->eflags)); 126 126 127 127 /* … … 131 131 CPUMSetHyperEFlags(pVCpu, CPUMGetHyperEFlags(pVCpu) | X86_EFL_RF); 132 132 rc = VMMR3ResumeHyper(pVM, pVCpu); 133 Log(("emR3RawResumeHyper: cs:eip=%RTsel:%RGr efl=%RGr - returned from GC with rc=%Rrc\n", pCtx->cs , pCtx->eip, pCtx->eflags, rc));133 Log(("emR3RawResumeHyper: cs:eip=%RTsel:%RGr efl=%RGr - returned from GC with rc=%Rrc\n", pCtx->cs.Sel, pCtx->eip, pCtx->eflags, rc)); 134 134 rc = CPUMR3RawLeave(pVCpu, NULL, rc); 135 135 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_RESUME_GUEST_MASK); … … 367 367 368 368 STAM_PROFILE_START(&pVCpu->em.s.StatREMEmu, a); 369 Log(("EMINS: %04x:%RGv RSP=%RGv\n", pCtx->cs , (RTGCPTR)pCtx->rip, (RTGCPTR)pCtx->rsp));369 Log(("EMINS: %04x:%RGv RSP=%RGv\n", pCtx->cs.Sel, (RTGCPTR)pCtx->rip, (RTGCPTR)pCtx->rsp)); 370 370 #ifdef VBOX_WITH_REM 371 371 EMRemLock(pVM); … … 578 578 */ 579 579 /** @todo move this up before the dispatching? */ 580 if ( (pCtx->ss & X86_SEL_RPL) <= 1580 if ( (pCtx->ss.Sel & X86_SEL_RPL) <= 1 581 581 && !pCtx->eflags.Bits.u1VM) 582 582 { … … 643 643 int rc2 = PGMGstGetPage(pVCpu, uCR2, &fFlags, &GCPhys); 644 644 Log(("emR3RawGuestTrap: cs:eip=%04x:%08x: trap=%02x err=%08x cr2=%08x cr0=%08x%s: Phys=%RGp fFlags=%08llx %s %s %s%s rc2=%d\n", 645 pCtx->cs, pCtx->eip, u8TrapNo, uErrorCode, uCR2, (uint32_t)pCtx->cr0, (enmType == TRPM_SOFTWARE_INT) ? " software" : "", GCPhys, fFlags, 645 pCtx->cs.Sel, pCtx->eip, u8TrapNo, uErrorCode, uCR2, (uint32_t)pCtx->cr0, 646 (enmType == TRPM_SOFTWARE_INT) ? " software" : "", GCPhys, fFlags, 646 647 fFlags & X86_PTE_P ? "P " : "NP", fFlags & X86_PTE_US ? "U" : "S", 647 648 fFlags & X86_PTE_RW ? "RW" : "R0", fFlags & X86_PTE_G ? " G" : "", rc2)); … … 684 685 { 685 686 rc = PATMR3InstallPatch(pVM, SELMToFlat(pVM, DISSELREG_CS, CPUMCTX2CORE(pCtx), pCtx->eip), 686 (SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == DISCPUMODE_32BIT) ? PATMFL_CODE32 : 0); 687 SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs.Sel, &pCtx->cs) 688 == DISCPUMODE_32BIT ? PATMFL_CODE32 : 0); 687 689 if (RT_SUCCESS(rc)) 688 690 { … … 929 931 return VERR_EM_RAW_PATCH_CONFLICT; 930 932 } 931 if ( (pCtx->ss & X86_SEL_RPL) == 0933 if ( (pCtx->ss.Sel & X86_SEL_RPL) == 0 932 934 && !pCtx->eflags.Bits.u1VM 933 935 && !PATMIsPatchGCAddr(pVM, pCtx->eip)) 934 936 { 935 937 int rc = PATMR3InstallPatch(pVM, SELMToFlat(pVM, DISSELREG_CS, CPUMCTX2CORE(pCtx), pCtx->eip), 936 (SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == DISCPUMODE_32BIT) ? PATMFL_CODE32 : 0); 938 ( SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs.Sel, &pCtx->cs) 939 == DISCPUMODE_32BIT) ? PATMFL_CODE32 : 0); 937 940 if (RT_SUCCESS(rc)) 938 941 { … … 1039 1042 } 1040 1043 #endif /* VBOX_WITH_STATISTICS */ 1041 if ( (pCtx->ss & X86_SEL_RPL) == 01044 if ( (pCtx->ss.Sel & X86_SEL_RPL) == 0 1042 1045 && !pCtx->eflags.Bits.u1VM 1043 && SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs , &pCtx->csHid) == DISCPUMODE_32BIT)1046 && SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs.Sel, &pCtx->cs) == DISCPUMODE_32BIT) 1044 1047 { 1045 1048 STAM_PROFILE_START(&pVCpu->em.s.StatPrivEmu, a); … … 1339 1342 int rc = VERR_IPE_UNINITIALIZED_STATUS; 1340 1343 PCPUMCTX pCtx = pVCpu->em.s.pCtx; 1341 LogFlow(("emR3RawExecute: (cs:eip=%04x:%08x)\n", pCtx->cs , pCtx->eip));1344 LogFlow(("emR3RawExecute: (cs:eip=%04x:%08x)\n", pCtx->cs.Sel, pCtx->eip)); 1342 1345 pVCpu->em.s.fForceRAW = false; 1343 1346 *pfFFDone = false; … … 1361 1364 Assert(REMR3QueryPendingInterrupt(pVM, pVCpu) == REM_NO_PENDING_IRQ); 1362 1365 # endif 1363 Assert(pCtx->eflags.Bits.u1VM || (pCtx->ss & X86_SEL_RPL) == 3 || (pCtx->ss& X86_SEL_RPL) == 0);1366 Assert(pCtx->eflags.Bits.u1VM || (pCtx->ss.Sel & X86_SEL_RPL) == 3 || (pCtx->ss.Sel & X86_SEL_RPL) == 0); 1364 1367 AssertMsg( (pCtx->eflags.u32 & X86_EFL_IF) 1365 1368 || PATMShouldUseRawMode(pVM, (RTGCPTR)pCtx->eip), … … 1401 1404 * Scan code before executing it. Don't bother with user mode or V86 code 1402 1405 */ 1403 if ( (pCtx->ss & X86_SEL_RPL) <= 11406 if ( (pCtx->ss.Sel & X86_SEL_RPL) <= 1 1404 1407 && !pCtx->eflags.Bits.u1VM 1405 1408 && !PATMIsPatchGCAddr(pVM, pCtx->eip)) … … 1427 1430 PPATMGCSTATE pGCState = PATMR3QueryGCStateHC(pVM); 1428 1431 if (pCtx->eflags.Bits.u1VM) 1429 Log(("RV86: %04X:%08X IF=%d VMFlags=%x\n", pCtx->cs , pCtx->eip, pCtx->eflags.Bits.u1IF, pGCState->uVMFlags));1430 else if ((pCtx->ss & X86_SEL_RPL) == 1)1432 Log(("RV86: %04X:%08X IF=%d VMFlags=%x\n", pCtx->cs.Sel, pCtx->eip, pCtx->eflags.Bits.u1IF, pGCState->uVMFlags)); 1433 else if ((pCtx->ss.Sel & X86_SEL_RPL) == 1) 1431 1434 { 1432 1435 bool fCSAMScanned = CSAMIsPageScanned(pVM, (RTGCPTR)pCtx->eip); 1433 Log(("RR0: %08X ESP=%08X IF=%d VMFlags=%x PIF=%d CPL=%d (Scanned=%d)\n", pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, pGCState->uVMFlags, pGCState->fPIF, (pCtx->ss & X86_SEL_RPL), fCSAMScanned));1434 } 1435 else if ((pCtx->ss & X86_SEL_RPL) == 3)1436 Log(("RR0: %08X ESP=%08X IF=%d VMFlags=%x PIF=%d CPL=%d (Scanned=%d)\n", pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, pGCState->uVMFlags, pGCState->fPIF, (pCtx->ss.Sel & X86_SEL_RPL), fCSAMScanned)); 1437 } 1438 else if ((pCtx->ss.Sel & X86_SEL_RPL) == 3) 1436 1439 Log(("RR3: %08X ESP=%08X IF=%d VMFlags=%x\n", pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, pGCState->uVMFlags)); 1437 1440 #endif /* LOG_ENABLED */ … … 1461 1464 STAM_PROFILE_ADV_START(&pVCpu->em.s.StatRAWTail, d); 1462 1465 1463 LogFlow(("RR0-E: %08X ESP=%08X IF=%d VMFlags=%x PIF=%d CPL=%d\n", pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, pGCState->uVMFlags, pGCState->fPIF, (pCtx->ss & X86_SEL_RPL)));1466 LogFlow(("RR0-E: %08X ESP=%08X IF=%d VMFlags=%x PIF=%d CPL=%d\n", pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, pGCState->uVMFlags, pGCState->fPIF, (pCtx->ss.Sel & X86_SEL_RPL))); 1464 1467 LogFlow(("VMMR3RawRunGC returned %Rrc\n", rc)); 1465 1468 … … 1542 1545 || VMCPU_FF_ISPENDING(pVCpu, ~VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK)) 1543 1546 { 1544 Assert(pCtx->eflags.Bits.u1VM || (pCtx->ss & X86_SEL_RPL) != 1);1547 Assert(pCtx->eflags.Bits.u1VM || (pCtx->ss.Sel & X86_SEL_RPL) != 1); 1545 1548 1546 1549 STAM_REL_PROFILE_ADV_SUSPEND(&pVCpu->em.s.StatRAWTotal, a); -
trunk/src/VBox/VMM/VMMR3/HWACCM.cpp
r41894 r41906 1517 1517 1518 1518 /* After a real mode switch to protected mode we must force 1519 * CPL to 0. Our real mode emulation had to set it to 3. 1520 */ 1521 pCtx->ssHid.Attr.n.u2Dpl = 0; 1519 CPL to 0. Our real mode emulation had to set it to 3. */ 1520 pCtx->ss.Attr.n.u2Dpl = 0; 1522 1521 } 1523 1522 } … … 2163 2162 { 2164 2163 char szOutput[256]; 2165 rc = DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs , GCPtrInstr, DBGF_DISAS_FLAGS_DEFAULT_MODE,2164 rc = DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, GCPtrInstr, DBGF_DISAS_FLAGS_DEFAULT_MODE, 2166 2165 szOutput, sizeof(szOutput), &cbCurInstr); 2167 2166 if (RT_SUCCESS(rc)) … … 2305 2304 if (CPUMIsGuestInRealModeEx(pCtx)) 2306 2305 { 2307 /* VT-x will not allow high selector bases in v86 mode; fall back to the recompiler in that case.2308 * The base must also be equal to (sel << 4).2309 */2310 if ( ( pCtx->cs != (pCtx->csHid.u64Base >> 4)2311 && pCtx->cs Hid.u64Base != 0xffff0000 /* we can deal with the BIOS code as it's also mapped into the lower region. */)2312 || (pCtx->cs Hid.u32Limit != 0xffff)2313 || (pCtx->ds Hid.u32Limit != 0xffff)2314 || (pCtx->es Hid.u32Limit != 0xffff)2315 || (pCtx->ss Hid.u32Limit != 0xffff)2316 || (pCtx->fs Hid.u32Limit != 0xffff)2317 || (pCtx->gs Hid.u32Limit != 0xffff)2318 || pCtx->ds != (pCtx->dsHid.u64Base >> 4)2319 || pCtx->es != (pCtx->esHid.u64Base >> 4)2320 || pCtx->fs != (pCtx->fsHid.u64Base >> 4)2321 || pCtx->gs != (pCtx->gsHid.u64Base >> 4)2322 || pCtx->ss != (pCtx->ssHid.u64Base >> 4))2306 /* VT-x will not allow high selector bases in v86 mode; fall 2307 back to the recompiler in that case. 2308 The base must also be equal to (sel << 4). */ 2309 if ( ( pCtx->cs.Sel != (pCtx->cs.u64Base >> 4) 2310 && pCtx->cs.u64Base != 0xffff0000 /* we can deal with the BIOS code as it's also mapped into the lower region. */) 2311 || (pCtx->cs.u32Limit != 0xffff) 2312 || (pCtx->ds.u32Limit != 0xffff) 2313 || (pCtx->es.u32Limit != 0xffff) 2314 || (pCtx->ss.u32Limit != 0xffff) 2315 || (pCtx->fs.u32Limit != 0xffff) 2316 || (pCtx->gs.u32Limit != 0xffff) 2317 || pCtx->ds.Sel != (pCtx->ds.u64Base >> 4) 2318 || pCtx->es.Sel != (pCtx->es.u64Base >> 4) 2319 || pCtx->fs.Sel != (pCtx->fs.u64Base >> 4) 2320 || pCtx->gs.Sel != (pCtx->gs.u64Base >> 4) 2321 || pCtx->ss.Sel != (pCtx->ss.u64Base >> 4)) 2323 2322 { 2324 2323 return false; … … 2328 2327 { 2329 2328 PGMMODE enmGuestMode = PGMGetGuestMode(pVCpu); 2330 /* Verify the requirements for executing code in protected mode. VT-x can't handle the CPU state right after a switch2331 * from real to protected mode. (all sorts of RPL & DPL assumptions)2332 */2329 /* Verify the requirements for executing code in protected 2330 mode. VT-x can't handle the CPU state right after a switch 2331 from real to protected mode. (all sorts of RPL & DPL assumptions) */ 2333 2332 if ( pVCpu->hwaccm.s.vmx.enmLastSeenGuestMode == PGMMODE_REAL 2334 2333 && enmGuestMode >= PGMMODE_PROTECTED) 2335 2334 { 2336 if ( (pCtx->cs & X86_SEL_RPL)2337 || (pCtx->ds & X86_SEL_RPL)2338 || (pCtx->es & X86_SEL_RPL)2339 || (pCtx->fs & X86_SEL_RPL)2340 || (pCtx->gs & X86_SEL_RPL)2341 || (pCtx->ss & X86_SEL_RPL))2335 if ( (pCtx->cs.Sel & X86_SEL_RPL) 2336 || (pCtx->ds.Sel & X86_SEL_RPL) 2337 || (pCtx->es.Sel & X86_SEL_RPL) 2338 || (pCtx->fs.Sel & X86_SEL_RPL) 2339 || (pCtx->gs.Sel & X86_SEL_RPL) 2340 || (pCtx->ss.Sel & X86_SEL_RPL)) 2342 2341 { 2343 2342 return false; … … 2346 2345 /* VT-x also chokes on invalid tr or ldtr selectors (minix) */ 2347 2346 if ( pCtx->gdtr.cbGdt 2348 && ( pCtx->tr > pCtx->gdtr.cbGdt2349 || pCtx->ldtr > pCtx->gdtr.cbGdt))2347 && ( pCtx->tr.Sel > pCtx->gdtr.cbGdt 2348 || pCtx->ldtr.Sel > pCtx->gdtr.cbGdt)) 2350 2349 { 2351 2350 return false; … … 2370 2369 2371 2370 /* Too early for VT-x; Solaris guests will fail with a guru meditation otherwise; same for XP. */ 2372 if (pCtx->idtr.pIdt == 0 || pCtx->idtr.cbIdt == 0 || pCtx->tr == 0)2371 if (pCtx->idtr.pIdt == 0 || pCtx->idtr.cbIdt == 0 || pCtx->tr.Sel == 0) 2373 2372 return false; 2374 2373 … … 2376 2375 /* Windows XP; switch to protected mode; all selectors are marked not present in the 2377 2376 * hidden registers (possible recompiler bug; see load_seg_vm) */ 2378 if (pCtx->cs Hid.Attr.n.u1Present == 0)2377 if (pCtx->cs.Attr.n.u1Present == 0) 2379 2378 return false; 2380 if (pCtx->ss Hid.Attr.n.u1Present == 0)2379 if (pCtx->ss.Attr.n.u1Present == 0) 2381 2380 return false; 2382 2381 … … 2385 2384 /** @todo This check is actually wrong, it doesn't take the direction of the 2386 2385 * stack segment into account. But, it does the job for now. */ 2387 if (pCtx->rsp >= pCtx->ss Hid.u32Limit)2386 if (pCtx->rsp >= pCtx->ss.u32Limit) 2388 2387 return false; 2389 2388 #if 0 2390 if ( pCtx->cs >= pCtx->gdtr.cbGdt2391 || pCtx->ss >= pCtx->gdtr.cbGdt2392 || pCtx->ds >= pCtx->gdtr.cbGdt2393 || pCtx->es >= pCtx->gdtr.cbGdt2394 || pCtx->fs >= pCtx->gdtr.cbGdt2395 || pCtx->gs >= pCtx->gdtr.cbGdt)2389 if ( pCtx->cs.Sel >= pCtx->gdtr.cbGdt 2390 || pCtx->ss.Sel >= pCtx->gdtr.cbGdt 2391 || pCtx->ds.Sel >= pCtx->gdtr.cbGdt 2392 || pCtx->es.Sel >= pCtx->gdtr.cbGdt 2393 || pCtx->fs.Sel >= pCtx->gdtr.cbGdt 2394 || pCtx->gs.Sel >= pCtx->gdtr.cbGdt) 2396 2395 return false; 2397 2396 #endif -
trunk/src/VBox/VMM/VMMR3/PATM.cpp
r41898 r41906 4088 4088 if (pInstrGCFlat != pInstrGC) 4089 4089 { 4090 Log(("PATMR3InstallPatch: code selector not wide open: %04x:%RRv != %RRv eflags=%08x\n", pCtx->cs , pInstrGCFlat, pInstrGC, pCtx->eflags.u32));4090 Log(("PATMR3InstallPatch: code selector not wide open: %04x:%RRv != %RRv eflags=%08x\n", pCtx->cs.Sel, pInstrGCFlat, pInstrGC, pCtx->eflags.u32)); 4091 4091 return VERR_PATCHING_REFUSED; 4092 4092 } … … 6105 6105 #ifdef DEBUG 6106 6106 char szBuf[256]; 6107 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs , pCurPatchInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,6107 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE, 6108 6108 szBuf, sizeof(szBuf), NULL); 6109 6109 Log(("DIRTY: %s\n", szBuf)); … … 6168 6168 #ifdef DEBUG 6169 6169 char szBuf[256]; 6170 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs , pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,6170 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE, 6171 6171 szBuf, sizeof(szBuf), NULL); 6172 6172 Log(("NEW: %s\n", szBuf)); … … 6184 6184 #ifdef DEBUG 6185 6185 char szBuf[256]; 6186 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs , pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,6186 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE, 6187 6187 szBuf, sizeof(szBuf), NULL); 6188 6188 Log(("NEW: %s (FAILED)\n", szBuf)); … … 6221 6221 #ifdef DEBUG 6222 6222 char szBuf[256]; 6223 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs , pCurPatchInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,6223 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE, 6224 6224 szBuf, sizeof(szBuf), NULL); 6225 6225 Log(("FILL: %s\n", szBuf)); … … 6233 6233 #ifdef DEBUG 6234 6234 char szBuf[256]; 6235 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs , pCurPatchInstrGC + i,6235 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC + i, 6236 6236 DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL); 6237 6237 Log(("FILL: %s\n", szBuf)); … … 6425 6425 6426 6426 char szBuf[256]; 6427 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs , pEip, DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL);6427 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pEip, DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL); 6428 6428 6429 6429 /* Very bad. We crashed in emitted code. Probably stack? */ … … 6542 6542 6543 6543 Log2(("pPatchBlockGC %RRv - pEip %RRv corresponding GC address %RRv\n", PATCHCODE_PTR_GC(&pPatch->patch), pEip, pNewEip)); 6544 DBGFR3DisasInstrLog(pVCpu, pCtx->cs , pNewEip, "PATCHRET: ");6544 DBGFR3DisasInstrLog(pVCpu, pCtx->cs.Sel, pNewEip, "PATCHRET: "); 6545 6545 if (pNewEip >= pPatch->patch.pPrivInstrGC && pNewEip < pPatch->patch.pPrivInstrGC + pPatch->patch.cbPatchJump) 6546 6546 { -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r41803 r41906 1330 1330 PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu); 1331 1331 1332 pCtx->cs = uVector << 8; 1333 pCtx->csHid.u64Base = uVector << 12; 1334 pCtx->csHid.u32Limit = 0x0000ffff; 1335 pCtx->rip = 0; 1332 pCtx->cs.Sel = uVector << 8; 1333 pCtx->cs.ValidSel = uVector << 8; 1334 pCtx->cs.fFlags = CPUMSELREG_FLAGS_VALID; 1335 pCtx->cs.u64Base = uVector << 12; 1336 pCtx->cs.u32Limit = UINT32_C(0x0000ffff); 1337 pCtx->rip = 0; 1336 1338 1337 1339 Log(("vmmR3SendSipi for VCPU %d with vector %x\n", uVector)); -
trunk/src/VBox/VMM/VMMR3/VMMTests.cpp
r41783 r41906 448 448 449 449 #define SYNC_SEL(pHyperCtx, reg) \ 450 if (pHyperCtx->reg )\450 if (pHyperCtx->reg.Sel) \ 451 451 { \ 452 452 DBGFSELINFO selInfo; \ 453 int rc2 = SELMR3GetShadowSelectorInfo(pVM, pHyperCtx->reg , &selInfo);\453 int rc2 = SELMR3GetShadowSelectorInfo(pVM, pHyperCtx->reg.Sel, &selInfo); \ 454 454 AssertRC(rc2); \ 455 455 \ 456 pHyperCtx->reg ##Hid.u64Base = selInfo.GCPtrBase;\457 pHyperCtx->reg ##Hid.u32Limit = selInfo.cbLimit;\458 pHyperCtx->reg ##Hid.Attr.n.u1Present = selInfo.u.Raw.Gen.u1Present;\459 pHyperCtx->reg ##Hid.Attr.n.u1DefBig = selInfo.u.Raw.Gen.u1DefBig;\460 pHyperCtx->reg ##Hid.Attr.n.u1Granularity = selInfo.u.Raw.Gen.u1Granularity;\461 pHyperCtx->reg ##Hid.Attr.n.u4Type = selInfo.u.Raw.Gen.u4Type;\462 pHyperCtx->reg ##Hid.Attr.n.u2Dpl = selInfo.u.Raw.Gen.u2Dpl;\463 pHyperCtx->reg ##Hid.Attr.n.u1DescType = selInfo.u.Raw.Gen.u1DescType;\464 pHyperCtx->reg ##Hid.Attr.n.u1Long = selInfo.u.Raw.Gen.u1Long;\456 pHyperCtx->reg.u64Base = selInfo.GCPtrBase; \ 457 pHyperCtx->reg.u32Limit = selInfo.cbLimit; \ 458 pHyperCtx->reg.Attr.n.u1Present = selInfo.u.Raw.Gen.u1Present; \ 459 pHyperCtx->reg.Attr.n.u1DefBig = selInfo.u.Raw.Gen.u1DefBig; \ 460 pHyperCtx->reg.Attr.n.u1Granularity = selInfo.u.Raw.Gen.u1Granularity; \ 461 pHyperCtx->reg.Attr.n.u4Type = selInfo.u.Raw.Gen.u4Type; \ 462 pHyperCtx->reg.Attr.n.u2Dpl = selInfo.u.Raw.Gen.u2Dpl; \ 463 pHyperCtx->reg.Attr.n.u1DescType = selInfo.u.Raw.Gen.u1DescType; \ 464 pHyperCtx->reg.Attr.n.u1Long = selInfo.u.Raw.Gen.u1Long; \ 465 465 } 466 466
Note:
See TracChangeset
for help on using the changeset viewer.