[PATCH] ubifs: allow loading to above 4GiB
Ben Dooks
ben.dooks at codethink.co.uk
Tue Jun 6 12:30:34 CEST 2023
On 05/06/2023 08:45, Heiko Schocher wrote:
> Hello Ben,
>
> On 10.05.23 15:41, Ben Dooks wrote:
>> The ubifsload command is truncating any address above 4GiB as it casts
>> this address to an u32, instead of using an unsigned long which most of
>> the other load commands do. Change this to an unsigned long to allow
>> loading into high memory for boards which use these areas.
>>
>> Fixes the following error:
>>
>> => ubifsload 0x2100000000 /boot/Image.lzma
>> Loading file '/boot/Image.lzma' to addr 0x00000000...
>> Unhandled exception: Store/AMO access fault
>>
>> Signed-off-by: Ben Dooks <ben.dooks at sifive.com>
>> ---
>> cmd/ubifs.c | 2 +-
>> fs/ubifs/ubifs.c | 4 ++--
>> include/ubifs_uboot.h | 2 +-
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> just started azure build and it drops errors:
>
> https://dev.azure.com/hs0298/hs/_build/results?buildId=105&view=results
>
> for example
> https://dev.azure.com/hs0298/hs/_build/results?buildId=103&view=results
>
> 2023-06-05T07:34:39.9304987Z + tools/buildman/buildman -o /tmp/vexpress_ca9x4 -w -E -W -e --board
> vexpress_ca9x4
> 2023-06-05T07:34:45.4735755Z Building current source for 1 boards (1 thread, 2 jobs per thread)
> 2023-06-05T07:34:45.4735947Z
> 2023-06-05T07:34:45.4736063Z Starting build...
> 2023-06-05T07:34:45.4736188Z
> 2023-06-05T07:34:45.4736233Z
> 2023-06-05T07:35:02.4142452Z 0 0 0 /1 -1 (starting)
> 2023-06-05T07:35:02.4150636Z
> 2023-06-05T07:35:02.4150787Z arm: + vexpress_ca9x4
> 2023-06-05T07:35:02.4150964Z +In file included from include/linux/printk.h:4,
> 2023-06-05T07:35:02.4151140Z + from include/common.h:20,
> 2023-06-05T07:35:02.4152527Z + from cmd/ubifs.c:14:
> 2023-06-05T07:35:02.4152796Z +cmd/ubifs.c: In function 'do_ubifs_load':
> 2023-06-05T07:35:02.4153181Z +cmd/ubifs.c:136:15: error: format '%x' expects argument of type
> 'unsigned int', but argument 3 has type 'long unsigned int' [-Werror=format=]
> 2023-06-05T07:35:02.4153550Z + 136 | debug("Loading file '%s' to address 0x%08x (size
> %d)\n", filename, addr, size);
> 2023-06-05T07:35:02.4153758Z + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 2023-06-05T07:35:02.4154045Z +include/log.h:155:21: note: in definition of macro 'pr_fmt'
> 2023-06-05T07:35:02.4154220Z + 155 | #define pr_fmt(fmt) fmt
> 2023-06-05T07:35:02.4154344Z + | ^~~
> 2023-06-05T07:35:02.4154571Z +include/log.h:272:9: note: in expansion of macro 'debug_cond'
> 2023-06-05T07:35:02.4155974Z + 272 | debug_cond(_DEBUG, fmt, ##args)
> 2023-06-05T07:35:02.4156144Z + | ^~~~~~~~~~
> 2023-06-05T07:35:02.4156393Z +cmd/ubifs.c:136:9: note: in expansion of macro 'debug'
> 2023-06-05T07:35:02.4156541Z + | ^~~~~
> 2023-06-05T07:35:02.4156769Z +cmd/ubifs.c:136:50: note: format string is defined here
> 2023-06-05T07:35:02.4156947Z + | ~~~^
> 2023-06-05T07:35:02.4157068Z + | |
> 2023-06-05T07:35:02.4157202Z + | unsigned int
> 2023-06-05T07:35:02.4157341Z + | %08lx
> 2023-06-05T07:35:02.4157475Z +cc1: all warnings being treated as errors
> 2023-06-05T07:35:02.4157660Z +make[2]: *** [scripts/Makefile.build:256: cmd/ubifs.o] Error 1
> 2023-06-05T07:35:02.4157845Z +make[1]: *** [Makefile:1853: cmd] Error 2
> 2023-06-05T07:35:02.4158061Z +make: *** [Makefile:177: sub-make] Error 2
>
> Please fix it, thanks!
I've just sent v2 with the debug print sorted.
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html
More information about the U-Boot
mailing list