All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] microblaze: Use the common INIT_DATA_SECTION macro in vmlinux.lds.S
@ 2020-11-19  1:40 Youling Tang
  2020-11-20 13:31 ` Michal Simek
  0 siblings, 1 reply; 3+ messages in thread
From: Youling Tang @ 2020-11-19  1:40 UTC (permalink / raw)
  To: Michal Simek, Stefan Asserhall, Arnd Bergmann; +Cc: linux-kernel

Use the common INIT_DATA_SECTION rule for the linker script in an effort
to regularize the linker script.

Signed-off-by: Youling Tang <tangyouling@loongson.cn>
---
 arch/microblaze/kernel/vmlinux.lds.S | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
index df07b3d..527ebfc 100644
--- a/arch/microblaze/kernel/vmlinux.lds.S
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -96,10 +96,7 @@ SECTIONS {
 	__init_begin = .;
 
 	INIT_TEXT_SECTION(PAGE_SIZE)
-
-	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
-		INIT_DATA
-	}
+	INIT_DATA_SECTION(0)
 
 	. = ALIGN(4);
 	.init.ivt : AT(ADDR(.init.ivt) - LOAD_OFFSET) {
@@ -107,25 +104,6 @@ SECTIONS {
 		*(.init.ivt)
 		__ivt_end = .;
 	}
-
-	.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
-		INIT_SETUP(0)
-	}
-
-	.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET ) {
-		INIT_CALLS
-	}
-
-	.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
-		CON_INITCALL
-	}
-
-	__init_end_before_initramfs = .;
-
-	.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
-		INIT_RAM_FS
-	}
-
 	__init_end = .;
 
 	.bss ALIGN (PAGE_SIZE) : AT(ADDR(.bss) - LOAD_OFFSET) {
-- 
2.1.0


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

* Re: [PATCH] microblaze: Use the common INIT_DATA_SECTION macro in vmlinux.lds.S
  2020-11-19  1:40 [PATCH] microblaze: Use the common INIT_DATA_SECTION macro in vmlinux.lds.S Youling Tang
@ 2020-11-20 13:31 ` Michal Simek
  2020-11-21  1:25   ` Youling Tang
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Simek @ 2020-11-20 13:31 UTC (permalink / raw)
  To: Youling Tang, Stefan Asserhall, Arnd Bergmann; +Cc: linux-kernel

Hi,

On 19. 11. 20 2:40, Youling Tang wrote:
> Use the common INIT_DATA_SECTION rule for the linker script in an effort
> to regularize the linker script.
> 
> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
> ---
>  arch/microblaze/kernel/vmlinux.lds.S | 24 +-----------------------
>  1 file changed, 1 insertion(+), 23 deletions(-)
> 
> diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
> index df07b3d..527ebfc 100644
> --- a/arch/microblaze/kernel/vmlinux.lds.S
> +++ b/arch/microblaze/kernel/vmlinux.lds.S
> @@ -96,10 +96,7 @@ SECTIONS {
>  	__init_begin = .;
>  
>  	INIT_TEXT_SECTION(PAGE_SIZE)
> -
> -	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
> -		INIT_DATA
> -	}
> +	INIT_DATA_SECTION(0)
>  
>  	. = ALIGN(4);
>  	.init.ivt : AT(ADDR(.init.ivt) - LOAD_OFFSET) {
> @@ -107,25 +104,6 @@ SECTIONS {
>  		*(.init.ivt)
>  		__ivt_end = .;
>  	}
> -
> -	.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
> -		INIT_SETUP(0)
> -	}
> -
> -	.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET ) {
> -		INIT_CALLS
> -	}
> -
> -	.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
> -		CON_INITCALL
> -	}
> -
> -	__init_end_before_initramfs = .;
> -
> -	.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
> -		INIT_RAM_FS
> -	}
> -
>  	__init_end = .;
>  
>  	.bss ALIGN (PAGE_SIZE) : AT(ADDR(.bss) - LOAD_OFFSET) {
> 

Thanks for the patch but I can't accept it because recently we found
that there needs to be some resorting in linker to be able to boot.
The issue is that INIT_RAMFS_FS section is text/data/init and bss.
But because microblaze in early code is using two TLBs (16M) each for
early mapping and you have big initramfs bss section is unreachable.
That's why these sections needs to be swapped.
Maybe bss section can be moved up before INIT_DATA_SECTION maybe even
before INIT_TEXT_SECTION and we should be fine.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs




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

* Re: [PATCH] microblaze: Use the common INIT_DATA_SECTION macro in vmlinux.lds.S
  2020-11-20 13:31 ` Michal Simek
@ 2020-11-21  1:25   ` Youling Tang
  0 siblings, 0 replies; 3+ messages in thread
From: Youling Tang @ 2020-11-21  1:25 UTC (permalink / raw)
  To: Michal Simek; +Cc: Stefan Asserhall, Arnd Bergmann, linux-kernel

Hi, Michal

On 11/20/2020 09:31 PM, Michal Simek wrote:
> Hi,
>
> On 19. 11. 20 2:40, Youling Tang wrote:
>> Use the common INIT_DATA_SECTION rule for the linker script in an effort
>> to regularize the linker script.
>>
>> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
>> ---
>>   arch/microblaze/kernel/vmlinux.lds.S | 24 +-----------------------
>>   1 file changed, 1 insertion(+), 23 deletions(-)
>>
>> diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
>> index df07b3d..527ebfc 100644
>> --- a/arch/microblaze/kernel/vmlinux.lds.S
>> +++ b/arch/microblaze/kernel/vmlinux.lds.S
>> @@ -96,10 +96,7 @@ SECTIONS {
>>   	__init_begin = .;
>>   
>>   	INIT_TEXT_SECTION(PAGE_SIZE)
>> -
>> -	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
>> -		INIT_DATA
>> -	}
>> +	INIT_DATA_SECTION(0)
>>   
>>   	. = ALIGN(4);
>>   	.init.ivt : AT(ADDR(.init.ivt) - LOAD_OFFSET) {
>> @@ -107,25 +104,6 @@ SECTIONS {
>>   		*(.init.ivt)
>>   		__ivt_end = .;
>>   	}
>> -
>> -	.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
>> -		INIT_SETUP(0)
>> -	}
>> -
>> -	.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET ) {
>> -		INIT_CALLS
>> -	}
>> -
>> -	.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
>> -		CON_INITCALL
>> -	}
>> -
>> -	__init_end_before_initramfs = .;
>> -
>> -	.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
>> -		INIT_RAM_FS
>> -	}
>> -
>>   	__init_end = .;
>>   
>>   	.bss ALIGN (PAGE_SIZE) : AT(ADDR(.bss) - LOAD_OFFSET) {
>>
> Thanks for the patch but I can't accept it because recently we found
> that there needs to be some resorting in linker to be able to boot.
> The issue is that INIT_RAMFS_FS section is text/data/init and bss.
> But because microblaze in early code is using two TLBs (16M) each for
> early mapping and you have big initramfs bss section is unreachable.
> That's why these sections needs to be swapped.
> Maybe bss section can be moved up before INIT_DATA_SECTION maybe even
> before INIT_TEXT_SECTION and we should be fine.
Thank you for your reply. Do you mean it should be changed as follows:
...
.bss ALIGN (PAGE_SIZE) : AT(ADDR(.bss) - LOAD_OFFSET) {
                 /* page aligned when MMU used */
                 __bss_start = . ;
                         *(.bss*)
                         *(COMMON)
                 . = ALIGN (4) ;
                 __bss_stop = . ;
         }
INIT_TEXT_SECTION(PAGE_SIZE)
INIT_DATA_SECTION(0)
...

Thanks,
Youling
> Thanks,
> Michal
>


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

end of thread, other threads:[~2020-11-21  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19  1:40 [PATCH] microblaze: Use the common INIT_DATA_SECTION macro in vmlinux.lds.S Youling Tang
2020-11-20 13:31 ` Michal Simek
2020-11-21  1:25   ` Youling Tang

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.