Repository navigation
Conversation
rmjskhy
force-pushed
the
temp2
branch
3 times, most recently
from
September 1, 2026 01:20
0a19fe3 to
a0ea94b
Compare
Build the pinned standalone translator with the LATU host adapter. Add the required hard/soft x87 and deferred-RSP recovery ABI together with block selection, strict failure handling and cached runtime options. These pieces are inseparable when using the current Quicktrans submodule.
Use the machine-code end offset to locate the existing Quicktrans recovery table instead of encoding a duplicate during TB finalization.
Allow the translated instruction-pattern policy to follow the LATU startup option.
Convert hard floating-point operands around BCD helpers and avoid applying the helper stack update twice.
Reuse available operands while computing overflow flags so the legacy translator stays within its temporary-register budget.
Handle large PR_SET_VMA ranges without unnecessary page-by-page work.
Validate eligible single-page Quicktrans blocks under their jump lock. Defer ptrace invalidation notifications across that lock and drain them before executing translated code. Keep the original lookup for unsupported configurations and include the ptrace regression.
Keep page consistency checks in assertion-enabled builds without performing unused page queries in release builds.
Treat search-table encoding exhaustion as code-region exhaustion and use the existing allocation retry instead of reporting an unsupported instruction.
Use compact headers only for strict non-bridge Quicktrans blocks while preserving host-PC lookup and existing alignment for other translation paths.
Do not reuse the shared EGL fallback when EGL initializes first. Resolve GLX functions using the owning GL library to avoid mixing graphics dispatch providers.
…ranslator Recognize registered one-instruction bridges before entering strict Quicktrans. Their INT3 stubs represent native calls rather than guest breakpoint instructions.
Select Quicktrans by default when compiled in. Preserve the environment override for the legacy path and the existing strict-mode override.
Record the map and bucket sequence on a consistent miss. Skip the second lookup only while RCU protection, writer serialization and the trace state establish that the miss remains valid.
Use per-page lists for single-page translations and retain an interval tree for crossing blocks. Keep all operations under the mapping lock and reclaim empty index nodes.
Narrow label offsets and SMC flags in the supported TBMini configuration. Preserve the previous split allocation footprint to avoid changing block placement.
Let tu_reset_tb initialize fields already covered by that routine. Keep the explicit initialization in builds without TU support.
Use the existing TU and signal-relink flags directly in the protected linking path instead of repeating helper access.
Use the fast reset only in the supported exclusive full-flush context. Guard signal invalidation during the flush, retain sequence updates, and fall back when table capacity differs.
On LoongArch, issue one release fence before relaxed atomic unlocks after all protected writes finish. Keep the regular lock API for thread-sanitizer builds.
Select the reviewed follow-up commits that reuse fetched page permissions and avoid duplicate decoder-field initialization. Keep the public submodule URL and open-source update branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 变更说明
--enable-latx-fast-translator。默认不编译 Quicktrans;使用./latxbuild/build64.sh -f时才编译。LATX_FAST_TRANSLATOR=1才会启用快速翻译。tr_disasm()解码和翻译。LATX_FAST_TRANSLATOR_STRICT=1下,Quicktrans 翻译失败时立即停止,便于查找尚未支持的指令。LATX_FAST_TRANSLATOR_TRACE_MISSES=1下,打印 Quicktrans 的失败位置、阶段和原因,并说明老解码器能否接受该指令。option_aot和option_load_aot的默认值设为0,避免默认生成或加载 Quicktrans 尚未支持的 AOT 代码。target/i386/latx/translator/中原有的指令翻译函数。Validation / 验证
执行了以下构建和测试:
在 x86 主机执行
make -j2,确认latx-base-test已正确编译。在 LoongArch 主机执行默认构建:
在 LoongArch 主机执行快速翻译构建:
./latxbuild/build64.sh -c -f
完整构建通过,Quicktrans 生成器和一致性检查均通过。
在 Quicktrans 仓库执行:
make test
所有测试通过。
使用 smoke-exit 验证快速翻译入口,日志确认指令实际进入 Quicktrans,程序正常退出。
使用独立的临时 HOME 运行快速翻译版本。未设置 LATX_AOT 时没有生成 AOT 文件,确认 option_aot 和 option_load_aot 默认关闭。
执行 latx-base-test daily 测试:
LATX_FAST_TRANSLATOR=1 ./run-tests.py
--latx /mnt/disk_a/lat-github/lat/build64/latx-x86_64
--tier daily -j 2
结果:
instr-retf 在关闭 Quicktrans 后仍以相同方式失败,输出为
FAIL:retfq_target 和 FAIL:retfq_rsp,确认它是目标分支原有问题,不是本次修改引入。
git diff --check 通过。
Checklist / 检查项
I have read CONTRIBUTING.md. / 我已阅读 CONTRIBUTING.md。
Every commit contains a DCO sign-off (git commit -s). /
每个提交都包含 DCO 签署(git commit -s)。
当前提交尚未包含 Signed-off-by。需要由提交作者确认并使用
git commit --amend --signoff 补充 DCO 签署。
I have included relevant build or test results, or explained why they
are not applicable. /
我已提供相关构建或测试结果,或说明了不适用的原因。