From: Sam Ravnborg <sam@ravnborg.org>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: hpa@zytor.com, mingo@elte.hu, tglx@linutronix.de,
arjan@linux.jf.intel.com, linux-kernel@vger.kernel.org,
chinang.ma@intel.com
Subject: Re: [patch 2/2] x86_64: align RODATA kernel section to 2MB with CONFIG_DEBUG_RODATA
Date: Thu, 15 Oct 2009 05:24:29 +0200 [thread overview]
Message-ID: <20091015032429.GA10068@merkur.ravnborg.org> (raw)
In-Reply-To: <20091014220254.190119924@sbs-t61.sc.intel.com>
> 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
next prev parent reply other threads:[~2009-10-15 3:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 21:46 [patch 0/2] x86_64: preserve large page text mappings " Suresh Siddha
2009-10-14 21:46 ` [patch 1/2] x86_64: preserve large page mapping for 1st 2MB kernel txt " Suresh Siddha
2009-10-24 1:03 ` [tip:branch?] x86-64: " tip-bot for Suresh Siddha
2009-10-14 21:46 ` [patch 2/2] x86_64: align RODATA kernel section to 2MB " Suresh Siddha
2009-10-15 3:24 ` Sam Ravnborg [this message]
2009-10-15 20:23 ` Suresh Siddha
2009-10-24 1:03 ` [tip:branch?] x86-64: " tip-bot for Suresh Siddha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091015032429.GA10068@merkur.ravnborg.org \
--to=sam@ravnborg.org \
--cc=arjan@linux.jf.intel.com \
--cc=chinang.ma@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®