Skip to contentSkip to conversation

linux: more users of __pte_val/__p[mug]d_val

PATCH New Jan Beulich 1 participant 1 message Oct 25, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: more users of __pte_val/__p[mug]d_val

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.

arch/i386/mm/fault-xen.c +1 -1
Index: head-2007-10-23/arch/i386/mm/fault-xen.c
===================================================================
@@ -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
 
arch/x86_64/mm/fault-xen.c +1 -1
Index: head-2007-10-23/arch/x86_64/mm/fault-xen.c
===================================================================
@@ -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;
arch/x86_64/mm/init-xen.c +2 -2
Index: head-2007-10-23/arch/x86_64/mm/init-xen.c
===================================================================
@@ -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"); 
arch/x86_64/mm/pageattr-xen.c +1 -1
Index: head-2007-10-23/arch/x86_64/mm/pageattr-xen.c
===================================================================
@@ -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);
include/asm-x86_64/mach-xen/asm/pgtable.h +1 -1
Index: head-2007-10-23/include/asm-x86_64/mach-xen/asm/pgtable.h
===================================================================
@@ -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;