Commit 63687a52 authored by Jan Beulich's avatar Jan Beulich Committed by Thomas Gleixner

x86: move tracedata to RODATA

.. allowing it to be write-protected just as other read-only data
under CONFIG_DEBUG_RODATA.
Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 75d3bce2
...@@ -60,13 +60,6 @@ SECTIONS ...@@ -60,13 +60,6 @@ SECTIONS
BUG_TABLE :text BUG_TABLE :text
. = ALIGN(4);
.tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
__tracedata_start = .;
*(.tracedata)
__tracedata_end = .;
}
RODATA RODATA
/* writeable */ /* writeable */
......
...@@ -53,13 +53,6 @@ SECTIONS ...@@ -53,13 +53,6 @@ SECTIONS
RODATA RODATA
. = ALIGN(4);
.tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
__tracedata_start = .;
*(.tracedata)
__tracedata_end = .;
}
. = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */ . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */
/* Data */ /* Data */
.data : AT(ADDR(.data) - LOAD_OFFSET) { .data : AT(ADDR(.data) - LOAD_OFFSET) {
......
...@@ -153,7 +153,7 @@ EXPORT_SYMBOL(set_trace_device); ...@@ -153,7 +153,7 @@ EXPORT_SYMBOL(set_trace_device);
* it's not any guarantee, but it's a high _likelihood_ that * it's not any guarantee, but it's a high _likelihood_ that
* the match is valid). * 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; unsigned short lineno = *(unsigned short *)tracedata;
const char *file = *(const char **)(tracedata + 2); const char *file = *(const char **)(tracedata + 2);
......
...@@ -93,6 +93,8 @@ ...@@ -93,6 +93,8 @@
VMLINUX_SYMBOL(__end_rio_route_ops) = .; \ VMLINUX_SYMBOL(__end_rio_route_ops) = .; \
} \ } \
\ \
TRACEDATA \
\
/* Kernel symbol table: Normal symbols */ \ /* Kernel symbol table: Normal symbols */ \
__ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start___ksymtab) = .; \ VMLINUX_SYMBOL(__start___ksymtab) = .; \
...@@ -318,6 +320,18 @@ ...@@ -318,6 +320,18 @@
__stop___bug_table = .; \ __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 \ #define NOTES \
.notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_notes) = .; \ VMLINUX_SYMBOL(__start_notes) = .; \
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define TRACE_RESUME(user) \ #define TRACE_RESUME(user) \
do { \ do { \
if (pm_trace_enabled) { \ if (pm_trace_enabled) { \
void *tracedata; \ const void *tracedata; \
asm volatile(_ASM_MOV_UL " $1f,%0\n" \ asm volatile(_ASM_MOV_UL " $1f,%0\n" \
".section .tracedata,\"a\"\n" \ ".section .tracedata,\"a\"\n" \
"1:\t.word %c1\n\t" \ "1:\t.word %c1\n\t" \
......
...@@ -8,7 +8,7 @@ extern int pm_trace_enabled; ...@@ -8,7 +8,7 @@ extern int pm_trace_enabled;
struct device; struct device;
extern void set_trace_device(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 { \ #define TRACE_DEVICE(dev) do { \
if (pm_trace_enabled) \ if (pm_trace_enabled) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment