[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen: Filter out MSR write events



This patch only allows introspection-related MSR write events to
be sent out, improving performance. Should additional events be
required, they can then simply be added to the list of
vmx_introspection_force_enabled_msrs[].

Signed-off-by: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index f24126d..21ba611 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3688,6 +3688,17 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t 
*msr_content)
     goto out;
 }
 
+static bool_t is_introspection_msr(unsigned int msr)
+{
+    unsigned int i;
+
+    for ( i = 0; i < vmx_introspection_force_enabled_msrs_size; i++ )
+        if ( msr == vmx_introspection_force_enabled_msrs[i] )
+            return 1;
+
+    return 0;
+}
+
 int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content,
                             bool_t may_defer)
 {
@@ -3703,7 +3714,8 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t 
msr_content,
     hvm_cpuid(1, NULL, NULL, NULL, &edx);
     mtrr = !!(edx & cpufeat_mask(X86_FEATURE_MTRR));
 
-    if ( may_defer && unlikely(currad->monitor.mov_to_msr_enabled) )
+    if ( may_defer && unlikely(currad->monitor.mov_to_msr_enabled) &&
+         is_introspection_msr(msr) )
     {
         ASSERT(v->arch.vm_event);
 
-- 
2.8.0


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.