Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3c1df68b848b39270752ff8d4b956cc4a4dce0f6 Commit: 3c1df68b848b39270752ff8d4b956cc4a4dce0f6 Parent: 488fd99588bf23da951b524a806e44feaa1aa366 Author: Arjan van de Ven <[EMAIL PROTECTED]> AuthorDate: Wed Jan 30 13:34:07 2008 +0100 Committer: Ingo Molnar <[EMAIL PROTECTED]> CommitDate: Wed Jan 30 13:34:07 2008 +0100
x86: make sure initmem is writable When we free initmem, various rodata and CPA checks may have left memory read only.. this patch ensures that the memory is writable before we free it. Signed-off-by: Arjan van de Ven <[EMAIL PROTECTED]> Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]> Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]> --- arch/x86/mm/init_32.c | 7 +++++++ arch/x86/mm/init_64.c | 1 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 0d3369b..4d11565 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -780,6 +780,13 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end) { unsigned long addr; + /* + * We just marked the kernel text read only above, now that + * we are going to free part of that, we need to make that + * writeable first. + */ + set_memory_rw(begin, (end - begin) >> PAGE_SHIFT); + for (addr = begin; addr < end; addr += PAGE_SIZE) { ClearPageReserved(virt_to_page(addr)); init_page_count(virt_to_page(addr)); diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 9b69fa5..f97ace7 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -570,6 +570,7 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end) * 2Mb kernel mapping just for this debug feature. */ if (begin >= __START_KERNEL_map) { + set_memory_rw(begin, (end - begin)/PAGE_SIZE); set_memory_np(begin, (end - begin)/PAGE_SIZE); set_memory_nx(begin, (end - begin)/PAGE_SIZE); } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html