Skip to content

[Bug Report] Incorrect exception type of PMP violation during address translation #605

Open
@Phantom1003

Description

@Phantom1003

Type of issue: bug report
Impact: unknown
Development Phase: proposal
Other information

Our co-simulation framework found that the exception type of address translation PMP violation is incorrect.

In the following test case, we let a non-leaf (level 2) PTE out of the PMP range.
Next, we will perform a store operation with a special virtual address, during translation processor will try to access the PTE that does not match any PMP.
boom throws a store page fault(0xf), while spike throws a store access fault(0x7).

[boom]  3 0x0000000080000364 (0x0105051b) x10 0x0000000040201010
[boom]  3 0x0000000080000368 (0x02a00593) x11 0x000000000000002a
[spike] core   0: 0x0000000080000364 (0x0105051b) addiw   a0, a0, 16
[spike] core   0: 0x0000000080000368 (0x02a00593) li      a1, 42
[boom]  3 0x0000000080000004 (0x34302f73) x30 0x0000000040201010
[spike] core   0: 0x000000008000036c (0x00b52023) sw      a1, 0(a0)
[spike] core   0: exception trap_store_access_fault, epc 0x000000008000036c
[spike] core   0:           tval 0x0000000040201010
[spike] core   0: 0x0000000080000004 (0x34302f73) csrr    t5, mtval
[boom]  3 0x0000000080000008 (0x34202f73) x30 0x000000000000000f
[spike] core   0: 0x0000000080000008 (0x34202f73) csrr    t5, mcause
[error] WDATA SIM 0000000000000007, DUT 000000000000000f
[error] check board clear 30 error
[CJ]           0 integer register Judge Failed

According to riscv-privileged specification:

If accessing pte violates a PMA or PMP check, raise an access-fault exception corresponding to the original access type.

Hence, boom should throw a store access fault.

Please tell us about your environment:
- version: ad64c54

boom-1.zip

@ProjectDimlight helps reproduce the problem

cc to @jerryz123

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions