Commit 69b1415e authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar

x86: cpa: ensure page alignment

the cpa API is page aligned - warn about any weird alignments.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 7bfeab9a
...@@ -688,6 +688,15 @@ static int change_page_attr_set_clr(unsigned long addr, int numpages, ...@@ -688,6 +688,15 @@ static int change_page_attr_set_clr(unsigned long addr, int numpages,
if (!pgprot_val(mask_set) && !pgprot_val(mask_clr)) if (!pgprot_val(mask_set) && !pgprot_val(mask_clr))
return 0; return 0;
/* Ensure we are PAGE_SIZE aligned */
if (addr & ~PAGE_MASK) {
addr &= PAGE_MASK;
/*
* People should not be passing in unaligned addresses:
*/
WARN_ON_ONCE(1);
}
cpa.vaddr = addr; cpa.vaddr = addr;
cpa.numpages = numpages; cpa.numpages = numpages;
cpa.mask_set = mask_set; cpa.mask_set = mask_set;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment