fix(ps5): use scheduler SMT evidence even without readable CPU topology CPUID [core-ready] [full-build] [test-all-on]

This commit is contained in:
Niak committed 2026-10-12 05:52:15 +02:00
1 parent 7ddf7bef32
commit 52a782f1de
2 files changed
+17 -2

No files matched your search

+3 -2
View File
@@ -245,8 +245,9 @@ void CheckWorkerTopology() {
topology_allowed = original;
topology_allowed_valid = true;
if (!has_x2apic && !has_amd_topology) {
std::printf("EDEN_WORKER_TOPOLOGY ready=0 reason=no_supported_physical_cpuid\n");
return;
// This is not yet a failure: the kernel may still expose authoritative
// SMT groups even when neither architectural CPUID leaf is usable.
std::printf("EDEN_PS5_CPU_CPUID unavailable=1 trying_kernel_topology=1\n");
}
// The PS5's FreeBSD scheduler may expose genuine SMT sibling groups
// even when CPUID per-affinity yields bogus 13-core/one-core readings.
+14
View File
@@ -151,6 +151,20 @@ int main(){
"<flags><flag name=\"SMT\"></flag></flags></group></groups>";
CheckWorkerTopology();
assert(!worker_topology_ready && current==0x1fff);
// Kernel topology must also work when no CPUID topology exists.
max_leaf=0xa;amd_vendor=false;amd_ext_feature=false;
os_xml="<groups>";
for(unsigned i=0;i<14;i+=2) {
char pair[160];
std::snprintf(pair,sizeof(pair),
"<group><cpu count=\"2\" mask=\"%llx,0,0\">pair</cpu>"
"<flags><flag name=\"SMT\">SMT group</flag></flags></group>",
(unsigned long long)(3ULL<<i));
os_xml+=pair;
}
os_xml+="</groups>";
CheckWorkerTopology();
assert(worker_topology_ready && current==0x1fff);
os_xml.clear();
max_leaf=0xa;
// TopologyExtensions absent: do not claim proof from logical IDs alone.