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(CSR): correct the width of PC pgaddr for inst fetch exception #3795

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cebarobot
Copy link
Member

We found that the CSR mtval2 truncates the high bits of gpaddr when GPF occurs in instruction fetching. Actually, there is an GPAMem which storages the whole 64-bit gpaddr, but it does not pass to CSR correctly, due to incorrect width of trapPCGPA in module NewCSR and bundle TrapEntryEventInput. This patch fixes this.

@cebarobot cebarobot marked this pull request as draft October 28, 2024 14:46
@XiangShanRobot
Copy link

[Generated by IPC robot]
commit: a615ec7

commit astar copy_and_run coremark gcc gromacs lbm linux mcf microbench milc namd povray wrf xalancbmk
a615ec7 1.917 0.450 2.699 1.203 2.823 2.460 2.395 0.913 1.373 1.611 3.418 2.742 2.420 3.263

master branch:

commit astar copy_and_run coremark gcc gromacs lbm linux mcf microbench milc namd povray wrf xalancbmk
9a07878
c3d62b6 1.928 0.450 2.699 1.190 2.823 2.460 2.395 0.913 1.373 1.611 3.418 2.742 2.420 3.263
a6da536 1.917 0.450 2.699 1.204 2.823 2.460 2.395 0.913 1.373 1.611 3.418 2.742 2.420 3.263
b3c3582 1.928 0.450 2.699 1.190 2.823 2.460 2.395 0.913 1.373 1.611 3.418 2.742 2.420 3.263
faf7d50 1.928 0.450 2.699 1.195 2.823 2.460 2.395 0.913 1.373 1.611 3.418 2.742 2.420 3.263

@cebarobot cebarobot marked this pull request as ready for review October 30, 2024 13:43
@XiangShanRobot
Copy link

[Generated by IPC robot]
commit: 073eb2c

commit astar copy_and_run coremark gcc gromacs lbm linux mcf microbench milc namd povray wrf xalancbmk
073eb2c 1.917 0.450 2.699 1.193 2.823 2.460 2.395 0.913 1.373 1.611 3.418 2.742 2.420 3.263

master branch:

commit astar copy_and_run coremark gcc gromacs lbm linux mcf microbench milc namd povray wrf xalancbmk
cb62726
3bfc01b
dcf4211 1.920 0.451 2.701 1.192 2.818 2.460 2.397 0.918 1.428 1.611 3.435 2.749 2.418 3.263
e9d45a6
20ee0fb

@ngc7331 ngc7331 requested a review from Gao-Zeyu October 31, 2024 08:47
cebarobot and others added 3 commits November 12, 2024 11:08
We found that the CSR mtval2 truncates the high bits of gpaddr when GPF occurs in instruction fetching. Actually, there is an GPAMem which storages the whole 64-bit gpaddr, but it does not pass to CSR correctly, due to incorrect width of trapPCGPA in module NewCSR and bundle TrapEntryEventInput. This patch fixes this.
The paddr genereted by VS Stage could only be 56 bits. So we could reduce the datapath width of IGPF tval2.

Besides, tval2/gpaddr could be over 56 bits only when an jump occurs and only G stage is enabled. This is handled by backend and not use this datapath.
@XiangShanRobot
Copy link

[Generated by IPC robot]
commit: 8f7529a

commit astar copy_and_run coremark gcc gromacs lbm linux mcf microbench milc namd povray wrf xalancbmk
8f7529a 1.917 0.450 2.701 1.228 2.891 2.473 2.398 0.915 1.429 1.700 3.470 2.729 2.417 3.280

master branch:

commit astar copy_and_run coremark gcc gromacs lbm linux mcf microbench milc namd povray wrf xalancbmk
4e7f257 1.917 1.237 2.891 2.473 0.915 1.700 3.470 2.417 3.280
393755c 1.917 0.450 2.701 1.239 2.891 2.473 2.398 0.915 1.429 1.700 3.470 2.729 2.417 3.280
e7ab463 1.917 0.450 2.701 1.229 2.891 2.473 2.398 0.915 1.429 1.700 3.470 2.729 2.417 3.280
4376b52 1.917 0.450 2.701 1.233 2.891 2.473 2.398 0.915 1.429 1.700 3.470 2.729 2.417 3.280
68838bf 1.920 0.450 2.701 1.234 2.891 2.473 2.398 0.915 1.429 1.700 3.470 2.729 2.417 3.280

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