qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v12 01/20] target/riscv: expose *envcfg csr and priv to qemu-


From: Richard Henderson
Subject: Re: [PATCH v12 01/20] target/riscv: expose *envcfg csr and priv to qemu-user as well
Date: Fri, 30 Aug 2024 12:10:29 +1000
User-agent: Mozilla Thunderbird

On 8/30/24 09:34, Deepak Gupta wrote:
Execution environment config CSR controlling user env and current
privilege state shouldn't be limited to qemu-system only. *envcfg
CSRs control enabling of features in next lesser mode. In some cases
bits *envcfg CSR can be lit up by kernel as part of kernel policy or
software (user app) can choose to opt-in by issuing a system call
(e.g. prctl). In case of qemu-user, it should be no different because
qemu is providing underlying execution environment facility and thus
either should provide some default value in *envcfg CSRs or react to
system calls (prctls) initiated from application. priv is set to PRV_U
and menvcfg/senvcfg set to 0 for qemu-user on reest.

`henvcfg` has been left for qemu-system only because it is not expected
that someone will use qemu-user where application is expected to have
hypervisor underneath which is controlling its execution environment. If
such a need arises then `henvcfg` could be exposed as well.

Relevant discussion:
https://lore.kernel.org/all/ CAKmqyKOTVWPFep2msTQVdUmJErkH+bqCcKEQ4hAnyDFPdWKe0Q@mail.gmail.com/

Signed-off-by: Deepak Gupta<debug@rivosinc.com>
Suggested-by: Richard Henderson<richard.henderson@linaro.org>
Reviewed-by: Alistair Francis<alistair.francis@wdc.com>
---
  target/riscv/cpu.c | 5 +++++
  target/riscv/cpu.h | 9 +++++----
  2 files changed, 10 insertions(+), 4 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]