+ if (tscan->c->x86_vendor == X86_VENDOR_AMD) {
+ if (tscan->c->x86 == 0x15)
+ tscan->c->topo.cu_id = leaf.cuid;
+
+ cacheinfo_amd_init_llc_id(tscan->c, leaf.nodeid);
+ } else {
+ /*
+ * Package ID is ApicId[6..] on Hygon CPUs. See commit
+ * e0ceeae708ce for explanation. The topology info is
+ * screwed up: The package shift is always 6 and the node
+ * ID is bit [4:5]. Don't touch the latter without
+ * confirmation from the Hygon developers.
+ */
+ topology_set_dom(tscan, TOPO_CORE_DOMAIN, 6, tscan->dom_ncpus[TOPO_CORE_DOMAIN]);
+ cacheinfo_hygon_init_llc_id(tscan->c);
+ }
+ return true;
+}
+