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

Question on interactions with SFENCE.VMA #204

Closed
gameboo opened this Issue Jun 28, 2018 · 7 comments

Comments

Projects
None yet
2 participants
@gameboo
Copy link
Contributor

gameboo commented Jun 28, 2018

In the current spec, from what I understand so far:

  • writes to ptes in memory need to be synchronized with sfence.vma
  • writes to pmp csrs need to be synchronized with sfence.vma
  • writes to the satp csr do not need to be synchronized with sfence.vma edit: to clarify, here, what I mean is that the very next instruction fetch following a write to satp that enable translation should be translated.

I simply want to confirm that this is indeed how the spec should be understood, as it felt slightly odd to me that pmp csrs need explicit synchronization and satp does not, implying some sort of microarchitectural support (probably a pipeline bubble in the most trivial implementations).

Thanks.

@aswaterman

This comment has been minimized.

Copy link
Member

aswaterman commented Jun 28, 2018

Yes, that's all true.

@gameboo

This comment has been minimized.

Copy link
Contributor

gameboo commented Jun 29, 2018

Ok, sounds good, thanks.

Out of curiosity, why is it that we are happy with the PMP being "less strict" (for lack of a better way to phrase it) than satp?

@aswaterman

This comment has been minimized.

Copy link
Member

aswaterman commented Jun 29, 2018

Mostly to make it easier to cache the PMPs inside cache tags, TLB entries, etc. satp itself doesn't get cached anywhere.

@gameboo

This comment has been minimized.

Copy link
Contributor

gameboo commented Jul 1, 2018

ok. thanks.

@gameboo gameboo closed this Jul 1, 2018

@gameboo

This comment has been minimized.

Copy link
Contributor

gameboo commented Jul 1, 2018

Just realised I wanted to confirm something else on the same topic:
Say I have valid PTEs in a cache of some sort, and I update the PMP in such a way that I would no longer be allowed to fetch those PTEs. It is valid behaviour to still hit on those PTEs after the PMP update despite the fact that access to the PTEs is now forbidden, and this until an SFENCE.VMA instruction with rs1=x0 and rs2=x0 is executed. Correct?

@gameboo gameboo reopened this Jul 1, 2018

@wsong83 wsong83 referenced this issue Jul 2, 2018

Merged

bi-weekly 2018-07-06 #93

7 of 7 tasks complete
@aswaterman

This comment has been minimized.

Copy link
Member

aswaterman commented Jul 2, 2018

Yeah that's right.

@gameboo

This comment has been minimized.

Copy link
Contributor

gameboo commented Jul 3, 2018

Great thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment