LATX, fix: Handle mixed 16K writes for Minke - #425
Open
ganjue66da wants to merge 2 commits into
Open
Conversation
The LATX_MT compatibility path walks the page-flags interval tree for every instrumented memory access. That is too expensive for applications which need exact guest 4K write checks on a 16K host. Allocate compact byte tables for guest 4K writability and mixed host 16K pages only after LATX_MT is enabled. Generated stores normally need one table lookup and consult the exact 4K entry only for mixed host pages. Disabled configurations retain no large tables or CPU state pointers and emit no additional guest memory checks. Do not enable LATX_MT automatically. Default translations remain uninstrumented, while affected applications can opt in explicitly. Tests: - default and LATX_MT=1 atomic-lock-stress-test - LATX_MT=1 Minke.MI.Organ.exe reached the rendered login window Signed-off-by: Wenqiang Wei <weiwenqiang@mail.ustc.edu.cn>
Minke.MI.Organ.exe uses a fixed Wine helper and small generated code mappings whose stores may cross guest 4K permission boundaries on a 16K host. Without precise checks, a write can miss the fault needed to create a shadow page and the application fails during startup. Add the explicit LATX_MINKE_16K_PAGE_CHECK option. On a 16K host it is accepted only for Minke.MI.Organ.exe, allocates the application TB map, and instruments the fixed helper page and small executable mappings recorded by mmap and mprotect. Other applications and disabled configurations remain on the normal uninstrumented path. This avoids the global LATX_MT cost while retaining the precise write fault where the application requires it. Tests: - 16K host: selective checks reached the rendered login window with LATX_MT=0 - 4K host: default and explicit-option atomic-lock-stress-test Signed-off-by: Wenqiang Wei <weiwenqiang@mail.ustc.edu.cn>
ganjue66da
force-pushed
the
codex/minke-16k-write-checks
branch
from
August 25, 2026 03:55
9159bd7 to
2ee0fee
Compare
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.
Motivation
Minke can issue writes that cross or mix 16K guest-page boundaries. The existing fast checks did not consistently route those writes through the path that maintains translated-code and shadow-memory coherence.
Changes
Validation
ninja -C build32 latx-i386ninja -C build64 latx-x86_64LATX_MT=1.4000000operations with the expected counter value.Scope
The two commits cover the same 16K write-checking path: the first removes redundant checks and the second fixes the Minke boundary case.