Skip to content

Commit

Permalink
[v0.96] Remove cache sizes check
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Noob committed Apr 8, 2021
1 parent 044608f commit e8d2898
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/x86/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,35 +633,6 @@ struct cache* get_cache_info(struct cpuInfo* cpu) {
}
}

// Sanity checks. If we read values greater than this, they can't be valid ones
// The values were chosen by me
if(cach->L1i->size > 64 * 1024) {
printBug("Invalid L1i size: %dKB", cach->L1i->size/1024);
//return NULL;
}
if(cach->L1d->size > 64 * 1024) {
printBug("Invalid L1d size: %dKB", cach->L1d->size/1024);
//return NULL;
}
if(cach->L2->exists) {
if(cach->L3->exists && cach->L2->size > 2 * 1048576) {
printBug("Invalid L2 size: %dMB", cach->L2->size/(1048576));
//return NULL;
}
else if(cach->L2->size > 100 * 1048576) {
printBug("Invalid L2 size: %dMB", cach->L2->size/(1048576));
//return NULL;
}
}
if(cach->L3->exists && cach->L3->size > 100 * 1048576) {
printBug("Invalid L3 size: %dMB", cach->L3->size/(1048576));
//return NULL;
}
if(!cach->L2->exists) {
printBug("Could not find L2 cache");
//return NULL;
}

return cach;
}

Expand Down

0 comments on commit e8d2898

Please sign in to comment.