box64 icon indicating copy to clipboard operation
box64 copied to clipboard

Runtime pagesize

Open Icenowy opened this issue 3 years ago • 6 comments

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.

Icenowy avatar Aug 13 '22 07:08 Icenowy

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.

ptitSeb avatar Sep 03 '22 08:09 ptitSeb

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.

n3ph avatar Jan 09 '24 19:01 n3ph

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...

ptitSeb avatar Jan 10 '24 08:01 ptitSeb

this is of great interest to me as a packager as well. users switching SD cards between raspi systems is a common occurance (see -> https://github.com/Botspot/pi-apps/issues/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 avatar Jan 15 '24 18:01 theofficialgman

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

theofficialgman avatar Jan 15 '24 18:01 theofficialgman

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

ptitSeb avatar Jan 31 '24 15:01 ptitSeb

Closing, it's done now.

ptitSeb avatar Apr 05 '24 17:04 ptitSeb