From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932323AbXIFUDf (ORCPT ); Thu, 6 Sep 2007 16:03:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932246AbXIFUCe (ORCPT ); Thu, 6 Sep 2007 16:02:34 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:39418 "EHLO smtp.polymtl.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932223AbXIFUCd (ORCPT ); Thu, 6 Sep 2007 16:02:33 -0400 Message-Id: <20070906200213.712460149@polymtl.ca> References: <20070906200124.595238505@polymtl.ca> User-Agent: quilt/0.46-1 Date: Thu, 06 Sep 2007 16:01:34 -0400 From: Mathieu Desnoyers To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org Cc: Mathieu Desnoyers , Andi Kleen , pageexec@freemail.hu Subject: [patch 10/10] Text Edit Lock - x86_64 standardize debug rodata Content-Disposition: inline; filename=text-edit-lock-x86_64-standardize-debug-rodata.patch X-Poly-FromMTA: (dijkstra.casi.polymtl.ca [132.207.72.10]) at Thu, 6 Sep 2007 20:02:14 +0000 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Standardize DEBUG_RODATA, removing special cases for hotplug and kprobes. Signed-off-by: Mathieu Desnoyers CC: Andi Kleen CC: pageexec@freemail.hu --- arch/x86_64/mm/init.c | 23 +++++------------------ include/asm-x86_64/cacheflush.h | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 18 deletions(-) Index: linux-2.6-lttng/arch/x86_64/mm/init.c =================================================================== --- linux-2.6-lttng.orig/arch/x86_64/mm/init.c 2007-08-18 10:02:58.000000000 -0400 +++ linux-2.6-lttng/arch/x86_64/mm/init.c 2007-08-18 10:04:14.000000000 -0400 @@ -598,25 +598,11 @@ void free_initmem(void) void mark_rodata_ro(void) { - unsigned long start = (unsigned long)_stext, end; + unsigned long start = PFN_ALIGN(_stext); + unsigned long end = PFN_ALIGN(__end_rodata); -#ifdef CONFIG_HOTPLUG_CPU - /* It must still be possible to apply SMP alternatives. */ - if (num_possible_cpus() > 1) - start = (unsigned long)_etext; -#endif - -#ifdef CONFIG_KPROBES - start = (unsigned long)__start_rodata; -#endif - - end = (unsigned long)__end_rodata; - start = (start + PAGE_SIZE - 1) & PAGE_MASK; - end &= PAGE_MASK; - if (end <= start) - return; - - change_page_attr_addr(start, (end - start) >> PAGE_SHIFT, PAGE_KERNEL_RO); + change_page_attr_addr(start, (end - start) >> PAGE_SHIFT, + PAGE_KERNEL_RO); printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n", (end - start) >> 10); @@ -629,6 +615,7 @@ void mark_rodata_ro(void) */ global_flush_tlb(); } + #endif #ifdef CONFIG_BLK_DEV_INITRD -- Mathieu Desnoyers Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68