Repository navigation
PSX3DS v0.2.3 — Real New 3DS ARM11 L1 I-Cache Fix & Dedicated SD Scan Folders
PSX3DS v0.2.3 — Real New 3DS ARM11 L1 I-Cache Invalidation, VIPT & 32B JIT Alignment, SP Guard, and Dedicated SD Scan Folders
v0.2.3 fixes a real-hardware New 3DS XL (Luma3DS) prefetch abort (Permission - Section) crash during JIT execution (PC = 0x08067E70, LR = 0x001378D8) and restricts SD card ROM/BIOS scanning to dedicated PS1 folders instead of scanning the SD root.
English Release Notes
Root Cause Fixed from Real-Hardware v0.2.2 Crash Dump (PC = 0x08067E70, SP = 0x0803DEA0)
- On real ARM11 MPCore hardware,
svcFlushProcessDataCacheonly cleans the L1 D-Cache out to FCRAM without invalidating the separate 32 KiB 4-way (8 KiB/way) VIPT L1 Instruction Cache or branch target buffer. - Inside a newly compiled JIT block,
emit_callexecutedpush {r12, lr}(SP: 0x0803DE80 -> 0x0803DE78) and then crossed a 32-byte ARM11 L1 I-Cache line boundary into a cache line that still held stale0x00000000(andeq r0, r0, r0=NOP) words cached by earlier instruction prefetching across 4-byte-packed blocks. - Executing
blx r12andpop {r12, lr}asNOPs leftLR = 0x001378D8(psx_run_frame + 0x778) untouched andSPshifted by-8bytes atjit_exit, causingpop {r4-r12, pc}to popsaved_r11 = 0x08067E70(sys + 0xb000, non-executable heap data) intoPCwhile leaving[0x0803DEA0] = 0x08931D30(saved_r12) and[0x0803DEA4] = 0x001378D8(saved_lr) at[SP].
What's New in v0.2.3
- ARM11 L1 I-Cache & Branch Predictor Invalidation on Every JIT Commit (
jit_mem_commit):- Flushes 32-byte aligned D-Cache lines for both the
m->rwview andm->rxmirror, invalidates the ARM11 L1 I-Cache + BTB via Luma3DSsvc 0x94(svcInvalidateEntireInstructionCache, withr0-r3, r12clobbers; or the 128 KiB NOP eviction sled on non-Luma hardware), and executes EL0-safeDSB(c7, c10, 4) +ISB(c7, c5, 4).
- Flushes 32-byte aligned D-Cache lines for both the
- 16 KiB VIPT Cache-Color Alignment & 32-Byte JIT Block Alignment:
jit_mem_alloc()now allocatesm->rwviamemalign(0x4000, size)(16 KiB >= 8 KiB/way) to match the 1 MiB-alignedm->rxmirror across all ARM11 VIPT cache colors (VA bits[13:12]).arm_jitnow aligns and zero-pads every emitted native block to a 32-byte ARM11 cache-line boundary (((uintptr_t)entry & 31) == 0).
- Hardware
SPGuard Acrossjit_enter/jit_exit*(jit_thunks.S):jit_entersaves the exact host stack pointer atcpu->jit_saved_sp([r11, #0x270]), and all 4 exit paths (jit_exit,jit_exit_step_one,jit_exit_with_reason,jit_raise_exception_exit) restoreldr sp, [r11, #0x270]immediately beforepop {r4-r12, pc}.
- Dedicated SD Card ROM & BIOS Scan Folders (No Full SD Root Scan):
1:ROMSnow scans onlysdmc:/psx3ds/roms,sdmc:/roms/psx, andsdmc:/psx(sdmc:/root is never scanned).- External BIOS auto-detection scans only
sdmc:/psx3ds/bios,sdmc:/bios, and those three PS1 ROM folders.
中文更新说明 (v0.2.3)
- 修复 New 3DS 实机 ARM11 L1 指令缓存(I-Cache)未失效导致的
PC = 0x08067E70崩溃:- 每次编译提交 JIT 代码块(
jit_mem_commit)时,同步刷写m->rw与m->rx的数据缓存(D-Cache),并通过 Luma3DSsvc 0x94使 ARM11 L1 指令缓存与分支预测器(BTB)失效,随后执行DSB + ISB内存与指令屏障。 - JIT 读写缓冲区升级为 16 KiB 对齐(
memalign(0x4000, size)),消除 ARM11 32 KiB 4-way(8 KiB/way)VIPT 缓存颜色别名;所有 JIT 代码块统一按 32 字节缓存行边界对齐与填充。 jit_enter/jit_exit*新增硬件栈指针保护([r11, #0x270]保存与恢复SP),确保pop {r4-r12, pc}永不错位。
- 每次编译提交 JIT 代码块(
- 精简 SD 卡扫描目录(不再扫描 SD 卡根目录):
1:ROMS游戏列表现仅扫描sdmc:/psx3ds/roms、sdmc:/roms/psx与sdmc:/psx(外置 BIOS 仅扫描sdmc:/psx3ds/bios、sdmc:/bios及上述游戏目录),大幅加快大肚量 SD 卡启动与刷新速度。