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
[Bug Report] Wrong exception priority during access memory #971
Comments
|
I believe this is a duplicate of #538 |
|
Yes, but the priority of the misaligned exception is also wrong, which is outside of the load_slow_path function. |
|
@timsifive perhaps this is of interest to you, since you're doing some trigger work now. |
|
I agree that this is wrong, and a (exceptionally clearly described) problem. It's been a long time since I added that trigger code. I'm not sure how to raise the trigger priority while minimizing the performance impact. I might have time to look at this in a few weeks, when I'm back from vacation. |
With this change, #971 is resolved for loads.
Fixes the other half of #971. Compared the start of this set of changes, it now takes 11% longer to run the towers benchmark (with 22 discs).
With this change, #971 is resolved for loads.
Fixes the other half of #971. Compared the start of this set of changes, it now takes 11% longer to run the towers benchmark (with 22 discs).
When the slow path occurs, don't check for alignment in load_fast(). I haven't tested unaligned accesses, nor different endianness. With this change, #971 is resolved for loads.
Fixes the other half of #971. Compared the start of this set of changes, it now takes 11% longer to run the towers benchmark (with 22 discs).
When the slow path occurs, don't check for alignment in load_fast(). I haven't tested different endianness. With this change, #971 is resolved for loads.
Fixes the other half of #971. Compared the start of this set of changes, it now takes 11% longer to run the towers benchmark (with 22 discs).
|
@Phantom1003 can you confirm if #1105 fixed this for you? |
|
Yes, the breakpoint can now be triggered successfully. |
This commit fixes the following two issues on AMO triggers: 1. The address trigger has a higher priority than the misaligned fault and page fault. [riscv-software-src#971] 2. AMO can fire on a chain with a load-only trigger and a store-only trigger. [riscv/riscv-debug-spec#780] This commit does NOT fix the priority for data trigger on AMO.
This commit fixes the following two issues for address trigger on AMO: 1. The address trigger has a higher priority than the misaligned fault and page fault. [riscv-software-src#971] [riscv-software-src#1105] 2. AMO can fire on a chain with a load-only trigger and a store-only trigger. [riscv/riscv-debug-spec#780]
Let's take the load instruction as an example:
riscv-isa-sim/riscv/mmu.h
Lines 99 to 125 in 0f15aa0
At line 101, load will first check if it is aligned, then at line 122 it will try to access the address in the load_slow_path function.
riscv-isa-sim/riscv/mmu.cc
Lines 142 to 162 in 0f15aa0
In load_slow_path, it will first check if it is legal address at line 153, and the watch point will be checked at the end of the function.
Briefly, the order of priority is as follows: trap_load_address_misaligned > trap_load_access_fault > trap_breakpoint
However, in the specification, trap_breakpoint has a higher priority than the others:

We also co-simulate with rocket to check this point, rocket threw a breakpoint exception, while spike threw an error misaligned exception.
The test point is at 0x800001c0 where loading a misaligned illegal address 0x100004001:
spike-0.zip
The text was updated successfully, but these errors were encountered: