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/mm/p2m: Fix locking discipline around

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86/mm/p2m: Fix locking discipline around p2m updates.
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Thu, 16 Jun 2011 11:12:34 +0100
Delivery-date: Thu, 16 Jun 2011 03:28:37 -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 Tim Deegan <Tim.Deegan@xxxxxxxxxx>
# Date 1307017012 -3600
# Node ID 32f80f08d7246cac9c75d4820698e754550a425a
# Parent  dd89c48f2ac5c55e8a46159390c2c2f83a7b7742
x86/mm/p2m: Fix locking discipline around p2m updates.

Direct callers of the p2m setting functions must hold the p2m lock.

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---


diff -r dd89c48f2ac5 -r 32f80f08d724 xen/arch/x86/mm/hap/nested_hap.c
--- a/xen/arch/x86/mm/hap/nested_hap.c  Thu Jun 02 13:16:52 2011 +0100
+++ b/xen/arch/x86/mm/hap/nested_hap.c  Thu Jun 02 13:16:52 2011 +0100
@@ -103,9 +103,12 @@
     ASSERT(p2m);
     ASSERT(p2m->set_entry);
 
-    rv = p2m->set_entry(p2m, L2_gpa >> PAGE_SHIFT,
+    p2m_lock(p2m);
+    rv = set_p2m_entry(p2m, L2_gpa >> PAGE_SHIFT,
                          page_to_mfn(maddr_to_page(L0_gpa)),
                          0 /*4K*/, p2mt, p2ma);
+    p2m_unlock(p2m);
+
     if (rv == 0) {
         gdprintk(XENLOG_ERR,
                "failed to set entry for 0x%"PRIx64" -> 0x%"PRIx64"\n",
diff -r dd89c48f2ac5 -r 32f80f08d724 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Thu Jun 02 13:16:52 2011 +0100
+++ b/xen/arch/x86/mm/p2m.c     Thu Jun 02 13:16:52 2011 +0100
@@ -140,6 +140,8 @@
     unsigned int order;
     int rc = 1;
 
+    ASSERT(p2m_locked_by_me(p2m));
+
     while ( todo )
     {
         if ( hap_enabled(d) )

_______________________________________________
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/mm/p2m: Fix locking discipline around p2m updates., Xen patchbot-unstable <=