-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arch/arm64: mem barrier interface Align with riscv #15072
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: lipengfei28 <[email protected]>
[Experimental Bot, please feedback here] This PR does not fully meet the NuttX requirements yet. While it provides a summary and mentions impact and testing, it lacks crucial details. Here's a breakdown: Missing/Insufficient Information:
To make this PR compliant, the author needs to:
By providing this missing information, the PR will meet the NuttX requirements and enable reviewers to effectively evaluate the proposed changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree with this change. ISB, DMB and DSB are well documented ARM/ARM64 instructions, so the naming is coherent already.
If you insist, you can remove the ARM64_ prefix, but even that is unnecessary IMO, as it would require updating all downstream code as well for no benefit.
Can you explain what is the motivation for this change? Why must we use similar names to RISC-V in arch specific code?
If you want to share the same driver around the different arch, it's important to keep this basic operation same around all arch. |
If a common set of barrier macros are needed in the common kernel drivers, then you can define a common set of macros that the arch specific macros are forwarded to, instead of renaming the existing ones. |
Why do you insist keep two set of macros (__DSB and ARM64_DSB/RISCV_DSB) which has the same functionality? developers may randomly select one to use, which just make the confusion and inconsistence. |
@@ -179,8 +179,8 @@ static int create_spgtables(arch_addrenv_t *addrenv) | |||
|
|||
/* Synchronize data and instruction pipelines */ | |||
|
|||
ARM64_DSB(); | |||
ARM64_ISB(); | |||
__MB(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lipengfei28 let's change to UP_MB or up_mb to indicate the barrier macro is the standard API between kernel/driver and arch. and replace ALL SP_XXX with the new macros
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,I will change to UP_MB as standard API,
Because ISB, DMB and DSB are arch specific instructions. The barrier macro names (DMB and ISB) are poorly chosen for risc-v as it does not have these instructions (fence with params is used instead). I think in arch specific code it is fine to use ISB DSB and DMB because like I said they are well documented ARM/ARM64 instructions. If generic barrrier macros are needed in the common kernel code, UP_MB and such is better like you said. If you insist we remove the arch specific macros then go ahead but I don't see the confusion, as they are macros for well known ARM instructions |
arch/arm64: mem barrier interface Align with riscv
Impact
Update this section, where applicable, on how change affects users,
build process, hardware, documentation, security, compatibility, etc.
Testing
Update this section with details on how did you verify the change,
what Host was used for build (OS, CPU, compiler, ..), what Target was
used for verification (arch, board:config, ..), etc. Providing build
and runtime logs from before and after change is highly appreciated.