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-devel

[Xen-devel] [PATCH] linux: more users of __pte_val/__p[mug]d_val

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: more users of __pte_val/__p[mug]d_val
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Thu, 25 Oct 2007 10:35:37 +0100
Delivery-date: Thu, 25 Oct 2007 02:34:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Use __pXX_val() instead of pXX_val() when only flags are accessed or
the frame number is only compared against zero

As usual, written and tested against 2.6.23 and made apply against
2.6.18 without further testing.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: head-2007-10-23/arch/i386/mm/fault-xen.c
===================================================================
--- head-2007-10-23.orig/arch/i386/mm/fault-xen.c       2007-10-24 
14:22:50.000000000 +0200
+++ head-2007-10-23/arch/i386/mm/fault-xen.c    2007-10-23 11:10:03.000000000 
+0200
@@ -311,7 +311,7 @@ static int spurious_fault(struct pt_regs
        if ((error_code & 0x02) && !pte_write(*pte))
                return 0;
 #ifdef CONFIG_X86_PAE
-       if ((error_code & 0x10) && (pte_val(*pte) & _PAGE_NX))
+       if ((error_code & 0x10) && (__pte_val(*pte) & _PAGE_NX))
                return 0;
 #endif
 
Index: head-2007-10-23/arch/x86_64/mm/fault-xen.c
===================================================================
--- head-2007-10-23.orig/arch/x86_64/mm/fault-xen.c     2007-10-24 
14:22:50.000000000 +0200
+++ head-2007-10-23/arch/x86_64/mm/fault-xen.c  2007-10-23 11:10:03.000000000 
+0200
@@ -345,7 +345,7 @@ static int spurious_fault(struct pt_regs
                return 0;
        if ((error_code & PF_WRITE) && !pte_write(*pte))
                return 0;
-       if ((error_code & PF_INSTR) && (pte_val(*pte) & _PAGE_NX))
+       if ((error_code & PF_INSTR) && (__pte_val(*pte) & _PAGE_NX))
                return 0;
 
        return 1;
Index: head-2007-10-23/arch/x86_64/mm/init-xen.c
===================================================================
--- head-2007-10-23.orig/arch/x86_64/mm/init-xen.c      2007-10-24 
14:22:50.000000000 +0200
+++ head-2007-10-23/arch/x86_64/mm/init-xen.c   2007-10-24 14:22:57.000000000 
+0200
@@ -287,7 +287,7 @@ static __init void set_pte_phys(unsigned
 
        pte = pte_offset_kernel(pmd, vaddr);
        if (!pte_none(*pte) &&
-           pte_val(*pte) != (pte_val(new_pte) & __supported_pte_mask))
+           __pte_val(*pte) != (__pte_val(new_pte) & __supported_pte_mask))
                pte_ERROR(*pte);
        set_pte(pte, new_pte);
 
@@ -850,7 +850,7 @@ void __init clear_kernel_mapping(unsigne
                pmd = pmd_offset(pud, address);
                if (!pmd || pmd_none(*pmd))
                        continue; 
-               if (0 == (pmd_val(*pmd) & _PAGE_PSE)) { 
+               if (0 == (__pmd_val(*pmd) & _PAGE_PSE)) {
                        /* Could handle this, but it should not happen 
currently. */
                        printk(KERN_ERR 
               "clear_kernel_mapping: mapping has been split. will leak 
memory\n"); 
Index: head-2007-10-23/arch/x86_64/mm/pageattr-xen.c
===================================================================
--- head-2007-10-23.orig/arch/x86_64/mm/pageattr-xen.c  2007-10-24 
14:22:50.000000000 +0200
+++ head-2007-10-23/arch/x86_64/mm/pageattr-xen.c       2007-10-23 
11:10:03.000000000 +0200
@@ -378,7 +378,7 @@ static void revert_page(unsigned long ad
        pud = pud_offset(pgd,address);
        BUG_ON(pud_none(*pud));
        pmd = pmd_offset(pud, address);
-       BUG_ON(pmd_val(*pmd) & _PAGE_PSE);
+       BUG_ON(__pmd_val(*pmd) & _PAGE_PSE);
        pgprot_val(ref_prot) |= _PAGE_PSE;
        large_pte = mk_pte_phys(__pa(address) & LARGE_PAGE_MASK, ref_prot);
        set_pte((pte_t *)pmd, large_pte);
Index: head-2007-10-23/include/asm-x86_64/mach-xen/asm/pgtable.h
===================================================================
--- head-2007-10-23.orig/include/asm-x86_64/mach-xen/asm/pgtable.h      
2007-10-24 14:22:50.000000000 +0200
+++ head-2007-10-23/include/asm-x86_64/mach-xen/asm/pgtable.h   2007-10-24 
14:22:04.000000000 +0200
@@ -499,7 +499,7 @@ static inline pte_t pte_modify(pte_t pte
 #define __swp_type(x)                  (((x).val >> 1) & 0x3f)
 #define __swp_offset(x)                        ((x).val >> 8)
 #define __swp_entry(type, offset)      ((swp_entry_t) { ((type) << 1) | 
((offset) << 8) })
-#define __pte_to_swp_entry(pte)                ((swp_entry_t) { pte_val(pte) })
+#define __pte_to_swp_entry(pte)                ((swp_entry_t) { __pte_val(pte) 
})
 #define __swp_entry_to_pte(x)          ((pte_t) { (x).val })
 
 extern spinlock_t pgd_lock;




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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux: more users of __pte_val/__p[mug]d_val, Jan Beulich <=