Skip to contentSkip to conversation

X86/VPMU:clear the overflow status of which counter happened overflow

PATCH Superseded Luwei Kang 2 participants 4 messages Dec 12, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Luwei Kang

author
#0 lore raw

PATCH 1/1 X86/VPMU:clear the overflow status of which counter happened overflow

If a counter happend overflow just clear corresponding bit of IA32_PERF_GLOBAL_OVF_CTRL, rather than clear all the bit of this msr.

---
 xen/arch/x86/cpu/vpmu_intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/cpu/vpmu_intel.c +1 -1
index e8049ed..613aafe 100644
@@ -868,7 +868,7 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
         if ( is_pmc_quirk )
             handle_pmc_quirk(msr_content);
         core2_vpmu_cxt->global_status |= msr_content;
-        msr_content = ~global_ovf_ctrl_mask;
+        msr_content &= ~global_ovf_ctrl_mask;
         wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, msr_content);
     }
     else
Signature · 7 lines
1.8.3.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 12.12.16 at 11:35, <[email protected]> wrote:

If a counter happend overflow just clear corresponding bit of IA32_PERF_GLOBAL_OVF_CTRL, rather than clear all the bit of this msr.

The code change is fine, but the description appears to be wrong:
Isn't the change to avoid bits getting wrongly set, rather than any getting wrongly cleared?

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 12.12.16 at 11:35, <[email protected]> wrote:

If a counter happend overflow just clear corresponding bit of IA32_PERF_GLOBAL_OVF_CTRL, rather than clear all the bit of this msr.

The code change is fine, but the description appears to be wrong:
Isn't the change to avoid bits getting wrongly set, rather than any getting wrongly cleared?

just set the corresponding bits of which counter happened overflow, rather than set all the available bits of IA32_PERF_GLOBAL_OVF_CTRL when happened pmu interrupt. Or
Remove the redundant bits set of IA32_PERF_GLOBAL_OVF_CTRL.

Is that OK?

Thank,
Luwei Kang

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines · On 12.12.16 at 12:40, <[email protected]> wrote:
Quoted 1 line
Quoted 1 line · On 12.12.16 at 11:35, <[email protected]> wrote:

If a counter happend overflow just clear corresponding bit of IA32_PERF_GLOBAL_OVF_CTRL, rather than clear all the bit of this msr.

Quoted 8 lines
Quoted 3 lines

The code change is fine, but the description appears to be wrong:
Isn't the change to avoid bits getting wrongly set, rather than any getting wrongly cleared?

just set the corresponding bits of which counter happened overflow, rather than set all the available bits of IA32_PERF_GLOBAL_OVF_CTRL when happened pmu interrupt.
Or
Remove the redundant bits set of IA32_PERF_GLOBAL_OVF_CTRL.

The former seems better to me.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel