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(store): make cross-page access consistent with XiangShan behavior #66

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

Anzooooo
Copy link
Member

@Anzooooo Anzooooo commented Dec 5, 2024

When spike processes a cross-page store, it will be split into two stores and the two stores are independent of each other.
This means that if the store on the lower page can be completed and the store on the upper page triggers a PF exception, the store on the lower page will still be written to memory, and a PF exception will be triggered using the store on the upper page.
For XiangShan, this store instruction can only be completed normally if both stores of the cross-page store can be completed normally.
This modification aligns Spike with XiangShan in the case of CPU = XiangShan.

@Anzooooo Anzooooo requested a review from cebarobot December 5, 2024 14:32
@cebarobot cebarobot merged commit 823b509 into difftest Dec 5, 2024
3 checks passed
@cebarobot cebarobot deleted the fix-cross branch December 5, 2024 14:34
@poemonsense
Copy link
Member

Is this a bug in Spike?

@Anzooooo
Copy link
Member Author

Anzooooo commented Dec 9, 2024

Is this a bug in Spike?

I can't be sure exactly, because the specification doesn't say anything specific about Zicclsm. And we can't be sure if Spike is doing the right thing.
Our understanding is that if the software handles cross-page misalignment, it will also split the cache into a low page and a high page. If the low page can be accessed normally, it will be accessed normally. If the high page is page fault , an exception will be generated for the high page.
However, this does not prove anything, maybe I should raise an issue in Spike.

@poemonsense
Copy link
Member

However, this does not prove anything, maybe I should raise an issue in Spike.

It's better to ask this in Spike.

I think it look strange for an instruction to partially take effect when it causes an exception.

@Anzooooo
Copy link
Member Author

Anzooooo commented Dec 9, 2024

However, this does not prove anything, maybe I should raise an issue in Spike.

It's better to ask this in Spike.

I think it look strange for an instruction to partially take effect when it causes an exception.

okk

@Anzooooo
Copy link
Member Author

However, this does not prove anything, maybe I should raise an issue in Spike.

It's better to ask this in Spike.

I think it look strange for an instruction to partially take effect when it causes an exception.

It's legal, see:
riscv-software-src#1867 (comment)

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.

3 participants