Skip to content

Commit e56d672

Browse files
committed
add IDX membar check quirk for Windows
Change-Id: I5e75ead0efe39d0c5277590598dba2bda500bf3e
1 parent ab69d39 commit e56d672

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/cpucounters.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,8 +1858,15 @@ bool getIDXDevBAR(std::vector<std::pair<uint32, uint32> > & socket2bus, uint32 d
18581858
PciHandleType IDXHandle(s2bus.first, s2bus.second, dev, func);
18591859
IDXHandle.read64(SPR_IDX_ACCEL_BAR0_OFFSET, &memBar);
18601860
IDXHandle.read32(SPR_IDX_ACCEL_PCICMD_OFFSET, &pciCmd);
1861-
IDXHandle.read32(SPR_IDX_ACCEL_PMCSR_OFFSET, &pmCsr);
1862-
if (memBar == 0x0 || (pciCmd & 0x02) == 0x0) //Check BAR0 is valid or NOT.
1861+
IDXHandle.read32(SPR_IDX_ACCEL_PMCSR_OFFSET, &pmCsr);
1862+
DBG(1, "IDX - BAR0 of B:0x", std::hex, s2bus.second, ",D:0x", std::hex, dev, ",F:0x", std::hex, func, " is (memBar=0x",
1863+
std::hex, memBar, ", pciCmd=0x", std::hex, pciCmd, ")", std::dec);
1864+
if (memBar == 0x0
1865+
#ifndef _MSC_VER
1866+
// on Windows the driver does not set the bit: do not check
1867+
|| (pciCmd & 0x02) == 0x0
1868+
#endif
1869+
) //Check BAR0 is valid or NOT.
18631870
{
18641871
std::cerr << "Warning: IDX - BAR0 of B:0x" << std::hex << s2bus.second << ",D:0x" << std::hex << dev << ",F:0x" << std::hex << func
18651872
<< " is invalid(memBar=0x" << std::hex << memBar << ", pciCmd=0x" << std::hex << pciCmd <<"), skipped." << std::dec << std::endl;

0 commit comments

Comments
 (0)