[PATCH v2] linux-gen: added wfe and wfet library functions#2256
[PATCH v2] linux-gen: added wfe and wfet library functions#2256sanvai01 wants to merge 2 commits intoOpenDataPlane:masterfrom
Conversation
Added wfe and wfet instruction library functions in wait_until header file Signed-off-by: Sanjyot Vaidya <Sanjyot.Vaidya@arm.com>
| _ODP_PRINT("%s\n", ndef); | ||
| #endif | ||
|
|
||
| _ODP_PRINT(" __ARM_FEATURE_WFXT "); |
There was a problem hiding this comment.
See my comment in PR 2257 about commit message and merge commits.
| } | ||
|
|
||
| static inline void | ||
| _odp_wait_until_equal_rel_u32(odp_atomic_u32_t *addr, uint32_t expected) |
There was a problem hiding this comment.
How is this function supposed/allowed to be different from _odp_wait_until_equal_32()? What does the rel part of this function indicate? In ODP, rel in a function name implies release memory ordering, but I cannot see what release ordering would mean in a function that does not stores. Or does ldxr synchronize with acquire loads in other threads? Even if it does, I am not sure providing a release type function would be useful. It could also be cumbersome for a generic C implementation, but since such is not provided in this PR, then why is this even a separate function in this aarch64 specific implementation?
| } | ||
|
|
||
| static inline void | ||
| _odp_wait_until_equal_32(odp_atomic_u32_t *addr, uint32_t expected) |
There was a problem hiding this comment.
Do we even need this function with a relaxed memory order? Aren't most (practically all?) concievable uses such that acquire is required? Maybe there is not need to introduce this new function until there is an actual user of it.
| __asm__ volatile("sevl" : : : "memory"); | ||
| do { | ||
| #ifdef __ARM_FEATURE_WFXT | ||
| __asm__ volatile("wfet %x0" : : "r"(100) : "memory"); |
There was a problem hiding this comment.
Why would WFET be useful here and better than WFE? If it is useful, then why not make the same change in the existing _odp_wait_until_equal_acq_u32() function?
Added wfe and wfet instruction library functions in wait_until header file