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 reporting traps (faults) to GDB in SE mode #166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it should be as @janvrany says, and empirically, it happens to be so on every physical RISC-V machine I have around here.
Still, there may be some reason why we are both wrong; @gabemblack what was your rationale for adding lines 167, 168?
Looking at failed test, I do not really understand what went wrong... Has anyone any idea? |
I think the VM running the tests died. Can you rebase and force push to update the branch? This will kick off the tests again. |
Well I did a CI re-run yesterday and it didn't make any difference. So yeah, very strange. |
Ah, it's hitting a timeout. I'm not totally sure why... I would try running the test that it failed on @mkjost0, do you have any suggestions on diagnosing this? |
88cb0d3
to
6a3ec97
Compare
@powerjg I did run
on my machine and it terminated successfully after ~20 secs. |
Let's see if it works this time. Maybe we got unlucky and ran on a really slow CI core or something. |
@powerjg I think it got stuck again. Is there a way I can run a single testcase timing-cpu_2-cores_no_cache_DualChannelDDR4_2400_arm_boot_test_to-tick-ALL-x86_64-opt on my machine? (I realized that what I run above was problably the previous one) |
The smallest unit of test we can run is by SuiteUID, which you can run by using |
@mkjost0 Thanks. I tried that but still, "works for me". I'm not sure what else to try locally, so let me just force-push one commit at time, starting with no-change commit, to see what happens. |
d9ca5f2
to
1576435
Compare
OK, so it looks like commit 7e64e7a is causing the hangup. In theory that change may cause infinite loop (and therefore CI timeout) for RISC-V SE workloads if that workload depends on (incorrect) behavior of PC being increased before reporting trap. However:
So, I do not understand that's going on here and out of ideas how to debug it. |
Ah! It is not ARM test that hangs, it is indeed RISC-V test that hangs - only the CI output is truncated! Now I can debug it. Note to myself: this is what fails:
|
Maybe we should make this PR be just the power change. I wonder if the gdb issue on RISC-V may be a different problem/solultion. |
inst->advancePC(pc_state); | ||
tc->pcState(pc_state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think move the code section to SyscallFault::invokeSE(ThreadContext *tc, const StaticInstPtr &inst)
will pass to test CI
7e64e7a
to
b191d89
Compare
@rogerchang23424 Thanks, this is exactly what I did. |
This commit moves all smalltalk sources to `src` subdirectory. This is needed in order to use (shared) smalltalk-makefiles, see discussion in PR 166 [1]. Moreover, this is how it is done in other packages (ArchC, Tinyrossa and so on). [1]: gem5/gem5#166
Due to inverted logic in POWER fault handlers, unimplemented opcode and trap faults did not report trap to GDB (if connected). This commit fixes the problem. While at it, I opted to use `if (! ...) { panic(...) }` rather than `panic_if(...)`. I find it easier to understand in this case. Change-Id: I6cd5dfd5f6546b8541d685e877afef21540d6824
On RISC-V when trap occurs the contents of PC register contains the address of instruction that caused that trap (as opposed to the address of instruction following it in instruction stream). Therefore this commit does not advance the PC before reporting trap in SE mode. Change-Id: I83f3766cff276312cefcf1b4ac6e78a6569846b9
This commit add code to report illegal instruction and breakpoint traps to GDB (if connected). This merely follows what POWER does.
b191d89
to
3564348
Compare
OK, I did what @rogerchang23424 suggested and now all checks pass. I think this is ready for review now. |
Wait, what?
What does this have to do with janvrany/MachineArithmetic@81b31f1 ?? |
Ah, sorry! Indeed this is completely unrelated, I just accidentally pasted wrong URL into commit message of MA. Fixed now. |
This addresses #123