move BRAND STRING parameter from CPUID to CPU option

CPUID option will be removed soon
This commit is contained in:
Stanislav Shwartsman 2024-11-06 07:16:37 +02:00
parent 6409fd68de
commit ca8daea663
6 changed files with 26 additions and 24 deletions

View File

@ -22,22 +22,22 @@ cpu
n_cores
n_threads
model
add_features
exclude_features
ips
quantum
reset_on_triple_fault
msrs
cpuid_limit_winnt
mwait_is_nop
brand_string
cpuid
level
family
model
add_features
exclude_features
stepping
vendor_string
brand_string
mmx
sep
simd

View File

@ -689,6 +689,13 @@ void bx_init_options()
"", BX_PATHNAME_LEN);
#endif
new bx_param_string_c(cpu_param,
"brand_string",
"CPUID brand string",
"Set the CPUID brand string override (keep empty to use original brand string)",
"",
BX_CPUID_BRAND_LEN+1);
cpu_param->set_options(menu->SHOW_PARENT);
// cpuid subtree
@ -729,16 +736,6 @@ void bx_init_options()
"AuthenticAMD",
#endif
BX_CPUID_VENDOR_LEN+1);
new bx_param_string_c(cpuid_param,
"brand_string",
"CPUID brand string",
"Set the CPUID brand string",
#if BX_CPU_VENDOR_INTEL
" Intel(R) Pentium(R) 4 CPU ",
#else
"AMD Athlon(tm) processor",
#endif
BX_CPUID_BRAND_LEN+1);
#if BX_CPU_LEVEL >= 5
new bx_param_bool_c(cpuid_param,

View File

@ -451,6 +451,9 @@ void bx_cpuid_t::get_leaf_0(unsigned max_leaf, const char *vendor_string, cpuid_
void bx_cpuid_t::get_ext_cpuid_brand_string_leaf(const char *brand_string, Bit32u function, cpuid_function_t *leaf) const
{
static const char *brand_string_ovr = (const char *)SIM->get_param_string(BXPN_BRAND_STRING)->getptr();
if (brand_string_ovr && *brand_string_ovr) brand_string = brand_string_ovr;
switch(function) {
case 0x80000002:
memcpy(&(leaf->eax), brand_string , 4);

View File

@ -3457,6 +3457,12 @@ to work around WinNT installation and boot issues.
When this option is enabled MWAIT will not put the CPU into a sleep state.
This option exists only if Bochs compiled with <option>--enable-monitor-mwait</option>.
</para>
<para><command>brand_string</command></para>
<para>
Set the CPUID brand string returned by CPUID(0x80000002 .. 0x80000004).
This should be at most a forty-eight-character ASCII string.
Keep it empty to use original CPUID brand string.
</para>
<para><command>msrs</command></para>
<para>
Define path to user CPU Model Specific Registers (MSRs) specification.
@ -3543,11 +3549,6 @@ Set stepping information returned by CPUID. Default stepping value is 3.
Set the CPUID vendor string returned by CPUID(0x0). This should be a
twelve-character ASCII string.
</para>
<para><command>brand_string</command></para>
<para>
Set the CPUID brand string returned by CPUID(0x80000002 .. 0x80000004]). This should be
at most a forty-eight-character ASCII string.
</para>
<para><command>mmx</command></para>
<para>
Select MMX instruction set support.

View File

@ -182,6 +182,12 @@ mwait_is_nop:
When this option is enabled MWAIT will not put the CPU into a sleep state.
This option exists only if Bochs compiled with --enable-monitor-mwait.
brand_string:
Set the CPUID brand string returned by CPUID(0x80000002 .. 0x80000004).
This should be at most a forty-eight-character ASCII string.
Keep it empty to use original CPUID brand string.
msrs:
Define path to user CPU Model Specific Registers (MSRs) specification.
@ -259,11 +265,6 @@ vendor_string:
Set the CPUID vendor string returned by CPUID(0x0). This should be a
twelve-character ASCII string.
brand_string:
Set the CPUID vendor string returned by CPUID(0x80000002 .. 0x80000004).
This should be at most a forty-eight-character ASCII string.
mmx:
Select MMX instruction set support.

View File

@ -48,8 +48,8 @@
#define BXPN_CONFIGURABLE_MSRS_PATH "cpu.msrs"
#define BXPN_CPUID_LIMIT_WINNT "cpu.cpuid_limit_winnt"
#define BXPN_MWAIT_IS_NOP "cpu.mwait_is_nop"
#define BXPN_BRAND_STRING "cpu.brand_string"
#define BXPN_VENDOR_STRING "cpuid.vendor_string"
#define BXPN_BRAND_STRING "cpuid.brand_string"
#define BXPN_CPUID_LEVEL "cpuid.level"
#define BXPN_CPUID_FAMILY "cpuid.family"
#define BXPN_CPUID_MODEL "cpuid.model"