diff options
Diffstat (limited to '')
| -rw-r--r-- | results/scraper/box64/260 | 14 | ||||
| -rw-r--r-- | results/scraper/box64/2600 | 5 | ||||
| -rw-r--r-- | results/scraper/box64/2601 | 10 | ||||
| -rw-r--r-- | results/scraper/box64/2602 | 186 | ||||
| -rw-r--r-- | results/scraper/box64/2603 | 4 | ||||
| -rw-r--r-- | results/scraper/box64/2604 | 92 | ||||
| -rw-r--r-- | results/scraper/box64/2608 | 57 |
7 files changed, 368 insertions, 0 deletions
diff --git a/results/scraper/box64/260 b/results/scraper/box64/260 new file mode 100644 index 000000000..ba801b677 --- /dev/null +++ b/results/scraper/box64/260 @@ -0,0 +1,14 @@ +Issue with x86-64 application launch +Hello, +when launching x86-64 apllication I've got strange message and application failed +3313|0x40d8f0: Unimplemented Opcode (C3) 66 0F 38 30 D0 66 0F 73 D8 08 66 0F 38 30 C0 + +Is there something not implemented on box64 +The application used is sbf2rin (application for gnss purpose) + +The version of box64 used is the following : +box64 -v +Dynarec for ARM64, with extension: ASIMD CRC32 PageSize:4096 +Box64 with Dynarec v0.1.7 23bbab1 built on Mar 2 2022 10:58:22 + +Thanks for your help \ No newline at end of file diff --git a/results/scraper/box64/2600 b/results/scraper/box64/2600 new file mode 100644 index 000000000..8f75d0f3b --- /dev/null +++ b/results/scraper/box64/2600 @@ -0,0 +1,5 @@ +[Winlator wcp] game not boot above "Merge mmapmem into mapallmem" commit +game tested nfsmw on winlator 7.1.4 succubussix (no bionic container) +preset: perfomance + +[speed_2025-05-04_10-52-52_105520.txt](https://github.com/user-attachments/files/20026010/speed_2025-05-04_10-52-52_105520.txt) \ No newline at end of file diff --git a/results/scraper/box64/2601 b/results/scraper/box64/2601 new file mode 100644 index 000000000..ccd036d8b --- /dev/null +++ b/results/scraper/box64/2601 @@ -0,0 +1,10 @@ +Question: Feasibility of Hot‑Path Runtime Profiling in Box64 Dynarec? +Hi @ptitSeb and the Box64 team—thanks for all the fantastic work on this project! + +I’ve been experimenting with Box64 for benchmarks and wanted to check whether a hot‑path runtime‑profiling mechanism is on your roadmap (or, if not, why it might not fit)? + +I read the source code and found out Box64’s dynarec currently relies on static “bigblock” extending mechanism to create a block as big as possible, which could improve Box64's performance on certain workloads. But this strategy can’t always zero in on the hottest execution paths, so some performance potential may be left untapped. + +So I wonder if a simple runtime profiling mechanism will be considered? Using counters to record each generated block's execution frequency, and when that counter exceeds a threshold (like 50, which in other DBI/DBO tools like DynamoRIO is treated as a good choice), the dynarec could treat the cross-block sequence as a hot path and combine these blocks into a bigblock. And let the counter decay over time, so new hot paths can surface. + +I’m curious whether you’ve explored a runtime‑profiling scheme for Box64, and—if it hasn’t been pursued—would you mind sharing what factors led to that decision? Thanks very much! \ No newline at end of file diff --git a/results/scraper/box64/2602 b/results/scraper/box64/2602 new file mode 100644 index 000000000..01e65e5d2 --- /dev/null +++ b/results/scraper/box64/2602 @@ -0,0 +1,186 @@ +Request (improvement) Box64 +### Tools and Improvements for Box64 + +#### **1. Performance Optimization** +- **Dynamic JIT Optimization:** Implement caching for frequently used code segments to reduce recompilation time. For example, DynaRec improves x86_64 code execution speed by 5–10× in tests on Raspberry Pi 400. +- **Multithreaded Translation:** Leverage all ARM/RISC-V cores for parallel instruction processing. Critical for demanding games (e.g., *The Witcher 3*) on devices like the Sophgo 64-core RISC-V. +- **Vulkan/DXVK Integration:** Enhance Vulkan driver support for devices such as Raspberry Pi 4/5, where current DXVK implementations are unstable due to missing extensions. + +#### **2. Compatibility Expansion** +- **Automatic Wine Configuration:** Tools to download and configure Wine (e.g., via symlinks and prebuilt PlayOnLinux versions), as documented for RISC-V and Nintendo Switch. +- **Docker Container Support:** Run x86_64 containers on ARM servers via Podman/Docker integration, simplifying deployment of ML tools like TensorFlow. +- **System Proxy Libraries:** Automatically replace x86_64 libraries with native equivalents (e.g., OpenAL, SDL2). Partially implemented but currently requires manual tweaks. + +#### **3. Usability** +- **Graphical Interface (GUI):** Integrate with managers like **Pi-Apps** for Nintendo Switch, enabling two-click Box64 installation. A similar tool for Linux desktops would streamline emulation setup. +- **Dependency Automation:** Scripts to install missing libraries (e.g., `winetricks` for DXVK/VKD3D). For example, RISC-V Wine currently requires manual downloads of `wine-10.0-amd64-wow64.tar.xz`. +- **Preconfigured Game Profiles:** Settings templates for popular games (*Half-Life 2*, *Cuphead*), including resolution and graphics library versions. + +#### **4. Security and Stability** +- **Sandbox Mode:** Isolate emulated apps to prevent access to system files, similar to Winlator on Android. +- **Enhanced Logging:** Detailed tracing of syscalls and translation errors. Current Box64 logs show warnings like `[BOX64] Warning: DynaRec is available...`. + +#### **5. Ecosystem Integration** +- **Android Support:** Run Box64 on Android via shells like **Winlator**. +- **Network Accelerators:** Optimize network calls for online games. Tests on *Factorio Dedicated Server* with Raspberry Pi 5 show latency due to emulated network stacks. +- **Steam Integration:** Auto-configure Proton to run Steam games on ARM devices. Steam is currently unsupported on RISC-V due to binary format limitations. + +--- + +### Implementation Examples from Search Results: +- **On RISC-V:** Compiling Box64 with Box32 requires manually enabling CMake flags `RV64` and `RV64_DYNAREC`. +- **On Raspberry Pi:** Using `-DRPI5ARM64=1` for devices with 16K pagesize improves OS compatibility. +- **systemd-binfmt Integration:** Auto-launch x86_64 programs via Box64 after restarting the `systemd-binfmt` service. + +--- +### Elaboration of Tools and Improvements for Box64 + +--- + +#### **1. Performance Optimization** +1. **Dynamic JIT Optimization (DynaRec):** + - **Cache Implementation:** Add an LRU cache to store recompiled code blocks. Example: + ```c + // Pseudocode for block caching + struct JITBlockCache { + uint64_t hash; + void *compiled_code; + } cache[MAX_CACHE_SIZE]; + ``` + - **Hot Path Optimization:** Use profiling to identify frequently executed blocks (e.g., loops) and prioritize their caching. + +2. **Multithreaded Translation:** + - Split code into independent segments (e.g., functions) and distribute them across threads. + - Use a thread pool (e.g., `libdispatch` on Linux): + ```bash + # Example compilation with OpenMP support + cmake .. -DUSE_OPENMP=ON -DNUM_THREADS=4 + ``` + +3. **Vulkan/DXVK Integration:** + - Add support for Vulkan extensions (e.g., `VK_KHR_buffer_device_address` for Raspberry Pi): + ```bash + # Enable experimental DXVK extensions + export DXVK_FILTER_EXTENSIONS="VK_KHR_buffer_device_address" + ``` + +--- + +#### **2. Compatibility Expansion** +1. **Automated Wine Configuration:** + - Script to download and configure Wine: + ```bash + #!/bin/bash + WINE_VERSION="wine-10.0-amd64-wow64" + wget https://dl.winehq.org/$WINE_VERSION.tar.xz + tar -xf $WINE_VERSION.tar.xz -C ~/.wine + ln -s ~/.wine/$WINE_VERSION/bin/wine /usr/local/bin/box64-wine + ``` + +2. **Docker Container Support:** + - Integrate with Podman via `binfmt_misc`: + ```bash + # Register Box64 as an x86_64 binary handler + echo ':x86_64:M::\x7fELF\x02\x01\x01\x00\x00\x00:/usr/bin/box64:' > /proc/sys/fs/binfmt_misc/register + ``` + +3. **Proxy System Libraries:** + - Automatically replace x86_64 libraries via `LD_PRELOAD`: + ```bash + # Script to substitute OpenAL + export LD_PRELOAD="/usr/lib/arm-linux-gnueabihf/libopenal.so.1" + ``` + +--- + +#### **3. Usability Enhancements** +1. **Graphical User Interface (GUI):** + - GTK3-based example for game selection: + ```python + import gi + gi.require_version('Gtk', '3.0') + from gi.repository import Gtk + + class GameLauncher(Gtk.Window): + def __init__(self): + super().__init__(title="Box64 Launcher") + self.set_default_size(400, 300) + # Add game buttons + ``` + +2. **Dependency Automation:** + - `box64-setup` script for DXVK installation: + ```bash + winetricks d3dcompiler_47 d3dx11_43 dxvk + ``` + +3. **Preconfigured Game Profiles:** + - Configuration for *Half-Life 2*: + ```ini + [hl2] + resolution=1280x720 + dxvk_version=1.10.3 + env_vars=LD_PRELOAD=libSDL2-2.0.so.0 + ``` + +--- + +#### **4. Security and Stability** +1. **Sandbox Mode:** + - Run via Firejail: + ```bash + firejail --private --net=none box64 ./game.exe + ``` + +2. **Enhanced Logging:** + - Enable system call tracing: + ```bash + export BOX64_LOG=1 + export BOX64_TRACE_SYSCALL=1 + ``` + +--- + +#### **5. Ecosystem Integration** +1. **Android Support:** + - Build Box64 with Android NDK: + ```bash + ndk-build APP_ABI=arm64-v8a BOX64_ANDROID=1 + ``` + +2. **Network Accelerators:** + - Intercept socket calls via `LD_PRELOAD`: + ```c + // Example optimized connect() + int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) { + // Optimize UDP packets + } + ``` + +3. **Steam Integration:** + - Launch Steam via Proton: + ```bash + BOX64_EMULATED_PROTON=1 box64 steam + ``` + +--- + +#### **Implementation Examples** +1. **For RISC-V:** + ```bash + cmake .. -DRV64=1 -DRV64_DYNAREC=ON + make -j$(nproc) + ``` + +2. **For Raspberry Pi 5:** + ```bash + cmake .. -DRPI5ARM64=1 -DPAGESIZE_16K=ON + ``` + +3. **Autostart via binfmt:** + ```bash + systemctl restart systemd-binfmt + ``` + +--- +These enhancements will position Box64 as a universal tool for running x86_64 applications on ARM/RISC-V devices, combining performance, usability, and security. diff --git a/results/scraper/box64/2603 b/results/scraper/box64/2603 new file mode 100644 index 000000000..922e621de --- /dev/null +++ b/results/scraper/box64/2603 @@ -0,0 +1,4 @@ +Proton 10 experimental support Arm64 + + +Valve Well done guys and community GitHub \ No newline at end of file diff --git a/results/scraper/box64/2604 b/results/scraper/box64/2604 new file mode 100644 index 000000000..bb364439d --- /dev/null +++ b/results/scraper/box64/2604 @@ -0,0 +1,92 @@ +Error when running GB studio under box64 +[BOX64] Box64 with Dynarec v0.3.3 c2d02977 built on Mar 8 2025 06:31:41 +[BOX64] Dynarec for ARM64, with extension: ASIMD CRC32 +[BOX64] Running on Cortex-A72 with 4 cores, pagesize: 4096 +[BOX64] Will use hardware counter measured at 54.0 MHz emulating 3.4 GHz +[BOX64] Didn't detect 48bits of address space, considering it's 39bits +[BOX64] Counted 44 Env var +[BOX64] Library search path: +[BOX64] Binary search path: ./:bin/:/home/rpi/.local/bin/:/home/rpi/bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/:/snap/bin/:/home/rpi/bin/ +[BOX64] Looking for /home/rpi/Downloads/squashfs-root/usr/lib/gb-studio/gb-studio +[BOX64] Rename process to "gb-studio" +[BOX64] Redirecting overridden malloc from symtab function for /home/rpi/Downloads/squashfs-root/usr/lib/gb-studio/gb-studio +[BOX64] Using emulated /home/rpi/Downloads/squashfs-root/usr/lib/gb-studio/libffmpeg.so +[BOX64] Using native(wrapped) libdl.so.2 +[BOX64] Using native(wrapped) libpthread.so.0 +[BOX64] Using native(wrapped) libgobject-2.0.so.0 +[BOX64] Using native(wrapped) libglib-2.0.so.0 +[BOX64] Using native(wrapped) libgio-2.0.so.0 +[BOX64] Using native(wrapped) libgmodule-2.0.so.0 +[BOX64] Using native(wrapped) libnss3.so +[BOX64] Using native(wrapped) libnssutil3.so +[BOX64] Using native(wrapped) libsmime3.so +[BOX64] Using native(wrapped) libnspr4.so +[BOX64] Using native(wrapped) libatk-1.0.so.0 +[BOX64] Using native(wrapped) libatk-bridge-2.0.so.0 +[BOX64] Using native(wrapped) libSM.so.6 +[BOX64] Using native(wrapped) libICE.so.6 +[BOX64] Using native(wrapped) libXau.so.6 +[BOX64] Using native(wrapped) libxcb.so.1 +[BOX64] Using native(wrapped) libXdmcp.so.6 +[BOX64] Using native(wrapped) libcups.so.2 +[BOX64] Using native(wrapped) libdbus-1.so.3 +[BOX64] Using native(wrapped) libdrm.so.2 +[BOX64] Using native(wrapped) libgtk-3.so.0 +[BOX64] Using native(wrapped) libgdk-3.so.0 +[BOX64] Using native(wrapped) libgdk_pixbuf-2.0.so.0 +[BOX64] Using native(wrapped) libpangocairo-1.0.so.0 +[BOX64] Using native(wrapped) libpango-1.0.so.0 +[BOX64] Using native(wrapped) libcairo.so.2 +[BOX64] Using native(wrapped) libm.so.6 +[BOX64] Using native(wrapped) libX11.so.6 +[BOX64] Using native(wrapped) libXcomposite.so.1 +[BOX64] Using native(wrapped) libXdamage.so.1 +[BOX64] Using native(wrapped) libXext.so.6 +[BOX64] Using native(wrapped) libXfixes.so.3 +[BOX64] Using native(wrapped) libXrandr.so.2 +[BOX64] Using native(wrapped) libXrender.so.1 +[BOX64] Using native(wrapped) libgbm.so.1 +[BOX64] Using native(wrapped) libexpat.so.1 +[BOX64] Using native(wrapped) libxkbcommon.so.0 +[BOX64] Using native(wrapped) libasound.so.2 +[BOX64] Using native(wrapped) libatspi.so.0 +[BOX64] Using emulated /usr/lib/box64-x86_64-linux-gnu/libgcc_s.so.1 +[BOX64] Using native(wrapped) libc.so.6 +[BOX64] Using native(wrapped) ld-linux-x86-64.so.2 +[BOX64] Using native(wrapped) libutil.so.1 +[BOX64] Using native(wrapped) librt.so.1 +[BOX64] Using native(wrapped) libbsd.so.0 +[BOX64] Warning: Weak Symbol _ZTHN2v88internal12trap_handler21g_thread_in_wasm_codeE not found, cannot apply R_X86_64_JUMP_SLOT @0x1099e5a10 (0x9476186) +[BOX64] Warning: Weak Symbol _ZTHN2v88internal19RwxMemoryWriteScope31code_space_write_nesting_level_E not found, cannot apply R_X86_64_JUMP_SLOT @0x1099e5a18 (0x9476196) +[BOX64] Warning: Weak Symbol _ZTHN3WTF16g_is_main_threadE not found, cannot apply R_X86_64_JUMP_SLOT @0x1099e5a60 (0x9476226) +[BOX64] Warning: Weak Symbol _ZTHN15partition_alloc8internal14g_thread_cacheE not found, cannot apply R_X86_64_JUMP_SLOT @0x1099e5cf8 (0x9476756) +[BOX64] Warning: Weak Symbol OPENSSL_memory_alloc not found, cannot apply R_X86_64_JUMP_SLOT @0x1099e5e78 (0x9476a56) +[BOX64] Warning: Weak Symbol OPENSSL_memory_free not found, cannot apply R_X86_64_JUMP_SLOT @0x1099e5e80 (0x9476a66) +[BOX64] Warning: Weak Symbol sdallocx not found, cannot apply R_X86_64_JUMP_SLOT @0x1099e5e88 (0x9476a76) +[BOX64] Warning: Weak Symbol OPENSSL_memory_get_size not found, cannot apply R_X86_64_JUMP_SLOT @0x1099e5e90 (0x9476a86) +free(): invalid pointer +[BOX64] NativeBT: /home/rpi/Downloads/squashfs-root/usr/lib/gb-studio/gb-studio() [0x34a7d774] +[BOX64] NativeBT: linux-vdso.so.1(__kernel_rt_sigreturn+0) [0x7f87ed87b0] +[BOX64] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(+0x80a50) [0x7f87d40a50] +[BOX64] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(gsignal+0x1c) [0x7f87cfa72c] +[BOX64] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(abort+0xf0) [0x7f87ce747c] +[BOX64] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(+0x74aac) [0x7f87d34aac] +[BOX64] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(+0x8aeac) [0x7f87d4aeac] +[BOX64] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(+0x8cc38) [0x7f87d4cc38] +[BOX64] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(__libc_free+0xd8) [0x7f87d4f76c] +[BOX64] NativeBT: [0x7f76f55d84] +[BOX64] EmulatedBT: box64(free+0) [0x300000a0] +[BOX64] EmulatedBT: /home/rpi/Downloads/squashfs-root/usr/lib/gb-studio/gb-studio+92a0431 [0x1092a0431] +[BOX64] EmulatedBT: /home/rpi/Downloads/squashfs-root/usr/lib/gb-studio/gb-studio+92ab244 [0x1092ab244] +[BOX64] EmulatedBT: /home/rpi/Downloads/squashfs-root/usr/lib/gb-studio/gb-studio(__libc_csu_init+45) [0x1021b1bc5] +[BOX64] EmulatedBT: box64(ExitEmulation+0) [0x30000080] +[BOX64] EmulatedBT: /home/rpi/Downloads/squashfs-root/usr/lib/gb-studio/gb-studio(+2a) [0x101e9d02a] +[BOX64] 547160|SIGABRT @0x7f87d40a50 (???(/lib/aarch64-linux-gnu/libc.so.6+0x80a50)) (x64pc=0x300000a0/"???", rsp=0x7f87826f18, stack=0x7f87028000:0x7f87828000 own=(nil) fp=0x7f87826fa0), for accessing 0x3e800085958 (code=-6/prot=0), db=(nil)((nil):(nil)/(nil):(nil)/???:clean, hash:0/0) handler=(nil) +RSP-0x20:0x000000000000000a RSP-0x18:0x0000007800214870 RSP-0x10:0x0000007f87826f30 RSP-0x08:0x0000007f87826fa0 +RSP+0x00:0x00000001092a0ee8 RSP+0x08:0x0000000000000000 RSP+0x10:0x0000007f87826f30 RSP+0x18:0x0000000000000000 +RAX:0x0000007800214828 RCX:0x0000007800218168 RDX:0x0000007800214870 RBX:0x0000007800214840 +RSP:0x0000007f87826f18 RBP:0x0000007f87826fa0 RSI:0x0000000000000001 RDI:0x0000007800214840 + R8:0x0000007800214870 R9:0x0000007f87826f70 R10:0x0000000000000001 R11:0x0000000000000010 +R12:0x0000007800214840 R13:0x000000000000000a R14:0x0000007800214828 R15:0x0000007f87826f30 +ES:0x002b CS:0x0033 SS:0x002b DS:0x002b FS:0x0043 GS:0x0053 +Aborted (core dumped) diff --git a/results/scraper/box64/2608 b/results/scraper/box64/2608 new file mode 100644 index 000000000..0149f7082 --- /dev/null +++ b/results/scraper/box64/2608 @@ -0,0 +1,57 @@ +[NON4KPAGE] AllocLoadElfMemory multiblocks wrong alignment +Hi, + +[jtreg testcase](https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/vmTestbase/vm/jit/LongTransitions/libLTTest.cpp#L3397) `objdump -d /your/path/jdk/build/linux-x86_64-server-release/images/test/hotspot/jtreg/native/libLTTest.so ` +``` +0000000000046b50 <Java_vm_jit_LongTransitions_LTTest_nativeFnc52>: + 46b50: 55 push %rbp +... +=> 47fff: b8 01 00 00 00 mov $0x1,%eax + ^--- expected + 48004: e8 67 a0 fb ff callq 2070 <fprintf@plt> +... +``` + +[AllocLoadElfMemory multiblocks wrong alignment](https://github.com/ptitSeb/box64/blob/main/src/elfs/elfloader.c#L302) failed to decode `0x3f00047fff` expected `B8 01 00 00 00`: +``` +... +[BOX64] New Instruction x64:0x3f00047fff, native:0xffc8d68628 +=> [BOX64] 0x3f00047fff: B8 00 00 00 00 MOV Reg, Id + ^--- wrong +[BOX64] 0xffc8d68628: 1 emitted opcodes, inst=631, barrier=0 state=0/1(0), set=0/0, use=0, need=80/80, fuse=0, sm=0(0/0), pred=630, last_ip=0x3f00047fed Q0:XMM0 + 0380000c ORI xRAX_r12, xZR, 0x0 +... +``` + +After changed the `balign` with `box64_pagesize`: +``` +diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c +index 2dadbda4..91b1df2e 100644 +--- a/src/elfs/elfloader.c ++++ b/src/elfs/elfloader.c +@@ -299,8 +299,8 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) + uint8_t prot = ((e->p_flags & PF_R)?PROT_READ:0)|((e->p_flags & PF_W)?PROT_WRITE:0)|((e->p_flags & PF_X)?PROT_EXEC:0); + // check if alignment is correct + uintptr_t balign = head->multiblocks[n].align-1; +- if(balign<4095) balign = 4095; +- head->multiblocks[n].asize = (e->p_memsz+(e->p_paddr&balign)+4095)&~4095; ++ if (balign < (box64_pagesize - 1)) balign = box64_pagesize - 1; ++ head->multiblocks[n].asize = (e->p_memsz + (e->p_paddr & balign) + (box64_pagesize - 1)) & ~(box64_pagesize - 1); + int try_mmap = 1; + if(e->p_paddr&balign) + try_mmap = 0; +``` + +Decoded `0x3f00047fff` correctly: +``` +... +[BOX64] New Instruction x64:0x3f00047fff, native:0xffc8d68628 +=> [BOX64] 0x3f00047fff: B8 01 00 00 00 MOV Reg, Id + ^--- correct +[BOX64] 0xffc8d68628: 2 emitted opcodes, inst=631, barrier=0 state=0/1(0), set=0/0, use=0, need=0/0, fuse=0, sm=0(0/0), pred=630, last_ip=0x3f00047fed Q0:XMM0 + 0380040c ORI xRAX_r12, xZR, 0x1 +... +``` + +Thanks, +Leslie Zhai \ No newline at end of file |