Re: [Qemu-devel] [PATCHv4 3/6] RISC-V: Check for the effective memory privilege mode during PMP checks

2019-06-27 Thread Richard Henderson
On 6/27/19 2:18 PM, Hesham Almatary wrote: > @@ -392,19 +392,27 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, > int size, > int prot; > bool pmp_violation = false; > int ret = TRANSLATE_FAIL; > +int mode = mmu_idx; > > qemu_log_mask(CPU_LOG_MMU, "%s ad %" VADDR_P

[Qemu-devel] [PATCHv4 3/6] RISC-V: Check for the effective memory privilege mode during PMP checks

2019-06-27 Thread Hesham Almatary
The current PMP check function checks for env->priv which is not the effective memory privilege mode. For example, mstatus.MPRV could be set while executing in M-Mode, and in that case the privilege mode for the PMP check should be S-Mode rather than M-Mode (in env->priv) if mstatus.MPP == PRV_S.

Re: [Qemu-devel] [PATCHv4 3/6] RISC-V: Check for the effective memory privilege mode during PMP checks

2019-06-05 Thread Alistair Francis
On Thu, May 30, 2019 at 6:52 AM Hesham Almatary wrote: > > The current PMP check function checks for env->priv which is not the effective > memory privilege mode. > > For example, mstatus.MPRV could be set while executing in M-Mode, and in that > case the privilege mode for the PMP check should be

[Qemu-devel] [PATCHv4 3/6] RISC-V: Check for the effective memory privilege mode during PMP checks

2019-05-30 Thread Hesham Almatary
The current PMP check function checks for env->priv which is not the effective memory privilege mode. For example, mstatus.MPRV could be set while executing in M-Mode, and in that case the privilege mode for the PMP check should be S-Mode rather than M-Mode (in env->priv) if mstatus.MPP == PRV_S.