Changeset 23797 in vbox
- Timestamp:
- Oct 15, 2009 12:54:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/CPUM.cpp
r23794 r23797 411 411 pCPUM->enmGuestCpuVendor = CPUMCPUVENDOR_SYNTHETIC; 412 412 413 /* Vendor */ 413 /* Limit the nr of standard leaves; 5 for monitor/mwait */ 414 pCPUM->aGuestCpuIdStd[0].eax = RT_MIN(pCPUM->aGuestCpuIdStd[0].eax, 5); 415 416 /* 0: Vendor */ 414 417 pCPUM->aGuestCpuIdStd[0].ebx = pCPUM->aGuestCpuIdExt[0].ebx = ((uint32_t *)szVendor)[0]; 415 418 pCPUM->aGuestCpuIdStd[0].ecx = pCPUM->aGuestCpuIdExt[0].ecx = ((uint32_t *)szVendor)[2]; 416 419 pCPUM->aGuestCpuIdStd[0].edx = pCPUM->aGuestCpuIdExt[0].edx = ((uint32_t *)szVendor)[1]; 417 420 418 /* Processor Name String Identifier. */ 421 /* 1.eax: Version information. family : model : stepping */ 422 pCPUM->aGuestCpuIdStd[0].eax = (0xf << 8) + (0x1 << 4) + 1; 423 424 /* Leaves 2 - 4 are Intel only - zero them out */ 425 memset(&pCPUM->aGuestCpuIdStd[2], 0, sizeof(pCPUM->aGuestCpuIdStd[2])); 426 memset(&pCPUM->aGuestCpuIdStd[3], 0, sizeof(pCPUM->aGuestCpuIdStd[3])); 427 memset(&pCPUM->aGuestCpuIdStd[4], 0, sizeof(pCPUM->aGuestCpuIdStd[4])); 428 429 /* Leaf 5 = monitor/mwait */ 430 431 /* Limit the nr of extended leaves: 0x80000008 to include the max virtual and physical address size (64 bits guests). */ 432 pCPUM->aGuestCpuIdExt[0].eax = RT_MIN(pCPUM->aGuestCpuIdExt[0].eax, 0x80000008); 433 /* AMD only - set to zero. */ 434 pCPUM->aGuestCpuIdExt[0].ebx = pCPUM->aGuestCpuIdExt[0].ecx = pCPUM->aGuestCpuIdExt[0].edx = 0; 435 436 /* 0x800000001: AMD only; shared feature bits are set dynamically. */ 437 memset(&pCPUM->aGuestCpuIdExt[1], 0, sizeof(pCPUM->aGuestCpuIdExt[1])); 438 439 /* 0x800000002-4: Processor Name String Identifier. */ 419 440 pCPUM->aGuestCpuIdExt[2].eax = ((uint32_t *)szProcessor)[0]; 420 441 pCPUM->aGuestCpuIdExt[2].ebx = ((uint32_t *)szProcessor)[1]; … … 430 451 pCPUM->aGuestCpuIdExt[4].edx = ((uint32_t *)szProcessor)[11]; 431 452 432 /* AMD only; shared feature bits are set dynamically. */ 433 pCPUM->aGuestCpuIdExt[1].edx = 0; 434 pCPUM->aGuestCpuIdExt[1].ecx = 0; 453 /* 0x800000005-7 - reserved -> zero */ 454 memset(&pCPUM->aGuestCpuIdExt[5], 0, sizeof(pCPUM->aGuestCpuIdExt[5])); 455 memset(&pCPUM->aGuestCpuIdExt[6], 0, sizeof(pCPUM->aGuestCpuIdExt[6])); 456 memset(&pCPUM->aGuestCpuIdExt[7], 0, sizeof(pCPUM->aGuestCpuIdExt[7])); 457 458 /* 0x800000008: only the max virtual and physical address size. */ 459 pCPUM->aGuestCpuIdExt[8].ecx = pCPUM->aGuestCpuIdExt[8].ebx = pCPUM->aGuestCpuIdExt[8].edx = 0; /* reserved */ 435 460 436 461 /** @todo fill in the rest of the cpu leaves. */ … … 443 468 pCPUM->aGuestCpuIdStd[1].ebx &= 0x0000ffff; 444 469 #ifdef VBOX_WITH_MULTI_CORE 445 if (pVM->cCpus > 1) 470 if ( pVM->cCpus > 1 471 && pCPUM->enmGuestCpuVendor != CPUMCPUVENDOR_SYNTHETIC) 446 472 { 447 473 /* If CPUID Fn0000_0001_EDX[HTT] = 1 then LogicalProcessorCount is the number of threads per CPU core times the number of CPU cores per processor */ … … 584 610 585 611 /** @cfgm{/CPUM/NT4LeafLimit, boolean, false} 586 * Limit the number of standard CPUID lea fs to 0..2to prevent NT4 from612 * Limit the number of standard CPUID leaves to 0..3 to prevent NT4 from 587 613 * bugchecking with MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED (0x3e). 588 614 * This option corrsponds somewhat to IA32_MISC_ENABLES.BOOT_NT4[bit 22]. 589 * @todo r=bird: The intel docs states that leafs 3 is included, why don't we?590 615 */ 591 616 bool fNt4LeafLimit; 592 617 CFGMR3QueryBoolDef(CFGMR3GetChild(CFGMR3GetRoot(pVM), "CPUM"), "NT4LeafLimit", &fNt4LeafLimit, false); 593 618 if (fNt4LeafLimit) 594 pCPUM->aGuestCpuIdStd[0].eax = 2;619 pCPUM->aGuestCpuIdStd[0].eax = 3; 595 620 596 621 /* … … 906 931 { 907 932 /* 908 * Save all the CPU ID lea fs here so we can check them for compatability933 * Save all the CPU ID leaves here so we can check them for compatability 909 934 * upon loading. 910 935 */ … … 939 964 940 965 /** 941 * Loads the CPU ID lea fs saved by pass 0.966 * Loads the CPU ID leaves saved by pass 0. 942 967 * 943 968 * @returns VBox status code. … … 1031 1056 1032 1057 /* 1033 * We're good, commit the CPU ID lea fs.1058 * We're good, commit the CPU ID leaves. 1034 1059 */ 1035 1060 memcmp(&pVM->cpum.s.aGuestCpuIdStd[0], &aGuestCpuIdStd[0], sizeof(aGuestCpuIdStd)); … … 2783 2808 2784 2809 /** 2785 * Gets a pointer to the array of standard CPUID lea fs.2810 * Gets a pointer to the array of standard CPUID leaves. 2786 2811 * 2787 2812 * CPUMR3GetGuestCpuIdStdMax() give the size of the array. 2788 2813 * 2789 * @returns Pointer to the standard CPUID lea fs (read-only).2814 * @returns Pointer to the standard CPUID leaves (read-only). 2790 2815 * @param pVM The VM handle. 2791 2816 * @remark Intended for PATM. … … 2798 2823 2799 2824 /** 2800 * Gets a pointer to the array of extended CPUID lea fs.2825 * Gets a pointer to the array of extended CPUID leaves. 2801 2826 * 2802 2827 * CPUMGetGuestCpuIdExtMax() give the size of the array. 2803 2828 * 2804 * @returns Pointer to the extended CPUID lea fs (read-only).2829 * @returns Pointer to the extended CPUID leaves (read-only). 2805 2830 * @param pVM The VM handle. 2806 2831 * @remark Intended for PATM. … … 2813 2838 2814 2839 /** 2815 * Gets a pointer to the array of centaur CPUID lea fs.2840 * Gets a pointer to the array of centaur CPUID leaves. 2816 2841 * 2817 2842 * CPUMGetGuestCpuIdCentaurMax() give the size of the array. 2818 2843 * 2819 * @returns Pointer to the centaur CPUID lea fs (read-only).2844 * @returns Pointer to the centaur CPUID leaves (read-only). 2820 2845 * @param pVM The VM handle. 2821 2846 * @remark Intended for PATM.
Note:
See TracChangeset
for help on using the changeset viewer.