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

Fix rare TLB refill/invalidate race condition #2534

Merged
merged 2 commits into from
Jun 25, 2020

Conversation

aswaterman
Copy link
Member

If an SFENCE.VMA with rs1 != x0 or rs2 != x0 happens on the same cycle as an I-TLB refill, the refill still occurs, even if the SFENCE.VMA should've flushed the entry being refilled.

SFENCE.VMA with rs1=x0 and rs2=x0 is unaffected.

It's exceedingly difficult to manifest this bug. We found it by inspection (thanks @khannaudit), not by observing it in the wild.

If an SFENCE.VMA with rs1 != x0 or rs2 != x0 happens on the same cycle
as an I-TLB refill, the refill still occurs, even if the SFENCE.VMA
should've flushed the entry being refilled.

SFENCE.VMA with rs1=x0 and rs2=x0 is unaffected.

It's exceedingly difficult, but possible, to manifest this bug.  We found
it by inspection (thanks @khannaudit), not by observing it in the wild.
This signal is sometimes slow to compute, so avoid fanning it out to the
clock-enables for the entire TLB.  Instead, make only the valid signals
depend on its output.
@aswaterman aswaterman merged commit f5889ed into master Jun 25, 2020
@aswaterman aswaterman deleted the fix-sfence-refill-race branch June 25, 2020 20:47
hcook pushed a commit that referenced this pull request Aug 4, 2020
Fix rare TLB refill/invalidate race condition
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