* hw/i386/pc_sysfw: Alias rather than copy isa-bios region
* target/i386: add control bits support for LAM * target/i386: tweaks to new translator * target/i386: add support for LAM in CPUID enumeration * hw/i386/pc: Support smp.modules for x86 PC machine * target-i386: hyper-v: Correct kvm_hv_handle_exit return value -----BEGIN PGP SIGNATURE----- iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmZOMlAUHHBib256aW5p QHJlZGhhdC5jb20ACgkQv/vSX3jHroNTSwf8DOPgipepNcsxUQoV9nOBfNXqEWa6 DilQGwuu/3eMSPITUCGKVrtLR5azwCwvNfYYErVBPVIhjImnk3XHwfKpH1csadgq 7Np8WGjAyKEIP/yC/K1VwsanFHv3hmC6jfcO3ZnsnlmbHsRINbvU9uMlFuiQkKJG lP/dSUcTVhwLT6eFr9DVDUnq4Nh7j3saY85pZUoDclobpeRLaEAYrawha1/0uQpc g7MZYsxT3sg9PIHlM+flpRvJNPz/ZDBdj4raN1xo4q0ET0KRLni6oEOVs5GpTY1R t4O8a/IYkxeI15K9U7i0HwYI2wVwKZbHgp9XPMYVZFJdKBGT8bnF56pV9A== =lp7q -----END PGP SIGNATURE----- Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging * hw/i386/pc_sysfw: Alias rather than copy isa-bios region * target/i386: add control bits support for LAM * target/i386: tweaks to new translator * target/i386: add support for LAM in CPUID enumeration * hw/i386/pc: Support smp.modules for x86 PC machine * target-i386: hyper-v: Correct kvm_hv_handle_exit return value # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmZOMlAUHHBib256aW5p # QHJlZGhhdC5jb20ACgkQv/vSX3jHroNTSwf8DOPgipepNcsxUQoV9nOBfNXqEWa6 # DilQGwuu/3eMSPITUCGKVrtLR5azwCwvNfYYErVBPVIhjImnk3XHwfKpH1csadgq # 7Np8WGjAyKEIP/yC/K1VwsanFHv3hmC6jfcO3ZnsnlmbHsRINbvU9uMlFuiQkKJG # lP/dSUcTVhwLT6eFr9DVDUnq4Nh7j3saY85pZUoDclobpeRLaEAYrawha1/0uQpc # g7MZYsxT3sg9PIHlM+flpRvJNPz/ZDBdj4raN1xo4q0ET0KRLni6oEOVs5GpTY1R # t4O8a/IYkxeI15K9U7i0HwYI2wVwKZbHgp9XPMYVZFJdKBGT8bnF56pV9A== # =lp7q # -----END PGP SIGNATURE----- # gpg: Signature made Wed 22 May 2024 10:58:40 AM PDT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] * tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (23 commits) target-i386: hyper-v: Correct kvm_hv_handle_exit return value i386/cpu: Use CPUCacheInfo.share_level to encode CPUID[0x8000001D].EAX[bits 25:14] i386/cpu: Use CPUCacheInfo.share_level to encode CPUID[4] i386: Add cache topology info in CPUCacheInfo hw/i386/pc: Support smp.modules for x86 PC machine tests: Add test case of APIC ID for module level parsing i386/cpu: Introduce module-id to X86CPU i386: Support module_id in X86CPUTopoIDs i386: Expose module level in CPUID[0x1F] i386: Support modules_per_die in X86CPUTopoInfo i386: Introduce module level cpu topology to CPUX86State i386/cpu: Decouple CPUID[0x1F] subleaf with specific topology level i386: Split topology types of CPUID[0x1F] from the definitions of CPUID[0xB] i386/cpu: Introduce bitmap to cache available CPU topology levels i386/cpu: Consolidate the use of topo_info in cpu_x86_cpuid() i386/cpu: Use APIC ID info get NumSharingCache for CPUID[0x8000001D].EAX[bits 25:14] i386/cpu: Use APIC ID info to encode cache topo in CPUID[4] i386/cpu: Fix i/d-cache topology to core level for Intel CPU target/i386: add control bits support for LAM target/i386: add support for LAM in CPUID enumeration ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
commit
7b68a5fe2f
19 changed files with 491 additions and 150 deletions
|
|
@ -119,6 +119,7 @@ struct PCMachineClass {
|
|||
bool enforce_aligned_dimm;
|
||||
bool broken_reserved_end;
|
||||
bool enforce_amd_1tb_hole;
|
||||
bool isa_bios_alias;
|
||||
|
||||
/* generate legacy CPU hotplug AML */
|
||||
bool legacy_cpu_hotplug;
|
||||
|
|
|
|||
|
|
@ -50,16 +50,34 @@ typedef uint32_t apic_id_t;
|
|||
typedef struct X86CPUTopoIDs {
|
||||
unsigned pkg_id;
|
||||
unsigned die_id;
|
||||
unsigned module_id;
|
||||
unsigned core_id;
|
||||
unsigned smt_id;
|
||||
} X86CPUTopoIDs;
|
||||
|
||||
typedef struct X86CPUTopoInfo {
|
||||
unsigned dies_per_pkg;
|
||||
unsigned cores_per_die;
|
||||
unsigned modules_per_die;
|
||||
unsigned cores_per_module;
|
||||
unsigned threads_per_core;
|
||||
} X86CPUTopoInfo;
|
||||
|
||||
/*
|
||||
* CPUTopoLevel is the general i386 topology hierarchical representation,
|
||||
* ordered by increasing hierarchical relationship.
|
||||
* Its enumeration value is not bound to the type value of Intel (CPUID[0x1F])
|
||||
* or AMD (CPUID[0x80000026]).
|
||||
*/
|
||||
enum CPUTopoLevel {
|
||||
CPU_TOPO_LEVEL_INVALID,
|
||||
CPU_TOPO_LEVEL_SMT,
|
||||
CPU_TOPO_LEVEL_CORE,
|
||||
CPU_TOPO_LEVEL_MODULE,
|
||||
CPU_TOPO_LEVEL_DIE,
|
||||
CPU_TOPO_LEVEL_PACKAGE,
|
||||
CPU_TOPO_LEVEL_MAX,
|
||||
};
|
||||
|
||||
/* Return the bit width needed for 'count' IDs */
|
||||
static unsigned apicid_bitwidth_for_count(unsigned count)
|
||||
{
|
||||
|
|
@ -77,7 +95,13 @@ static inline unsigned apicid_smt_width(X86CPUTopoInfo *topo_info)
|
|||
/* Bit width of the Core_ID field */
|
||||
static inline unsigned apicid_core_width(X86CPUTopoInfo *topo_info)
|
||||
{
|
||||
return apicid_bitwidth_for_count(topo_info->cores_per_die);
|
||||
return apicid_bitwidth_for_count(topo_info->cores_per_module);
|
||||
}
|
||||
|
||||
/* Bit width of the Module_ID field */
|
||||
static inline unsigned apicid_module_width(X86CPUTopoInfo *topo_info)
|
||||
{
|
||||
return apicid_bitwidth_for_count(topo_info->modules_per_die);
|
||||
}
|
||||
|
||||
/* Bit width of the Die_ID field */
|
||||
|
|
@ -92,10 +116,16 @@ static inline unsigned apicid_core_offset(X86CPUTopoInfo *topo_info)
|
|||
return apicid_smt_width(topo_info);
|
||||
}
|
||||
|
||||
/* Bit offset of the Module_ID field */
|
||||
static inline unsigned apicid_module_offset(X86CPUTopoInfo *topo_info)
|
||||
{
|
||||
return apicid_core_offset(topo_info) + apicid_core_width(topo_info);
|
||||
}
|
||||
|
||||
/* Bit offset of the Die_ID field */
|
||||
static inline unsigned apicid_die_offset(X86CPUTopoInfo *topo_info)
|
||||
{
|
||||
return apicid_core_offset(topo_info) + apicid_core_width(topo_info);
|
||||
return apicid_module_offset(topo_info) + apicid_module_width(topo_info);
|
||||
}
|
||||
|
||||
/* Bit offset of the Pkg_ID (socket ID) field */
|
||||
|
|
@ -114,6 +144,7 @@ static inline apic_id_t x86_apicid_from_topo_ids(X86CPUTopoInfo *topo_info,
|
|||
{
|
||||
return (topo_ids->pkg_id << apicid_pkg_offset(topo_info)) |
|
||||
(topo_ids->die_id << apicid_die_offset(topo_info)) |
|
||||
(topo_ids->module_id << apicid_module_offset(topo_info)) |
|
||||
(topo_ids->core_id << apicid_core_offset(topo_info)) |
|
||||
topo_ids->smt_id;
|
||||
}
|
||||
|
|
@ -127,11 +158,16 @@ static inline void x86_topo_ids_from_idx(X86CPUTopoInfo *topo_info,
|
|||
X86CPUTopoIDs *topo_ids)
|
||||
{
|
||||
unsigned nr_dies = topo_info->dies_per_pkg;
|
||||
unsigned nr_cores = topo_info->cores_per_die;
|
||||
unsigned nr_modules = topo_info->modules_per_die;
|
||||
unsigned nr_cores = topo_info->cores_per_module;
|
||||
unsigned nr_threads = topo_info->threads_per_core;
|
||||
|
||||
topo_ids->pkg_id = cpu_index / (nr_dies * nr_cores * nr_threads);
|
||||
topo_ids->die_id = cpu_index / (nr_cores * nr_threads) % nr_dies;
|
||||
topo_ids->pkg_id = cpu_index / (nr_dies * nr_modules *
|
||||
nr_cores * nr_threads);
|
||||
topo_ids->die_id = cpu_index / (nr_modules * nr_cores *
|
||||
nr_threads) % nr_dies;
|
||||
topo_ids->module_id = cpu_index / (nr_cores * nr_threads) %
|
||||
nr_modules;
|
||||
topo_ids->core_id = cpu_index / nr_threads % nr_cores;
|
||||
topo_ids->smt_id = cpu_index % nr_threads;
|
||||
}
|
||||
|
|
@ -149,6 +185,9 @@ static inline void x86_topo_ids_from_apicid(apic_id_t apicid,
|
|||
topo_ids->core_id =
|
||||
(apicid >> apicid_core_offset(topo_info)) &
|
||||
~(0xFFFFFFFFUL << apicid_core_width(topo_info));
|
||||
topo_ids->module_id =
|
||||
(apicid >> apicid_module_offset(topo_info)) &
|
||||
~(0xFFFFFFFFUL << apicid_module_width(topo_info));
|
||||
topo_ids->die_id =
|
||||
(apicid >> apicid_die_offset(topo_info)) &
|
||||
~(0xFFFFFFFFUL << apicid_die_width(topo_info));
|
||||
|
|
@ -168,4 +207,13 @@ static inline apic_id_t x86_apicid_from_cpu_idx(X86CPUTopoInfo *topo_info,
|
|||
return x86_apicid_from_topo_ids(topo_info, &topo_ids);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check whether there's extended topology level (module or die)?
|
||||
*/
|
||||
static inline bool x86_has_extended_topo(unsigned long *topo_bitmap)
|
||||
{
|
||||
return test_bit(CPU_TOPO_LEVEL_MODULE, topo_bitmap) ||
|
||||
test_bit(CPU_TOPO_LEVEL_DIE, topo_bitmap);
|
||||
}
|
||||
|
||||
#endif /* HW_I386_TOPOLOGY_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue