All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] extable: Make sure all archs define _sdata
@ 2011-05-20  1:34 ` Steven Rostedt
  0 siblings, 0 replies; 14+ messages in thread
From: Steven Rostedt @ 2011-05-20  1:34 UTC (permalink / raw)
  To: LKML
  Cc: Ingo Molnar, Richard Henderson, Ivan Kokshaysky, Matt Turner,
	linux-alpha, Hirokazu Takata, Geert Uytterhoeven, Roman Zippel,
	linux-m68k, Ralf Baechle, Kyle McMartin, Helge Deller,
	JamesE.J.Bottomley

Can I get an Acked-by (or comment) from the following Maintainers:

  alpha
  m32r
  m68k
  mips
  parisc

Ingo has discovered that one of my patches broke the builds of these
architectures. Although he added a quick fix, this patch supplies the
proper fix and touches the affected architectures. Please review and Ack
(or NACK with guidance) this patch.

-- Steve

A new utility function is used to determine if a passed in address is
part of core kernel data or not. It may or may not return true for RO
data, but this utility must work for RW data. Thus both _sdata and
_edata must be defined and continuous, without .init sections that may
later be freed and replaced by volatile memory (memory that can be
freed).

This utility function is used to determine if data is safe from ever
being freed. Thus it should return true for all RW global data that is
not in a module or has been allocated, or false otherwise.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
----
 arch/alpha/kernel/vmlinux.lds.S   |    1 +
 arch/m32r/kernel/vmlinux.lds.S    |    1 +
 arch/m68k/kernel/vmlinux-std.lds  |    2 ++
 arch/m68k/kernel/vmlinux-sun3.lds |    1 +
 arch/mips/kernel/vmlinux.lds.S    |    1 +
 arch/parisc/kernel/vmlinux.lds.S  |    3 +++
 kernel/extable.c                  |   12 +++++++++++-
 7 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index 433be2a..3d890a9 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -46,6 +46,7 @@ SECTIONS
 	__init_end = .;
 	/* Freed after init ends here */
 
+	_sdata = .;	/* Start of rw data section */
 	_data = .;
 	RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
 
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index c194d64..cf95aec 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -44,6 +44,7 @@ SECTIONS
   EXCEPTION_TABLE(16)
   NOTES
 
+  _sdata = .;			/* Start of data section */
   RODATA
   RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
   _edata = .;			/* End of data section */
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 878be5f..d099359 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -25,6 +25,8 @@ SECTIONS
 
   EXCEPTION_TABLE(16)
 
+  _sdata = .;			/* Start of data section */
+
   RODATA
 
   RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE)
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 1ad6b7a..8080469 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -25,6 +25,7 @@ SECTIONS
   _etext = .;			/* End of text section */
 
   EXCEPTION_TABLE(16) :data
+  _sdata = .;			/* Start of rw data section */
   RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) :data
   /* End of data goes *here* so that freeing init code works properly. */
   _edata = .;
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 832afbb..60b8af3 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -65,6 +65,7 @@ SECTIONS
 	NOTES :text :note
 	.dummy : { *(.dummy) } :text
 
+	_sdata = .;			/* Start of data section */
 	RODATA
 
 	/* writeable */
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index 8f1e4ef..2d9a5c7 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -69,6 +69,9 @@ SECTIONS
 	/* End of text section */
 	_etext = .;
 
+	/* Start of data section */
+	_sdata = .;
+
 	RODATA
 
 	/* writeable */
diff --git a/kernel/extable.c b/kernel/extable.c
index d44aac0..5339705 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -72,9 +72,19 @@ int core_kernel_text(unsigned long addr)
 	return 0;
 }
 
+/**
+ * core_kernel_data - tell if addr points to kernel data
+ * @addr: address to test
+ *
+ * Returns true if @addr passed in is from the core kernel data
+ * section.
+ *
+ * Note: On some archs it may return true for core RODATA, and false
+ *  for others. But will always be true for core RW data.
+ */
 int core_kernel_data(unsigned long addr)
 {
-	if (addr >= (unsigned long)_stext &&
+	if (addr >= (unsigned long)_sdata &&
 	    addr < (unsigned long)_edata)
 		return 1;
 	return 0;



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [RFC][PATCH] extable: Make sure all archs define _sdata
@ 2011-05-20  1:34 ` Steven Rostedt
  0 siblings, 0 replies; 14+ messages in thread
From: Steven Rostedt @ 2011-05-20  1:34 UTC (permalink / raw)
  To: LKML
  Cc: Ingo Molnar, Richard Henderson, Ivan Kokshaysky, Matt Turner,
	linux-alpha, Hirokazu Takata, Geert Uytterhoeven, Roman Zippel,
	linux-m68k, Ralf Baechle, Kyle McMartin, Helge Deller,
	JamesE.J.Bottomley

Can I get an Acked-by (or comment) from the following Maintainers:

  alpha
  m32r
  m68k
  mips
  parisc

Ingo has discovered that one of my patches broke the builds of these
architectures. Although he added a quick fix, this patch supplies the
proper fix and touches the affected architectures. Please review and Ack
(or NACK with guidance) this patch.

-- Steve

A new utility function is used to determine if a passed in address is
part of core kernel data or not. It may or may not return true for RO
data, but this utility must work for RW data. Thus both _sdata and
_edata must be defined and continuous, without .init sections that may
later be freed and replaced by volatile memory (memory that can be
freed).

This utility function is used to determine if data is safe from ever
being freed. Thus it should return true for all RW global data that is
not in a module or has been allocated, or false otherwise.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
----
 arch/alpha/kernel/vmlinux.lds.S   |    1 +
 arch/m32r/kernel/vmlinux.lds.S    |    1 +
 arch/m68k/kernel/vmlinux-std.lds  |    2 ++
 arch/m68k/kernel/vmlinux-sun3.lds |    1 +
 arch/mips/kernel/vmlinux.lds.S    |    1 +
 arch/parisc/kernel/vmlinux.lds.S  |    3 +++
 kernel/extable.c                  |   12 +++++++++++-
 7 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index 433be2a..3d890a9 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -46,6 +46,7 @@ SECTIONS
 	__init_end = .;
 	/* Freed after init ends here */
 
+	_sdata = .;	/* Start of rw data section */
 	_data = .;
 	RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
 
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index c194d64..cf95aec 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -44,6 +44,7 @@ SECTIONS
   EXCEPTION_TABLE(16)
   NOTES
 
+  _sdata = .;			/* Start of data section */
   RODATA
   RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
   _edata = .;			/* End of data section */
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 878be5f..d099359 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -25,6 +25,8 @@ SECTIONS
 
   EXCEPTION_TABLE(16)
 
+  _sdata = .;			/* Start of data section */
+
   RODATA
 
   RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE)
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 1ad6b7a..8080469 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -25,6 +25,7 @@ SECTIONS
   _etext = .;			/* End of text section */
 
   EXCEPTION_TABLE(16) :data
+  _sdata = .;			/* Start of rw data section */
   RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) :data
   /* End of data goes *here* so that freeing init code works properly. */
   _edata = .;
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 832afbb..60b8af3 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -65,6 +65,7 @@ SECTIONS
 	NOTES :text :note
 	.dummy : { *(.dummy) } :text
 
+	_sdata = .;			/* Start of data section */
 	RODATA
 
 	/* writeable */
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index 8f1e4ef..2d9a5c7 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -69,6 +69,9 @@ SECTIONS
 	/* End of text section */
 	_etext = .;
 
+	/* Start of data section */
+	_sdata = .;
+
 	RODATA
 
 	/* writeable */
diff --git a/kernel/extable.c b/kernel/extable.c
index d44aac0..5339705 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -72,9 +72,19 @@ int core_kernel_text(unsigned long addr)
 	return 0;
 }
 
+/**
+ * core_kernel_data - tell if addr points to kernel data
+ * @addr: address to test
+ *
+ * Returns true if @addr passed in is from the core kernel data
+ * section.
+ *
+ * Note: On some archs it may return true for core RODATA, and false
+ *  for others. But will always be true for core RW data.
+ */
 int core_kernel_data(unsigned long addr)
 {
-	if (addr >= (unsigned long)_stext &&
+	if (addr >= (unsigned long)_sdata &&
 	    addr < (unsigned long)_edata)
 		return 1;
 	return 0;

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [RFC][PATCH] extable: Make sure all archs define _sdata
  2011-05-20  1:34 ` Steven Rostedt
  (?)
@ 2011-05-20  6:34 ` Ralf Baechle
  -1 siblings, 0 replies; 14+ messages in thread
From: Ralf Baechle @ 2011-05-20  6:34 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Ingo Molnar, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, linux-alpha, Hirokazu Takata, Geert Uytterhoeven,
	Roman Zippel, linux-m68k, Kyle McMartin, Helge Deller,
	JamesE.J.Bottomley

On Thu, May 19, 2011 at 09:34:58PM -0400, Steven Rostedt wrote:

> Can I get an Acked-by (or comment) from the following Maintainers:
> 
>   alpha
>   m32r
>   m68k
>   mips
>   parisc
> 
> Ingo has discovered that one of my patches broke the builds of these
> architectures. Although he added a quick fix, this patch supplies the
> proper fix and touches the affected architectures. Please review and Ack
> (or NACK with guidance) this patch.
> 
> -- Steve
> 
> A new utility function is used to determine if a passed in address is
> part of core kernel data or not. It may or may not return true for RO
> data, but this utility must work for RW data. Thus both _sdata and
> _edata must be defined and continuous, without .init sections that may
> later be freed and replaced by volatile memory (memory that can be
> freed).
> 
> This utility function is used to determine if data is safe from ever
> being freed. Thus it should return true for all RW global data that is
> not in a module or has been allocated, or false otherwise.

Acked-by: Ralf Baechle <ralf@linux-mips.org>

Thanks,

  Ralf

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC][PATCH] extable: Make sure all archs define _sdata
  2011-05-20  1:34 ` Steven Rostedt
@ 2011-05-20  6:49   ` Hirokazu Takata
  -1 siblings, 0 replies; 14+ messages in thread
From: Hirokazu Takata @ 2011-05-20  6:49 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Ingo Molnar, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, linux-alpha, Hirokazu Takata, Geert Uytterhoeven,
	Roman Zippel, linux-m68k, Ralf Baechle, Kyle McMartin,
	Helge Deller, JamesE.J.Bottomley

From: Steven Rostedt <rostedt@goodmis.org>
Subject: [RFC][PATCH] extable: Make sure all archs define _sdata
Date: Thu, 19 May 2011 21:34:58 -0400
> Can I get an Acked-by (or comment) from the following Maintainers:
> 
>   alpha
>   m32r
>   m68k
>   mips
>   parisc
> 
> Ingo has discovered that one of my patches broke the builds of these
> architectures. Although he added a quick fix, this patch supplies the
> proper fix and touches the affected architectures. Please review and Ack
> (or NACK with guidance) this patch.
> 
> -- Steve
> 
> A new utility function is used to determine if a passed in address is
> part of core kernel data or not. It may or may not return true for RO
> data, but this utility must work for RW data. Thus both _sdata and
> _edata must be defined and continuous, without .init sections that may
> later be freed and replaced by volatile memory (memory that can be
> freed).
> 
> This utility function is used to determine if data is safe from ever
> being freed. Thus it should return true for all RW global data that is
> not in a module or has been allocated, or false otherwise.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ----
>  arch/alpha/kernel/vmlinux.lds.S   |    1 +
>  arch/m32r/kernel/vmlinux.lds.S    |    1 +
>  arch/m68k/kernel/vmlinux-std.lds  |    2 ++
>  arch/m68k/kernel/vmlinux-sun3.lds |    1 +
>  arch/mips/kernel/vmlinux.lds.S    |    1 +
>  arch/parisc/kernel/vmlinux.lds.S  |    3 +++
>  kernel/extable.c                  |   12 +++++++++++-
>  7 files changed, 20 insertions(+), 1 deletion(-)

Acked-by: Hirokazu Takata <takata@linux-m32r.org>

Thank you.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC][PATCH] extable: Make sure all archs define _sdata
  2011-05-20  1:34 ` Steven Rostedt
  (?)
  (?)
@ 2011-05-20  6:49 ` Hirokazu Takata
  -1 siblings, 0 replies; 14+ messages in thread
From: Hirokazu Takata @ 2011-05-20  6:49 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Ingo Molnar, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, linux-alpha, Hirokazu Takata, Geert Uytterhoeven,
	Roman Zippel, linux-m68k, Ralf Baechle, Kyle McMartin,
	Helge Deller, JamesE.J.Bottomley

From: Steven Rostedt <rostedt@goodmis.org>
Subject: [RFC][PATCH] extable: Make sure all archs define _sdata
Date: Thu, 19 May 2011 21:34:58 -0400
> Can I get an Acked-by (or comment) from the following Maintainers:
> 
>   alpha
>   m32r
>   m68k
>   mips
>   parisc
> 
> Ingo has discovered that one of my patches broke the builds of these
> architectures. Although he added a quick fix, this patch supplies the
> proper fix and touches the affected architectures. Please review and Ack
> (or NACK with guidance) this patch.
> 
> -- Steve
> 
> A new utility function is used to determine if a passed in address is
> part of core kernel data or not. It may or may not return true for RO
> data, but this utility must work for RW data. Thus both _sdata and
> _edata must be defined and continuous, without .init sections that may
> later be freed and replaced by volatile memory (memory that can be
> freed).
> 
> This utility function is used to determine if data is safe from ever
> being freed. Thus it should return true for all RW global data that is
> not in a module or has been allocated, or false otherwise.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ----
>  arch/alpha/kernel/vmlinux.lds.S   |    1 +
>  arch/m32r/kernel/vmlinux.lds.S    |    1 +
>  arch/m68k/kernel/vmlinux-std.lds  |    2 ++
>  arch/m68k/kernel/vmlinux-sun3.lds |    1 +
>  arch/mips/kernel/vmlinux.lds.S    |    1 +
>  arch/parisc/kernel/vmlinux.lds.S  |    3 +++
>  kernel/extable.c                  |   12 +++++++++++-
>  7 files changed, 20 insertions(+), 1 deletion(-)

Acked-by: Hirokazu Takata <takata@linux-m32r.org>

Thank you.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC][PATCH] extable: Make sure all archs define _sdata
@ 2011-05-20  6:49   ` Hirokazu Takata
  0 siblings, 0 replies; 14+ messages in thread
From: Hirokazu Takata @ 2011-05-20  6:49 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Ingo Molnar, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, linux-alpha, Hirokazu Takata, Geert Uytterhoeven,
	Roman Zippel, linux-m68k, Ralf Baechle, Kyle McMartin,
	Helge Deller, JamesE.J.Bottomley

From: Steven Rostedt <rostedt@goodmis.org>
Subject: [RFC][PATCH] extable: Make sure all archs define _sdata
Date: Thu, 19 May 2011 21:34:58 -0400
> Can I get an Acked-by (or comment) from the following Maintainers:
> 
>   alpha
>   m32r
>   m68k
>   mips
>   parisc
> 
> Ingo has discovered that one of my patches broke the builds of these
> architectures. Although he added a quick fix, this patch supplies the
> proper fix and touches the affected architectures. Please review and Ack
> (or NACK with guidance) this patch.
> 
> -- Steve
> 
> A new utility function is used to determine if a passed in address is
> part of core kernel data or not. It may or may not return true for RO
> data, but this utility must work for RW data. Thus both _sdata and
> _edata must be defined and continuous, without .init sections that may
> later be freed and replaced by volatile memory (memory that can be
> freed).
> 
> This utility function is used to determine if data is safe from ever
> being freed. Thus it should return true for all RW global data that is
> not in a module or has been allocated, or false otherwise.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ----
>  arch/alpha/kernel/vmlinux.lds.S   |    1 +
>  arch/m32r/kernel/vmlinux.lds.S    |    1 +
>  arch/m68k/kernel/vmlinux-std.lds  |    2 ++
>  arch/m68k/kernel/vmlinux-sun3.lds |    1 +
>  arch/mips/kernel/vmlinux.lds.S    |    1 +
>  arch/parisc/kernel/vmlinux.lds.S  |    3 +++
>  kernel/extable.c                  |   12 +++++++++++-
>  7 files changed, 20 insertions(+), 1 deletion(-)

Acked-by: Hirokazu Takata <takata@linux-m32r.org>

Thank you.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [tip:perf/urgent] extable, core_kernel_data(): Make sure all archs define _sdata
  2011-05-20  1:34 ` Steven Rostedt
                   ` (3 preceding siblings ...)
  (?)
@ 2011-05-20  8:07 ` tip-bot for Steven Rostedt
  -1 siblings, 0 replies; 14+ messages in thread
From: tip-bot for Steven Rostedt @ 2011-05-20  8:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, kyle, geert, rostedt, ralf, jejb,
	mattst88, ink, tglx, takata, zippel, deller, rth, mingo

Commit-ID:  a2d063ac216c1618bfc2b4d40b7176adffa63511
Gitweb:     http://git.kernel.org/tip/a2d063ac216c1618bfc2b4d40b7176adffa63511
Author:     Steven Rostedt <rostedt@goodmis.org>
AuthorDate: Thu, 19 May 2011 21:34:58 -0400
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 20 May 2011 08:56:56 +0200

extable, core_kernel_data(): Make sure all archs define _sdata

A new utility function (core_kernel_data()) is used to determine if a
passed in address is part of core kernel data or not. It may or may not
return true for RO data, but this utility must work for RW data.

Thus both _sdata and _edata must be defined and continuous,
without .init sections that may later be freed and replaced by
volatile memory (memory that can be freed).

This utility function is used to determine if data is safe from
ever being freed. Thus it should return true for all RW global
data that is not in a module or has been allocated, or false
otherwise.

Also change core_kernel_data() back to the more precise _sdata condition
and document the function.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Hirokazu Takata <takata@linux-m32r.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Helge Deller <deller@gmx.de>
Cc: JamesE.J.Bottomley <jejb@parisc-linux.org>
Link: http://lkml.kernel.org/r/1305855298.1465.19.camel@gandalf.stny.rr.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
----
 arch/alpha/kernel/vmlinux.lds.S   |    1 +
 arch/m32r/kernel/vmlinux.lds.S    |    1 +
 arch/m68k/kernel/vmlinux-std.lds  |    2 ++
 arch/m68k/kernel/vmlinux-sun3.lds |    1 +
 arch/mips/kernel/vmlinux.lds.S    |    1 +
 arch/parisc/kernel/vmlinux.lds.S  |    3 +++
 kernel/extable.c                  |   12 +++++++++++-
 7 files changed, 20 insertions(+), 1 deletion(-)
---
 arch/alpha/kernel/vmlinux.lds.S   |    1 +
 arch/m32r/kernel/vmlinux.lds.S    |    1 +
 arch/m68k/kernel/vmlinux-std.lds  |    2 ++
 arch/m68k/kernel/vmlinux-sun3.lds |    1 +
 arch/mips/kernel/vmlinux.lds.S    |    1 +
 arch/parisc/kernel/vmlinux.lds.S  |    3 +++
 kernel/extable.c                  |   12 +++++++++++-
 7 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index 433be2a..3d890a9 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -46,6 +46,7 @@ SECTIONS
 	__init_end = .;
 	/* Freed after init ends here */
 
+	_sdata = .;	/* Start of rw data section */
 	_data = .;
 	RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
 
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index c194d64..cf95aec 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -44,6 +44,7 @@ SECTIONS
   EXCEPTION_TABLE(16)
   NOTES
 
+  _sdata = .;			/* Start of data section */
   RODATA
   RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
   _edata = .;			/* End of data section */
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 878be5f..d099359 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -25,6 +25,8 @@ SECTIONS
 
   EXCEPTION_TABLE(16)
 
+  _sdata = .;			/* Start of data section */
+
   RODATA
 
   RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE)
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 1ad6b7a..8080469 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -25,6 +25,7 @@ SECTIONS
   _etext = .;			/* End of text section */
 
   EXCEPTION_TABLE(16) :data
+  _sdata = .;			/* Start of rw data section */
   RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) :data
   /* End of data goes *here* so that freeing init code works properly. */
   _edata = .;
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index cd2ca54..01af387 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -65,6 +65,7 @@ SECTIONS
 	NOTES :text :note
 	.dummy : { *(.dummy) } :text
 
+	_sdata = .;			/* Start of data section */
 	RODATA
 
 	/* writeable */
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index 8f1e4ef..2d9a5c7 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -69,6 +69,9 @@ SECTIONS
 	/* End of text section */
 	_etext = .;
 
+	/* Start of data section */
+	_sdata = .;
+
 	RODATA
 
 	/* writeable */
diff --git a/kernel/extable.c b/kernel/extable.c
index d44aac0..5339705 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -72,9 +72,19 @@ int core_kernel_text(unsigned long addr)
 	return 0;
 }
 
+/**
+ * core_kernel_data - tell if addr points to kernel data
+ * @addr: address to test
+ *
+ * Returns true if @addr passed in is from the core kernel data
+ * section.
+ *
+ * Note: On some archs it may return true for core RODATA, and false
+ *  for others. But will always be true for core RW data.
+ */
 int core_kernel_data(unsigned long addr)
 {
-	if (addr >= (unsigned long)_stext &&
+	if (addr >= (unsigned long)_sdata &&
 	    addr < (unsigned long)_edata)
 		return 1;
 	return 0;

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [RFC][PATCH] extable: Make sure all archs define _sdata
  2011-05-20  1:34 ` Steven Rostedt
                   ` (4 preceding siblings ...)
  (?)
@ 2011-05-20 14:28 ` Richard Henderson
  2011-05-20 15:04   ` Steven Rostedt
  2011-05-20 20:21     ` Sam Ravnborg
  -1 siblings, 2 replies; 14+ messages in thread
From: Richard Henderson @ 2011-05-20 14:28 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Ingo Molnar, Ivan Kokshaysky, Matt Turner, linux-alpha,
	Hirokazu Takata, Geert Uytterhoeven, Roman Zippel, linux-m68k,
	Ralf Baechle, Kyle McMartin, Helge Deller, JamesE.J.Bottomley

On 05/19/2011 06:34 PM, Steven Rostedt wrote:
> Can I get an Acked-by (or comment) from the following Maintainers:
> 
>   alpha
>   m32r
>   m68k
>   mips
>   parisc
> 
> Ingo has discovered that one of my patches broke the builds of these
> architectures. Although he added a quick fix, this patch supplies the
> proper fix and touches the affected architectures. Please review and Ack
> (or NACK with guidance) this patch.
> 
> -- Steve
> 
> A new utility function is used to determine if a passed in address is
> part of core kernel data or not. It may or may not return true for RO
> data, but this utility must work for RW data. Thus both _sdata and
> _edata must be defined and continuous, without .init sections that may
> later be freed and replaced by volatile memory (memory that can be
> freed).
> 
> This utility function is used to determine if data is safe from ever
> being freed. Thus it should return true for all RW global data that is
> not in a module or has been allocated, or false otherwise.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Acked-by: Richard Henderson <rth@twiddle.net>

Although I suppose if we're supposedly standardizing on _sdata,
the two uses of _data in arch/alpha/mm/ could be transitioned.


r~

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC][PATCH] extable: Make sure all archs define _sdata
  2011-05-20  1:34 ` Steven Rostedt
@ 2011-05-20 14:42   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2011-05-20 14:42 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Ingo Molnar, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, linux-alpha, Hirokazu Takata, Roman Zippel,
	linux-m68k, Ralf Baechle, Kyle McMartin, Helge Deller,
	JamesE.J.Bottomley

On Fri, May 20, 2011 at 03:34, Steven Rostedt <rostedt@goodmis.org> wrote:
> Can I get an Acked-by (or comment) from the following Maintainers:

>  m68k

>  arch/m68k/kernel/vmlinux-std.lds  |    2 ++
>  arch/m68k/kernel/vmlinux-sun3.lds |    1 +

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC][PATCH] extable: Make sure all archs define _sdata
  2011-05-20  1:34 ` Steven Rostedt
                   ` (5 preceding siblings ...)
  (?)
@ 2011-05-20 14:42 ` Geert Uytterhoeven
  -1 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2011-05-20 14:42 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Ingo Molnar, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, linux-alpha, Hirokazu Takata, Roman Zippel,
	linux-m68k, Ralf Baechle, Kyle McMartin, Helge Deller,
	JamesE.J.Bottomley

On Fri, May 20, 2011 at 03:34, Steven Rostedt <rostedt@goodmis.org> wrote:
> Can I get an Acked-by (or comment) from the following Maintainers:

>  m68k

>  arch/m68k/kernel/vmlinux-std.lds  |    2 ++
>  arch/m68k/kernel/vmlinux-sun3.lds |    1 +

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC][PATCH] extable: Make sure all archs define _sdata
@ 2011-05-20 14:42   ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2011-05-20 14:42 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Ingo Molnar, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, linux-alpha, Hirokazu Takata, Roman Zippel,
	linux-m68k, Ralf Baechle, Kyle McMartin, Helge Deller,
	JamesE.J.Bottomley

On Fri, May 20, 2011 at 03:34, Steven Rostedt <rostedt@goodmis.org> wrote:
> Can I get an Acked-by (or comment) from the following Maintainers:

>  m68k

>  arch/m68k/kernel/vmlinux-std.lds  |    2 ++
>  arch/m68k/kernel/vmlinux-sun3.lds |    1 +

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-alpha" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC][PATCH] extable: Make sure all archs define _sdata
  2011-05-20 14:28 ` [RFC][PATCH] extable: " Richard Henderson
@ 2011-05-20 15:04   ` Steven Rostedt
  2011-05-20 20:21     ` Sam Ravnborg
  1 sibling, 0 replies; 14+ messages in thread
From: Steven Rostedt @ 2011-05-20 15:04 UTC (permalink / raw)
  To: Richard Henderson
  Cc: LKML, Ingo Molnar, Ivan Kokshaysky, Matt Turner, linux-alpha,
	Hirokazu Takata, Geert Uytterhoeven, Roman Zippel, linux-m68k,
	Ralf Baechle, Kyle McMartin, Helge Deller, JamesE.J.Bottomley

On Fri, 2011-05-20 at 07:28 -0700, Richard Henderson wrote:

> Although I suppose if we're supposedly standardizing on _sdata,
> the two uses of _data in arch/alpha/mm/ could be transitioned.
> 

If we start getting more uses of _sdata, then perhaps this would be a
good idea.

Currently I only need it to know if a pointer passed in to one of my
functions can be freed or not. If the pointer is pointing to a struct in
the core kernel data, it is safe from being freed. Anything else will
need the extra work to keep it safe (rcu logic and such) and takes a
path with a bit more overhead.

Thanks!

-- Steve



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC][PATCH] extable: Make sure all archs define _sdata
  2011-05-20 14:28 ` [RFC][PATCH] extable: " Richard Henderson
@ 2011-05-20 20:21     ` Sam Ravnborg
  2011-05-20 20:21     ` Sam Ravnborg
  1 sibling, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2011-05-20 20:21 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Steven Rostedt, LKML, Ingo Molnar, Ivan Kokshaysky, Matt Turner,
	linux-alpha, Hirokazu Takata, Geert Uytterhoeven, Roman Zippel,
	linux-m68k, Ralf Baechle, Kyle McMartin, Helge Deller,
	JamesE.J.Bottomley

> 
> Acked-by: Richard Henderson <rth@twiddle.net>
> 
> Although I suppose if we're supposedly standardizing on _sdata,
> the two uses of _data in arch/alpha/mm/ could be transitioned.

>From include/asm-generic/vmlinux.lds.h:

 *
 *      _sdata = .;
 *      RO_DATA_SECTION(PAGE_SIZE)
 *      RW_DATA_SECTION(...)
 *      _edata = .;
 *

So yes - we do standardize on _sdata.
Other symbols for the same ought to be replaced...

	Sam

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC][PATCH] extable: Make sure all archs define _sdata
@ 2011-05-20 20:21     ` Sam Ravnborg
  0 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2011-05-20 20:21 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Steven Rostedt, LKML, Ingo Molnar, Ivan Kokshaysky, Matt Turner,
	linux-alpha, Hirokazu Takata, Geert Uytterhoeven, Roman Zippel,
	linux-m68k, Ralf Baechle, Kyle McMartin, Helge Deller,
	JamesE.J.Bottomley

> 
> Acked-by: Richard Henderson <rth@twiddle.net>
> 
> Although I suppose if we're supposedly standardizing on _sdata,
> the two uses of _data in arch/alpha/mm/ could be transitioned.

From include/asm-generic/vmlinux.lds.h:

 *
 *      _sdata = .;
 *      RO_DATA_SECTION(PAGE_SIZE)
 *      RW_DATA_SECTION(...)
 *      _edata = .;
 *

So yes - we do standardize on _sdata.
Other symbols for the same ought to be replaced...

	Sam

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-05-20 20:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-20  1:34 [RFC][PATCH] extable: Make sure all archs define _sdata Steven Rostedt
2011-05-20  1:34 ` Steven Rostedt
2011-05-20  6:34 ` Ralf Baechle
2011-05-20  6:49 ` Hirokazu Takata
2011-05-20  6:49 ` Hirokazu Takata
2011-05-20  6:49   ` Hirokazu Takata
2011-05-20  8:07 ` [tip:perf/urgent] extable, core_kernel_data(): " tip-bot for Steven Rostedt
2011-05-20 14:28 ` [RFC][PATCH] extable: " Richard Henderson
2011-05-20 15:04   ` Steven Rostedt
2011-05-20 20:21   ` Sam Ravnborg
2011-05-20 20:21     ` Sam Ravnborg
2011-05-20 14:42 ` Geert Uytterhoeven
2011-05-20 14:42 ` Geert Uytterhoeven
2011-05-20 14:42   ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.