Skip to content

Zalrsc (sc.w/d) checking reservation before checking pmp permission. #1239

@sudo-apt-abdullah

Description

@sudo-apt-abdullah

A region with no permission (XWR-000) from 0x80002000 to 0x80002040 is there and we're trying to lr.w from start of the region.

[233] [M]: 0x800004A0 (0x1007A62F) lr.w x12, (x15)
trapping from M to M to handle load-access-fault
handling exc#0x05 at priv M with tval 0x80002000
CSR mstatus (0x300) <- 0x00001800
CSR mstatush (0x310) <- 0x00000000
CSR mcause (0x342) <- 0x00000005
CSR mtval (0x343) <- 0x80002000
CSR mepc (0x341) <- 0x800004A0 

Since, there's no permission read permission, it throws access-fault and when we're trying to sc.w at the same address, with no write permission it's checking reservation first and since no load occur at that address, it simply putting 1 in rd. But it should check the pmp permission first and throw access-fault.

[345] [M]: 0x800004AC (0x18C7A62F) sc.w x12, x12, (x15)
x12 <- 0x00000001

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions