All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/HVM: replace open-coded non-local cache flushing
@ 2014-04-25 10:51 Jan Beulich
  2014-04-25 10:55 ` Andrew Cooper
  2014-04-25 14:19 ` Boris Ostrovsky
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Beulich @ 2014-04-25 10:51 UTC (permalink / raw)
  To: xen-devel
  Cc: Kevin Tian, Keir Fraser, suravee.suthikulpanit, Eddie Dong,
	Jun Nakajima, Boris Ostrovsky

[-- Attachment #1: Type: text/plain, Size: 2427 bytes --]

We accumulated quite a number of these, despite having a pre-canned
interface for it.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1823,11 +1823,6 @@ static bool_t domain_exit_uc_mode(struct
     return 1;
 }
 
-static void local_flush_cache(void *info)
-{
-    wbinvd();
-}
-
 static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
 {
     v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
@@ -1927,7 +1922,7 @@ void hvm_shadow_handle_cd(struct vcpu *v
             domain_pause_nosync(v->domain);
 
             /* Flush physical caches. */
-            on_each_cpu(local_flush_cache, NULL, 1);
+            flush_all(FLUSH_CACHE);
             hvm_set_uc_mode(v, 1);
 
             domain_unpause(v->domain);
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2106,15 +2106,10 @@ static void svm_vmexit_mce_intercept(
     }
 }
 
-static void wbinvd_ipi(void *info)
-{
-    wbinvd();
-}
-
 static void svm_wbinvd_intercept(void)
 {
     if ( cache_flush_permitted(current->domain) )
-        on_each_cpu(wbinvd_ipi, NULL, 1);
+        flush_all(FLUSH_CACHE);
 }
 
 static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1301,11 +1301,6 @@ void vm_resume_fail(void)
     domain_crash_synchronous();
 }
 
-static void wbinvd_ipi(void *info)
-{
-    wbinvd();
-}
-
 void vmx_do_resume(struct vcpu *v)
 {
     bool_t debug_state;
@@ -1332,7 +1327,7 @@ void vmx_do_resume(struct vcpu *v)
         {
             int cpu = v->arch.hvm_vmx.active_cpu;
             if ( cpu != -1 )
-                on_selected_cpus(cpumask_of(cpu), wbinvd_ipi, NULL, 1);
+                flush_mask(cpumask_of(cpu), FLUSH_CACHE);
         }
 
         vmx_clear_vmcs(v);
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2307,18 +2307,13 @@ static void vmx_do_extint(struct cpu_use
     do_IRQ(regs);
 }
 
-static void wbinvd_ipi(void *info)
-{
-    wbinvd();
-}
-
 static void vmx_wbinvd_intercept(void)
 {
     if ( !cache_flush_permitted(current->domain) || iommu_snoop )
         return;
 
     if ( cpu_has_wbinvd_exiting )
-        on_each_cpu(wbinvd_ipi, NULL, 1);
+        flush_all(FLUSH_CACHE);
     else
         wbinvd();
 }




[-- Attachment #2: x86-replace-wbinvd-IPI.patch --]
[-- Type: text/plain, Size: 2477 bytes --]

x86/HVM: replace open-coded non-local cache flushing

We accumulated quite a number of these, despite having a pre-canned
interface for it.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1823,11 +1823,6 @@ static bool_t domain_exit_uc_mode(struct
     return 1;
 }
 
-static void local_flush_cache(void *info)
-{
-    wbinvd();
-}
-
 static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
 {
     v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
@@ -1927,7 +1922,7 @@ void hvm_shadow_handle_cd(struct vcpu *v
             domain_pause_nosync(v->domain);
 
             /* Flush physical caches. */
-            on_each_cpu(local_flush_cache, NULL, 1);
+            flush_all(FLUSH_CACHE);
             hvm_set_uc_mode(v, 1);
 
             domain_unpause(v->domain);
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2106,15 +2106,10 @@ static void svm_vmexit_mce_intercept(
     }
 }
 
-static void wbinvd_ipi(void *info)
-{
-    wbinvd();
-}
-
 static void svm_wbinvd_intercept(void)
 {
     if ( cache_flush_permitted(current->domain) )
-        on_each_cpu(wbinvd_ipi, NULL, 1);
+        flush_all(FLUSH_CACHE);
 }
 
 static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1301,11 +1301,6 @@ void vm_resume_fail(void)
     domain_crash_synchronous();
 }
 
-static void wbinvd_ipi(void *info)
-{
-    wbinvd();
-}
-
 void vmx_do_resume(struct vcpu *v)
 {
     bool_t debug_state;
@@ -1332,7 +1327,7 @@ void vmx_do_resume(struct vcpu *v)
         {
             int cpu = v->arch.hvm_vmx.active_cpu;
             if ( cpu != -1 )
-                on_selected_cpus(cpumask_of(cpu), wbinvd_ipi, NULL, 1);
+                flush_mask(cpumask_of(cpu), FLUSH_CACHE);
         }
 
         vmx_clear_vmcs(v);
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2307,18 +2307,13 @@ static void vmx_do_extint(struct cpu_use
     do_IRQ(regs);
 }
 
-static void wbinvd_ipi(void *info)
-{
-    wbinvd();
-}
-
 static void vmx_wbinvd_intercept(void)
 {
     if ( !cache_flush_permitted(current->domain) || iommu_snoop )
         return;
 
     if ( cpu_has_wbinvd_exiting )
-        on_each_cpu(wbinvd_ipi, NULL, 1);
+        flush_all(FLUSH_CACHE);
     else
         wbinvd();
 }

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

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

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

* Re: [PATCH] x86/HVM: replace open-coded non-local cache flushing
  2014-04-25 10:51 [PATCH] x86/HVM: replace open-coded non-local cache flushing Jan Beulich
@ 2014-04-25 10:55 ` Andrew Cooper
  2014-04-28  7:54   ` Tian, Kevin
  2014-04-25 14:19 ` Boris Ostrovsky
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2014-04-25 10:55 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Kevin Tian, Keir Fraser, suravee.suthikulpanit, Eddie Dong,
	Jun Nakajima, xen-devel, Boris Ostrovsky


[-- Attachment #1.1: Type: text/plain, Size: 2751 bytes --]

On 25/04/14 11:51, Jan Beulich wrote:
> We accumulated quite a number of these, despite having a pre-canned
> interface for it.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -1823,11 +1823,6 @@ static bool_t domain_exit_uc_mode(struct
>      return 1;
>  }
>  
> -static void local_flush_cache(void *info)
> -{
> -    wbinvd();
> -}
> -
>  static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
>  {
>      v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
> @@ -1927,7 +1922,7 @@ void hvm_shadow_handle_cd(struct vcpu *v
>              domain_pause_nosync(v->domain);
>  
>              /* Flush physical caches. */
> -            on_each_cpu(local_flush_cache, NULL, 1);
> +            flush_all(FLUSH_CACHE);
>              hvm_set_uc_mode(v, 1);
>  
>              domain_unpause(v->domain);
> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -2106,15 +2106,10 @@ static void svm_vmexit_mce_intercept(
>      }
>  }
>  
> -static void wbinvd_ipi(void *info)
> -{
> -    wbinvd();
> -}
> -
>  static void svm_wbinvd_intercept(void)
>  {
>      if ( cache_flush_permitted(current->domain) )
> -        on_each_cpu(wbinvd_ipi, NULL, 1);
> +        flush_all(FLUSH_CACHE);
>  }
>  
>  static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -1301,11 +1301,6 @@ void vm_resume_fail(void)
>      domain_crash_synchronous();
>  }
>  
> -static void wbinvd_ipi(void *info)
> -{
> -    wbinvd();
> -}
> -
>  void vmx_do_resume(struct vcpu *v)
>  {
>      bool_t debug_state;
> @@ -1332,7 +1327,7 @@ void vmx_do_resume(struct vcpu *v)
>          {
>              int cpu = v->arch.hvm_vmx.active_cpu;
>              if ( cpu != -1 )
> -                on_selected_cpus(cpumask_of(cpu), wbinvd_ipi, NULL, 1);
> +                flush_mask(cpumask_of(cpu), FLUSH_CACHE);
>          }
>  
>          vmx_clear_vmcs(v);
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2307,18 +2307,13 @@ static void vmx_do_extint(struct cpu_use
>      do_IRQ(regs);
>  }
>  
> -static void wbinvd_ipi(void *info)
> -{
> -    wbinvd();
> -}
> -
>  static void vmx_wbinvd_intercept(void)
>  {
>      if ( !cache_flush_permitted(current->domain) || iommu_snoop )
>          return;
>  
>      if ( cpu_has_wbinvd_exiting )
> -        on_each_cpu(wbinvd_ipi, NULL, 1);
> +        flush_all(FLUSH_CACHE);
>      else
>          wbinvd();
>  }
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 3512 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: [PATCH] x86/HVM: replace open-coded non-local cache flushing
  2014-04-25 10:51 [PATCH] x86/HVM: replace open-coded non-local cache flushing Jan Beulich
  2014-04-25 10:55 ` Andrew Cooper
@ 2014-04-25 14:19 ` Boris Ostrovsky
  2014-04-25 15:55   ` Jan Beulich
  1 sibling, 1 reply; 6+ messages in thread
From: Boris Ostrovsky @ 2014-04-25 14:19 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Kevin Tian, Keir Fraser, suravee.suthikulpanit, Eddie Dong,
	Jun Nakajima, xen-devel

On 04/25/2014 06:51 AM, Jan Beulich wrote:
> We accumulated quite a number of these, despite having a pre-canned
> interface for it.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

Somewhat related: I also noticed that in on_selected_cpus() (that this 
patch is replacing for flushing) we take a global lock. I wonder whether 
this may cause scaling issues on big systems. (The same would be true 
for flush_all/mask but to a lesser extent since at least that's a lock 
dedicated to a particular operation)

-boris

>
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -1823,11 +1823,6 @@ static bool_t domain_exit_uc_mode(struct
>       return 1;
>   }
>   
> -static void local_flush_cache(void *info)
> -{
> -    wbinvd();
> -}
> -
>   static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
>   {
>       v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
> @@ -1927,7 +1922,7 @@ void hvm_shadow_handle_cd(struct vcpu *v
>               domain_pause_nosync(v->domain);
>   
>               /* Flush physical caches. */
> -            on_each_cpu(local_flush_cache, NULL, 1);
> +            flush_all(FLUSH_CACHE);
>               hvm_set_uc_mode(v, 1);
>   
>               domain_unpause(v->domain);
> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -2106,15 +2106,10 @@ static void svm_vmexit_mce_intercept(
>       }
>   }
>   
> -static void wbinvd_ipi(void *info)
> -{
> -    wbinvd();
> -}
> -
>   static void svm_wbinvd_intercept(void)
>   {
>       if ( cache_flush_permitted(current->domain) )
> -        on_each_cpu(wbinvd_ipi, NULL, 1);
> +        flush_all(FLUSH_CACHE);
>   }
>   
>   static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -1301,11 +1301,6 @@ void vm_resume_fail(void)
>       domain_crash_synchronous();
>   }
>   
> -static void wbinvd_ipi(void *info)
> -{
> -    wbinvd();
> -}
> -
>   void vmx_do_resume(struct vcpu *v)
>   {
>       bool_t debug_state;
> @@ -1332,7 +1327,7 @@ void vmx_do_resume(struct vcpu *v)
>           {
>               int cpu = v->arch.hvm_vmx.active_cpu;
>               if ( cpu != -1 )
> -                on_selected_cpus(cpumask_of(cpu), wbinvd_ipi, NULL, 1);
> +                flush_mask(cpumask_of(cpu), FLUSH_CACHE);
>           }
>   
>           vmx_clear_vmcs(v);
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2307,18 +2307,13 @@ static void vmx_do_extint(struct cpu_use
>       do_IRQ(regs);
>   }
>   
> -static void wbinvd_ipi(void *info)
> -{
> -    wbinvd();
> -}
> -
>   static void vmx_wbinvd_intercept(void)
>   {
>       if ( !cache_flush_permitted(current->domain) || iommu_snoop )
>           return;
>   
>       if ( cpu_has_wbinvd_exiting )
> -        on_each_cpu(wbinvd_ipi, NULL, 1);
> +        flush_all(FLUSH_CACHE);
>       else
>           wbinvd();
>   }
>
>
>

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

* Re: [PATCH] x86/HVM: replace open-coded non-local cache flushing
  2014-04-25 14:19 ` Boris Ostrovsky
@ 2014-04-25 15:55   ` Jan Beulich
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2014-04-25 15:55 UTC (permalink / raw)
  To: Boris Ostrovsky
  Cc: Kevin Tian, Keir Fraser, suravee.suthikulpanit, Eddie Dong,
	Jun Nakajima, xen-devel

>>> On 25.04.14 at 16:19, <boris.ostrovsky@oracle.com> wrote:
> Somewhat related: I also noticed that in on_selected_cpus() (that this 
> patch is replacing for flushing) we take a global lock. I wonder whether 
> this may cause scaling issues on big systems. (The same would be true 
> for flush_all/mask but to a lesser extent since at least that's a lock 
> dedicated to a particular operation)

Yes, quite possible - I think Linux has seen quite a number of
adjustments in this area over the years; perhaps time for us to re-
sync.

Jan

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

* Re: [PATCH] x86/HVM: replace open-coded non-local cache flushing
  2014-04-25 10:55 ` Andrew Cooper
@ 2014-04-28  7:54   ` Tian, Kevin
  2014-04-30  6:29     ` Suravee Suthikulpanit
  0 siblings, 1 reply; 6+ messages in thread
From: Tian, Kevin @ 2014-04-28  7:54 UTC (permalink / raw)
  To: Andrew Cooper, Jan Beulich
  Cc: Keir Fraser, suravee.suthikulpanit@amd.com, Dong, Eddie,
	Nakajima, Jun, xen-devel, Boris Ostrovsky


[-- Attachment #1.1: Type: text/plain, Size: 3315 bytes --]

Acked-by: Kevin Tian <kevin.tian@intel.com>

From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
Sent: Friday, April 25, 2014 6:56 PM
To: Jan Beulich
Cc: xen-devel; Tian, Kevin; Keir Fraser; suravee.suthikulpanit@amd.com; Dong, Eddie; Nakajima, Jun; Boris Ostrovsky
Subject: Re: [Xen-devel] [PATCH] x86/HVM: replace open-coded non-local cache flushing

On 25/04/14 11:51, Jan Beulich wrote:

We accumulated quite a number of these, despite having a pre-canned

interface for it.



Signed-off-by: Jan Beulich <jbeulich@suse.com><mailto:jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com><mailto:andrew.cooper3@citrix.com>







--- a/xen/arch/x86/hvm/hvm.c

+++ b/xen/arch/x86/hvm/hvm.c

@@ -1823,11 +1823,6 @@ static bool_t domain_exit_uc_mode(struct

     return 1;

 }



-static void local_flush_cache(void *info)

-{

-    wbinvd();

-}

-

 static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)

 {

     v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;

@@ -1927,7 +1922,7 @@ void hvm_shadow_handle_cd(struct vcpu *v

             domain_pause_nosync(v->domain);



             /* Flush physical caches. */

-            on_each_cpu(local_flush_cache, NULL, 1);

+            flush_all(FLUSH_CACHE);

             hvm_set_uc_mode(v, 1);



             domain_unpause(v->domain);

--- a/xen/arch/x86/hvm/svm/svm.c

+++ b/xen/arch/x86/hvm/svm/svm.c

@@ -2106,15 +2106,10 @@ static void svm_vmexit_mce_intercept(

     }

 }



-static void wbinvd_ipi(void *info)

-{

-    wbinvd();

-}

-

 static void svm_wbinvd_intercept(void)

 {

     if ( cache_flush_permitted(current->domain) )

-        on_each_cpu(wbinvd_ipi, NULL, 1);

+        flush_all(FLUSH_CACHE);

 }



 static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)

--- a/xen/arch/x86/hvm/vmx/vmcs.c

+++ b/xen/arch/x86/hvm/vmx/vmcs.c

@@ -1301,11 +1301,6 @@ void vm_resume_fail(void)

     domain_crash_synchronous();

 }



-static void wbinvd_ipi(void *info)

-{

-    wbinvd();

-}

-

 void vmx_do_resume(struct vcpu *v)

 {

     bool_t debug_state;

@@ -1332,7 +1327,7 @@ void vmx_do_resume(struct vcpu *v)

         {

             int cpu = v->arch.hvm_vmx.active_cpu;

             if ( cpu != -1 )

-                on_selected_cpus(cpumask_of(cpu), wbinvd_ipi, NULL, 1);

+                flush_mask(cpumask_of(cpu), FLUSH_CACHE);

         }



         vmx_clear_vmcs(v);

--- a/xen/arch/x86/hvm/vmx/vmx.c

+++ b/xen/arch/x86/hvm/vmx/vmx.c

@@ -2307,18 +2307,13 @@ static void vmx_do_extint(struct cpu_use

     do_IRQ(regs);

 }



-static void wbinvd_ipi(void *info)

-{

-    wbinvd();

-}

-

 static void vmx_wbinvd_intercept(void)

 {

     if ( !cache_flush_permitted(current->domain) || iommu_snoop )

         return;



     if ( cpu_has_wbinvd_exiting )

-        on_each_cpu(wbinvd_ipi, NULL, 1);

+        flush_all(FLUSH_CACHE);

     else

         wbinvd();

 }










_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xen.org<mailto:Xen-devel@lists.xen.org>

http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 12887 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: [PATCH] x86/HVM: replace open-coded non-local cache flushing
  2014-04-28  7:54   ` Tian, Kevin
@ 2014-04-30  6:29     ` Suravee Suthikulpanit
  0 siblings, 0 replies; 6+ messages in thread
From: Suravee Suthikulpanit @ 2014-04-30  6:29 UTC (permalink / raw)
  To: Tian, Kevin, Andrew Cooper, Jan Beulich
  Cc: xen-devel, Boris Ostrovsky, Keir Fraser, Dong, Eddie,
	Nakajima, Jun

Reviewed and Tested

Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>


On 04/28/2014 02:54 AM, Tian, Kevin wrote:
> Acked-by: Kevin Tian <kevin.tian@intel.com>
>
> *From:*Andrew Cooper [mailto:andrew.cooper3@citrix.com]
> *Sent:* Friday, April 25, 2014 6:56 PM
> *To:* Jan Beulich
> *Cc:* xen-devel; Tian, Kevin; Keir Fraser;
> suravee.suthikulpanit@amd.com; Dong, Eddie; Nakajima, Jun; Boris Ostrovsky
> *Subject:* Re: [Xen-devel] [PATCH] x86/HVM: replace open-coded non-local
> cache flushing
>
> On 25/04/14 11:51, Jan Beulich wrote:
>
>     We accumulated quite a number of these, despite having a pre-canned
>
>     interface for it.
>
>
>
>     Signed-off-by: Jan Beulich<jbeulich@suse.com>  <mailto:jbeulich@suse.com>
>
>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> <mailto:andrew.cooper3@citrix.com>
>
>
>
>
>
>
> --- a/xen/arch/x86/hvm/hvm.c
>
> +++ b/xen/arch/x86/hvm/hvm.c
>
> @@ -1823,11 +1823,6 @@ static bool_t domain_exit_uc_mode(struct
>
>       return 1;
>
>   }
>
>
>
> -static void local_flush_cache(void *info)
>
> -{
>
> -    wbinvd();
>
> -}
>
> -
>
>   static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
>
>   {
>
>       v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
>
> @@ -1927,7 +1922,7 @@ void hvm_shadow_handle_cd(struct vcpu *v
>
>               domain_pause_nosync(v->domain);
>
>
>
>               /* Flush physical caches. */
>
> -            on_each_cpu(local_flush_cache, NULL, 1);
>
> +            flush_all(FLUSH_CACHE);
>
>               hvm_set_uc_mode(v, 1);
>
>
>
>               domain_unpause(v->domain);
>
> --- a/xen/arch/x86/hvm/svm/svm.c
>
> +++ b/xen/arch/x86/hvm/svm/svm.c
>
> @@ -2106,15 +2106,10 @@ static void svm_vmexit_mce_intercept(
>
>       }
>
>   }
>
>
>
> -static void wbinvd_ipi(void *info)
>
> -{
>
> -    wbinvd();
>
> -}
>
> -
>
>   static void svm_wbinvd_intercept(void)
>
>   {
>
>       if ( cache_flush_permitted(current->domain) )
>
> -        on_each_cpu(wbinvd_ipi, NULL, 1);
>
> +        flush_all(FLUSH_CACHE);
>
>   }
>
>
>
>   static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)
>
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
>
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
>
> @@ -1301,11 +1301,6 @@ void vm_resume_fail(void)
>
>       domain_crash_synchronous();
>
>   }
>
>
>
> -static void wbinvd_ipi(void *info)
>
> -{
>
> -    wbinvd();
>
> -}
>
> -
>
>   void vmx_do_resume(struct vcpu *v)
>
>   {
>
>       bool_t debug_state;
>
> @@ -1332,7 +1327,7 @@ void vmx_do_resume(struct vcpu *v)
>
>           {
>
>               int cpu = v->arch.hvm_vmx.active_cpu;
>
>               if ( cpu != -1 )
>
> -                on_selected_cpus(cpumask_of(cpu), wbinvd_ipi, NULL, 1);
>
> +                flush_mask(cpumask_of(cpu), FLUSH_CACHE);
>
>           }
>
>
>
>           vmx_clear_vmcs(v);
>
> --- a/xen/arch/x86/hvm/vmx/vmx.c
>
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>
> @@ -2307,18 +2307,13 @@ static void vmx_do_extint(struct cpu_use
>
>       do_IRQ(regs);
>
>   }
>
>
>
> -static void wbinvd_ipi(void *info)
>
> -{
>
> -    wbinvd();
>
> -}
>
> -
>
>   static void vmx_wbinvd_intercept(void)
>
>   {
>
>       if ( !cache_flush_permitted(current->domain) || iommu_snoop )
>
>           return;
>
>
>
>       if ( cpu_has_wbinvd_exiting )
>
> -        on_each_cpu(wbinvd_ipi, NULL, 1);
>
> +        flush_all(FLUSH_CACHE);
>
>       else
>
>           wbinvd();
>
>   }
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
>
> Xen-devel mailing list
>
> Xen-devel@lists.xen.org  <mailto:Xen-devel@lists.xen.org>
>
> http://lists.xen.org/xen-devel
>

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

end of thread, other threads:[~2014-04-30  6:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-25 10:51 [PATCH] x86/HVM: replace open-coded non-local cache flushing Jan Beulich
2014-04-25 10:55 ` Andrew Cooper
2014-04-28  7:54   ` Tian, Kevin
2014-04-30  6:29     ` Suravee Suthikulpanit
2014-04-25 14:19 ` Boris Ostrovsky
2014-04-25 15:55   ` Jan Beulich

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.