riscv: detect Zicsr/Zifencei without leading underscore - #468
Draft
rootkiller6788 wants to merge 1 commit into
Draft
riscv: detect Zicsr/Zifencei without leading underscore#468rootkiller6788 wants to merge 1 commit into
rootkiller6788 wants to merge 1 commit into
Conversation
The kernel riscv,isa binding allows the first multi-letter extension to omit its leading underscore (e.g. rv64imafdczicsr_zifencei). The parser looked for "_zicsr" and "_zifencei" with the underscore, so those extensions were missed when the first multi-letter extension dropped the underscore. Match them without the underscore to catch both spellings. Also update the comment to the current devicetree binding regex and add regression tests for the underscore-less and canonical spellings.
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.
Fixes #301
The Linux devicetree
riscv,isabinding (cpus.yaml) allows the first multi-letter extension to omit its leading underscore, so a valid isa string can look likerv64imafdczicsr_zifencei. The parser insrc/impl_riscv_linux.clooked for_zicsrand_zifencei(with a leading underscore), so when the first multi-letter extension dropped the underscore, Zicsr and Zifencei were silently missed.Changes:
zicsr,zifencei), which still matches the canonical_zicsr/_zifenceispelling.cpus.yamlregex (^rv(?:64|32)imaf?d?q?c?b?k?j?p?v?h?(?:[hsxz](?:[a-z])+)?(?:_[hsxz](?:[a-z])+)*$).rv64imafdczicsr_zifencei,rv64imafdczifencei, and the canonicalrv64imafdc_zicsr_zifencei.Verified: the two underscore-less tests fail on the old parser and pass with this change; all existing riscv tests still pass.