-
Notifications
You must be signed in to change notification settings - Fork 69
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
[herd7,aarch64] A failed CAS may write back #1095
base: master
Are you sure you want to change the base?
Conversation
3996303
to
9958020
Compare
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.
Hi @artkhyzha
Thanks a lot for this, sorry a comment escaped my pending review on Friday ...
I have mainly stylistic comments, feel free not to follow them.
2667ce9
to
6401490
Compare
Thank you very much, @HadrienRenaud, the stylistic comments are much appreciated. I found them all helpful to apply. |
6401490
to
df8566d
Compare
Co-authored-by: Hadrien Renaud <[email protected]>
df8566d
to
fe6c738
Compare
@jalglave, this PR seems to be in a decent shape, so I am hoping to check with you how to best go about it. It essentially implements the outcomes of the investigation for the failed Overall, a few questions. Do we want more reviews before merging? Do we want to put |
Actually I was waiting for this PR merged to restart my work on |
Ah, super to hear that's something you are working on, @murzinv. Rebasing on top of this would be great, but also if you think another strategy could be more helpful, don't hesitate to let me know. |
As this seems reasonably mature, I'll be aiming to merge this by the end of the day. @HadrienRenaud, @jalglave, @murzinv -- if any reason not to merge this comes up, please let me know. |
@artkhyzha here is change for FEAT_MTE_STOREONLY . Feel free to cherry-pick in your series or I can make separate PR |
@artkhyzha should we do anything for |
Excellent point about CASP, @murzinv! This should have been within the scope, and its support should look similar. I'll update the PR. |
I've pushed an update for CASP essentially copying the solution for CAS. Perhaps, overly pedantically, but reading CASP description I am not sure CASP behaves exactly like CAS (i.e., has two options for present/absent Explicit Effect rather than, say, four). Hence, I'd like to hold off merging this for a little bit. |
Apologies, a follow-up to this fell between the cracks. I had concerns that perhaps there are more sophisticated single-copy atomicity rules. However, having double checked the letter of the Arm ARM and confirmed the reading of it with architects, I believe CASP is intended to always be single-copy-atomic to its full size, for both the read effect and the write effect (if the write effect does actually occur) -- or is subject to an alignment fault. To the best of my understanding, the current status of this PR treats CASP fairly. |
The objective of this PR is to amend the instruction semantics for CAS in case when its comparison fails. Broadly speaking, whenever a CAS fails its comparison, it is now allowed to read the original value in memory and then write the same value back. This has consequences: an Explicit Write Effect may be created, a Hardware Update might be created, (with FEAT_MTE_STOREONLY not supported by
herd7
presently) a TagCheck may be created.The following kinds of executions are expected of a failed CAS:
-variant vmsa
is enabled, that leads to generating a Hardware Update to the dirty bit.-variant vmsa
is enabled, a candidate execution with a Hardware Update to the dirty bit is generated.-variant vmsa
is enabled, a candidate execution without a Hardware Update to the dirty bit is generated.Note that the aforementioned three executions are archetypes: other "alternatives" affect the overall number of executions. Thus, for instance, the test
./herd/tests/instructions/AArch64.kvm/A019.litmus
has 5 rather than 3 executions.