-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[LoongArch64] fix the building error for "PalInterlockedCompareExchange128" #108364
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
Conversation
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
|
Is |
The cas-128 instruction is only supported from 3A6000, which is added within ISA1.1. |
|
It means that this change will fix the build break, but there is a correctness problem at runtime on systems before 3A6000. The one place where this method is used requires the updates to be atomic. |
Yes, this is very clear.
If calling the libatomic which implements this by mutex_lock is not correct, I think there might be a correctness problem. |
Add a TODO comment and open an issue about this? |
OK, I will add a TODO and an issue later. |
The one and only place that calls runtime/src/coreclr/nativeaot/Runtime/CachedInterfaceDispatch.cpp Lines 69 to 70 in 3d9334c
It should be possible to create a variant of the calling code for platforms that are missing atomic 128-bit update. |
Since LA64's NativeAOT support is new (still yet to pass all tests), maybe we can make 3A6000 as LA64 baseline for AOT? |
|
Our default strategy is to have the same min supported hardware and OS versions for both regular CoreCLR and NAOT. You can certainly do something else for Loongarch, but you will have to explain these differences to Loongarch users. |
Thanks. I will add some TODO comments to explain, and try to add some compile arguments which only support the ISA1.1. |
Hi, @jkotas runtime/src/coreclr/nativeaot/Runtime/amd64/StubDispatch.S Lines 30 to 32 in 5d09a8f
Are these codes related with the CAS-128-bit data? |
|
Yes, this code is related to the 128-bit CAS update. If the code sees a new value of the first pointer, it needs to see the new value of the second pointer as well in subsequent read to maintain correctness. |
But now these code will hit the wrong value at the very low possibility. |
|
Right, the changes in this PR do not maintain this invariant that will lead to intermittent crashes. |
I agree with you. |
…he ISA's version is 1.1"
|
Fix included in #111086 |
fix the building error for "PalInterlockedCompareExchange128".