LATX: translate AES and VAES encryption rounds directly - #432
Open
luzeng87 wants to merge 6 commits into
Open
Conversation
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
Generate AESENC and AESENCLAST with scalar table-based IR2 instead of C helpers, and relocate the AES tables for AOT loading. Preserve memory and aliased round keys and release the consumed memory-address temporary before allocating the seven AES integer temporaries. This avoids corrupting the environment register on memory-source forms. Signed-off-by: Lu Zeng <luzeng87@gmail.com>
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
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
Bug
convert_mem()may reuse the physical GPR that still contains the cached AES table address. A following AES or VEX-AES instruction then sees the cache tag as valid and reads through the overwritten address. Two consecutive rounds using[base + index * scale]reproduced the failure.The memory-key loader now clears the table cache tag after emitting the load. The next direct round reloads the table address before using it.
Validation
meson test --suite lat-pr-fast --print-errorlogs: 24/24 passedgeekbench_avx2 --workload 101 --no-upload: hot AOT scores 745 and 741 on 3A6000-25gThe 3A6000-25g host does not provide clang, so the x86 assembly guests were built as static binaries on an x86 host and then executed by the final LATX binary. The registered integration runner skips when clang is unavailable.