From: "Jan Beulich" <jbeulich@novell.com>
To: <mingo@elte.hu>, <tglx@linutronix.de>, <hpa@zytor.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: move tracedata to RODATA
Date: Tue, 22 Apr 2008 16:25:16 +0100 [thread overview]
Message-ID: <480E1F7C.76E4.0078.0@novell.com> (raw)
.. allowing it to be write-protected just as other read-only data
under CONFIG_DEBUG_RODATA.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
---
arch/x86/kernel/vmlinux_32.lds.S | 7 -------
arch/x86/kernel/vmlinux_64.lds.S | 7 -------
drivers/base/power/trace.c | 2 +-
include/asm-generic/vmlinux.lds.h | 14 ++++++++++++++
include/asm-x86/resume-trace.h | 2 +-
include/linux/resume-trace.h | 2 +-
6 files changed, 17 insertions(+), 17 deletions(-)
--- linux-2.6.25/arch/x86/kernel/vmlinux_32.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-resume-trace-rodata/arch/x86/kernel/vmlinux_32.lds.S 2008-03-04 11:12:20.000000000 +0100
@@ -60,13 +60,6 @@ SECTIONS
BUG_TABLE :text
- . = ALIGN(4);
- .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
- __tracedata_start = .;
- *(.tracedata)
- __tracedata_end = .;
- }
-
RODATA
/* writeable */
--- linux-2.6.25/arch/x86/kernel/vmlinux_64.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-resume-trace-rodata/arch/x86/kernel/vmlinux_64.lds.S 2008-03-04 11:13:30.000000000 +0100
@@ -53,13 +53,6 @@ SECTIONS
RODATA
- . = ALIGN(4);
- .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
- __tracedata_start = .;
- *(.tracedata)
- __tracedata_end = .;
- }
-
. = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */
/* Data */
.data : AT(ADDR(.data) - LOAD_OFFSET) {
--- linux-2.6.25/drivers/base/power/trace.c 2008-01-24 23:58:37.000000000 +0100
+++ 2.6.25-resume-trace-rodata/drivers/base/power/trace.c 2008-03-04 11:12:20.000000000 +0100
@@ -153,7 +153,7 @@ EXPORT_SYMBOL(set_trace_device);
* it's not any guarantee, but it's a high _likelihood_ that
* the match is valid).
*/
-void generate_resume_trace(void *tracedata, unsigned int user)
+void generate_resume_trace(const void *tracedata, unsigned int user)
{
unsigned short lineno = *(unsigned short *)tracedata;
const char *file = *(const char **)(tracedata + 2);
--- linux-2.6.25/include/asm-generic/vmlinux.lds.h 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-resume-trace-rodata/include/asm-generic/vmlinux.lds.h 2008-03-04 11:12:20.000000000 +0100
@@ -93,6 +93,8 @@
VMLINUX_SYMBOL(__end_rio_route_ops) = .; \
} \
\
+ TRACEDATA \
+ \
/* Kernel symbol table: Normal symbols */ \
__ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start___ksymtab) = .; \
@@ -318,6 +320,18 @@
__stop___bug_table = .; \
}
+#ifdef CONFIG_PM_TRACE
+#define TRACEDATA \
+ . = ALIGN(4); \
+ .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { \
+ __tracedata_start = .; \
+ *(.tracedata) \
+ __tracedata_end = .; \
+ }
+#else
+#define TRACEDATA
+#endif
+
#define NOTES \
.notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_notes) = .; \
--- linux-2.6.25/include/asm-x86/resume-trace.h 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-resume-trace-rodata/include/asm-x86/resume-trace.h 2008-03-04 11:14:02.000000000 +0100
@@ -5,7 +5,7 @@
#define TRACE_RESUME(user) do { \
if (pm_trace_enabled) { \
- void *tracedata; \
+ const void *tracedata; \
asm volatile(_ASM_MOV_UL " $1f,%0\n" \
".section .tracedata,\"a\"\n" \
"1:\t.word %c1\n\t" \
--- linux-2.6.25/include/linux/resume-trace.h 2007-10-09 22:31:38.000000000 +0200
+++ 2.6.25-resume-trace-rodata/include/linux/resume-trace.h 2008-03-04 11:12:20.000000000 +0100
@@ -8,7 +8,7 @@ extern int pm_trace_enabled;
struct device;
extern void set_trace_device(struct device *);
-extern void generate_resume_trace(void *tracedata, unsigned int user);
+extern void generate_resume_trace(const void *tracedata, unsigned int user);
#define TRACE_DEVICE(dev) do { \
if (pm_trace_enabled) \
reply other threads:[~2008-04-22 15:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=480E1F7C.76E4.0078.0@novell.com \
--to=jbeulich@novell.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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®