fixed CPUID after correlation with real HW CPUZ output
This commit is contained in:
parent
1a051f9f00
commit
919fbd95da
@ -91,9 +91,10 @@ romimage: file=$BXSHARE/BIOS-bochs-latest
|
||||
# has no effect anymore.
|
||||
#
|
||||
# CPU configurations that can be selected:
|
||||
# ------------------------------------------------------
|
||||
# core2_pnr Intel(R) Core(TM)2 Extreme CPU X9770
|
||||
# core2_snb Intel(R) Core(TM) i7-2600K CPU
|
||||
# -----------------------------------------------------------------
|
||||
# p4_prescott_celeron_336 Intel(R) Celeron(R) 336
|
||||
# core2_extreme_x9770 Intel(R) Core(TM)2 Extreme X9770
|
||||
# corei7_sandy_bridge_2600k Intel(R) Core(TM) i7-2600K
|
||||
#
|
||||
# COUNT:
|
||||
# Set the number of processors:cores per processor:threads per core
|
||||
|
@ -3979,7 +3979,8 @@ int bx_write_configuration(const char *rc, int overwrite)
|
||||
#else
|
||||
fprintf(fp, "cpu: count=1, ips=%u, ", SIM->get_param_num(BXPN_IPS)->get());
|
||||
#endif
|
||||
fprintf(fp, "reset_on_triple_fault=%d, cpuid_limit_winnt=%d",
|
||||
fprintf(fp, "model=%s, reset_on_triple_fault=%d, cpuid_limit_winnt=%d",
|
||||
SIM->get_param_enum(BXPN_CPU_MODEL)->get_selected(),
|
||||
SIM->get_param_bool(BXPN_RESET_ON_TRIPLE_FAULT)->get(),
|
||||
SIM->get_param_bool(BXPN_CPUID_LIMIT_WINNT)->get());
|
||||
#if BX_CPU_LEVEL >= 5
|
||||
|
@ -186,12 +186,13 @@ void core2_extreme_x9770_t::get_std_cpuid_leaf_1(cpuid_function_t *leaf)
|
||||
// [23:16] Number of logical processors in one physical processor
|
||||
// [31:24] Local Apic ID
|
||||
|
||||
leaf->ebx = (CACHE_LINE_SIZE / 8) << 8;
|
||||
#if BX_SUPPORT_SMP
|
||||
unsigned n_logical_processors = ncores*nthreads;
|
||||
if (n_logical_processors > 1)
|
||||
leaf->ebx |= (n_logical_processors << 16);
|
||||
#else
|
||||
unsigned n_logical_processors = 1;
|
||||
#endif
|
||||
leaf->ebx = ((CACHE_LINE_SIZE / 8) << 8) |
|
||||
(n_logical_processors << 16);
|
||||
#if BX_SUPPORT_APIC
|
||||
leaf->ebx |= ((cpu->get_apic_id() & 0xff) << 24);
|
||||
#endif
|
||||
|
@ -207,12 +207,13 @@ void corei7_sandy_bridge_2600k_t::get_std_cpuid_leaf_1(cpuid_function_t *leaf)
|
||||
// [23:16] Number of logical processors in one physical processor
|
||||
// [31:24] Local Apic ID
|
||||
|
||||
leaf->ebx = (CACHE_LINE_SIZE / 8) << 8;
|
||||
#if BX_SUPPORT_SMP
|
||||
unsigned n_logical_processors = ncores*nthreads;
|
||||
if (n_logical_processors > 1)
|
||||
leaf->ebx |= (n_logical_processors << 16);
|
||||
#else
|
||||
unsigned n_logical_processors = 1;
|
||||
#endif
|
||||
leaf->ebx = ((CACHE_LINE_SIZE / 8) << 8) |
|
||||
(n_logical_processors << 16);
|
||||
#if BX_SUPPORT_APIC
|
||||
leaf->ebx |= ((cpu->get_apic_id() & 0xff) << 24);
|
||||
#endif
|
||||
|
@ -156,12 +156,13 @@ void p4_prescott_celeron_336_t::get_std_cpuid_leaf_1(cpuid_function_t *leaf)
|
||||
// [23:16] Number of logical processors in one physical processor
|
||||
// [31:24] Local Apic ID
|
||||
|
||||
leaf->ebx = (CACHE_LINE_SIZE / 8) << 8;
|
||||
#if BX_SUPPORT_SMP
|
||||
unsigned n_logical_processors = ncores*nthreads;
|
||||
if (n_logical_processors > 1)
|
||||
leaf->ebx |= (n_logical_processors << 16);
|
||||
#else
|
||||
unsigned n_logical_processors = 1;
|
||||
#endif
|
||||
leaf->ebx = ((CACHE_LINE_SIZE / 8) << 8) |
|
||||
(n_logical_processors << 16);
|
||||
#if BX_SUPPORT_APIC
|
||||
leaf->ebx |= ((cpu->get_apic_id() & 0xff) << 24);
|
||||
#endif
|
||||
@ -321,7 +322,7 @@ void p4_prescott_celeron_336_t::get_ext_cpuid_leaf_1(cpuid_function_t *leaf)
|
||||
leaf->ebx = 0;
|
||||
|
||||
// ECX:
|
||||
// * [0:0] LAHF/SAHF instructions support in 64-bit mode
|
||||
// [0:0] LAHF/SAHF instructions support in 64-bit mode
|
||||
// [1:1] CMP_Legacy: Core multi-processing legacy mode (AMD)
|
||||
// [2:2] SVM: Secure Virtual Machine (AMD)
|
||||
// [3:3] Extended APIC Space
|
||||
@ -336,7 +337,7 @@ void p4_prescott_celeron_336_t::get_ext_cpuid_leaf_1(cpuid_function_t *leaf)
|
||||
// [13:13] WDT: Watchdog timer support
|
||||
// [31:14] reserved
|
||||
|
||||
leaf->ecx = BX_CPUID_EXT2_LAHF_SAHF;
|
||||
leaf->ecx = 0;
|
||||
|
||||
// EDX:
|
||||
// Many of the bits in EDX are the same as EAX [*] for AMD
|
||||
|
@ -186,9 +186,10 @@ void bx_generic_cpuid_t::get_std_cpuid_leaf_1(cpuid_function_t *leaf)
|
||||
}
|
||||
#if BX_SUPPORT_SMP
|
||||
unsigned n_logical_processors = ncores*nthreads;
|
||||
if (n_logical_processors > 1)
|
||||
leaf->ebx |= (n_logical_processors << 16);
|
||||
#else
|
||||
unsigned n_logical_processors = 1;
|
||||
#endif
|
||||
leaf->ebx |= (n_logical_processors << 16);
|
||||
#if BX_SUPPORT_APIC
|
||||
leaf->ebx |= ((cpu->get_apic_id() & 0xff) << 24);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user