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] x86: add support for domain-initiated glo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: add support for domain-initiated global cache flush
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 04 May 2010 13:20:52 -0700
Delivery-date: Tue, 04 May 2010 13:27:16 -0700
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 1272973271 -3600
# Node ID 6c7b905b03ff1cf171187bafe7129e3e213e5787
# Parent  bd52f2e040e5a5ca58e956b3d0780a86934a429e
x86: add support for domain-initiated global cache flush

Newer Linux' AGP code wants to flush caches on all CPUs under certain
circumstances. Since doing this on all vCPU-s of the domain in
question doesn't yield the intended effect, this needs to be done in
the hypervisor. Add a new MMUEXT operation for this.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/arch/x86/mm.c        |   21 +++++++++++++++++++++
 xen/include/public/xen.h |    5 +++++
 2 files changed, 26 insertions(+)

diff -r bd52f2e040e5 -r 6c7b905b03ff xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Tue May 04 12:39:29 2010 +0100
+++ b/xen/arch/x86/mm.c Tue May 04 12:41:11 2010 +0100
@@ -2888,6 +2888,27 @@ int do_mmuext_op(
             }
             break;
 
+        case MMUEXT_FLUSH_CACHE_GLOBAL:
+            if ( unlikely(foreigndom != DOMID_SELF) )
+                okay = 0;
+            else if ( likely(cache_flush_permitted(d)) )
+            {
+                unsigned int cpu;
+                cpumask_t mask = CPU_MASK_NONE;
+
+                for_each_online_cpu(cpu)
+                    if ( !cpus_intersects(mask,
+                                          per_cpu(cpu_sibling_map, cpu)) )
+                        cpu_set(cpu, mask);
+                flush_mask(&mask, FLUSH_CACHE);
+            }
+            else
+            {
+                MEM_LOG("Non-physdev domain tried to FLUSH_CACHE_GLOBAL");
+                okay = 0;
+            }
+            break;
+
         case MMUEXT_SET_LDT:
         {
             unsigned long ptr  = op.arg1.linear_addr;
diff -r bd52f2e040e5 -r 6c7b905b03ff xen/include/public/xen.h
--- a/xen/include/public/xen.h  Tue May 04 12:39:29 2010 +0100
+++ b/xen/include/public/xen.h  Tue May 04 12:41:11 2010 +0100
@@ -239,6 +239,10 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
  * 
  * cmd: MMUEXT_FLUSH_CACHE
  * No additional arguments. Writes back and flushes cache contents.
+ *
+ * cmd: MMUEXT_FLUSH_CACHE_GLOBAL
+ * No additional arguments. Writes back and flushes cache contents
+ * on all CPUs in the system.
  * 
  * cmd: MMUEXT_SET_LDT
  * linear_addr: Linear address of LDT base (NB. must be page-aligned).
@@ -268,6 +272,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 #define MMUEXT_NEW_USER_BASEPTR 15
 #define MMUEXT_CLEAR_PAGE       16
 #define MMUEXT_COPY_PAGE        17
+#define MMUEXT_FLUSH_CACHE_GLOBAL 18
 
 #ifndef __ASSEMBLY__
 struct mmuext_op {

_______________________________________________
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] x86: add support for domain-initiated global cache flush, Xen patchbot-unstable <=