/* * Use a lookup table for the case that there are future types > 6 which * describe an intermediate domain level which does not exist today.
*/ staticconstunsignedint topo_domain_map_0b_1f[MAX_TYPE_1F] = {
[SMT_TYPE] = TOPO_SMT_DOMAIN,
[CORE_TYPE] = TOPO_CORE_DOMAIN,
[MODULE_TYPE] = TOPO_MODULE_DOMAIN,
[TILE_TYPE] = TOPO_TILE_DOMAIN,
[DIE_TYPE] = TOPO_DIE_DOMAIN,
[DIEGRP_TYPE] = TOPO_DIEGRP_DOMAIN,
};
staticinlinebool topo_subleaf(struct topo_scan *tscan, u32 leaf, u32 subleaf, unsignedint *last_dom)
{ unsignedint dom, maxtype; constunsignedint *map; struct { // eax
u32 x2apic_shift : 5, // Number of bits to shift APIC ID right // for the topology ID at the next level
: 27; // Reserved // ebx
u32 num_processors : 16, // Number of processors at current level
: 16; // Reserved // ecx
u32 level : 8, // Current topology level. Same as sub leaf number
type : 8, // Level type. If 0, invalid
: 16; // Reserved // edx
u32 x2apic_id : 32; // X2APIC ID of the current logical processor
} sl;
if (!sl.num_processors || sl.type == INVALID_TYPE) returnfalse;
if (sl.type >= maxtype) {
pr_err_once("Topology: leaf 0x%x:%d Unknown domain type %u\n",
leaf, subleaf, sl.type); /* * It really would have been too obvious to make the domain * type space sparse and leave a few reserved types between * the points which might change instead of following the * usual "this can be fixed in software" principle.
*/
dom = *last_dom + 1;
} else {
dom = map[sl.type];
*last_dom = dom;
}
/* Read all available subleafs and populate the levels */ for (subleaf = 0, last_dom = 0; topo_subleaf(tscan, leaf, subleaf, &last_dom); subleaf++);
/* If subleaf 0 failed to parse, give up */ if (!subleaf) returnfalse;
/* * There are machines in the wild which have shift 0 in the subleaf * 0, but advertise 2 logical processors at that level. They are * truly SMT.
*/ if (!tscan->dom_shifts[TOPO_SMT_DOMAIN] && tscan->dom_ncpus[TOPO_SMT_DOMAIN] > 1) { unsignedint sft = get_count_order(tscan->dom_ncpus[TOPO_SMT_DOMAIN]);
pr_warn_once(FW_BUG "CPUID leaf 0x%x subleaf 0 has shift level 0 but %u CPUs. Fixing it up.\n",
leaf, tscan->dom_ncpus[TOPO_SMT_DOMAIN]);
topology_update_dom(tscan, TOPO_SMT_DOMAIN, sft, tscan->dom_ncpus[TOPO_SMT_DOMAIN]);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.