aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86')
-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;