diff mbox series

linker_lists: set LINKER_LIST_ALIGN to 8 if 64BIT

Message ID 20241007094206.2928071-1-jerome.forissier@linaro.org
State New
Headers show
Series linker_lists: set LINKER_LIST_ALIGN to 8 if 64BIT | expand

Commit Message

Jérôme Forissier Oct. 7, 2024, 9:42 a.m. UTC
CPU_MIPS64 needs 8-byte alignment on the linker lists, otherwise an
exception may occur. In fact all 64BIT architectures should default
to 8; that's what this patch does.
Fixes an issue found on malta64 with QEMU:

 Breakpoint 1, lists_driver_lookup_name (name=0xffffffffbe043578 "root_driver") at /home/uboot/u-boot/drivers/core/lists.c:31
 31                      if (!strcmp(name, entry->name))
 [...]
 ld      a1,0(s0)

 (gdb) p/x &entry->name
 0xffffffffbe04b0d4
 (gdb) p/x $s0
 0xffffffffbe04b0d4

 $ grep __u_boot_list /tmp/malta64/u-boot.objdump
 4 __u_boot_list 000018e0  ffffffffbe04a4d4  ffffffffbe04a4d4  0004a584  2**2

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
---
 arch/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ilias Apalodimas Oct. 7, 2024, 9:50 a.m. UTC | #1
On Mon, 7 Oct 2024 at 12:42, Jerome Forissier
<jerome.forissier@linaro.org> wrote:
>
> CPU_MIPS64 needs 8-byte alignment on the linker lists, otherwise an
> exception may occur. In fact all 64BIT architectures should default
> to 8; that's what this patch does.
> Fixes an issue found on malta64 with QEMU:
>
>  Breakpoint 1, lists_driver_lookup_name (name=0xffffffffbe043578 "root_driver") at /home/uboot/u-boot/drivers/core/lists.c:31
>  31                      if (!strcmp(name, entry->name))
>  [...]
>  ld      a1,0(s0)
>
>  (gdb) p/x &entry->name
>  0xffffffffbe04b0d4
>  (gdb) p/x $s0
>  0xffffffffbe04b0d4
>
>  $ grep __u_boot_list /tmp/malta64/u-boot.objdump
>  4 __u_boot_list 000018e0  ffffffffbe04a4d4  ffffffffbe04a4d4  0004a584  2**2
>
> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
> ---
>  arch/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/Kconfig b/arch/Kconfig
> index 8f1f4667012..72bf4029251 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -45,7 +45,7 @@ config SYS_CACHELINE_SIZE
>  config LINKER_LIST_ALIGN
>         int
>         default 32 if SANDBOX
> -       default 8 if ARM64 || X86
> +       default 8 if 64BIT
>         default 4
>         help
>           Force the each linker list to be aligned to this boundary. This
> --
> 2.40.1
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Jérôme Forissier Oct. 7, 2024, 12:55 p.m. UTC | #2
On 10/7/24 11:42, Jerome Forissier wrote:
> CPU_MIPS64 needs 8-byte alignment on the linker lists, otherwise an
> exception may occur. In fact all 64BIT architectures should default
> to 8; that's what this patch does.
> Fixes an issue found on malta64 with QEMU:
> 
>  Breakpoint 1, lists_driver_lookup_name (name=0xffffffffbe043578 "root_driver") at /home/uboot/u-boot/drivers/core/lists.c:31
>  31                      if (!strcmp(name, entry->name))
>  [...]
>  ld      a1,0(s0)
> 
>  (gdb) p/x &entry->name
>  0xffffffffbe04b0d4
>  (gdb) p/x $s0
>  0xffffffffbe04b0d4
> 
>  $ grep __u_boot_list /tmp/malta64/u-boot.objdump
>  4 __u_boot_list 000018e0  ffffffffbe04a4d4  ffffffffbe04a4d4  0004a584  2**2
> 
> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
> ---
>  arch/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/Kconfig b/arch/Kconfig
> index 8f1f4667012..72bf4029251 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -45,7 +45,7 @@ config SYS_CACHELINE_SIZE
>  config LINKER_LIST_ALIGN
>  	int
>  	default 32 if SANDBOX
> -	default 8 if ARM64 || X86
> +	default 8 if 64BIT
>  	default 4
>  	help
>  	  Force the each linker list to be aligned to this boundary. This

Superseded by https://patchwork.ozlabs.org/project/uboot/patch/20241007094206.2928071-1-jerome.forissier@linaro.org/

Thanks,
Heinrich Schuchardt Oct. 7, 2024, 1:31 p.m. UTC | #3
On 07.10.24 14:55, Jerome Forissier wrote:
>
>
> On 10/7/24 11:42, Jerome Forissier wrote:
>> CPU_MIPS64 needs 8-byte alignment on the linker lists, otherwise an
>> exception may occur. In fact all 64BIT architectures should default
>> to 8; that's what this patch does.
>> Fixes an issue found on malta64 with QEMU:
>>
>>   Breakpoint 1, lists_driver_lookup_name (name=0xffffffffbe043578 "root_driver") at /home/uboot/u-boot/drivers/core/lists.c:31
>>   31                      if (!strcmp(name, entry->name))
>>   [...]
>>   ld      a1,0(s0)
>>
>>   (gdb) p/x &entry->name
>>   0xffffffffbe04b0d4
>>   (gdb) p/x $s0
>>   0xffffffffbe04b0d4
>>
>>   $ grep __u_boot_list /tmp/malta64/u-boot.objdump
>>   4 __u_boot_list 000018e0  ffffffffbe04a4d4  ffffffffbe04a4d4  0004a584  2**2
>>
>> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
>> ---
>>   arch/Kconfig | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/Kconfig b/arch/Kconfig
>> index 8f1f4667012..72bf4029251 100644
>> --- a/arch/Kconfig
>> +++ b/arch/Kconfig
>> @@ -45,7 +45,7 @@ config SYS_CACHELINE_SIZE
>>   config LINKER_LIST_ALIGN
>>   	int
>>   	default 32 if SANDBOX
>> -	default 8 if ARM64 || X86
>> +	default 8 if 64BIT
>>   	default 4
>>   	help
>>   	  Force the each linker list to be aligned to this boundary. This
>
> Superseded by https://patchwork.ozlabs.org/project/uboot/patch/20241007094206.2928071-1-jerome.forissier@linaro.org/

It seems you are pointing to this very patch. You probably wanted to
respond to an earlier version.

Best regards

Heinrich
Jérôme Forissier Oct. 7, 2024, 1:35 p.m. UTC | #4
On 10/7/24 15:31, Heinrich Schuchardt wrote:
> On 07.10.24 14:55, Jerome Forissier wrote:
>>
>>
>> On 10/7/24 11:42, Jerome Forissier wrote:
>>> CPU_MIPS64 needs 8-byte alignment on the linker lists, otherwise an
>>> exception may occur. In fact all 64BIT architectures should default
>>> to 8; that's what this patch does.
>>> Fixes an issue found on malta64 with QEMU:
>>>
>>>   Breakpoint 1, lists_driver_lookup_name (name=0xffffffffbe043578 "root_driver") at /home/uboot/u-boot/drivers/core/lists.c:31
>>>   31                      if (!strcmp(name, entry->name))
>>>   [...]
>>>   ld      a1,0(s0)
>>>
>>>   (gdb) p/x &entry->name
>>>   0xffffffffbe04b0d4
>>>   (gdb) p/x $s0
>>>   0xffffffffbe04b0d4
>>>
>>>   $ grep __u_boot_list /tmp/malta64/u-boot.objdump
>>>   4 __u_boot_list 000018e0  ffffffffbe04a4d4  ffffffffbe04a4d4  0004a584  2**2
>>>
>>> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
>>> ---
>>>   arch/Kconfig | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/Kconfig b/arch/Kconfig
>>> index 8f1f4667012..72bf4029251 100644
>>> --- a/arch/Kconfig
>>> +++ b/arch/Kconfig
>>> @@ -45,7 +45,7 @@ config SYS_CACHELINE_SIZE
>>>   config LINKER_LIST_ALIGN
>>>       int
>>>       default 32 if SANDBOX
>>> -    default 8 if ARM64 || X86
>>> +    default 8 if 64BIT
>>>       default 4
>>>       help
>>>         Force the each linker list to be aligned to this boundary. This
>>
>> Superseded by https://patchwork.ozlabs.org/project/uboot/patch/20241007094206.2928071-1-jerome.forissier@linaro.org/
> 
> It seems you are pointing to this very patch. You probably wanted to
> respond to an earlier version.

Sorry about that. I wanted to reply to [1] indeed. And I wondering
why my reply wouldn't show up on patchwork... :o

[1] http://patchwork.ozlabs.org/project/uboot/patch/20241003142030.1610222-1-jerome.forissier@linaro.org/

Thanks.
diff mbox series

Patch

diff --git a/arch/Kconfig b/arch/Kconfig
index 8f1f4667012..72bf4029251 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -45,7 +45,7 @@  config SYS_CACHELINE_SIZE
 config LINKER_LIST_ALIGN
 	int
 	default 32 if SANDBOX
-	default 8 if ARM64 || X86
+	default 8 if 64BIT
 	default 4
 	help
 	  Force the each linker list to be aligned to this boundary. This