Commit 5f87dfb79f829339508a5d989b8252eb30842587

Authored by Suravee Suthikulpanit
Committed by Robert Richter
1 parent 69046d4304

x86/oprofile: add the logic for enabling additional IBS bits

This patch adds the logic for enabling additional IBS control bits :
* IBS-Fetch IbsRandEn bit (bit 57)
* IBS-Op IbsOpCntCtl bit (bit 19)

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>

Showing 1 changed file with 5 additions and 2 deletions Side-by-side Diff

arch/x86/oprofile/op_model_amd.c
... ... @@ -310,12 +310,15 @@
310 310 #ifdef CONFIG_OPROFILE_IBS
311 311 if (ibs_allowed && ibs_config.fetch_enabled) {
312 312 low = (ibs_config.max_cnt_fetch >> 4) & 0xFFFF;
313   - high = IBS_FETCH_HIGH_ENABLE;
  313 + high = ((ibs_config.rand_en & 0x1) << 25) /* bit 57 */
  314 + + IBS_FETCH_HIGH_ENABLE;
314 315 wrmsr(MSR_AMD64_IBSFETCHCTL, low, high);
315 316 }
316 317  
317 318 if (ibs_allowed && ibs_config.op_enabled) {
318   - low = ((ibs_config.max_cnt_op >> 4) & 0xFFFF) + IBS_OP_LOW_ENABLE;
  319 + low = ((ibs_config.max_cnt_op >> 4) & 0xFFFF)
  320 + + ((ibs_config.dispatched_ops & 0x1) << 19) /* bit 19 */
  321 + + IBS_OP_LOW_ENABLE;
319 322 high = 0;
320 323 wrmsr(MSR_AMD64_IBSOPCTL, low, high);
321 324 }