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

Clarification Needed: Concerns Regarding PMP Changes Without HFENCE.VVMA Usage #1795

Closed
Wangrodman opened this issue Jan 10, 2025 · 4 comments

Comments

@Wangrodman
Copy link

Wangrodman commented Jan 10, 2025

image

HFENCE.VVMA targets VS-stage translation, while HFENCE.GVMA targets G-stage translation.

I have concerns about the above description regarding PMP changes. PTE caching is a common practice in MMUs, meaning that PTEs accessed implicitly during VS-stage translation can be cached. If the PMP settings for the address of a cached PTE are changed, the new settings will not be visible to the cached entry.

As a result, the expected trap will not occur because the cached PTE will be used without checking the new settings.
In this case, whether a fault should occur is undefined, correct? If the software requires consistent and predictable protection, HFENCE.VVMA should be executed. This responsibility should be documented in the software guidelines by whoever provides a product that includes the PTE cache.

@aswaterman
Copy link
Member

The spec clearly states that HFENCE.GVMA suffices and HFENCE.VVMA is not required. There is no problem here.

HFENCE.VVMA targets VS-stage translation, while HFENCE.GVMA targets G-stage translation.

This is not entirely correct. As noted above, HFENCE.GVMA suffices in this case, meaning that in certain cases it is more powerful than you presume.

@Wangrodman
Copy link
Author

Wangrodman commented Jan 10, 2025

HFENCE.VVMA targets VS-stage translation, while HFENCE.GVMA targets G-stage translation.

This is not entirely correct. As noted above, HFENCE.GVMA suffices in this case, meaning that in certain cases it is more powerful than you presume.

Do you mean that implicit G-stage is also targeted by HFENCE.GVMA?
If so, it makes sense that GVMA is sufficient.

@aswaterman
Copy link
Member

Do you mean that implicit G-stage translation is also targeted by HFENCE.GVMA?

No. I only mean to say that the spec clearly states that this particular case is covered by HFENCE.GVMA. I am not making a broader statement.

@aswaterman
Copy link
Member

Closing this issue, since the spec is crystal clear.

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

No branches or pull requests

2 participants