Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: make sure the CPA test code's use of _PAGE_UNUSED1 is obvious

The CPA test code uses _PAGE_UNUSED1, so make sure its obvious.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Jeremy Fitzhardinge and committed by
Ingo Molnar
110e0358 c09ff7e1

+5 -3
+3 -3
arch/x86/mm/pageattr-test.c
··· 32 32 GPS = (1<<30) 33 33 }; 34 34 35 - #define PAGE_TESTBIT __pgprot(_PAGE_UNUSED1) 35 + #define PAGE_CPA_TEST __pgprot(_PAGE_CPA_TEST) 36 36 37 37 static int pte_testbit(pte_t pte) 38 38 { ··· 174 174 } 175 175 176 176 test_addr = addr[i]; 177 - err = change_page_attr_set(&test_addr, len[i], PAGE_TESTBIT, 0); 177 + err = change_page_attr_set(&test_addr, len[i], PAGE_CPA_TEST, 0); 178 178 if (err < 0) { 179 179 printk(KERN_ERR "CPA %d failed %d\n", i, err); 180 180 failed++; ··· 207 207 continue; 208 208 } 209 209 test_addr = addr[i]; 210 - err = change_page_attr_clear(&test_addr, len[i], PAGE_TESTBIT, 0); 210 + err = change_page_attr_clear(&test_addr, len[i], PAGE_CPA_TEST, 0); 211 211 if (err < 0) { 212 212 printk(KERN_ERR "CPA reverting failed: %d\n", err); 213 213 failed++;
+2
include/asm-x86/pgtable.h
··· 19 19 #define _PAGE_BIT_UNUSED3 11 20 20 #define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */ 21 21 #define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1 22 + #define _PAGE_BIT_CPA_TEST _PAGE_BIT_UNUSED1 22 23 #define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */ 23 24 24 25 #define _PAGE_PRESENT (_AT(pteval_t, 1) << _PAGE_BIT_PRESENT) ··· 37 36 #define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT) 38 37 #define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE) 39 38 #define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL) 39 + #define _PAGE_CPA_TEST (_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST) 40 40 #define __HAVE_ARCH_PTE_SPECIAL 41 41 42 42 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)