- Timestamp:
- Jun 11, 2010 2:16:09 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/CPUM.cpp
r29250 r30164 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 134 134 135 135 /* Calculate the offset from CPUM to CPUMCPU for the first CPU. */ 136 pVM->cpum.s. ulOffCPUMCPU= RT_OFFSETOF(VM, aCpus[0].cpum) - RT_OFFSETOF(VM, cpum);137 Assert((uintptr_t)&pVM->cpum + pVM->cpum.s. ulOffCPUMCPU== (uintptr_t)&pVM->aCpus[0].cpum);136 pVM->cpum.s.offCPUMCPU0 = RT_OFFSETOF(VM, aCpus[0].cpum) - RT_OFFSETOF(VM, cpum); 137 Assert((uintptr_t)&pVM->cpum + pVM->cpum.s.offCPUMCPU0 == (uintptr_t)&pVM->aCpus[0].cpum); 138 138 139 139 /* Calculate the offset from CPUMCPU to CPUM. */ … … 148 148 pVCpu->cpum.s.pHyperCoreR0 = VM_R0_ADDR(pVM, CPUMCTX2CORE(&pVCpu->cpum.s.Hyper)); 149 149 150 pVCpu->cpum.s. ulOffCPUM= RT_OFFSETOF(VM, aCpus[i].cpum) - RT_OFFSETOF(VM, cpum);151 Assert((uintptr_t)&pVCpu->cpum - pVCpu->cpum.s. ulOffCPUM == (uintptr_t)&pVM->cpum);150 pVCpu->cpum.s.offCPUM = RT_OFFSETOF(VM, aCpus[i].cpum) - RT_OFFSETOF(VM, cpum); 151 Assert((uintptr_t)&pVCpu->cpum - pVCpu->cpum.s.offCPUM == (uintptr_t)&pVM->cpum); 152 152 } 153 153 … … 322 322 323 323 /** 324 * Load the overrides for a set of CPUID lea fs.324 * Load the overrides for a set of CPUID leaves. 325 325 * 326 326 * @returns VBox status code. 327 * @param paLea fsThe leaf array.328 * @param cLea fs The number of leafs.327 * @param paLeaves The leaf array. 328 * @param cLeaves The number of leaves. 329 329 * @param uStart The start leaf number. 330 330 * @param pCfgNode The CFGM node containing the overrides 331 331 * (/CPUM/HostCPUID/ or /CPUM/CPUID/). 332 332 */ 333 static int cpumR3CpuIdInitLoadOverrideSet(uint32_t uStart, PCPUMCPUID paLea fs, uint32_t cLeafs, PCFGMNODE pCfgNode)334 { 335 for (uint32_t i = 0; i < cLea fs; i++)336 { 337 int rc = cpumR3CpuIdFetchLeafOverride(&paLea fs[i], pCfgNode, uStart + i);333 static int cpumR3CpuIdInitLoadOverrideSet(uint32_t uStart, PCPUMCPUID paLeaves, uint32_t cLeaves, PCFGMNODE pCfgNode) 334 { 335 for (uint32_t i = 0; i < cLeaves; i++) 336 { 337 int rc = cpumR3CpuIdFetchLeafOverride(&paLeaves[i], pCfgNode, uStart + i); 338 338 if (RT_FAILURE(rc)) 339 339 return rc; … … 344 344 345 345 /** 346 * Init a set of host CPUID lea fs.346 * Init a set of host CPUID leaves. 347 347 * 348 348 * @returns VBox status code. 349 * @param paLea fsThe leaf array.350 * @param cLea fs The number of leafs.349 * @param paLeaves The leaf array. 350 * @param cLeaves The number of leaves. 351 351 * @param uStart The start leaf number. 352 352 * @param pCfgNode The /CPUM/HostCPUID/ node. 353 353 */ 354 static int cpumR3CpuIdInitHostSet(uint32_t uStart, PCPUMCPUID paLea fs, uint32_t cLeafs, PCFGMNODE pCfgNode)354 static int cpumR3CpuIdInitHostSet(uint32_t uStart, PCPUMCPUID paLeaves, uint32_t cLeaves, PCFGMNODE pCfgNode) 355 355 { 356 356 /* Using the ECX variant for all of them can't hurt... */ 357 for (uint32_t i = 0; i < cLea fs; i++)358 ASMCpuId_Idx_ECX(uStart + i, 0, &paLea fs[i].eax, &paLeafs[i].ebx, &paLeafs[i].ecx, &paLeafs[i].edx);359 360 /* Load CPUID leaf override; we currently don't care if the caller357 for (uint32_t i = 0; i < cLeaves; i++) 358 ASMCpuId_Idx_ECX(uStart + i, 0, &paLeaves[i].eax, &paLeaves[i].ebx, &paLeaves[i].ecx, &paLeaves[i].edx); 359 360 /* Load CPUID leaf override; we currently don't care if the user 361 361 specifies features the host CPU doesn't support. */ 362 return cpumR3CpuIdInitLoadOverrideSet(uStart, paLea fs, cLeafs, pCfgNode);362 return cpumR3CpuIdInitLoadOverrideSet(uStart, paLeaves, cLeaves, pCfgNode); 363 363 } 364 364 … … 377 377 int rc; 378 378 379 /* 380 * Get the host CPUIDs and redetect the guest CPU vendor (could've been overridden). 379 #define PORTABLE_CLEAR_BITS_WHEN(Lvl, LeafSuffReg, FeatNm, fMask, uValue) \ 380 if (pCPUM->u8PortableCpuIdLevel >= (Lvl) && (pCPUM->aGuestCpuId##LeafSuffReg & (fMask)) == (uValue) ) \ 381 { \ 382 LogRel(("PortableCpuId: " #LeafSuffReg "[" #FeatNm "]: %#x -> 0\n", pCPUM->aGuestCpuId##LeafSuffReg & (fMask))); \ 383 pCPUM->aGuestCpuId##LeafSuffReg &= ~(uint32_t)(fMask); \ 384 } 385 #define PORTABLE_DISABLE_FEATURE_BIT(Lvl, LeafSuffReg, FeatNm, fBitMask) \ 386 if (pCPUM->u8PortableCpuIdLevel >= (Lvl) && (pCPUM->aGuestCpuId##LeafSuffReg & (fBitMask)) ) \ 387 { \ 388 LogRel(("PortableCpuId: " #LeafSuffReg "[" #FeatNm "]: 1 -> 0\n")); \ 389 pCPUM->aGuestCpuId##LeafSuffReg &= ~(uint32_t)(fBitMask); \ 390 } 391 392 /* 393 * Read the configuration. 394 */ 395 /** @cfgm{CPUM/SyntheticCpu, boolean, false} 396 * Enables the Synthetic CPU. The Vendor ID and Processor Name are 397 * completely overridden by VirtualBox custom strings. Some 398 * CPUID information is withheld, like the cache info. */ 399 rc = CFGMR3QueryBoolDef(pCpumCfg, "SyntheticCpu", &pCPUM->fSyntheticCpu, false); 400 AssertRCReturn(rc, rc); 401 402 /** @cfgm{CPUM/PortableCpuIdLevel, 8-bit, 0, 3, 0} 403 * When non-zero CPUID features that could cause portability issues will be 404 * stripped. The higher the value the more features gets stripped. Higher 405 * values should only be used when older CPUs are involved since it may 406 * harm performance and maybe also cause problems with specific guests. */ 407 rc = CFGMR3QueryU8Def(pCpumCfg, "PortableCpuIdLevel", &pCPUM->u8PortableCpuIdLevel, 0); 408 AssertRCReturn(rc, rc); 409 410 AssertLogRelReturn(!pCPUM->fSyntheticCpu || !pCPUM->u8PortableCpuIdLevel, VERR_INTERNAL_ERROR_2); 411 412 /* 413 * Get the host CPUID leaves and redetect the guest CPU vendor (could've 414 * been overridden). 381 415 */ 382 416 /** @cfgm{CPUM/HostCPUID/[000000xx|800000xx|c000000x]/[eax|ebx|ecx|edx],32-bit} 383 417 * Overrides the host CPUID leaf values used for calculating the guest CPUID 384 * lea fs. This can be used to preserve the CPUID values when moving a VM to385 * a different machine. Another use is restricting (or extending) the418 * leaves. This can be used to preserve the CPUID values when moving a VM 419 * to a different machine. Another use is restricting (or extending) the 386 420 * feature set exposed to the guest. */ 387 421 PCFGMNODE pHostOverrideCfg = CFGMR3GetChild(pCpumCfg, "HostCPUID"); … … 397 431 398 432 /* 433 * Determine the default leaf. 434 * 435 * Intel returns values of the highest standard function, while AMD 436 * returns zeros. VIA on the other hand seems to returning nothing or 437 * perhaps some random garbage, we don't try to duplicate this behavior. 438 */ 439 ASMCpuId(pCPUM->aGuestCpuIdStd[0].eax + 10, /** @todo r=bird: Use the host value here in case of overrides and more than 10 leaves being stripped already. */ 440 &pCPUM->GuestCpuIdDef.eax, &pCPUM->GuestCpuIdDef.ebx, 441 &pCPUM->GuestCpuIdDef.ecx, &pCPUM->GuestCpuIdDef.edx); 442 443 444 /* Cpuid 1 & 0x80000001: 399 445 * Only report features we can support. 400 */ 401 pCPUM->aGuestCpuIdStd[1].edx &= X86_CPUID_FEATURE_EDX_FPU 402 | X86_CPUID_FEATURE_EDX_VME 403 | X86_CPUID_FEATURE_EDX_DE 404 | X86_CPUID_FEATURE_EDX_PSE 405 | X86_CPUID_FEATURE_EDX_TSC 406 | X86_CPUID_FEATURE_EDX_MSR 407 //| X86_CPUID_FEATURE_EDX_PAE - not implemented yet. 408 | X86_CPUID_FEATURE_EDX_MCE 409 | X86_CPUID_FEATURE_EDX_CX8 410 //| X86_CPUID_FEATURE_EDX_APIC - set by the APIC device if present. 411 /* Note! we don't report sysenter/sysexit support due to our inability to keep the IOPL part of eflags in sync while in ring 1 (see #1757) */ 412 //| X86_CPUID_FEATURE_EDX_SEP 413 | X86_CPUID_FEATURE_EDX_MTRR 414 | X86_CPUID_FEATURE_EDX_PGE 415 | X86_CPUID_FEATURE_EDX_MCA 416 | X86_CPUID_FEATURE_EDX_CMOV 417 | X86_CPUID_FEATURE_EDX_PAT 418 | X86_CPUID_FEATURE_EDX_PSE36 419 //| X86_CPUID_FEATURE_EDX_PSN - no serial number. 420 | X86_CPUID_FEATURE_EDX_CLFSH 421 //| X86_CPUID_FEATURE_EDX_DS - no debug store. 422 //| X86_CPUID_FEATURE_EDX_ACPI - not virtualized yet. 423 | X86_CPUID_FEATURE_EDX_MMX 424 | X86_CPUID_FEATURE_EDX_FXSR 425 | X86_CPUID_FEATURE_EDX_SSE 426 | X86_CPUID_FEATURE_EDX_SSE2 427 //| X86_CPUID_FEATURE_EDX_SS - no self snoop. 428 //| X86_CPUID_FEATURE_EDX_HTT - no hyperthreading. 429 //| X86_CPUID_FEATURE_EDX_TM - no thermal monitor. 430 //| X86_CPUID_FEATURE_EDX_PBE - no pending break enabled. 431 | 0; 432 pCPUM->aGuestCpuIdStd[1].ecx &= 0 433 | X86_CPUID_FEATURE_ECX_SSE3 434 /* Can't properly emulate monitor & mwait with guest SMP; force the guest to use hlt for idling VCPUs. */ 435 | ((pVM->cCpus == 1) ? X86_CPUID_FEATURE_ECX_MONITOR : 0) 436 //| X86_CPUID_FEATURE_ECX_CPLDS - no CPL qualified debug store. 437 //| X86_CPUID_FEATURE_ECX_VMX - not virtualized. 438 //| X86_CPUID_FEATURE_ECX_EST - no extended speed step. 439 //| X86_CPUID_FEATURE_ECX_TM2 - no thermal monitor 2. 440 | X86_CPUID_FEATURE_ECX_SSSE3 441 //| X86_CPUID_FEATURE_ECX_CNTXID - no L1 context id (MSR++). 442 //| X86_CPUID_FEATURE_ECX_CX16 - no cmpxchg16b 443 /* ECX Bit 14 - xTPR Update Control. Processor supports changing IA32_MISC_ENABLES[bit 23]. */ 444 //| X86_CPUID_FEATURE_ECX_TPRUPDATE 445 /* ECX Bit 21 - x2APIC support - not yet. */ 446 // | X86_CPUID_FEATURE_ECX_X2APIC 447 /* ECX Bit 23 - POPCNT instruction. */ 448 //| X86_CPUID_FEATURE_ECX_POPCNT 449 | 0; 450 451 /* ASSUMES that this is ALWAYS the AMD define feature set if present. */ 452 pCPUM->aGuestCpuIdExt[1].edx &= X86_CPUID_AMD_FEATURE_EDX_FPU 453 | X86_CPUID_AMD_FEATURE_EDX_VME 454 | X86_CPUID_AMD_FEATURE_EDX_DE 455 | X86_CPUID_AMD_FEATURE_EDX_PSE 456 | X86_CPUID_AMD_FEATURE_EDX_TSC 457 | X86_CPUID_AMD_FEATURE_EDX_MSR //?? this means AMD MSRs.. 458 //| X86_CPUID_AMD_FEATURE_EDX_PAE - not implemented yet. 459 //| X86_CPUID_AMD_FEATURE_EDX_MCE - not virtualized yet. 460 | X86_CPUID_AMD_FEATURE_EDX_CX8 461 //| X86_CPUID_AMD_FEATURE_EDX_APIC - set by the APIC device if present. 462 /* Note! we don't report sysenter/sysexit support due to our inability to keep the IOPL part of eflags in sync while in ring 1 (see #1757) */ 463 //| X86_CPUID_AMD_FEATURE_EDX_SEP 464 | X86_CPUID_AMD_FEATURE_EDX_MTRR 465 | X86_CPUID_AMD_FEATURE_EDX_PGE 466 | X86_CPUID_AMD_FEATURE_EDX_MCA 467 | X86_CPUID_AMD_FEATURE_EDX_CMOV 468 | X86_CPUID_AMD_FEATURE_EDX_PAT 469 | X86_CPUID_AMD_FEATURE_EDX_PSE36 470 //| X86_CPUID_AMD_FEATURE_EDX_NX - not virtualized, requires PAE. 471 //| X86_CPUID_AMD_FEATURE_EDX_AXMMX 472 | X86_CPUID_AMD_FEATURE_EDX_MMX 473 | X86_CPUID_AMD_FEATURE_EDX_FXSR 474 | X86_CPUID_AMD_FEATURE_EDX_FFXSR 475 //| X86_CPUID_AMD_FEATURE_EDX_PAGE1GB 476 //| X86_CPUID_AMD_FEATURE_EDX_RDTSCP - AMD only; turned on when necessary 477 //| X86_CPUID_AMD_FEATURE_EDX_LONG_MODE - turned on when necessary 478 | X86_CPUID_AMD_FEATURE_EDX_3DNOW_EX 479 | X86_CPUID_AMD_FEATURE_EDX_3DNOW 480 | 0; 481 pCPUM->aGuestCpuIdExt[1].ecx &= 0 482 //| X86_CPUID_AMD_FEATURE_ECX_LAHF_SAHF 483 //| X86_CPUID_AMD_FEATURE_ECX_CMPL 484 //| X86_CPUID_AMD_FEATURE_ECX_SVM - not virtualized. 485 //| X86_CPUID_AMD_FEATURE_ECX_EXT_APIC 486 /* Note: This could prevent teleporting from AMD to Intel CPUs! */ 487 | X86_CPUID_AMD_FEATURE_ECX_CR8L /* expose lock mov cr0 = mov cr8 hack for guests that can use this feature to access the TPR. */ 488 //| X86_CPUID_AMD_FEATURE_ECX_ABM 489 //| X86_CPUID_AMD_FEATURE_ECX_SSE4A 490 //| X86_CPUID_AMD_FEATURE_ECX_MISALNSSE 491 //| X86_CPUID_AMD_FEATURE_ECX_3DNOWPRF 492 //| X86_CPUID_AMD_FEATURE_ECX_OSVW 493 //| X86_CPUID_AMD_FEATURE_ECX_IBS 494 //| X86_CPUID_AMD_FEATURE_ECX_SSE5 495 //| X86_CPUID_AMD_FEATURE_ECX_SKINIT 496 //| X86_CPUID_AMD_FEATURE_ECX_WDT 497 | 0; 498 499 rc = CFGMR3QueryBoolDef(pCpumCfg, "SyntheticCpu", &pCPUM->fSyntheticCpu, false); AssertRCReturn(rc, rc); 446 * 447 * Note! When enabling new features the Synthetic CPU and Portable CPUID 448 * options may require adjusting (i.e. stripping what was enabled). 449 */ 450 pCPUM->aGuestCpuIdStd[1].edx &= X86_CPUID_FEATURE_EDX_FPU 451 | X86_CPUID_FEATURE_EDX_VME 452 | X86_CPUID_FEATURE_EDX_DE 453 | X86_CPUID_FEATURE_EDX_PSE 454 | X86_CPUID_FEATURE_EDX_TSC 455 | X86_CPUID_FEATURE_EDX_MSR 456 //| X86_CPUID_FEATURE_EDX_PAE - set later if configured. 457 | X86_CPUID_FEATURE_EDX_MCE 458 | X86_CPUID_FEATURE_EDX_CX8 459 //| X86_CPUID_FEATURE_EDX_APIC - set by the APIC device if present. 460 /* Note! we don't report sysenter/sysexit support due to our inability to keep the IOPL part of eflags in sync while in ring 1 (see #1757) */ 461 //| X86_CPUID_FEATURE_EDX_SEP 462 | X86_CPUID_FEATURE_EDX_MTRR 463 | X86_CPUID_FEATURE_EDX_PGE 464 | X86_CPUID_FEATURE_EDX_MCA 465 | X86_CPUID_FEATURE_EDX_CMOV 466 | X86_CPUID_FEATURE_EDX_PAT 467 | X86_CPUID_FEATURE_EDX_PSE36 468 //| X86_CPUID_FEATURE_EDX_PSN - no serial number. 469 | X86_CPUID_FEATURE_EDX_CLFSH 470 //| X86_CPUID_FEATURE_EDX_DS - no debug store. 471 //| X86_CPUID_FEATURE_EDX_ACPI - not virtualized yet. 472 | X86_CPUID_FEATURE_EDX_MMX 473 | X86_CPUID_FEATURE_EDX_FXSR 474 | X86_CPUID_FEATURE_EDX_SSE 475 | X86_CPUID_FEATURE_EDX_SSE2 476 //| X86_CPUID_FEATURE_EDX_SS - no self snoop. 477 //| X86_CPUID_FEATURE_EDX_HTT - no hyperthreading. 478 //| X86_CPUID_FEATURE_EDX_TM - no thermal monitor. 479 //| X86_CPUID_FEATURE_EDX_PBE - no pending break enabled. 480 | 0; 481 pCPUM->aGuestCpuIdStd[1].ecx &= 0 482 | X86_CPUID_FEATURE_ECX_SSE3 483 /* Can't properly emulate monitor & mwait with guest SMP; force the guest to use hlt for idling VCPUs. */ 484 | ((pVM->cCpus == 1) ? X86_CPUID_FEATURE_ECX_MONITOR : 0) 485 //| X86_CPUID_FEATURE_ECX_CPLDS - no CPL qualified debug store. 486 //| X86_CPUID_FEATURE_ECX_VMX - not virtualized. 487 //| X86_CPUID_FEATURE_ECX_EST - no extended speed step. 488 //| X86_CPUID_FEATURE_ECX_TM2 - no thermal monitor 2. 489 | X86_CPUID_FEATURE_ECX_SSSE3 490 //| X86_CPUID_FEATURE_ECX_CNTXID - no L1 context id (MSR++). 491 //| X86_CPUID_FEATURE_ECX_CX16 - no cmpxchg16b 492 /* ECX Bit 14 - xTPR Update Control. Processor supports changing IA32_MISC_ENABLES[bit 23]. */ 493 //| X86_CPUID_FEATURE_ECX_TPRUPDATE 494 /* ECX Bit 21 - x2APIC support - not yet. */ 495 // | X86_CPUID_FEATURE_ECX_X2APIC 496 /* ECX Bit 23 - POPCNT instruction. */ 497 //| X86_CPUID_FEATURE_ECX_POPCNT 498 | 0; 499 if (pCPUM->u8PortableCpuIdLevel > 0) 500 { 501 PORTABLE_CLEAR_BITS_WHEN(1, Std[1].eax, ProcessorType, (UINT32_C(3) << 12), (UINT32_C(2) << 12)); 502 PORTABLE_DISABLE_FEATURE_BIT(1, Std[1].ecx, SSSE3, X86_CPUID_FEATURE_ECX_SSSE3); 503 PORTABLE_DISABLE_FEATURE_BIT(1, Std[1].ecx, SSE3, X86_CPUID_FEATURE_ECX_SSE3); 504 PORTABLE_DISABLE_FEATURE_BIT(2, Std[1].edx, SSE2, X86_CPUID_FEATURE_EDX_SSE2); 505 PORTABLE_DISABLE_FEATURE_BIT(3, Std[1].edx, SSE, X86_CPUID_FEATURE_EDX_SSE); 506 PORTABLE_DISABLE_FEATURE_BIT(3, Std[1].edx, CLFSH, X86_CPUID_FEATURE_EDX_CLFSH); 507 PORTABLE_DISABLE_FEATURE_BIT(3, Std[1].edx, CMOV, X86_CPUID_FEATURE_EDX_CMOV); 508 509 Assert(!(pCPUM->aGuestCpuIdStd[1].edx & ( X86_CPUID_FEATURE_EDX_SEP 510 | X86_CPUID_FEATURE_EDX_PSN 511 | X86_CPUID_FEATURE_EDX_DS 512 | X86_CPUID_FEATURE_EDX_ACPI 513 | X86_CPUID_FEATURE_EDX_SS 514 | X86_CPUID_FEATURE_EDX_TM 515 | X86_CPUID_FEATURE_EDX_PBE 516 ))); 517 Assert(!(pCPUM->aGuestCpuIdStd[1].ecx & ( X86_CPUID_FEATURE_ECX_PCLMUL 518 | X86_CPUID_FEATURE_ECX_DTES64 519 | X86_CPUID_FEATURE_ECX_CPLDS 520 | X86_CPUID_FEATURE_ECX_VMX 521 | X86_CPUID_FEATURE_ECX_SMX 522 | X86_CPUID_FEATURE_ECX_EST 523 | X86_CPUID_FEATURE_ECX_TM2 524 | X86_CPUID_FEATURE_ECX_CNTXID 525 | X86_CPUID_FEATURE_ECX_FMA 526 | X86_CPUID_FEATURE_ECX_CX16 527 | X86_CPUID_FEATURE_ECX_TPRUPDATE 528 | X86_CPUID_FEATURE_ECX_PDCM 529 | X86_CPUID_FEATURE_ECX_DCA 530 | X86_CPUID_FEATURE_ECX_MOVBE 531 | X86_CPUID_FEATURE_ECX_AES 532 | X86_CPUID_FEATURE_ECX_POPCNT 533 | X86_CPUID_FEATURE_ECX_XSAVE 534 | X86_CPUID_FEATURE_ECX_OSXSAVE 535 | X86_CPUID_FEATURE_ECX_AVX 536 ))); 537 } 538 539 /* Cpuid 0x80000001: 540 * Only report features we can support. 541 * 542 * Note! When enabling new features the Synthetic CPU and Portable CPUID 543 * options may require adjusting (i.e. stripping what was enabled). 544 * 545 * ASSUMES that this is ALWAYS the AMD defined feature set if present. 546 */ 547 pCPUM->aGuestCpuIdExt[1].edx &= X86_CPUID_AMD_FEATURE_EDX_FPU 548 | X86_CPUID_AMD_FEATURE_EDX_VME 549 | X86_CPUID_AMD_FEATURE_EDX_DE 550 | X86_CPUID_AMD_FEATURE_EDX_PSE 551 | X86_CPUID_AMD_FEATURE_EDX_TSC 552 | X86_CPUID_AMD_FEATURE_EDX_MSR //?? this means AMD MSRs.. 553 //| X86_CPUID_AMD_FEATURE_EDX_PAE - not implemented yet. 554 //| X86_CPUID_AMD_FEATURE_EDX_MCE - not virtualized yet. 555 | X86_CPUID_AMD_FEATURE_EDX_CX8 556 //| X86_CPUID_AMD_FEATURE_EDX_APIC - set by the APIC device if present. 557 /* Note! we don't report sysenter/sysexit support due to our inability to keep the IOPL part of eflags in sync while in ring 1 (see #1757) */ 558 //| X86_CPUID_AMD_FEATURE_EDX_SEP 559 | X86_CPUID_AMD_FEATURE_EDX_MTRR 560 | X86_CPUID_AMD_FEATURE_EDX_PGE 561 | X86_CPUID_AMD_FEATURE_EDX_MCA 562 | X86_CPUID_AMD_FEATURE_EDX_CMOV 563 | X86_CPUID_AMD_FEATURE_EDX_PAT 564 | X86_CPUID_AMD_FEATURE_EDX_PSE36 565 //| X86_CPUID_AMD_FEATURE_EDX_NX - not virtualized, requires PAE. 566 //| X86_CPUID_AMD_FEATURE_EDX_AXMMX 567 | X86_CPUID_AMD_FEATURE_EDX_MMX 568 | X86_CPUID_AMD_FEATURE_EDX_FXSR 569 | X86_CPUID_AMD_FEATURE_EDX_FFXSR 570 //| X86_CPUID_AMD_FEATURE_EDX_PAGE1GB 571 //| X86_CPUID_AMD_FEATURE_EDX_RDTSCP - AMD only; turned on when necessary 572 //| X86_CPUID_AMD_FEATURE_EDX_LONG_MODE - turned on when necessary 573 | X86_CPUID_AMD_FEATURE_EDX_3DNOW_EX 574 | X86_CPUID_AMD_FEATURE_EDX_3DNOW 575 | 0; 576 pCPUM->aGuestCpuIdExt[1].ecx &= 0 577 //| X86_CPUID_AMD_FEATURE_ECX_LAHF_SAHF 578 //| X86_CPUID_AMD_FEATURE_ECX_CMPL 579 //| X86_CPUID_AMD_FEATURE_ECX_SVM - not virtualized. 580 //| X86_CPUID_AMD_FEATURE_ECX_EXT_APIC 581 /* Note: This could prevent teleporting from AMD to Intel CPUs! */ 582 | X86_CPUID_AMD_FEATURE_ECX_CR8L /* expose lock mov cr0 = mov cr8 hack for guests that can use this feature to access the TPR. */ 583 //| X86_CPUID_AMD_FEATURE_ECX_ABM 584 //| X86_CPUID_AMD_FEATURE_ECX_SSE4A 585 //| X86_CPUID_AMD_FEATURE_ECX_MISALNSSE 586 //| X86_CPUID_AMD_FEATURE_ECX_3DNOWPRF 587 //| X86_CPUID_AMD_FEATURE_ECX_OSVW 588 //| X86_CPUID_AMD_FEATURE_ECX_IBS 589 //| X86_CPUID_AMD_FEATURE_ECX_SSE5 590 //| X86_CPUID_AMD_FEATURE_ECX_SKINIT 591 //| X86_CPUID_AMD_FEATURE_ECX_WDT 592 | 0; 593 if (pCPUM->u8PortableCpuIdLevel > 0) 594 { 595 PORTABLE_DISABLE_FEATURE_BIT(1, Ext[1].ecx, CR8L, X86_CPUID_AMD_FEATURE_ECX_CR8L); 596 PORTABLE_DISABLE_FEATURE_BIT(1, Ext[1].edx, 3DNOW, X86_CPUID_AMD_FEATURE_EDX_3DNOW); 597 PORTABLE_DISABLE_FEATURE_BIT(1, Ext[1].edx, 3DNOW_EX, X86_CPUID_AMD_FEATURE_EDX_3DNOW_EX); 598 PORTABLE_DISABLE_FEATURE_BIT(1, Ext[1].edx, FFXSR, X86_CPUID_AMD_FEATURE_EDX_FFXSR); 599 PORTABLE_DISABLE_FEATURE_BIT(1, Ext[1].edx, RDTSCP, X86_CPUID_AMD_FEATURE_EDX_RDTSCP); 600 PORTABLE_DISABLE_FEATURE_BIT(2, Ext[1].ecx, LAHF_SAHF, X86_CPUID_AMD_FEATURE_ECX_LAHF_SAHF); 601 PORTABLE_DISABLE_FEATURE_BIT(3, Ext[1].ecx, CMOV, X86_CPUID_AMD_FEATURE_EDX_CMOV); 602 603 Assert(!(pCPUM->aGuestCpuIdExt[1].ecx & ( X86_CPUID_AMD_FEATURE_ECX_CMPL 604 | X86_CPUID_AMD_FEATURE_ECX_SVM 605 | X86_CPUID_AMD_FEATURE_ECX_EXT_APIC 606 | X86_CPUID_AMD_FEATURE_ECX_CR8L 607 | X86_CPUID_AMD_FEATURE_ECX_ABM 608 | X86_CPUID_AMD_FEATURE_ECX_SSE4A 609 | X86_CPUID_AMD_FEATURE_ECX_MISALNSSE 610 | X86_CPUID_AMD_FEATURE_ECX_3DNOWPRF 611 | X86_CPUID_AMD_FEATURE_ECX_OSVW 612 | X86_CPUID_AMD_FEATURE_ECX_IBS 613 | X86_CPUID_AMD_FEATURE_ECX_SSE5 614 | X86_CPUID_AMD_FEATURE_ECX_SKINIT 615 | X86_CPUID_AMD_FEATURE_ECX_WDT 616 | UINT32_C(0xffffc000) 617 ))); 618 Assert(!(pCPUM->aGuestCpuIdExt[1].edx & ( RT_BIT(10) 619 | X86_CPUID_AMD_FEATURE_EDX_SEP 620 | RT_BIT(18) 621 | RT_BIT(19) 622 | RT_BIT(21) 623 | X86_CPUID_AMD_FEATURE_EDX_AXMMX 624 | X86_CPUID_AMD_FEATURE_EDX_PAGE1GB 625 | RT_BIT(28) 626 ))); 627 } 628 629 /* 630 * Apply the Synthetic CPU modifications. (TODO: move this up) 631 */ 500 632 if (pCPUM->fSyntheticCpu) 501 633 { 502 const charszVendor[13] = "VirtualBox ";503 const charszProcessor[48] = "VirtualBox SPARCx86 Processor v1000 "; /* includes null terminator */634 static const char s_szVendor[13] = "VirtualBox "; 635 static const char s_szProcessor[48] = "VirtualBox SPARCx86 Processor v1000 "; /* includes null terminator */ 504 636 505 637 pCPUM->enmGuestCpuVendor = CPUMCPUVENDOR_SYNTHETIC; … … 509 641 510 642 /* 0: Vendor */ 511 pCPUM->aGuestCpuIdStd[0].ebx = pCPUM->aGuestCpuIdExt[0].ebx = ((uint32_t *)s zVendor)[0];512 pCPUM->aGuestCpuIdStd[0].ecx = pCPUM->aGuestCpuIdExt[0].ecx = ((uint32_t *)s zVendor)[2];513 pCPUM->aGuestCpuIdStd[0].edx = pCPUM->aGuestCpuIdExt[0].edx = ((uint32_t *)s zVendor)[1];643 pCPUM->aGuestCpuIdStd[0].ebx = pCPUM->aGuestCpuIdExt[0].ebx = ((uint32_t *)s_szVendor)[0]; 644 pCPUM->aGuestCpuIdStd[0].ecx = pCPUM->aGuestCpuIdExt[0].ecx = ((uint32_t *)s_szVendor)[2]; 645 pCPUM->aGuestCpuIdStd[0].edx = pCPUM->aGuestCpuIdExt[0].edx = ((uint32_t *)s_szVendor)[1]; 514 646 515 647 /* 1.eax: Version information. family : model : stepping */ … … 532 664 533 665 /* 0x800000002-4: Processor Name String Identifier. */ 534 pCPUM->aGuestCpuIdExt[2].eax = ((uint32_t *)s zProcessor)[0];535 pCPUM->aGuestCpuIdExt[2].ebx = ((uint32_t *)s zProcessor)[1];536 pCPUM->aGuestCpuIdExt[2].ecx = ((uint32_t *)s zProcessor)[2];537 pCPUM->aGuestCpuIdExt[2].edx = ((uint32_t *)s zProcessor)[3];538 pCPUM->aGuestCpuIdExt[3].eax = ((uint32_t *)s zProcessor)[4];539 pCPUM->aGuestCpuIdExt[3].ebx = ((uint32_t *)s zProcessor)[5];540 pCPUM->aGuestCpuIdExt[3].ecx = ((uint32_t *)s zProcessor)[6];541 pCPUM->aGuestCpuIdExt[3].edx = ((uint32_t *)s zProcessor)[7];542 pCPUM->aGuestCpuIdExt[4].eax = ((uint32_t *)s zProcessor)[8];543 pCPUM->aGuestCpuIdExt[4].ebx = ((uint32_t *)s zProcessor)[9];544 pCPUM->aGuestCpuIdExt[4].ecx = ((uint32_t *)s zProcessor)[10];545 pCPUM->aGuestCpuIdExt[4].edx = ((uint32_t *)s zProcessor)[11];666 pCPUM->aGuestCpuIdExt[2].eax = ((uint32_t *)s_szProcessor)[0]; 667 pCPUM->aGuestCpuIdExt[2].ebx = ((uint32_t *)s_szProcessor)[1]; 668 pCPUM->aGuestCpuIdExt[2].ecx = ((uint32_t *)s_szProcessor)[2]; 669 pCPUM->aGuestCpuIdExt[2].edx = ((uint32_t *)s_szProcessor)[3]; 670 pCPUM->aGuestCpuIdExt[3].eax = ((uint32_t *)s_szProcessor)[4]; 671 pCPUM->aGuestCpuIdExt[3].ebx = ((uint32_t *)s_szProcessor)[5]; 672 pCPUM->aGuestCpuIdExt[3].ecx = ((uint32_t *)s_szProcessor)[6]; 673 pCPUM->aGuestCpuIdExt[3].edx = ((uint32_t *)s_szProcessor)[7]; 674 pCPUM->aGuestCpuIdExt[4].eax = ((uint32_t *)s_szProcessor)[8]; 675 pCPUM->aGuestCpuIdExt[4].ebx = ((uint32_t *)s_szProcessor)[9]; 676 pCPUM->aGuestCpuIdExt[4].ecx = ((uint32_t *)s_szProcessor)[10]; 677 pCPUM->aGuestCpuIdExt[4].edx = ((uint32_t *)s_szProcessor)[11]; 546 678 547 679 /* 0x800000005-7 - reserved -> zero */ … … 572 704 * Intel: Cache and TLB information 573 705 * AMD: Reserved 574 * Safe to expose 575 */ 706 * Safe to expose; restrict the number of calls to 1 for the portable case. 707 */ 708 if ( pCPUM->u8PortableCpuIdLevel > 0 709 && pCPUM->aGuestCpuIdStd[0].eax >= 2 710 && (pCPUM->aGuestCpuIdStd[2].eax & 0xff) > 1) 711 { 712 LogRel(("PortableCpuId: Std[2].al: %d -> 1\n", pCPUM->aGuestCpuIdStd[2].eax & 0xff)); 713 pCPUM->aGuestCpuIdStd[2].eax &= UINT32_C(0xfffffffe); 714 } 576 715 577 716 /* Cpuid 3: 578 * Intel: EAX, EBX - reserved 717 * Intel: EAX, EBX - reserved (transmeta uses these) 579 718 * ECX, EDX - Processor Serial Number if available, otherwise reserved 580 719 * AMD: Reserved … … 582 721 */ 583 722 if (!(pCPUM->aGuestCpuIdStd[1].edx & X86_CPUID_FEATURE_EDX_PSN)) 723 { 584 724 pCPUM->aGuestCpuIdStd[3].ecx = pCPUM->aGuestCpuIdStd[3].edx = 0; 725 if (pCPUM->u8PortableCpuIdLevel > 0) 726 pCPUM->aGuestCpuIdStd[3].eax = pCPUM->aGuestCpuIdStd[3].ebx = 0; 727 } 585 728 586 729 /* Cpuid 4: … … 619 762 pCPUM->aGuestCpuIdStd[5].ecx = pCPUM->aGuestCpuIdStd[5].edx = 0; 620 763 /** @cfgm{/CPUM/MWaitExtensions, boolean, false} 621 * Expose MWAIT extended features to the guest. 622 * For now we expose just MWAIT break on interrupt feature (bit 1)764 * Expose MWAIT extended features to the guest. For now we expose 765 * just MWAIT break on interrupt feature (bit 1). 623 766 */ 624 767 bool fMWaitExtensions; … … 643 786 pCPUM->aGuestCpuIdStd[5].ecx = pCPUM->aGuestCpuIdStd[5].edx = 0; 644 787 645 /*646 * Determine the default.647 *648 * Intel returns values of the highest standard function, while AMD649 * returns zeros. VIA on the other hand seems to returning nothing or650 * perhaps some random garbage, we don't try to duplicate this behavior.651 */652 ASMCpuId(pCPUM->aGuestCpuIdStd[0].eax + 10,653 &pCPUM->GuestCpuIdDef.eax, &pCPUM->GuestCpuIdDef.ebx,654 &pCPUM->GuestCpuIdDef.ecx, &pCPUM->GuestCpuIdDef.edx);655 656 788 /* Cpuid 0x800000005 & 0x800000006 contain information about L1, L2 & L3 cache and TLB identifiers. 657 789 * Safe to pass on to the guest. … … 686 818 //| X86_CPUID_AMD_ADVPOWER_EDX_MC 687 819 //| X86_CPUID_AMD_ADVPOWER_EDX_HWPSTATE 688 #if 1 689 /* We don't expose X86_CPUID_AMD_ADVPOWER_EDX_TSCINVAR, because newer Linux kernels blindly assume 690 * that the AMD performance counters work if this is set for 64 bits guests. (can't really find a CPUID feature bit for them though) 691 */ 692 #else 820 #if 0 /* We don't expose X86_CPUID_AMD_ADVPOWER_EDX_TSCINVAR, because newer 821 * Linux kernels blindly assume that the AMD performance counters work 822 * if this is set for 64 bits guests. (Can't really find a CPUID feature 823 * bit for them though.) */ 693 824 | X86_CPUID_AMD_ADVPOWER_EDX_TSCINVAR 694 825 #endif … … 701 832 /* Cpuid 0x800000008: 702 833 * AMD: EBX, EDX - reserved 703 * EAX: Virtual/Physical address Size834 * EAX: Virtual/Physical/Guest address Size 704 835 * ECX: Number of cores + APICIdCoreIdSize 705 836 * Intel: EAX: Virtual/Physical address Size … … 709 840 { 710 841 /* Only expose the virtual and physical address sizes to the guest. (EAX completely) */ 842 pCPUM->aGuestCpuIdExt[8].eax &= UINT32_C(0x0000ffff); 711 843 pCPUM->aGuestCpuIdExt[8].ebx = pCPUM->aGuestCpuIdExt[8].edx = 0; /* reserved */ 712 844 /* Set APICIdCoreIdSize to zero (use legacy method to determine the number of cores per cpu) … … 733 865 rc = CFGMR3QueryBoolDef(pCpumCfg, "NT4LeafLimit", &fNt4LeafLimit, false); AssertRCReturn(rc, rc); 734 866 if (fNt4LeafLimit) 735 pCPUM->aGuestCpuIdStd[0].eax = 3; 867 pCPUM->aGuestCpuIdStd[0].eax = 3; /** @todo r=bird: shouldn't we check if pCPUM->aGuestCpuIdStd[0].eax > 3 before setting it 3 here? */ 736 868 737 869 /* … … 744 876 if (pCPUM->aGuestCpuIdStd[0].eax > 5) 745 877 pCPUM->aGuestCpuIdStd[0].eax = 5; 746 747 878 for (i = pCPUM->aGuestCpuIdStd[0].eax + 1; i < RT_ELEMENTS(pCPUM->aGuestCpuIdStd); i++) 748 879 pCPUM->aGuestCpuIdStd[i] = pCPUM->GuestCpuIdDef; … … 753 884 ? pCPUM->aGuestCpuIdExt[0].eax - UINT32_C(0x80000000) + 1 754 885 : 0; 755 i < RT_ELEMENTS(pCPUM->aGuestCpuIdExt); i++) 886 i < RT_ELEMENTS(pCPUM->aGuestCpuIdExt); 887 i++) 756 888 pCPUM->aGuestCpuIdExt[i] = pCPUM->GuestCpuIdDef; 757 889 … … 812 944 DBGFR3InfoLog(pVM, "cpuid", "verbose"); /* macro */ 813 945 LogRel(("******************** End of CPUID dump **********************\n")); 946 947 #undef PORTABLE_DISABLE_FEATURE_BIT 948 #undef PORTABLE_CLEAR_BITS_WHEN 949 814 950 return VINF_SUCCESS; 815 951 } 816 817 818 952 819 953 … … 923 1057 * Initialize everything to ZERO first. 924 1058 */ 925 uint32_t 1059 uint32_t fUseFlags = pVCpu->cpum.s.fUseFlags & ~CPUM_USED_FPU_SINCE_REM; 926 1060 memset(pCtx, 0, sizeof(*pCtx)); 927 1061 pVCpu->cpum.s.fUseFlags = fUseFlags; … … 1327 1461 * Get the host and guest overrides so we don't reject the state because 1328 1462 * some feature was enabled thru these interfaces. 1329 * Note! We currently only need the feature lea fs, so skip rest.1463 * Note! We currently only need the feature leaves, so skip rest. 1330 1464 */ 1331 1465 PCFGMNODE pOverrideCfg = CFGMR3GetChild(CFGMR3GetRoot(pVM), "CPUM/CPUID"); … … 1480 1614 CPUID_CHECK_RET( (aHostRawExt[0].eax >= UINT32_C(0x80000001) && aHostRawExt[0].eax <= UINT32_C(0x8000007f)) 1481 1615 || !(aRawExt[0].eax >= UINT32_C(0x80000001) && aRawExt[0].eax <= UINT32_C(0x8000007f)), 1482 (N_("Extended lea fs was present on saved state host, but is missing on the current\n")));1616 (N_("Extended leaves was present on saved state host, but is missing on the current\n"))); 1483 1617 if (aRawExt[0].eax >= UINT32_C(0x80000001) && aRawExt[0].eax <= UINT32_C(0x8000007f)) 1484 1618 { … … 2746 2880 if (cStdMax >= 1 && iVerbosity) 2747 2881 { 2882 static const char * const s_apszTypes[4] = { "primary", "overdrive", "MP", "reserved" }; 2883 2748 2884 Guest = pVM->cpum.s.aGuestCpuIdStd[1]; 2749 2885 uint32_t uEAX = Guest.eax; … … 2753 2889 "Model: %d \tExtended: %d \tEffective: %d\n" 2754 2890 "Stepping: %d\n" 2755 "Type: %d \n"2891 "Type: %d (%s)\n" 2756 2892 "APIC ID: %#04x\n" 2757 2893 "Logical CPUs: %d\n" … … 2761 2897 (uEAX >> 4) & 0xf, (uEAX >> 16) & 0x0f, ASMGetCpuModel(uEAX, fIntel), 2762 2898 ASMGetCpuStepping(uEAX), 2763 (uEAX >> 12) & 3, 2899 (uEAX >> 12) & 3, s_apszTypes[(uEAX >> 12) & 3], 2764 2900 (Guest.ebx >> 24) & 0xff, 2765 2901 (Guest.ebx >> 16) & 0xff, … … 3200 3336 "Physical Address Width: %d bits\n" 3201 3337 "Virtual Address Width: %d bits\n", 3338 "Guest Physical Address Width: %d bits\n", 3202 3339 (uEAX >> 0) & 0xff, 3203 (uEAX >> 8) & 0xff); 3340 (uEAX >> 8) & 0xff, 3341 (uEAX >> 16) & 0xff); 3204 3342 pHlp->pfnPrintf(pHlp, 3205 3343 "Physical Core Count: %d\n", -
trunk/src/VBox/VMM/CPUMInternal.h
r28800 r30164 257 257 typedef struct CPUM 258 258 { 259 /* Offset from CPUM to CPUMCPU for the first CPU. */260 uint32_t ulOffCPUMCPU;259 /** Offset from CPUM to CPUMCPU for the first CPU. */ 260 uint32_t offCPUMCPU0; 261 261 262 262 /** Use flags. … … 282 282 } CPUFeaturesExt; 283 283 284 /* Host CPU manufacturer. */284 /** Host CPU manufacturer. */ 285 285 CPUMCPUVENDOR enmHostCpuVendor; 286 /* Guest CPU manufacturer. */286 /** Guest CPU manufacturer. */ 287 287 CPUMCPUVENDOR enmGuestCpuVendor; 288 288 … … 298 298 /** Synthetic CPU type? */ 299 299 bool fSyntheticCpu; 300 /** The (more) portable CPUID level. */ 301 uint8_t u8PortableCpuIdLevel; 300 302 /** Indiciates that a state restore is pending. 301 303 * This is used to verify load order dependencies (PGM). */ 302 304 bool fPendingRestore; 303 uint8_t abPadding[1 + (HC_ARCH_BITS == 64) * 4]; 305 #if HC_ARCH_BITS == 64 306 uint8_t abPadding[4]; 307 #endif 304 308 305 309 /** The standard set of CpuId leafs. */ … … 379 383 uint32_t fChanged; 380 384 381 /* Offset to CPUM. (subtract from the pointer to get to CPUM) */ 382 uint32_t ulOffCPUM; 383 384 /* Temporary storage for the return code of the function called in the 32-64 switcher. */ 385 /** Offset from CPUM to CPUMCPU. */ 386 uint32_t offCPUM; 387 388 /** Temporary storage for the return code of the function called in the 389 * 32-64 switcher. */ 385 390 uint32_t u32RetCode; 386 391 387 /** Align the next member, and thereby the structure,on a 64-byte boundrary. */392 /** Align the structure on a 64-byte boundrary. */ 388 393 uint8_t abPadding2[HC_ARCH_BITS == 32 ? 36 : 28]; 389 394 } CPUMCPU, *PCPUMCPU; -
trunk/src/VBox/VMM/CPUMInternal.mac
r28800 r30164 5 5 6 6 ; 7 ; Copyright (C) 2006-20 07Oracle Corporation7 ; Copyright (C) 2006-2010 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 49 49 struc CPUM 50 50 ;... 51 . ulOffCPUMCPUresd 151 .offCPUMCPU0 resd 1 52 52 .fHostUseFlags resd 1 53 53 … … 69 69 .fRawEntered resb 1 70 70 .fSyntheticCpu resb 1 71 .u8PortableCpuIdLevel resb 1 71 72 .fPendingRestore resb 1 72 73 %if RTHCPTR_CB == 8 73 .abPadding resb 574 .abPadding resb 4 74 75 %else 75 .abPadding resb 1 76 ; .abPadding resb 0 76 77 %endif 77 78 … … 415 416 .fUseFlags resd 1 416 417 .fChanged resd 1 417 . ulOffCPUMresd 1418 .offCPUM resd 1 418 419 .u32RetCode resd 1 419 420 … … 431 432 ; @param %1 register name 432 433 %macro CPUMCPU_FROM_CPUM 1 433 add %1, dword [%1 + CPUM. ulOffCPUMCPU]434 add %1, dword [%1 + CPUM.offCPUMCPU0] 434 435 %endmacro 435 436 … … 438 439 ; @param %1 register name 439 440 %macro CPUM_FROM_CPUMCPU 1 440 sub %1, dword [%1 + CPUMCPU. ulOffCPUM]441 sub %1, dword [%1 + CPUMCPU.offCPUM] 441 442 %endmacro -
trunk/src/VBox/VMM/VMMAll/CPUMAllA.asm
r28800 r30164 153 153 %ifndef RT_ARCH_AMD64 154 154 mov eax, edx ; Calculate the PCPUM pointer 155 sub eax, [edx + CPUMCPU. ulOffCPUM]155 sub eax, [edx + CPUMCPU.offCPUM] 156 156 test dword [eax + CPUM.CPUFeatures.edx], X86_CPUID_FEATURE_EDX_FXSR 157 157 jz short hlfpua_no_fxsave -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r30145 r30164 1380 1380 { 1381 1381 if ( pVM->cpum.s.aGuestCpuIdExt[0].eax < 0x80000001 1382 || !(ASMCpuId_EDX(0x80000001) & X86_CPUID_AMD_FEATURE_EDX_RDTSCP)) 1382 || !(ASMCpuId_EDX(0x80000001) & X86_CPUID_AMD_FEATURE_EDX_RDTSCP) 1383 || pVM->cpum.s.u8PortableCpuIdLevel > 0) 1383 1384 { 1384 LogRel(("WARNING: Can't turn on RDTSCP when the host doesn't support it!!\n")); 1385 if (!pVM->cpum.s.u8PortableCpuIdLevel) 1386 LogRel(("WARNING: Can't turn on RDTSCP when the host doesn't support it!!\n")); 1385 1387 return; 1386 1388 } -
trunk/src/VBox/VMM/VMMGC/CPUMGCA.asm
r28800 r30164 70 70 mov edx, IMP(g_CPUM) 71 71 ; Convert to CPUMCPU pointer 72 add edx, [edx + CPUM. ulOffCPUMCPU]72 add edx, [edx + CPUM.offCPUMCPU0] 73 73 74 74 mov ecx, [edx + CPUMCPU.Guest.eip] … … 249 249 BEGINPROC_EXPORTED CPUMGCResumeGuest 250 250 ; Convert to CPUMCPU pointer 251 add edx, [edx + CPUM. ulOffCPUMCPU]251 add edx, [edx + CPUM.offCPUMCPU0] 252 252 ; 253 253 ; Setup iretd … … 327 327 BEGINPROC_EXPORTED CPUMGCResumeGuestV86 328 328 ; Convert to CPUMCPU pointer 329 add edx, [edx + CPUM. ulOffCPUMCPU]329 add edx, [edx + CPUM.offCPUMCPU0] 330 330 ; 331 331 ; Setup iretd -
trunk/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac
r28800 r30164 196 196 BEGINPROC vmmR0HostToGuestAsm 197 197 ;; Store the offset from CPUM to CPUMCPU in r8 198 mov r8d, [rdx + CPUM. ulOffCPUMCPU]198 mov r8d, [rdx + CPUM.offCPUMCPU0] 199 199 200 200 ;; … … 943 943 mov rdx, [NAME(pCpumHC) wrt rip] 944 944 ; Load the CPUMCPU offset. 945 mov r8d, [rdx + CPUM. ulOffCPUMCPU]945 mov r8d, [rdx + CPUM.offCPUMCPU0] 946 946 947 947 ; activate host gdt and idt
Note:
See TracChangeset
for help on using the changeset viewer.