aboutsummaryrefslogtreecommitdiff
path: root/util/oslib-posix.c
diff options
context:
space:
mode:
authorDeepak Gupta <debug@rivosinc.com>2024-10-08 15:50:03 -0700
committerAlistair Francis <alistair.francis@wdc.com>2024-10-30 11:22:08 +1000
commit669b4867495c48cfb302c6500de99f79d38802b6 (patch)
treeb19b62dcde4ee8b914244075aff35e33d958fc04 /util/oslib-posix.c
parentf9fdf9077c2a6d7d2bfc5ccfcd961f60d311218d (diff)
downloadqemu-669b4867495c48cfb302c6500de99f79d38802b6.zip
qemu-669b4867495c48cfb302c6500de99f79d38802b6.tar.gz
qemu-669b4867495c48cfb302c6500de99f79d38802b6.tar.bz2
target/riscv: mmu changes for zicfiss shadow stack protection
zicfiss protects shadow stack using new page table encodings PTE.W=1, PTE.R=0 and PTE.X=0. This encoding is reserved if zicfiss is not implemented or if shadow stack are not enabled. Loads on shadow stack memory are allowed while stores to shadow stack memory leads to access faults. Shadow stack accesses to RO memory leads to store page fault. To implement special nature of shadow stack memory where only selected stores (shadow stack stores from sspush) have to be allowed while rest of regular stores disallowed, new MMU TLB index is created for shadow stack. Furthermore, `check_zicbom_access` (`cbo.clean/flush/inval`) may probe shadow stack memory and must always raise store/AMO access fault because it has store semantics. For non-shadow stack memory even though `cbo.clean/flush/inval` have store semantics, it will not fault if read is allowed (probably to follow `clflush` on x86). Although if read is not allowed, eventually `probe_write` will do store page (or access) fault (if permissions don't allow it). cbo operations on shadow stack memory must always raise store access fault. Thus extending `get_physical_address` to recieve `probe` parameter as well. Signed-off-by: Deepak Gupta <debug@rivosinc.com> Suggested-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20241008225010.1861630-14-debug@rivosinc.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'util/oslib-posix.c')
0 files changed, 0 insertions, 0 deletions