diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-02-15 08:48:28 -0800 |
---|---|---|
committer | Christoph Lameter <clameter@sgi.com> | 2008-02-15 08:48:28 -0800 |
commit | 6f157c1d268d5888ca44c589dccd01729c4172f6 (patch) | |
tree | e439df35a39c06df3665ec30b406406f08e82177 /arch/x86/mm/pageattr.c | |
parent | c5974932c1e8514d3478573bb52beebeb2c786dd (diff) | |
parent | 4ee29f6a52158cea526b16a44ae38643946103ec (diff) | |
download | kernel-crypto-6f157c1d268d5888ca44c589dccd01729c4172f6.tar.gz kernel-crypto-6f157c1d268d5888ca44c589dccd01729c4172f6.tar.xz kernel-crypto-6f157c1d268d5888ca44c589dccd01729c4172f6.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'arch/x86/mm/pageattr.c')
-rw-r--r-- | arch/x86/mm/pageattr.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index bd61ed13f9c..4119379f80f 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, if (!pgprot_val(mask_set) && !pgprot_val(mask_clr)) 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.numpages = numpages; cpa.mask_set = mask_set; @@ -861,8 +870,12 @@ void kernel_map_pages(struct page *page, int numpages, int enable) return; /* - * The return value is ignored - the calls cannot fail, - * large pages are disabled at boot time: + * The return value is ignored as the calls cannot fail. + * Large pages are kept enabled at boot time, and are + * split up quickly with DEBUG_PAGEALLOC. If a splitup + * fails here (due to temporary memory shortage) no damage + * is done because we just keep the largepage intact up + * to the next attempt when it will likely be split up: */ if (enable) __set_pages_p(page, numpages); |