All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiang Liu <liuj97@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>
Cc: Jiang Liu <jiang.liu@huawei.com>,
	Wen Congyang <wency@cn.fujitsu.com>, Mel Gorman <mgorman@suse.de>,
	Minchan Kim <minchan@kernel.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Michal Hocko <mhocko@suse.cz>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	David Howells <dhowells@redhat.com>,
	Mark Salter <msalter@redhat.com>,
	Jianguo Wu <wujianguo@huawei.com>,
	linux-mm@kvack.org, linux-arch@vger.kernel.org,
	linux-kernel@vger.kernel.org, Chris Metcalf <cmetcalf@tilera.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH v3, part4 06/39] tile: normalize global variables exported by vmlinux.lds
Date: Tue, 26 Mar 2013 23:54:25 +0800	[thread overview]
Message-ID: <1364313298-17336-7-git-send-email-jiang.liu@huawei.com> (raw)
In-Reply-To: <1364313298-17336-1-git-send-email-jiang.liu@huawei.com>

Normalize global variables exported by vmlinux.lds to conform usage
guidelines from include/asm-generic/sections.h.

1) Use _text to mark the start of the kernel image including the head
text, and _stext to mark the start of the .text section.
2) Export mandatory global variables __init_begin and __init_end.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: David Howells <dhowells@redhat.com>
Cc: linux-kernel@vger.kernel.org
---
Hi all,
	Sorry for my mistake that my previous patch series has been screwed up.
So I regenerate a third version and also set up a git tree at:
	git://github.com/jiangliu/linux.git mem_init
	Any help to review and test are welcomed!

	Regards!
	Gerry
---
 arch/tile/include/asm/sections.h |    2 +-
 arch/tile/kernel/setup.c         |    4 ++--
 arch/tile/kernel/vmlinux.lds.S   |    4 +++-
 arch/tile/mm/init.c              |    2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/tile/include/asm/sections.h b/arch/tile/include/asm/sections.h
index d062d46..7d8a935 100644
--- a/arch/tile/include/asm/sections.h
+++ b/arch/tile/include/asm/sections.h
@@ -34,7 +34,7 @@ extern char __sys_cmpxchg_grab_lock[];
 extern char __start_atomic_asm_code[], __end_atomic_asm_code[];
 #endif
 
-/* Handle the discontiguity between _sdata and _stext. */
+/* Handle the discontiguity between _sdata and _text. */
 static inline int arch_is_kernel_data(unsigned long addr)
 {
 	return addr >= (unsigned long)_sdata &&
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c
index d1e15f7..a986b71 100644
--- a/arch/tile/kernel/setup.c
+++ b/arch/tile/kernel/setup.c
@@ -307,8 +307,8 @@ static void __cpuinit store_permanent_mappings(void)
 		hv_store_mapping(addr, pages << PAGE_SHIFT, pa);
 	}
 
-	hv_store_mapping((HV_VirtAddr)_stext,
-			 (uint32_t)(_einittext - _stext), 0);
+	hv_store_mapping((HV_VirtAddr)_text,
+			 (uint32_t)(_einittext - _text), 0);
 }
 
 /*
diff --git a/arch/tile/kernel/vmlinux.lds.S b/arch/tile/kernel/vmlinux.lds.S
index 631f10d..a13ed90 100644
--- a/arch/tile/kernel/vmlinux.lds.S
+++ b/arch/tile/kernel/vmlinux.lds.S
@@ -27,7 +27,6 @@ SECTIONS
   .intrpt1 (LOAD_OFFSET) : AT ( 0 )   /* put at the start of physical memory */
   {
     _text = .;
-    _stext = .;
     *(.intrpt1)
   } :intrpt1 =0
 
@@ -36,6 +35,7 @@ SECTIONS
 
   /* Now the real code */
   . = ALIGN(0x20000);
+  _stext = .;
   .text : AT (ADDR(.text) - LOAD_OFFSET) {
     HEAD_TEXT
     SCHED_TEXT
@@ -58,11 +58,13 @@ SECTIONS
   #define LOAD_OFFSET PAGE_OFFSET
 
   . = ALIGN(PAGE_SIZE);
+  __init_begin = .;
   VMLINUX_SYMBOL(_sinitdata) = .;
   INIT_DATA_SECTION(16) :data =0
   PERCPU_SECTION(L2_CACHE_BYTES)
   . = ALIGN(PAGE_SIZE);
   VMLINUX_SYMBOL(_einitdata) = .;
+  __init_end = .;
 
   _sdata = .;                   /* Start of data section */
 
diff --git a/arch/tile/mm/init.c b/arch/tile/mm/init.c
index 45ce26d..f2ac2f4 100644
--- a/arch/tile/mm/init.c
+++ b/arch/tile/mm/init.c
@@ -562,7 +562,7 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
 			prot = ktext_set_nocache(prot);
 		}
 
-		BUG_ON(address != (unsigned long)_stext);
+		BUG_ON(address != (unsigned long)_text);
 		pte = NULL;
 		for (; address < (unsigned long)_einittext;
 		     pfn++, address += PAGE_SIZE) {
-- 
1.7.9.5


WARNING: multiple messages have this Message-ID (diff)
From: Jiang Liu <liuj97@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>
Cc: Jiang Liu <jiang.liu@huawei.com>,
	Wen Congyang <wency@cn.fujitsu.com>, Mel Gorman <mgorman@suse.de>,
	Minchan Kim <minchan@kernel.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Michal Hocko <mhocko@suse.cz>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	David Howells <dhowells@redhat.com>,
	Mark Salter <msalter@redhat.com>,
	Jianguo Wu <wujianguo@huawei.com>,
	linux-mm@kvack.org, linux-arch@vger.kernel.org,
	linux-kernel@vger.kernel.org, Chris Metcalf <cmetcalf@tilera.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH v3, part4 06/39] tile: normalize global variables exported by vmlinux.lds
Date: Tue, 26 Mar 2013 23:54:25 +0800	[thread overview]
Message-ID: <1364313298-17336-7-git-send-email-jiang.liu@huawei.com> (raw)
In-Reply-To: <1364313298-17336-1-git-send-email-jiang.liu@huawei.com>

Normalize global variables exported by vmlinux.lds to conform usage
guidelines from include/asm-generic/sections.h.

1) Use _text to mark the start of the kernel image including the head
text, and _stext to mark the start of the .text section.
2) Export mandatory global variables __init_begin and __init_end.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: David Howells <dhowells@redhat.com>
Cc: linux-kernel@vger.kernel.org
---
Hi all,
	Sorry for my mistake that my previous patch series has been screwed up.
So I regenerate a third version and also set up a git tree at:
	git://github.com/jiangliu/linux.git mem_init
	Any help to review and test are welcomed!

	Regards!
	Gerry
---
 arch/tile/include/asm/sections.h |    2 +-
 arch/tile/kernel/setup.c         |    4 ++--
 arch/tile/kernel/vmlinux.lds.S   |    4 +++-
 arch/tile/mm/init.c              |    2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/tile/include/asm/sections.h b/arch/tile/include/asm/sections.h
index d062d46..7d8a935 100644
--- a/arch/tile/include/asm/sections.h
+++ b/arch/tile/include/asm/sections.h
@@ -34,7 +34,7 @@ extern char __sys_cmpxchg_grab_lock[];
 extern char __start_atomic_asm_code[], __end_atomic_asm_code[];
 #endif
 
-/* Handle the discontiguity between _sdata and _stext. */
+/* Handle the discontiguity between _sdata and _text. */
 static inline int arch_is_kernel_data(unsigned long addr)
 {
 	return addr >= (unsigned long)_sdata &&
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c
index d1e15f7..a986b71 100644
--- a/arch/tile/kernel/setup.c
+++ b/arch/tile/kernel/setup.c
@@ -307,8 +307,8 @@ static void __cpuinit store_permanent_mappings(void)
 		hv_store_mapping(addr, pages << PAGE_SHIFT, pa);
 	}
 
-	hv_store_mapping((HV_VirtAddr)_stext,
-			 (uint32_t)(_einittext - _stext), 0);
+	hv_store_mapping((HV_VirtAddr)_text,
+			 (uint32_t)(_einittext - _text), 0);
 }
 
 /*
diff --git a/arch/tile/kernel/vmlinux.lds.S b/arch/tile/kernel/vmlinux.lds.S
index 631f10d..a13ed90 100644
--- a/arch/tile/kernel/vmlinux.lds.S
+++ b/arch/tile/kernel/vmlinux.lds.S
@@ -27,7 +27,6 @@ SECTIONS
   .intrpt1 (LOAD_OFFSET) : AT ( 0 )   /* put at the start of physical memory */
   {
     _text = .;
-    _stext = .;
     *(.intrpt1)
   } :intrpt1 =0
 
@@ -36,6 +35,7 @@ SECTIONS
 
   /* Now the real code */
   . = ALIGN(0x20000);
+  _stext = .;
   .text : AT (ADDR(.text) - LOAD_OFFSET) {
     HEAD_TEXT
     SCHED_TEXT
@@ -58,11 +58,13 @@ SECTIONS
   #define LOAD_OFFSET PAGE_OFFSET
 
   . = ALIGN(PAGE_SIZE);
+  __init_begin = .;
   VMLINUX_SYMBOL(_sinitdata) = .;
   INIT_DATA_SECTION(16) :data =0
   PERCPU_SECTION(L2_CACHE_BYTES)
   . = ALIGN(PAGE_SIZE);
   VMLINUX_SYMBOL(_einitdata) = .;
+  __init_end = .;
 
   _sdata = .;                   /* Start of data section */
 
diff --git a/arch/tile/mm/init.c b/arch/tile/mm/init.c
index 45ce26d..f2ac2f4 100644
--- a/arch/tile/mm/init.c
+++ b/arch/tile/mm/init.c
@@ -562,7 +562,7 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
 			prot = ktext_set_nocache(prot);
 		}
 
-		BUG_ON(address != (unsigned long)_stext);
+		BUG_ON(address != (unsigned long)_text);
 		pte = NULL;
 		for (; address < (unsigned long)_einittext;
 		     pfn++, address += PAGE_SIZE) {
-- 
1.7.9.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2013-03-26 15:57 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 15:54 [PATCH v3, part4 00/39] Simplify mem_init() implementations and kill num_physpages Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 01/39] vmlinux.lds: add comments for global variables and clean up useless declarations Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 02/39] avr32: normalize global variables exported by vmlinux.lds Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 03/39] c6x: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 04/39] h8300: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 05/39] score: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` Jiang Liu [this message]
2013-03-26 15:54   ` [PATCH v3, part4 06/39] tile: " Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 07/39] UML: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 08/39] mm: introduce helper function mem_init_print_info() to simplify mem_init() Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 09/39] mm: use totalram_pages instead of num_physpages at runtime Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 10/39] mm/alpha: prepare for removing num_physpages and simplify mem_init() Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 11/39] mm/ARM: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 12/39] mm/ARM64: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 13/39] mm/AVR32: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 14/39] mm/blackfin: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 15/39] mm/c6x: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 16/39] mm/cris: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 17/39] mm/frv: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 18/39] mm/h8300: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 19/39] mm/hexagon: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 20/39] mm/IA64: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 21/39] mm/m32r: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 22/39] mm/m68k: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 23/39] mm/microblaze: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 24/39] mm/MIPS: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 25/39] mm/mn10300: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 26/39] mm/openrisc: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-04-02  5:31   ` Jonas Bonn
2013-04-02  5:31     ` Jonas Bonn
2013-04-02  5:31     ` Jonas Bonn
2013-04-02  5:31     ` Jonas Bonn
2013-04-02 14:38     ` Jiang Liu
2013-04-02 14:38       ` Jiang Liu
2013-04-02 14:38       ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 27/39] mm/PARISC: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 28/39] mm/ppc: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 29/39] mm/s390: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 30/39] mm/score: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 31/39] mm/SH: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 32/39] mm/SPARC: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-29 16:17   ` Sam Ravnborg
2013-03-29 16:17     ` Sam Ravnborg
2013-03-29 16:17     ` Sam Ravnborg
2013-03-26 15:54 ` [PATCH v3, part4 33/39] mm/tile: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 34/39] mm/um: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 35/39] mm/unicore32: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 36/39] mm/x86: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 37/39] mm/xtensa: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 38/39] mm/hotplug: prepare for removing num_physpages Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-29 11:18   ` Sam Ravnborg
2013-03-29 11:18     ` Sam Ravnborg
2013-03-29 15:36     ` Jiang Liu
2013-03-29 15:36       ` Jiang Liu
2013-03-29 16:17       ` Sam Ravnborg
2013-03-29 16:17         ` Sam Ravnborg
2013-03-29 16:30         ` Jiang Liu
2013-03-29 16:30           ` Jiang Liu
2013-03-29 16:40           ` Sam Ravnborg
2013-03-29 16:40             ` Sam Ravnborg
2013-03-29 16:42             ` Jiang Liu
2013-03-29 16:42               ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 39/39] mm: kill global variable num_physpages Jiang Liu
2013-03-26 15:54   ` Jiang Liu

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=1364313298-17336-7-git-send-email-jiang.liu@huawei.com \
    --to=liuj97@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhelgaas@google.com \
    --cc=cmetcalf@tilera.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=jiang.liu@huawei.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.cz \
    --cc=minchan@kernel.org \
    --cc=msalter@redhat.com \
    --cc=rientjes@google.com \
    --cc=rusty@rustcorp.com.au \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=wency@cn.fujitsu.com \
    --cc=wujianguo@huawei.com \
    /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 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.