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] [linux-2.6.18-xen] Fix ptep_get_and_clear() on init_mm p

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] Fix ptep_get_and_clear() on init_mm pte that is not mapped into
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 20 Oct 2007 05:50:27 -0700
Delivery-date: Sat, 20 Oct 2007 05:52:44 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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@xxxxxxxxxxxxx>
# Date 1192720728 -3600
# Node ID 7837d0ec57bce4578c17018ca1ef1ded64fe1dd3
# Parent  3116d92146522ae5989b40e1915d0baf6daa1008
Fix ptep_get_and_clear() on init_mm pte that is not mapped into
current address space.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 include/asm-i386/mach-xen/asm/pgtable-2level.h |    5 ++---
 include/asm-i386/mach-xen/asm/pgtable-3level.h |    6 +++---
 include/asm-x86_64/mach-xen/asm/pgtable.h      |    5 ++---
 3 files changed, 7 insertions(+), 9 deletions(-)

diff -r 3116d9214652 -r 7837d0ec57bc 
include/asm-i386/mach-xen/asm/pgtable-2level.h
--- a/include/asm-i386/mach-xen/asm/pgtable-2level.h    Thu Oct 18 11:18:55 
2007 +0100
+++ b/include/asm-i386/mach-xen/asm/pgtable-2level.h    Thu Oct 18 16:18:48 
2007 +0100
@@ -44,10 +44,9 @@ static inline pte_t ptep_get_and_clear(s
 {
        pte_t pte = *ptep;
        if (!pte_none(pte)) {
-               if (mm != &init_mm)
+               if ((mm != current->mm && mm != &init_mm) ||
+                   HYPERVISOR_update_va_mapping(addr, __pte(0), 0))
                        pte = __pte_ma(xchg(&ptep->pte_low, 0));
-               else
-                       HYPERVISOR_update_va_mapping(addr, __pte(0), 0);
        }
        return pte;
 }
diff -r 3116d9214652 -r 7837d0ec57bc 
include/asm-i386/mach-xen/asm/pgtable-3level.h
--- a/include/asm-i386/mach-xen/asm/pgtable-3level.h    Thu Oct 18 11:18:55 
2007 +0100
+++ b/include/asm-i386/mach-xen/asm/pgtable-3level.h    Thu Oct 18 16:18:48 
2007 +0100
@@ -128,7 +128,8 @@ static inline pte_t ptep_get_and_clear(s
 {
        pte_t pte = *ptep;
        if (!pte_none(pte)) {
-               if (mm != &init_mm) {
+               if ((mm != current->mm && mm != &init_mm) ||
+                   HYPERVISOR_update_va_mapping(addr, __pte(0), 0)) {
                        uint64_t val = __pte_val(pte);
                        if (__cmpxchg64(ptep, val, 0) != val) {
                                /* xchg acts as a barrier before the setting of 
the high bits */
@@ -136,8 +137,7 @@ static inline pte_t ptep_get_and_clear(s
                                pte.pte_high = ptep->pte_high;
                                ptep->pte_high = 0;
                        }
-               } else
-                       HYPERVISOR_update_va_mapping(addr, __pte(0), 0);
+               }
        }
        return pte;
 }
diff -r 3116d9214652 -r 7837d0ec57bc include/asm-x86_64/mach-xen/asm/pgtable.h
--- a/include/asm-x86_64/mach-xen/asm/pgtable.h Thu Oct 18 11:18:55 2007 +0100
+++ b/include/asm-x86_64/mach-xen/asm/pgtable.h Thu Oct 18 16:18:48 2007 +0100
@@ -285,10 +285,9 @@ static inline pte_t ptep_get_and_clear(s
 {
        pte_t pte = *ptep;
        if (!pte_none(pte)) {
-               if (mm != &init_mm)
+               if ((mm != current->mm && mm != &init_mm) ||
+                   HYPERVISOR_update_va_mapping(addr, __pte(0), 0))
                        pte = __pte_ma(xchg(&ptep->pte, 0));
-               else
-                       HYPERVISOR_update_va_mapping(addr, __pte(0), 0);
        }
        return pte;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] Fix ptep_get_and_clear() on init_mm pte that is not mapped into, Xen patchbot-linux-2.6.18-xen <=