Shadow stack instructions can be decoded as zimop / zcmop or shadow stack
instructions depending on whether shadow stack are enabled at current
privilege. This requires a TB flag so that correct TB generation and correct
TB lookup happens. `DisasContext` gets a field indicating whether bcfi is
enabled or not.
This patch also implements helper bcfi function which determines if bcfi
is enabled at current privilege or not. qemu-user also gets field
`ubcfien` indicating whether qemu user has shadow stack enabled or not.
Signed-off-by: Deepak Gupta<debug@rivosinc.com>
Co-developed-by: Jim Shu<jim.shu@sifive.com>
Co-developed-by: Andy Chiu<andy.chiu@sifive.com>
---
target/riscv/cpu.c | 2 ++
target/riscv/cpu.h | 4 ++++
target/riscv/cpu_helper.c | 30 ++++++++++++++++++++++++++++++
target/riscv/translate.c | 4 ++++
4 files changed, 40 insertions(+)