Fix systests#35
Merged
Merged
Conversation
9911843 to
aee9655
Compare
androm3da
reviewed
Jun 10, 2026
androm3da
reviewed
Jun 10, 2026
The previous tlbp64 split the 64-bit lookup key into two uint32_t halves and probed each separately. Each probe used `"r"(<uint32_t>)` as the inline-asm constraint, which made the compiler allocate a single 32-bit register. The assembler's `tlbp` mnemonic is operand-width-driven: a single 32-bit register selects the legacy Y2_tlbp instruction (which only searches legacy TLB entries at indices 0-511); a 64-bit register pair (Rss) selects Y2_tlbpp (which searches the full TLB including HSV39 extended entries at indices 512+). The hsv39_tlb test writes its TLB entries at indices >=512. The old tlbp64 always emitted Y2_tlbp and so never found those entries, making the test fail with bogus TLB_NOT_FOUND results. Pass the lookup key as a single uint64_t. This forces a register pair and makes the assembler emit Y2_tlbpp. Signed-off-by: Marco Liebel <marco.liebel@oss.qualcomm.com>
aee9655 to
030bc8c
Compare
androm3da
approved these changes
Jun 10, 2026
hsv39.h's HSV39_PageSize, TLBEntry64, hsv39_make_tlb_entry(), and hsv39_write_tlb_entry() were locally redefined when __HEXAGON_ARCH__ was 80 or earlier. But the only consumer of this header is hsv39_tlb.c, which is forced to build with -mv81 by CMakeLists.txt (the next commit). So the fallback was unreachable in practice. The fallbacks were also semantically wrong: the local TLBEntry64 omitted the HSV39:1 bit field that the toolchain's version sets, so even if reached the fallback would have produced incorrect TLB entries. Delete them. The toolchain's tlb.h provides the correct definitions when __HEXAGON_ARCH__ > 80. Keep pow4() — it is used directly by hsv39_tlb.c, not just by the deleted helpers. Signed-off-by: Marco Liebel <marco.liebel@oss.qualcomm.com>
hsv39_tlb's tlbp64() probes HSV39 extended TLB entries by passing a 64-bit register pair to the tlbp mnemonic, which the assembler encodes as Y2_tlbpp. That instruction form requires -mv81, while the suite otherwise defaults to -mv68. Add compile and link options for hsv39_tlb only, leaving the global HEXAGON_ARCH and unrelated tests unchanged. Signed-off-by: Marco Liebel <marco.liebel@oss.qualcomm.com>
030bc8c to
81bbccd
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.
No description provided.