Skip to content
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

Make sure that sc after failure sc fails #465

Closed

Conversation

mohanson
Copy link
Contributor

@mohanson mohanson commented Apr 6, 2023

Regardless of success or failure, executing an SC.W instruction invalidates any reservation held by this hart. So sc after failure sc must fails.

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't work. It gets stuck in an infinite loop when executed on Spike because the first SC is to a different address than the LR.

@mohanson
Copy link
Contributor Author

mohanson commented Apr 7, 2023

I mistakenly used an old lrsc binary for testing. I have fixed this.

@aswaterman
Copy link
Collaborator

aswaterman commented Apr 7, 2023

I don't think this version is correct, either, even though it now passes on Spike. The problem is that implementations are allowed to reserve more than one word of memory on an LR, so the SC might succeed on some implementations even though the addresses differ. On such implementations, this version will loop forever.

I made a version of this that does work in general, by piggy-backing on the previous test, which does contain an SC that we know will fail by construction. 394937e

@mohanson
Copy link
Contributor Author

mohanson commented Apr 7, 2023

Your version is better, this PR no longer needs to open.

@mohanson mohanson closed this Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants