In order to reliably clear the PCRx.ov bit when updating a
performance counter value, we need to stop it counting first.
If we do not do this, then we can miss performance counter
overflow events.
Orabug:
22876587
Signed-off-by: Dave Aldridge <david.j.aldridge@oracle.com>
(cherry picked from commit
6de93dc001ed2f440ed3881722934fbda2de0d4f)
(cherry picked from commit
b36dd4d8040cd53f7e8de5a1d145be483d185105)
Signed-off-by: Allen Pais <allen.pais@oracle.com>
u64 pcr;
pcr = pcr_ops->read_pcr(idx);
+
+ /* stop the counter */
+ pcr_ops->write_pcr(idx, PCR_N4_PICNPT);
+
/* ensure ov and ntc are reset */
pcr &= ~(PCR_N4_OV | PCR_N4_NTC);