[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091015032429.GA10068@merkur.ravnborg.org>
Date: Thu, 15 Oct 2009 05:24:29 +0200
From: Sam Ravnborg <sam@...nborg.org>
To: Suresh Siddha <suresh.b.siddha@...el.com>
Cc: hpa@...or.com, mingo@...e.hu, tglx@...utronix.de,
arjan@...ux.jf.intel.com, linux-kernel@...r.kernel.org,
chinang.ma@...el.com
Subject: Re: [patch 2/2] x86_64: align RODATA kernel section to 2MB with
CONFIG_DEBUG_RODATA
> Index: tree/arch/x86/include/asm/sections.h
> ===================================================================
> --- tree.orig/arch/x86/include/asm/sections.h
> +++ tree/arch/x86/include/asm/sections.h
> @@ -2,7 +2,13 @@
> #define _ASM_X86_SECTIONS_H
>
> #include <asm-generic/sections.h>
> +#include <asm/uaccess.h>
>
> extern char __brk_base[], __brk_limit[];
> +extern struct exception_table_entry __stop___ex_table[];
> +
> +#if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA)
> +extern char __end_rodata_hpage_align[];
> +#endif
>
> #endif /* _ASM_X86_SECTIONS_H */
> Index: tree/arch/x86/kernel/vmlinux.lds.S
> ===================================================================
> --- tree.orig/arch/x86/kernel/vmlinux.lds.S
> +++ tree/arch/x86/kernel/vmlinux.lds.S
> @@ -41,6 +41,21 @@ ENTRY(phys_startup_64)
> jiffies_64 = jiffies;
> #endif
>
> +#if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA)
> +
> +#define X64_ALIGN_DEBUG_RODATA_BEGIN . = ALIGN(HPAGE_SIZE);
> +
> +#define X64_ALIGN_DEBUG_RODATA_END \
> + . = ALIGN(HPAGE_SIZE); \
> + __end_rodata_hpage_align = .;
This symbol is only defined if CONFIG_DEBUG_RODATA is defined, but (see below).
> +
> +#else
> +
> +#define X64_ALIGN_DEBUG_RODATA_BEGIN
> +#define X64_ALIGN_DEBUG_RODATA_END
> +
> +#endif
A coment describing the purpose of
this would be nice.
> +
> PHDRS {
> text PT_LOAD FLAGS(5); /* R_E */
> data PT_LOAD FLAGS(7); /* RWE */
> @@ -90,7 +105,9 @@ SECTIONS
>
> EXCEPTION_TABLE(16) :text = 0x9090
>
> + X64_ALIGN_DEBUG_RODATA_BEGIN
> RO_DATA(PAGE_SIZE)
> + X64_ALIGN_DEBUG_RODATA_END
>
> /* Data */
> .data : AT(ADDR(.data) - LOAD_OFFSET) {
> Index: tree/arch/x86/mm/init_64.c
> ===================================================================
> --- tree.orig/arch/x86/mm/init_64.c
> +++ tree/arch/x86/mm/init_64.c
> @@ -726,9 +726,13 @@ void set_kernel_text_ro(void)
>
> void mark_rodata_ro(void)
> {
> - unsigned long start = PFN_ALIGN(_text), end = PFN_ALIGN(__end_rodata);
> + unsigned long start = PFN_ALIGN(_text);
> unsigned long rodata_start =
> ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK;
> + unsigned long end = (unsigned long) &__end_rodata_hpage_align;
Here the symbol seems to be referenced unconditionally.
Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists