Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Runtime pagesize #384

Closed
Icenowy opened this issue Aug 13, 2022 · 7 comments
Closed

Runtime pagesize #384

Icenowy opened this issue Aug 13, 2022 · 7 comments

Comments

@Icenowy
Copy link

Icenowy commented Aug 13, 2022

ARM64 kernel supports 3 kinds of page sizes: 4K, 16K and 64K, and it's an option when building kernel.

RHEL-derivatives uses 64K page, most embedded things use 4K and Apple uses 16K.

To ship box64 as a generic distribution, it could be beneficial to support all page sizes dynamically.

@ptitSeb
Copy link
Owner

ptitSeb commented Sep 3, 2022

The Pagesize is fixed for performances reason. I might add a dynamic option, but it will be an option, as I don't want to introduce a slowdown for something almost no one will use.

@n3ph
Copy link

n3ph commented Jan 9, 2024

According to ongoing discussions in the Fedora Asahi Remix community, this is of great interest to an upcoming potential userbase already.

EDIT: FAR patches box64 for this matter:

Name         : box64-asahi
Version      : 0.2.4
Release      : 1.fc39
Architecture : aarch64
Size         : 1.8 M
Source       : box64-0.2.4-1.fc39.src.rpm
Repository   : fedora
Summary      : Apple Silicon version of box64
URL          : https://box86.org
License      : MIT
Description  : Box64 lets you run x86_64 Linux programs (such as games) on non-x86_64 Linux
             : systems, like ARM (host system needs to be 64-bit little-endian).
             : 
             : This package contains a version of box64 targeting Apple Silicon systems using
             : a 16k page size.

@ptitSeb
Copy link
Owner

ptitSeb commented Jan 10, 2024

I don't see anything abot runtime pagesize size in this patch (I don't see what this patch bring tbh, it looks like current CMakeList.txt there)

My understanding was that on the Fedora image on M1 there was a special container thingy with 4K pagesize specialy developped for emulation? Isn't that still the case?

non 4K pagesize is difficult for x86_64 because all elf and PE files use a 4K granularity as a given...

@theofficialgman
Copy link
Contributor

theofficialgman commented Jan 15, 2024

this is of great interest to me as a packager as well. users switching SD cards between raspi systems is a common occurance (see -> Botspot/pi-apps#2524) and often result in a different (4k vs 16k) pagesize kernel as a result. it would be great for multiple pagesizes to be supported in one build.

@theofficialgman
Copy link
Contributor

The Pagesize is fixed for performances reason. I might add a dynamic option, but it will be an option, as I don't want to introduce a slowdown for something almost no one will use.

if a runtime pagesize would result in considerable slowdown, I am also interested in potential multi-packaging ideas for having 3 versions of box64 included in one package (4K, 16K, and 64K) where the appropriate version is automatically chosen at runtime depending on the current kernel pagesize. I guess this could already be accomplished by modifying the binfmt to point to a bash wrapper script that calls getconf PAGESIZE and then runs the appropriate binary based on that but I would rather have it implemented natively in box64

ptitSeb added a commit that referenced this issue Jan 31, 2024
…agesize not 4K. The define are still there but might be removed shortly (for #1231, #1226, #1189, #1175, #999, #384 and probably a few other)
@ptitSeb
Copy link
Owner

ptitSeb commented Jan 31, 2024

Finaly made pagesize handling dynamic!
I guess this ticket can be closed now?

@ptitSeb ptitSeb closed this as completed Apr 5, 2024
@ptitSeb
Copy link
Owner

ptitSeb commented Apr 5, 2024

Closing, it's done now.

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

No branches or pull requests

4 participants