WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xenoprof: The checks in the function pass

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenoprof: The checks in the function passive_domain_do_rdmsr() were
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Jan 2009 08:35:10 -0800
Delivery-date: Fri, 16 Jan 2009 08:34:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1232022989 0
# Node ID f6a455c9f01db586832c0eb98c14965c045e07ac
# Parent  5b75d99acf9c970dac9775d0d988554bd678bda3
xenoprof: The checks in the function passive_domain_do_rdmsr() were
not sufficient.
Also the same checks were done in the function
passive_domain_do_wrmsr().
So these common checks are moved in a new single function
passive_domain_msr_op_checks().

Signed-off-by: Nitin A Kamble <nitin.a.kamble@xxxxxxxxx>
Signed-off-by: Jun Nakajima <jun.nakajima@xxxxxxxxx>
---
 xen/arch/x86/oprofile/nmi_int.c |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff -r 5b75d99acf9c -r f6a455c9f01d xen/arch/x86/oprofile/nmi_int.c
--- a/xen/arch/x86/oprofile/nmi_int.c   Thu Jan 15 12:35:09 2009 +0000
+++ b/xen/arch/x86/oprofile/nmi_int.c   Thu Jan 15 12:36:29 2009 +0000
@@ -38,19 +38,29 @@ extern int is_active(struct domain *d);
 extern int is_active(struct domain *d);
 extern int is_passive(struct domain *d);
 
-int passive_domain_do_rdmsr(struct cpu_user_regs *regs)
-{
-       u64 msr_content;
-       int type, index;
+static int passive_domain_msr_op_checks(struct cpu_user_regs *regs ,int 
*typep, int *indexp)
+{
        struct vpmu_struct *vpmu = vcpu_vpmu(current);
-
+       if ( model == NULL )
+               return 0;
        if ( model->is_arch_pmu_msr == NULL )
                return 0;
-       if ( !model->is_arch_pmu_msr((u64)regs->ecx, &type, &index) )
-               return 0;
+       if ( !model->is_arch_pmu_msr((u64)regs->ecx, typep, indexp) )
+               return 0;
+
        if ( !(vpmu->flags & PASSIVE_DOMAIN_ALLOCATED) )
                if ( ! model->allocated_msr(current) )
                        return 0;
+       return 1;
+}
+
+int passive_domain_do_rdmsr(struct cpu_user_regs *regs)
+{
+       u64 msr_content;
+       int type, index;
+
+       if ( !passive_domain_msr_op_checks(regs, &type, &index))
+               return 0;
 
        model->load_msr(current, type, index, &msr_content);
        regs->eax = msr_content & 0xFFFFFFFF;
@@ -58,23 +68,13 @@ int passive_domain_do_rdmsr(struct cpu_u
        return 1;
 }
 
-
 int passive_domain_do_wrmsr(struct cpu_user_regs *regs)
 {
        u64 msr_content;
        int type, index;
-       struct vpmu_struct *vpmu = vcpu_vpmu(current);
-
-       if ( model == NULL )
-               return 0;
-       if ( model->is_arch_pmu_msr == NULL )
-               return 0;
-       if ( !model->is_arch_pmu_msr((u64)regs->ecx, &type, &index) )
-               return 0;
-
-       if ( !(vpmu->flags & PASSIVE_DOMAIN_ALLOCATED) )
-               if ( ! model->allocated_msr(current) )
-                       return 0;
+
+       if ( !passive_domain_msr_op_checks(regs, &type, &index))
+               return 0;
 
        msr_content = (u32)regs->eax | ((u64)regs->edx << 32);
        model->save_msr(current, type, index, msr_content);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xenoprof: The checks in the function passive_domain_do_rdmsr() were, Xen patchbot-unstable <=