mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Gittinger Joerg (XC-ECO/ESH2)" <Joerg.Gittinger@de.bosch.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>,
	"barebox@lists.infradead.org" <barebox@lists.infradead.org>
Cc: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Subject: AW: Aarch64 Qemu virt - crash
Date: Fri, 12 Mar 2021 12:23:45 +0000	[thread overview]
Message-ID: <091631c2e041496996d0904f0a6c8af7@de.bosch.com> (raw)
In-Reply-To: <33279efb-c168-04a4-10fe-8492d426679a@pengutronix.de>

Hi Ahmad,

>> Apparently the NOR cfi driver tries to figure out the flash width by writing to it. In QEMU aarch64 virt machine, the flash starts at 0x0, so the address is correct. 
>> In barebox config the "QEMU arm64 virt machine" is selected. I tried with specifying a "-pflash ..." parameter at QEMU command line but still got the same exception. 
>> MMU (SCTLR.M) is turned on - therefore I wonder why I get this exception. It seems that the MMU region for the flash is not or not correctly set up when the memory 
>> access occurs..? Or do I do something wrong? Please let me know how I get it running.

> There was recent rework on this platform, please pull again. This particular issue is worked around with
> 767edcc58757 ("mtd: cfi-flash: fail gracefully instead of crashing on NULL page")

Yes, cherry-picking this change solved the crash. Thanks.

> The root cause is that when MMU is enabled, barebox traps NULL pointer dereference and accessing the first page of a cfi-flash mapped at zero looks just like one.
>
> The proper fix would be to remap the cfi-flash for this board, but no one has come around to do this yet. An alternative if you need to pass data to barebox is to use 
> VirtIO Block devices. They need no further configuration than qemu command line parameters. That's in next as well.

BTW, I tried disabling MMU in config as well as Rouven suggested (thanks). But this gives me a linker error:

---------------------------------------------
...
  LD      barebox
aarch64-linux-gnu-ld: common/uimage.o: in function `zero_page_memcpy':
/home/gjt2abt/src/barebox/include/zero_page.h:47: undefined reference to `zero_page_access'
/home/gjt2abt/src/barebox/include/zero_page.h:47:(.text.uimage_sdram_flush+0xc4): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zero_page_access'
aarch64-linux-gnu-ld: /home/gjt2abt/src/barebox/include/zero_page.h:49: undefined reference to `zero_page_faulting'
/home/gjt2abt/src/barebox/include/zero_page.h:49:(.text.uimage_sdram_flush+0xd8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zero_page_faulting'
aarch64-linux-gnu-ld: /home/gjt2abt/src/barebox/include/zero_page.h:47: undefined reference to `zero_page_access'
/home/gjt2abt/src/barebox/include/zero_page.h:47:(.text.file_to_sdram+0xd8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zero_page_access'
aarch64-linux-gnu-ld: /home/gjt2abt/src/barebox/include/zero_page.h:49: undefined reference to `zero_page_faulting'
/home/gjt2abt/src/barebox/include/zero_page.h:49:(.text.file_to_sdram+0xf0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zero_page_faulting'
make: *** [Makefile:915: barebox] Error 1
---------------------------------------------

Regards,
Joerg
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-03-12 12:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 10:55 Gittinger Joerg (XC-ECO/ESH2)
2021-03-12 11:03 ` Rouven Czerwinski
2021-03-12 11:13 ` Ahmad Fatoum
2021-03-12 12:23   ` Gittinger Joerg (XC-ECO/ESH2) [this message]
2021-03-12 12:34     ` AW: " Ahmad Fatoum

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=091631c2e041496996d0904f0a6c8af7@de.bosch.com \
    --to=joerg.gittinger@de.bosch.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=r.czerwinski@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox