Re: [Xen-devel] [PATCH v19 01/14] x86/VPMU: VPMU should not exist when vpmu_initialise() is called

2015-03-19 Thread Dietmar Hahn
Am Dienstag 17 März 2015, 10:53:58 schrieb Boris Ostrovsky:
> We don't need to try to destroy it since it can't be already allocated at the
> time we try to initialize it.
> 
> Signed-off-by: Boris Ostrovsky 
> Suggested-by: Andrew Cooper 

Seems to be already commited.

Dietmar.


> ---
> 
> Changes in v19:
> * Removed unnecesary test for VPMU_CONTEXT_ALLOCATED in svm/vpmu.c
> 
>  xen/arch/x86/hvm/svm/vpmu.c | 3 ---
>  xen/arch/x86/hvm/vpmu.c | 5 +
>  2 files changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
> index 64dc167..6764070 100644
> --- a/xen/arch/x86/hvm/svm/vpmu.c
> +++ b/xen/arch/x86/hvm/svm/vpmu.c
> @@ -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 )
> diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
> index 0e6b6c0..c3273ee 100644
> --- a/xen/arch/x86/hvm/vpmu.c
> +++ b/xen/arch/x86/hvm/vpmu.c
> @@ -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 )
>  {
> 

-- 
Company details: http://ts.fujitsu.com/imprint.html

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


[Xen-devel] [PATCH v19 01/14] x86/VPMU: VPMU should not exist when vpmu_initialise() is called

2015-03-17 Thread Boris Ostrovsky
We don't need to try to destroy it since it can't be already allocated at the
time we try to initialize it.

Signed-off-by: Boris Ostrovsky 
Suggested-by: Andrew Cooper 
---

Changes in v19:
* Removed unnecesary test for VPMU_CONTEXT_ALLOCATED in svm/vpmu.c

 xen/arch/x86/hvm/svm/vpmu.c | 3 ---
 xen/arch/x86/hvm/vpmu.c | 5 +
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 64dc167..6764070 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -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 )
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 0e6b6c0..c3273ee 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -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 )
 {
-- 
1.8.1.4


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