]> xenbits.xensource.com Git - xen.git/commitdiff
x86/VPMU: VPMU should not exist when vpmu_initialise() is called
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Wed, 18 Mar 2015 13:19:01 +0000 (14:19 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 18 Mar 2015 13:19:01 +0000 (14:19 +0100)
We don't need to try to destroy it since it can't be already allocated at the
time we try to initialize it.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
xen/arch/x86/hvm/svm/vpmu.c
xen/arch/x86/hvm/vpmu.c

index 64dc1678f108fb0eaa71bbf574b9459babbe12a4..6764070ddb8e152b4c35565a35572bdfaee46c1d 100644 (file)
@@ -359,9 +359,6 @@ static int amd_vpmu_initialise(struct vcpu *v)
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     uint8_t family = current_cpu_data.x86;
 
-    if ( vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        return 0;
-
     if ( counters == NULL )
     {
          switch ( family )
index 0e6b6c022bd353ce42fcb6db67b762653179ec6c..c3273ee64ba64c9a8724b57af4e75a3213c6889b 100644 (file)
@@ -236,10 +236,7 @@ void vpmu_initialise(struct vcpu *v)
     if ( is_pvh_vcpu(v) )
         return;
 
-    if ( vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        vpmu_destroy(v);
-    vpmu_clear(vpmu);
-    vpmu->context = NULL;
+    ASSERT(!vpmu->flags && !vpmu->context);
 
     switch ( vendor )
     {