Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Raspberry Pi 5] Core segfaults when using dynamic recompiler #57

Open
vanfanel opened this issue Nov 4, 2023 · 6 comments
Open

[Raspberry Pi 5] Core segfaults when using dynamic recompiler #57

vanfanel opened this issue Nov 4, 2023 · 6 comments

Comments

@vanfanel
Copy link
Contributor

vanfanel commented Nov 4, 2023

Hi there,

Just built this core on the latest Raspberry Pi OS on the Pi5, and it segfaults when dosbox_core_core is set to dynamic.

Not much more to say, it seems the ARMV8L dynarec doesn't work on the Pi5.

@realnc
Copy link
Owner

realnc commented Nov 4, 2023

And I guess it's not a compilation issue. So the pre-compiled core from here:

https://github.com/realnc/dosbox-core/releases/tag/latest_build_linux_arm

Doesn't work either?

@vanfanel
Copy link
Contributor Author

vanfanel commented Nov 4, 2023

@realnc No, that doesn't work with the dynamic core, either.

@vanfanel
Copy link
Contributor Author

vanfanel commented Nov 9, 2023

Could this be related?

flyinghead/flycast#1288

Apparently, it originates from this Raspberry Pi OS bug:

raspberrypi/bookworm-feedback#107

So, where could I set the page size for the dynarec?

@vanfanel
Copy link
Contributor Author

I have confirmed that the 16K PageSize is what causes the segfault here, since using kernel=kernel8.img avoids the problem and dynarec works.

@vanfanel
Copy link
Contributor Author

vanfanel commented Dec 3, 2023

@realnc
It's an easy fix:

src/cpu/core_dynrec.cpp:#define PAGESIZE 4096
src/cpu/core_dynrec.cpp:#define DYN_PAGE_HASH   (4096>>DYN_HASH_SHIFT)
src/cpu/core_dyn_x86.cpp:#define PAGESIZE 4096

You see these 4096? They should be 16384 so dynarec core works on the Pi5.
This is because on the Pi5:

root@raspberrypi:~# getconf PAGESIZE
16384

What Flycast did to fix this, is get the PAGE_SIZE at build time:
flyinghead/flycast@0f6a92c

Would you please add such a fix to this core?

@vanfanel
Copy link
Contributor Author

vanfanel commented Dec 4, 2023

Well, made the fix and the corresponding PR.
@realnc Please merge #58

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants