All of lore.kernel.org
 help / color / mirror / Atom feed
* qemu-arm: hang during MMU initialization
@ 2021-02-05 17:38 Igor Opaniuk
  2021-02-11  8:57 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Igor Opaniuk @ 2021-02-05 17:38 UTC (permalink / raw)
  To: u-boot

Hi,

With this commit 3fa914af82("arm: qemu: implement enable_caches()") introduced,
which enables instruction/data caches for qemu-arm target,
U-Boot sometimes hangs during MMU init procedure :

DRAM:  1 GiB
initcall: 60011df8
initcall: 60011904
New Stack Pointer is: 80fffe90
initcall: 60011a20
initcall: 60011bcc
initcall: 60011bd4
initcall: 600119b4
Relocation Offset is: 22042000
Relocating to 82042000, new gd at 81001ed0, sp at 80fffe90
initcall: 60011b8c
initcall: 82053ea0
initcall: 82053ea8
initcall: 60012040 (relocated to 82054040)
dram_bank_mmu_setup: bank: 0

This issue reproduces every time when the amount of memory provided to QEMU
is not 2MB granular. Looks like it might be some unexpected alignment issue.

Test results (QEMU v5.2.0 release):
qemu-system-arm -machine virt -m 1058 -nographic -bios u-boot.bin - boots OK
qemu-system-arm -machine virt -m 1057 -nographic -bios u-boot.bin - hangs
qemu-system-arm -machine virt -m 1056 -nographic -bios u-boot.bin - boots OK
qemu-system-arm -machine virt -m 1055 -nographic -bios u-boot.bin - hangs

Unfortunately I didn't have a chance to investigate this further, so
just sharing my current observations. Thanks for any input.

Cheers,
Igor

-- 
Best regards - Freundliche Gr?sse - Meilleures salutations

Igor Opaniuk
Embedded Software Engineer
T:  +380 938364067
E: igor.opaniuk at foundries.io
W: www.foundries.io

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

* qemu-arm: hang during MMU initialization
  2021-02-05 17:38 qemu-arm: hang during MMU initialization Igor Opaniuk
@ 2021-02-11  8:57 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2021-02-11  8:57 UTC (permalink / raw)
  To: u-boot

On Fri, 5 Feb 2021 at 18:38, Igor Opaniuk <igor.opaniuk@foundries.io> wrote:
>
> Hi,
>
> With this commit 3fa914af82("arm: qemu: implement enable_caches()") introduced,
> which enables instruction/data caches for qemu-arm target,
> U-Boot sometimes hangs during MMU init procedure :
>
> DRAM:  1 GiB
> initcall: 60011df8
> initcall: 60011904
> New Stack Pointer is: 80fffe90
> initcall: 60011a20
> initcall: 60011bcc
> initcall: 60011bd4
> initcall: 600119b4
> Relocation Offset is: 22042000
> Relocating to 82042000, new gd at 81001ed0, sp at 80fffe90
> initcall: 60011b8c
> initcall: 82053ea0
> initcall: 82053ea8
> initcall: 60012040 (relocated to 82054040)
> dram_bank_mmu_setup: bank: 0
>
> This issue reproduces every time when the amount of memory provided to QEMU
> is not 2MB granular. Looks like it might be some unexpected alignment issue.
>
> Test results (QEMU v5.2.0 release):
> qemu-system-arm -machine virt -m 1058 -nographic -bios u-boot.bin - boots OK
> qemu-system-arm -machine virt -m 1057 -nographic -bios u-boot.bin - hangs
> qemu-system-arm -machine virt -m 1056 -nographic -bios u-boot.bin - boots OK
> qemu-system-arm -machine virt -m 1055 -nographic -bios u-boot.bin - hangs
>
> Unfortunately I didn't have a chance to investigate this further, so
> just sharing my current observations. Thanks for any input.
>

Hello Igor,

enable_caches() results in a 1:1 mapping to be created, and since LPAE
has been enabled as well, the 1:1 mapping is created using 2 MB
blocks. So I am not surprised that using a value that is not a
multiple of 2 MB causes problems.

I'd suggest implementing a simple fix, e.g., just round down the
amount of available memory, as this is not something that is likely to
ever be a problem on real systems.

-- 
Ard.

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

end of thread, other threads:[~2021-02-11  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 17:38 qemu-arm: hang during MMU initialization Igor Opaniuk
2021-02-11  8:57 ` Ard Biesheuvel

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.