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

realm/mm: Correct setting of RIPAS=EMPTY on ASSIGNED_EMPTY RTTEs #425

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Skryptonyte
Copy link
Contributor

Currently, if RTT_SET_RIPAS were to be run on ASSIGNED_EMPTY RTTEs with the requested RIPAS being EMPTY, the HIPAS would unexpectedly change to UNASSIGNED. The expected behaviour is that the entry states should remain unchanged.

To fix this, the PR does the following:

  1. Change the first case under the EMPTY request to handle UNASSIGNED_RAM instead of UNASSIGNED_EMPTY.
  2. Add a fallback case which will handle both UNASSIGNED_EMPTY and ASSIGNED_EMPTY i.e the entries will be left unchanged.

This will hence mirror the code where the requested RIPAS is RAM instead.

Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com>
Comment on lines 384 to -387
if ripas as u64 == invalid_ripas::EMPTY {
new_s2tte |= bits_in_reg(S2TTE::INVALID_RIPAS, invalid_ripas::EMPTY);

if s2tte.is_unassigned_empty() {
Copy link
Collaborator

@nook1208 nook1208 Apr 2, 2025

Choose a reason for hiding this comment

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

if RTT_SET_RIPAS were to be run on ASSIGNED_EMPTY RTTEs with the requested RIPAS being EMPTY

I think this is not the case that you mention. The current code (AS-IS code) is from UNASSIGNED_EMPTY to UNASSIGNED_EMPTY which it means do nothing. Although that's not a problem, It looks good to use 'continue' in the
'else' condition like you did 👍

And it seems that the case which is from UNASSIGNED_RAM to UNASSIGNED_EMPTY was missing. It's nice to be added. Thank you !

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