All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/vpmu_intel: Handle SMT consistently for programmable and fixed counters
@ 2017-03-31 14:46 Mohit Gambhir
  2017-03-31 15:17 ` Boris Ostrovsky
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mohit Gambhir @ 2017-03-31 14:46 UTC (permalink / raw)
  To: jun.nakajima, kevin.tian, boris.ostrovsky, xen-devel; +Cc: mohit.gambhir

This patch masks .AnyThread bits in IA32_FIXED_CTR_CTRL MSR for all
versions of Intel Arhcitectural Performance Monitoring. Note that
.AnyThread bit (21) is already masked in IA32_PERFEVTSELx MSRs since
hyperthreading is not exposed to guests and Intel SDM discourages the use of
.AnyThread bit in virtualized environments (per section 18.2.3.1
AnyThread Counting and Software Evolution)

Signed-off-by: Mohit Gambhir <mohit.gambhir@oracle.com>
---
 xen/arch/x86/cpu/vpmu_intel.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 0d66ecb..7944e22 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -979,8 +979,7 @@ int __init core2_vpmu_init(void)
     full_width_write = (caps >> 13) & 1;
 
     fixed_ctrl_mask = ~((1ull << (fixed_pmc_cnt * FIXED_CTR_CTRL_BITS)) - 1);
-    if ( version == 2 )
-        fixed_ctrl_mask |= 0x444;
+    fixed_ctrl_mask |= 0x444;
     fixed_counters_mask = ~((1ull << core2_get_bitwidth_fix_count()) - 1);
     global_ctrl_mask = ~((((1ULL << fixed_pmc_cnt) - 1) << 32) |
                          ((1ULL << arch_pmc_cnt) - 1));
-- 
2.9.3


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-05  7:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 14:46 [PATCH] x86/vpmu_intel: Handle SMT consistently for programmable and fixed counters Mohit Gambhir
2017-03-31 15:17 ` Boris Ostrovsky
2017-04-03 10:36 ` Jan Beulich
2017-04-03 19:23   ` Mohit Gambhir
2017-04-04  7:56     ` Jan Beulich
2017-04-05  7:10 ` Tian, Kevin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.