aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-02-13 05:04:50 -0500
committerIngo Molnar <mingo@elte.hu>2008-02-14 17:30:20 -0500
commit69b1415e934fc1a796a817e32d84162ae65962f5 (patch)
treec9a41dfe191131bcb4d9632d2f7541c3f5883474 /arch/x86/mm
parent7bfeab9af95565e38a97fbcfb631e5b140241187 (diff)
x86: cpa: ensure page alignment
the cpa API is page aligned - warn about any weird alignments. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/pageattr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index bd61ed13f9cf..5d2259468d3c 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -688,6 +688,15 @@ static int change_page_attr_set_clr(unsigned long addr, int numpages,
688 if (!pgprot_val(mask_set) && !pgprot_val(mask_clr)) 688 if (!pgprot_val(mask_set) && !pgprot_val(mask_clr))
689 return 0; 689 return 0;
690 690
691 /* Ensure we are PAGE_SIZE aligned */
692 if (addr & ~PAGE_MASK) {
693 addr &= PAGE_MASK;
694 /*
695 * People should not be passing in unaligned addresses:
696 */
697 WARN_ON_ONCE(1);
698 }
699
691 cpa.vaddr = addr; 700 cpa.vaddr = addr;
692 cpa.numpages = numpages; 701 cpa.numpages = numpages;
693 cpa.mask_set = mask_set; 702 cpa.mask_set = mask_set;