Hi , all:
Recently I was reading the PCM source code and the document "Intel Xeon Processor E5-2600 Product Family Uncore Performance Monitoring Guide"(Reference Number:327043-001). There are some questions confused me.
In the guide 18.104.22.168, Page 89, I can get the "Q_Py_PCI_PMON_BOX_CTL Register – Field Definitions",and the attr of bit is WO.
And I find the definition of "WO" in the EDS of E5-2600 family:
Write Only: These bits can only be written by microcode, reads return indeterminate values. Microcode that wants to ensure this bit was written must read wherever the side-effect takes place.
Then I read the source of PCM v2.5, from Line 2849 to Line 2860 in cpucounter.cpp, I can get the code to write & read the registry:
// freeze enable
qpiLLHandles->write32(Q_P_PCI_PMON_BOX_CTL, Q_P_PCI_PMON_BOX_CTL_RST_FRZ_EN + Q_P_PCI_PMON_BOX_CTL_RST_FRZ);
val = 0;
if (val != (Q_P_PCI_PMON_BOX_CTL_RST_FRZ_EN + Q_P_PCI_PMON_BOX_CTL_RST_FRZ))
std::cout << "ERROR: QPI LL counter programming seems not to work. Q_P" << i << "_PCI_PMON_BOX_CTL=0x" << std::hex << val << std::endl;
std::cout << " Please see BIOS options to enable the export of performance monitoring devices (devices 8 and 9: function 2)." << std::endl;
So comes the questions.
1.As the bit is WO and can only be written by microcode, can a linux process write this bit?
2.As the bit is WO and read return indeterminate values, is the if statement resonable?