mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] [MIPS] Place __kernel_entry at the beginning of text section
@ 2024-11-26 17:34 Rong Xu
  2024-11-26 17:39 ` Rong Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rong Xu @ 2024-11-26 17:34 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Masahiro Yamada, Klara Modin, Rong Xu,
	Christophe Leroy, Michael Ellerman, Nicolas Schier,
	Chris Packham, Maciej W. Rozycki, linux-mips, linux-kernel

Mark __kernel_entry as ".head.text" and place HEAD_TEXT before
TEXT_TEXT in the linker script. This ensures that __kernel_entry
will be placed at the beginning of text section.

Drop mips from scripts/head-object-list.txt.

Signed-off-by: Rong Xu <xur@google.com>
Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Closes: https://lore.kernel.org/lkml/c6719149-8531-4174-824e-a3caf4bc6d0e@alliedtelesis.co.nz/T/
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
 arch/mips/kernel/head.S        | 1 +
 arch/mips/kernel/vmlinux.lds.S | 1 +
 scripts/head-object-list.txt   | 1 -
 3 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index e90695b2b60e..c7528d96dd1a 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -59,6 +59,7 @@
 #endif
 	.endm
 
+	__HEAD
 #ifndef CONFIG_NO_EXCEPT_FILL
 	/*
 	 * Reserved space for exception handlers.
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index d575f945d422..c9c1ba85ac7b 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -62,6 +62,7 @@ SECTIONS
 	_text = .;	/* Text and read-only data */
 	_stext = .;
 	.text : {
+		HEAD_TEXT
 		TEXT_TEXT
 		SCHED_TEXT
 		LOCK_TEXT
diff --git a/scripts/head-object-list.txt b/scripts/head-object-list.txt
index fd5d00bac447..f12b4a7b8406 100644
--- a/scripts/head-object-list.txt
+++ b/scripts/head-object-list.txt
@@ -23,7 +23,6 @@ arch/m68k/coldfire/head.o
 arch/m68k/kernel/head.o
 arch/m68k/kernel/sun3-head.o
 arch/microblaze/kernel/head.o
-arch/mips/kernel/head.o
 arch/nios2/kernel/head.o
 arch/openrisc/kernel/head.o
 arch/parisc/kernel/head.o

base-commit: 3596c721c4348b2a964e43f9296a0c01509ba927
-- 
2.47.0.338.g60cca15819-goog


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

* Re: [PATCH v2] [MIPS] Place __kernel_entry at the beginning of text section
  2024-11-26 17:34 [PATCH v2] [MIPS] Place __kernel_entry at the beginning of text section Rong Xu
@ 2024-11-26 17:39 ` Rong Xu
  2024-11-27  0:41 ` Masahiro Yamada
  2024-12-02 17:58 ` Maciej W. Rozycki
  2 siblings, 0 replies; 5+ messages in thread
From: Rong Xu @ 2024-11-26 17:39 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Masahiro Yamada, Klara Modin, Rong Xu,
	Christophe Leroy, Michael Ellerman, Nicolas Schier,
	Chris Packham, Maciej W. Rozycki, linux-mips, linux-kernel

I forgot to add the changelog for this V2: The change was to move __HEAD
down based on Chris Packham's review.

-Rong

On Tue, Nov 26, 2024 at 9:34 AM Rong Xu <xur@google.com> wrote:
>
> Mark __kernel_entry as ".head.text" and place HEAD_TEXT before
> TEXT_TEXT in the linker script. This ensures that __kernel_entry
> will be placed at the beginning of text section.
>
> Drop mips from scripts/head-object-list.txt.
>
> Signed-off-by: Rong Xu <xur@google.com>
> Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Closes: https://lore.kernel.org/lkml/c6719149-8531-4174-824e-a3caf4bc6d0e@alliedtelesis.co.nz/T/
> Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
>  arch/mips/kernel/head.S        | 1 +
>  arch/mips/kernel/vmlinux.lds.S | 1 +
>  scripts/head-object-list.txt   | 1 -
>  3 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
> index e90695b2b60e..c7528d96dd1a 100644
> --- a/arch/mips/kernel/head.S
> +++ b/arch/mips/kernel/head.S
> @@ -59,6 +59,7 @@
>  #endif
>         .endm
>
> +       __HEAD
>  #ifndef CONFIG_NO_EXCEPT_FILL
>         /*
>          * Reserved space for exception handlers.
> diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
> index d575f945d422..c9c1ba85ac7b 100644
> --- a/arch/mips/kernel/vmlinux.lds.S
> +++ b/arch/mips/kernel/vmlinux.lds.S
> @@ -62,6 +62,7 @@ SECTIONS
>         _text = .;      /* Text and read-only data */
>         _stext = .;
>         .text : {
> +               HEAD_TEXT
>                 TEXT_TEXT
>                 SCHED_TEXT
>                 LOCK_TEXT
> diff --git a/scripts/head-object-list.txt b/scripts/head-object-list.txt
> index fd5d00bac447..f12b4a7b8406 100644
> --- a/scripts/head-object-list.txt
> +++ b/scripts/head-object-list.txt
> @@ -23,7 +23,6 @@ arch/m68k/coldfire/head.o
>  arch/m68k/kernel/head.o
>  arch/m68k/kernel/sun3-head.o
>  arch/microblaze/kernel/head.o
> -arch/mips/kernel/head.o
>  arch/nios2/kernel/head.o
>  arch/openrisc/kernel/head.o
>  arch/parisc/kernel/head.o
>
> base-commit: 3596c721c4348b2a964e43f9296a0c01509ba927
> --
> 2.47.0.338.g60cca15819-goog
>

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

* Re: [PATCH v2] [MIPS] Place __kernel_entry at the beginning of text section
  2024-11-26 17:34 [PATCH v2] [MIPS] Place __kernel_entry at the beginning of text section Rong Xu
  2024-11-26 17:39 ` Rong Xu
@ 2024-11-27  0:41 ` Masahiro Yamada
  2024-12-02 17:58 ` Maciej W. Rozycki
  2 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2024-11-27  0:41 UTC (permalink / raw)
  To: Rong Xu
  Cc: Thomas Bogendoerfer, Klara Modin, Christophe Leroy,
	Michael Ellerman, Nicolas Schier, Chris Packham,
	Maciej W. Rozycki, linux-mips, linux-kernel

On Wed, Nov 27, 2024 at 2:34 AM Rong Xu <xur@google.com> wrote:
>
> Mark __kernel_entry as ".head.text" and place HEAD_TEXT before
> TEXT_TEXT in the linker script. This ensures that __kernel_entry
> will be placed at the beginning of text section.
>
> Drop mips from scripts/head-object-list.txt.
>
> Signed-off-by: Rong Xu <xur@google.com>
> Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Closes: https://lore.kernel.org/lkml/c6719149-8531-4174-824e-a3caf4bc6d0e@alliedtelesis.co.nz/T/
> Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>


Applied to linux-kbuild.
(Inserted before the offending commit)

Thanks!



-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH v2] [MIPS] Place __kernel_entry at the beginning of text section
  2024-11-26 17:34 [PATCH v2] [MIPS] Place __kernel_entry at the beginning of text section Rong Xu
  2024-11-26 17:39 ` Rong Xu
  2024-11-27  0:41 ` Masahiro Yamada
@ 2024-12-02 17:58 ` Maciej W. Rozycki
  2024-12-02 18:20   ` Rong Xu
  2 siblings, 1 reply; 5+ messages in thread
From: Maciej W. Rozycki @ 2024-12-02 17:58 UTC (permalink / raw)
  To: Rong Xu
  Cc: Thomas Bogendoerfer, Masahiro Yamada, Klara Modin,
	Christophe Leroy, Michael Ellerman, Nicolas Schier,
	Chris Packham, linux-mips, linux-kernel

On Tue, 26 Nov 2024, Rong Xu wrote:

> diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
> index e90695b2b60e..c7528d96dd1a 100644
> --- a/arch/mips/kernel/head.S
> +++ b/arch/mips/kernel/head.S
> @@ -59,6 +59,7 @@
>  #endif
>  	.endm
>  
> +	__HEAD
>  #ifndef CONFIG_NO_EXCEPT_FILL
>  	/*
>  	 * Reserved space for exception handlers.

 A new line would be preferable afterwards so as to visually separate the 
directive from the conditional part that follows.  It looks messy as it 
stands (and we have prior art further down the file with __REF).  Please 
send a fix.

  Maciej

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

* Re: [PATCH v2] [MIPS] Place __kernel_entry at the beginning of text section
  2024-12-02 17:58 ` Maciej W. Rozycki
@ 2024-12-02 18:20   ` Rong Xu
  0 siblings, 0 replies; 5+ messages in thread
From: Rong Xu @ 2024-12-02 18:20 UTC (permalink / raw)
  To: Maciej W. Rozycki
  Cc: Thomas Bogendoerfer, Masahiro Yamada, Klara Modin,
	Christophe Leroy, Michael Ellerman, Nicolas Schier,
	Chris Packham, linux-mips, linux-kernel

Sure. I'll send a separate patch for this format change (not v3 as
this patch was already submitted).

Thanks!

-Rong

On Mon, Dec 2, 2024 at 9:58 AM Maciej W. Rozycki <macro@orcam.me.uk> wrote:
>
> On Tue, 26 Nov 2024, Rong Xu wrote:
>
> > diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
> > index e90695b2b60e..c7528d96dd1a 100644
> > --- a/arch/mips/kernel/head.S
> > +++ b/arch/mips/kernel/head.S
> > @@ -59,6 +59,7 @@
> >  #endif
> >       .endm
> >
> > +     __HEAD
> >  #ifndef CONFIG_NO_EXCEPT_FILL
> >       /*
> >        * Reserved space for exception handlers.
>
>  A new line would be preferable afterwards so as to visually separate the
> directive from the conditional part that follows.  It looks messy as it
> stands (and we have prior art further down the file with __REF).  Please
> send a fix.
>
>   Maciej

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

end of thread, other threads:[~2024-12-02 18:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-26 17:34 [PATCH v2] [MIPS] Place __kernel_entry at the beginning of text section Rong Xu
2024-11-26 17:39 ` Rong Xu
2024-11-27  0:41 ` Masahiro Yamada
2024-12-02 17:58 ` Maciej W. Rozycki
2024-12-02 18:20   ` Rong Xu

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®