Skip to content

Commit c8d6cd5

Browse files
committed
replace assert with a PMU discovery BIOS table bug report
Change-Id: I726d4c22c6cab5e3325f0c3a3f92ff45b9f1d258
1 parent 4bed9d2 commit c8d6cd5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/cpucounters.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7571,14 +7571,23 @@ void PCM::getPCICFGPMUsFromDiscovery(const unsigned int BoxType, const size_t s,
75717571
{
75727572
std::vector<std::shared_ptr<HWRegister> > CounterControlRegs, CounterValueRegs;
75737573
const auto n_regs = uncorePMUDiscovery->getBoxNumRegs(BoxType, s, pos);
7574-
auto makeRegister = [](const uint64 rawAddr)
7574+
auto makeRegister = [&pos, &numBoxes, &BoxType, &s](const uint64 rawAddr)
75757575
{
75767576
#ifndef PCI_ENABLE
75777577
constexpr auto PCI_ENABLE = 0x80000000ULL;
75787578
#endif
75797579
UncorePMUDiscovery::PCICFGAddress Addr;
75807580
Addr.raw = rawAddr;
7581-
assert(Addr.raw & PCI_ENABLE);
7581+
if ((Addr.raw & PCI_ENABLE) == 0)
7582+
{
7583+
std::cerr << "PCM Error: PCI_ENABLE bit not set in address 0x" << std::hex << Addr.raw << std::dec << "\n";
7584+
std::cerr << "This is likely a bug in the uncore PMU discovery BIOS table. Contact your BIOS vendor.\n";
7585+
std::cerr << "Socket: " << s << "\n";
7586+
std::cerr << "Box type: " << BoxType << "\n";
7587+
std::cerr << "Box position: " << pos << "/" << numBoxes << "\n";
7588+
std::cerr << "Address: " << Addr.getStr() << "\n";
7589+
return std::shared_ptr<PCICFGRegister64>();
7590+
}
75827591
try {
75837592
auto handle = std::make_shared<PciHandleType>(0, (uint32)Addr.fields.bus,
75847593
(uint32)Addr.fields.device,

0 commit comments

Comments
 (0)