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

target/riscv: move read redirection for priv to riscv-013.c #997

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

en-sc
Copy link
Collaborator

@en-sc en-sc commented Jan 17, 2024

The reason for the change is a conflict: dcsr[5] is dcsr.v in current spec, but it is dcsr.debugint in 0.11. This causes priv register to be read incorrectly.

Change-Id: If2d8fdcd8536afa4c7149c453101b00ce0df1ce0

@en-sc
Copy link
Collaborator Author

en-sc commented Jan 17, 2024

@lz-bro, FYI.

@TommyMurphyTM1234
Copy link
Collaborator

Confirmed as working with SiFive HiFive1 Rev A01:

@JanMatCodasip
Copy link
Collaborator

FYI, I will probably be able to review this on Monday.

Copy link
Collaborator

@MarekVCodasip MarekVCodasip left a comment

Choose a reason for hiding this comment

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

Otherwise, it looks fine to me.

src/target/riscv/riscv-013.c Outdated Show resolved Hide resolved
The reason for the change is a conflict: `dcsr[5]` is `dcsr.v` in
current spec, but it is `dcsr.debugint` in 0.11. This causes `priv`
register to be read incorrectly.

Change-Id: If2d8fdcd8536afa4c7149c453101b00ce0df1ce0
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
@JanMatCodasip
Copy link
Collaborator

Let's merge this on Thursday if no other feedback comes.

@JanMatCodasip
Copy link
Collaborator

TommyMurphyTM1234: Confirmed as working with SiFive HiFive1 Rev A01: [...]

Thanks for checking it. 👍

@JanMatCodasip JanMatCodasip merged commit ec28cf0 into riscv-collab:riscv Jan 25, 2024
4 checks passed
@lz-bro
Copy link
Contributor

lz-bro commented Jan 25, 2024

Need to move write register for priv to riscv-013.c?

@en-sc
Copy link
Collaborator Author

en-sc commented Jan 26, 2024

Need to move write register for priv to riscv-013.c?

@iz-bro, this is a valid concern. However, I've decided not to move the write in this commit.
The reasoning is:

  • This is a bug-fix. Bug is related to reading the register, not writing it.
  • Assuming the other code is correct, only a user-requested write can cause an issue with writing dcsr[5] via writing priv on 0.11.

I'm currently working on a patch that significantly changes register accesses. I will post a PR changing the code in question soon. So, I would like not to change current version too much to avoid doing extra work).

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.

5 participants